# HG changeset patch # User jake # Date 1273659771 -10800 # Node ID 45cc9ca502a97ef82ba637e3e37081fc53b5799b # Parent 899e4666ea9a07f649c0cb122b2f2f2e05ed08f4# Parent e01a28ecba3f20cdd6b2cebe67fb9921b8ed9ff1 Merge bug fix diff -r e01a28ecba3f -r 45cc9ca502a9 homescreen_plat/hs_content_control_ui/inc/hscontentcontrolui.h --- a/homescreen_plat/hs_content_control_ui/inc/hscontentcontrolui.h Mon Mar 22 15:12:36 2010 +0200 +++ b/homescreen_plat/hs_content_control_ui/inc/hscontentcontrolui.h Wed May 12 13:22:51 2010 +0300 @@ -24,6 +24,7 @@ // Forward declarations class MHsContentController; +class CAknView; /** * Content control UI interface @@ -47,6 +48,16 @@ /** * */ + virtual void DeActivate() = 0; + + /** + * + */ + virtual void Views( RPointerArray& aViews ) = 0; + + /** + * + */ virtual void NotifyWidgetListChanged() = 0; /** @@ -100,6 +111,16 @@ /** * */ + inline void DeActivate(); + + /** + * + */ + inline void Views( RPointerArray& aViews ); + + /** + * + */ inline void NotifyWidgetListChanged(); /** @@ -173,6 +194,15 @@ { // Default implementation of MHsContentControlUi method } +inline void CHsContentControlUi::DeActivate() + { + // Default implementation of MHsContentControlUi method + } +inline void CHsContentControlUi::Views( + RPointerArray& /*aViews*/ ) + { + // Default implementation of MHsContentControlUi method + } inline void CHsContentControlUi::NotifyWidgetListChanged() { // Default implementation of MHsContentControlUi method diff -r e01a28ecba3f -r 45cc9ca502a9 homescreen_plat/hs_renderingplugin_api/group/bld.inf --- a/homescreen_plat/hs_renderingplugin_api/group/bld.inf Mon Mar 22 15:12:36 2010 +0200 +++ b/homescreen_plat/hs_renderingplugin_api/group/bld.inf Wed May 12 13:22:51 2010 +0300 @@ -22,3 +22,4 @@ PRJ_EXPORTS ../inc/xnextrenderingpluginadapter.h APP_LAYER_PLATFORM_EXPORT_PATH(xnextrenderingpluginadapter.h) +../inc/xnexteventhandler.h APP_LAYER_PLATFORM_EXPORT_PATH(xnexteventhandler.h) diff -r e01a28ecba3f -r 45cc9ca502a9 homescreen_plat/hs_renderingplugin_api/hs_renderingplugin_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/hs_renderingplugin_api/hs_renderingplugin_api.metaxml Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,15 @@ + + + HS Rendering Plug-in API + API allows the widget developer to create his own rendering plugin, which can be taken into use in widget declaration. + c++ + idlehomescreen + + + + + + no + no + + diff -r e01a28ecba3f -r 45cc9ca502a9 homescreen_plat/hs_renderingplugin_api/inc/xnexteventhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/hs_renderingplugin_api/inc/xnexteventhandler.h Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms 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 XNEXTEVENTHANDLER_H +#define XNEXTEVENTHANDLER_H + +// System includes +#include + +/** + * External event hadler interface for routing events from external + * rendering plug-ins to content plug-ins + * + * @since S60 v5.2 + */ +class MXnExtEventHandler + { +public: + /** + * Routes the events from the external rendering plug-ins to content plug-ins + * @since Series 60 5.2 + * @param aEvent Event string + * @param aDestination Destination content plug-in. + */ + virtual void HandleEventL( const TDesC& aEvent, const TDesC8& aDestination ) = 0; + }; + +#endif //XNEXTEVENTHANDLER_H diff -r e01a28ecba3f -r 45cc9ca502a9 homescreen_plat/hs_renderingplugin_api/inc/xnextrenderingpluginadapter.h --- a/homescreen_plat/hs_renderingplugin_api/inc/xnextrenderingpluginadapter.h Mon Mar 22 15:12:36 2010 +0200 +++ b/homescreen_plat/hs_renderingplugin_api/inc/xnextrenderingpluginadapter.h Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: External rendering plugin adapter header +* Description: External rendering plugin adapter * */ @@ -25,8 +25,15 @@ // User includes +class MXnExtEventHandler; + /** - * CXnExtRenderingPluginAdapter class + * Base class for the external rendering plug-ins. Widget developer + * can implement own rendering plug-in if stock plug-ins do not + * provide sufficient functionality. Baddly written plug-in can + * ruin the Homescreen performance as it runs in the Homescreen + * process. Power save mode must be obeyed in order to maximize + * the standby times of the device. * * * @code @@ -34,63 +41,92 @@ * @endcode * * @lib extrenderingplugin.lib - * @since S60 v5.0 + * @since S60 v5.2 */ class CXnExtRenderingPluginAdapter : public CCoeControl { public: // Constructor and destructor /** * Two-phased constructor. + * + * @since Series 60 5.2 */ IMPORT_C static CXnExtRenderingPluginAdapter* NewL( TUid aImplUid ); /** * Destructor. + * + * @since Series 60 5.2 */ IMPORT_C virtual ~CXnExtRenderingPluginAdapter(); -private: // Constructors - /** - * Constructor - */ - // CXnExtRenderingPluginAdapter(); - - /** - * Second phase constructor - */ - // void ConstructL(); - public: // New functions, /** - * Returns the implementation uid. + * Returns the ECOM implementation uid. + * + * @since Series 60 5.2 */ IMPORT_C TUid ImplUid() const; /** - * Enters power save mode. + * Is called when Homescreen enters power save mode. + * In power save mode all the timers, outstanding requests and animations + * must be cancelled in order to save battery. + * + * @since Series 60 5.2 */ IMPORT_C virtual void EnterPowerSaveModeL(); /** - * Exits power save mode. + * Is called when Homescreen exists power save mode. + * + * @since Series 60 5.2 */ IMPORT_C virtual void ExitPowerSaveModeL(); /** - * Informs skin change. + * Informs skin change. If plug-in is responsible of loading skin + * graphics, all the graphics must be reloaded. + * + * @since Series 60 5.2 */ IMPORT_C virtual void SkinChanged(); /** - * Informs focuschange. + * Informs that plug-in element has gained a focus and highlight must be + * drawn if appropriate. + * + * @since Series 60 5.2 + * @param aDrawNow whether plug-in should draw itself. */ IMPORT_C virtual void FocusChanged( TDrawNow aDrawNow ); /** - * Informs size change. + * Informs that plug-in element size has changed. Size can change if the + * plug-in element is declared relatively to parent element. + * + * @since Series 60 5.2 */ IMPORT_C virtual void SizeChanged(); + + /** + * Sets the external event handler interface. + * + * @since Series 60 5.2 + * @param aEventHandler Event handler interface. + */ + IMPORT_C virtual void SetEventHandler( MXnExtEventHandler* aEventHandler ); + + /** + * Routes the data stream for the external rendering plugin. + * + * @since Series 60 5.2 + * @param aData Data stream. + * @param aType Type of the stream. + * @param aIndex Index of the data. + */ + IMPORT_C virtual void SetDataL( const TDesC8& aData, const TDesC& aType, TInt aIndex ); private: // Data diff -r e01a28ecba3f -r 45cc9ca502a9 homescreen_plat/menu_settings_api/menu_settings_api.metaxml --- a/homescreen_plat/menu_settings_api/menu_settings_api.metaxml Mon Mar 22 15:12:36 2010 +0200 +++ b/homescreen_plat/menu_settings_api/menu_settings_api.metaxml Wed May 12 13:22:51 2010 +0300 @@ -1,7 +1,7 @@ Menu Settings API - Provides infromation about Menu current state. + Provides infromation about the current state of Menu application. c++ menufw diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ - + qhd_tch @@ -25,7 +25,7 @@ desktopconfiguration.dtd - 2 + unlimited &qtn_desktop_configuration_desc; skin(270501603 9361):mif(icon.mif 16384 16385) diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/widgetconfiguration.xml --- a/idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/widgetconfiguration.xml Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/widgetconfiguration.xml Wed May 12 13:22:51 2010 +0300 @@ -8,12 +8,12 @@ - + - - + + - + @@ -22,10 +22,10 @@ - + - + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/desktop_20026f4f/loc/desktopconfiguration.loc --- a/idlehomescreen/data/qhd_tch/desktop_20026f4f/loc/desktopconfiguration.loc Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/loc/desktopconfiguration.loc Wed May 12 13:22:51 2010 +0300 @@ -22,7 +22,7 @@ #define qtn_desktop_configuration_name "Shortcuts" // d: Shortcut widget description -// l: listrow_wgtman_pane_t2 +// l: wgtman_list_pane_t1 // w: // r: TB9.2 #define qtn_desktop_configuration_desc "Quick access to your favorite applications from Home Screen." diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/empty_2001f47f/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/empty_2001f47f/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/empty_2001f47f/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,6 +1,6 @@ - + @@ -57,4 +57,4 @@ - \ No newline at end of file + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/group/bld.inf --- a/idlehomescreen/data/qhd_tch/group/bld.inf Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/group/bld.inf Wed May 12 13:22:51 2010 +0300 @@ -25,6 +25,8 @@ #include "../posterwideimage_2001fdbc/group/bld.inf" #include "../profile_2001cb7c/group/bld.inf" #include "../view_2001f48b/group/bld.inf" +#include "../view_200286e4/group/bld.inf" +#include "../view_200286e5/group/bld.inf" #include "../templateview_20026f50/group/bld.inf" #include "../root_2001f482/group/bld.inf" diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/onerow_2001f480/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/onerow_2001f480/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,18 +1,18 @@ - + - qhd_tch + qhd_tch - template + template - + 0x2001f48a @@ -60,4 +60,4 @@ - \ No newline at end of file + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/37/onerow.css --- a/idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/37/onerow.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/37/onerow.css Wed May 12 13:22:51 2010 +0300 @@ -21,6 +21,7 @@ padding-left:8px; padding-right:8px; font-line-space: 15; + direction: ltr; text-align: right; text-overflow-mode: wrap; max-line-amount: 2; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/50/onerow.css --- a/idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/50/onerow.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/50/onerow.css Wed May 12 13:22:51 2010 +0300 @@ -21,6 +21,7 @@ padding-left:8px; padding-right:8px; font-line-space: 15; + direction: ltr; text-align: right; text-overflow-mode: wrap; max-line-amount: 2; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/57/onerow.css --- a/idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/57/onerow.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/57/onerow.css Wed May 12 13:22:51 2010 +0300 @@ -21,6 +21,7 @@ padding-left:8px; padding-right:8px; font-line-space: 15; + direction: ltr; text-align: right; text-overflow-mode: wrap; max-line-amount: 2; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/94/onerow.css --- a/idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/94/onerow.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/94/onerow.css Wed May 12 13:22:51 2010 +0300 @@ -21,6 +21,7 @@ padding-left:8px; padding-right:8px; font-line-space: 15; + direction: ltr; text-align: right; text-overflow-mode: wrap; max-line-amount: 2; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,18 +1,18 @@ - + - qhd_tch + qhd_tch - template + template - + 0x2001f48a @@ -58,4 +58,4 @@ - \ No newline at end of file + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/profile_2001cb7c/group/bld.inf --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/group/bld.inf Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/group/bld.inf Wed May 12 13:22:51 2010 +0300 @@ -23,8 +23,7 @@ //******************************************************** ../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 +../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 @@ -45,8 +44,7 @@ //***************************** // 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) +../loc/profileconfiguration.loc APP_LAYER_LOC_EXPORT_PATH(profileconfiguration.loc) // Support for S60 builds //*********************** @@ -61,6 +59,7 @@ START EXTENSION tools/dtd OPTION SWITCH_LOC_FILE_NAME profile_2001cb7c OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes END diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,6 +1,6 @@ - + qhd_tch widget @@ -14,22 +14,17 @@ 0x2001cb7c - - - - profilename waits loc profile 1.0 + + &qtn_profile_configuration_desc; + widgetconfiguration.xml - - profiledesc waits localization from platform skin(270501603 9360):mif(icon.mif 16384 16385) @@ -37,4 +32,4 @@ profile.o0000 - \ No newline at end of file + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/widgetconfiguration.xml --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/widgetconfiguration.xml Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/widgetconfiguration.xml Wed May 12 13:22:51 2010 +0300 @@ -1,9 +1,5 @@ - - - - - + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/profile_2001cb7c/loc/profileconfiguration.loc --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/loc/profileconfiguration.loc Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/loc/profileconfiguration.loc Wed May 12 13:22:51 2010 +0300 @@ -23,7 +23,7 @@ #define qtn_profile_configuration_name "Time & profile" // d: profile widget description -// l: listrow_wgtman_pane_t2 +// l: wgtman_list_pane_t1 // w: // r: TB9.2 #define qtn_profile_configuration_desc "Quick access to time, date and change profile." \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/profile_2001cb7c/rom/profilewidget_customer.iby --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/rom/profilewidget_customer.iby Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/rom/profilewidget_customer.iby Wed May 12 13:22:51 2010 +0300 @@ -23,6 +23,7 @@ // Enabled by DTD-localization tools, language specific data=ZPRIVATE\200159c0\install\profile_2001cb7c\xuikon\00\profile.o0000 \private\200159c0\install\profile_2001cb7c\xuikon\00\profile.o0000 +data=ZPRIVATE\200159c0\install\profile_2001cb7c\hsps\00\profileconfiguration.dtd \private\200159c0\install\profile_2001cb7c\hsps\00\profileconfiguration.dtd #endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/profile_2001cb7c/rom/profilewidget_resources.iby --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/rom/profilewidget_resources.iby Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/rom/profilewidget_resources.iby Wed May 12 13:22:51 2010 +0300 @@ -23,6 +23,7 @@ data=ZPRIVATE\200159c0\install\profile_2001cb7c\xuikon\00\profile.o0000 \private\200159c0\install\profile_2001cb7c\xuikon\00\profile.o0000 data=ZPRIVATE\200159c0\install\profile_2001cb7c\hsps\00\icon.mif \private\200159c0\install\profile_2001cb7c\hsps\00\icon.mif +data=ZPRIVATE\200159c0\install\profile_2001cb7c\hsps\00\profileconfiguration.dtd \private\200159c0\install\profile_2001cb7c\hsps\00\profileconfiguration.dtd #endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.css --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.css Wed May 12 13:22:51 2010 +0300 @@ -1,9 +1,5 @@ widget#profilewidget { - padding-top: 3px; - padding-left: 3px; - padding-right: 3px; - padding-bottom: 3px; background-color: none; } @@ -23,13 +19,13 @@ _s60-ampm-font-size: 16px; _s60-digital-font-size: 56px; color: "SKIN(268458534 13056 74)"; - background-color: "SKIN(268458534 9886)"; + background-color: "SKIN(268458534 9916)"; nav-index: appearance; } box.clock_profile { - background-color: "SKIN(268458534 9886)"; + background-color: "SKIN(268458534 9916)"; nav-index: appearance; } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.xml --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.xml Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.xml Wed May 12 13:22:51 2010 +0300 @@ -106,20 +106,20 @@ - + <title id="title_sat" titleindex="0"> + <property class="SAT/SatIdleModeText"/> + <property class="policy/emptyContent" name="title_sat" value="display: none;" /> + <property class="policy/Content" name="title_sat" value="display: block;" /> + <property class="policy/Visibility" name="NT_SATVHZ" value="if (title_vhz,title_sat,SatIdleModeIcon) display:block" /> + <property class="policy/Visibility" name="NT_SATVHZ" value="if !+(title_vhz,title_sat,SatIdleModeIcon) display:none" /> + + <property class="DeviceStatus/VHZText"/> <property class="policy/emptyContent" name="title_vhz" value="display: none;" /> <property class="policy/Content" name="title_vhz" value="display: block;" /> <property class="policy/Visibility" name="NT_SATVHZ" value="if (title_vhz,title_sat,SatIdleModeIcon) display:block" /> <property class="policy/Visibility" name="NT_SATVHZ" value="if !+(title_vhz,title_sat,SatIdleModeIcon) display:none" /> - - <property class="SAT/SatIdleModeText"/> - <property class="policy/emptyContent" name="title_sat" value="display: none;" /> - <property class="policy/Content" name="title_sat" value="display: block;" /> - <property class="policy/Visibility" name="NT_SATVHZ" value="if (title_vhz,title_sat,SatIdleModeIcon) display:block" /> - <property class="policy/Visibility" name="NT_SATVHZ" value="if !+(title_vhz,title_sat,SatIdleModeIcon) display:none" /> - diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/37/profile.css --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/37/profile.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/37/profile.css Wed May 12 13:22:51 2010 +0300 @@ -1,9 +1,5 @@ widget#profilewidget { - padding-top: 3px; - padding-left: 3px; - padding-right: 3px; - padding-bottom: 3px; background-color: none; } @@ -23,13 +19,14 @@ _s60-ampm-font-size: 16px; _s60-digital-font-size: 56px; color: "SKIN(268458534 13056 74)"; - background-color: "SKIN(268458534 9886)"; + background-color: "SKIN(268458534 9916)"; nav-index: appearance; } box.clock_profile { - background-color: "SKIN(268458534 9886)"; + background-color: "SKIN(268458534 9916)"; + nav-index: appearance; } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/50/profile.css --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/50/profile.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/50/profile.css Wed May 12 13:22:51 2010 +0300 @@ -1,9 +1,5 @@ widget#profilewidget { - padding-top: 3px; - padding-left: 3px; - padding-right: 3px; - padding-bottom: 3px; background-color: none; } @@ -23,13 +19,14 @@ _s60-ampm-font-size: 16px; _s60-digital-font-size: 56px; color: "SKIN(268458534 13056 74)"; - background-color: "SKIN(268458534 9886)"; + background-color: "SKIN(268458534 9916)"; nav-index: appearance; } box.clock_profile { - background-color: "SKIN(268458534 9886)"; + background-color: "SKIN(268458534 9916)"; + nav-index: appearance; } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/57/profile.css --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/57/profile.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/57/profile.css Wed May 12 13:22:51 2010 +0300 @@ -1,9 +1,5 @@ widget#profilewidget { - padding-top: 3px; - padding-left: 3px; - padding-right: 3px; - padding-bottom: 3px; background-color: none; } @@ -23,13 +19,14 @@ _s60-ampm-font-size: 16px; _s60-digital-font-size: 56px; color: "SKIN(268458534 13056 74)"; - background-color: "SKIN(268458534 9886)"; + background-color: "SKIN(268458534 9916)"; nav-index: appearance; } box.clock_profile { - background-color: "SKIN(268458534 9886)"; + background-color: "SKIN(268458534 9916)"; + nav-index: appearance; } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/94/profile.css --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/94/profile.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/94/profile.css Wed May 12 13:22:51 2010 +0300 @@ -1,9 +1,5 @@ widget#profilewidget { - padding-top: 3px; - padding-left: 3px; - padding-right: 3px; - padding-bottom: 3px; background-color: none; } @@ -23,13 +19,14 @@ _s60-ampm-font-size: 16px; _s60-digital-font-size: 56px; color: "SKIN(268458534 13056 74)"; - background-color: "SKIN(268458534 9886)"; + background-color: "SKIN(268458534 9916)"; nav-index: appearance; } box.clock_profile { - background-color: "SKIN(268458534 9886)"; + background-color: "SKIN(268458534 9916)"; + nav-index: appearance; } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/root_2001f482/conf/root2001f482.confml Binary file idlehomescreen/data/qhd_tch/root_2001f482/conf/root2001f482.confml has changed diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/root_2001f482/conf/root2001f482.gcfml --- a/idlehomescreen/data/qhd_tch/root_2001f482/conf/root2001f482.gcfml Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/conf/root2001f482.gcfml Wed May 12 13:22:51 2010 +0300 @@ -1,3 +1,5 @@ + + @@ -14,36 +16,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -53,3 +25,4 @@ + \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/root_2001f482/group/bld.inf --- a/idlehomescreen/data/qhd_tch/root_2001f482/group/bld.inf Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/group/bld.inf Wed May 12 13:22:51 2010 +0300 @@ -25,7 +25,6 @@ // Support for productization and Carbide.Ui customization //******************************************************** ../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/root_2001f482/hsps/manifest.dat -../hsps/00/rootconfiguration.xml /epoc32/data/Z/resource/homescreen/root_2001f482/hsps/rootconfiguration.xml ../xuikon/00/Root.dat /epoc32/data/Z/resource/homescreen/root_2001f482/xuikon/root_2001f482.dat ../xuikon/00/Root.css /epoc32/data/Z/resource/homescreen/root_2001f482/xuikon/root.css ../xuikon/00/Root.xml /epoc32/data/Z/resource/homescreen/root_2001f482/xuikon/root.xml @@ -35,8 +34,8 @@ //Confml and cfgml files for the customization // starting use confml it is need to remove root_configuration.xml direct exporting (root_2001f482_variant.iby) //*********************************** -//../conf/root2001f482.confml APP_LAYER_CONFML(root2001f482.confml) -//../conf/root2001f482.gcfml APP_LAYER_GCFML(root2001f482.gcfml) +../conf/root2001f482.confml APP_LAYER_CONFML(root2001f482.confml) +../conf/root2001f482.gcfml APP_LAYER_GCFML(root2001f482.gcfml) // Support for S60 localization //***************************** @@ -44,9 +43,6 @@ // Support for S60 builds //*********************** -../rom/root_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(root_2001f482_resources.iby) -../rom/root_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(root_2001f482_customer.iby) -../rom/root_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(root_2001f482_variant.iby) ../rom/root.iby CORE_APP_LAYER_IBY_EXPORT_PATH(root_2001f482.iby) diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/root_2001f482/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/root_2001f482/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,11 +1,11 @@ - + - qhd_tch + qhd_tch - application + application - + 0x102750F0 @@ -30,4 +30,4 @@ - \ No newline at end of file + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/root_2001f482/hsps/00/rootconfiguration.xml --- a/idlehomescreen/data/qhd_tch/root_2001f482/hsps/00/rootconfiguration.xml Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/hsps/00/rootconfiguration.xml Wed May 12 13:22:51 2010 +0300 @@ -1,14 +1,12 @@ - - - - - - - - - - - - - + + + + + + + + + + + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/root_2001f482/rom/root_customer.iby --- a/idlehomescreen/data/qhd_tch/root_2001f482/rom/root_customer.iby Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Root widget HSPS-plugin language specific IBY file. -* -*/ - -#ifndef __ROOT_2001F482_CUSTOMER_IBY__ -#define __ROOT_2001F482_CUSTOMER_IBY__ - -#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) - -// Enabled by DTD-localization tools, language specific -data=ZPRIVATE\200159c0\install\root_2001f482\hsps\00\rootconfiguration.dtd \private\200159c0\install\root_2001f482\hsps\00\rootconfiguration.dtd - -#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH - -#endif // __ROOT_2001F482_CUSTOMER_IBY__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/root_2001f482/rom/root_resources.iby --- a/idlehomescreen/data/qhd_tch/root_2001f482/rom/root_resources.iby Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Root widget HSPS-plugin language specific IBY file. -* -*/ - -#ifndef __ROOT_2001F482_RESOURCES_IBY__ -#define __ROOT_2001F482_RESOURCES_IBY__ - -#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) - -// Enabled by DTD-localization tools, language specific - -#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH - -#endif // __ROOT_2001F482_RESOURCES_IBY__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/root_2001f482/rom/root_variant.iby --- a/idlehomescreen/data/qhd_tch/root_2001f482/rom/root_variant.iby Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Root widget HSPS-plugin variant specific IBY file. -* -*/ - -#ifndef __ROOT_2001F482_VARIANT_IBY__ -#define __ROOT_2001F482_VARIANT_IBY__ - -#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) - -// Enabled by variation tools, variant specific -data=ZPRIVATE\200159c0\install\root_2001f482\hsps\00\rootconfiguration.xml \private\200159c0\install\root_2001f482\hsps\00\rootconfiguration.xml - -#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH - -#endif // __ROOT_2001F482_VARIANT_IBY__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/templateview_20026f50/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,8 +1,8 @@ - + - qhd_tch - view + qhd_tch + view 0x2001f48a @@ -28,4 +28,4 @@ templateview.o0000 - \ No newline at end of file + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/templateview_20026f50/hsps/00/templateviewconfiguration.xml --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/hsps/00/templateviewconfiguration.xml Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/hsps/00/templateviewconfiguration.xml Wed May 12 13:22:51 2010 +0300 @@ -1,22 +1,23 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.css --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.css Wed May 12 13:22:51 2010 +0300 @@ -11,7 +11,7 @@ box#plugins_container { direction: ltr; - block-progression: tb; + block-progression: rl; padding-top: 3px; } @@ -29,11 +29,6 @@ nav-index: appearance; } -plugin:edit -{ - background-color:"SKIN(270501603 8582)"; -} - trigger#hs_popup_open_hold:edit { display: none; @@ -54,3 +49,13 @@ _s60-longtap: true; _s60-aspect-ratio: preserve; } + +softkey#msk_ltr +{ + display: block; +} + +softkey#msk_rtl +{ + display: none; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.xml --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.xml Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.xml Wed May 12 13:22:51 2010 +0300 @@ -21,7 +21,7 @@ - + @@ -33,18 +33,16 @@ - + - - + - - + @@ -76,38 +74,16 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + @@ -115,23 +91,13 @@ - - + - - - - - - - - - @@ -151,8 +117,7 @@ - - + @@ -170,6 +135,12 @@ + + + + + + @@ -184,14 +155,6 @@ - - - - - - - - @@ -209,8 +172,7 @@ - - + @@ -227,8 +189,7 @@ - - + @@ -236,8 +197,7 @@ - - + @@ -301,17 +261,24 @@ - - + - + - - + + + + + + + + + + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/37/templateview.css --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/37/templateview.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/37/templateview.css Wed May 12 13:22:51 2010 +0300 @@ -11,7 +11,7 @@ box#plugins_container { direction: rtl; - block-progression: tb; + block-progression: rl; padding-top: 3px; } @@ -23,18 +23,12 @@ margin-bottom: 4px; margin-right: 5px; margin-left: 5px; - background-color: "SKIN(268458534 9916)"; _s60-longtap: true; nav-index: appearance; } -plugin:edit -{ - background-color:"SKIN(270501603 8582)"; -} - trigger#hs_popup_open_hold:edit { display: none; @@ -55,3 +49,13 @@ _s60-longtap: true; _s60-aspect-ratio: preserve; } + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/50/templateview.css --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/50/templateview.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/50/templateview.css Wed May 12 13:22:51 2010 +0300 @@ -11,7 +11,7 @@ box#plugins_container { direction: rtl; - block-progression: tb; + block-progression: rl; padding-top: 3px; } @@ -23,18 +23,12 @@ margin-bottom: 4px; margin-right: 5px; margin-left: 5px; - background-color: "SKIN(268458534 9916)"; _s60-longtap: true; nav-index: appearance; } -plugin:edit -{ - background-color:"SKIN(270501603 8582)"; -} - trigger#hs_popup_open_hold:edit { display: none; @@ -55,3 +49,13 @@ _s60-longtap: true; _s60-aspect-ratio: preserve; } + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/57/templateview.css --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/57/templateview.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/57/templateview.css Wed May 12 13:22:51 2010 +0300 @@ -11,7 +11,7 @@ box#plugins_container { direction: rtl; - block-progression: tb; + block-progression: rl; padding-top: 3px; } @@ -23,18 +23,12 @@ margin-bottom: 4px; margin-right: 5px; margin-left: 5px; - background-color: "SKIN(268458534 9916)"; _s60-longtap: true; nav-index: appearance; } -plugin:edit -{ - background-color:"SKIN(270501603 8582)"; -} - trigger#hs_popup_open_hold:edit { display: none; @@ -55,3 +49,13 @@ _s60-longtap: true; _s60-aspect-ratio: preserve; } + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/94/templateview.css --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/94/templateview.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/94/templateview.css Wed May 12 13:22:51 2010 +0300 @@ -11,7 +11,7 @@ box#plugins_container { direction: rtl; - block-progression: tb; + block-progression: rl; padding-top: 3px; } @@ -23,18 +23,12 @@ margin-bottom: 4px; margin-right: 5px; margin-left: 5px; - background-color: "SKIN(268458534 9916)"; _s60-longtap: true; nav-index: appearance; } -plugin:edit -{ - background-color:"SKIN(270501603 8582)"; -} - trigger#hs_popup_open_hold:edit { display: none; @@ -55,3 +49,13 @@ _s60-longtap: true; _s60-aspect-ratio: preserve; } + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/threerows_2001f486/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/threerows_2001f486/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,18 +1,18 @@ - + - qhd_tch + qhd_tch - template + template - + 0x2001f48a @@ -60,4 +60,4 @@ - \ No newline at end of file + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/37/threerows.css --- a/idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/37/threerows.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/37/threerows.css Wed May 12 13:22:51 2010 +0300 @@ -25,6 +25,7 @@ { padding-left:8px; padding-right:8px; + direction: ltr; text-align: right; font-family: EAknLogicalFontSecondaryFont; font-size: 23px; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/50/threerows.css --- a/idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/50/threerows.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/50/threerows.css Wed May 12 13:22:51 2010 +0300 @@ -25,6 +25,7 @@ { padding-left:8px; padding-right:8px; + direction: ltr; text-align: right; font-family: EAknLogicalFontSecondaryFont; font-size: 23px; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/57/threerows.css --- a/idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/57/threerows.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/57/threerows.css Wed May 12 13:22:51 2010 +0300 @@ -25,6 +25,7 @@ { padding-left:8px; padding-right:8px; + direction: ltr; text-align: right; font-family: EAknLogicalFontSecondaryFont; font-size: 23px; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/94/threerows.css --- a/idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/94/threerows.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/94/threerows.css Wed May 12 13:22:51 2010 +0300 @@ -25,6 +25,7 @@ { padding-left:8px; padding-right:8px; + direction: ltr; text-align: right; font-family: EAknLogicalFontSecondaryFont; font-size: 23px; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/threetextrows_2001f487/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/threetextrows_2001f487/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,18 +1,18 @@ - + - qhd_tch + qhd_tch - template + template - + 0x2001f48a @@ -62,4 +62,4 @@ - \ No newline at end of file + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/37/threetextrows.css --- a/idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/37/threetextrows.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/37/threetextrows.css Wed May 12 13:22:51 2010 +0300 @@ -2,6 +2,7 @@ { padding-left:8px; padding-right:8px; + direction: ltr; text-align: right; font-family: EAknLogicalFontSecondaryFont; font-size: 23px; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/50/threetextrows.css --- a/idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/50/threetextrows.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/50/threetextrows.css Wed May 12 13:22:51 2010 +0300 @@ -2,6 +2,7 @@ { padding-left:8px; padding-right:8px; + direction: ltr; text-align: right; font-family: EAknLogicalFontSecondaryFont; font-size: 23px; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/57/threetextrows.css --- a/idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/57/threetextrows.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/57/threetextrows.css Wed May 12 13:22:51 2010 +0300 @@ -2,6 +2,7 @@ { padding-left:8px; padding-right:8px; + direction: ltr; text-align: right; font-family: EAknLogicalFontSecondaryFont; font-size: 23px; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/94/threetextrows.css --- a/idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/94/threetextrows.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/94/threetextrows.css Wed May 12 13:22:51 2010 +0300 @@ -2,6 +2,7 @@ { padding-left:8px; padding-right:8px; + direction: ltr; text-align: right; font-family: EAknLogicalFontSecondaryFont; font-size: 23px; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/tworows_2001f488/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/tworows_2001f488/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,18 +1,18 @@ - + - qhd_tch + qhd_tch - template + template - + 0x2001f48a @@ -60,4 +60,4 @@ - \ No newline at end of file + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/37/tworows.css --- a/idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/37/tworows.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/37/tworows.css Wed May 12 13:22:51 2010 +0300 @@ -26,6 +26,7 @@ padding-right:8px; padding-left:8px; padding-top:8px; + direction: ltr; text-align: right; font-family: EAknLogicalFontSecondaryFont; font-size: 23px; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/50/tworows.css --- a/idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/50/tworows.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/50/tworows.css Wed May 12 13:22:51 2010 +0300 @@ -26,6 +26,7 @@ padding-right:8px; padding-left:8px; padding-top:8px; + direction: ltr; text-align: right; font-family: EAknLogicalFontSecondaryFont; font-size: 23px; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/57/tworows.css --- a/idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/57/tworows.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/57/tworows.css Wed May 12 13:22:51 2010 +0300 @@ -26,6 +26,7 @@ padding-right:8px; padding-left:8px; padding-top:8px; + direction: ltr; text-align: right; font-family: EAknLogicalFontSecondaryFont; font-size: 23px; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/94/tworows.css --- a/idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/94/tworows.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/94/tworows.css Wed May 12 13:22:51 2010 +0300 @@ -26,6 +26,7 @@ padding-right:8px; padding-left:8px; padding-top:8px; + direction: ltr; text-align: right; font-family: EAknLogicalFontSecondaryFont; font-size: 23px; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f486.confml Binary file idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f486.confml has changed diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f486.gcfml --- a/idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f486.gcfml Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48b.confml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48b.confml Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,263 @@ + + + + + Maximum widget amount in Homescreen 1 page. Customizable + + + Not customizable! + + + Not customizable! + + + Not customizable! + + + Path of the Wallpaper resource. Customizable. + + + Not customizable! + + + Not customizable! + + + Widgets in the Homescreen 1 + + Widget name + + + Bundle identifier for the (C)WRT widgets. None for the native widgets + + + + Templeate identifier for the (C)WRT widgets. None for the native widgets + + + Locking status for the widget 1 in Homescreen 1 page + + + Customize enabler for desktop/shortcut widget + + + Customize 1st item in desktop widget + + + Type of the item: Application, bookmark, or shortcut(param specific item) + + + Uid for the application, Menu content Uid for the bookmarks and shortcuts. + + + url for the bookmark based shortcut. for example http://www.google.com + + + Params for shortcut. For example: messaging:msg + + + Customize 2nd item in desktop widget + + + Type of the item: Application, bookmark, or shortcut(param specific item) + + + Uid for the application, Menu content Uid for the bookmarks and shortcuts + + + url for the bookmark based shortcut. for example http://www.google.com + + + Params for shortcut. messaging:msg + + + Customize 3rd item in desktop widget + + + Type of the item: Application, bookmark, or shortcut(param specific item) + + + Uid for the application,Menu content Uid for the bookmarks and shortcuts. + + + url for the bookmark based shortcut. for example http://www.google.com + + + Params for shortcut. messaging:msg + + + Customize 4th item in desktop widget + + + Type of the item: Application, bookmark, or shortcut(param specific item) + + + Uid for the application, Menu content ids for the bookmarks and shortcuts + + + url for the bookmark based shortcut. for example http://www.google.com + + + Params for shortcut. messaging:msg + + + Not customizable! + + + Not customizable! + + + Not customizable! + + + Not customizable! + + + Not customizable! + + + Not customizable! + + + Not customizable! + + + Not customizable! + + + Not customizable! + + + Not customizable! + + + Not customizable! + + + Not customizable! + + + + + + 6 + true + hs_qhd_tch_view + use_empty_widget + wallpaper + path + + 0x2001cb7c00locked0firstShortcut1secondShortcut2thirdShortcut3fourthShortcut4typeuidviewparam + 0x20026f4f00none00firstShortcut1secondShortcut2thirdShortcut3fourthShortcut4typeuidviewparam + 0x10207c1800none00firstShortcut1secondShortcut2thirdShortcut3fourthShortcut4typeuidviewparam + 0x2001f48100none00firstShortcut1secondShortcut2thirdShortcut3fourthShortcut4typeuidviewparam + 0x2001f47f00none00firstShortcut1secondShortcut2thirdShortcut3fourthShortcut4typeuidviewparam + 0x2001f47f00none00firstShortcut1secondShortcut2thirdShortcut3fourthShortcut4typeuidviewparam + + + \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48b.gcfml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48b.gcfml Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48bmanifest.confml Binary file idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48bmanifest.confml has changed diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48bmanifest.gcfml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48bmanifest.gcfml Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + & + + ; + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48bxuikon.confml Binary file idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48bxuikon.confml has changed diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48bxuikon.gcfml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48bxuikon.gcfml Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/group/bld.inf --- a/idlehomescreen/data/qhd_tch/view_2001f48b/group/bld.inf Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/group/bld.inf Wed May 12 13:22:51 2010 +0300 @@ -24,8 +24,8 @@ PRJ_EXPORTS // Support for productization and Carbide.Ui customization //******************************************************** -../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/view_2001f48b/hsps/manifest.dat -../hsps/00/viewconfiguration.xml /epoc32/data/Z/resource/homescreen/view_2001f48b/hsps/viewconfiguration.xml +//../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/view_2001f48b/hsps/manifest.dat +//../hsps/00/viewconfiguration.xml /epoc32/data/Z/resource/homescreen/view_2001f48b/hsps/viewconfiguration.xml ../xuikon/00/View.dat /epoc32/data/Z/resource/homescreen/view_2001f48b/xuikon/view_2001f48b.dat ../xuikon/00/View.css /epoc32/data/Z/resource/homescreen/view_2001f48b/xuikon/view.css @@ -41,10 +41,13 @@ //Confml and cfgml files for the customization -// starting use confml it is need to remove root_configuration.xml direct exporting (view_2001f48b_variant.iby) //*********************************** -//../conf/view2001f486.confml APP_LAYER_CONFML(view2001f486.confml) -//../conf/view2001f486.gcfml APP_LAYER_GCFML(view2001f486.gcfml) +../conf/view2001f48b.confml APP_LAYER_CONFML(view2001f48b.confml) +../conf/view2001f48b.gcfml APP_LAYER_GCFML(view2001f48b.gcfml) +../conf/view2001f48bmanifest.confml APP_LAYER_CONFML(view2001f48bmanifest.confml) +../conf/view2001f48bmanifest.gcfml APP_LAYER_GCFML(view2001f48bmanifest.gcfml) +../conf/view2001f48bxuikon.confml APP_LAYER_CONFML(view2001f48bxuikon.confml) +../conf/view2001f48bxuikon.gcfml APP_LAYER_GCFML(view2001f48bxuikon.gcfml) // Support for S60 localization //***************************** @@ -57,8 +60,8 @@ //*********************** ../rom/view_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(view_2001f48b_resources.iby) ../rom/view_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(view_2001f48b_customer.iby) -../rom/view_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(view_2001f48b_variant.iby) -../rom/view.iby CORE_APP_LAYER_IBY_EXPORT_PATH(view_2001f48b.iby) +//../rom/view_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(view_2001f48b_variant.iby) +//../rom/view.iby CORE_APP_LAYER_IBY_EXPORT_PATH(view_2001f48b.iby) // Dtd-localization diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/view_2001f48b/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,6 +1,6 @@ - + @@ -56,4 +56,4 @@ - \ No newline at end of file + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/hsps/00/viewconfiguration.xml --- a/idlehomescreen/data/qhd_tch/view_2001f48b/hsps/00/viewconfiguration.xml Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/hsps/00/viewconfiguration.xml Wed May 12 13:22:51 2010 +0300 @@ -1,22 +1,23 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/rom/view_variant.iby diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.css --- a/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.css Wed May 12 13:22:51 2010 +0300 @@ -11,7 +11,7 @@ box#plugins_container { direction: ltr; - block-progression: tb; + block-progression: rl; padding-top: 3px; } @@ -29,11 +29,6 @@ nav-index: appearance; } -plugin:edit -{ - background-color:"SKIN(270501603 8582)"; -} - trigger#hs_popup_open_hold:edit { display: none; @@ -53,4 +48,15 @@ { _s60-longtap: true; _s60-aspect-ratio: preserve; -} +} + +softkey#msk_ltr +{ + display: block; +} + +softkey#msk_rtl +{ + display: none; +} + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.xml --- a/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.xml Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.xml Wed May 12 13:22:51 2010 +0300 @@ -21,7 +21,7 @@ - + @@ -33,18 +33,16 @@ - + - - + - - + @@ -76,38 +74,16 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + @@ -115,23 +91,13 @@ - - + - - - - - - - - - @@ -151,8 +117,7 @@ - - + @@ -170,6 +135,12 @@ + + + + + + @@ -184,14 +155,6 @@ - - - - - - - - @@ -209,8 +172,7 @@ - - + @@ -227,8 +189,7 @@ - - + @@ -236,8 +197,7 @@ - - + @@ -301,17 +261,24 @@ - - + - + - - + + + + + + + + + + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/37/View.css --- a/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/37/View.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/37/View.css Wed May 12 13:22:51 2010 +0300 @@ -11,7 +11,7 @@ box#plugins_container { direction: rtl; - block-progression: tb; + block-progression: rl; padding-top: 3px; } @@ -23,18 +23,10 @@ margin-bottom: 4px; margin-right: 5px; margin-left: 5px; - background-color: "SKIN(268458534 9916)"; - _s60-longtap: true; - nav-index: appearance; } -plugin:edit -{ - background-color:"SKIN(270501603 8582)"; -} - trigger#hs_popup_open_hold:edit { display: none; @@ -55,3 +47,13 @@ _s60-longtap: true; _s60-aspect-ratio: preserve; } + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/50/View.css --- a/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/50/View.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/50/View.css Wed May 12 13:22:51 2010 +0300 @@ -11,7 +11,7 @@ box#plugins_container { direction: rtl; - block-progression: tb; + block-progression: rl; padding-top: 3px; } @@ -23,18 +23,10 @@ margin-bottom: 4px; margin-right: 5px; margin-left: 5px; - background-color: "SKIN(268458534 9916)"; - _s60-longtap: true; - nav-index: appearance; } -plugin:edit -{ - background-color:"SKIN(270501603 8582)"; -} - trigger#hs_popup_open_hold:edit { display: none; @@ -55,3 +47,13 @@ _s60-longtap: true; _s60-aspect-ratio: preserve; } + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/57/View.css --- a/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/57/View.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/57/View.css Wed May 12 13:22:51 2010 +0300 @@ -11,7 +11,7 @@ box#plugins_container { direction: rtl; - block-progression: tb; + block-progression: rl; padding-top: 3px; } @@ -23,18 +23,10 @@ margin-bottom: 4px; margin-right: 5px; margin-left: 5px; - background-color: "SKIN(268458534 9916)"; - _s60-longtap: true; - nav-index: appearance; } -plugin:edit -{ - background-color:"SKIN(270501603 8582)"; -} - trigger#hs_popup_open_hold:edit { display: none; @@ -55,3 +47,13 @@ _s60-longtap: true; _s60-aspect-ratio: preserve; } + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/94/View.css --- a/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/94/View.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/94/View.css Wed May 12 13:22:51 2010 +0300 @@ -11,7 +11,7 @@ box#plugins_container { direction: rtl; - block-progression: tb; + block-progression: rl; padding-top: 3px; } @@ -23,18 +23,10 @@ margin-bottom: 4px; margin-right: 5px; margin-left: 5px; - background-color: "SKIN(268458534 9916)"; - _s60-longtap: true; - nav-index: appearance; } -plugin:edit -{ - background-color:"SKIN(270501603 8582)"; -} - trigger#hs_popup_open_hold:edit { display: none; @@ -55,3 +47,13 @@ _s60-longtap: true; _s60-aspect-ratio: preserve; } + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4.confml Binary file idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4.confml has changed diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4.gcfml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4.gcfml Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4manifest.confml Binary file idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4manifest.confml has changed diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4manifest.gcfml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4manifest.gcfml Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + & + + ; + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4xuikon.confml Binary file idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4xuikon.confml has changed diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4xuikon.gcfml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4xuikon.gcfml Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/group/bld.inf Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* The information required for building +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// Support for productization and Carbide.Ui customization +//******************************************************** +//../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/view_200286e4/hsps/manifest.dat +//../hsps/00/viewconfiguration.xml /epoc32/data/Z/resource/homescreen/view_200286e4/hsps/viewconfiguration.xml + +../xuikon/00/View.dat /epoc32/data/Z/resource/homescreen/view_200286e4/xuikon/view_200286e4.dat +../xuikon/00/View.css /epoc32/data/Z/resource/homescreen/view_200286e4/xuikon/view.css +../xuikon/00/View.xml /epoc32/data/Z/resource/homescreen/view_200286e4/xuikon/view.xml +../xuikon/00/View.dtd /epoc32/data/Z/resource/homescreen/view_200286e4/xuikon/view.dtd + +// Arabic languages +//***************** +../xuikon/37/View.css /epoc32/data/Z/resource/homescreen/view_200286e4/xuikon/37/view.css +../xuikon/50/View.css /epoc32/data/Z/resource/homescreen/view_200286e4/xuikon/50/view.css +../xuikon/57/View.css /epoc32/data/Z/resource/homescreen/view_200286e4/xuikon/57/view.css +../xuikon/94/View.css /epoc32/data/Z/resource/homescreen/view_200286e4/xuikon/94/view.css + + +//Confml and cfgml files for the customization +// starting use confml it is need to remove root_configuration.xml direct exporting (view_200286e4_variant.iby) +//*********************************** +../conf/view200286e4.confml APP_LAYER_CONFML(view200286e4.confml) +../conf/view200286e4.gcfml APP_LAYER_GCFML(view200286e4.gcfml) +../conf/view200286e4manifest.confml APP_LAYER_CONFML(view200286e4manifest.confml) +../conf/view200286e4manifest.gcfml APP_LAYER_GCFML(view200286e4manifest.gcfml) +../conf/view200286e4xuikon.confml APP_LAYER_CONFML(view200286e4xuikon.confml) +../conf/view200286e4xuikon.gcfml APP_LAYER_GCFML(view200286e4xuikon.gcfml) + +// Support for S60 localization +//***************************** +#ifndef __VIEW_LOC__ +#define __VIEW_LOC__ +../loc/view.loc APP_LAYER_LOC_EXPORT_PATH(view.loc) +#endif // __VIEW_LOC__ + +// Support for S60 builds +//*********************** +../rom/view_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(view_200286e4_resources.iby) +../rom/view_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(view_200286e4_customer.iby) +//../rom/view_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(view_200286e4_variant.iby) +//../rom/view.iby CORE_APP_LAYER_IBY_EXPORT_PATH(view_200286e4.iby) + + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME view_200286e4 +OPTION DTD_TYPE widget +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,59 @@ + + + + + + + qhd_tch + + + + view + + + + + + 0x2001f48a + + + + + + 0x101fb657 + + + + + + 0x200286e4 + + + + + + &qtn_view_200286e4_name; + + ai3_view2 + + 1.0 + + + + + + viewconfiguration.xml + + + + + + + + view.o0000 + + + + + + \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/hsps/00/viewconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/hsps/00/viewconfiguration.xml Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/loc/View.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/loc/View.loc Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,268 @@ +/* +* 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 +* +*/ + +// d: Help +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_options_help "Help" + +// d: Open +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define qtn_msk_open "Open" + +// d: Options +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define text_softkey_done "Done" + +// d: Open +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_options_open "Open" + +// d: Back +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define text_softkey_back "Back" + +// d: Empty string +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define shortcut_emptycaption " " + +// d: Add page +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_add_page "Add page" + +// d: Select +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_options_select_widget "Select" + +// d: Add content +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_add_widget "Add content" + +// d: Access the widget catalog +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_widget_catalog "Widget catalog" + +// d: Search +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define text_softkey_search "Search" + +// d: Options +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define text_softkey_options "Options" + +// d: Refresh +// l: list_single_pane_t1_cp2/opt3 +// w: +// r: TB9.2 +#define qtn_hs_refresh_widget "Refresh" + +// d: Focused widget +// l: list_single_popup_submenu_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_refresh_one_widget "One" + +// d: All widgets +// l: list_single_popup_submenu_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_refresh_all_widgets "All" + +// d: Remove content +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_remove_widget "Remove content" + +// d: Hide the content +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_hide_widgets "Hide the content" + +// d: Edit contents +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_edit_content "Edit content" + +// d: Change Wallpaper +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_change_wallpaper "Change Wallpaper" + +// d: Change Shortcut Settings +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_change_shortcut_settings "Change Shortcut Settings" + +// d: Widget settings +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_widget_settings "Widget settings" + +// d: Show widgets +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_show_widgets "Show the content" + +// d: Change Home screen page +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_change_page "Change Home screen page" + +// d: Change +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define qtn_msk_change "Change" + +// d: Show all profiles in Profiles widget +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_show_profiles "Show all profiles" + +// d: Right selection key +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_set_right_idle_softkey "Right selection key" + +// d: Select +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define text_softkey_select "Select" + +// d: Cancel +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define text_softkey_cancel "Cancel" + +// d: Options menu item which switches home to online. Web widgets get updates from network. +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_online "Switch Home to online" + +// d: Options menu item which switches home to offline. Web widgets are not updated +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_offline "Switch Home to offline" + +// d: String which is shown in long tap menu of Home screen if tapped widget has settings +// l: list_single_touch_menu_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_longtap_settings "Settings" + +// d: String which is shown in long tap menu of Home screen if tapped some widget which is removable +// l: list_single_touch_menu_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_longtap_remove_element "Remove" + +// d: String which is shown in long tap menu of Home screen if tapped empty space in home screen +// l: list_single_touch_menu_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_longtap_add "Add content" + +// d: String which is shown in long tap menu of Home screen +// l: list_single_touch_menu_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_change_longtap_wallpaper "Change wallpaper" + +// d: User can download new HS widgets. String is visible in add content list query +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_download_new_widgets "Download" + +// d: Changes focused widget +// l: list_single_touch_menu_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_edit_replace "Replace" + +// d: deletes current home screen page +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_page_options_delete "Delete page" + +// d: creates new home screen page +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_page_options_new "New page" + +// d: view title in editing mode +// l: title_pane_t2 +// w: +// r: TB9.2 +#define qtn_hs_title_editing_view "Editing view" + +// d: Call +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define text_softkey_call "Call" + +// d: Added new option menu item to Edit mode for opening the widget catalog, +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_edit_widget_catalog "Widget Catalog" + +// d: Deletes the current Home screen page and focus goes to the next available Home screen page in Edit mode +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_page_edit_options_delete "Delete page" diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/rom/view.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/rom/view.iby Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* View widget HSPS-plugin IBY file. +* +*/ + +#ifndef __AI3VIEW_200286E4_IBY__ +#define __AI3VIEW_200286E4_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\view_200286e4\hsps\00\manifest.dat \private\200159c0\install\view_200286e4\hsps\00\manifest.dat + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3VIEW_200286E4_IBY__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/rom/view_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/rom/view_customer.iby Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* View widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __AI3VIEW_200286E4_CUSTOMER_IBY__ +#define __AI3VIEW_200286E4_CUSTOMER_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\view_200286e4\xuikon\00\view.o0000 \private\200159c0\install\view_200286e4\xuikon\00\view.o0000 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3VIEW_2001F48B_CUSTOMER_IBY__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/rom/view_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/rom/view_resources.iby Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* View widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __AI3VIEW_200286E4_RESOURCES_IBY__ +#define __AI3VIEW_200286E4_RESOURCES_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\view_200286e4\xuikon\00\view.o0000 \private\200159c0\install\view_200286e4\xuikon\00\view.o0000 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3VIEW_2001F48B_RESOURCES_IBY__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/rom/view_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/rom/view_variant.iby Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* View widget HSPS-plugin variant specific IBY file. +* +*/ + +#ifndef __AI3VIEW_200286E4_VARIANT_IBY__ +#define __AI3VIEW_200286E4_VARIANT_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\view_200286e4\hsps\00\viewconfiguration.xml \private\200159c0\install\view_200286e4\hsps\00\viewconfiguration.xml + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3VIEW_2001F48B_VARIANT_IBY__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/xuikon/00/View.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/xuikon/00/View.css Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,67 @@ +view +{ + direction: ltr; + block-progression: tb; + background-image: wallpaper; + swipe: true; + + _s60-status-pane-layout: widescreen-flat-3softkeys; +} + +box#plugins_container +{ + direction: ltr; + block-progression: rl; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + + _s60-longtap: true; + + nav-index: appearance; +} + +plugin:edit +{ + background-color:"SKIN(270501603 8582)"; +} + +trigger#hs_popup_open_hold:edit +{ + display: none; +} + +trigger#hs_popup_open_up +{ + display: none; +} + +trigger#hs_popup_open_up:edit +{ + display: block; +} + +softkey#rsk +{ + _s60-longtap: true; + _s60-aspect-ratio: preserve; +} + +softkey#msk_ltr +{ + display: block; +} + +softkey#msk_rtl +{ + display: none; +} + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/xuikon/00/View.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/xuikon/00/View.dat Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,13 @@ + + + E029CF57 + 101FB657 + 11001234 + DemoView + view + 1.0 + view.xml + view.css + view.dtd + + \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/xuikon/00/View.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/xuikon/00/View.dtd Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,428 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/xuikon/00/View.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/xuikon/00/View.xml Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,288 @@ + + + + + + + + + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/xuikon/37/View.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/xuikon/37/View.css Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,64 @@ +view +{ + direction: ltr; + block-progression: tb; + background-image: wallpaper; + swipe: true; + + _s60-status-pane-layout: widescreen-flat-3softkeys; +} + +box#plugins_container +{ + direction: rtl; + block-progression: rl; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + _s60-longtap: true; + nav-index: appearance; +} + +plugin:edit +{ + background-color:"SKIN(270501603 8582)"; +} + +trigger#hs_popup_open_hold:edit +{ + display: none; +} + +trigger#hs_popup_open_up +{ + display: none; +} + +trigger#hs_popup_open_up:edit +{ + display: block; +} + +softkey#rsk +{ + _s60-longtap: true; + _s60-aspect-ratio: preserve; +} + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/xuikon/50/View.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/xuikon/50/View.css Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,64 @@ +view +{ + direction: ltr; + block-progression: tb; + background-image: wallpaper; + swipe: true; + + _s60-status-pane-layout: widescreen-flat-3softkeys; +} + +box#plugins_container +{ + direction: rtl; + block-progression: rl; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + _s60-longtap: true; + nav-index: appearance; +} + +plugin:edit +{ + background-color:"SKIN(270501603 8582)"; +} + +trigger#hs_popup_open_hold:edit +{ + display: none; +} + +trigger#hs_popup_open_up +{ + display: none; +} + +trigger#hs_popup_open_up:edit +{ + display: block; +} + +softkey#rsk +{ + _s60-longtap: true; + _s60-aspect-ratio: preserve; +} + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/xuikon/57/View.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/xuikon/57/View.css Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,64 @@ +view +{ + direction: ltr; + block-progression: tb; + background-image: wallpaper; + swipe: true; + + _s60-status-pane-layout: widescreen-flat-3softkeys; +} + +box#plugins_container +{ + direction: rtl; + block-progression: rl; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + _s60-longtap: true; + nav-index: appearance; +} + +plugin:edit +{ + background-color:"SKIN(270501603 8582)"; +} + +trigger#hs_popup_open_hold:edit +{ + display: none; +} + +trigger#hs_popup_open_up +{ + display: none; +} + +trigger#hs_popup_open_up:edit +{ + display: block; +} + +softkey#rsk +{ + _s60-longtap: true; + _s60-aspect-ratio: preserve; +} + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e4/xuikon/94/View.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/xuikon/94/View.css Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,64 @@ +view +{ + direction: ltr; + block-progression: tb; + background-image: wallpaper; + swipe: true; + + _s60-status-pane-layout: widescreen-flat-3softkeys; +} + +box#plugins_container +{ + direction: rtl; + block-progression: rl; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + _s60-longtap: true; + nav-index: appearance; +} + +plugin:edit +{ + background-color:"SKIN(270501603 8582)"; +} + +trigger#hs_popup_open_hold:edit +{ + display: none; +} + +trigger#hs_popup_open_up +{ + display: none; +} + +trigger#hs_popup_open_up:edit +{ + display: block; +} + +softkey#rsk +{ + _s60-longtap: true; + _s60-aspect-ratio: preserve; +} + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5.confml Binary file idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5.confml has changed diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5.gcfml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5.gcfml Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5manifest.confml Binary file idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5manifest.confml has changed diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5manifest.gcfml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5manifest.gcfml Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + & + + ; + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5xuikon.confml Binary file idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5xuikon.confml has changed diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5xuikon.gcfml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5xuikon.gcfml Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/group/bld.inf Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* The information required for building +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// Support for productization and Carbide.Ui customization +//******************************************************** +//../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/view_200286e5/hsps/manifest.dat +//../hsps/00/viewconfiguration.xml /epoc32/data/Z/resource/homescreen/view_200286e5/hsps/viewconfiguration.xml + +../xuikon/00/View.dat /epoc32/data/Z/resource/homescreen/view_200286e5/xuikon/view_200286e5.dat +../xuikon/00/View.css /epoc32/data/Z/resource/homescreen/view_200286e5/xuikon/view.css +../xuikon/00/View.xml /epoc32/data/Z/resource/homescreen/view_200286e5/xuikon/view.xml +../xuikon/00/View.dtd /epoc32/data/Z/resource/homescreen/view_200286e5/xuikon/view.dtd + +// Arabic languages +//***************** +../xuikon/37/View.css /epoc32/data/Z/resource/homescreen/view_200286e5/xuikon/37/view.css +../xuikon/50/View.css /epoc32/data/Z/resource/homescreen/view_200286e5/xuikon/50/view.css +../xuikon/57/View.css /epoc32/data/Z/resource/homescreen/view_200286e5/xuikon/57/view.css +../xuikon/94/View.css /epoc32/data/Z/resource/homescreen/view_200286e5/xuikon/94/view.css + + +//Confml and cfgml files for the customization +// starting use confml it is need to remove root_configuration.xml direct exporting (view_200286e5_variant.iby) +//*********************************** +../conf/view200286e5.confml APP_LAYER_CONFML(view200286e5.confml) +../conf/view200286e5.gcfml APP_LAYER_GCFML(view200286e5.gcfml) +../conf/view200286e5manifest.confml APP_LAYER_CONFML(view200286e5manifest.confml) +../conf/view200286e5manifest.gcfml APP_LAYER_GCFML(view200286e5manifest.gcfml) +../conf/view200286e5xuikon.confml APP_LAYER_CONFML(view200286e5xuikon.confml) +../conf/view200286e5xuikon.gcfml APP_LAYER_GCFML(view200286e5xuikon.gcfml) + +// Support for S60 localization +//***************************** +#ifndef __VIEW_LOC__ +#define __VIEW_LOC__ +../loc/view.loc APP_LAYER_LOC_EXPORT_PATH(view.loc) +#endif // __VIEW_LOC__ + +// Support for S60 builds +//*********************** +../rom/view_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(view_200286e5_resources.iby) +../rom/view_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(view_200286e5_customer.iby) +//../rom/view_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(view_200286e5_variant.iby) +//../rom/view.iby CORE_APP_LAYER_IBY_EXPORT_PATH(view_200286e5.iby) + + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME view_200286e5 +OPTION DTD_TYPE widget +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,59 @@ + + + + + + + qhd_tch + + + + view + + + + + + 0x2001f48a + + + + + + 0x101fb657 + + + + + + 0x200286e5 + + + + + + &qtn_view_200286e5_name; + + ai3_view3 + + 1.0 + + + + + + viewconfiguration.xml + + + + + + + + view.o0000 + + + + + + \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/hsps/00/viewconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/hsps/00/viewconfiguration.xml Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/loc/View.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/loc/View.loc Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,268 @@ +/* +* 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 +* +*/ + +// d: Help +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_options_help "Help" + +// d: Open +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define qtn_msk_open "Open" + +// d: Options +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define text_softkey_done "Done" + +// d: Open +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_options_open "Open" + +// d: Back +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define text_softkey_back "Back" + +// d: Empty string +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define shortcut_emptycaption " " + +// d: Add page +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_add_page "Add page" + +// d: Select +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_options_select_widget "Select" + +// d: Add content +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_add_widget "Add content" + +// d: Access the widget catalog +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_widget_catalog "Widget catalog" + +// d: Search +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define text_softkey_search "Search" + +// d: Options +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define text_softkey_options "Options" + +// d: Refresh +// l: list_single_pane_t1_cp2/opt3 +// w: +// r: TB9.2 +#define qtn_hs_refresh_widget "Refresh" + +// d: Focused widget +// l: list_single_popup_submenu_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_refresh_one_widget "One" + +// d: All widgets +// l: list_single_popup_submenu_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_refresh_all_widgets "All" + +// d: Remove content +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_remove_widget "Remove content" + +// d: Hide the content +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_hide_widgets "Hide the content" + +// d: Edit contents +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_edit_content "Edit content" + +// d: Change Wallpaper +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_change_wallpaper "Change Wallpaper" + +// d: Change Shortcut Settings +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_change_shortcut_settings "Change Shortcut Settings" + +// d: Widget settings +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_widget_settings "Widget settings" + +// d: Show widgets +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_show_widgets "Show the content" + +// d: Change Home screen page +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_change_page "Change Home screen page" + +// d: Change +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define qtn_msk_change "Change" + +// d: Show all profiles in Profiles widget +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_show_profiles "Show all profiles" + +// d: Right selection key +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_set_right_idle_softkey "Right selection key" + +// d: Select +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define text_softkey_select "Select" + +// d: Cancel +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define text_softkey_cancel "Cancel" + +// d: Options menu item which switches home to online. Web widgets get updates from network. +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_online "Switch Home to online" + +// d: Options menu item which switches home to offline. Web widgets are not updated +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_offline "Switch Home to offline" + +// d: String which is shown in long tap menu of Home screen if tapped widget has settings +// l: list_single_touch_menu_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_longtap_settings "Settings" + +// d: String which is shown in long tap menu of Home screen if tapped some widget which is removable +// l: list_single_touch_menu_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_longtap_remove_element "Remove" + +// d: String which is shown in long tap menu of Home screen if tapped empty space in home screen +// l: list_single_touch_menu_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_longtap_add "Add content" + +// d: String which is shown in long tap menu of Home screen +// l: list_single_touch_menu_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_change_longtap_wallpaper "Change wallpaper" + +// d: User can download new HS widgets. String is visible in add content list query +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_download_new_widgets "Download" + +// d: Changes focused widget +// l: list_single_touch_menu_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_edit_replace "Replace" + +// d: deletes current home screen page +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_page_options_delete "Delete page" + +// d: creates new home screen page +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_page_options_new "New page" + +// d: view title in editing mode +// l: title_pane_t2 +// w: +// r: TB9.2 +#define qtn_hs_title_editing_view "Editing view" + +// d: Call +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +#define text_softkey_call "Call" + +// d: Added new option menu item to Edit mode for opening the widget catalog, +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_edit_widget_catalog "Widget Catalog" + +// d: Deletes the current Home screen page and focus goes to the next available Home screen page in Edit mode +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_page_edit_options_delete "Delete page" diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/rom/view.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/rom/view.iby Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* View widget HSPS-plugin IBY file. +* +*/ + +#ifndef __AI3VIEW_200286E5_IBY__ +#define __AI3VIEW_200286E5_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\view_200286e5\hsps\00\manifest.dat \private\200159c0\install\view_200286e5\hsps\00\manifest.dat + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3VIEW_200286E5_IBY__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/rom/view_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/rom/view_customer.iby Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* View widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __AI3VIEW_200286E5_CUSTOMER_IBY__ +#define __AI3VIEW_200286E5_CUSTOMER_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\view_200286e5\xuikon\00\view.o0000 \private\200159c0\install\view_200286e5\xuikon\00\view.o0000 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3VIEW_200286E5_CUSTOMER_IBY__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/rom/view_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/rom/view_resources.iby Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* View widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __AI3VIEW_200286E5_RESOURCES_IBY__ +#define __AI3VIEW_200286E5_RESOURCES_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\view_200286e5\xuikon\00\view.o0000 \private\200159c0\install\view_200286e5\xuikon\00\view.o0000 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3VIEW_200286E5_RESOURCES_IBY__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/rom/view_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/rom/view_variant.iby Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* View widget HSPS-plugin variant specific IBY file. +* +*/ + +#ifndef __AI3VIEW_200286E5_VARIANT_IBY__ +#define __AI3VIEW_200286E5_VARIANT_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\view_200286e5\hsps\00\viewconfiguration.xml \private\200159c0\install\view_200286e5\hsps\00\viewconfiguration.xml + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3VIEW_200286E5_VARIANT_IBY__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/xuikon/00/View.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/xuikon/00/View.css Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,67 @@ +view +{ + direction: ltr; + block-progression: tb; + background-image: wallpaper; + swipe: true; + + _s60-status-pane-layout: widescreen-flat-3softkeys; +} + +box#plugins_container +{ + direction: ltr; + block-progression: rl; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + + _s60-longtap: true; + + nav-index: appearance; +} + +plugin:edit +{ + background-color:"SKIN(270501603 8582)"; +} + +trigger#hs_popup_open_hold:edit +{ + display: none; +} + +trigger#hs_popup_open_up +{ + display: none; +} + +trigger#hs_popup_open_up:edit +{ + display: block; +} + +softkey#rsk +{ + _s60-longtap: true; + _s60-aspect-ratio: preserve; +} + +softkey#msk_ltr +{ + display: block; +} + +softkey#msk_rtl +{ + display: none; +} + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/xuikon/00/View.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/xuikon/00/View.dat Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,13 @@ + + + E029CF57 + 101FB657 + 11001234 + DemoView + view + 1.0 + view.xml + view.css + view.dtd + + \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/xuikon/00/View.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/xuikon/00/View.dtd Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,428 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/xuikon/00/View.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/xuikon/00/View.xml Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,288 @@ + + + + + + + + + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/xuikon/37/View.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/xuikon/37/View.css Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,64 @@ +view +{ + direction: ltr; + block-progression: tb; + background-image: wallpaper; + swipe: true; + + _s60-status-pane-layout: widescreen-flat-3softkeys; +} + +box#plugins_container +{ + direction: rtl; + block-progression: rl; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + _s60-longtap: true; + nav-index: appearance; +} + +plugin:edit +{ + background-color:"SKIN(270501603 8582)"; +} + +trigger#hs_popup_open_hold:edit +{ + display: none; +} + +trigger#hs_popup_open_up +{ + display: none; +} + +trigger#hs_popup_open_up:edit +{ + display: block; +} + +softkey#rsk +{ + _s60-longtap: true; + _s60-aspect-ratio: preserve; +} + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/xuikon/50/View.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/xuikon/50/View.css Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,64 @@ +view +{ + direction: ltr; + block-progression: tb; + background-image: wallpaper; + swipe: true; + + _s60-status-pane-layout: widescreen-flat-3softkeys; +} + +box#plugins_container +{ + direction: rtl; + block-progression: rl; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + _s60-longtap: true; + nav-index: appearance; +} + +plugin:edit +{ + background-color:"SKIN(270501603 8582)"; +} + +trigger#hs_popup_open_hold:edit +{ + display: none; +} + +trigger#hs_popup_open_up +{ + display: none; +} + +trigger#hs_popup_open_up:edit +{ + display: block; +} + +softkey#rsk +{ + _s60-longtap: true; + _s60-aspect-ratio: preserve; +} + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/xuikon/57/View.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/xuikon/57/View.css Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,64 @@ +view +{ + direction: ltr; + block-progression: tb; + background-image: wallpaper; + swipe: true; + + _s60-status-pane-layout: widescreen-flat-3softkeys; +} + +box#plugins_container +{ + direction: rtl; + block-progression: rl; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + _s60-longtap: true; + nav-index: appearance; +} + +plugin:edit +{ + background-color:"SKIN(270501603 8582)"; +} + +trigger#hs_popup_open_hold:edit +{ + display: none; +} + +trigger#hs_popup_open_up +{ + display: none; +} + +trigger#hs_popup_open_up:edit +{ + display: block; +} + +softkey#rsk +{ + _s60-longtap: true; + _s60-aspect-ratio: preserve; +} + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/view_200286e5/xuikon/94/View.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/xuikon/94/View.css Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,64 @@ +view +{ + direction: ltr; + block-progression: tb; + background-image: wallpaper; + swipe: true; + + _s60-status-pane-layout: widescreen-flat-3softkeys; +} + +box#plugins_container +{ + direction: rtl; + block-progression: rl; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + _s60-longtap: true; + nav-index: appearance; +} + +plugin:edit +{ + background-color:"SKIN(270501603 8582)"; +} + +trigger#hs_popup_open_hold:edit +{ + display: none; +} + +trigger#hs_popup_open_up +{ + display: none; +} + +trigger#hs_popup_open_up:edit +{ + display: block; +} + +softkey#rsk +{ + _s60-longtap: true; + _s60-aspect-ratio: preserve; +} + +softkey#msk_ltr +{ + display: none; +} + +softkey#msk_rtl +{ + display: block; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/wideimage_2001f489/group/bld.inf --- a/idlehomescreen/data/qhd_tch/wideimage_2001f489/group/bld.inf Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/group/bld.inf Wed May 12 13:22:51 2010 +0300 @@ -26,11 +26,16 @@ //******************************************************** ../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/wideimage_2001f489/hsps/manifest.dat ../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/wideimage_2001f489/hsps/widgetconfiguration.xml - ../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 +// Arabic languages +//***************** +../xuikon/37/wideimage.css /epoc32/data/Z/resource/homescreen/wideimage_2001f489/xuikon/37/wideimage.css +../xuikon/50/wideimage.css /epoc32/data/Z/resource/homescreen/wideimage_2001f489/xuikon/50/wideimage.css +../xuikon/57/wideimage.css /epoc32/data/Z/resource/homescreen/wideimage_2001f489/xuikon/57/wideimage.css +../xuikon/94/wideimage.css /epoc32/data/Z/resource/homescreen/wideimage_2001f489/xuikon/94/wideimage.css // Support for S60 builds //*********************** diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/wideimage_2001f489/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/wideimage_2001f489/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,18 +1,18 @@ - + - qhd_tch + qhd_tch - template + template - + 0x2001f48a @@ -56,4 +56,4 @@ - \ No newline at end of file + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/wideimage_2001f489/hsps/00/widgetconfiguration.xml --- a/idlehomescreen/data/qhd_tch/wideimage_2001f489/hsps/00/widgetconfiguration.xml Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/hsps/00/widgetconfiguration.xml Wed May 12 13:22:51 2010 +0300 @@ -1,28 +1,9 @@ - - + + - - - - - - - - - - - - - - - - - - - diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/wideimage_2001f489/rom/wideimage_resources.iby --- a/idlehomescreen/data/qhd_tch/wideimage_2001f489/rom/wideimage_resources.iby Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/rom/wideimage_resources.iby Wed May 12 13:22:51 2010 +0300 @@ -21,7 +21,18 @@ #if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) // Enabled by DTD-localization tools, language specific -data=ZPRIVATE\200159c0\install\wideimage_2001f489\xuikon\00\wideimage.o0000 \private\200159c0\install\wideimage_2001f489\xuikon\00\wideimage.o0000 +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\wideimage_2001f489\xuikon\37\wideimage.o0037 \private\200159c0\install\wideimage_2001f489\xuikon\37\wideimage.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\wideimage_2001f489\xuikon\50\wideimage.o0050 \private\200159c0\install\wideimage_2001f489\xuikon\50\wideimage.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\wideimage_2001f489\xuikon\57\wideimage.o0057 \private\200159c0\install\wideimage_2001f489\xuikon\57\wideimage.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\wideimage_2001f489\xuikon\94\wideimage.o0094 \private\200159c0\install\wideimage_2001f489\xuikon\94\wideimage.o0094 +#endif #endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.css --- a/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.css Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.css Wed May 12 13:22:51 2010 +0300 @@ -2,6 +2,7 @@ { nav-index: appearance; block-progression:rl; + direction: ltr; } box#image_container @@ -12,12 +13,10 @@ box#default_container { /* Will be updated by content policy */ - block-progression: rl; - direction:ltr; display: block; } -image#default_image +image#w_default_image { padding-top:9px; padding-bottom:9px; @@ -27,6 +26,20 @@ width: 64px; } +text#w_default_text +{ + padding-left:9px; + padding-right:9px; + height : 10u; + font-line-space: 15; + direction: ltr; + text-align:left; + text-overflow-mode: wrap; + font-family: EAknLogicalFontSecondaryFont; + font-size: 4u; + color: "SKIN(268458534 13056 74)"; +} + animation#loading { position: absolute; @@ -38,16 +51,3 @@ /* 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: 4u; - color: "SKIN(268458534 13056 74)"; -} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.xml --- a/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.xml Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.xml Wed May 12 13:22:51 2010 +0300 @@ -3,7 +3,7 @@ - + @@ -12,15 +12,15 @@ - + - - + + - - + + @@ -31,7 +31,7 @@ - + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/37/wideimage.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/37/wideimage.css Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,53 @@ +widget#wideimage_template +{ + nav-index: appearance; + block-progression:rl; + direction: rtl; +} + +box#image_container +{ + /* Will be updated by content policy */ + display: none; +} +box#default_container +{ + /* Will be updated by content policy */ + display: block; +} + +image#w_default_image +{ + padding-top:9px; + padding-bottom:9px; + padding-left:9px; + padding-right:9px; + height: 64px; + width: 64px; +} + +text#w_default_text +{ + padding-left:9px; + padding-right:9px; + height : 10u; + font-line-space: 15; + direction: ltr; + text-align: right; + text-overflow-mode: wrap; + font-family: EAknLogicalFontSecondaryFont; + font-size: 4u; + color: "SKIN(268458534 13056 74)"; +} + +animation#loading +{ + position: absolute; + top:9px; + left:9px; + right:273px; + width:30px; + height:30px; + /* Will be updated by dataplugin */ + display: none; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/50/wideimage.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/50/wideimage.css Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,53 @@ +widget#wideimage_template +{ + nav-index: appearance; + block-progression:rl; + direction: rtl; +} + +box#image_container +{ + /* Will be updated by content policy */ + display: none; +} +box#default_container +{ + /* Will be updated by content policy */ + display: block; +} + +image#w_default_image +{ + padding-top:9px; + padding-bottom:9px; + padding-left:9px; + padding-right:9px; + height: 64px; + width: 64px; +} + +text#w_default_text +{ + padding-left:9px; + padding-right:9px; + height : 10u; + font-line-space: 15; + direction: ltr; + text-align: right; + text-overflow-mode: wrap; + font-family: EAknLogicalFontSecondaryFont; + font-size: 4u; + color: "SKIN(268458534 13056 74)"; +} + +animation#loading +{ + position: absolute; + top:9px; + left:9px; + right:273px; + width:30px; + height:30px; + /* Will be updated by dataplugin */ + display: none; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/57/wideimage.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/57/wideimage.css Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,53 @@ +widget#wideimage_template +{ + nav-index: appearance; + block-progression:rl; + direction: rtl; +} + +box#image_container +{ + /* Will be updated by content policy */ + display: none; +} +box#default_container +{ + /* Will be updated by content policy */ + display: block; +} + +image#w_default_image +{ + padding-top:9px; + padding-bottom:9px; + padding-left:9px; + padding-right:9px; + height: 64px; + width: 64px; +} + +text#w_default_text +{ + padding-left:9px; + padding-right:9px; + height : 10u; + font-line-space: 15; + direction: ltr; + text-align: right; + text-overflow-mode: wrap; + font-family: EAknLogicalFontSecondaryFont; + font-size: 4u; + color: "SKIN(268458534 13056 74)"; +} + +animation#loading +{ + position: absolute; + top:9px; + left:9px; + right:273px; + width:30px; + height:30px; + /* Will be updated by dataplugin */ + display: none; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/94/wideimage.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/94/wideimage.css Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,53 @@ +widget#wideimage_template +{ + nav-index: appearance; + block-progression:rl; + direction: rtl; +} + +box#image_container +{ + /* Will be updated by content policy */ + display: none; +} +box#default_container +{ + /* Will be updated by content policy */ + display: block; +} + +image#w_default_image +{ + padding-top:9px; + padding-bottom:9px; + padding-left:9px; + padding-right:9px; + height: 64px; + width: 64px; +} + +text#w_default_text +{ + padding-left:9px; + padding-right:9px; + height : 10u; + font-line-space: 15; + direction: ltr; + text-align: right; + text-overflow-mode: wrap; + font-family: EAknLogicalFontSecondaryFont; + font-size: 4u; + color: "SKIN(268458534 13056 74)"; +} + +animation#loading +{ + position: absolute; + top:9px; + left:9px; + right:273px; + width:30px; + height:30px; + /* Will be updated by dataplugin */ + display: none; +} diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/vga_tch/desktop_20018eee/hsps/00/manifest.dat --- a/idlehomescreen/data/vga_tch/desktop_20018eee/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/vga_tch/desktop_20018eee/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ - + vga_tch diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/hsps/00/manifest.dat --- a/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ - + vga_tch diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/hsps/00/manifest.dat --- a/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ - + vga_tch diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/vga_tch/root_2001f48f/hsps/00/manifest.dat --- a/idlehomescreen/data/vga_tch/root_2001f48f/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/vga_tch/root_2001f48f/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ - + vga_tch diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/hsps/00/manifest.dat --- a/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ - + vga_tch diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/hsps/00/manifest.dat --- a/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ - + vga_tch diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/hsps/00/manifest.dat --- a/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ - + vga_tch diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/hsps/00/manifest.dat --- a/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ - + vga_tch diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/vga_tch/view1_2001fdb9/hsps/00/manifest.dat --- a/idlehomescreen/data/vga_tch/view1_2001fdb9/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ - + vga_tch diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/data/vga_tch/wideimage_10009dff/hsps/00/manifest.dat --- a/idlehomescreen/data/vga_tch/wideimage_10009dff/hsps/00/manifest.dat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/data/vga_tch/wideimage_10009dff/hsps/00/manifest.dat Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ - + vga_tch diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/exths/group/backup_registration.xml --- a/idlehomescreen/exths/group/backup_registration.xml Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/exths/group/bld.inf --- a/idlehomescreen/exths/group/bld.inf Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/exths/group/bld.inf Wed May 12 13:22:51 2010 +0300 @@ -27,11 +27,6 @@ ../rom/aicontainer.iby CORE_APP_LAYER_IBY_EXPORT_PATH(aicontainer.iby) -// Backup registration -//backup_registration.xml /epoc32/data/z/private/101fd657/backup_registration.xml -//backup_registration.xml /epoc32/release/winscw/udeb/z/private/101fd657/backup_registration.xml -//backup_registration.xml /epoc32/release/winscw/urel/z/private/101fd657/backup_registration.xml - // Generic configuration interface for component cenrep settings ../conf/activeidle.confml APP_LAYER_CONFML(activeidle.confml) ../conf/activeidle_10207467.crml APP_LAYER_CRML(activeidle_10207467.crml) diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/exths/rom/aicontainer.iby --- a/idlehomescreen/exths/rom/aicontainer.iby Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/exths/rom/aicontainer.iby Wed May 12 13:22:51 2010 +0300 @@ -23,7 +23,6 @@ #ifdef RD_CUSTOMIZABLE_AI ECOM_PLUGIN(aicontainer.dll,101FD657.rsc) -data=ZPRIVATE\101FD657\backup_registration.xml private\101FD657\backup_registration.xml #endif // RD_CUSTOMIZABLE_AI #endif // AIPLUGINTEST_IBY diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/help/data/xhtml.zip Binary file idlehomescreen/help/data/xhtml.zip has changed diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/help/inc/hmsc.hlp.hrh --- a/idlehomescreen/help/inc/hmsc.hlp.hrh Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/help/inc/hmsc.hlp.hrh Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/hscontentcontrol/bwins/hscontentcontrol.def --- a/idlehomescreen/hscontentcontrol/bwins/hscontentcontrol.def Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/hscontentcontrol/bwins/hscontentcontrol.def Wed May 12 13:22:51 2010 +0300 @@ -1,6 +1,7 @@ EXPORTS ?NewL@CHsContentControlUi@@SAPAV1@VTUid@@@Z @ 1 NONAME ; class CHsContentControlUi * CHsContentControlUi::NewL(class TUid) ?GetHsContentController@CHsContentControlFactory@@QAEPAVMHsContentControlUi@@ABVTDesC8@@@Z @ 2 NONAME ; class MHsContentControlUi * CHsContentControlFactory::GetHsContentController(class TDesC8 const &) - ?NewL@CHsContentControlFactory@@SAPAV1@XZ @ 3 NONAME ; class CHsContentControlFactory * CHsContentControlFactory::NewL(void) - ??1CHsContentControlFactory@@UAE@XZ @ 4 NONAME ; CHsContentControlFactory::~CHsContentControlFactory(void) + ??1CHsContentControlFactory@@UAE@XZ @ 3 NONAME ; CHsContentControlFactory::~CHsContentControlFactory(void) + ?NewL@CHsContentControlFactory@@SAPAV1@AAVCXnAppUiAdapter@@@Z @ 4 NONAME ; class CHsContentControlFactory * CHsContentControlFactory::NewL(class CXnAppUiAdapter &) + ?PrepareToExit@CHsContentControlFactory@@QAEXXZ @ 5 NONAME ; void CHsContentControlFactory::PrepareToExit(void) diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/hscontentcontrol/eabi/hscontentcontrol.def --- a/idlehomescreen/hscontentcontrol/eabi/hscontentcontrol.def Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/hscontentcontrol/eabi/hscontentcontrol.def Wed May 12 13:22:51 2010 +0300 @@ -1,8 +1,9 @@ EXPORTS _ZN19CHsContentControlUi4NewLE4TUid @ 1 NONAME _ZN24CHsContentControlFactory22GetHsContentControllerERK6TDesC8 @ 2 NONAME - _ZN24CHsContentControlFactory4NewLEv @ 3 NONAME + _ZN24CHsContentControlFactory4NewLER15CXnAppUiAdapter @ 3 NONAME _ZN24CHsContentControlFactoryD0Ev @ 4 NONAME _ZN24CHsContentControlFactoryD1Ev @ 5 NONAME _ZN24CHsContentControlFactoryD2Ev @ 6 NONAME + _ZN24CHsContentControlFactory13PrepareToExitEv @ 7 NONAME diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/hscontentcontrol/group/hscontentcontrol.mmp --- a/idlehomescreen/hscontentcontrol/group/hscontentcontrol.mmp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/hscontentcontrol/group/hscontentcontrol.mmp Wed May 12 13:22:51 2010 +0300 @@ -24,6 +24,7 @@ VENDORID VID_DEFAULT USERINCLUDE ../inc +USERINCLUDE ../../inc APP_LAYER_SYSTEMINCLUDE @@ -32,7 +33,7 @@ SOURCE hscontentcontrolfactory.cpp SOURCE hscontentcontrolui.cpp SOURCE hscontentcontrolecomlistener.cpp -SOURCE hscontentcontroluninstallmonitor.cpp +SOURCE hscontentcontrolswilistener.cpp //By default, the build tools look for the WINSCW def file in a BWINS directory //(at the same level as the directory containing the mmp file), @@ -59,7 +60,8 @@ LIBRARY estor.lib LIBRARY ecom.lib LIBRARY charconv.lib - +LIBRARY swiutils.lib +LIBRARY xn3layoutengine.lib #ifdef ENABLE_ABIV2_MODE DEBUGGABLE diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/hscontentcontrol/inc/hscontentcontrolfactory.h --- a/idlehomescreen/hscontentcontrol/inc/hscontentcontrolfactory.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/hscontentcontrol/inc/hscontentcontrolfactory.h Wed May 12 13:22:51 2010 +0300 @@ -24,11 +24,12 @@ // User includes #include "hscontentcontrolecomobserver.h" -#include "hscontentcontroluninstallobserver.h" +#include "hscontentcontrolswiobserver.h" // Forward declarations class CHsContentControlEComListener; -class CHsContentControlUninstallMonitor; +class CHsContentControlSwiListener; +class CXnAppUiAdapter; /** * Content control UI base class @@ -43,13 +44,13 @@ */ NONSHARABLE_CLASS( CHsContentControlFactory ) : public CBase, public MHsContentControlEComObserver, - public MHsContentControlUninstallObserver + public MHsContentControlSwiObserver { public: // Constructor and destructor /** * Two-phased constructor. */ - IMPORT_C static CHsContentControlFactory* NewL(); + IMPORT_C static CHsContentControlFactory* NewL( CXnAppUiAdapter& aAdapter ); /** * Destructor. @@ -63,24 +64,23 @@ */ void HandleEComChangeEvent(); -private: // from MHsContentControlUninstallObserver +private: // from MHsContentControlSwiObserver /** - * Notification of Uninstall event from SWI. - * @param aPkgUid The package UID which is being uninstalled. + * Notification of Install/Uninstall event from SWI. + * @param aUidList The package UID list which is being processed. */ - void HandleUninstallEvent( const TUid& aPkgUid ); + void HandleSwiEvent( const RArray& aUidList ); private: // Constructors /** * Constructor */ - CHsContentControlFactory(); + CHsContentControlFactory( CXnAppUiAdapter& aAdapter ); /** Second phase constructor */ void ConstructL(); - public: // New functions /** * @@ -88,7 +88,18 @@ IMPORT_C MHsContentControlUi* GetHsContentController( const TDesC8& aControllerType ); + /** + * + */ + IMPORT_C void PrepareToExit(); + private: + + /** + * Deregisters/Removes/Deletes plugin's views from AppUi. + */ + void ReleaseHsCcUi( CHsContentControlUi* aHsContentControlUi ); + /** * Finds and returns loaded ContentControlUi object from array. */ @@ -119,6 +130,11 @@ private: // Data /** + * Reference to XnAppUiAdapter. + */ + CXnAppUiAdapter& iAdapter; + + /** * An array of type CHsContentControlUi ( Owned ). */ RPointerArray< CHsContentControlUi > iHsContentControlUis; @@ -134,9 +150,9 @@ CHsContentControlEComListener* iHsContentControlEComListener; /** - * An object of type CHsContentControlUninstallMonitor ( Owned ). + * An object of type CHsContentControlSwiListener ( Owned ). */ - CHsContentControlUninstallMonitor* iHsContentControlUninstallMonitor; + CHsContentControlSwiListener* iHsContentControlSwiListener; }; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/hscontentcontrol/inc/hscontentcontrolswilistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/hscontentcontrol/inc/hscontentcontrolswilistener.h Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Utility class to listen SWI operations. +* +*/ + +#ifndef HSCONTENTCONTROLSWILISTENER_H +#define HSCONTENTCONTROLSWILISTENER_H + +// System includes +#include +#include + +// User includes +#include "hscontentcontrolswiobserver.h" + +// Forward declarations + +// Class declaration +/** +* @class CHsContentControlSwiListener +* +* @brief An instance of class CHsContentControlSwiListener which listens for +* SWI operations (installation, uninstallation , restore). +* +* @lib hscontentcontrol.lib +*/ +NONSHARABLE_CLASS( CHsContentControlSwiListener ) : public CActive + { +public: // constructors and destructor + static CHsContentControlSwiListener* NewL( + MHsContentControlSwiObserver& aObs ); + ~CHsContentControlSwiListener(); + +protected: // from CActive + void DoCancel(); + void RunL(); + +private: // new functions + CHsContentControlSwiListener( + MHsContentControlSwiObserver& aObs ); + void ConstructL(); + +private: // data + MHsContentControlSwiObserver& iObs; + RProperty iSwInstallKey; + }; + +#endif // HSCONTENTCONTROLSWILISTENER_H + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/hscontentcontrol/inc/hscontentcontrolswiobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/hscontentcontrol/inc/hscontentcontrolswiobserver.h Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface for getting notified for Swi events. +* +*/ + + +#ifndef HSCONTENTCONTROLSWIOBSERVER_H +#define HSCONTENTCONTROLSWIOBSERVER_H + +/** +* MHsContentControlSwiObserver +* +* @brief The observer of Swi operations. The derived class needs to implement +* the functions below and will be notified by CHsContentControlSwiListener +* +* @see CHsContentControlSwiListener +*/ +class MHsContentControlSwiObserver + { +public: + /** + * Notification of Swi event ( install/uninstall/restore) + * @param aUidList list of package UID which is being processed. + */ + virtual void HandleSwiEvent( const RArray& aUidList ) = 0; + }; + +#endif // HSCONTENTCONTROLSWIOBSERVER_H + +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/hscontentcontrol/inc/hscontentcontroluninstallmonitor.h --- a/idlehomescreen/hscontentcontrol/inc/hscontentcontroluninstallmonitor.h Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +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: Class to listen SWI uninstall operation. -* -*/ - -#ifndef HSCONTENTCONTROLUNINSTALLMONITOR_H -#define HSCONTENTCONTROLUNINSTALLMONITOR_H - -// System includes -#include -#include - -// User includes -#include "hscontentcontroluninstallobserver.h" - -// Forward declarations - -// Class declaration -/** -* @class CHsContentControlUninstallMonitor -* -* @brief An instance of class CHsContentControlUninstallMonitor which listens for -* uninstall event from SWI. -* -* @lib hscontentcontrol.lib -*/ -NONSHARABLE_CLASS( CHsContentControlUninstallMonitor ) : public CActive - { -public: // constructors and destructor - static CHsContentControlUninstallMonitor* NewL( - MHsContentControlUninstallObserver& aObs ); - ~CHsContentControlUninstallMonitor(); - -protected: // from CActive - void DoCancel(); - void RunL(); - -private: // new functions - CHsContentControlUninstallMonitor( - MHsContentControlUninstallObserver& aObs ); - void ConstructL(); - -private: // data - MHsContentControlUninstallObserver& iObs; - RProperty iSwUninstallKey; - }; - -#endif // HSCONTENTCONTROLUNINSTALLMONITOR_H - diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/hscontentcontrol/inc/hscontentcontroluninstallobserver.h --- a/idlehomescreen/hscontentcontrol/inc/hscontentcontroluninstallobserver.h Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Interface for getting notified for SWI uninstall event. -* -*/ - - -#ifndef HSCONTENTCONTROLUNINSTALLOBSERVER_H -#define HSCONTENTCONTROLUNINSTALLOBSERVER_H - -/** -* MHsContentControlUninstallObserver -* -* @brief The observer of uninstall operations. The derived class needs to implement -* the functions below and will be notified by CHsContentControlUninstallMonitor. -* -* @see CHsContentControlUninstallMonitor -*/ -class MHsContentControlUninstallObserver - { -public: - /** - * Notification of Uninstall event from SWI. - * @param aPkgUid The package UID which is being uninstalled. - */ - virtual void HandleUninstallEvent( const TUid& aPkgUid ) = 0; - }; - -#endif // HSCONTENTCONTROLUNINSTALLOBSERVER_H - -// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/hscontentcontrol/src/hscontentcontrolfactory.cpp --- a/idlehomescreen/hscontentcontrol/src/hscontentcontrolfactory.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/hscontentcontrol/src/hscontentcontrolfactory.cpp Wed May 12 13:22:51 2010 +0300 @@ -18,11 +18,13 @@ // System include files #include #include +#include // User include files +#include "xnappuiadapter.h" #include "hscontentcontrolfactory.h" #include "hscontentcontrolecomlistener.h" -#include "hscontentcontroluninstallmonitor.h" +#include "hscontentcontrolswilistener.h" // Local constants @@ -60,9 +62,11 @@ // CHsContentControlFactory::NewL() // ---------------------------------------------------------------------------- // -EXPORT_C CHsContentControlFactory* CHsContentControlFactory::NewL() +EXPORT_C CHsContentControlFactory* CHsContentControlFactory::NewL( + CXnAppUiAdapter& aAdapter ) { - CHsContentControlFactory* self = new ( ELeave ) CHsContentControlFactory(); + CHsContentControlFactory* self = + new ( ELeave ) CHsContentControlFactory( aAdapter ); CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); @@ -77,18 +81,19 @@ { iHsContentControlEComListener = CHsContentControlEComListener::NewL( *this ); + iHsContentControlSwiListener = + CHsContentControlSwiListener::NewL( *this ); + REComSession::ListImplementationsL( - KInterfaceUidContentController, iImplArray ); - - iHsContentControlUninstallMonitor = - CHsContentControlUninstallMonitor::NewL( *this ); + KInterfaceUidContentController, iImplArray ); } // ---------------------------------------------------------------------------- // CHsContentControlFactory::CHsContentControlFactory() // ---------------------------------------------------------------------------- // -CHsContentControlFactory::CHsContentControlFactory() +CHsContentControlFactory::CHsContentControlFactory( CXnAppUiAdapter& aAdapter ) + :iAdapter( aAdapter ) { } @@ -97,13 +102,14 @@ // ---------------------------------------------------------------------------- // EXPORT_C CHsContentControlFactory::~CHsContentControlFactory() - { + { + delete iHsContentControlEComListener; + delete iHsContentControlSwiListener; + iImplArray.ResetAndDestroy(); iImplArray.Close(); + iHsContentControlUis.ResetAndDestroy(); - - delete iHsContentControlEComListener; - delete iHsContentControlUninstallMonitor; } // --------------------------------------------------------------------------------- @@ -111,7 +117,7 @@ // --------------------------------------------------------------------------------- // EXPORT_C MHsContentControlUi* CHsContentControlFactory::GetHsContentController( - const TDesC8& aControlType ) + const TDesC8& aControlType ) { MHsContentControlUi* retval( FindHsContentController( aControlType ) ); @@ -152,6 +158,22 @@ return retval; } +// --------------------------------------------------------------------------------- +// CHsContentControlFactory::PrepareToExit() +// --------------------------------------------------------------------------------- +// +EXPORT_C void CHsContentControlFactory::PrepareToExit() + { + if ( iHsContentControlUis.Count() > 0 ) + { + for( TInt index( iHsContentControlUis.Count() - 1 ); index >= 0; --index ) + { + CHsContentControlUi* cc( iHsContentControlUis[ index ] ); + ReleaseHsCcUi( cc ); + } + } + } + // ---------------------------------------------------------------------------- // CHsContentControlFactory::FindHsContentController() // ---------------------------------------------------------------------------- @@ -186,24 +208,29 @@ } // ---------------------------------------------------------------------------- -// CHsContentControlFactory::HandleUninstallEvent() +// CHsContentControlFactory::HandleSwiEvent() // ---------------------------------------------------------------------------- // -void CHsContentControlFactory::HandleUninstallEvent( const TUid& aPkgUid ) +void CHsContentControlFactory::HandleSwiEvent( const RArray& aUidList ) { // ignore event if no plugin loaded. - if ( iHsContentControlUis.Count() > 0 ) + if ( iHsContentControlUis.Count() > 0 && aUidList.Count() > 0 ) { for( TInt index( iHsContentControlUis.Count() - 1 ); index >= 0; --index ) { CHsContentControlUi* cc( iHsContentControlUis[ index ] ); - // ImplUid of plugin must match Sis pkg uid - if ( cc && cc->ImplUid() == aPkgUid ) + for( TInt uidIndex( aUidList.Count() - 1 ); uidIndex >= 0 && cc; --uidIndex ) { - iHsContentControlUis.Remove( index ); - delete cc; - cc = NULL; - break; + // ImplUid of plugin must match Sis pkg uid + if ( cc->ImplUid() == aUidList[uidIndex] ) + { + // release ui and keep checking, multiple package might be being + // processed by SWI, this events comes once for all packages. + ReleaseHsCcUi( cc ); + iHsContentControlUis.Remove( index ); + delete cc; + cc = NULL; + } } } } @@ -229,7 +256,7 @@ // If an implementation is not present in present in the plugInArray then its removed. for( TInt index( iImplArray.Count() - 1 ); index >= 0 && !done; --index ) { - uid = plugInArray[ index ]->ImplementationUid(); + uid = iImplArray[ index ]->ImplementationUid(); CImplementationInformation* implInfo = FindPluginImplInfo( uid, plugInArray ); if ( implInfo && PluginUpgradeDowngrade( *implInfo ) ) @@ -245,6 +272,7 @@ CHsContentControlUi* cc( iHsContentControlUis[ innerIndex ] ); if ( cc && cc->ImplUid() == uid ) { + ReleaseHsCcUi( cc ); iHsContentControlUis.Remove( innerIndex ); delete cc; cc = NULL; @@ -310,6 +338,7 @@ CHsContentControlUi* cc( iHsContentControlUis[ innerIndex ] ); if ( cc && cc->ImplUid() == uid ) { + ReleaseHsCcUi( cc ); iHsContentControlUis.Remove( innerIndex ); delete cc; cc = NULL; @@ -323,4 +352,34 @@ return EFalse; } +// ---------------------------------------------------------------------------- +// CHsContentControlFactory::ReleaseHsCcUi +// ---------------------------------------------------------------------------- +// +void CHsContentControlFactory::ReleaseHsCcUi( + CHsContentControlUi* aHsContentControlUi ) + { + if ( &iAdapter && aHsContentControlUi ) + { + RPointerArray views; + + // notify plugin about deactivation + aHsContentControlUi->DeActivate(); + + // get all views from HsContentControlUi + aHsContentControlUi->Views( views ); + + for ( TInt i=0; i +#include // KSWIUidsCurrentlyBeingProcessed + +#include "hscontentcontrolswilistener.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CHsContentControlSwiListener::NewL() +// --------------------------------------------------------------------------- +// +CHsContentControlSwiListener* CHsContentControlSwiListener::NewL( + MHsContentControlSwiObserver& aObs ) + { + CHsContentControlSwiListener* self = + new( ELeave ) CHsContentControlSwiListener( aObs ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CHsContentControlSwiListener::~CHsContentControlSwiListener() +// --------------------------------------------------------------------------- +// +CHsContentControlSwiListener::~CHsContentControlSwiListener() + { + Cancel(); + iSwInstallKey.Close(); + } + +// --------------------------------------------------------------------------- +// CHsContentControlSwiListener::DoCancel() +// --------------------------------------------------------------------------- +// +void CHsContentControlSwiListener::DoCancel() + { + if ( IsActive() ) + { + iSwInstallKey.Cancel(); + } + } + +// --------------------------------------------------------------------------- +// CHsContentControlSwiListener::RunL() +// --------------------------------------------------------------------------- +// +void CHsContentControlSwiListener::RunL() + { + RArray uidList; + + // get list of uids being processed. + if ( Swi::GetAllUids( uidList ) == KErrNone ) + { + iObs.HandleSwiEvent( uidList ); + uidList.Reset(); + } + + // close array + uidList.Close(); + + // keep monitoring + iSwInstallKey.Subscribe( iStatus ); + SetActive(); + } + +// --------------------------------------------------------------------------- +// CHsContentControlSwiListener::CHsContentControlSwiListener() +// --------------------------------------------------------------------------- +// +CHsContentControlSwiListener::CHsContentControlSwiListener( + MHsContentControlSwiObserver& aObs ) + : CActive( CActive::EPriorityStandard ), + iObs( aObs ) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// CHsContentControlSwiListener::ConstructL() +// --------------------------------------------------------------------------- +// +void CHsContentControlSwiListener::ConstructL() + { + if ( KErrNone == iSwInstallKey.Attach( + KUidSystemCategory, KSWIUidsCurrentlyBeingProcessed ) ) + { + iSwInstallKey.Subscribe( iStatus ); + SetActive(); + } + } + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/hscontentcontrol/src/hscontentcontroluninstallmonitor.cpp --- a/idlehomescreen/hscontentcontrol/src/hscontentcontroluninstallmonitor.cpp Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +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: Class to listen SWI uninstall operation. -* -*/ - -#include "hscontentcontroluninstallmonitor.h" -#include - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CHsContentControlUninstallMonitor::NewL() -// --------------------------------------------------------------------------- -// -CHsContentControlUninstallMonitor* CHsContentControlUninstallMonitor::NewL( - MHsContentControlUninstallObserver& aObs ) - { - CHsContentControlUninstallMonitor* self = - new ( ELeave ) CHsContentControlUninstallMonitor( aObs ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CHsContentControlUninstallMonitor::~CHsContentControlUninstallMonitor() -// --------------------------------------------------------------------------- -// -CHsContentControlUninstallMonitor::~CHsContentControlUninstallMonitor() - { - Cancel(); - iSwUninstallKey.Close(); - } - -// --------------------------------------------------------------------------- -// CHsContentControlUninstallMonitor::DoCancel() -// --------------------------------------------------------------------------- -// -void CHsContentControlUninstallMonitor::DoCancel() - { - if ( IsActive() ) - { - iSwUninstallKey.Cancel(); - } - } - -// --------------------------------------------------------------------------- -// CHsContentControlUninstallMonitor::RunL() -// --------------------------------------------------------------------------- -// -void CHsContentControlUninstallMonitor::RunL() - { - iSwUninstallKey.Subscribe( iStatus ); - SetActive(); - - TInt value = 0; - if( iSwUninstallKey.Get( value ) == KErrNone ) - { - TUid uid( KNullUid ); - uid.iUid = value; - iObs.HandleUninstallEvent( uid ); - } - } - -// --------------------------------------------------------------------------- -// CHsContentControlUninstallMonitor::CHsContentControlUninstallMonitor() -// --------------------------------------------------------------------------- -// -CHsContentControlUninstallMonitor::CHsContentControlUninstallMonitor( - MHsContentControlUninstallObserver& aObs ) - : CActive( CActive::EPriorityStandard ), - iObs( aObs ) - { - CActiveScheduler::Add( this ); - } - -// --------------------------------------------------------------------------- -// CHsContentControlUninstallMonitor::ConstructL() -// --------------------------------------------------------------------------- -// -void CHsContentControlUninstallMonitor::ConstructL() - { - if ( KErrNone == iSwUninstallKey.Attach( - KPSUidSWInstallerUiNotification, KSWInstallerUninstallation ) ) - { - iSwUninstallKey.Subscribe( iStatus ); - SetActive(); - } - } - -// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/ai3.hrh --- a/idlehomescreen/inc/ai3.hrh Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/ai3.hrh Wed May 12 13:22:51 2010 +0300 @@ -22,6 +22,7 @@ #include //Enable performance logs //#define AI3_DEBUG_PERFORMANCE +//#define HS_NETWORK_MONITOR //Run AI3 on startup #define FF_HOMESCREEN_COMMON_IDLEFW diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/ainativeuiplugins.h --- a/idlehomescreen/inc/ainativeuiplugins.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/ainativeuiplugins.h Wed May 12 13:22:51 2010 +0300 @@ -20,11 +20,10 @@ #define AINATIVEUIPLUGINS_H #include -#include "aipropertyextension.h" -#include "aiprofilepluginuids.hrh" +#include const TUid KDeviceStatusPluginUid = { AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DEVSTAPLUGIN }; -_LIT( KDeviceStatusPluginName, "0x102750F8" ); +_LIT( KDeviceStatusPluginName, "DeviceStatus" ); const TUid KShortcutPluginUid = { AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SHORTCUTPLUGIN }; _LIT( KShortcutPluginName, "Shortcut" ); diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xnappuiadapter.h --- a/idlehomescreen/inc/xnappuiadapter.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xnappuiadapter.h Wed May 12 13:22:51 2010 +0300 @@ -34,6 +34,7 @@ class MHsContentControlUi; class CXnEffectManager; class MHsContentControl; + // Class declaration /** * Avkon adapter for Xuikon. @@ -61,6 +62,14 @@ // New functions /** + * Removes and deregisters view from AppUi + * + * @since S60 5.2 + * @param aView view to deregister + */ + IMPORT_C void RemoveViewL( CAknView& aView ); + + /** * Get the UI engine * * @since Series 60 3.1 @@ -90,20 +99,24 @@ * To be overriden by subclass. * * @since S60 5.0 - * @param aList list of plugins to load + * @param aPublisher Publisher to load + * @param aReason Load reason + * @return KErrNone if succesful, system wide error code otherwise */ - IMPORT_C virtual void LoadDataPluginsL( - RPointerArray< CXnNodeAppIf >& aList ); + IMPORT_C virtual TInt LoadPublisher( + CXnNodeAppIf& aPublisher, TInt aReason ); /** * Handles data plugin destroying. * To be overriden by subclass. * * @since S60 5.0 - * @param aList list of plugins to destroy + * @param aPublisher Publisher to destroy + * @param aReason Destroy reason + * @return KErrNone if succesful, system wide error code otherwise */ - IMPORT_C virtual void DestroyDataPluginsL( - RPointerArray< CXnNodeAppIf >& aList ); + IMPORT_C virtual TInt DestroyPublisher( + CXnNodeAppIf& aPublisher, TInt aReason ); /** * Handles dynamic menuitem element initialisation. @@ -117,16 +130,6 @@ IMPORT_C virtual TBool DynInitMenuItemL( const TDesC& aItemType, RPointerArray< CXnNodeAppIf >* aList = NULL ); - - /** - * Determines and sets data plugins to online. - * To be overriden by subclass. - * - * @since S60 5.0 - * @param aList List of data plugins - */ - IMPORT_C virtual void SetOnlineStateL( - RPointerArray< CXnNodeAppIf >& aList ); /* * Returns the Xml Ui view as CAknView reference. @@ -135,15 +138,7 @@ * @return Xml Ui View */ IMPORT_C CAknView& CXnAppUiAdapter::View() const; - - /** - * Handles page switch changes - * To be overriden by subclass. - * - * @since S60 5.0 - */ - IMPORT_C virtual void HandlePageSwitch(); - + /** * Handles changes when entering or exiting edit mode * To be overriden by subclass. @@ -153,24 +148,56 @@ */ IMPORT_C virtual void HandleEnterEditModeL( TBool aEnter ); -public: /** - * From CEikAppUi. + * Routes the events from external rendering plug-ins to content plug-ins. + * To be overriden by subclass. + * + * @since S60 5.2 + * @param aEvent Event string + * @param aDestination Destination node for the event + */ + IMPORT_C virtual void HandleEventL( const TDesC& aEvent, + CXnNodeAppIf& aDestination ); + + /** + * This is called when (initial) view is ready + * To be overriden by subclass. + * + * @since S60 5.2 + */ + IMPORT_C virtual void HandleUiReadyEventL(); + + /** * Second-phase constructor * * @since Series 60 3.1 */ IMPORT_C void ConstructL(); -protected: + /** + * From CEikAppUi. + * + * @since Series 60 3.1 + */ + IMPORT_C void ProcessMessageL( TUid aUid, const TDesC8& aParams ); +protected: + // from CAknViewAppUi + /** - * From CAknAppUi. + * @see CAknViewAppUi * * @since Series 60 3.1 */ IMPORT_C void HandleResourceChangeL( TInt aType ); - + + /** + * @see CAknViewAppUi + * + * @since S60 5.2 + */ + IMPORT_C void PrepareToExit(); + public: // new functions @@ -255,13 +282,18 @@ * Makes focus control visible * * @since S60 5.0 - */ + */ void ShowFocus(); private: // Data /** + * flag for application exit + */ + TBool iExitingApp; + + /** * application uid */ TUid iApplicationUid; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xncomponent.h --- a/idlehomescreen/inc/xncomponent.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xncomponent.h Wed May 12 13:22:51 2010 +0300 @@ -35,7 +35,7 @@ * Xuikon component base class. * * @ingroup group_xnlayoutengine - * @lib ?library + * @lib xnlayoutengine.lib * @since Series 60 3.1 */ class CXnComponent : public CBase @@ -121,6 +121,18 @@ * Two-phased constructor. */ IMPORT_C void ConstructL(); + +public: + + /** + * Routes the data stream for the external rendering plugin. + * + * @since Series 60 5.2 + * @param aData Data stream. + * @param aType Type of the stream. + * @param aIndex Index of the data. + */ + IMPORT_C void SetDataL( const TDesC8& aData, const TDesC& aType, TInt aIndex ); private: // Data diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xncontroladapter.h --- a/idlehomescreen/inc/xncontroladapter.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xncontroladapter.h Wed May 12 13:22:51 2010 +0300 @@ -420,6 +420,11 @@ * Remove all child adapters */ void RemoveChildAdapters(); + + /** + * Set Longtap delays + */ + void SetLongTapDelays( const TInt aStartDelay, const TInt aLongTapDelay ); /** * Get child adapter list i.e which are not window owning controls @@ -430,6 +435,16 @@ * Determines wheter control refuses focus loss */ virtual TBool RefusesFocusLoss() const { return EFalse; }; + + /** + * Routes the data stream for the external rendering plugin. + * + * @since Series 60 5.2 + * @param aData Data stream. + * @param aType Type of the stream. + * @param aIndex Index of the data. + */ + IMPORT_C virtual void SetDataL( const TDesC8& aData, const TDesC& aType, TInt aIndex ); private: // Data @@ -445,6 +460,16 @@ * Own. */ CAknLongTapDetector* iLongTapDetector; + + /** + * Long tap delay + */ + TInt iCurrentLongTapTimeDelay; + + /** + * Start Long tap delay + */ + TInt iCurrentLongTapStartDelay; }; // Inline functions diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xneditmode.h --- a/idlehomescreen/inc/xneditmode.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xneditmode.h Wed May 12 13:22:51 2010 +0300 @@ -151,13 +151,6 @@ * @since Series 60 5.0 */ void UpdateScreen(); - - /** - * Sets the title for status pane - * - * @since Series 60 5.0 - */ - void SetStatusPaneTitleL(); private: // Constructors diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xnlistquerydialogadapter.h --- a/idlehomescreen/inc/xnlistquerydialogadapter.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xnlistquerydialogadapter.h Wed May 12 13:22:51 2010 +0300 @@ -29,6 +29,7 @@ // FORWARD DECLARATIONS class CXnNodePluginIf; class CXnUiEngine; +class CAknListQueryDialog; // CLASS DECLARATION @@ -200,6 +201,10 @@ void ModifyDynamicEventL( TInt aIndex ); private: // Data + + // Dialog + CAknListQueryDialog* iDialog; + // Node CXnNodePluginIf& iNode; /** diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xnmenu.h --- a/idlehomescreen/inc/xnmenu.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xnmenu.h Wed May 12 13:22:51 2010 +0300 @@ -137,6 +137,12 @@ */ virtual CXnNodePluginIf* SoftKeyL( XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ) = 0; + /** + * Returns softkey node, which should handle key event. + * @return softkey node which should handle key event, NULL if not available. + */ + virtual CXnNodePluginIf* KeyEventNode() = 0; + /** * Sets MXnMenuObserver observer * @since S60 5.1 @@ -152,10 +158,11 @@ /** * Tries to display menubar - * @since S60 5.1 - * @param aMenuNodeId the menu node id + * @since S60 5.2 + * @param aMenuNodeId the menu node id + * @param aContextMenu ETrue if context menu should be displayed, EFalse otherwise */ - virtual void TryDisplayingMenuBarL( const TDesC& aMenuNodeId ) = 0; + virtual void TryDisplayingMenuBarL( const TDesC& aMenuNodeId, TBool aContextMenu ) = 0; }; } @@ -220,6 +227,11 @@ */ CXnNodePluginIf* SoftKeyL( XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ); + /** + * @see MXnMenuInterface::KeyEventNode + */ + CXnNodePluginIf* KeyEventNode(); + /** * @see MXnMenuInterface::SetObserver */ @@ -233,13 +245,13 @@ /** * @see MXnMenuInterface::TryDisplayingMenuBarL */ - void TryDisplayingMenuBarL( const TDesC& aMenuNodeId ); - - + void TryDisplayingMenuBarL( const TDesC& aMenuNodeId, TBool aContextMenu ); + /** * @see MXnComponentInterface::MakeInterfaceL */ - XnComponentInterface::MXnComponentInterface* MakeInterfaceL( const TDesC8& aType ); + XnComponentInterface::MXnComponentInterface* MakeInterfaceL( const TDesC8& aType ); + private: /** diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xnmenuadapter.h --- a/idlehomescreen/inc/xnmenuadapter.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xnmenuadapter.h Wed May 12 13:22:51 2010 +0300 @@ -148,6 +148,12 @@ CXnNodePluginIf* SoftKeyL( XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ); /** + * Returns softkey node, which should handle key event. + * @return softkey node which should handle key event, NULL if not available. + */ + CXnNodePluginIf* KeyEventNode(); + + /** * Finds softkey node by given position * @since Series 60 5.0 */ @@ -155,10 +161,11 @@ /** * Tries to display menubar - * @since Series 60 5.1 + * @since Series 60 5.2 * @param aMenuNodeId the menu node id + * @param aContextMenu ETrue if context menu should be displayed, EFalse otherwise */ - void TryDisplayingMenuL( const TDesC& aMenuNodeId ); + void TryDisplayingMenuL( const TDesC& aMenuNodeId, TBool aContextMenu ); public: // from CCoeControl @@ -384,6 +391,7 @@ TBool iUpdateLskAppearance; TBool iUpdateMskAppearance; TBool iUpdateRskAppearance; + TBool iContextMenu; CXnSoftkeyItem* iVisibleLSK; CXnSoftkeyItem* iVisibleRSK; CXnSoftkeyItem* iVisibleMSK; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xnnode.h --- a/idlehomescreen/inc/xnnode.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xnnode.h Wed May 12 13:22:51 2010 +0300 @@ -888,62 +888,6 @@ * @see GetPropertyL * @return The property mapped to the key or NULL if not found. */ - CXnProperty* VisibleRowsL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* GridColumnsL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* GridOrientationL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* GridVerDirectionL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* GridHorDirectionL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* FocusHorLoopingL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* FocusVerLoopingL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ CXnProperty* ZIndexL(); /** @@ -971,30 +915,6 @@ CXnProperty* BackgroundImageL(); /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* RefL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* GridScrollBarMarginL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* GridScrollBarWidthL(); - - /** * Sets the pointer of DOM node * * @since S60 3.1 @@ -1052,27 +972,6 @@ void FixAdaptiveSizeL( const TSize& aFixedSize ); /** - * Restarts the timer in a timed trigger. - * - * @param aDelay Delay in microseconds. If delay is zero, then the timer - * is only cancelled. - */ - void RestartTimedTrigger( TInt aDelay = 0 ); - - /** - * Sets default trigger delay. - * - * @param aDelay delay in microseconds. If new delay is not set, then - * this value is used in restarting the timer. - */ - void SetTriggerDelay( TTimeIntervalMicroSeconds32 aDelay ); - - /** - * Returns the default trigger delay. - */ - TTimeIntervalMicroSeconds32 TriggerDelay(); - - /** * Marks node as dirty, adds it to UiEngine's dirty list and * clears rendered and laidout from the node and its children. * @@ -1184,10 +1083,6 @@ */ CXnNodeAppIf* iAppIf; - /** - * delay in microseconds for timer. - */ - TTimeIntervalMicroSeconds32 iTriggerDelay; }; #endif diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xnnodeappif.h --- a/idlehomescreen/inc/xnnodeappif.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xnnodeappif.h Wed May 12 13:22:51 2010 +0300 @@ -30,6 +30,7 @@ class CXnProperty; class CXnNode; class TXnUiEngineAppIf; +class CXnComponent; namespace XnComponentInterface { @@ -247,6 +248,14 @@ * Get namespace of this node */ IMPORT_C const TDesC8& Namespace(); + + /** + * Get the component object of the node. + * + * @since Series 60 5.2 + * @return component object + */ + IMPORT_C CXnComponent& Component(); private: // Data diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xnnodeimpl.h --- a/idlehomescreen/inc/xnnodeimpl.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xnnodeimpl.h Wed May 12 13:22:51 2010 +0300 @@ -33,7 +33,6 @@ class CXnProperty; class CXnNode; class CXnUiEngine; -class CGridPropertyCache; class CLayoutPropertyCache; class CXnDomNode; class CXnScrollableControlAdapter; @@ -797,62 +796,6 @@ * @see GetPropertyL * @return The property mapped to the key or NULL if not found. */ - CXnProperty* VisibleRowsL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* GridColumnsL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* GridOrientationL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* GridVerDirectionL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* GridHorDirectionL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* FocusHorLoopingL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* FocusVerLoopingL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ CXnProperty* ZIndexL(); /** @@ -880,30 +823,6 @@ CXnProperty* BackgroundImageL(); /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* RefL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* GridScrollBarMarginL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - CXnProperty* GridScrollBarWidthL(); - - /** * Sets the pointer of DOM node * * @since S60 3.1 @@ -953,29 +872,6 @@ void FixAdaptiveSizeL( const TSize& aFixedSize ); /** - * Callback which will be called by the CPeriodic. - * - * @param aPtr User defined pointer. - * @return ETrue if the method should be called again. - */ - static TInt PeriodicEventL( TAny* aPtr ); - - /** - * Returns a pointer to the periodic timer (for timed triggers). - */ - CPeriodic* PeriodicTimer(); - - /** - * Creates a periodic timer (iPeriodicTimer). - */ - void CreatePeriodicL(); - - /** - * Deletes a periodict timer (iPeriodicTimer) - */ - void DeletePeriodic(); - - /** * Marks node as dirty, adds it to UiEngine's dirty list and * clears rendered and laidout from the node and its children. * @@ -1016,7 +912,7 @@ * Gets scrollable control. */ CXnScrollableControlAdapter* ScrollableControl(); - + private: TInt DoSetPropertyL( CXnProperty* aPropery ); @@ -1129,12 +1025,6 @@ RArray< CXnDomProperty::TPseudoClass > iStates; /** - * Local cache for property with name KRef. - * Not own. - */ - CXnProperty* iRef; - - /** * Local cache for property with name KName. * Not own. */ @@ -1186,12 +1076,6 @@ * Local property cache. * Own. */ - CGridPropertyCache* iGridPropertyCache; - - /** - * Local property cache. - * Own. - */ CLayoutPropertyCache* iLayoutPropertyCache; /** @@ -1216,11 +1100,6 @@ */ TInt iAdaptive; - /** - * The timer for the timed triggers. - * Own. - */ - CPeriodic* iPeriodicTimer; }; #endif diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xnnodepluginif.h --- a/idlehomescreen/inc/xnnodepluginif.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xnnodepluginif.h Wed May 12 13:22:51 2010 +0300 @@ -390,86 +390,6 @@ * @see GetPropertyL * @return The property mapped to the key or NULL if not found. */ - IMPORT_C CXnProperty* VisibleRowsL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - IMPORT_C CXnProperty* GridColumnsL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - IMPORT_C CXnProperty* GridOrientationL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - IMPORT_C CXnProperty* GridVerDirectionL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - IMPORT_C CXnProperty* GridHorDirectionL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - IMPORT_C CXnProperty* FocusHorLoopingL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - IMPORT_C CXnProperty* FocusVerLoopingL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - IMPORT_C CXnProperty* RefL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - IMPORT_C CXnProperty* GridScrollBarWidthL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ - IMPORT_C CXnProperty* GridScrollBarMarginL(); - - /** - * Get property as indicated by method name. - * - * @see GetPropertyL - * @return The property mapped to the key or NULL if not found. - */ IMPORT_C CXnProperty* PathL(); /** diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xnoomsyshandler.h --- a/idlehomescreen/inc/xnoomsyshandler.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xnoomsyshandler.h Wed May 12 13:22:51 2010 +0300 @@ -71,7 +71,8 @@ EMem1MB = 1024000, EMem2MB = 2048000, EMem3MB = 3072000, - EMem4MB = 4096000 + EMem4MB = 4096000, + EMem6MB = 6144000 }; public: // Construction / destruction. diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xnproperty.h --- a/idlehomescreen/inc/xnproperty.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xnproperty.h Wed May 12 13:22:51 2010 +0300 @@ -48,27 +48,13 @@ _LIT8(KInitialFocus, "_s60-initial-focus"); _LIT8(KFocusAppearance, "_s60-focus-appearance"); _LIT8(KDisabled, "disabled"); -// _LIT8(KLocked, "locked"); -// _LIT8(KStyleLocked, "stylelocked"); _LIT8(KLongTap, "_s60-longtap"); _LIT8(KSwipe, "swipe"); _LIT8(KSwipeDestination, "_s60-swipe-destination"); _LIT8(KBackgroundMask, "backgroundmask" ); - _LIT8(KStylusStates, "stylusstates"); - /*_LIT8(KTouchFeedbackDown, "touchfeedbackdown"); - _LIT8(KTouchFeedbackUp, "touchfeedbackup"); - _LIT8(KTouchFeedbackDrag, "touchfeedbackdrag"); - _LIT8(KTouchFeedbackLongTap, "touchfeedbacklongtap");*/ - _LIT8(KEventFilter, "eventfilter"); _LIT8(KEffectId, "effectid"); - _LIT8(KKeyMoveMode, "keymovemode"); _LIT8(KSizeAware, "sizeaware"); _LIT8(KVisualisationAware, "visualisationaware"); - /*namespace touchfeedback - { - _LIT8(KFeedbackBasic, "basic"); - _LIT8(KFeedbackSensitive, "sensitive"); - }*/ } namespace tooltip { @@ -77,7 +63,6 @@ _LIT8(KPositionHint, "_s60-position-hint"); namespace positionhint { -// _LIT8(KNone, "none"); _LIT8(KAboveLeft, "aboveleft"); _LIT8(KAboveRight, "aboveright"); _LIT8(KBelowLeft, "belowleft"); @@ -86,21 +71,18 @@ _LIT8(KLeft, "left"); } } - namespace styluspopup + namespace popup { - _LIT8(KPositionHint, "_s60-position-hint"); - namespace positionhint + _LIT8(KPopupType, "_s60-popup-type"); + + namespace popuptype { - _LIT8(KAbove, "above"); -// _LIT8(KBelow, "below"); - } - } + _LIT8(KNormal, "normal"); + _LIT8(KPermanent, "permanent"); + } + } namespace view { -// _LIT8(KUid, "uid"); - _LIT8(KInitial, "initial"); -// _LIT8(KTitle, "title"); - _LIT8(KFocusVisibility, "_s60-focus-visibility"); _LIT8(KStatusPaneLayout, "_s60-status-pane-layout"); namespace statuspanelayout { @@ -112,59 +94,18 @@ _LIT8( KWideScreenFlat3Softkeys, "widescreen-flat-3softkeys" ); } } - namespace grid - { -// _LIT8(KType, "type"); -// namespace type -// { -// _LIT8(KSelection, "selection"); -// _LIT8(KMarkable, "markable"); -// } -// _LIT8(KSelectionType, "selectiontype"); -// namespace selectiontype -// { -// _LIT8(KSingle, "single"); -// _LIT8(KMulti, "multi"); -// } -// _LIT8(KMarkingElement, "markingelement"); -// _LIT8(KMarkingElementOff, "markingelementoff"); -// _LIT8(KOpeningEffect, "openingeffect"); - _LIT8(KS60GridColumns, "_s60-grid-columns"); - _LIT8(KS60VisibleRows, "_s60-visible-list-rows"); -// _LIT8(KS60GridColumnsLandscape, "_s60-grid-columns-landscape"); -// _LIT8(KS60VisibleRowsLandscape, "_s60-visible-list-rows-landscape"); -// _LIT8(KS60InitialSelection, "_s60-initial-list-selection"); - _LIT8(KS60FocusHorLooping, "_s60-list-focus-horizontal-looping"); - _LIT8(KS60FocusVerLooping, "_s60-list-focus-vertical-looping"); - namespace s60_focus_looping - { - _LIT8(KStop, "stop"); -// _LIT8(KLoop, "loop"); -// _LIT8(KSnake, "snake"); - } - _LIT8(KS60GridOrientation, "_s60-grid-orientation"); - _LIT8(KS60GridVerDirection, "_s60-grid-ver-direction"); //lr, rl - _LIT8(KS60GridHorDirection, "_s60-grid-hor-direction"); //tb, bt -// _LIT8(KS60GridPreserveImageRatio, "_s60-grid-preserve-image-ratio"); - _LIT8(KS60GridScrollbarWidth, "_s60-grid-scrollbar-width"); - _LIT8(KS60GridScrollbarMargin, "_s60-grid-scrollbar-margin"); - _LIT8(KGridCellTemplate, "gridcelltemplate"); - _LIT8(KListRowTemplate, "listrowtemplate"); - } namespace newsticker { _LIT8(KXnNewsticker, "newsticker"); _LIT8(KXnScrollAmount, "_s60-scroll-amount"); _LIT8(KXnScrollDelay, "_s60-scroll-delay"); _LIT8(KXnStartDelay, "_s60-start-delay"); - _LIT8(KXnNewstickerAnimationDelay, "_s60-animation-delay"); _LIT8(KDisplayTime, "_s60-display-time"); _LIT8(KScrollBehaviour, "_s60-scroll-behaviour"); _LIT8(KScrollLoop, "_s60-scroll-loop"); _LIT8(KRestartAfterUpdate, "_s60-restart-after-update"); namespace scroll_behaviour { -// _LIT8(KScroll, "scroll"); _LIT8(KSlide, "slide"); _LIT8(KAlternate, "alternate"); _LIT8(KScrollAlternate, "scroll-alternate"); @@ -175,44 +116,10 @@ _LIT8(KTitleIndex, "titleindex" ); _LIT8(KTitle, "title" ); } -/* namespace trackster - { - _LIT8( KTrackster, "trackster" ); - _LIT8( KTracksterCellTemplate, "trackstercelltemplate" ); - _LIT8( KText, "text" ); - _LIT8( KImage, "image" ); - _LIT8( KCurveTypeCurve, "trackstercurve" ); - _LIT8( KCurveTypeZoom, "tracksterzoom" ); - _LIT8( KKeyPoint, "keypoint" ); - _LIT8( KXCoordinate, "_s60-co-ordinate-x" ); - _LIT8( KYCoordinate, "_s60-co-ordinate-y" ); - _LIT8( KScrollTime, "_S60-scroll-time" ); - _LIT8( KS60VisibleFocus, "_s60-visible-focus" ); - _LIT8( KTracsterItems, "tracksteritems" ); - _LIT8( KItemCount, "_s60-item-count" ); - _LIT8( KVisibleFocus, "_s60-visible-focus" ); - _LIT8( KItemPoints, "_s60-item-points" ); - _LIT8( KTracksterType, "trackstertype" ); - _LIT8( KTypeContainer, "container" ); - _LIT8( KTypePreview, "preview" ); - }*/ -/* namespace anim - { - _LIT8(KS60ZoomingFactor, "_s60-zooming-factor"); - _LIT8(KS60ZoomingTime, "_s60-zooming-time"); - _LIT8(KS60StartDelay, "_s60-start-delay"); - _LIT8(KS60AnimationDelay, "_s60-animation-delay"); - _LIT8(KS60LoopAmount, "_s60-loop-amount"); - _LIT8(KS60SmoothEnding, "_s60-smooth-ending"); - _LIT8(KS60HighlightAnimation, "_s60-highlight-animation"); - _LIT8(KS60FocusAnimationTime, "_s60-focus-animation-time"); - _LIT8(KS60HWAcceleration, "_s60-hw-acceleration"); - }*/ namespace menu { namespace menutype { -// _LIT8(KMenuOptions, "menuoptions"); _LIT8(KMenuOptionsNoTaskSwapper, "menuoptionsnotaskswapper"); } _LIT8(KMenuItem, "menuitem" ); @@ -221,11 +128,8 @@ _LIT8(KMenuType, "menutype"); _LIT8(KEvent, "event"); _LIT8(KLabel, "label"); -// _LIT8(KSelectionType, "selectiontype"); _LIT8(KChecked, "checked"); -// _LIT8(KMSKDotImage8,"#mskdot"); _LIT(KMSKDotImage16,"#mskdot"); -// _LIT(KMSKDialerImage, "#dialer"); _LIT8(KItemType, "type"); } namespace listquerydialog @@ -251,10 +155,6 @@ _LIT8(KModeEdit, "mode_edit"); } } - namespace text - { -// _LIT8(KLabel, "label"); - } namespace image { _LIT8(KPath, "path"); @@ -270,7 +170,6 @@ { _LIT8(KDigital, "digital"); _LIT8(KAnalog, "analog"); -// _LIT8(KLocale, "locale"); } _LIT8(KS60AmPmFontSize, "_s60-ampm-font-size" ); @@ -287,6 +186,13 @@ _LIT8( KMute, "mute" ); _LIT8( KVolumeLevelAdjustment, "_s60-volume-level-adjustment" ); } + namespace texteditor + { + _LIT8( KEditorMarginLeft, "editor-margin-left" ); + _LIT8( KEditorMarginRight, "editor-margin-right" ); + _LIT8( KEditorMarginTop, "editor-margin-top" ); + _LIT8( KEditorMarginBottom, "editor-margin-bottom" ); + } namespace action { _LIT8(KActions, "actions"); @@ -299,7 +205,6 @@ namespace trigger { _LIT8(KName, "name"); - _LIT8(KDelay, "delay"); namespace name { _LIT8(KLeft, "left"); @@ -309,7 +214,6 @@ _LIT8(KDownAndUp, "downup"); _LIT8(KActivate, "activate"); _LIT8(KHold, "hold"); -// _LIT8(KHover, "hover"); _LIT8(KFocus, "focus"); _LIT8(KPassiveFocus, "passivefocus"); _LIT8(KGainFocus, "gainfocus"); @@ -317,28 +221,19 @@ _LIT8(KKeyEvent, "keyevent"); _LIT8(KViewActivate, "viewactivate"); _LIT8(KViewDeactivate, "viewdeactivate"); -// _LIT8(KStartup, "startup"); -// _LIT8(KShutdown, "shutdown"); _LIT8(KScreenDeviceChange, "screendevicechange"); -// _LIT8(KUiDefinitionModificationStart, "uidefinitionmodificationstart"); -// _LIT8(KUiDefinitionModificationEnd, "uidefinitionmodificationend"); - _LIT8(KForeground, "foreground"); - _LIT8(KBackground, "background"); _LIT8(KStylus, "stylus"); _LIT8(KGainVisualisation, "gainvisualisation"); _LIT8(KLoseVisualisation, "losevisualisation"); - /*_LIT8(KGainFocusNotification, "gainfocusnotification");*/ _LIT8(KSwipe, "swipe"); _LIT8(KSizeChanged, "sizechanged"); _LIT8(KWidgetAmount, "widgetamount"); _LIT8(KTitleToScroll, "titletoscroll"); _LIT8(KTitleScrolled, "titlescrolled"); _LIT8(KTitleIndex, "titleindex"); - /*_LIT8(KViewPagesCountChanged, "viewpagescountchanged");*/ _LIT8(KCallState, "callstate"); - /*_LIT8(KViewAdditionCompleted, "viewadded" );*/ _LIT8(KEditMode, "editmode" ); - + namespace swipe { _LIT8(KDirection, "direction"); @@ -348,11 +243,6 @@ _LIT8(KRight, "right"); } } - namespace stylus - { - _LIT8(KStylusState, "stylusstate"); - _LIT8(KStylusEventType, "eventtype"); - } namespace keyevent { _LIT8(KKeyCode, "keycode"); @@ -361,17 +251,13 @@ _LIT8(KEventType, "eventtype"); _LIT8(KRepeats, "repeats"); } - namespace uidefinitionmodification + namespace orientation { _LIT8(KReason, "reason"); namespace reason { -// _LIT8(KThemeActivated, "themeactivated"); -// _LIT8(KDisplaySwitch, "displayswitch"); _LIT8(KLandscape, "landscape"); _LIT8(KPortrait, "portrait"); -// _LIT8(KResolutionChange, "resolutionchange"); -// _LIT8(KLanguageSwitch, "languageswitch"); } } namespace callstate @@ -384,29 +270,6 @@ _LIT8(KEnter, "enter"); _LIT8(KExit, "exit"); } - /*namespace viewpagescountchanged - { - _LIT8( KInfo, "info" ); - namespace info - { - _LIT8( KInfoMax, "max" ); - _LIT8( KInfoMin, "min" ); - _LIT8( KInfoMid, "mid" ); - _LIT8( KInfoMinMax, "minmax" ); - } - }*/ - /*namespace viewadditioncompleted - { - _LIT8( KAddedViewActivated, "activated" ); - }*/ -/* namespace uisettingsmodification - { - _LIT8(KReason, "reason"); - namespace reason - { - _LIT8(KSettingsUpdated, "settingsupdated"); - } - }*/ } } namespace event @@ -421,38 +284,25 @@ _LIT8(KSetEditMode, "system/seteditmode"); _LIT8(KResetEditMode, "system/reseteditmode"); _LIT8(KClearPassiveFocuses, "system/clearpassivefocuses"); - _LIT8(KResetStylusCounter, "system/resetstyluscounter"); _LIT8(KRunAddWidgetQuery, "system/runaddwidgetquery"); -// _LIT8(KRunRemoveWidgetQuery, "system/runremovewidgetquery"); _LIT8(KRemoveFocusedWidget, "system/removefocusedwidget"); _LIT8(KRemoveWidget, "system/removewidget"); _LIT8(KAddWidget, "system/addwidget"); - _LIT8(KRunFullScreenEffect, "system/runfullscreeneffect"); _LIT8(KActivateView, "system/activateview"); _LIT8(KActivateNextView, "system/activatenextview"); _LIT8(KActivatePreviousView, "system/activatepreviousview"); _LIT8(KAddView,"system/addview"); _LIT8(KRemoveView,"system/removeview"); - /*_LIT8(KFocusNext, "system/focusnext"); - _LIT8(KFocusPrevious, "system/focusprevious");*/ _LIT8(KActivate, "system/activate"); _LIT8(KDeactivate, "system/deactivate"); - _LIT8(KExit, "system/exitapplication"); _LIT8(KSet, "system/set"); - /*_LIT8(KUiDefinitionModificationStart, "system/uidefinitionmodificationstart"); - _LIT8(KUiDefinitionModificationEnd, "system/uidefinitionmodificationend"); - _LIT8(KUiSettingsModificationStart, "system/uisettingsmodificationstart"); - _LIT8(KUiSettingsModificationEnd, "system/uisettingsmodificationend"); */ - _LIT8(KRestartTriggerTimer, "system/restarttriggertimer" ); - _LIT8(KCancelTriggerTimer, "system/canceltriggertimer" ); - /*_LIT8(KNotifyFocus, "system/notifyfocus" ); */ _LIT8(KTryDisplayingMenu, "system/trydisplayingmenu"); _LIT8(KTryDisplayingListQueryDialog, "system/trydisplayinglistquerydialog"); _LIT8(KTryDisplayingStylusPopup, "system/trydisplayingstyluspopup"); _LIT8(KToggleWidgetsVisibilty, "system/togglewidgetsvisibilty"); - /*_LIT8(KStoreFocus, "system/storefocus"); - _LIT8(KRestoreFocus, "system/restorefocus");*/ _LIT8(KSetWallpaper, "system/setwallpaper"); + _LIT8(KActivateTextEditor, "system/activatetexteditor"); + _LIT8(KDeactivateTextEditor, "system/deactivatetexteditor"); _LIT8(KActivateSelectedItem, "system/activateselecteditem"); _LIT8(KDestination, "destination"); _LIT8(KBroadcast, "broadcast"); @@ -500,11 +350,6 @@ _LIT8(KBlock, "block"); _LIT8(KNone, "none"); } -/* namespace focus - { - _LIT8(KSensitive, "sensitive"); - _LIT8(KNone, "none"); - }*/ _LIT8(KS60DisplayPriority, "_s60-display-priority"); _LIT8(KVisibility, "visibility"); namespace visibility @@ -513,12 +358,6 @@ _LIT8(KHidden, "hidden"); _LIT8(KBlank, "blank"); } -// _LIT8(KS60Orientation, "_s60-orientation"); -/* namespace s60_orientation - { - _LIT8(KVertical, "vertical"); - _LIT8(KHorizontal, "horizontal"); - }*/ _LIT8(KBlockProgression, "block-progression"); namespace block_progression { @@ -544,7 +383,7 @@ { _LIT8(KThin, "thin"); _LIT8(KMedium, "medium"); -// _LIT8(KThick, "thick"); + _LIT8(KThick, "thick"); } _LIT8(KBorderTopWidth, "border-top-width"); _LIT8(KBorderRightWidth, "border-right-width"); @@ -559,10 +398,8 @@ { _LIT8(KAbsolute, "absolute"); _LIT8(KStatic, "static"); -// _LIT8(KFixed, "fixed"); _LIT8(KRelative, "relative"); _LIT8(KFloating, "floating"); -// _LIT8(KInherit, "inherit"); } _LIT8(KTop, "top"); _LIT8(KRight, "right"); @@ -573,11 +410,14 @@ _LIT8(KMinHeight, "min-height"); _LIT8(KMaxHeight, "max-height"); _LIT8(KOverflow, "overflow"); -// _LIT8(KTextOverflowMode, "text-overflow-mode"); _LIT8(KZIndex, "z-index"); _LIT8(KAuto, "auto"); _LIT8(KAdaptive, "adaptive"); _LIT8(KAppearance, "appearance"); + namespace s60_focus_looping + { + _LIT8(KStop, "stop"); + } } }//style namespace appearance @@ -587,9 +427,8 @@ //Color and background properties _LIT8(KColor, "color"); _LIT8(KEffectsColor, "font-effects-color"); -// _LIT8(KHighlightColor, "highlight-color"); _LIT8(KBackGroundColor, "background-color"); - _LIT8(KFocusBackground, "focus-background"); + _LIT8(KFocusBackground, "focus-background"); _LIT8(KBackGroundImage, "background-image"); _LIT8(KBackGroundSize, "background-size"); _LIT8(KBackGroundRepeat, "background-repeat"); @@ -609,7 +448,6 @@ _LIT8(KRight, "right"); _LIT8(KTop, "top"); _LIT8(KBottom, "bottom"); -// _LIT8(KCenter, "center"); } // Border properties _LIT8(KBorderStyle, "border-style"); @@ -619,15 +457,8 @@ _LIT8(KBorderLeftStyle, "border-left-style"); namespace borderstyle { -// _LIT8(KNone, "none"); -// _LIT8(KHidden, "hidden"); _LIT8(KDotted, "dotted"); -// _LIT8(KDashed, "dashed"); _LIT8(KSolid, "solid"); -// _LIT8(KDouble, "double"); -// _LIT8(KDotDash, "dot-dash"); -// _LIT8(KDotDotDash, "dot-dot-dash"); -// _LIT8(KWave, "wave"); _LIT8(KGroove, "groove"); _LIT8(KRidge, "ridge"); _LIT8(KInset, "inset"); @@ -677,7 +508,7 @@ namespace textvalign { _LIT8( KAlignTop, "top"); -// _LIT8( KAlignCenter, "center"); + _LIT8( KAlignCenter, "center"); _LIT8( KAlignBottom, "bottom"); } _LIT8(KTextEffects, "font-effects"); @@ -694,14 +525,12 @@ namespace textoverflow { _LIT8(KClipMode, "clip"); -// _LIT8(KEllipsisMode, "ellipsis"); _LIT8(KWrapMode,"wrap"); _LIT8(KMaxLineAmount,"max-line-amount"); } _LIT8(KWhiteSpaceCollapse, "white-space-collapse"); namespace whitespace { -// _LIT8(KPreserve, "preserve"); _LIT8(KCollapse, "collapse"); _LIT8(KPreserveBreaks, "preserve-breaks"); _LIT8(KDiscard, "discard"); diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xnpropertysubscriber.h --- a/idlehomescreen/inc/xnpropertysubscriber.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xnpropertysubscriber.h Wed May 12 13:22:51 2010 +0300 @@ -94,17 +94,26 @@ private: /** - * From CActive. - * Handle completion + * Handles an active object's request completion event. + * + * @see CActive::RunL */ void RunL(); /** - * From CActive. - * How to cancel me + * Implements cancellation of an outstanding request. + * + * @see CActive::DoCancel */ void DoCancel(); + /** + * RunError + * + * @see CActive::RunError + */ + TInt RunError(TInt aError); + private: // Data diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xntexteditor.h --- a/idlehomescreen/inc/xntexteditor.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xntexteditor.h Wed May 12 13:22:51 2010 +0300 @@ -54,6 +54,14 @@ */ virtual const HBufC* Text() = 0; + /** + * Handles editor events + * + * @since S60 5.2 + * @param aReason, editor event + */ + virtual void HandleEditorEvent( TInt aReason ) = 0; + private: }; } @@ -67,6 +75,18 @@ { public: +/** + * Editor events + */ + enum TEditorEvent + { + KActivateTextEditor, + KDeactivateTextEditor, + KRemoveSplitInputFromStack, + KKeepSplitInputInStack + }; +public: + /** * 2 phase construction. */ @@ -91,6 +111,14 @@ */ const HBufC* Text(); + /** + * Handles editor events + * + * @since S60 5.2 + * @param aReason, editor event + */ + void HandleEditorEvent( TInt aReason ); + public: // from CCoeControl /** diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xnuiengine.h --- a/idlehomescreen/inc/xnuiengine.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xnuiengine.h Wed May 12 13:22:51 2010 +0300 @@ -37,7 +37,6 @@ class CXnPointerArray; class CXnEditor; class CXnEditMode; -class CXnHitTest; class CXnKeyEventDispatcher; // Class declaration @@ -145,6 +144,16 @@ const TDesC8& aNamespace = KNullDesC8 ); /** + * Find content source nodes from namespace. Ownership is not transferred. + * + * @since S60 5.2 + * @param aNamespace Namespace + * @return Content source nodes from namespace + */ + CXnPointerArray* FindContentSourceNodesL( + const TDesC8& aNamespace ); + + /** * Find resources (images etc.) of the UI. Ownership is not transferred. * * @since Series 60 3.1 @@ -233,14 +242,6 @@ void RefreshMenuL(); /** - * Activate a view - * - * @since Series 60 3.1 - * @param aViewNode View node - */ - void ActivateViewL( CXnNode& aViewNode ); - - /** * Returns view manager * * @since S60 5.0 @@ -404,27 +405,6 @@ RPointerArray< CXnNode >* Plugins(); /** - * Gets hit test - * - * @since S60 5.1 - * @return the hittest - */ - CXnHitTest& HitTest() const; - - /** - * Positions stylus popup according given position - * - * @since S60 5.1 - * @param aNode stylus popup node - * @param aReference a reference node where popup should fit - * @param aPosition stylus popup position to set. - */ - void PositionStylusPopupL( - CXnNode& aNode, - CXnNode& aReference, - const TPoint& aPosition ); - - /** * Gets theme resource file * * @since S60 5.1 @@ -457,6 +437,31 @@ */ void SetEventDispatcher( CXnKeyEventDispatcher* aDispatcher ); + /** + * Enables partial touch input + * + * @since Series 60 5.2 + * @param aNode Editor Node + * @param TBool True if partial input is open + */ + void EnablePartialTouchInput( CXnNode& aNode, TBool aEnable ); + + /** + * Is partial input active + * + * @since Series 60 5.2 + * @return TBool is partial input active + */ + TBool IsPartialInputActive(); + + /** + * Checks if text editor is focused or partioal touch input open. + * + * @since Series 60 5.2 + * @return TBool True if partial input is open or editor focused + */ + TBool IsTextEditorActive(); + private: /** * C++ default constructor. diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xnuiengineappif.h --- a/idlehomescreen/inc/xnuiengineappif.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xnuiengineappif.h Wed May 12 13:22:51 2010 +0300 @@ -139,14 +139,6 @@ IMPORT_C void RefreshMenuL(); /** - * Activate a view - * - * @since Series 60 3.1 - * @param aViewNode View node - */ - IMPORT_C void ActivateViewL( CXnNodeAppIf& aViewNode ); - - /** * Returns the active view * * @since Series 60 3.1 diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xnuienginepluginif.h --- a/idlehomescreen/inc/xnuienginepluginif.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xnuienginepluginif.h Wed May 12 13:22:51 2010 +0300 @@ -127,12 +127,6 @@ */ IMPORT_C void SetFocusedNode( CXnNodePluginIf* aFocusedNode ); - /** - * Restore focus to previously focused node - * - * @since Series 60 3.1 - */ - IMPORT_C void RestorePreviousFocusedNode(); /** * Get the string pool @@ -191,14 +185,6 @@ TInt aReferenceValue ); /** - * Activate a view - * - * @since Series 60 3.1 - * @param aViewNode View node - */ - IMPORT_C void ActivateViewL( CXnNodePluginIf& aViewNode ); - - /** * Get the size of the current screen device * * @since Series 60 3.1 @@ -253,29 +239,6 @@ * @return ETrue if widgets visible, EFalse otherwise */ IMPORT_C TBool WidgetsVisible() const; - - /** - * Gets control defining hit region - * - * @since Series 60 5.0 - * @return Control defining the hit region - */ - IMPORT_C CXnControlAdapter* HitRegion() const; - - /** - * Deactivates focused node - * - * @since Series 60 5.0 - */ - IMPORT_C void DeactivateFocusedNodeL(); - - /** - * Queries wheter focus is visible - * - * @since Series 60 5.0 - * @return ETrue if focus is shown, EFalse otherwise - */ - IMPORT_C TBool ShowFocus(); /** * Gets a plugin node which the given node is. @@ -285,35 +248,7 @@ * @return A Plugin node. */ IMPORT_C CXnNodePluginIf& PluginNodeL( CXnNodePluginIf* aNode ); - - /** - * Sets focus visibility for active view - * @since Series 60 5.0 - * @param aVisible Visibility state - */ - IMPORT_C void SetFocusVisibleL( TBool aVisible ); - - /** - * Return focus visibility of active view - * @since Series 60 5.0 - * @return ETrue if active view focus is visible, EFalse otherwise - */ - IMPORT_C TBool FocusVisible(); - - /** - * Enables or disables swipe for active view - * @since Series 60 5.0 - * @param aEnable True will enable swipe, false will disable - */ - IMPORT_C void EnableSwipeL( TBool aEnable ); - - /** - * Return whether swipe is enabled or not - * @since Series 60 5.0 - * @return ETrue if swipe is enable, EFalse otherwise - */ - IMPORT_C TBool SwipeEnabledL(); - + /** * Disables layoyt and redraw, places cleanup item to cleanup stack * for enabling layot and redraw @@ -321,7 +256,24 @@ * @since Series 60 5.0 */ IMPORT_C void DisableRenderUiLC(); - + + /** + * Enables partial touch input + * + * @since Series 60 5.2 + * @param aNode Editor Node + * @param TBool True if partial input is open + */ + IMPORT_C void EnablePartialTouchInput( CXnNodePluginIf& aNode, TBool aEnable ); + + /** + * Checks if text editor is focused or partioal touch input open. + * + * @since Series 60 5.2 + * @return TBool True if partial input is open or editor focused + */ + IMPORT_C TBool IsTextEditorActive(); + private: // Data diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/inc/xnviewmanager.h --- a/idlehomescreen/inc/xnviewmanager.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/inc/xnviewmanager.h Wed May 12 13:22:51 2010 +0300 @@ -11,8 +11,7 @@ * * Contributors: * -* Description: -* Management of views in UiEngine +* Description: View Manager * */ @@ -21,7 +20,8 @@ // System includes #include -#include + +// User includes // Forward declarations class CXnUiEngine; @@ -40,6 +40,7 @@ class CHsContentInfo; class CXnViewAdapter; class CXnOomSysHandler; +class CIdle; namespace hspswrapper { @@ -86,25 +87,37 @@ */ NONSHARABLE_CLASS( CXnViewManager ) : public CBase { - // Friend classes - friend class CXnViewAdapter; - public: /** * Two-phased constructor. */ static CXnViewManager* NewL( CXnAppUiAdapter& aAdapter ); - + + /** + * Two-phased constructor. + */ static CXnViewManager* NewLC( CXnAppUiAdapter& aAdapter ); + /** + * Destructor + */ ~CXnViewManager(); private: + // constructors + + /** + * C++ constructor + */ CXnViewManager( CXnAppUiAdapter& aAdapter ); + + /** + * 2nd phase constructor + */ void ConstructL(); - + public: // New functions @@ -135,6 +148,9 @@ void PluginDataL( RPointerArray< CXnPluginData >& aList, TBool aGlobal = EFalse ) const; + TInt PluginDataL( const TDesC8& aParentId, + RPointerArray< CXnPluginData >& aList ) const; + RPointerArray< CXnNode >& AppearanceNodes() const; CArrayPtrSeg< CXnResource >& Resources() const ; @@ -144,28 +160,27 @@ void ReloadUiL(); TInt LoadWidgetToPluginL( - CHsContentInfo& aContentInfo, + const CHsContentInfo& aContentInfo, CXnPluginData& aPluginData ); TInt UnloadWidgetFromPluginL( - CXnPluginData& aPluginData ); + CXnPluginData& aPluginData, TBool aForce = EFalse ); TInt ReplaceWidgetToPluginL( - CHsContentInfo& aContentInfo, - CXnPluginData& aPluginData, - TBool aUseHsps = ETrue ); + const CHsContentInfo& aContentInfo, + CXnPluginData& aPluginData ); - void ActivateNextViewL(); + void ActivateNextViewL( TInt aEffectId = 0 ); - void ActivatePreviousViewL(); + void ActivatePreviousViewL( TInt aEffectId = 0 ); - TInt AddViewL( CHsContentInfo& aInfo ); + TInt AddViewL( const CHsContentInfo& aInfo ); - void AddViewL(); + void AddViewL( TInt aEffectId = 0 ); TInt RemoveViewL( const CHsContentInfo& aInfo ); - void RemoveViewL(); + void RemoveViewL( TInt aEffectId = 0 ); void AddObserver( const MXnViewObserver& aObserver ); @@ -174,13 +189,7 @@ CXnRootData& ActiveAppData() const; CXnViewData& ActiveViewData() const; - - void SetFirstPassDrawCompleteL(); - - void SetDataPluginLoadCompleteL( const CXnPluginData& aPluginData ); - - void UpdatePluginStateL( CXnPluginData& aPluginData ); - + TInt ActivateAppL( const TDesC8& aPluginUid ); TInt ActivateViewL( const TDesC8& aPluginId ); @@ -188,16 +197,17 @@ TInt ViewIndex() const; + TInt MaxPages() const; + CXnOomSysHandler& OomSysHandler() const; - /** - * Get maximum pages allowed - * - * @return number of pages allowed - */ - TInt32 MaxPages(); + void UpdatePageManagementInformationL(); + + void OrientationChanged(); private: + // new functions + void NotifyContainerChangedL( CXnViewData& aViewToActivate ); void NotifyViewActivatedL( const CXnViewData& aViewData ); @@ -223,23 +233,33 @@ CXnViewData& NextViewData() const; void UpdateCachesL(); - - void ValidateActiveViewL(); - - void InvalidateActiveView(); - + void ReportWidgetAmountL( const CXnViewData& aViewData ); void ShowDiskFullMessageL() const; - -public: - void UpdatePageManagementInformationL(); + + TInt ResolveIconIndex( TInt aPageCount, TInt aPageNum ) const; + + /** + * Callback for stability timer + * + * @param aAny Pointer to CViewManager object + * @return TInt System wide error code. + */ + static TInt SystemStabileTimerCallback( TAny* aAny ); -private: - TInt ResolveIconIndex( TInt aPageCount, TInt aPageNum ) const; + /** + * Reset crash count + */ + void ResetCrashCount(); - void UpdateWallpaperL( CXnViewData& aCurrent, CXnViewData& aNew ); - + /** + * Show error note from resource. + */ + void ShowErrorNoteL(); + + void DoRobustnessCheckL(); + private: // data @@ -265,7 +285,7 @@ * Not own. */ CXnUiEngine* iUiEngine; - + /** * Comopser. * Own. @@ -314,22 +334,28 @@ * Own. */ RPointerArray< MXnViewObserver > iObservers; - + /** - * Failed plugins. + * OOM system handler. * Own. - */ - RPointerArray< CXnPluginData > iFailedPlugins; + */ + CXnOomSysHandler* iOomSysHandler; /** - * Flags + * Timer for system stability. + * Own. */ - TBitFlags32 iFlags; + CPeriodic* iStabilityTimer; /** - * OOM system handler. Owned. - */ - CXnOomSysHandler* iOomSysHandler; + * Flag for current orientation. + */ + TBool iIsLandscapeOrientation; + +private: + // Friend classes + + friend class CXnViewAdapter; }; // Inline functions diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/loc/activeidle3.loc --- a/idlehomescreen/loc/activeidle3.loc Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/loc/activeidle3.loc Wed May 12 13:22:51 2010 +0300 @@ -297,3 +297,22 @@ // r: TB9.2 // #define qtn_hs_corrupted_image_note "Unable to select. Image corrupted or format not supported." + +// d: Shown when user select too large image file as a wallpaper +// l: popup_note_window +// w: +// r: TB9.2 +// +#define qtn_hs_too_big_image_note "Unable to select. Image size is too large." + +// d: Show when default configuration is loaded (critical error case) +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_error_content_removed "Critical error occurred. Content removed." + +// d: Wait/progress note text that is shown when backup or restore process is ongoing. +// l: popup_note_wait_window +// w: +// r: TB9.2 +#define qtn_hs_backup_use_prevented "Home screen is not in use during backup or restore operation. Wait to finish." diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/group/ainatiui.mmp --- a/idlehomescreen/nativeuicontroller/group/ainatiui.mmp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/group/ainatiui.mmp Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -41,8 +41,6 @@ SOURCE aisoftkeyrenderer.cpp SOURCE ainativeuimodel.cpp SOURCE aistatuspanetouchui.cpp -SOURCE aitoolbarrenderer.cpp -SOURCE aitoolbarbutton.cpp SOURCE ainotifierrenderer.cpp @@ -96,3 +94,4 @@ #ifdef RD_TACTILE_FEEDBACK LIBRARY touchfeedback.lib #endif +LIBRARY phonesettings.lib diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/inc/aidialogrenderer.h --- a/idlehomescreen/nativeuicontroller/inc/aidialogrenderer.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/inc/aidialogrenderer.h Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,12 +19,22 @@ #ifndef C_AIDIALOGRENDERER_H #define C_AIDIALOGRENDERER_H - +// System includes #include #include "ainativerenderer.h" +#include // for MPsetNetworkInfoObserver +#include // for MPsetNetworkSelect +// User includes +#include "ainativerenderer.h" +// Forward declarations class CAknNoteDialog; +class CHsContentPublisher; +class CPsetNetwork; +class CAknWaitDialog; +class CPsetContainer; +class CAknPopupList; namespace AiNativeUiController { @@ -36,7 +46,7 @@ * * @since S60 3.2 */ -class CAiDialogRenderer : public CAiNativeRenderer +NONSHARABLE_CLASS( CAiDialogRenderer ) : public CAiNativeRenderer, public MPsetNetworkInfoObserver { public: @@ -46,11 +56,64 @@ // from base class CAiNativeRenderer - void DoPublishL( MAiPropertyExtension& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); + void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); - void DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent ); + void DoCleanL( CHsContentPublisher& aPlugin, TInt aContent ); void FocusObtainedL(); + + // from base class MPsetNetworkInfoObserver + + /** + * @@see MPsetNetworkInfoObserver::HandleNetworkInfoReceivedL + */ + void HandleNetworkInfoReceivedL( + const CNetworkInfoArray* aInfoArray, const TInt aResult ); + + /** + * @@see MPsetNetworkInfoObserver::HandleSearchingNetworksL + */ + void HandleSearchingNetworksL( TServiceRequest aRequest ); + + /** + * @@see MPsetNetworkInfoObserver::HandleRequestingSelectedNetworkL + */ + void HandleRequestingSelectedNetworkL( TBool aOngoing ); + + /** + * @@see MPsetNetworkInfoObserver::HandleNetworkChangedL - not used + */ + void HandleNetworkChangedL( + const MPsetNetworkSelect::TNetworkInfo& aCurrentInfo, + const RMobilePhone::TMobilePhoneRegistrationStatus& aStatus, + const TInt aResult ); + + /** + * @@see MPsetNetworkInfoObserver::HandleNetworkErrorL + */ + void HandleNetworkErrorL( const TServiceRequest aRequest, + const TInt aError ); + + /** + * @@see MPsetNetworkInfoObserver::HandleCurrentNetworkInfoL - not used + */ + void HandleCurrentNetworkInfoL( + const MPsetNetworkSelect::TCurrentNetworkInfo& /* aCurrentInfo */, + const TInt /* aResult */ ) {}; + + /** + * @@see MPsetNetworkInfoObserver::HandleNetworkChangedL - not used + */ + void HandleNetworkChangedL( + const MPsetNetworkSelect::TNetworkInfo& /* aCurrentInfo */, + const MPsetNetworkSelect::TCurrentNetworkStatus /* aStatus */, + const TInt /* aResult */ ) {}; + + /** + * @@see MPsetNetworkInfoObserver::HandleCallActivatedL + */ + void HandleCallActivatedL() {}; + private: @@ -63,6 +126,40 @@ */ void ShowDialogL(); + void ConstructL(); + + void PopulatePLMNListL(); + + /** + * Provides the network operator list. + */ + void NetworkListL(); + + /** + * Sets title to a popup list. + * @param aList pointer to list + * @param aTitleID resource ID of the title + */ + void SetTitleToPopupL( CAknPopupList& aList, TInt aTitleID ); + + /** + * Creates a waiting note (member variable). + * @param aDelayOff is the note shown immediately or not + */ + void CheckAndCreateDlgL( TBool aDelayOff ); + + /* + * Empties fetched network provider's list. + */ + void PurgeNetworkList(); + + /** + * Shows a requested note. + * @param aResourceId reource ID for note text + * @param aType type of note + */ + void ShowNoteL( TInt aResourceId, TInt aType ); + private: // data @@ -89,6 +186,25 @@ TInt iDialogId; #endif + + //PhoneSettings engine object + CPsetNetwork* iNetwork; + //PhoneSettings container + CPsetContainer* iSettingsContainer; + //Requesting note + CAknWaitDialog* iDlg; + //Array of networks + CNetworkInfoArray* iNetworkArray; + //Network selection list + CAknPopupList* iNetworkPopupList; + //Has the user selected a valid network + TBool iApprovedNetwork; + TBool iSearchForNetworksActive; + TBool iPLMNListPopulateShowIsHandling; + + // Resource index + TInt iRscIndex; + }; } // namespace AiNativeUiController diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/inc/ainativerenderer.h --- a/idlehomescreen/nativeuicontroller/inc/ainativerenderer.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/inc/ainativerenderer.h Wed May 12 13:22:51 2010 +0300 @@ -19,14 +19,16 @@ #ifndef M_AINATIVERENDERER_H #define M_AINATIVERENDERER_H +// System includes #include -#include "aidevicestatuscontentmodel.h" -#include "aiscutcontentmodel.h" -#include "aiprofileplugincontentmodel.h" +// User includes +#include +#include +// Forward declarations +class CHsContentPublisher; class RFile; -class MAiPropertyExtension; namespace AiNativeUiController { @@ -36,13 +38,15 @@ * * @since S60 3.2 */ -class CAiNativeRenderer : public CBase +NONSHARABLE_CLASS( CAiNativeRenderer ) : public CBase { +public: + + ~CAiNativeRenderer(); public: - - virtual ~CAiNativeRenderer(); - + // new methods + /** * Publish resource. * @@ -53,7 +57,7 @@ * @param aIndex is index of the content. * @return KErrNone if publish is successful. */ - virtual TInt Publish( MAiPropertyExtension& aPlugin, + virtual TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); @@ -68,7 +72,7 @@ * @param aIndex is index of the content. * @return KErrNone if publish is successful. */ - virtual TInt Publish( MAiPropertyExtension& aPlugin, + virtual TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); @@ -83,7 +87,7 @@ * @param aIndex is index of the content. * @return KErrNone if publish is successful. */ - virtual TInt Publish( MAiPropertyExtension& aPlugin, + virtual TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); @@ -98,7 +102,7 @@ * @param aIndex is index of the content. * @return KErrNone if publish is successful. */ - virtual TInt Publish( MAiPropertyExtension& aPlugin, + virtual TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ); @@ -112,7 +116,7 @@ * @param aIndex is index of the content. * @return KErrNone if cleaning works. */ - virtual TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent ); + virtual TInt Clean( CHsContentPublisher& aPlugin, TInt aContent ); /** * Renderer must implement this method if it needs to support resource publishing. @@ -125,7 +129,7 @@ * @param aResource is id of the resource. * @param aIndex is index of the content. */ - virtual void DoPublishL( MAiPropertyExtension& aPlugin, + virtual void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); @@ -141,7 +145,7 @@ * @param aText is published text. * @param aIndex is index of the content. */ - virtual void DoPublishL( MAiPropertyExtension& aPlugin, + virtual void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); @@ -157,7 +161,7 @@ * @param aBuf is published data. * @param aIndex is index of the content. */ - virtual void DoPublishL( MAiPropertyExtension& aPlugin, + virtual void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); @@ -173,7 +177,7 @@ * @param aFile is reference to file client. * @param aIndex is index of the content. */ - virtual void DoPublishL( MAiPropertyExtension& aPlugin, + virtual void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ); @@ -187,7 +191,7 @@ * @param aPlugin is publishing plugin. * @param aContent is id of the content. */ - virtual void DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent ); + virtual void DoCleanL( CHsContentPublisher& aPlugin, TInt aContent ); /** * Called when UI switches to foreground. @@ -238,7 +242,7 @@ * @param aMimeType is mime type. * @return ETrue if match is successful. */ - TBool MatchMimeType( MAiPropertyExtension& aPlugin, TInt aContentId, const TDesC8& aMimeType ) const; + TBool MatchMimeType( CHsContentPublisher& aPlugin, TInt aContentId, const TDesC8& aMimeType ) const; /** @@ -248,7 +252,7 @@ * @param aPlugin is publishing plugin. * @param aContentId is id of the content. */ - void DoMimeTypeCheckL( MAiPropertyExtension& aPlugin, TInt aContentId ); + void DoMimeTypeCheckL( CHsContentPublisher& aPlugin, TInt aContentId ); }; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/inc/ainavipanerenderer.h --- a/idlehomescreen/nativeuicontroller/inc/ainavipanerenderer.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/inc/ainavipanerenderer.h Wed May 12 13:22:51 2010 +0300 @@ -19,15 +19,16 @@ #ifndef C_AINAVIPANERENDERER_H #define C_AINAVIPANERENDERER_H +// System includes +#include -#include +// User includes #include "ainativerenderer.h" #include "ainavipaneanimatorcallback.h" #include "ainativeuimodel.h" namespace AiNativeUiController { - class CAiStatusPanel; class CAiNaviPaneAnimator; @@ -40,9 +41,8 @@ * @since S60 3.2 */ // inheritance order must be this, despite codescanner warnings -class CAiNaviPaneRenderer : public MAiNaviPaneAnimatorCallback, - public CAiNativeRenderer - +NONSHARABLE_CLASS( CAiNaviPaneRenderer ) : public MAiNaviPaneAnimatorCallback, + public CAiNativeRenderer { public: @@ -52,12 +52,12 @@ // from base class CAiNativeRenderer - void DoPublishL( MAiPropertyExtension& aPlugin, + void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); - void DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent ); + void DoCleanL( CHsContentPublisher& aPlugin, TInt aContent ); void FocusObtainedL(); diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/inc/ainotifierrenderer.h --- a/idlehomescreen/nativeuicontroller/inc/ainotifierrenderer.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/inc/ainotifierrenderer.h Wed May 12 13:22:51 2010 +0300 @@ -19,16 +19,19 @@ #ifndef C_AISOFTNOTIFERRENDERER_H #define C_AISOFTNOTIFERRENDERER_H - +// System includes #include -#include "ainativerenderer.h" #include +// User includes +#include "ainativerenderer.h" + +// Forward declarations +class CHsContentPublisher; class CAknSoftNotifier; namespace AiNativeUiController { - /** * Dialog renderer. * @@ -36,7 +39,7 @@ * * @since S60 3.2 */ -class CAiNotifierRenderer : public CAiNativeRenderer +NONSHARABLE_CLASS( CAiNotifierRenderer ) : public CAiNativeRenderer { public: @@ -46,9 +49,9 @@ // from base class CAiNativeRenderer - void DoPublishL( MAiPropertyExtension& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); + void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); - void DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent ); + void DoCleanL( CHsContentPublisher& aPlugin, TInt aContent ); private: diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/inc/aisoftkeyrenderer.h --- a/idlehomescreen/nativeuicontroller/inc/aisoftkeyrenderer.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/inc/aisoftkeyrenderer.h Wed May 12 13:22:51 2010 +0300 @@ -19,12 +19,16 @@ #ifndef C_AISOFTKEYRENDERER_H #define C_AISOFTKEYRENDERER_H - +// System includes #include #include //ECoeStackPriorityDefault + +// User includes #include "ainativerenderer.h" #include "ainativeuimodel.h" +// Forward declarations +class CHsContentPublisher; namespace AiNativeUiController { @@ -48,7 +52,7 @@ * * @since S60 3.2 */ -class CAiSoftKeyRenderer : public CAiNativeRenderer +NONSHARABLE_CLASS( CAiSoftKeyRenderer ) : public CAiNativeRenderer { public: @@ -58,15 +62,15 @@ // from base class CAiNativeRenderer - void DoPublishL( MAiPropertyExtension& aPlugin, + void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); - void DoPublishL( MAiPropertyExtension& aPlugin, + void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); - void DoPublishL( MAiPropertyExtension& aPlugin, + void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/inc/aistatuspanel.h --- a/idlehomescreen/nativeuicontroller/inc/aistatuspanel.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/inc/aistatuspanel.h Wed May 12 13:22:51 2010 +0300 @@ -201,10 +201,14 @@ TInt iMaskHandle; /** - * + * Navidecorator observer */ MAknNaviDecoratorObserver* iNaviDecoratorObserver; + /** + * Flag to indicate wheter text is published to title pane + */ + TBool iTextInTitlePane; }; } // namespace AiNativeUiController diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/inc/aistatuspanetouchui.h --- a/idlehomescreen/nativeuicontroller/inc/aistatuspanetouchui.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/inc/aistatuspanetouchui.h Wed May 12 13:22:51 2010 +0300 @@ -19,21 +19,23 @@ #ifndef C_AISTATUSPANETOUCHUI_H #define C_AISTATUSPANETOUCHUI_H +// System includes #include #include #include #include #include +// User includes #include "ainativerenderer.h" +// Forward declarations +class CHsContentPublisher; class MAiFwEventHandler; - class CAknStylusPopUpMenu; namespace AiNativeUiController { - // Stylus activated popup command ids enum TLinkCommandID { @@ -42,14 +44,11 @@ EAIProfileCmdLink }; - class CAiStatusPanel; -class CAiStatusPaneTouchUi : public CAiNativeRenderer, - public MAknNaviDecoratorObserver, - public MEikMenuObserver +NONSHARABLE_CLASS( CAiStatusPaneTouchUi ) : public CAiNativeRenderer, + public MAknNaviDecoratorObserver, public MEikMenuObserver { - public: // Construction and destructor @@ -72,7 +71,7 @@ // from base class CAiNativeRenderer - void DoPublishL( MAiPropertyExtension& aPlugin, + void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); @@ -111,4 +110,4 @@ } // namespace AiNativeUiController -#endif //C_AISTATUSPANETOUCHUI_H \ No newline at end of file +#endif //C_AISTATUSPANETOUCHUI_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/inc/aititlepanerenderer.h --- a/idlehomescreen/nativeuicontroller/inc/aititlepanerenderer.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/inc/aititlepanerenderer.h Wed May 12 13:22:51 2010 +0300 @@ -19,11 +19,16 @@ #ifndef C_AITITLEPANERENDERER_H #define C_AITITLEPANERENDERER_H +// System includes +#include -#include +// User includes #include "ainativerenderer.h" #include "ainativeuimodel.h" +// Forward declarations +class CHsContentPublisher; + namespace AiUtility { class CContentPriorityMap; @@ -43,7 +48,7 @@ * * @since S60 3.2 */ -class CAiTitlePaneRenderer : public CAiNativeRenderer +NONSHARABLE_CLASS( CAiTitlePaneRenderer ) : public CAiNativeRenderer { public: @@ -53,22 +58,22 @@ // from base class CAiNativeRenderer - void DoPublishL( MAiPropertyExtension& aPlugin, + void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); - void DoPublishL( MAiPropertyExtension& aPlugin, + void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); - void DoPublishL( MAiPropertyExtension& aPlugin, + void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); - void DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent ); + void DoCleanL( CHsContentPublisher& aPlugin, TInt aContent ); void TransactionCommittedL(); diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/inc/aitoolbarrenderer.h --- a/idlehomescreen/nativeuicontroller/inc/aitoolbarrenderer.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/inc/aitoolbarrenderer.h Wed May 12 13:22:51 2010 +0300 @@ -19,30 +19,31 @@ #ifndef C_AITOOLBARRENDERER_H #define C_AITOOLBARRENDERER_H +// System includes #include #include + +// User includes #include "ainativerenderer.h" #include "ainativeuimodel.h" #include "aitoolbarbutton.h" +// Forward declarations +class CHsContentPublisher; class MAiFwEventHandler; class CAknToolbar; namespace AiNativeUiController { - - /** * Toolbar class of Native UI Controller application * * @lib AiNatiUi */ // inheritance order must be this, despite codescanner warnings -class CAiToolbarRenderer : public MAknToolbarObserver, - public CAiNativeRenderer - { - - +NONSHARABLE_CLASS( CAiToolbarRenderer ) : public MAknToolbarObserver, + public CAiNativeRenderer + { public: // Constructors and destructor static CAiToolbarRenderer* NewLC( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar); @@ -53,12 +54,12 @@ public: // from CAiNativeRenderer - void DoPublishL( MAiPropertyExtension& aPlugin, + void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); - void DoPublishL( MAiPropertyExtension& aPlugin, + void DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/inc/nativeuicontroller.h --- a/idlehomescreen/nativeuicontroller/inc/nativeuicontroller.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/inc/nativeuicontroller.h Wed May 12 13:22:51 2010 +0300 @@ -19,24 +19,24 @@ #ifndef C_NATIVEUICONTROLLER_H #define C_NATIVEUICONTROLLER_H - +// System includes #include -#include "aiuicontroller.h" -#include "aiuiframeworkobserver.h" -#include "aicontentobserver.h" +// User includes +#include +#include #include -class MAiPropertyExtension; +// Forward declarations class MAiPSPropertyObserver; +class CHsContentPublisher; +class THsPublisherInfo; namespace AiNativeUiController { - class CAiNativeRenderer; class CAiStatusPanel; class CAppUi; -class CAiToolbarRenderer; const TInt KImplementationUidNativeUiController = AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE; @@ -50,125 +50,132 @@ * * @since Series 60 3.2 */ -class CNativeUiController : public CAiUiController, - public MAiSecondaryUiController, - public MAiMainUiController, - public MAiUiFrameworkObserver, - public MAiContentObserver +NONSHARABLE_CLASS( CNativeUiController ) : public CAiUiController, + public MAiSecondaryUiController, public MAiMainUiController, + public MAiContentObserver { public: - + // Constructor and destructor static CNativeUiController* NewL(); - virtual ~CNativeUiController(); - -// from base class CAiUiController - - void PrepareToExit(); + ~CNativeUiController(); +public: + // from CAiUiController + void LoadUIDefinitionL(); - - void GetPluginsL(RAiPublisherInfoArray& aPlugins); - - void GetSettingsL(const TAiPublisherInfo& aPubInfo, - RAiSettingsItemArray& aSettings); + + void GetSettingsL( const THsPublisherInfo& aPublisherInfo, + RAiSettingsItemArray& aSettings ); void ActivateUI(); MAiContentObserver& GetContentObserver(); - void SetEventHandler(MAiFwEventHandler& aEventHandler); + void SetEventHandler( MAiFwEventHandler& aEventHandler ); + + void SetStateHandler( MAiFwStateHandler& aStateHandler ); MAiFwEventHandler* FwEventHandler(); - void RemovePluginFromUI( MAiPropertyExtension& aPlugin ); - + MAiFwStateHandler* FwStateHandler(); + MAiMainUiController* MainInterface(); MAiSecondaryUiController* SecondaryInterface(); - - void HandleLoadedPlugins(const RAiPublisherInfoArray& /*aRequiredPlugins*/ ) {}; - -// from base class MAiMainUiController + +public: + // from MAiMainUiController void RunApplicationL(); CCoeEnv& CoeEnv(); - - void SetUiFrameworkObserver( MAiUiFrameworkObserver& aObserver ); TBool IsMenuOpen(); -// from base class CAiSecordaryUiController +public: + // from CAiSecordaryUiController void SetCoeEnv( CCoeEnv& aCoeEnv ); - MAiUiFrameworkObserver* UiFrameworkObserver(); - -// from base class MAiUiFrameworkObserver - - void HandleResourceChange( TInt aType ); - - void HandleForegroundEvent( TBool aForeground ); - -// from base class MAiContentObserver - +public: + // from MAiContentObserver TInt StartTransaction(TInt aTxId); TInt Commit(TInt aTxId); TInt CancelTransaction(TInt aTxId); - TBool CanPublish(MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex); + TBool CanPublish(CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex); - TInt Publish(MAiPropertyExtension& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); + TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); - TInt Publish(MAiPropertyExtension& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); + TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); - TInt Publish(MAiPropertyExtension& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); + TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); - TInt Publish(MAiPropertyExtension& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ); + TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ); - TInt Clean(MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); + TInt Clean(CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ); TAny* Extension(TUid aUid); - TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const; + TBool RequiresSubscription( const THsPublisherInfo& aPublisherInfo ) const; - TInt SetProperty( MAiPropertyExtension& aPlugin, + TInt SetProperty( CHsContentPublisher& aPlugin, const TDesC8& aElementId, const TDesC8& aPropertyName, const TDesC8& aPropertyValue ); - TInt SetProperty( MAiPropertyExtension& aPlugin, + TInt SetProperty( CHsContentPublisher& aPlugin, const TDesC8& aElementId, const TDesC8& aPropertyName, const TDesC8& aPropertyValue, MAiContentObserver::TValueType aValueType); -// new methods +private: + // constructors + + /** + * C++ default contructor + */ + CNativeUiController(); +public: + // new functions + /** * Set app ui instance to this class. * * @since S60 3.2 * @param aAppUi is pointer to app ui. */ - void SetAppUi( CAppUi* aAppUi ) - { - iAppUi = aAppUi; - } - + void SetAppUi( CAppUi* aAppUi ); + + /** + * Promotes this UI controller as main UI controller. + * + * @since S60 3.2 + */ void VariateToMainUiController(); + /** + * Runs exit timer. + * + * @since S60 3.2 + */ void Exit(); + /** + * Preperas to exit + * + * @since S60 3.2 + */ + void PrepareToExit(); + private: - - CNativeUiController(); - - static CApaApplication* NewApplication(); - + // new functions + /** * Add renderer. * @@ -190,17 +197,6 @@ * @return ETrue upon successful removing. */ TBool RemoveRenderer( CAiNativeRenderer *aRenderer, TBool aDelete = EFalse ); - - /** - * Recreates the toolbar renderer - */ - TBool RecreateToolbarRendererL(); - - /** - * Deletes and removes the toolbar renderer from - * renderer array. - */ - void DeleteToolbarRenderer(); /** * Template function for publish. @@ -213,7 +209,7 @@ * @return KErrNone if publishing was successful. */ template - TInt DoPublish( MAiPropertyExtension& aPlugin, TInt aContent, T& aData, TInt aIndex ); + TInt DoPublish( CHsContentPublisher& aPlugin, TInt aContent, T& aData, TInt aIndex ); /** * Handles idle state changes. @@ -232,10 +228,13 @@ static TInt HandlePluginConfChange( TAny* aPtr ); static TInt ExitTimerCallBack( TAny* aSelf ); - void GetSettingsFromCRL( const TAiPublisherInfo& aPubInfo, - RAiSettingsItemArray &aPluginSettings ); - -private: // Data + void GetSettingsFromCRL( const THsPublisherInfo& aPublisherInfo, + RAiSettingsItemArray &aPluginSettings ); + + static CApaApplication* NewApplication(); + +private: + // data /** * Array of renderers. @@ -281,13 +280,19 @@ /** * Native UI controller plug-ins */ - RAiPublisherInfoArray iPlugins; + RArray< THsPublisherInfo > iPlugins; /** * Plug-in event handler. * Doesn't own. */ MAiFwEventHandler* iFwEventHandler; + + /** + * Plug-in state handler. + * Doesn't own. + */ + MAiFwStateHandler* iFwStateHandler; /** * Pointer to this, when role is main ui controller. @@ -295,11 +300,6 @@ MAiMainUiController* iMain; /** - * Ui framework observer. Not own. - */ - MAiUiFrameworkObserver* iUiFrameworkObserver; - - /** * Pointer to app ui. * Not own. */ @@ -320,13 +320,6 @@ * To prevent double loading of the UI **/ TBool iUiLoaded; - - /** - * Pointer to our toolbar renderer. Do not delete - * renderer through this pointer - */ - CAiToolbarRenderer *iToolbarRenderer; - }; #include "nativeuicontroller.inl" diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/src/aidialogrenderer.cpp --- a/idlehomescreen/nativeuicontroller/src/aidialogrenderer.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/src/aidialogrenderer.cpp Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,13 +15,16 @@ * */ - +// System includes #include -#include -#include #include #include #include + +// User includes +#include +#include +#include #include #include "aidialogrenderer.h" #include "ainativeuiplugins.h" @@ -29,36 +32,162 @@ #include "aisecondarydisplayapi.h" #endif + +// AVKON headers +#include // for Note Wrappers +#include // for Popup menus +#include // for CAknWaitDialog +#include // for StringLoader +#include // for CTextListBoxModel +#include // for AknPopupListEmpty +#include // for BaflUtils + +// Phonesettings headers +#include // for CPsetContainer +#include // for CPsetNetwork +#include // for CPsetSAObserver +#include // for GSM-specific error messages + +#include // for resource IDs +#include // for KCRUidCoreApplicationUIs, TCoreAppUIsNetworkConnectionAllowed +#include + +const TInt KAIAlphaTagIconAdditionalChars = 5; +// Length of long network name. +const TInt KAIAlphaTagLongNameLength = 20; +// Length of short network name. +const TInt KAIAlphaTagShortNameLength = 10; + +// array granularity +const TInt KAINetworkInfoArrayGranularity = 10; + +// Error note type ID - for Net view internal usage only +const TInt KAIPPErrorNote = 5001; +// Confirmation note type ID - for Net view internal usage only +const TInt KAIPPConfirmationNote = 5002; +//Information note type ID - for Net view internal usage only +const TInt KAIPPInformationNote = 5003; + +const TInt KAIPLMNListPopupMenuItems = 3; + +// Some resources defined for GSNetworkPlugin are used +_LIT(KGSNetworkPluginResource, "z:\\resource\\GsNetworkPluginRsc.rsc"); + +enum TGSSoftKeys + { + EGSSoftkeyQuit = 1, + EGSSoftkeyEmpty + }; + + using namespace AiNativeUiController; // ======== MEMBER FUNCTIONS ======== - +// ---------------------------------------------------------------------------- +// CAiDialogRenderer::NewLC() +// +// ---------------------------------------------------------------------------- +// CAiDialogRenderer* CAiDialogRenderer::NewLC() { CAiDialogRenderer* self = new( ELeave ) CAiDialogRenderer; CleanupStack::PushL( self ); + self->ConstructL(); return self; } - +// ---------------------------------------------------------------------------- +// CAiDialogRenderer::~CAiDialogRenderer() +// +// ---------------------------------------------------------------------------- +// CAiDialogRenderer::~CAiDialogRenderer() { + if ( FeatureManager::FeatureSupported( KFeatureIdFfManualSelectionPopulatedPlmnList ) ) + { + if( iRscIndex ) + { + CEikonEnv::Static()->DeleteResourceFile( iRscIndex ); + } + if ( iNetwork ) + { + if ( iSearchForNetworksActive ) + { + // Reset back to previously used network + iNetwork->ResetNetworkSearch(); + } + delete iNetwork; + } + + if ( iNetworkArray ) + { + iNetworkArray->Reset(); + } + delete iNetworkArray; + + if ( iDlg ) + { + delete iDlg; + } + if ( iNetworkPopupList ) + { + iNetworkPopupList->CancelPopup(); + } + + if ( iSettingsContainer ) + { + delete iSettingsContainer; + } + } + + FeatureManager::UnInitializeLib(); + delete iDialog; delete iText; } - +// ---------------------------------------------------------------------------- +// CAiDialogRenderer::CAiDialogRenderer() +// +// ---------------------------------------------------------------------------- +// CAiDialogRenderer::CAiDialogRenderer() { } - + +void CAiDialogRenderer::ConstructL() + { + FeatureManager::InitializeLibL(); + + if ( FeatureManager::FeatureSupported( KFeatureIdFfManualSelectionPopulatedPlmnList ) ) + { + iSettingsContainer = CPsetContainer::NewL(); + iNetwork = iSettingsContainer->CreateNetworkObjectL( *this ); + + iApprovedNetwork = EFalse; + CheckAndCreateDlgL( EFalse ); + iSearchForNetworksActive = EFalse; + iPLMNListPopulateShowIsHandling = EFalse; -void CAiDialogRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aResource, - TInt /*aIndex*/ ) + // Open the resource file. Assume that the resource is stored on the same + // drive the DLL is installed on. + TFileName file; + Dll::FileName( file ); + TParse parse; + parse.Set( KGSNetworkPluginResource, &file, NULL ); + file = parse.FullName(); + CEikonEnv* eikonEnv = CEikonEnv::Static(); + BaflUtils::NearestLanguageFile( eikonEnv->FsSession(), file ); + iRscIndex = eikonEnv->AddResourceFileL( file ); + } + } + +void CAiDialogRenderer::DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, TInt aResource, TInt /*aIndex*/ ) { - if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + if( info.Uid() == KDeviceStatusPluginUid ) { switch( aContent ) { @@ -89,11 +218,32 @@ } if ( idleState == EPSAiForeground ) { - ShowDialogL(); + ShowDialogL(); } - break; } + + case EAiDeviceStatusContentNetRegStatus: + { + MPsetNetworkSelect::TSelectMode mode = + MPsetNetworkSelect::ENetSelectModeAutomatic; + + if ( iNetwork ) + { + iNetwork->GetNetworkSelectMode( mode ); + } + + if ( mode == MPsetNetworkSelect::ENetSelectModeManual ) + { + if ( aResource == EAiDeviceStatusResourceNetRegFail ) + { + PopulatePLMNListL(); + } + } + break; + } + + default: { User::Leave( KErrNotFound ); @@ -103,12 +253,17 @@ } else { - User::Leave( KErrNotFound ); + User::Leave( KErrNotFound ); } } -void CAiDialogRenderer::DoCleanL( MAiPropertyExtension& /*aPlugin*/, - TInt aContent ) +// ---------------------------------------------------------------------------- +// CAiDialogRenderer::DoCleanL() +// +// ---------------------------------------------------------------------------- +// +void CAiDialogRenderer::DoCleanL( CHsContentPublisher& /*aPlugin*/, + TInt aContent ) { switch( aContent ) { @@ -124,11 +279,14 @@ User::Leave( KErrNotFound ); break; } - }; - + } } - +// ---------------------------------------------------------------------------- +// CAiDialogRenderer::ShowDialogL() +// +// ---------------------------------------------------------------------------- +// void CAiDialogRenderer::ShowDialogL() { if ( iDialog ) @@ -153,7 +311,11 @@ iDialog->RunLD(); } - +// ---------------------------------------------------------------------------- +// CAiDialogRenderer::FocusObtainedL() +// +// ---------------------------------------------------------------------------- +// void CAiDialogRenderer::FocusObtainedL() { if( iShowDialog ) @@ -161,3 +323,420 @@ ShowDialogL(); } } + +void CAiDialogRenderer::PopulatePLMNListL() + { + // Ignore any subsequent EAiDeviceStatusResourcePLMNListPopulateShow content while one is handling + if ( iPLMNListPopulateShowIsHandling ) + { + return; + } + + iPLMNListPopulateShowIsHandling = ETrue; + iSearchForNetworksActive = ETrue; + iNetwork->GetAvailableNetworksL(); + } + +// --------------------------------------------------------------------------- +// +// While request to find networks is processed +// +// --------------------------------------------------------------------------- +void CAiDialogRenderer::HandleSearchingNetworksL( + MPsetNetworkInfoObserver::TServiceRequest aRequest ) + { + // Create a network info array if doesn't exist + if ( !iNetworkArray ) + { + iNetworkArray = new ( ELeave ) + CNetworkInfoArray( KAINetworkInfoArrayGranularity ); + } + + if ( aRequest != MPsetNetworkInfoObserver::EServiceRequestNone ) + { + CheckAndCreateDlgL( EFalse ); + iSearchForNetworksActive = ETrue; + TInt res = iDlg->ExecuteLD( R_SEARCHING_NOTE ); + if ( res == EGSSoftkeyQuit ) + { + iNetwork->CancelProcess(); + iPLMNListPopulateShowIsHandling = EFalse; + } + } + else // If EServiceRequestNone received, hide the "Searching..." note + { + delete iDlg; + iDlg = NULL; + } + } + +// --------------------------------------------------------------------------- +// +// Handles network info +// +// --------------------------------------------------------------------------- +void CAiDialogRenderer::HandleNetworkInfoReceivedL( + const CNetworkInfoArray* aInfoArray, const TInt /* aResult */ ) + { + const TInt itemsCount = aInfoArray->Count(); + + // First delete old ones + iNetworkArray->Delete( 0, iNetworkArray->Count() ); + + // Then insert found networks + for ( TInt i = 0; i < itemsCount; i++ ) + { + MPsetNetworkSelect::TNetworkInfo info = aInfoArray->At( i ); + iNetworkArray->InsertL( i, info ); + } + + NetworkListL(); // After search complete, show results + } + +// --------------------------------------------------------------------------- +// +// While request to change network is processed, a note is shown +// +// --------------------------------------------------------------------------- +void CAiDialogRenderer::HandleRequestingSelectedNetworkL( TBool aOngoing ) + { + if ( aOngoing ) + { + CheckAndCreateDlgL( ETrue ); + + if ( iDlg->ExecuteLD( R_REQUESTING_NOTE ) == EGSSoftkeyQuit ) + { + iNetwork->CancelProcess(); + + CAknNoteDialog* dlg = new ( ELeave ) CAknNoteDialog( + CAknNoteDialog::EConfirmationTone, + CAknNoteDialog::EShortTimeout ); + dlg->ExecuteLD( R_REGISTRATION_INTERRUPTED ); + iApprovedNetwork = EFalse; + iPLMNListPopulateShowIsHandling = EFalse; + } + } + else + { + delete iDlg; + iDlg = NULL; + } + } + +// --------------------------------------------------------------------------- +// +// Handle network change +// +// --------------------------------------------------------------------------- +void CAiDialogRenderer::HandleNetworkChangedL( + const MPsetNetworkSelect::TNetworkInfo& aCurrentInfo, + const RMobilePhone::TMobilePhoneRegistrationStatus& aStatus, + const TInt aResult ) + { + switch ( aStatus ) + { + case RMobilePhone::ERegisteredOnHomeNetwork: + { + ShowNoteL( R_HOME_NETWORK_SELECTED, KAIPPConfirmationNote ); + PurgeNetworkList(); + break; + } + case RMobilePhone::ERegisteredRoaming: + { + HBufC* stringholder = NULL; + if ( aCurrentInfo.iLongName.Length() > 0 && + aCurrentInfo.iLongName.Length() <= + MPsetNetworkSelect::ENetLongNameSize ) + { + stringholder = StringLoader::LoadLC( R_NETSL_NETWORKSELECTED, + aCurrentInfo.iLongName ); + } + else if (aCurrentInfo.iShortName.Length() > 0 && + aCurrentInfo.iShortName.Length() <= + MPsetNetworkSelect::ENetShortNameSize ) + { + stringholder = StringLoader::LoadLC( R_NETSL_NETWORKSELECTED, + aCurrentInfo.iShortName ); + } + + CAknConfirmationNote* note = new ( ELeave ) CAknConfirmationNote( ETrue ); + if ( stringholder ) + { + note->ExecuteLD( *stringholder ); + CleanupStack::PopAndDestroy( stringholder ); + } + + //After list has been used, clear it. + PurgeNetworkList(); + break; + } + case RMobilePhone::ERegistrationUnknown: + case RMobilePhone::ENotRegisteredNoService: + case RMobilePhone::ENotRegisteredEmergencyOnly: + case RMobilePhone::ENotRegisteredSearching: + case RMobilePhone::ERegisteredBusy: + case RMobilePhone::ERegistrationDenied: + default: + break; + } + + iPLMNListPopulateShowIsHandling = EFalse; + iSearchForNetworksActive = EFalse; + } + +// --------------------------------------------------------------------------- +// +// Handles errors. +// +// --------------------------------------------------------------------------- +void CAiDialogRenderer::HandleNetworkErrorL( + const MPsetNetworkInfoObserver::TServiceRequest aRequest, + const TInt aError ) + { + TInt resourceTxt = KErrNone; + + switch ( aRequest ) + { + case MPsetNetworkInfoObserver::EServiceRequestGetNetworkInfo: + { + iNetwork->CancelProcess(); + iApprovedNetwork = EFalse; + break; + } + case MPsetNetworkInfoObserver::EServiceRequestSetNetwork: + { + } + default: + { + break; + } + } + + TBool ignore = EFalse; + + switch ( aError ) + { + case KErrGsmNetCauseCallActive: + { + ignore = ETrue; // Do not show an error + break; + } + case KErrGsm0707NoNetworkService: + { + resourceTxt = R_NO_NETWORK_FOUND; + break; + } + case KErrGsmOfflineOpNotAllowed: + { + resourceTxt = R_OFFLINE_MODE; + break; + } + default: + { + resourceTxt = R_NO_NETWORK_ACCESS; + break; + } + } + + if ( !ignore ) + { + ShowNoteL( resourceTxt, KAIPPErrorNote ); + iApprovedNetwork = EFalse; + } + } + +// --------------------------------------------------------------------------- +// +// Creates list of Network providers +// +// --------------------------------------------------------------------------- +void CAiDialogRenderer::NetworkListL() + { + //if no net items were found, do not show list + if ( iNetworkArray->Count() > 0 ) + { + while ( !iApprovedNetwork ) + { + AknPopupListEmpty* list; + list = new ( ELeave ) CAknSinglePopupMenuStyleListBox; + CleanupStack::PushL( list ); + + if ( iNetworkPopupList ) + { + iNetworkPopupList->CancelPopup(); + iNetworkPopupList = NULL; + } // + + iNetworkPopupList = + CAknPopupList::NewL( list, R_AVKON_SOFTKEYS_OK_CANCEL ); + + list->ConstructL( iNetworkPopupList, + CEikListBox::ELeftDownInViewRect ); + list->CreateScrollBarFrameL( ETrue ); + list->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); + + // Fill in the list texts + CDesCArrayFlat* items = + new ( ELeave ) CDesCArrayFlat( KAIPLMNListPopupMenuItems ); + CleanupStack::PushL( items ); + + const TInt itemsCount = iNetworkArray->Count(); + + for ( TInt loop = 0; loop < itemsCount; loop++ ) + { + HBufC* insertString = + HBufC::NewLC( + KAIAlphaTagLongNameLength + KAIAlphaTagIconAdditionalChars ); + MPsetNetworkSelect::TNetworkInfo info = + iNetworkArray->At( loop ); + + if ( info.iLongName.Length() <= 0 || + info.iLongName.Length() > KAIAlphaTagLongNameLength ) + { + // Short name received + if ( info.iShortName.Length() > 0 && + info.iShortName.Length() <= KAIAlphaTagShortNameLength ) + { + insertString->Des().Append( info.iShortName ); + } // + } // + // Long name received + else + { + insertString->Des().Append( info.iLongName ); + } // + + items->AppendL( *insertString ); + CleanupStack::PopAndDestroy(); + } + + CTextListBoxModel* model = list->Model(); + model->SetItemTextArray( items ); + model->SetOwnershipType( ELbmOwnsItemArray ); + CleanupStack::Pop( items ); // Listbox model now owns this + + // Set title for list + SetTitleToPopupL( *iNetworkPopupList, R_NETSL_FOUNDOPERATORS ); + + TInt res = 0; + // Show the PLMN list + if ( items->Count() ) + { + res = iNetworkPopupList->ExecuteLD(); + } // + + iNetworkPopupList = NULL; + iApprovedNetwork = ETrue; // User might want to quit + TInt selection = list->CurrentItemIndex(); + + CleanupStack::PopAndDestroy( list ); + + if ( res ) + { + MPsetNetworkSelect::TNetworkInfo info = + iNetworkArray->At( selection ); + info.iMode = MPsetNetworkSelect::ENetSelectModeManual; + iNetwork->SelectNetworkL( info ); + } // + else // User selected "Cancel" + { + // Reset back to previously used network + iNetwork->ResetNetworkSearch(); + iSearchForNetworksActive = EFalse; + // After list has been used, clear it + PurgeNetworkList(); + iPLMNListPopulateShowIsHandling = EFalse; + } // + } + } + + iApprovedNetwork = EFalse; // Initialize before new search + } + +// --------------------------------------------------------------------------- +// +// Creates dialog, if it is does not exist yet. +// +// --------------------------------------------------------------------------- +// +void CAiDialogRenderer::CheckAndCreateDlgL( TBool aDelayOff ) + { + if ( !iDlg ) + { + iDlg = new ( ELeave ) CAknWaitDialog( + reinterpret_cast ( &iDlg ), aDelayOff ); + } + } + +// --------------------------------------------------------------------------- +// +// Sets a title to a given popup list. +// +// --------------------------------------------------------------------------- +void CAiDialogRenderer::SetTitleToPopupL( CAknPopupList& aList, TInt aTitleID ) + { + HBufC* text = StringLoader::LoadLC( aTitleID ); + + aList.SetTitleL( *text ); + + CleanupStack::PopAndDestroy( text ); + text = NULL; + } + +// --------------------------------------------------------------------------- +// +// Shows note. +// +// --------------------------------------------------------------------------- +// +void CAiDialogRenderer::ShowNoteL( TInt aResourceId, TInt aType ) + { + HBufC* string = StringLoader::LoadLC( aResourceId ); + + switch ( aType ) + { + case KAIPPErrorNote: + { + CAknErrorNote* note = new ( ELeave ) CAknErrorNote ( ETrue ); + note->ExecuteLD( *string ); + break; + } + case KAIPPConfirmationNote: + { + CAknConfirmationNote* note = + new ( ELeave ) CAknConfirmationNote( ETrue ); + note->ExecuteLD( *string ); + break; + } + case KAIPPInformationNote: + { + CAknInformationNote* note = + new ( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *string ); + break; + } + default: + break; + } + + CleanupStack::PopAndDestroy( string ); + } + +// --------------------------------------------------------------------------- +// +// Empties fetched network provider's list +// +// --------------------------------------------------------------------------- +// +void CAiDialogRenderer::PurgeNetworkList() + { + if ( iNetworkArray ) + { + iNetworkArray->Reset(); + delete iNetworkArray; + iNetworkArray = NULL; + } + } + +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/src/ainativerenderer.cpp --- a/idlehomescreen/nativeuicontroller/src/ainativerenderer.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/src/ainativerenderer.cpp Wed May 12 13:22:51 2010 +0300 @@ -15,21 +15,34 @@ * */ +// System includes -#include +// User includes +#include +#include + #include "ainativerenderer.h" #include "ainativeuiplugins.h" using namespace AiNativeUiController; - +// ======== MEMBER FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// CAiNativeRenderer::CAiNativeRenderer() +// +// ---------------------------------------------------------------------------- +// CAiNativeRenderer::~CAiNativeRenderer() { } - -TInt CAiNativeRenderer::Publish( MAiPropertyExtension& aPlugin, TInt aContent, - TInt aResource, TInt aIndex ) +// ---------------------------------------------------------------------------- +// CAiNativeRenderer::Publish() +// +// ---------------------------------------------------------------------------- +// +TInt CAiNativeRenderer::Publish( CHsContentPublisher& aPlugin, TInt aContent, + TInt aResource, TInt aIndex ) { TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); @@ -39,12 +52,17 @@ } TRAP( err, DoPublishL( aPlugin, aContent, aResource, aIndex ) ); + return err; } - -TInt CAiNativeRenderer::Publish( MAiPropertyExtension& aPlugin, TInt aContent, - const TDesC16& aText, TInt aIndex ) +// ---------------------------------------------------------------------------- +// CAiNativeRenderer::Publish() +// +// ---------------------------------------------------------------------------- +// +TInt CAiNativeRenderer::Publish( CHsContentPublisher& aPlugin, TInt aContent, + const TDesC16& aText, TInt aIndex ) { TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); @@ -54,12 +72,17 @@ } TRAP( err, DoPublishL( aPlugin, aContent, aText, aIndex ) ); + return err; } - -TInt CAiNativeRenderer::Publish( MAiPropertyExtension& aPlugin, TInt aContent, - const TDesC8& aBuf, TInt aIndex ) +// ---------------------------------------------------------------------------- +// CAiNativeRenderer::Publish() +// +// ---------------------------------------------------------------------------- +// +TInt CAiNativeRenderer::Publish( CHsContentPublisher& aPlugin, TInt aContent, + const TDesC8& aBuf, TInt aIndex ) { TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); @@ -69,12 +92,17 @@ } TRAP( err, DoPublishL( aPlugin, aContent, aBuf, aIndex ) ); + return err; } - -TInt CAiNativeRenderer::Publish( MAiPropertyExtension& aPlugin, TInt aContent, - RFile& aFile, TInt aIndex ) +// ---------------------------------------------------------------------------- +// CAiNativeRenderer::Publish() +// +// ---------------------------------------------------------------------------- +// +TInt CAiNativeRenderer::Publish( CHsContentPublisher& aPlugin, TInt aContent, + RFile& aFile, TInt aIndex ) { TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); @@ -84,11 +112,16 @@ } TRAP( err, DoPublishL( aPlugin, aContent, aFile, aIndex ) ); + return err; } - -TInt CAiNativeRenderer::Clean( MAiPropertyExtension& aPlugin, TInt aContent ) +// ---------------------------------------------------------------------------- +// CAiNativeRenderer::Clean() +// +// ---------------------------------------------------------------------------- +// +TInt CAiNativeRenderer::Clean( CHsContentPublisher& aPlugin, TInt aContent ) { TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); @@ -98,50 +131,75 @@ } TRAP( err, DoCleanL( aPlugin, aContent ) ); + return err; } - -void CAiNativeRenderer::DoPublishL - ( MAiPropertyExtension& /*aPlugin*/, TInt /*aContent*/, TInt /*aResource*/, TInt /*aIndex*/ ) +// ---------------------------------------------------------------------------- +// CAiNativeRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiNativeRenderer::DoPublishL( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, TInt /*aResource*/, TInt /*aIndex*/ ) { // Default implementation, overridden in subclass if needed. User::Leave( KErrNotFound ); } - -void CAiNativeRenderer::DoPublishL - ( MAiPropertyExtension& /*aPlugin*/, TInt /*aContent*/, const TDesC16& /*aText*/, TInt /*aIndex*/ ) +// ---------------------------------------------------------------------------- +// CAiNativeRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiNativeRenderer::DoPublishL( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, const TDesC16& /*aText*/, TInt /*aIndex*/ ) { // Default implementation, overridden in subclass if needed. User::Leave( KErrNotFound ); } - -void CAiNativeRenderer::DoPublishL - ( MAiPropertyExtension& /*aPlugin*/, TInt /*aContent*/, const TDesC8& /*aBuf*/, TInt /*aIndex*/ ) +// ---------------------------------------------------------------------------- +// CAiNativeRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiNativeRenderer::DoPublishL( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, const TDesC8& /*aBuf*/, TInt /*aIndex*/ ) { // Default implementation, overridden in subclass if needed. User::Leave( KErrNotFound ); } - -void CAiNativeRenderer::DoPublishL - ( MAiPropertyExtension& /*aPlugin*/, TInt /*aContent*/, RFile& /*aFile*/, TInt /*aIndex*/ ) +// ---------------------------------------------------------------------------- +// CAiNativeRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiNativeRenderer::DoPublishL( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, RFile& /*aFile*/, TInt /*aIndex*/ ) { // Default implementation, overridden in subclass if needed. User::Leave( KErrNotFound ); } - -void CAiNativeRenderer::DoCleanL - ( MAiPropertyExtension& /*aPlugin*/, TInt /*aContent*/ ) +// ---------------------------------------------------------------------------- +// CAiNativeRenderer::DoCleanL() +// +// ---------------------------------------------------------------------------- +// +void CAiNativeRenderer::DoCleanL( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/ ) { // Default implementation, overridden in subclass if needed. User::Leave( KErrNotFound ); } - +// ---------------------------------------------------------------------------- +// CAiNativeRenderer::GetIntContentId() +// +// ---------------------------------------------------------------------------- +// TInt CAiNativeRenderer::GetIntContentId( const TDesC& aCid ) const { for( TInt i( 0 ); i < KAiDeviceStatusContentCount; i++ ) @@ -154,30 +212,19 @@ } } - for( TInt i( 0 ); i < KAiScutContentCount; i++ ) - { - const TAiContentItem& item = KAiScutContent[i]; - if( ContentCid(item) == aCid ) - { - //match - return item.id; - } - } - return KErrNotFound; } - -TBool CAiNativeRenderer::MatchMimeType( MAiPropertyExtension& aPlugin, - TInt aContentId, - const TDesC8& aMimeType ) const +// ---------------------------------------------------------------------------- +// CAiNativeRenderer::MatchMimeType() +// +// ---------------------------------------------------------------------------- +// +TBool CAiNativeRenderer::MatchMimeType( CHsContentPublisher& aPlugin, + TInt aContentId, const TDesC8& aMimeType ) const { - TUid pluginUid; - TRAPD( err, pluginUid = aPlugin.PublisherInfoL()->iUid ); - if ( err != KErrNone ) - { - return EFalse; - } + TUid pluginUid( aPlugin.PublisherInfo().Uid() ); + // loop through Device Status content items if ( pluginUid == KDeviceStatusPluginUid ) { @@ -195,23 +242,6 @@ return ( mimeType.Match( aMimeType ) != KErrNotFound ); } } - else if ( pluginUid == KShortcutPluginUid ) - { - // if match not found, loop through Shortcut content items - for( TInt i( 0 ); i < KAiScutContentCount; i++ ) - { - const TAiContentItem& item = KAiScutContent[i]; - - if( item.id != aContentId ) - { - continue; - } - - TBuf8 mimeType((TText8*) item.type); - - return ( mimeType.Match( aMimeType ) != KErrNotFound ); - } - } else if ( pluginUid == KProfilePluginUid ) { // if match not found, loop through Profile content items @@ -233,11 +263,22 @@ return EFalse; } - -void CAiNativeRenderer::DoMimeTypeCheckL( MAiPropertyExtension& aPlugin, TInt aContentId ) +// ---------------------------------------------------------------------------- +// CAiNativeRenderer::DoMimeTypeCheckL() +// +// ---------------------------------------------------------------------------- +// +void CAiNativeRenderer::DoMimeTypeCheckL( CHsContentPublisher& aPlugin, + TInt aContentId ) { - MAiContentItemIterator* iter = - (MAiContentItemIterator*)aPlugin.GetPropertyL( EAiPublisherContent ); + MAiContentItemIterator* iter( static_cast< MAiContentItemIterator* >( + aPlugin.GetProperty( CHsContentPublisher::EPublisherContent ) ) ); + + if ( !iter ) + { + User::Leave( KErrNotSupported ); + } + const TAiContentItem& item = iter->ItemL( aContentId ); aContentId = GetIntContentId( ContentCid(item) ); @@ -246,6 +287,7 @@ { User::Leave( KErrNotSupported ); } + } - } - +// End of file + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/src/ainativeuimodel.cpp --- a/idlehomescreen/nativeuicontroller/src/ainativeuimodel.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/src/ainativeuimodel.cpp Wed May 12 13:22:51 2010 +0300 @@ -17,7 +17,7 @@ #include "ainativeuimodel.h" -#include "aidevicestatuscontentmodel.h" +#include namespace AiNativeUiController { diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/src/ainavipanerenderer.cpp --- a/idlehomescreen/nativeuicontroller/src/ainavipanerenderer.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/src/ainavipanerenderer.cpp Wed May 12 13:22:51 2010 +0300 @@ -15,11 +15,14 @@ * */ - -#include +// System includes #include #include +// User includes +#include +#include + #include "ainavipanerenderer.h" #include "ainavipaneanimator.h" #include "aistatuspanel.h" @@ -31,7 +34,11 @@ using namespace AiNativeUiController; - +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer::ConstructL() +// +// ---------------------------------------------------------------------------- +// void CAiNaviPaneRenderer::ConstructL() { iAnimator = CAiNaviPaneAnimator::NewL( iStatusPanel, @@ -41,17 +48,26 @@ iSilentIndicator = HBufC::NewL(0); } - +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer::NewLC() +// +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer* CAiNaviPaneRenderer::NewLC( CAiStatusPanel& aStatusPanel ) { - CAiNaviPaneRenderer* self = new( ELeave ) CAiNaviPaneRenderer( aStatusPanel ); + CAiNaviPaneRenderer* self = + new( ELeave ) CAiNaviPaneRenderer( aStatusPanel ); CleanupStack::PushL( self ); self->ConstructL(); return self; } - +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer::~CAiNaviPaneRenderer() +// +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer::~CAiNaviPaneRenderer() { delete iAnimator; @@ -60,7 +76,11 @@ delete iTimedProfileIndicator; } - +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer::CAiNaviPaneRenderer() +// +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer::CAiNaviPaneRenderer( CAiStatusPanel& aStatusPanel ) : iStatusPanel( aStatusPanel ), iRenderingPriorities( AiNativeUiModel::RenderingPriorities( AiNativeUiModel::KNaviPaneId ) ), @@ -69,13 +89,17 @@ { } - -void CAiNaviPaneRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC16& aText, - TInt /*aIndex*/ ) +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiNaviPaneRenderer::DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, const TDesC16& aText, TInt /*aIndex*/ ) { - if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + if( info.Uid() == KDeviceStatusPluginUid ) { switch( aContent ) { @@ -226,6 +250,11 @@ } } +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer::ConstructProfileTextLC() +// +// ---------------------------------------------------------------------------- +// HBufC* CAiNaviPaneRenderer::ConstructProfileTextLC() { TInt bufLen = iProfileText->Length(); @@ -253,9 +282,16 @@ return temp; } -void CAiNaviPaneRenderer::DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent ) +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer::DoCleanL() +// +// ---------------------------------------------------------------------------- +// +void CAiNaviPaneRenderer::DoCleanL( CHsContentPublisher& aPlugin, TInt aContent ) { - if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + if( info.Uid() == KDeviceStatusPluginUid ) { switch( aContent ) @@ -305,7 +341,7 @@ iStatusPanel.RenderNaviPaneL(); MAiContentRequest* contentReq = static_cast( - aPlugin.GetPropertyL( EAiContentRequest ) ); + aPlugin.GetProperty( CHsContentPublisher::EContentRequest ) ); if ( contentReq ) { @@ -349,7 +385,11 @@ } - +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer::FocusObtainedL() +// +// ---------------------------------------------------------------------------- +// void CAiNaviPaneRenderer::FocusObtainedL() { if( !iStatusPanel.IsKeyLockEnabled() ) @@ -359,7 +399,11 @@ iFocusObtained = ETrue; } - +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer::FocusLostL() +// +// ---------------------------------------------------------------------------- +// void CAiNaviPaneRenderer::FocusLostL() { iAnimator->CancelAnimationL(); @@ -367,19 +411,31 @@ iCommitted = EFalse; } - +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer::KeylockDisabledL() +// +// ---------------------------------------------------------------------------- +// void CAiNaviPaneRenderer::KeylockDisabledL() { iAnimator->AnimateL(); } - +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer::KeylockEnabledL() +// +// ---------------------------------------------------------------------------- +// void CAiNaviPaneRenderer::KeylockEnabledL() { iAnimator->CancelAnimationL(); } - +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer::TransactionCommittedL() +// +// ---------------------------------------------------------------------------- +// void CAiNaviPaneRenderer::TransactionCommittedL() { if( iIsChanged ) @@ -393,7 +449,11 @@ } } - +// ---------------------------------------------------------------------------- +// CAiNaviPaneRenderer::AnimationCompleteL() +// +// ---------------------------------------------------------------------------- +// void CAiNaviPaneRenderer::AnimationCompleteL() { // Navi pane animation is now completed -> show original text @@ -414,3 +474,4 @@ CleanupStack::PopAndDestroy( newText ); } +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/src/ainotifierrenderer.cpp --- a/idlehomescreen/nativeuicontroller/src/ainotifierrenderer.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/src/ainotifierrenderer.cpp Wed May 12 13:22:51 2010 +0300 @@ -15,23 +15,31 @@ * */ +// System includes +#include -#include +// User includes +#include +#include #include -#include - #include - #include "ainotifierrenderer.h" #include "ainativeuiplugins.h" using namespace AiNativeUiController; +// Constants + // 1-minute timeout before showing soft notification const TInt KNetworkLostTimeout = 60*1000000; // ======== MEMBER FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// CAiNotifierRenderer::NewLC() +// +// ---------------------------------------------------------------------------- +// CAiNotifierRenderer* CAiNotifierRenderer::NewLC() { CAiNotifierRenderer* self = new( ELeave ) CAiNotifierRenderer; @@ -40,30 +48,48 @@ return self; } - +// ---------------------------------------------------------------------------- +// CAiNotifierRenderer::~CAiNotifierRenderer() +// +// ---------------------------------------------------------------------------- +// CAiNotifierRenderer::~CAiNotifierRenderer() { delete iSoftNotifier; delete iTimer; } - +// ---------------------------------------------------------------------------- +// CAiNotifierRenderer::CAiNotifierRenderer() +// +// ---------------------------------------------------------------------------- +// CAiNotifierRenderer::CAiNotifierRenderer() { } +// ---------------------------------------------------------------------------- +// CAiNotifierRenderer::ConstructL() +// +// ---------------------------------------------------------------------------- +// void CAiNotifierRenderer::ConstructL() { iSoftNotifier = CAknSoftNotifier::NewL(); iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); } -void CAiNotifierRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aResource, - TInt /*aIndex*/ ) +// ---------------------------------------------------------------------------- +// CAiNotifierRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiNotifierRenderer::DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, TInt aResource, TInt /*aIndex*/ ) { - if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + if( info.Uid() == KDeviceStatusPluginUid ) { switch( aContent ) { @@ -90,7 +116,7 @@ User::Leave( KErrNotFound ); break; } - }; + } } else { @@ -98,8 +124,13 @@ } } -void CAiNotifierRenderer::DoCleanL( MAiPropertyExtension& /*aPlugin*/, - TInt aContent ) +// ---------------------------------------------------------------------------- +// CAiNotifierRenderer::DoCleanL() +// +// ---------------------------------------------------------------------------- +// +void CAiNotifierRenderer::DoCleanL( CHsContentPublisher& /*aPlugin*/, + TInt aContent ) { switch( aContent ) { @@ -114,30 +145,47 @@ User::Leave( KErrNotFound ); break; } - }; - + } } - +// ---------------------------------------------------------------------------- +// CAiNotifierRenderer::AddNotification() +// +// ---------------------------------------------------------------------------- +// void CAiNotifierRenderer::AddNotification( TAknSoftNotificationType aType ) { - TRAP_IGNORE( iSoftNotifier->AddNotificationL( aType, 1 ); ); + TRAP_IGNORE( iSoftNotifier->AddNotificationL( aType, 1 ) ); } -void CAiNotifierRenderer::RemoveNotification( TAknSoftNotificationType aType) +// ---------------------------------------------------------------------------- +// CAiNotifierRenderer::RemoveNotification() +// +// ---------------------------------------------------------------------------- +// +void CAiNotifierRenderer::RemoveNotification( TAknSoftNotificationType aType ) { TRAP_IGNORE( iSoftNotifier->CancelSoftNotificationL( aType ); ); } -TInt CAiNotifierRenderer::NWLostDelayCallBack(TAny* aParam) +// ---------------------------------------------------------------------------- +// CAiNotifierRenderer::NWLostDelayCallBack() +// +// ---------------------------------------------------------------------------- +// +TInt CAiNotifierRenderer::NWLostDelayCallBack( TAny* aParam ) { - CAiNotifierRenderer* self = reinterpret_cast (aParam); - if ( self ) + CAiNotifierRenderer* self = + reinterpret_cast< CAiNotifierRenderer* >( aParam ); + + if ( self ) { self->iTimer->Cancel(); self->AddNotification( ESelectNetworkNotification ); } + return KErrNone; } +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/src/aisoftkeyrenderer.cpp --- a/idlehomescreen/nativeuicontroller/src/aisoftkeyrenderer.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/src/aisoftkeyrenderer.cpp Wed May 12 13:22:51 2010 +0300 @@ -15,11 +15,10 @@ * */ - +// System includes #include #include #include -#include #include #include #include @@ -29,21 +28,25 @@ #include #include #include -#include + +// User includes +#include +#include + +#include #include "ainativeui.hrh" #include "aisoftkeyrenderer.h" #include "ainativeuiplugins.h" -#include "aiscutdefs.h" - using namespace AiNativeUiController; +// Constants // Index for left softkey; defined in avkon -const TInt KNativeUiLeftSoftkeyId = 0; +//const TInt KNativeUiLeftSoftkeyId = 0; // Index for right softkey; defined in avkon -const TInt KNativeUiRightSoftkeyId = 2; +//const TInt KNativeUiRightSoftkeyId = 2; const TInt KControlArrayCBAButton1Posn =0; const TInt KControlArrayCBAButton2Posn =2; @@ -51,7 +54,7 @@ const TInt KWideScreenWidth = 640; - +// ======== LOCAL FUNCTIONS ======== inline TAknWindowComponentLayout DoCompose( TAknWindowComponentLayout aLine1, TAknWindowComponentLayout aLine2 ) { @@ -420,14 +423,23 @@ return size; } - +// ======== MEMBER FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::ConstructL() +// +// ---------------------------------------------------------------------------- +// void CAiSoftKeyRenderer::ConstructL() { // load default soft key labels from resource CreateDefaultSoftKeysL(); } - +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::NewLC() +// +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer* CAiSoftKeyRenderer::NewLC() { CAiSoftKeyRenderer* self = new( ELeave ) CAiSoftKeyRenderer(); @@ -436,7 +448,11 @@ return self; } - +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::~CAiSoftKeyRenderer() +// +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::~CAiSoftKeyRenderer() { delete iText; @@ -450,136 +466,54 @@ delete iCba; } - +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::CAiSoftKeyRenderer() +// +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::CAiSoftKeyRenderer() { iAppUi = iAvkonAppUi; } - - - -void CAiSoftKeyRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC16& aText, - TInt aIndex ) +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiSoftKeyRenderer::DoPublishL( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, const TDesC16& /*aText*/, TInt /*aIndex*/ ) { - if( aPlugin.PublisherInfoL()->iUid == KShortcutPluginUid ) - { - if( aContent == KAiScutContent[EAiScutContentShortcutShortCaption].id ) - { - HBufC* temp = aText.AllocL(); - delete iText; - iText = temp; - - UpdateSoftKeyL( aIndex, NULL ); - } - } - else - { - User::Leave( KErrNotFound ); - } + User::Leave( KErrNotFound ); } - -void CAiSoftKeyRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aResource, - TInt aIndex ) +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiSoftKeyRenderer::DoPublishL( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, TInt /*aResource*/, TInt /*aIndex*/ ) { - if( aPlugin.PublisherInfoL()->iUid == KShortcutPluginUid ) - { - if( aContent == KAiScutContent[EAiScutContentShortcutShortCaption].id ) - { - TInt internalId = KErrNotFound; - switch( aResource ) - { - case EAiScutResourceBackCaption: - { - internalId = R_NATIVEUI_SK_BACK; - break; - } - case EAiScutResourceNewMsgShortCaption: - { - internalId = R_NATIVEUI_SK_NEWMSG; - break; - } - case EAiScutResourceNewEmailShortCaption: - { - internalId = R_NATIVEUI_SK_EMAIL; - break; - } - case EAiScutResourceNewSyncMLMailShortCaption: - { - internalId = R_NATIVEUI_SK_SYNCMLMAIL; - break; - } - case EAiScutResourceNewPostcardShortCaption: - { - internalId = R_NATIVEUI_SK_MMSPOSTCARD; - break; - } - case EAiScutResourceSelectMsgTypeShortCaption: - { - internalId = R_NATIVEUI_SK_MSGTYPE; - break; - } - case EAiScutResourceNewAudioMsgShortCaption: - { - internalId = R_NATIVEUI_SK_AUDIOMSG; - break; - } - case EAiScutResourceChangeThemeShortCaption: - { - internalId = R_NATIVEUI_SK_CHANGETHEME; - break; - } - default: - { - User::Leave( KErrNotFound ); - } - } - - HBufC* temp = StringLoader::LoadL( internalId ); - delete iText; - iText = temp; - - UpdateSoftKeyL( aIndex, NULL ); - } - } - else - { - User::Leave( KErrNotFound ); - } + User::Leave( KErrNotFound ); } - -void CAiSoftKeyRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC8& aBuf, - TInt aIndex ) +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiSoftKeyRenderer::DoPublishL( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, const TDesC8& /*aBuf*/, TInt /*aIndex*/ ) { - if( aPlugin.PublisherInfoL()->iUid == KShortcutPluginUid ) - { - if( aContent == KAiScutContent[EAiScutContentShortcutSkIcon].id ) - { - CGulIcon* icon = NULL; - TPckg( icon ).Copy( aBuf ); - // icon ownership is transferred - UpdateSoftKeyL( aIndex, icon ); - } - else - { - User::Leave( KErrNotSupported ); - } - } - else - { - User::Leave( KErrNotFound ); - } + User::Leave( KErrNotFound ); } - +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::CreateDefaultSoftKeysL() +// +// ---------------------------------------------------------------------------- +// void CAiSoftKeyRenderer::CreateDefaultSoftKeysL() { // If we already have cba, then do nothing. @@ -611,8 +545,12 @@ ECoeStackFlagRefusesFocus | ECoeStackFlagRefusesAllKeys ); } - -void CAiSoftKeyRenderer::UpdateSoftKeyL( TInt aKey, CGulIcon* aIcon ) +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::UpdateSoftKeyL() +// +// ---------------------------------------------------------------------------- +// +void CAiSoftKeyRenderer::UpdateSoftKeyL( TInt /*aKey*/, CGulIcon* /*aIcon*/ ) { if( !iCba ) { @@ -620,9 +558,10 @@ } // remove the locked flag if any - aKey &= KScutBitMaskLocked; + // NOTE ai_shortcut_command_api has been removed! + //aKey &= KScutBitMaskLocked; - TInt buttonPosImage; + /*TInt buttonPosImage; TInt buttonPosText; TInt buttonCmd; @@ -672,5 +611,7 @@ *iText ); } - iCba->DrawDeferred(); + iCba->DrawDeferred();*/ } + +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/src/aistatuspanel.cpp --- a/idlehomescreen/nativeuicontroller/src/aistatuspanel.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/src/aistatuspanel.cpp Wed May 12 13:22:51 2010 +0300 @@ -158,6 +158,9 @@ if( !iTitlePaneText ) { __PRINTS("XAI: Rendering text to title pane - invalid text, aborting"); + + iTextInTitlePane = EFalse; + return; } @@ -173,6 +176,9 @@ iTitlePaneText = NULL; UpdatePhoneDisplayInfo( displayText ); + + iTextInTitlePane = ETrue; + __PRINTS("XAI: Rendering text to title pane - done"); } @@ -183,6 +189,7 @@ if( iBitmapHandle == KErrNotFound ) { __PRINTS("XAI: Rendering bitmap to title pane - invalid bitmap handle, aborting"); + return; } @@ -275,6 +282,9 @@ // undetermined stuff could occurr iBitmapHandle = KErrNotFound; iMaskHandle = KErrNotFound; + + iTextInTitlePane = EFalse; + __PRINTS("XAI: Rendering bitmap to title pane - done"); } @@ -386,7 +396,7 @@ void CAiStatusPanel::StopTitlePaneScrollingL() { // stop scrolling - if( iTitlePane->Text() ) + if( iTextInTitlePane && iTitlePane->Text() ) { iTitlePane->SetTextL( *iTitlePane->Text(), EFalse ); } @@ -395,7 +405,7 @@ void CAiStatusPanel::ScrollTitlePaneTextL() { // start scrolling - if( iTitlePane->Text() ) + if ( iTextInTitlePane && iTitlePane->Text() ) { iTitlePane->SetTextL( *iTitlePane->Text(), ETrue ); } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/src/aistatuspanetouchui.cpp --- a/idlehomescreen/nativeuicontroller/src/aistatuspanetouchui.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/src/aistatuspanetouchui.cpp Wed May 12 13:22:51 2010 +0300 @@ -15,33 +15,34 @@ * */ - +// System includes #include -#include +#include +#include +#include +#include +#include +#include +#include +#ifdef RD_TACTILE_FEEDBACK +#include +#endif +#include +#include +#include +#include +// User includes #include "aistrcnv.h" #include "aistatuspanetouchui.h" #include "aistatuspanel.h" #include "ainativeuiplugins.h" #include "aifweventhandler.h" #include "aiconsts.h" -#include "aidevicestatuscontentmodel.h" -#include - -#include -#include -#include -#include -#include -#include -#include - -#ifdef RD_TACTILE_FEEDBACK -#include -#endif using namespace AiNativeUiController; +// Constants _LIT( KProfileSwitchByIndexEvent, "Profile/SwitchProfileByIndex" ); const TInt KProfileSwitchByIndexEventLength = 28; const TInt KRadix = 10; @@ -52,6 +53,12 @@ _LIT( KOpenAppProfiles, "Shortcut/LaunchByValue(localapp:0x100058F8)" ); _LIT( KOpenAppCalendar, "Shortcut/LaunchByValue(localapp:0x10005901)" ); +// ======== LOCAL FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// IndexLength() +// +// ---------------------------------------------------------------------------- +// static TInt IndexLength( TInt aIndex ) { TInt length = 0; @@ -72,35 +79,54 @@ // ======== MEMBER FUNCTIONS ======== - +// ---------------------------------------------------------------------------- +// CAiStatusPaneTouchUi::NewL() +// +// ---------------------------------------------------------------------------- +// CAiStatusPaneTouchUi* CAiStatusPaneTouchUi::NewL( CAiStatusPanel& aStatusPanel, - MAiFwEventHandler& aEventHandler ) + MAiFwEventHandler& aEventHandler ) { - CAiStatusPaneTouchUi* self = CAiStatusPaneTouchUi::NewLC( aStatusPanel, aEventHandler ); + CAiStatusPaneTouchUi* self = + CAiStatusPaneTouchUi::NewLC( aStatusPanel, aEventHandler ); CleanupStack::Pop( self ); return self; } +// ---------------------------------------------------------------------------- +// CAiStatusPaneTouchUi::NewLC() +// +// ---------------------------------------------------------------------------- +// CAiStatusPaneTouchUi* CAiStatusPaneTouchUi::NewLC( CAiStatusPanel& aStatusPanel, - MAiFwEventHandler& aEventHandler ) + MAiFwEventHandler& aEventHandler ) { - CAiStatusPaneTouchUi* self = new (ELeave) CAiStatusPaneTouchUi( aStatusPanel, aEventHandler ); + CAiStatusPaneTouchUi* self = + new ( ELeave ) CAiStatusPaneTouchUi( aStatusPanel, aEventHandler ); CleanupStack::PushL( self ); self->ConstructL(); return self; } +// ---------------------------------------------------------------------------- +// CAiStatusPaneTouchUi::CAiStatusPaneTouchUi() +// +// ---------------------------------------------------------------------------- +// CAiStatusPaneTouchUi::CAiStatusPaneTouchUi( CAiStatusPanel& aStatusPanel, - MAiFwEventHandler& aEventHandler ) - : - iStatusPane( aStatusPanel ), - iEventHandler( aEventHandler ) + MAiFwEventHandler& aEventHandler ) + : iStatusPane( aStatusPanel ), iEventHandler( aEventHandler ) { - // no implementation required + // no implementation required } +// ---------------------------------------------------------------------------- +// CAiStatusPaneTouchUi::~CAiStatusPaneTouchUi() +// +// ---------------------------------------------------------------------------- +// CAiStatusPaneTouchUi::~CAiStatusPaneTouchUi() { delete iEventBuffer; @@ -108,6 +134,11 @@ iProfileNamePointerArray.ResetAndDestroy(); } +// ---------------------------------------------------------------------------- +// CAiStatusPaneTouchUi::ConstructL() +// +// ---------------------------------------------------------------------------- +// void CAiStatusPaneTouchUi::ConstructL() { if( AknLayoutUtils::PenEnabled() ) @@ -116,6 +147,11 @@ } } +// ---------------------------------------------------------------------------- +// CAiStatusPaneTouchUi::LoadUIDefinitionL() +// +// ---------------------------------------------------------------------------- +// void CAiStatusPaneTouchUi::LoadUIDefinitionL() { // If profile popup exists, for example, when screendevicechange occurs, @@ -127,6 +163,11 @@ } } +// ---------------------------------------------------------------------------- +// CAiStatusPaneTouchUi::ProcessCommandL() +// +// ---------------------------------------------------------------------------- +// void CAiStatusPaneTouchUi::ProcessCommandL( TInt aCommandId ) { if( aCommandId == EAIGotoCalendarCmdLink ) @@ -162,8 +203,11 @@ } } - - +// ---------------------------------------------------------------------------- +// CAiStatusPaneTouchUi::HandleNaviDecoratorEventL() +// +// ---------------------------------------------------------------------------- +// void CAiStatusPaneTouchUi::HandleNaviDecoratorEventL( TInt aEventID ) { if( aEventID == EAknNaviDecoratorEventNaviLabel ) @@ -261,13 +305,17 @@ } } - -void CAiStatusPaneTouchUi::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC16& aText, - TInt aIndex ) +// ---------------------------------------------------------------------------- +// CAiStatusPaneTouchUi::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiStatusPaneTouchUi::DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, const TDesC16& aText, TInt aIndex ) { - if( aPlugin.PublisherInfoL()->iUid == KProfilePluginUid ) + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + if( info.Uid() == KProfilePluginUid ) { switch( aContent ) { @@ -303,8 +351,14 @@ } } -void CAiStatusPaneTouchUi::SetEmphasis( CCoeControl* /*aMenuControl*/, TBool /*aEmphasis*/ ) - { - } +// ---------------------------------------------------------------------------- +// CAiStatusPaneTouchUi::SetEmphasis() +// +// ---------------------------------------------------------------------------- +// +void CAiStatusPaneTouchUi::SetEmphasis( CCoeControl* /*aMenuControl*/, + TBool /*aEmphasis*/ ) + { + } - +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/src/aititlepanerenderer.cpp --- a/idlehomescreen/nativeuicontroller/src/aititlepanerenderer.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/src/aititlepanerenderer.cpp Wed May 12 13:22:51 2010 +0300 @@ -15,53 +15,80 @@ * */ - +// System includes #include #include #include + +// User includes +#include +#include + #include "aititlepanerenderer.h" #include "aistatuspanel.h" -#include "aipropertyextension.h" + #include #include "ainativeuiplugins.h" #include "debug.h" using namespace AiNativeUiController; - +// ======== MEMBER FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// CAiTitlePaneRenderer::ConstructL() +// +// ---------------------------------------------------------------------------- +// void CAiTitlePaneRenderer::ConstructL() { } - -CAiTitlePaneRenderer* CAiTitlePaneRenderer::NewLC( CAiStatusPanel& aStatusPanel ) +// ---------------------------------------------------------------------------- +// CAiTitlePaneRenderer::NewLC() +// +// ---------------------------------------------------------------------------- +// +CAiTitlePaneRenderer* CAiTitlePaneRenderer::NewLC( + CAiStatusPanel& aStatusPanel ) { - CAiTitlePaneRenderer* self = new( ELeave ) CAiTitlePaneRenderer( aStatusPanel ); + CAiTitlePaneRenderer* self = + new( ELeave ) CAiTitlePaneRenderer( aStatusPanel ); + CleanupStack::PushL( self ); self->ConstructL(); return self; } - +// ---------------------------------------------------------------------------- +// CAiTitlePaneRenderer::CAiTitlePaneRenderer() +// +// ---------------------------------------------------------------------------- +// CAiTitlePaneRenderer::~CAiTitlePaneRenderer() { } - +// ---------------------------------------------------------------------------- +// CAiTitlePaneRenderer::CAiTitlePaneRenderer() +// +// ---------------------------------------------------------------------------- +// CAiTitlePaneRenderer::CAiTitlePaneRenderer( CAiStatusPanel& aStatusPanel ) : iStatusPanel( aStatusPanel ) { } - - - -void CAiTitlePaneRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC16& aText, - TInt /*aIndex*/ ) +// ---------------------------------------------------------------------------- +// CAiTitlePaneRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiTitlePaneRenderer::DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, const TDesC16& aText, TInt /*aIndex*/ ) { - if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + if( info.Uid() == KDeviceStatusPluginUid ) { switch( aContent ) { @@ -89,12 +116,17 @@ } } -void CAiTitlePaneRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC8& aBuf, - TInt /*aIndex*/ ) +// ---------------------------------------------------------------------------- +// CAiTitlePaneRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiTitlePaneRenderer::DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, const TDesC8& aBuf, TInt /*aIndex*/ ) { - if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + if( info.Uid() == KDeviceStatusPluginUid ) { switch( aContent ) { @@ -135,12 +167,17 @@ } } -void CAiTitlePaneRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aResource, - TInt /*aIndex*/ ) +// ---------------------------------------------------------------------------- +// CAiTitlePaneRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiTitlePaneRenderer::DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, TInt aResource, TInt /*aIndex*/ ) { - if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + if( info.Uid() == KDeviceStatusPluginUid ) { switch( aContent ) { @@ -168,11 +205,19 @@ } } - -void CAiTitlePaneRenderer::DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent ) +// ---------------------------------------------------------------------------- +// CAiTitlePaneRenderer::DoCleanL() +// +// ---------------------------------------------------------------------------- +// +void CAiTitlePaneRenderer::DoCleanL( CHsContentPublisher& aPlugin, + TInt aContent ) { __PRINT(__DBG_FORMAT("XAI: Clean title pane - %d"), aContent ); - if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + if( info.Uid() == KDeviceStatusPluginUid ) { switch( aContent ) { @@ -199,21 +244,43 @@ } } +// ---------------------------------------------------------------------------- +// CAiTitlePaneRenderer::TransactionCommittedL() +// +// ---------------------------------------------------------------------------- +// void CAiTitlePaneRenderer::TransactionCommittedL() { } +// ---------------------------------------------------------------------------- +// CAiTitlePaneRenderer::KeylockEnabledL() +// +// ---------------------------------------------------------------------------- +// void CAiTitlePaneRenderer::KeylockEnabledL() { iStatusPanel.StopTitlePaneScrollingL(); } +// ---------------------------------------------------------------------------- +// CAiTitlePaneRenderer::FocusObtainedL() +// +// ---------------------------------------------------------------------------- +// void CAiTitlePaneRenderer::FocusObtainedL() { iStatusPanel.RenderTitlePaneL(); } +// ---------------------------------------------------------------------------- +// CAiTitlePaneRenderer::FocusLostL() +// +// ---------------------------------------------------------------------------- +// void CAiTitlePaneRenderer::FocusLostL() { iStatusPanel.StopTitlePaneScrollingL(); } + +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/src/aitoolbarrenderer.cpp --- a/idlehomescreen/nativeuicontroller/src/aitoolbarrenderer.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/src/aitoolbarrenderer.cpp Wed May 12 13:22:51 2010 +0300 @@ -15,17 +15,8 @@ * */ - -#include "aitoolbarrenderer.h" -#include "aifweventhandler.h" -#include "aicontentobserver.h" -#include "activeidle2domaincrkeys.h" -#include "activeidle2domainpskeys.h" -#include "aiscutplugindomaincrkeys.h" -#include -#include "ainativeuiplugins.h" - -#include +// System includes +#include #include #include #include @@ -33,13 +24,24 @@ #include #include -#include "centralrepository.h" +// User includes +#include +#include +#include "aitoolbarrenderer.h" +#include "aifweventhandler.h" +#include "aicontentobserver.h" +#include "activeidle2domaincrkeys.h" +#include "activeidle2domainpskeys.h" +#include "aiscutplugindomaincrkeys.h" +#include "ainativeuiplugins.h" +#include #include "debug.h" using namespace AiNativeUiController; +// Constants // Action to send to framework _LIT( KOpenAppByIndex, "Shortcut/LaunchByIndex(%d)" ); _LIT( KOpenAppByIndexAlternate, "Shortcut/LaunchByIndexAlternate(%d)"); @@ -52,6 +54,12 @@ const TInt KRadix = 10; +// ======== LOCAL FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// IndexLength() +// +// ---------------------------------------------------------------------------- +// static TInt IndexLength( TInt aIndex ) { TInt length = 0; @@ -71,6 +79,11 @@ return length; } +// ---------------------------------------------------------------------------- +// CreateEventStringL() +// +// ---------------------------------------------------------------------------- +// static HBufC* CreateEventStringL( const TDesC& aFrom, TInt aEventIndex ) { HBufC* buffer = NULL; @@ -87,16 +100,25 @@ return buffer; } -// ========== MEMBER FUNCTIONS ================================================ - -CAiToolbarRenderer::CAiToolbarRenderer( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar ) +// ======== MEMBER FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// CAiToolbarRenderer::CAiToolbarRenderer() +// +// ---------------------------------------------------------------------------- +// +CAiToolbarRenderer::CAiToolbarRenderer( MAiFwEventHandler& aAiFwEventHandler, + CAknToolbar& aToolbar ) : iToolbar( aToolbar ), iAiFwEventHandler( aAiFwEventHandler ) - { // no implementation required } +// ---------------------------------------------------------------------------- +// CAiToolbarRenderer::ConstructL() +// +// ---------------------------------------------------------------------------- +// void CAiToolbarRenderer::ConstructL( ) { iToolbarEnabled = EFalse; @@ -119,24 +141,42 @@ iToolbar.SetToolbarObserver( this ); iToolbar.SetToolbarVisibility( ETrue, EFalse ); } - } -CAiToolbarRenderer* CAiToolbarRenderer::NewLC( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar ) +// ---------------------------------------------------------------------------- +// CAiToolbarRenderer::NewLC() +// +// ---------------------------------------------------------------------------- +// +CAiToolbarRenderer* CAiToolbarRenderer::NewLC( + MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar ) { - CAiToolbarRenderer* self = new (ELeave) CAiToolbarRenderer( aAiFwEventHandler, aToolbar ); + CAiToolbarRenderer* self = + new ( ELeave ) CAiToolbarRenderer( aAiFwEventHandler, aToolbar ); CleanupStack::PushL( self ); - self->ConstructL( ); + self->ConstructL(); return self; } -CAiToolbarRenderer* CAiToolbarRenderer::NewL( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar ) +// ---------------------------------------------------------------------------- +// CAiToolbarRenderer::NewL() +// +// ---------------------------------------------------------------------------- +// +CAiToolbarRenderer* CAiToolbarRenderer::NewL( + MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar ) { - CAiToolbarRenderer* self = CAiToolbarRenderer::NewLC( aAiFwEventHandler, aToolbar ); + CAiToolbarRenderer* self = + CAiToolbarRenderer::NewLC( aAiFwEventHandler, aToolbar ); CleanupStack::Pop(); // self return self; } +// ---------------------------------------------------------------------------- +// CAiToolbarRenderer::~CAiToolbarRenderer() +// +// ---------------------------------------------------------------------------- +// CAiToolbarRenderer::~CAiToolbarRenderer() { // We don't want anymore events from toolbar @@ -144,46 +184,67 @@ iButtons.ResetAndDestroy(); } -void CAiToolbarRenderer::DynInitToolbarL( TInt /*aResourceId*/, CAknToolbar* /*aToolbar*/ ) +// ---------------------------------------------------------------------------- +// CAiToolbarRenderer::DynInitToolbarL() +// +// ---------------------------------------------------------------------------- +// +void CAiToolbarRenderer::DynInitToolbarL( TInt /*aResourceId*/, + CAknToolbar* /*aToolbar*/ ) { // do nothing } +// ---------------------------------------------------------------------------- +// CAiToolbarRenderer::OfferToolbarEventL() +// +// ---------------------------------------------------------------------------- +// void CAiToolbarRenderer::OfferToolbarEventL( TInt aCommand ) { TInt modifiers = iToolbar.EventModifiers(); - if ( aCommand >= 0 && aCommand < iButtons.Count()) { CAiToolbarButton* button = iButtons[aCommand]; + if ( button ) { - HBufC *event = NULL; + if ( modifiers == CAknToolbar::ELongPress ) { - event = CreateEventStringL( KOpenAppByIndexAlternate, button->ShortcutId() ); + event = CreateEventStringL( + KOpenAppByIndexAlternate, button->ShortcutId() ); + CleanupStack::PushL( event ); } else { - event = CreateEventStringL( KOpenAppByIndex, button->ShortcutId() ); + event = CreateEventStringL( + KOpenAppByIndex, button->ShortcutId() ); + CleanupStack::PushL( event ); } + iAiFwEventHandler.HandlePluginEvent( *event ); CleanupStack::PopAndDestroy( event ); } } } -void CAiToolbarRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC16& aText, - TInt aIndex ) +// ---------------------------------------------------------------------------- +// CAiToolbarRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiToolbarRenderer::DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, const TDesC16& aText, TInt aIndex ) { + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + // Only interested on certain publish events - if ( aPlugin.PublisherInfoL()->iUid == KShortcutPluginUid && + if ( info.Uid() == KShortcutPluginUid && aContent == EAiScutContentShortcutToolbarCaption && ( aIndex == EAiScutToolbarFirst || aIndex == EAiScutToolbarSecond || @@ -199,13 +260,18 @@ } } -void CAiToolbarRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC8& aBuf, - TInt aIndex ) +// ---------------------------------------------------------------------------- +// CAiToolbarRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiToolbarRenderer::DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, const TDesC8& aBuf, TInt aIndex ) { + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + // Only interested on certain publish events - if ( aPlugin.PublisherInfoL()->iUid == KShortcutPluginUid && + if ( info.Uid() == KShortcutPluginUid && aContent == EAiScutContentShortcutToolbarIcon && ( aIndex == EAiScutToolbarFirst || aIndex == EAiScutToolbarSecond || @@ -239,6 +305,11 @@ } } +// ---------------------------------------------------------------------------- +// CAiToolbarRenderer::ButtonL() +// +// ---------------------------------------------------------------------------- +// CAiToolbarButton* CAiToolbarRenderer::ButtonL( TInt aShortcutId ) { TInt index = KErrNotFound; @@ -279,12 +350,16 @@ return button; } - +// ---------------------------------------------------------------------------- +// CAiToolbarRenderer::TransactionCommittedL() +// +// ---------------------------------------------------------------------------- +// void CAiToolbarRenderer::TransactionCommittedL() { if ( !iCommitted ) { - for(TInt i = 0; i < iButtons.Count(); i++) + for ( TInt i = 0; i < iButtons.Count(); i++ ) { CAiToolbarButton *button = iButtons[i]; if ( button && button->Icon()) @@ -300,5 +375,4 @@ } } - // End of File. diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/src/appui.cpp --- a/idlehomescreen/nativeuicontroller/src/appui.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/src/appui.cpp Wed May 12 13:22:51 2010 +0300 @@ -16,26 +16,8 @@ */ -#include "appui.h" -#include "ainativeui.hrh" -#include "ainativeuistrings.h" // string literals -#include "ainativeuiview.h" -#include "application.h" -#include "nativeuicontroller.h" -#include "aiuiframeworkobserver.h" -#include "aifweventhandler.h" -#include - -#include "aipropertyextension.h" -#include "aicontentmodel.h" -#include "aiuiidleintegration.h" -#include "activeidle2domaincrkeys.h" -#include "activeidle2domainpskeys.h" -#include "extrstandbycontainerif.h" -#include "debug.h" - +// System includes #include -#include #include #include #include @@ -51,6 +33,27 @@ #include #include +// User includes +#include +#include + +#include "appui.h" +#include "ainativeui.hrh" +#include "ainativeuistrings.h" // string literals +#include "ainativeuiview.h" +#include "application.h" +#include "nativeuicontroller.h" +#include "aifweventhandler.h" +#include + +#include "aicontentmodel.h" +#include "aiuiidleintegration.h" +#include "activeidle2domaincrkeys.h" +#include "activeidle2domainpskeys.h" +#include "extrstandbycontainerif.h" +#include "debug.h" + + namespace { _LIT( KResourceDrive, "Z:" ); @@ -193,21 +196,14 @@ } iFwEventHandler = iUiCtl->FwEventHandler(); - - iUiFwObserver = iUiCtl->UiFrameworkObserver(); - - TAiIdleKeySoundConfig keySoundConfig; - keySoundConfig.iKeySounds = KeySounds(); - keySoundConfig.iContextResId = R_NATIVEUI_DEFAULT_SKEY_LIST; - iIdleIntegration = CAiUiIdleIntegration::NewL - ( *iEikonEnv, keySoundConfig, iFwEventHandler ); - + iUiCtl->SetAppUi( this ); if( iFwEventHandler ) { iFwEventHandler->AppEnvReadyL(); } + TBool isFullScreen = EFalse; //Get pointer to status pane CEikStatusPane* statusPane = static_cast( iEikonEnv->EikAppUi() )->StatusPane(); @@ -270,11 +266,12 @@ CCenRepNotifyHandler::EIntKey, KAiStatusPaneLayout ); iNotifyHandler->StartListeningL(); - - if( iFwEventHandler ) - { - iFwEventHandler->HandleUiReadyEventL(*iUiCtl); - } + + TAiIdleKeySoundConfig keySoundConfig; + keySoundConfig.iKeySounds = KeySounds(); + keySoundConfig.iContextResId = R_NATIVEUI_DEFAULT_SKEY_LIST; + iIdleIntegration = CAiUiIdleIntegration::NewL + ( *iEikonEnv, keySoundConfig, iFwEventHandler ); // Check powerkey availability FeatureManager::InitializeLibL(); @@ -328,11 +325,6 @@ void CAppUi::HandleForegroundEventL(TBool aForeground) { CAknAppUi::HandleForegroundEventL( aForeground ); - - if ( iUiFwObserver ) - { - iUiFwObserver->HandleForegroundEvent( aForeground ); - } } void CAppUi::HandleCommandL(TInt aCommand) @@ -463,11 +455,6 @@ } } - - if ( iUiFwObserver ) - { - iUiFwObserver->HandleResourceChange(aType); - } } void CAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination) @@ -634,6 +621,11 @@ { iStanbyContainerIF->StartL(); } + + if( iFwEventHandler ) + { + iFwEventHandler->HandleUiReadyEventL( *iUiCtl ); + } } void CAppUi::HandleNotifyInt( TUint32 aId, TInt aNewValue ) diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/nativeuicontroller/src/nativeuicontroller.cpp --- a/idlehomescreen/nativeuicontroller/src/nativeuicontroller.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/src/nativeuicontroller.cpp Wed May 12 13:22:51 2010 +0300 @@ -16,31 +16,29 @@ */ // System includes +#include #include -#include #include -#include -#include #include #include -#include #include #include #include #include -#include #include -#include +#include +#include // User includes +#include +#include +#include #include "nativeuicontroller.h" #include "ainativeui.hrh" #include "application.h" #include "appui.h" #include "aiutility.h" #include "aistrparser.h" -#include "aidevicestatuscontentmodel.h" -#include "aipropertyextension.h" #include "aistatuspanel.h" #include "ainativerenderer.h" #include "aititlepanerenderer.h" @@ -48,13 +46,11 @@ #include "aidialogrenderer.h" #include "aisoftkeyrenderer.h" #include "ainotifierrenderer.h" -#include "aitoolbarrenderer.h" #include "ainativeuiplugins.h" #include "activeidle2domaincrkeys.h" #include "aistatuspanetouchui.h" #include "ainativeuistrings.h" // string literals #include "aistrcnv.h" -#include using namespace AiNativeUiController; @@ -75,9 +71,22 @@ IMPLEMENTATION_PROXY_ENTRY(KImplementationUidNativeUiController, CNativeUiController::NewL) }; +// ======== LOCAL FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// IsDeviceStatus() +// +// ---------------------------------------------------------------------------- +// +TBool IsDeviceStatus( const THsPublisherInfo& aInfo ) + { + return ( aInfo.Name() == KDeviceStatusPluginName && + aInfo.Uid() == KDeviceStatusPluginUid ); + } +// ======== MEMBER FUNCTIONS ======== // ---------------------------------------------------------------------------- // CNativeUiController::NewL() +// // ---------------------------------------------------------------------------- // CNativeUiController* CNativeUiController::NewL() @@ -96,6 +105,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::Exit() +// // ---------------------------------------------------------------------------- // void CNativeUiController::Exit() @@ -107,11 +117,11 @@ iExitTimer->Start( 0, KOneSecondInMicroS, TCallBack( ExitTimerCallBack, this ) ); } - } // ---------------------------------------------------------------------------- // CNativeUiController::ExitTimerCallBack() +// // ---------------------------------------------------------------------------- // TInt CNativeUiController::ExitTimerCallBack( TAny *aSelf ) @@ -131,12 +141,13 @@ // ---------------------------------------------------------------------------- // CNativeUiController::~CNativeUiController() +// // ---------------------------------------------------------------------------- // CNativeUiController::~CNativeUiController() { - iPlugins.Close(); - + iPlugins.Reset(); + delete iExitTimer; PrepareToExit(); @@ -147,6 +158,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::PrepareToExit() +// // ---------------------------------------------------------------------------- // void CNativeUiController::PrepareToExit() @@ -175,6 +187,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::CNativeUiController() +// // ---------------------------------------------------------------------------- // CNativeUiController::CNativeUiController() @@ -183,7 +196,18 @@ } // ---------------------------------------------------------------------------- +// CNativeUiController::SetAppUi() +// +// ---------------------------------------------------------------------------- +// +void CNativeUiController::SetAppUi( CAppUi* aAppUi ) + { + iAppUi = aAppUi; + } + +// ---------------------------------------------------------------------------- // CNativeUiController::AddRendererL() +// // ---------------------------------------------------------------------------- // void CNativeUiController::AddRendererL( CAiNativeRenderer* aRenderer ) @@ -193,6 +217,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::RemoveRenderer() +// // ---------------------------------------------------------------------------- // TBool CNativeUiController::RemoveRenderer( CAiNativeRenderer *aRenderer, @@ -216,56 +241,17 @@ } // ---------------------------------------------------------------------------- -// CNativeUiController::ExitTimerCallBack() -// ---------------------------------------------------------------------------- -// -void CNativeUiController::DeleteToolbarRenderer() - { - if ( iToolbarRenderer ) - { - RemoveRenderer( iToolbarRenderer ); - delete iToolbarRenderer; - iToolbarRenderer = NULL; - } - } - -// ---------------------------------------------------------------------------- -// CNativeUiController::RecreateToolbarRendererL() -// ---------------------------------------------------------------------------- +// CNativeUiController::DoPublish() // -TBool CNativeUiController::RecreateToolbarRendererL() - { - TBool created( EFalse ); - // Remove the old renderer... - DeleteToolbarRenderer(); - - CAknToolbar* toolbar( iAvkonAppUi->CurrentFixedToolbar() ); - // ...and create the new if there is an existing toolbar that - // we can use - if ( toolbar ) - { - iToolbarRenderer = CAiToolbarRenderer::NewL( *iFwEventHandler, *toolbar); - AddRendererL( iToolbarRenderer ); - created = ETrue; - } - - return created; - } - - -// ---------------------------------------------------------------------------- -// CNativeUiController::DoPublish() // ---------------------------------------------------------------------------- // template -TInt CNativeUiController::DoPublish( MAiPropertyExtension& aPlugin, +TInt CNativeUiController::DoPublish( CHsContentPublisher& aPlugin, TInt aContent, T& aData, TInt aIndex ) { - const TAiPublisherInfo* info( NULL ); - - TRAP_IGNORE( info = aPlugin.PublisherInfoL() ); - - if ( !info || info->iNamespace != KNativeUiNamespace ) + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + if ( !IsDeviceStatus( info ) && info.Namespace() != KNativeUiNamespace ) { return KErrNotSupported; } @@ -294,6 +280,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::HandleIdleStateEvent() +// // ---------------------------------------------------------------------------- // TInt CNativeUiController::HandleIdleStateEvent( TAny* aPtr ) @@ -329,6 +316,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::HandleKeylockStateEvent() +// // ---------------------------------------------------------------------------- // TInt CNativeUiController::HandleKeylockStateEvent( TAny* aPtr ) @@ -376,6 +364,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::HandlePluginConfChange() +// // ---------------------------------------------------------------------------- // TInt CNativeUiController::HandlePluginConfChange( TAny* aPtr ) @@ -398,6 +387,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::LoadUIDefinitionL() +// // ---------------------------------------------------------------------------- // void CNativeUiController::LoadUIDefinitionL() @@ -412,7 +402,7 @@ } return; } - + if ( !iExitTimer ) { iExitTimer = CPeriodic::NewL( CActive::EPriorityStandard ); @@ -452,10 +442,21 @@ CleanupStack::Pop();//CAiSoftKeyRenderer // Toolbar shown only when we are not the main ui controller - DeleteToolbarRenderer(); - - TRAP_IGNORE( - iAppUi->StartL(); ) + //DeleteToolbarRenderer(); + + THsPublisherInfo deviceStatus( KDeviceStatusPluginUid, + KDeviceStatusPluginName, KNativeUiNamespace ); + + iPlugins.Append( deviceStatus ); + + iFwStateHandler->LoadPlugin( deviceStatus, EAiFwSystemStartup ); + + THsPublisherInfo profile( KProfilePluginUid, + KProfilePluginName, KNativeUiNamespace ); + + iPlugins.Append( profile ); + + iFwStateHandler->LoadPlugin( profile, EAiFwSystemStartup ); } // We need to load the resource file here if we are not main controller. @@ -473,7 +474,7 @@ iResourceOffset = iCoeEnv->AddResourceFileL( resourceFile ); } // Create the toolbar renderer - RecreateToolbarRendererL(); + //RecreateToolbarRendererL(); } // 4) Add an observer that informs us about the focus transition changes @@ -503,59 +504,19 @@ } // ---------------------------------------------------------------------------- -// CNativeUiController::GetPluginsL() +// CNativeUiController::GetSettingsL() +// // ---------------------------------------------------------------------------- // -void CNativeUiController::GetPluginsL( RAiPublisherInfoArray& aPlugins ) - { - iPlugins.Reset(); - - if( iRunningAsMain ) - { - TAiPublisherInfo shortcutPublisherInfo; - shortcutPublisherInfo.iUid = KShortcutPluginUid; - shortcutPublisherInfo.iName.Copy( KShortcutPluginName ); - shortcutPublisherInfo.iNamespace.Copy( KNativeUiNamespace ); - - User::LeaveIfError( iPlugins.Append( shortcutPublisherInfo ) ); - - TAiPublisherInfo deviceStatusPublisherInfo; - deviceStatusPublisherInfo.iUid = KDeviceStatusPluginUid; - deviceStatusPublisherInfo.iName.Copy( KDeviceStatusPluginName ); - deviceStatusPublisherInfo.iNamespace.Copy( KNativeUiNamespace ); - - User::LeaveIfError( iPlugins.Append( deviceStatusPublisherInfo ) ); - - TAiPublisherInfo profilePublisherInfo; - profilePublisherInfo.iUid = KProfilePluginUid; - profilePublisherInfo.iName.Copy( KProfilePluginName ); - profilePublisherInfo.iNamespace.Copy( KNativeUiNamespace ); - - User::LeaveIfError( iPlugins.Append( profilePublisherInfo ) ); - - // Copy iPlugins to aPlugins - aPlugins.ReserveL( aPlugins.Count() + iPlugins.Count() ); - - for( TInt i = 0; i < iPlugins.Count(); ++i ) - { - aPlugins.Append( iPlugins[i] ); - } - } - } - -// ---------------------------------------------------------------------------- -// CNativeUiController::GetSettingsL() -// ---------------------------------------------------------------------------- -// -void CNativeUiController::GetSettingsL( const TAiPublisherInfo& aPubInfo, +void CNativeUiController::GetSettingsL( const THsPublisherInfo& aPublisherInfo, RAiSettingsItemArray& aSettings ) { - if ( aPubInfo.iNamespace != KNativeUiNamespace ) + if ( aPublisherInfo.Namespace() != KNativeUiNamespace ) { return; } - if( iRunningAsMain && aPubInfo.iUid == KShortcutPluginUid ) + if( iRunningAsMain && aPublisherInfo.Uid() == KShortcutPluginUid ) { RProperty::Set( KPSUidAiInformation, KActiveIdleExtHS_PluginConfChange, 0 ); @@ -563,7 +524,7 @@ CleanupDeletePushL( settings ); MAiPluginSettingsItem& item = settings->AiPluginSettingsItem(); - item.SetPublisherId( aPubInfo.iUid ); + item.SetPublisherId( aPublisherInfo.Uid() ); HBufC* appBuf; appBuf = HBufC::NewLC( RProperty::KMaxPropertySize ); @@ -593,7 +554,7 @@ CleanupDeletePushL( settings ); MAiPluginSettingsItem& item2 = settings->AiPluginSettingsItem(); - item2.SetPublisherId( aPubInfo.iUid ); + item2.SetPublisherId( aPublisherInfo.Uid() ); HBufC* app2Buf; app2Buf = HBufC::NewLC( RProperty::KMaxPropertySize ); @@ -619,19 +580,21 @@ // In case there are settings in the cenrep the settings // here are overwritten by them - GetSettingsFromCRL( aPubInfo, aSettings ); + GetSettingsFromCRL( aPublisherInfo, aSettings ); CleanupStack::Pop( settings ); } } // ---------------------------------------------------------------------------- // CNativeUiController::GetSettingsFromCRL() +// // ---------------------------------------------------------------------------- // -void CNativeUiController::GetSettingsFromCRL( const TAiPublisherInfo& aPubInfo, - RAiSettingsItemArray &aPluginSettings ) +void CNativeUiController::GetSettingsFromCRL( + const THsPublisherInfo& aPublisherInfo, + RAiSettingsItemArray &aPluginSettings ) { - if ( aPubInfo.iNamespace != KNativeUiNamespace ) + if ( aPublisherInfo.Namespace() != KNativeUiNamespace ) { return; } @@ -660,13 +623,13 @@ TInt32 settingId = 0; TInt err = KErrNone; - TBool settingFound = EFalse; + //TBool settingFound = EFalse; CRepository *settingsRepository = CRepository::NewLC( TUid::Uid( KCRUidActiveIdleLV ) ); while ( moreSettings ) { - settingFound = EFalse; + //settingFound = EFalse; pluginIdPtr.Zero(); settingValuePtr.Zero(); @@ -684,7 +647,7 @@ } // does the setting belong to this plugin - if ( err == KErrNone && pluginIdPtr == aPubInfo.iName ) + if ( err == KErrNone && pluginIdPtr == aPublisherInfo.Name() ) { // Get the settings id err = settingsRepository->Get(crKey++, settingKeyPtr); @@ -707,28 +670,30 @@ MAiPluginSettingsItem& item = setting->AiPluginSettingsItem(); // Existing setting found => replace it - if ( item.Key() == settingId && item.PublisherId() == aPubInfo.iUid ) + if ( item.Key() == settingId && item.PublisherId() == aPublisherInfo.Uid() ) { item.SetValueL( settingValuePtr, EFalse ); - settingFound = ETrue; + //settingFound = ETrue; break; } } // Existing setting not found => append new one ONLY if we // are dealing with the icon overrides + /* NOTE ai_shortcut_command_api has been removed! if ( !settingFound && ( settingId & KScutFlagBitIconOverride ) ) { MAiPluginSettings* settings = AiUtility::CreatePluginSettingsL(); CleanupDeletePushL( settings ); MAiPluginSettingsItem& item = settings->AiPluginSettingsItem(); - item.SetPublisherId( aPubInfo.iUid ); + item.SetPublisherId( aPublisherInfo.Uid() ); item.SetKey( settingId ); item.SetValueL( settingValuePtr, EFalse ); aPluginSettings.Append( settings ); CleanupStack::Pop( settings ); } + */ } } } @@ -753,18 +718,29 @@ // ---------------------------------------------------------------------------- // CNativeUiController::ActivateUI() +// // ---------------------------------------------------------------------------- // void CNativeUiController::ActivateUI() { - if( iAppUi ) + if( iAppUi && iRunningAsMain ) { - TRAP_IGNORE( iAppUi->StartL() ); + TRAP_IGNORE( iAppUi->StartL() ); + + TInt value( EIdlePhase1Ok ); + + RProperty::Get( KPSUidStartup, KPSIdlePhase1Ok, value ); + + if ( value == EIdlePhase1NOK ) + { + RProperty::Set( KPSUidStartup, KPSIdlePhase1Ok, EIdlePhase1Ok ); + } } } // ---------------------------------------------------------------------------- // CNativeUiController::GetContentObserver() +// // ---------------------------------------------------------------------------- // MAiContentObserver& CNativeUiController::GetContentObserver() @@ -774,6 +750,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::SetEventHandler() +// // ---------------------------------------------------------------------------- // void CNativeUiController::SetEventHandler( MAiFwEventHandler& aEventHandler ) @@ -782,7 +759,18 @@ } // ---------------------------------------------------------------------------- +// CNativeUiController::SetStateHandler() +// +// ---------------------------------------------------------------------------- +// +void CNativeUiController::SetStateHandler( MAiFwStateHandler& aStateHandler ) + { + iFwStateHandler = &aStateHandler; + } + +// ---------------------------------------------------------------------------- // CNativeUiController::FwEventHandler() +// // ---------------------------------------------------------------------------- // MAiFwEventHandler* CNativeUiController::FwEventHandler() @@ -791,16 +779,8 @@ } // ---------------------------------------------------------------------------- -// CNativeUiController::RemovePluginFromUI() -// ---------------------------------------------------------------------------- +// CNativeUiController::MainInterface() // -void CNativeUiController::RemovePluginFromUI( - MAiPropertyExtension& /*aPlugin*/ ) - { - } - -// ---------------------------------------------------------------------------- -// CNativeUiController::MainInterface() // ---------------------------------------------------------------------------- // MAiMainUiController* CNativeUiController::MainInterface() @@ -810,6 +790,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::SecondaryInterface() +// // ---------------------------------------------------------------------------- // MAiSecondaryUiController* CNativeUiController::SecondaryInterface() @@ -819,6 +800,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::RunApplicationL() +// // ---------------------------------------------------------------------------- // void CNativeUiController::RunApplicationL() @@ -831,6 +813,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::CoeEnv() +// // ---------------------------------------------------------------------------- // CCoeEnv& CNativeUiController::CoeEnv() @@ -839,26 +822,18 @@ } // ---------------------------------------------------------------------------- -// CNativeUiController::SetUiFrameworkObserver() -// ---------------------------------------------------------------------------- +// CNativeUiController::IsMenuOpen() // -void CNativeUiController::SetUiFrameworkObserver( - MAiUiFrameworkObserver& aObserver ) - { - iUiFrameworkObserver = &aObserver; - } - -// ---------------------------------------------------------------------------- -// CNativeUiController::IsMenuOpen() // ---------------------------------------------------------------------------- // TBool CNativeUiController::IsMenuOpen() { - return CoeEnv().AppUi()->IsDisplayingMenuOrDialog(); + return iAppUi->IsDisplayingMenuOrDialog(); } // ---------------------------------------------------------------------------- // CNativeUiController::SetCoeEnv() +// // ---------------------------------------------------------------------------- // void CNativeUiController::SetCoeEnv( CCoeEnv& aCoeEnv ) @@ -867,32 +842,8 @@ } // ---------------------------------------------------------------------------- -// CNativeUiController::UiFrameworkObserver() -// ---------------------------------------------------------------------------- -// -MAiUiFrameworkObserver* CNativeUiController::UiFrameworkObserver() - { - return iUiFrameworkObserver; - } - -// ---------------------------------------------------------------------------- -// CNativeUiController::HandleResourceChange() -// ---------------------------------------------------------------------------- +// CNativeUiController::StartTransaction() // -void CNativeUiController::HandleResourceChange( TInt /*aType*/ ) - { - } - -// ---------------------------------------------------------------------------- -// CNativeUiController::HandleForegroundEvent() -// ---------------------------------------------------------------------------- -// -void CNativeUiController::HandleForegroundEvent( TBool /*aForeground*/ ) - { - } - -// ---------------------------------------------------------------------------- -// CNativeUiController::StartTransaction() // ---------------------------------------------------------------------------- // TInt CNativeUiController::StartTransaction( TInt /*aTxId*/ ) @@ -902,6 +853,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::Commit() +// // ---------------------------------------------------------------------------- // TInt CNativeUiController::Commit( TInt /*aTxId*/ ) @@ -919,6 +871,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::CancelTransaction() +// // ---------------------------------------------------------------------------- // TInt CNativeUiController::CancelTransaction( TInt /*aTxId*/ ) @@ -928,23 +881,27 @@ // ---------------------------------------------------------------------------- // CNativeUiController::CanPublish() +// // ---------------------------------------------------------------------------- // -TBool CNativeUiController::CanPublish( MAiPropertyExtension& aPlugin, +TBool CNativeUiController::CanPublish( CHsContentPublisher& aPlugin, TInt /*aContent*/, TInt /*aIndex*/ ) { - const TAiPublisherInfo* info( NULL ); + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + if ( IsDeviceStatus( info ) ) + { + return ETrue; + } - TRAP_IGNORE( info = aPlugin.PublisherInfoL() ); - - if ( !info || info->iNamespace != KNativeUiNamespace ) + if ( info.Namespace() != KNativeUiNamespace ) { return EFalse; } for( TInt i = 0; i < iPlugins.Count(); i++ ) { - if ( iPlugins[i] == *info ) + if ( iPlugins[i] == info ) { return ETrue; } @@ -955,9 +912,10 @@ // ---------------------------------------------------------------------------- // CNativeUiController::Publish() +// // ---------------------------------------------------------------------------- // -TInt CNativeUiController::Publish( MAiPropertyExtension& aPlugin, +TInt CNativeUiController::Publish( CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ) { TInt err = DoPublish( aPlugin, aContent, aResource, aIndex ); @@ -966,9 +924,10 @@ // ---------------------------------------------------------------------------- // CNativeUiController::Publish() +// // ---------------------------------------------------------------------------- // -TInt CNativeUiController::Publish( MAiPropertyExtension& aPlugin, +TInt CNativeUiController::Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ) { TInt err = DoPublish( aPlugin, aContent, aText, aIndex ); @@ -977,9 +936,10 @@ // ---------------------------------------------------------------------------- // CNativeUiController::Publish() +// // ---------------------------------------------------------------------------- // -TInt CNativeUiController::Publish( MAiPropertyExtension& aPlugin, +TInt CNativeUiController::Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ) { TInt err = DoPublish( aPlugin, aContent, aBuf, aIndex ); @@ -988,9 +948,10 @@ // ---------------------------------------------------------------------------- // CNativeUiController::Publish() +// // ---------------------------------------------------------------------------- // -TInt CNativeUiController::Publish( MAiPropertyExtension& aPlugin, +TInt CNativeUiController::Publish( CHsContentPublisher& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ) { TInt err = DoPublish( aPlugin, aContent, aFile, aIndex ); @@ -999,9 +960,10 @@ // ---------------------------------------------------------------------------- // CNativeUiController::Clean() +// // ---------------------------------------------------------------------------- // -TInt CNativeUiController::Clean( MAiPropertyExtension& aPlugin, +TInt CNativeUiController::Clean( CHsContentPublisher& aPlugin, TInt aContent, TInt /*aIndex*/ ) { const TInt count( iRenderers.Count() ); @@ -1016,6 +978,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::Extension() +// // ---------------------------------------------------------------------------- // TAny* CNativeUiController::Extension( TUid /*aUid*/ ) @@ -1025,12 +988,14 @@ // ---------------------------------------------------------------------------- // CNativeUiController::RequiresSubscription() +// // ---------------------------------------------------------------------------- // TBool CNativeUiController::RequiresSubscription( - const TAiPublisherInfo& aPublisherInfo ) const + const THsPublisherInfo& aPublisherInfo ) const { - if ( aPublisherInfo.iNamespace == KNativeUiNamespace ) + if ( IsDeviceStatus( aPublisherInfo ) || + aPublisherInfo.Namespace() == KNativeUiNamespace ) { // Targeted to this content renderer return ETrue; @@ -1043,12 +1008,11 @@ // CNativeUiController::SetProperty() // ---------------------------------------------------------------------------- // -TInt CNativeUiController::SetProperty( MAiPropertyExtension& /*aPlugin*/, +TInt CNativeUiController::SetProperty( CHsContentPublisher& /*aPlugin*/, const TDesC8& /*aElementId*/, const TDesC8& /*aPropertyName*/, const TDesC8& /*aPropertyValue*/ ) - { - + { return KErrNotSupported; } @@ -1056,7 +1020,7 @@ // CNativeUiController::SetProperty() // ---------------------------------------------------------------------------- // -TInt CNativeUiController::SetProperty(MAiPropertyExtension& /*aPlugin*/, +TInt CNativeUiController::SetProperty(CHsContentPublisher& /*aPlugin*/, const TDesC8& /*aElementId*/, const TDesC8& /*aPropertyName*/, const TDesC8& /*aPropertyValue*/, @@ -1067,6 +1031,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::NewApplication() +// // ---------------------------------------------------------------------------- // CApaApplication* CNativeUiController::NewApplication() @@ -1079,6 +1044,7 @@ // ---------------------------------------------------------------------------- // CNativeUiController::VariateToMainUiController() +// // ---------------------------------------------------------------------------- // void CNativeUiController::VariateToMainUiController() diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/sapiwrapper/hspswrapper/bwins/hspswrapper.def --- a/idlehomescreen/sapiwrapper/hspswrapper/bwins/hspswrapper.def Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/sapiwrapper/hspswrapper/bwins/hspswrapper.def Wed May 12 13:22:51 2010 +0300 @@ -44,57 +44,59 @@ ?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) + ?RestoreDefaultConfL@CHspsWrapper@hspswrapper@@QAEHXZ @ 46 NONAME ; int hspswrapper::CHspsWrapper::RestoreDefaultConfL(void) + ?MediaType@CObjectMap@hspswrapper@@QBEABVTDesC8@@XZ @ 47 NONAME ; class TDesC8 const & hspswrapper::CObjectMap::MediaType(void) const + ?SetTypeL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 48 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetTypeL(class TDesC8 const &) + ?AddPropertyMapL@CItemMap@hspswrapper@@QAEAAV12@PAVCPropertyMap@2@@Z @ 49 NONAME ; class hspswrapper::CItemMap & hspswrapper::CItemMap::AddPropertyMapL(class hspswrapper::CPropertyMap *) + ?NewLC@CObjectMap@hspswrapper@@SAPAV12@XZ @ 50 NONAME ; class hspswrapper::CObjectMap * hspswrapper::CObjectMap::NewLC(void) + ?GetAppConfigurationsL@CHspsWrapper@hspswrapper@@QAEXAAV?$RPointerArray@VCPluginInfo@hspswrapper@@@@@Z @ 51 NONAME ; void hspswrapper::CHspsWrapper::GetAppConfigurationsL(class RPointerArray &) + ?NewL@CPluginInfo@hspswrapper@@SAPAV12@XZ @ 52 NONAME ; class hspswrapper::CPluginInfo * hspswrapper::CPluginInfo::NewL(void) + ?SetItemNameL@CItemMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 53 NONAME ; class hspswrapper::CItemMap & hspswrapper::CItemMap::SetItemNameL(class TDesC8 const &) + ?AddPluginL@CHspsWrapper@hspswrapper@@QAEPAVCAddPluginResult@2@ABVTDesC8@@0@Z @ 54 NONAME ; class hspswrapper::CAddPluginResult * hspswrapper::CHspsWrapper::AddPluginL(class TDesC8 const &, class TDesC8 const &) + ?NewL@CHspsConfiguration@hspswrapper@@SAPAV12@XZ @ 55 NONAME ; class hspswrapper::CHspsConfiguration * hspswrapper::CHspsConfiguration::NewL(void) + ?SetLogoIconL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 56 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetLogoIconL(class TDesC8 const &) + ?SetPluginUidL@CPluginMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 57 NONAME ; class hspswrapper::CPluginMap & hspswrapper::CPluginMap::SetPluginUidL(class TDesC8 const &) + ?SetValueL@CPropertyMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 58 NONAME ; class hspswrapper::CPropertyMap & hspswrapper::CPropertyMap::SetValueL(class TDesC8 const &) + ??1CObjectMap@hspswrapper@@UAE@XZ @ 59 NONAME ; hspswrapper::CObjectMap::~CObjectMap(void) + ??1CItemMap@hspswrapper@@UAE@XZ @ 60 NONAME ; hspswrapper::CItemMap::~CItemMap(void) + ?Name@CPropertyMap@hspswrapper@@QBEABVTDesC8@@XZ @ 61 NONAME ; class TDesC8 const & hspswrapper::CPropertyMap::Name(void) const + ?SetPluginSettingsL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@ABV?$RPointerArray@VCItemMap@hspswrapper@@@@@Z @ 62 NONAME ; int hspswrapper::CHspsWrapper::SetPluginSettingsL(class TDesC8 const &, class RPointerArray const &) + ?ConfId@CHspsConfiguration@hspswrapper@@QBEABVTDesC8@@XZ @ 63 NONAME ; class TDesC8 const & hspswrapper::CHspsConfiguration::ConfId(void) const + ?GetPluginsL@CHspsWrapper@hspswrapper@@QAEXAAV?$RPointerArray@VCPluginInfo@hspswrapper@@@@ABVTDesC8@@1@Z @ 64 NONAME ; void hspswrapper::CHspsWrapper::GetPluginsL(class RPointerArray &, class TDesC8 const &, class TDesC8 const &) + ?ItemId@CItemMap@hspswrapper@@QBEABVTDesC8@@XZ @ 65 NONAME ; class TDesC8 const & hspswrapper::CItemMap::ItemId(void) const + ?GetAppConfigurationL@CHspsWrapper@hspswrapper@@QAEPAVCHspsConfiguration@2@XZ @ 66 NONAME ; class hspswrapper::CHspsConfiguration * hspswrapper::CHspsWrapper::GetAppConfigurationL(void) + ?NewL@CItemMap@hspswrapper@@SAPAV12@XZ @ 67 NONAME ; class hspswrapper::CItemMap * hspswrapper::CItemMap::NewL(void) + ?SetPathL@CObjectMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 68 NONAME ; class hspswrapper::CObjectMap & hspswrapper::CObjectMap::SetPathL(class TDesC8 const &) + ?PluginId@CAddPluginResult@hspswrapper@@QBEABVTDesC8@@XZ @ 69 NONAME ; class TDesC8 const & hspswrapper::CAddPluginResult::PluginId(void) const + ?RestoreRootL@CHspsWrapper@hspswrapper@@QAEHXZ @ 70 NONAME ; int hspswrapper::CHspsWrapper::RestoreRootL(void) + ??1CAddPluginResult@hspswrapper@@UAE@XZ @ 71 NONAME ; hspswrapper::CAddPluginResult::~CAddPluginResult(void) + ?NewLC@CPluginMap@hspswrapper@@SAPAV12@XZ @ 72 NONAME ; class hspswrapper::CPluginMap * hspswrapper::CPluginMap::NewLC(void) + ?ReplacePluginL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@0@Z @ 73 NONAME ; int hspswrapper::CHspsWrapper::ReplacePluginL(class TDesC8 const &, class TDesC8 const &) + ?Resources@CHspsConfiguration@hspswrapper@@QAEAAV?$RPointerArray@VCObjectMap@hspswrapper@@@@XZ @ 74 NONAME ; class RPointerArray & hspswrapper::CHspsConfiguration::Resources(void) + ?MaxChild@CPluginInfo@hspswrapper@@QBEABJXZ @ 75 NONAME ; long const & hspswrapper::CPluginInfo::MaxChild(void) const + ?SetLockingStatusL@CPluginMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 76 NONAME ; class hspswrapper::CPluginMap & hspswrapper::CPluginMap::SetLockingStatusL(class TDesC8 const &) + ?ServiceHandler@CHspsWrapper@hspswrapper@@QBEPAVCLiwServiceHandler@@XZ @ 77 NONAME ; class CLiwServiceHandler * hspswrapper::CHspsWrapper::ServiceHandler(void) const + ?Interface@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 78 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::Interface(void) const + ?SetActivePluginL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@@Z @ 79 NONAME ; int hspswrapper::CHspsWrapper::SetActivePluginL(class TDesC8 const &) + ?SetDescriptionL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 80 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetDescriptionL(class TDesC8 const &) + ?AddPluginL@CHspsWrapper@hspswrapper@@QAEPAVCAddPluginResult@2@ABVTDesC8@@0H@Z @ 81 NONAME ; class hspswrapper::CAddPluginResult * hspswrapper::CHspsWrapper::AddPluginL(class TDesC8 const &, class TDesC8 const &, int) + ?SetPluginIdL@CAddPluginResult@hspswrapper@@QAEXABVTDesC8@@@Z @ 82 NONAME ; void hspswrapper::CAddPluginResult::SetPluginIdL(class TDesC8 const &) + ?SetUidL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 83 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetUidL(class TDesC8 const &) + ?SetTagL@CObjectMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 84 NONAME ; class hspswrapper::CObjectMap & hspswrapper::CObjectMap::SetTagL(class TDesC8 const &) + ?NewLC@CPluginInfo@hspswrapper@@SAPAV12@XZ @ 85 NONAME ; class hspswrapper::CPluginInfo * hspswrapper::CPluginInfo::NewLC(void) + ?SetNameL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 86 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetNameL(class TDesC8 const &) + ?SetMediaTypeL@CObjectMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 87 NONAME ; class hspswrapper::CObjectMap & hspswrapper::CObjectMap::SetMediaTypeL(class TDesC8 const &) + ?Tag@CObjectMap@hspswrapper@@QBEABVTDesC8@@XZ @ 88 NONAME ; class TDesC8 const & hspswrapper::CObjectMap::Tag(void) const + ?SetItemIdL@CItemMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 89 NONAME ; class hspswrapper::CItemMap & hspswrapper::CItemMap::SetItemIdL(class TDesC8 const &) + ?NewLC@CItemMap@hspswrapper@@SAPAV12@XZ @ 90 NONAME ; class hspswrapper::CItemMap * hspswrapper::CItemMap::NewLC(void) + ?SetLogoIconL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC16@@@Z @ 91 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetLogoIconL(class TDesC16 const &) + ?SetInterfaceL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 92 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetInterfaceL(class TDesC8 const &) + ?AddPluginMapL@CHspsConfiguration@hspswrapper@@QAEAAV12@PAVCPluginMap@2@@Z @ 93 NONAME ; class hspswrapper::CHspsConfiguration & hspswrapper::CHspsConfiguration::AddPluginMapL(class hspswrapper::CPluginMap *) + ?RemovePluginL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@@Z @ 94 NONAME ; int hspswrapper::CHspsWrapper::RemovePluginL(class TDesC8 const &) + ?LockingStatus@CPluginMap@hspswrapper@@QBEABVTDesC8@@XZ @ 95 NONAME ; class TDesC8 const & hspswrapper::CPluginMap::LockingStatus(void) const + ?SetActivationStateL@CPluginMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 96 NONAME ; class hspswrapper::CPluginMap & hspswrapper::CPluginMap::SetActivationStateL(class TDesC8 const &) + ?Type@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 97 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::Type(void) const + ?SetConfIdL@CHspsConfiguration@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 98 NONAME ; class hspswrapper::CHspsConfiguration & hspswrapper::CHspsConfiguration::SetConfIdL(class TDesC8 const &) + ?NewLC@CPropertyMap@hspswrapper@@SAPAV12@XZ @ 99 NONAME ; class hspswrapper::CPropertyMap * hspswrapper::CPropertyMap::NewLC(void) + ??0CAddPluginResult@hspswrapper@@AAE@XZ @ 100 NONAME ; hspswrapper::CAddPluginResult::CAddPluginResult(void) diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/sapiwrapper/hspswrapper/eabi/hspswrapper.def --- a/idlehomescreen/sapiwrapper/hspswrapper/eabi/hspswrapper.def Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/sapiwrapper/hspswrapper/eabi/hspswrapper.def Wed May 12 13:22:51 2010 +0300 @@ -36,98 +36,100 @@ _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 + _ZN11hspswrapper12CHspsWrapper12RestoreRootLEv @ 38 NONAME + _ZN11hspswrapper12CHspsWrapper13RemovePluginLERK6TDesC8 @ 39 NONAME + _ZN11hspswrapper12CHspsWrapper13SetConfStateLERK6TDesC8S3_i @ 40 NONAME + _ZN11hspswrapper12CHspsWrapper14ReplacePluginLERK6TDesC8S3_ @ 41 NONAME + _ZN11hspswrapper12CHspsWrapper16SetActivePluginLERK6TDesC8 @ 42 NONAME + _ZN11hspswrapper12CHspsWrapper18SetPluginSettingsLERK6TDesC8RK13RPointerArrayINS_8CItemMapEE @ 43 NONAME + _ZN11hspswrapper12CHspsWrapper19RestoreDefaultConfLEv @ 44 NONAME + _ZN11hspswrapper12CHspsWrapper20GetAppConfigurationLEv @ 45 NONAME + _ZN11hspswrapper12CHspsWrapper20SetAppConfigurationLERK6TDesC8 @ 46 NONAME + _ZN11hspswrapper12CHspsWrapper21GetAppConfigurationsLER13RPointerArrayINS_11CPluginInfoEE @ 47 NONAME + _ZN11hspswrapper12CHspsWrapper23GetPluginConfigurationLERK6TDesC8 @ 48 NONAME + _ZN11hspswrapper12CHspsWrapper4NewLERK6TDesC8PNS_20MHspsWrapperObserverE @ 49 NONAME + _ZN11hspswrapper12CHspsWrapper5NewLCERK6TDesC8PNS_20MHspsWrapperObserverE @ 50 NONAME + _ZN11hspswrapper12CHspsWrapperD0Ev @ 51 NONAME + _ZN11hspswrapper12CHspsWrapperD1Ev @ 52 NONAME + _ZN11hspswrapper12CHspsWrapperD2Ev @ 53 NONAME + _ZN11hspswrapper12CPropertyMap4NewLEv @ 54 NONAME + _ZN11hspswrapper12CPropertyMap5NewLCEv @ 55 NONAME + _ZN11hspswrapper12CPropertyMap8SetNameLERK6TDesC8 @ 56 NONAME + _ZN11hspswrapper12CPropertyMap9SetValueLERK6TDesC8 @ 57 NONAME + _ZN11hspswrapper12CPropertyMapD0Ev @ 58 NONAME + _ZN11hspswrapper12CPropertyMapD1Ev @ 59 NONAME + _ZN11hspswrapper12CPropertyMapD2Ev @ 60 NONAME + _ZN11hspswrapper16CAddPluginResult12SetPluginIdLERK6TDesC8 @ 61 NONAME + _ZN11hspswrapper16CAddPluginResult4NewLEv @ 62 NONAME + _ZN11hspswrapper16CAddPluginResult9SetStatusEi @ 63 NONAME + _ZN11hspswrapper16CAddPluginResultC1Ev @ 64 NONAME + _ZN11hspswrapper16CAddPluginResultC2Ev @ 65 NONAME + _ZN11hspswrapper16CAddPluginResultD0Ev @ 66 NONAME + _ZN11hspswrapper16CAddPluginResultD1Ev @ 67 NONAME + _ZN11hspswrapper16CAddPluginResultD2Ev @ 68 NONAME + _ZN11hspswrapper18CHspsConfiguration10PluginInfoEv @ 69 NONAME + _ZN11hspswrapper18CHspsConfiguration10PluginMapsEv @ 70 NONAME + _ZN11hspswrapper18CHspsConfiguration10SetConfIdLERK6TDesC8 @ 71 NONAME + _ZN11hspswrapper18CHspsConfiguration11AddItemMapLEPNS_8CItemMapE @ 72 NONAME + _ZN11hspswrapper18CHspsConfiguration13AddObjectMapLEPNS_10CObjectMapE @ 73 NONAME + _ZN11hspswrapper18CHspsConfiguration13AddPluginMapLEPNS_10CPluginMapE @ 74 NONAME + _ZN11hspswrapper18CHspsConfiguration4NewLEv @ 75 NONAME + _ZN11hspswrapper18CHspsConfiguration5NewLCEv @ 76 NONAME + _ZN11hspswrapper18CHspsConfiguration8SettingsEv @ 77 NONAME + _ZN11hspswrapper18CHspsConfiguration9ResourcesEv @ 78 NONAME + _ZN11hspswrapper18CHspsConfigurationD0Ev @ 79 NONAME + _ZN11hspswrapper18CHspsConfigurationD1Ev @ 80 NONAME + _ZN11hspswrapper18CHspsConfigurationD2Ev @ 81 NONAME + _ZN11hspswrapper8CItemMap10SetItemIdLERK6TDesC8 @ 82 NONAME + _ZN11hspswrapper8CItemMap12SetItemNameLERK6TDesC8 @ 83 NONAME + _ZN11hspswrapper8CItemMap15AddPropertyMapLEPNS_12CPropertyMapE @ 84 NONAME + _ZN11hspswrapper8CItemMap4NewLEv @ 85 NONAME + _ZN11hspswrapper8CItemMap5NewLCEv @ 86 NONAME + _ZN11hspswrapper8CItemMapD0Ev @ 87 NONAME + _ZN11hspswrapper8CItemMapD1Ev @ 88 NONAME + _ZN11hspswrapper8CItemMapD2Ev @ 89 NONAME + _ZNK11hspswrapper10CObjectMap3TagEv @ 90 NONAME + _ZNK11hspswrapper10CObjectMap4PathEv @ 91 NONAME + _ZNK11hspswrapper10CObjectMap5NameLEv @ 92 NONAME + _ZNK11hspswrapper10CObjectMap9MediaTypeEv @ 93 NONAME + _ZNK11hspswrapper10CPluginMap13LockingStatusEv @ 94 NONAME + _ZNK11hspswrapper10CPluginMap15ActivationStateEv @ 95 NONAME + _ZNK11hspswrapper10CPluginMap8PluginIdEv @ 96 NONAME + _ZNK11hspswrapper10CPluginMap9PluginUidEv @ 97 NONAME + _ZNK11hspswrapper11CPluginInfo11DescriptionEv @ 98 NONAME + _ZNK11hspswrapper11CPluginInfo13MultiInstanceEv @ 99 NONAME + _ZNK11hspswrapper11CPluginInfo18ConfigurationStateEv @ 100 NONAME + _ZNK11hspswrapper11CPluginInfo3UidEv @ 101 NONAME + _ZNK11hspswrapper11CPluginInfo4NameEv @ 102 NONAME + _ZNK11hspswrapper11CPluginInfo4TypeEv @ 103 NONAME + _ZNK11hspswrapper11CPluginInfo8LogoIconEv @ 104 NONAME + _ZNK11hspswrapper11CPluginInfo8MaxChildEv @ 105 NONAME + _ZNK11hspswrapper11CPluginInfo9InterfaceEv @ 106 NONAME + _ZNK11hspswrapper12CHspsWrapper11HspsServiceEv @ 107 NONAME + _ZNK11hspswrapper12CHspsWrapper13HspsInterfaceEv @ 108 NONAME + _ZNK11hspswrapper12CHspsWrapper14ServiceHandlerEv @ 109 NONAME + _ZNK11hspswrapper12CPropertyMap4NameEv @ 110 NONAME + _ZNK11hspswrapper12CPropertyMap5ValueEv @ 111 NONAME + _ZNK11hspswrapper16CAddPluginResult6StatusEv @ 112 NONAME + _ZNK11hspswrapper16CAddPluginResult8PluginIdEv @ 113 NONAME + _ZNK11hspswrapper18CHspsConfiguration6ConfIdEv @ 114 NONAME + _ZNK11hspswrapper8CItemMap10PropertiesEv @ 115 NONAME + _ZNK11hspswrapper8CItemMap6ItemIdEv @ 116 NONAME + _ZNK11hspswrapper8CItemMap8ItemNameEv @ 117 NONAME + _ZTIN11hspswrapper10CObjectMapE @ 118 NONAME + _ZTIN11hspswrapper10CPluginMapE @ 119 NONAME + _ZTIN11hspswrapper11CPluginInfoE @ 120 NONAME + _ZTIN11hspswrapper12CHspsWrapperE @ 121 NONAME + _ZTIN11hspswrapper12CPropertyMapE @ 122 NONAME + _ZTIN11hspswrapper16CAddPluginResultE @ 123 NONAME + _ZTIN11hspswrapper18CHspsConfigurationE @ 124 NONAME + _ZTIN11hspswrapper8CItemMapE @ 125 NONAME + _ZTVN11hspswrapper10CObjectMapE @ 126 NONAME + _ZTVN11hspswrapper10CPluginMapE @ 127 NONAME + _ZTVN11hspswrapper11CPluginInfoE @ 128 NONAME + _ZTVN11hspswrapper12CHspsWrapperE @ 129 NONAME + _ZTVN11hspswrapper12CPropertyMapE @ 130 NONAME + _ZTVN11hspswrapper16CAddPluginResultE @ 131 NONAME + _ZTVN11hspswrapper18CHspsConfigurationE @ 132 NONAME + _ZTVN11hspswrapper8CItemMapE @ 133 NONAME diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/sapiwrapper/hspswrapper/group/hspswrapper.mmp --- a/idlehomescreen/sapiwrapper/hspswrapper/group/hspswrapper.mmp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/sapiwrapper/hspswrapper/group/hspswrapper.mmp Wed May 12 13:22:51 2010 +0300 @@ -62,6 +62,8 @@ LIBRARY euser.lib LIBRARY liwServiceHandler.lib +LIBRARY centralrepository.lib + #ifdef ENABLE_ABIV2_MODE DEBUGGABLE #endif diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/sapiwrapper/hspswrapper/inc/hspswrapper.h --- a/idlehomescreen/sapiwrapper/hspswrapper/inc/hspswrapper.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/sapiwrapper/hspswrapper/inc/hspswrapper.h Wed May 12 13:22:51 2010 +0300 @@ -33,10 +33,10 @@ class CLiwDefaultList; class MLiwNotifyCallback; class CLiwGenericParamList; +class CRepository; namespace hspswrapper{ - class CHspsConfiguration; class CItemMap; class CPluginInfo; @@ -228,14 +228,28 @@ */ IMPORT_C TInt RemovePluginL(const TDesC8& aPluginId); - /** - * Sets plugin active into active configuration. + /** + * Sets plugin active. * * @param aPluginId Plugin id to be activated * @return Operation status. KErrNone (success), KErrNotFound */ - IMPORT_C TInt SetActivePluginL(const TDesC8& aPluginId); - + IMPORT_C TInt SetActivePluginL(const TDesC8& aPluginId); + + /** + * Removes all but one view and removes all plugins from it. + * + * @return Operation status. KErrNone (success), KErrNotFound + */ + IMPORT_C TInt RestoreRootL(); + + /** + * Restore (re-install) default configuration from ROM. + * + * @return Operation status. KErrNone (success), KErrNotFound + */ + IMPORT_C TInt RestoreDefaultConfL(); + /** * Replace plugin in the active configuration. * @@ -299,19 +313,24 @@ * Returns HSPS services interface */ IMPORT_C MLiwInterface* HspsInterface() const; - + protected: CHspsWrapper(MHspsWrapperObserver* aObserver); - void ConstructL(const TDesC8& aAppUid); - - void ProcessConfigurationMapL(const CLiwMap& aSource, CHspsConfiguration& aTarget); - void ProcessConfigurationPluginsL(const CLiwList& aPluginsList, CHspsConfiguration& aTarget); + void ConstructL(const TDesC8& aAppUid); + void ProcessConfigurationMapL( const CLiwMap& aSource, + CHspsConfiguration& aTarget, + const TBool aAppConf ); + void ProcessConfigurationPluginsL( const CLiwList& aPluginsList, + CHspsConfiguration& aTarget, + const TBool aAppConf ); void ProcessConfigurationSettingsL(const CLiwList& aItemList, CHspsConfiguration& aTarget); void ProcessConfigurationResourcesL(const CLiwList& aObjectList, CHspsConfiguration& aTarget); void ProcessConfItemPropertiesL(const CLiwList& aPropertyMapList,CItemMap& aItemMap); void ProcessPluginsL(const CLiwList& aPluginInfoMapList, RPointerArray& aPlugins); void FillMapFromItemL( CLiwDefaultMap& aMap, const CItemMap& aItemMap ); void FillMapFromPropertiesL( CLiwDefaultList& aInPropertyMapList, const RPointerArray& aProperties ); + TInt LoadActivePluginIdL(); + const TDesC8& ActivePluginId() const; protected: // from MLiwNotifyCallback @@ -349,6 +368,16 @@ * Asynchronous service request tarnsaction id */ TInt iTransactionId; + + /* + * Central repository session. Owned; + */ + CRepository* iRepository; + + /* + * Active plugin id. Owned. + */ + HBufC8* iActivePluginId; }; } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/sapiwrapper/hspswrapper/src/hspswrapper.cpp --- a/idlehomescreen/sapiwrapper/hspswrapper/src/hspswrapper.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/sapiwrapper/hspswrapper/src/hspswrapper.cpp Wed May 12 13:22:51 2010 +0300 @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include "hspswrapper.h" #include "hspsconfiguration.h" @@ -28,7 +30,6 @@ #include "objectmap.h" #include "plugininfo.h" - _LIT8( KHSPS, "Service.HSPS" ); _LIT8( KHSPSConfigurationIf, "IConfiguration" ); @@ -38,7 +39,6 @@ _LIT8( KHSPSCommandAddPlugin, "AddPlugin" ); _LIT8( KHSPSCommandRemovePlugin, "RemovePlugin" ); _LIT8( KHSPSCommandReplacePlugin, "ReplacePlugin" ); -_LIT8( KHSPSCommandSetActivePlugin, "SetActivePlugin" ); _LIT8( KHSPSCommandSetConfState, "SetConfState" ); _LIT8( KHSPSCommandGetAppConfs, "GetAppConfs" ); _LIT8( KHSPSCommandSetAppConf, "SetActiveAppConf" ); @@ -56,6 +56,7 @@ _LIT8( KKeyConfUid, "confUid" ); _LIT8( KInterface, "interface" ); _LIT8( KType, "type" ); +_LIT8( KCopyLogos, "copylogos" ); _LIT8( KKeyPlugins, "plugins" ); _LIT8( KKeyItemId, "itemId" ); _LIT8( KKeyName, "name" ); @@ -65,6 +66,14 @@ _LIT8( KIndex, "position" ); _LIT8( KConfState, "state" ); _LIT8( KRequestNotification, "RequestNotification" ); +_LIT8( KHSPSCommandRestoreConfigurations, "RestoreConfigurations" ); +_LIT8( KRestore, "restore" ); +_LIT8( KActive, "active" ); +_LIT8( KAll, "all" ); +_LIT8( K0, "0" ); +_LIT8( K1, "1" ); +_LIT8( KPluginIdNotSet, "-1" ); +const TInt KMaxPluginIdLen = 32; namespace hspswrapper{ @@ -145,7 +154,11 @@ // --------------------------------------------------------------------------- // void CHspsWrapper::ConstructL(const TDesC8& aAppUid) - { + { + // Read active view. + iRepository = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); + LoadActivePluginIdL(); + // Attach to HSPS: iServiceHandler = CLiwServiceHandler::NewL(); @@ -265,6 +278,8 @@ delete iHspsService; delete iServiceHandler; + delete iRepository; + delete iActivePluginId; } // --------------------------------------------------------------------------- @@ -293,7 +308,7 @@ // 2: Process Configuration map if(confMap) { - ProcessConfigurationMapL(*confMap,*configuration); + ProcessConfigurationMapL( *confMap, *configuration, ETrue ); } } outParamList.Reset(); @@ -355,6 +370,8 @@ CleanupStack::Pop(&confVar); confVar.Reset(); + plugin->SetTypeL( _L8("application") ); + aPlugins.AppendL( plugin ); CleanupStack::Pop( plugin ); } @@ -373,6 +390,8 @@ EXPORT_C TInt CHspsWrapper::SetAppConfigurationL( const TDesC8& aConfigurationUid ) { + SetActivePluginL( KPluginIdNotSet ); + #ifdef _XN_PERFORMANCE_TEST_ RDebug::Print( _L( "CHspsWrapper::SetAppConfigurationL() - start" ) ); #endif //_XN_PERFORMANCE_TEST_ @@ -447,7 +466,7 @@ // 2: Process Configuration map if(confMap) { - ProcessConfigurationMapL(*confMap,*configuration); + ProcessConfigurationMapL( *confMap, *configuration, EFalse ); } } @@ -482,6 +501,13 @@ inParamList.AppendL( typeParam ); CleanupStack::Pop(&typeParam); typeParam.Reset(); + + TLiwGenericParam logosParam; + logosParam.SetNameAndValueL( KCopyLogos, TLiwVariant( ETrue ) ); + logosParam.PushL(); + inParamList.AppendL( logosParam ); + CleanupStack::Pop(&logosParam); + logosParam.Reset(); iHspsInterface->ExecuteCmdL( KHSPSCommandGetPlugins, inParamList, outParamList ); inParamList.Reset(); @@ -496,7 +522,17 @@ ProcessPluginsL(*list,aPlugins); } } - outParamList.Reset(); + + // check success + TInt pos(0); + const TLiwGenericParam* outParam = + outParamList.FindFirst( pos, KOutKeyStatus ); + if ( outParam ) + { + User::LeaveIfError( outParam->Value().AsTInt32() ); + } + + outParamList.Reset(); } // --------------------------------------------------------------------------- @@ -721,21 +757,48 @@ // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // -EXPORT_C TInt CHspsWrapper::SetActivePluginL(const TDesC8& aPluginId) +EXPORT_C TInt CHspsWrapper::SetActivePluginL( const TDesC8& aPluginId ) { - // Compose AddPlugin hsps LIW message to Service.HomeScreenPluginConfiguration + TPtrC8 pluginId = aPluginId; + if( aPluginId.Length() > KMaxPluginIdLen ) + { + pluginId.Set( aPluginId.Left( KMaxPluginIdLen ) ); + } + + const TInt error = iRepository->Set( KAIActiveViewPluginId, pluginId ); + + delete iActivePluginId; + iActivePluginId = NULL; + + if( error == KErrNone ) + { + iActivePluginId = pluginId.AllocL(); + } + else + { + iActivePluginId = KPluginIdNotSet().AllocL(); + } + + return error; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHspsWrapper::RestoreRootL() + { CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); // Compose Liw message - TLiwGenericParam pluginIdParam; - pluginIdParam.SetNameAndValueL( KKeyPluginId, TLiwVariant(aPluginId) ); - pluginIdParam.PushL(); - inParamList.AppendL( pluginIdParam ); - CleanupStack::Pop(&pluginIdParam); - pluginIdParam.Reset(); + TLiwGenericParam restoreTypeParam; + restoreTypeParam.SetNameAndValueL( KRestore, TLiwVariant( KAll ) ); + restoreTypeParam.PushL(); + inParamList.AppendL( restoreTypeParam ); + CleanupStack::Pop( &restoreTypeParam ); + restoreTypeParam.Reset(); - iHspsInterface->ExecuteCmdL( KHSPSCommandSetActivePlugin, + iHspsInterface->ExecuteCmdL( KHSPSCommandRestoreConfigurations, inParamList, outParamList ); @@ -754,7 +817,43 @@ outParamList.Reset(); return status; } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHspsWrapper::RestoreDefaultConfL() + { + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + // Compose Liw message + TLiwGenericParam restoreTypeParam; + restoreTypeParam.SetNameAndValueL( KRestore, TLiwVariant( KActive ) ); + restoreTypeParam.PushL(); + inParamList.AppendL( restoreTypeParam ); + CleanupStack::Pop( &restoreTypeParam ); + restoreTypeParam.Reset(); + + iHspsInterface->ExecuteCmdL( KHSPSCommandRestoreConfigurations, + inParamList, + outParamList ); + + inParamList.Reset(); + + // check success + const TLiwGenericParam* outParam = NULL; + TInt pos(0); + outParam = outParamList.FindFirst( pos, KOutKeyStatus ); + TInt status(KErrGeneral); + if ( outParam ) + { + status = outParam->Value().AsTInt32(); + } + outParamList.Reset(); + return status; + } + // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // @@ -972,7 +1071,8 @@ // void CHspsWrapper::ProcessConfigurationMapL( const CLiwMap& aSource, - CHspsConfiguration& aTarget) + CHspsConfiguration& aTarget, + const TBool aAppConf ) { TLiwVariant tempVariant; tempVariant.PushL(); @@ -1014,7 +1114,9 @@ const CLiwList* plugins( tempVariant.AsList() ); if( plugins ) { - ProcessConfigurationPluginsL(*plugins,aTarget); + ProcessConfigurationPluginsL( *plugins, + aTarget, + aAppConf ); } } if( aSource.FindL( _L8("settings"), tempVariant ) ) @@ -1042,8 +1144,11 @@ // void CHspsWrapper::ProcessConfigurationPluginsL( const CLiwList& aPluginsList, - CHspsConfiguration& aTarget) + CHspsConfiguration& aTarget, + const TBool aAppConf ) { + TBool activePluginFound = EFalse; + TLiwVariant pluginMapVariant; pluginMapVariant.PushL(); for( int i=0;iSetPluginUidL( pluginVariant.AsData() ); } - if( pluginMap->FindL( _L8("activationstate"),pluginVariant ) ) - { - plugin->SetActivationStateL( pluginVariant.AsData() ); - } if ( pluginMap->FindL( _L8( "locking_status" ), pluginVariant ) ) { plugin->SetLockingStatusL( pluginVariant.AsData() ); + } + + if( aAppConf ) + { + if( ActivePluginId().Compare( KPluginIdNotSet ) == 0 && + pluginMap->FindL( _L8( "activationstate" ), pluginVariant ) ) + { + const TPtrC8 data = pluginVariant.AsData(); + + plugin->SetActivationStateL( data ); + + if( data.Compare( K1 ) == 0 ) + { + SetActivePluginL( plugin->PluginId() ); + activePluginFound = ETrue; + } + } + else if( ActivePluginId().Compare( plugin->PluginId() ) == 0 ) + { + plugin->SetActivationStateL( K1 ); + activePluginFound = ETrue; + } + else + { + plugin->SetActivationStateL( K0 ); + } } + else + { + if ( pluginMap->FindL( _L8( "activationstate" ), pluginVariant ) ) + { + plugin->SetActivationStateL( pluginVariant.AsData() ); + } + } + aTarget.AddPluginMapL(plugin); CleanupStack::Pop(plugin); } CleanupStack::Pop(&pluginVariant); pluginVariant.Reset(); - } - + } } + CleanupStack::Pop(&pluginMapVariant); pluginMapVariant.Reset(); + + if( aAppConf && + !activePluginFound && + aTarget.PluginMaps().Count() > 0 ) + { + CPluginMap* plugin = aTarget.PluginMaps()[0]; + if( plugin ) + { + plugin->SetActivationStateL( K1 ); + SetActivePluginL( plugin->PluginId() ); + } + } } // --------------------------------------------------------------------------- @@ -1488,7 +1635,46 @@ return retval; - } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +TInt CHspsWrapper::LoadActivePluginIdL() + { + delete iActivePluginId; + iActivePluginId = NULL; + + iActivePluginId = HBufC8::NewL( KMaxPluginIdLen ); + TPtr8 activePluginId = iActivePluginId->Des(); + + const TInt error = iRepository->Get( KAIActiveViewPluginId, activePluginId ); + + if( error != KErrNone ) + { + delete iActivePluginId; + iActivePluginId = NULL; + iActivePluginId = KPluginIdNotSet().AllocL(); + } + + return error; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +const TDesC8& CHspsWrapper::ActivePluginId() const + { + if( iActivePluginId ) + { + return *iActivePluginId; + } + else + { + return KPluginIdNotSet; + } + } + } //End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/conf/widgetmanager.confml Binary file idlehomescreen/widgetmanager/conf/widgetmanager.confml has changed diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/conf/widgetmanager_20026F53.crml Binary file idlehomescreen/widgetmanager/conf/widgetmanager_20026F53.crml has changed diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/data/widgetmanagerview.rss --- a/idlehomescreen/widgetmanager/data/widgetmanagerview.rss Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/data/widgetmanagerview.rss Wed May 12 13:22:51 2010 +0300 @@ -23,7 +23,6 @@ #include #include #include -#include #include #include "widgetmanager.hrh" @@ -190,6 +189,11 @@ buf = qtn_wm_uninst_process_busy; } +RESOURCE TBUF r_qtn_hs_add_widget_max_reached + { + buf = qtn_hs_add_widget_max_reached; + } + RESOURCE TBUF r_qtn_wm_uninstall_text { buf = qtn_wm_uninstall_text; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/gfx/add_widget_button.svg --- a/idlehomescreen/widgetmanager/gfx/add_widget_button.svg Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/group/widgetmanager.mmp --- a/idlehomescreen/widgetmanager/group/widgetmanager.mmp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/group/widgetmanager.mmp Wed May 12 13:22:51 2010 +0300 @@ -52,6 +52,9 @@ SOURCE wmwidgetloaderao.cpp SOURCE wmconfiguration.cpp SOURCE wminstaller.cpp +SOURCE wmprocessmonitor.cpp +SOURCE wmwidgetorderdata.cpp +SOURCE wmspbgcleaner.cpp SOURCEPATH ../data START RESOURCE 20026F53.rss @@ -115,4 +118,7 @@ LIBRARY etext.lib LIBRARY centralrepository.lib LIBRARY bmpanim.lib // AknBitmap animation +LIBRARY inetprotutil.lib +LIBRARY browserlauncher.lib + // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/group/wmicons.txt --- a/idlehomescreen/widgetmanager/group/wmicons.txt Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/group/wmicons.txt Wed May 12 13:22:51 2010 +0300 @@ -1,3 +1,2 @@ -c32,8 qgn_menu_hswidget --c32,8 add_widget_button -c32,8 qgn_menu_ovistore.svg diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmconfiguration.h --- a/idlehomescreen/widgetmanager/inc/wmconfiguration.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmconfiguration.h Wed May 12 13:22:51 2010 +0300 @@ -35,7 +35,19 @@ { public: // constructors and destructor - + + /** Operator Application type */ + enum TOpAppType + { + EUnknown, + ES60, + ECwrt, + EWrt, + EJava, + EQt, + EReserved + }; + /** Two-phased constructor. */ static CWmConfiguration* NewL( CWmResourceLoader& aResourceLoader ); @@ -52,21 +64,7 @@ void ConstructL(); public: // API - - /** - * 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 - EApplication // launch an application - }; - + /** * Number of portal buttons (1 or more) */ @@ -86,62 +84,68 @@ const TDesC& PortalButtonIcon( TInt aIndex ); /** - * Portal button action method. - * Defines what happens when the portal button is pressed. + * Returns url to for browser by button index * @param aIndex index of the button, starting at 0 */ - TMethod PortalButtonPrimaryMethod( TInt aIndex ); + const TDesC& PortalButtonBrowserUrl( 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. + * Returns client uid by button index * @param aIndex index of the button, starting at 0 */ - const TDesC& PortalButtonPrimaryService( TInt aIndex ); + TUid PortalButtonClientUid( TInt aIndex ); /** - * parameters related to the method. - * For EHttp this is the HTTP address - * For EWidget the parameters passed to the widget - * For EApplication the params passed to the app. + * Returns client parameter by button index * @param aIndex index of the button, starting at 0 */ - const TDesC& PortalButtonPrimaryParams( TInt aIndex ); + const TDesC& PortalButtonClientParam( TInt aIndex ); /** - * Secondary method, which is excuted if - * primary method fails. - * Works like Primary method. - * @param aIndex index of the button, starting at 0 + * Returns bool if buttons are mirrored. + * @return true when operator button on left on portraid and + * on top on landscape. */ - TMethod PortalButtonSecondaryMethod( TInt aIndex ); + TBool PortalButtonsMirrored(); /** - * 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 + * Returns application type by button index + * @param aIndex button index + * @return application type */ - const TDesC& PortalButtonSecondaryService( TInt aIndex ); + TOpAppType PortalButtonApplicationType( TInt aIndex ); /** - * Parameters for Secondary method. Like Primary method - * Works like Primary params. - * @param aIndex index of the button, starting at 0 + * Returns application id as string + * @param aIndex button index + * @param aOperatorAppId string to get app id */ - const TDesC& PortalButtonSecondaryParams( TInt aIndex ); + void PortalButtonApplicationId( TInt aIndex, TDes& aOperatorAppId ); + + /** + * Returns application id as uid + * @param aIndex button index + * @param aOperatorAppId uid to get app id + */ + void PortalButtonApplicationId( TInt aIndex, TUid& aOperatorAppId ); private: // New functions void LoadConfigurationL(); TInt FindCorrectLanguageId(); - HBufC* ReadParameterL( TInt aKey ); + HBufC* ReadDescParameterL( TInt aKey ); + void ReadInt32Parameter( TInt aKey, TInt32& aValue ); + void ReadIntParameter( TInt aKey, TInt& aValue ); HBufC* ReadLocalisedParameterL( TInt aOffset ); - void IndexConversion( TInt& aIndex ); - + void ReadOperatorApplicationInfoL(); + TUid StringToUid( const TDesC& aStr ); + + /** Returns uid of the widget with a particular bundle identifier. */ + TUid FetchWidgetUidFromRegistryL( const TDesC& aBundleId ); + + /** sets operator icon to button if not already defined */ + void SetOperatorIconL( TUid aUid ); + private: /** @@ -171,20 +175,14 @@ 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; /** - * OVI store button widget bundle ID + * OVI store laucher uid */ - HBufC* iOviStoreBundleId; + TUid iOviStoreUid; /** * OPERATOR button text @@ -201,7 +199,36 @@ */ HBufC* iOperatorButtonUrl; - }; + /** + * OPERATOR store button application parameter + */ + HBufC* iOperatorParam; + + /** + * OPERATOR store application id as string. Used for java + */ + HBufC* iOperatorAppIdStr; + + /** + * OPERATOR store application id as uid. + */ + TUid iOperatorAppIdUid; + + /** + * OPERATOR store application type + */ + TOpAppType iOperatorAppType; + + /** + * Tells if operator button is enabled. + */ + TBool iOperatorButtonEnabled; + + /** + * Tells if buttons need to be mirrored for operator. + */ + TBool iButtonsMirrored; + }; #endif // WMCONFIGURATION_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmcrkeys.h --- a/idlehomescreen/widgetmanager/inc/wmcrkeys.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmcrkeys.h Wed May 12 13:22:51 2010 +0300 @@ -26,49 +26,73 @@ // ************************************************************ // LOCALISED parameters start here -// Key Id's from 0x1 to 0x28 are reserved for languages. +// Key Id's from 0x1 to 0x1E are reserved for languages. // LangId_0 0x1 -// OviStoreBrowserUrl_0 0x2 -// OperatorUrl_0 0x3 -// OperatorButtonText_0 0x4 +// OperatorUrl_0 0x2 +// OperatorButtonText_0 0x3 // ... -// LangId_1 0x5 +// LangId_1 0x4 // ... -// LangId_9 0x25 -// OviStoreBrowserUrl_9 0x26 -// OperatorUrl_9 0x27 -// OperatorButtonText_9 0x28 +// LangId_9 0x1C +// OperatorUrl_9 0x1D +// OperatorButtonText_9 0x1E // ************************************************************ /** 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; +const TUint32 KOperatorButtonUrl0 = 0x2; /** localised set #0, Operator button text */ -const TUint32 KOperatorButtonText0 = 0x4; +const TUint32 KOperatorButtonText0 = 0x3; /** localised set #1, language ID */ -const TUint32 KLangId1 = 0x5; +const TUint32 KLangId1 = 0x4; /** localised set #9, language ID */ -const TUint32 KLangId9 = 0x25; +const TUint32 KLangId9 = 0x1C; // ************************************************************ -// NON-LOCALISED parameters +// NON-LOCALISED OVI parameters // ************************************************************ /** Key to Ovi Store Client param */ -const TUint32 KOviStoreClientParam = 0x29; +const TUint32 KOviStoreClientParam = 0x1F; + +/** Key to Ovi Store client Uid */ +const TUint32 KOviStoreUid = 0x20; + +// ************************************************************ +// NON-LOCALISED Operator parameters +// ************************************************************ + +/** Key to Operator button icon */ +const TUint32 KOperatorButtonEnabled = 0x21; /** Key to Operator button icon */ -const TUint32 KOperatorButtonIcon = 0x2A; +const TUint32 KOperatorButtonIcon = 0x22; -/** Key to Ovi Store client BundleId */ -const TUint32 KOviStoreBundleId = 0x2B; +/** + * Key to Operator application type and id. + * Give ':' as separator between type and id. + * Type can be s60, cwrt, wrt, java, qt + * Examples: + * s60:0x10005902 Application Uid as id + * cwrt:ovi.serviceui.SSOUI BundleId as id + * wrt:com.accuweather.widget.touchNG BundleId as id + * java:c:/sys/bin/javastore.jar full path for java app + * qt:0x2001A9CA Application Uid as id + */ +const TUint32 KOperatorAppTypeAndId = 0x23; +/** Key to Operator application param */ +const TUint32 KOperatorParam = 0x24; + +/** + * Key to define if operator button needs to be placed to left in landscape and + * top on portraid. By default it's right and bottom. + */ +const TUint32 KOperatorButtonHigherPriority = 0x25; #endif // __WMCRKEYS_H__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmdetailsdlg.h --- a/idlehomescreen/widgetmanager/inc/wmdetailsdlg.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmdetailsdlg.h Wed May 12 13:22:51 2010 +0300 @@ -27,6 +27,7 @@ class CAknMarqueeControl; class CEikRichTextEditor; class CAknsBasicBackgroundControlContext; +class CWmImageConverter; // CLASS DECLARATIONS /** @@ -42,9 +43,10 @@ static CWmDetailsDlg* NewL( const TDesC& aName, const TDesC& aDescription, - TBool aCanBeAdded, - const CFbsBitmap* aLogoBmp, - const CFbsBitmap* aLogoMask ); + TBool aCanBeAdded, + const TDesC& aIconStr, + const CFbsBitmap& aDefaultIcon, + const CFbsBitmap& aDefaultIconMask ); /** Destructor. */ ~CWmDetailsDlg(); @@ -108,8 +110,9 @@ void ConstructL( const TDesC& aName, const TDesC& aDescription, - const CFbsBitmap* aLogoBmp, - const CFbsBitmap* aLogoMask ); + const TDesC& aIconStr, + const CFbsBitmap& aDefaultIcon, + const CFbsBitmap& aDefaultIconMask ); private: @@ -157,6 +160,11 @@ * ETrue if widget name needs to be scrolled. */ TBool iNeedToScroll; + + /** + * the image converter utility + */ + CWmImageConverter* iImageConverter; }; #endif ___WMDETAILSDLG_H__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmeffectmanager.h --- a/idlehomescreen/widgetmanager/inc/wmeffectmanager.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmeffectmanager.h Wed May 12 13:22:51 2010 +0300 @@ -25,8 +25,8 @@ class CCoeEnv; // CONSTANTS // Effects -const TInt KAppStartCommonDefaultStyle = 3; -const TInt KAppExitCommonDefaultStyle = 5; +const TInt KAppStartEffectStyle = 1007; +const TInt KAppExitEffectStyle = 1008; /** * Struct which holds needed info of effect. diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmimageconverter.h --- a/idlehomescreen/widgetmanager/inc/wmimageconverter.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmimageconverter.h Wed May 12 13:22:51 2010 +0300 @@ -27,47 +27,23 @@ // Forward declarations class CFbsBitmap; -class CBitmapScaler; -class CImageDecoder; class TAknsItemID; class CWmUnitTest; class MSvgError; // Class declaration /** - * MConverterObserver - * To notify when image is converted - */ -NONSHARABLE_CLASS( MConverterObserver ) - { - public: - virtual void NotifyCompletion( TInt aError ) = 0; - }; - -// Class declaration -/** * CWmImageConverter * Image converter */ -NONSHARABLE_CLASS ( CWmImageConverter ) : public CActive, - public MAknIconFileProvider +NONSHARABLE_CLASS ( CWmImageConverter ) : public MAknIconFileProvider { - /** states for this converter */ - enum TState - { - EIdle = 0, - EDecoding, - EScalingBitmap, - EScalingMask, - EFailed - }; - public: //contructors/destructors /** * Two-phased constructor. * @param aObserver observer */ - static CWmImageConverter* NewL( MConverterObserver* aObserver ); + static CWmImageConverter* NewL(); /** Destructor */ ~CWmImageConverter(); @@ -77,9 +53,10 @@ /** * Parses icon string and prepares logo image. * - * @param aWidth wanted widht - * @param aHeight wanted height + * @param aIconSize wanted size * @param aIconStr str containing logo icon + * @param aBitmap bitmap to create. Empty if fails + * @param aMask mask to create. Empty if fails * Supported values: * - skin( ):mif( ) * - mif( ) @@ -88,86 +65,35 @@ * * @return Error code */ - TInt HandleIconString( TInt aWidth, TInt aHeight, const TDesC& aIconStr ); - - /** - * Returns converted bitmap. Caller takes ownership - * - * @return CFbsBitmap - */ - CFbsBitmap* Bitmap(); + TInt HandleIconString( + const TSize& aIconSize, + const TDesC& aIconStr, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask ); - /** - * Returns converted mask. Caller takes ownership + /** + * Parses icon string and resizes given bitmaps if needed. + * Errors are ignored and previos size image will be used. * - * @return CFbsBitmap - */ - CFbsBitmap* Mask(); - - /** - * sets the size for decoding - * @param aSize the logo size - */ - void SetLogoSize( const TSize& aSize ); - - /** supported image conversion methods */ - enum TConversionMethod - { - EUnrecognized, // we could not recognise the icon string - EUidIcon, // App.UID-coded icon - ESvgIcon, // Icon from SVG-file - ESkinIcon, // Icon from SKIN id - EMifIcon, // Icon from MIF file, known graphic index - ESkinAndMifIcon, // Icon from SKIN and MIF combination - EImageIcon, // Icon from image file (jpeg or png) - }; - - /** - * The type of currently converted image. - * This method can be used to check if correct conversion was used. - * @return conversion method used for current image - */ - TConversionMethod ConversionMethod(); - - /** - * Image convertion status - * - * @return ETrue if processing image, false otherwise. - */ - TBool IsProcessing(); - -protected: // implementation of CActive - /** - * Implements cancellation of an outstanding request. - * - * @see CActive::DoCancel - */ - void DoCancel(); + * @param aIconSize wanted size + * @param aIconStr icon string to find out what to resize + * @param aBitmap bitmap to resize + * @param aMask mask to resize + */ + void UpdateImageSize( + const TSize& aSize, + const TDesC& aIconStr, + CFbsBitmap& aBitmap, + CFbsBitmap& aMask ); - /** - * Handles an active object's request completion event. - * - * @see CActive::RunL - */ - void RunL(); - - /** - * RunError - * - * @see CActive::RunError - */ - TInt RunError(TInt aError); - private: CWmImageConverter(); - void ConstructL( MConverterObserver* aObserver ); - void CheckSvgErrorL( MSvgError* aError ); - void HandleIconStringL( TInt aWidth, TInt aHeight, - const TDesC& aIconStr ); + void ConstructL(); private: - void ScaleBitmap( TInt aWidth, TInt aHeight ); - void ScaleMask( TInt aWidth, TInt aHeight ); + void CheckSvgErrorL( MSvgError* aError ); + void HandleIconStringL( const TSize& aIconSize, const TDesC& aIconStr ); + void CreateIconFromUidL( const TUid& aUid ); void CreateIconFromSvgL( const TDesC& aFileName ); void CreateIconFromOtherL( const TDesC& aFileName ); @@ -185,6 +111,7 @@ // helpers TInt ParseNextUint( TLex& aLex, TUint& aValue ); + void CopyBitmapL( CFbsBitmap& aTrgBitmap, CFbsBitmap& aSrcBitmap ); private: // from MAknIconFileProvider @@ -196,11 +123,6 @@ private: /** - * Converter observer (not owned) - */ - MConverterObserver* iObserver; - - /** * decoded image */ CFbsBitmap* iBitmap; @@ -209,22 +131,7 @@ * decoded image mask */ CFbsBitmap* iMask; - - /** - * decoder from ICL API - */ - CImageDecoder* iImageDecoder; - - /** - * bitmap scaler - */ - CBitmapScaler* iScaler; - - /** - * internal state - */ - TState iState; - + /** * File name to convert */ @@ -234,22 +141,11 @@ * size to convert */ TSize iSize; - - /** - * is scaling needed - */ - TBool iScaleNeeded; - + /** * File handle */ RFs iFs; - - /** - * Conversion method for current image - */ - TConversionMethod iConversionMethod; - }; #endif // #ifndef WMIMAGECONVERTER_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wminstaller.h --- a/idlehomescreen/widgetmanager/inc/wminstaller.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wminstaller.h Wed May 12 13:22:51 2010 +0300 @@ -24,6 +24,7 @@ class CIdle; class CWmWidgetData; class TUid; +class CWmPlugin; /** * CWmInstaller @@ -33,16 +34,17 @@ public: /** * Two-phased constructors. + * @param aWmPlugin Reference to plugin root */ - static CWmInstaller* NewL(); - static CWmInstaller* NewLC(); + static CWmInstaller* NewL( CWmPlugin& aWmPlugin ); + static CWmInstaller* NewLC( CWmPlugin& aWmPlugin ); /** Destructor */ ~CWmInstaller(); private: /** constructor */ - CWmInstaller(); + CWmInstaller( CWmPlugin& aWmPlugin ); /** 2nd phase constructor */ void ConstructL(); @@ -103,6 +105,14 @@ * wrt widget that is currently been uninstalled */ TUid iUid; + + /** + * mime type of widget currently being uninstalled. + */ + HBufC8* iMime; + + /** reference to plugin root */ + CWmPlugin& iWmPlugin; }; #endif // __WMPLUGIN_ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmlistbox.h --- a/idlehomescreen/widgetmanager/inc/wmlistbox.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmlistbox.h Wed May 12 13:22:51 2010 +0300 @@ -32,6 +32,7 @@ #include #include "wmwidgetdataobserver.h" #include "wmwidgetdata.h" +#include "wmwidgetorderdata.h" // FORWARD DECLARATIONS class CWmListBox; @@ -69,17 +70,11 @@ const CFbsBitmap* DefaultLogoMask(); /** - * re-size bitmaps to size provided by layout + * sets item height according to layout */ - void ResizeDefaultBitmaps(); - - /** - * Responds to skin changed event. - */ - void HandleSkinChanged(); + void UpdateItemHeight(); public: - /** * from CFormattedCellListBoxItemDrawer: * draws a single list box item @@ -100,9 +95,8 @@ /** 2nd phase constructor */ void ConstructL(); - + private: // data members - /** * the plugin root (not owned) */ @@ -117,31 +111,6 @@ * pointer to the listbox (not owned) */ CWmListBox* iListBox; - - /** - * current font used in drawing (not owned) - */ - const CFont* iFont; - - /** - * add-button colored bitmap (default color) - */ - CFbsBitmap* iAddWidgetBtnImage; - - /** - * add-button mask - */ - CFbsBitmap* iAddWidgetBtnMask; - - /** - * add-button colored bitmap (highlighted color) - */ - CFbsBitmap* iAddWidgetBtnHighlightImage; - - /** - * add-button mask - */ - CFbsBitmap* iAddWidgetBtnHighlightMask; /** * default logo (when widget does not have one) bitmap @@ -156,7 +125,6 @@ }; - // CLASS DECLARATIONS /** * CWmListBox @@ -276,11 +244,11 @@ }; /** - * sets the list sort order + * Sorts the listbox's visible array * * @param aOrder sort order */ - void SetSortOrderL( TSortOrder aOrder ); + void DoSortToVisibleArray( TSortOrder aOrder ); /** * Responds to layout switched. @@ -288,24 +256,34 @@ void HandleLayoutChanged(); /** - * Responds to skin changed. - */ - void HandleSkinChanged(); - - /** - * State of pointer down event - * - * @return ETrue if pointer is down - */ - inline TBool PressedDown(); - - /** * Returns size of logo * * @return Size of logo rect */ TSize LogoSize(); + /** + * gets the constant widget order data array + */ + inline const ROrderArray& OrderDataArray(); + + /** + * Sorts the order array + * + * @param aOrder sort order + */ + void DoSortToOrderData( TSortOrder aOrder ); + + /** + * Adds order data to array + */ + void AddOrderDataL( CWmWidgetOrderData* aOrderData ); + + /* + * Returns orderdata object by index + */ + CWmWidgetOrderData* OrderData( TInt aItemIndex ); + private: // from CEikTextListBox /** * Creates the item drawer. @@ -331,13 +309,6 @@ * @see CCoeControl::Draw */ void Draw( const TRect& aRect ) const; - - /** - * Handles pointer events. - * - * @see CCoeControl::HandlePointerEventL - */ - void HandlePointerEventL( const TPointerEvent& aPointerEvent ); private: /** Constructor for performing 1st stage construction */ @@ -349,7 +320,17 @@ const CCoeControl* aParent, TInt aFlags ); - +private: + /** + * linear order for sorting, depending on the sort type being used + */ + TLinearOrder SortOrder( TSortOrder aOrder ); + + /** + * linear order for sorting, depending on the sort type being used + */ + TLinearOrder SortOrderToOrderData( TSortOrder aOrder ); + protected: // from MWmWidgetDataObserver /** @@ -359,13 +340,6 @@ */ void HandleWidgetDataChanged( CWmWidgetData* aWidgetData ); -private: // own methods - - /** - * linear order for sorting, depending on the sort type being used - */ - TLinearOrder SortOrder( TSortOrder aOrder ); - private: /** @@ -376,7 +350,7 @@ /** * array of widget data objects (the list model) */ - RWidgetDataValues iWidgetDatas; + RWidgetDataValues iVisibleWidgetArray; /** * the currently active item ADD button's rectangle, for push recognition @@ -388,13 +362,13 @@ */ TBool iFindPaneIsVisible; - /** - * state of pointer pressed down and hold + /** size of logo rect in list item */ + TSize iLogoSize; + + /** + * array of widget order objects */ - TBool iPressedDown; - - /** size of logo rect in list item */ - TSize iLogoSize; + ROrderArray iOrderDataArray; }; #include "wmlistbox.inl" diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmlistbox.inl --- a/idlehomescreen/widgetmanager/inc/wmlistbox.inl Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmlistbox.inl Wed May 12 13:22:51 2010 +0300 @@ -33,21 +33,15 @@ * @return count of widget data array */ inline TInt CWmListBox::WidgetDataCount() - { return iWidgetDatas.Count(); } + { return iVisibleWidgetArray.Count(); } /** * gets the constant widget data array */ inline const RWidgetDataValues& CWmListBox::WidgetDataArray() - { return iWidgetDatas; } + { return iVisibleWidgetArray; } -/** - * State of pointer down event - * - * @return ETrue if pointer is down - */ - inline TBool CWmListBox::PressedDown() - { return iPressedDown; } + inline const ROrderArray& CWmListBox::OrderDataArray() + { return iOrderDataArray; } - #endif /* WMLISTBOX_INL_ */ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmmaincontainer.h --- a/idlehomescreen/widgetmanager/inc/wmmaincontainer.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmmaincontainer.h Wed May 12 13:22:51 2010 +0300 @@ -84,7 +84,12 @@ const TRect& aRect ); public: // new functions - + + /** + * @return true, if widgets loading operation is ongoing. + */ + TBool IsLoadingWidgets(); + /** * @return true, if portal button is currently selected */ @@ -148,12 +153,12 @@ /** * executes findbox activation */ - void ActivateFindPaneL(); + void ActivateFindPaneL( TBool aActivateAdaptive = EFalse ); /** * executes findbox deactivation */ - void DeactivateFindPaneL(); + void DeactivateFindPaneL(TBool aLayout = ETrue); /** * sorts the widget list in alphabetical order @@ -189,6 +194,13 @@ public: + /** + * Handles focus changed events. + * + * @see CCoeControl::FocusChanged + */ + void FocusChanged( TDrawNow aDrawNow ); + /** * Handles key events. * @@ -243,6 +255,17 @@ */ CWmConfiguration& Configuration(); + /** + * Process foregound events. + * @param aForeground ETrue indicates foreground + */ + void ProcessForegroundEvent( TBool aForeground ); + + /** + * access to WM list + */ + CWmListBox& WmListBox(); + protected: // from base class CCoeControl /** @@ -286,6 +309,7 @@ void StartLoadingWidgetsL(); void RemoveCtrlsFromStack(); void UpdateFocusMode(); + void ResetFocus( TDrawNow aDrawNow = ENoDrawNow ); CCoeControl* FindChildControlByPoint( const TPoint& aPoint ); void HandleFindSizeChanged(); TKeyResponse MoveFocusByKeys( @@ -300,6 +324,8 @@ TKeyResponse HandleSearchKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + TInt OperatorButtonHigherPriority( TInt aIndex ); + private: /** @@ -375,6 +401,9 @@ */ CWmConfiguration* iConfiguration; +#ifdef _WM_UNIT_TEST + friend class CWmUnitTest; +#endif }; #endif // WMMAINCONTAINER_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmmaincontainerview.h --- a/idlehomescreen/widgetmanager/inc/wmmaincontainerview.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmmaincontainerview.h Wed May 12 13:22:51 2010 +0300 @@ -21,8 +21,8 @@ #include - class CWmMainContainer; +class CWmSpBgCleaner; class CWmPlugin; /** @@ -73,6 +73,21 @@ */ CWmMainContainer* CreateContainerL(); + /** + * View deactivation function intended for overriding by sub classes. + * + * @see CAknView::DoActivateL + */ + void DoDeactivate(); + +public: // from MeikMenuObserver + + /** + * Foreground event handling function. + * @param aForeground Indicates the required focus state of the control. + */ + void HandleForegroundEventL( TBool aForeground ); + private: CWmMainContainerView( CWmPlugin& aWmPlugin ); void ConstructL(); @@ -88,20 +103,6 @@ TUid aCustomMessageId, const TDesC8& aCustomMessage ); - /** - * View deactivation function intended for overriding by sub classes. - * - * @see CAknView::DoActivateL - */ - void DoDeactivate(); - - /** - * Event handler for status pane size changes. - * - * @see CAknView::HandleStatusPaneSizeChange - */ - void HandleStatusPaneSizeChange(); - protected: // From MEikMenuObserver /* * Menu observer interface. @@ -122,8 +123,8 @@ TBool HandleHelpMenuItemSelectedL(); TBool HandleDetailsMenuItemSelectedL(); TBool HandleDeactivateFindPaneL(); - /** setup status pane */ - void SetupStatusPaneL(); + /** setup title in status pane */ + void SetTitleL(); private: /** @@ -131,6 +132,11 @@ */ CWmMainContainer* iWmMainContainer; + /** + * Statuspane background cleaner + */ + CWmSpBgCleaner* iWmSpBgCleaner; + /** * the plugin root (not owned) */ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmpersistentwidgetorder.h --- a/idlehomescreen/widgetmanager/inc/wmpersistentwidgetorder.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmpersistentwidgetorder.h Wed May 12 13:22:51 2010 +0300 @@ -22,6 +22,7 @@ // INCLUDES #include #include "wmwidgetdata.h" +#include "wmwidgetorderdata.h" // FORWARD DECLARATIONS class RFs; @@ -66,7 +67,7 @@ * The instance can now be used to sort widget data. */ void LoadL(); - + /** * Stores a sorted array of WmWidgetData types. Note that * the order will be directly stored and a copy will not @@ -75,7 +76,7 @@ * * @param aArray the array of widget daya types */ - void StoreL( const RWidgetDataValues& aArray ); + void StoreL( const ROrderArray& aArray ); /** * Retrieves an index of given widget data object within the list. @@ -89,6 +90,17 @@ TInt IndexOf( const CWmWidgetData& aWidgetData ) const; /** + * Retrieves an index of given widget order object within the order list. + * This index can be used to sort and organise. Note that LoadL() + * must be used prior to calling this method, and before that + * there must be something persisted. + * + * @param aWidgetOrder data to seek index of in the sorted order + * @return the index found, or KErrNotFound if widget is new + */ + TInt IndexOf( const CWmWidgetOrderData& aWidgetOrder ) const; + + /** * checks if the persistent widget order is empty. In this case it does * not make any sense to use the object to sort anything. * Note that before loading the object is always empty. @@ -121,6 +133,9 @@ /** compares a tag agains a widget data */ TBool Matches( const CWmWidgetData& aWidgetData ) const; + /** compares a tag agains a widget order */ + TBool Matches( const CWmWidgetOrderData& aWidgetOrder ) const; + /** widget uid */ TInt32 iUid; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmplugin.h --- a/idlehomescreen/widgetmanager/inc/wmplugin.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmplugin.h Wed May 12 13:22:51 2010 +0300 @@ -57,7 +57,23 @@ * @see MHsContentControlUi::Activate */ void Activate(); - + + /** + * notification for widget manager UI that its + * deactivated and plugin is about to be destroyed. + * + * @see MHsContentControlUi::DeActivate + */ + void DeActivate(); + + /** + * returns array of AknViews which were added to + * AknViewAppUi by this plugin. + * + * @see MHsContentControlUi::Views + */ + void Views( RPointerArray& aViews ); + /** * Notifies widget list changes * @@ -77,7 +93,7 @@ /** * hides widget manager UI */ - void Deactivate(); + void CloseView(); /** * main view activated. Sets the previous view ID and main container @@ -147,6 +163,13 @@ */ CWmInstaller& WmInstaller(); + /** + * Get widget by Uid. Used for getting widget details + * when error has occured during uninstallation. + * @param aUid Uid of widget + */ + CWmWidgetData* GetUninstalledWidgetByUid( TUid aUid ); + private: /** constructor */ CWmPlugin(); @@ -159,6 +182,13 @@ * @param aEnabled ETrue if numeric keys are forwarded to phone */ void ForwardNumericKeysToPhone( TBool aEnabled ); + + /** + * Shows error note. + * + * @parama aError Error to be shown. + */ + void ShowErrorNoteL( TInt aError ); private: // data members @@ -203,16 +233,14 @@ */ CHsContentInfo* iPostponedContent; - /** - * ActiveSchedulerWait used to wait while previous view is - * being activated upon deletion. - */ - CActiveSchedulerWait* iWait; - /* * Handles installation */ CWmInstaller* iWmInstaller; + +#ifdef _WM_UNIT_TEST + friend class CWmUnitTest; +#endif }; #endif // __WMPLUGIN_ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmportalbutton.h --- a/idlehomescreen/widgetmanager/inc/wmportalbutton.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmportalbutton.h Wed May 12 13:22:51 2010 +0300 @@ -20,12 +20,17 @@ #define ___WMPORTALBUTTON_H__ #include // CAknButton -#include "wmimageconverter.h" +#include //MAknServerAppExitObserver + #include "wmcommon.h" // FORWARD DECLARATIONS class CWmMainContainer; class CFbsBitmap; +class CWmConfiguration; +class CWmProcessMonitor; +class CBrowserLauncher; +class CWmImageConverter; /** * Portal button ( ovi, operator ) class for Wm @@ -33,8 +38,8 @@ * @class CWmPortalButton wmportalbutton.h */ NONSHARABLE_CLASS( CWmPortalButton ) : public CAknButton, - public MConverterObserver, - public MCoeControlObserver + public MCoeControlObserver, + public MAknServerAppExitObserver { public: /* @@ -71,16 +76,21 @@ */ void ExecuteL(); -protected: // from MConverterObserver - - /** image conversin completed */ - void NotifyCompletion( TInt aError ); - protected: // from MCoeControlObserver /** Observes the button's own activity */ void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); +protected: // from MAknServerAppExitObserver + + /** Observes when browser is exited */ + void HandleServerAppExit( TInt aReason ); + +protected: // from CCoeControl + + /** Handles pointer events. */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + protected: // Constructors /** Constructor for performing 1st stage construction */ @@ -103,7 +113,26 @@ const TDesC& aText, TAknTextComponentLayout& aLayout, TInt aMargin ) const; - + + /** Runs ovi store launcher */ + void RunOviL( CWmConfiguration& aConf ); + + /** Starts browser */ + void StartBrowserL( const TDesC& aUrl ); + + /** Starts operator application */ + void RunOperatorApplicationL( CWmConfiguration& aConf ); + + /** Starts rprocess by given values */ + void StartProcessL( TUid aUid, const TDesC& aParam ); + + /** + * Opens cwrt/wrt widget to fullscreen. + * @param aAppUid Uid of the widget + * @param aParams Optional parameters + * */ + void StartWidgetL( TUid aAppUid, const TDesC& aParams ); + private: //data members /** @@ -126,6 +155,17 @@ /** icon mask */ CFbsBitmap* iButtonIconMask; + + /** + * Monitors process + */ + CWmProcessMonitor* iProcessMonitor; + + /** + * Broswer launcher. + */ + CBrowserLauncher* iBrowserLauncher; + }; #endif //___WMPORTALBUTTON_H__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmprocessmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/widgetmanager/inc/wmprocessmonitor.h Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,85 @@ +/* +* 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 __WMPROCESSMONITOR_ +#define __WMPROCESSMONITOR_ + +//includes +#include + +// Forward declaration +class RProcess; + + +/** + * CWmProcessMonitor + * Monitoring running process + */ +NONSHARABLE_CLASS( CWmProcessMonitor ) : public CActive + { +public: + /** + * Two-phased constructors. + */ + static CWmProcessMonitor* NewL(); + static CWmProcessMonitor* NewLC(); + + /** Destructor */ + ~CWmProcessMonitor(); + +private: + /** constructor */ + CWmProcessMonitor(); + + /** 2nd phase constructor */ + void ConstructL(); + +protected: // implementation of CActive + /** + * Implements cancellation of an outstanding request. + * + * @see CActive::DoCancel + */ + void DoCancel(); + + /** + * Handles an active object's request completion event. + * + * @see CActive::RunL + */ + void RunL(); + + /** + * RunError + * + * @see CActive::RunError + */ + TInt RunError(TInt aError); + +public: + /** + * Starts monitoring process + */ + void Monitor( RProcess& aProcess ); + +private: + + /** process to monitor*/ + RProcess iProcess; + }; + +#endif // __WMPROCESSMONITOR_ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmspbgcleaner.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/widgetmanager/inc/wmspbgcleaner.h Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Declares statuspane's background cleaner. +* +*/ + +#ifndef __WMSPBGCLEANER_ +#define __WMSPBGCLEANER_ + +// Forward declarations + +/** + * Statuspane background cleaner. + * + * @class CWmSpBgCleaner wmspbgcleaner.h + */ +NONSHARABLE_CLASS( CWmSpBgCleaner ) : public CCoeControl + { +public: + /** + * Two-phased constructors. + */ + static CWmSpBgCleaner* NewL(); + static CWmSpBgCleaner* NewLC(); + + /** Destructor */ + ~CWmSpBgCleaner(); + +private: + /** constructor */ + CWmSpBgCleaner(); + + /** 2nd phase constructor */ + void ConstructL(); + + +protected: // from base class CCoeControl + + /** + * Handles a change to the control's resources + * + * @see CCoeControl::HandleResourceChange + */ + void HandleResourceChange( TInt aType ); + + /** + * Sets the control's extent, specifying a rectangle. + * + * @see CCoeControl::SizeChanged + */ + void SizeChanged(); + + /* + * Draws the control. + * + * @see CCoeControl::Draw + */ + void Draw( const TRect& aRect ) const; + +private: + + }; + +#endif // __WMSPBGCLEANERCTRL_ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmwidgetdata.h --- a/idlehomescreen/widgetmanager/inc/wmwidgetdata.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmwidgetdata.h Wed May 12 13:22:51 2010 +0300 @@ -27,7 +27,6 @@ #include #include -#include "wmimageconverter.h" // FORWARD DECLARATIONS class CDictionaryFileStore; @@ -37,6 +36,7 @@ class CWmPersistentWidgetOrder; class RWidgetRegistryClientSession; class CWmResourceLoader; +class CWmImageConverter; // CLASS DECLARATION /** @@ -46,7 +46,6 @@ */ NONSHARABLE_CLASS( CWmWidgetData ) : public CBase - , public MConverterObserver { public: // types @@ -59,6 +58,14 @@ ECps // wrt widgets included in this category }; + /** wrt widget type */ + enum TWrtType + { + EUnIdentified, + EWgz, + EWgt + }; + public: // construction /** * static constructor @@ -139,7 +146,7 @@ /** * Init logo re-creation */ - void ReCreateLogo( const TSize& aSize ); + void UpdateLogo( const TSize& aSize, TBool aReCreateLogo ); /** * returns widget description @@ -154,7 +161,7 @@ * @param aHsContentInfo new content (takes ownership) * @return ETrue if content was changed */ - TBool ReplaceContentInfoL( + TBool ReplaceContentInfo( CHsContentInfo* aHsContentInfo ); public: // comparing / sorting @@ -174,6 +181,9 @@ const CWmWidgetData& aDataTwo ); public: // methods to read the content + + /** Mdcapoint for listbox("\t0widget name") */ + const TDesC& MdcaPoint() const; /** the HsContent info */ inline CHsContentInfo& HsContentInfo(); @@ -182,7 +192,7 @@ inline const CHsContentInfo& HsContentInfo() const; /** widget name */ - inline const TDesC& Name() const; + const TDesC& Name() const; /** widget uid */ inline TUid Uid() const; @@ -196,6 +206,9 @@ /** widget type */ inline TWidgetType WidgetType() const; + /** wrt widget type */ + inline TWrtType WrtType() const; + /** running install animation index */ inline TInt InstallAnimationIndex() const; @@ -214,20 +227,19 @@ /** start animation for uninstallation*/ void VisualizeUninstallL(); -protected: // from MConverterObserver - - /** image conversin completed */ - void NotifyCompletion( TInt aError ); - + /** stop uninstallation animation */ + void StopUninstallAnimation(); + private: // new functions /** uninstall animation related*/ void PrepairAnimL(); void DestroyAnimData(); - static TInt Tick( TAny* aPtr ); + static TInt AnimationTick( TAny* aPtr ); /** fetches publisher uid from widget registry*/ void FetchPublisherUidL( + const TDesC& aPublisherId, RWidgetRegistryClientSession* aRegistryClientSession ); /** Converts uid to TUid from TDesC8 */ @@ -242,9 +254,6 @@ /* reference to resource loader */ CWmResourceLoader& iWmResourceLoader; - /* the image converter utility */ - CWmImageConverter* iImageConverter; - /* observes this widget representation (NOT OWNED) */ MWmWidgetDataObserver* iObserver; @@ -257,12 +266,18 @@ /** The CHsContentInfo that corresponds to this list row */ CHsContentInfo* iHsContentInfo; - /** type oif the widget */ + /** type of the widget */ TWidgetType iWidgetType; + + /** type of the wrt widget */ + TWrtType iWrtType; /** persistent order of widgets (used in sorting) */ const CWmPersistentWidgetOrder* iPersistentWidgetOrder; - + + /** "0\t" + widget name for listbox*/ + HBufC* iMdcaPoint; + /** wrt widget publisher uid */ TUid iPublisherUid; @@ -275,23 +290,17 @@ /* Array of uninstall animation bitmaps*/ RArray iUninstallAnimIcons; - /** periodic timer for updating animation */ - CPeriodic* iPeriodic; - + /** timer for updating animation */ + CPeriodic* iAnimationTimer; + /* uninstall animation index */ TInt iAnimationIndex; /** uninstallation switch */ TBool iAsyncUninstalling; - - /** logo changed switch */ - TBool iFireLogoChanged; - - /** - * ActiveSchedulerWait used to wait while logo image - * is being prepaired. - */ - CActiveSchedulerWait* iWait; + + /* the image converter utility */ + CWmImageConverter* iImageConverter; }; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmwidgetdata.inl --- a/idlehomescreen/widgetmanager/inc/wmwidgetdata.inl Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmwidgetdata.inl Wed May 12 13:22:51 2010 +0300 @@ -27,10 +27,6 @@ inline const CHsContentInfo& CWmWidgetData::HsContentInfo() const { return *iHsContentInfo; } - /** widget name */ - inline const TDesC& CWmWidgetData::Name() const - { return iHsContentInfo->Name(); } - /** widget uid */ inline TUid CWmWidgetData::Uid() const { return UidFromString( iHsContentInfo->Uid() ); }; @@ -43,6 +39,10 @@ inline CWmWidgetData::TWidgetType CWmWidgetData::WidgetType() const { return iWidgetType; } + /** wrt widget type */ + inline CWmWidgetData::TWrtType CWmWidgetData::WrtType() const + { return iWrtType; } + /** the logo bitmap */ inline const CFbsBitmap* CWmWidgetData::LogoImage() { return iLogoImage; } @@ -59,7 +59,6 @@ inline void CWmWidgetData::SetValid( TBool aValid ) { iValid = aValid; } - //From RWidgetDataValues /** returns number of items in the pointer array */ @@ -70,7 +69,7 @@ /** returns the pointed widget name */ inline TPtrC16 RWidgetDataValues::MdcaPoint(TInt aIndex) const { - const TPtrC16 ptr( (*this)[aIndex]->Name() ); + const TPtrC16 ptr( (*this)[aIndex]->MdcaPoint() ); return ptr; } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmwidgetloaderao.h --- a/idlehomescreen/widgetmanager/inc/wmwidgetloaderao.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmwidgetloaderao.h Wed May 12 13:22:51 2010 +0300 @@ -56,6 +56,11 @@ */ void StartLoading(); + /** + * Is loading ongoing. + */ + TBool IsLoading(); + private: /** @@ -85,6 +90,11 @@ private: /** + * connects to wrt registry + */ + void OpenSessionL(); + + /** * loads widgets into the listbox */ void DoLoadWidgetsL(); @@ -100,13 +110,16 @@ * adds a widget data entry to iWidgetsList * takes ownership of aContentInfo */ - void AddWidgetDataL( CHsContentInfo* aContentInfo ); + void AddWidgetDataL( CHsContentInfo* aContentInfo, TInt& aCount ); /** * cleanup resources allocated runing one single run */ void Cleanup(); + /** Converts uid to TUid from TDesC8 */ + TUid UidFromString( const TDesC8& aUidString ) const; + private: // data /** reference to the widget manager root */ @@ -123,6 +136,9 @@ /** uid of currently unistalled widget */ TUid iUninstallUid; + + /** switch for loading operation */ + TBool iLoading; }; #endif // WMWIDGETLOADERAO_H_ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/inc/wmwidgetorderdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/widgetmanager/inc/wmwidgetorderdata.h Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,118 @@ +/* +* 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: +* CWmWidgetOrderData declaration +* +*/ + + +#ifndef WMWIDGETORDERDATA_H +#define WMWIDGETORDERDATA_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CWmPersistentWidgetOrder; + + +// CLASS DECLARATION +/** + * CWmWidgetOrderData + */ +NONSHARABLE_CLASS( CWmWidgetOrderData ) + : public CBase + { + +public: // constructions + /** + * @param aPublisherId + * @param aUid + * @param aUid + * @param aPersistentWidgetOrder + */ + static CWmWidgetOrderData* NewL( + const TDesC& aPublisherId, + const TUid aUid, + const TDesC& aName, + const CWmPersistentWidgetOrder* aPersistentWidgetOrder ); + + static CWmWidgetOrderData* NewLC( + const TDesC& aPublisherId, + const TUid aUid, + const TDesC& aName, + const CWmPersistentWidgetOrder* aPersistentWidgetOrder ); + + /** Destructor. */ + ~CWmWidgetOrderData(); + +private: // private construction + /** Constructor for performing 1st stage construction */ + CWmWidgetOrderData( const TUid aUid ); + + /** 2nd phase constructor */ + void ConstructL( + const TDesC& aPublisherId, + const TDesC& aName, + const CWmPersistentWidgetOrder* aPersistentWidgetOrder ); + +public: + + /** Returns publisherId */ + const TDesC& PublisherId() const; + + /** Returns Uid */ + const TUid Uid() const; + + /** Returns Name */ + const TDesC& Name() const; + + /** comparator function for sort by name (compare two names) */ + static TInt CompareByName( + const CWmWidgetOrderData& aDataOne, + const CWmWidgetOrderData& aDataTwo ); + + /** comparator function for sorting by stored order */ + static TInt CompareByPersistentWidgetOrder( + const CWmWidgetOrderData& aDataOne, + const CWmWidgetOrderData& aDataTwo ); + + /** compare given values to member. Returns ETrue if matches*/ + TBool EqualsTo( const TUid aUid, const TDesC& aPublisherId ); + + /** set persistentorder data*/ + void SetPersistentWidgetOrder( + CWmPersistentWidgetOrder* aPersistentWidgetOrder ); + + /** Updates name if param aName is different than iName */ + void UpdateName( const TDesC& aName ); + +private: // data members + /** uid */ + TUid iUid; + + /** publisherId */ + HBufC* iPublisherId; + + /** Name */ + HBufC* iName; + + /** persistent order of widgets (used in sorting) */ + const CWmPersistentWidgetOrder* iPersistentWidgetOrder; + }; + +typedef RPointerArray ROrderArray; + +#endif // WMWIDGETORDERDATA_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/loc/widgetmanagerview.loc --- a/idlehomescreen/widgetmanager/loc/widgetmanagerview.loc Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/loc/widgetmanagerview.loc Wed May 12 13:22:51 2010 +0300 @@ -92,7 +92,7 @@ // w: // r: TB9.2 // -#define qtn_options_wm_details "Details" +#define qtn_options_wm_show_details "Details" // MISC @@ -163,7 +163,7 @@ // d: Query for unistallation // d: // d: -// l: query +// l: popup_note_window // w: // r: TB9.2 // diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/sis/Create_update_sisx.bat --- a/idlehomescreen/widgetmanager/sis/Create_update_sisx.bat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/sis/Create_update_sisx.bat Wed May 12 13:22:51 2010 +0300 @@ -23,9 +23,9 @@ rem Create wm sis&sisx files makesis widgetmanager_udeb.pkg -signsis widgetmanager_udeb.SIS widgetmanager_udeb.SISX Nokia_RnDCert_02.der Nokia_RnDCert_02.key +signsis widgetmanager_udeb.SIS widgetmanager_udeb.SISX ..\internal\cert\Nokia_RnDCert_02.der ..\internal\cert\Nokia_RnDCert_02.key makesis widgetmanager_urel.pkg -signsis widgetmanager_urel.SIS widgetmanager_urel.SISX Nokia_RnDCert_02.der Nokia_RnDCert_02.key +signsis widgetmanager_urel.SIS widgetmanager_urel.SISX ..\internal\cert\Nokia_RnDCert_02.der ..\internal\cert\Nokia_RnDCert_02.key rem Create wm stubsis file makesis -s widgetmanager_stub.pkg diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/sis/Nokia_RnDCert_02.der Binary file idlehomescreen/widgetmanager/sis/Nokia_RnDCert_02.der has changed diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/sis/Nokia_RnDCert_02.key --- a/idlehomescreen/widgetmanager/sis/Nokia_RnDCert_02.key Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQC/TDP7KKIaf5+uW4OD2iVZuUMC2a+SeQTjf6srlKcOm+CpPNXn -uLNm/8fdEnyOIuRXPRKmqhs1n0JkxEGHynELWMTuKXbQx9SRAGUXzyneGn+IJNnO -vOKHWgKCouX2hfI8rtkdqJpqmO460gGsMgw+lsbeyWyW9lnfLxq+ZC7sqQIDAQAB -AoGBALmUWZE8GBaQ3P4u9WUCSd3DJkkrmXIFSULSZeH/chlwCwDjbbhArHothVzo -REE3hEFFlERvHbplZ+mNouzy7boduvgUzbksGrbGMLJ2qO1GzWWVwV+GzOWKd3ss -/98Gwoy5R8pjnkqUE2wP1iJFw0FjvUTKcYv/z6t3LLJ0CsoBAkEA+c7ixvsviQ3J -s0INytCKU2bf8fqFQJi1VI82ukxNsujGTQ9upVSjuvqPvWyDvvTdrUBHqO+3qPut -sEh01Q8aiQJBAMQKDJPVRu4ud3mwUfEavzL5EjqwG1k9VCNGYsT4FwtrHcxu1oP/ -pk6M3rIZukqomoEEnHWPMwhrK3fhBqi0OSECQQDr40VXege4FnH5OI2Hj4afHMyp -VdQQXGMWFyopnzXblFz0lXb43cTCIiorR9XcMqNFHybLypkWE5o+lRzlt55pAkBQ -P/zeF5Sts//cpL0mgdh7OVKpC6ZmZaCnwAx2rUhhuDu+kDDoYCLoTOps5fNI1LRK -1GRoC3LMo3Jr5IYhUYWBAkBpCpN6k4JU/mszq98EojHerQNxk8sPqvQKUzTutohT -1gLX9yepGayB/TtT2EEJDkWOlnTy/dvN6W3vzbJYz97x ------END RSA PRIVATE KEY----- diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wmconfiguration.cpp --- a/idlehomescreen/widgetmanager/src/wmconfiguration.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmconfiguration.cpp Wed May 12 13:22:51 2010 +0300 @@ -19,7 +19,8 @@ // INCLUDE FILES #include #include -#include +#include +#include // widget reqistry #include #include @@ -30,12 +31,19 @@ // 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; +_LIT( KOpAppTypeS60, "s60" ); +_LIT( KOpAppTypeCwrt, "cwrt" ); +_LIT( KOpAppTypeWrt, "wrt" ); +_LIT( KOpAppTypeJava, "java" ); +_LIT( KOpAppTypeQt, "qt" ); +_LIT( KSeparator, ":" ); +_LIT( KOperatorIcon, "uid(%d)"); +_LIT( KHexPrefix, "0x" ); // --------------------------------------------------------- // CWmConfiguration::NewL @@ -59,15 +67,15 @@ CWmResourceLoader& aResourceLoader ) : iResourceLoader( aResourceLoader ) { - iRepository = NULL; - iOviStoreBundleId = NULL; - iOviStoreClientParam = NULL; - iOviButtonTitle = NULL; - iOviButtonIcon = NULL; - iOviButtonUrl = NULL; - iOperatorButtonTitle = NULL; - iOperatorButtonIcon = NULL; - iOperatorButtonUrl = NULL; + + // ovi + iOviStoreUid = KNullUid; + + // operator + iOperatorAppIdUid = KNullUid; + iOperatorAppType = EUnknown; + iOperatorButtonEnabled = EFalse; + iButtonsMirrored = EFalse; } // --------------------------------------------------------- @@ -77,14 +85,16 @@ CWmConfiguration::~CWmConfiguration() { delete iRepository; - delete iOviStoreBundleId; + // ovi delete iOviStoreClientParam; delete iOviButtonTitle; delete iOviButtonIcon; - delete iOviButtonUrl; + // operator delete iOperatorButtonTitle; delete iOperatorButtonIcon; delete iOperatorButtonUrl; + delete iOperatorParam; + delete iOperatorAppIdStr; } // --------------------------------------------------------- @@ -122,19 +132,23 @@ 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 ) + // read Ovi parameters + ReadInt32Parameter( KOviStoreUid, iOviStoreUid.iUid ); + iOviStoreClientParam = ReadDescParameterL( KOviStoreClientParam ); + + // read operator parameters if operator button enabled + ReadIntParameter( KOperatorButtonEnabled, iOperatorButtonEnabled ); + if ( iOperatorButtonEnabled ) { - // construct the operator button icon. - iOperatorButtonIcon = ReadParameterL( KOperatorButtonIcon ); + // determine language and read localised parameters + iLanguageIndex = FindCorrectLanguageId(); + iOperatorButtonTitle = ReadLocalisedParameterL( KLangOffsetOperatorText ); + iOperatorButtonUrl = ReadLocalisedParameterL( KLangOffsetOperatorUrl ); + // read non-localised parameters + iOperatorButtonIcon = ReadDescParameterL( KOperatorButtonIcon ); + ReadOperatorApplicationInfoL(); + iOperatorParam = ReadDescParameterL( KOperatorParam ); + ReadIntParameter( KOperatorButtonHigherPriority, iButtonsMirrored ); } delete iRepository; @@ -178,10 +192,10 @@ } // --------------------------------------------------------- -// CWmConfiguration::ReadParameterL +// CWmConfiguration::ReadDescParameterL // --------------------------------------------------------- // -HBufC* CWmConfiguration::ReadParameterL( TInt aKey ) +HBufC* CWmConfiguration::ReadDescParameterL( TInt aKey ) { TBuf buf; TInt err = iRepository->Get( aKey, buf ); @@ -196,6 +210,29 @@ } // --------------------------------------------------------- +// CWmConfiguration::ReadInt32ParameterIntL +// --------------------------------------------------------- +// +void CWmConfiguration::ReadInt32Parameter( TInt aKey, TInt32& aValue ) + { + TInt value = 0; + if ( iRepository->Get( aKey, value ) == KErrNone ) + { + aValue = value; + } + } + +// --------------------------------------------------------- +// CWmConfiguration::ReadIntParameterIntL +// --------------------------------------------------------- +// +void CWmConfiguration::ReadIntParameter( TInt aKey, TInt& aValue ) + { + aValue = 0; + iRepository->Get( aKey, aValue ); + } + +// --------------------------------------------------------- // CWmConfiguration::ReadLocalisedParameterL // --------------------------------------------------------- // @@ -222,14 +259,102 @@ } // --------------------------------------------------------- +// CWmConfiguration::ReadOperatorApplicationInfoL +// --------------------------------------------------------- +// +void CWmConfiguration::ReadOperatorApplicationInfoL() + { + HBufC* applicationInfo = ReadDescParameterL( KOperatorAppTypeAndId ); + if ( applicationInfo && applicationInfo->Des().Length() > 0 ) + { + CleanupStack::PushL( applicationInfo ); + applicationInfo->Des().TrimAll(); + + // parse + TInt separator = applicationInfo->Des().Find( KSeparator ); + if ( separator != KErrNotFound ) + { + TPtrC type = applicationInfo->Des().Left( separator ); + TPtrC appId = applicationInfo->Des().Mid( + separator + KSeparator().Length() ); + + if ( !type.Compare( KOpAppTypeS60 ) ) + { + iOperatorAppType = ES60; + iOperatorAppIdUid = StringToUid( appId ); + SetOperatorIconL( iOperatorAppIdUid ); + } + else if ( !type.Compare( KOpAppTypeCwrt ) ) + { + iOperatorAppType = ECwrt; + iOperatorAppIdUid = FetchWidgetUidFromRegistryL( appId ); + SetOperatorIconL( iOperatorAppIdUid ); + } + else if ( !type.Compare( KOpAppTypeWrt ) ) + { + iOperatorAppType = EWrt; + iOperatorAppIdUid = FetchWidgetUidFromRegistryL( appId ); + SetOperatorIconL( iOperatorAppIdUid ); + } + else if ( !type.Compare( KOpAppTypeJava ) ) + { + //TODO: java support is not fully implemented + User::Leave( KErrGeneral ); + iOperatorAppType = EJava; + iOperatorAppIdStr = appId.AllocL(); + } + else if ( !type.Compare( KOpAppTypeQt ) ) + { + iOperatorAppType = EQt; + iOperatorAppIdUid = StringToUid( appId ); + SetOperatorIconL( iOperatorAppIdUid ); + } + } + CleanupStack::PopAndDestroy( applicationInfo ); + } + } + +// --------------------------------------------------------- +// CWmConfiguration::SetOperatorIcon +// --------------------------------------------------------- +// +void CWmConfiguration::SetOperatorIconL( TUid aUid ) + { + if ( iOperatorButtonIcon && + !iOperatorButtonIcon->Des().Length() ) + { + delete iOperatorButtonIcon; + iOperatorButtonIcon = NULL; + iOperatorButtonIcon = HBufC::NewL( + KMaxUidName + KOperatorIcon().Length() ); + iOperatorButtonIcon->Des().Format( + KOperatorIcon(), aUid ); + } + } + +// --------------------------------------------------------- +// CWmConfiguration::FetchWidgetUidFromRegistryL +// --------------------------------------------------------- +// +TUid CWmConfiguration::FetchWidgetUidFromRegistryL( + const TDesC& aBundleId ) + { + RWidgetRegistryClientSession clientSession; + User::LeaveIfError( clientSession.Connect() ); + CleanupClosePushL( clientSession ); + TInt ret = clientSession.GetWidgetUidL( aBundleId ); + clientSession.Disconnect(); + CleanupStack::PopAndDestroy( &clientSession ); + return TUid::Uid( ret ); + } + +// --------------------------------------------------------- // CWmConfiguration::PortalButtonCount // --------------------------------------------------------- // TInt CWmConfiguration::PortalButtonCount() { - if ( iOperatorButtonUrl && iOperatorButtonUrl->Length() > 0 ) - return 2; - return 1; + return ( iOperatorButtonEnabled ? 2 : 1 ); } // --------------------------------------------------------- @@ -238,10 +363,9 @@ // const TDesC& CWmConfiguration::PortalButtonText( TInt aIndex ) { - IndexConversion( aIndex ); if ( aIndex == 0 && iOviButtonTitle ) return *iOviButtonTitle; - if ( aIndex == 1 && iOperatorButtonTitle ) + if ( aIndex == 1 && iOperatorButtonTitle && iOperatorButtonEnabled ) return *iOperatorButtonTitle; return KNullDesC; } @@ -252,112 +376,137 @@ // const TDesC& CWmConfiguration::PortalButtonIcon( TInt aIndex ) { - IndexConversion( aIndex ); if ( aIndex == 0 && iOviButtonIcon ) return *iOviButtonIcon; - if ( aIndex == 1 && iOperatorButtonIcon ) + if ( aIndex == 1 && iOperatorButtonIcon && iOperatorButtonEnabled ) return *iOperatorButtonIcon; return KNullDesC; } // --------------------------------------------------------- -// CWmConfiguration::PortalButtonPrimaryMethod -// --------------------------------------------------------- -// -CWmConfiguration::TMethod - CWmConfiguration::PortalButtonPrimaryMethod( TInt aIndex ) - { - IndexConversion( aIndex ); - if ( aIndex == 0 && iOviStoreBundleId && iOviStoreBundleId->Length() > 0 ) - return EWidget; - if ( aIndex == 1 && iOperatorButtonUrl && iOperatorButtonUrl->Length() > 0 ) - return EHttp; - return ENone; - } - -// --------------------------------------------------------- -// CWmConfiguration::PortalButtonPrimaryService +// CWmConfiguration::PortalButtonBrowserUrl // --------------------------------------------------------- // -const TDesC& - CWmConfiguration::PortalButtonPrimaryService( TInt aIndex ) +const TDesC& CWmConfiguration::PortalButtonBrowserUrl( TInt aIndex ) { - IndexConversion( aIndex ); - if ( aIndex == 0 && iOviStoreBundleId && iOviStoreBundleId->Length() > 0 ) - return *iOviStoreBundleId; - return KNullDesC; - } - -// --------------------------------------------------------- -// CWmConfiguration::PortalButtonPrimaryParams -// --------------------------------------------------------- -// -const TDesC& - CWmConfiguration::PortalButtonPrimaryParams( TInt aIndex ) - { - IndexConversion( aIndex ); - if ( aIndex == 0 && iOviStoreClientParam ) - return *iOviStoreClientParam; - if ( aIndex == 1 && iOperatorButtonUrl ) + // No support for ovi here + if ( aIndex == 1 && iOperatorButtonUrl && iOperatorButtonEnabled ) return *iOperatorButtonUrl; return KNullDesC; } - // --------------------------------------------------------- -// CWmConfiguration::PortalButtonSecondaryMethod +// CWmConfiguration::PortalButtonClientUid // --------------------------------------------------------- // -CWmConfiguration::TMethod - CWmConfiguration::PortalButtonSecondaryMethod( TInt aIndex ) +TUid CWmConfiguration::PortalButtonClientUid( TInt aIndex ) { - IndexConversion( aIndex ); - if ( aIndex == 0 && iOviButtonUrl && iOviButtonUrl->Length() > 0 ) - return EHttp; - return ENone; + if ( aIndex == 0 ) + { + return iOviStoreUid; + } + // operator not supported. Get operator data using + // PortalButtonApplicationInfoL + return KNullUid; } // --------------------------------------------------------- -// CWmConfiguration::PortalButtonSecondaryService +// CWmConfiguration::PortalButtonClientParam // --------------------------------------------------------- // -const TDesC& - CWmConfiguration::PortalButtonSecondaryService( TInt aIndex ) +const TDesC& CWmConfiguration::PortalButtonClientParam( TInt aIndex ) { - IndexConversion( aIndex ); + if ( aIndex == 0 && iOviStoreClientParam ) + { + return *iOviStoreClientParam; + } + if ( aIndex == 1 && iOperatorParam && iOperatorButtonEnabled ) + { + return *iOperatorParam; + } return KNullDesC; } // --------------------------------------------------------- -// CWmConfiguration::PortalButtonSecondaryParams +// CWmConfiguration::PortalButtonsMirrored +// --------------------------------------------------------- +// +TBool CWmConfiguration::PortalButtonsMirrored() + { + return iButtonsMirrored; + } + +// --------------------------------------------------------- +// CWmConfiguration::PortalButtonApplicationType // --------------------------------------------------------- // -const TDesC& - CWmConfiguration::PortalButtonSecondaryParams( TInt aIndex ) +CWmConfiguration::TOpAppType CWmConfiguration::PortalButtonApplicationType( + TInt aIndex ) { - IndexConversion( aIndex ); - if ( aIndex == 0 && iOviButtonUrl ) - return *iOviButtonUrl; - return KNullDesC; + if ( aIndex == 1 ) + { + return iOperatorAppType; + } + // no support for ovi + return EUnknown; + } + +// --------------------------------------------------------- +// CWmConfiguration::PortalButtonApplicationId +// --------------------------------------------------------- +// +void CWmConfiguration::PortalButtonApplicationId( + TInt aIndex, TDes& aOperatorAppId ) + { + if ( aIndex == 1 ) + { + aOperatorAppId.Copy( *iOperatorAppIdStr ); + } + // no support for ovi } // --------------------------------------------------------- -// CWmConfiguration::IndexConversion +// CWmConfiguration::PortalButtonApplicationId +// --------------------------------------------------------- +// +void CWmConfiguration::PortalButtonApplicationId( + TInt aIndex, TUid& aOperatorAppId ) + { + if ( aIndex == 1 ) + { + aOperatorAppId = iOperatorAppIdUid; + } + // no support for ovi + } + +// --------------------------------------------------------- +// CWmConfiguration::StringToUid // --------------------------------------------------------- // -void CWmConfiguration::IndexConversion( TInt& /*aIndex*/ ) +TUid CWmConfiguration::StringToUid( const TDesC& aStr ) { - // 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. + if ( aStr.Length() > 0 && aStr.Find( KHexPrefix ) == 0 ) + { + // hex value 0x12345678 + TLex lex( aStr.Mid( KHexPrefix().Length() ) ); + TUint id = 0; + if ( lex.Val( id, EHex ) == KErrNone ) + { + return TUid::Uid( (TInt)id ); + } + } + else if ( aStr.Length() > 0 ) + { + TLex lex( aStr ); + TUint id( 0 ); + if ( KErrNone == lex.Val( id ) ) + { + return TUid::Uid( (TInt)id ); + } + } + return KNullUid; } - - // End of File diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wmdetailsdlg.cpp --- a/idlehomescreen/widgetmanager/src/wmdetailsdlg.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmdetailsdlg.cpp Wed May 12 13:22:51 2010 +0300 @@ -30,8 +30,10 @@ #include #include #include + #include "widgetmanager.hrh" #include "wmdetailsdlg.h" +#include "wmimageconverter.h" // CONSTANTS @@ -47,12 +49,18 @@ const TDesC& aName, const TDesC& aDescription, TBool aCanBeAdded, - const CFbsBitmap* aLogoBmp, - const CFbsBitmap* aLogoMask ) + const TDesC& aIconStr, + const CFbsBitmap& aDefaultIcon, + const CFbsBitmap& aDefaultIconMask ) { CWmDetailsDlg* self = new ( ELeave ) CWmDetailsDlg( aCanBeAdded ); CleanupStack::PushL( self ); - self->ConstructL( aName, aDescription, aLogoBmp, aLogoMask ); + self->ConstructL( + aName, + aDescription, + aIconStr, + aDefaultIcon, + aDefaultIconMask ); CleanupStack::Pop( self ); return self; } @@ -61,7 +69,7 @@ // CWmDetailsDlg::CWmDetailsDlg // --------------------------------------------------------- // -CWmDetailsDlg::CWmDetailsDlg( TBool aCanBeAdded ) +CWmDetailsDlg::CWmDetailsDlg( TBool aCanBeAdded ) : CAknDialog(), iCanBeAdded( aCanBeAdded ), iNeedToScroll( EFalse ) @@ -85,6 +93,7 @@ delete iLogoBmp; delete iLogoMask; delete iBgContext; + delete iImageConverter; } // ----------------------------------------------------------------------------- @@ -110,13 +119,10 @@ void CWmDetailsDlg::ConstructL( const TDesC& aName, const TDesC& aDescription, - const CFbsBitmap* aLogoBmp, - const CFbsBitmap* aLogoMask ) + const TDesC& aIconStr, + const CFbsBitmap& aDefaultIcon, + const CFbsBitmap& aDefaultIconMask ) { - if ( !aLogoBmp ) - { - User::Leave( KErrArgument ); - } CAknDialog::ConstructL( R_AVKON_DIALOG_EMPTY_MENUBAR ); @@ -125,21 +131,61 @@ iName = aName.AllocL(); iDescription = aDescription.AllocL(); - - // create bitmap and duplicate handle - iLogoBmp = new ( ELeave ) CFbsBitmap; - TSize newSize = TSize( aLogoBmp->SizeInPixels().iWidth , - aLogoBmp->SizeInPixels().iHeight ); - User::LeaveIfError( iLogoBmp->Create( newSize, aLogoBmp->DisplayMode() ) ); - User::LeaveIfError( iLogoBmp->Duplicate( aLogoBmp->Handle() ) ); + + iImageConverter = CWmImageConverter::NewL(); - if ( aLogoMask ) + // Main window + TRect mainPane; + AknLayoutUtils::LayoutMetricsRect( + AknLayoutUtils::EApplicationWindow, mainPane ); + + // Dialog + TAknLayoutRect dlgWindowRect; + TAknWindowLineLayout dlgWindow = AknLayoutScalable_Apps + ::popup_wgtman_window().LayoutLine(); + dlgWindowRect.LayoutRect( mainPane, dlgWindow ); + + // Heading + TAknLayoutRect layoutRect; + TAknWindowLineLayout headingPane = AknLayoutScalable_Apps + ::wgtman_heading_pane().LayoutLine(); + layoutRect.LayoutRect( dlgWindowRect.Rect(), headingPane ); + + // Icon + TAknLayoutRect iconRect; + TAknWindowLineLayout icongrapichs = AknLayoutScalable_Apps + ::wgtman_heading_pane_g1().LayoutLine(); + iconRect.LayoutRect( layoutRect.Rect(), icongrapichs ); + + iImageConverter->HandleIconString( + iconRect.Rect().Size(), + aIconStr, + iLogoBmp, + iLogoMask ); + + // if icon creation fails use defaults + if ( !iLogoBmp || !iLogoMask ) { - iLogoMask = new ( ELeave ) CFbsBitmap; - newSize = TSize( aLogoMask->SizeInPixels().iWidth , - aLogoMask->SizeInPixels().iHeight ); - User::LeaveIfError( iLogoMask->Create( newSize, aLogoMask->DisplayMode() ) ); - User::LeaveIfError( iLogoMask->Duplicate( aLogoMask->Handle() ) ); + delete iLogoBmp; iLogoBmp = NULL; + delete iLogoMask; iLogoMask = NULL; + + iLogoBmp = new ( ELeave ) CFbsBitmap; + iLogoMask = new ( ELeave ) CFbsBitmap; + + TSize size = iconRect.Rect().Size(); + User::LeaveIfError( + iLogoBmp->Create( size, aDefaultIcon.DisplayMode() ) ); + User::LeaveIfError( + iLogoMask->Create( size, aDefaultIconMask.DisplayMode() ) ); + + iLogoBmp->Duplicate( aDefaultIcon.Handle() ); + iLogoMask->Duplicate( aDefaultIconMask.Handle() ); + + // Resize default icons only when they are really needed + AknIconUtils::SetSize( + iLogoBmp, size, EAspectRatioPreserved ); + AknIconUtils::SetSize( + iLogoMask, size, EAspectRatioPreserved ); } iEikonEnv->AddWindowShadow( static_cast(this) ); @@ -180,12 +226,11 @@ EEikEdwinAvkonDisableCursor | EEikEdwinDisplayOnly | EEikEdwinReadOnly ); + iRtEditor->EnableKineticScrollingL( ETrue ); CEikScrollBarFrame* scrollBarFrame = iRtEditor->CreateScrollBarFrameL(); scrollBarFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, - CEikScrollBarFrame::EOff ); // set to EAuto - // when layout fixed. ~wk04_2010 - // currently scrollbar overlaps cba. + CEikScrollBarFrame::EAuto ); iMarquee = CAknMarqueeControl::NewL(); TCallBack callback( RedrawCallback, this ); @@ -225,18 +270,12 @@ TCharFormatMask charFormatMask; CParaFormat paraFormat; TParaFormatMask paraFormatMask; - if ( Layout_Meta_Data::IsMirrored() ) - { - paraFormat.iHorizontalAlignment = CParaFormat::ERightAlign; - } - else - { - paraFormat.iHorizontalAlignment = CParaFormat::ELeftAlign; - } + paraFormat.iHorizontalAlignment = CParaFormat::ELeftAlign; charFormat.iFontPresentation.iTextColor = color; paraFormatMask.SetAttrib(EAttAlignment); charFormatMask.SetAttrib(EAttFontTypeface); charFormatMask.SetAttrib(EAttFontHeight); + paraFormatMask.SetAttrib(EAttLineSpacing); charFormatMask.SetAttrib(EAttColor); iRtEditor->ApplyParaFormatL(¶Format, paraFormatMask); iRtEditor->ApplyCharFormatL(charFormat, charFormatMask); @@ -319,7 +358,10 @@ layoutRect.LayoutRect( rect, contentPane ); AknLayoutUtils::LayoutControl( iRtEditor, layoutRect.Rect(), rtePane ); CEikScrollBarFrame* sbFrame = iRtEditor->ScrollBarFrame(); - if ( sbFrame && sbFrame->VScrollBarVisibility() != CEikScrollBarFrame::EOff ) + if ( sbFrame && + sbFrame->ScrollBarVisibility( + CEikScrollBar::EVertical ) != CEikScrollBarFrame::EOff && + sbFrame->VerticalScrollBar()->IsVisible() ) { CEikScrollBar* scrollBar = sbFrame->VerticalScrollBar(); TAknWindowLineLayout scrollPane = AknLayoutScalable_Apps @@ -401,7 +443,6 @@ TRect rect = Rect(); TRect innerRect( rect ); TRgb color = KRgbBlack; - const TInt offSet = 5; MAknsSkinInstance* skin = AknsUtils::SkinInstance(); MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); @@ -423,12 +464,17 @@ ::wgtman_heading_pane().LayoutLine(); layoutRect.LayoutRect( rect, headingPane ); + TAknLayoutRect logoLayout; + logoLayout.LayoutRect( layoutRect.Rect(),AknLayoutScalable_Apps + ::wgtman_heading_pane_g1().LayoutLine() ); + if( iLogoBmp && iLogoMask ) { - TAknLayoutRect logoLayout; - logoLayout.LayoutRect( layoutRect.Rect(),AknLayoutScalable_Apps - ::wgtman_heading_pane_g1().LayoutLine() ); - logoLayout.DrawImage( gc, iLogoBmp, iLogoMask ); + gc.DrawBitmapMasked( logoLayout.Rect(), + iLogoBmp, + TRect(TPoint(0, 0), iLogoBmp->SizeInPixels()), + iLogoMask, + EFalse ); } AknsUtils::GetCachedColor( @@ -478,22 +524,6 @@ const TInt KBorderWidth = 2; gc.SetPenSize( TSize( KBorderWidth, KBorderWidth ) ); gc.DrawRoundRect( innerRect, TSize( KFrameRoundRadius, KFrameRoundRadius ) ); - - // draw shadow - gc.SetBrushStyle(CGraphicsContext::ESolidBrush); - gc.SetPenStyle( CGraphicsContext::ESolidPen ); - gc.SetBrushColor( color ); - gc.SetPenColor( color ); - TRect rightShadowArea = Rect(); - rightShadowArea.iTl.iX = rightShadowArea.iBr.iX - offSet; - rightShadowArea.iTl.iY += offSet/2; - gc.DrawRect(rightShadowArea); - TRect bottomShadowArea = Rect(); - bottomShadowArea.iTl.iX += offSet/2; - bottomShadowArea.iTl.iY += bottomShadowArea.iBr.iY - offSet; - gc.DrawRect( bottomShadowArea ); - gc.SetBrushStyle( CGraphicsContext::ENullBrush ); - gc.SetPenStyle( CGraphicsContext::ENullPen ); } // --------------------------------------------------------- @@ -547,14 +577,7 @@ void CWmDetailsDlg::FocusChanged( TDrawNow aDrawNow ) { CCoeControl::FocusChanged( aDrawNow ); - if ( IsFocused() ) - { - StartMarquee(); - } - else - { - StopMarquee(); - } + ( IsFocused() ? StartMarquee() : StopMarquee() ); } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wmeffectmanager.cpp --- a/idlehomescreen/widgetmanager/src/wmeffectmanager.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmeffectmanager.cpp Wed May 12 13:22:51 2010 +0300 @@ -126,6 +126,12 @@ RemoveEffect( &aEffect ); return; } + + // Must give some time before starting effect, because otherwise + // fullscreen effect may contain unwanted parts (dialog, note, etc.) + // which was shown when fullscreen effect is about to be started + iCoeEnv.WsSession().Finish(); + User::After( 1 ); const TInt flags( AknTransEffect::TParameter::EActivateExplicitCancel ); const TUid targetAppUid( iAvkonAppUi->Application()->AppDllUid() ); diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wmimageconverter.cpp --- a/idlehomescreen/widgetmanager/src/wmimageconverter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmimageconverter.cpp Wed May 12 13:22:51 2010 +0300 @@ -44,12 +44,12 @@ // CWmImageConverter::NewL // --------------------------------------------------------- // -CWmImageConverter* CWmImageConverter::NewL( MConverterObserver* aObserver ) +CWmImageConverter* CWmImageConverter::NewL() { CWmImageConverter* self = new(ELeave) CWmImageConverter(); CleanupStack::PushL( self ); - self->ConstructL( aObserver ); + self->ConstructL(); CleanupStack::Pop(self); return self; } @@ -59,26 +59,19 @@ // --------------------------------------------------------- // CWmImageConverter::CWmImageConverter() - : CActive( EPriorityStandard ) { - iState = EIdle; iBitmap = NULL; iMask = NULL; - iObserver = NULL; - iConversionMethod = EUnrecognized; - CActiveScheduler::Add( this ); } // --------------------------------------------------------- // CWmImageConverter::ConstructL // --------------------------------------------------------- // -void CWmImageConverter::ConstructL( MConverterObserver* aObserver ) +void CWmImageConverter::ConstructL() { User::LeaveIfError( iFs.Connect() ); iFs.ShareProtected(); - iScaler = CBitmapScaler::NewL(); - iObserver = aObserver; } // --------------------------------------------------------- @@ -87,8 +80,6 @@ // CWmImageConverter::~CWmImageConverter() { - Cancel(); - delete iImageDecoder; iFs.Close(); if ( iBitmap ) { @@ -100,7 +91,6 @@ delete iMask; iMask = NULL; } - delete iScaler; } // --------------------------------------------------------- @@ -108,14 +98,26 @@ // --------------------------------------------------------- // TInt CWmImageConverter::HandleIconString( - TInt aWidth, TInt aHeight, - const TDesC& aIconStr ) + const TSize& aIconSize, + const TDesC& aIconStr, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask ) { + delete aBitmap; aBitmap = NULL; + delete aMask; aMask = NULL; + TInt err( KErrNone ); - TRAP( err, HandleIconStringL( aWidth, aHeight, aIconStr ); ); - if ( KErrNone != err ) + TRAP( err, HandleIconStringL( aIconSize, aIconStr ); ); + if ( err == KErrNone && iBitmap && iMask ) { - iState = EFailed; + // ownership transferred + aBitmap = iBitmap; + iBitmap = NULL; + aMask = iMask; + iMask = NULL; + } + else + { if ( iBitmap ) { delete iBitmap; @@ -127,6 +129,7 @@ iMask = NULL; } } + return err; } @@ -135,11 +138,9 @@ // --------------------------------------------------------- // void CWmImageConverter::HandleIconStringL( - TInt aWidth, TInt aHeight, + const TSize& aIconSize, const TDesC& aIconStr ) { - iConversionMethod = EUnrecognized; - iState = EDecoding; if ( aIconStr.Length() ) { TAknsItemID skinItemId; @@ -149,36 +150,26 @@ TInt maskId( KErrNotFound ); TUid appUid; iFilename = KNullDesC; - iScaleNeeded = EFalse; - iSize.SetSize( aWidth, aHeight ); + iSize = aIconSize; if ( ResolveSkinIdAndMifId( aIconStr, skinItemId, bitmapId, maskId, iFilename ) ) { - if ( bitmapId >= 0 && skinItemId.iMajor > 0 ) - iConversionMethod = ESkinAndMifIcon; - else if ( bitmapId >= 0 ) - iConversionMethod = EMifIcon; - else - iConversionMethod = ESkinIcon; CreateSkinOrMifIconL( skinItemId, bitmapId, maskId, iFilename ); } else if ( ResolveUid( aIconStr, appUid ) ) { - iConversionMethod = EUidIcon; CreateIconFromUidL( appUid ); } else if ( EndsWith( aIconStr, KSvgExt ) ) { // filename_with_full_path.svg - iConversionMethod = ESvgIcon; CreateIconFromSvgL( aIconStr ); } else if ( BaflUtils::FileExists( iFs, aIconStr ) ) { // filename_with_full_path.png/jpg - iConversionMethod = EImageIcon; CreateIconFromOtherL( aIconStr ); } else @@ -200,12 +191,10 @@ { CFbsBitmap* bitmap = NULL; CFbsBitmap* mask = NULL; - + if ( aUid.iUid >= KWidgetUidLowerBound && aUid.iUid < KWidgetUidUpperBound ) { - // AknsUtils::CreateAppIconLC panics incase of WRT - RApaLsSession lsSession; User::LeaveIfError( lsSession.Connect() ); CleanupClosePushL( lsSession ); @@ -214,42 +203,39 @@ CArrayFixFlat* sizeArray = new (ELeave) CArrayFixFlat( KAppSizeArraySize ); CleanupStack::PushL( sizeArray ); + User::LeaveIfError( lsSession.GetAppIconSizes( aUid, *sizeArray ) ); - TSize size; + + // there should be atleast one size available + if ( sizeArray->Count() == 0 ){ User::Leave( KErrNotReady ); }; + + TSize size(0,0); for( TInt i=0; i < sizeArray->Count(); i++ ) { - size = (*sizeArray)[i]; - if ( size == iSize ) - { - break; - } + TSize s = (*sizeArray)[i]; + if ( size.iWidth < s.iWidth || size.iHeight < s.iHeight ) + { size = s; } + if ( size == iSize ) { break; } } + CApaMaskedBitmap* maskedBmp = CApaMaskedBitmap::NewLC(); User::LeaveIfError( lsSession.GetAppIcon( aUid, size, *maskedBmp ) ); - iBitmap = static_cast( maskedBmp ); // ownership transfered + + // handle bitmap + iBitmap = new ( ELeave ) CFbsBitmap; + CopyBitmapL( *iBitmap, *maskedBmp ); - iMask = new ( ELeave ) CFbsBitmap; - User::LeaveIfError( iMask->Create( - maskedBmp->Mask()->SizeInPixels(), - maskedBmp->Mask()->DisplayMode() ) ); - // duplicate mask, origional is owned by maskedBmp - iMask->Duplicate( maskedBmp->Mask()->Handle() ); - CleanupStack::Pop( maskedBmp ); - maskedBmp = NULL; - CleanupStack::PopAndDestroy(sizeArray); + // handle mask + if ( maskedBmp->Mask() ) + { + iMask = new ( ELeave ) CFbsBitmap; + CopyBitmapL( *iMask, *maskedBmp->Mask() ); + } + + // cleanup + CleanupStack::PopAndDestroy( maskedBmp ); + CleanupStack::PopAndDestroy( sizeArray ); CleanupStack::PopAndDestroy( &lsSession ); - - // scale or notify - if ( size == iSize ) - { - iState = EIdle; - iObserver->NotifyCompletion( KErrNone ); - } - else - { - iScaleNeeded = ETrue; - ScaleBitmap( iSize.iWidth, iSize.iHeight ); - } } else if ( aUid.iUid != KNullUid.iUid ) { @@ -276,20 +262,14 @@ iBitmap = bitmap; iMask = mask; - - err = AknIconUtils::SetSize( iBitmap , iSize, EAspectRatioNotPreserved ); + err = AknIconUtils::SetSize( iBitmap , iSize, EAspectRatioPreserved ); if ( KErrNone == err ) { - err = AknIconUtils::SetSize( iMask , iSize, EAspectRatioNotPreserved ); + err = AknIconUtils::SetSize( iMask , iSize, EAspectRatioPreserved ); } - - // notify observer - iState = EIdle; - iObserver->NotifyCompletion( err ); } else { - iState = EIdle; User::Leave( KErrArgument ); } } @@ -353,8 +333,152 @@ iBitmap = bitmap; iMask = mask; - iState = EIdle; - iObserver->NotifyCompletion( KErrNone ); + } + +// --------------------------------------------------------- +// CWmImageConverter::CreateIconFromOtherL +// --------------------------------------------------------- +// +void CWmImageConverter::CreateIconFromOtherL( const TDesC& aFileName ) + { + if (iBitmap) {delete iBitmap; iBitmap = NULL;} + if (iMask) {delete iMask; iMask = NULL;} + + iFilename.Copy( aFileName ); + + // create the decoder + CImageDecoder* imageDecoder = CImageDecoder::FileNewL( + iFs, iFilename, CImageDecoder::EOptionAlwaysThread ); + CleanupStack::PushL( imageDecoder ); + + TSize size = imageDecoder->FrameInfo().iOverallSizeInPixels; + + // create the destination bitmap + iBitmap = new (ELeave) CFbsBitmap(); + User::LeaveIfError( iBitmap->Create( + size, imageDecoder->FrameInfo().iFrameDisplayMode ) ); + + iMask = new (ELeave) CFbsBitmap(); + User::LeaveIfError( iMask->Create( size, EGray256 ) ); + + // start conversion to bitmap + TRequestStatus status; + imageDecoder->Convert( &status, *iBitmap, *iMask ); + User::WaitForRequest( status ); + if( status.Int() == KErrUnderflow ) + { + imageDecoder->ContinueConvert( &status ); + User::WaitForRequest( status ); + } + User::LeaveIfError( status.Int() ); + CleanupStack::PopAndDestroy( imageDecoder ); + } + +// --------------------------------------------------------------------------- +// CWmImageConverter::CreateSkinOrMifIconL +// --------------------------------------------------------------------------- +// +void CWmImageConverter::CreateSkinOrMifIconL( + const TAknsItemID& aItemId, TInt aBitmapId, + TInt aMaskId, const TDesC& aFileName ) + { + iFilename = aFileName; + CFbsBitmap* bitmap = NULL; + CFbsBitmap* mask = NULL; + + // Load from skin + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + if ( skin && aItemId.iMajor != 0 && aItemId.iMinor != 0 ) + { + TInt err( KErrNone ); + CAknsMaskedBitmapItemData* itemData = NULL; + TRAP( err, itemData = + static_cast( + skin->CreateUncachedItemDataL( aItemId, EAknsITMaskedBitmap ) ); ); + if( itemData && KErrNone == err ) + { + CleanupStack::PushL( itemData ); + // Detach bitmaps + bitmap = itemData->Bitmap(); + itemData->SetBitmap( NULL ); + mask = itemData->Mask(); + itemData->SetMask( NULL ); + CleanupStack::PopAndDestroy( itemData ); + } + else + { + // look in imagetable + CAknsImageTableItemData* iconData = NULL; + TRAP( err, iconData = static_cast( + skin->CreateUncachedItemDataL( aItemId, EAknsITImageTable ) ); ); + if( iconData && KErrNone == err ) + { + CleanupStack::PushL( iconData ); + if( iconData->NumberOfImages() ) + { + TAknsItemID iconIId; + iconIId.Set( iconData->ImageIID(0) ); + TRAP( err, AknsUtils::CreateIconL( + skin, iconIId, bitmap, mask, KNullDesC, -1, -1 ); ); + } + CleanupStack::PopAndDestroy( iconData ); + } + } + + if ( KErrNone == err && bitmap ) + { + TInt err = AknIconUtils::SetSize( + bitmap, + iSize, + EAspectRatioPreserved ); + if ( KErrNone == err ) + { + if ( mask ) + { + err = AknIconUtils::SetSize( + mask, + iSize, + EAspectRatioPreserved ); + } + iBitmap = bitmap; + iMask = mask; + return; + } + else + { + if ( bitmap ) { delete bitmap; bitmap = NULL; } + if ( mask ){ delete mask; mask = NULL; } + } + } + } + + if( aBitmapId != KErrNotFound && !bitmap && + aFileName.Length() && BaflUtils::FileExists( iFs, aFileName ) ) + { + if ( aMaskId != KErrNotFound ) + { + // Create icon from Mif filename , bitmap id and mask id + AknIconUtils::CreateIconL( + bitmap, mask, *this, aBitmapId, aMaskId ); + } + else + { + bitmap = AknIconUtils::CreateIconL( *this, aBitmapId ); + } + } + else + { + User::Leave( KErrArgument ); + } + + iBitmap = bitmap; + iMask = mask; + + TInt err = AknIconUtils::SetSize( iBitmap , iSize, EAspectRatioPreserved ); + if ( KErrNone == err && iMask ) + { + err = AknIconUtils::SetSize( iMask , iSize, EAspectRatioPreserved ); + } } // --------------------------------------------------------- @@ -370,263 +494,6 @@ } // --------------------------------------------------------- -// CWmImageConverter::CreateIconFromOtherL -// --------------------------------------------------------- -// -void CWmImageConverter::CreateIconFromOtherL( const TDesC& aFileName ) - { - if ( IsActive() ) - { - User::Leave( KErrNotReady ); - } - - if ( iImageDecoder ) delete iImageDecoder; iImageDecoder = NULL; - if (iBitmap) {delete iBitmap; iBitmap = NULL;} - if (iMask) {delete iMask; iMask = NULL;} - - iFilename.Copy( aFileName ); - - // create the decoder - iImageDecoder = CImageDecoder::FileNewL( iFs, iFilename ); - - TSize size = iImageDecoder->FrameInfo().iOverallSizeInPixels; - - // create the destination bitmap - iBitmap = new (ELeave) CFbsBitmap(); - iBitmap->Create( size, - iImageDecoder->FrameInfo().iFrameDisplayMode ); - - iMask = new (ELeave) CFbsBitmap(); - iMask->Create( size, EGray256 ); - - if ( size != iSize ) - { - iScaleNeeded = ETrue; - } - - // start conversion to bitmap - iImageDecoder->Convert( &iStatus, *iBitmap, *iMask ); - SetActive(); - } - -// --------------------------------------------------------- -// CWmImageConverter::DoCancel -// --------------------------------------------------------- -// -void CWmImageConverter::DoCancel() - { - if( iState == EDecoding && - iConversionMethod == EImageIcon ) - { - iImageDecoder->Cancel(); - iState = EIdle; - if ( iObserver ) - { - iObserver->NotifyCompletion( KErrCancel ); - } - } - else if( iState == EScalingBitmap || - iState == EScalingMask ) - { - iScaler->Cancel(); - iState = EIdle; - if ( iObserver ) - { - iObserver->NotifyCompletion( KErrCancel ); - } - } - else - { - // State is EIdle, do nothing - } - iScaleNeeded = EFalse; - } - -// --------------------------------------------------------- -// CWmImageConverter::RunL -// --------------------------------------------------------- -// -void CWmImageConverter::RunL() - { - switch( iState ) - { - case EDecoding: - { - if( iStatus.Int() == KErrNone ) - { - if ( iScaleNeeded ) - { - ScaleBitmap( iSize.iWidth, iSize.iHeight ); - } - else - { - iState = EIdle; - if ( iObserver ) - { - iObserver->NotifyCompletion( KErrNone ); - } - } - break; - } - else if( iStatus.Int() == KErrUnderflow ) - { - iImageDecoder->ContinueConvert( &iStatus ); - SetActive(); - break; - } - else if ( iStatus.Int() == KErrCorrupt ) - { - iState = EIdle; - iScaleNeeded = EFalse; - if ( iBitmap ) - { - delete iBitmap; - iBitmap = NULL; - } - if ( iMask ) - { - delete iMask; - iMask = NULL; - } - if ( iObserver ) - { - iObserver->NotifyCompletion( KErrCorrupt ); - } - break; - } - else - { - // Unknown error - iState = EIdle; - iScaleNeeded = EFalse; - if ( iBitmap ) - { - delete iBitmap; - iBitmap = NULL; - } - if ( iMask ) - { - delete iMask; - iMask = NULL; - } - if ( iObserver ) - { - iObserver->NotifyCompletion( iStatus.Int() ); - } - break; - } - } - case EScalingBitmap: - { - if( iStatus.Int() == KErrNone && iMask ) - { - ScaleMask( iSize.iWidth, iSize.iHeight ); - } - else - { - iState = EIdle; - iScaleNeeded = EFalse; - if ( iObserver ) - { - iObserver->NotifyCompletion( iStatus.Int() ); - } - } - break; - } - case EScalingMask: - { - iState = EIdle; - iScaleNeeded = EFalse; - if ( iObserver ) - { - iObserver->NotifyCompletion( iStatus.Int() ); - } - break; - } - default: - break; - } - } - -// --------------------------------------------------------- -// CWmImageConverter::RunError -// --------------------------------------------------------- -// -TInt CWmImageConverter::RunError(TInt /*aError*/) - { - // Our RunL does not contain any method calls that would leave, so this method - // should never be called. - iScaleNeeded = EFalse; - return KErrNone; - } - -// --------------------------------------------------------- -// CWmImageConverter::ScaleBitmap -// --------------------------------------------------------- -// -void CWmImageConverter::ScaleBitmap( TInt aWidth, TInt aHeight ) - { - if ( !IsActive() && - iBitmap && - ( iState == EDecoding || iState == EIdle ) ) - { - iState = EScalingBitmap; - // the maintain aspect ratio is by default set to true - iScaler->Scale( &iStatus, *iBitmap, TSize( aWidth,aHeight ), EFalse ); - SetActive(); - } - } - -// --------------------------------------------------------- -// CWmImageConverter::ScaleMask -// --------------------------------------------------------- -// -void CWmImageConverter::ScaleMask( TInt aWidth, TInt aHeight ) - { - if ( !IsActive() && - iState == EScalingBitmap && - iMask ) - { - iState = EScalingMask; - // the maintain aspect ratio is by default set to true - iScaler->Scale( &iStatus, *iMask, TSize(aWidth,aHeight), EFalse ); - SetActive(); - } - } - -// --------------------------------------------------------- -// CWmImageConverter::Bitmap -// --------------------------------------------------------- -// -CFbsBitmap* CWmImageConverter::Bitmap() - { - CFbsBitmap* bitmap = NULL; - if (iState == EIdle && - iBitmap ) - { - bitmap = iBitmap; // ownership taken - iBitmap = NULL; - } - return bitmap; - } - -// --------------------------------------------------------- -// CWmImageConverter::Mask -// --------------------------------------------------------- -// -CFbsBitmap* CWmImageConverter::Mask() - { - CFbsBitmap* mask = NULL; - if (iState == EIdle && - iMask ) - { - mask = iMask; // ownership taken - iMask = NULL; - } - return mask; - } - -// --------------------------------------------------------- // CWmImageConverter::EndsWith // --------------------------------------------------------- // @@ -764,115 +631,6 @@ } // --------------------------------------------------------------------------- -// CWmImageConverter::CreateSkinOrMifIconL -// --------------------------------------------------------------------------- -// -void CWmImageConverter::CreateSkinOrMifIconL( - const TAknsItemID& aItemId, TInt aBitmapId, - TInt aMaskId, const TDesC& aFileName ) - { - iFilename = aFileName; - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - // Load from skin - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - if ( skin && aItemId.iMajor != 0 && aItemId.iMinor != 0 ) - { - TInt err( KErrNone ); - CAknsMaskedBitmapItemData* itemData = NULL; - TRAP( err, itemData = - static_cast( - skin->CreateUncachedItemDataL( aItemId, EAknsITMaskedBitmap ) ); ); - if( itemData && KErrNone == err ) - { - CleanupStack::PushL( itemData ); - // Detach bitmaps - bitmap = itemData->Bitmap(); - itemData->SetBitmap( NULL ); - mask = itemData->Mask(); - itemData->SetMask( NULL ); - CleanupStack::PopAndDestroy( itemData ); - } - else - { - // look in imagetable - CAknsImageTableItemData* iconData = NULL; - TRAP( err, iconData = static_cast( - skin->CreateUncachedItemDataL( aItemId, EAknsITImageTable ) ); ); - if( iconData && KErrNone == err ) - { - CleanupStack::PushL( iconData ); - if( iconData->NumberOfImages() ) - { - TAknsItemID iconIId; - iconIId.Set( iconData->ImageIID(0) ); - TRAP( err, AknsUtils::CreateIconL( - skin, iconIId, bitmap, mask, KNullDesC, -1, -1 ); ); - } - CleanupStack::PopAndDestroy( iconData ); - } - } - - if ( KErrNone == err && bitmap ) - { - TInt err = AknIconUtils::SetSize( bitmap , iSize, EAspectRatioNotPreserved ); - if ( KErrNone == err ) - { - if ( mask ) - { - err = AknIconUtils::SetSize( mask , iSize, EAspectRatioNotPreserved ); - } - iBitmap = bitmap; - iMask = mask; - iState = EIdle; - // notify observer - iObserver->NotifyCompletion( KErrNone ); - return; - } - else - { - if ( bitmap ) { delete bitmap; bitmap = NULL; } - if ( mask ){ delete mask; mask = NULL; } - } - } - } - - if( aBitmapId != KErrNotFound && !bitmap && - aFileName.Length() && BaflUtils::FileExists( iFs, aFileName ) ) - { - if ( aMaskId != KErrNotFound ) - { - // Create icon from Mif filename , bitmap id and mask id - AknIconUtils::CreateIconL( - bitmap, mask, *this, aBitmapId, aMaskId ); - } - else - { - bitmap = AknIconUtils::CreateIconL( *this, aBitmapId ); - } - } - else - { - iState = EIdle; - User::Leave( KErrArgument ); - } - - iBitmap = bitmap; - iMask = mask; - - TInt err = AknIconUtils::SetSize( iBitmap , iSize, EAspectRatioNotPreserved ); - if ( KErrNone == err && iMask ) - { - err = AknIconUtils::SetSize( iMask , iSize, EAspectRatioNotPreserved ); - } - - iState = EIdle; - // notify observer - iObserver->NotifyCompletion( err ); - } - -// --------------------------------------------------------------------------- // CWmImageConverter::ParseNextUint() // --------------------------------------------------------------------------- // @@ -899,24 +657,6 @@ } // --------------------------------------------------------------------------- -// CWmImageConverter::SetLogoSize() -// --------------------------------------------------------------------------- -// -void CWmImageConverter::SetLogoSize( const TSize& aSize ) - { - iSize = aSize; - } - -// --------------------------------------------------------------------------- -// CWmImageConverter::ConversionMethod() -// --------------------------------------------------------------------------- -// -CWmImageConverter::TConversionMethod CWmImageConverter::ConversionMethod() - { - return iConversionMethod; - } - -// --------------------------------------------------------------------------- // CWmImageConverter::RetrieveIconFileHandleL // --------------------------------------------------------------------------- // @@ -927,12 +667,35 @@ EFileRead | EFileShareReadersOnly ); if ( KErrNone != err ) { - iState = EIdle; User::Leave( err ); } } // --------------------------------------------------------------------------- +// CWmImageConverter::CopyBitmapL +// --------------------------------------------------------------------------- +// +void CWmImageConverter::CopyBitmapL( + CFbsBitmap& aTrgBitmap, + CFbsBitmap& aSrcBitmap ) + { + TSize size( aSrcBitmap.SizeInPixels() ); + TDisplayMode displayMode( aSrcBitmap.DisplayMode() ); + User::LeaveIfError( aTrgBitmap.Create( size, displayMode ) ); + + HBufC8* scanLine = HBufC8::NewL( aSrcBitmap.ScanLineLength( + size.iWidth, displayMode ) ); + TPtr8 scanPtr( scanLine->Des() ); + TPoint pp; + for( pp.iY = 0; pp.iY < size.iHeight; ++pp.iY ) + { + aSrcBitmap.GetScanLine( scanPtr, pp, size.iWidth, displayMode ); + aTrgBitmap.SetScanLine( scanPtr, pp.iY ); + } + delete scanLine; + } + +// --------------------------------------------------------------------------- // CWmImageConverter::Finished // --------------------------------------------------------------------------- // @@ -942,13 +705,47 @@ } // --------------------------------------------------------------------------- -// CWmImageConverter::IsProcessing +// CWmImageConverter::UpdateImageSize // --------------------------------------------------------------------------- // -TBool CWmImageConverter::IsProcessing() +void CWmImageConverter::UpdateImageSize( + const TSize& aSize, + const TDesC& aIconStr, + CFbsBitmap& aBitmap, + CFbsBitmap& aMask ) { - return ( ( ( iState != EIdle && iState != EFailed ) || - IsActive() ) ? ETrue : EFalse ); + if ( aIconStr.Length() && iSize != aSize ) + { + TAknsItemID skinItemId; + skinItemId.iMajor = 0; + skinItemId.iMinor = 0; + TInt bitmapId( KErrNotFound ); + TInt maskId( KErrNotFound ); + TUid appUid; + iFilename = KNullDesC; + iSize = aSize; + + if ( ResolveSkinIdAndMifId( + aIconStr, skinItemId, bitmapId, maskId, iFilename ) ) + { + AknIconUtils::SetSize( &aBitmap, iSize ); + AknIconUtils::SetSize( &aMask, iSize ); + } + else if ( ResolveUid( aIconStr, appUid ) ) + { + if ( appUid.iUid >= KWidgetUidLowerBound && + appUid.iUid < KWidgetUidUpperBound ) + { + //WRT. No resize needed here + return; + } + else if ( appUid.iUid != KNullUid.iUid ) + { + AknIconUtils::SetSize( &aBitmap, iSize ); + AknIconUtils::SetSize( &aMask, iSize ); + } + } + } } // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wminstaller.cpp --- a/idlehomescreen/widgetmanager/src/wminstaller.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wminstaller.cpp Wed May 12 13:22:51 2010 +0300 @@ -17,21 +17,31 @@ */ #include +#include #include "wminstaller.h" #include "wmwidgetdata.h" +#include "wmplugin.h" // CONSTANTS _LIT8( KWrtMime, "application/x-nokia-widget"); +/* + Note: + same mime type as above is used for wgz & wgt in wk9. + \ext\mw\cwrt\app\platform\s60\WidgetRecognizer\ + Uninstalltion will fail with KErrNotFound for now. +*/ +_LIT8( KCWrtMime, "application/widget"); + // --------------------------------------------------------- // CWmInstaller::NewL // --------------------------------------------------------- // -CWmInstaller* CWmInstaller::NewL() +CWmInstaller* CWmInstaller::NewL( CWmPlugin& aWmPlugin ) { - CWmInstaller* self = CWmInstaller::NewLC(); + CWmInstaller* self = CWmInstaller::NewLC( aWmPlugin ); CleanupStack::Pop(); // self; return self; } @@ -40,9 +50,9 @@ // CWmInstaller::NewLC // --------------------------------------------------------- // -CWmInstaller* CWmInstaller::NewLC() +CWmInstaller* CWmInstaller::NewLC( CWmPlugin& aWmPlugin ) { - CWmInstaller* self = new ( ELeave ) CWmInstaller(); + CWmInstaller* self = new ( ELeave ) CWmInstaller( aWmPlugin ); CleanupStack::PushL(self); self->ConstructL(); return self; @@ -52,7 +62,9 @@ // CWmInstaller::CWmInstaller // --------------------------------------------------------- // -CWmInstaller::CWmInstaller() : CActive( EPriorityStandard ) +CWmInstaller::CWmInstaller( CWmPlugin& aWmPlugin ) : + CActive( EPriorityStandard ), + iWmPlugin( aWmPlugin ) { iUid = KNullUid; iIdle = NULL; @@ -81,6 +93,7 @@ iIdle->Cancel(); } delete iIdle; + delete iMime; } // --------------------------------------------------------- @@ -105,6 +118,20 @@ // void CWmInstaller::RunL() { + // if error has occurred, stop uninstallation animation. + CWmWidgetData* widget = + iWmPlugin.GetUninstalledWidgetByUid( iUid ); + if ( widget ) + { + widget->StopUninstallAnimation(); + } + + if ( KErrNone != iStatus.Int() ) + { + // display error note incase of error + CEikonEnv::Static()->HandleError( iStatus.Int() ); + } + // close SWI session if ( iIdle && iIdle->IsActive() ) { @@ -136,7 +163,14 @@ // --------------------------------------------------------- // TInt CWmInstaller::RunError(TInt /*aError*/) - { + { + // if error has occurred, stop uninstallation animation. + CWmWidgetData* widget = + iWmPlugin.GetUninstalledWidgetByUid( iUid ); + if ( widget ) + { + widget->StopUninstallAnimation(); + } // close SWI session if ( iIdle && iIdle->IsActive() ) { @@ -157,16 +191,28 @@ { User::Leave( KErrInUse ); } + else if ( !aData || aData->PublisherUid() == KNullUid || + aData->WrtType() == CWmWidgetData::EUnIdentified ) + { + User::Leave( KErrArgument ); + } else { + delete iMime; + iMime = NULL; + CloseSwiSession( this ); + + // re-open session to swi server User::LeaveIfError( iInstaller.Connect() ); + iMime = ( ( aData->WrtType() == CWmWidgetData::EWgt ) ? + KCWrtMime().AllocL() : KWrtMime().AllocL() ); iUid = aData->PublisherUid(); SwiUI::TUninstallOptions optionsUninstall; optionsUninstall.iBreakDependency = SwiUI::EPolicyAllowed; optionsUninstall.iKillApp = SwiUI::EPolicyAllowed; SwiUI::TUninstallOptionsPckg uninstallOptionsPkg( optionsUninstall ); iInstaller.SilentUninstall( iStatus, iUid, - uninstallOptionsPkg, KWrtMime ); + uninstallOptionsPkg, *iMime ); aData->VisualizeUninstallL(); SetActive(); diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wmlistbox.cpp --- a/idlehomescreen/widgetmanager/src/wmlistbox.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmlistbox.cpp Wed May 12 13:22:51 2010 +0300 @@ -30,11 +30,13 @@ #include #include #include + #include "wmcommon.h" #include "wmplugin.h" #include "wmresourceloader.h" #include "wmlistbox.h" #include "wmwidgetdata.h" +#include "wmwidgetorderdata.h" // CONSTANTS @@ -78,7 +80,6 @@ { iCellData = aFormattedCellData; iListBox = aListBox; - iFont = aFont; } // --------------------------------------------------------- @@ -99,30 +100,6 @@ EMbmWidgetmanagerQgn_menu_hswidget, EMbmWidgetmanagerQgn_menu_hswidget_mask ); - - AknsUtils::CreateColorIconL( - skin, - KAknsIIDQgnIndiWmAdd, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6, - iAddWidgetBtnImage, - iAddWidgetBtnMask, - iWmPlugin.ResourceLoader().IconFilePath(), - EMbmWidgetmanagerAdd_widget_button, - EMbmWidgetmanagerAdd_widget_button_mask, - KRgbBlack ); - - AknsUtils::CreateColorIconL( - skin, - KAknsIIDQgnIndiWmAdd, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG10, - iAddWidgetBtnHighlightImage, - iAddWidgetBtnHighlightMask, - iWmPlugin.ResourceLoader().IconFilePath(), - 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. @@ -131,12 +108,27 @@ // 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(); + + CFbsBitmap* dummyBmp = new(ELeave) CFbsBitmap; + CleanupStack::PushL( dummyBmp ); + User::LeaveIfError( dummyBmp->Create( TSize(0,0), EColor256 ) ); + CGulIcon* dummyIcon = CGulIcon::NewL( dummyBmp ); + CleanupStack::Pop( dummyBmp ); //ownership transfered + CleanupStack::PushL( dummyIcon ); + + CFbsBitmap* dummyBmp2 = new(ELeave) CFbsBitmap; + CleanupStack::PushL( dummyBmp2 ); + User::LeaveIfError( dummyBmp2->Create( TSize(0,0), EColor256 ) ); + CGulIcon* dummyIcon2 = CGulIcon::NewL( dummyBmp2 ); + CleanupStack::Pop( dummyBmp2 ); //ownership transfered + CleanupStack::PushL( dummyIcon2 ); + dummyArray->AppendL(dummyIcon); dummyArray->AppendL(dummyIcon2); ColumnData()->SetIconArray(dummyArray); - CleanupStack::Pop(3); + CleanupStack::Pop( dummyIcon2 ); + CleanupStack::Pop( dummyIcon ); + CleanupStack::Pop( dummyArray ); } // --------------------------------------------------------- @@ -151,53 +143,34 @@ // dispose icons delete iDefaultLogoImage; delete iDefaultLogoImageMask; - delete iAddWidgetBtnImage; - delete iAddWidgetBtnMask; - delete iAddWidgetBtnHighlightImage; - delete iAddWidgetBtnHighlightMask; } // --------------------------------------------------------- -// CWmListItemDrawer::ResizeDefaultBitmaps +// CWmListItemDrawer::UpdateItemHeight // --------------------------------------------------------- // -void CWmListItemDrawer::ResizeDefaultBitmaps() +void CWmListItemDrawer::UpdateItemHeight() { - TAknWindowLineLayout logoPane = - AknLayoutScalable_Apps::listrow_wgtman_pane_g1().LayoutLine(); - TAknWindowLineLayout addPane = - AknLayoutScalable_Apps::listrow_wgtman_pane_g2().LayoutLine(); - TAknLayoutRect layoutRect; - TRect rect = TRect( ItemCellSize() ); - layoutRect.LayoutRect( rect, logoPane ); - - // RESIZE DEFAULT LOGO BITMAPS ACCORDING TO LAYOUT - TSize size = layoutRect.Rect().Size(); - AknIconUtils::SetSize( - iDefaultLogoImage, size, EAspectRatioPreserved ); - AknIconUtils::SetSize( - iDefaultLogoImageMask, size, EAspectRatioPreserved ); - - // RESIZE ADD BTN BITMAPS ACCORDING TO LAYOUT - layoutRect.LayoutRect( rect, addPane ); - size = layoutRect.Rect().Size(); - AknIconUtils::SetSize( - iAddWidgetBtnImage, size, EAspectRatioPreserved ); - AknIconUtils::SetSize( - iAddWidgetBtnMask, size, EAspectRatioPreserved ); - AknIconUtils::SetSize( - iAddWidgetBtnHighlightImage, size, EAspectRatioPreserved ); - AknIconUtils::SetSize( - iAddWidgetBtnHighlightMask, size, EAspectRatioPreserved ); + // sets item height according to layout + TAknWindowLineLayout listPane = AknLayoutScalable_Apps + ::list_wgtman_pane().LayoutLine(); + TAknLayoutRect listPaneRect; + listPaneRect.LayoutRect( iListBox->Rect(), listPane ); + TAknWindowLineLayout listRowPane = AknLayoutScalable_Apps + ::listrow_wgtman_pane().LayoutLine(); + TAknLayoutRect listRowPaneRect; + listRowPaneRect.LayoutRect( listPaneRect.Rect(), listRowPane ); + TRAP_IGNORE( iListBox->SetItemHeightL( listRowPaneRect.Rect().Height() ); ); + iListBox->View()->ItemDrawer()->SetItemCellSize( listRowPaneRect.Rect().Size() ); } - + // --------------------------------------------------------- // CWmListItemDrawer::DrawItem // --------------------------------------------------------- // void CWmListItemDrawer::DrawItem( TInt aItemIndex, TPoint aItemRectPos, - TBool aItemIsSelected, TBool aItemIsCurrent, - TBool aViewIsEmphasized, TBool aViewIsDimmed ) const + TBool /*aItemIsSelected*/, TBool aItemIsCurrent, + TBool /*aViewIsEmphasized*/, TBool aViewIsDimmed ) const { TSize cellSize = ItemCellSize(); @@ -205,107 +178,91 @@ // Get graphics context which is used for drawing. CWindowGc& gc = *Gc(); MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - TInt selectedIndex = iListBox->CurrentItemIndex(); - TBool isInFocus = ( selectedIndex == aItemIndex ); - TBool listFocused = iListBox->IsFocused(); + TBool highlightEnabled = !( iListBox->ItemDrawer()->Flags() & + CListItemDrawer::ESingleClickDisabledHighlight ); + TBool listFocused = ((iListBox->IsFocused() && !aViewIsDimmed) ? ETrue : EFalse); TRect itemRect = TRect( aItemRectPos, cellSize ); - - if ( isInFocus && listFocused ) + + CFormattedCellListBoxItemDrawer::DrawEmptyItem( + aItemIndex, aItemRectPos, aViewIsDimmed ); + + if ( aItemIsCurrent && listFocused && highlightEnabled ) { - // force baseclass to draw highlight and animation for this item - CFormattedCellListBoxItemDrawer::DrawItemText( - aItemIndex, itemRect, - aItemIsCurrent, aViewIsEmphasized, - ( isInFocus || aItemIsSelected ) ); + TRect innerRect( itemRect ); + const TInt highlightOffset = 2; + innerRect.Shrink( highlightOffset, highlightOffset ); - if ( iListBox->PressedDown() ) - { - TRect innerRect( itemRect ); - const TInt highlightOffset = 3; - innerRect.Shrink( highlightOffset, highlightOffset ); - AknsDrawUtils::DrawFrame( skin, - gc, - itemRect, - innerRect, - KAknsIIDQsnFrListPressed, - KAknsIIDQsnFrListCenterPressed ); - } + AknsDrawUtils::DrawFrame( skin, + gc, + itemRect, + innerRect, + KAknsIIDQsnFrList, + KAknsIIDQsnFrListCenter ); } - else - { - // to prevent item staying highlighted when list isn't focused. - CFormattedCellListBoxItemDrawer::DrawEmptyItem( - aItemIndex, aItemRectPos, aViewIsDimmed ); - } - - // DRAW LOGO CFbsBitmap* bitmap = const_cast(wData.LogoImage()); CFbsBitmap* mask = const_cast(wData.LogoImageMask()); TAknLayoutRect logoLayout; logoLayout.LayoutRect( itemRect, AknLayoutScalable_Apps::listrow_wgtman_pane_g1().LayoutLine() ); - - if ( !bitmap && !wData.IsPrepairingLogo() ) + if ( ( !bitmap || !mask ) && iDefaultLogoImage && iDefaultLogoImageMask ) { - logoLayout.DrawImage( gc, iDefaultLogoImage, iDefaultLogoImageMask ); + // real logo missing use default + TSize size = logoLayout.Rect().Size(); + if ( iDefaultLogoImage->SizeInPixels() != size ) + { + // Resize default icons only when they are really needed + AknIconUtils::SetSize( + iDefaultLogoImage, size, EAspectRatioPreserved ); + AknIconUtils::SetSize( + iDefaultLogoImageMask, size, EAspectRatioPreserved ); + } + + gc.DrawBitmapMasked( logoLayout.Rect(), + iDefaultLogoImage, + TRect(TPoint(0, 0), iDefaultLogoImage->SizeInPixels()), + iDefaultLogoImageMask, + EFalse ); } else if( bitmap && mask ) { - logoLayout.DrawImage( gc, bitmap, mask ); + gc.DrawBitmapMasked( logoLayout.Rect(), + bitmap, + TRect(TPoint(0, 0), bitmap->SizeInPixels()), + mask, + ETrue ); } + // DRAW NAME TRgb textColor; - TAknsQsnTextColorsIndex index = ( isInFocus && listFocused )? + TAknsQsnTextColorsIndex index = + ( aItemIsCurrent && listFocused && highlightEnabled )? EAknsCIQsnTextColorsCG10 : EAknsCIQsnTextColorsCG6; AknsUtils::GetCachedColor( skin, textColor, KAknsIIDQsnTextColors, index ); - // DRAW TEXT - gc.UseFont( iFont ); - gc.SetPenColor( textColor ); - gc.SetPenSize( TSize(2,2) ); - - TAknTextLineLayout titleTextLayout = - AknLayoutScalable_Apps::listrow_wgtman_pane_t1().LayoutLine(); + TAknTextLineLayout titleTextLayout; + if ( !wData.IsUninstalling() ) + { + // centered 1 row layout + titleTextLayout = + AknLayoutScalable_Apps::listrow_wgtman_pane_t1(1).LayoutLine(); + } + else + { + // 2 row layout for uninstalling + titleTextLayout = + AknLayoutScalable_Apps::listrow_wgtman_pane_t1(0).LayoutLine(); + } TAknLayoutText textLayoutTitle; textLayoutTitle.LayoutText( itemRect, titleTextLayout ); textLayoutTitle.DrawText( gc, wData.Name(), ETrue, textColor ); - if ( !wData.IsUninstalling() && - wData.HsContentInfo().CanBeAdded() ) + if ( wData.IsUninstalling() ) { - // DRAW ADD BUTTON - TAknLayoutRect addButtonLayout; - addButtonLayout.LayoutRect( itemRect, - AknLayoutScalable_Apps::listrow_wgtman_pane_g2().LayoutLine() ); - if ( isInFocus && listFocused ) - { - addButtonLayout.DrawImage( gc, - iAddWidgetBtnHighlightImage, iAddWidgetBtnHighlightMask ); - } - else - { - addButtonLayout.DrawImage( gc, - iAddWidgetBtnImage, iAddWidgetBtnMask ); - } - } - - if ( !wData.IsUninstalling() ) - { - TAknTextLineLayout descTextLayout = - AknLayoutScalable_Apps::listrow_wgtman_pane_t2().LayoutLine(); - gc.SetPenSize(TSize(1,1)); - // DRAW DESCRIPTION TEXT - TAknLayoutText textLayoutDes; - textLayoutDes.LayoutText( itemRect, descTextLayout ); - textLayoutDes.DrawText( gc, wData.Description(), ETrue, textColor ); - } - else - { - // draw animation + // DRAW UNINSTALL ANIMATION TAknLayoutRect animationLayout; animationLayout.LayoutRect( itemRect, AknLayoutScalable_Apps::wait_bar_pane_cp09().LayoutLine() ); @@ -319,7 +276,6 @@ animationLayout.DrawImage( gc, animBitmap, animMask ); } } - gc.DiscardFont(); } // --------------------------------------------------------- @@ -341,73 +297,6 @@ } // --------------------------------------------------------- -// CWmListItemDrawer::HandleSkinChanged -// --------------------------------------------------------- -// -void CWmListItemDrawer::HandleSkinChanged() - { - CFbsBitmap* addWidgetBtnImage( NULL ); - CFbsBitmap* addWidgetBtnMask( NULL ); - CFbsBitmap* addWidgetBtnHighlightImage( NULL ); - CFbsBitmap* addWidgetBtnHighlightMask( NULL ); - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - - TRAPD( err, - AknsUtils::CreateColorIconLC( - skin, - KAknsIIDQgnIndiWmAdd, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6, - addWidgetBtnImage, - addWidgetBtnMask, - iWmPlugin.ResourceLoader().IconFilePath(), - EMbmWidgetmanagerAdd_widget_button, - EMbmWidgetmanagerAdd_widget_button_mask, - KRgbBlack ); - - AknsUtils::CreateColorIconLC( - skin, - KAknsIIDQgnIndiWmAdd, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG10, - addWidgetBtnHighlightImage, - addWidgetBtnHighlightMask, - iWmPlugin.ResourceLoader().IconFilePath(), - EMbmWidgetmanagerAdd_widget_button, - EMbmWidgetmanagerAdd_widget_button_mask, - KRgbWhite ); - - CleanupStack::Pop( 4 ); // pop icons - ); - - if ( KErrNone == err ) - { - // delete old icons - delete iAddWidgetBtnImage; - iAddWidgetBtnImage = NULL; - delete iAddWidgetBtnMask; - iAddWidgetBtnMask = NULL; - delete iAddWidgetBtnHighlightImage; - iAddWidgetBtnHighlightImage = NULL; - delete iAddWidgetBtnHighlightMask; - iAddWidgetBtnHighlightMask = NULL; - - // transfer ownership - iAddWidgetBtnImage = addWidgetBtnImage; - addWidgetBtnImage = NULL; - iAddWidgetBtnMask = addWidgetBtnMask; - addWidgetBtnMask = NULL; - iAddWidgetBtnHighlightImage = addWidgetBtnHighlightImage; - addWidgetBtnHighlightImage = NULL; - iAddWidgetBtnHighlightMask = addWidgetBtnHighlightMask; - addWidgetBtnHighlightMask = NULL; - - // resize new created icons - ResizeDefaultBitmaps(); - } - } - -// --------------------------------------------------------- // CWmListBox::NewL // --------------------------------------------------------- // @@ -433,7 +322,6 @@ iWmPlugin( aWmPlugin ) { iFindPaneIsVisible = EFalse; - iPressedDown = EFalse; iLogoSize = TSize( 0, 0); } @@ -443,7 +331,8 @@ // CWmListBox::~CWmListBox() { - iWidgetDatas.ResetAndDestroy(); + iVisibleWidgetArray.ResetAndDestroy(); + iOrderDataArray.ResetAndDestroy(); } // --------------------------------------------------------- @@ -459,7 +348,7 @@ SetContainerWindowL( *aParent ); // set model point to the widgets array - Model()->SetItemTextArray( &iWidgetDatas ); + Model()->SetItemTextArray( &iVisibleWidgetArray ); Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); // set empty-text to null @@ -475,7 +364,7 @@ CWmWidgetData* CWmListBox::WidgetData() { TInt index = CurrentListBoxItemIndex(); - return (index>=0 ? iWidgetDatas[index] : NULL); + return (index>=0 ? iVisibleWidgetArray[index] : NULL); } // --------------------------------------------------------- @@ -484,7 +373,7 @@ // CWmWidgetData& CWmListBox::WidgetData( TInt aItemIndex ) { - return *iWidgetDatas[ RealIndex( aItemIndex ) ]; + return *iVisibleWidgetArray[ RealIndex( aItemIndex ) ]; } // --------------------------------------------------------- @@ -494,10 +383,13 @@ void CWmListBox::AddWidgetDataL( CWmWidgetData* aWidgetData, TBool aRedraw ) { - aWidgetData->SetObserver( this ); - iWidgetDatas.InsertInOrderAllowRepeatsL( aWidgetData, + if ( aWidgetData ) + { + aWidgetData->SetObserver( this ); + iVisibleWidgetArray.InsertInOrderAllowRepeatsL( aWidgetData, SortOrder(EStoredOrder) ); - if ( aRedraw ) { HandleItemAdditionL(); } + if ( aRedraw ) { HandleItemAdditionL(); } + } } // --------------------------------------------------------- @@ -509,12 +401,25 @@ TInt realIndex = RealIndex( aItemIndex ); TBool current = ( aItemIndex == CurrentItemIndex() ); // remove widget data - CWmWidgetData* data = iWidgetDatas[realIndex]; - iWidgetDatas.Remove( realIndex ); + CWmWidgetData* data = iVisibleWidgetArray[realIndex]; + iVisibleWidgetArray.Remove( realIndex ); // reorganise TRAP_IGNORE( AknListBoxUtils::HandleItemRemovalAndPositionHighlightL( this, realIndex, current ) ); + + // Remove item from order array + for ( TInt i = 0; i < iOrderDataArray.Count(); i++ ) + { + CWmWidgetOrderData* order = iOrderDataArray[i]; + if ( order->EqualsTo( data->Uid(), data->PublisherId() ) ) + { + iOrderDataArray.Remove( i ); + delete order; + order = NULL; + break; + } + } // delete now delete data; @@ -538,10 +443,10 @@ // CWmListBox::SetSortOrderL // --------------------------------------------------------- // -void CWmListBox::SetSortOrderL( TSortOrder aOrder ) +void CWmListBox::DoSortToVisibleArray( TSortOrder aOrder ) { // now sort the existing data - iWidgetDatas.Sort( SortOrder( aOrder ) ); + iVisibleWidgetArray.Sort( SortOrder( aOrder ) ); DrawNow(); } @@ -570,23 +475,9 @@ { iLogoSize = TSize( 0, 0); iLogoSize = LogoSize(); - for ( TInt i=0; iReCreateLogo( iLogoSize ); - } - } - -// --------------------------------------------------------- -// CWmListBox::HandleSkinChanged -// --------------------------------------------------------- -// -void CWmListBox::HandleSkinChanged() - { - CWmListItemDrawer* itemDrawer = - static_cast ( iItemDrawer ); - if ( itemDrawer ) - { - itemDrawer->HandleSkinChanged(); + iVisibleWidgetArray[i]->UpdateLogo( iLogoSize, EFalse ); } } @@ -599,7 +490,7 @@ if ( !iFindPaneIsVisible ) { // spontaneous change in the model. Cause table to redraw - TInt index = iWidgetDatas.Find( aWidgetData ); + TInt index = iVisibleWidgetArray.Find( aWidgetData ); if ( index >= 0 ) { // redraw item. @@ -672,7 +563,7 @@ static_cast ( iItemDrawer ); if ( itemDrawer ) { - return itemDrawer->ResizeDefaultBitmaps(); + itemDrawer->UpdateItemHeight(); } } @@ -690,39 +581,6 @@ } // --------------------------------------------------------- -// CWmListBox::HandlePointerEventL -// --------------------------------------------------------- -// -void CWmListBox::HandlePointerEventL( const TPointerEvent& aPointerEvent ) - { - CAknDouble2LargeStyleListBox::HandlePointerEventL( aPointerEvent ); - - // Check if pointer is down ( needed for drawing correct hightlight frame ) - if ( Rect().Contains( aPointerEvent.iPosition ) ) - { - 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 ); - } - } - } - } - -// --------------------------------------------------------- // CWmListBox::LogoSize // --------------------------------------------------------- // @@ -774,5 +632,53 @@ return NULL; } +// --------------------------------------------------------- +// CWmListBox::SortOrderToOrderData +// --------------------------------------------------------- +// +TLinearOrder CWmListBox::SortOrderToOrderData( TSortOrder aOrder ) + { + if ( aOrder == EStoredOrder ) + { + return TLinearOrder( + CWmWidgetOrderData::CompareByPersistentWidgetOrder ); + } + else + { + return TLinearOrder( + CWmWidgetOrderData::CompareByName ); + } + } + +// --------------------------------------------------------- +// CWmListBox::SetSortOrderToOrderDataL +// --------------------------------------------------------- +// +void CWmListBox::DoSortToOrderData( TSortOrder aOrder ) + { + iOrderDataArray.Sort( SortOrderToOrderData( aOrder ) ); + } + +// --------------------------------------------------------- +// CWmListBox::AddWidgetDataL +// --------------------------------------------------------- +// +void CWmListBox::AddOrderDataL( CWmWidgetOrderData* aOrderData ) + { + if ( aOrderData ) + { + iOrderDataArray.InsertInOrderAllowRepeatsL( aOrderData, + SortOrderToOrderData( EStoredOrder ) ); + } + } + +// --------------------------------------------------------- +// CWmListBox::OrderData +// --------------------------------------------------------- +// +CWmWidgetOrderData* CWmListBox::OrderData( TInt aItemIndex ) + { + return iOrderDataArray[ aItemIndex ]; + } // End of File diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wmmaincontainer.cpp --- a/idlehomescreen/widgetmanager/src/wmmaincontainer.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmmaincontainer.cpp Wed May 12 13:22:51 2010 +0300 @@ -52,6 +52,7 @@ #include // HlpLauncher #include #include +#include #include "wmcommon.h" #include "wmplugin.h" @@ -67,6 +68,9 @@ #include "wmconfiguration.h" #include "wminstaller.h" +#include // content control api +#include // content control api + // CONSTANTS const TInt KTextLimit = 40; // Text-limit for find-field const TInt KMinWidgets = 1; // minimum number of widgets to show findpane @@ -92,9 +96,13 @@ // CWmMainContainer::~CWmMainContainer() { + TRAP_IGNORE(DeactivateFindPaneL(EFalse)); + + delete iWidgetLoader; + RemoveCtrlsFromStack(); Components().ResetAndDestroy(); - delete iWidgetLoader; + iWidgetsList = NULL; iPortalButtonOne = NULL; iPortalButtonTwo = NULL; @@ -219,8 +227,18 @@ ::wgtman_btn_pane( variety ).LayoutLine(); TAknWindowLineLayout operatorBtnLayout = AknLayoutScalable_Apps ::wgtman_btn_pane_cp_01( variety ).LayoutLine(); - AknLayoutUtils::LayoutControl( iPortalButtonOne, rect, oviBtnLayout ); - AknLayoutUtils::LayoutControl( iPortalButtonTwo, rect, operatorBtnLayout ); + + // button placement + if ( iConfiguration->PortalButtonsMirrored() ) + { + AknLayoutUtils::LayoutControl( iPortalButtonOne, rect, operatorBtnLayout ); + AknLayoutUtils::LayoutControl( iPortalButtonTwo, rect, oviBtnLayout ); + } + else + { + AknLayoutUtils::LayoutControl( iPortalButtonOne, rect, oviBtnLayout ); + AknLayoutUtils::LayoutControl( iPortalButtonTwo, rect, operatorBtnLayout ); + } } // layout iWidgetsList @@ -253,14 +271,17 @@ // This is a bug fix for ou1cimx1#217716 & ou1cimx1#217667. // For some weird reason homescreen is genarating one extra EEventKey - // when using Nokia SU-8W bluetooth keyboard & backspace key. This if is to + // when using bluetooth keyboard & backspace key. This if is to // ignore that event. Extra event allways has iModifiers set to - // EModifierAutorepeatable. + // EModifierAutorepeatable, EModifierKeyboardExtend and + // EModifierNumLock. if ( aType == EEventKey && - aKeyEvent.iScanCode == EStdKeyBackspace && - aKeyEvent.iModifiers == EModifierAutorepeatable ) + aKeyEvent.iScanCode == EStdKeyBackspace && + aKeyEvent.iModifiers&EModifierKeyboardExtend && + aKeyEvent.iModifiers&EModifierNumLock && + aKeyEvent.iModifiers&EModifierAutorepeatable ) { - return EKeyWasNotConsumed; + return EKeyWasConsumed; } // Handle search keyevent @@ -295,6 +316,10 @@ return EKeyWasConsumed; } +// --------------------------------------------------------- +// CWmMainContainer::HandleSearchKeyEventL +// --------------------------------------------------------- +// TKeyResponse CWmMainContainer::HandleSearchKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) @@ -306,7 +331,7 @@ aKeyEvent.iScanCode < EStdKeyF1 && TChar( aKeyEvent.iScanCode ).IsAlphaDigit() ) { - ActivateFindPaneL(); + ActivateFindPaneL( EFalse ); if ( iFindPaneIsVisible ) { @@ -346,6 +371,10 @@ return keyResponse; } +// --------------------------------------------------------- +// CWmMainContainer::HandleListKeyEventL +// --------------------------------------------------------- +// TKeyResponse CWmMainContainer::HandleListKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) @@ -382,6 +411,10 @@ return keyResponse; } +// --------------------------------------------------------- +// CWmMainContainer::HandleButtonKeyEventL +// --------------------------------------------------------- +// TKeyResponse CWmMainContainer::HandleButtonKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) @@ -426,7 +459,7 @@ { // widget list top -> up -> ovi button (portrait) if ( aType == EEventKey ) - SetFocusToPortalButton( 0 ); + SetFocusToPortalButton( OperatorButtonHigherPriority ( 0 ) ); keyResponse = EKeyWasConsumed; } else if ( !iLandscape && @@ -436,7 +469,7 @@ { // widget list bottom -> down -> ovi button (portrait) if ( aType == EEventKey ) - SetFocusToPortalButton( 0 ); + SetFocusToPortalButton( OperatorButtonHigherPriority ( 0 ) ); keyResponse = EKeyWasConsumed; } else if ( iLandscape && !iMirrored && @@ -444,7 +477,7 @@ { // widget list -> right -> ovi button (landscape normal) if ( aType == EEventKey ) - SetFocusToPortalButton( 0 ); + SetFocusToPortalButton( OperatorButtonHigherPriority ( 0 ) ); keyResponse = EKeyWasConsumed; } else if ( iLandscape && iMirrored && @@ -452,7 +485,7 @@ { // widget list -> left -> ovi button (landscape mirrored) if ( aType == EEventKey ) - SetFocusToPortalButton( 0 ); + SetFocusToPortalButton( OperatorButtonHigherPriority ( 0 ) ); keyResponse = EKeyWasConsumed; } } @@ -478,8 +511,20 @@ keyResponse = EKeyWasConsumed; } else if ( !iLandscape && !iMirrored && + aKeyEvent.iScanCode == EStdKeyLeftArrow && + iConfiguration->PortalButtonCount() > 1 && + iConfiguration->PortalButtonsMirrored() ) + { + // right portal -> left -> left portal + // (portrait, operator button higher priority ) + if ( aType == EEventKey ) + SetFocusToPortalButton( 1 ); + keyResponse = EKeyWasConsumed; + } + else if ( !iLandscape && !iMirrored && aKeyEvent.iScanCode == EStdKeyRightArrow && - iConfiguration->PortalButtonCount() > 1 ) + iConfiguration->PortalButtonCount() > 1 && + !iConfiguration->PortalButtonsMirrored() ) { // left portal -> right -> right portal (portrait normal) if ( aType == EEventKey ) @@ -487,8 +532,19 @@ keyResponse = EKeyWasConsumed; } else if ( !iLandscape && iMirrored && + aKeyEvent.iScanCode == EStdKeyRightArrow && + iConfiguration->PortalButtonCount() > 1 && + iConfiguration->PortalButtonsMirrored() ) + { + // right portal -> left -> left portal (portrait mirrored) + if ( aType == EEventKey ) + SetFocusToPortalButton( 1 ); + keyResponse = EKeyWasConsumed; + } + else if ( !iLandscape && iMirrored && aKeyEvent.iScanCode == EStdKeyLeftArrow && - iConfiguration->PortalButtonCount() > 1 ) + iConfiguration->PortalButtonCount() > 1 && + !iConfiguration->PortalButtonsMirrored() ) { // right portal -> left -> left portal (portrait mirrored) if ( aType == EEventKey ) @@ -512,8 +568,20 @@ keyResponse = EKeyWasConsumed; } else if ( iLandscape && + aKeyEvent.iScanCode == EStdKeyUpArrow && + iConfiguration->PortalButtonCount() > 1 && + iConfiguration->PortalButtonsMirrored() ) + { + // lower portal -> up -> upper portal + // (landscape, operator button higher priority ) + if ( aType == EEventKey ) + SetFocusToPortalButton( 1 ); + keyResponse = EKeyWasConsumed; + } + else if ( iLandscape && aKeyEvent.iScanCode == EStdKeyDownArrow && - iConfiguration->PortalButtonCount() > 1 ) + iConfiguration->PortalButtonCount() > 1 && + !iConfiguration->PortalButtonsMirrored() ) { // upper portal -> down -> lower portal (landscape) if ( aType == EEventKey ) @@ -543,8 +611,20 @@ keyResponse = EKeyWasConsumed; } else if ( !iLandscape && !iMirrored && + aKeyEvent.iScanCode == EStdKeyRightArrow && + iConfiguration->PortalButtonCount() > 1 && + iConfiguration->PortalButtonsMirrored() ) + { + // left portal -> right -> right portal + // (portrait, operator button higher priority ) + if ( aType == EEventKey ) + SetFocusToPortalButton( 0 ); + keyResponse = EKeyWasConsumed; + } + else if ( !iLandscape && !iMirrored && aKeyEvent.iScanCode == EStdKeyLeftArrow && - iConfiguration->PortalButtonCount() > 1 ) + iConfiguration->PortalButtonCount() > 1 && + !iConfiguration->PortalButtonsMirrored() ) { // right portal -> left -> left portal (portrait normal) if ( aType == EEventKey ) @@ -552,8 +632,19 @@ keyResponse = EKeyWasConsumed; } else if ( !iLandscape && iMirrored && + aKeyEvent.iScanCode == EStdKeyLeftArrow && + iConfiguration->PortalButtonCount() > 1 && + iConfiguration->PortalButtonsMirrored() ) + { + // left portal -> right -> right portal (portrait mirrored) + if ( aType == EEventKey ) + SetFocusToPortalButton( 0 ); + keyResponse = EKeyWasConsumed; + } + else if ( !iLandscape && iMirrored && aKeyEvent.iScanCode == EStdKeyRightArrow && - iConfiguration->PortalButtonCount() > 1 ) + iConfiguration->PortalButtonCount() > 1 && + !iConfiguration->PortalButtonsMirrored() ) { // left portal -> right -> right portal (portrait mirrored) if ( aType == EEventKey ) @@ -577,7 +668,18 @@ keyResponse = EKeyWasConsumed; } else if ( iLandscape && - aKeyEvent.iScanCode == EStdKeyUpArrow ) + aKeyEvent.iScanCode == EStdKeyDownArrow && + iConfiguration->PortalButtonsMirrored() ) + { + // upper portal -> down -> lower portal + // ( landscape operator button higher priority ) + if ( aType == EEventKey ) + SetFocusToPortalButton( 0 ); + keyResponse = EKeyWasConsumed; + } + else if ( iLandscape && + aKeyEvent.iScanCode == EStdKeyUpArrow && + !iConfiguration->PortalButtonsMirrored() ) { // lower portal -> up -> upper portal (landscape) if ( aType == EEventKey ) @@ -591,20 +693,42 @@ // focus is NOWHERE // ------------------------------------ if ( aKeyEvent.iScanCode == EStdKeyUpArrow || - aKeyEvent.iScanCode == EStdKeyDownArrow || - aKeyEvent.iScanCode == EStdKeyLeftArrow || - aKeyEvent.iScanCode == EStdKeyRightArrow ) + aKeyEvent.iScanCode == EStdKeyDownArrow ) { // no focus -> key hit -> focus list if ( aType == EEventKey ) + { SetFocusToWidgetList(); - keyResponse = EKeyWasConsumed; + keyResponse = EKeyWasNotConsumed; + } } } return keyResponse; } + +// --------------------------------------------------------- +// CWmMainContainer::OperatorButtonHigherPriority +// --------------------------------------------------------- +// +TInt CWmMainContainer::OperatorButtonHigherPriority( TInt aIndex ) + { + TInt ret = aIndex; + if ( iConfiguration->PortalButtonsMirrored() ) + { + if ( aIndex == 0 ) + { + ret = 1; + } + else if ( aIndex == 1 ) + { + ret = 0; + } + } + return ret; + } + // --------------------------------------------------------- // CWmMainContainer::SetFocusToPortalButton // --------------------------------------------------------- @@ -709,26 +833,15 @@ { if ( !iClosingDown ) { - + TBool eatEvent( EFalse ); + TPointerEvent event( aPointerEvent ); + if (aPointerEvent.iType == TPointerEvent::EButton1Down) { // Check if user clicked a child control CCoeControl* control = FindChildControlByPoint( aPointerEvent.iPosition ); if ( control && !control->IsFocused() ) { - // set focus to selected list box item. - if ( control == iWidgetsList ) - { - TInt itemIndex = iWidgetsList->CurrentListBoxItemIndex(); - TBool itemPointed = iWidgetsList->View()->XYPosToItemIndex( - aPointerEvent.iPosition, - itemIndex ); - if ( itemIndex >= 0 && itemPointed ) - { - iWidgetsList->SetCurrentItemIndex( itemIndex ); - } - } - // remove focus from ALL other child controls. CCoeControlArray::TCursor cursor = Components().Begin(); CCoeControl* c; @@ -746,9 +859,37 @@ // repaint DrawDeferred(); } + + // stylus popup should not be opened when uninstalling. + // ou1cimx1#302973 + if ( control == iWidgetsList && iWidgetsList->IsFocused() ) + { + TInt itemIndex = iWidgetsList->CurrentListBoxItemIndex(); + TBool itemPointed = iWidgetsList->View()->XYPosToItemIndex( + aPointerEvent.iPosition, + itemIndex ); + if ( itemIndex >= 0 && itemPointed ) + { + CWmWidgetData& data = iWidgetsList->WidgetData( itemIndex ); + if ( &data && data.IsUninstalling() ) + { + event.iType = TPointerEvent::EButton1Up; + eatEvent = ETrue; + } + } + } + } - - CCoeControl::HandlePointerEventL( aPointerEvent ); + + // set downkey event to base class + CCoeControl::HandlePointerEventL( aPointerEvent ); + + // send key up event if selected widget is being uninstalled. + // stylus popup shouldn't be displayed for this item. + if ( eatEvent ) + { + CCoeControl::HandlePointerEventL( event ); + } } } @@ -810,6 +951,17 @@ // void CWmMainContainer::StartLoadingWidgetsL() { + if ( iFindbox && iFindPaneIsVisible ) + { + iFindbox->ResetL(); + iFindbox->SetSearchTextL( KNullDesC ); + CAknFilteredTextListBoxModel* m = + static_cast ( iWidgetsList->Model() ); + if ( m && m->Filter() ) + { + m->Filter()->ResetFilteringL(); + } + } if ( !iWidgetLoader ) { // create the widget loader AO @@ -836,11 +988,6 @@ // notify widgetlist iWidgetsList->HandleLayoutChanged(); } - else if ( KAknsMessageSkinChange == aType ) - { - // notify widgetlist , colored add icon need to be updated - iWidgetsList->HandleSkinChanged(); - } } @@ -879,12 +1026,31 @@ TInt aControlId ) { Components().AppendLC( aControl, aControlId ); // Ownership transfered - CleanupStack::Pop(aControl); - iWmPlugin.ViewAppUi().AddToStackL( aControl ); + CleanupStack::Pop(aControl); + CAknView* view = iWmPlugin.ViewAppUi().View( + TUid::Uid(EWmMainContainerViewId) ); + if ( view ) + { + iWmPlugin.ViewAppUi().AddToStackL( *view, aControl ); + } + else + { + iWmPlugin.ViewAppUi().AddToStackL( aControl ); + } aControl->MakeVisible( ETrue ); } // --------------------------------------------------------- +// CWmMainContainer::IsLoadingWidgets +// --------------------------------------------------------- +// +TBool CWmMainContainer::IsLoadingWidgets() + { + return ((iWidgetLoader && iWidgetLoader->IsLoading()) ? + ETrue : EFalse); + } + +// --------------------------------------------------------- // CWmMainContainer::PortalSelected // --------------------------------------------------------- // @@ -929,7 +1095,8 @@ if ( WidgetSelected() && data && !data->IsUninstalling() ) { if ( data->WidgetType() == CWmWidgetData::ECps && - data->PublisherUid() != KNullUid ) + data->PublisherUid() != KNullUid && + data->WrtType() != CWmWidgetData::EUnIdentified ) { retVal = ETrue; } @@ -966,12 +1133,7 @@ // TBool CWmMainContainer::CanDoFind() { - TBool canDo( !iFindPaneIsVisible ); - if ( canDo ) - { - canDo = ( iFocusMode == EList || iFocusMode == ENowhere ); - } - return canDo; + return !iFindPaneIsVisible; } // --------------------------------------------------------- @@ -1009,41 +1171,21 @@ void CWmMainContainer::AddWidgetToHomeScreenL() { CWmWidgetData* data = iWidgetsList->WidgetData(); - if ( !iClosingDown && data && !data->IsUninstalling() ) + if ( !iClosingDown ) { if ( iFindbox && iFindPaneIsVisible ) { - DeactivateFindPaneL(); - } - - // set add to homescreen to be executed later - iWmPlugin.SetPostponedCommandL( - CWmPlugin::EAddToHomescreen, - data->HsContentInfo() ); - - // check if we can add any widgets to hs. - TBool hsContentFull = ETrue; - for ( TInt i=0; iWidgetDataCount(); i++ ) - { - CHsContentInfo& info = iWidgetsList->WidgetData(i).HsContentInfo(); - if ( info.CanBeAdded() ) - { - hsContentFull = EFalse; - break; - } + DeactivateFindPaneL(EFalse); } - // do not deactivate wm if wrt widget already exists on hs, - // instead of that show popup info note. - if ( CWmWidgetData::ECps == data->WidgetType() && - !data->HsContentInfo().CanBeAdded() && - !hsContentFull ) + if ( data && !data->IsUninstalling() ) { - iWmPlugin.ExecuteCommandL(); - } - else - { - iWmPlugin.Deactivate(); + // set add to homescreen to be executed later + iWmPlugin.SetPostponedCommandL( + CWmPlugin::EAddToHomescreen, + data->HsContentInfo() ); + + iWmPlugin.CloseView(); } } } @@ -1076,12 +1218,21 @@ // CWmMainContainer::ActivateFindPaneL // --------------------------------------------------------------------------- // -void CWmMainContainer::ActivateFindPaneL() +void CWmMainContainer::ActivateFindPaneL( TBool aActivateAdaptive ) { if ( iFindbox && !iFindPaneIsVisible && iWidgetsList->Model()->NumberOfItems() > KMinWidgets ) { - // enable filtering + // reset focus + ResetFocus(); + + // set column filter flag + TBitFlags32 bitFlag; + bitFlag.ClearAll(); // clear all columns + bitFlag.Assign( 1,1 ); // turn on column at index one + iFindbox->SetListColumnFilterFlags( bitFlag ); + + // enable filtering CAknFilteredTextListBoxModel* m = static_cast ( iWidgetsList->Model() ); if ( m ) @@ -1097,13 +1248,16 @@ iFindbox->ResetL(); iFindbox->SetSearchTextL( KNullDesC ); iFindbox->SetSkinEnabledL( ETrue ); - iFindPaneIsVisible = ETrue; iFindbox->MakeVisible( ETrue ); // layout listbox and findbox LayoutControls(); + if ( aActivateAdaptive ) + { + iFindbox->ShowAdaptiveSearchGrid(); + } iFindbox->SetFocus( ETrue ); iWidgetsList->SetFindPaneIsVisible( ETrue ); @@ -1121,10 +1275,10 @@ // CWmMainContainer::DeactivateFindPaneL // --------------------------------------------------------------------------- // -void CWmMainContainer::DeactivateFindPaneL() +void CWmMainContainer::DeactivateFindPaneL(TBool aLayout) { if( iFindbox && iFindPaneIsVisible ) - { + { // notify search field we're shutting down TKeyEvent keyEvent = { EKeyNo, EStdKeyNo, 0, 0 }; iFindbox->OfferKeyEventL( keyEvent, EEventKey ); @@ -1140,23 +1294,30 @@ m->Filter()->ResetFilteringL(); m->RemoveFilter(); } - - iFindbox->MakeVisible( EFalse ); - iFindbox->SetFocus( EFalse ); - iFindPaneIsVisible = EFalse; - iWidgetsList->SetFindPaneIsVisible( EFalse ); - LayoutControls(); - iWidgetsList->SetFocus( ETrue ); + ResetFocus(); - // set soft key set - CEikButtonGroupContainer* cbaGroup = - CEikButtonGroupContainer::Current(); - cbaGroup->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK__SELECT ); - cbaGroup->DrawNow(); - - UpdateFocusMode(); - DrawNow(); + iFindbox->MakeVisible( EFalse ); + iFindPaneIsVisible = EFalse; + iWidgetsList->SetFindPaneIsVisible( EFalse ); + + if (aLayout) //no need to draw UI if exiting list + { + LayoutControls(); + + // set soft key set + CEikButtonGroupContainer* cbaGroup = + CEikButtonGroupContainer::Current(); + TInt cbaResourceId = ( AknLayoutUtils::MSKEnabled() ? + R_AVKON_SOFTKEYS_OPTIONS_BACK__SELECT : + R_AVKON_SOFTKEYS_OPTIONS_BACK ); + + cbaGroup->SetCommandSetL( cbaResourceId ); + cbaGroup->DrawNow(); + + UpdateFocusMode(); + DrawNow(); + } } } @@ -1168,15 +1329,16 @@ { if ( iWidgetsList ) { - iWidgetsList->SetSortOrderL( CWmListBox::EAlphabetical ); + iWidgetsList->DoSortToVisibleArray( CWmListBox::EAlphabetical ); + iWidgetsList->DoSortToOrderData( CWmListBox::EAlphabetical ); //store changed list order CWmPersistentWidgetOrder* widgetOrder = CWmPersistentWidgetOrder::NewL( iWmPlugin.FileServer() ); CleanupStack::PushL( widgetOrder ); - widgetOrder->StoreL( iWidgetsList->WidgetDataArray() ); + widgetOrder->StoreL( iWidgetsList->OrderDataArray() ); + CleanupStack::PopAndDestroy( widgetOrder ); - } } @@ -1267,7 +1429,7 @@ // --------------------------------------------------------------------------- // void CWmMainContainer::RemoveCtrlsFromStack() - { + { for ( TInt i=0; i < CountComponentControls(); i++ ) { CCoeControl* ctl = ComponentControl( i ) ; @@ -1301,17 +1463,26 @@ { CWmWidgetData* data = iWidgetsList->WidgetData(); if ( data ) - { - const CFbsBitmap* logo = ( data->LogoImage() ) ? - data->LogoImage() : iWidgetsList->DefaultLogo(); - const CFbsBitmap* mask = ( data->LogoImageMask() ) ? - data->LogoImageMask() : iWidgetsList->DefaultMask(); + { + // Find out if HS is full + TBool hsFull = ETrue; + MHsContentController& controller = iWmPlugin.ContentController(); + CHsContentInfo* activeView = CHsContentInfo::NewLC(); + if ( controller.ActiveViewL( *activeView ) == KErrNone ) + { + hsFull = activeView->IsFull(); + } + CleanupStack::PopAndDestroy( activeView ); CWmDetailsDlg* dlg = CWmDetailsDlg::NewL( - data->Name(), data->Description(), - data->HsContentInfo().CanBeAdded(), - logo, mask ); - + data->Name(), + data->Description(), + !hsFull, + data->HsContentInfo().IconPath(), + *iWidgetsList->DefaultLogo(), + *iWidgetsList->DefaultMask() + ); + if ( dlg && dlg->ExecuteLD() == ECbaAddToHs ) { AddWidgetToHomeScreenL(); @@ -1375,6 +1546,71 @@ iWidgetsList->DrawNow(); } +// ---------------------------------------------------- +// CWmMainContainer::ProcessForegroundEvent +// ---------------------------------------------------- +// +void CWmMainContainer::ProcessForegroundEvent( TBool aForeground ) + { + if ( iFindbox && iFindPaneIsVisible && + iFindbox->IsFocused() ) + { + // keep focus & do nothing + } + else if ( aForeground ) + { + // set init state when wm comes to foreground. + // remove focus from all controls when activating view. + ResetFocus( EDrawNow ); + } + } + +// ---------------------------------------------------- +// CWmMainContainer::ResetFocus +// ---------------------------------------------------- +// +void CWmMainContainer::ResetFocus( TDrawNow aDrawNow ) + { + CCoeControl* control = NULL; + CCoeControlArray::TCursor cursor = Components().Begin(); + while( ( control = cursor.Control() ) != NULL ) + { + if( control->IsVisible() && control->IsFocused() ) + { + control->SetFocus( EFalse, aDrawNow ); + } + cursor.Next(); + } + UpdateFocusMode(); + } + +// ---------------------------------------------------- +// CWmMainContainer::WmListBox +// ---------------------------------------------------- +// +CWmListBox& CWmMainContainer::WmListBox() + { + return *iWidgetsList; + } + +// ---------------------------------------------------- +// CWmMainContainer::FocusChanged +// ---------------------------------------------------- +// +void CWmMainContainer::FocusChanged( TDrawNow aDrawNow ) + { + CCoeControl::FocusChanged( aDrawNow ); + + if ( iFindbox && iFindPaneIsVisible && + !iFindbox->IsFocused() && IsFocused() ) + { + // reset focus to find pane if its lost ( ou1cimx1#308019 ) + ResetFocus(); + iFindbox->SetFocus( ETrue ); + UpdateFocusMode(); + } + } + // End of File diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wmmaincontainerview.cpp --- a/idlehomescreen/widgetmanager/src/wmmaincontainerview.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmmaincontainerview.cpp Wed May 12 13:22:51 2010 +0300 @@ -27,14 +27,15 @@ #include #include #include +#include +#include #include "wmplugin.h" #include "widgetmanager.hrh" #include "wmmaincontainerview.h" #include "wmresourceloader.h" #include "wmmaincontainer.h" -#include - +#include "wmspbgcleaner.h" // --------------------------------------------------------- // CWmMainContainerView::CWmMainContainerView() @@ -45,6 +46,7 @@ iWmPlugin( aWmPlugin ) { iWmMainContainer = NULL; + iWmSpBgCleaner = NULL; } // --------------------------------------------------------- @@ -55,10 +57,18 @@ { if ( iWmMainContainer != NULL ) { - AppUi()->RemoveFromViewStack( *this, iWmMainContainer ); + AppUi()->RemoveFromStack( iWmMainContainer ); + delete iWmMainContainer; iWmMainContainer = NULL; } + + if ( iWmSpBgCleaner != NULL ) + { + AppUi()->RemoveFromStack( iWmSpBgCleaner ); + delete iWmSpBgCleaner; + iWmSpBgCleaner = NULL; + } } // --------------------------------------------------------- @@ -140,8 +150,14 @@ break; case EWmMainContainerViewBackMenuItemCommand: // flow through case EAknSoftkeyBack: - iWmPlugin.Deactivate(); + { + if ( iWmMainContainer && + !iWmMainContainer->IsLoadingWidgets() ) + { + iWmPlugin.CloseView(); + } break; + } case EWmMainContainerViewWiddetDetailsMenuItemCommand: HandleDetailsMenuItemSelectedL(); break; @@ -170,29 +186,50 @@ TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/ ) { - if ( iWmMainContainer == NULL ) - { - iWmMainContainer = CreateContainerL(); - iWmMainContainer->SetMopParent( this ); - AppUi()->AddToStackL( *this, iWmMainContainer ); - } - - SetupStatusPaneL(); - - iWmPlugin.MainViewActivated( aPrevViewId, iWmMainContainer ); + // setup status pane layout StatusPane()->SwitchLayoutL( - R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ); + R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ); + // disable transparancy + StatusPane()->EnableTransparent( EFalse ); + // apply changes StatusPane()->ApplyCurrentSettingsL(); + + // create container + if ( iWmSpBgCleaner == NULL ) + { + iWmSpBgCleaner = CWmSpBgCleaner::NewL(); + iWmSpBgCleaner->SetMopParent( this ); + AppUi()->AddToStackL( *this, iWmSpBgCleaner ); + } + + // title in status pane + SetTitleL(); + StatusPane()->DrawNow(); + + // update cba CEikButtonGroupContainer* bgc( Cba() ); - CEikCba* cba = static_cast< CEikCba* >( bgc->ButtonGroup() ); if ( cba ) { - + TInt cbaResourceId = ( AknLayoutUtils::MSKEnabled() ? + R_AVKON_SOFTKEYS_OPTIONS_BACK__SELECT : + R_AVKON_SOFTKEYS_OPTIONS_BACK ); + + cba->SetCommandSetL( cbaResourceId ); bgc->SetBoundingRect( TRect() ); cba->DrawNow(); } + + // create container + if ( iWmMainContainer == NULL ) + { + iWmMainContainer = CreateContainerL(); + iWmMainContainer->SetMopParent( this ); + AppUi()->AddToStackL( *this, iWmMainContainer ); + } + + iWmPlugin.MainViewActivated( aPrevViewId, iWmMainContainer ); } // --------------------------------------------------------- @@ -203,40 +240,25 @@ { if ( iWmMainContainer != NULL ) { - AppUi()->RemoveFromViewStack( *this, iWmMainContainer ); + AppUi()->RemoveFromStack( iWmMainContainer ); delete iWmMainContainer; iWmMainContainer = NULL; + iWmPlugin.MainViewDeactivated(); } - iWmPlugin.MainViewDeactivated(); + if ( iWmSpBgCleaner != NULL ) + { + AppUi()->RemoveFromStack( iWmSpBgCleaner ); + delete iWmSpBgCleaner; + iWmSpBgCleaner = NULL; + } } // --------------------------------------------------------- -// CWmMainContainerView::HandleStatusPaneSizeChange +// CWmMainContainerView::SetTitleL // --------------------------------------------------------- // -void CWmMainContainerView::HandleStatusPaneSizeChange() - { - CAknView::HandleStatusPaneSizeChange(); - - // this may fail, but we're not able to propagate exceptions here - TVwsViewId view; - AppUi()->GetActiveViewId( view ); - if ( view.iViewUid == Id() ) - { - if ( iWmMainContainer ) - { - iWmMainContainer->SetRect( AppUi()->ClientRect() ); - } - } - - } - -// --------------------------------------------------------- -// CWmMainContainerView::SetupStatusPaneL -// --------------------------------------------------------- -// -void CWmMainContainerView::SetupStatusPaneL() +void CWmMainContainerView::SetTitleL() { // setup the title pane TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle ); @@ -358,7 +380,7 @@ { if ( iWmMainContainer ) { - iWmMainContainer->ActivateFindPaneL(); + iWmMainContainer->ActivateFindPaneL( ETrue ); } return ETrue; } @@ -406,10 +428,23 @@ TBool CWmMainContainerView::HandleDeactivateFindPaneL() { if ( iWmMainContainer ) - { + { iWmMainContainer->DeactivateFindPaneL(); } return ETrue; } +// --------------------------------------------------------- +// CWmMainContainerView::HandleForegroundEventL +// --------------------------------------------------------- +// +void CWmMainContainerView::HandleForegroundEventL( TBool aForeground ) + { + CAknView::HandleForegroundEventL( aForeground ); + if ( iWmMainContainer ) + { + iWmMainContainer->ProcessForegroundEvent( aForeground ); + } + } + // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wmpersistentwidgetorder.cpp --- a/idlehomescreen/widgetmanager/src/wmpersistentwidgetorder.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmpersistentwidgetorder.cpp Wed May 12 13:22:51 2010 +0300 @@ -23,6 +23,7 @@ #include #include "wmwidgetdata.h" +#include "wmwidgetorderdata.h" #include "wmpersistentwidgetorder.h" // CONSTANTS @@ -67,6 +68,7 @@ CWmPersistentWidgetOrder::~CWmPersistentWidgetOrder() { CleanupArray(); + iTagArray.Close(); } // --------------------------------------------------------- @@ -107,39 +109,56 @@ // CWmPersistentWidgetOrder::StoreL // --------------------------------------------------------- // -void CWmPersistentWidgetOrder::StoreL( const RWidgetDataValues& aArray ) +void CWmPersistentWidgetOrder::StoreL( const ROrderArray& aArray ) { + // 1. create stream for storing the data to a file TFileName storeFileName; GetStoreFileNameL( storeFileName ); - CPermanentFileStore* fileStore = CPermanentFileStore::ReplaceLC( + CPermanentFileStore* fileStore = NULL; + fileStore = CPermanentFileStore::ReplaceLC( iFs, storeFileName, EFileWrite ); - fileStore->SetTypeL( KPermanentFileStoreLayoutUid ); - RStoreWriteStream writer; - TStreamId id = writer.CreateLC( *fileStore ); - // 2. write all content to the stream - writer.WriteInt32L( aArray.Count() ); - for( TInt i=0; iUid().iUid; - const TDesC16& publisherId = aArray[i]->HsContentInfo().PublisherId(); - writer.WriteInt32L( uid ); - writer.WriteInt32L( publisherId.Length() ); - writer.WriteL( publisherId, publisherId.Length() ); + fileStore->SetTypeL( KPermanentFileStoreLayoutUid ); + RStoreWriteStream writer; + TStreamId id = writer.CreateLC( *fileStore ); + + // 2. write all content to the stream + writer.WriteInt32L( aArray.Count() ); + for( TInt i=0; iUid().iUid; + const TDesC16& publisherId = data->PublisherId(); + writer.WriteInt32L( uid ); + writer.WriteInt32L( publisherId.Length() ); + writer.WriteL( publisherId, publisherId.Length() ); + + } + // 3. check available space and commit the stream + TInt streamsize = writer.Sink()->SizeL(); + TBool belowCriticalLevel = SysUtil::DiskSpaceBelowCriticalLevelL( + &iFs, streamsize, EDriveC ); + + if( !belowCriticalLevel ) + { + writer.CommitL(); + fileStore->SetRootL(id); + fileStore->CommitL(); + } + + // 4. cleanup + CleanupStack::PopAndDestroy( &writer ); + CleanupStack::PopAndDestroy( fileStore ); } - // 3. check available space and commit the stream - TInt streamsize = writer.Sink()->SizeL(); - TBool belowCriticalLevel = SysUtil::DiskSpaceBelowCriticalLevelL( - &iFs, streamsize, EDriveC ); - if( !belowCriticalLevel ) - { - writer.CommitL(); - fileStore->SetRootL(id); - fileStore->CommitL(); - } - // 4. cleanup - CleanupStack::PopAndDestroy( &writer ); - CleanupStack::PopAndDestroy( fileStore ); + } // --------------------------------------------------------- @@ -151,9 +170,9 @@ for( TInt i=0; iIsActive() ) { - 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(); - } - else - { - // 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 ) ); + iWmInstaller->Cancel(); } - // delete other members + // delete members delete iResourceLoader; delete iEffectManager; delete iPostponedContent; - delete iWait; - delete iWmInstaller; + delete iWmInstaller; } // --------------------------------------------------------- @@ -122,7 +86,8 @@ void CWmPlugin::ConstructL() { iWmMainContainer = NULL; - + iPostponedCommand = ENone; + // store static view app ui CEikonEnv* eikonEnv = CEikonEnv::Static(); if ( !eikonEnv ) User::Leave( KErrUnknown ); @@ -133,18 +98,14 @@ iFs = &eikonEnv->FsSession(); iResourceLoader = CWmResourceLoader::NewL( *eikonEnv ); iEffectManager = CWmEffectManager::NewL( *eikonEnv ); - - // wait object - iWait = new (ELeave) CActiveSchedulerWait(); - + iWmInstaller = CWmInstaller::NewL( *this ); + // main view CWmMainContainerView* mainView = CWmMainContainerView::NewL( *this ); CleanupStack::PushL( mainView ); iViewAppUi->AddViewL( mainView ); CleanupStack::Pop( mainView ); - - iWmInstaller = CWmInstaller::NewL(); } // --------------------------------------------------------- @@ -153,41 +114,95 @@ // void CWmPlugin::Activate() { - if ( !IsActive() && iHsContentController ) + CWmMainContainerView* view = static_cast( + iViewAppUi->View( TUid::Uid(EWmMainContainerViewId) ) ); + if ( !IsActive() && view && iHsContentController ) { + // stop displaying menubar before starting fullscreen effects + CEikMenuBar* menuBar = CEikonEnv::Static()->AppUiFactory()->MenuBar(); + if ( menuBar && menuBar->IsDisplayed() ) + { + menuBar->StopDisplayingMenuBar(); + } + TRAP_IGNORE( iEffectManager->BeginFullscreenEffectL( - KAppStartCommonDefaultStyle ); - iViewAppUi->ActivateLocalViewL( - TUid::Uid( EWmMainContainerViewId ) ); + KAppStartEffectStyle ); + iViewAppUi->ActivateLocalViewL( + TUid::Uid( EWmMainContainerViewId ) ); ); } } // --------------------------------------------------------- +// CWmPlugin::DeActivate +// --------------------------------------------------------- +// +void CWmPlugin::DeActivate() + { + iPostponedCommand = ENone; + iPreviousViewUid.iViewUid = KNullUid; + CWmMainContainerView* view = static_cast( + iViewAppUi->View( TUid::Uid(EWmMainContainerViewId) ) ); + if ( view ) { view->DoDeactivate(); } + } + +// --------------------------------------------------------- +// CWmPlugin::Views +// --------------------------------------------------------- +// +void CWmPlugin::Views( RPointerArray& aViews ) + { + // return view to be destroyed. + CAknView* view = iViewAppUi->View( + TUid::Uid(EWmMainContainerViewId) ); + if ( view ) + { + aViews.Append( view ); + } + } + +// --------------------------------------------------------- // CWmPlugin::IsActive // --------------------------------------------------------- // TBool CWmPlugin::IsActive() { - return ( iPreviousViewUid.iViewUid != KNullUid ); + TVwsViewId activeViewId(KNullUid,KNullUid); + if ( iViewAppUi->GetActiveViewId( activeViewId ) == KErrNone && + activeViewId.iViewUid == TUid::Uid( EWmMainContainerViewId ) ) + { + if ( iPreviousViewUid.iViewUid == KNullUid && + iViewAppUi->GetDefaultViewId( iPreviousViewUid ) != KErrNone ) + { + iPreviousViewUid.iAppUid = iViewAppUi->Application()->AppDllUid(); + iPreviousViewUid.iViewUid = TUid::Uid( 1 ); + } + return ETrue; + } + + return( iPreviousViewUid.iViewUid != KNullUid ); } // --------------------------------------------------------- -// CWmPlugin::Deactivate +// CWmPlugin::CloseView // --------------------------------------------------------- // -void CWmPlugin::Deactivate() +void CWmPlugin::CloseView() { if ( IsActive() ) { iWmMainContainer->SetClosingDown( ETrue ); - TRAP_IGNORE( + TRAPD( err, iEffectManager->BeginFullscreenEffectL( - KAppExitCommonDefaultStyle ); + KAppExitEffectStyle ); iViewAppUi->ActivateLocalViewL( iPreviousViewUid.iViewUid ); ); + if ( KErrNone != err ) + { + iWmMainContainer->SetClosingDown( EFalse ); + } } } @@ -196,17 +211,24 @@ // --------------------------------------------------------- // void CWmPlugin::MainViewActivated( - const TVwsViewId& aViewId, + const TVwsViewId& /*aViewId*/, CWmMainContainer* aWmMainContainer ) { - iPreviousViewUid = aViewId; + // previous view for Wm is always default view. + if ( iViewAppUi->GetDefaultViewId( iPreviousViewUid ) != KErrNone ) + { + // use default if we got wrong viewid as previous view + iPreviousViewUid.iAppUid = iViewAppUi->Application()->AppDllUid(); + iPreviousViewUid.iViewUid = TUid::Uid( 1 ); + } + iWmMainContainer = aWmMainContainer; iEffectManager->UiRendered(); iWmMainContainer->SetClosingDown( EFalse ); // Don't forward numeric keys to phone ForwardNumericKeysToPhone( EFalse ); - } + } // --------------------------------------------------------- // CWmPlugin::MainViewDeactivated @@ -219,14 +241,18 @@ iPreviousViewUid.iViewUid = KNullUid; iWmMainContainer = NULL; - if ( iEffectManager && !iWait->IsStarted() ) + if ( iEffectManager ) { iEffectManager->UiRendered(); } - TRAP_IGNORE( ExecuteCommandL(); ); - - if ( iWait->IsStarted() ) { iWait->AsyncStop(); } + TRAPD( err, ExecuteCommandL(); ); + if ( KErrNone != err ) + { + delete iPostponedContent; + iPostponedContent = NULL; + iPostponedCommand = ENone; + } } // --------------------------------------------------------- @@ -267,26 +293,8 @@ if ( iPostponedCommand == EAddToHomescreen ) { TInt err = ContentController().AddWidgetL( *iPostponedContent ); - if ( err == KHsErrorViewFull || - err == KHsErrorDoesNotFit ) - { - ResourceLoader().InfoPopupL( - R_QTN_HS_ADD_WIDGET_NO_SPACE_NOTE, KNullDesC ); - } - else if ( err == KHsErrorMaxInstanceCountExceeded ) - { - ResourceLoader().InfoPopupL( - R_QTN_HS_ADD_WIDGET_MAX_COUNT_NOTE, KNullDesC ); - } - else if ( err == KErrNoMemory ) - { - ResourceLoader().InfoPopupL( - R_QTN_HS_HS_MEMORY_FULL, KNullDesC ); - } - else if ( ( err != KErrNone ) && ( err != KErrDiskFull ) ) - { - ResourceLoader().ErrorPopup( err ); - } + if ( err != KErrNone ) + ShowErrorNoteL( err ); } iPostponedCommand = ENone; delete iPostponedContent; @@ -294,7 +302,32 @@ } // --------------------------------------------------------- -// CWmPlugin::MainViewDeactivated +// CWmPlugin::ShowErrorNoteL +// --------------------------------------------------------- +// +void CWmPlugin::ShowErrorNoteL( TInt aError ) + { + switch ( aError ) + { + case KHsErrorViewFull: + case KHsErrorDoesNotFit: + // Not enough space to add new widget to active page. + // Remove some content first. + ResourceLoader().InfoPopupL( + R_QTN_HS_ADD_WIDGET_NO_SPACE_NOTE, KNullDesC ); + break; + case KErrNoMemory: + case KErrDiskFull: + // do not show error note here to avoid multiple error notes + break; + default: + ResourceLoader().ErrorPopup( aError ); + break; + } + } + +// --------------------------------------------------------- +// CWmPlugin::ViewAppUi // --------------------------------------------------------- // CAknViewAppUi& CWmPlugin::ViewAppUi() @@ -303,7 +336,7 @@ } // --------------------------------------------------------- -// CWmPlugin::MainViewDeactivated +// CWmPlugin::ResourceLoader // --------------------------------------------------------- // CWmResourceLoader& CWmPlugin::ResourceLoader() @@ -312,7 +345,7 @@ } // --------------------------------------------------------- -// CWmPlugin::MainViewDeactivated +// CWmPlugin::ContentController // --------------------------------------------------------- // MHsContentController& CWmPlugin::ContentController() @@ -321,7 +354,7 @@ } // --------------------------------------------------------- -// CWmPlugin::MainViewDeactivated +// CWmPlugin::FileServer // --------------------------------------------------------- // RFs& CWmPlugin::FileServer() @@ -350,5 +383,30 @@ return *iWmInstaller; } +// --------------------------------------------------------- +// CWmPlugin::GetUnistalledWidget +// --------------------------------------------------------- +// +CWmWidgetData* CWmPlugin::GetUninstalledWidgetByUid( TUid aUid ) + { + CWmWidgetData* retVal = NULL; + if ( iWmMainContainer ) + { + const RWidgetDataValues& widgetArray = + iWmMainContainer->WmListBox().WidgetDataArray(); + for ( TInt i = 0; i < widgetArray.Count(); i++ ) + { + CWmWidgetData* widgetData = widgetArray[i]; + if ( widgetData->IsUninstalling() && + widgetData->PublisherUid() == aUid ) + { + retVal = widgetArray[i]; + break; + } + } + } + return retVal; + } + // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wmportalbutton.cpp --- a/idlehomescreen/widgetmanager/src/wmportalbutton.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmportalbutton.cpp Wed May 12 13:22:51 2010 +0300 @@ -30,17 +30,21 @@ #include #include #include // widgetreqistry +#include +#include +#include +#include - +#include "wmimageconverter.h" #include "wmportalbutton.h" #include "wmcommon.h" #include "wmplugin.h" #include "wmresourceloader.h" #include "wmmaincontainer.h" #include "wmconfiguration.h" +#include "wmprocessmonitor.h" // CONSTANTS -_LIT( KBrowserPrefix, "4 "); // MEMBER FUNCTIONS @@ -74,7 +78,7 @@ // --------------------------------------------------------- // CWmPortalButton::~CWmPortalButton() - { + { delete iButtonIcon; delete iButtonIconMask; @@ -82,6 +86,8 @@ // then it'll try accessing imageconverter after bitmap deletion // for de-reference open file count, so it should be deleted last. delete iImageConverter; + delete iProcessMonitor; + delete iBrowserLauncher; } // --------------------------------------------------------- @@ -96,6 +102,8 @@ { iButtonIcon = NULL; iButtonIconMask = NULL; + iProcessMonitor = NULL; + iBrowserLauncher = NULL; } // --------------------------------------------------------- @@ -119,200 +127,199 @@ // construct the button CAknButton::ConstructL( NULL, NULL, NULL, NULL, aText, KNullDesC, 0 ); - TAknsItemID frameId = KAknsIIDQgnHomeWmButton; - TAknsItemID frameCenterId = KAknsIIDQgnHomeWmButtonCenter; - TAknsItemID framePressedId = KAknsIIDQgnHomeWmButtonPressed; - TAknsItemID framePressedCenterId = KAknsIIDQgnHomeWmButtonPressedCenter; - - SetFocusing( ETrue ); - SetBackgroundIds( frameId, - framePressedId, - KAknsIIDQsnFrButtonInactive, - framePressedId, - KAknsIIDQsnFrButtonInactive ); SetFrameAndCenterIds( - frameId, - frameCenterId, - KAknsIIDDefault, - KAknsIIDDefault, - KAknsIIDDefault, - KAknsIIDDefault, - framePressedId, - framePressedCenterId, - KAknsIIDDefault, - KAknsIIDDefault ); + KAknsIIDQsnFrButtonNormal, + KAknsIIDQsnFrButtonCenterNormal, + KAknsIIDQsnFrButtonPressed, + KAknsIIDQsnFrButtonCenterPressed, + KAknsIIDQsnFrButtonInactive, + KAknsIIDQsnFrButtonCenterInactive, + KAknsIIDQsnFrButtonPressed, + KAknsIIDQsnFrButtonCenterPressed, + KAknsIIDQsnFrButtonInactive, + KAknsIIDQsnFrButtonCenterInactive ); // start image converter for the icon - iImageConverter = CWmImageConverter::NewL( this ); + iImageConverter = CWmImageConverter::NewL(); TSize iconsize( LayoutIconSize() ); iImageConverter->HandleIconString( - iconsize.iWidth, iconsize.iHeight, aIcon ); + iconsize, + aIcon, + iButtonIcon, + iButtonIconMask ); // observe our own press events SetObserver( this ); + SetFocusing( ETrue ); + SetRequestExit( ETrue ); // notification request for button up event + // ready to be drawn ActivateL(); } -// --------------------------------------------------------------------------- -// Runs HTTP method: (starts browser or brongs browser to foreground) -// --------------------------------------------------------------------------- -// -void TryRunHttpL( const TDesC& aParam ) - { - RApaLsSession session; - User::LeaveIfError( session.Connect() ); - CleanupClosePushL( session ); - - // browser start parameters - const TUid KOSSBrowserUidValue = { 0x10008D39 }; - HBufC* param = HBufC::NewLC( aParam.Length() + - KBrowserPrefix().Length() ); - - param->Des().Copy( KBrowserPrefix ); - param->Des().Append( aParam ); - - TUid id( KOSSBrowserUidValue ); - - TApaTaskList taskList( CEikonEnv::Static()->WsSession() ); - TApaTask task = taskList.FindApp( id ); - if( task.Exists() ) - { - task.BringToForeground(); - HBufC8* param8 = HBufC8::NewLC(param->Length()); - param8->Des().Append(*param); - task.SendMessage(TUid::Uid(0), *param8); // UID not used - CleanupStack::PopAndDestroy(param8); - } - else - { - if( !session.Handle() ) - { - User::LeaveIfError( session.Connect() ); - } - TThreadId thread; - User::LeaveIfError(session.StartDocument(*param, KOSSBrowserUidValue, thread)); - } - - CleanupStack::PopAndDestroy( param ); - CleanupStack::PopAndDestroy( &session ); - } - -// --------------------------------------------------------------------------- -// Runs WIDGET method: (launches given widget with parameters) -// --------------------------------------------------------------------------- -// -void TryRunWidgetL( const TDesC& aBundleId, const TDesC& aParam ) - { - RApaLsSession session; - User::LeaveIfError( session.Connect() ); - CleanupClosePushL( session ); - TApaAppInfo appInfo; - TUid launchUid; - - // Get widget uid - RWidgetRegistryClientSession widgetSession; - User::LeaveIfError( widgetSession.Connect() ); - CleanupClosePushL( widgetSession ); - launchUid.iUid = widgetSession.GetWidgetUidL( aBundleId ); - CleanupStack::PopAndDestroy( &widgetSession ); - - // prepare widget start params - User::LeaveIfError( session.GetAppInfo( appInfo, launchUid ) ); - CApaCommandLine* commandLine = CApaCommandLine::NewLC(); - commandLine->SetExecutableNameL( appInfo.iFullName ); - HBufC8* buf8 = HBufC8::NewLC( aParam.Length() ); - buf8->Des().Copy( aParam ); - - // do the launch - commandLine->SetTailEndL( *buf8 ); - User::LeaveIfError( session.StartApp( *commandLine ) ); - - CleanupStack::PopAndDestroy( buf8 ); - CleanupStack::PopAndDestroy( commandLine ); - CleanupStack::PopAndDestroy( &session ); - } - -// --------------------------------------------------------------------------- -// 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& aService, - const TDesC& aParam ) - { - // open portal according to the method. - if ( aMethod == CWmConfiguration::EHttp ) - { TryRunHttpL( aParam ); } - else if ( aMethod == CWmConfiguration::EWidget ) - { TryRunWidgetL( aService, aParam ); } - else if ( aMethod == CWmConfiguration::EApplication ) - { TryRunApplicationL( aService, aParam ); } - else - { User::Leave( KErrNotSupported ); } - } - -// --------------------------------------------------------------------------- -// Opens a portal. Called when user presses a portal button. tries the -// primary method, and if if fails, tries the secondary. If it fails, -// gives up. -// --------------------------------------------------------------------------- -// -void OpenPortalL( - CWmConfiguration& aConfiguration, TInt aPortalIndex ) - { - TRAPD( err, - TryOpenPortalL( - aConfiguration.PortalButtonPrimaryMethod( aPortalIndex ), - aConfiguration.PortalButtonPrimaryService( aPortalIndex ), - aConfiguration.PortalButtonPrimaryParams( aPortalIndex ) ); ); - if ( err != KErrNone ) - { - // if secondary method fails, leave will be propagated. - TryOpenPortalL( - aConfiguration.PortalButtonSecondaryMethod( aPortalIndex ), - aConfiguration.PortalButtonSecondaryService( aPortalIndex ), - aConfiguration.PortalButtonSecondaryParams( aPortalIndex ) ); - } - } - // --------------------------------------------------------- // CWmPortalButton::ExecuteL // --------------------------------------------------------- // void CWmPortalButton::ExecuteL() { - OpenPortalL( iWmMainContainer->Configuration(), iPortalButtonIndex ); + if ( iPortalButtonIndex == 0 ) + { + // OVI button + if ( !iProcessMonitor ) + { + iProcessMonitor = CWmProcessMonitor::NewL(); + } + // if process monitor is active laucher was allready started. + // this is for ignoring multiple button presses + if ( !iProcessMonitor->IsActive() ) + { + RunOviL( iWmMainContainer->Configuration() ); + } + } + else if ( iPortalButtonIndex == 1 ) + { + // OPERATOR button + // if this leaves it means we need to start browser + // becouse application info was not given + TRAPD( err, RunOperatorApplicationL( + iWmMainContainer->Configuration() ) ) + if ( err != KErrNone ) + { + StartBrowserL( + iWmMainContainer->Configuration().PortalButtonBrowserUrl( + iPortalButtonIndex ) ); + } + } + else + { + // Not supported + User::Leave( KErrGeneral ); + } + } + +// --------------------------------------------------------- +// CWmPortalButton::RunOviL +// --------------------------------------------------------- +// +void CWmPortalButton::RunOviL( CWmConfiguration& aConf ) + { + RApaLsSession session; + User::LeaveIfError( session.Connect() ); + CleanupClosePushL( session ); + + //get app info + TApaAppInfo appInfo; + TUid launchUid; + launchUid = aConf.PortalButtonClientUid( iPortalButtonIndex ); + + if ( session.GetAppInfo( appInfo, launchUid ) == KErrNone ) + { + // Form parameter + HBufC* param = HBufC::NewLC( aConf.PortalButtonClientParam( iPortalButtonIndex ).Length() ); + param->Des().Copy( aConf.PortalButtonClientParam( iPortalButtonIndex ) ); + + // do the launch + RProcess process; + User::LeaveIfError( process.Create( appInfo.iFullName, *param ) ); + + iProcessMonitor->Monitor( process ); + process.Resume(); + + CleanupStack::PopAndDestroy( param ); + } + + CleanupStack::PopAndDestroy( &session ); + } + +// --------------------------------------------------------- +// CWmPortalButton::StartBrowserL +// --------------------------------------------------------- +// +void CWmPortalButton::StartBrowserL( const TDesC& aUrl ) + { + // already running/or request launch or url is empty + if ( iBrowserLauncher || !aUrl.Length() ) { return; } + + _LIT( KUrlPrefix, "4 "); + HBufC* param = HBufC::NewLC( aUrl.Length() + KUrlPrefix().Length() ); + param->Des().Append( KUrlPrefix ); + param->Des().Append( aUrl ); + + // Create browser launcher + CBrowserLauncher* launcher = CBrowserLauncher::NewLC(); + + // Asynchronous operation to launch the browser with given URL + launcher->LaunchBrowserEmbeddedL( + *param, NULL, this, NULL ); + + CleanupStack::Pop( launcher ); + iBrowserLauncher = launcher; + launcher = NULL; + + CleanupStack::PopAndDestroy( param ); + } + +// --------------------------------------------------------- +// CWmPortalButton::HandleServerAppExit +// --------------------------------------------------------- +// +void CWmPortalButton::HandleServerAppExit( TInt aReason ) + { + MAknServerAppExitObserver::HandleServerAppExit( aReason ); + delete iBrowserLauncher; + iBrowserLauncher = NULL; } // --------------------------------------------------------- // CWmPortalButton::HandleControlEventL // --------------------------------------------------------- // -void CWmPortalButton::HandleControlEventL( CCoeControl* /*aControl*/, +void CWmPortalButton::HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ) { - // execute portal action when button pressed (short or long press) - if ( aEventType == EEventStateChanged || - aEventType == ELongPressEndedEvent ) + if ( aControl == this ) { - ExecuteL(); + if ( aEventType == EEventStateChanged || + aEventType == ELongPressEndedEvent || + aEventType == EEventRequestCancel ) + { + DrawDeferred(); + } + // execute portal action when button pressed (short or long press) + if ( aEventType == EEventRequestExit ) + { + SetFocus( EFalse ); + DrawNow(); + ExecuteL(); + } } } // --------------------------------------------------------- +// CWmPortalButton::HandlePointerEventL +// --------------------------------------------------------- +// +void CWmPortalButton::HandlePointerEventL( + const TPointerEvent& aPointerEvent ) + { + CAknButton::HandlePointerEventL( aPointerEvent ); + + // remove focus from button if button is released outside rect + if ( aPointerEvent.iType == TPointerEvent::EDrag ) + { + TBool wasFoucused( IsFocused() ); + SetFocus( Rect().Contains( aPointerEvent.iPosition ) ); + if ( wasFoucused != IsFocused() ){ DrawNow(); } + } + else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + SetFocus( EFalse ); // remove focus when button released. + } + } + + +// --------------------------------------------------------- // CWmPortalButton::LayoutIconSize // --------------------------------------------------------- // @@ -348,11 +355,12 @@ // resize icon if ( iButtonIcon && iButtonIconMask ) { - TSize size = LayoutIconSize(); - AknIconUtils::SetSize( - iButtonIcon, size, EAspectRatioPreserved ); - AknIconUtils::SetSize( - iButtonIconMask, size, EAspectRatioPreserved ); + iImageConverter->UpdateImageSize( + LayoutIconSize(), + iWmMainContainer->Configuration().PortalButtonIcon( + iPortalButtonIndex ), + *iButtonIcon, + *iButtonIconMask ); } TBool landscape = Layout_Meta_Data::IsLandscapeOrientation(); @@ -361,37 +369,6 @@ } // --------------------------------------------------------- -// CWmPortalButton::NotifyCompletion -// --------------------------------------------------------- -// -void CWmPortalButton::NotifyCompletion( TInt aError ) - { - if ( KErrNone == aError ) - { - // take ownership of icon - delete iButtonIcon; - iButtonIcon = NULL; - iButtonIcon = iImageConverter->Bitmap(); - delete iButtonIconMask; - iButtonIconMask = NULL; - iButtonIconMask = iImageConverter->Mask(); - if ( iButtonIcon && iButtonIconMask ) - { - TSize size = LayoutIconSize(); - AknIconUtils::SetSize( - iButtonIcon, size, EAspectRatioPreserved ); - AknIconUtils::SetSize( - iButtonIconMask, size, EAspectRatioPreserved ); - DrawDeferred(); - } - } - else - { - // no image available. Do nothing. - } - } - -// --------------------------------------------------------- // CWmPortalButton::Draw // --------------------------------------------------------- // @@ -407,13 +384,13 @@ CWindowGc& gc = SystemGc(); MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - TAknsItemID frameId = ( KAknsIIDQgnHomeWmButton ); - TAknsItemID frameCenterId = ( KAknsIIDQgnHomeWmButtonCenter ); + TAknsItemID frameId = ( KAknsIIDQsnFrButtonNormal ); + TAknsItemID frameCenterId = ( KAknsIIDQsnFrButtonCenterNormal ); if ( iButtonPressed ) { - frameId = ( KAknsIIDQgnHomeWmButtonPressed ); - frameCenterId = ( KAknsIIDQgnHomeWmButtonPressedCenter ); + frameId = ( KAknsIIDQsnFrButtonPressed ); + frameCenterId = ( KAknsIIDQsnFrButtonCenterPressed ); } else if ( IsDimmed() ) { @@ -422,8 +399,8 @@ } else if ( IsFocused() ) { - frameId = KAknsIIDQsnFrList; - frameCenterId = KAknsIIDQsnFrListCenter; + frameId = KAknsIIDQsnFrButtonHighlight; + frameCenterId = KAknsIIDQsnFrButtonHighlightCenter; } iBgContext->SetFrame( frameId ); @@ -431,7 +408,7 @@ iBgContext->SetFrameRects( rect, innerRect ); if ( !AknsDrawUtils::Background( skin, iBgContext, NULL, - gc, rect, KAknsDrawParamNoClearUnderImage ) ) + gc, rect, KAknsDrawParamNoClearUnderImage ) ) { gc.SetBrushColor( KRgbRed ); gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); @@ -459,7 +436,13 @@ imageLayout.LayoutRect( rect, AknLayoutScalable_Apps ::wgtman_btn_pane_g1( variety ).LayoutLine() ); } - imageLayout.DrawImage( gc, iButtonIcon, iButtonIconMask ); + + gc.DrawBitmapMasked( + imageLayout.Rect(), + iButtonIcon, + TRect(TPoint( 0, 0 ), iButtonIcon->SizeInPixels() ), + iButtonIconMask, + EFalse ); } // draw text if portrait @@ -494,30 +477,15 @@ MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - TRgb textColor( layoutText.Color() ); - - if ( IsDimmed() ) + TRgb textColor; + TInt err = AknsUtils::GetCachedColor( + skin, + textColor, + KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG63 ); + if ( err != KErrNone ) { - const TInt KAlpha = 77; - textColor = iEikonEnv->ControlColor( EColorButtonText, *this ); - // try over-writing color from theme, ignore error. - AknsUtils::GetCachedColor( - skin, textColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ); - textColor.SetAlpha( KAlpha ); - } - else if ( IsFocused() || iButtonPressed ) - { - textColor = iEikonEnv->ControlColor( EColorButtonTextPressed, *this ); - // try over-writing color from theme, ignore error. - AknsUtils::GetCachedColor( - skin, textColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 ); - } - else if ( textColor.Internal() <= 0 ) - { - textColor = iEikonEnv->ControlColor( EColorButtonText, *this ); - // try over-writing color from theme, ignore error. - AknsUtils::GetCachedColor( - skin, textColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ); + textColor = layoutText.Color(); } aGc.SetPenColor( textColor); @@ -557,4 +525,95 @@ baselineOffset, layoutText.Align() ); } +// --------------------------------------------------------- +// CWmPortalButton::RunOperatorApplicationL +// --------------------------------------------------------- +// +void CWmPortalButton::RunOperatorApplicationL( CWmConfiguration& aConf ) + { + CWmConfiguration::TOpAppType type = aConf.PortalButtonApplicationType( 1 ); + if ( type == CWmConfiguration::EUnknown || + type >= CWmConfiguration::EReserved ) + { + // Leave if not found + User::Leave( KErrArgument ); + } + + switch( type ) + { + case CWmConfiguration::ES60: + case CWmConfiguration::EQt: + { + TUid uid = KNullUid; + aConf.PortalButtonApplicationId( 1, uid ); + StartProcessL( uid, aConf.PortalButtonClientParam( 1 ) ); + } + break; + case CWmConfiguration::ECwrt: + { + TUid uid = KNullUid; + aConf.PortalButtonApplicationId( 1, uid ); + StartWidgetL( uid, aConf.PortalButtonClientParam( 1 ) ); + } + break; + case CWmConfiguration::EWrt: + { + TUid uid = KNullUid; + aConf.PortalButtonApplicationId( 1, uid ); + StartWidgetL( uid, KNullDesC ); + } + break; + case CWmConfiguration::EJava: + { + TBuf appId; + aConf.PortalButtonApplicationId( 1, appId ); + //TODO: + } + break; + } + } + +// --------------------------------------------------------- +// CWmPortalButton::StartProcessL +// --------------------------------------------------------- +// +void CWmPortalButton::StartProcessL( TUid aUid, const TDesC& aParam ) + { + RApaLsSession session; + User::LeaveIfError( session.Connect() ); + CleanupClosePushL( session ); + + //get app info + TApaAppInfo appInfo; + User::LeaveIfError( session.GetAppInfo( appInfo, aUid ) ); + // do the launch + RProcess process; + User::LeaveIfError( process.Create( appInfo.iFullName, aParam ) ); + process.Resume(); + + CleanupStack::PopAndDestroy( &session ); + } + +// --------------------------------------------------------- +// CWmPortalButton::StartWidgetL +// --------------------------------------------------------- +// +void CWmPortalButton::StartWidgetL( TUid aAppUid, const TDesC& aParams ) + { + if ( aAppUid == KNullUid ) + User::Leave( KErrArgument ); + + HBufC* params = aParams.AllocLC(); + + RApaLsSession appArc; + User::LeaveIfError( appArc.Connect() ); + CleanupClosePushL( appArc ); + + TThreadId threadId; + User::LeaveIfError( appArc.StartDocument( *params, aAppUid, threadId ) ); + + CleanupStack::PopAndDestroy( &appArc ); + CleanupStack::PopAndDestroy( params ); + } + // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wmprocessmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/widgetmanager/src/wmprocessmonitor.cpp Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,117 @@ +/* +* 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 "wmprocessmonitor.h" + + +// --------------------------------------------------------- +// CWmProcessMonitor::NewL +// --------------------------------------------------------- +// +CWmProcessMonitor* CWmProcessMonitor::NewL( ) + { + CWmProcessMonitor* self = CWmProcessMonitor::NewLC(); + CleanupStack::Pop(); // self; + return self; + } + +// --------------------------------------------------------- +// CWmProcessMonitor::NewLC +// --------------------------------------------------------- +// +CWmProcessMonitor* CWmProcessMonitor::NewLC() + { + CWmProcessMonitor* self = new ( ELeave ) CWmProcessMonitor(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------- +// CWmProcessMonitor::CWmProcessMonitor +// --------------------------------------------------------- +// +CWmProcessMonitor::CWmProcessMonitor() + : CActive( EPriorityStandard ) + { + } + +// --------------------------------------------------------- +// CWmProcessMonitor::ConstructL +// --------------------------------------------------------- +// +void CWmProcessMonitor::ConstructL() + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------- +// CWmProcessMonitor::~CWmProcessMonitor +// --------------------------------------------------------- +// +CWmProcessMonitor::~CWmProcessMonitor() + { + Cancel(); + } + +// --------------------------------------------------------- +// CWmProcessMonitor::DoCancel +// --------------------------------------------------------- +// +void CWmProcessMonitor::DoCancel() + { + if ( IsActive() ) + { + iProcess.LogonCancel( iStatus ); + } + iProcess.Close(); + } + +// --------------------------------------------------------- +// CWmProcessMonitor::RunL +// --------------------------------------------------------- +// +void CWmProcessMonitor::RunL() + { + iProcess.Close(); + } + +// --------------------------------------------------------- +// CWmProcessMonitor::RunError +// --------------------------------------------------------- +// +TInt CWmProcessMonitor::RunError(TInt /*aError*/) + { + iProcess.Close(); + return KErrNone; + } + + +// --------------------------------------------------------- +// CWmProcessMonitor::Monitor +// --------------------------------------------------------- +// +void CWmProcessMonitor::Monitor( RProcess& aProcess ) + { + iProcess.SetHandle( aProcess.Handle() ); + iProcess.Logon( iStatus ); + SetActive(); + } + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wmresourceloader.cpp --- a/idlehomescreen/widgetmanager/src/wmresourceloader.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmresourceloader.cpp Wed May 12 13:22:51 2010 +0300 @@ -133,7 +133,7 @@ { if ( iResourceFileOffset ) { - iEnv.DeleteResourceFile( iResourceFileOffset ); + iEnv.DeleteResourceFile( iResourceFileOffset ); } } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wmspbgcleaner.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/widgetmanager/src/wmspbgcleaner.cpp Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms 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: +* statuspane transparency handling implementation +* +*/ + +#include +#include +#include + +#include "wmspbgcleaner.h" + +// CONSTANTS + +// --------------------------------------------------------- +// CWmSpBgCleaner::NewL +// --------------------------------------------------------- +// +CWmSpBgCleaner* CWmSpBgCleaner::NewL() + { + CWmSpBgCleaner* self = CWmSpBgCleaner::NewLC(); + CleanupStack::Pop(); // self; + return self; + } + +// --------------------------------------------------------- +// CWmSpBgCleaner::NewLC +// --------------------------------------------------------- +// +CWmSpBgCleaner* CWmSpBgCleaner::NewLC() + { + CWmSpBgCleaner* self = new ( ELeave ) CWmSpBgCleaner(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------- +// CWmSpBgCleaner::CWmSpBgCleaner +// --------------------------------------------------------- +// +CWmSpBgCleaner::CWmSpBgCleaner() + { + } + +// --------------------------------------------------------- +// CWmSpBgCleaner::ConstructL +// --------------------------------------------------------- +// +void CWmSpBgCleaner::ConstructL() + { + CreateWindowL(); + + TRect statusPaneRect; + AknLayoutUtils::LayoutMetricsRect( + AknLayoutUtils::EStatusPane, statusPaneRect ); + + SetRect( statusPaneRect ); + SetNonFocusing(); + + Window().SetOrdinalPosition( -1 ); + Window().SetBackgroundColor( TRgb::Color16MA(0) ); + Window().SetVisible( ETrue ); + + ActivateL(); + } + +// --------------------------------------------------------- +// CWmSpBgCleaner::~CWmSpBgCleaner +// --------------------------------------------------------- +// +CWmSpBgCleaner::~CWmSpBgCleaner() + { + } + +// --------------------------------------------------------- +// CWmSpBgCleaner::SizeChanged +// --------------------------------------------------------- +// +void CWmSpBgCleaner::SizeChanged() + { + CCoeControl::SizeChanged(); + DrawDeferred(); + } + +// --------------------------------------------------------- +// CWmSpBgCleaner::Draw +// --------------------------------------------------------- +// +void CWmSpBgCleaner::Draw( const TRect& /*aRect*/ ) const + { + CWindowGc& gc = SystemGc(); + TRgb color( TRgb::Color16MA(0) ); + gc.SetPenColor( color ); + gc.SetBrushColor( color ); + gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); + gc.SetPenStyle(CGraphicsContext::ESolidPen ); + gc.SetBrushStyle(CGraphicsContext::ESolidBrush ); + gc.Clear(); + } + +// --------------------------------------------------------- +// CWmSpBgCleaner::HandleResourceChange +// --------------------------------------------------------- +// +void CWmSpBgCleaner::HandleResourceChange( TInt aType ) + { + CCoeControl::HandleResourceChange( aType ); + + if ( KEikDynamicLayoutVariantSwitch == aType ) + { + TRect statusPaneRect; + AknLayoutUtils::LayoutMetricsRect( + AknLayoutUtils::EStatusPane, statusPaneRect ); + SetRect( statusPaneRect ); + } + } + +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wmwidgetdata.cpp --- a/idlehomescreen/widgetmanager/src/wmwidgetdata.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmwidgetdata.cpp Wed May 12 13:22:51 2010 +0300 @@ -36,6 +36,7 @@ #include "wmpersistentwidgetorder.h" #include "wmresourceloader.h" #include "wmcommon.h" +#include "wmimageconverter.h" // --------------------------------------------------------- // CWmWidgetData::NewL @@ -83,31 +84,30 @@ iLogoImageMask = NULL; iHsContentInfo = NULL; iWidgetType = CWmWidgetData::EUnknown; + iWrtType = CWmWidgetData::EUnIdentified; iPublisherUid = KNullUid; iLogoSize = aLogoSize; - iPeriodic = NULL; + iAnimationTimer = NULL; iAnimationIndex = 0; iAsyncUninstalling = EFalse; - iFireLogoChanged = EFalse; + iMdcaPoint = NULL; } // --------------------------------------------------------- // CWmWidgetData::ConstructL // --------------------------------------------------------- // -void CWmWidgetData::ConstructL( +void CWmWidgetData::ConstructL( CHsContentInfo* aHsContentInfo, RWidgetRegistryClientSession* aRegistryClientSession ) { - InitL( aHsContentInfo, aRegistryClientSession ); + // start decoding the icon + iImageConverter = CWmImageConverter::NewL(); + iAnimationTimer = CPeriodic::NewL( CActive::EPriorityStandard ); - // start decoding the icon - iImageConverter = CWmImageConverter::NewL( this ); - iWait = new (ELeave) CActiveSchedulerWait(); - iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); - + InitL( aHsContentInfo, aRegistryClientSession ); + // start logo handling - iImageConverter->SetLogoSize( iLogoSize ); HandleIconString( HsContentInfo().IconPath() ); } @@ -129,12 +129,18 @@ iWidgetType = CWmWidgetData::ENative; } + // get publisher uid from widget registry + FetchPublisherUidL( aHsContentInfo->PublisherId(), + aRegistryClientSession ); + + // create iMdcaPoint for listbox + _LIT( KFormatStr, "0\t%S"); + iMdcaPoint = HBufC::NewL( + aHsContentInfo->Name().Length() + KFormatStr().Length() ); + iMdcaPoint->Des().Format( KFormatStr(), &aHsContentInfo->Name() ); + // take ownership of the content info iHsContentInfo = aHsContentInfo; - - // get publisher uid from widget registry - FetchPublisherUidL( aRegistryClientSession ); - } // --------------------------------------------------------- @@ -143,18 +149,14 @@ // CWmWidgetData::~CWmWidgetData() { - if ( iWait && iWait->IsStarted() ) - { - iWait->AsyncStop(); - } - delete iWait; SetObserver( NULL ); DestroyAnimData(); - delete iPeriodic; + delete iAnimationTimer; delete iLogoImage; delete iLogoImageMask; delete iImageConverter; delete iHsContentInfo; + delete iMdcaPoint; } // --------------------------------------------------------- @@ -223,37 +225,6 @@ } // --------------------------------------------------------- -// CWmWidgetData::NotifyCompletion -// --------------------------------------------------------- -// -void CWmWidgetData::NotifyCompletion( TInt aError ) - { - delete iLogoImage; - iLogoImage = NULL; - delete iLogoImageMask; - iLogoImageMask = NULL; - if ( KErrNone != aError ) - { - // no image available. Do nothing. - } - else - { - iLogoImage = iImageConverter->Bitmap(); - iLogoImageMask = iImageConverter->Mask(); - - if ( iWait && iWait->IsStarted() ) - { - iWait->AsyncStop(); - } - if ( iFireLogoChanged ) - { - iFireLogoChanged = EFalse; - FireDataChanged(); - } - } - } - -// --------------------------------------------------------- // CWmWidgetData::HandleIconString // --------------------------------------------------------- // @@ -274,6 +245,9 @@ { iconStr = aIconStr.Alloc(); } + + // nothing to do if no iconstr + if ( !iconStr ){ return; } TSize size( iLogoSize ); if ( iLogoImage ) { size = iLogoImage->SizeInPixels(); } @@ -282,22 +256,17 @@ { size = iLogoSize; } - TInt err = iImageConverter->HandleIconString( - size.iWidth, size.iHeight, *iconStr ); + + iImageConverter->HandleIconString( + size, + *iconStr, + iLogoImage, + iLogoImageMask ); delete iconStr; iconStr = NULL; - // handle result - if ( KErrNone == err && IsPrepairingLogo() ) - { - iWait->Start(); - } - else if ( KErrNone != err && iFireLogoChanged ) - { - FireDataChanged(); // draw default icon - iFireLogoChanged = EFalse; - } + FireDataChanged(); // draw default icon } // --------------------------------------------------------- @@ -346,18 +315,40 @@ // ---------------------------------------------------- // void CWmWidgetData::FetchPublisherUidL( + const TDesC& aPublisherId, RWidgetRegistryClientSession* aRegistryClientSession ) { if ( iPublisherUid == KNullUid && - PublisherId() != KNullDesC && + aPublisherId != KNullDesC && iWidgetType != CWmWidgetData::ENative && aRegistryClientSession ) { - TInt widgetUid = aRegistryClientSession->GetWidgetUidL( PublisherId() ); + TInt widgetUid = aRegistryClientSession->GetWidgetUidL( aPublisherId ); if ( widgetUid != 0 ) { // WRT widget - iPublisherUid = TUid::Uid( widgetUid ); + iPublisherUid = TUid::Uid( widgetUid ); + + // wrt widget type + CWidgetPropertyValue* value( NULL ); + value = aRegistryClientSession->GetWidgetPropertyValueL( + iPublisherUid, ENokiaWidget ); + if ( value && *value == 1 ) + { + iWrtType = CWmWidgetData::EWgz; + } + else if ( value && *value == 2 ) + { + iWrtType = CWmWidgetData::EWgt; + } + else + { + iWrtType = CWmWidgetData::EUnIdentified; + } + + delete value; + value = NULL; + } else { @@ -370,6 +361,17 @@ // CWmWidgetData::Description // --------------------------------------------------------- // +const TDesC& CWmWidgetData::Name() const + { + return ( iAsyncUninstalling ? + iWmResourceLoader.Uninstalling() : + iHsContentInfo->Name() ); + } + +// --------------------------------------------------------- +// CWmWidgetData::Description +// --------------------------------------------------------- +// const TDesC& CWmWidgetData::Description() const { if ( iHsContentInfo->Description().Length() <= 0 && @@ -386,28 +388,32 @@ // CWmWidgetData::ReCreateLogo // --------------------------------------------------------- // -void CWmWidgetData::ReCreateLogo( const TSize& aSize ) - { - delete iLogoImage; - iLogoImage = NULL; - delete iLogoImageMask; - iLogoImageMask = NULL; - - if ( iWait && iWait->IsStarted() ) +void CWmWidgetData::UpdateLogo( const TSize& aSize, TBool aReCreateLogo ) + { + iLogoSize = aSize; + if ( aReCreateLogo ) { - iWait->AsyncStop(); + delete iLogoImage; + iLogoImage = NULL; + delete iLogoImageMask; + iLogoImageMask = NULL; + HandleIconString( HsContentInfo().IconPath() ); } - - iFireLogoChanged = ETrue; - iLogoSize = aSize; - HandleIconString( HsContentInfo().IconPath() ); + else + { + iImageConverter->UpdateImageSize( + iLogoSize, + HsContentInfo().IconPath(), + *iLogoImage, + *iLogoImageMask ); + } } // --------------------------------------------------------- -// CWmWidgetData::ReplaceContentInfoL +// CWmWidgetData::ReplaceContentInfo // --------------------------------------------------------- // -TBool CWmWidgetData::ReplaceContentInfoL( +TBool CWmWidgetData::ReplaceContentInfo( CHsContentInfo* aHsContentInfo ) { TBool sameAppearance = ( @@ -420,10 +426,15 @@ // delete the old content info delete iHsContentInfo; iHsContentInfo = NULL; - - // re-init the object - InitL( aHsContentInfo, NULL ); - + + // re-init the object, take care about leave. + TRAPD( err, InitL( aHsContentInfo, NULL ); ); + if ( KErrNone != err ) + { + delete aHsContentInfo; + aHsContentInfo = NULL; + } + if ( !sameAppearance ) { // fire change event -> widget redrawn @@ -434,27 +445,13 @@ { // re-convert image // change event will be fired later when bitmap is ready - ReCreateLogo( iLogoSize ); + UpdateLogo( iLogoSize, ETrue ); } return !( sameAppearance && sameLogo ); } // --------------------------------------------------------- -// CWmWidgetData::IsPrepairingLogo -// --------------------------------------------------------- -// -TBool CWmWidgetData::IsPrepairingLogo() - { - TBool prepairing( EFalse ); - if ( !iLogoImage ) - { - prepairing = iImageConverter->IsProcessing(); - } - return prepairing; - } - -// --------------------------------------------------------- // CWmWidgetData::VisualizeUninstall // --------------------------------------------------------- // @@ -462,13 +459,12 @@ { DestroyAnimData(); PrepairAnimL(); - - iHsContentInfo->SetNameL( iWmResourceLoader.Uninstalling() ); + iAsyncUninstalling = ETrue; iAnimationIndex = 0; const TInt tickInterval = 400000; - iPeriodic->Start( - tickInterval,tickInterval,TCallBack(Tick, this)); + iAnimationTimer->Start( + tickInterval,tickInterval,TCallBack(AnimationTick, this)); } // --------------------------------------------------------- @@ -511,9 +507,9 @@ // void CWmWidgetData::DestroyAnimData() { - if ( iPeriodic && iPeriodic->IsActive() ) + if ( iAnimationTimer && iAnimationTimer->IsActive() ) { - iPeriodic->Cancel(); + iAnimationTimer->Cancel(); } for( TInt i=0; i < iUninstallAnimIcons.Count(); i++ ) @@ -525,10 +521,10 @@ } // --------------------------------------------------------- -// CWmWidgetData::Tick +// CWmWidgetData::AnimationTick // --------------------------------------------------------- // -TInt CWmWidgetData::Tick( TAny* aPtr ) +TInt CWmWidgetData::AnimationTick( TAny* aPtr ) { CWmWidgetData* self = static_cast< CWmWidgetData* >( aPtr ); self->iAnimationIndex += 2; @@ -597,5 +593,28 @@ return iAsyncUninstalling; } +// --------------------------------------------------------- +// CWmWidgetData::MdcaPoint +// --------------------------------------------------------- +// +const TDesC& CWmWidgetData::MdcaPoint() const + { + if ( iMdcaPoint ) + return *iMdcaPoint; + else + return KNullDesC; + } + +// --------------------------------------------------------- +// CWmWidgetData::StopUninstallAnimation +// --------------------------------------------------------- +// +void CWmWidgetData::StopUninstallAnimation() + { + iAsyncUninstalling = EFalse; + DestroyAnimData(); + FireDataChanged(); //redraw + } + // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wmwidgetloaderao.cpp --- a/idlehomescreen/widgetmanager/src/wmwidgetloaderao.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmwidgetloaderao.cpp Wed May 12 13:22:51 2010 +0300 @@ -24,6 +24,7 @@ #include "wmlistbox.h" #include "wmwidgetloaderao.h" #include "wminstaller.h" +#include "wmwidgetorderdata.h" #include // content control api #include // content control api @@ -54,12 +55,13 @@ CWmWidgetLoaderAo::CWmWidgetLoaderAo( CWmPlugin& aWmPlugin, CWmListBox& aTargetList ) - : CAsyncOneShot( EPriorityStandard ) + : CAsyncOneShot( EPriorityHigh ) , iWmPlugin( aWmPlugin ) , iWidgetsList( aTargetList ) { iWidgetRegistry = NULL; iWidgetOrder = NULL; + iLoading = EFalse; } // --------------------------------------------------------------------------- @@ -128,6 +130,9 @@ // iUninstallUid is null no uninstallation is ongoing iUninstallUid = iWmPlugin.WmInstaller().UninstallUid(); + // connect to widget registry + OpenSessionL(); + // 1. load the widgets array MHsContentController& controller = iWmPlugin.ContentController(); CHsContentInfoArray* contentInfoArray = CHsContentInfoArray::NewL(); @@ -135,23 +140,30 @@ controller.WidgetListL( *contentInfoArray ); // 2. load the widget order + if ( iWidgetOrder ) { Cleanup(); } iWidgetOrder = CWmPersistentWidgetOrder::NewL( iWmPlugin.FileServer() ); TRAPD( loadError, iWidgetOrder->LoadL() ); - - // 3. prepare the widget data list + + // 3. prepare the widget data array & sort order array for( TInt i=0; iSetPersistentWidgetOrder( iWidgetOrder ); + } + // 4. loop through the content array and compare it against the existing // widget data. TInt widgetsAdded = 0; TInt widgetsChanged = 0; + iLoading = ETrue; while( contentInfoArray->Array().Count() > 0 ) { CHsContentInfo* contentInfo = contentInfoArray->Array()[0]; + if ( !contentInfo ) { break; } contentInfoArray->Array().Remove( 0 ); // check if this widget exists. @@ -160,18 +172,27 @@ CWmWidgetData* existingData = FindWidgetData( *contentInfo ); if ( existingData ) { - // update existing widget data + // update existing visible widget data existingData->SetValid( ETrue ); - if ( existingData->ReplaceContentInfoL( contentInfo ) ) + if ( existingData->ReplaceContentInfo( contentInfo ) ) { + // Update name to order array if name changed + for ( TInt i=0; i < iWidgetsList.OrderDataArray().Count(); i++ ) + { + CWmWidgetOrderData* order = iWidgetsList.OrderData(i); + if ( order->EqualsTo( + existingData->Uid(), existingData->PublisherId() ) ) + { + order->UpdateName( existingData->Name() ); + } + } ++widgetsChanged; } } else { // add a new widget data - AddWidgetDataL( contentInfo ); - ++widgetsAdded; + TRAP_IGNORE( AddWidgetDataL( contentInfo, widgetsAdded ); ); } } @@ -217,9 +238,8 @@ // 8. store list order if necessary if ( loadError != KErrNone || widgetsAdded > 0 || widgetsRemoved > 0 ) { - iWidgetOrder->StoreL( iWidgetsList.WidgetDataArray() ); + TRAP_IGNORE( iWidgetOrder->StoreL( iWidgetsList.OrderDataArray() ); ); } - } // --------------------------------------------------------- @@ -241,34 +261,80 @@ } // --------------------------------------------------------- +// CWmWidgetLoaderAo::OpenSessionL +// --------------------------------------------------------- +// +void CWmWidgetLoaderAo::OpenSessionL() + { + if ( !iWidgetRegistry ) + { + iWidgetRegistry = new (ELeave) RWidgetRegistryClientSession(); + TInt err = iWidgetRegistry->Connect(); + if ( KErrNone != err ) + { + delete iWidgetRegistry; + iWidgetRegistry = NULL; + User::Leave( err ); + } + } + } + +// --------------------------------------------------------- // CWmWidgetLoaderAo::AddWidgetDataL // --------------------------------------------------------- // void CWmWidgetLoaderAo::AddWidgetDataL( - CHsContentInfo* aContentInfo ) + CHsContentInfo* aContentInfo, TInt& aCount ) { CleanupStack::PushL( aContentInfo ); - if ( !iWidgetRegistry ) - { - iWidgetRegistry = new (ELeave) RWidgetRegistryClientSession(); - User::LeaveIfError( iWidgetRegistry->Connect() ); - } - CleanupStack::Pop( aContentInfo ); + + // Becouse we show only widgets that can be added we need two arrays + // to maintain order data and visible data. + // All widgets are added to listbox's iOrderDataArray and + // widgets that CanBeAdded are added also to iVisibleWidgetArray. + CWmWidgetOrderData* order = CWmWidgetOrderData::NewLC( + aContentInfo->PublisherId(), + UidFromString( aContentInfo->Uid() ), + aContentInfo->Name(), + iWidgetOrder + ); + + // add to order data + iWidgetsList.AddOrderDataL( order ); + CleanupStack::Pop( order ); - CWmWidgetData* widgetData = CWmWidgetData::NewLC( - iWidgetsList.LogoSize(), - iWmPlugin.ResourceLoader(), - aContentInfo, iWidgetRegistry ); - widgetData->SetPersistentWidgetOrder( iWidgetOrder ); - widgetData->SetValid( ETrue ); - iWidgetsList.AddWidgetDataL( widgetData, EFalse ); - if ( iUninstallUid != KNullUid - && iUninstallUid == widgetData->PublisherUid() ) + if ( aContentInfo->CanBeAdded() ) { - widgetData->VisualizeUninstallL(); + CWmWidgetData* widgetData = CWmWidgetData::NewL( + iWidgetsList.LogoSize(), + iWmPlugin.ResourceLoader(), + aContentInfo, iWidgetRegistry ); + + // widgetdata has taken ownership of contentinfo + CleanupStack::Pop( aContentInfo ); + + CleanupStack::PushL( widgetData ); + + widgetData->SetPersistentWidgetOrder( iWidgetOrder ); + widgetData->SetValid( ETrue ); + + // start uninstall animation if this widget + // is currently been unistalled + if ( iUninstallUid != KNullUid && + iUninstallUid == widgetData->PublisherUid() ) + { + widgetData->VisualizeUninstallL(); + } + // add to visible data + iWidgetsList.AddWidgetDataL( widgetData, EFalse ); + CleanupStack::Pop( widgetData ); + aCount++; } - - CleanupStack::Pop( widgetData ); + else + { + //delete aContentInfo when it's not added to iVisibleWidgetArray + CleanupStack::PopAndDestroy( aContentInfo ); + } } // --------------------------------------------------------------------------- @@ -277,6 +343,8 @@ // void CWmWidgetLoaderAo::Cleanup() { + iLoading = EFalse; + // disconnect widget registry if ( iWidgetRegistry ) { @@ -295,5 +363,34 @@ iWidgetOrder = NULL; } +// ---------------------------------------------------- +// CWmWidgetData::UidFromString +// ---------------------------------------------------- +// +TUid CWmWidgetLoaderAo::UidFromString( const TDesC8& aUidString ) const + { + TUid uid( KNullUid ); + const TInt KHexPrefixLength = 2; + if ( aUidString.Length() > KHexPrefixLength ) + { + TUint id = 0; + TLex8 lex( aUidString.Mid( KHexPrefixLength ) ); + if ( lex.Val( id, EHex ) == KErrNone ) + { + uid.iUid = (TInt32)id; + } + } + return uid; + } + +// ---------------------------------------------------- +// CWmWidgetData::IsLoading +// ---------------------------------------------------- +// +TBool CWmWidgetLoaderAo::IsLoading() + { + return iLoading; + } + // end of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/src/wmwidgetorderdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/widgetmanager/src/wmwidgetorderdata.cpp Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,187 @@ +/* +* 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: +* CWmWidgetOrderData implementation. +* +*/ + + +// INCLUDE FILES +#include +#include +#include "wmwidgetorderdata.h" +#include "wmpersistentwidgetorder.h" + +// --------------------------------------------------------- +// CWmWidgetOrderData::NewL +// --------------------------------------------------------- +// +CWmWidgetOrderData* CWmWidgetOrderData::NewL( + const TDesC& aPublisherId, + const TUid aUid, + const TDesC& aName, + const CWmPersistentWidgetOrder* aPersistentWidgetOrder ) + { + CWmWidgetOrderData* self = CWmWidgetOrderData::NewLC( + aPublisherId, aUid, aName, aPersistentWidgetOrder ); + CleanupStack::Pop(); // self; + return self; + } + +// --------------------------------------------------------- +// CWmWidgetOrderData::NewLC +// --------------------------------------------------------- +// +CWmWidgetOrderData* CWmWidgetOrderData::NewLC( + const TDesC& aPublisherId, + const TUid aUid, + const TDesC& aName, + const CWmPersistentWidgetOrder* aPersistentWidgetOrder ) + { + CWmWidgetOrderData* self = new ( ELeave ) CWmWidgetOrderData( aUid ); + CleanupStack::PushL(self); + self->ConstructL( aPublisherId, aName, aPersistentWidgetOrder ); + return self; + } + +// --------------------------------------------------------- +// CWmWidgetOrderData::CWmWidgetOrderData +// --------------------------------------------------------- +// +CWmWidgetOrderData::CWmWidgetOrderData( const TUid aUid ) + : iUid( aUid ) + { + } + +// --------------------------------------------------------- +// CWmWidgetOrderData::ConstructL +// --------------------------------------------------------- +// +void CWmWidgetOrderData::ConstructL( + const TDesC& aPublisherId, + const TDesC& aName, + const CWmPersistentWidgetOrder* aPersistentWidgetOrder ) + { + iPublisherId = aPublisherId.AllocL(); + iName = aName.AllocL(); + iPersistentWidgetOrder = aPersistentWidgetOrder; + } + +// --------------------------------------------------------- +// CWmWidgetOrderData::~CWmWidgetOrderData +// --------------------------------------------------------- +// +CWmWidgetOrderData::~CWmWidgetOrderData() + { + delete iPublisherId; + delete iName; + //delete iPersistentWidgetOrder // TODO: is needed??? + } + +// --------------------------------------------------------- +// CWmWidgetOrderData::PublisherId +// --------------------------------------------------------- +// +const TDesC& CWmWidgetOrderData::PublisherId() const + { + return ( iPublisherId ) ? *iPublisherId : KNullDesC(); + } + +// --------------------------------------------------------- +// CWmWidgetOrderData::Uid +// --------------------------------------------------------- +// +const TUid CWmWidgetOrderData::Uid() const + { + return iUid; + } + +// --------------------------------------------------------- +// CWmWidgetOrderData::Name +// --------------------------------------------------------- +// +const TDesC& CWmWidgetOrderData::Name() const + { + return ( iName ) ? *iName : KNullDesC(); + } + +// --------------------------------------------------------- +// CWmWidgetOrderData::CompareByName +// --------------------------------------------------------- +// +TInt CWmWidgetOrderData::CompareByName( + const CWmWidgetOrderData& aDataOne, const CWmWidgetOrderData& aDataTwo ) + { + // negate the result for ascending alphabetical order + TInt result = aDataOne.Name().CompareC( aDataTwo.Name() ); + return result; + } + +// --------------------------------------------------------- +// CWmWidgetOrderData::CompareByPersistentWidgetOrder +// --------------------------------------------------------- +// +TInt CWmWidgetOrderData::CompareByPersistentWidgetOrder( + const CWmWidgetOrderData& aDataOne, const CWmWidgetOrderData& aDataTwo ) + { + TInt result; + const CWmPersistentWidgetOrder* order = aDataOne.iPersistentWidgetOrder; + if ( order && !order->IsEmpty() ) + { + result = order->IndexOf( aDataOne ) - order->IndexOf( aDataTwo ); + } + else + { + // fallback: if persistent widget order is not available + // or it is empty (this is the case on first start, or if the persistent + // file is corrupted or deleted) -> order widgets by name. + result = CompareByName( aDataOne, aDataTwo ); + } + return result; + } + +// --------------------------------------------------------- +// CWmWidgetOrderData::EqualsTo +// --------------------------------------------------------- +// +TBool CWmWidgetOrderData::EqualsTo( const TUid aUid, const TDesC& aPublisherId ) + { + return ( iUid == aUid && *iPublisherId == aPublisherId ); + } + +// --------------------------------------------------------- +// CWmWidgetOrderData::SetPersistentWidgetOrder +// --------------------------------------------------------- +// +void CWmWidgetOrderData::SetPersistentWidgetOrder( + CWmPersistentWidgetOrder* aPersistentWidgetOrder ) + { + iPersistentWidgetOrder = aPersistentWidgetOrder; + } + +// --------------------------------------------------------- +// CWmWidgetOrderData::UpdateName +// --------------------------------------------------------- +// +void CWmWidgetOrderData::UpdateName( const TDesC& aName ) + { + if ( iName->Compare( aName ) != KErrNone ) + { + delete iName; + iName = NULL; + iName = aName.Alloc(); + } + } + +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/tsrc/wmunittest/conf/ui_wmunittest.cfg --- a/idlehomescreen/widgetmanager/tsrc/wmunittest/conf/ui_wmunittest.cfg Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/tsrc/wmunittest/conf/ui_wmunittest.cfg Wed May 12 13:22:51 2010 +0300 @@ -17,6 +17,8 @@ LOGO_PATH 102 CAN_BE_ADDED 103 CAN_BE_REMOVED 104 +KPUBLISHERID 105 +KTYPE 106 EUnrecognized 0 EUidIcon 1 @@ -601,7 +603,6 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConversionMethod EUnrecognized test ImageConverterDelete test HeapCheck delete test @@ -613,36 +614,21 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "foo bar" -test ImageConverterWaitResult FAIL -test ImageConverterConvert "*************" -test ImageConverterWaitResult FAIL -test ImageConverterConvert "uid skin mif logo icon jpg jpeg icon" -test ImageConverterWaitResult FAIL -test ImageConverterConvert "girl.jpg" -test ImageConverterWaitResult FAIL -test ImageConverterConvert "dirty_hack.exe" -test ImageConverterWaitResult FAIL -test ImageConverterConvert "c:/testframework/wmunittest/wmlogo/logo.jpg" -test ImageConverterWaitResult FAIL -test ImageConverterConvert "skin[0x10005a26 0x1000]" -test ImageConverterWaitResult FAIL -test ImageConverterConvert "skin(0x10005a26)" -test ImageConverterWaitResult FAIL -test ImageConverterConvert "mif(c:\testframework\wmunittest\wmlogo\logo.mif)" -test ImageConverterWaitResult FAIL -test ImageConverterConvert "mif(c:\testframework\wmunittest\wmlogo\logo.mif XXX YYY)" -test ImageConverterWaitResult FAIL -test ImageConverterConvert "mif ( 16384 16385)" -test ImageConverterWaitResult FAIL -test ImageConverterConvert "skin( 0x100056c6 0x86 ):mif ( c:\testframework\wmunittest\wmlogo\logo.mif )" -test ImageConverterWaitResult FAIL -test ImageConverterConvert " uid(0x10005901)" -test ImageConverterWaitResult FAIL -test ImageConverterConvert "uidaan(0x10005901)" -test ImageConverterWaitResult FAIL -test ImageConverterConvert "uid (%%%)" -test ImageConverterWaitResult FAIL +test ImageConverterConvert "foo bar" FAIL +test ImageConverterConvert "*************" FAIL +test ImageConverterConvert "uid skin mif logo icon jpg jpeg icon" FAIL +test ImageConverterConvert "girl.jpg" FAIL +test ImageConverterConvert "dirty_hack.exe" FAIL +test ImageConverterConvert "c:/testframework/wmunittest/wmlogo/logo.jpg" FAIL +test ImageConverterConvert "skin[0x10005a26 0x1000]" FAIL +test ImageConverterConvert "skin(0x10005a26)" FAIL +test ImageConverterConvert "mif(c:\testframework\wmunittest\wmlogo\logo.mif)" FAIL +test ImageConverterConvert "mif(c:\testframework\wmunittest\wmlogo\logo.mif XXX YYY)" FAIL +test ImageConverterConvert "mif ( 16384 16385)" FAIL +test ImageConverterConvert "skin( 0x100056c6 0x86 ):mif ( c:\testframework\wmunittest\wmlogo\logo.mif )" FAIL +test ImageConverterConvert " uid(0x10005901)" FAIL +test ImageConverterConvert "uidaan(0x10005901)" FAIL +test ImageConverterConvert "uid (%%%)" FAIL test ImageConverterDelete test HeapCheck delete test @@ -660,9 +646,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "skin(270501603 4145)" -test ImageConverterWaitResult OK -test ImageConverterConversionMethod ESkinIcon +test ImageConverterConvert "skin(270501603 4145)" OK test ImageConverterDelete test HeapCheck delete test @@ -674,9 +658,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "skin(0x101F86E3 0x100d)" -test ImageConverterWaitResult OK -test ImageConverterConversionMethod ESkinIcon +test ImageConverterConvert "skin(0x101F86E3 0x100d)" OK test ImageConverterDelete test HeapCheck delete test @@ -688,9 +670,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "skin ( 270501603 4145 ) " -test ImageConverterWaitResult OK -test ImageConverterConversionMethod ESkinIcon +test ImageConverterConvert "skin ( 270501603 4145 ) " OK test ImageConverterDelete test HeapCheck delete test @@ -703,8 +683,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "skin(0 0)" -test ImageConverterWaitResult FAIL +test ImageConverterConvert "skin(0 0)" FAIL test ImageConverterDelete test HeapCheck delete test @@ -716,9 +695,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "skin(270501603 4145):mif(c:\testframework\wmunittest\wmlogo\logo.mif 16384 16385)" -test ImageConverterWaitResult OK -test ImageConverterConversionMethod ESkinAndMifIcon +test ImageConverterConvert "skin(270501603 4145):mif(c:\testframework\wmunittest\wmlogo\logo.mif 16384 16385)" OK test ImageConverterDelete test HeapCheck delete test @@ -730,9 +707,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "skin(0x101F86E3 0x1031):mif(c:\testframework\wmunittest\wmlogo\logo.mif 0x4000 0x4001)" -test ImageConverterWaitResult OK -test ImageConverterConversionMethod ESkinAndMifIcon +test ImageConverterConvert "skin(0x101F86E3 0x1031):mif(c:\testframework\wmunittest\wmlogo\logo.mif 0x4000 0x4001)" OK test ImageConverterDelete test HeapCheck delete test @@ -744,9 +719,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "skin ( 0x101F86E3 0x1031 ) :mif ( c:\testframework\wmunittest\wmlogo\logo.mif 0x4000 0x4001 ) " -test ImageConverterWaitResult OK -test ImageConverterConversionMethod ESkinAndMifIcon +test ImageConverterConvert "skin ( 0x101F86E3 0x1031 ) :mif ( c:\testframework\wmunittest\wmlogo\logo.mif 0x4000 0x4001 ) " OK test ImageConverterDelete test HeapCheck delete test @@ -758,9 +731,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "mif(c:\testframework\wmunittest\wmlogo\logo.mif 16384 16385)" -test ImageConverterWaitResult OK -test ImageConverterConversionMethod EMifIcon +test ImageConverterConvert "mif(c:\testframework\wmunittest\wmlogo\logo.mif 16384 16385)" OK test ImageConverterDelete test HeapCheck delete test @@ -772,9 +743,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "mif(c:\testframework\wmunittest\wmlogo\logo.mif 16384)" -test ImageConverterWaitResult OK -test ImageConverterConversionMethod EMifIcon +test ImageConverterConvert "mif(c:\testframework\wmunittest\wmlogo\logo.mif 16384)" OK test ImageConverterDelete test HeapCheck delete test @@ -786,9 +755,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "mif(c:\testframework\wmunittest\wmlogo\logo.mif 0x4000 0x4001)" -test ImageConverterWaitResult OK -test ImageConverterConversionMethod EMifIcon +test ImageConverterConvert "mif(c:\testframework\wmunittest\wmlogo\logo.mif 0x4000 0x4001)" OK test ImageConverterDelete test HeapCheck delete test @@ -800,9 +767,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "mif ( c:\testframework\wmunittest\wmlogo\logo.mif 16384 16385 ) " -test ImageConverterWaitResult OK -test ImageConverterConversionMethod EMifIcon +test ImageConverterConvert "mif ( c:\testframework\wmunittest\wmlogo\logo.mif 16384 16385 ) " OK test ImageConverterDelete test HeapCheck delete test @@ -815,8 +780,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "mif(c:\blabla.mif 16384 16385)" -test ImageConverterWaitResult FAIL +test ImageConverterConvert "mif(c:\blabla.mif 16384 16385)" FAIL test ImageConverterDelete test HeapCheck delete test @@ -828,8 +792,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "mif(c:\testframework\wmunittest\wmlogo\logo.mif 1 2)" -test ImageConverterWaitResult FAIL +test ImageConverterConvert "mif(c:\testframework\wmunittest\wmlogo\logo.mif 1 2)" FAIL test ImageConverterDelete test HeapCheck delete test @@ -841,9 +804,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "uid(268458241)" -test ImageConverterWaitResult OK -test ImageConverterConversionMethod EUidIcon +test ImageConverterConvert "uid(268458241)" OK test ImageConverterDelete test HeapCheck delete test @@ -855,9 +816,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "uid(0x10005901)" -test ImageConverterWaitResult OK -test ImageConverterConversionMethod EUidIcon +test ImageConverterConvert "uid(0x10005901)" OK test ImageConverterDelete test HeapCheck delete test @@ -869,9 +828,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "uid ( 0x10005901 ) " -test ImageConverterWaitResult OK -test ImageConverterConversionMethod EUidIcon +test ImageConverterConvert "uid ( 0x10005901 ) " OK test ImageConverterDelete test HeapCheck delete test @@ -883,8 +840,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "uid(0x0)" -test ImageConverterWaitResult FAIL +test ImageConverterConvert "uid(0x0)" FAIL test ImageConverterDelete test HeapCheck delete test @@ -897,9 +853,7 @@ test HeapSet test InstallWrtWidget "c:\testframework\wmunittest\wmlogo\test.wgz" test ImageConverterCreate -test ImageConverterConvert "uid(0x2000DAD2)" -test ImageConverterWaitResult OK -test ImageConverterConversionMethod EUidIcon +test ImageConverterConvert "uid(0x2000DAD2)" OK test ImageConverterDelete test UninstallWrtWidget "0x2000DAD2" test HeapCheck @@ -912,9 +866,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logo.svg" -test ImageConverterWaitResult OK -test ImageConverterConversionMethod ESvgIcon +test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logo.svg" OK test ImageConverterDelete test HeapCheck delete test @@ -926,9 +878,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logocorrupt.svg" -test ImageConverterWaitResult FAIL -test ImageConverterConversionMethod ESvgIcon +test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logocorrupt.svg" FAIL test ImageConverterDelete test HeapCheck delete test @@ -940,9 +890,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logo.png" -test ImageConverterWaitResult OK -test ImageConverterConversionMethod EImageIcon +test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logo.png" OK test ImageConverterDelete test HeapCheck delete test @@ -954,8 +902,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logocorrupt.png" -test ImageConverterWaitResult FAIL +test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logocorrupt.png" FAIL test ImageConverterDelete test HeapCheck delete test @@ -967,9 +914,7 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logo.jpg" -test ImageConverterWaitResult OK -test ImageConverterConversionMethod EImageIcon +test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logo.jpg" OK test ImageConverterDelete test HeapCheck delete test @@ -981,85 +926,60 @@ create wmunittest test test HeapSet test ImageConverterCreate -test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logocorrupt.jpg" -test ImageConverterWaitResult FAIL -test ImageConverterDelete -test HeapCheck -delete test -[Endtest] - - - -// Tests image converter cancel when idle -[Test] -title Image converter cancel (idle) -create wmunittest test -test HeapSet -test ImageConverterCreate -test CancelConvert -test ImageConverterDelete -test HeapCheck -delete test -[Endtest] - -// Tests image converter cancel (mif conversion) -[Test] -title Image converter cancel (mif) -create wmunittest test -test HeapSet -test ImageConverterCreate -test ImageConverterConvert "mif(c:\testframework\wmunittest\wmlogo\logo.mif 16384 16385)" -test CancelConvert +test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logocorrupt.jpg" FAIL test ImageConverterDelete test HeapCheck delete test [Endtest] -// Tests image converter cancel (uid conversion) -[Test] -title Image converter cancel (uid) -create wmunittest test -test HeapSet -test ImageConverterCreate -test ImageConverterConvert "uid(268458241)" -test CancelConvert -test ImageConverterDelete -test HeapCheck -delete test -[Endtest] - -// Tests image converter cancel (svg conversion) -[Test] -title Image converter cancel (svg) -create wmunittest test -test HeapSet -test ImageConverterCreate -test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logo.svg" -test CancelConvert -test ImageConverterDelete -test HeapCheck -delete test -[Endtest] - -// Tests image converter cancel (jpg conversion) -[Test] -title Image converter cancel (jpg) -create wmunittest test -test HeapSet -test ImageConverterCreate -test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logo.jpg" -test CancelConvert -test ImageConverterDelete -test HeapCheck -delete test -[Endtest] - - //------------------------------------------------------------------------------- // Misc Test cases //------------------------------------------------------------------------------- // +// Tests Uninstall +[Test] +title Uninstall +create wmunittest test +test PluginCreate +test InstallWrtWidget "c:\testframework\wmunittest\wmlogo\test.wgz" +test SetMass 1 +test ChangeContent 0 KPUBLISHERID "com.nokia.widget.foreca.touchweather" +test PluginActivate +pause 500 +test UninstallUid +test Uninstall +test UninstallUid +test WaitUninstallToFinnish +test CleanUninstall +pause 3000 +test PluginDeactivate +pause 500 +test PluginDelete +test WasUnistalled "com.nokia.widget.foreca.touchweather" +delete test +[Endtest] + +// Tests Uninstall +[Test] +title Cancel Uninstall +create wmunittest test +test PluginCreate +test InstallWrtWidget "c:\testframework\wmunittest\wmlogo\test.wgz" +test SetMass 1 +test ChangeContent 0 KPUBLISHERID "com.nokia.widget.foreca.touchweather" +test PluginActivate +pause 500 +test Uninstall +pause 500 +test CancelUninstall +pause 500 +test PluginDeactivate +pause 500 +test PluginDelete +delete test +[Endtest] + // Tests error note [Test] title Other error note diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/tsrc/wmunittest/group/Create_sisx.bat --- a/idlehomescreen/widgetmanager/tsrc/wmunittest/group/Create_sisx.bat Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/tsrc/wmunittest/group/Create_sisx.bat Wed May 12 13:22:51 2010 +0300 @@ -16,4 +16,4 @@ rem Create wm sis&sisx files makesis wmunittest.pkg -signsis wmunittest.SIS wmunittest.SISX Nokia_RnDCert_02.der Nokia_RnDCert_02.key +signsis wmunittest.SIS wmunittest.SISX ..\..\..\internal\cert\Nokia_RnDCert_02.der ..\..\..\internal\cert\Nokia_RnDCert_02.key diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/tsrc/wmunittest/group/Nokia_RnDCert_02.der Binary file idlehomescreen/widgetmanager/tsrc/wmunittest/group/Nokia_RnDCert_02.der has changed diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/tsrc/wmunittest/group/Nokia_RnDCert_02.key --- a/idlehomescreen/widgetmanager/tsrc/wmunittest/group/Nokia_RnDCert_02.key Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQC/TDP7KKIaf5+uW4OD2iVZuUMC2a+SeQTjf6srlKcOm+CpPNXn -uLNm/8fdEnyOIuRXPRKmqhs1n0JkxEGHynELWMTuKXbQx9SRAGUXzyneGn+IJNnO -vOKHWgKCouX2hfI8rtkdqJpqmO460gGsMgw+lsbeyWyW9lnfLxq+ZC7sqQIDAQAB -AoGBALmUWZE8GBaQ3P4u9WUCSd3DJkkrmXIFSULSZeH/chlwCwDjbbhArHothVzo -REE3hEFFlERvHbplZ+mNouzy7boduvgUzbksGrbGMLJ2qO1GzWWVwV+GzOWKd3ss -/98Gwoy5R8pjnkqUE2wP1iJFw0FjvUTKcYv/z6t3LLJ0CsoBAkEA+c7ixvsviQ3J -s0INytCKU2bf8fqFQJi1VI82ukxNsujGTQ9upVSjuvqPvWyDvvTdrUBHqO+3qPut -sEh01Q8aiQJBAMQKDJPVRu4ud3mwUfEavzL5EjqwG1k9VCNGYsT4FwtrHcxu1oP/ -pk6M3rIZukqomoEEnHWPMwhrK3fhBqi0OSECQQDr40VXege4FnH5OI2Hj4afHMyp -VdQQXGMWFyopnzXblFz0lXb43cTCIiorR9XcMqNFHybLypkWE5o+lRzlt55pAkBQ -P/zeF5Sts//cpL0mgdh7OVKpC6ZmZaCnwAx2rUhhuDu+kDDoYCLoTOps5fNI1LRK -1GRoC3LMo3Jr5IYhUYWBAkBpCpN6k4JU/mszq98EojHerQNxk8sPqvQKUzTutohT -1gLX9yepGayB/TtT2EEJDkWOlnTy/dvN6W3vzbJYz97x ------END RSA PRIVATE KEY----- diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/tsrc/wmunittest/group/wmunittest.mmp --- a/idlehomescreen/widgetmanager/tsrc/wmunittest/group/wmunittest.mmp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/tsrc/wmunittest/group/wmunittest.mmp Wed May 12 13:22:51 2010 +0300 @@ -25,6 +25,8 @@ UID 0x1000008D 0x101FB3E3 CAPABILITY ALL -TCB +MACRO _WM_UNIT_TEST + VENDORID VID_DEFAULT SECUREID 0x101FB3E3 @@ -52,6 +54,9 @@ SOURCE wmwidgetloaderao.cpp SOURCE wmconfiguration.cpp SOURCE wminstaller.cpp +SOURCE wmprocessmonitor.cpp +SOURCE wmwidgetorderdata.cpp +SOURCE wmspbgcleaner.cpp SOURCEPATH ../src SOURCE wmunittest.cpp @@ -59,6 +64,7 @@ SOURCE wmunittest_plugin.cpp SOURCE wmunittest_sortorder.cpp SOURCE wmunittest_converter.cpp +SOURCE wmunittest_uninstaller.cpp // same as in widgetmanager.mmp LIBRARY euser.lib @@ -100,6 +106,10 @@ LIBRARY etext.lib LIBRARY centralrepository.lib LIBRARY bmpanim.lib // AknBitmap animation +LIBRARY inetprotutil.lib +LIBRARY bitgdi.lib // CFbsBitmapDevice +LIBRARY charconv.lib +LIBRARY browserlauncher.lib // libraries needed by the test framework LIBRARY stiftestinterface.lib diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/tsrc/wmunittest/inc/wmunittest.h --- a/idlehomescreen/widgetmanager/tsrc/wmunittest/inc/wmunittest.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/tsrc/wmunittest/inc/wmunittest.h Wed May 12 13:22:51 2010 +0300 @@ -25,8 +25,9 @@ #include #include // RFs -#include "wmimageconverter.h" // MConverterObserver +#include "wmwidgetorderdata.h" #include +#include "wminstaller.h" // MACROS #define TEST_CLASS_VERSION_MAJOR 0 @@ -58,14 +59,13 @@ class CHsContentInfo; class CHsContentInfoArray; class RWidgetDataValues; - +class CWmInstaller; // CLASS DECLARATION /** * test class for STIF Test Framework TestScripter. */ NONSHARABLE_CLASS(CWmUnitTest) : public CScriptBase, - public MConverterObserver, public MHsContentController { public: // Constructors and destructor @@ -87,15 +87,13 @@ /** From CScriptBase Runs a script line. */ virtual TInt RunMethodL( CStifItemParser& aItem ); - public: // from MConverterObserver - - virtual void NotifyCompletion( TInt aError ); - public: // from MHsContentController TInt WidgetListL( CHsContentInfoArray& aArray ); + TInt WidgetListL( CHsContentInfo& aInfo, CHsContentInfoArray& aArray ); TInt ViewListL( CHsContentInfoArray& aArray ); + TInt ViewListL( CHsContentInfo& aInfo, CHsContentInfoArray& aArray ); TInt AppListL( CHsContentInfoArray& aArray ); TInt AddWidgetL( CHsContentInfo& aInfo ); TInt RemoveWidgetL( CHsContentInfo& aInfo ); @@ -162,19 +160,25 @@ TInt ImageConverterDeleteL( CStifItemParser& aItem ); // calls image converter's main conversion method TInt ImageConverterConvertL( CStifItemParser& aItem ); - // checks image converter callback and checks its result - TInt ImageConverterWaitResultL( CStifItemParser& aItem ); - // gets and checks the conversion method from image converter - TInt ImageConverterConversionMethodL( CStifItemParser& aItem ); - // cancel ongoing convert - TInt CancelConvertL( CStifItemParser& aItem ); - - private: // members used in testing + // TESTING UNISTALL + TInt UninstallL( CStifItemParser& aItem ); + TInt WaitUninstallToFinnishL( CStifItemParser& aItem ); + TInt UninstallUidL( CStifItemParser& aItem ); + TInt CleanUninstall( CStifItemParser& aItem ); + TInt WasUnistalledL( CStifItemParser& aItem ); + TInt CancelUninstall( CStifItemParser& aItem ); + + private: // helper functions for test cases void CreateContentInfoArrayL( CHsContentInfoArray& aArray, TInt aCount ); - void CreateWidgetDataArrayL( RWidgetDataValues& aArray, TInt aCount ); - + void CreateWidgetDataArrayL( ROrderArray& aArray, TInt aCount ); + TUid UidFromString( const TDesC8& aUidString ) const; + void StartTimerL(); + static TInt Timeout( TAny* aPtr ); + + private: // members used in testing + // file server RFs iFs; @@ -202,6 +206,12 @@ // multipurpose test data count TInt iMass; + // uninstall uid + TUid iUninstallUid; + + // timer for waiting uninstall to finnish + CPeriodic* iTimer; + // requested changes to the content TInt iChangeIndex; TInt iChangeType; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_all.cpp --- a/idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_all.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_all.cpp Wed May 12 13:22:51 2010 +0300 @@ -75,9 +75,14 @@ ENTRY( "ImageConverterCreate", CWmUnitTest::ImageConverterCreateL ), ENTRY( "ImageConverterDelete", CWmUnitTest::ImageConverterDeleteL ), ENTRY( "ImageConverterConvert", CWmUnitTest::ImageConverterConvertL ), - ENTRY( "ImageConverterWaitResult", CWmUnitTest::ImageConverterWaitResultL ), - ENTRY( "ImageConverterConversionMethod", CWmUnitTest::ImageConverterConversionMethodL ), - ENTRY( "CancelConvert", CWmUnitTest::CancelConvertL ), + + // uninstall + ENTRY( "Uninstall", CWmUnitTest::UninstallL ), + ENTRY( "UninstallUid", CWmUnitTest::UninstallUidL ), + ENTRY( "WaitUninstallToFinnish", CWmUnitTest::WaitUninstallToFinnishL ), + ENTRY( "CleanUninstall", CWmUnitTest::CleanUninstall ), + ENTRY( "WasUnistalled", CWmUnitTest::WasUnistalledL ), + ENTRY( "CancelUninstall", CWmUnitTest::CancelUninstall ), }; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_converter.cpp --- a/idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_converter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_converter.cpp Wed May 12 13:22:51 2010 +0300 @@ -36,7 +36,7 @@ if ( iImageConverter != 0 ) User::Leave( KErrArgument ); TInt ret = KErrNone; _CLEANUPCHECK_BEGIN - iImageConverter = CWmImageConverter::NewL( this ); + iImageConverter = CWmImageConverter::NewL(); _CLEANUPCHECK_END _RETURN("ImageConverterCreateL End", ret); } @@ -64,101 +64,24 @@ TInt ret = KErrNone; iConversionReady = EFalse; TPtrC inputStr; - + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); User::LeaveIfError( aItem.GetNextString( inputStr ) ); if ( inputStr.Length() == 0 ) User::Leave( KErrArgument ); - TInt err = iImageConverter->HandleIconString( 40, 40, inputStr ); - if ( err != KErrNone ) + TInt expectedResult; + User::LeaveIfError( aItem.GetNextInt( expectedResult ) ); + + CFbsBitmap* bitmap = NULL; + CFbsBitmap* mask = NULL; + TInt err = iImageConverter->HandleIconString( + TSize (40, 40), inputStr, bitmap, mask ); + if ( err != KErrNone && expectedResult == -1 ) { - _LOG("ImageConverterConvertL:HandleIconString returns Error!!!"); - iConversionReady = ETrue; - iConversionError = err; + err = KErrNone; } _RETURN("ImageConverterConvertL End", ret ); } -// ----------------------------------------------------------------------------- -// CWmUnitTest::ImageConverterWaitResultL -// ----------------------------------------------------------------------------- -// -TInt CWmUnitTest::ImageConverterWaitResultL( CStifItemParser& aItem ) - { - if ( iImageConverter == 0 ) User::Leave( KErrArgument ); - TInt ret = KErrNone; - TInt expectedResult; - - User::LeaveIfError( aItem.GetNextInt( expectedResult ) ); - - iWaiting = EFalse; - if ( !iConversionReady ) - { - iWaiting = ETrue; - CActiveScheduler::Start(); - iWaiting = EFalse; - } - - // check conversion error - if ( expectedResult == KErrNone && iConversionError != KErrNone ) - { - _LOG("ImageConverterWaitResultL: expected ok, returns error"); - ret = iConversionError; - } - else if ( expectedResult != KErrNone && iConversionError == KErrNone ) - { - _LOG("ImageConverterWaitResultL: expected error, returns ok"); - ret = KErrGeneral; - } - - _RETURN("ImageConverterWaitResultL End", ret); - } - -// ----------------------------------------------------------------------------- -// CWmUnitTest::NotifyCompletion -// ----------------------------------------------------------------------------- -// -void CWmUnitTest::NotifyCompletion( TInt aError ) - { - if ( !iConversionReady ) - { - iConversionReady = ETrue; - iConversionError = aError; - if ( iWaiting ) - { - CActiveScheduler::Stop(); - } - } - } - -// ----------------------------------------------------------------------------- -// CWmUnitTest::ImageConverterConversionMethodL -// ----------------------------------------------------------------------------- -// -TInt CWmUnitTest::ImageConverterConversionMethodL( CStifItemParser& aItem ) - { - if ( iImageConverter == 0 ) User::Leave( KErrArgument ); - TInt ret = KErrNone; - TInt conversionMethod; - - User::LeaveIfError( aItem.GetNextInt( conversionMethod ) ); - - // check conversion method - if ( conversionMethod != iImageConverter->ConversionMethod() ) - ret = KErrGeneral; - - _RETURN("ImageConverterConversionMethodL End", ret); - } - -// ----------------------------------------------------------------------------- -// CWmUnitTest::CancelConvertL -// ----------------------------------------------------------------------------- -// -TInt CWmUnitTest::CancelConvertL( CStifItemParser& /*aItem*/ ) - { - if ( iImageConverter == 0 ) User::Leave( KErrArgument ); - iImageConverter->Cancel(); - _RETURN("CancelConvertL End", KErrNone); - } // End of File diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_plugin.cpp --- a/idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_plugin.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_plugin.cpp Wed May 12 13:22:51 2010 +0300 @@ -22,6 +22,7 @@ #include #include #include +#include #include "wmunittest.h" // components to test #include "wmplugin.h" @@ -47,7 +48,8 @@ const TInt KLogoPath = 102; const TInt KCanBeAdded = 103; const TInt KCanBeRemoved = 104; - +const TInt KPublisherId = 105; +const TInt KType = 106; // ============================ MEMBER FUNCTIONS =============================== @@ -98,7 +100,7 @@ TInt CWmUnitTest::PluginDeactivateL( CStifItemParser& /*aItem*/ ) { if ( iWmPlugin == 0 ) User::Leave( KErrArgument ); - iWmPlugin->Deactivate(); + iWmPlugin->DeActivate(); _RETURN("PluginActivateL End", KErrNone); } @@ -123,11 +125,21 @@ return KErrNone; } +TInt CWmUnitTest::WidgetListL( CHsContentInfo& aInfo, CHsContentInfoArray& aArray ) + { + return KErrNone; + } + TInt CWmUnitTest::ViewListL( CHsContentInfoArray& /*aArray*/ ) { return KErrNone; } +TInt CWmUnitTest::ViewListL( CHsContentInfo& aInfo, CHsContentInfoArray& aArray ) + { + return KErrNone; + } + TInt CWmUnitTest::AppListL( CHsContentInfoArray& /*aArray*/ ) { return KErrNone; @@ -165,12 +177,12 @@ TInt CWmUnitTest::ActiveViewL( CHsContentInfo& /*aInfo*/ ) { - return 0; + return KErrNone; } TInt CWmUnitTest::ActiveAppL( CHsContentInfo& /*aInfo*/ ) { - return 0; + return KErrNone; } @@ -236,6 +248,14 @@ { info->SetCanBeAdded( s2b(*iChangeValue) ); } else if ( iChangeType == KCanBeRemoved ) { info->SetCanBeRemoved( s2b(*iChangeValue) ); } + else if ( iChangeType == KPublisherId ) + { info->SetPublisherIdL( *iChangeValue ); } + else if ( iChangeType == KType ) + { + TBuf8<128> buf; + CnvUtfConverter::ConvertFromUnicodeToUtf8( buf, *iChangeValue ); + info->SetTypeL( buf ); + } } } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_sortorder.cpp --- a/idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_sortorder.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_sortorder.cpp Wed May 12 13:22:51 2010 +0300 @@ -26,6 +26,7 @@ // components to test #include "wmpersistentwidgetorder.h" #include "wmwidgetdata.h" +#include "wmwidgetorderdata.h" #include #include #include // widgetreqistry @@ -85,7 +86,7 @@ TInt ret = KErrNone; _CLEANUPCHECK_BEGIN - RWidgetDataValues array; + ROrderArray array; CleanupClosePushL( array ); CreateWidgetDataArrayL( array, iMass ); iWmWidgetOrder->StoreL( array ); @@ -126,7 +127,7 @@ _CLEANUPCHECK_BEGIN // test IndexOf - RWidgetDataValues array; + ROrderArray array; CreateWidgetDataArrayL( array, iMass ); for( TInt i=0; iArray().Count() > 0 ) - { - CWmWidgetData* data = CWmWidgetData::NewL( - dummySize, *resLoader, - contentArray->Array()[0], - ®istryClient); - contentArray->Array().Remove( 0 ); + for ( TInt i = 0; i < contentArray->Array().Count(); i++ ) + { + CHsContentInfo* contentInfo = contentArray->Array()[i]; + CWmWidgetOrderData* data = CWmWidgetOrderData::NewL( + contentInfo->PublisherId(), + UidFromString ( contentInfo->Uid() ), + contentInfo->Name(), + iWmWidgetOrder ); + CleanupStack::PushL( data ); aArray.AppendL( data ); CleanupStack::Pop( data ); } - - registryClient.Disconnect(); - CleanupStack::PopAndDestroy( ®istryClient ); + + contentArray->Array().ResetAndDestroy(); CleanupStack::PopAndDestroy( contentArray ); } +TUid CWmUnitTest::UidFromString( const TDesC8& aUidString ) const + { + TUid uid( TUid::Null() ); + const TInt KHexPrefixLength = 2; + if ( aUidString.Length() > KHexPrefixLength ) + { + TUint id = 0; + TLex8 lex( aUidString.Mid( KHexPrefixLength ) ); + if ( lex.Val( id, EHex ) == KErrNone ) + { + uid.iUid = (TInt32)id; + } + } + return uid; + } // End of File diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_uninstaller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_uninstaller.cpp Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,184 @@ +/* +* 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 FILES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // widgetreqistry +#include "wmresourceloader.h" + +#include "hscontentinfo.h" +#include "wmplugin.h" +#include "wmwidgetdata.h" +#include "wmunittest.h" +#include "wminstaller.h" +#include "wmmainContainer.h" +#include "wmlistbox.h" + + +// ----------------------------------------------------------------------------- +// CWmUnitTest::UninstallL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::UninstallL( CStifItemParser& aItem ) + { + TInt ret = KErrNone; + CWmWidgetData* data = + iWmPlugin->iWmMainContainer->iWidgetsList->WidgetData(); + iUninstallUid = data->PublisherUid(); + iWmPlugin->WmInstaller().UninstallL( data ); + + _RETURN("UninstallL End", ret); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::CleanUninstall +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::CleanUninstall( CStifItemParser& /*aItem*/ ) + { + if ( iTimer ) + { + if ( iTimer->IsActive() ) + iTimer->Cancel(); + + delete iTimer; + iTimer = NULL; + } + _RETURN("CleanUninstall End", KErrNone ); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::UninstallUidL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::UninstallUidL( CStifItemParser& /*aItem*/ ) + { + TInt ret = KErrNone; + + TUid installUid = iWmPlugin->WmInstaller().UninstallUid(); + if ( installUid != iUninstallUid ) + { + ret = KErrNotFound; + } + _RETURN("UninstallUidL End", ret); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::WaitUninstallToFinnishL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::WaitUninstallToFinnishL( CStifItemParser& /*aItem*/ ) + { + TInt ret = KErrNone; + + if ( iWmPlugin->WmInstaller().IsActive() ) + { + StartTimerL(); + CActiveScheduler::Start(); + + if ( iWmPlugin->WmInstaller().UninstallUid() != KNullUid || + iWmPlugin->WmInstaller().IsActive() ) + { + ret = KErrGeneral; + } + } + _RETURN("WaitUninstallToFinnishL End", ret); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::WasUnistalled +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::WasUnistalledL( CStifItemParser& aItem ) + { + TInt ret = KErrNone; + TPtrC id; + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + aItem.GetNextString( id ); + + RWidgetRegistryClientSession widgetRegistry; + User::LeaveIfError( widgetRegistry.Connect() ); + CleanupClosePushL( widgetRegistry ); + + TInt uid = widgetRegistry.GetWidgetUidL( id ); + + if ( uid != KErrNone ) + { + ret = KErrGeneral; + } + CleanupStack::PopAndDestroy( &widgetRegistry ); + + _RETURN("WasUnistalled End", ret); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::CancelUninstall +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::CancelUninstall( CStifItemParser& aItem ) + { + TInt ret = KErrNone; + iWmPlugin->WmInstaller().Cancel(); + + TBool active = iWmPlugin->WmInstaller().IsActive(); + if ( active ) + { + ret = KErrGeneral; + } + _RETURN("CancelUninstall End", ret ); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::StartTimer +// ----------------------------------------------------------------------------- +// +void CWmUnitTest::StartTimerL() + { + if ( !iTimer ) + iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + + TTimeIntervalMicroSeconds32 delay( 4*1000*1000 ); // 2 sec + iTimer->Start( delay, delay, TCallBack( Timeout, this ) ); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::Timeout +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::Timeout( TAny* aPtr ) + { + CWmUnitTest* self = static_cast( aPtr ); + if ( self->iWmPlugin->WmInstaller().IsActive() ) + { + return 1; + } + else + { + self->iTimer->Cancel(); + CActiveScheduler::Stop(); + return 0; + } + } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/group/aixmluimain.mmp --- a/idlehomescreen/xmluicontroller/group/aixmluimain.mmp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/group/aixmluimain.mmp Wed May 12 13:22:51 2010 +0300 @@ -55,6 +55,7 @@ SOURCE contentpublisher.cpp SOURCE globalqueryhandler.cpp SOURCE onlineofflinehelper.cpp +SOURCE cenrepobserver.cpp START RESOURCE ai3xmluimain.rss diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/inc/aieventhandler.h --- a/idlehomescreen/xmluicontroller/inc/aieventhandler.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/inc/aieventhandler.h Wed May 12 13:22:51 2010 +0300 @@ -81,6 +81,12 @@ * Own. */ CLiwServiceHandler* iServiceHandler; + + /** + * Service interface. + * Own + */ + MLiwInterface* iMsgInterface; }; } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/inc/aixmluiconstants.h --- a/idlehomescreen/xmluicontroller/inc/aixmluiconstants.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/inc/aixmluiconstants.h Wed May 12 13:22:51 2010 +0300 @@ -112,6 +112,7 @@ _LIT8( KConfiguration, "configuration" ); _LIT8( KNewsTicker, "newsticker" ); _LIT8( KAnimation, "animation" ); + _LIT8( KTextEditor, "texteditor" ); } } // End of namespace xml @@ -120,6 +121,7 @@ #define KContentTypeText TPtrC8( reinterpret_cast< const TText8* >( KAiContentTypeText ) ) #define KContentTypeBitmap TPtrC8( reinterpret_cast< const TText8* >( KAiContentTypeBitmap ) ) +#define KContentTypeData TPtrC8( reinterpret_cast< const TText8* >( KAiContentTypeData )) _LIT8( KContentTypeImage, "image/" ); _LIT8( KContentTypeImageSvg, "image/svg+xml" ); _LIT( KTargetSliderVolumeValue, "slider::volume" ); diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/inc/aixuikoneventhandler.h --- a/idlehomescreen/xmluicontroller/inc/aixuikoneventhandler.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/inc/aixuikoneventhandler.h Wed May 12 13:22:51 2010 +0300 @@ -38,6 +38,7 @@ class CContentRenderer; class MAiUiEventHandler; class MAiApplicationEventHandler; +class CAIEventHandler; /** * @ingroup group_xmluicontroller @@ -169,6 +170,12 @@ * Not owned. */ XnVolumeControlInterface::MXnVolumeControlInterface* iVolumeControl; + + /** + * AiEvent handler + * Owned + */ + CAIEventHandler* iAiEventHandler; }; } // namespace AiXmlUiController diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/inc/aixuikonmenueventhandler.h --- a/idlehomescreen/xmluicontroller/inc/aixuikonmenueventhandler.h Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,223 +0,0 @@ -/* -* Copyright (c) 2007-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: Used for handling XUIKON menu events -* -*/ - - -#ifndef C_MENUEVENTHANDLER_H -#define C_MENUEVENTHANDLER_H - -#include -#include "xnmenu.h" -#include "xnbitmap.h" - -class CXnNodeAppIf; -class TXnUiEngineAppIf; -class MAiStrParser; -class MAiFwEventHandler; -class MAiPSPropertyObserver; -class CXnAppUiAdapter; -class CXnDomNode; -class XnMenuInterface::MXnMenuObserver; - -enum TAICBA - { - EAIMenuOff = 1, - EAIMenuOn - }; - - -namespace AiXmlUiController -{ - -/** - * @ingroup group_xmluicontroller - * - * This class is used for handling XUIKON events. - * - * Menu events are handled in here. This class parses - * the events and decides what to do with them. - * - * @lib AiXmlUiMain - */ -class CAIXuikonMenuEventHandler : public CBase, public XnMenuInterface::MXnMenuObserver - { -public: - - static CAIXuikonMenuEventHandler* NewL(TXnUiEngineAppIf& aUiEngine, - MAiFwEventHandler* aFwEventHandler, - CXnAppUiAdapter* aAppUi); - - ~CAIXuikonMenuEventHandler(); - - TBool HandleEventL( const TDesC8& aEventString8, CXnNodeAppIf* aOrigin = NULL, CXnDomNode* aEvent = NULL ); - -private: - CAIXuikonMenuEventHandler(TXnUiEngineAppIf& aUiEngine, - MAiFwEventHandler* aFwEventHandler, - CXnAppUiAdapter* aAppUi); - - void ConstructL(); - - static TInt HandleKeylockEvent(TAny* aSelf); - - void SetCBALabelsL(TAICBA aCBA, CXnDomNode* aEvent); - - void ShowMenuL(TBool aShow, const TDesC8& aMenuId, CXnDomNode* aEvent); - - void ShowMenuItemL(const TDesC8& aMenuItemId, TBool aShow, CXnDomNode* aEvent ); - - TBool IsMenuItemVisibleL( const TDesC8& aMenuItemId, CXnDomNode* aEvent ); - - void ParseParameterStringL(const TDesC8& aSourcePtr, TPtrC8& aTargetPtr); - - void RecurseChildrenL(TBool aShow, CXnNodeAppIf* aNode); - - void DoMacrosetL(const TDesC8& aMacrosetNodeId, CXnDomNode* aEvent); - - void GetTextFromElementL(HBufC8*& aMemberPtr, const TDesC8& aItemId, CXnDomNode* aEvent); - - TBool HandleMacroOperationL(const TDesC8& aSourcePtr, CXnNodeAppIf& aTargetNode, CXnDomNode& aEvent ); - - TBool AttemptRestoreSoftkeyIconL( - XnMenuInterface::MXnMenuInterface* aControl, - XnImageInterface::MXnImageInterface* aIconControl, - CXnNodeAppIf* aSourceNode, - XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ); - - void SetSoftkeyLabelL( - XnMenuInterface::MXnMenuInterface* aControl, - const TDesC8* aLabel, - XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ); - - void SetObserverL( const TDesC8& aParam, CXnDomNode* aEvent ); - - TBool InitEditModeMenuItemL( CXnNodeAppIf& aMenuItem, CXnNodeAppIf* aFocused, const TDesC8& aSource ); - - TBool InitDefaultModeMenuItemL( CXnNodeAppIf& aMenuItem, CXnNodeAppIf* aFocused, const TDesC8& aSource ); - - CXnProperty* GetWidgetPropertyL(CXnNodeAppIf& aPlugin, const TDesC8& aProperty); - -private: // from XnMenuInterface::MXnMenuObserver - TBool DynInitMenuItemL( CXnNodeAppIf& aMenuItem ); - -private: - TBool DynInitItemL( CXnNodeAppIf& aMenuItem, CXnNodeAppIf* aFocused ); - -private: // data - - /** - * Current CBA mode, menu/normal(shortcut). - */ - TAICBA iCurrentCBA; - - /** - * Pointer to UI engine IF. Not own. - */ - TXnUiEngineAppIf* iUiEngine; - - /** - * String parser utility. Own. - */ - MAiStrParser* iStrParser; - - /** - * Menu item Open event string. - * Own. - */ - HBufC* iActivationEvent; - - /** - * Menu item settings event string. - * Own. - */ - HBufC* iSettingsEvent; - - /** - * Close action id. - * Own. - */ - TPtrC8 iCloseActionId; - - /** - * Menu mode softkey labels. - * Own. - */ - HBufC8* iMenuModeLskLabel; - HBufC8* iMenuModeRskLabel; - - /** - * Normal mode softkey labels. - * Own. - */ - HBufC8* iNormalModeLskLabel; - HBufC8* iNormalModeRskLabel; - - /** - * Normal mode softkey label ids. - * Own. - */ - TPtrC8 iNormalModeLskLabelId; - TPtrC8 iNormalModeRskLabelId; - - /** - * Normal mode softkey icon ids. - * Own. - */ - TPtrC8 iNormalModeLskIconId; - TPtrC8 iNormalModeRskIconId; - - /** - * App softkey ids. - * Own. - */ - TPtrC8 iLskId; - TPtrC8 iRskId; - - TPtrC8 iLskMenuModeNode; - TPtrC8 iRskMenuModeNode; - /** - * Plug-in event handler. - * Doesn't own. - */ - MAiFwEventHandler* iFwEventHandler; - - /** - * Observers keylock status - * Owned - */ - MAiPSPropertyObserver* iKeylockObserver; - - /** - * Pointer to Appui for closing the menubar when necessary - * Not owned - */ - CXnAppUiAdapter* iAppUi; - /** - * For comparing has the bitmap changed. RSK - * Not owned. - */ - CFbsBitmap* iMenumodeBitmapRsk; - /** - * For comparing has the bitmap changed. LSK - * Not owned. - */ - CFbsBitmap* iMenumodeBitmapLsk; - - }; - -} // namespace AiXmlUiController - -#endif // C_MENUEVENTHANDLER_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/inc/appui.h --- a/idlehomescreen/xmluicontroller/inc/appui.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/inc/appui.h Wed May 12 13:22:51 2010 +0300 @@ -19,12 +19,15 @@ #ifndef C_APPUI_H #define C_APPUI_H +// System includes #include + +// User includes +#include #include "xnappuiadapter.h" - +// Forward declarations class CAiUiIdleIntegration; -class MAiUiFrameworkObserver; namespace AiXmlUiController { @@ -40,7 +43,7 @@ * * @lib AiXmlUiMain */ -NONSHARABLE_CLASS( CAppUi ) : public CXnAppUiAdapter, +NONSHARABLE_CLASS( CAppUi ) : public CXnAppUiAdapter, public MCoeViewActivationObserver { public: // Constructors and destructor @@ -55,38 +58,69 @@ private: // from CXnAppUiAdapter + void PrepareToExit(); - - void HandleForegroundEventL( TBool aForeground ); - + void HandleCommandL( TInt aCommand ); - - void HandleResourceChangeL( TInt aType ); void HandleXuikonEventL( CXnNodeAppIf& aOrigin, CXnNodeAppIf& aTrigger, - CXnDomNode& aTriggerDefinition, CXnDomNode& aEvent ); + CXnDomNode& aTriggerDefinition, CXnDomNode& aEvent ); + + void HandleEventL( const TDesC& aEvent, CXnNodeAppIf& aDestination ); void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination ); - void LoadDataPluginsL( RPointerArray< CXnNodeAppIf >& aList ); - - void DestroyDataPluginsL( RPointerArray< CXnNodeAppIf >& aList ); - - void SetOnlineStateL( RPointerArray< CXnNodeAppIf >& aList ); - + TInt LoadPublisher( CXnNodeAppIf& aPublisher, TInt aReason ); + + TInt DestroyPublisher( CXnNodeAppIf& aPublisher, TInt aReason ); + TBool DynInitMenuItemL( const TDesC& aItemType, RPointerArray< CXnNodeAppIf >* aList = NULL ); - - void HandlePageSwitch(); void HandleEnterEditModeL( TBool aEnter ); - + + void HandleUiReadyEventL(); + private: // new functions - void LoadNativeDataPluginsL(); - void DestroyNativeDataPluginsL(); + + /** + * Starts long press recognizer of Send key. + * + * @since S60 5.2 + */ + void StartKeyTimerL(); + + /** + * Stops Send key long press recognizer. + * + * @since S60 5.2 + */ + void StopKeyTimer(); + /** + * Launches Voice command application after long Send key is pressed. + * + * @since S60 5.2 + */ + void LaunchVoiceCommandL(); + + /** + * Callback function for long press timer of the Send key. + * + * @since S60 5.2 + */ + static TInt ReportLongPressL( TAny* aThis ); + + /** + * Sets title pane text + * + * @since S60 5.2 + * @param aText Text to set + */ + void SetTitlePaneTextL( const TDesC& aText ); + private: // from MCoeViewActivationObserver @@ -95,14 +129,30 @@ */ void HandleViewActivation( const TVwsViewId& aNewlyActivatedViewId, const TVwsViewId& aViewIdToBeDeactivated ); - + +private: + // from CCoeAppUi + + /** + * Gets a list of help contexts for a particular + * application user interface. + */ + CArrayFix* HelpContextL() const; + public: // new functions /** + * Activates UI. Called by UI controller during bootup sequence. + * + * @since S60 5.2 + */ + void ActivateUi(); + + /** * Sets plugins online state * - * @since S60 5.0 + * @since S60 5.2 * @param aOnline ETrue to enter online, EFalse to offline * */ @@ -115,6 +165,14 @@ * @return Ui Controller */ CXmlUiController& UiController() const; + + /** + * Gets online/offline helper object + * + * @since S60 5.2 + * @return online/offline helper + */ + COnlineOfflineHelper* Helper() const; private: // Constructors @@ -126,45 +184,24 @@ private: // data - /** - * UI Controller implementation. Not own. - */ + /** UI Controller implementation, not owned */ CXmlUiController& iUiCtl; - - /** - * Event handler. Own. - */ - CAIXuikonEventHandler* iEventHandler; - - /** - * Content renderer. Own. - */ - CContentRenderer* iContentRenderer; - - /** - * Ui framework event observer. Not own. - */ - MAiUiFrameworkObserver* iUiFwObserver; - - /** - * Idle Integration helper object. Own. - */ + /** Event handler, owned */ + CAIXuikonEventHandler* iEventHandler; + /** Content renderer, owned */ + CContentRenderer* iContentRenderer; + /** Idle Integration helper object, owed */ CAiUiIdleIntegration* iIdleIntegration; - - /** - * Online/Offline helper object. Own. - */ - COnlineOfflineHelper* iHelper; - - /** - * Flag to indicate whether native plugins are loaded. - */ - TBool iNativePluginsLoaded; - - /** - * Flag to indicate whether edit mode is active. - */ - TBool iIsEditModeActive; + /** Online/Offline helper object, owned */ + COnlineOfflineHelper* iHelper; + /** Timer for Send key long press recognition, owned */ + CPeriodic* iKeyTimer; + /** Edit mode title pane text, owned */ + HBufC* iEditModeTitle; + /** DeviceStatus publisher info */ + THsPublisherInfo iDeviceStatusInfo; + /** Flag to indicate whether edit mode is active */ + TBool iInEditMode; }; } // namespace AiXmlUiController diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/inc/cenrepobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/cenrepobserver.h Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms 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: Listens for changes in a Central Repository key. +* +*/ + +#ifndef CENREPOBSERVER_H +#define CENREPOBSERVER_H + +// FORWARD DECLARATIONS +class CRepository; +class MCenRepObserver; + +// Stop requesting new notifications after this many consecutive errors +const TInt KCenRepErrorRetryCount = 80; + +namespace AiXmlUiController +{ + +/** +* MCenRepObserver +* +* Client application must implement the CenRepObserver interface in +* order to receive a notification when Central Repository key +* KCRUidCmManager/ KCurrentCellularDataUsage changes. +* +*/ +class MCenRepObserver + { +public: + /** + * This method is called every time when Central Repository key + * KCRUidCmManager/ KCurrentCellularDataUsage changes. + * + * @param aValue The new value for KCurrentCellularDataUsage. + * + */ + virtual void CurrentCellularDataUsageChangedL( const TInt aValue ) = 0; + }; + +/** +* CCenRepObserver +* +*/ +NONSHARABLE_CLASS( CCenRepObserver ) : public CActive + { +public: // Constructors and destructor + static CCenRepObserver* NewL( MCenRepObserver* aObserver ); + + static CCenRepObserver* NewLC( MCenRepObserver* aObserver ); + + virtual ~CCenRepObserver(); + +private: + CCenRepObserver( MCenRepObserver* aObserver ); + + void ConstructL(); + + /** + * Request notification for network setting change + */ + void RequestNotifications(); + +private: // Methods from base class + void DoCancel(); + void RunL(); + +private: + /** + * Cenrep Observer. Not own + */ + MCenRepObserver* iObserver; + + /** + * Cenrep repository. Own + */ + CRepository* iRepository; + + /** + * Cenrep read error count. + */ + TInt iErrorCounter; + }; +}// namespace AiXmlUiController +#endif // AOCENREPOBSERVER_H + +// End-of-file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/inc/contentpublisher.h --- a/idlehomescreen/xmluicontroller/inc/contentpublisher.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/inc/contentpublisher.h Wed May 12 13:22:51 2010 +0300 @@ -34,13 +34,10 @@ class CLiwGenericParamList; class CLiwServiceHandler; class MLiwInterface; -class CAknGlobalConfirmationQuery; namespace AiXmlUiController { class CXmlUiController; -class CGlobalQueryHandler; - /** * @ingroup group_xmluicontroller @@ -113,14 +110,6 @@ void RegisterListenerL(); void UnRegisterListenerL(); - /** - * Displayes global query for 'go online' or 'go offline' confirmations - * @param aResourceId resource id for the text string - * @param aSetOnline if ETrue then set widgets online if confirmation accepted, - * if EFalse then set widgets offline if confirmation accepted - */ - void ShowGlobalQueryL( TInt aResourceId, TBool aSetOnline ); - private: MLiwInterface* iCpsInterface; CLiwServiceHandler* iServiceHandler; @@ -129,10 +118,6 @@ * Reference to XML ui controller. */ CXmlUiController& iUiController; - - CGlobalQueryHandler* iGlobalQueryHandler; - CAknGlobalConfirmationQuery* iGlobalConfirmationQuery; - }; }// namespace AiXmlUiController diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/inc/contentrenderer.h --- a/idlehomescreen/xmluicontroller/inc/contentrenderer.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/inc/contentrenderer.h Wed May 12 13:22:51 2010 +0300 @@ -19,17 +19,22 @@ #ifndef C_CONTENTRENDERER_H #define C_CONTENTRENDERER_H +// System includes #include #include + +// User includes #include "xnnewsticker.h" +#include "aicontentobserver.h" #include "xnproperty.h" -#include "aicontentobserver.h" +// Forward declarations class TXnUiEngineAppIf; class CXnNodeAppIf; class CGulIcon; class MAiFwEventHandler; -struct TAiPublisherInfo; +class CHsContentPublisher; +class THsPublisherInfo; namespace AiUtility { @@ -50,7 +55,6 @@ class TAiPolicyElement; } - namespace AiXmlUiController { @@ -62,15 +66,19 @@ * @lib AiXmlUiMain */ class CContentRenderer : public CBase, - public MAiContentObserver, - public XnNewstickerInterface::MXnNewstickerCallbackInterface + public MAiContentObserver, + public XnNewstickerInterface::MXnNewstickerCallbackInterface { -public: // Constructors and destructor +public: + // Constructors and destructor static CContentRenderer* NewL( CAppUi& aAppUi ); - virtual ~CContentRenderer(); + ~CContentRenderer(); +public: + // New functions + /** * Sets event handler. * @@ -79,138 +87,158 @@ void SetEventHandler( MAiFwEventHandler& aFwEventHandler ); /** - * Resets content renderer for new theme. - */ - void Reset(); - - /** * Cleans all content items published by aPlugin. */ - void CleanPluginFromUi( MAiPropertyExtension& aPlugin ); + void CleanPluginFromUi( CHsContentPublisher& aPlugin ); -// Functions from MAiContentObserver +public: + // from MAiContentObserver + /** + * @see MAiContentObserver + */ TInt StartTransaction( TInt aTxId ); + /** + * @see MAiContentObserver + */ TInt Commit( TInt aTxId ); + /** + * @see MAiContentObserver + */ TInt CancelTransaction( TInt aTxId ); - TBool CanPublish( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aIndex ); - - TInt Publish( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aResource, - TInt aIndex ); + /** + * @see MAiContentObserver + */ + TBool CanPublish( CHsContentPublisher& aPlugin, + TInt aContent, TInt aIndex ); + + /** + * @see MAiContentObserver + */ + TInt Publish( CHsContentPublisher& aPlugin, + TInt aContent, TInt aResource, TInt aIndex ); + + /** + * @see MAiContentObserver + */ + TInt Publish( CHsContentPublisher& aPlugin, + TInt aContent, const TDesC16& aText, TInt aIndex ); - TInt Publish( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC16& aText, - TInt aIndex ); + /** + * @see MAiContentObserver + */ + TInt Publish( CHsContentPublisher& aPlugin, + TInt aContent, const TDesC8& aBuf, TInt aIndex ); - TInt Publish( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC8& aBuf, - TInt aIndex ); + /** + * @see MAiContentObserver + */ + TInt Publish( CHsContentPublisher& aPlugin, + TInt aContent, RFile& aFile, TInt aIndex ); - TInt Publish( MAiPropertyExtension& aPlugin, - TInt aContent, - RFile& aFile, - TInt aIndex ); + /** + * @see MAiContentObserver + */ + TInt Clean( CHsContentPublisher& aPlugin, + TInt aContent, TInt aIndex ); - TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); - + /** + * @see MAiContentObserver + */ TAny* Extension( TUid aUid ); - TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const; - - TInt SetProperty(MAiPropertyExtension& aPlugin, - const TDesC8& aElementId, - const TDesC8& aPropertyName, - const TDesC8& aPropertyValue ); + /** + * @see MAiContentObserver + */ + TBool RequiresSubscription( + const THsPublisherInfo& aPublisherInfo ) const; + + /** + * @see MAiContentObserver + */ + TInt SetProperty( CHsContentPublisher& 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); + /** + * @see MAiContentObserver + */ + TInt SetProperty( CHsContentPublisher& aPlugin, + const TDesC8& aElementId, const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + MAiContentObserver::TValueType aValueType ); + +private: + // Constructors - CXnDomPropertyValue::TPrimitiveValueType - DomPropertyValueType(MAiContentObserver::TValueType aValueType); - -private: - + /** + * C++ default constructor + */ CContentRenderer( CAppUi& aAppUi ); + /** + * 2nd phase constructor + */ void ConstructL(); +private: + // New functions + void DoStartTransactionL( TInt aTxId ); - TInt CanPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aIndex ); - - TInt DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aResource, - TInt aIndex); + TInt CanPublishL( CHsContentPublisher& aPlugin, + TInt aContent, TInt aIndex ); + + TInt DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, TInt aResource, TInt aIndex ); - TInt DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC16& aText, - TInt aIndex ); + TInt DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, const TDesC16& aText, TInt aIndex ); - TInt DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC8& aBuf, - TInt aIndex ); - - TInt DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - RFile& aFile, - TInt aIndex ); - - TInt DoCleanL( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aIndex ); - + TInt DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, const TDesC8& aBuf, TInt aIndex ); + + TInt DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, RFile& aFile, TInt aIndex ); + + TInt DoCleanL( CHsContentPublisher& aPlugin, + TInt aContent, TInt aIndex ); + void SetImmediateMode( TBool aImmediateMode ); TBool IsImmediateMode() const; - void ProcessTransactionElementL( MTransactionElement* aElement ); + void ProcessTransactionElementL( + MTransactionElement* aElement ); + + CXnNodeAppIf* FindNodeByClassL( + const TDesC& aCid, TInt aIndex, const TDesC8& aNs ); - CXnNodeAppIf* FindNodeByClassL( const TDesC& aCid, - TInt aIndex, - const TDesC8& aNs ); + CXnNodeAppIf* FindNodeByIdL( + const TDesC& aCid, const TDesC& aNs = KNullDesC ); - CXnNodeAppIf* FindNodeByIdL( const TDesC& aCid, const TDesC& aNs = KNullDesC ); - - CXnNodeAppIf* FindNodeByIdL( const TDesC8& aCid, const TDesC8& aNs = KNullDesC8 ); + CXnNodeAppIf* FindNodeByIdL( + const TDesC8& aCid, const TDesC8& aNs = KNullDesC8 ); - TInt PublishIconL( MAiPropertyExtension& aPlugin, - const TDesC& aCid, - CGulIcon* aIcon, - TInt aIndex, - CXnNodeAppIf* aResource = NULL ); + TInt PublishIconL( CHsContentPublisher& aPlugin, + const TDesC& aCid, CGulIcon* aIcon, TInt aIndex, + CXnNodeAppIf* aResource = NULL ); - TInt PublishDataL( MAiPropertyExtension& aPlugin, - const TDesC& aCid, - const TDesC8& aData, - const TDesC8& aContentType, - TInt aIndex, - CXnNodeAppIf* aResource = NULL ); + TInt PublishDataL( CHsContentPublisher& aPlugin, + const TDesC& aCid, const TDesC8& aData, + const TDesC8& aContentType, TInt aIndex, + CXnNodeAppIf* aResource = NULL ); - TBool AllowPublishByPriority( CXnNodeAppIf& aUiElement, - TInt aNewPriority ) const; - + TBool AllowPublishByPriority( + CXnNodeAppIf& aUiElement, TInt aNewPriority ) const; + void StartContentRefresh(); - TInt RefreshContentL( HBufC* aUiElementId, - TInt aOldPriority ); - + TInt RefreshContentL( HBufC* aUiElementId, TInt aOldPriority ); + static TInt RefreshContentCallback( TAny* aContentRenderer ); void SendRefreshContentEventL(); @@ -218,97 +246,55 @@ TBool IsParentNewsticker( CXnNodeAppIf& aTarget ); void RegisterNewstickerCallbackInterfaceL( CXnNodeAppIf& aTarget ); + + void ProcessContentChangesL( MTransaction& aTr ); + void ProcessContentChangeL( TAiPolicyElement& aElement ); - TInt SetPropertyL(MAiPropertyExtension& aPlugin, - const TDesC8& aElementId, - const TDesC8& aPropertyName, - const TDesC8& aPropertyValue, - MAiContentObserver::TValueType aValueType); - -// From XnNewstickerInterface::MXnNewstickerCallbackInterface + TInt SetPropertyL( CHsContentPublisher& aPlugin, + const TDesC8& aElementId, const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, MAiContentObserver::TValueType aValueType ); + + CXnDomPropertyValue::TPrimitiveValueType DomPropertyValueType( + MAiContentObserver::TValueType aValueType ); + +private: + // From XnNewstickerInterface::MXnNewstickerCallbackInterface void TitleScrolled(TInt aTitleIndex); void TitleToScroll(TInt aTitleIndex); - void CleanPluginFromUiL( MAiPropertyExtension& aPlugin ); - - void ProcessContentChangesL( MTransaction& aTr ); - void ProcessContentChangeL( TAiPolicyElement& aElement ); - -private: // Data - - /** - * Transaction stack. Own. - */ - CActiveTransactionStack* iStack; - - /** - * Factory for transacations. Own. - */ - CTransactionFactoryImpl* iFactory; - - /** - * Immediate mode flag. Own. - */ - TBool iImmediateMode; - - /** - * App UI - */ - CAppUi& iAppUi; - - /** - * Node lookup id generator. Own. - */ - CXmlNodeIdGenerator* iNodeIdGenerator; - - /** - * Content priority map. Own. - */ - AiUtility::CContentPriorityMap* iContentPriorityMap; +private: + // data - /** - * Map of refreshable ui elements. - */ - RPtrHashMap< TDesC, TInt > iRefreshableUiElements; - - /** - * Timer for asynchronous content refreshing - */ - CPeriodic* iTimer; - - /** - * Fw event handler needed for content refresh event notifications. - * Not own. - */ + /** Transaction stack, Owned. */ + CActiveTransactionStack* iStack; + /** Factory for transacations, Owned. */ + CTransactionFactoryImpl* iFactory; + /** Immediate mode flag, Owned. */ + TBool iImmediateMode; + /** AppUI, Not owned. */ + CAppUi& iAppUi; + /** Node lookup id generator, Owned. */ + CXmlNodeIdGenerator* iNodeIdGenerator; + /** Content priority map, Owned. */ + AiUtility::CContentPriorityMap* iContentPriorityMap; + /** Map of refreshable ui elements. */ + RPtrHashMap< TDesC, TInt > iRefreshableUiElements; + /** Timer for asynchronous content refreshing, Owned. */ + CPeriodic* iTimer; + /** Fw event handler, Not owned. */ MAiFwEventHandler* iFwEventHandler; - - /** - * Newsticker callback handler - */ - CNewstickerCallbackHandler* iCallbackHandler; - - /** - * Pointer descriptor to newsticker plugin name - */ - TPtrC iNTPublisher; - - /** - * Newsticker element property class. - */ - HBufC* iNTClass; - - /** - * CSS property map. Own - */ - CCssPropertyMap* iPropertyMap; - - /** - * Publishing policy evaluator. Own. - */ + /** Newsticker callback handler, Owned */ + CNewstickerCallbackHandler* iCallbackHandler; + /** Pointer descriptor to newsticker plugin name */ + TPtrC iNTPublisher; + /** Newsticker element property class, Owned */ + HBufC* iNTClass; + /** CSS property map, Owned. */ + CCssPropertyMap* iPropertyMap; + /** Publishing policy evaluator, Owned. */ CPolicyEvaluator* iPolicyEvaluator; - }; } // namespace AiXmlUiController diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/inc/onlineofflinehelper.h --- a/idlehomescreen/xmluicontroller/inc/onlineofflinehelper.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/inc/onlineofflinehelper.h Wed May 12 13:22:51 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,17 +22,20 @@ #include #include #include +#include +#include "cenrepobserver.h" // Forward declrations class CNWSession; class CProfileChangeNotifyHandler; class CXnNodeAppIf; +class CAknGlobalConfirmationQuery; namespace AiXmlUiController { // Forward declrations class CXmlUiController; - +class CGlobalQueryHandler; // Classe declaration @@ -45,7 +48,7 @@ */ class COnlineOfflineHelper : public CBase, - public MNWMessageObserver, public MProfileChangeObserver + public MNWMessageObserver, public MProfileChangeObserver, public MCenRepObserver { public: // Constructors @@ -71,6 +74,18 @@ */ void ConstructL(); +public : + // from MCenRepObserver + + /** + * This method is called every time when Central Repository key + * KCRUidCmManager/ KCurrentCellularDataUsage changes. + * + * @param aValue The new value for KCurrentCellularDataUsage. + * + */ + void CurrentCellularDataUsageChangedL( const TInt aValue ); + public: // New functions @@ -91,14 +106,6 @@ TBool ShowOfflineItem() const; /* - * Check and set whether online/offline state is needed by plugins - * - * @since S60 5.0 - * @param aList List of plugins - */ - void ProcessOnlineStateL( RPointerArray< CXnNodeAppIf >& aList ); - - /* * Set online or offline state based on user selection * * @since S60 5.0 @@ -106,6 +113,22 @@ */ void ProcessOnlineStateL( TBool aOnline ); + /* + * Handles the connection query dialogs + * + * @since S60 5.0 + * @param aConnection connection disconnected or connected + */ + void HandleConnectionQueryL( const TDesC& aConnection); + + /** + * Displayes global query for 'go online' or 'go offline' confirmations + * @param aResourceId resource id for the text string + * @param aSetOnline if ETrue then set widgets online if confirmation accepted, + * if EFalse then set widgets offline if confirmation accepted + */ + void ShowGlobalQueryL( TInt aResourceId, TBool aSetOnline ); + private: // from MNWMessageObserver @@ -146,7 +169,10 @@ TBool HasNetworkInfoChanged( const TNWMessages aMsg ); void InterpretNWMessageL( const TNWMessages aMessage, const TNWInfo ); - void SetOnlineL( TBool aOnline ); + void SetOnline( TBool aOnline ); + + void CurrentNetworkSetting(); + private: // Data types @@ -167,9 +193,12 @@ enum { + // if defined Home Screen is in online mode. EOnline, - EUtilizeOnline, + // if defined there is no need to show automatic offline note + // and automatic offline setting is disabled. ERoamingShown, + // if defined phone profile is offline. EOfflineProfile }; private: @@ -222,12 +251,34 @@ * Flags */ TBitFlags32 iFlags; + + /** + * Network setting observer, owned + */ + CCenRepObserver *iNwSettingObserver; + + /** + * Home network setting + */ + TInt iHomeNetwork; + + /** + * Roaming network setting + */ + TInt iRoamingNetwork; + + /** + * Global query handler, owned. + */ + CGlobalQueryHandler* iGlobalQueryHandler; + + /** + * Global confirmation query, owned. + */ + CAknGlobalConfirmationQuery* iGlobalConfirmationQuery; + }; }// namespace AiXmlUiController #endif //ONLINEOFFLINEHELPER_H - - - - diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/inc/xmlnodeidgenerator.h --- a/idlehomescreen/xmluicontroller/inc/xmlnodeidgenerator.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/inc/xmlnodeidgenerator.h Wed May 12 13:22:51 2010 +0300 @@ -19,15 +19,18 @@ #ifndef C_XMLNODEIDGENERATOR_H #define C_XMLNODEIDGENERATOR_H +// System includes #include -class MAiPropertyExtension; -struct TAiPublisherInfo; +// User includes + +// Forward declarations +class CHsContentPublisher; +class THsPublisherInfo; struct TAiContentItem; namespace AiXmlUiController { - /** * @ingroup group_xmluicontroller * @@ -36,25 +39,27 @@ * * @lib AiXmlUiMain */ -class CXmlNodeIdGenerator : public CBase +NONSHARABLE_CLASS( CXmlNodeIdGenerator ) : public CBase { -public: // Construction +public: + // Constructor and destructor static CXmlNodeIdGenerator* NewL(); ~CXmlNodeIdGenerator(); -// New methods +public: + // New functions /** * Generates an identifier that is used to look up settings node from * XML UI model. * - * @param aPubInfo Active Idle publisher info to use in the - * identifier generation. + * @param aPublisherInfo Active Idle publisher info to use in the + * identifier generation. * @return content node identifier. */ - TPtrC SettingsNodeIdL( const TAiPublisherInfo& aPubInfo); + TPtrC SettingsNodeIdL( const THsPublisherInfo& aPublisherInfo ); /** * Generates an identifier that is used to look up content node from @@ -66,19 +71,21 @@ * identifier generation. * @return content node identifier. */ - TPtrC ContentNodeIdL(MAiPropertyExtension& aPlugin, const TAiContentItem& aContentItem); + TPtrC ContentNodeIdL( CHsContentPublisher& aPlugin, + const TAiContentItem& aContentItem ); /** * Generates an identifier that is used to look up content node from * XML UI model. * - * @param aPubInfo Active Idle publisher info to use in the - * identifier generation. - * @param aContentItem Active Idle content item to use in the - * identifier generation. + * @param aPublisherInfo Active Idle publisher info to use in the + * identifier generation. + * @param aContentItem Active Idle content item to use in the + * identifier generation. * @return content node identifier. */ - TPtrC ContentNodeIdL(const TAiPublisherInfo& aPubInfo, const TAiContentItem& aContentItem); + TPtrC ContentNodeIdL( const THsPublisherInfo& aPublisherInfo, + const TAiContentItem& aContentItem ); /** * Generates an identifier that is used to look up resource node from @@ -90,32 +97,39 @@ * identifier generation. * @return resource node identifier. */ - TPtrC ResourceNodeIdL(MAiPropertyExtension& aPlugin, const TAiContentItem& aContentItem); + TPtrC ResourceNodeIdL( CHsContentPublisher& aPlugin, + const TAiContentItem& aContentItem ); /** * Generates an identifier that is used to look up resource node from * XML UI model. * - * @param aPubInfo Active Idle publisher info to use in the - * identifier generation. - * @param aContentItem Active Idle content item to use in the - * identifier generation. + * @param aPublisherInfo Active Idle publisher info to use in the + * identifier generation. + * @param aContentItem Active Idle content item to use in the + * identifier generation. * @return resource node identifier. */ - TPtrC ResourceNodeIdL(const TAiPublisherInfo& aPubInfo, const TAiContentItem& aContentItem); + TPtrC ResourceNodeIdL( const THsPublisherInfo& aPublisherInfo, + const TAiContentItem& aContentItem ); -private: // Construction - - CXmlNodeIdGenerator(); +private: + // Constructors - void ConstructL(); - -private: // Data + /** + * C++ default constructor + */ + CXmlNodeIdGenerator(); + +private: + // data - HBufC* iContentNodeIdBuf; - + /** Content node id buffer, Owned */ + HBufC* iContentNodeIdBuf; }; } // namespace AiXmlUiController #endif // C_XMLNODEIDGENERATOR_H + +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/inc/xmluicontroller.h --- a/idlehomescreen/xmluicontroller/inc/xmluicontroller.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/inc/xmluicontroller.h Wed May 12 13:22:51 2010 +0300 @@ -15,42 +15,42 @@ * */ +#ifndef _XMLUICONTROLLER_H +#define _XMLUICONTROLLER_H -#ifndef C_XMLUICONTROLLER_H -#define C_XMLUICONTROLLER_H +// System includes +// User includes #include #include "aiuicontroller.h" #include "aiuieventhandler.h" - +// Constants const TInt KImplementationUidXmlUiController = AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML; const TUid KUidXmlUiController = { KImplementationUidXmlUiController }; - +// Forward declarations class CApaApplication; class TXnUiEngineAppIf; class CXnNodeAppIf; class CRepository; +class THsPublisherInfo; namespace AiXmlUiController { - class CAppUi; class CAIXuikonEventHandler; class CXmlNodeIdGenerator; class CContentRenderer; class CContentPublisher; - /** * @ingroup group_xmluicontroller * * Active Idle XML UI Controller. */ -class CXmlUiController : public CAiUiController, - public MAiMainUiController, - public MAiUiEventHandler +NONSHARABLE_CLASS( CXmlUiController ) : public CAiUiController, + public MAiMainUiController, public MAiUiEventHandler { public: // Constructors and destructor @@ -104,20 +104,20 @@ void NotifyAppEnvReadyL(); /** - * Gets UiFw observer - * - * @since S60 5.0 - * @return UiFw observer - */ - MAiUiFrameworkObserver* UiFrameworkObserver() const; - - /** * Gets UiFw event handler * * @since S60 5.0 * @return UiFw event handler */ MAiFwEventHandler* FwEventHandler() const; + + /** + * Gets UiFw state handler + * + * @since S60 5.2 + * @return UiFw state handler + */ + MAiFwStateHandler* FwStateHandler() const; /** * Gets UiEngine. @@ -136,135 +136,149 @@ CRepository& SettingsRepository() const; /** - * Gets native ui publishers - * - * @since S60 5.0 - * @param aPlugins Array where plugins are appended. - */ - void PublisherInfoL( RAiPublisherInfoArray& aPlugins ); - - /** * Gets xml ui publishers * - * @since S60 5.0 + * @since S60 5.2 * @param aSource Xml node which defineds the publisher - * @param aInfo Publisher info filled based aSource information + * @param aPublisherInfo Publisher info filled based aSource information */ void PublisherInfoL( CXnNodeAppIf& aSource, - TAiPublisherInfo& aInfo ); + THsPublisherInfo& aPublisherInfo ); public: // from CAiUiController + /** + * @see CAiUiController + */ void LoadUIDefinitionL(); - - void GetPluginsL( RAiPublisherInfoArray& aPlugins ); - - void GetSettingsL( const TAiPublisherInfo& aPubInfo, + + /** + * @see CAiUiController + */ + void GetSettingsL( const THsPublisherInfo& aPublisherInfo, RAiSettingsItemArray& aSettings ); + /** + * @see CAiUiController + */ void ActivateUI(); + /** + * @see CAiUiController + */ MAiContentObserver& GetContentObserver(); + /** + * @see CAiUiController + */ void SetEventHandler( MAiFwEventHandler& aFwEventHandler ); - void RemovePluginFromUI( MAiPropertyExtension& aPlugin ); - + /** + * @see CAiUiController + */ + void SetStateHandler( MAiFwStateHandler& aFwStateHandler ); + + /** + * @see CAiUiController + */ MAiMainUiController* MainInterface(); + /** + * @see CAiUiController + */ MAiSecondaryUiController* SecondaryInterface(); private: // from MAiMainUiController + /** + * @see MAiMainUiController + */ void RunApplicationL(); + /** + * @see MAiMainUiController + */ CCoeEnv& CoeEnv(); - - void SetUiFrameworkObserver( MAiUiFrameworkObserver& aObserver ); - + + /** + * @see MAiMainUiController + */ void Exit(); - + + /** + * @see MAiMainUiController + */ TBool IsMenuOpen(); private: // from MAiUiEventHandler + /** + * @see MAiUiEventHandler + */ TBool HandleUiEvent(TAny* aEvent, const TDesC8& aParam); private: // Constructors + /** + * C++ default constructor + */ CXmlUiController(); + /** + * 2nd phase constructor + */ void ConstructL(); private: - // New methods + // New functions + static CApaApplication* NewApplication(); - void HandleFocusGainedL( const TDesC8& aUiElement1, const TDesC8& aUiElement2, CXnNodeAppIf& aOrigin ); + void HandleFocusGainedL( const TDesC8& aUiElement1, + const TDesC8& aUiElement2, CXnNodeAppIf& aOrigin ); - void HandleSetElementSizeL( const TDesC8& aElementName, CXnNodeAppIf& aOrigin ); + void HandleSetElementSizeL( const TDesC8& aElementName, + CXnNodeAppIf& aOrigin ); - static TInt ExitTimerCallBack(TAny *aSelf); - - void GetSettingsFromCRL( const TAiPublisherInfo& aPubInfo, RAiSettingsItemArray &aPluginSettings ); + static TInt ExitTimerCallBack( TAny *aSelf ); + + void GetContentItemL( CXnNodeAppIf& aNode, + RAiSettingsItemArray& aSettings, HBufC*& aItemName ); - void GetContentItemL( CXnNodeAppIf& aNode, RAiSettingsItemArray& aSettings, HBufC*& aItemName ); + void GetConfigurationsL( CXnNodeAppIf& aNode, + RAiSettingsItemArray& aSettings, const TDesC& aConfOwner ); - void GetConfigurationsL( CXnNodeAppIf& aNode, RAiSettingsItemArray& aSettings, const TDesC& aConfOwner ); - - void GetContentModelL(const TAiPublisherInfo& aPubInfo, RAiSettingsItemArray& aSettings); + void GetContentModelL( const THsPublisherInfo& aPubInfo, + RAiSettingsItemArray& aSettings ); -private: // data +private: + // data - /** - * Ai content observer. Not own. - */ - MAiContentObserver* iObserver; - - /** - * Ui framework observer. Not own. - */ - MAiUiFrameworkObserver* iUiFrameworkObserver; - - /** - * Event handler. Not own. - */ + /** Ai content observer, Not owned */ + MAiContentObserver* iObserver; + /** AiFw Event handler, Not owned */ MAiFwEventHandler* iFwEventHandler; - - /** - * Node id generator. Own. - */ - CXmlNodeIdGenerator* iNodeIdGenerator; - - /** - * App UI. Not own. - */ - CAppUi* iAppUi; - - /** - * Timer to call AppUi's exit. Own. - **/ + /** AiFw State handler, Not owned */ + MAiFwStateHandler* iFwStateHandler; + /** * Node id generator, Owned */ + CXmlNodeIdGenerator* iNodeIdGenerator; + /** AppUi, Not owned */ + CAppUi* iAppUi; + /** Timer to call AppUi's exit, Owned */ CPeriodic *iExitTimer; - - /** - * Cenrep. Own. - */ + /** Cenrep, Owned */ CRepository *iAISettingsRepository; - - /** - * CPS publisher. Own. - */ - CContentPublisher* iCPSpublisher; - - /** - * Flag to indicate whether running as main UI controller - */ + /** CPS publisher, Owned */ + CContentPublisher* iCPSpublisher; + /** Flag to indicate whether running as main UI controller */ TBool iRunningAsMain; }; } // namespace AiXmlUiController -#endif // C_XMLUICONTROLLER_H +#endif // _XMLUICONTROLLER_H + +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/src/ai3xmlui.rss --- a/idlehomescreen/xmluicontroller/src/ai3xmlui.rss Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/ai3xmlui.rss Wed May 12 13:22:51 2010 +0300 @@ -29,6 +29,7 @@ #include #include #include + // ========== RESOURCE DEFINITIONS ============================================ RESOURCE RSS_SIGNATURE { } @@ -142,6 +143,11 @@ buf = qtn_hs_operation_failed_no_disk; } +RESOURCE TBUF r_qtn_hs_title_editmode + { + buf = qtn_hs_title_editing; + } + // home screen online dialog RESOURCE DIALOG r_yes_no_hs_online { diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/src/aieventhandler.cpp --- a/idlehomescreen/xmluicontroller/src/aieventhandler.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/aieventhandler.cpp Wed May 12 13:22:51 2010 +0300 @@ -30,7 +30,6 @@ #include "xnnodeappif.h" #include "aistrcnv.h" -#include #include using namespace AiXmlUiController; @@ -41,7 +40,7 @@ _LIT( KLaunchApplication, "launch_application" ); _LIT( KViewActivation, "view_activation" ); -_LIT( KCmdLine, "cmd_line"); +_LIT( KCmdLine, "cmd_line" ); _LIT8( KType, "type" ); _LIT8( KLaunchMethod, "launch_method" ); @@ -59,27 +58,6 @@ const TUid KVideoCallUid = { 0x101F8681 }; // ======== LOCAL FUNCTIONS ======== -// ---------------------------------------------------------------------------- -// Shows the Homescreen specific help item -// ---------------------------------------------------------------------------- -// -static void ShowHelpL( const TDesC& aHelpString ) - { - TUid fwUid = TUid::Uid( AI_UID3_AIFW_COMMON ); - TCoeContextName helpString; - helpString.Copy( aHelpString ); - - CArrayFixFlat* array = - new (ELeave) CArrayFixFlat(1); - CleanupStack::PushL( array ); - - array->AppendL( TCoeHelpContext( fwUid, helpString ) ); - - HlpLauncher::LaunchHelpApplicationL( - CCoeEnv::Static()->WsSession(), array ); - - CleanupStack::Pop( array ); - } // --------------------------------------------------------------------------- // Activates Phone application either in video call or normal view @@ -107,7 +85,7 @@ // ---------------------------------------------------------------------------- // CAIEventHandler::CAIEventHandler( CXmlUiController& aUiController ) - : iUiController( aUiController ) + : iUiController( aUiController ), iMsgInterface ( NULL ) { } @@ -139,6 +117,12 @@ // CAIEventHandler::~CAIEventHandler() { + if ( iMsgInterface ) + { + iMsgInterface->Close(); + iMsgInterface = NULL; + } + if( iServiceHandler ) { iServiceHandler->Reset(); @@ -169,14 +153,9 @@ } else if ( event == AiUiDef::xml::event::KEventShowHelp ) { - if( iUiController.UiEngineL()->IsEditMode() ) - { - ShowHelpL( KSET_HLP_HOME_SCREEN_EDIT ); - } - else - { - ShowHelpL( KSET_HLP_HOME_SCREEN ); - } + HlpLauncher::LaunchHelpApplicationL( + CCoeEnv::Static()->WsSession(), + CCoeEnv::Static()->AppUi()->AppHelpContextL() ); } else if ( event == AiUiDef::xml::event::KEventActivatePhoneView ) { @@ -206,6 +185,7 @@ CLiwDefaultMap* map = CLiwDefaultMap::NewL(); map->PushL(); + map->InsertL( KType, TLiwVariant( KLaunchApplication )); map->InsertL( KLaunchMethod, TLiwVariant( KCmdLine )); map->InsertL( KApplicationUid, TLiwVariant( uid )); @@ -257,8 +237,12 @@ // void CAIEventHandler::ExecuteAppLauncherL( CLiwDefaultMap& aMap ) { - MLiwInterface* msgInterface = ActionHandlerInterfaceL( ); - if( msgInterface && iServiceHandler ) + if ( !iMsgInterface ) + { + iMsgInterface = ActionHandlerInterfaceL(); + } + + if( iMsgInterface && iServiceHandler ) { CLiwGenericParamList& inparam = iServiceHandler->InParamListL(); CLiwGenericParamList& outparam = iServiceHandler->OutParamListL(); @@ -269,8 +253,7 @@ TLiwGenericParam data( KData, TLiwVariant( &aMap )); inparam.AppendL( data ); - msgInterface ->ExecuteCmdL(KExecute, inparam, outparam); - msgInterface->Close(); + iMsgInterface ->ExecuteCmdL(KExecute, inparam, outparam); outparam.Reset(); inparam.Reset(); diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/src/aixuikoneventhandler.cpp --- a/idlehomescreen/xmluicontroller/src/aixuikoneventhandler.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/aixuikoneventhandler.cpp Wed May 12 13:22:51 2010 +0300 @@ -15,6 +15,28 @@ * */ +// System includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// User includes +#include +#include +#include +#include +#include +#include +#include #include "aixuikoneventhandler.h" #include "aifweventhandler.h" @@ -25,11 +47,6 @@ #include "aixmluiconstants.h" #include "aixmluiutils.h" #include "contentrenderer.h" -#include -#include -#include -#include - #include "xnnodeappif.h" #include "xnuiengineappif.h" #include "xnproperty.h" @@ -37,20 +54,6 @@ #include "xntype.h" #include "xndomlist.h" // for cxndomlist #include "xndomattribute.h" // for cxndomattribute -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "xndompropertyvalue.h" #include "xnnodeappif.h" #include "appui.h" @@ -73,16 +76,14 @@ void AppEnvReadyL(); void HandleUiReadyEventL( CAiUiController& aUiController ); void HandleActivateUI(); - void HandleUiShutdown( CAiUiController& aUiController ); - void CriticalStartupPhaseOver( TInt aStageInteger ); - void HandleLoadPluginL( const TAiPublisherInfo& aPublisherInfo ); - void HandleDestroyPluginL( const TAiPublisherInfo& aPublisherInfo ); + void HandleUiShutdown( CAiUiController& aUiController ); void HandlePluginEvent( const TDesC& aParam ); - void HandlePluginEventL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aParam ); - TBool HasMenuItemL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ); + void HandlePluginEventL( const THsPublisherInfo& aPublisherInfo, const TDesC& aParam ); + TBool HasMenuItemL( const THsPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ); TBool RefreshContent( const TDesC& aContentCid ); - TBool QueryIsMenuOpen(); - void ProcessStateChange( TAifwStates aSate ); + TBool RefreshContent( const THsPublisherInfo& aPublisherInfo, const TDesC& aContentId ); + TBool SuspendContent( const THsPublisherInfo& aPublisherInfo, const TDesC& aContentId ); + TBool QueryIsMenuOpen(); private: // from MAiUiEventHandler TBool HandleUiEvent( TAny* aEvent, const TDesC8& aParam ); @@ -103,7 +104,8 @@ CAIXuikonEventHandler::CAIXuikonEventHandler( CXmlUiController& aUiController, CContentRenderer& aRenderer ) : iUiController(aUiController), - iContentRenderer(aRenderer) + iContentRenderer(aRenderer), + iAiEventHandler( NULL ) { } @@ -144,7 +146,7 @@ { delete iNullEventHandler; delete iVolumeEvent; - + delete iAiEventHandler; Release( iStrParser ); } @@ -224,10 +226,13 @@ // Event is not targeted here return EFalse; } - CAIEventHandler* handler = CAIEventHandler::NewL( iUiController ); - CleanupStack::PushL( handler ); - handler->HandleEventL( aEventText, aEvent ); - CleanupStack::PopAndDestroy( handler ); + + if ( !iAiEventHandler ) + { + iAiEventHandler = CAIEventHandler::NewL( iUiController ); + } + iAiEventHandler->HandleEventL( aEventText, aEvent ); + return ETrue; } @@ -358,7 +363,7 @@ // Broadcast event to all plugins for ( TInt i = 0; i < list.Count(); i++ ) { - TAiPublisherInfo info; + THsPublisherInfo info; iUiController.PublisherInfoL( *list[i], info ); @@ -383,7 +388,7 @@ { // Only one data plugin in this namespace, // it must handle this event. - TAiPublisherInfo info; + THsPublisherInfo info; iUiController.PublisherInfoL( *list[0], info ); @@ -403,7 +408,7 @@ if ( eventHandler ) { - TAiPublisherInfo info; + THsPublisherInfo info; iUiController.PublisherInfoL( *eventHandler, info ); @@ -423,11 +428,11 @@ for ( TInt i = 0; i < list.Count(); i++ ) { - TAiPublisherInfo info; + THsPublisherInfo info; iUiController.PublisherInfoL( *list[i], info ); - if( info.iName == pluginName ) + if( info.Name() == pluginName ) { // Forward Plug-in events to AI FW for further // dispatching to the target Plug-in @@ -476,8 +481,8 @@ { } -void CAIXuikonEventHandler::CNullEventHandler::HandleUiReadyEventL - ( CAiUiController& /*aUiController*/ ) +void CAIXuikonEventHandler::CNullEventHandler::HandleUiReadyEventL( + CAiUiController& /*aUiController*/ ) { } @@ -485,24 +490,24 @@ { } -void CAIXuikonEventHandler::CNullEventHandler::HandlePluginEvent - ( const TDesC& /*aParam*/ ) +void CAIXuikonEventHandler::CNullEventHandler::HandlePluginEvent( + const TDesC& /*aParam*/ ) { } -void CAIXuikonEventHandler::CNullEventHandler::HandlePluginEventL - (const TAiPublisherInfo& /*aPublisherInfo*/, const TDesC& /*aParam*/ ) +void CAIXuikonEventHandler::CNullEventHandler::HandlePluginEventL( + const THsPublisherInfo& /*aPublisherInfo*/, const TDesC& /*aParam*/ ) { } TBool CAIXuikonEventHandler::CNullEventHandler::HasMenuItemL( - const TAiPublisherInfo& /*aPublisherInfo*/, const TDesC& /*aMenuItem*/ ) + const THsPublisherInfo& /*aPublisherInfo*/, const TDesC& /*aMenuItem*/ ) { return EFalse; } -void CAIXuikonEventHandler::CNullEventHandler::HandleUiShutdown - ( CAiUiController& /*aUiController*/ ) +void CAIXuikonEventHandler::CNullEventHandler::HandleUiShutdown( + CAiUiController& /*aUiController*/ ) { } @@ -512,9 +517,16 @@ return EFalse; } -void CAIXuikonEventHandler::CNullEventHandler::CriticalStartupPhaseOver( - TInt /*aStageInteger*/ ) +TBool CAIXuikonEventHandler::CNullEventHandler::RefreshContent( + const THsPublisherInfo& /*aPublisherInfo*/, const TDesC& /*aContentId*/ ) { + return EFalse; + } + +TBool CAIXuikonEventHandler::CNullEventHandler::SuspendContent( + const THsPublisherInfo& /*aPublisherInfo*/, const TDesC& /*aContentId*/ ) + { + return EFalse; } TBool CAIXuikonEventHandler::CNullEventHandler::QueryIsMenuOpen() @@ -522,29 +534,14 @@ return EFalse; } -void CAIXuikonEventHandler::CNullEventHandler::ProcessStateChange( - TAifwStates /*aSate*/) - { - } - -void CAIXuikonEventHandler::CNullEventHandler::HandleLoadPluginL( - const TAiPublisherInfo& /*aPluginToLoad*/ ) - { - } - -void CAIXuikonEventHandler::CNullEventHandler::HandleDestroyPluginL( - const TAiPublisherInfo& /*aPluginToDestroy*/ ) - { - } - -TBool CAIXuikonEventHandler::CNullEventHandler::HandleUiEvent - (TAny* /*aEvent*/, const TDesC8& /*aParam*/) +TBool CAIXuikonEventHandler::CNullEventHandler::HandleUiEvent( + TAny* /*aEvent*/, const TDesC8& /*aParam*/ ) { return EFalse; } -TBool CAIXuikonEventHandler::CNullEventHandler::HandleApplicationEvent - (TInt /*aEvent*/, const TDesC8& /*aParam*/) +TBool CAIXuikonEventHandler::CNullEventHandler::HandleApplicationEvent( + TInt /*aEvent*/, const TDesC8& /*aParam*/ ) { return EFalse; } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/src/aixuikonmenueventhandler.cpp --- a/idlehomescreen/xmluicontroller/src/aixuikonmenueventhandler.cpp Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1742 +0,0 @@ -/* -* Copyright (c) 2007-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: Used for handling XUIKON menu events -* -*/ - - -#include "aixuikonmenueventhandler.h" -#include "aiconsts.h" -#include "aixmluiconstants.h" -#include "aixmluiutils.h" - -#include "mxncomponentinterface.h" -#include "xnmenuadapter.h" -#include "xnappuiadapter.h" -#include "xntext.h" -#include "xnnodeappif.h" -#include "xndomnode.h" -#include "xndomlist.h" -#include "xntype.h" -#include -#include -#include -#include "aifweventhandler.h" -#include "xnproperty.h" -#include "xnuiengineappif.h" -#include "xndompropertyvalue.h" -#include -#include -#include //CaknViewAppui -#include "xnplugindefs.h" - -_LIT8( KMenubar, "menubar" ); -_LIT8( KClass, "class" ); -_LIT8( KId, "id" ); -_LIT8( KEditWidget, "edit_widget" ); -_LIT8( KRemoveItem, "removeitem" ); -_LIT8( KWidget, "widget" ); -_LIT8( KRemovable, "removable" ); -_LIT ( KMenuItem, "menuitem"); - -using namespace AiXmlUiController; - - -// --------------------------------------------------------------------------- -// FindFromContentModelL -// --------------------------------------------------------------------------- -// -static CXnNodeAppIf* FindFromContentModelL( CXnNodeAppIf* aNode ) - { - if ( !aNode ) - { - return NULL; - } - - CXnProperty* node = aNode->GetPropertyL( KClass ); - if ( node && node->StringValue() == KContentSource ) - { - return aNode; - } - - // Recurse children - RPointerArray< CXnNodeAppIf > children( aNode->ChildrenL() ); - CleanupClosePushL( children ); - - CXnNodeAppIf* retval( NULL ); - - for ( TInt i = 0; i < children.Count(); i++ ) - { - CXnNodeAppIf* node( FindFromContentModelL( children[i] ) ); - - if ( node ) - { - retval = node; - break; - } - } - - CleanupStack::PopAndDestroy( &children ); - - return retval; - } - -// --------------------------------------------------------------------------- -// FindFromConfigurationL -// --------------------------------------------------------------------------- -// -static CXnNodeAppIf* FindFromConfigurationL( CXnNodeAppIf* aNode ) - { - if ( !aNode ) - { - return NULL; - } - // Is this node type of settingsconfiguration - if ( aNode->Type()->Type() == KSettingsConfiguration ) - { - return aNode; - } - - // Recurse children - RPointerArray< CXnNodeAppIf > children( aNode->ChildrenL() ); - CleanupClosePushL( children ); - - CXnNodeAppIf* retval( NULL ); - - for ( TInt i = 0; i < children.Count(); i++ ) - { - CXnNodeAppIf* node( FindFromConfigurationL( children[i] ) ); - - if ( node ) - { - retval = node; - break; - } - } - - CleanupStack::PopAndDestroy( &children ); - - return retval; - } - -// --------------------------------------------------------------------------- -// DeletePluginNames -// --------------------------------------------------------------------------- -// -static void DeletePluginNames( TAny* aObject ) - { - reinterpret_cast< - RPointerArray*>( aObject )->ResetAndDestroy(); - } - -CAIXuikonMenuEventHandler::CAIXuikonMenuEventHandler( TXnUiEngineAppIf& aUiEngine, - MAiFwEventHandler* aFwEventHandler, - CXnAppUiAdapter* aAppUi ) - : iCurrentCBA( EAIMenuOff ), - iUiEngine( &aUiEngine ), - iFwEventHandler( aFwEventHandler ), - iAppUi( aAppUi ) - { - } - -void CAIXuikonMenuEventHandler::ConstructL() - { - iStrParser = AiUtility::CreateStrParserL(); - iKeylockObserver = AiUtility::CreatePSPropertyObserverL - ( TCallBack( HandleKeylockEvent, this ), - KPSUidAvkonDomain, KAknKeyguardStatus ); - } - -void CAIXuikonMenuEventHandler::SetObserverL( const TDesC8& aParam, CXnDomNode* aEvent ) - { - if ( aEvent ) - { - CXnNodeAppIf* node( iUiEngine->FindNodeByIdL( aParam, aEvent->Namespace() ) ); - - if ( node && node->Type()->Type() == KMenubar ) - { - XnMenuInterface::MXnMenuInterface* menuIf( NULL ); - XnComponentInterface::MakeInterfaceL( menuIf, *node ); - - if ( menuIf ) - { - menuIf->SetObserver( *this ); - } - } - } - } - -TInt CAIXuikonMenuEventHandler::HandleKeylockEvent( TAny* aSelf ) - { - // Stop displaying menu when keylock is activated. - CAIXuikonMenuEventHandler* self = - static_cast( aSelf ); - TInt err = KErrNone; - TInt value = EKeyguardNotActive; - if ( self ) - { - TInt err = self->iKeylockObserver->Get( value ); - if ( err == KErrNone ) - { - if ( value > EKeyguardNotActive ) - { - if ( self->iAppUi && self->iCurrentCBA == EAIMenuOn ) - { - self->iAppUi->StopDisplayingMenuBar(); - TRAP_IGNORE( self->iUiEngine->RefreshMenuL() ); - } - } - } - } - return err; - } - -CAIXuikonMenuEventHandler* CAIXuikonMenuEventHandler::NewL( TXnUiEngineAppIf& aUiEngine, - MAiFwEventHandler* aFwEventHandler, - CXnAppUiAdapter* aAppUi ) - { - CAIXuikonMenuEventHandler* self = - new( ELeave ) CAIXuikonMenuEventHandler( aUiEngine, aFwEventHandler, aAppUi ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -CAIXuikonMenuEventHandler::~CAIXuikonMenuEventHandler() - { - Release ( iKeylockObserver ); - Release( iStrParser ); - delete iActivationEvent; - delete iSettingsEvent; - - // Delete stored label id's - delete iMenuModeLskLabel; - delete iMenuModeRskLabel; - delete iNormalModeLskLabel; - delete iNormalModeRskLabel; - } - -TBool CAIXuikonMenuEventHandler::HandleEventL( const TDesC8& aEventString8, CXnNodeAppIf* aOrigin, CXnDomNode* aEvent ) - { - if ( aEventString8 == AiUiDef::xml::event::KScreenDeviceChange ) - { - iUiEngine = iAppUi->UiEngineL(); - return ETrue; - } - else if ( aEventString8.Left(KAIDynamicMenuPrefixLen).Compare( KAIDynamicMenuPrefix ) != 0 ) - { - // For optimization when dynamic menu prefix is not found from event string start - // return immediate from here. - return EFalse; - } - - if ( (iCurrentCBA == EAIMenuOff && aEventString8.Find(KAIMenuEventIfMenuOff) >= 0 ) || - (iCurrentCBA == EAIMenuOn && aEventString8.Find(KAIMenuEventIfMenuOn) >= 0) ) - { - TPtrC8 eventString; - ParseParameterStringL(aEventString8, eventString); - if ( !HandleEventL(eventString, aOrigin, aEvent ) ) - { - // Default action from the event string - HBufC16* eventString16 = NULL; - eventString16 = iStrParser->CopyToBufferL( eventString16, eventString ); - CleanupStack::PushL( eventString16 ); - if ( iFwEventHandler && eventString16 ) - { - iFwEventHandler->HandlePluginEvent( *eventString16 ); - } - CleanupStack::PopAndDestroy( eventString16 ); - } - return ETrue; - } - else if ( aEventString8 == KAIMenuEventInitPluginItems ) - { - if ( !aEvent ) - { - return ETrue; - } - - CXnDomList& children( aEvent->ChildNodes() ); - - TInt count( children.Length() ); - - for ( TInt i = 0; i < count; i++ ) - { - CXnDomNode* node = static_cast< CXnDomNode* >( children.Item( i ) ); - - const TDesC8& type( node->Name() ); - - if ( type == XnPropertyNames::action::KProperty ) - { - const TDesC8& id( node->AttributeValue( - XnPropertyNames::action::KValue ) ); - - if ( id != KNullDesC8 ) - { - CXnNodeAppIf* nodeById( iUiEngine->FindNodeByIdL( id, aEvent->Namespace() ) ); - - if ( nodeById ) - { - TBool showItem( DynInitItemL( *nodeById, aOrigin ) ); - - const TDesC8 *value( NULL ); - - if ( showItem ) - { - value = &XnPropertyNames::style::common::display::KBlock; - } - else - { - value = &XnPropertyNames::style::common::display::KNone; - } - - CXnDomStringPool& sp( aEvent->StringPool() ); - - // create property - CXnProperty* prop = CXnProperty::NewL( XnPropertyNames::style::common::KDisplay, - *value, - CXnDomPropertyValue::EString, - sp ); - - CleanupStack::PushL( prop ); - - // and set it - nodeById->SetPropertyL( prop ); - - CleanupStack::Pop( prop ); - } - } - } - } - - return ETrue; - } - else if ( aEventString8 == KAIMenuEventInitEmptyItems || - aEventString8 == KAIMenuEventInitWidgetItems ) - { - if ( !aEvent ) - { - return ETrue; - } - - CXnProperty* pluginId( aOrigin->GetPropertyL( KPluginId ) ); - CXnProperty* pluginName( aOrigin->GetPropertyL( KPluginName ) ); - - TBool showItem( EFalse ); - - if ( aEventString8 == KAIMenuEventInitWidgetItems ) - { - if( pluginId && pluginName && pluginName->StringValue() != KDummy8 ) - { - // check if plugin can be removed - CXnProperty* removable = GetWidgetPropertyL(*aOrigin, KRemovable); - if ( removable && removable->StringValue() == XnPropertyNames::KFalse ) - { - showItem = EFalse; - } - else - { - showItem = ETrue; - } - } - } - else - { - if ( pluginId && pluginName && pluginName->StringValue() == KDummy8 ) - { - showItem = ETrue; - } - } - - CXnDomList& children( aEvent->ChildNodes() ); - - TInt count( children.Length() ); - - for ( TInt i = 0; i < count; i++ ) - { - CXnDomNode* node = static_cast< CXnDomNode* >( children.Item( i ) ); - - const TDesC8& type( node->Name() ); - - if ( type == XnPropertyNames::action::KProperty ) - { - const TDesC8& id( node->AttributeValue( - XnPropertyNames::action::KValue ) ); - - if ( id != KNullDesC8 ) - { - CXnNodeAppIf* nodeById( iUiEngine->FindNodeByIdL( id, aEvent->Namespace() ) ); - - if ( nodeById ) - { - const TDesC8 *value( NULL ); - - if ( showItem ) - { - value = &XnPropertyNames::style::common::display::KBlock; - } - else - { - value = &XnPropertyNames::style::common::display::KNone; - } - - CXnDomStringPool& sp( aEvent->StringPool() ); - - // create property - CXnProperty* prop = CXnProperty::NewL( XnPropertyNames::style::common::KDisplay, - *value, - CXnDomPropertyValue::EString, - sp ); - - CleanupStack::PushL( prop ); - - // and set it - nodeById->SetPropertyL( prop ); - - CleanupStack::Pop( prop ); - } - } - } - } - - return ETrue; - } - else if ( aEventString8.Find( KAIMenuEventIfMenuOff ) >= 0 ) - { - return ETrue; - } - else if ( aEventString8.Find( KAIMenuEventIfMenuOn ) >= 0 ) - { - return ETrue; - } - else if ( aEventString8.Compare( KAIMenuEventGenerateSetActivationEvent ) == 0 ) - { - // Generate set plugin event - if ( iFwEventHandler && iActivationEvent ) - { - iFwEventHandler->HandlePluginEvent( *iActivationEvent ); - } - return ETrue; - } - else if ( aEventString8.Find( KAIMenuEventSetActivationEvent ) >= 0 ) - { - // find event string - TPtrC8 eventString; - ParseParameterStringL( aEventString8, eventString ); - delete iActivationEvent; - iActivationEvent = NULL; - // store activation event (plugin event string) - iActivationEvent = iStrParser->CopyToBufferL( iActivationEvent, eventString ); - return ETrue; - } - else if (aEventString8.Compare( KAIMenuEventGenerateOpenSettingsEvent ) == 0) - { - // Generate set plugin event - if ( iFwEventHandler && iSettingsEvent ) - { - iFwEventHandler->HandlePluginEvent( *iSettingsEvent ); - } - return ETrue; - } - else if ( aEventString8.Find( KAIMenuEventSetOpenSettingsnEvent ) >= 0 ) - { - // find event string - TPtrC8 eventString; - ParseParameterStringL( aEventString8, eventString ); - delete iSettingsEvent; - iSettingsEvent = NULL; - // store activation event (plugin event string) - iSettingsEvent = iStrParser->CopyToBufferL( iSettingsEvent, eventString ); - return ETrue; - } - else if ( aEventString8.Find( KAIMenuEventShowMenuItem ) >= 0 ) - { - if (iCurrentCBA == EAIMenuOn) - { - // find node by id - TPtrC8 menuItem; - ParseParameterStringL( aEventString8, menuItem ); - // set visibility property to visible - ShowMenuItemL( menuItem, ETrue, aEvent ); - } - return ETrue; - } - else if ( aEventString8.Find( KAIMenuEventHideMenuItem ) >= 0 ) - { - if ( iCurrentCBA == EAIMenuOn ) - { - // find node by id - TPtrC8 menuItem; - ParseParameterStringL( aEventString8, menuItem ); - // set visibility property to visible - ShowMenuItemL( menuItem, EFalse, aEvent ); - } - return ETrue; - } - else if ( aEventString8.Find( KAIMenuEventShowHideMenuItem ) >= 0 ) - { - if ( iCurrentCBA == EAIMenuOn ) - { - // find node by id - TPtrC8 menuItem; - ParseParameterStringL( aEventString8, menuItem ); - // set visibility property - if ( IsMenuItemVisibleL( menuItem, aEvent ) ) - { - ShowMenuItemL( menuItem, EFalse, aEvent ); - } - else - { - ShowMenuItemL( menuItem, ETrue, aEvent ); - } - } - return ETrue; - } - else if ( aEventString8.Compare( KAIMenuEventMenuOn ) == 0 ) - { - if ( iCurrentCBA != EAIMenuOn ) - { - // also updates current state - SetCBALabelsL( EAIMenuOn, aEvent ); - } - return ETrue; - } - else if ( aEventString8.Compare( KAIMenuEventMenuOff ) == 0 ) - { - if ( iCurrentCBA != EAIMenuOff ) - { - // also updates current state - SetCBALabelsL( EAIMenuOff, aEvent ); - } - return ETrue; - } - else if ( ( aEventString8.Find( KAIMenuEventShowAll ) ) >= 0 ) - { - if ( iCurrentCBA == EAIMenuOn ) - { - // Show all menu items. Xuikon actually open the menu it self.. - TPtrC8 menu; - ParseParameterStringL( aEventString8, menu ); - ShowMenuL( ETrue, menu, aEvent ); - } - return ETrue; - } - else if ( aEventString8.Find( KAIMenuEventRefresh ) >= 0 ) - { - if ( iCurrentCBA == EAIMenuOn ) - { - iUiEngine->RefreshMenuL(); - } - return ETrue; - } - else if ( aEventString8.Find( KAIMenuEventHideAll ) >= 0 ) - { - // Hide all menu items - TPtrC8 menu; - ParseParameterStringL( aEventString8, menu ); - ShowMenuL( EFalse, menu, aEvent ); - return ETrue; - } - else if ( aEventString8.Find( KAIMenuEventSetCloseAction ) >= 0 ) - { - // Set menu mode close action / RSK action - TPtrC8 closeActionId; - ParseParameterStringL( aEventString8, closeActionId ); - - // Store close action macroset node id - iCloseActionId.Set( closeActionId ); - return ETrue; - } - else if ( aEventString8.Find( KAIMenuEventCloseAction ) >= 0 ) - { - // Decide action - if ( iCurrentCBA == EAIMenuOff ) - { - TPtrC8 eventString; - ParseParameterStringL( aEventString8, eventString ); - - // Default action - HBufC16* eventString16 = NULL; - eventString16 = iStrParser->CopyToBufferL( eventString16, eventString ); - CleanupStack::PushL( eventString16 ); - if ( iFwEventHandler && eventString16 ) - { - iFwEventHandler->HandlePluginEvent( *eventString16 ); - } - CleanupStack::PopAndDestroy( eventString16 ); - } - else - { - DoMacrosetL( iCloseActionId, aEvent ); - } - return ETrue; - } - else if ( aEventString8.Find( KAIMenuEventSetSoftKeyId ) >= 0 ) - { - // Store softkey labels and label node id's - TPtrC8 softkeyString; - ParseParameterStringL( aEventString8, softkeyString ); - TPtrC8 softkeyId; - ParseParameterStringL( softkeyString, softkeyId ); - if ( softkeyString.Find( KAIMenuModeLsk ) >= 0) - { - GetTextFromElementL( iMenuModeLskLabel, softkeyId, aEvent ); - if ( iMenuModeLskLabel && iMenuModeLskLabel->Length() <= 0 ) - { - delete iMenuModeLskLabel; - iMenuModeLskLabel = NULL; - } - iLskMenuModeNode.Set( softkeyId ); - } - else if ( softkeyString.Find( KAIMenuModeRsk ) >= 0 ) - { - GetTextFromElementL( iMenuModeRskLabel, softkeyId, aEvent ); - if ( iMenuModeLskLabel && iMenuModeRskLabel->Length() <= 0 ) - { - delete iMenuModeRskLabel; - iMenuModeRskLabel = NULL; - } - iRskMenuModeNode.Set( softkeyId ); - } - else if ( softkeyString.Find( KAINormalModeLskLabel ) >= 0) - { - GetTextFromElementL( iNormalModeLskLabel, softkeyId, aEvent ); - iNormalModeLskLabelId.Set( softkeyId ); - } - else if ( softkeyString.Find( KAINormalModeRskLabel ) >= 0) - { - GetTextFromElementL( iNormalModeRskLabel, softkeyId, aEvent ); - iNormalModeRskLabelId.Set( softkeyId ); - } - else if ( softkeyString.Find( KAINormalModeLskIcon ) >= 0) - { - iNormalModeLskIconId.Set( softkeyId ); - } - else if ( softkeyString.Find( KAINormalModeRskIcon ) >= 0) - { - iNormalModeRskIconId.Set( softkeyId ); - } - else if ( softkeyString.Find( KAIMenuLsk ) >= 0) - { - iLskId.Set( softkeyId ); - } - else if ( softkeyString.Find( KAIMenuRsk ) >= 0) - { - iRskId.Set( softkeyId ); - } - - return ETrue; - } - else if ( aEventString8.Find( KAIMenuEventSettingsReady ) >= 0) - { - SetCBALabelsL( EAIMenuOff, aEvent ); - return ETrue; - } - else if ( aEventString8.Find( KAIMenuEventDoMacroset ) >= 0 ) - { - // Do defined macro set - - // Parse macroset node id - TPtrC8 macroNodeId; - ParseParameterStringL( aEventString8, macroNodeId ); - if ( macroNodeId != KNullDesC8 ) - { - DoMacrosetL( macroNodeId, aEvent ); - } - return ETrue; - } - else if ( aEventString8.Find( KAIMenuEventSetDynMenuItemObserver ) >= 0 ) - { - TPtrC8 eventString; - ParseParameterStringL( aEventString8, eventString ); - SetObserverL( eventString, aEvent ); - return ETrue; - } - else if ( aEventString8 == KAIToggleWidgetsState ) - { - iFwEventHandler->SetPluginsVisibility( iUiEngine->WidgetsVisible() ); - return ETrue; - } - else - { - // Handlers for macroset operations - TPtrC8 targetNodeName; - ParseParameterStringL( aEventString8, targetNodeName ); - TBool handledEvent = EFalse; - - if ( targetNodeName != KNullDesC8 ) - { - CXnNodeAppIf* eventTargetNode = NULL; - if ( aEvent ) - { - eventTargetNode = iUiEngine->FindNodeByIdL( targetNodeName, aEvent->Namespace() ); - } - if ( eventTargetNode ) - { - handledEvent = HandleMacroOperationL( - aEventString8, *eventTargetNode, *aEvent ); - iUiEngine->RenderUIL( NULL ); - } - } - return handledEvent; - } - } - -void CAIXuikonMenuEventHandler::ParseParameterStringL( const TDesC8& aSourcePtr, - TPtrC8& aTargetPtr ) - { - // Parses parameter string between the first '(' and last ')' - // Trailing and heading white spaces ARE NOT handled! - - const TInt separatorPos = aSourcePtr.Locate( KEventParameterSeparator ); - User::LeaveIfError( separatorPos ); - - const TInt eventSeparatorPos = aSourcePtr.LocateReverse( - KEventParameterSeparatorEnd ); - User::LeaveIfError( eventSeparatorPos ); - - // separatorPos + 1 must be smaller than eventSeparatorPos - 1 - User::LeaveIfError( ( eventSeparatorPos ) - ( separatorPos + 1 ) ); - - // Extract event and parameter string - TPtrC8 menuName( aSourcePtr.Mid( separatorPos + 1, - ( eventSeparatorPos ) - ( separatorPos + 1 ) ) ); - - aTargetPtr.Set( menuName ); - } - -void CAIXuikonMenuEventHandler::SetCBALabelsL( TAICBA aCBA, CXnDomNode* aEvent ) - { - // Set CBA labels according to mode, to the predefined CBA nodes - if ( (iLskId == KNullDesC8) || (iRskId == KNullDesC8) || !aEvent ) - { - return; - } - CXnNodeAppIf* lskNode = iUiEngine->FindNodeByIdL( iLskId, aEvent->Namespace() ); - CXnNodeAppIf* rskNode = iUiEngine->FindNodeByIdL( iRskId, aEvent->Namespace() ); - - TBool propertyUpdated = EFalse; - - if ( rskNode && lskNode ) - { - CXnNodeAppIf* menuBar = lskNode->ParentL(); - - XnMenuInterface::MXnMenuInterface* lskControl = NULL; - XnMenuInterface::MXnMenuInterface* rskControl = NULL; - - if ( menuBar ) - { - XnComponentInterface::MakeInterfaceL( lskControl, *menuBar ); - XnComponentInterface::MakeInterfaceL( rskControl, *menuBar ); - } - if ( !lskControl || !rskControl ) - { - return; - } - switch ( aCBA ) - { - case EAIMenuOff: - { - CXnNodeAppIf* lskIconNode = NULL; - CXnNodeAppIf* rskIconNode = NULL; - XnImageInterface::MXnImageInterface* lskIconControl = NULL; - XnImageInterface::MXnImageInterface* rskIconControl = NULL; - if ( iNormalModeLskIconId != KNullDesC8 ) - { - lskIconNode = iUiEngine->FindNodeByIdL( iNormalModeLskIconId, aEvent->Namespace() ); - XnComponentInterface::MakeInterfaceL( lskIconControl, *lskIconNode ); - } - - if ( iNormalModeRskIconId != KNullDesC8 ) - { - rskIconNode = iUiEngine->FindNodeByIdL( iNormalModeRskIconId, aEvent->Namespace() ); - XnComponentInterface::MakeInterfaceL( rskIconControl, *rskIconNode ); - } - - // Try to set the icon, if the icon setting fails - // try to set the text - if ( !AttemptRestoreSoftkeyIconL( lskControl, - lskIconControl, - lskIconNode, - XnMenuInterface::MXnMenuInterface::ELeft ) ) - { - if ( iNormalModeLskLabelId != KNullDesC8 ) - { - GetTextFromElementL( iNormalModeLskLabel, iNormalModeLskLabelId, aEvent ); - } - - SetSoftkeyLabelL( lskControl, iNormalModeLskLabel, - XnMenuInterface::MXnMenuInterface::ELeft ); - } - - if ( !AttemptRestoreSoftkeyIconL( rskControl, - rskIconControl, - rskIconNode, - XnMenuInterface::MXnMenuInterface::ERight ) ) - { - if ( iNormalModeRskLabelId != KNullDesC8 ) - { - GetTextFromElementL( iNormalModeRskLabel, iNormalModeRskLabelId, aEvent ); - } - - SetSoftkeyLabelL( rskControl, iNormalModeRskLabel, - XnMenuInterface::MXnMenuInterface::ERight ); - } - propertyUpdated = ETrue; - break; - } - case EAIMenuOn: - { - // Need to set the bitmaps back after - // the menu is closed - iMenumodeBitmapLsk = NULL; - iMenumodeBitmapRsk = NULL; - if ( !iMenuModeLskLabel ) - { - GetTextFromElementL( iMenuModeLskLabel, iLskMenuModeNode, aEvent ); - } - SetSoftkeyLabelL( lskControl, iMenuModeLskLabel, - XnMenuInterface::MXnMenuInterface::ELeft ); - - if ( !iMenuModeRskLabel ) - { - GetTextFromElementL( iMenuModeRskLabel, iRskMenuModeNode, aEvent ); - } - SetSoftkeyLabelL( rskControl, iMenuModeRskLabel, - XnMenuInterface::MXnMenuInterface::ERight ); - propertyUpdated = ETrue; - break; - } - default: - break; - } - } - iCurrentCBA = aCBA; - if ( propertyUpdated ) - { - iUiEngine->RefreshMenuL(); - } - } - -void CAIXuikonMenuEventHandler::ShowMenuL( TBool aShow, const TDesC8& aMenuId, CXnDomNode* aEvent ) - { - if ( aEvent ) - { - // Show or hide all menu items - CXnNodeAppIf* lskNode = iUiEngine->FindNodeByIdL( aMenuId, aEvent->Namespace() ); - - if ( lskNode ) - { - RecurseChildrenL( aShow, lskNode ); - } - } - } - -void CAIXuikonMenuEventHandler::RecurseChildrenL( TBool aShow, CXnNodeAppIf* aNode ) - { - RPointerArray children = aNode->ChildrenL(); - CleanupClosePushL( children ); - - for ( TInt i=0; iType()->Type() == KAIMenuItem || - node->Type()->Type() == KAIMenu ) ) - { - if ( aShow ) - { - SetPropertyToNodeL( *node, XnPropertyNames::style::common::KVisibility, - XnPropertyNames::style::common::visibility::KVisible ); - } - else - { - SetPropertyToNodeL( *node, XnPropertyNames::style::common::KVisibility, - XnPropertyNames::style::common::visibility::KHidden ); - } - - if ( node->Type()->Type() == KAIMenu ) - { - RecurseChildrenL(aShow, node); - } - } - } - - CleanupStack::PopAndDestroy( &children ); - } - -void CAIXuikonMenuEventHandler::DoMacrosetL( const TDesC8& aMacrosetNodeId, CXnDomNode* aEvent ) - { - if ( !aEvent ) - { - return; - } - // Do operations in a macroset - CXnNodeAppIf* actionNode = iUiEngine->FindNodeByIdL( aMacrosetNodeId, aEvent->Namespace() ); - if ( !actionNode ) - { - return; - } - RPointerArray children = actionNode->ChildrenL(); - for ( TInt i=0; iFindNodeByIdL( targetNodeName, aEvent->Namespace() ); - if ( eventTargetNode ) - { - HandleMacroOperationL( *value, *eventTargetNode, *aEvent ); - } - } - } - } - children.Reset(); - } - -void CAIXuikonMenuEventHandler::ShowMenuItemL( const TDesC8& aMenuItemId, TBool aShow, CXnDomNode* aEvent ) - { - if ( aEvent ) - { - // Show a single menuitem - CXnNodeAppIf* itemNode = iUiEngine->FindNodeByIdL( aMenuItemId, aEvent->Namespace() ); - if ( itemNode && ( itemNode->Type()->Type() == KAIMenuItem || - itemNode->Type()->Type() == KAIMenu ) ) - { - if ( aShow ) - { - SetPropertyToNodeL( *itemNode, XnPropertyNames::style::common::KVisibility, - XnPropertyNames::style::common::visibility::KVisible ); - } - else - { - SetPropertyToNodeL( *itemNode, XnPropertyNames::style::common::KVisibility, - XnPropertyNames::style::common::visibility::KHidden ); - } - } - } - } - -TBool CAIXuikonMenuEventHandler::IsMenuItemVisibleL( const TDesC8& aMenuItemId, CXnDomNode* aEvent ) - { - TBool ret = EFalse; - if ( aEvent ) - { - CXnNodeAppIf* itemNode = iUiEngine->FindNodeByIdL( aMenuItemId, aEvent->Namespace() ); - if ( itemNode && ( itemNode->Type()->Type() == KAIMenuItem || - itemNode->Type()->Type() == KAIMenu ) ) - { - CXnProperty* visibility = itemNode->GetPropertyL( XnPropertyNames::style::common::KVisibility ); - if ( visibility && (visibility->StringValue() == XnPropertyNames::style::common::visibility::KVisible) ) - { - ret = ETrue; - } - } - } - return ret; - } - -void CAIXuikonMenuEventHandler::GetTextFromElementL( HBufC8*& aMemberPtr, - const TDesC8& aItemId, - CXnDomNode* aEvent ) - { - delete aMemberPtr; - aMemberPtr = NULL; - if ( aEvent ) - { - CXnNodeAppIf* labelNode = iUiEngine->FindNodeByIdL( aItemId, aEvent->Namespace() ); - - if ( labelNode ) - { - if ( labelNode->Type() ) - { - const TDesC8& type = labelNode->Type()->Type(); - if ( type == XnTextInterface::MXnTextInterface::Type() ) - { - XnTextInterface::MXnTextInterface* textControl = NULL; - XnComponentInterface::MakeInterfaceL( textControl, *labelNode ); - if ( textControl ) - { - // Set text - aMemberPtr = iStrParser->CopyToBufferL( aMemberPtr, - *(textControl->Text()) ); - } - } - } - } - } - } - -TBool CAIXuikonMenuEventHandler::HandleMacroOperationL( const TDesC8& aSourcePtr, - CXnNodeAppIf& aTargetNode, - CXnDomNode& aEvent ) - { - if ( aSourcePtr.Find( KAIMenuEventSetFocus ) >= 0 ) - { - // Set focus - aTargetNode.SetStateL( XnPropertyNames::style::common::KFocus ); - return ETrue; - } - else if ( aSourcePtr.Find( KAIMenuEventSetDisplayNone ) >= 0 ) - { - SetPropertyToNodeL( aTargetNode, XnPropertyNames::style::common::KDisplay, - XnPropertyNames::style::common::display::KNone ); - return ETrue; - } - else if ( aSourcePtr.Find( KAIMenuEventSetDisplayBlock) >= 0 ) - { - SetPropertyToNodeL( aTargetNode, XnPropertyNames::style::common::KDisplay, - XnPropertyNames::style::common::display::KBlock ); - return ETrue; - } - else - { - HandleEventL( aSourcePtr, &aTargetNode, &aEvent ); - return ETrue; - } - } - -TBool CAIXuikonMenuEventHandler::AttemptRestoreSoftkeyIconL( - XnMenuInterface::MXnMenuInterface* aControl, - XnImageInterface::MXnImageInterface* aIconControl, - CXnNodeAppIf* aSourceNode, - XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ) - { - if ( aControl && aSourceNode ) - { - const TDesC8* isVisible = - PropertyValue( *aSourceNode, - XnPropertyNames::style::common::KVisibility ); - - // node not "visible" so assume that text has been published - // after image - if ( !isVisible || *isVisible == XnPropertyNames::style::common::visibility::KHidden ) - { - return EFalse; - } - - CGulIcon* icon = NULL; - TBool transferOwnership = ETrue; - // First try to get the icon from image interface - if ( aIconControl ) - { - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - aIconControl->ContentBitmaps( bitmap, mask ); - if ( bitmap ) - { - icon = CGulIcon::NewL( bitmap, mask ); - icon->SetBitmapsOwnedExternally( ETrue ); - // image adapter wants to keep ownership - transferOwnership = EFalse; - CleanupStack::PushL( icon ); - } - } - // Then try to load it ourselves. - if ( !icon ) - { - const TDesC8* value = - PropertyValue( *aSourceNode, XnPropertyNames::image::KPath ); - - if ( value ) - { - icon = LoadIconLC( *aSourceNode ); - icon->SetBitmapsOwnedExternally( ETrue ); - // transfer ownerhsip to menunode - transferOwnership = ETrue; - } - } - // This icon is already in menu, no need to set it - // again - if ( icon && - (icon->Bitmap() == iMenumodeBitmapLsk || - icon->Bitmap() == iMenumodeBitmapRsk) ) - { - CleanupStack::PopAndDestroy( icon ); - return ETrue; - } - else if ( icon ) - { - switch ( aPos ) - { - case XnMenuInterface::MXnMenuInterface::ELeft: - iMenumodeBitmapLsk = icon->Bitmap(); - break; - case XnMenuInterface::MXnMenuInterface::ERight: - iMenumodeBitmapRsk = icon->Bitmap(); - break; - default: - break; - } - aControl->SetSoftKeyImageL( - icon->Bitmap(), - icon->Mask(), - aPos, - ETrue, /* preserve aspect ratio */ - EFalse, /* !invert mask */ - transferOwnership - ); - CleanupStack::PopAndDestroy( icon ); - return ETrue; - } - } - return EFalse; - } - -void CAIXuikonMenuEventHandler::SetSoftkeyLabelL( - XnMenuInterface::MXnMenuInterface* aControl, - const TDesC8* aLabel, - XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ) - { - if ( aControl && aLabel ) - { - HBufC16* string16 = NULL; - string16 = iStrParser->CopyToBufferL( string16, *aLabel ); - CleanupStack::PushL( string16 ); - // Trapped because this will leave when setting the same again - TRAP_IGNORE( - aControl->SetSoftKeyTextL( *string16, aPos ); - ) - CleanupStack::PopAndDestroy( string16 ); - } - } - -TBool CAIXuikonMenuEventHandler::InitEditModeMenuItemL( CXnNodeAppIf& aMenuItem, CXnNodeAppIf* aFocused, const TDesC8& aSource ) - { - TBool showItem( EFalse ); - CXnNodeAppIf* focused( aFocused ); - - if ( focused && aSource == KContentModel ) - { - CXnNodeAppIf* node = FindFromContentModelL( focused ); - if ( !node ) - { - // no plugin or no launch action - return showItem; - } - CXnProperty* plugin ( node->GetPropertyL( KName ) ) ; - if ( !plugin ) - { - // no plugin or no launch action - return showItem; - } - HBufC* pluginName( plugin->StringValueL() ); - CleanupStack::PushL( pluginName ); - HBufC* item ( aMenuItem.GetPropertyL( KName )->StringValueL() ); - CleanupStack::PushL( item ); - - showItem = iFwEventHandler->HasMenuItem( *pluginName , *item ); - - if ( showItem ) - { - // pluginName/menuitem(item) - // Create launch event and store it to menuitem's property - HBufC8* eventstr = HBufC8::NewLC( pluginName->Length() - + 15 // / ( ) - + item->Length() ); - TPtr8 str ( eventstr->Des() ); - str.Copy( pluginName->Des() ); - str.Append( TChar( '/' )); - str.Append( KMenuItem ); - str.Append( TChar( '(' )); - str.Append( item->Des() ); - str.Append( TChar( ')' )); - - CXnDomStringPool& sp( iUiEngine->StringPool() ); - - CXnDomPropertyValue* newValue = CXnDomPropertyValue::NewL( sp ); - CleanupStack::PushL( newValue ); - - newValue->SetStringValueL( CXnDomPropertyValue::EString, str ); - - CXnProperty* prop = CXnProperty::NewL( XnPropertyNames::menu::KEvent, - newValue, sp ); - - CleanupStack::Pop( newValue ); - - CleanupStack::PushL( prop ); - - // and set it - aMenuItem.SetPropertyL( prop ); - CleanupStack::Pop( prop ); - - CleanupStack::PopAndDestroy(eventstr ); // eventstr, children - } - - CleanupStack::PopAndDestroy( item ); - CleanupStack::PopAndDestroy( pluginName ); - } - else if ( focused && aSource == KConfigurationModel ) - { - CXnNodeAppIf* node( FindFromConfigurationL( focused ) ); - - if ( node ) - { - CXnProperty* launch( node->GetPropertyL( KLaunch ) ); - CXnProperty* plugin( node->GetPropertyL( KName ) ); - - if ( !launch || !plugin ) - { - // no plugin or no launch action - return showItem; - } - - HBufC* pluginName( plugin->StringValueL() ); - CleanupStack::PushL( pluginName ); - - CXnProperty* prop( aMenuItem.GetPropertyL( KName ) ); - - if ( prop ) - { - HBufC* item( prop->StringValueL() ); - CleanupStack::PushL( item ); - - showItem = iFwEventHandler->HasMenuItem( *pluginName, *item ); - - CleanupStack::PopAndDestroy( item ); - } - else - { - showItem = iFwEventHandler->HasMenuItem( *pluginName, KNullDesC ); - } - - CleanupStack::PopAndDestroy( pluginName ); - - if ( showItem ) - { - // Create launch event and store it to menuitem's property - RPointerArray children( node->ChildrenL() ); - CleanupClosePushL( children ); - - TInt count( children.Count() ); - - TInt length( launch->StringValue().Length() + 2 ); // +2 for '(' and ')' - - for ( TInt i = 0; i < count; i++ ) - { - if ( i > 0 ) - { - length += 1; - } - - CXnProperty* prop( children[i]->GetPropertyL( KName ) ); - - if ( prop ) - { - length += prop->StringValue().Length(); - } - } - - HBufC8* eventstr = HBufC8::NewLC( length ); - - TPtr8 str( eventstr->Des() ); - - str.Append( launch->StringValue() ); - - str.Append( TChar( '(' ) ); - - for ( TInt i = 0; i < count; i++ ) - { - if ( i > 0 ) - { - str.Append( TChar( ',' ) ); - } - - CXnProperty* prop( children[i]->GetPropertyL( KName ) ); - - if ( prop ) - { - str.Append( prop->StringValue() ); - } - } - - str.Append( TChar( ')' ) ); - - CXnDomStringPool& sp( iUiEngine->StringPool() ); - - CXnDomPropertyValue* newValue = CXnDomPropertyValue::NewL( sp ); - CleanupStack::PushL( newValue ); - - newValue->SetStringValueL( CXnDomPropertyValue::EString, str ); - - CXnProperty* prop = CXnProperty::NewL( XnPropertyNames::menu::KEvent, - newValue, sp ); - - CleanupStack::Pop( newValue ); - - CleanupStack::PushL( prop ); - - // and set it - aMenuItem.SetPropertyL( prop ); - CleanupStack::Pop( prop ); - - CleanupStack::PopAndDestroy( 2, &children ); // eventstr, children - } - } - } - - return showItem; - } - -TBool CAIXuikonMenuEventHandler::InitDefaultModeMenuItemL( CXnNodeAppIf& aMenuItem, CXnNodeAppIf* aFocused, const TDesC8& aSource ) - { - TBool showItem( EFalse ); - TInt len( 0 ); - if ( aSource == KContentModel ) - { - CXnProperty* prop( aMenuItem.GetPropertyL( KName ) ); - if ( !prop ) - { - return showItem; - } - - RPointerArray plnNames; - CleanupStack::PushL( TCleanupItem( DeletePluginNames, &plnNames ) ); - - CXnNodeAppIf* focused( aFocused ); - HBufC* item ( prop->StringValueL() ); - CleanupStack::PushL( item ); - - if( item->Des() == KHSOnLine_OffLine() ) - { - TBool webContent = EFalse; - RPointerArray plugins = iUiEngine->FindNodeByClassL( KContentSource16 ) ; - CleanupClosePushL( plugins ); - if( plugins.Count() <= 0 ) - { - CleanupStack::PopAndDestroy(&plugins); - CleanupStack::PopAndDestroy( item ); - CleanupStack::PopAndDestroy(&plnNames); - return showItem; - } - for (TInt i = 0; i < plugins.Count(); i++) - { - CXnProperty* property ( plugins[i]->GetPropertyL( KName ) ) ; - if ( property ) - { - HBufC16* pluginName ( property->StringValueL() ); - CleanupStack::PushL( pluginName ); - if( iFwEventHandler->HasMenuItem( *pluginName , *item ) ) - { - webContent = ETrue; - CleanupStack::PopAndDestroy( pluginName ); - break; - } - CleanupStack::PopAndDestroy( pluginName ); - } - } - CleanupStack::PopAndDestroy(&plugins); - - // At least one widget using web content - if ( webContent ) - { - CXnProperty* status( aMenuItem.GetPropertyL(KStatus) ); - if ( status ) - { - HBufC* statusValue ( status->StringValueL() ); - CleanupStack::PushL( statusValue ); - if ( (statusValue->Des() == KHSOnLine()) && !iFwEventHandler->IsPluginsOnline() ) - { - plnNames.AppendL( KHSOnLine().Alloc() ); - len = KHSOnLine().Length(); - } - else if ( (statusValue->Des() == KHSOffLine()) && iFwEventHandler->IsPluginsOnline() ) - { - plnNames.AppendL( KHSOffLine().Alloc() ); - len = KHSOffLine().Length(); - } - CleanupStack::PopAndDestroy( statusValue ); - } - } - } - else - { - if( focused ) - { - RPointerArray< CXnNodeAppIf > plugins; - CleanupClosePushL( plugins ); - - iUiEngine->GetPluginNodeArrayL( plugins ); - - CXnNodeAppIf* node( NULL ); - - for( ; focused; focused = focused->ParentL() ) - { - if( plugins.Find( focused ) != KErrNotFound ) - { - node = FindFromContentModelL( focused ); - break; - } - } - - CleanupStack::PopAndDestroy( &plugins ); - - if( !node ) - { - // no plugin or no launch action - CleanupStack::PopAndDestroy(item ); - CleanupStack::PopAndDestroy(&plnNames); - return showItem; - } - CXnProperty* plugin ( node->GetPropertyL( KName ) ) ; - if( !plugin ) - { - // no plugin or no launch action - CleanupStack::PopAndDestroy(item ); - CleanupStack::PopAndDestroy(&plnNames); - return showItem; - } - HBufC16* pluginName( plugin->StringValueL() ); - CleanupStack::PushL( pluginName ); - if( iFwEventHandler->HasMenuItem( *pluginName , *item ) ) - { - plnNames.AppendL( pluginName ); - len += pluginName->Length(); - CleanupStack::Pop( pluginName ); - } - else - { - CleanupStack::PopAndDestroy( pluginName ); - } - } - else - { - RPointerArray plugins = iUiEngine->FindNodeByClassL( KContentSource16 ) ; - if( plugins.Count() <= 0 ) - { - CleanupStack::PopAndDestroy( item ); - CleanupStack::PopAndDestroy(&plnNames); - return showItem; - } - CleanupClosePushL( plugins ); - for (TInt i = 0; i < plugins.Count(); i++) - { - CXnProperty* property ( plugins[i]->GetPropertyL( KName ) ) ; - if ( property ) - { - HBufC16* pluginName ( property->StringValueL() ); - CleanupStack::PushL( pluginName ); - if( iFwEventHandler->HasMenuItem( *pluginName , *item ) ) - { - plnNames.AppendL( pluginName ); - len += pluginName->Length(); - CleanupStack::Pop( pluginName ); - } - else - { - CleanupStack::PopAndDestroy( pluginName ); - } - } - } - CleanupStack::PopAndDestroy(&plugins); - } - } - - TInt count = plnNames.Count(); - if( count > 0 ) - { - showItem = ETrue; - // [pluginName1,...]/menuitem(item) - // Create launch event and store it to menuitem's property - HBufC8* eventstr = HBufC8::NewLC( len + - + 15 // / ( ) [ ] - + item->Length() ); - TPtr8 str ( eventstr->Des() ); - str.Copy( KOpenBrace ); - for ( TInt i = 0; i < count; i++ ) - { - str.Append( plnNames[i]->Des() ); - if ( i+1 != count ) str.Append( TChar( ',' ) ); - } - str.Append( KCloseBrace ); - str.Append( TChar( '/' ) ); - str.Append( KMenuItem ); - str.Append( TChar( '(' ) ); - str.Append( item->Des() ); - str.Append( TChar( ')' ) ); - - CXnDomStringPool& sp( iUiEngine->StringPool() ); - - CXnDomPropertyValue* newValue = CXnDomPropertyValue::NewL( sp ); - CleanupStack::PushL( newValue ); - - newValue->SetStringValueL( CXnDomPropertyValue::EString, str ); - - CXnProperty* prop = CXnProperty::NewL( XnPropertyNames::menu::KEvent, - newValue, sp ); - - CleanupStack::Pop( newValue ); - - CleanupStack::PushL( prop ); - - // and set it - aMenuItem.SetPropertyL( prop ); - CleanupStack::Pop( prop ); - - CleanupStack::PopAndDestroy( eventstr ); // eventstr, children - } - - CleanupStack::PopAndDestroy( item ); - CleanupStack::PopAndDestroy( &plnNames ); - } - else if ( aFocused && aSource == KConfigurationModel ) - { - CXnNodeAppIf* node( FindFromConfigurationL( aFocused ) ); - - if ( node ) - { - CXnProperty* launch( node->GetPropertyL( KLaunch ) ); - CXnProperty* plugin( node->GetPropertyL( KName ) ); - - if ( !launch || !plugin ) - { - // no plugin or no launch action - return showItem; - } - - HBufC* pluginName( plugin->StringValueL() ); - CleanupStack::PushL( pluginName ); - - CXnProperty* prop( aMenuItem.GetPropertyL( KName ) ); - - if ( prop ) - { - HBufC* item( prop->StringValueL() ); - CleanupStack::PushL( item ); - - showItem = iFwEventHandler->HasMenuItem( *pluginName, *item ); - - CleanupStack::PopAndDestroy( item ); - } - else - { - showItem = iFwEventHandler->HasMenuItem( *pluginName, KNullDesC ); - } - - CleanupStack::PopAndDestroy( pluginName ); - - if ( showItem ) - { - // Create launch event and store it to menuitem's property - RPointerArray children( node->ChildrenL() ); - CleanupClosePushL( children ); - - TInt count( children.Count() ); - - TInt length( launch->StringValue().Length() + 2 ); // +2 for '(' and ')' - - for ( TInt i = 0; i < count; i++ ) - { - if ( i > 0 ) - { - length += 1; - } - - CXnProperty* prop( children[i]->GetPropertyL( KName ) ); - - if ( prop ) - { - length += prop->StringValue().Length(); - } - } - - HBufC8* eventstr = HBufC8::NewLC( length ); - - TPtr8 str( eventstr->Des() ); - - str.Append( launch->StringValue() ); - - str.Append( TChar( '(' ) ); - - for ( TInt i = 0; i < count; i++ ) - { - if ( i > 0 ) - { - str.Append( TChar( ',' ) ); - } - - CXnProperty* prop( children[i]->GetPropertyL( KName ) ); - - if ( prop ) - { - str.Append( prop->StringValue() ); - } - } - - str.Append( TChar( ')' ) ); - - CXnDomStringPool& sp( iUiEngine->StringPool() ); - - CXnDomPropertyValue* newValue = CXnDomPropertyValue::NewL( sp ); - CleanupStack::PushL( newValue ); - - newValue->SetStringValueL( CXnDomPropertyValue::EString, str ); - - CXnProperty* prop = CXnProperty::NewL( XnPropertyNames::menu::KEvent, - newValue, sp ); - - CleanupStack::Pop( newValue ); - - CleanupStack::PushL( prop ); - - // and set it - aMenuItem.SetPropertyL( prop ); - CleanupStack::Pop( prop ); - - CleanupStack::PopAndDestroy( 2, &children ); // eventstr, children - } - } - } - - // Currently we don't support default mode dynamic menu item for ConfigurationModel - return showItem; - } - -CXnProperty* CAIXuikonMenuEventHandler::GetWidgetPropertyL(CXnNodeAppIf& aPlugin, const TDesC8& aProperty) - { - CXnProperty* retval = NULL; - RPointerArray children(aPlugin.ChildrenL()); - CleanupClosePushL( children ); - TInt childCount = children.Count(); - for (TInt i = 0; i < childCount; i++) - { - //search for widget element and get given property - CXnNodeAppIf* widget = children[i]; - if (widget && widget->InternalDomNodeType() == KWidget) - { - retval = widget->GetPropertyL(aProperty); - i = childCount; - } - } - CleanupStack::PopAndDestroy( &children ); - return retval; - } - -TBool CAIXuikonMenuEventHandler::DynInitItemL( CXnNodeAppIf& aMenuItem, CXnNodeAppIf* aFocused ) - { - CXnProperty* prop( aMenuItem.GetPropertyL( KSource ) ); - if ( prop ) - { - if ( prop && prop->StringValue().Length() > 0 ) - { - if ( iUiEngine->IsEditMode() ) - { - return InitEditModeMenuItemL( aMenuItem, aFocused, prop->StringValue() ); - } - else - { - return InitDefaultModeMenuItemL( aMenuItem, aFocused, prop->StringValue() ); - } - } - } - else - { - CXnProperty* idProp( aMenuItem.GetPropertyL( KId ) ); - if ( idProp ) - { - const TDesC8& id = idProp->StringValue(); - if ( id == KEditWidget ) - { - if ( aFocused ) - { - for ( CXnNodeAppIf* candidate = aFocused; candidate; candidate = candidate->ParentL() ) - { - if ( candidate->InternalDomNodeType() == KPlugin && !iUiEngine->IsEditMode() ) - { - return ETrue; - } - } - } - } - else if( id == KRemoveItem && iUiEngine->IsEditMode() ) - { - // get plugin node from focused - CXnNodeAppIf* node = aFocused; - CXnNodeAppIf* pluginNode = NULL; - for(; node && node->Type()->Type() != KView; node = node->ParentL() ) - { - CXnProperty* configurationId( node->GetPropertyL( KConfigurationId ) ); - CXnProperty* pluginId( node->GetPropertyL( KPluginId ) ); - - if( configurationId && pluginId ) - { - pluginNode = node; - break; - } - } - - if( pluginNode ) - { - // check if plugin can be removed - CXnProperty* removable = GetWidgetPropertyL(*pluginNode, KRemovable); - if ( removable && removable->StringValue() == XnPropertyNames::KFalse ) - { - return EFalse; - } - // hide menu item if the focused plugin is an "empty" widget - CXnProperty* pluginName = pluginNode->GetPropertyL( KPluginName ); - if( pluginName ) - { - const TDesC8& nameStr = pluginName->StringValue(); - if( nameStr == KDummy8 ) - { - return EFalse; - } - else - { - return ETrue; - } - } - } - } - } - } - - return EFalse; - } - - -TBool CAIXuikonMenuEventHandler::DynInitMenuItemL( CXnNodeAppIf& aMenuItem ) - { - TBool ret = EFalse; - if( !iUiEngine->WidgetsVisible() ) - { - // only online/offline dynamic menu item is allowed to show now - CXnProperty* prop( aMenuItem.GetPropertyL(KName) ); - if ( prop ) - { - HBufC* item ( prop->StringValueL() ); - CleanupStack::PushL( item ); - if (item->Des() == KHSOnLine_OffLine() ) - { - ret = DynInitItemL( aMenuItem, iUiEngine->FocusedNode() ); - } - CleanupStack::PopAndDestroy( item ); - } - } - else - { - ret = DynInitItemL( aMenuItem, iUiEngine->FocusedNode() ); - } - return ret; - } - diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/src/appui.cpp --- a/idlehomescreen/xmluicontroller/src/appui.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/appui.cpp Wed May 12 13:22:51 2010 +0300 @@ -17,38 +17,50 @@ // System includes #include -#include // For status pane layout resource ids -#include -#include // For RProperty +#include +#include #include -#include // Avkon dialog shutter. +#include #include +#include +#include +#include +#include +#include +#include // User includes +#include +#include #include #include +#include #include #include "appui.h" #include "application.h" #include "xmluicontroller.h" #include "aixuikoneventhandler.h" -#include "aiuiframeworkobserver.h" #include "aixmluiconstants.h" #include "contentrenderer.h" #include "psobserver.h" -#include "aipropertyextension.h" #include "aicontentmodel.h" #include "aiuiidleintegration.h" #include "xmluicontrollerpanic.h" -#include "debug.h" -#include "ai3perf.h" #include "xndomnode.h" #include "xnproperty.h" #include "xnuiengineappif.h" #include "onlineofflinehelper.h" +#include "ainativeuiplugins.h" + +#include "debug.h" + +// Constants +// EAiDeviceStatusContentNetworkIdentity content id +_LIT( KNetworkIdentity, "NetworkIdentity" ); +const TUid KVoiceUiUID = { 0x101F8543 }; using namespace AiXmlUiController; @@ -69,32 +81,36 @@ // void CAppUi::ConstructL() { - AI3_PERF_START(perfdata, "xmluicontroller: CAppUi::ConstructL") - + __TICK( "CAppUi::ConstructL" ); + // Always reset the phoneforward P&S key on startup just in case - RProperty::Set(KPSUidAiInformation, - KActiveIdleForwardNumericKeysToPhone, - EPSAiForwardNumericKeysToPhone); - + RProperty::Set( KPSUidAiInformation, + KActiveIdleForwardNumericKeysToPhone, EPSAiForwardNumericKeysToPhone ); + + iEditModeTitle = StringLoader::LoadL( R_QTN_HS_TITLE_EDITMODE ); + // Initialize with empty title pane so it's not shown on startup. __HEAP("XML UI: Init - Construct App UI") - __TIME("XML UI: XnAppUiAdapted::ConstructL", - CXnAppUiAdapter::ConstructL(); - ) + + __TIME("XML UI: CXnAppUiAdapter::ConstructL", + CXnAppUiAdapter::ConstructL() ); + + CAknAppUiBase::SetKeyEventFlags( CAknAppUiBase::EDisableSendKeyShort | + CAknAppUiBase::EDisableSendKeyLong ); // Register for XML UI view activation & deactivation AddViewActivationObserverL( this ); // Disable CCoeEnv exit checks. // Active Idle Framework will perform the checks. - iCoeEnv->DisableExitChecks(ETrue); + iCoeEnv->DisableExitChecks( ETrue ); __TIME("XML UI: Construct Content Renderer", iContentRenderer = CContentRenderer::NewL( *this ); ) __HEAP("XML UI: Construct Content Renderer"); - TXnUiEngineAppIf* uiEngine = UiEngineL(); + TXnUiEngineAppIf* uiEngine( UiEngineL() ); __ASSERT_ALWAYS( uiEngine, Panic(ECriticalPointerNull) ); iUiCtl.SetObserver( *iContentRenderer ); @@ -104,30 +120,19 @@ iUiCtl.SetAppUi( *this ); iEventHandler = iUiCtl.CreateXuikonEventHandlerL( *iContentRenderer ); - - iUiFwObserver = iUiCtl.UiFrameworkObserver(); - + TAiIdleKeySoundConfig keySoundConfig; keySoundConfig.iKeySounds = KeySounds(); keySoundConfig.iContextResId = R_XUI_DEFAULT_SKEY_LIST; - iIdleIntegration = CAiUiIdleIntegration::NewL - ( *iEikonEnv, keySoundConfig, iUiCtl.FwEventHandler() ); - - iHelper = COnlineOfflineHelper::NewL( iUiCtl ); - iUiCtl.NotifyAppEnvReadyL(); - LoadNativeDataPluginsL(); - - CAknAppUiBase::SetKeyEventFlags( CAknAppUiBase::EDisableSendKeyShort | - CAknAppUiBase::EDisableSendKeyLong ); + iHelper = COnlineOfflineHelper::NewL( iUiCtl ); - iIsEditModeActive = EFalse; - - - __HEAP("XML UI: Done - Construct App UI"); - AI3_PERF_STOP(perfdata, "xmluicontroller: CAppUi::ConstructL") + iIdleIntegration = CAiUiIdleIntegration::NewL + ( *iEikonEnv, keySoundConfig, iUiCtl.FwEventHandler() ); + + __TICK( "CAppUi::ConstructL - done" ); } // ---------------------------------------------------------------------------- @@ -149,6 +154,8 @@ // CAppUi::~CAppUi() { + delete iEditModeTitle; + delete iKeyTimer; delete iHelper; delete iEventHandler; delete iContentRenderer; @@ -156,31 +163,57 @@ } // ---------------------------------------------------------------------------- +// CAppUi::ActivateUi() +// ---------------------------------------------------------------------------- +// +void CAppUi::ActivateUi() + { + __PRINTS( "*** CAppUi::ActivateUi" ); + + if ( iDeviceStatusInfo.Uid() == TUid::Null() ) + { + __PRINTS( "*** CAppUi::ActivateUI - Loading DeviceStatus plugin" ); + + _LIT8( KNs, "namespace" ); + + // Load device status plugin here because it is always needed + iDeviceStatusInfo = THsPublisherInfo( KDeviceStatusPluginUid, + KDeviceStatusPluginName, KNs ); + + iUiCtl.FwStateHandler()->LoadPlugin( + iDeviceStatusInfo, EAiFwSystemStartup ); + } + + __PRINTS( "*** CAppUi::ActivateUi - done" ); + } + +// ---------------------------------------------------------------------------- +// CAppUi::HandleUiReadyEventL() +// ---------------------------------------------------------------------------- +// +void CAppUi::HandleUiReadyEventL() + { + __PRINTS( "*** CAppUi::HandleUiReadyEventL" ); + + iUiCtl.FwEventHandler()->HandleUiReadyEventL( iUiCtl ); + + __PRINTS( "*** CAppUi::HandleUiReadyEventL - done" ); + } + +// ---------------------------------------------------------------------------- // CAppUi::PrepareToExit() // ---------------------------------------------------------------------------- // void CAppUi::PrepareToExit() - { + { + RemoveViewActivationObserver( this ); + iUiCtl.FwEventHandler()->HandleUiShutdown( iUiCtl ); CXnAppUiAdapter::PrepareToExit(); } // ---------------------------------------------------------------------------- -// CAppUi::HandleForegroundEventL() -// ---------------------------------------------------------------------------- -// -void CAppUi::HandleForegroundEventL( TBool aForeground ) - { - CXnAppUiAdapter::HandleForegroundEventL( aForeground ); - - if( iUiFwObserver ) - { - iUiFwObserver->HandleForegroundEvent( aForeground ); - } - } - -// ---------------------------------------------------------------------------- // CAppUi::HandleCommandL() // ---------------------------------------------------------------------------- // @@ -210,20 +243,6 @@ } // ---------------------------------------------------------------------------- -// CAppUi::HandleResourceChangeL() -// ---------------------------------------------------------------------------- -// -void CAppUi::HandleResourceChangeL( TInt aType ) - { - CXnAppUiAdapter::HandleResourceChangeL( aType ); - - if( iUiFwObserver ) - { - iUiFwObserver->HandleResourceChange( aType ); - } - } - -// ---------------------------------------------------------------------------- // CAppUi::HandleWsEventL() // ---------------------------------------------------------------------------- // @@ -244,13 +263,36 @@ TKeyEvent key; key.iScanCode = EStdKeyNo; - key.iCode = EStdKeyNull; + key.iCode = EKeyNull; key.iModifiers = 0; key.iRepeats = 0; iCoeEnv->SimulateKeyEventL( key, EEventKey ); } } + + if( aEvent.Type() == EEventKeyDown ) + { + if( aEvent.Key()->iScanCode == EStdKeyYes ) + { + // Send key was pushed and long press recognition is started + StartKeyTimerL(); + } + } + + if( aEvent.Type() == EEventKeyUp ) + { + if( aEvent.Key()->iScanCode == EStdKeyYes ) + { + if( iKeyTimer && iKeyTimer->IsActive() ) + { + // up event is coming before long press of Send key is recognized + // Start dialled calls + StopKeyTimer(); + LogsUiCmdStarter::CmdStartL( LogsUiCmdStarterConsts::KDialledView() ); + } + } + } if( iIdleIntegration ) { @@ -279,92 +321,58 @@ { __TIME("UC: Event Management", iEventHandler->HandleXuikonEventL( aOrigin, - aTrigger, - aTriggerDefinition, - aEvent ); - ); + aTrigger, aTriggerDefinition, aEvent ) ); } __PRINTS("*** UI: Done - Event Management"); } + +// ---------------------------------------------------------------------------- +// CAppUi::HandleEventL() +// ---------------------------------------------------------------------------- +// +void CAppUi::HandleEventL( const TDesC& aEvent, CXnNodeAppIf& aDestination ) + { + THsPublisherInfo info; + iUiCtl.PublisherInfoL( aDestination, info ); + + iUiCtl.FwEventHandler()->HandlePluginEventL( info, aEvent ); + } + // ---------------------------------------------------------------------------- // CAppUi::LoadDataPluginsL() // ---------------------------------------------------------------------------- // -void CAppUi::LoadDataPluginsL( RPointerArray< CXnNodeAppIf >& aList ) +TInt CAppUi::LoadPublisher( CXnNodeAppIf& aPublisher, TInt aReason ) { - for( TInt i = 0; i < aList.Count(); i++ ) - { - TAiPublisherInfo info; - - iUiCtl.PublisherInfoL( *aList[i], info ); - - iUiCtl.FwEventHandler()->HandleLoadPluginL( info ); - } - } + THsPublisherInfo info; + + TRAP_IGNORE( iUiCtl.PublisherInfoL( aPublisher, info ) ); -// ---------------------------------------------------------------------------- -// CAppUi::LoadNativeDataPluginsL() -// ---------------------------------------------------------------------------- -// -void CAppUi::LoadNativeDataPluginsL() - { - if ( !iNativePluginsLoaded ) + if ( info.Uid() == KDeviceStatusPluginUid ) { - RAiPublisherInfoArray plugins; - CleanupClosePushL( plugins ); - - iUiCtl.PublisherInfoL( plugins ); - - for ( TInt i = 0; i < plugins.Count(); i++ ) - { - iUiCtl.FwEventHandler()->HandleLoadPluginL( plugins[i] ); - } - - CleanupStack::PopAndDestroy( &plugins ); - - iNativePluginsLoaded = ETrue; - } + // Update device status info + iDeviceStatusInfo = info; + } + + return iUiCtl.FwStateHandler()->LoadPlugin( + info, (TAiFwLoadReason) aReason ); } // ---------------------------------------------------------------------------- -// CAppUi::DestroyDataPluginsL() -// ---------------------------------------------------------------------------- -// -void CAppUi::DestroyDataPluginsL( RPointerArray< CXnNodeAppIf >& aList ) - { - for( TInt i = 0; i < aList.Count(); i++ ) - { - TAiPublisherInfo info; - - iUiCtl.PublisherInfoL( *aList[i], info ); - - iUiCtl.FwEventHandler()->HandleDestroyPluginL( info ); - } - } - -// ---------------------------------------------------------------------------- -// CAppUi::DestroyNativeDataPluginsL() +// CAppUi::DestroyPublisher() // ---------------------------------------------------------------------------- // -void CAppUi::DestroyNativeDataPluginsL() +TInt CAppUi::DestroyPublisher( CXnNodeAppIf& aPublisher, TInt aReason ) { - if ( iNativePluginsLoaded ) - { - RAiPublisherInfoArray plugins; - CleanupClosePushL( plugins ); - - iUiCtl.PublisherInfoL( plugins ); - - for ( TInt i = 0; i < plugins.Count(); i++ ) - { - iUiCtl.FwEventHandler()->HandleDestroyPluginL( plugins[i] ); - } - - CleanupStack::PopAndDestroy( &plugins ); - - iNativePluginsLoaded = EFalse; - } + THsPublisherInfo info; + + TRAP_IGNORE( iUiCtl.PublisherInfoL( aPublisher, info ) ); + + iUiCtl.FwStateHandler()->DestroyPlugin( + info, (TAiFwDestroyReason) aReason ); + + return KErrNone; } // ---------------------------------------------------------------------------- @@ -393,7 +401,7 @@ for( TInt i = 0; !retval && i < list.Count(); i++ ) { - TAiPublisherInfo info; + THsPublisherInfo info; iUiCtl.PublisherInfoL( *list[i], info ); @@ -406,49 +414,12 @@ // ---------------------------------------------------------------------------- // CAppUi::SetOnlineStateL() -// Called always by view manager when view is activated. -// ---------------------------------------------------------------------------- -// -void CAppUi::SetOnlineStateL( RPointerArray< CXnNodeAppIf >& aList ) - { - iHelper->ProcessOnlineStateL( aList ); - } - -// ---------------------------------------------------------------------------- -// CAppUi::SetOnlineL() // Called always when user changed HS online/offline status from option menu. // ---------------------------------------------------------------------------- // void CAppUi::SetOnlineStateL( TBool aOnline ) - { - iHelper->ProcessOnlineStateL( aOnline ); - } - -// ---------------------------------------------------------------------------- -// CAppUi::HandleViewActivation() -// ---------------------------------------------------------------------------- -// -void CAppUi::HandleViewActivation( const TVwsViewId& aNewlyActivatedViewId, - const TVwsViewId& aViewIdToBeDeactivated ) - { - if ( iIsEditModeActive ) - { - return; - } - - // Get Xml Ui view id - TVwsViewId viewId( View().ViewId() ); - - if ( viewId == aNewlyActivatedViewId ) - { - // Xml Ui view became active - TRAP_IGNORE( LoadNativeDataPluginsL() ); - } - else if ( viewId == aViewIdToBeDeactivated ) - { - // Xml Ui view became inactive - TRAP_IGNORE( DestroyNativeDataPluginsL() ); - } + { + iHelper->ProcessOnlineStateL( aOnline ); } // ---------------------------------------------------------------------------- @@ -461,12 +432,12 @@ } // ---------------------------------------------------------------------------- -// CAppUi::HandlePageSwitch() +// CAppUi::Helper() // ---------------------------------------------------------------------------- // -void CAppUi::HandlePageSwitch() +COnlineOfflineHelper* CAppUi::Helper() const { - iUiCtl.FwEventHandler()->ProcessStateChange( EAifwPageSwitch ); + return iHelper; } // ---------------------------------------------------------------------------- @@ -475,16 +446,227 @@ // void CAppUi::HandleEnterEditModeL( TBool aEnter ) { - if ( aEnter ) + if ( iInEditMode != aEnter ) + { + TVwsViewId activeViewId; + TInt err( GetActiveViewId( activeViewId ) ); + + if ( aEnter ) + { + iUiCtl.FwEventHandler()->SuspendContent( + iDeviceStatusInfo, KNetworkIdentity ); + + if ( !err && View().ViewId() == activeViewId ) + { + SetTitlePaneTextL( *iEditModeTitle ); + } + } + else + { + if ( !err && View().ViewId() == activeViewId ) + { + SetTitlePaneTextL( KNullDesC ); + } + + iUiCtl.FwEventHandler()->RefreshContent( + iDeviceStatusInfo, KNetworkIdentity ); + } + + iInEditMode = aEnter; + } + } + +// ---------------------------------------------------------------------------- +// CAppUi::HandleViewActivation() +// ---------------------------------------------------------------------------- +// +void CAppUi::HandleViewActivation( const TVwsViewId& aNewlyActivatedViewId, + const TVwsViewId& aViewIdToBeDeactivated ) + { + TVwsViewId activeViewId; + + TInt err( GetActiveViewId( activeViewId ) ); + + if ( err == KErrNotFound ) { - DestroyNativeDataPluginsL(); - iIsEditModeActive = ETrue; + return; + } + + // Get Xml Ui view id + TVwsViewId xmlViewId( View().ViewId() ); + + if ( xmlViewId == aNewlyActivatedViewId && activeViewId != xmlViewId ) + { + if ( iInEditMode ) + { + TRAP_IGNORE( SetTitlePaneTextL( *iEditModeTitle ) ); + } + else + { + // Xml Ui view became active + iUiCtl.FwEventHandler()->RefreshContent( + iDeviceStatusInfo, KNetworkIdentity ); + } + } + else if ( xmlViewId == aViewIdToBeDeactivated && activeViewId == xmlViewId ) + { + if ( iInEditMode ) + { + TRAP_IGNORE( SetTitlePaneTextL( KNullDesC ) ); + } + else + { + // Xml Ui view became inactive + iUiCtl.FwEventHandler()->SuspendContent( + iDeviceStatusInfo, KNetworkIdentity ); + } + } + } + +// ---------------------------------------------------------------------------- +// CAppUi::StartKeyTimerL() +// Starts long press recognizer of Send key. +// ---------------------------------------------------------------------------- +// +void CAppUi::StartKeyTimerL() + { + if ( !iKeyTimer ) + { + iKeyTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + } + else if ( iKeyTimer->IsActive() ) + { + iKeyTimer->Cancel(); + } + iKeyTimer->Start( KAknKeyboardRepeatInitialDelay, + KAknKeyboardRepeatInitialDelay, + TCallBack ( ReportLongPressL, this ) ); + } + +// ---------------------------------------------------------------------------- +// CAppUi::StopKeyTimer() +// Stops Send key long press recognizer. +// ---------------------------------------------------------------------------- +// +void CAppUi::StopKeyTimer() + { + if ( iKeyTimer && iKeyTimer->IsActive() ) + { + iKeyTimer->Cancel(); + } + } + +// ---------------------------------------------------------------------------- +// CAppUi::HandleViewActivation() +// Launches Voice command application after long Send key is pressed. +// ---------------------------------------------------------------------------- +// +void CAppUi::LaunchVoiceCommandL() + { + TApaTaskList apaTaskList( iCoeEnv->WsSession() ); + TApaTask apaTask = apaTaskList.FindApp( KVoiceUiUID ); + + if ( apaTask.Exists() ) + { + apaTask.BringToForeground(); } else { - LoadNativeDataPluginsL(); - iIsEditModeActive = EFalse; + RApaLsSession apaLsSession; + User::LeaveIfError( apaLsSession.Connect() ); + CleanupClosePushL( apaLsSession ); + + TApaAppInfo appInfo; + + if( apaLsSession.GetAppInfo( appInfo, KVoiceUiUID ) == KErrNone ) + { + CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); + cmdLine->SetExecutableNameL( appInfo.iFullName ); + cmdLine->SetCommandL( EApaCommandRun ); + User::LeaveIfError( apaLsSession.StartApp( *cmdLine ) ); + CleanupStack::PopAndDestroy( cmdLine ); + } + CleanupStack::PopAndDestroy( &apaLsSession ); } } +// ---------------------------------------------------------------------------- +// CAppUi::ReportLongPressL() +// Callback function for long press timer of the Send key. +// ---------------------------------------------------------------------------- +// +TInt CAppUi::ReportLongPressL( TAny* aThis ) + { + CAppUi* self = reinterpret_cast ( aThis ); + + self->StopKeyTimer(); + + if ( iAvkonAppUi->IsForeground() ) + { + self->LaunchVoiceCommandL(); + } + + return 1; // CPeriodic ignores return value + } + +// ---------------------------------------------------------------------------- +// CAppUi::SetTitlePaneTextL() +// +// ---------------------------------------------------------------------------- +// +void CAppUi::SetTitlePaneTextL( const TDesC& aText ) + { + CEikStatusPane* sp( StatusPane() ); + if ( !sp ) { return; } + + // make sure status pane is transparent. + sp->EnableTransparent( ETrue ); + + TUid titlePaneUid( TUid::Uid( EEikStatusPaneUidTitle ) ); + + CEikStatusPaneBase::TPaneCapabilities subPaneTitle( + sp->PaneCapabilities( titlePaneUid ) ); + + if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() ) + { + CAknTitlePane* title = + static_cast< CAknTitlePane* >( sp->ControlL( titlePaneUid ) ); + + if ( title ) + { + title->SetTextL( aText ); + title->DrawNow(); + } + } + + // redraw statuspane + sp->DrawNow(); + } + +// ----------------------------------------------------------------------------- +// CAppUi::HelpContextL +// Returns the help context +// ----------------------------------------------------------------------------- +// +CArrayFix* CAppUi::HelpContextL() const + { + TUid fwUid = TUid::Uid( AI_UID3_AIFW_COMMON ); + TCoeContextName helpString; + if( iUiCtl.UiEngineL()->IsEditMode()) + { + helpString.Copy( KSET_HLP_HOME_SCREEN_EDIT ); + } + else + { + helpString.Copy( KSET_HLP_HOME_SCREEN ); + } + + CArrayFixFlat* array = + new( ELeave ) CArrayFixFlat( 1 ); + CleanupStack::PushL( array ); + array->AppendL( TCoeHelpContext( fwUid, helpString ) ); + CleanupStack::Pop( array ); + return array; + } + // End of File. diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/src/cenrepobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/cenrepobserver.cpp Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,174 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms 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: Listens to changes in a Central Repository key +* KCurrentCellularDataUsage in Repository KCRUidCmManager. +*/ + +#include +#include +#include + +#include "cenrepobserver.h" +#include "ai3.hrh" +using namespace AiXmlUiController; + +#ifdef HS_NETWORK_MONITOR +#include +_LIT( KLogFolder,"xnnetwork" ); +_LIT( KLogDom, "networksettings.log" ); + +#define _LOG1( a ) RFileLogger::Write( \ + KLogFolder, KLogDom, EFileLoggingModeAppend, ( a ) ); +#define _LOG2( a, b ) RFileLogger::WriteFormat( \ + KLogFolder, KLogDom, EFileLoggingModeAppend, ( a ), ( b ) ) +#else +#define _LOG1 +#define _LOG2 +#endif + +// ----------------------------------------------------------------------------- +// CCenRepObserver::NewL +// ----------------------------------------------------------------------------- +// +CCenRepObserver* CCenRepObserver::NewL( MCenRepObserver* aObserver ) + { + CCenRepObserver* self = + CCenRepObserver::NewLC( aObserver ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CCenRepObserver::NewLC +// ----------------------------------------------------------------------------- +// +CCenRepObserver* CCenRepObserver::NewLC( MCenRepObserver* aObserver ) + { + CCenRepObserver* self = + new( ELeave ) CCenRepObserver( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CCenRepObserver::~CCenRepObserver +// ----------------------------------------------------------------------------- +// +CCenRepObserver::~CCenRepObserver() + { + // Cancel outstanding request, if exists + Cancel(); + delete iRepository; + iObserver = NULL; + } + +// ----------------------------------------------------------------------------- +// CCenRepObserver::CCenRepObserver +// ----------------------------------------------------------------------------- +// +CCenRepObserver::CCenRepObserver( MCenRepObserver* aObserver ) + : + CActive( CActive::EPriorityStandard ), + iObserver( aObserver ) + { + } + +// ----------------------------------------------------------------------------- +// CCenRepObserver::ConstructL +// ----------------------------------------------------------------------------- +// +void CCenRepObserver::ConstructL() + { + TRAPD( err, iRepository = CRepository::NewL( KCRUidCmManager ) ) + + if ( err == KErrNone ) + { + CActiveScheduler::Add( this ); + RequestNotifications(); + } + else + { + _LOG2( _L("FAILED to open KCRUidCmManager repository <%d>"), err ); + } + } + +// ----------------------------------------------------------------------------- +// CCenRepObserver::RequestNotifications +// ----------------------------------------------------------------------------- +// +void CCenRepObserver::RequestNotifications() + { + _LOG1( _L("CCenRepObserver::RequestNotifications") ); + + TInt err = iRepository->NotifyRequest( KCurrentCellularDataUsage, iStatus ); + + if ( err == KErrNone ) + { + SetActive(); + } + else + { + _LOG2( _L("ERROR, iRepository->NotifyRequest() %d"), err ); + } + } + +// ----------------------------------------------------------------------------- +// CCenRepObserver::DoCancel +// ----------------------------------------------------------------------------- +// +void CCenRepObserver::DoCancel() + { + iRepository->NotifyCancel( KCurrentCellularDataUsage ); + } + +// ----------------------------------------------------------------------------- +// CCenRepObserver::RunL +// ----------------------------------------------------------------------------- +// +void CCenRepObserver::RunL() + { + _LOG2( _L("CCenRepObserver::RunL() %d"), iStatus.Int() ); + + if ( iStatus.Int() < KErrNone ) + { + iErrorCounter++; + if ( iErrorCounter > KCenRepErrorRetryCount ) + { + _LOG2( _L("Over %d consecutive errors, stopping notifications permanently"), + KCenRepErrorRetryCount ); + return; + } + } + else + { + iErrorCounter = 0; + + TInt value( 0 ); + TInt err = iRepository->Get( KCurrentCellularDataUsage, value ); + + if ( err == KErrNone ) + { + _LOG2( _L("KCurrentCellularDataUsage: %d"), value ); + iObserver->CurrentCellularDataUsageChangedL( value ); + } + else + { + _LOG2( _L("ERROR, iRepository->Get(KCurrentCellularDataUsage) %d"), err ); + } + } + + RequestNotifications(); + } +// End-of-file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/src/contentpublisher.cpp --- a/idlehomescreen/xmluicontroller/src/contentpublisher.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/contentpublisher.cpp Wed May 12 13:22:51 2010 +0300 @@ -16,16 +16,13 @@ */ #include "contentpublisher.h" -#include "globalqueryhandler.h" #include #include #include -#include -#include #include "xmluicontroller.h" -#include -#include // StringLoader +#include "appui.h" +#include "onlineofflinehelper.h" using namespace AiXmlUiController; @@ -46,9 +43,6 @@ _LIT8( KAPStatus, "apstatus"); _LIT(KNetwork, "network"); -_LIT( KDisConnected, "disconnected"); -_LIT( KConnected, "connected"); - _LIT(KPublisher16, "publisher"); @@ -62,6 +56,7 @@ _LIT8( KWidth, "width"); _LIT8( KHeight, "height"); _LIT8( KChangeInfo, "change_info" ); + // ============================ LOCAL FUNCTIONS =============================== @@ -105,8 +100,6 @@ delete iServiceHandler; iServiceHandler = NULL; } - delete iGlobalQueryHandler; - delete iGlobalConfirmationQuery; } // ----------------------------------------------------------------------------- @@ -125,9 +118,6 @@ { InitCpsInterfaceL(); RegisterListenerL(); - iGlobalQueryHandler = CGlobalQueryHandler::NewL(iUiController); - iGlobalConfirmationQuery = CAknGlobalConfirmationQuery::NewL(); - } // ----------------------------------------------------------------------------- @@ -387,44 +377,21 @@ } void CContentPublisher::HandlePublisherInfoL( const TDesC& aPubInfo) - { - //Currently HS will handle only network status update form publisher - if ( aPubInfo == KNetwork ) - { - CLiwDefaultMap *outDataMap = CLiwDefaultMap::NewLC(); - GetDataL( KAI3HSPublisher(), KPublisher16, KNetwork(), outDataMap ); - TLiwVariant variant; - variant.PushL(); - if ( outDataMap->FindL(KAPStatus, variant)) - { - HBufC16* netStatus = variant.AsDes().AllocLC(); - if ( netStatus->Des() == KDisConnected() ) - { - ShowGlobalQueryL(R_QTN_HS_DISABLE_NETWORK, EFalse ); - } - else if ( netStatus->Des() == KConnected() ) - { - ShowGlobalQueryL(R_QTN_HS_SWITCH_ONLINE, ETrue ); - } - CleanupStack::PopAndDestroy( netStatus ); - } - CleanupStack::PopAndDestroy( &variant ); - CleanupStack::PopAndDestroy(outDataMap); - } - } - - -void CContentPublisher::ShowGlobalQueryL( TInt aResourceId, TBool aSetOnline ) { - if ( !iGlobalQueryHandler->IsActive() ) + //Currently HS will handle only network status update form publisher + if ( aPubInfo == KNetwork ) { - HBufC* confirmationText = StringLoader::LoadLC(aResourceId); - iGlobalConfirmationQuery->ShowConfirmationQueryL( - iGlobalQueryHandler->iStatus, - *confirmationText, - R_AVKON_SOFTKEYS_YES_NO); - iGlobalQueryHandler->SetOnlineParamAndActivate(aSetOnline); - CleanupStack::PopAndDestroy(); //confirmationText + _LIT( KOffline, "hs_offline" ); + CLiwDefaultMap *outDataMap = CLiwDefaultMap::NewLC(); + GetDataL( KAI3HSPublisher(), KPublisher16, KNetwork(), outDataMap ); + TLiwVariant variant; + variant.PushL(); + if ( outDataMap->FindL(KAPStatus, variant)) + { + iUiController.AppUi()->Helper()->HandleConnectionQueryL(variant.AsDes()); + } + CleanupStack::PopAndDestroy( &variant ); + CleanupStack::PopAndDestroy(outDataMap); } } // END OF FILE diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/src/contentrenderer.cpp --- a/idlehomescreen/xmluicontroller/src/contentrenderer.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/contentrenderer.cpp Wed May 12 13:22:51 2010 +0300 @@ -16,289 +16,91 @@ */ // System includes -#include -#include -#include +#include +#include +#include // User includes - -#include "contentrenderer.h" -#include "appui.h" -#include "activetransactionstack.h" -#include "transactionfactoryimpl.h" -#include "mtransaction.h" -#include "mtransactionelement.h" -#include "aixmluiutils.h" -#include "xmluicontroller.h" -#include "xmlnodeidgenerator.h" -#include "aixmluiconstants.h" -#include "aifweventhandler.h" -#include "databuffertransactionelement.h" -#include "newstickercallbackhandler.h" -#include "newstickertransactionelement.h" -#include "csspropertymap.h" -#include "policyevaluator.h" -#include "debug.h" -#include "xnuiengineappif.h" -#include "xnnodeappif.h" -#include "xnproperty.h" -#include "mxncomponentinterface.h" -#include "xntext.h" -#include "xnbitmap.h" -#include "xntype.h" -#include "xnmenuadapter.h" -#include "xnlistquerydialogadapter.h" -#include "mxncomponentinterface.h" -#include "aistrcnv.h" -#include "contentprioritymap.h" -#include "ainativeuiplugins.h" +#include +#include +#include "contentrenderer.h" +#include "appui.h" +#include "activetransactionstack.h" +#include "transactionfactoryimpl.h" +#include "mtransaction.h" +#include "mtransactionelement.h" +#include "aixmluiutils.h" +#include "xmluicontroller.h" +#include "xmlnodeidgenerator.h" +#include "aixmluiconstants.h" +#include "aifweventhandler.h" +#include "databuffertransactionelement.h" +#include "newstickercallbackhandler.h" +#include "newstickertransactionelement.h" +#include "csspropertymap.h" +#include "policyevaluator.h" +#include "debug.h" +#include "xnuiengineappif.h" +#include "xnnodeappif.h" +#include "xncomponentnodeimpl.h" +#include "xnproperty.h" +#include "mxncomponentinterface.h" +#include "xntext.h" +#include "xnbitmap.h" +#include "xntype.h" +#include "xnmenuadapter.h" +#include "xnlistquerydialogadapter.h" +#include "mxncomponentinterface.h" +#include "aistrcnv.h" +#include "contentprioritymap.h" +#include "ainativeuiplugins.h" using namespace AiXmlUiController; using namespace AiUiDef::xml; using namespace XnTextInterface; using namespace XnImageInterface; -namespace +/** + * Cleanup item for cleanup of TPtrHashMapIter + */ +class TMapCleanupItem { - typedef RPointerArray RXnNodeArray; - - /** - * Gets content item iterator. - * - * @param aPlugin plugin to fetch the iterator - * @param aContentType type of iterator (content/resource/event) - * @return the iterator - * @leave KErrNotSupported if plugin does not provide iterator - */ - static MAiContentItemIterator& ContentItemIteratorL( MAiPropertyExtension& aPlugin, - TInt aContentType ) - { - MAiContentItemIterator* iter = - static_cast< MAiContentItemIterator* >( aPlugin.GetPropertyL( aContentType ) ); - - if ( !iter ) - { - User::Leave( KErrNotSupported ); - } - - return *iter; - } - - /** - * Gets the content priority associated in the property element. - * - * @param aPropertyElement the property element - * @return priority value or KErrNotFound for non-prioritized element - */ - TInt GetContentPriority( CXnNodeAppIf& aPropertyElement ) - { - TInt32 priority( KErrNotFound ); - - const TDesC8* name = PropertyValue( aPropertyElement, - property::KName ); - - - if ( name && *name == name::KPriority ) - { - const TDesC8* value = PropertyValue( aPropertyElement, - property::KValue ); - if ( value ) - { - AiUtility::ParseInt( priority, *value ); - } - } - - return priority; - } - +public: /** - * Remove elements from array which do not contain priority or priority is not lower than - * the given value. - * - * @param aElements array of elements - * @param aLastPriority upper bound of priority value (excluded from the array) + * C++ consturctor */ - void RemoveNonPriorityElements( RPointerArray< CXnNodeAppIf>& aElements, - TInt aLastPriority ) - { - // Remove non priority elements and higher priority elements - - TInt elementCount = aElements.Count(); - for ( TInt i = 0; i < elementCount; ) - { - CXnNodeAppIf* current = aElements[i]; - - // Check name attribute - const TDesC8* name = PropertyValue( *current, property::KName ); - - if ( !name || *name != name::KPriority ) - { - // Remove current - aElements.Remove( i ); - --elementCount; - } - else - { - // Check current priority - const TDesC8* value = PropertyValue( *current, property::KValue ); - - if ( !value ) // value not present - { - aElements.Remove( i ); - --elementCount; - continue; - } - - TInt32 currentPriority( KErrNotFound ); - if ( AiUtility::ParseInt( currentPriority, *value ) != KErrNone ) - { - // value is not integer - aElements.Remove( i ); - --elementCount; - continue; - } - - if ( currentPriority < aLastPriority ) - { - // Keep element and iterate further - ++i; - } - else - { - // priority is too high - aElements.Remove( i ); - --elementCount; - } - } - } - } + TMapCleanupItem( TPtrHashMapIter< TDesC, TInt >& aIterator ); /** - * Descending priority order for prioritized content selectors. - * - * @param aNode1 First node to compare - * @param aNode2 Second node to compare - * @return 0 nodes have equal priority - * @return >0 aNode1 has lower priority - * @return <0 aNode2 has lower priority - */ - TInt DescendingPriorityOrder( const CXnNodeAppIf& aNode1, - const CXnNodeAppIf& aNode2 ) - { - // Array content has been validated, so no checks are needed - const TDesC8* value1 = PropertyValue( aNode1, - property::KValue ); - - const TDesC8* value2 = PropertyValue( aNode2, - property::KValue ); - - TInt32 priority1( KErrNotFound ); - AiUtility::ParseInt( priority1, *value1 ); - - TInt32 priority2( KErrNotFound ); - AiUtility::ParseInt( priority2, *value2 ); - - if ( priority1 == priority2 ) - { - return 0; - } + * Removes the pointers in the map and deletes the objects + * referenced by the pointers. + */ + void Release(); - return ( priority1 < priority2 ) ? 1 : -1; - } - - /** - * Removes duplicate entries in content change array - */ - void RemoveDuplicateContentChangesL( RAiPolicyElementArray& aArray ) - { - for ( TInt i = 0; i < aArray.Count(); ++i ) - { - HBufC* id = PropertyValueL( aArray[i].Target(), - AiUiDef::xml::property::KId ); - if ( id ) - { - CleanupStack::PushL( id ); - for ( TInt j = i; j < aArray.Count(); ++j ) - { - HBufC* id2 = PropertyValueL( aArray[j].Target(), - AiUiDef::xml::property::KId ); - if ( id2) - { - CleanupStack::PushL( id2 ); - // Same id and same policy - if ( i != j && - id->Compare( *id2 ) == 0 && - ( aArray[i].Policy().Compare( aArray[j].Policy()) == 0) - ) - { - aArray.Remove( j ); - --j; - } - } - CleanupStack::PopAndDestroy( id2 ); - - } - CleanupStack::PopAndDestroy( id ); - } - } - } - /** - * Cleanup item for cleanup of TPtrHashMapIter - */ - class TMapCleanupItem - { - public: - - TMapCleanupItem( TPtrHashMapIter< TDesC, TInt >& aIterator ); - - /** - * Removes the pointers in the map and deletes the objects - * referenced by the pointers. - */ - void Release(); - - private: - - TPtrHashMapIter< TDesC, TInt > iIterator; - - }; +private: + TPtrHashMapIter< TDesC, TInt > iIterator; + }; - /** - * Helper to handle cleanup of map iterator - * @param aMapCleanupItem - */ - void CleanupRelease( TAny* aMapCleanupItem ) - { - if ( aMapCleanupItem ) - { - static_cast< TMapCleanupItem* >( aMapCleanupItem )->Release(); - } - } - - /** - * Helper to push map iterator into cleanup stack. - * - * @param aCleanupItem item to push into cleanup stack - **/ - void CleanupReleasePushL( TMapCleanupItem& aCleanupItem ) - { - CleanupStack::PushL( TCleanupItem( CleanupRelease, - &aCleanupItem ) ); - } - - - } - +// ---------------------------------------------------------------------------- +// TMapCleanupItem::TMapCleanupItem +// +// ---------------------------------------------------------------------------- +// TMapCleanupItem::TMapCleanupItem( TPtrHashMapIter< TDesC, TInt >& aIterator ) : iIterator( aIterator ) { } +// ---------------------------------------------------------------------------- +// TMapCleanupItem::Release +// +// ---------------------------------------------------------------------------- +// void TMapCleanupItem::Release() { // Delete current key and value - const TDesC* key = iIterator.CurrentKey(); - const TInt* value = iIterator.CurrentValue(); + const TDesC* key( iIterator.CurrentKey() ); + const TInt* value( iIterator.CurrentValue() ); delete key; delete value; @@ -307,15 +109,227 @@ iIterator.RemoveCurrent(); } +// ============================ LOCAL FUNCTIONS =============================== +// ---------------------------------------------------------------------------- +// ContentItemIterator +// Gets content item iterator +// ---------------------------------------------------------------------------- +// +static MAiContentItemIterator* ContentItemIterator( CHsContentPublisher& aPlugin, + CHsContentPublisher::TProperty aType ) + { + return static_cast< + MAiContentItemIterator* >( aPlugin.GetProperty( aType ) ); + } + +// ---------------------------------------------------------------------------- +// ContentPriority +// Gets the content priority associated in the property element +// ---------------------------------------------------------------------------- +// +static TInt ContentPriority( CXnNodeAppIf& aPropertyElement ) + { + TInt32 priority( KErrNotFound ); + + const TDesC8* name( + PropertyValue( aPropertyElement, property::KName ) ); + + if ( name && *name == name::KPriority ) + { + const TDesC8* value( + PropertyValue( aPropertyElement, property::KValue ) ); + + if ( value ) + { + AiUtility::ParseInt( priority, *value ); + } + } + + return priority; + } + +// ---------------------------------------------------------------------------- +// RemoveNonPriorityElements +// Remove elements from array which do not contain priority or priority is +// not lower than the given value. +// ---------------------------------------------------------------------------- +// +static void RemoveNonPriorityElements( RPointerArray< CXnNodeAppIf>& aElements, + TInt aLastPriority ) + { + // Remove non priority elements and higher priority elements + TInt elementCount( aElements.Count() ); + + for ( TInt i = 0; i < elementCount; ) + { + CXnNodeAppIf* current( aElements[i] ); + + // Check name attribute + const TDesC8* name( PropertyValue( *current, property::KName ) ); + + if ( !name || *name != name::KPriority ) + { + // Remove current + aElements.Remove( i ); + --elementCount; + } + else + { + // Check current priority + const TDesC8* value( + PropertyValue( *current, property::KValue ) ); + + if ( !value ) // value not present + { + aElements.Remove( i ); + --elementCount; + continue; + } + + TInt32 currentPriority( KErrNotFound ); + + if ( AiUtility::ParseInt( currentPriority, *value ) != KErrNone ) + { + // value is not integer + aElements.Remove( i ); + --elementCount; + continue; + } + + if ( currentPriority < aLastPriority ) + { + // Keep element and iterate further + ++i; + } + else + { + // priority is too high + aElements.Remove( i ); + --elementCount; + } + } + } + } + +// ---------------------------------------------------------------------------- +// DescendingPriorityOrder +// Descending priority order for prioritized content selectors. +// ---------------------------------------------------------------------------- +// +static TInt DescendingPriorityOrder( const CXnNodeAppIf& aNode1, + const CXnNodeAppIf& aNode2 ) + { + /* + * @param aNode1 First node to compare + * @param aNode2 Second node to compare + * @return 0 nodes have equal priority + * @return >0 aNode1 has lower priority + * @return <0 aNode2 has lower priority + */ + // Array content has been validated, so no checks are needed + const TDesC8* value1( + PropertyValue( aNode1, property::KValue ) ); + + const TDesC8* value2( + PropertyValue( aNode2, property::KValue ) ); + + TInt32 priority1( KErrNotFound ); + AiUtility::ParseInt( priority1, *value1 ); + + TInt32 priority2( KErrNotFound ); + AiUtility::ParseInt( priority2, *value2 ); + + if ( priority1 == priority2 ) + { + return 0; + } + + return ( priority1 < priority2 ) ? 1 : -1; + } + +// ---------------------------------------------------------------------------- +// RemoveDuplicateContentChangesL +// Removes duplicate entries in content change array +// ---------------------------------------------------------------------------- +// +static void RemoveDuplicateContentChangesL( RAiPolicyElementArray& aArray ) + { + for ( TInt i = 0; i < aArray.Count(); ++i ) + { + HBufC* id( PropertyValueL( aArray[i].Target(), + AiUiDef::xml::property::KId ) ); + + if ( id ) + { + CleanupStack::PushL( id ); + + for ( TInt j = i; j < aArray.Count(); ++j ) + { + HBufC* id2( PropertyValueL( aArray[j].Target(), + AiUiDef::xml::property::KId ) ); + CleanupStack::PushL( id2 ); + + if ( id2 ) + { + // Same id and same policy + if ( i != j && id->Compare( *id2 ) == 0 && + ( aArray[i].Policy().Compare( aArray[j].Policy()) == 0 ) ) + + { + aArray.Remove( j ); + --j; + } + } + + CleanupStack::PopAndDestroy( id2 ); + } + + CleanupStack::PopAndDestroy( id ); + } + } + } + +// ---------------------------------------------------------------------------- +// CleanupReleaseMapItem +// Helper to handle cleanup of map iterator +// ---------------------------------------------------------------------------- +// +static void CleanupReleaseMapItem( TAny* aMapCleanupItem ) + { + if ( aMapCleanupItem ) + { + static_cast< TMapCleanupItem* >( aMapCleanupItem )->Release(); + } + } + +// ---------------------------------------------------------------------------- +// CleanupReleasePushL +// Helper to push map iterator into cleanup stack. +// ---------------------------------------------------------------------------- +// +static void CleanupReleasePushL( TMapCleanupItem& aCleanupItem ) + { + CleanupStack::PushL( TCleanupItem( CleanupReleaseMapItem, &aCleanupItem ) ); + } // ============================ MEMBER FUNCTIONS =============================== +// ---------------------------------------------------------------------------- +// CContentRenderer::CContentRenderer +// +// ---------------------------------------------------------------------------- +// CContentRenderer::CContentRenderer( CAppUi& aAppUi ) : iAppUi( aAppUi ) { } +// ---------------------------------------------------------------------------- +// CContentRenderer::ConstructL +// +// ---------------------------------------------------------------------------- +// void CContentRenderer::ConstructL() { iContentPriorityMap = AiUtility::CContentPriorityMap::NewL(); @@ -328,17 +342,27 @@ iPolicyEvaluator = CPolicyEvaluator::NewL(); } +// ---------------------------------------------------------------------------- +// CContentRenderer::NewL +// +// ---------------------------------------------------------------------------- +// CContentRenderer* CContentRenderer::NewL( CAppUi& aAppUi ) { CContentRenderer* self = new( ELeave ) CContentRenderer( aAppUi ); CleanupStack::PushL( self ); self->ConstructL(); - CleanupStack::Pop(); + CleanupStack::Pop( self ); return self; } +// ---------------------------------------------------------------------------- +// CContentRenderer::~CContentRenderer +// +// ---------------------------------------------------------------------------- +// CContentRenderer::~CContentRenderer() { delete iPolicyEvaluator; @@ -374,46 +398,27 @@ delete iCallbackHandler; } +// ---------------------------------------------------------------------------- +// CContentRenderer::SetEventHandler +// +// ---------------------------------------------------------------------------- +// void CContentRenderer::SetEventHandler( MAiFwEventHandler& aFwEventHandler ) { iFwEventHandler = &aFwEventHandler; } -void CContentRenderer::Reset() - { - iContentPriorityMap->Reset(); - iPropertyMap->Reset(); - } - -void CContentRenderer::CleanPluginFromUi( MAiPropertyExtension& aPlugin ) - { - // Create transaction to clean UI - TInt txId = reinterpret_cast< TInt >( &aPlugin ); - - TBool txCreated = ( StartTransaction( txId ) == KErrNone ); - - // Clean plugin - TRAPD( cleanError, CleanPluginFromUiL( aPlugin ) ); - - // Commit transaction - if ( txCreated ) - { - if (cleanError ) - { - CancelTransaction( txId ); - } - else - { - Commit( txId ); - } - } - } - +// ---------------------------------------------------------------------------- +// CContentRenderer::StartTransaction +// +// ---------------------------------------------------------------------------- +// TInt CContentRenderer::StartTransaction( TInt aTxId ) { __PRINT(__DBG_FORMAT("\t[I]\tXML UI: Start transaction id=%d"), aTxId); __HEAP("XML UI: Start transaction"); __TICK("XML UI: Start transaction"); + TRAPD( error, DoStartTransactionL( aTxId ) ); if ( error ) @@ -424,10 +429,15 @@ return error; } +// ---------------------------------------------------------------------------- +// CContentRenderer::Commit +// +// ---------------------------------------------------------------------------- +// TInt CContentRenderer::Commit( TInt aTxId ) { // Remove transaction with aTxId from stack - MTransaction* tr = iStack->Remove( aTxId ); + MTransaction* tr( iStack->Remove( aTxId ) ); if ( tr ) { @@ -437,10 +447,12 @@ TBool layoutChanged( EFalse ); TRAPD( error, tr->CommitL( layoutChanged, propertyHashMap ) ); + if( error == KErrNone ) { TRAP_IGNORE( SetPropertyArraysL( propertyHashMap ) ); } + propertyHashMap.Close(); __TICK("XML UI: Commit transaction"); @@ -464,9 +476,14 @@ return KErrNotSupported; } +// ---------------------------------------------------------------------------- +// CContentRenderer::ProcessContentChangesL +// +// ---------------------------------------------------------------------------- +// void CContentRenderer::ProcessContentChangesL( MTransaction& aTr ) { - TDblQueIter iter = aTr.ElementIter(); + TDblQueIter iter( aTr.ElementIter() ); RAiPolicyElementArray contentChangedArray; CleanupClosePushL( contentChangedArray ); @@ -479,7 +496,7 @@ iPolicyEvaluator->EvaluateContentChangedPolicyL( target, contentChangedArray); - iPolicyEvaluator->EvaluateContentChangedPolicyL( *(target.ParentL()), + iPolicyEvaluator->EvaluateContentChangedPolicyL( *(target.ParentL() ), contentChangedArray); } @@ -489,16 +506,25 @@ { ProcessContentChangeL( contentChangedArray[i] ); } + CleanupStack::PopAndDestroy(); } +// ---------------------------------------------------------------------------- +// CContentRenderer::ProcessContentChangeL +// +// ---------------------------------------------------------------------------- +// void CContentRenderer::ProcessContentChangeL( TAiPolicyElement& aElement ) { - const TDesC8* id = PropertyValue( aElement.Target(), - AiUiDef::xml::property::KId ); + const TDesC8* id( PropertyValue( + aElement.Target(), AiUiDef::xml::property::KId ) ); + if ( id ) { - CXnNodeAppIf* targetNode = FindNodeByIdL( *id, aElement.Target().Namespace() ); + CXnNodeAppIf* targetNode( + FindNodeByIdL( *id, aElement.Target().Namespace() ) ); + if ( targetNode ) { if ( aElement.Policy() == AiUiDef::xml::value::KShowTooltips ) @@ -509,10 +535,15 @@ } } +// ---------------------------------------------------------------------------- +// CContentRenderer::CancelTransaction +// +// ---------------------------------------------------------------------------- +// TInt CContentRenderer::CancelTransaction( TInt aTxId ) { // Remove transaction with aTxId from stack - MTransaction* tr = iStack->Remove( aTxId ); + MTransaction* tr( iStack->Remove( aTxId ) ); if ( tr ) { @@ -529,143 +560,209 @@ return KErrNotSupported; } -TBool CContentRenderer::CanPublish( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aIndex ) +// ---------------------------------------------------------------------------- +// CContentRenderer::CanPublish +// +// ---------------------------------------------------------------------------- +// +TBool CContentRenderer::CanPublish( CHsContentPublisher& aPlugin, + TInt aContent, TInt aIndex ) { TInt error( KErrNone ); TInt retval( KErrNone ); - __PRINTS("*** UC: Init - Content Validation ***"); + + __PRINTS("*** XML UI: CContentRenderer::CanPublish ***"); + + __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x" ), + &aPlugin.PublisherInfo().Name(), aPlugin.PublisherInfo().Uid().iUid ); + __TIME("UC: Content Validation", - TRAP( error, retval = CanPublishL( aPlugin, aContent, aIndex ) ); - ); - __HEAP("UC: Content Validation"); - __PRINTS("*** UC: Done - Content Validation ***"); - - return ( error == KErrNone && retval == KErrNone ); + TRAP( error, retval = CanPublishL( aPlugin, aContent, aIndex ) ) ); + + __HEAP("UC: Content Validation"); + + TBool ret( error == KErrNone && retval == KErrNone ); + + __PRINT( __DBG_FORMAT("*** XML UI: CContentRenderer::CanPublish - done, CanPublish: %d ***"), ret ); + + return ret; } -TInt CContentRenderer::Publish( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aResource, - TInt aIndex ) +// ---------------------------------------------------------------------------- +// CContentRenderer::Publish +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::Publish( CHsContentPublisher& aPlugin, TInt aContent, + TInt aResource, TInt aIndex ) { TInt error( KErrNone ); TInt retval( KErrNone ); - __PRINTS("*** UC: Init - Content Publishing (Resource) ***"); + + __PRINTS("*** XML UI: CContentRenderer::Publish (Resource) ***"); + + __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x" ), + &aPlugin.PublisherInfo().Name(), aPlugin.PublisherInfo().Uid().iUid ); + __TIME("UC: Content Publishing (Resource)", - TRAP( error, retval = DoPublishL( aPlugin, aContent, aResource, aIndex ) ); - ); + TRAP( error, retval = DoPublishL( aPlugin, aContent, aResource, aIndex ) ) ); + __HEAP("UC: Content Publishing (Resource)"); - __PRINTS("*** UC: Done - Content Publishing (Resource) ***"); - + if( !error && retval ) { error = retval; } + __PRINT( __DBG_FORMAT("*** XML UI: CContentRenderer::Publish (Resource) - done, error: %d ***"), error ); + return error; } -TInt CContentRenderer::Publish( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC16& aText, - TInt aIndex ) +// ---------------------------------------------------------------------------- +// CContentRenderer::Publish +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::Publish( CHsContentPublisher& aPlugin, TInt aContent, + const TDesC16& aText, TInt aIndex ) { TInt error( KErrNone ); TInt retval( KErrNone ); - __PRINTS("*** UC: Init - Content Publishing (Value-Text) ***"); + __PRINTS("*** XML UI: CContentRenderer::Publish (Value-Text) ***"); + + __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x" ), + &aPlugin.PublisherInfo().Name(), aPlugin.PublisherInfo().Uid().iUid ); + __TIME("UC: Content Publishing (Value-Text)", - TRAP( error, retval = DoPublishL( aPlugin, aContent, aText, aIndex ) ); - ); + TRAP( error, retval = DoPublishL( aPlugin, aContent, aText, aIndex ) ) ); + __HEAP("UC: Content Publishing (Value-Text)"); - __PRINTS("*** UC: Done - Content Publishing (Value-Text) ***"); - + if( !error && retval ) { error = retval; } + __PRINT( __DBG_FORMAT("*** XML UI: CContentRenderer::Publish (Value-Text) - done, error: %d ***"), error ); + return error; } -TInt CContentRenderer::Publish( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC8& aBuf, - TInt aIndex ) +// ---------------------------------------------------------------------------- +// CContentRenderer::Publish +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::Publish( CHsContentPublisher& aPlugin, TInt aContent, + const TDesC8& aBuf, TInt aIndex ) { TInt error( KErrNone ); TInt retval( KErrNone ); - __PRINTS("*** UC: Init - Content Publishing (Value-Buf) ***"); + __PRINTS("*** XML UI: CContentRenderer::Publish (Value-Buf) ***"); + + __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x" ), + &aPlugin.PublisherInfo().Name(), aPlugin.PublisherInfo().Uid().iUid ); + __TIME("UC: Content Publishing (Value-Buf)", - TRAP( error, retval = DoPublishL( aPlugin, aContent, aBuf, aIndex ) ); - ) + TRAP( error, retval = DoPublishL( aPlugin, aContent, aBuf, aIndex ) ) ); + __HEAP("UC: Content Publishing (Value-Buf)"); - __PRINTS("*** UC: Done - Content Publishing (Value-Buf) ***"); - + if( !error && retval ) { error = retval; } + __PRINT( __DBG_FORMAT("*** XML UI: CContentRenderer::Publish (Value-Buf) - done, error: %d ***"), error ); + return error; } -TInt CContentRenderer::Publish( MAiPropertyExtension& aPlugin, - TInt aContent, - RFile& aFile, - TInt aIndex ) +// ---------------------------------------------------------------------------- +// CContentRenderer::Publish +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::Publish( CHsContentPublisher& aPlugin, TInt aContent, + RFile& aFile, TInt aIndex ) { TInt error( KErrNone ); TInt retval( KErrNone ); - __PRINTS("*** UC: Init - Content Publishing (Value-RFile) ***"); + __PRINTS("*** XML UI: CContentRenderer::Publish (Value-RFile) ***"); + + __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x" ), + &aPlugin.PublisherInfo().Name(), aPlugin.PublisherInfo().Uid().iUid ); + __TIME("UC: Content Publishing (Value-RFile)", - TRAP( error, retval = DoPublishL( aPlugin, aContent, aFile, aIndex ) ); - ); + TRAP( error, retval = DoPublishL( aPlugin, aContent, aFile, aIndex ) ) ); + __HEAP("UC: Content Publishing (Value-RFile)"); - __PRINTS("*** UC: Done - Content Publishing (Value-RFile) ***"); - + if( !error && retval ) { error = retval; } + __PRINT( __DBG_FORMAT("*** XML UI: CContentRenderer::Publish (Value-RFile) - done, error: %d ***"), error ); + return error; } -TInt CContentRenderer::Clean( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ) +// ---------------------------------------------------------------------------- +// CContentRenderer::Clean +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::Clean( CHsContentPublisher& aPlugin, TInt aContent, + TInt aIndex ) { TInt error( KErrNone ); TInt retval( KErrNone ); - __PRINTS("*** UC: Init - Content Publishing (Clean) ***"); + __PRINTS("*** XML UI: CContentRenderer::Clean (Clean) ***"); + + __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x" ), + &aPlugin.PublisherInfo().Name(), aPlugin.PublisherInfo().Uid().iUid ); + __TIME("UC: Content Publishing (Clean)", - TRAP( error, retval = DoCleanL( aPlugin, aContent, aIndex ) ); - ); + TRAP( error, retval = DoCleanL( aPlugin, aContent, aIndex ) ) ); + __HEAP("UC: Content Publishing (Clean)"); - __PRINTS("*** UC: Done - Content Publishing (Clean) ***"); - + if( !error && retval ) { error = retval; } + __PRINT( __DBG_FORMAT("*** XML UI: CContentRenderer::Clean (Clean) - done, error: %d ***"), error ); + return error; } +// ---------------------------------------------------------------------------- +// CContentRenderer::CContentRenderer +// +// ---------------------------------------------------------------------------- +// TAny* CContentRenderer::Extension( TUid /*aUid*/ ) { // No extensions supported return NULL; } +// ---------------------------------------------------------------------------- +// CContentRenderer::RequiresSubscription +// +// ---------------------------------------------------------------------------- +// TBool CContentRenderer::RequiresSubscription( - const TAiPublisherInfo& aPublisherInfo ) const + const THsPublisherInfo& aPublisherInfo ) const { - if ( aPublisherInfo.iNamespace == KNativeUiNamespace ) + if ( aPublisherInfo.Namespace() == KNativeUiNamespace ) { // Not targeted to this content renderer return EFalse; @@ -674,21 +771,875 @@ return ETrue; } -TInt CContentRenderer::SetProperty( MAiPropertyExtension& aPlugin, - const TDesC8& aElementId, - const TDesC8& aPropertyName, - const TDesC8& aPropertyValue ) +// ---------------------------------------------------------------------------- +// CContentRenderer::DoStartTransactionL +// +// ---------------------------------------------------------------------------- +// +void CContentRenderer::DoStartTransactionL( TInt aTxId ) + { + MTransaction* tr( iFactory->CreateTransactionL( aTxId ) ); + iStack->Push( tr ); + + SetImmediateMode( EFalse ); + } + +// ---------------------------------------------------------------------------- +// CContentRenderer::CanPublishL +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::CanPublishL( CHsContentPublisher& aPlugin, + TInt aContent, TInt aIndex ) + { + // Get content item for aContent + MAiContentItemIterator* iter( ContentItemIterator( + aPlugin, CHsContentPublisher::EPublisherContent ) ); + + if ( !iter ) + { + return KErrNotSupported; + } + + const TAiContentItem& item( iter->ItemL( aContent ) ); + + // Lookup ui element + const TDesC& nodeId( iNodeIdGenerator->ContentNodeIdL( aPlugin, item ) ); + + CXnNodeAppIf* property( FindNodeByClassL( nodeId, aIndex, + aPlugin.PublisherInfo().Namespace() ) ); + + if( !property ) + { + return KErrNotFound; + } + + // Check content priority + TInt priority( ContentPriority( *property ) ); + + CXnNodeAppIf* target( property->ParentL() ); + + if( !target ) + { + return KErrNotSupported; + } + + if ( !AllowPublishByPriority( *target, priority ) ) + { + return KErrAccessDenied; + } + + // Check if content type is supported by target + const TDesC8& contentType( ContentType( item ) ); + + if ( !iFactory->IsSupported( *target, contentType ) && + target->Type()->Type() != XnPropertyNames::listquerydialog::KListQueryDialog ) + { + return KErrNotSupported; + } + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CContentRenderer::DoPublishL +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, + TInt aResource, TInt aIndex ) + { + TInt retval( KErrNotSupported ); + + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + // Read ref value. + MAiContentItemIterator* resIter( ContentItemIterator( + aPlugin, CHsContentPublisher::EPublisherResources ) ); + + if ( !resIter ) + { + return retval; + } + + const TAiContentItem& ref( resIter->ItemL( aResource ) ); + + const TDesC8& refType( ContentType( ref ) ); + + // Resolve source node + const TDesC& nodeId( iNodeIdGenerator->ResourceNodeIdL( aPlugin, ref ) ); + + HBufC8* nodeId8( CnvUtfConverter::ConvertFromUnicodeToUtf8L( nodeId ) ); + CleanupStack::PushL( nodeId8 ); + + CXnNodeAppIf* source( NULL ); + + __TIME_MARK( xmlOverhead ); + + source = FindNodeByIdL( *nodeId8, info.Namespace() ); + + __TIME_ENDMARK("XML UI: Lookup node by id", xmlOverhead); + __PRINT(__DBG_FORMAT("\t[I]\tXML UI: Lookup node by id=%S"), &nodeId); + + CleanupStack::PopAndDestroy( nodeId8 ); + + // Fetch content id + MAiContentItemIterator* iter( ContentItemIterator( + aPlugin, CHsContentPublisher::EPublisherContent ) ); + + if ( !iter ) + { + return retval; + } + + const TAiContentItem& item( iter->ItemL( aContent ) ); + + const TDesC& targetId( iNodeIdGenerator->ContentNodeIdL( aPlugin, item ) ); + + // Check types + if ( refType == KContentTypeText ) + { + // Fetch text + const TDesC8& text( source->GetPCData() ); + + // Delegate to data publishing function + retval = PublishDataL( aPlugin, + targetId, + text, + refType, + aIndex, + source ); + } + else if ( refType.Find( KContentTypeImage ) != KErrNotFound ) + { + // Fetch icon + CGulIcon* icon( LoadIconLC( *source ) ); + + // Delegate to icon publishing function + retval = PublishIconL( aPlugin, + targetId, + icon, + aIndex, + source ); + + CleanupStack::Pop( icon ); + } + + return retval; + } + +// ---------------------------------------------------------------------------- +// CContentRenderer::DoPublishL +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, + const TDesC16& aText, TInt aIndex ) + { + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + // Resolve content item + MAiContentItemIterator* iter( ContentItemIterator( + aPlugin, CHsContentPublisher::EPublisherContent ) ); + + if ( !iter ) + { + return KErrNotSupported; + } + + const TAiContentItem& item( iter->ItemL( aContent ) ); + + const TDesC8& type( ContentType( item ) ); + + if ( type == KContentTypeText ) + { + // Find ui element + const TDesC& nodeId( + iNodeIdGenerator->ContentNodeIdL( aPlugin, item ) ); + + __TIME_MARK( xmlOverhead ); + + CXnNodeAppIf* property( FindNodeByClassL( + nodeId, aIndex, info.Namespace() ) ); + + if( !property ) + { + return KErrNotFound; + } + + TInt priority( ContentPriority( *property ) ); + + __TIME_ENDMARK("XML UI: Lookup node by class", xmlOverhead); + __PRINT(__DBG_FORMAT("\t[I]\tXML UI: Lookup node by class=%S"), &nodeId); + + //Navigate to parent + CXnNodeAppIf* target( property->ParentL() ); + + if( !target ) + { + return KErrNotSupported; + } + + // Check priority + if ( AllowPublishByPriority( *target, priority ) ) + { + // Check if target is newsticker + MTransactionElement* element( NULL ); + + if ( IsParentNewsticker( *target ) ) + { + // Register callback interface for newsticker + CXnNodeAppIf *parent( target->ParentL() ); + + if( !parent ) + { + return KErrNotFound; + } + + RegisterNewstickerCallbackInterfaceL( *parent ); + + iNTPublisher.Set( info.Name() ); + iNTClass = AiUtility::CopyToBufferL( iNTClass, nodeId ); + + element = iFactory->CreateNewsTickerTransactionElementL( + *target, aText, priority, aIndex ); + } + else if( target->Type()->Type() == + XnListQueryDialogInterface::MXnListQueryDialogInterface::Type()) + { + // Get the data interface for dialog and publish data + XnListQueryDialogInterface::MXnListQueryDialogInterface* listQuery( NULL ); + XnComponentInterface::MakeInterfaceL( listQuery, *target ); + LeaveIfNull( listQuery, KErrNotSupported ); + listQuery->ReplaceItemL( aText, aIndex -1 );// plugins publish ordinals not indexes + return KErrNone; + } + else + { + // Create transaction element for text + // Not put to cleanupstack, because element is from our pool! + element = iFactory->CreateTextTransactionElementL( *target, + aText, + priority ); + } + + iPolicyEvaluator->EvaluateContentPolicyL( + *target, element->PolicyArray() ); + + iPolicyEvaluator->EvaluateVisibilityPolicyL( + *target, element->PolicyArray() ); + + ProcessTransactionElementL( element ); + } + else + { + return KErrAccessDenied; + } + } + else + { + return KErrNotSupported; + } + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CContentRenderer::DoPublishL +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, + const TDesC8& aBuf, TInt aIndex ) + { + TInt retval( KErrNotSupported ); + + // resolve content item + MAiContentItemIterator* iter( ContentItemIterator( + aPlugin, CHsContentPublisher::EPublisherContent ) ); + + if ( !iter ) + { + return retval; + } + + const TAiContentItem& item( iter->ItemL( aContent ) ); + + const TDesC8& type( ContentType( item ) ); + + const TDesC& nodeId( iNodeIdGenerator->ContentNodeIdL( aPlugin, item ) ); + + if( type == KContentTypeBitmap ) + { + // Unpack icon from pointer + CGulIcon* icon( LeaveIfNull( UnpackPtr( aBuf ), KErrArgument ) ); + + // Publish icon + retval = PublishIconL( aPlugin, nodeId, icon, aIndex ); + } + else if ( type == KContentTypeImageSvg || + type == KContentTypeData ) + { + // Publish data + retval = PublishDataL( aPlugin, nodeId, aBuf, type, aIndex ); + } + + return retval; + } + +// ---------------------------------------------------------------------------- +// CContentRenderer::DoPublishL +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::DoPublishL( CHsContentPublisher& aPlugin, TInt aContent, + RFile& aFile, TInt aIndex ) + { + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + //Resolve content item + MAiContentItemIterator* iter( ContentItemIterator( + aPlugin, CHsContentPublisher::EPublisherContent ) ); + + if ( !iter ) + { + return KErrNotSupported; + } + + const TAiContentItem& item( iter->ItemL( aContent ) ); + + const TDesC8& type( ContentType( item ) ); + + // Image support + if ( type.Find( KContentTypeImage ) != KErrNotFound ) + { + // Find ui element + const TDesC& nodeId( iNodeIdGenerator->ContentNodeIdL( aPlugin, item ) ); + + CXnNodeAppIf* property( FindNodeByClassL( + nodeId, aIndex, info.Namespace() ) ); + + if( !property ) + { + return KErrNotFound; + } + + // Check priority + TInt priority( ContentPriority( *property ) ); + + CXnNodeAppIf* target( property->ParentL() ); + + if( !target ) + { + return KErrNotSupported; + } + + if ( AllowPublishByPriority( *target, priority ) ) + { + // Check if target is newsticker + if ( IsParentNewsticker( *target ) ) + { + // Register callback interface + CXnNodeAppIf *parent( target->ParentL() ); + + if( !parent ) + { + return KErrNotFound; + } + + RegisterNewstickerCallbackInterfaceL( *parent ); + + iNTPublisher.Set( info.Name() ); + iNTClass = AiUtility::CopyToBufferL( iNTClass, nodeId ); + } + + // Create transaction element for file + MTransactionElement* element = + iFactory->CreateImageTransactionElementL( + *target, aFile, priority ); + + iPolicyEvaluator->EvaluateContentPolicyL( + *target, element->PolicyArray() ); + + iPolicyEvaluator->EvaluateVisibilityPolicyL( + *target, element->PolicyArray() ); + + ProcessTransactionElementL( element ); + } + else + { + return KErrAccessDenied; + } + } + else + { + return KErrNotSupported; + } + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CContentRenderer::DoCleanL +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::DoCleanL( CHsContentPublisher& aPlugin, TInt aContent, + TInt aIndex ) + { + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + // Resolve content item + MAiContentItemIterator* iter( ContentItemIterator( + aPlugin, CHsContentPublisher::EPublisherContent ) ); + + if ( !iter ) + { + return KErrNotSupported; + } + + const TAiContentItem& item( iter->ItemL( aContent ) ); + + const TDesC& nodeId( iNodeIdGenerator->ContentNodeIdL( aPlugin, item ) ); + + CXnNodeAppIf* property( FindNodeByClassL( + nodeId, aIndex, info.Namespace() ) ); + + if( !property ) + { + return KErrNotFound; + } + + TInt priority( ContentPriority( *property ) ); + + // Navigate to parent + CXnNodeAppIf* target( property->ParentL() ); + + if( !target ) + { + return KErrNotSupported; + } + + if ( !AllowPublishByPriority( *target, priority ) ) + { + return KErrAccessDenied; + } + + if ( IsParentNewsticker( *target ) ) + { + CXnNodeAppIf *parent( target->ParentL() ); + + if( !parent ) + { + return KErrNotFound; + } + + RegisterNewstickerCallbackInterfaceL( *parent ); + + iNTPublisher.Set( info.Name() ); + iNTClass = AiUtility::CopyToBufferL( iNTClass, nodeId ); + } + + if( target->Type()->Type() == + XnListQueryDialogInterface::MXnListQueryDialogInterface::Type()) + { + // Get the data interface for dialog and delete data + XnListQueryDialogInterface::MXnListQueryDialogInterface* listQuery( NULL ); + XnComponentInterface::MakeInterfaceL( listQuery, *target ); + LeaveIfNull( listQuery, KErrNotSupported ); + listQuery->DeleteItem( aIndex -1 );// plugins publish ordinals not indexes + return KErrNone; + } + + // Create transaction element for empty content + MTransactionElement* element = + iFactory->CreateEmptyContentTransactionElementL( + *target, aIndex ); + + iPolicyEvaluator->EvaluateEmptyContentPolicyL( + *target, element->PolicyArray() ); + + iPolicyEvaluator->EvaluateVisibilityPolicyL( + *target, element->PolicyArray() ); + + ProcessTransactionElementL( element ); + + if ( priority > KErrNotFound ) // Only for prioritized elements + { + // Add current ui element into content refresh map + HBufC* uiElementId( PropertyValueL( + *target, XnPropertyNames::common::KId ) ); + + return RefreshContentL( uiElementId, priority ); + } + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CContentRenderer::SetImmediateMode +// +// ---------------------------------------------------------------------------- +// +void CContentRenderer::SetImmediateMode( TBool aImmediateMode ) + { + iImmediateMode = aImmediateMode; + } + +// ---------------------------------------------------------------------------- +// CContentRenderer::IsImmediateMode +// +// ---------------------------------------------------------------------------- +// +TBool CContentRenderer::IsImmediateMode() const + { + return iImmediateMode; + } + +// ---------------------------------------------------------------------------- +// CContentRenderer::ProcessTransactionElementL +// +// ---------------------------------------------------------------------------- +// +void CContentRenderer::ProcessTransactionElementL( + MTransactionElement* aElement ) + { + LeaveIfNull( aElement, KErrArgument ); + + __PRINTS("*** XML UI: CContentRenderer::ProcessTransactionElementL ***"); + + if ( IsImmediateMode() || iStack->IsEmpty() ) + { + __PRINTS("* Immediate transaction mode, or transaction stack is empty" ); + + // No transaction. Commit element immediately + TBool layoutChanged( EFalse ); + + RPropertyHashMap propertyHashMap; + CleanupClosePushL( propertyHashMap ); + + aElement->CommitL( layoutChanged, propertyHashMap ); + SetPropertyArraysL( propertyHashMap ); + + CleanupStack::PopAndDestroy( &propertyHashMap ); + + iFactory->ReleaseTransactionElement( aElement ); + StartContentRefresh(); + + // Re-layout + iAppUi.UiEngineL()->RenderUIL(); + } + else + { + // Append transaction element to transaction + __PRINTS("* Adding transaction element to stack"); + + MTransaction* tr( iStack->Top() ); + tr->Append( *aElement ); + } + + __PRINTS("*** XML UI: CContentRenderer::ProcessTransactionElementL - done ***"); + } + +// ---------------------------------------------------------------------------- +// CContentRenderer::FindNodeByClassL +// +// ---------------------------------------------------------------------------- +// +CXnNodeAppIf* CContentRenderer::FindNodeByClassL( const TDesC& aCid, + TInt aIndex, const TDesC8& aNs ) + { + // Find node + HBufC8* classId( CnvUtfConverter::ConvertFromUnicodeToUtf8L( aCid ) ); + CleanupStack::PushL( classId ); + + RPointerArray nodes( + iAppUi.UiEngineL()->FindNodeByClassL( *classId, aNs ) ); + + CleanupStack::PopAndDestroy( classId ); + + CleanupClosePushL( nodes ); + + for ( TInt i = 0; i < nodes.Count(); ++i ) + { + CXnNodeAppIf* node = nodes[i]; + + const TDesC8* name( + PropertyValue( *node, AiUiDef::xml::property::KName ) ); + + if ( name && ( *name == AiUiDef::xml::name::KOrdinal ) ) + { + const TDesC8* value( + PropertyValue( *node, AiUiDef::xml::property::KValue ) ); + + if ( value ) + { + // Try to parse index from string either + TInt32 index( 0 ); + + User::LeaveIfError( AiUtility::ParseInt( index, *value ) ); + + if ( index == aIndex ) + { + CleanupStack::PopAndDestroy( &nodes ); + + return node; + } + } + } + else if ( name && ( *name == AiUiDef::xml::name::KTarget ) ) + { + const TDesC8* target( + PropertyValue( *node, AiUiDef::xml::property::KValue ) ); + + CXnNodeAppIf* targetNode( + FindNodeByIdL( *target, node->Namespace() ) ); + + if ( targetNode ) + { + CleanupStack::PopAndDestroy( &nodes ); + + return targetNode; + } + } + else if ( nodes.Count() == 1 ) // Only one node in class + { + node = nodes[ 0 ]; + + // No ordinal specified + CleanupStack::PopAndDestroy( &nodes ); + + return node; + } + } + + CleanupStack::PopAndDestroy( &nodes ); + + return NULL; // Never reached. Needed to omit compiler warning + } + +// ---------------------------------------------------------------------------- +// CContentRenderer::FindNodeByIdL +// +// ---------------------------------------------------------------------------- +// +CXnNodeAppIf* CContentRenderer::FindNodeByIdL( const TDesC& aCid, + const TDesC& aNs ) + { + // Find node + return LeaveIfNull( + iAppUi.UiEngineL()->FindNodeByIdL( aCid, aNs ), KErrNotFound ); + } + +// ---------------------------------------------------------------------------- +// CContentRenderer::FindNodeByIdL +// +// ---------------------------------------------------------------------------- +// +CXnNodeAppIf* CContentRenderer::FindNodeByIdL( const TDesC8& aCid, + const TDesC8& aNs ) + { + // Find node + return LeaveIfNull( + iAppUi.UiEngineL()->FindNodeByIdL( aCid, aNs ), KErrNotFound ); + } + +// ---------------------------------------------------------------------------- +// CContentRenderer::PublishIconL +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::PublishIconL( CHsContentPublisher& aPlugin, + const TDesC& aCid, CGulIcon* aIcon, TInt aIndex, CXnNodeAppIf* aResource ) + { + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + // Find proiperty element by class + CXnNodeAppIf* property( + FindNodeByClassL( aCid, aIndex, info.Namespace() ) ); + + if( !property ) + { + return KErrNotFound; + } + + // Get priority information + TInt priority( ContentPriority( *property ) ); + + // Navigate to parent + CXnNodeAppIf* target( property->ParentL() ); + + if( !target ) + { + return KErrNotFound; + } + + // Check priority + if ( !AllowPublishByPriority( *target, priority ) ) + { + return KErrAccessDenied; + } + + // Special handling of newsticker + if ( IsParentNewsticker( *target ) ) + { + // Register callback interface + CXnNodeAppIf *parent( target->ParentL() ); + + if( !parent ) + { + return KErrNotFound; + } + + RegisterNewstickerCallbackInterfaceL( *parent ); + + iNTPublisher.Set( info.Name() ); + iNTClass = AiUtility::CopyToBufferL( iNTClass, aCid ); + } + + MTransactionElement* element = + iFactory->CreateImageTransactionElementL( + *target, aIcon, priority ); + + if ( aResource ) + { + iPolicyEvaluator->EvaluateResourcePolicyL( + *target, *aResource, element->PolicyArray() ); + + iPolicyEvaluator->EvaluateContentPolicyL( + *target, element->PolicyArray() ); + + iPolicyEvaluator->EvaluateVisibilityPolicyL( + *target, element->PolicyArray() ); + } + + else + { + iPolicyEvaluator->EvaluateContentPolicyL( + *target, element->PolicyArray() ); + + iPolicyEvaluator->EvaluateVisibilityPolicyL( + *target, element->PolicyArray() ); + } + + ProcessTransactionElementL( element ); + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CContentRenderer::PublishDataL +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::PublishDataL( CHsContentPublisher& aPlugin, + const TDesC& aCid, const TDesC8& aData, const TDesC8& aContentType, + TInt aIndex, CXnNodeAppIf* aResource ) + { + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + CXnNodeAppIf* property( + FindNodeByClassL( aCid, aIndex, info.Namespace() ) ); + + if( !property ) + { + return KErrNotFound; + } + + TInt priority( ContentPriority( *property ) ); + + // Navigate to parent + CXnNodeAppIf* target( property->ParentL() ); + + if( !target ) + { + return KErrNotFound; + } + + if ( !AllowPublishByPriority( *target, priority ) ) + { + return KErrAccessDenied; + } + + if( aContentType == KContentTypeData ) + { + CXnComponent& component( target->ParentL()->Component() ); + component.SetDataL( aData, aCid, aIndex ); + return KErrNone; + } + + if ( !CDataBufferTransactionElement::IsSupported( *target, aContentType ) ) + { + return KErrNotSupported; + } + + // Handle newsticker + if ( IsParentNewsticker( *target ) ) + { + CXnNodeAppIf *parent( target->ParentL() ); + + if( !parent ) + { + return KErrNotFound; + } + + RegisterNewstickerCallbackInterfaceL( *parent ); + + iNTPublisher.Set( info.Name() ); + iNTClass = AiUtility::CopyToBufferL( iNTClass, aCid ); + } + + MTransactionElement* element = + iFactory->CreateDataBufferTransactionElementL( + *target, aData, priority ); + + if ( aResource ) + { + iPolicyEvaluator->EvaluateResourcePolicyL( + *target, *aResource, element->PolicyArray() ); + + iPolicyEvaluator->EvaluateContentPolicyL( + *target, element->PolicyArray() ); + + iPolicyEvaluator->EvaluateVisibilityPolicyL( + *target, element->PolicyArray() ); + } + else + { + iPolicyEvaluator->EvaluateContentPolicyL( + *target, element->PolicyArray() ); + + iPolicyEvaluator->EvaluateVisibilityPolicyL( + *target, element->PolicyArray() ); + } + + ProcessTransactionElementL( element ); + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CContentRenderer::SetProperty +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::SetProperty( CHsContentPublisher& 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) +// ---------------------------------------------------------------------------- +// CContentRenderer::SetProperty +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::SetProperty( CHsContentPublisher& aPlugin, + const TDesC8& aElementId, const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, MAiContentObserver::TValueType aValueType ) { TInt error( KErrNone ); TInt retval( KErrNone ); @@ -704,15 +1655,21 @@ return error; } -TInt CContentRenderer::SetPropertyL( MAiPropertyExtension& aPlugin, - const TDesC8& aElementId, - const TDesC8& aPropertyName, - const TDesC8& aPropertyValue, - MAiContentObserver::TValueType aValueType) +// ---------------------------------------------------------------------------- +// CContentRenderer::SetPropertyL +// +// ---------------------------------------------------------------------------- +// +TInt CContentRenderer::SetPropertyL( CHsContentPublisher& aPlugin, + const TDesC8& aElementId, const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, MAiContentObserver::TValueType aValueType ) { - TInt err = KErrNone; + TInt err( KErrNone ); // Find node - CXnNodeAppIf* targetNode = FindNodeByIdL( aElementId, aPlugin.PublisherInfoL()->iNamespace ); + + CXnNodeAppIf* targetNode( + FindNodeByIdL( aElementId, aPlugin.PublisherInfo().Namespace() ) ); + if ( targetNode ) { CXnDomStringPool& sp( targetNode->UiEngineL()->StringPool() ); @@ -732,16 +1689,21 @@ { err = KErrNotFound; } + return err; } - -CXnDomPropertyValue::TPrimitiveValueType - CContentRenderer::DomPropertyValueType( - MAiContentObserver::TValueType aValueType) +// ---------------------------------------------------------------------------- +// CContentRenderer::DomPropertyValueType +// +// ---------------------------------------------------------------------------- +// +CXnDomPropertyValue::TPrimitiveValueType CContentRenderer::DomPropertyValueType( + MAiContentObserver::TValueType aValueType ) { - CXnDomPropertyValue::TPrimitiveValueType type = - CXnDomPropertyValue::EUnknown; + CXnDomPropertyValue::TPrimitiveValueType type( + CXnDomPropertyValue::EUnknown ); + switch ( aValueType ) { case MAiContentObserver::EValueNumber : @@ -779,755 +1741,37 @@ type = CXnDomPropertyValue::EUnknown; } } + return type; } -void CContentRenderer::DoStartTransactionL( TInt aTxId ) - { - MTransaction* tr = iFactory->CreateTransactionL( aTxId ); - iStack->Push(tr); - SetImmediateMode(EFalse); - } - -TInt CContentRenderer::CanPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aIndex ) - { - // Get content item for aContent - MAiContentItemIterator& iter( - ContentItemIteratorL( aPlugin, EAiPublisherContent ) ); - - const TAiContentItem& item( iter.ItemL( aContent ) ); - - // Lookup ui element - const TDesC& nodeId( iNodeIdGenerator->ContentNodeIdL( aPlugin, item ) ); - - CXnNodeAppIf* property( FindNodeByClassL( nodeId, aIndex, - aPlugin.PublisherInfoL()->iNamespace ) ); - - if( !property ) - { - return KErrNotFound; - } - - // Check content priority - TInt priority( GetContentPriority( *property ) ); - - CXnNodeAppIf* target( property->ParentL() ); - - if( !target ) - { - return KErrNotSupported; - } - - if ( !AllowPublishByPriority( *target, priority ) ) - { - return KErrAccessDenied; - } - - // Check if content type is supported by target - const TDesC8& contentType( ContentType( item ) ); - - if ( !iFactory->IsSupported( *target, contentType ) && - target->Type()->Type() != XnPropertyNames::listquerydialog::KListQueryDialog ) - { - return KErrNotSupported; - } - - return KErrNone; - } - -TInt CContentRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aResource, - TInt aIndex ) - { - TAiPublisherInfo *info = static_cast(aPlugin.GetPropertyL( EAiPublisherInfo )); - if (!info) - { - return KErrNotFound; - } - // Read ref value. - MAiContentItemIterator& refIter( ContentItemIteratorL( aPlugin, EAiPublisherResources ) ); - const TAiContentItem& ref( refIter.ItemL( aResource ) ); - - const TDesC8& refType( ContentType( ref ) ); - - // Resolve source node - const TDesC& nodeId = iNodeIdGenerator->ResourceNodeIdL(aPlugin, ref); - HBufC8* nodeId8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L(nodeId); - CleanupStack::PushL(nodeId8); - CXnNodeAppIf* source = NULL; - __TIME_MARK(xmlOverhead); - source = FindNodeByIdL( *nodeId8, info->iNamespace ); - __TIME_ENDMARK("XML UI: Lookup node by id", xmlOverhead); - __PRINT(__DBG_FORMAT("\t[I]\tXML UI: Lookup node by id=%S"), &nodeId); - - CleanupStack::PopAndDestroy(nodeId8); - - // Fetch content id - MAiContentItemIterator& iter = ContentItemIteratorL( aPlugin, EAiPublisherContent ); - const TAiContentItem& item = iter.ItemL( aContent ); - - const TDesC& targetId = iNodeIdGenerator->ContentNodeIdL(aPlugin, item); - - TInt retval( KErrNotSupported ); - - // Check types - if ( refType == KContentTypeText ) - { - // Fetch text - const TDesC8& text = source->GetPCData(); - - // Delegate to data publishing function - retval = PublishDataL( aPlugin, - targetId, - text, - refType, - aIndex, - source ); - } - else if ( refType.Find( KContentTypeImage ) != KErrNotFound ) - { - // Fetch icon - CGulIcon* icon = LoadIconLC( *source ); - - // Delegate to icon publishing function - retval = PublishIconL( aPlugin, - targetId, - icon, - aIndex, - source ); - - CleanupStack::Pop( icon ); - } - - return retval; - } - -TInt CContentRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC16& aText, - TInt aIndex ) - { - // Resolve content item - MAiContentItemIterator& iter( - ContentItemIteratorL( aPlugin, EAiPublisherContent ) ); - - const TAiContentItem& item( iter.ItemL( aContent ) ); - - const TDesC8& type( ContentType( item ) ); - - if ( type == KContentTypeText ) - { - // Find ui element - const TDesC& nodeId = iNodeIdGenerator->ContentNodeIdL( aPlugin, item ); - - __TIME_MARK(xmlOverhead); - - CXnNodeAppIf* property( FindNodeByClassL( nodeId, aIndex, - aPlugin.PublisherInfoL()->iNamespace ) ); - - if( !property ) - { - return KErrNotFound; - } - - TInt priority( GetContentPriority( *property ) ); - - __TIME_ENDMARK("XML UI: Lookup node by class", xmlOverhead); - __PRINT(__DBG_FORMAT("\t[I]\tXML UI: Lookup node by class=%S"), &nodeId); - - //Navigate to parent - CXnNodeAppIf* target( property->ParentL() ); - - if( !target ) - { - return KErrNotSupported; - } - - // Check priority - if ( AllowPublishByPriority( *target, priority ) ) - { - // Check if target is newsticker - MTransactionElement* element( NULL ); - - if ( IsParentNewsticker( *target ) ) - { - // Register callback interface for newsticker - CXnNodeAppIf *parent( target->ParentL() ); - - if( !parent ) - { - return KErrNotFound; - } - - RegisterNewstickerCallbackInterfaceL( *parent ); - - const TAiPublisherInfo* info( aPlugin.PublisherInfoL() ); - - if ( info ) - { - iNTPublisher.Set( info->iName ); - iNTClass = AiUtility::CopyToBufferL( iNTClass, nodeId ); - } - - element = iFactory->CreateNewsTickerTransactionElementL( *target, - aText, - priority, - aIndex ); - } - else if( target->Type()->Type() == - XnListQueryDialogInterface::MXnListQueryDialogInterface::Type()) - { - // Get the data interface for dialog and publish data - XnListQueryDialogInterface::MXnListQueryDialogInterface* listQuery( NULL ); - XnComponentInterface::MakeInterfaceL( listQuery, *target ); - LeaveIfNull( listQuery, KErrNotSupported ); - listQuery->ReplaceItemL( aText, aIndex -1 );// plugins publish ordinals not indexes - return KErrNone; - } - else - { - // Create transaction element for text - // Not put to cleanupstack, because element is from our pool! - element = iFactory->CreateTextTransactionElementL( *target, - aText, - priority ); - } - - iPolicyEvaluator->EvaluateContentPolicyL( *target, - element->PolicyArray() ); - iPolicyEvaluator->EvaluateVisibilityPolicyL( *target, - element->PolicyArray() ); - - ProcessTransactionElementL( element ); - } - else - { - return KErrAccessDenied; - } - } - else - { - return KErrNotSupported; - } - - return KErrNone; - } - -TInt CContentRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC8& aBuf, - TInt aIndex ) - { - // resolve content item - MAiContentItemIterator& iter( - ContentItemIteratorL( aPlugin, EAiPublisherContent ) ); - - const TAiContentItem& item( iter.ItemL( aContent ) ); - - const TDesC8& type( ContentType( item ) ); - - TInt retval( KErrNotSupported ); - - if( type == KContentTypeBitmap ) - { - // Unpack icon from pointer - CGulIcon* icon( LeaveIfNull( UnpackPtr( aBuf ), KErrArgument ) ); - - const TDesC& nodeId( iNodeIdGenerator->ContentNodeIdL( aPlugin, item ) ); - - // Publish icon - retval = PublishIconL( aPlugin, nodeId, icon, aIndex ); - } - else if ( type == KContentTypeImageSvg ) - { - // Get node id - const TDesC& nodeId( iNodeIdGenerator->ContentNodeIdL( aPlugin, item ) ); - - // Publish SVG data - retval = PublishDataL( aPlugin, nodeId, aBuf, KContentTypeImageSvg, aIndex ); - } - - return retval; - } - -TInt CContentRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - RFile& aFile, - TInt aIndex) - { - //Resolve content item - MAiContentItemIterator& iter( - ContentItemIteratorL( aPlugin, EAiPublisherContent ) ); - - const TAiContentItem& item( iter.ItemL( aContent ) ); - - const TDesC8& type( ContentType( item ) ); - - // Image support - if ( type.Find( KContentTypeImage ) != KErrNotFound ) - { - // Find ui element - const TDesC& nodeId( iNodeIdGenerator->ContentNodeIdL( aPlugin, item ) ); - - CXnNodeAppIf* property( FindNodeByClassL( nodeId, aIndex, - aPlugin.PublisherInfoL()->iNamespace ) ); - - if( !property ) - { - return KErrNotFound; - } - - // Check priority - TInt priority( GetContentPriority( *property ) ); - - CXnNodeAppIf* target( property->ParentL() ); - - if( !target ) - { - return KErrNotSupported; - } - - if ( AllowPublishByPriority( *target, priority ) ) - { - // Check if target is newsticker - if ( IsParentNewsticker( *target ) ) - { - // Register callback interface - CXnNodeAppIf *parent( target->ParentL() ); - - if( !parent ) - { - return KErrNotFound; - } - - RegisterNewstickerCallbackInterfaceL( *parent ); - - const TAiPublisherInfo* info( aPlugin.PublisherInfoL() ); - - if( info ) - { - iNTPublisher.Set( info->iName ); - iNTClass = AiUtility::CopyToBufferL( iNTClass, nodeId ); - } - } - - // Create transaction element for file - MTransactionElement* element = - iFactory->CreateImageTransactionElementL( *target, - aFile, - priority ); - - iPolicyEvaluator->EvaluateContentPolicyL( *target, - element->PolicyArray() ); - iPolicyEvaluator->EvaluateVisibilityPolicyL( *target, - element->PolicyArray() ); - - ProcessTransactionElementL( element ); - } - else - { - return KErrAccessDenied; - } - } - else - { - return KErrNotSupported; - } - - return KErrNone; - } - -TInt CContentRenderer::DoCleanL( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aIndex ) - { - // Resolve content item - MAiContentItemIterator& iter( - ContentItemIteratorL( aPlugin, EAiPublisherContent ) ); - - const TAiContentItem& item( iter.ItemL( aContent ) ); - - const TDesC& nodeId( iNodeIdGenerator->ContentNodeIdL( aPlugin, item ) ); - - CXnNodeAppIf* property( FindNodeByClassL( nodeId, aIndex, - aPlugin.PublisherInfoL()->iNamespace ) ); - - if( !property ) - { - return KErrNotFound; - } - - TInt priority( GetContentPriority( *property ) ); - - // Navigate to parent - CXnNodeAppIf* target( property->ParentL() ); - - if( !target ) - { - return KErrNotSupported; - } - - if ( !AllowPublishByPriority( *target, priority ) ) - { - return KErrAccessDenied; - } - - if ( IsParentNewsticker( *target ) ) - { - CXnNodeAppIf *parent( target->ParentL() ); - - if( !parent ) - { - return KErrNotFound; - } - - RegisterNewstickerCallbackInterfaceL( *parent ); - - const TAiPublisherInfo* info( aPlugin.PublisherInfoL() ); - - if( info ) - { - iNTPublisher.Set( info->iName ); - iNTClass = AiUtility::CopyToBufferL( iNTClass, nodeId ); - } - } - if( target->Type()->Type() == - XnListQueryDialogInterface::MXnListQueryDialogInterface::Type()) - { - // Get the data interface for dialog and delete data - XnListQueryDialogInterface::MXnListQueryDialogInterface* listQuery( NULL ); - XnComponentInterface::MakeInterfaceL( listQuery, *target ); - LeaveIfNull( listQuery, KErrNotSupported ); - listQuery->DeleteItem( aIndex -1 );// plugins publish ordinals not indexes - return KErrNone; - } - - // Create transaction element for empty content - MTransactionElement* element = - iFactory->CreateEmptyContentTransactionElementL( *target, aIndex ); - - iPolicyEvaluator->EvaluateEmptyContentPolicyL( *target, - element->PolicyArray() ); - iPolicyEvaluator->EvaluateVisibilityPolicyL( *target, - element->PolicyArray() ); - - ProcessTransactionElementL( element ); - - if ( priority > KErrNotFound ) // Only for prioritized elements - { - // Add current ui element into content refresh map - HBufC* uiElementId = PropertyValueL( *target, - XnPropertyNames::common::KId ); - return RefreshContentL( uiElementId, priority ); - } - - return KErrNone; - } - -void CContentRenderer::SetImmediateMode( TBool aImmediateMode ) - { - iImmediateMode = aImmediateMode; - } - -TBool CContentRenderer::IsImmediateMode() const - { - return iImmediateMode; - } - -void CContentRenderer::ProcessTransactionElementL( MTransactionElement* aElement ) - { - LeaveIfNull( aElement, KErrArgument ); - - if ( IsImmediateMode() || iStack->IsEmpty() ) - { - // No transaction. Commit element immediately - TBool layoutChanged = EFalse; - - RPropertyHashMap propertyHashMap; - aElement->CommitL(layoutChanged, propertyHashMap); - SetPropertyArraysL( propertyHashMap ); - propertyHashMap.Close(); - - iFactory->ReleaseTransactionElement( aElement ); - StartContentRefresh(); - - // Re-layout - iAppUi.UiEngineL()->RenderUIL(); - } - else - { - // Append transaction element to transaction - MTransaction* tr = iStack->Top(); - tr->Append( *aElement ); - } - } - -CXnNodeAppIf* CContentRenderer::FindNodeByClassL( const TDesC& aCid, - TInt aIndex, - const TDesC8& aNs ) - { - // Find node - HBufC8* classId = CnvUtfConverter::ConvertFromUnicodeToUtf8L(aCid); - CleanupStack::PushL(classId); - - RPointerArray nodes = iAppUi.UiEngineL()->FindNodeByClassL( *classId, aNs ); - - CleanupStack::PopAndDestroy(classId); - - CleanupClosePushL( nodes ); - - for ( TInt i = 0; i < nodes.Count(); ++i ) - { - CXnNodeAppIf* node = nodes[i]; - - const TDesC8* name = - PropertyValue( *node, AiUiDef::xml::property::KName ); - - if ( name && ( *name == AiUiDef::xml::name::KOrdinal ) ) - { - const TDesC8* value = - PropertyValue( *node, AiUiDef::xml::property::KValue ); - - if ( value ) - { - // Try to parse index from string either - - TInt32 index( 0 ); - User::LeaveIfError( AiUtility::ParseInt( index, *value ) ); - - if ( index == aIndex ) - { - CleanupStack::PopAndDestroy(&nodes); - return node; - } - } - } - else if ( name && ( *name == AiUiDef::xml::name::KTarget ) ) - { - const TDesC8* target = - PropertyValue( *node, AiUiDef::xml::property::KValue ); - - CXnNodeAppIf* targetNode = FindNodeByIdL( *target, node->Namespace() ); - if ( targetNode ) - { - CleanupStack::PopAndDestroy( &nodes ); - return targetNode; - } - } - else if ( nodes.Count() == 1 ) // Only one node in class - { - // No ordinal specified - node = nodes[ 0 ]; - CleanupStack::PopAndDestroy(&nodes); - return node; - } - } - - CleanupStack::PopAndDestroy( &nodes ); - - return NULL; // Never reached. Needed to omit compiler warning - } - -CXnNodeAppIf* CContentRenderer::FindNodeByIdL( const TDesC& aCid, const TDesC& aNs ) - { - // Find node - return LeaveIfNull( iAppUi.UiEngineL()->FindNodeByIdL( aCid, aNs ), - KErrNotFound ); - } - -CXnNodeAppIf* CContentRenderer::FindNodeByIdL( const TDesC8& aCid, const TDesC8& aNs ) - { - // Find node - return LeaveIfNull( iAppUi.UiEngineL()->FindNodeByIdL( aCid, aNs ), - KErrNotFound ); - } - -TInt CContentRenderer::PublishIconL( MAiPropertyExtension& aPlugin, - const TDesC& aCid, - CGulIcon* aIcon, - TInt aIndex, - CXnNodeAppIf* aResource ) - { - // Find proiperty element by class - CXnNodeAppIf* property( FindNodeByClassL( aCid, aIndex, - aPlugin.PublisherInfoL()->iNamespace ) ); - - if( !property ) - { - return KErrNotFound; - } - - // Get priority information - TInt priority( GetContentPriority( *property ) ); - - // Navigate to parent - CXnNodeAppIf* target( property->ParentL() ); - - if( !target ) - { - return KErrNotFound; - } - - // Check priority - if ( !AllowPublishByPriority( *target, priority ) ) - { - return KErrAccessDenied; - } - - // Special handling of newsticker - if ( IsParentNewsticker( *target ) ) - { - // Register callback interface - CXnNodeAppIf *parent( target->ParentL() ); - - if( !parent ) - { - return KErrNotFound; - } - - RegisterNewstickerCallbackInterfaceL( *parent ); - - const TAiPublisherInfo* info( aPlugin.PublisherInfoL() ); - - if( info ) - { - iNTPublisher.Set( info->iName ); - iNTClass = AiUtility::CopyToBufferL( iNTClass, aCid ); - } - } - - MTransactionElement* element = - iFactory->CreateImageTransactionElementL( *target, - aIcon, - priority ); - - if ( aResource ) - { - iPolicyEvaluator->EvaluateResourcePolicyL( *target, - *aResource, - element->PolicyArray() ); - iPolicyEvaluator->EvaluateContentPolicyL( *target, - element->PolicyArray() ); - iPolicyEvaluator->EvaluateVisibilityPolicyL( *target, - element->PolicyArray() ); - } - - else - { - iPolicyEvaluator->EvaluateContentPolicyL( *target, - element->PolicyArray() ); - iPolicyEvaluator->EvaluateVisibilityPolicyL( *target, - element->PolicyArray() ); - } - - ProcessTransactionElementL( element ); - - return KErrNone; - } - -TInt CContentRenderer::PublishDataL( MAiPropertyExtension& aPlugin, - const TDesC& aCid, - const TDesC8& aData, - const TDesC8& aContentType, - TInt aIndex, - CXnNodeAppIf* aResource ) - { - CXnNodeAppIf* property( FindNodeByClassL( aCid, aIndex, - aPlugin.PublisherInfoL()->iNamespace ) ); - - if( !property ) - { - return KErrNotFound; - } - - TInt priority( GetContentPriority( *property ) ); - - // Navigate to parent - CXnNodeAppIf* target( property->ParentL() ); - - if( !target ) - { - return KErrNotFound; - } - - if ( !AllowPublishByPriority( *target, priority ) ) - { - return KErrAccessDenied; - } - - if ( !CDataBufferTransactionElement::IsSupported( *target, aContentType ) ) - { - return KErrNotSupported; - } - - // Handle newsticker - if ( IsParentNewsticker( *target ) ) - { - CXnNodeAppIf *parent( target->ParentL() ); - - if( !parent ) - { - return KErrNotFound; - } - - RegisterNewstickerCallbackInterfaceL( *parent ); - - const TAiPublisherInfo* info( aPlugin.PublisherInfoL() ); - - if( info ) - { - iNTPublisher.Set( info->iName ); - iNTClass = AiUtility::CopyToBufferL( iNTClass, aCid ); - } - } - - MTransactionElement* element = - iFactory->CreateDataBufferTransactionElementL( *target, - aData, - priority ); - - if ( aResource ) - { - iPolicyEvaluator->EvaluateResourcePolicyL( *target, - *aResource, - element->PolicyArray() ); - iPolicyEvaluator->EvaluateContentPolicyL( *target, - element->PolicyArray() ); - iPolicyEvaluator->EvaluateVisibilityPolicyL( *target, - element->PolicyArray() ); - } - else - { - iPolicyEvaluator->EvaluateContentPolicyL( *target, - element->PolicyArray() ); - iPolicyEvaluator->EvaluateVisibilityPolicyL( *target, - element->PolicyArray() ); - } - - ProcessTransactionElementL( element ); - - return KErrNone; - } - +// ---------------------------------------------------------------------------- +// CContentRenderer::AllowPublishByPriority +// +// ---------------------------------------------------------------------------- +// TBool CContentRenderer::AllowPublishByPriority( CXnNodeAppIf& aUiElement, - TInt aPriority ) const + TInt aPriority ) const { // Get ui element id - const TDesC8* uiElementId = PropertyValue( aUiElement, - XnPropertyNames::common::KId ); - + const TDesC8* uiElementId( + PropertyValue( aUiElement, XnPropertyNames::common::KId ) ); + if ( uiElementId ) { // compare given priority with the current value of ui element return iContentPriorityMap->OverrideContent( *uiElementId, aPriority ); } - return EFalse; // priority cannot be used, because ui element does not have id + // priority cannot be used, because ui element does not have id + return EFalse; } +// ---------------------------------------------------------------------------- +// CContentRenderer::StartContentRefresh +// +// ---------------------------------------------------------------------------- +// void CContentRenderer::StartContentRefresh() { // Cancel ongoing refresh @@ -1542,14 +1786,13 @@ } } -/** - * Adds ui element to list of refreshable elements - * - * @param aUiElementId ui element id - * @param aOldPriority old priority value - */ +// ---------------------------------------------------------------------------- +// CContentRenderer::RefreshContentL +// +// ---------------------------------------------------------------------------- +// TInt CContentRenderer::RefreshContentL( HBufC* aUiElementId, - TInt aOldPriority ) + TInt aOldPriority ) { if( !aUiElementId ) { @@ -1563,11 +1806,12 @@ { // Content refresh event cannot be sent CleanupStack::PopAndDestroy( aUiElementId ); + return KErrNotReady; } // Find current mapping - TInt* oldPriority = iRefreshableUiElements.Find( *aUiElementId ); + TInt* oldPriority( iRefreshableUiElements.Find( *aUiElementId ) ); if ( oldPriority ) { @@ -1590,9 +1834,11 @@ return KErrNone; } -/** - * Callback function to make content refreshing asynchronous - */ +// ---------------------------------------------------------------------------- +// CContentRenderer::RefreshContentCallback +// +// ---------------------------------------------------------------------------- +// TInt CContentRenderer::RefreshContentCallback( TAny* aContentRenderer ) { if ( !aContentRenderer ) @@ -1600,18 +1846,27 @@ return KErrArgument; } - CContentRenderer* renderer = static_cast< CContentRenderer* >( aContentRenderer ); - TRAP_IGNORE( renderer->SendRefreshContentEventL() ); + CContentRenderer* self = + static_cast< CContentRenderer* >( aContentRenderer ); + + TRAP_IGNORE( self->SendRefreshContentEventL() ); + return KErrNone; } -/** - * Sends Refresh content event to framework. - * Event is sent for content selectors with lower priority than the - * last content which has been cleaned from ui element. - */ +// ---------------------------------------------------------------------------- +// CContentRenderer::SendRefreshContentEventL +// +// ---------------------------------------------------------------------------- +// void CContentRenderer::SendRefreshContentEventL() { + /** + * Sends Refresh content event to framework. + * Event is sent for content selectors with lower priority than the + * last content which has been cleaned from ui element. + */ + // Cancel periodic timer. iTimer->Cancel(); @@ -1619,21 +1874,21 @@ TPtrHashMapIter< TDesC, TInt> iter( iRefreshableUiElements ); iter.Reset(); - const TDesC* uiElementId = iter.NextKey(); // Never NULL - TInt priority = *( iter.CurrentValue() ); + const TDesC* uiElementId( iter.NextKey() ); // Never NULL + TInt priority( *( iter.CurrentValue() ) ); // Cleanup item for iterator TMapCleanupItem cleanup( iter ); CleanupReleasePushL( cleanup ); // Lookup ui element - CXnNodeAppIf* uiElement = FindNodeByIdL( *uiElementId ); + CXnNodeAppIf* uiElement( FindNodeByIdL( *uiElementId ) ); // Remove current ui element from the map CleanupStack::PopAndDestroy( &cleanup ); // Find lower priority content elements associated to this ui element - RPointerArray< CXnNodeAppIf > children = uiElement->ChildrenL(); + RPointerArray< CXnNodeAppIf > children( uiElement->ChildrenL() ); // Remove higher priority content elements RemoveNonPriorityElements( children, priority ); @@ -1645,13 +1900,14 @@ // Continue until first content gets published or array exhausts. for ( TInt i = 0; i < children.Count(); ++i ) { - CXnNodeAppIf* current = children[ i ]; + CXnNodeAppIf* current( children[ i ] ); // Get content selector - const HBufC* contentSelector = PropertyValueL( *current, - XnPropertyNames::common::KClass ); - - if ( contentSelector && iFwEventHandler->RefreshContent( *contentSelector )) + const HBufC* contentSelector( + PropertyValueL( *current, XnPropertyNames::common::KClass ) ); + + if ( contentSelector && + iFwEventHandler->RefreshContent( *contentSelector ) ) { break; } @@ -1664,133 +1920,82 @@ StartContentRefresh(); } +// ---------------------------------------------------------------------------- +// CContentRenderer::TitleScrolled +// +// ---------------------------------------------------------------------------- +// void CContentRenderer::TitleScrolled( TInt aTitleIndex ) { if ( iCallbackHandler ) { - TRAP_IGNORE( iCallbackHandler->TitleScrolledL( iNTPublisher, - *iNTClass, - aTitleIndex ) ); + TRAP_IGNORE( iCallbackHandler->TitleScrolledL( + iNTPublisher, *iNTClass, aTitleIndex ) ); } } - + +// ---------------------------------------------------------------------------- +// CContentRenderer::TitleToScroll +// +// ---------------------------------------------------------------------------- +// void CContentRenderer::TitleToScroll( TInt aTitleIndex ) { if ( iCallbackHandler ) { - TRAP_IGNORE( iCallbackHandler->TitleToScrollL( iNTPublisher, - *iNTClass, - aTitleIndex ) ); + TRAP_IGNORE( iCallbackHandler->TitleToScrollL( + iNTPublisher, *iNTClass, aTitleIndex ) ); } } +// ---------------------------------------------------------------------------- +// CContentRenderer::IsParentNewsticker +// +// ---------------------------------------------------------------------------- +// TBool CContentRenderer::IsParentNewsticker( CXnNodeAppIf& aTarget ) { - CXnNodeAppIf* parent = NULL; + CXnNodeAppIf* parent( NULL ); + TRAP_IGNORE( parent = aTarget.ParentL() ); + if ( !parent ) { return EFalse; } - CXnType* typeInfo = parent->Type(); - if ( !typeInfo ) - { - return EFalse; - } - - return ( typeInfo->Type() == XnNewstickerInterface::MXnNewstickerInterface::Type()); + const TDesC8& type( parent->Type()->Type() ) ; + + return ( type == XnNewstickerInterface::MXnNewstickerInterface::Type() ); } -void CContentRenderer::RegisterNewstickerCallbackInterfaceL( CXnNodeAppIf& aTarget ) +// ---------------------------------------------------------------------------- +// CContentRenderer::RegisterNewstickerCallbackInterfaceL +// +// ---------------------------------------------------------------------------- +// +void CContentRenderer::RegisterNewstickerCallbackInterfaceL( + CXnNodeAppIf& aTarget ) { if ( !iCallbackHandler ) { // Instantiate callback handler - CNewstickerCallbackHandler* handler = CNewstickerCallbackHandler::NewLC( *iFwEventHandler ); + CNewstickerCallbackHandler* handler = + CNewstickerCallbackHandler::NewLC( *iFwEventHandler ); // Set callback handler iCallbackHandler = handler; CleanupStack::Pop( handler ); } - // Obtain newsticker component interface - XnNewstickerInterface::MXnNewstickerInterface* newsticker = NULL; - XnComponentInterface::MakeInterfaceL( newsticker, aTarget ); - - LeaveIfNull( newsticker, KErrGeneral ); - - // Set callback interface - newsticker->SetCallbackInterfaceL( this ); - } -void CContentRenderer::CleanPluginFromUiL( MAiPropertyExtension& aPlugin ) - { - TInt itemCount = 0; - - // Resolve content items - MAiContentItemIterator& iter = ContentItemIteratorL( aPlugin, EAiPublisherContent ); - iter.Reset(); + // Obtain newsticker component interface + XnNewstickerInterface::MXnNewstickerInterface* newsticker( NULL ); + XnComponentInterface::MakeInterfaceL( newsticker, aTarget ); - // Clean all content items - while ( iter.HasNext() ) - { - const TAiContentItem& item = iter.NextL(); - - const TDesC& nodeId = iNodeIdGenerator->ContentNodeIdL( aPlugin, item ); - - // Find nodes - HBufC8* nodeId8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L(nodeId); - CleanupStack::PushL(nodeId8); - - RPointerArray nodes = iAppUi.UiEngineL()->FindNodeByClassL( - *nodeId8, aPlugin.PublisherInfoL()->iNamespace ); - - CleanupStack::PopAndDestroy(nodeId8); - - itemCount += nodes.Count(); - - CleanupClosePushL( nodes ); - - for ( TInt i = 0; i < nodes.Count(); ++i ) - { - CXnNodeAppIf* property = nodes[i]; - - TInt priority = GetContentPriority( *property ); - - // Navigate to parent - CXnNodeAppIf* target = LeaveIfNull( property->ParentL(), KErrNotFound ); - - if ( AllowPublishByPriority( *target, priority ) ) - { - // Create transaction element for empty content - MTransactionElement* element = - iFactory->CreateEmptyContentTransactionElementL( *target, 0 ); - - iPolicyEvaluator->EvaluateEmptyContentPolicyL( *target, - element->PolicyArray() ); - iPolicyEvaluator->EvaluateVisibilityPolicyL( *target, - element->PolicyArray() ); - - ProcessTransactionElementL( element ); - - if ( priority > KErrNotFound ) // Only for prioritized elements - { - // Add current ui element into content refresh map - HBufC* uiElementId = PropertyValueL( *target, - XnPropertyNames::common::KId ); - RefreshContentL( uiElementId, priority ); - } - } - } - - CleanupStack::PopAndDestroy(&nodes); - } - - if ( itemCount == 0 ) - { - //Nothing to clean from UI. Cancel transaction outside current trap harness - User::Leave( KErrNotFound ); - } + LeaveIfNull( newsticker, KErrGeneral ); + + // Set callback interface + newsticker->SetCallbackInterfaceL( this ); } // End of File diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/src/emptycontenttransactionelement.cpp --- a/idlehomescreen/xmluicontroller/src/emptycontenttransactionelement.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/emptycontenttransactionelement.cpp Wed May 12 13:22:51 2010 +0300 @@ -20,6 +20,7 @@ #include "xnnewsticker.h" #include "xnbitmap.h" #include "xntext.h" +#include "xntexteditor.h" #include "emptycontenttransactionelement.h" #include "aixmluiconstants.h" #include "aixmluiutils.h" @@ -81,15 +82,25 @@ imageIntr->SetContentBitmaps( NULL, NULL ); } else if ( type->Type() == XnTextInterface::MXnTextInterface::Type() ) // text element - { - // Get control interface - XnTextInterface::MXnTextInterface* textControl = NULL; - XnComponentInterface::MakeInterfaceL( textControl, Target() ); - LeaveIfNull( textControl, KErrNotSupported ); - - // Clears the text from component - textControl->SetTextL( KNullDesC ); - } + { + // Get control interface + XnTextInterface::MXnTextInterface* textControl = NULL; + XnComponentInterface::MakeInterfaceL( textControl, Target() ); + LeaveIfNull( textControl, KErrNotSupported ); + + // Clears the text from component + textControl->SetTextL( KNullDesC ); + } + else if ( type->Type() == XnTextEditorInterface::MXnTextEditorInterface::Type() ) // texteditor element + { + // Get control interface + XnTextEditorInterface::MXnTextEditorInterface* editorControl = NULL; + XnComponentInterface::MakeInterfaceL( editorControl, Target() ); + LeaveIfNull( editorControl, KErrNotSupported ); + + // Clears the text from component + editorControl->SetTextL( KNullDesC ); + } else { CXnNodeAppIf* parent = Target().ParentL(); diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/src/globalqueryhandler.cpp --- a/idlehomescreen/xmluicontroller/src/globalqueryhandler.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/globalqueryhandler.cpp Wed May 12 13:22:51 2010 +0300 @@ -81,6 +81,11 @@ { iUiController.AppUi()->SetOnlineStateL( iSetOnline ); } + else + { + iUiController.AppUi()->SetOnlineStateL(!iSetOnline ); + } + } // ----------------------------------------------------------------------------- diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/src/onlineofflinehelper.cpp --- a/idlehomescreen/xmluicontroller/src/onlineofflinehelper.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/onlineofflinehelper.cpp Wed May 12 13:22:51 2010 +0300 @@ -20,23 +20,48 @@ #include #include #include -#include #include #include #include #include - +#include +#include +#include // StringLoader +#include +#include // User includes +#include +#include #include +#include #include "onlineofflinehelper.h" #include "xmluicontroller.h" #include "appui.h" +#include "ai3.hrh" +#include "globalqueryhandler.h" // Constants const TInt KOfflineProfileId( 5 ); using namespace AiXmlUiController; +#ifdef HS_NETWORK_MONITOR +#include +_LIT( KLogFolder,"xnnetwork" ); +_LIT( KLogDom, "networksettings.log" ); + +#define _LOG1( a ) RFileLogger::Write( \ + KLogFolder, KLogDom, EFileLoggingModeAppend, ( a ) ); +#define _LOG2( a, b ) RFileLogger::WriteFormat( \ + KLogFolder, KLogDom, EFileLoggingModeAppend, ( a ), ( b ) ) +#else +#define _LOG1 +#define _LOG2 +#endif + +_LIT( KDisConnected, "disconnected"); +_LIT( KConnected, "connected"); + // ============================ LOCAL FUNCTIONS ============================== // ============================ MEMBER FUNCTIONS ============================= @@ -92,10 +117,18 @@ } } - // Update repository - iUiCtl.SettingsRepository().Set( KAIWebStatus, iFlags.IsSet( EOnline ) ); + // Update state manager + SetOnline( iFlags.IsSet( EOnline ) ); + + iCurrentNwStatus = ENWRegistrationUnknown; + iHomeNetwork = KErrNotFound; + iRoamingNetwork = KErrNotFound; - iCurrentNwStatus = ENWRegistrationUnknown; + iNwSettingObserver = CCenRepObserver::NewL( this ); + + iGlobalQueryHandler = CGlobalQueryHandler::NewL(iUiCtl); + iGlobalConfirmationQuery = CAknGlobalConfirmationQuery::NewL(); + } // ---------------------------------------------------------------------------- @@ -106,7 +139,25 @@ { delete iHandler; delete iSession; - // Whether the user choice EOnline should be stored in cenrep ? + delete iNwSettingObserver; + delete iGlobalQueryHandler; + delete iGlobalConfirmationQuery; + } + +// ---------------------------------------------------------------------------- +// COnlineOfflineHelper::CurrentCellularDataUsageChangedL +// ---------------------------------------------------------------------------- +// +void COnlineOfflineHelper::CurrentCellularDataUsageChangedL(const TInt aValue) + { + if ( iCurrentNwStatus == ENWRegisteredOnHomeNetwork ) + { + iHomeNetwork = aValue; + } + else if ( iCurrentNwStatus == ENWRegisteredRoaming ) + { + iRoamingNetwork = aValue; + } } // ---------------------------------------------------------------------------- @@ -114,15 +165,12 @@ // ---------------------------------------------------------------------------- // TBool COnlineOfflineHelper::ShowOnlineItem() const - { - if ( iFlags.IsSet( EUtilizeOnline ) ) - { - TInt value ( KErrNotFound ); - if ( iUiCtl.SettingsRepository().Get( KAIWebStatus, value ) == KErrNone ) - { - return ( !value ); - } - } + { + TInt value ( KErrNotFound ); + if ( iUiCtl.SettingsRepository().Get( KAIWebStatus, value ) == KErrNone ) + { + return ( !value ); + } return EFalse; } @@ -132,58 +180,12 @@ // TBool COnlineOfflineHelper::ShowOfflineItem() const { - if ( iFlags.IsSet( EUtilizeOnline ) ) - { - TInt value ( KErrNotFound ); - if ( iUiCtl.SettingsRepository().Get( KAIWebStatus, value ) == KErrNone ) - { - return ( value ); - } - } - return EFalse; - } - -// ---------------------------------------------------------------------------- -// COnlineOfflineHelper::ProcessOnlineStateL -// ---------------------------------------------------------------------------- -// -void COnlineOfflineHelper::ProcessOnlineStateL( - RPointerArray< CXnNodeAppIf >& aList ) - { - _LIT( KOnlineOffline, "online_offline" ); - - iFlags.Clear( EUtilizeOnline ); - - // Check if data plugins are using online_offline - for ( TInt i = 0; i < aList.Count(); i++ ) + TInt value ( KErrNotFound ); + if ( iUiCtl.SettingsRepository().Get( KAIWebStatus, value ) == KErrNone ) { - TAiPublisherInfo info; - - iUiCtl.PublisherInfoL( *aList[i], info ); - - if( iUiCtl.FwEventHandler()->HasMenuItemL( info, KOnlineOffline() ) ) - { - iFlags.Set( EUtilizeOnline ); - break; - } - } - - if( iFlags.IsSet( EUtilizeOnline ) ) - { - TInt value( 0 ); - iUiCtl.SettingsRepository().Get( KAIWebStatus, value ); - - if ( value ) - { - // Switch to online - SetOnlineL( ETrue ); - } - else - { - // Switch to offline - SetOnlineL( EFalse ); - } + return ( value ); } + return EFalse; } // ---------------------------------------------------------------------------- @@ -193,48 +195,38 @@ void COnlineOfflineHelper::ProcessOnlineStateL( TBool aOnline ) { // User has selected online/offline item from menu - if( iFlags.IsSet( EUtilizeOnline ) ) - { - // Don't show R_YES_NO_HS_ONLINE query as user selected online - if (aOnline ) - { - iFlags.Set( EOnline ); - // Save state - iUiCtl.SettingsRepository().Set( KAIWebStatus, ETrue ); - // Run state change. - iUiCtl.FwEventHandler()->ProcessStateChange( EAifwOnline ); - } - else - { - iFlags.Clear( EOnline ); - // Save state - iUiCtl.SettingsRepository().Set( KAIWebStatus, EFalse ); - // Run state change. - iUiCtl.FwEventHandler()->ProcessStateChange( EAifwOffline ); - } - } + // Don't show R_YES_NO_HS_ONLINE query as user selected online + if ( aOnline ) + { + iFlags.Set( EOnline ); + if ( iCurrentNwStatus == ENWRegisteredRoaming ) + { + // When user allready is in foreing network and sets + // HS online we want to disable automatic offline setting and not + // show note QTN_HS_AUTOMATIC_OFFLINE + iFlags.Set( ERoamingShown ); + } + } + else + { + iFlags.Clear( EOnline ); + } + + SetOnline( aOnline ); } // ---------------------------------------------------------------------------- // COnlineOfflineHelper::SetOnline // ---------------------------------------------------------------------------- // -void COnlineOfflineHelper::SetOnlineL( TBool aOnline ) - { - +void COnlineOfflineHelper::SetOnline( TBool aOnline ) + { // Save state iUiCtl.SettingsRepository().Set( KAIWebStatus, aOnline ); - if( aOnline ) - { - // Run state change. - iUiCtl.FwEventHandler()->ProcessStateChange( EAifwOnline ); - } - else - { - // Run state change. - iUiCtl.FwEventHandler()->ProcessStateChange( EAifwOffline ); - } + // Run state change. + iUiCtl.FwStateHandler()->ChangePluginState( + aOnline ? EAiFwOnline : EAiFwOffline ); } // ---------------------------------------------------------------------------- @@ -265,27 +257,52 @@ switch ( aNWInfo.iRegistrationStatus ) { case ENWRegisteredRoaming: - if( iFlags.IsSet( EOnline ) ) + _LOG1( _L(" Roaming Network Activated ")); + iCurrentNwStatus = aNWInfo.iRegistrationStatus; + CurrentNetworkSetting(); + if( ( iRoamingNetwork == ECmCellularDataUsageConfirm + || iRoamingNetwork == ECmCellularDataUsageDisabled ) + && iFlags.IsSet( EOnline ) + && iFlags.IsClear( ERoamingShown ) ) { // Process to offline state. // Don't change the user selection. - SetOnlineL ( EFalse ); + SetOnline( EFalse ); // Show roaming notification CAknGlobalNote* note = CAknGlobalNote::NewLC(); - HBufC* msg( StringLoader::LoadLC( R_QTN_HS_AUTOMATIC_OFFLINE ) ); + HBufC* msg( StringLoader::LoadLC( + R_QTN_HS_AUTOMATIC_OFFLINE ) ); note->SetSoftkeys(R_AVKON_SOFTKEYS_OK_EMPTY); note->ShowNoteL( EAknGlobalInformationNote, *msg ); - CleanupStack::PopAndDestroy( 2, note ); // msg + CleanupStack::PopAndDestroy( 2, note ); // msg + + // set roming shown flag. We want to show + // romign note only once while user stays in foreign + // network. If user sets the HS to online this note is + // not showed again and HS will stay online in foreign + // network. + iFlags.Set( ERoamingShown ); + } + break; + + case ENWRegisteredOnHomeNetwork: + _LOG1( _L(" Home Network Activated ")); + if ( iFlags.IsSet( ERoamingShown ) ) + { + // Clear ERoamingShown when user returns to home + // network. + iFlags.Clear( ERoamingShown ); } iCurrentNwStatus = aNWInfo.iRegistrationStatus; - break; - case ENWRegisteredOnHomeNetwork: - // Reset to user selection - SetOnlineL(iFlags.IsSet( EOnline ) ); - - iCurrentNwStatus = aNWInfo.iRegistrationStatus; + CurrentNetworkSetting(); + if( iHomeNetwork == ECmCellularDataUsageAutomatic ) + { + // Reset to user selection + SetOnline( iFlags.IsSet( EOnline ) ); + } break; + default: // unknown state iCurrentNwStatus = ENWRegistrationUnknown; @@ -372,13 +389,13 @@ { iFlags.Set( EOfflineProfile ); // Don't change the user selection. - SetOnlineL( EFalse ); + SetOnline( EFalse ); } else { iFlags.Clear( EOfflineProfile ); // Reset to user selection - SetOnlineL(iFlags.IsSet( EOnline ) ); + SetOnline( iFlags.IsSet( EOnline ) ); } } @@ -388,5 +405,70 @@ iHandler = CProfileChangeNotifyHandler::NewL( this ); } +// --------------------------------------------------------------------------- +// COnlineOfflineHelper::CurrentNetworkSetting +// --------------------------------------------------------------------------- +// +void COnlineOfflineHelper::CurrentNetworkSetting() + { + CRepository* repository( NULL ); + + TRAP_IGNORE( repository = CRepository::NewL( KCRUidCmManager ) ) + + if ( repository ) + { + TInt value( 0 ); + TInt err( repository->Get( KCurrentCellularDataUsage, value ) ); + + if ( err == KErrNone ) + { + if ( iCurrentNwStatus == ENWRegisteredRoaming ) + { + iRoamingNetwork = value; + _LOG2( _L("Roaming Network Setting <%d>"), value ); + } + else if ( iCurrentNwStatus == ENWRegisteredOnHomeNetwork ) + { + iHomeNetwork = value; + _LOG2( _L("Home Network Setting <%d>"), value ); + } + } + } + delete repository; + } + +// --------------------------------------------------------------------------- +// COnlineOfflineHelper::HandleConnectionQueryL +// --------------------------------------------------------------------------- +// +void COnlineOfflineHelper::HandleConnectionQueryL( const TDesC& aConnection) + { + if ( aConnection == KDisConnected() ) + { + ShowGlobalQueryL(R_QTN_HS_DISABLE_NETWORK, EFalse ); + } + else if ( aConnection == KConnected() ) + { + ShowGlobalQueryL(R_QTN_HS_SWITCH_ONLINE, ETrue ); + } + } + +// --------------------------------------------------------------------------- +// COnlineOfflineHelper::ShowGlobalQueryL +// --------------------------------------------------------------------------- +// +void COnlineOfflineHelper::ShowGlobalQueryL( TInt aResourceId, TBool aSetOnline ) + { + if ( !iGlobalQueryHandler->IsActive() ) + { + HBufC* confirmationText = StringLoader::LoadLC(aResourceId); + iGlobalConfirmationQuery->ShowConfirmationQueryL( + iGlobalQueryHandler->iStatus, + *confirmationText, + R_AVKON_SOFTKEYS_YES_NO); + iGlobalQueryHandler->SetOnlineParamAndActivate(aSetOnline); + CleanupStack::PopAndDestroy(); //confirmationText + } + } + // End of file - diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/src/texttransactionelement.cpp --- a/idlehomescreen/xmluicontroller/src/texttransactionelement.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/texttransactionelement.cpp Wed May 12 13:22:51 2010 +0300 @@ -22,6 +22,7 @@ #include "xntype.h" #include "xnproperty.h" #include "xntext.h" +#include "xntexteditor.h" #include "xnmenuadapter.h" #include "xnnewsticker.h" //#include @@ -33,6 +34,8 @@ #include "xnvolumecontrol.h" #include "aistrcnv.h" +_LIT8( KTextEditor, "texteditor" ); + // ============================ MEMBER FUNCTIONS =============================== using namespace AiXmlUiController; @@ -109,9 +112,8 @@ type == KXnMenuItem || type == KXnMenu || type == XnPropertyNames::softkey::KNodeName || - type == XnPropertyNames::volumecontrol::KSlider /*|| - type == XnNewstickerInterface::MXnNewstickerInterface::Type() || - type == XnMarqueeInterface::MXnMarqueeInterface::Type() */); + type == XnPropertyNames::volumecontrol::KSlider || + type == KTextEditor ); } void CTextTransactionElement::CheckTypeL( CXnNodeAppIf& aTarget ) @@ -134,9 +136,17 @@ XnComponentInterface::MakeInterfaceL( textControl, Target() ); LeaveIfNull( textControl, KErrNotSupported ); - // Set text + // set text + textControl->SetTextL( *iNewText ); + } + else if( type == XnTextEditorInterface::MXnTextEditorInterface::Type() ) + { + XnTextEditorInterface::MXnTextEditorInterface* editorControl = NULL; + XnComponentInterface::MakeInterfaceL( editorControl, Target() ); + LeaveIfNull( editorControl, KErrNotSupported ); - textControl->SetTextL( *iNewText ); + // set text + editorControl->SetTextL( *iNewText ); } // Menu softkey texts diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/src/xmlnodeidgenerator.cpp --- a/idlehomescreen/xmluicontroller/src/xmlnodeidgenerator.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/xmlnodeidgenerator.cpp Wed May 12 13:22:51 2010 +0300 @@ -15,66 +15,104 @@ * */ +// System includes -#include "xmlnodeidgenerator.h" -#include "aipropertyextension.h" +// User includes +#include +#include #include "aicontentmodel.h" #include "aixmluiutils.h" #include "aixmluiconstants.h" #include "aistrcnv.h" +#include "xmlnodeidgenerator.h" + using namespace AiXmlUiController; +// ---------------------------------------------------------------------------- +// CXmlNodeIdGenerator::CXmlNodeIdGenerator +// +// ---------------------------------------------------------------------------- +// CXmlNodeIdGenerator::CXmlNodeIdGenerator() { } - + +// ---------------------------------------------------------------------------- +// CXmlNodeIdGenerator::NewL +// +// ---------------------------------------------------------------------------- +// CXmlNodeIdGenerator* CXmlNodeIdGenerator::NewL() { - return new(ELeave) CXmlNodeIdGenerator; + return new ( ELeave ) CXmlNodeIdGenerator; } - + +// ---------------------------------------------------------------------------- +// CXmlNodeIdGenerator::CXmlNodeIdGenerator +// +// ---------------------------------------------------------------------------- +// CXmlNodeIdGenerator::~CXmlNodeIdGenerator() { delete iContentNodeIdBuf; } -TPtrC CXmlNodeIdGenerator::SettingsNodeIdL( const TAiPublisherInfo& aPubInfo ) +// ---------------------------------------------------------------------------- +// CXmlNodeIdGenerator::SettingsNodeIdL +// +// ---------------------------------------------------------------------------- +// +TPtrC CXmlNodeIdGenerator::SettingsNodeIdL( + const THsPublisherInfo& aPublisherInfo ) { - const TInt idLength = aPubInfo.iName.Length() - + AiUiDef::xml::id::KSettingsIdSeparator().Length() - + AiUiDef::xml::propertyClass::KSettings().Length(); - TPtr bufPtr( AiUtility::EnsureBufMaxLengthL( iContentNodeIdBuf, idLength ) ); + const TInt idLength( aPublisherInfo.Name().Length() + + AiUiDef::xml::id::KSettingsIdSeparator().Length() + + AiUiDef::xml::propertyClass::KSettings().Length() ); + + TPtr bufPtr( + AiUtility::EnsureBufMaxLengthL( iContentNodeIdBuf, idLength ) ); bufPtr.Copy( AiUiDef::xml::propertyClass::KSettings ); bufPtr.Append( AiUiDef::xml::id::KSettingsIdSeparator ); - bufPtr.Append( aPubInfo.iName ); + bufPtr.Append( aPublisherInfo.Name() ); return bufPtr; } -TPtrC CXmlNodeIdGenerator::ContentNodeIdL(MAiPropertyExtension& aPlugin, const TAiContentItem& aContentItem) +// ---------------------------------------------------------------------------- +// CXmlNodeIdGenerator::CXmlNodeIdGenerator +// +// ---------------------------------------------------------------------------- +// +TPtrC CXmlNodeIdGenerator::ContentNodeIdL( CHsContentPublisher& aPlugin, + const TAiContentItem& aContentItem ) { - TAiPublisherInfo* info = static_cast( aPlugin.GetPropertyL( EAiPublisherInfo ) ); - - LeaveIfNull( info, KErrNotFound ); - - return ContentNodeIdL(*info, aContentItem); + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + return ContentNodeIdL( info, aContentItem ); } - -TPtrC CXmlNodeIdGenerator::ContentNodeIdL - ( const TAiPublisherInfo& aPubInfo, const TAiContentItem& aContentItem ) + +// ---------------------------------------------------------------------------- +// CXmlNodeIdGenerator::CXmlNodeIdGenerator +// +// ---------------------------------------------------------------------------- +// +TPtrC CXmlNodeIdGenerator::ContentNodeIdL( + const THsPublisherInfo& aPublisherInfo, + const TAiContentItem& aContentItem ) { - const TDesC& contentCid = ContentCid( aContentItem ); + const TDesC& contentCid( ContentCid( aContentItem ) ); // Calculate buffer size and ensure buffer has enough room - const TInt idLength = aPubInfo.iName.Length() - + AiUiDef::xml::id::KContentIdSeparator().Length() - + contentCid.Length(); - TPtr bufPtr( AiUtility::EnsureBufMaxLengthL( iContentNodeIdBuf, idLength ) ); + const TInt idLength( aPublisherInfo.Name().Length() + + AiUiDef::xml::id::KContentIdSeparator().Length() + contentCid.Length() ); + + TPtr bufPtr( + AiUtility::EnsureBufMaxLengthL( iContentNodeIdBuf, idLength ) ); // Copy publisher info name to the buffer - bufPtr.Copy( aPubInfo.iName ); + bufPtr.Copy( aPublisherInfo.Name() ); // Append separator bufPtr.Append( AiUiDef::xml::id::KContentIdSeparator ); @@ -85,19 +123,30 @@ return bufPtr; } -TPtrC CXmlNodeIdGenerator::ResourceNodeIdL - ( MAiPropertyExtension& aPlugin, const TAiContentItem& aContentItem ) +// ---------------------------------------------------------------------------- +// CXmlNodeIdGenerator::CXmlNodeIdGenerator +// +// ---------------------------------------------------------------------------- +// +TPtrC CXmlNodeIdGenerator::ResourceNodeIdL( + CHsContentPublisher& aPlugin, const TAiContentItem& aContentItem ) { - TAiPublisherInfo* info = static_cast( aPlugin.GetPropertyL( EAiPublisherInfo ) ); - - LeaveIfNull( info, KErrNotFound ); - - return ResourceNodeIdL(*info, aContentItem); + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + return ResourceNodeIdL( info, aContentItem ); } -TPtrC CXmlNodeIdGenerator::ResourceNodeIdL - ( const TAiPublisherInfo& aPubInfo, const TAiContentItem& aContentItem ) +// ---------------------------------------------------------------------------- +// CXmlNodeIdGenerator::CXmlNodeIdGenerator +// +// ---------------------------------------------------------------------------- +// +TPtrC CXmlNodeIdGenerator::ResourceNodeIdL( + const THsPublisherInfo& aPublisherInfo, + const TAiContentItem& aContentItem ) { // Resources node id is similar to content node id - return ContentNodeIdL( aPubInfo, aContentItem ); + return ContentNodeIdL( aPublisherInfo, aContentItem ); } + +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluicontroller/src/xmluicontroller.cpp --- a/idlehomescreen/xmluicontroller/src/xmluicontroller.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/xmluicontroller.cpp Wed May 12 13:22:51 2010 +0300 @@ -26,7 +26,8 @@ // User includes #include #include -#include +#include +#include #include #include @@ -56,16 +57,12 @@ #include "xnplugindefs.h" #include "ainativeuiplugins.h" +// Constants +const TInt KOneSecondInMicroS = 1000*1000; +_LIT8( KData, "data" ); using namespace AiXmlUiController; -const TInt KOneSecondInMicroS = 1000*1000; -const TInt KAI2CrKeyIncrementBy2 = 2; - -typedef TBuf<32> TNamespace; - -_LIT( KSettingsDummyData, "" ); - // ======== LOCAL FUNCTIONS ======== // ---------------------------------------------------------------------------- // ResolveEventParameters() @@ -262,22 +259,15 @@ // ---------------------------------------------------------------------------- // void CXmlUiController::NotifyAppEnvReadyL() - { + { + iCPSpublisher = CContentPublisher::NewL( *this ); + + iExitTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + if( iFwEventHandler ) { - iFwEventHandler->AppEnvReadyL(); - iFwEventHandler->HandleUiReadyEventL( *this ); - } - - if( !iCPSpublisher ) - { - iCPSpublisher = CContentPublisher::NewL( *this ); - } - - if( !iExitTimer ) - { - iExitTimer = CPeriodic::NewL( CActive::EPriorityStandard ); - } + iFwEventHandler->AppEnvReadyL(); + } } // ---------------------------------------------------------------------------- @@ -285,36 +275,7 @@ // ---------------------------------------------------------------------------- // void CXmlUiController::LoadUIDefinitionL() - { - // No implementation required - } - -// ---------------------------------------------------------------------------- -// CXmlUiController::GetPluginsL() -// ---------------------------------------------------------------------------- -// -void CXmlUiController::GetPluginsL( RAiPublisherInfoArray& /*aPlugins*/ ) - { - // No implementation required - } - -// ---------------------------------------------------------------------------- -// CXmlUiController::PublisherInfo() -// ---------------------------------------------------------------------------- -// -void CXmlUiController::PublisherInfoL( RAiPublisherInfoArray& aPlugins ) - { - // This method returns plugins with namespace KNativeUiNamespace - if ( iRunningAsMain ) - { - // This plugin is used to publish data on secondary ui controller side - TAiPublisherInfo deviceStatus; - deviceStatus.iUid = KDeviceStatusPluginUid; - deviceStatus.iName.Copy( KDeviceStatusPluginName ); - deviceStatus.iNamespace.Copy( KNativeUiNamespace ); - - aPlugins.AppendL( deviceStatus ); - } + { } // ---------------------------------------------------------------------------- @@ -322,7 +283,7 @@ // ---------------------------------------------------------------------------- // void CXmlUiController::PublisherInfoL( CXnNodeAppIf& aSource, - TAiPublisherInfo& aInfo ) + THsPublisherInfo& aInfo ) { // Fetch uid from XML and convert it to TUid const TDesC8* uid( PropertyValue( aSource, @@ -332,62 +293,59 @@ { return; } - + _LIT8( KPrefix, "0x" ); const TInt pos( uid->FindF( KPrefix ) ); + TInt32 uidValue( 0 ); + if( pos != KErrNotFound ) { TLex8 lex( uid->Mid( pos + KPrefix().Length() ) ); // Hex parsing needs unsigned int - TUint32 value = 0; - const TInt parseResult = lex.Val( value, EHex ); + TUint32 value( 0 ); + TInt err( lex.Val( value, EHex ) ); - if ( parseResult == KErrNone ) + if ( err == KErrNone ) { - TInt32 value32( value ); - - aInfo.iUid = TUid::Uid( value32 ); + uidValue = value; } } // Fetch plug-in name from XML - HBufC* pluginName( PropertyValueL( aSource, - AiUiDef::xml::property::KName ) ); - - CleanupStack::PushL( pluginName ); - - if ( pluginName ) - { - aInfo.iName.Copy( *pluginName ); - } + HBufC* name( PropertyValueL( aSource, AiUiDef::xml::property::KName ) ); + + TUid pluginuid( TUid::Uid( uidValue ) ); + + aInfo = THsPublisherInfo( pluginuid, *name, aSource.Namespace() ); - CleanupStack::PopAndDestroy( pluginName ); - - aInfo.iNamespace.Copy( aSource.Namespace() ); + delete name; + name = NULL; } // ---------------------------------------------------------------------------- // CXmlUiController::GetSettingsL() +// // ---------------------------------------------------------------------------- // -void CXmlUiController::GetSettingsL( const TAiPublisherInfo& aPubInfo, +void CXmlUiController::GetSettingsL( const THsPublisherInfo& aPublisherInfo, RAiSettingsItemArray& aSettings ) { - if ( aPubInfo.iNamespace == KNativeUiNamespace ) + if ( aPublisherInfo.Namespace() == KNativeUiNamespace ) { // This controller doesn't provide settings for native ui namespace return; } - const TDesC& classId( iNodeIdGenerator->SettingsNodeIdL( aPubInfo ) ); + const TDesC& classId( + iNodeIdGenerator->SettingsNodeIdL( aPublisherInfo ) ); + + TBuf< KHsPublisherNamespaceMaxLength > ns; - TNamespace ns; + ns.Copy( aPublisherInfo.Namespace() ); - ns.Copy( aPubInfo.iNamespace ); - // Find settings nodes RPointerArray< CXnNodeAppIf > nodes( UiEngineL()->FindNodeByClassL( classId, ns ) ); @@ -405,10 +363,10 @@ CXnNodeAppIf* node( nodes[i] ); const TDesC8* name( - PropertyValue( *node, AiUiDef::xml::property::KName ) ); + PropertyValue( *node, AiUiDef::xml::property::KName ) ); HBufC* value( - PropertyValueL( *node, AiUiDef::xml::property::KValue ) ); + PropertyValueL( *node, AiUiDef::xml::property::KValue ) ); CleanupStack::PushL( value ); @@ -418,7 +376,7 @@ CleanupDeletePushL( settings ); MAiPluginSettingsItem& item( settings->AiPluginSettingsItem() ); - item.SetPublisherId( aPubInfo.iUid ); + item.SetPublisherId( aPublisherInfo.Uid() ); TInt32 key( 0 ); @@ -438,148 +396,7 @@ CleanupStack::PopAndDestroy( &nodes ); - GetSettingsFromCRL( aPubInfo, aSettings ); - GetContentModelL( aPubInfo, aSettings ); - } - -// ---------------------------------------------------------------------------- -// CXmlUiController::GetSettingsFromCRL() -// ---------------------------------------------------------------------------- -// -void CXmlUiController::GetSettingsFromCRL( const TAiPublisherInfo& aPubInfo, - RAiSettingsItemArray &aPluginSettings ) - { - if ( aPubInfo.iNamespace == KNativeUiNamespace ) - { - // This controller doesn't provide settings for native ui namespace - return; - } - - /* - * The settings are stored in the cenrep starting from 0x1000. - * 0x1000 is the name of the plugin which this setting belongs to (for example Settings/Shortcut) - * 0x1001 is the id of the setting (for example 1) - * 0x1002 is the value of the setting (for example localapp:0x012345678) - * - * So three keys per setting. - * - * Settings from cenrep override those from XML - */ - - TUint32 crKey( KAIPluginSettingsKeyRangeStart ); - - TBool moreSettings( ETrue ); - - HBufC* pluginId = HBufC::NewLC( - NCentralRepositoryConstants::KMaxUnicodeStringLength ); - - HBufC* settingValue = HBufC::NewLC( - NCentralRepositoryConstants::KMaxUnicodeStringLength ); - - HBufC* settingKey = HBufC::NewLC( - NCentralRepositoryConstants::KMaxUnicodeStringLength ); - - TPtr pluginIdPtr( pluginId->Des() ); - TPtr settingValuePtr( settingValue->Des() ); - TPtr settingKeyPtr( settingKey->Des() ); - - TInt32 settingId( 0 ); - - TInt err( KErrNone ); - TBool settingFound( EFalse ); - - while( moreSettings ) - { - settingFound = EFalse; - - pluginIdPtr.Zero(); - settingValuePtr.Zero(); - settingKeyPtr.Zero(); - - //Get the name of plugin with the Settings/ prefix - err = iAISettingsRepository->Get( crKey++, pluginIdPtr ); - - // remove the Settings/ prefix if it is located at the start of the string - if( pluginIdPtr.FindC( AiUiDef::xml::propertyClass::KSettings ) == 0 ) - { - pluginIdPtr.Delete( 0, - AiUiDef::xml::id::KSettingsIdSeparator().Length() + - AiUiDef::xml::propertyClass::KSettings().Length() ); - } - - // does the setting belong to this plugin - if( err == KErrNone && pluginIdPtr == aPubInfo.iName ) - { - // Get the settings id - err = iAISettingsRepository->Get( crKey++, settingKeyPtr ); - - if( err == KErrNone ) - { - err = AiUtility::ParseInt( settingId,settingKeyPtr ); - } - - if( err == KErrNone ) - { - // Get the actual value of the setting - err = iAISettingsRepository->Get( crKey++, settingValuePtr ); - - // Ignore possible placeholder data in cenrep - if( err == KErrNone && settingValuePtr.Compare( KSettingsDummyData ) != 0 ) - { - // Try to find an existing setting for this - for( TInt j = 0; j < aPluginSettings.Count(); j++ ) - { - MAiPluginSettings* setting( aPluginSettings[j] ); - MAiPluginSettingsItem& item( setting->AiPluginSettingsItem() ); - - // Existing setting found => replace it - if( item.Key() == settingId && item.PublisherId() == aPubInfo.iUid ) - { - item.SetValueL( settingValuePtr, EFalse ); - settingFound = ETrue; - break; - } - } - - // Existing setting not found => append new one ONLY if we - // are dealing with the icon overrides or toolbar shortcuts - if( !settingFound && - ( ( settingId & KScutFlagBitToolbarShortcut ) || - ( settingId & KScutFlagBitIconOverride ) ) ) - { - MAiPluginSettings* settings( AiUtility::CreatePluginSettingsL() ); - CleanupDeletePushL( settings ); - - MAiPluginSettingsItem& item( settings->AiPluginSettingsItem() ); - - item.SetPublisherId( aPubInfo.iUid ); - item.SetKey( settingId ); - item.SetValueL( settingValuePtr, EFalse ); - - aPluginSettings.Append( settings ); - CleanupStack::Pop( settings ); - } - } - } - else - { - // no settings id found => invalid settings in cenrep - __PRINT8( __DBG_FORMAT8("CXmlUiController::GetSettingsFromCRL: ERROR: invalid settings. key: %d pluginname: %S id: %d value: %S"), crKey, pluginId, settingId, settingValue ); - } - } - else if( err != KErrNone ) - { - // name of the plugin not found => no more settings - moreSettings = EFalse; - } - else - { - // not the correct setting for this plugin - crKey += KAI2CrKeyIncrementBy2; - } - } - - CleanupStack::PopAndDestroy( 3, pluginId ); // settingValue, settingKey + GetContentModelL( aPublisherInfo, aSettings ); } // ---------------------------------------------------------------------------- @@ -587,10 +404,10 @@ // ---------------------------------------------------------------------------- // // ContentModelL() -void CXmlUiController::GetContentModelL( const TAiPublisherInfo& aPubInfo, +void CXmlUiController::GetContentModelL( const THsPublisherInfo& aPublisherInfo, RAiSettingsItemArray& aSettings ) { - if ( aPubInfo.iNamespace == KNativeUiNamespace ) + if ( aPublisherInfo.Namespace() == KNativeUiNamespace ) { // This controller doesn't provide content model for native ui namespace return; @@ -599,7 +416,8 @@ // Find the node for the publisher // TODO Does not work if widget is in view RPointerArray list( - UiEngineL()->FindContentSourceNodesL( aPubInfo.iNamespace ) ); + UiEngineL()->FindContentSourceNodesL( aPublisherInfo.Namespace() ) ); + CleanupClosePushL( list ); CXnNodeAppIf* publisherNode( NULL ); @@ -638,7 +456,9 @@ else if( nodeType == AiUiDef::xml::element::KImage || nodeType == AiUiDef::xml::element::KText || nodeType == AiUiDef::xml::element::KNewsTicker || - nodeType == AiUiDef::xml::element::KAnimation ) + nodeType == AiUiDef::xml::element::KAnimation || + nodeType == AiUiDef::xml::element::KTextEditor || + nodeType == KData ) { // Is created in GetContenItem and used in GetConfigurationsL HBufC* confOwner( NULL ); @@ -772,6 +592,10 @@ // void CXmlUiController::ActivateUI() { + if ( iRunningAsMain && iAppUi ) + { + iAppUi->ActivateUi(); + } } // ---------------------------------------------------------------------------- @@ -793,18 +617,12 @@ } // ---------------------------------------------------------------------------- -// CXmlUiController::RemovePluginFromUI() +// CXmlUiController::SetStateHandler() // ---------------------------------------------------------------------------- // -void CXmlUiController::RemovePluginFromUI( MAiPropertyExtension& aPlugin ) +void CXmlUiController::SetStateHandler( MAiFwStateHandler& aFwStateHandler ) { - CContentRenderer* contentRenderer = - static_cast< CContentRenderer* >( iObserver ); - - if ( contentRenderer ) - { - contentRenderer->CleanPluginFromUi( aPlugin ); - } + iFwStateHandler = &aFwStateHandler; } // ---------------------------------------------------------------------------- @@ -817,6 +635,15 @@ } // ---------------------------------------------------------------------------- +// CXmlUiController::FwStateHandler() +// ---------------------------------------------------------------------------- +// +MAiFwStateHandler* CXmlUiController::FwStateHandler() const + { + return iFwStateHandler; + } + +// ---------------------------------------------------------------------------- // CXmlUiController::MainInterface() // ---------------------------------------------------------------------------- // @@ -840,10 +667,12 @@ // void CXmlUiController::RunApplicationL() { - iRunningAsMain = ETrue; + __PRINTS( "*** CXmlUiController::RunApplicationL" ); + iRunningAsMain = ETrue; + User::LeaveIfError( - EikStart::RunApplication( &CXmlUiController::NewApplication ) ); + EikStart::RunApplication( &CXmlUiController::NewApplication ) ); } // ---------------------------------------------------------------------------- @@ -857,33 +686,12 @@ } // ---------------------------------------------------------------------------- -// CXmlUiController::SetUiFrameworkObserver() -// ---------------------------------------------------------------------------- -// -void CXmlUiController::SetUiFrameworkObserver( - MAiUiFrameworkObserver& aObserver ) - { - iUiFrameworkObserver = &aObserver; - } - -// ---------------------------------------------------------------------------- // CXmlUiController::IsMenuOpen() // ---------------------------------------------------------------------------- // TBool CXmlUiController::IsMenuOpen() { - TBool menuOpen( EFalse ); - TRAP_IGNORE( menuOpen = UiEngineL()->IsMenuDisplaying() ); - return menuOpen; - } - -// ---------------------------------------------------------------------------- -// CXmlUiController::UiFrameworkObserver() -// ---------------------------------------------------------------------------- -// -MAiUiFrameworkObserver* CXmlUiController::UiFrameworkObserver() const - { - return iUiFrameworkObserver; + return iAppUi->IsDisplayingMenuOrDialog(); } // ---------------------------------------------------------------------------- @@ -1006,9 +814,18 @@ // CApaApplication* CXmlUiController::NewApplication() { - CXmlUiController* self = static_cast(Dll::Tls()); - __ASSERT_ALWAYS( self, Panic(ECriticalPointerNull) ); - return CApplication::New(*self); + __TICK( "CXmlUiController::NewApplication" ); + __TIME_MARK( time ); + + CXmlUiController* self = static_cast< CXmlUiController* >( Dll::Tls() ); + + __ASSERT_ALWAYS( self, Panic( ECriticalPointerNull ) ); + + CApplication* app = CApplication::New( *self ); + + __TIME_ENDMARK( "CXmlUiController::NewApplication, done", time ); + + return app; } const TImplementationProxy KImplementationTable[] = diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/dom/src/xndomstringpooloptimizer.cpp --- a/idlehomescreen/xmluirendering/dom/src/xndomstringpooloptimizer.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/dom/src/xndomstringpooloptimizer.cpp Wed May 12 13:22:51 2010 +0300 @@ -82,7 +82,7 @@ } TInt index = FindEntry( aString, 0, iEntries.Count() - 1 ); - if( index > 0 && index < iEntries.Count() ) + if( index >= 0 && index < iEntries.Count() ) { return iEntries[index].iIndex; } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/ecomelement/xndomvisitor/inc/xnliteral.h --- a/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/inc/xnliteral.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/inc/xnliteral.h Wed May 12 13:22:51 2010 +0300 @@ -47,13 +47,6 @@ //Control _STLIT8(KButton, "button"); -_STLIT8(KGrid, "grid"); -_STLIT8(KListItem, "listitem"); -_STLIT8(KDataGrid, "datagrid"); -_STLIT8(KGridCellTemplate, "gridcelltemplate"); -_STLIT8(KList, "list"); -_STLIT8(KDataList, "datalist"); -_STLIT8(KListRowTemplate, "listrowtemplate"); _STLIT8(KMenuBar, "menubar"); _STLIT8(KMenu, "menu"); _STLIT8(KMenuItem, "menuitem"); @@ -144,18 +137,6 @@ //For text,list,datalist, grid, datagrid elements _STLIT8(KOverflow, "overflow"); -//List And grid properties -_STLIT8(KVisibleRows, "_s60-visible-list-rows"); -_STLIT8(KInitialSelection, "_s60-initial-list-selection"); -_STLIT8(KFocusHorLooping, "_s60-list-focus-horizontal-looping"); -_STLIT8(KFocusVerLooping, "_s60-list-focus-vertical-looping"); - -//Datagrid & grid properties -_STLIT8(KGridColumns, "_s60-grid-columns"); -_STLIT8(KS60GridOrientation, "_s60-grid-orientation"); -_STLIT8(KS60GridVerDirection, "_s60-grid-ver-direction"); //lr, rl -_STLIT8(KS60GridHorDirection, "_s60-grid-hor-direction"); //tb, bt - //Views and view properties _STLIT8(KViewDecoration, "_s60-view-decoration"); _STLIT8(KTabStyle, "_s60-tab-style"); @@ -258,23 +239,6 @@ {(const void*)&KOverflow, EFalse} }; -const TXnPropertyProxy KXnGridAndListPropertyTable[] = - { - {(const void*)&KVisibleRows, EFalse}, - {(const void*)&KInitialSelection, EFalse}, - {(const void*)&KFocusHorLooping, EFalse}, - {(const void*)&KFocusVerLooping, EFalse}, - {(const void*)&KOverflow, EFalse} - }; - -const TXnPropertyProxy KXnDataGridAndGridPropertyTable[] = - { - {(const void*)&KGridColumns, EFalse}, - {(const void*)&KS60GridOrientation, EFalse}, - {(const void*)&KS60GridVerDirection, EFalse}, - {(const void*)&KS60GridHorDirection, EFalse} - }; - const TXnPropertyProxy KXnViewsAndViewPropertyTable[] = { {(const void*)&KViewDecoration, EFalse}, diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/ecomelement/xndomvisitor/src/xndomvisitor.cpp --- a/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/src/xndomvisitor.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/src/xndomvisitor.cpp Wed May 12 13:22:51 2010 +0300 @@ -33,8 +33,6 @@ LOCAL_C void SetCommonPropertiesL( TAny* aData ); LOCAL_C void SetElementWithTextPropertiesL( TAny* aData ); LOCAL_C void SetTextElementPropertiesL( TAny* aData ); -LOCAL_C void SetGridAndListPropertiesL( TAny* aData ); -LOCAL_C void SetDataGridAndGridPropertiesL( TAny* aData ); LOCAL_C void SetViewsAndViewPropertiesL( TAny* aData ); LOCAL_C void SetViewPropertiesL( TAny* aData ); @@ -56,13 +54,6 @@ { (const void*)&KApplication, NULL, EEmpty}, { (const void*)&KDesc, NULL, EPCData}, { (const void*)&KButton, &SetTextElementPropertiesL, EEmpty}, - { (const void*)&KGrid, &SetDataGridAndGridPropertiesL, EEmpty}, - { (const void*)&KListItem, &SetElementWithTextPropertiesL, EEmpty}, - { (const void*)&KDataGrid, &SetDataGridAndGridPropertiesL, EEmpty}, - { (const void*)&KGridCellTemplate, &SetCommonPropertiesL, EEmpty}, - { (const void*)&KList, &SetGridAndListPropertiesL, EEmpty}, - { (const void*)&KDataList, &SetGridAndListPropertiesL, EEmpty}, - { (const void*)&KListRowTemplate, &SetCommonPropertiesL, EEmpty}, { (const void*)&KMenuBar, NULL, EEmpty}, { (const void*)&KMenu, NULL, EEmpty}, { (const void*)&KMenuItem, NULL, EEmpty}, @@ -141,22 +132,7 @@ SetElementWithTextPropertiesL( aData ); TInt count( sizeof (KXnTextElementPropertyTable) / sizeof(TXnPropertyProxy) ); SetPropertiesL( KXnTextElementPropertyTable, count, aData ); - } - -LOCAL_C void SetGridAndListPropertiesL( TAny* aData ) - { - SetCommonPropertiesL( aData ); - TInt count( sizeof (KXnGridAndListPropertyTable) / sizeof(TXnPropertyProxy) ); - SetPropertiesL( KXnGridAndListPropertyTable, count, aData ); - } - -LOCAL_C void SetDataGridAndGridPropertiesL( TAny* aData ) - { - SetGridAndListPropertiesL( aData ); - TInt count( sizeof (KXnDataGridAndGridPropertyTable) / sizeof(TXnPropertyProxy) ); - SetPropertiesL( KXnDataGridAndGridPropertyTable, count, aData ); - } - + } LOCAL_C void SetViewsAndViewPropertiesL( TAny* aData ) { diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/bwins/extrenderingplugin.def --- a/idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/bwins/extrenderingplugin.def Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/bwins/extrenderingplugin.def Wed May 12 13:22:51 2010 +0300 @@ -7,4 +7,6 @@ ?ImplUid@CXnExtRenderingPluginAdapter@@QBE?AVTUid@@XZ @ 6 NONAME ; class TUid CXnExtRenderingPluginAdapter::ImplUid(void) const ??1CXnExtRenderingPluginAdapter@@UAE@XZ @ 7 NONAME ; CXnExtRenderingPluginAdapter::~CXnExtRenderingPluginAdapter(void) ?EnterPowerSaveModeL@CXnExtRenderingPluginAdapter@@UAEXXZ @ 8 NONAME ; void CXnExtRenderingPluginAdapter::EnterPowerSaveModeL(void) + ?SetEventHandler@CXnExtRenderingPluginAdapter@@UAEXPAVMXnExtEventHandler@@@Z @ 9 NONAME ; void CXnExtRenderingPluginAdapter::SetEventHandler(class MXnExtEventHandler *) + ?SetDataL@CXnExtRenderingPluginAdapter@@UAEXABVTDesC8@@ABVTDesC16@@H@Z @ 10 NONAME ; void CXnExtRenderingPluginAdapter::SetDataL(class TDesC8 const &, class TDesC16 const &, int) diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/eabi/extrenderingplugin.def --- a/idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/eabi/extrenderingplugin.def Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/eabi/extrenderingplugin.def Wed May 12 13:22:51 2010 +0300 @@ -11,4 +11,6 @@ _ZNK28CXnExtRenderingPluginAdapter7ImplUidEv @ 10 NONAME _ZTI28CXnExtRenderingPluginAdapter @ 11 NONAME _ZTV28CXnExtRenderingPluginAdapter @ 12 NONAME + _ZN28CXnExtRenderingPluginAdapter15SetEventHandlerEP18MXnExtEventHandler @ 13 NONAME + _ZN28CXnExtRenderingPluginAdapter8SetDataLERK6TDesC8RK7TDesC16i @ 14 NONAME diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/src/xnextrenderingpluginadapter.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/src/xnextrenderingpluginadapter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/src/xnextrenderingpluginadapter.cpp Wed May 12 13:22:51 2010 +0300 @@ -19,6 +19,7 @@ #include #include #include +#include // Local constants @@ -102,5 +103,24 @@ { } +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginAdapter::SetEventHandler() +// ---------------------------------------------------------------------------- +// +EXPORT_C void CXnExtRenderingPluginAdapter::SetEventHandler( + MXnExtEventHandler* /*aEventHandler*/ ) + { + + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginAdapter::SetDataL() +// ---------------------------------------------------------------------------- +// +EXPORT_C void CXnExtRenderingPluginAdapter::SetDataL( const TDesC8& /*aData*/, + const TDesC& /*aType*/, TInt /*aIndex*/ ) + { + + } // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/inc/xnanimationadapter.h --- a/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/inc/xnanimationadapter.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/inc/xnanimationadapter.h Wed May 12 13:22:51 2010 +0300 @@ -50,13 +50,16 @@ virtual ~CXnAnimationAdapter(); public: // From Base classes - /** - * From CXnControlAdapter Handles the property changes. - * @since Series 60 3.1 - * @return void. - */ + + // From CXnControlAdapter void DoHandlePropertyChangeL(CXnProperty* aProperty = NULL); + // From CXnControlAdapter + void DoEnterPowerSaveModeL( TModeEvent aEvent ); + + // From CXnControlAdapter + void DoExitPowerSaveModeL( TModeEvent aEvent ); + protected: /** * From CCoeControl. @@ -124,6 +127,9 @@ // Timer for animation, owned CPeriodic* iPeriodicTimer; + + // Whether the renderer is in power save mode or not + TBool iInPowerSaveMode; }; #endif // _XNANIMATIONAPADAPTER_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimationadapter.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimationadapter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimationadapter.cpp Wed May 12 13:22:51 2010 +0300 @@ -15,9 +15,11 @@ * */ #include -#include -#include +#include +#include #include +#include + #include "xnnodepluginif.h" #include "xndomproperty.h" #include "xnproperty.h" @@ -112,6 +114,26 @@ } // ----------------------------------------------------------------------------- +// CXnAnimationAdapter::DoEnterPowerSaveModeL +// ----------------------------------------------------------------------------- +// +void CXnAnimationAdapter::DoEnterPowerSaveModeL( TModeEvent /*aEvent*/ ) + { + iInPowerSaveMode = ETrue; + StopAnimation(); + } + +// ----------------------------------------------------------------------------- +// CXnAnimationAdapter::DoExitPowerSaveModeL +// ----------------------------------------------------------------------------- +// +void CXnAnimationAdapter::DoExitPowerSaveModeL( TModeEvent /*aEvent*/ ) + { + iInPowerSaveMode = EFalse; + StartAnimation(); + } + +// ----------------------------------------------------------------------------- // CXnNewstickerAdapter::MakeVisible() // ----------------------------------------------------------------------------- // @@ -176,6 +198,7 @@ // TInt CXnAnimationAdapter::TimerCallBack(TAny* aAny) { + __PRINTS( "CXnAnimationAdapter::TimerCallback, timer runs" ); CXnAnimationAdapter* self = static_cast (aAny); // Update widget @@ -190,7 +213,7 @@ // void CXnAnimationAdapter::StartAnimation() { - if ( !iPeriodicTimer && IsVisible() ) + if ( !iPeriodicTimer && IsVisible() && !iInPowerSaveMode ) { TRAPD(err, iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityIdle) ); if ( err == KErrNone ) diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockadapter.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockadapter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockadapter.cpp Wed May 12 13:22:51 2010 +0300 @@ -37,7 +37,7 @@ _LIT8( KDateInformation, "Clock/DateInformation" ); _LIT8( KDayInformation, "Clock/DayInformation" ); -_LIT( KDigitalFont, "EAknLogicalFontDigitalFont" ); +_LIT( KDigitalFont, "EAknLogicalFontSecondaryFont" ); _LIT( KAmPmFont, "EAknLogicalFontSecondaryFont" ); _LIT( KDateFont, "EAknLogicalFontSecondaryFont" ); @@ -275,6 +275,7 @@ if( iForeground ) { UpdateDisplay(); // starts timer after update + iClockControl->StartTimer(); } else { diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockcontrol.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockcontrol.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockcontrol.cpp Wed May 12 13:22:51 2010 +0300 @@ -18,6 +18,7 @@ // SYSTEM INCLUDE FILES #include // for RChangeNotifier +#include // USER INCLUDE FILES #include "xncontroladapter.h" @@ -61,6 +62,7 @@ void RunL() { + __PRINTS( "CXnClockChangeHandler::RunL, timer runs" ); if( iStatus.Int() & ( EChangesLocale | EChangesSystemTime ) ) { iClient.TimeOrLocaleChanged(); @@ -244,9 +246,6 @@ homeTime.HomeTime(); TRAP_IGNORE( iFace->DrawL( *iAdapter, aGc, aRect, homeTime ) ); - - // Ensure timer is active - const_cast< CXnClockControl* >( this )->StartTimer(); } } @@ -257,6 +256,7 @@ // TInt CXnClockControl::TimerCallback( TAny* aThis ) { + __PRINTS( "CXnClockControl::TimerCallback, timer runs" ); CXnClockControl* self = static_cast< CXnClockControl* >( aThis ); // Update the clock display diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockface.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockface.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockface.cpp Wed May 12 13:22:51 2010 +0300 @@ -91,62 +91,53 @@ // void CXnClockFaceDigital::DrawL( CXnClockAdapter& aAdapter, CWindowGc& aGc, const TRect& aRect, const TTime& aTime ) - { + { TBuf< KMaxTimeFormatSpec > time; - aTime.FormatL( time, KTimeFormat() ); + aTime.FormatL( time, KTimeFormat() ); TBuf< KMaxTimeFormatSpec > ampm; aTime.FormatL( ampm, KAmPmFormat() ); - + AknTextUtils::LanguageSpecificNumberConversion( time ); - + const CAknLayoutFont* clockFont( aAdapter.FontL( CXnClockAdapter::EDigitalFont ) ); - + const CAknLayoutFont* ampmFont( aAdapter.FontL( CXnClockAdapter::EAmPmFont ) ); const CAknLayoutFont* dateFont( aAdapter.FontL( CXnClockAdapter::EDateFont ) ); - + const TRgb& color( aAdapter.TextColorL() ); - + CXnNodePluginIf* date( aAdapter.Date() ); - - TInt ampmWidth( 0 ); - - if( TLocale().TimeFormat() == ETime12 ) - { - // Measure the full width of the ampm string - ampmWidth = AknBidiTextUtils::MeasureTextBoundsWidth( *ampmFont, ampm, - CFont::TMeasureTextInput::EFVisualOrder ); - } - + const TInt deltaHeight( aRect.Height() - clockFont->TextPaneHeight() ); TInt offset( clockFont->TextPaneTopToBaseline() + deltaHeight / 2 ); - + if( date ) { // When date string is shown, time string must be lifted up offset -= ( dateFont->TextPaneHeight() / 2 ); } - + // Measure the full width of the time string TInt textWidth( AknBidiTextUtils::MeasureTextBoundsWidth( *clockFont, time, CFont::TMeasureTextInput::EFVisualOrder ) ); - - TInt extraWidth( aRect.Width() - ampmWidth - textWidth ); - + + TInt extraWidth( aRect.Width() - textWidth ); + TInt margin( extraWidth / 2 ); - + aGc.SetPenColor( color ); - + aGc.UseFont( clockFont ); CGraphicsContext::TTextAlign align; - + TBool mirrored( AknLayoutUtils::LayoutMirrored() ); - + if( mirrored ) { align = CGraphicsContext::ERight; @@ -154,65 +145,64 @@ else { align = CGraphicsContext::ELeft; - } - + } + aGc.DrawText( time, aRect, offset, align, margin ); aGc.DiscardFont(); - + if( TLocale().TimeFormat() == ETime12 ) { TRect ampmRect( aRect ); - + TInt ampmHeight( ampmFont->TextPaneHeight() ); + if( mirrored ) { - ampmRect.iBr.iX -= ( textWidth + ( margin / 2 ) ); + align = CGraphicsContext::ELeft; } else { - ampmRect.iTl.iX += ( textWidth + ( margin / 2 ) ); - } - - extraWidth = ampmRect.Width() - ampmWidth; - - margin = extraWidth / 2; + align = CGraphicsContext::ERight; + } + + ampmRect.iTl.iY += ampmHeight; aGc.UseFont( ampmFont ); - + aGc.DrawText( ampm, ampmRect, offset, align, margin ); - + aGc.DiscardFont(); - } - + } + if( date ) { const TDesC* dateStr( &KNullDesC() ); - + CXnText* textIf( NULL ); - XnComponentInterface::MakeInterfaceL( textIf, date->AppIfL() ); + XnComponentInterface::MakeInterfaceL( textIf, date->AppIfL() ); if( textIf ) { dateStr = textIf->Text(); - } - + } + // Measure the full width of the time string TInt dateWidth( AknBidiTextUtils::MeasureTextBoundsWidth( *dateFont, *dateStr, CFont::TMeasureTextInput::EFVisualOrder ) ); - + TInt width( aRect.Width() - dateWidth ); TInt margin( width / 2 ); - + // Move date string down by text pane height and 5% of rect height offset += dateFont->TextPaneHeight() + ( aRect.Height() / 20 ); - + aGc.UseFont( dateFont ); - + aGc.DrawText( *dateStr, aRect, offset, align, margin ); - - aGc.DiscardFont(); - } + + aGc.DiscardFont(); + } } // ============================ MEMBER FUNCTIONS =============================== diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenu.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenu.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenu.cpp Wed May 12 13:22:51 2010 +0300 @@ -145,6 +145,17 @@ } // ----------------------------------------------------------------------------- +// CXnMenu::KeyEventNode +// +// ----------------------------------------------------------------------------- +// +CXnNodePluginIf* CXnMenu::KeyEventNode() + { + CXnMenuAdapter* adapter = static_cast< CXnMenuAdapter* >( ControlAdapter() ); + return adapter->KeyEventNode(); + } + +// ----------------------------------------------------------------------------- // CXnMenu::SetObserver // // ----------------------------------------------------------------------------- @@ -171,11 +182,12 @@ // // ----------------------------------------------------------------------------- // -void CXnMenu::TryDisplayingMenuBarL( const TDesC& aMenuNodeId ) +void CXnMenu::TryDisplayingMenuBarL( const TDesC& aMenuNodeId, + TBool aContextMenu ) { CXnMenuAdapter* adapter = static_cast< CXnMenuAdapter* >( ControlAdapter() ); - adapter->TryDisplayingMenuL( aMenuNodeId ); + adapter->TryDisplayingMenuL( aMenuNodeId, aContextMenu ); } // ----------------------------------------------------------------------------- diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenuadapter.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenuadapter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenuadapter.cpp Wed May 12 13:22:51 2010 +0300 @@ -55,19 +55,19 @@ #undef _AVKON_CBA_LSC -_LIT8( KWidgetSpecific, "Menu/WidgetSpecific" ); -_LIT8( KViewSpecific, "Menu/ViewSpecific" ); -_LIT8( KWidgetsHidden, "Menu/WidgetsHidden" ); -_LIT8( KWidgetsShown, "Menu/WidgetsShown" ); _LIT8( KEditMode, "Menu/EditMode" ); +_LIT8( KNormalMode, "Menu/NormalMode" ); +_LIT8( KContextEditMode, "ContextMenu/EditMode" ); +_LIT8( KContextNormalMode, "ContextMenu/NormalMode" ); _LIT8( KAlwaysShown, "Menu/AlwaysShown" ); + _LIT8( KHsShowHelp, "hs_show_help" ); const TInt KMenuCommandFirst = 6000; const TInt KMenuCommandLast = 6199; -const TInt KCBACommandFirst = 6200; -const TInt KCBACommandSecond = 6201; -const TInt KCBACommandMiddle = 6202; +const TInt KCBACommandFirst = EAknSoftkeyOptions; +const TInt KCBACommandSecond = EAknSoftkeyBack; +const TInt KCBACommandMiddle = EAknSoftkeyDialler; const TInt KXnMenuArrayGranularity = 6; const TInt KWideScreenWidth = 640; @@ -809,6 +809,34 @@ return retval; } +// ----------------------------------------------------------------------------- +// FindWidgetElementL +// +// ----------------------------------------------------------------------------- +// +static CXnNodePluginIf* FindWidgetElementL( CXnNodePluginIf& aPluginNode ) + { + CXnNodePluginIf* retval( NULL ); + + RPointerArray< CXnNodePluginIf > children( aPluginNode.ChildrenL() ); + CleanupClosePushL( children ); + + for ( TInt i = 0; i < children.Count(); i++ ) + { + CXnNodePluginIf* node( children[i] ); + + if ( node->AppIfL().InternalDomNodeType() == XnPropertyNames::KWidget ) + { + retval = node; + break; + } + } + + CleanupStack::PopAndDestroy( &children ); + + return retval; + } + // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- @@ -1449,39 +1477,29 @@ iMenuItems.Reset(); iIdCounter = KMenuCommandFirst; - - CXnNodePluginIf* focused( iUiEngine->FocusedNodeL() ); - - const TDesC8& ns( iRootNode->Namespace() ); - - TBool widgetSpecific( EFalse ); - - for( ; focused ; focused = focused->ParentL() ) - { - if( focused->AppIfL().InternalDomNodeType() == XnPropertyNames::KPlugin ) + + RPointerArray< const TDesC8 > groups; + CleanupClosePushL( groups ); + + if ( !iUiEngine->IsTextEditorActive() ) + { + if( iUiEngine->EditMode() ) { - widgetSpecific = ETrue; - break; + groups.AppendL( + iContextMenu ? &KContextEditMode : &KEditMode ); + } + else + { + groups.AppendL( + iContextMenu ? &KContextNormalMode : &KNormalMode ); } } - TBool widgetsShown( iUiEngine->WidgetsVisible() ); - - RPointerArray< const TDesC8 > groups; - CleanupClosePushL( groups ); - - if( iUiEngine->EditMode() ) + if ( !iContextMenu ) { - groups.AppendL( &KEditMode ); + groups.AppendL( &KAlwaysShown ); } - else - { - groups.AppendL( widgetSpecific ? &KWidgetSpecific : &KViewSpecific ); - groups.AppendL( widgetsShown ? &KWidgetsShown : &KWidgetsHidden ); - } - - groups.AppendL( &KAlwaysShown ); - + // Recursively add menuitems AddMenuItemL( -1, iMenuBarNode, groups ); @@ -1504,40 +1522,45 @@ return resp; } - - const TDesC8* pos( &KNullDesC8 ); + TInt pos( KErrNotFound ); + if( aKeyEvent.iScanCode == EStdKeyDevice0 ) { - pos = &XnPropertyNames::softkey::type::KLeft; + pos = CEikButtonGroupContainer::ELeftSoftkeyPosition; } else if( aKeyEvent.iScanCode == EStdKeyDevice1 ) { - pos = &XnPropertyNames::softkey::type::KRight; + pos = CEikButtonGroupContainer::ERightSoftkeyPosition; } else if( aKeyEvent.iScanCode == EStdKeyDevice3 ) { - pos = &XnPropertyNames::softkey::type::KMiddle; + pos = CEikButtonGroupContainer::EMiddleSoftkeyPosition; } - if( aType == EEventKeyDown ) - { - iKeyEventNode = FindSoftkeyNodeL( *pos ); + CXnSoftkeyItem* softkey( NULL ); + + if ( pos != KErrNotFound ) + { + softkey = SoftkeyItemL( pos ); } - - if( aKeyEvent.iScanCode == EStdKeyDevice0 || - aKeyEvent.iScanCode == EStdKeyDevice1 || - aKeyEvent.iScanCode == EStdKeyDevice3 ) + + if ( softkey ) { - CXnNodePluginIf* node( FindSoftkeyNodeL( *pos ) ); + CXnNodePluginIf* node( softkey->iNode ); + if( aType == EEventKeyDown ) + { + iKeyEventNode = node; + } + if( node && node == iKeyEventNode ) { // Let base class handle the event resp = CXnControlAdapter::OfferKeyEventL( aKeyEvent, aType ); } } - + if( aType == EEventKeyUp ) { iKeyEventNode = NULL; @@ -1715,8 +1738,7 @@ // ----------------------------------------------------------------------------- // void CXnMenuAdapter::SetContainerL( CEikButtonGroupContainer& aContainer ) - { - + { User::LeaveIfNull( &aContainer ); TBool updateNeeded( EFalse ); @@ -1759,16 +1781,19 @@ // ----------------------------------------------------------------------------- // CXnMenuAdapter::TryDisplayingMenuL -// Displays options menu if it is defined for the softkey item +// Displays options menu // ----------------------------------------------------------------------------- // -void CXnMenuAdapter::TryDisplayingMenuL( const TDesC& aMenuNodeId ) +void CXnMenuAdapter::TryDisplayingMenuL( const TDesC& aMenuNodeId, + TBool aContextMenu ) { HBufC8* id = CnvUtfConverter::ConvertFromUnicodeToUtf8L( aMenuNodeId ); CleanupStack::PushL( id ); CXnNodePluginIf* node( iUiEngine->FindNodeByIdL( *id, iRootNode->Namespace() ) ); CleanupStack::PopAndDestroy( id ); + iContextMenu = aContextMenu; + if( node && node->Type()->Type() == KXnMenu ) { TryDisplayingMenuL(); @@ -1807,8 +1832,8 @@ // ----------------------------------------------------------------------------- // void CXnMenuAdapter::StopDisplayingMenu() - { - if( iMenuShown && iMenuBar ) + { + if( iMenuBar ) { iMenuBar->StopDisplayingMenuBar(); } @@ -2087,6 +2112,16 @@ } // ----------------------------------------------------------------------------- +// CXnMenuAdapter::KeyEventNode +// +// ----------------------------------------------------------------------------- +// +CXnNodePluginIf* CXnMenuAdapter::KeyEventNode() + { + return iKeyEventNode; + } + +// ----------------------------------------------------------------------------- // CXnMenuAdapter::HandleScreenDeviceChangedL // // ----------------------------------------------------------------------------- @@ -2736,15 +2771,13 @@ // Get element CXnNodePluginIf& pluginNode( iUiEngine->PluginNodeL( focusedNode ) ); - RPointerArray< CXnNodePluginIf > children( pluginNode.ChildrenL() ); - CleanupClosePushL( children ); - + CXnNodePluginIf* widget( FindWidgetElementL( pluginNode ) ); + CXnNodePluginIf* widgetExtNode( NULL ); - if( children.Count() > 0 ) - { - // children[0] must be element - widgetExtNode = FindChildL( *children[0], KXnMenuExtension ); + if( widget ) + { + widgetExtNode = FindChildL( *widget, KXnMenuExtension ); } if( !widgetExtNode ) @@ -2773,9 +2806,7 @@ source ); } } - } - - CleanupStack::PopAndDestroy( &children ); + } } if( menuItem && IsNodeVisibleL( *menuItem ) ) diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickercontrol.h --- a/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickercontrol.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickercontrol.h Wed May 12 13:22:51 2010 +0300 @@ -90,7 +90,13 @@ * @return The title of the given index. */ const TDesC& Title(TInt aIndex) const; - + + /** + * Returns last index from iTitleTexts + * Which is not empty string + */ + TInt LastIndexWithContent(); + /** * Delete all titles. */ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickeradapter.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickeradapter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickeradapter.cpp Wed May 12 13:22:51 2010 +0300 @@ -21,6 +21,7 @@ #include #include #include +#include // User includes #include "xnviewnodeimpl.h" @@ -684,6 +685,7 @@ // TInt CXnNewstickerAdapter::PeriodicEventL( TAny* aPtr ) { + __PRINTS( "CXnNewstickerAdapter::PeriodicEventL, timer runs" ); CXnNewstickerAdapter* self = static_cast< CXnNewstickerAdapter* >( aPtr ); self->DoScroll(); diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickercontrol.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickercontrol.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickercontrol.cpp Wed May 12 13:22:51 2010 +0300 @@ -174,6 +174,22 @@ } // ----------------------------------------------------------------------------- +// CXnNewstickerControl::LastIndexWithContent +// ----------------------------------------------------------------------------- +// +TInt CXnNewstickerControl::LastIndexWithContent() + { + for( TInt i(iTitleTexts.Count()-1); i>=0; --i ) + { + if ( iTitleTexts[ i ]->Des().Length() > 0 ) + { + return i; + } + } + return KErrNotFound; + } + +// ----------------------------------------------------------------------------- // CXnNewstickerControl::ClearTitles // ----------------------------------------------------------------------------- // @@ -252,22 +268,38 @@ { TBool ret( EFalse ); TInt lastIndex( iTitleTexts.Count() - 1 ); + TInt lastIndexWithContent = LastIndexWithContent(); if( aSetDefault ) { + // set last index as default iCurrentTitleIndex = GetNextTitleWithContent( lastIndex, ETrue ); } else if( iCurrentTitleIndex >= lastIndex ) { + // if iCurrentTitleIndex is in last position start from beginning iCurrentTitleIndex = GetNextTitleWithContent( 0 ); } else { - iCurrentTitleIndex = GetNextTitleWithContent( iCurrentTitleIndex + 1 ); + if ( iCurrentTitleIndex + 1 > lastIndexWithContent ) + { + // if lastIndexWithContent is creater than next item + // it means all next items are empty strings + iCurrentTitleIndex = lastIndexWithContent; + } + else + { + // find next index with content + iCurrentTitleIndex + = GetNextTitleWithContent( iCurrentTitleIndex + 1 ); + } } - if( iCurrentTitleIndex == lastIndex) + if( iCurrentTitleIndex == lastIndexWithContent || + lastIndexWithContent == KErrNotFound ) { + // loop done stop periodic timer. ret = ETrue; } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/group/xnpopupfactory.mmp --- a/idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/group/xnpopupfactory.mmp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/group/xnpopupfactory.mmp Wed May 12 13:22:51 2010 +0300 @@ -45,6 +45,7 @@ LIBRARY xn3domdocument.lib LIBRARY avkon.lib LIBRARY ws32.lib +LIBRARY gfxtrans.lib START RESOURCE xn3popupfactory.rss #ifdef SYMBIAN_SECURE_ECOM diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/inc/xnpopupadapter.h --- a/idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/inc/xnpopupadapter.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/inc/xnpopupadapter.h Wed May 12 13:22:51 2010 +0300 @@ -86,7 +86,13 @@ /** * @see CXnControlAdapter */ - void DoHandlePropertyChangeL(CXnProperty* aProperty = NULL); + void DoHandlePropertyChangeL(CXnProperty* aProperty = NULL); + +private: // from base class + /** + * @see CCoeControl documentation + */ + void MakeVisible( TBool aVisible ); private: void Draw(const TRect& aRect) const; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/src/xnpopupadapter.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/src/xnpopupadapter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/src/xnpopupadapter.cpp Wed May 12 13:22:51 2010 +0300 @@ -26,6 +26,8 @@ #include "xncomponent.h" #include +#include +#include const TInt KStartDelay = 1000000; const TInt KDisplayTime = 0; @@ -295,6 +297,8 @@ CXnControlAdapter::ConstructL(aNode); iNode = &aNode; iAppUi = CCoeEnv::Static()->AppUi(); + + GfxTransEffect::Register( this, KGfxPreviewPopupControlUid ); } // ----------------------------------------------------------------------------- @@ -314,6 +318,7 @@ CXnPopupAdapter::~CXnPopupAdapter() { delete iActiveObject; + GfxTransEffect::Deregister( this ); } // ----------------------------------------------------------------------------- @@ -541,4 +546,31 @@ this->SetRect( rect ); } +// ----------------------------------------------------------------------------- +// CXnPopupAdapter::MakeVisible +// +// ----------------------------------------------------------------------------- +// +void CXnPopupAdapter::MakeVisible( TBool aVisible ) + { + if ( aVisible == IsVisible() ) + { + return; + } + + if ( aVisible ) + { + GfxTransEffect::Begin( this, KGfxControlAppearAction ); + } + else + { + GfxTransEffect::Begin( this, KGfxControlDisappearAction ); + } + + CCoeControl::MakeVisible( aVisible ); + + GfxTransEffect::SetDemarcation( this, iPosition ); + GfxTransEffect::End( this ); + } + // End of File diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/group/xntexteditorfactory.mmp --- a/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/group/xntexteditorfactory.mmp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/group/xntexteditorfactory.mmp Wed May 12 13:22:51 2010 +0300 @@ -56,6 +56,7 @@ LIBRARY gdi.lib LIBRARY etext.lib LIBRARY aknskins.lib +LIBRARY egul.lib LANG SC diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/inc/xntexteditoradapter.h --- a/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/inc/xntexteditoradapter.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/inc/xntexteditoradapter.h Wed May 12 13:22:51 2010 +0300 @@ -29,6 +29,7 @@ class CXnNodePluginIf; class CEikEdwin; class CXnTextEditorPublisher; +class CXnAppUiAdapter; // CLASS DECLARATION class CXnTextEditorAdapter : public CXnControlAdapter @@ -73,7 +74,15 @@ * @return Text, ownership is transfered */ HBufC* Text() const; - + + /** + * Handles editor events + * + * @since S60 5.2 + * @param aReason, editor event + */ + void HandleEditorEvent( TInt aReason ); + public: // from base classes /** @@ -110,7 +119,12 @@ * See CCoeControl documentation */ void Draw( const TRect& aRect ) const; - + + /** + * See CCoeControl documentation + */ + void HandleResourceChange( TInt aType ); + private: // from MCoeControlObserver @@ -118,7 +132,7 @@ * See MCoeControlObserver documentation */ void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); - + private: // private constrcutors @@ -130,6 +144,8 @@ // new functions void SetPropertiesL(); + + void SetEditorMarginPropertiesL(); private: // data @@ -139,6 +155,8 @@ CXnNodePluginIf& iNode; /** UI engine, not owned */ TXnUiEnginePluginIf* iUiEngine; + /** Appui adapter, not owned */ + CXnAppUiAdapter* iAppui; /** Editor, owned */ CEikEdwin* iEditor; /** CPS publisher wrapper, owned */ @@ -151,6 +169,8 @@ TInt iMaxLines; /** Flag to indicate whether focus loss is refused */ TBool iRefusesFocusLoss; + /** Split input states*/ + TInt iSplitInputFlags; }; #endif // _XNTEXTEDITORADAPTER_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditor.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditor.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditor.cpp Wed May 12 13:22:51 2010 +0300 @@ -85,7 +85,17 @@ { return (static_cast(ControlAdapter()))->Text(); } - + +// --------------------------------------------------------- +// CXnTextEditor::HandleEditorEvent +// --------------------------------------------------------- +// +void CXnTextEditor::HandleEditorEvent( TInt aReason ) + { + static_cast(ControlAdapter())-> + HandleEditorEvent( aReason ); + } + // --------------------------------------------------------- // --------------------------------------------------------- XnComponentInterface::MXnComponentInterface* CXnTextEditor::MakeInterfaceL(const TDesC8& aType) diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditoradapter.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditoradapter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditoradapter.cpp Wed May 12 13:22:51 2010 +0300 @@ -25,11 +25,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include @@ -46,12 +48,21 @@ #include "xnnodepluginif.h" #include "xneditmode.h" #include "c_xnutils.h" +#include "xntexteditor.h" const TInt KMaxLength = 100; +enum TSplitInputState + { + ESplitInputEnabled = 1, + ESplitInputOpen = 2, + ESplitInputEditorInStack = 4, + }; + _LIT8( KCpsPublishing, "cpspublishing" ); _LIT8( KMaxLineAmount, "max-line-amount" ); _LIT8( KMaxCharAmount, "max-char-amount" ); +_LIT8( KEnablePartialInput, "splitinputenabled" ); _LIT( KEnterChar, "\x2029" ); @@ -62,6 +73,30 @@ // ============================ LOCAL FUNCTIONS ================================ +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +TBool IsFlagSet( TInt aFlags, TInt aFlag ) + { + return aFlags & aFlag; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void SetFlag( TInt& aFlags, TInt aFlag ) + { + aFlags |= aFlag; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void ClearFlag( TInt& aFlags, TInt aFlag ) + { + aFlags &= ~aFlag; + } + // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- @@ -99,7 +134,15 @@ // ----------------------------------------------------------------------------- // CXnTextEditorAdapter::~CXnTextEditorAdapter() - { + { + if( IsFlagSet( iSplitInputFlags, ESplitInputOpen ) ) + { + if( iUiEngine ) + { + iUiEngine->EnablePartialTouchInput( iNode, EFalse ); + } + } + if ( iAvkonAppUi ) { iAvkonAppUi->RemoveFromStack( iEditor ); @@ -125,6 +168,8 @@ CXnControlAdapter::ConstructL( iNode ); iUiEngine = iNode.UiEngineL(); + iAppui = static_cast< CXnAppUiAdapter* >( iAvkonAppUi ); + // Max line amount iMaxLines = 0; @@ -170,7 +215,24 @@ iEditor->SetAknEditorNumericKeymap( EAknEditorPlainNumberModeKeymap ); iEditor->SetSuppressBackgroundDrawing( ETrue ); - + + // Enable partial Screen + CXnProperty* enablepartialinput( iNode.GetPropertyL( KEnablePartialInput ) ); + iSplitInputFlags = 0; + + if ( enablepartialinput && + enablepartialinput->StringValue() == XnPropertyNames::KTrue ) + { + iEditor->SetAknEditorFlags( EAknEditorFlagEnablePartialScreen ); + SetFlag( iSplitInputFlags, ESplitInputEnabled ); + } + + // for RTL languages + iEditor->SetAknEditorLocalLanguage( User::Language() ); + ( AknLayoutUtils::LayoutMirrored() ? + iEditor->SetAlignment( EHRightVCenter ) : + iEditor->SetAlignment( EHLeftVCenter ) ); + iEditor->SetObserver( this ); // Default not focused @@ -285,30 +347,49 @@ // void CXnTextEditorAdapter::FocusChanged( TDrawNow aDrawNow ) { - CXnAppUiAdapter* appui( - static_cast< CXnAppUiAdapter* >( iAvkonAppUi ) ); - TBool isFocused( IsFocused() ? ETrue : EFalse ); - TInt value; if ( isFocused ) { value = EPSAiDontForwardNumericKeysToPhone; - - TRAP_IGNORE( appui->AddToStackL( appui->View(), iEditor ) ); - - // AddToStackL calls iEditor->SetFocus( ETrue ); + + if( !IsFlagSet( iSplitInputFlags, ESplitInputEnabled ) ) + { + TRAP_IGNORE( iAppui->AddToStackL( iAppui->View(), iEditor ) ); + // AddToStackL calls iEditor->SetFocus( ETrue ); + } + else if( !IsFlagSet( iSplitInputFlags, ESplitInputOpen ) ) + { + TRAP_IGNORE( iAppui->AddToStackL( iAppui->View(), iEditor ) ); + SetFlag( iSplitInputFlags, ESplitInputEditorInStack ); + } } else { value = EPSAiForwardNumericKeysToPhone; - appui->RemoveFromStack( iEditor ); + if( !IsFlagSet( iSplitInputFlags, ESplitInputEnabled ) ) + { + iAppui->RemoveFromStack( iEditor ); + iEditor->SetFocus( EFalse, aDrawNow ); + } - iEditor->SetFocus( EFalse, aDrawNow ); + // Remove editor from stack if it has not beed removed AND split screen has been closed + else if( IsFlagSet( iSplitInputFlags, ESplitInputEditorInStack ) && + !IsFlagSet( iSplitInputFlags, ESplitInputOpen ) ) + { + iAppui->RemoveFromStack( iEditor ); + iEditor->SetFocus( EFalse, aDrawNow ); + ClearFlag( iSplitInputFlags, ESplitInputEditorInStack ); + } } - + + if( IsFlagSet( iSplitInputFlags, ESplitInputOpen ) ) + { + value = EPSAiDontForwardNumericKeysToPhone; + } + iRefusesFocusLoss = isFocused; RProperty::Set( KPSUidAiInformation, @@ -327,6 +408,50 @@ } // ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::HandleResourceChange +// +// ----------------------------------------------------------------------------- +// +void CXnTextEditorAdapter::HandleResourceChange( TInt aType ) + { + if ( aType == KAknSplitInputEnabled ) + { + if( IsFlagSet( iSplitInputFlags, ESplitInputEditorInStack ) && + !IsFlagSet( iSplitInputFlags, ESplitInputOpen ) ) + { + iUiEngine->EnablePartialTouchInput( iNode, ETrue ); + SetFlag( iSplitInputFlags, ESplitInputOpen ); + } + } + + if ( aType == KAknSplitInputDisabled ) + { + if( IsFlagSet( iSplitInputFlags, ESplitInputOpen ) ) + { + iUiEngine->EnablePartialTouchInput( iNode, EFalse ); + ClearFlag( iSplitInputFlags, ESplitInputOpen ); + + // If editor is not focused anymore, remove if from stack + CXnNodePluginIf* focusedNode( NULL ); + TRAP_IGNORE( focusedNode = iUiEngine->FocusedNodeL() ); + if( focusedNode != &iNode && + IsFlagSet( iSplitInputFlags, ESplitInputEditorInStack ) ) + { + iAppui->RemoveFromStack( iEditor ); + iEditor->SetFocus( EFalse ); + ClearFlag( iSplitInputFlags, ESplitInputEditorInStack ); + + // Forward keys to phone again + RProperty::Set( KPSUidAiInformation, + KActiveIdleForwardNumericKeysToPhone, + EPSAiForwardNumericKeysToPhone ); + } + } + } + CCoeControl::HandleResourceChange( aType ); + } + +// ----------------------------------------------------------------------------- // CXnTextEditorAdapter::HandleControlEventL // // ----------------------------------------------------------------------------- @@ -352,6 +477,7 @@ void CXnTextEditorAdapter::SetTextL( const TDesC& aText ) { iEditor->SetTextL( &aText ); + iNode.SetDirtyL(); } // ----------------------------------------------------------------------------- @@ -370,6 +496,22 @@ } // ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::HandleEditorEvent +// ----------------------------------------------------------------------------- +// +void CXnTextEditorAdapter::HandleEditorEvent( TInt aReason ) + { + if( aReason == CXnTextEditor::KDeactivateTextEditor && + IsFlagSet( iSplitInputFlags, ESplitInputOpen ) ) + { + iAppui->RemoveFromStack( iEditor ); + iEditor->SetFocus( EFalse ); + ClearFlag( iSplitInputFlags, ESplitInputEditorInStack ); + iRefusesFocusLoss = EFalse; + } + } + +// ----------------------------------------------------------------------------- // CXnTextEditorAdapter::SetPropertiesL // Sets text properties // ----------------------------------------------------------------------------- @@ -495,11 +637,61 @@ cf.iFontPresentation.iTextColor = KRgbBlack; } } - } + } + + SetEditorMarginPropertiesL(); CCharFormatLayer *pCharFL = CCharFormatLayer::NewL(cf,cfm); iEditor->SetCharFormatLayer(pCharFL); iEditor->SetTextBaselineSpacing( 2 ); } +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::SetEditorMarginPropertiesL +// Sets text properties +// ----------------------------------------------------------------------------- +// +void CXnTextEditorAdapter::SetEditorMarginPropertiesL() + { + TMargins8 margins; + + CXnProperty* leftMarginProp( + iNode.GetPropertyL( XnPropertyNames::texteditor::KEditorMarginLeft ) ); + if( leftMarginProp ) + { + TInt leftValue = iUiEngine->HorizontalPixelValueL( leftMarginProp, + iNode.Rect().Width() ); + margins.iLeft = leftValue; + } + + CXnProperty* rightMarginProp( + iNode.GetPropertyL( XnPropertyNames::texteditor::KEditorMarginRight ) ); + if( rightMarginProp ) + { + TInt rightValue = iUiEngine->HorizontalPixelValueL( rightMarginProp, + iNode.Rect().Width() ); + margins.iRight = rightValue; + } + + CXnProperty* topMarginProp( + iNode.GetPropertyL( XnPropertyNames::texteditor::KEditorMarginTop ) ); + if( topMarginProp ) + { + TInt topValue = iUiEngine->VerticalPixelValueL( topMarginProp, + iNode.Rect().Width() ); + margins.iTop = topValue; + } + + CXnProperty* bottomMarginProp( + iNode.GetPropertyL( XnPropertyNames::texteditor::KEditorMarginBottom ) ); + if( bottomMarginProp ) + { + TInt bottomValue = iUiEngine->VerticalPixelValueL( bottomMarginProp, + iNode.Rect().Width() ); + margins.iBottom = bottomValue; + } + + iEditor->SetBorderViewMargins( margins ); + } + // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/renderingplugins/xntextfactory/src/xntextadapter.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xntextfactory/src/xntextadapter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntextfactory/src/xntextadapter.cpp Wed May 12 13:22:51 2010 +0300 @@ -141,33 +141,45 @@ TInt lineCount( array->Count() ); - buffer = HBufC::NewLC( temp->Length() + ( lineCount - 1 ) ); - - TPtr ptr( buffer->Des() ); - - for( TInt i = 0; i < lineCount; i++ ) + TInt bufLen = temp->Length() + ( lineCount - 1 ); + if ( bufLen > 0 ) { - TPtrC line( array->At( i ) ); - - ptr.Append( line ); + buffer = HBufC::NewLC( bufLen ); - if( i + 1 < lineCount ) + TPtr ptr( buffer->Des() ); + + for( TInt i = 0; i < lineCount; i++ ) { - ptr.Append( '\n' ); - } + TPtrC line( array->At( i ) ); + + ptr.Append( line ); + + if( i + 1 < lineCount ) + { + ptr.Append( '\n' ); + } + } + + CleanupStack::Pop(); + CleanupStack::PopAndDestroy( temp ); + CleanupStack::PushL( buffer ); } - - CleanupStack::Pop(); - CleanupStack::PopAndDestroy( temp ); - CleanupStack::PushL( buffer ); + else + { + CleanupStack::PopAndDestroy( temp ); + } } // The text is already in visual form, no need for conversion conversion = EFalse; - aLabel.SetTextL( *buffer ); - - CleanupStack::PopAndDestroy( 2 ); // buffer, array + if ( buffer ) + { + aLabel.SetTextL( *buffer ); + CleanupStack::PopAndDestroy( buffer ); + } + + CleanupStack::PopAndDestroy(); // array } else { diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/rom/ai3xmluirendering.iby --- a/idlehomescreen/xmluirendering/rom/ai3xmluirendering.iby Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/rom/ai3xmluirendering.iby Wed May 12 13:22:51 2010 +0300 @@ -38,6 +38,7 @@ data=\epoc32\data\z\resource\plugins\xn3volumecontrol.rsc \resource\plugins\xn3volumecontrol.rsc data=\epoc32\data\Z\resource\apps\xnuiengine.rsc APP_RESOURCE_DIR\xnuiengine.rsc +data=\epoc32\data\Z\resource\apps\xnwallpaperview.rsc APP_RESOURCE_DIR\xnwallpaperview.rsc // Stock plugins ECOM_PLUGIN( xn3textfactory.dll , xn3textfactory.rsc ) diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/rom/ai3xmluirendering_resources.iby --- a/idlehomescreen/xmluirendering/rom/ai3xmluirendering_resources.iby Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/rom/ai3xmluirendering_resources.iby Wed May 12 13:22:51 2010 +0300 @@ -23,5 +23,6 @@ #include data=\epoc32\data\Z\resource\apps\xnuiengine.rsc APP_RESOURCE_DIR\xnuiengine.rsc +data=\epoc32\data\Z\resource\apps\xnwallpaperview.rsc APP_RESOURCE_DIR\xnwallpaperview.rsc #endif // XMLUIRENDERINGRESOURCES_IBY diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/bwins/xn3layoutengineu.def --- a/idlehomescreen/xmluirendering/uiengine/bwins/xn3layoutengineu.def Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/bwins/xn3layoutengineu.def Wed May 12 13:22:51 2010 +0300 @@ -11,56 +11,56 @@ ?AppIfL@CXnNodePluginIf@@QAEAAVCXnNodeAppIf@@XZ @ 10 NONAME ; class CXnNodeAppIf & CXnNodePluginIf::AppIfL(void) ??1MXnComponentFactory@@UAE@XZ @ 11 NONAME ; MXnComponentFactory::~MXnComponentFactory(void) ?ParentL@CXnNodePluginIf@@QBEPAV1@XZ @ 12 NONAME ; class CXnNodePluginIf * CXnNodePluginIf::ParentL(void) const - ?EnterPowerSaveModeL@CXnControlAdapter@@QAEXW4TModeEvent@1@@Z @ 13 NONAME ; void CXnControlAdapter::EnterPowerSaveModeL(enum CXnControlAdapter::TModeEvent) - ??0CXnComponentNodeImpl@@IAE@XZ @ 14 NONAME ; CXnComponentNodeImpl::CXnComponentNodeImpl(void) - ?SetLocalUiZoomL@CXnControlAdapter@@UAEXW4TAknUiZoom@@@Z @ 15 NONAME ; void CXnControlAdapter::SetLocalUiZoomL(enum TAknUiZoom) - ?SetDirtyL@CXnNodePluginIf@@QAEXXZ @ 16 NONAME ; void CXnNodePluginIf::SetDirtyL(void) - ?Draw@CXnControlAdapter@@UBEXABVTRect@@AAVCWindowGc@@@Z @ 17 NONAME ; void CXnControlAdapter::Draw(class TRect const &, class CWindowGc &) const - ?ShowTooltipsL@CXnNodeAppIf@@QAEXXZ @ 18 NONAME ; void CXnNodeAppIf::ShowTooltipsL(void) - ?MakeInterfaceL@CXnNodePluginIf@@QAEPAVMXnComponentInterface@XnComponentInterface@@ABVTDesC8@@@Z @ 19 NONAME ; class XnComponentInterface::MXnComponentInterface * CXnNodePluginIf::MakeInterfaceL(class TDesC8 const &) - ?SetBorderRect@CXnNodePluginIf@@QAEXABVTRect@@@Z @ 20 NONAME ; void CXnNodePluginIf::SetBorderRect(class TRect const &) - ?RenderUIL@TXnUiEnginePluginIf@@QAEXPAVCXnNodePluginIf@@@Z @ 21 NONAME ; void TXnUiEnginePluginIf::RenderUIL(class CXnNodePluginIf *) - ?TextAlignment@CXnUtils@@SA?AW4TGulAlignmentValue@@AAVCXnNodePluginIf@@@Z @ 22 NONAME ; enum TGulAlignmentValue CXnUtils::TextAlignment(class CXnNodePluginIf &) - ?Property@CXnProperty@@QAEPAVCXnDomProperty@@XZ @ 23 NONAME ; class CXnDomProperty * CXnProperty::Property(void) - ?Namespace@CXnNodePluginIf@@QAEABVTDesC8@@XZ @ 24 NONAME ; class TDesC8 const & CXnNodePluginIf::Namespace(void) - ?AddDirtyNodeL@TXnUiEnginePluginIf@@QAEXAAVCXnNodePluginIf@@@Z @ 25 NONAME ; void TXnUiEnginePluginIf::AddDirtyNodeL(class CXnNodePluginIf &) - ?SetPropertyL@CXnNodePluginIf@@QAEXPAVCXnProperty@@@Z @ 26 NONAME ; void CXnNodePluginIf::SetPropertyL(class CXnProperty *) - ?HorizontalPixelValueL@TXnUiEnginePluginIf@@QAEHPAVCXnProperty@@H@Z @ 27 NONAME ; int TXnUiEnginePluginIf::HorizontalPixelValueL(class CXnProperty *, int) - ?HandlePowerSaveModeL@CXnUtils@@SAHPAVCXnNode@@HH@Z @ 28 NONAME ; int CXnUtils::HandlePowerSaveModeL(class CXnNode *, int, int) - ?ContentBitmaps@CXnControlAdapter@@QAEXAAPAVCFbsBitmap@@0@Z @ 29 NONAME ; void CXnControlAdapter::ContentBitmaps(class CFbsBitmap * &, class CFbsBitmap * &) - ?HandlePropertyChangeL@CXnControlAdapter@@QAEXPAVCXnProperty@@@Z @ 30 NONAME ; void CXnControlAdapter::HandlePropertyChangeL(class CXnProperty *) - ?FocusHorLoopingL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 31 NONAME ; class CXnProperty * CXnNodePluginIf::FocusHorLoopingL(void) + ?HandleEnterEditModeL@CXnAppUiAdapter@@UAEXH@Z @ 13 NONAME ; void CXnAppUiAdapter::HandleEnterEditModeL(int) + ?EnterPowerSaveModeL@CXnControlAdapter@@QAEXW4TModeEvent@1@@Z @ 14 NONAME ; void CXnControlAdapter::EnterPowerSaveModeL(enum CXnControlAdapter::TModeEvent) + ??0CXnComponentNodeImpl@@IAE@XZ @ 15 NONAME ; CXnComponentNodeImpl::CXnComponentNodeImpl(void) + ?SetLocalUiZoomL@CXnControlAdapter@@UAEXW4TAknUiZoom@@@Z @ 16 NONAME ; void CXnControlAdapter::SetLocalUiZoomL(enum TAknUiZoom) + ?SetDirtyL@CXnNodePluginIf@@QAEXXZ @ 17 NONAME ; void CXnNodePluginIf::SetDirtyL(void) + ?Draw@CXnControlAdapter@@UBEXABVTRect@@AAVCWindowGc@@@Z @ 18 NONAME ; void CXnControlAdapter::Draw(class TRect const &, class CWindowGc &) const + ?ShowTooltipsL@CXnNodeAppIf@@QAEXXZ @ 19 NONAME ; void CXnNodeAppIf::ShowTooltipsL(void) + ?MakeInterfaceL@CXnNodePluginIf@@QAEPAVMXnComponentInterface@XnComponentInterface@@ABVTDesC8@@@Z @ 20 NONAME ; class XnComponentInterface::MXnComponentInterface * CXnNodePluginIf::MakeInterfaceL(class TDesC8 const &) + ?SetBorderRect@CXnNodePluginIf@@QAEXABVTRect@@@Z @ 21 NONAME ; void CXnNodePluginIf::SetBorderRect(class TRect const &) + ?RenderUIL@TXnUiEnginePluginIf@@QAEXPAVCXnNodePluginIf@@@Z @ 22 NONAME ; void TXnUiEnginePluginIf::RenderUIL(class CXnNodePluginIf *) + ?TextAlignment@CXnUtils@@SA?AW4TGulAlignmentValue@@AAVCXnNodePluginIf@@@Z @ 23 NONAME ; enum TGulAlignmentValue CXnUtils::TextAlignment(class CXnNodePluginIf &) + ?Property@CXnProperty@@QAEPAVCXnDomProperty@@XZ @ 24 NONAME ; class CXnDomProperty * CXnProperty::Property(void) + ?Namespace@CXnNodePluginIf@@QAEABVTDesC8@@XZ @ 25 NONAME ; class TDesC8 const & CXnNodePluginIf::Namespace(void) + ?AddDirtyNodeL@TXnUiEnginePluginIf@@QAEXAAVCXnNodePluginIf@@@Z @ 26 NONAME ; void TXnUiEnginePluginIf::AddDirtyNodeL(class CXnNodePluginIf &) + ?SetPropertyL@CXnNodePluginIf@@QAEXPAVCXnProperty@@@Z @ 27 NONAME ; void CXnNodePluginIf::SetPropertyL(class CXnProperty *) + ?HorizontalPixelValueL@TXnUiEnginePluginIf@@QAEHPAVCXnProperty@@H@Z @ 28 NONAME ; int TXnUiEnginePluginIf::HorizontalPixelValueL(class CXnProperty *, int) + ?HandlePowerSaveModeL@CXnUtils@@SAHPAVCXnNode@@HH@Z @ 29 NONAME ; int CXnUtils::HandlePowerSaveModeL(class CXnNode *, int, int) + ?ContentBitmaps@CXnControlAdapter@@QAEXAAPAVCFbsBitmap@@0@Z @ 30 NONAME ; void CXnControlAdapter::ContentBitmaps(class CFbsBitmap * &, class CFbsBitmap * &) + ?HandlePropertyChangeL@CXnControlAdapter@@QAEXPAVCXnProperty@@@Z @ 31 NONAME ; void CXnControlAdapter::HandlePropertyChangeL(class CXnProperty *) ?Control@CXnNodePluginIf@@QBEPAVCXnControlAdapter@@XZ @ 32 NONAME ; class CXnControlAdapter * CXnNodePluginIf::Control(void) const - ?GetPropertyL@CXnNodeAppIf@@QBEPAVCXnProperty@@AAV2@@Z @ 33 NONAME ; class CXnProperty * CXnNodeAppIf::GetPropertyL(class CXnProperty &) const - ?MakeInterfaceL@CXnComponentNodeImpl@@UAEPAVMXnComponentInterface@XnComponentInterface@@ABVTDesC8@@@Z @ 34 NONAME ; class XnComponentInterface::MXnComponentInterface * CXnComponentNodeImpl::MakeInterfaceL(class TDesC8 const &) - ?SkinChanged@CXnControlAdapter@@UAEXXZ @ 35 NONAME ; void CXnControlAdapter::SkinChanged(void) - ?SetContentBitmaps@CXnControlAdapter@@QAEXPAVCFbsBitmap@@0@Z @ 36 NONAME ; void CXnControlAdapter::SetContentBitmaps(class CFbsBitmap *, class CFbsBitmap *) - ?FindNodeByClassL@TXnUiEngineAppIf@@QAE?AV?$RPointerArray@VCXnNodeAppIf@@@@ABVTDesC16@@0@Z @ 37 NONAME ; class RPointerArray TXnUiEngineAppIf::FindNodeByClassL(class TDesC16 const &, class TDesC16 const &) - ?ComponentNodeImpl@CXnNodePluginIf@@QAEPAVCXnComponentNodeImpl@@XZ @ 38 NONAME ; class CXnComponentNodeImpl * CXnNodePluginIf::ComponentNodeImpl(void) - ??0CXnViewsNodeImpl@@IAE@XZ @ 39 NONAME ; CXnViewsNodeImpl::CXnViewsNodeImpl(void) - ?HandlePointerEventL@CXnControlAdapter@@UAEXABUTPointerEvent@@@Z @ 40 NONAME ; void CXnControlAdapter::HandlePointerEventL(struct TPointerEvent const &) - ??1CXnDocument@@UAE@XZ @ 41 NONAME ; CXnDocument::~CXnDocument(void) - ?HandleResourceChangeL@CXnAppUiAdapter@@MAEXH@Z @ 42 NONAME ; void CXnAppUiAdapter::HandleResourceChangeL(int) - ?DoEnterPowerSaveModeL@CXnControlAdapter@@UAEXW4TModeEvent@1@@Z @ 43 NONAME ; void CXnControlAdapter::DoEnterPowerSaveModeL(enum CXnControlAdapter::TModeEvent) - ?CloneL@CXnProperty@@QAEPAV1@XZ @ 44 NONAME ; class CXnProperty * CXnProperty::CloneL(void) - ?ReportTriggerEventL@CXnNodePluginIf@@QAEXABVTDesC8@@00@Z @ 45 NONAME ; void CXnNodePluginIf::ReportTriggerEventL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &) - ?FocusedNodeL@TXnUiEnginePluginIf@@QAEPAVCXnNodePluginIf@@XZ @ 46 NONAME ; class CXnNodePluginIf * TXnUiEnginePluginIf::FocusedNodeL(void) - ?FindContentSourceNodesL@TXnUiEngineAppIf@@QAE?AV?$RPointerArray@VCXnNodeAppIf@@@@ABVTDesC8@@@Z @ 47 NONAME ; class RPointerArray TXnUiEngineAppIf::FindContentSourceNodesL(class TDesC8 const &) - ?EqualsL@CXnProperty@@QBEHAAV1@@Z @ 48 NONAME ; int CXnProperty::EqualsL(class CXnProperty &) const - ?ScreenDeviceSize@TXnUiEnginePluginIf@@QAE?AVTSize@@XZ @ 49 NONAME ; class TSize TXnUiEnginePluginIf::ScreenDeviceSize(void) - ??0CXnControlAdapter@@IAE@XZ @ 50 NONAME ; CXnControlAdapter::CXnControlAdapter(void) - ?VisibleRowsL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 51 NONAME ; class CXnProperty * CXnNodePluginIf::VisibleRowsL(void) - ?UiEngineL@CXnNodeAppIf@@QAEPAVTXnUiEngineAppIf@@XZ @ 52 NONAME ; class TXnUiEngineAppIf * CXnNodeAppIf::UiEngineL(void) - ?LongTapDetector@CXnControlAdapter@@QBEPAVCAknLongTapDetector@@XZ @ 53 NONAME ; class CAknLongTapDetector * CXnControlAdapter::LongTapDetector(void) const - ??0CXnAppUiAdapter@@QAE@VTUid@@@Z @ 54 NONAME ; CXnAppUiAdapter::CXnAppUiAdapter(class TUid) - ?Rect@CXnNodePluginIf@@QAE?AVTRect@@XZ @ 55 NONAME ; class TRect CXnNodePluginIf::Rect(void) - ?AddChildL@CXnNodePluginIf@@QAEXPAV1@@Z @ 56 NONAME ; void CXnNodePluginIf::AddChildL(class CXnNodePluginIf *) - ?SetNode@CXnComponent@@QAEXAAVCXnNodePluginIf@@@Z @ 57 NONAME ; void CXnComponent::SetNode(class CXnNodePluginIf &) - ?ResetStylusCounter@CXnControlAdapter@@QAEXXZ @ 58 NONAME ; void CXnControlAdapter::ResetStylusCounter(void) - ?SetComponent@CXnComponentNodeImpl@@QAEXPAVCXnComponent@@@Z @ 59 NONAME ; void CXnComponentNodeImpl::SetComponent(class CXnComponent *) - ?LayoutUIL@TXnUiEnginePluginIf@@QAEXPAVCXnNodePluginIf@@@Z @ 60 NONAME ; void TXnUiEnginePluginIf::LayoutUIL(class CXnNodePluginIf *) - ?LoadDataPluginsL@CXnAppUiAdapter@@UAEXAAV?$RPointerArray@VCXnNodeAppIf@@@@@Z @ 61 NONAME ; void CXnAppUiAdapter::LoadDataPluginsL(class RPointerArray &) - ?FocusVisible@TXnUiEnginePluginIf@@QAEHXZ @ 62 NONAME ; int TXnUiEnginePluginIf::FocusVisible(void) + ?DestroyPublisher@CXnAppUiAdapter@@UAEHAAVCXnNodeAppIf@@H@Z @ 33 NONAME ; int CXnAppUiAdapter::DestroyPublisher(class CXnNodeAppIf &, int) + ?GetPropertyL@CXnNodeAppIf@@QBEPAVCXnProperty@@AAV2@@Z @ 34 NONAME ; class CXnProperty * CXnNodeAppIf::GetPropertyL(class CXnProperty &) const + ?MakeInterfaceL@CXnComponentNodeImpl@@UAEPAVMXnComponentInterface@XnComponentInterface@@ABVTDesC8@@@Z @ 35 NONAME ; class XnComponentInterface::MXnComponentInterface * CXnComponentNodeImpl::MakeInterfaceL(class TDesC8 const &) + ?SkinChanged@CXnControlAdapter@@UAEXXZ @ 36 NONAME ; void CXnControlAdapter::SkinChanged(void) + ?SetContentBitmaps@CXnControlAdapter@@QAEXPAVCFbsBitmap@@0@Z @ 37 NONAME ; void CXnControlAdapter::SetContentBitmaps(class CFbsBitmap *, class CFbsBitmap *) + ?FindNodeByClassL@TXnUiEngineAppIf@@QAE?AV?$RPointerArray@VCXnNodeAppIf@@@@ABVTDesC16@@0@Z @ 38 NONAME ; class RPointerArray TXnUiEngineAppIf::FindNodeByClassL(class TDesC16 const &, class TDesC16 const &) + ?SetDataL@CXnControlAdapter@@UAEXABVTDesC8@@ABVTDesC16@@H@Z @ 39 NONAME ; void CXnControlAdapter::SetDataL(class TDesC8 const &, class TDesC16 const &, int) + ?ComponentNodeImpl@CXnNodePluginIf@@QAEPAVCXnComponentNodeImpl@@XZ @ 40 NONAME ; class CXnComponentNodeImpl * CXnNodePluginIf::ComponentNodeImpl(void) + ??0CXnViewsNodeImpl@@IAE@XZ @ 41 NONAME ; CXnViewsNodeImpl::CXnViewsNodeImpl(void) + ?IsTextEditorActive@TXnUiEnginePluginIf@@QAEHXZ @ 42 NONAME ; int TXnUiEnginePluginIf::IsTextEditorActive(void) + ?HandlePointerEventL@CXnControlAdapter@@UAEXABUTPointerEvent@@@Z @ 43 NONAME ; void CXnControlAdapter::HandlePointerEventL(struct TPointerEvent const &) + ??1CXnDocument@@UAE@XZ @ 44 NONAME ; CXnDocument::~CXnDocument(void) + ?HandleResourceChangeL@CXnAppUiAdapter@@MAEXH@Z @ 45 NONAME ; void CXnAppUiAdapter::HandleResourceChangeL(int) + ?DoEnterPowerSaveModeL@CXnControlAdapter@@UAEXW4TModeEvent@1@@Z @ 46 NONAME ; void CXnControlAdapter::DoEnterPowerSaveModeL(enum CXnControlAdapter::TModeEvent) + ?CloneL@CXnProperty@@QAEPAV1@XZ @ 47 NONAME ; class CXnProperty * CXnProperty::CloneL(void) + ?ReportTriggerEventL@CXnNodePluginIf@@QAEXABVTDesC8@@00@Z @ 48 NONAME ; void CXnNodePluginIf::ReportTriggerEventL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &) + ?FocusedNodeL@TXnUiEnginePluginIf@@QAEPAVCXnNodePluginIf@@XZ @ 49 NONAME ; class CXnNodePluginIf * TXnUiEnginePluginIf::FocusedNodeL(void) + ?FindContentSourceNodesL@TXnUiEngineAppIf@@QAE?AV?$RPointerArray@VCXnNodeAppIf@@@@ABVTDesC8@@@Z @ 50 NONAME ; class RPointerArray TXnUiEngineAppIf::FindContentSourceNodesL(class TDesC8 const &) + ?EqualsL@CXnProperty@@QBEHAAV1@@Z @ 51 NONAME ; int CXnProperty::EqualsL(class CXnProperty &) const + ?ScreenDeviceSize@TXnUiEnginePluginIf@@QAE?AVTSize@@XZ @ 52 NONAME ; class TSize TXnUiEnginePluginIf::ScreenDeviceSize(void) + ??0CXnControlAdapter@@IAE@XZ @ 53 NONAME ; CXnControlAdapter::CXnControlAdapter(void) + ?UiEngineL@CXnNodeAppIf@@QAEPAVTXnUiEngineAppIf@@XZ @ 54 NONAME ; class TXnUiEngineAppIf * CXnNodeAppIf::UiEngineL(void) + ?LongTapDetector@CXnControlAdapter@@QBEPAVCAknLongTapDetector@@XZ @ 55 NONAME ; class CAknLongTapDetector * CXnControlAdapter::LongTapDetector(void) const + ??0CXnAppUiAdapter@@QAE@VTUid@@@Z @ 56 NONAME ; CXnAppUiAdapter::CXnAppUiAdapter(class TUid) + ?Rect@CXnNodePluginIf@@QAE?AVTRect@@XZ @ 57 NONAME ; class TRect CXnNodePluginIf::Rect(void) + ?AddChildL@CXnNodePluginIf@@QAEXPAV1@@Z @ 58 NONAME ; void CXnNodePluginIf::AddChildL(class CXnNodePluginIf *) + ?SetNode@CXnComponent@@QAEXAAVCXnNodePluginIf@@@Z @ 59 NONAME ; void CXnComponent::SetNode(class CXnNodePluginIf &) + ?ResetStylusCounter@CXnControlAdapter@@QAEXXZ @ 60 NONAME ; void CXnControlAdapter::ResetStylusCounter(void) + ?SetComponent@CXnComponentNodeImpl@@QAEXPAVCXnComponent@@@Z @ 61 NONAME ; void CXnComponentNodeImpl::SetComponent(class CXnComponent *) + ?LayoutUIL@TXnUiEnginePluginIf@@QAEXPAVCXnNodePluginIf@@@Z @ 62 NONAME ; void TXnUiEnginePluginIf::LayoutUIL(class CXnNodePluginIf *) ?ExitPowerSaveModeL@CXnControlAdapter@@QAEXW4TModeEvent@1@@Z @ 63 NONAME ; void CXnControlAdapter::ExitPowerSaveModeL(enum CXnControlAdapter::TModeEvent) ?GetThemeResource@TXnUiEngineAppIf@@QAEHABVTDesC16@@AAVRFile@@@Z @ 64 NONAME ; int TXnUiEngineAppIf::GetThemeResource(class TDesC16 const &, class RFile &) ?ConstructL@CXnComponent@@IAEXXZ @ 65 NONAME ; void CXnComponent::ConstructL(void) @@ -69,171 +69,159 @@ ?Uid@CXnDocument@@QAE?AVTUid@@XZ @ 68 NONAME ; class TUid CXnDocument::Uid(void) ?FocusChanged@CXnControlAdapter@@UAEXW4TDrawNow@@@Z @ 69 NONAME ; void CXnControlAdapter::FocusChanged(enum TDrawNow) ?SetBlank@CXnControlAdapter@@QAEXH@Z @ 70 NONAME ; void CXnControlAdapter::SetBlank(int) - ?SetLayoutCapable@CXnNodePluginIf@@QAEXH@Z @ 71 NONAME ; void CXnNodePluginIf::SetLayoutCapable(int) - ?MarginRect@CXnNodePluginIf@@QAE?AVTRect@@XZ @ 72 NONAME ; class TRect CXnNodePluginIf::MarginRect(void) - ?UiEngineL@CXnAppUiAdapter@@QAEPAVTXnUiEngineAppIf@@XZ @ 73 NONAME ; class TXnUiEngineAppIf * CXnAppUiAdapter::UiEngineL(void) - ?SwipeEnabledL@TXnUiEnginePluginIf@@QAEHXZ @ 74 NONAME ; int TXnUiEnginePluginIf::SwipeEnabledL(void) - ?SetFocusVisibleL@TXnUiEnginePluginIf@@QAEXH@Z @ 75 NONAME ; void TXnUiEnginePluginIf::SetFocusVisibleL(int) + ?ProcessMessageL@CXnAppUiAdapter@@UAEXVTUid@@ABVTDesC8@@@Z @ 71 NONAME ; void CXnAppUiAdapter::ProcessMessageL(class TUid, class TDesC8 const &) + ?Component@CXnNodeAppIf@@QAEAAVCXnComponent@@XZ @ 72 NONAME ; class CXnComponent & CXnNodeAppIf::Component(void) + ?SetLayoutCapable@CXnNodePluginIf@@QAEXH@Z @ 73 NONAME ; void CXnNodePluginIf::SetLayoutCapable(int) + ?MarginRect@CXnNodePluginIf@@QAE?AVTRect@@XZ @ 74 NONAME ; class TRect CXnNodePluginIf::MarginRect(void) + ?UiEngineL@CXnAppUiAdapter@@QAEPAVTXnUiEngineAppIf@@XZ @ 75 NONAME ; class TXnUiEngineAppIf * CXnAppUiAdapter::UiEngineL(void) ?ActiveView@TXnUiEngineAppIf@@QAEPAVCXnNodeAppIf@@XZ @ 76 NONAME ; class CXnNodeAppIf * TXnUiEngineAppIf::ActiveView(void) - ?GridOrientationL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 77 NONAME ; class CXnProperty * CXnNodePluginIf::GridOrientationL(void) - ?HandleXuikonEventL@CXnAppUiAdapter@@UAEXAAVCXnNodeAppIf@@0AAVCXnDomNode@@1@Z @ 78 NONAME ; void CXnAppUiAdapter::HandleXuikonEventL(class CXnNodeAppIf &, class CXnNodeAppIf &, class CXnDomNode &, class CXnDomNode &) - ?RenderUIL@TXnUiEngineAppIf@@QAEXPAVCXnNodeAppIf@@@Z @ 79 NONAME ; void TXnUiEngineAppIf::RenderUIL(class CXnNodeAppIf *) + ?HandleXuikonEventL@CXnAppUiAdapter@@UAEXAAVCXnNodeAppIf@@0AAVCXnDomNode@@1@Z @ 77 NONAME ; void CXnAppUiAdapter::HandleXuikonEventL(class CXnNodeAppIf &, class CXnNodeAppIf &, class CXnDomNode &, class CXnDomNode &) + ?RenderUIL@TXnUiEngineAppIf@@QAEXPAVCXnNodeAppIf@@@Z @ 78 NONAME ; void TXnUiEngineAppIf::RenderUIL(class CXnNodeAppIf *) + ?PrepareToExit@CXnAppUiAdapter@@MAEXXZ @ 79 NONAME ; void CXnAppUiAdapter::PrepareToExit(void) ?DoHandlePropertyChangeL@CXnControlAdapter@@UAEXPAVCXnProperty@@@Z @ 80 NONAME ; void CXnControlAdapter::DoHandlePropertyChangeL(class CXnProperty *) ?ConstructL@CXnControlAdapter@@IAEXAAVCXnNodePluginIf@@@Z @ 81 NONAME ; void CXnControlAdapter::ConstructL(class CXnNodePluginIf &) ?FocusedNode@TXnUiEngineAppIf@@QAEPAVCXnNodeAppIf@@XZ @ 82 NONAME ; class CXnNodeAppIf * TXnUiEngineAppIf::FocusedNode(void) - ?OfferKeyEventL@CXnControlAdapter@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 83 NONAME ; enum TKeyResponse CXnControlAdapter::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode) - ?IsDrawingAllowed@CXnControlAdapter@@QBEHXZ @ 84 NONAME ; int CXnControlAdapter::IsDrawingAllowed(void) const - ?DisplayL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 85 NONAME ; class CXnProperty * CXnNodePluginIf::DisplayL(void) - ?NewL@CXnProperty@@SAPAV1@ABVTDesC8@@PAVCXnDomPropertyValue@@AAVCXnDomStringPool@@@Z @ 86 NONAME ; class CXnProperty * CXnProperty::NewL(class TDesC8 const &, class CXnDomPropertyValue *, class CXnDomStringPool &) - ?Rect@CXnNodeAppIf@@QAE?AVTRect@@XZ @ 87 NONAME ; class TRect CXnNodeAppIf::Rect(void) - ?NewL@CXnComponentNodeImpl@@SAPAV1@PAVCXnType@@@Z @ 88 NONAME ; class CXnComponentNodeImpl * CXnComponentNodeImpl::NewL(class CXnType *) - ?GridVerDirectionL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 89 NONAME ; class CXnProperty * CXnNodePluginIf::GridVerDirectionL(void) + ?SetDataL@CXnComponent@@QAEXABVTDesC8@@ABVTDesC16@@H@Z @ 83 NONAME ; void CXnComponent::SetDataL(class TDesC8 const &, class TDesC16 const &, int) + ?OfferKeyEventL@CXnControlAdapter@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 84 NONAME ; enum TKeyResponse CXnControlAdapter::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode) + ?IsDrawingAllowed@CXnControlAdapter@@QBEHXZ @ 85 NONAME ; int CXnControlAdapter::IsDrawingAllowed(void) const + ?DisplayL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 86 NONAME ; class CXnProperty * CXnNodePluginIf::DisplayL(void) + ?NewL@CXnProperty@@SAPAV1@ABVTDesC8@@PAVCXnDomPropertyValue@@AAVCXnDomStringPool@@@Z @ 87 NONAME ; class CXnProperty * CXnProperty::NewL(class TDesC8 const &, class CXnDomPropertyValue *, class CXnDomStringPool &) + ?Rect@CXnNodeAppIf@@QAE?AVTRect@@XZ @ 88 NONAME ; class TRect CXnNodeAppIf::Rect(void) + ?NewL@CXnComponentNodeImpl@@SAPAV1@PAVCXnType@@@Z @ 89 NONAME ; class CXnComponentNodeImpl * CXnComponentNodeImpl::NewL(class CXnType *) ?WidgetsVisible@TXnUiEngineAppIf@@QBEHXZ @ 90 NONAME ; int TXnUiEngineAppIf::WidgetsVisible(void) const ?Type@CXnNodePluginIf@@QAEPAVCXnType@@XZ @ 91 NONAME ; class CXnType * CXnNodePluginIf::Type(void) ?MakeXnComponentL@MXnComponentFactory@@EAE?AW4TXnComponentFactoryResponse@1@AAVCXnNodePluginIf@@AAPAVCXnComponent@@@Z @ 92 NONAME ; enum MXnComponentFactory::TXnComponentFactoryResponse MXnComponentFactory::MakeXnComponentL(class CXnNodePluginIf &, class CXnComponent * &) - ?ActivateViewL@TXnUiEngineAppIf@@QAEXAAVCXnNodeAppIf@@@Z @ 93 NONAME ; void TXnUiEngineAppIf::ActivateViewL(class CXnNodeAppIf &) - ?UnsetStateL@CXnNodePluginIf@@QAEXABVTDesC8@@@Z @ 94 NONAME ; void CXnNodePluginIf::UnsetStateL(class TDesC8 const &) - ?StringValueL@CXnProperty@@QAEPAVHBufC16@@XZ @ 95 NONAME ; class HBufC16 * CXnProperty::StringValueL(void) - ?DisableRenderUiLC@TXnUiEnginePluginIf@@QAEXXZ @ 96 NONAME ; void TXnUiEnginePluginIf::DisableRenderUiLC(void) - ?SetPropertyL@CXnNodeAppIf@@QAEXPAVCXnProperty@@@Z @ 97 NONAME ; void CXnNodeAppIf::SetPropertyL(class CXnProperty *) - ?View@CXnAppUiAdapter@@QBEAAVCAknView@@XZ @ 98 NONAME ; class CAknView & CXnAppUiAdapter::View(void) const - ?ViewNodeImpl@CXnNodePluginIf@@QAEPAVCXnViewNodeImpl@@XZ @ 99 NONAME ; class CXnViewNodeImpl * CXnNodePluginIf::ViewNodeImpl(void) - ?StripQuotes@CXnUtils@@SAXAAPAVHBufC16@@@Z @ 100 NONAME ; void CXnUtils::StripQuotes(class HBufC16 * &) - ?SetPCDataL@CXnNodePluginIf@@QAEXABVTDesC8@@@Z @ 101 NONAME ; void CXnNodePluginIf::SetPCDataL(class TDesC8 const &) - ?DestroyDataPluginsL@CXnAppUiAdapter@@UAEXAAV?$RPointerArray@VCXnNodeAppIf@@@@@Z @ 102 NONAME ; void CXnAppUiAdapter::DestroyDataPluginsL(class RPointerArray &) - ?VisibilityL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 103 NONAME ; class CXnProperty * CXnNodePluginIf::VisibilityL(void) - ?Draw@CXnControlAdapter@@MBEXABVTRect@@@Z @ 104 NONAME ; void CXnControlAdapter::Draw(class TRect const &) const - ??1CXnApplication@@UAE@XZ @ 105 NONAME ; CXnApplication::~CXnApplication(void) - ?DoesNodeNeedComponentImplL@MXnComponentFactory@@QAEHABVTDesC8@@@Z @ 106 NONAME ; int MXnComponentFactory::DoesNodeNeedComponentImplL(class TDesC8 const &) - ?ConstructL@CXnViewsNodeImpl@@IAEXPAVCXnType@@@Z @ 107 NONAME ; void CXnViewsNodeImpl::ConstructL(class CXnType *) - ?StringPool@TXnUiEngineAppIf@@QAEAAVCXnDomStringPool@@XZ @ 108 NONAME ; class CXnDomStringPool & TXnUiEngineAppIf::StringPool(void) - ?UiEngineL@CXnNodePluginIf@@QAEPAVTXnUiEnginePluginIf@@XZ @ 109 NONAME ; class TXnUiEnginePluginIf * CXnNodePluginIf::UiEngineL(void) - ?ShowFocus@TXnUiEnginePluginIf@@QAEHXZ @ 110 NONAME ; int TXnUiEnginePluginIf::ShowFocus(void) - ?ResolveSkinItemIDL@CXnUtils@@SAHABVTDesC16@@AAVTAknsItemID@@@Z @ 111 NONAME ; int CXnUtils::ResolveSkinItemIDL(class TDesC16 const &, class TAknsItemID &) - ?PluginNodeL@TXnUiEnginePluginIf@@QAEAAVCXnNodePluginIf@@PAV2@@Z @ 112 NONAME ; class CXnNodePluginIf & TXnUiEnginePluginIf::PluginNodeL(class CXnNodePluginIf *) - ?VerticalPixelValueL@TXnUiEnginePluginIf@@QAEHPAVCXnProperty@@H@Z @ 113 NONAME ; int TXnUiEnginePluginIf::VerticalPixelValueL(class CXnProperty *, int) - ?SetComponent@CXnControlAdapter@@QAEXPAVCXnComponent@@@Z @ 114 NONAME ; void CXnControlAdapter::SetComponent(class CXnComponent *) - ??0MXnNodePredicate@@QAE@XZ @ 115 NONAME ; MXnNodePredicate::MXnNodePredicate(void) - ??1CXnViewsNodeImpl@@UAE@XZ @ 116 NONAME ; CXnViewsNodeImpl::~CXnViewsNodeImpl(void) - ?HandleControlEventL@CXnControlAdapter@@UAEXPAVCCoeControl@@W4TCoeEvent@MCoeControlObserver@@@Z @ 117 NONAME ; void CXnControlAdapter::HandleControlEventL(class CCoeControl *, enum MCoeControlObserver::TCoeEvent) - ?ActivateViewL@TXnUiEnginePluginIf@@QAEXAAVCXnNodePluginIf@@@Z @ 118 NONAME ; void TXnUiEnginePluginIf::ActivateViewL(class CXnNodePluginIf &) - ?HandleScreenDeviceChangedL@CXnControlAdapter@@UAEXXZ @ 119 NONAME ; void CXnControlAdapter::HandleScreenDeviceChangedL(void) - ?SizeChanged@CXnControlAdapter@@MAEXXZ @ 120 NONAME ; void CXnControlAdapter::SizeChanged(void) - ?CountComponentControls@CXnControlAdapter@@MBEHXZ @ 121 NONAME ; int CXnControlAdapter::CountComponentControls(void) const - ?HideTooltipsL@CXnNodeAppIf@@QAEXXZ @ 122 NONAME ; void CXnNodeAppIf::HideTooltipsL(void) - ?GetPropertyL@CXnNodeAppIf@@QBEPAVCXnProperty@@ABVTDesC8@@@Z @ 123 NONAME ; class CXnProperty * CXnNodeAppIf::GetPropertyL(class TDesC8 const &) const - ?GridScrollBarWidthL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 124 NONAME ; class CXnProperty * CXnNodePluginIf::GridScrollBarWidthL(void) - ?DeactivateFocusedNodeL@TXnUiEnginePluginIf@@QAEXXZ @ 125 NONAME ; void TXnUiEnginePluginIf::DeactivateFocusedNodeL(void) - ?FindNodeByClassL@TXnUiEngineAppIf@@QAE?AV?$RPointerArray@VCXnNodeAppIf@@@@ABVTDesC8@@0@Z @ 126 NONAME ; class RPointerArray TXnUiEngineAppIf::FindNodeByClassL(class TDesC8 const &, class TDesC8 const &) - ?Match@MXnNodePredicate@@UAEHAAVCXnNode@@@Z @ 127 NONAME ; int MXnNodePredicate::Match(class CXnNode &) - ?GetBitmapAndMask@CXnControlAdapter@@QAEXABVTDesC16@@0AAPAVCFbsBitmap@@1@Z @ 128 NONAME ; void CXnControlAdapter::GetBitmapAndMask(class TDesC16 const &, class TDesC16 const &, class CFbsBitmap * &, class CFbsBitmap * &) - ?NewL@CXnViewsNodeImpl@@SAPAV1@PAVCXnType@@@Z @ 129 NONAME ; class CXnViewsNodeImpl * CXnViewsNodeImpl::NewL(class CXnType *) - ?PaddingRect@CXnNodeAppIf@@QAE?AVTRect@@XZ @ 130 NONAME ; class TRect CXnNodeAppIf::PaddingRect(void) - ?SetMarginRect@CXnNodePluginIf@@QAEXABVTRect@@@Z @ 131 NONAME ; void CXnNodePluginIf::SetMarginRect(class TRect const &) - ?IsDialogDisplaying@TXnUiEnginePluginIf@@QAEHXZ @ 132 NONAME ; int TXnUiEnginePluginIf::IsDialogDisplaying(void) - ?GetPropertyL@CXnNodePluginIf@@QBEPAVCXnProperty@@ABVTDesC8@@@Z @ 133 NONAME ; class CXnProperty * CXnNodePluginIf::GetPropertyL(class TDesC8 const &) const - ?SetPropertyArrayL@CXnNodeAppIf@@QAEXPAV?$RPointerArray@VCXnProperty@@@@@Z @ 134 NONAME ; void CXnNodeAppIf::SetPropertyArrayL(class RPointerArray *) - ?RestorePreviousFocusedNode@TXnUiEnginePluginIf@@QAEXXZ @ 135 NONAME ; void TXnUiEnginePluginIf::RestorePreviousFocusedNode(void) - ?EnterPowerSaveModeL@CXnComponent@@UAEXXZ @ 136 NONAME ; void CXnComponent::EnterPowerSaveModeL(void) - ?SetRect@CXnNodePluginIf@@QAEXABVTRect@@@Z @ 137 NONAME ; void CXnNodePluginIf::SetRect(class TRect const &) - ??0CXnComponent@@IAE@XZ @ 138 NONAME ; CXnComponent::CXnComponent(void) - ?CollapseWhiteSpace@CXnUtils@@SAXAAVCXnNodePluginIf@@AAVTDes16@@@Z @ 139 NONAME ; void CXnUtils::CollapseWhiteSpace(class CXnNodePluginIf &, class TDes16 &) - ?SetHandleTooltip@CXnNodePluginIf@@QAEXH@Z @ 140 NONAME ; void CXnNodePluginIf::SetHandleTooltip(int) - ??1CXnAppUiAdapter@@UAE@XZ @ 141 NONAME ; CXnAppUiAdapter::~CXnAppUiAdapter(void) - ?SetOnlineStateL@CXnAppUiAdapter@@UAEXAAV?$RPointerArray@VCXnNodeAppIf@@@@@Z @ 142 NONAME ; void CXnAppUiAdapter::SetOnlineStateL(class RPointerArray &) - ?NewL@CXnControlAdapter@@SAPAV1@AAVCXnNodePluginIf@@@Z @ 143 NONAME ; class CXnControlAdapter * CXnControlAdapter::NewL(class CXnNodePluginIf &) - ?EnableLongTapAnimation@CXnControlAdapter@@QAEXH@Z @ 144 NONAME ; void CXnControlAdapter::EnableLongTapAnimation(int) - ?RefL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 145 NONAME ; class CXnProperty * CXnNodePluginIf::RefL(void) - ?SetPaddingRect@CXnNodePluginIf@@QAEXABVTRect@@@Z @ 146 NONAME ; void CXnNodePluginIf::SetPaddingRect(class TRect const &) - ?FocusVerLoopingL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 147 NONAME ; class CXnProperty * CXnNodePluginIf::FocusVerLoopingL(void) - ?SetFocusedNode@TXnUiEnginePluginIf@@QAEXPAVCXnNodePluginIf@@@Z @ 148 NONAME ; void TXnUiEnginePluginIf::SetFocusedNode(class CXnNodePluginIf *) - ?ExitPowerSaveModeL@CXnComponent@@UAEXXZ @ 149 NONAME ; void CXnComponent::ExitPowerSaveModeL(void) - ?EnableSwipeL@TXnUiEnginePluginIf@@QAEXH@Z @ 150 NONAME ; void TXnUiEnginePluginIf::EnableSwipeL(int) - ?GetPCData@CXnNodeAppIf@@QBEABVTDesC8@@XZ @ 151 NONAME ; class TDesC8 const & CXnNodeAppIf::GetPCData(void) const - ?Namespace@CXnNodeAppIf@@QAEABVTDesC8@@XZ @ 152 NONAME ; class TDesC8 const & CXnNodeAppIf::Namespace(void) - ??1CXnComponentNodeImpl@@UAE@XZ @ 153 NONAME ; CXnComponentNodeImpl::~CXnComponentNodeImpl(void) - ?SetPropertyWithoutNotificationL@CXnNodePluginIf@@QAEXPAVCXnProperty@@@Z @ 154 NONAME ; void CXnNodePluginIf::SetPropertyWithoutNotificationL(class CXnProperty *) - ?GetPCData@CXnNodePluginIf@@QBEABVTDesC8@@XZ @ 155 NONAME ; class TDesC8 const & CXnNodePluginIf::GetPCData(void) const - ?SetPCDataL@CXnNodeAppIf@@QAEXABVTDesC8@@@Z @ 156 NONAME ; void CXnNodeAppIf::SetPCDataL(class TDesC8 const &) - ?Resources@TXnUiEnginePluginIf@@QAEAAV?$CArrayPtrSeg@VCXnResource@@@@XZ @ 157 NONAME ; class CArrayPtrSeg & TXnUiEnginePluginIf::Resources(void) - ?SetContentBitmaps@CXnControlAdapter@@QAEXABVTDesC16@@0@Z @ 158 NONAME ; void CXnControlAdapter::SetContentBitmaps(class TDesC16 const &, class TDesC16 const &) - ??1CXnControlAdapter@@UAE@XZ @ 159 NONAME ; CXnControlAdapter::~CXnControlAdapter(void) - ??1MXnNodePredicate@@UAE@XZ @ 160 NONAME ; MXnNodePredicate::~MXnNodePredicate(void) - ?HorizontalTwipValueL@TXnUiEnginePluginIf@@QAEHPAVCXnProperty@@H@Z @ 161 NONAME ; int TXnUiEnginePluginIf::HorizontalTwipValueL(class CXnProperty *, int) - ?ConstructL@CXnAppUiAdapter@@UAEXXZ @ 162 NONAME ; void CXnAppUiAdapter::ConstructL(void) - ?CreateFontL@CXnUtils@@SAXAAVCXnNodePluginIf@@AAPAVCFont@@AAH@Z @ 163 NONAME ; void CXnUtils::CreateFontL(class CXnNodePluginIf &, class CFont * &, int &) - ??0CXnApplication@@QAE@VTUid@@@Z @ 164 NONAME ; CXnApplication::CXnApplication(class TUid) - ?ComponentControl@CXnControlAdapter@@MBEPAVCCoeControl@@H@Z @ 165 NONAME ; class CCoeControl * CXnControlAdapter::ComponentControl(int) const - ?HandlePageSwitch@CXnAppUiAdapter@@UAEXXZ @ 166 NONAME ; void CXnAppUiAdapter::HandlePageSwitch(void) - ?HandleLongTapEventL@CXnControlAdapter@@UAEXABVTPoint@@0@Z @ 167 NONAME ; void CXnControlAdapter::HandleLongTapEventL(class TPoint const &, class TPoint const &) - ?ParentL@CXnNodeAppIf@@QBEPAV1@XZ @ 168 NONAME ; class CXnNodeAppIf * CXnNodeAppIf::ParentL(void) const - ??1CXnComponent@@UAE@XZ @ 169 NONAME ; CXnComponent::~CXnComponent(void) - ?ControlAdapter@CXnComponent@@QAEPAVCXnControlAdapter@@XZ @ 170 NONAME ; class CXnControlAdapter * CXnComponent::ControlAdapter(void) - ?DrawContentImage@CXnControlAdapter@@IBEXXZ @ 171 NONAME ; void CXnControlAdapter::DrawContentImage(void) const - ?Component@CXnComponentNodeImpl@@QAEPAVCXnComponent@@XZ @ 172 NONAME ; class CXnComponent * CXnComponentNodeImpl::Component(void) - ?GridScrollBarMarginL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 173 NONAME ; class CXnProperty * CXnNodePluginIf::GridScrollBarMarginL(void) - ?WidgetsVisible@TXnUiEnginePluginIf@@QBEHXZ @ 174 NONAME ; int TXnUiEnginePluginIf::WidgetsVisible(void) const - ?SetControlAdapter@CXnComponent@@QAEXPAVCXnControlAdapter@@@Z @ 175 NONAME ; void CXnComponent::SetControlAdapter(class CXnControlAdapter *) - ?GridColumnsL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 176 NONAME ; class CXnProperty * CXnNodePluginIf::GridColumnsL(void) - ?SetStateL@CXnNodePluginIf@@QAEXABVTDesC8@@@Z @ 177 NONAME ; void CXnNodePluginIf::SetStateL(class TDesC8 const &) - ?DoesComponentNeedCreation@CXnComponentNodeImpl@@QBEHXZ @ 178 NONAME ; int CXnComponentNodeImpl::DoesComponentNeedCreation(void) const - ??0CXnDocument@@QAE@AAVCEikApplication@@VTUid@@@Z @ 179 NONAME ; CXnDocument::CXnDocument(class CEikApplication &, class TUid) - ?FindNodeByClassL@TXnUiEnginePluginIf@@QAE?AV?$RPointerArray@VCXnNodePluginIf@@@@ABVTDesC16@@@Z @ 180 NONAME ; class RPointerArray TXnUiEnginePluginIf::FindNodeByClassL(class TDesC16 const &) - ?GridHorDirectionL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 181 NONAME ; class CXnProperty * CXnNodePluginIf::GridHorDirectionL(void) - ?InternalDomNodeType@CXnNodeAppIf@@QBEABVTDesC8@@XZ @ 182 NONAME ; class TDesC8 const & CXnNodeAppIf::InternalDomNodeType(void) const - ?StringPool@TXnUiEnginePluginIf@@QAEAAVCXnDomStringPool@@XZ @ 183 NONAME ; class CXnDomStringPool & TXnUiEnginePluginIf::StringPool(void) - ?SetStateL@CXnNodeAppIf@@QAEXABVTDesC8@@@Z @ 184 NONAME ; void CXnNodeAppIf::SetStateL(class TDesC8 const &) - ?Type@CXnNodeAppIf@@QAEPAVCXnType@@XZ @ 185 NONAME ; class CXnType * CXnNodeAppIf::Type(void) - ?BorderRect@CXnNodeAppIf@@QAE?AVTRect@@XZ @ 186 NONAME ; class TRect CXnNodeAppIf::BorderRect(void) - ?IdL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 187 NONAME ; class CXnProperty * CXnNodePluginIf::IdL(void) - ?RootNodeL@TXnUiEngineAppIf@@QAEAAVCXnNodeAppIf@@XZ @ 188 NONAME ; class CXnNodeAppIf & TXnUiEngineAppIf::RootNodeL(void) - ?CreateXnComponentL@MXnComponentFactory@@QAE?AW4TXnComponentFactoryResponse@1@AAVCXnNodePluginIf@@AAPAVCXnComponent@@@Z @ 189 NONAME ; enum MXnComponentFactory::TXnComponentFactoryResponse MXnComponentFactory::CreateXnComponentL(class CXnNodePluginIf &, class CXnComponent * &) - ?RefreshMenuL@TXnUiEngineAppIf@@QAEXXZ @ 190 NONAME ; void TXnUiEngineAppIf::RefreshMenuL(void) - ?PaddingRect@CXnNodePluginIf@@QAE?AVTRect@@XZ @ 191 NONAME ; class TRect CXnNodePluginIf::PaddingRect(void) - ?MeasureAdaptiveContentL@CXnControlAdapter@@UAE?AVTSize@@ABV2@@Z @ 192 NONAME ; class TSize CXnControlAdapter::MeasureAdaptiveContentL(class TSize const &) - ?NewL@CXnProperty@@SAPAV1@ABVTDesC8@@0W4TPrimitiveValueType@CXnDomPropertyValue@@AAVCXnDomStringPool@@@Z @ 193 NONAME ; class CXnProperty * CXnProperty::NewL(class TDesC8 const &, class TDesC8 const &, enum CXnDomPropertyValue::TPrimitiveValueType, class CXnDomStringPool &) - ?GetPropertyL@CXnNodePluginIf@@QBEPAVCXnProperty@@AAV2@@Z @ 194 NONAME ; class CXnProperty * CXnNodePluginIf::GetPropertyL(class CXnProperty &) const - ?HitRegion@TXnUiEnginePluginIf@@QBEPAVCXnControlAdapter@@XZ @ 195 NONAME ; class CXnControlAdapter * TXnUiEnginePluginIf::HitRegion(void) const - ?MarginRect@CXnNodeAppIf@@QAE?AVTRect@@XZ @ 196 NONAME ; class TRect CXnNodeAppIf::MarginRect(void) - ?MakeInterfaceL@CXnComponent@@UAEPAVMXnComponentInterface@XnComponentInterface@@ABVTDesC8@@@Z @ 197 NONAME ; class XnComponentInterface::MXnComponentInterface * CXnComponent::MakeInterfaceL(class TDesC8 const &) - ?EditMode@TXnUiEnginePluginIf@@QAEHXZ @ 198 NONAME ; int TXnUiEnginePluginIf::EditMode(void) - ?FindNodeByIdL@TXnUiEnginePluginIf@@QAEPAVCXnNodePluginIf@@ABVTDesC8@@0@Z @ 199 NONAME ; class CXnNodePluginIf * TXnUiEnginePluginIf::FindNodeByIdL(class TDesC8 const &, class TDesC8 const &) - ?EnableRenderUi@CXnUiEngineImpl@@CAXPAX@Z @ 200 NONAME ; void CXnUiEngineImpl::EnableRenderUi(void *) - ?IsMenuDisplaying@TXnUiEnginePluginIf@@QAEHXZ @ 201 NONAME ; int TXnUiEnginePluginIf::IsMenuDisplaying(void) - ?IsMenuDisplaying@TXnUiEngineAppIf@@QAEHXZ @ 202 NONAME ; int TXnUiEngineAppIf::IsMenuDisplaying(void) - ?NewL@CXnProperty@@SAPAV1@PAVCXnDomProperty@@@Z @ 203 NONAME ; class CXnProperty * CXnProperty::NewL(class CXnDomProperty *) - ?ConstructL@CXnComponentNodeImpl@@IAEXPAVCXnType@@@Z @ 204 NONAME ; void CXnComponentNodeImpl::ConstructL(class CXnType *) - ?ChildrenL@CXnNodeAppIf@@QAE?AV?$RPointerArray@VCXnNodeAppIf@@@@XZ @ 205 NONAME ; class RPointerArray CXnNodeAppIf::ChildrenL(void) - ?ConvertHslToRgb@CXnUtils@@SA?AVTRgb@@HHH@Z @ 206 NONAME ; class TRgb CXnUtils::ConvertHslToRgb(int, int, int) - ?LoadBitmap@CXnControlAdapter@@QAEPAVCFbsBitmap@@ABVTDesC16@@@Z @ 207 NONAME ; class CFbsBitmap * CXnControlAdapter::LoadBitmap(class TDesC16 const &) - ??0MXnComponentFactory@@IAE@XZ @ 208 NONAME ; MXnComponentFactory::MXnComponentFactory(void) - ?SetComponent@CXnViewsNodeImpl@@QAEXPAVCXnComponent@@@Z @ 209 NONAME ; void CXnViewsNodeImpl::SetComponent(class CXnComponent *) - ?BorderRect@CXnNodePluginIf@@QAE?AVTRect@@XZ @ 210 NONAME ; class TRect CXnNodePluginIf::BorderRect(void) - ?CreateDocumentL@CXnApplication@@MAEPAVCApaDocument@@XZ @ 211 NONAME ; class CApaDocument * CXnApplication::CreateDocumentL(void) - ?CreateFontL@CXnUtils@@SAXABVTDesC16@@HVTFontStyle@@AAPAVCFont@@AAH@Z @ 212 NONAME ; void CXnUtils::CreateFontL(class TDesC16 const &, int, class TFontStyle, class CFont * &, int &) - ?GetPluginNodeArrayL@TXnUiEngineAppIf@@QAEHAAV?$RPointerArray@VCXnNodeAppIf@@@@@Z @ 213 NONAME ; int TXnUiEngineAppIf::GetPluginNodeArrayL(class RPointerArray &) - ?MakeXnControlAdapterL@MXnComponentFactory@@EAEPAVCXnControlAdapter@@AAVCXnNodePluginIf@@PAV2@@Z @ 214 NONAME ; class CXnControlAdapter * MXnComponentFactory::MakeXnControlAdapterL(class CXnNodePluginIf &, class CXnControlAdapter *) - ?IsDrawingAllowed@CXnNodePluginIf@@QBEHXZ @ 215 NONAME ; int CXnNodePluginIf::IsDrawingAllowed(void) const - ?MakeInterfaceL@CXnNodeAppIf@@QAEPAVMXnComponentInterface@XnComponentInterface@@ABVTDesC8@@@Z @ 216 NONAME ; class XnComponentInterface::MXnComponentInterface * CXnNodeAppIf::MakeInterfaceL(class TDesC8 const &) - ?VerticalTwipValueL@TXnUiEnginePluginIf@@QAEHPAVCXnProperty@@H@Z @ 217 NONAME ; int TXnUiEnginePluginIf::VerticalTwipValueL(class CXnProperty *, int) - ?Component@CXnControlAdapter@@QAEPAVCXnComponent@@XZ @ 218 NONAME ; class CXnComponent * CXnControlAdapter::Component(void) - ?FloatValueL@CXnProperty@@QAENXZ @ 219 NONAME ; double CXnProperty::FloatValueL(void) - ?SetUiEngine@TXnUiEngineAppIf@@QAEXPAVCXnUiEngine@@@Z @ 220 NONAME ; void TXnUiEngineAppIf::SetUiEngine(class CXnUiEngine *) - ?FindNodeByIdL@TXnUiEngineAppIf@@QAEPAVCXnNodeAppIf@@ABVTDesC16@@0@Z @ 221 NONAME ; class CXnNodeAppIf * TXnUiEngineAppIf::FindNodeByIdL(class TDesC16 const &, class TDesC16 const &) - ?IsEditMode@TXnUiEngineAppIf@@QAEHXZ @ 222 NONAME ; int TXnUiEngineAppIf::IsEditMode(void) - ?ResolveSkinItemIDL@CXnUtils@@SAHABVTDesC16@@AAVTAknsItemID@@AAH@Z @ 223 NONAME ; int CXnUtils::ResolveSkinItemIDL(class TDesC16 const &, class TAknsItemID &, int &) - ?RootNodeL@TXnUiEnginePluginIf@@QAEAAVCXnNodePluginIf@@XZ @ 224 NONAME ; class CXnNodePluginIf & TXnUiEnginePluginIf::RootNodeL(void) - ?CreateAppUiL@CXnDocument@@UAEPAVCEikAppUi@@XZ @ 225 NONAME ; class CEikAppUi * CXnDocument::CreateAppUiL(void) - ?PathL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 226 NONAME ; class CXnProperty * CXnNodePluginIf::PathL(void) - ?NewL@CXnProperty@@SAPAV1@ABVTDesC8@@NW4TPrimitiveValueType@CXnDomPropertyValue@@AAVCXnDomStringPool@@@Z @ 227 NONAME ; class CXnProperty * CXnProperty::NewL(class TDesC8 const &, double, enum CXnDomPropertyValue::TPrimitiveValueType, class CXnDomStringPool &) - ?MaskPathL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 228 NONAME ; class CXnProperty * CXnNodePluginIf::MaskPathL(void) - ?AppDllUid@CXnApplication@@MBE?AVTUid@@XZ @ 229 NONAME ; class TUid CXnApplication::AppDllUid(void) const - ?DoExitPowerSaveModeL@CXnControlAdapter@@UAEXW4TModeEvent@1@@Z @ 230 NONAME ; void CXnControlAdapter::DoExitPowerSaveModeL(enum CXnControlAdapter::TModeEvent) - ?LabelL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 231 NONAME ; class CXnProperty * CXnNodePluginIf::LabelL(void) - ?Component@CXnViewsNodeImpl@@QAEPAVCXnComponent@@XZ @ 232 NONAME ; class CXnComponent * CXnViewsNodeImpl::Component(void) - ?GetRgbValue@CXnUtils@@SAHAAVTRgb@@ABVTDesC8@@@Z @ 233 NONAME ; int CXnUtils::GetRgbValue(class TRgb &, class TDesC8 const &) - ?StringValue@CXnProperty@@QAEABVTDesC8@@XZ @ 234 NONAME ; class TDesC8 const & CXnProperty::StringValue(void) - ?SetVisible@CXnControlAdapter@@QAEXH@Z @ 235 NONAME ; void CXnControlAdapter::SetVisible(int) - ?Node@CXnComponent@@QAEPAVCXnNodePluginIf@@XZ @ 236 NONAME ; class CXnNodePluginIf * CXnComponent::Node(void) - ?HandleEnterEditModeL@CXnAppUiAdapter@@UAEXH@Z @ 237 NONAME ; void CXnAppUiAdapter::HandleEnterEditModeL(int) + ?UnsetStateL@CXnNodePluginIf@@QAEXABVTDesC8@@@Z @ 93 NONAME ; void CXnNodePluginIf::UnsetStateL(class TDesC8 const &) + ?StringValueL@CXnProperty@@QAEPAVHBufC16@@XZ @ 94 NONAME ; class HBufC16 * CXnProperty::StringValueL(void) + ?DisableRenderUiLC@TXnUiEnginePluginIf@@QAEXXZ @ 95 NONAME ; void TXnUiEnginePluginIf::DisableRenderUiLC(void) + ?SetPropertyL@CXnNodeAppIf@@QAEXPAVCXnProperty@@@Z @ 96 NONAME ; void CXnNodeAppIf::SetPropertyL(class CXnProperty *) + ?View@CXnAppUiAdapter@@QBEAAVCAknView@@XZ @ 97 NONAME ; class CAknView & CXnAppUiAdapter::View(void) const + ?ViewNodeImpl@CXnNodePluginIf@@QAEPAVCXnViewNodeImpl@@XZ @ 98 NONAME ; class CXnViewNodeImpl * CXnNodePluginIf::ViewNodeImpl(void) + ?StripQuotes@CXnUtils@@SAXAAPAVHBufC16@@@Z @ 99 NONAME ; void CXnUtils::StripQuotes(class HBufC16 * &) + ?SetPCDataL@CXnNodePluginIf@@QAEXABVTDesC8@@@Z @ 100 NONAME ; void CXnNodePluginIf::SetPCDataL(class TDesC8 const &) + ?VisibilityL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 101 NONAME ; class CXnProperty * CXnNodePluginIf::VisibilityL(void) + ?Draw@CXnControlAdapter@@MBEXABVTRect@@@Z @ 102 NONAME ; void CXnControlAdapter::Draw(class TRect const &) const + ??1CXnApplication@@UAE@XZ @ 103 NONAME ; CXnApplication::~CXnApplication(void) + ?DoesNodeNeedComponentImplL@MXnComponentFactory@@QAEHABVTDesC8@@@Z @ 104 NONAME ; int MXnComponentFactory::DoesNodeNeedComponentImplL(class TDesC8 const &) + ?ConstructL@CXnViewsNodeImpl@@IAEXPAVCXnType@@@Z @ 105 NONAME ; void CXnViewsNodeImpl::ConstructL(class CXnType *) + ?StringPool@TXnUiEngineAppIf@@QAEAAVCXnDomStringPool@@XZ @ 106 NONAME ; class CXnDomStringPool & TXnUiEngineAppIf::StringPool(void) + ?UiEngineL@CXnNodePluginIf@@QAEPAVTXnUiEnginePluginIf@@XZ @ 107 NONAME ; class TXnUiEnginePluginIf * CXnNodePluginIf::UiEngineL(void) + ?ResolveSkinItemIDL@CXnUtils@@SAHABVTDesC16@@AAVTAknsItemID@@@Z @ 108 NONAME ; int CXnUtils::ResolveSkinItemIDL(class TDesC16 const &, class TAknsItemID &) + ?PluginNodeL@TXnUiEnginePluginIf@@QAEAAVCXnNodePluginIf@@PAV2@@Z @ 109 NONAME ; class CXnNodePluginIf & TXnUiEnginePluginIf::PluginNodeL(class CXnNodePluginIf *) + ?VerticalPixelValueL@TXnUiEnginePluginIf@@QAEHPAVCXnProperty@@H@Z @ 110 NONAME ; int TXnUiEnginePluginIf::VerticalPixelValueL(class CXnProperty *, int) + ?SetComponent@CXnControlAdapter@@QAEXPAVCXnComponent@@@Z @ 111 NONAME ; void CXnControlAdapter::SetComponent(class CXnComponent *) + ??0MXnNodePredicate@@QAE@XZ @ 112 NONAME ; MXnNodePredicate::MXnNodePredicate(void) + ??1CXnViewsNodeImpl@@UAE@XZ @ 113 NONAME ; CXnViewsNodeImpl::~CXnViewsNodeImpl(void) + ?HandleControlEventL@CXnControlAdapter@@UAEXPAVCCoeControl@@W4TCoeEvent@MCoeControlObserver@@@Z @ 114 NONAME ; void CXnControlAdapter::HandleControlEventL(class CCoeControl *, enum MCoeControlObserver::TCoeEvent) + ?HandleScreenDeviceChangedL@CXnControlAdapter@@UAEXXZ @ 115 NONAME ; void CXnControlAdapter::HandleScreenDeviceChangedL(void) + ?SizeChanged@CXnControlAdapter@@MAEXXZ @ 116 NONAME ; void CXnControlAdapter::SizeChanged(void) + ?CountComponentControls@CXnControlAdapter@@MBEHXZ @ 117 NONAME ; int CXnControlAdapter::CountComponentControls(void) const + ?HideTooltipsL@CXnNodeAppIf@@QAEXXZ @ 118 NONAME ; void CXnNodeAppIf::HideTooltipsL(void) + ?GetPropertyL@CXnNodeAppIf@@QBEPAVCXnProperty@@ABVTDesC8@@@Z @ 119 NONAME ; class CXnProperty * CXnNodeAppIf::GetPropertyL(class TDesC8 const &) const + ?FindNodeByClassL@TXnUiEngineAppIf@@QAE?AV?$RPointerArray@VCXnNodeAppIf@@@@ABVTDesC8@@0@Z @ 120 NONAME ; class RPointerArray TXnUiEngineAppIf::FindNodeByClassL(class TDesC8 const &, class TDesC8 const &) + ?Match@MXnNodePredicate@@UAEHAAVCXnNode@@@Z @ 121 NONAME ; int MXnNodePredicate::Match(class CXnNode &) + ?GetBitmapAndMask@CXnControlAdapter@@QAEXABVTDesC16@@0AAPAVCFbsBitmap@@1@Z @ 122 NONAME ; void CXnControlAdapter::GetBitmapAndMask(class TDesC16 const &, class TDesC16 const &, class CFbsBitmap * &, class CFbsBitmap * &) + ?NewL@CXnViewsNodeImpl@@SAPAV1@PAVCXnType@@@Z @ 123 NONAME ; class CXnViewsNodeImpl * CXnViewsNodeImpl::NewL(class CXnType *) + ?PaddingRect@CXnNodeAppIf@@QAE?AVTRect@@XZ @ 124 NONAME ; class TRect CXnNodeAppIf::PaddingRect(void) + ?SetMarginRect@CXnNodePluginIf@@QAEXABVTRect@@@Z @ 125 NONAME ; void CXnNodePluginIf::SetMarginRect(class TRect const &) + ?IsDialogDisplaying@TXnUiEnginePluginIf@@QAEHXZ @ 126 NONAME ; int TXnUiEnginePluginIf::IsDialogDisplaying(void) + ?HandleEventL@CXnAppUiAdapter@@UAEXABVTDesC16@@AAVCXnNodeAppIf@@@Z @ 127 NONAME ; void CXnAppUiAdapter::HandleEventL(class TDesC16 const &, class CXnNodeAppIf &) + ?GetPropertyL@CXnNodePluginIf@@QBEPAVCXnProperty@@ABVTDesC8@@@Z @ 128 NONAME ; class CXnProperty * CXnNodePluginIf::GetPropertyL(class TDesC8 const &) const + ?SetPropertyArrayL@CXnNodeAppIf@@QAEXPAV?$RPointerArray@VCXnProperty@@@@@Z @ 129 NONAME ; void CXnNodeAppIf::SetPropertyArrayL(class RPointerArray *) + ?RemoveViewL@CXnAppUiAdapter@@QAEXAAVCAknView@@@Z @ 130 NONAME ; void CXnAppUiAdapter::RemoveViewL(class CAknView &) + ?EnterPowerSaveModeL@CXnComponent@@UAEXXZ @ 131 NONAME ; void CXnComponent::EnterPowerSaveModeL(void) + ?SetRect@CXnNodePluginIf@@QAEXABVTRect@@@Z @ 132 NONAME ; void CXnNodePluginIf::SetRect(class TRect const &) + ??0CXnComponent@@IAE@XZ @ 133 NONAME ; CXnComponent::CXnComponent(void) + ?CollapseWhiteSpace@CXnUtils@@SAXAAVCXnNodePluginIf@@AAVTDes16@@@Z @ 134 NONAME ; void CXnUtils::CollapseWhiteSpace(class CXnNodePluginIf &, class TDes16 &) + ?SetHandleTooltip@CXnNodePluginIf@@QAEXH@Z @ 135 NONAME ; void CXnNodePluginIf::SetHandleTooltip(int) + ??1CXnAppUiAdapter@@UAE@XZ @ 136 NONAME ; CXnAppUiAdapter::~CXnAppUiAdapter(void) + ?NewL@CXnControlAdapter@@SAPAV1@AAVCXnNodePluginIf@@@Z @ 137 NONAME ; class CXnControlAdapter * CXnControlAdapter::NewL(class CXnNodePluginIf &) + ?EnableLongTapAnimation@CXnControlAdapter@@QAEXH@Z @ 138 NONAME ; void CXnControlAdapter::EnableLongTapAnimation(int) + ?SetPaddingRect@CXnNodePluginIf@@QAEXABVTRect@@@Z @ 139 NONAME ; void CXnNodePluginIf::SetPaddingRect(class TRect const &) + ?SetFocusedNode@TXnUiEnginePluginIf@@QAEXPAVCXnNodePluginIf@@@Z @ 140 NONAME ; void TXnUiEnginePluginIf::SetFocusedNode(class CXnNodePluginIf *) + ?ExitPowerSaveModeL@CXnComponent@@UAEXXZ @ 141 NONAME ; void CXnComponent::ExitPowerSaveModeL(void) + ?GetPCData@CXnNodeAppIf@@QBEABVTDesC8@@XZ @ 142 NONAME ; class TDesC8 const & CXnNodeAppIf::GetPCData(void) const + ?Namespace@CXnNodeAppIf@@QAEABVTDesC8@@XZ @ 143 NONAME ; class TDesC8 const & CXnNodeAppIf::Namespace(void) + ??1CXnComponentNodeImpl@@UAE@XZ @ 144 NONAME ; CXnComponentNodeImpl::~CXnComponentNodeImpl(void) + ?SetPropertyWithoutNotificationL@CXnNodePluginIf@@QAEXPAVCXnProperty@@@Z @ 145 NONAME ; void CXnNodePluginIf::SetPropertyWithoutNotificationL(class CXnProperty *) + ?GetPCData@CXnNodePluginIf@@QBEABVTDesC8@@XZ @ 146 NONAME ; class TDesC8 const & CXnNodePluginIf::GetPCData(void) const + ?SetPCDataL@CXnNodeAppIf@@QAEXABVTDesC8@@@Z @ 147 NONAME ; void CXnNodeAppIf::SetPCDataL(class TDesC8 const &) + ?Resources@TXnUiEnginePluginIf@@QAEAAV?$CArrayPtrSeg@VCXnResource@@@@XZ @ 148 NONAME ; class CArrayPtrSeg & TXnUiEnginePluginIf::Resources(void) + ?SetContentBitmaps@CXnControlAdapter@@QAEXABVTDesC16@@0@Z @ 149 NONAME ; void CXnControlAdapter::SetContentBitmaps(class TDesC16 const &, class TDesC16 const &) + ??1CXnControlAdapter@@UAE@XZ @ 150 NONAME ; CXnControlAdapter::~CXnControlAdapter(void) + ??1MXnNodePredicate@@UAE@XZ @ 151 NONAME ; MXnNodePredicate::~MXnNodePredicate(void) + ?HorizontalTwipValueL@TXnUiEnginePluginIf@@QAEHPAVCXnProperty@@H@Z @ 152 NONAME ; int TXnUiEnginePluginIf::HorizontalTwipValueL(class CXnProperty *, int) + ?ConstructL@CXnAppUiAdapter@@UAEXXZ @ 153 NONAME ; void CXnAppUiAdapter::ConstructL(void) + ?CreateFontL@CXnUtils@@SAXAAVCXnNodePluginIf@@AAPAVCFont@@AAH@Z @ 154 NONAME ; void CXnUtils::CreateFontL(class CXnNodePluginIf &, class CFont * &, int &) + ??0CXnApplication@@QAE@VTUid@@@Z @ 155 NONAME ; CXnApplication::CXnApplication(class TUid) + ?ComponentControl@CXnControlAdapter@@MBEPAVCCoeControl@@H@Z @ 156 NONAME ; class CCoeControl * CXnControlAdapter::ComponentControl(int) const + ?HandleLongTapEventL@CXnControlAdapter@@UAEXABVTPoint@@0@Z @ 157 NONAME ; void CXnControlAdapter::HandleLongTapEventL(class TPoint const &, class TPoint const &) + ?ParentL@CXnNodeAppIf@@QBEPAV1@XZ @ 158 NONAME ; class CXnNodeAppIf * CXnNodeAppIf::ParentL(void) const + ??1CXnComponent@@UAE@XZ @ 159 NONAME ; CXnComponent::~CXnComponent(void) + ?ControlAdapter@CXnComponent@@QAEPAVCXnControlAdapter@@XZ @ 160 NONAME ; class CXnControlAdapter * CXnComponent::ControlAdapter(void) + ?DrawContentImage@CXnControlAdapter@@IBEXXZ @ 161 NONAME ; void CXnControlAdapter::DrawContentImage(void) const + ?Component@CXnComponentNodeImpl@@QAEPAVCXnComponent@@XZ @ 162 NONAME ; class CXnComponent * CXnComponentNodeImpl::Component(void) + ?WidgetsVisible@TXnUiEnginePluginIf@@QBEHXZ @ 163 NONAME ; int TXnUiEnginePluginIf::WidgetsVisible(void) const + ?SetControlAdapter@CXnComponent@@QAEXPAVCXnControlAdapter@@@Z @ 164 NONAME ; void CXnComponent::SetControlAdapter(class CXnControlAdapter *) + ?SetStateL@CXnNodePluginIf@@QAEXABVTDesC8@@@Z @ 165 NONAME ; void CXnNodePluginIf::SetStateL(class TDesC8 const &) + ?DoesComponentNeedCreation@CXnComponentNodeImpl@@QBEHXZ @ 166 NONAME ; int CXnComponentNodeImpl::DoesComponentNeedCreation(void) const + ??0CXnDocument@@QAE@AAVCEikApplication@@VTUid@@@Z @ 167 NONAME ; CXnDocument::CXnDocument(class CEikApplication &, class TUid) + ?FindNodeByClassL@TXnUiEnginePluginIf@@QAE?AV?$RPointerArray@VCXnNodePluginIf@@@@ABVTDesC16@@@Z @ 168 NONAME ; class RPointerArray TXnUiEnginePluginIf::FindNodeByClassL(class TDesC16 const &) + ?InternalDomNodeType@CXnNodeAppIf@@QBEABVTDesC8@@XZ @ 169 NONAME ; class TDesC8 const & CXnNodeAppIf::InternalDomNodeType(void) const + ?StringPool@TXnUiEnginePluginIf@@QAEAAVCXnDomStringPool@@XZ @ 170 NONAME ; class CXnDomStringPool & TXnUiEnginePluginIf::StringPool(void) + ?SetStateL@CXnNodeAppIf@@QAEXABVTDesC8@@@Z @ 171 NONAME ; void CXnNodeAppIf::SetStateL(class TDesC8 const &) + ?Type@CXnNodeAppIf@@QAEPAVCXnType@@XZ @ 172 NONAME ; class CXnType * CXnNodeAppIf::Type(void) + ?BorderRect@CXnNodeAppIf@@QAE?AVTRect@@XZ @ 173 NONAME ; class TRect CXnNodeAppIf::BorderRect(void) + ?IdL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 174 NONAME ; class CXnProperty * CXnNodePluginIf::IdL(void) + ?RootNodeL@TXnUiEngineAppIf@@QAEAAVCXnNodeAppIf@@XZ @ 175 NONAME ; class CXnNodeAppIf & TXnUiEngineAppIf::RootNodeL(void) + ?CreateXnComponentL@MXnComponentFactory@@QAE?AW4TXnComponentFactoryResponse@1@AAVCXnNodePluginIf@@AAPAVCXnComponent@@@Z @ 176 NONAME ; enum MXnComponentFactory::TXnComponentFactoryResponse MXnComponentFactory::CreateXnComponentL(class CXnNodePluginIf &, class CXnComponent * &) + ?RefreshMenuL@TXnUiEngineAppIf@@QAEXXZ @ 177 NONAME ; void TXnUiEngineAppIf::RefreshMenuL(void) + ?PaddingRect@CXnNodePluginIf@@QAE?AVTRect@@XZ @ 178 NONAME ; class TRect CXnNodePluginIf::PaddingRect(void) + ?MeasureAdaptiveContentL@CXnControlAdapter@@UAE?AVTSize@@ABV2@@Z @ 179 NONAME ; class TSize CXnControlAdapter::MeasureAdaptiveContentL(class TSize const &) + ?NewL@CXnProperty@@SAPAV1@ABVTDesC8@@0W4TPrimitiveValueType@CXnDomPropertyValue@@AAVCXnDomStringPool@@@Z @ 180 NONAME ; class CXnProperty * CXnProperty::NewL(class TDesC8 const &, class TDesC8 const &, enum CXnDomPropertyValue::TPrimitiveValueType, class CXnDomStringPool &) + ?GetPropertyL@CXnNodePluginIf@@QBEPAVCXnProperty@@AAV2@@Z @ 181 NONAME ; class CXnProperty * CXnNodePluginIf::GetPropertyL(class CXnProperty &) const + ?MarginRect@CXnNodeAppIf@@QAE?AVTRect@@XZ @ 182 NONAME ; class TRect CXnNodeAppIf::MarginRect(void) + ?EditMode@TXnUiEnginePluginIf@@QAEHXZ @ 183 NONAME ; int TXnUiEnginePluginIf::EditMode(void) + ?FindNodeByIdL@TXnUiEnginePluginIf@@QAEPAVCXnNodePluginIf@@ABVTDesC8@@0@Z @ 184 NONAME ; class CXnNodePluginIf * TXnUiEnginePluginIf::FindNodeByIdL(class TDesC8 const &, class TDesC8 const &) + ?MakeInterfaceL@CXnComponent@@UAEPAVMXnComponentInterface@XnComponentInterface@@ABVTDesC8@@@Z @ 185 NONAME ; class XnComponentInterface::MXnComponentInterface * CXnComponent::MakeInterfaceL(class TDesC8 const &) + ?EnableRenderUi@CXnUiEngineImpl@@CAXPAX@Z @ 186 NONAME ; void CXnUiEngineImpl::EnableRenderUi(void *) + ?IsMenuDisplaying@TXnUiEnginePluginIf@@QAEHXZ @ 187 NONAME ; int TXnUiEnginePluginIf::IsMenuDisplaying(void) + ?IsMenuDisplaying@TXnUiEngineAppIf@@QAEHXZ @ 188 NONAME ; int TXnUiEngineAppIf::IsMenuDisplaying(void) + ?NewL@CXnProperty@@SAPAV1@PAVCXnDomProperty@@@Z @ 189 NONAME ; class CXnProperty * CXnProperty::NewL(class CXnDomProperty *) + ?ConstructL@CXnComponentNodeImpl@@IAEXPAVCXnType@@@Z @ 190 NONAME ; void CXnComponentNodeImpl::ConstructL(class CXnType *) + ?ChildrenL@CXnNodeAppIf@@QAE?AV?$RPointerArray@VCXnNodeAppIf@@@@XZ @ 191 NONAME ; class RPointerArray CXnNodeAppIf::ChildrenL(void) + ?ConvertHslToRgb@CXnUtils@@SA?AVTRgb@@HHH@Z @ 192 NONAME ; class TRgb CXnUtils::ConvertHslToRgb(int, int, int) + ?LoadPublisher@CXnAppUiAdapter@@UAEHAAVCXnNodeAppIf@@H@Z @ 193 NONAME ; int CXnAppUiAdapter::LoadPublisher(class CXnNodeAppIf &, int) + ?LoadBitmap@CXnControlAdapter@@QAEPAVCFbsBitmap@@ABVTDesC16@@@Z @ 194 NONAME ; class CFbsBitmap * CXnControlAdapter::LoadBitmap(class TDesC16 const &) + ??0MXnComponentFactory@@IAE@XZ @ 195 NONAME ; MXnComponentFactory::MXnComponentFactory(void) + ?SetComponent@CXnViewsNodeImpl@@QAEXPAVCXnComponent@@@Z @ 196 NONAME ; void CXnViewsNodeImpl::SetComponent(class CXnComponent *) + ?BorderRect@CXnNodePluginIf@@QAE?AVTRect@@XZ @ 197 NONAME ; class TRect CXnNodePluginIf::BorderRect(void) + ?CreateDocumentL@CXnApplication@@MAEPAVCApaDocument@@XZ @ 198 NONAME ; class CApaDocument * CXnApplication::CreateDocumentL(void) + ?HandleUiReadyEventL@CXnAppUiAdapter@@UAEXXZ @ 199 NONAME ; void CXnAppUiAdapter::HandleUiReadyEventL(void) + ?CreateFontL@CXnUtils@@SAXABVTDesC16@@HVTFontStyle@@AAPAVCFont@@AAH@Z @ 200 NONAME ; void CXnUtils::CreateFontL(class TDesC16 const &, int, class TFontStyle, class CFont * &, int &) + ?GetPluginNodeArrayL@TXnUiEngineAppIf@@QAEHAAV?$RPointerArray@VCXnNodeAppIf@@@@@Z @ 201 NONAME ; int TXnUiEngineAppIf::GetPluginNodeArrayL(class RPointerArray &) + ?MakeXnControlAdapterL@MXnComponentFactory@@EAEPAVCXnControlAdapter@@AAVCXnNodePluginIf@@PAV2@@Z @ 202 NONAME ; class CXnControlAdapter * MXnComponentFactory::MakeXnControlAdapterL(class CXnNodePluginIf &, class CXnControlAdapter *) + ?IsDrawingAllowed@CXnNodePluginIf@@QBEHXZ @ 203 NONAME ; int CXnNodePluginIf::IsDrawingAllowed(void) const + ?MakeInterfaceL@CXnNodeAppIf@@QAEPAVMXnComponentInterface@XnComponentInterface@@ABVTDesC8@@@Z @ 204 NONAME ; class XnComponentInterface::MXnComponentInterface * CXnNodeAppIf::MakeInterfaceL(class TDesC8 const &) + ?VerticalTwipValueL@TXnUiEnginePluginIf@@QAEHPAVCXnProperty@@H@Z @ 205 NONAME ; int TXnUiEnginePluginIf::VerticalTwipValueL(class CXnProperty *, int) + ?Component@CXnControlAdapter@@QAEPAVCXnComponent@@XZ @ 206 NONAME ; class CXnComponent * CXnControlAdapter::Component(void) + ?FloatValueL@CXnProperty@@QAENXZ @ 207 NONAME ; double CXnProperty::FloatValueL(void) + ?SetUiEngine@TXnUiEngineAppIf@@QAEXPAVCXnUiEngine@@@Z @ 208 NONAME ; void TXnUiEngineAppIf::SetUiEngine(class CXnUiEngine *) + ?FindNodeByIdL@TXnUiEngineAppIf@@QAEPAVCXnNodeAppIf@@ABVTDesC16@@0@Z @ 209 NONAME ; class CXnNodeAppIf * TXnUiEngineAppIf::FindNodeByIdL(class TDesC16 const &, class TDesC16 const &) + ?IsEditMode@TXnUiEngineAppIf@@QAEHXZ @ 210 NONAME ; int TXnUiEngineAppIf::IsEditMode(void) + ?ResolveSkinItemIDL@CXnUtils@@SAHABVTDesC16@@AAVTAknsItemID@@AAH@Z @ 211 NONAME ; int CXnUtils::ResolveSkinItemIDL(class TDesC16 const &, class TAknsItemID &, int &) + ?EnablePartialTouchInput@TXnUiEnginePluginIf@@QAEXAAVCXnNodePluginIf@@H@Z @ 212 NONAME ; void TXnUiEnginePluginIf::EnablePartialTouchInput(class CXnNodePluginIf &, int) + ?RootNodeL@TXnUiEnginePluginIf@@QAEAAVCXnNodePluginIf@@XZ @ 213 NONAME ; class CXnNodePluginIf & TXnUiEnginePluginIf::RootNodeL(void) + ?CreateAppUiL@CXnDocument@@UAEPAVCEikAppUi@@XZ @ 214 NONAME ; class CEikAppUi * CXnDocument::CreateAppUiL(void) + ?PathL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 215 NONAME ; class CXnProperty * CXnNodePluginIf::PathL(void) + ?NewL@CXnProperty@@SAPAV1@ABVTDesC8@@NW4TPrimitiveValueType@CXnDomPropertyValue@@AAVCXnDomStringPool@@@Z @ 216 NONAME ; class CXnProperty * CXnProperty::NewL(class TDesC8 const &, double, enum CXnDomPropertyValue::TPrimitiveValueType, class CXnDomStringPool &) + ?MaskPathL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 217 NONAME ; class CXnProperty * CXnNodePluginIf::MaskPathL(void) + ?AppDllUid@CXnApplication@@MBE?AVTUid@@XZ @ 218 NONAME ; class TUid CXnApplication::AppDllUid(void) const + ?DoExitPowerSaveModeL@CXnControlAdapter@@UAEXW4TModeEvent@1@@Z @ 219 NONAME ; void CXnControlAdapter::DoExitPowerSaveModeL(enum CXnControlAdapter::TModeEvent) + ?LabelL@CXnNodePluginIf@@QAEPAVCXnProperty@@XZ @ 220 NONAME ; class CXnProperty * CXnNodePluginIf::LabelL(void) + ?Component@CXnViewsNodeImpl@@QAEPAVCXnComponent@@XZ @ 221 NONAME ; class CXnComponent * CXnViewsNodeImpl::Component(void) + ?GetRgbValue@CXnUtils@@SAHAAVTRgb@@ABVTDesC8@@@Z @ 222 NONAME ; int CXnUtils::GetRgbValue(class TRgb &, class TDesC8 const &) + ?StringValue@CXnProperty@@QAEABVTDesC8@@XZ @ 223 NONAME ; class TDesC8 const & CXnProperty::StringValue(void) + ?SetVisible@CXnControlAdapter@@QAEXH@Z @ 224 NONAME ; void CXnControlAdapter::SetVisible(int) + ?Node@CXnComponent@@QAEPAVCXnNodePluginIf@@XZ @ 225 NONAME ; class CXnNodePluginIf * CXnComponent::Node(void) diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/eabi/xn3layoutengineu.def --- a/idlehomescreen/xmluirendering/uiengine/eabi/xn3layoutengineu.def Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/eabi/xn3layoutengineu.def Wed May 12 13:22:51 2010 +0300 @@ -24,268 +24,256 @@ _ZN12CXnComponent4NewLEv @ 23 NONAME _ZN12CXnComponent4NodeEv @ 24 NONAME _ZN12CXnComponent7SetNodeER15CXnNodePluginIf @ 25 NONAME - _ZN12CXnComponentC1Ev @ 26 NONAME - _ZN12CXnComponentC2Ev @ 27 NONAME - _ZN12CXnComponentD0Ev @ 28 NONAME - _ZN12CXnComponentD1Ev @ 29 NONAME - _ZN12CXnComponentD2Ev @ 30 NONAME - _ZN12CXnNodeAppIf10BorderRectEv @ 31 NONAME - _ZN12CXnNodeAppIf10IsStateSetERK6TDesC8 @ 32 NONAME - _ZN12CXnNodeAppIf10MarginRectEv @ 33 NONAME - _ZN12CXnNodeAppIf10SetPCDataLERK6TDesC8 @ 34 NONAME - _ZN12CXnNodeAppIf11PaddingRectEv @ 35 NONAME - _ZN12CXnNodeAppIf11UnsetStateLERK6TDesC8 @ 36 NONAME - _ZN12CXnNodeAppIf12SetPropertyLEP11CXnProperty @ 37 NONAME - _ZN12CXnNodeAppIf13HideTooltipsLEv @ 38 NONAME - _ZN12CXnNodeAppIf13ShowTooltipsLEv @ 39 NONAME - _ZN12CXnNodeAppIf14MakeInterfaceLERK6TDesC8 @ 40 NONAME - _ZN12CXnNodeAppIf17SetPropertyArrayLEP13RPointerArrayI11CXnPropertyE @ 41 NONAME - _ZN12CXnNodeAppIf4RectEv @ 42 NONAME - _ZN12CXnNodeAppIf4TypeEv @ 43 NONAME - _ZN12CXnNodeAppIf9ChildrenLEv @ 44 NONAME - _ZN12CXnNodeAppIf9NamespaceEv @ 45 NONAME - _ZN12CXnNodeAppIf9SetStateLERK6TDesC8 @ 46 NONAME - _ZN12CXnNodeAppIf9UiEngineLEv @ 47 NONAME - _ZN14CXnApplication15CreateDocumentLEv @ 48 NONAME - _ZN14CXnApplicationC1E4TUid @ 49 NONAME - _ZN14CXnApplicationC2E4TUid @ 50 NONAME - _ZN14CXnApplicationD0Ev @ 51 NONAME - _ZN14CXnApplicationD1Ev @ 52 NONAME - _ZN14CXnApplicationD2Ev @ 53 NONAME - _ZN15CXnAppUiAdapter10ConstructLEv @ 54 NONAME - _ZN15CXnAppUiAdapter15SetOnlineStateLER13RPointerArrayI12CXnNodeAppIfE @ 55 NONAME - _ZN15CXnAppUiAdapter16DynInitMenuItemLERK7TDesC16P13RPointerArrayI12CXnNodeAppIfE @ 56 NONAME - _ZN15CXnAppUiAdapter16HandlePageSwitchEv @ 57 NONAME - _ZN15CXnAppUiAdapter16LoadDataPluginsLER13RPointerArrayI12CXnNodeAppIfE @ 58 NONAME - _ZN15CXnAppUiAdapter18HandleXuikonEventLER12CXnNodeAppIfS1_R10CXnDomNodeS3_ @ 59 NONAME - _ZN15CXnAppUiAdapter19DestroyDataPluginsLER13RPointerArrayI12CXnNodeAppIfE @ 60 NONAME - _ZN15CXnAppUiAdapter21HandleResourceChangeLEi @ 61 NONAME - _ZN15CXnAppUiAdapter9UiEngineLEv @ 62 NONAME - _ZN15CXnAppUiAdapterC1E4TUid @ 63 NONAME - _ZN15CXnAppUiAdapterC2E4TUid @ 64 NONAME - _ZN15CXnAppUiAdapterD0Ev @ 65 NONAME - _ZN15CXnAppUiAdapterD1Ev @ 66 NONAME - _ZN15CXnAppUiAdapterD2Ev @ 67 NONAME - _ZN15CXnNodePluginIf10BorderRectEv @ 68 NONAME - _ZN15CXnNodePluginIf10MarginRectEv @ 69 NONAME - _ZN15CXnNodePluginIf10SetPCDataLERK6TDesC8 @ 70 NONAME - _ZN15CXnNodePluginIf11PaddingRectEv @ 71 NONAME - _ZN15CXnNodePluginIf11UnsetStateLERK6TDesC8 @ 72 NONAME - _ZN15CXnNodePluginIf11VisibilityLEv @ 73 NONAME - _ZN15CXnNodePluginIf12GridColumnsLEv @ 74 NONAME - _ZN15CXnNodePluginIf12SetPropertyLEP11CXnProperty @ 75 NONAME - _ZN15CXnNodePluginIf12ViewNodeImplEv @ 76 NONAME - _ZN15CXnNodePluginIf12VisibleRowsLEv @ 77 NONAME - _ZN15CXnNodePluginIf13SetBorderRectERK5TRect @ 78 NONAME - _ZN15CXnNodePluginIf13SetMarginRectERK5TRect @ 79 NONAME - _ZN15CXnNodePluginIf14IsFocusedStateEv @ 80 NONAME - _ZN15CXnNodePluginIf14MakeInterfaceLERK6TDesC8 @ 81 NONAME - _ZN15CXnNodePluginIf14SetPaddingRectERK5TRect @ 82 NONAME - _ZN15CXnNodePluginIf16FocusHorLoopingLEv @ 83 NONAME - _ZN15CXnNodePluginIf16FocusVerLoopingLEv @ 84 NONAME - _ZN15CXnNodePluginIf16GridOrientationLEv @ 85 NONAME - _ZN15CXnNodePluginIf16SetHandleTooltipEi @ 86 NONAME - _ZN15CXnNodePluginIf16SetLayoutCapableEi @ 87 NONAME - _ZN15CXnNodePluginIf17ComponentNodeImplEv @ 88 NONAME - _ZN15CXnNodePluginIf17GridHorDirectionLEv @ 89 NONAME - _ZN15CXnNodePluginIf17GridVerDirectionLEv @ 90 NONAME - _ZN15CXnNodePluginIf19GridScrollBarWidthLEv @ 91 NONAME - _ZN15CXnNodePluginIf19ReportTriggerEventLERK6TDesC8S2_S2_ @ 92 NONAME - _ZN15CXnNodePluginIf20GridScrollBarMarginLEv @ 93 NONAME - _ZN15CXnNodePluginIf31SetPropertyWithoutNotificationLEP11CXnProperty @ 94 NONAME - _ZN15CXnNodePluginIf3IdLEv @ 95 NONAME - _ZN15CXnNodePluginIf4RectEv @ 96 NONAME - _ZN15CXnNodePluginIf4RefLEv @ 97 NONAME - _ZN15CXnNodePluginIf4TypeEv @ 98 NONAME - _ZN15CXnNodePluginIf5PathLEv @ 99 NONAME - _ZN15CXnNodePluginIf6AppIfLEv @ 100 NONAME - _ZN15CXnNodePluginIf6LabelLEv @ 101 NONAME - _ZN15CXnNodePluginIf7SetRectERK5TRect @ 102 NONAME - _ZN15CXnNodePluginIf8DisplayLEv @ 103 NONAME - _ZN15CXnNodePluginIf9AddChildLEPS_ @ 104 NONAME - _ZN15CXnNodePluginIf9ChildrenLEv @ 105 NONAME - _ZN15CXnNodePluginIf9MaskPathLEv @ 106 NONAME - _ZN15CXnNodePluginIf9NamespaceEv @ 107 NONAME - _ZN15CXnNodePluginIf9SetDirtyLEv @ 108 NONAME - _ZN15CXnNodePluginIf9SetStateLERK6TDesC8 @ 109 NONAME - _ZN15CXnNodePluginIf9UiEngineLEv @ 110 NONAME - _ZN15CXnUiEngineImpl14EnableRenderUiEPv @ 111 NONAME - _ZN16CXnViewsNodeImpl10ConstructLEP7CXnType @ 112 NONAME - _ZN16CXnViewsNodeImpl12SetComponentEP12CXnComponent @ 113 NONAME - _ZN16CXnViewsNodeImpl4NewLEP7CXnType @ 114 NONAME - _ZN16CXnViewsNodeImpl9ComponentEv @ 115 NONAME - _ZN16CXnViewsNodeImplC1Ev @ 116 NONAME - _ZN16CXnViewsNodeImplC2Ev @ 117 NONAME - _ZN16CXnViewsNodeImplD0Ev @ 118 NONAME - _ZN16CXnViewsNodeImplD1Ev @ 119 NONAME - _ZN16CXnViewsNodeImplD2Ev @ 120 NONAME - _ZN16MXnNodePredicate5MatchER7CXnNode @ 121 NONAME - _ZN16MXnNodePredicateC1Ev @ 122 NONAME - _ZN16MXnNodePredicateC2Ev @ 123 NONAME - _ZN16MXnNodePredicateD0Ev @ 124 NONAME - _ZN16MXnNodePredicateD1Ev @ 125 NONAME - _ZN16MXnNodePredicateD2Ev @ 126 NONAME - _ZN16TXnUiEngineAppIf10ActiveViewEv @ 127 NONAME - _ZN16TXnUiEngineAppIf10IsEditModeEv @ 128 NONAME - _ZN16TXnUiEngineAppIf10StringPoolEv @ 129 NONAME - _ZN16TXnUiEngineAppIf11FocusedNodeEv @ 130 NONAME - _ZN16TXnUiEngineAppIf11SetUiEngineEP11CXnUiEngine @ 131 NONAME - _ZN16TXnUiEngineAppIf12RefreshMenuLEv @ 132 NONAME - _ZN16TXnUiEngineAppIf13ActivateViewLER12CXnNodeAppIf @ 133 NONAME - _ZN16TXnUiEngineAppIf13FindNodeByIdLERK6TDesC8S2_ @ 134 NONAME - _ZN16TXnUiEngineAppIf13FindNodeByIdLERK7TDesC16S2_ @ 135 NONAME - _ZN16TXnUiEngineAppIf16FindNodeByClassLERK6TDesC8S2_ @ 136 NONAME - _ZN16TXnUiEngineAppIf16FindNodeByClassLERK7TDesC16S2_ @ 137 NONAME - _ZN16TXnUiEngineAppIf16GetThemeResourceERK7TDesC16R5RFile @ 138 NONAME - _ZN16TXnUiEngineAppIf16IsMenuDisplayingEv @ 139 NONAME - _ZN16TXnUiEngineAppIf19GetPluginNodeArrayLER13RPointerArrayI12CXnNodeAppIfE @ 140 NONAME - _ZN16TXnUiEngineAppIf23FindContentSourceNodesLERK6TDesC8 @ 141 NONAME - _ZN16TXnUiEngineAppIf9RenderUILEP12CXnNodeAppIf @ 142 NONAME - _ZN16TXnUiEngineAppIf9RootNodeLEv @ 143 NONAME - _ZN17CXnControlAdapter10ConstructLER15CXnNodePluginIf @ 144 NONAME - _ZN17CXnControlAdapter10LoadBitmapERK7TDesC16 @ 145 NONAME - _ZN17CXnControlAdapter10SetVisibleEi @ 146 NONAME - _ZN17CXnControlAdapter11SizeChangedEv @ 147 NONAME - _ZN17CXnControlAdapter11SkinChangedEv @ 148 NONAME - _ZN17CXnControlAdapter12FocusChangedE8TDrawNow @ 149 NONAME - _ZN17CXnControlAdapter12SetComponentEP12CXnComponent @ 150 NONAME - _ZN17CXnControlAdapter14ContentBitmapsERP10CFbsBitmapS2_ @ 151 NONAME - _ZN17CXnControlAdapter14OfferKeyEventLERK9TKeyEvent10TEventCode @ 152 NONAME - _ZN17CXnControlAdapter15SetLocalUiZoomLE10TAknUiZoom @ 153 NONAME - _ZN17CXnControlAdapter16GetBitmapAndMaskERK7TDesC16S2_RP10CFbsBitmapS5_ @ 154 NONAME - _ZN17CXnControlAdapter17SetContentBitmapsEP10CFbsBitmapS1_ @ 155 NONAME - _ZN17CXnControlAdapter17SetContentBitmapsERK7TDesC16S2_ @ 156 NONAME - _ZN17CXnControlAdapter18ExitPowerSaveModeLENS_10TModeEventE @ 157 NONAME - _ZN17CXnControlAdapter18ResetStylusCounterEv @ 158 NONAME - _ZN17CXnControlAdapter19EnterPowerSaveModeLENS_10TModeEventE @ 159 NONAME - _ZN17CXnControlAdapter19HandleControlEventLEP11CCoeControlN19MCoeControlObserver9TCoeEventE @ 160 NONAME - _ZN17CXnControlAdapter19HandleLongTapEventLERK6TPointS2_ @ 161 NONAME - _ZN17CXnControlAdapter19HandlePointerEventLERK13TPointerEvent @ 162 NONAME - _ZN17CXnControlAdapter20DoExitPowerSaveModeLENS_10TModeEventE @ 163 NONAME - _ZN17CXnControlAdapter21DoEnterPowerSaveModeLENS_10TModeEventE @ 164 NONAME - _ZN17CXnControlAdapter21HandlePropertyChangeLEP11CXnProperty @ 165 NONAME - _ZN17CXnControlAdapter22EnableLongTapAnimationEi @ 166 NONAME - _ZN17CXnControlAdapter23DoHandlePropertyChangeLEP11CXnProperty @ 167 NONAME - _ZN17CXnControlAdapter23MeasureAdaptiveContentLERK5TSize @ 168 NONAME - _ZN17CXnControlAdapter26HandleScreenDeviceChangedLEv @ 169 NONAME - _ZN17CXnControlAdapter4NewLER15CXnNodePluginIf @ 170 NONAME - _ZN17CXnControlAdapter8SetBlankEi @ 171 NONAME - _ZN17CXnControlAdapter9ComponentEv @ 172 NONAME - _ZN17CXnControlAdapterC1Ev @ 173 NONAME - _ZN17CXnControlAdapterC2Ev @ 174 NONAME - _ZN17CXnControlAdapterD0Ev @ 175 NONAME - _ZN17CXnControlAdapterD1Ev @ 176 NONAME - _ZN17CXnControlAdapterD2Ev @ 177 NONAME - _ZN19MXnComponentFactory16MakeXnComponentLER15CXnNodePluginIfRP12CXnComponent @ 178 NONAME - _ZN19MXnComponentFactory18CreateXnComponentLER15CXnNodePluginIfRP12CXnComponent @ 179 NONAME - _ZN19MXnComponentFactory21MakeXnControlAdapterLER15CXnNodePluginIfP17CXnControlAdapter @ 180 NONAME - _ZN19MXnComponentFactory26DoesNodeNeedComponentImplLERK6TDesC8 @ 181 NONAME - _ZN19MXnComponentFactoryC2Ev @ 182 NONAME - _ZN19MXnComponentFactoryD0Ev @ 183 NONAME - _ZN19MXnComponentFactoryD1Ev @ 184 NONAME - _ZN19MXnComponentFactoryD2Ev @ 185 NONAME - _ZN19TXnUiEnginePluginIf10StringPoolEv @ 186 NONAME - _ZN19TXnUiEnginePluginIf11PluginNodeLEP15CXnNodePluginIf @ 187 NONAME - _ZN19TXnUiEnginePluginIf12EnableSwipeLEi @ 188 NONAME - _ZN19TXnUiEnginePluginIf12FocusVisibleEv @ 189 NONAME - _ZN19TXnUiEnginePluginIf12FocusedNodeLEv @ 190 NONAME - _ZN19TXnUiEnginePluginIf13ActivateViewLER15CXnNodePluginIf @ 191 NONAME - _ZN19TXnUiEnginePluginIf13AddDirtyNodeLER15CXnNodePluginIf @ 192 NONAME - _ZN19TXnUiEnginePluginIf13FindNodeByIdLERK6TDesC8S2_ @ 193 NONAME - _ZN19TXnUiEnginePluginIf13FindNodeByIdLERK7TDesC16S2_ @ 194 NONAME - _ZN19TXnUiEnginePluginIf13SwipeEnabledLEv @ 195 NONAME - _ZN19TXnUiEnginePluginIf14SetFocusedNodeEP15CXnNodePluginIf @ 196 NONAME - _ZN19TXnUiEnginePluginIf16FindNodeByClassLERK7TDesC16 @ 197 NONAME - _ZN19TXnUiEnginePluginIf16IsMenuDisplayingEv @ 198 NONAME - _ZN19TXnUiEnginePluginIf16ScreenDeviceSizeEv @ 199 NONAME - _ZN19TXnUiEnginePluginIf16SetFocusVisibleLEi @ 200 NONAME - _ZN19TXnUiEnginePluginIf17DisableRenderUiLCEv @ 201 NONAME - _ZN19TXnUiEnginePluginIf18IsDialogDisplayingEv @ 202 NONAME - _ZN19TXnUiEnginePluginIf18VerticalTwipValueLEP11CXnPropertyi @ 203 NONAME - _ZN19TXnUiEnginePluginIf19VerticalPixelValueLEP11CXnPropertyi @ 204 NONAME - _ZN19TXnUiEnginePluginIf20HorizontalTwipValueLEP11CXnPropertyi @ 205 NONAME - _ZN19TXnUiEnginePluginIf21HorizontalPixelValueLEP11CXnPropertyi @ 206 NONAME - _ZN19TXnUiEnginePluginIf22DeactivateFocusedNodeLEv @ 207 NONAME - _ZN19TXnUiEnginePluginIf26RestorePreviousFocusedNodeEv @ 208 NONAME - _ZN19TXnUiEnginePluginIf8EditModeEv @ 209 NONAME - _ZN19TXnUiEnginePluginIf9LayoutUILEP15CXnNodePluginIf @ 210 NONAME - _ZN19TXnUiEnginePluginIf9RenderUILEP15CXnNodePluginIf @ 211 NONAME - _ZN19TXnUiEnginePluginIf9ResourcesEv @ 212 NONAME - _ZN19TXnUiEnginePluginIf9RootNodeLEv @ 213 NONAME - _ZN19TXnUiEnginePluginIf9ShowFocusEv @ 214 NONAME - _ZN20CXnComponentNodeImpl10ConstructLEP7CXnType @ 215 NONAME - _ZN20CXnComponentNodeImpl12SetComponentEP12CXnComponent @ 216 NONAME - _ZN20CXnComponentNodeImpl14MakeInterfaceLERK6TDesC8 @ 217 NONAME - _ZN20CXnComponentNodeImpl25SetComponentNeedsCreationEi @ 218 NONAME - _ZN20CXnComponentNodeImpl4NewLEP7CXnType @ 219 NONAME - _ZN20CXnComponentNodeImpl9ComponentEv @ 220 NONAME - _ZN20CXnComponentNodeImplC1Ev @ 221 NONAME - _ZN20CXnComponentNodeImplC2Ev @ 222 NONAME - _ZN20CXnComponentNodeImplD0Ev @ 223 NONAME - _ZN20CXnComponentNodeImplD1Ev @ 224 NONAME - _ZN20CXnComponentNodeImplD2Ev @ 225 NONAME - _ZN8CXnUtils11CreateFontLER15CXnNodePluginIfRP5CFontRi @ 226 NONAME - _ZN8CXnUtils11CreateFontLERK7TDesC16i10TFontStyleRP5CFontRi @ 227 NONAME - _ZN8CXnUtils11GetRgbValueER4TRgbRK6TDesC8 @ 228 NONAME - _ZN8CXnUtils11StripQuotesERP7HBufC16 @ 229 NONAME - _ZN8CXnUtils12FindResourceER12CArrayPtrSegI11CXnResourceERK7TDesC16Ri @ 230 NONAME - _ZN8CXnUtils12ScaleBitmapLERK5TRectP10CFbsBitmapS4_ @ 231 NONAME - _ZN8CXnUtils13TextAlignmentER15CXnNodePluginIf @ 232 NONAME - _ZN8CXnUtils15ConvertHslToRgbEiii @ 233 NONAME - _ZN8CXnUtils18CollapseWhiteSpaceER15CXnNodePluginIfR6TDes16 @ 234 NONAME - _ZN8CXnUtils18ResolveSkinItemIDLERK7TDesC16R11TAknsItemIDRi @ 235 NONAME - _ZN8CXnUtils20HandlePowerSaveModeLEP7CXnNodeii @ 236 NONAME - _ZNK11CXnProperty7EqualsLERS_ @ 237 NONAME - _ZNK12CXnNodeAppIf12GetPropertyLER11CXnProperty @ 238 NONAME - _ZNK12CXnNodeAppIf12GetPropertyLERK6TDesC8 @ 239 NONAME - _ZNK12CXnNodeAppIf19InternalDomNodeTypeEv @ 240 NONAME - _ZNK12CXnNodeAppIf7ParentLEv @ 241 NONAME - _ZNK12CXnNodeAppIf9GetPCDataEv @ 242 NONAME - _ZNK14CXnApplication9AppDllUidEv @ 243 NONAME - _ZNK15CXnAppUiAdapter4ViewEv @ 244 NONAME - _ZNK15CXnNodePluginIf12GetPropertyLER11CXnProperty @ 245 NONAME - _ZNK15CXnNodePluginIf12GetPropertyLERK6TDesC8 @ 246 NONAME - _ZNK15CXnNodePluginIf7ControlEv @ 247 NONAME - _ZNK15CXnNodePluginIf7ParentLEv @ 248 NONAME - _ZNK15CXnNodePluginIf9GetPCDataEv @ 249 NONAME - _ZNK16TXnUiEngineAppIf14WidgetsVisibleEv @ 250 NONAME - _ZNK17CXnControlAdapter15LongTapDetectorEv @ 251 NONAME - _ZNK17CXnControlAdapter16ComponentControlEi @ 252 NONAME - _ZNK17CXnControlAdapter16DrawContentImageEv @ 253 NONAME - _ZNK17CXnControlAdapter16IsDrawingAllowedEv @ 254 NONAME - _ZNK17CXnControlAdapter22CountComponentControlsEv @ 255 NONAME - _ZNK17CXnControlAdapter4DrawERK5TRect @ 256 NONAME - _ZNK17CXnControlAdapter4DrawERK5TRectR9CWindowGc @ 257 NONAME - _ZNK19TXnUiEnginePluginIf14WidgetsVisibleEv @ 258 NONAME - _ZNK19TXnUiEnginePluginIf9HitRegionEv @ 259 NONAME - _ZNK20CXnComponentNodeImpl25DoesComponentNeedCreationEv @ 260 NONAME - _ZTI11CXnDocument @ 261 NONAME - _ZTI11CXnProperty @ 262 NONAME - _ZTI12CXnComponent @ 263 NONAME - _ZTI14CXnApplication @ 264 NONAME - _ZTI15CXnAppUiAdapter @ 265 NONAME - _ZTI16CXnViewsNodeImpl @ 266 NONAME - _ZTI16MXnNodePredicate @ 267 NONAME - _ZTI17CXnControlAdapter @ 268 NONAME - _ZTI18CXnListQueryDialog @ 269 NONAME - _ZTI19MXnComponentFactory @ 270 NONAME - _ZTI20CXnComponentNodeImpl @ 271 NONAME - _ZTI27CXnNodeBreadthFirstIteratorI7CXnNodeE @ 272 NONAME - _ZTIN21CXnControlAdapterImpl13TIconProviderE @ 273 NONAME - _ZTV11CXnDocument @ 274 NONAME - _ZTV11CXnProperty @ 275 NONAME - _ZTV12CXnComponent @ 276 NONAME - _ZTV14CXnApplication @ 277 NONAME - _ZTV15CXnAppUiAdapter @ 278 NONAME - _ZTV16CXnViewsNodeImpl @ 279 NONAME - _ZTV16MXnNodePredicate @ 280 NONAME - _ZTV17CXnControlAdapter @ 281 NONAME - _ZTV18CXnListQueryDialog @ 282 NONAME - _ZTV19MXnComponentFactory @ 283 NONAME - _ZTV20CXnComponentNodeImpl @ 284 NONAME - _ZTV27CXnNodeBreadthFirstIteratorI7CXnNodeE @ 285 NONAME - _ZTVN21CXnControlAdapterImpl13TIconProviderE @ 286 NONAME - _ZThn52_N17CXnControlAdapter19HandleControlEventLEP11CCoeControlN19MCoeControlObserver9TCoeEventE @ 287 NONAME - _ZThn60_N17CXnControlAdapter19HandleLongTapEventLERK6TPointS2_ @ 288 NONAME - _ZN15CXnAppUiAdapter20HandleEnterEditModeLEi @ 289 NONAME + _ZN12CXnComponent8SetDataLERK6TDesC8RK7TDesC16i @ 26 NONAME + _ZN12CXnComponentC1Ev @ 27 NONAME + _ZN12CXnComponentC2Ev @ 28 NONAME + _ZN12CXnComponentD0Ev @ 29 NONAME + _ZN12CXnComponentD1Ev @ 30 NONAME + _ZN12CXnComponentD2Ev @ 31 NONAME + _ZN12CXnNodeAppIf10BorderRectEv @ 32 NONAME + _ZN12CXnNodeAppIf10IsStateSetERK6TDesC8 @ 33 NONAME + _ZN12CXnNodeAppIf10MarginRectEv @ 34 NONAME + _ZN12CXnNodeAppIf10SetPCDataLERK6TDesC8 @ 35 NONAME + _ZN12CXnNodeAppIf11PaddingRectEv @ 36 NONAME + _ZN12CXnNodeAppIf11UnsetStateLERK6TDesC8 @ 37 NONAME + _ZN12CXnNodeAppIf12SetPropertyLEP11CXnProperty @ 38 NONAME + _ZN12CXnNodeAppIf13HideTooltipsLEv @ 39 NONAME + _ZN12CXnNodeAppIf13ShowTooltipsLEv @ 40 NONAME + _ZN12CXnNodeAppIf14MakeInterfaceLERK6TDesC8 @ 41 NONAME + _ZN12CXnNodeAppIf17SetPropertyArrayLEP13RPointerArrayI11CXnPropertyE @ 42 NONAME + _ZN12CXnNodeAppIf4RectEv @ 43 NONAME + _ZN12CXnNodeAppIf4TypeEv @ 44 NONAME + _ZN12CXnNodeAppIf9ChildrenLEv @ 45 NONAME + _ZN12CXnNodeAppIf9ComponentEv @ 46 NONAME + _ZN12CXnNodeAppIf9NamespaceEv @ 47 NONAME + _ZN12CXnNodeAppIf9SetStateLERK6TDesC8 @ 48 NONAME + _ZN12CXnNodeAppIf9UiEngineLEv @ 49 NONAME + _ZN14CXnApplication15CreateDocumentLEv @ 50 NONAME + _ZN14CXnApplicationC1E4TUid @ 51 NONAME + _ZN14CXnApplicationC2E4TUid @ 52 NONAME + _ZN14CXnApplicationD0Ev @ 53 NONAME + _ZN14CXnApplicationD1Ev @ 54 NONAME + _ZN14CXnApplicationD2Ev @ 55 NONAME + _ZN15CXnAppUiAdapter10ConstructLEv @ 56 NONAME + _ZN15CXnAppUiAdapter11RemoveViewLER8CAknView @ 57 NONAME + _ZN15CXnAppUiAdapter12HandleEventLERK7TDesC16R12CXnNodeAppIf @ 58 NONAME + _ZN15CXnAppUiAdapter13LoadPublisherER12CXnNodeAppIfi @ 59 NONAME + _ZN15CXnAppUiAdapter13PrepareToExitEv @ 60 NONAME + _ZN15CXnAppUiAdapter15ProcessMessageLE4TUidRK6TDesC8 @ 61 NONAME + _ZN15CXnAppUiAdapter16DestroyPublisherER12CXnNodeAppIfi @ 62 NONAME + _ZN15CXnAppUiAdapter16DynInitMenuItemLERK7TDesC16P13RPointerArrayI12CXnNodeAppIfE @ 63 NONAME + _ZN15CXnAppUiAdapter18HandleXuikonEventLER12CXnNodeAppIfS1_R10CXnDomNodeS3_ @ 64 NONAME + _ZN15CXnAppUiAdapter19HandleUiReadyEventLEv @ 65 NONAME + _ZN15CXnAppUiAdapter20HandleEnterEditModeLEi @ 66 NONAME + _ZN15CXnAppUiAdapter21HandleResourceChangeLEi @ 67 NONAME + _ZN15CXnAppUiAdapter9UiEngineLEv @ 68 NONAME + _ZN15CXnAppUiAdapterC1E4TUid @ 69 NONAME + _ZN15CXnAppUiAdapterC2E4TUid @ 70 NONAME + _ZN15CXnAppUiAdapterD0Ev @ 71 NONAME + _ZN15CXnAppUiAdapterD1Ev @ 72 NONAME + _ZN15CXnAppUiAdapterD2Ev @ 73 NONAME + _ZN15CXnNodePluginIf10BorderRectEv @ 74 NONAME + _ZN15CXnNodePluginIf10MarginRectEv @ 75 NONAME + _ZN15CXnNodePluginIf10SetPCDataLERK6TDesC8 @ 76 NONAME + _ZN15CXnNodePluginIf11PaddingRectEv @ 77 NONAME + _ZN15CXnNodePluginIf11UnsetStateLERK6TDesC8 @ 78 NONAME + _ZN15CXnNodePluginIf11VisibilityLEv @ 79 NONAME + _ZN15CXnNodePluginIf12SetPropertyLEP11CXnProperty @ 80 NONAME + _ZN15CXnNodePluginIf12ViewNodeImplEv @ 81 NONAME + _ZN15CXnNodePluginIf13SetBorderRectERK5TRect @ 82 NONAME + _ZN15CXnNodePluginIf13SetMarginRectERK5TRect @ 83 NONAME + _ZN15CXnNodePluginIf14IsFocusedStateEv @ 84 NONAME + _ZN15CXnNodePluginIf14MakeInterfaceLERK6TDesC8 @ 85 NONAME + _ZN15CXnNodePluginIf14SetPaddingRectERK5TRect @ 86 NONAME + _ZN15CXnNodePluginIf16SetHandleTooltipEi @ 87 NONAME + _ZN15CXnNodePluginIf16SetLayoutCapableEi @ 88 NONAME + _ZN15CXnNodePluginIf17ComponentNodeImplEv @ 89 NONAME + _ZN15CXnNodePluginIf19ReportTriggerEventLERK6TDesC8S2_S2_ @ 90 NONAME + _ZN15CXnNodePluginIf31SetPropertyWithoutNotificationLEP11CXnProperty @ 91 NONAME + _ZN15CXnNodePluginIf3IdLEv @ 92 NONAME + _ZN15CXnNodePluginIf4RectEv @ 93 NONAME + _ZN15CXnNodePluginIf4TypeEv @ 94 NONAME + _ZN15CXnNodePluginIf5PathLEv @ 95 NONAME + _ZN15CXnNodePluginIf6AppIfLEv @ 96 NONAME + _ZN15CXnNodePluginIf6LabelLEv @ 97 NONAME + _ZN15CXnNodePluginIf7SetRectERK5TRect @ 98 NONAME + _ZN15CXnNodePluginIf8DisplayLEv @ 99 NONAME + _ZN15CXnNodePluginIf9AddChildLEPS_ @ 100 NONAME + _ZN15CXnNodePluginIf9ChildrenLEv @ 101 NONAME + _ZN15CXnNodePluginIf9MaskPathLEv @ 102 NONAME + _ZN15CXnNodePluginIf9NamespaceEv @ 103 NONAME + _ZN15CXnNodePluginIf9SetDirtyLEv @ 104 NONAME + _ZN15CXnNodePluginIf9SetStateLERK6TDesC8 @ 105 NONAME + _ZN15CXnNodePluginIf9UiEngineLEv @ 106 NONAME + _ZN15CXnUiEngineImpl14EnableRenderUiEPv @ 107 NONAME + _ZN16CXnViewsNodeImpl10ConstructLEP7CXnType @ 108 NONAME + _ZN16CXnViewsNodeImpl12SetComponentEP12CXnComponent @ 109 NONAME + _ZN16CXnViewsNodeImpl4NewLEP7CXnType @ 110 NONAME + _ZN16CXnViewsNodeImpl9ComponentEv @ 111 NONAME + _ZN16CXnViewsNodeImplC1Ev @ 112 NONAME + _ZN16CXnViewsNodeImplC2Ev @ 113 NONAME + _ZN16CXnViewsNodeImplD0Ev @ 114 NONAME + _ZN16CXnViewsNodeImplD1Ev @ 115 NONAME + _ZN16CXnViewsNodeImplD2Ev @ 116 NONAME + _ZN16MXnNodePredicate5MatchER7CXnNode @ 117 NONAME + _ZN16MXnNodePredicateC1Ev @ 118 NONAME + _ZN16MXnNodePredicateC2Ev @ 119 NONAME + _ZN16MXnNodePredicateD0Ev @ 120 NONAME + _ZN16MXnNodePredicateD1Ev @ 121 NONAME + _ZN16MXnNodePredicateD2Ev @ 122 NONAME + _ZN16TXnUiEngineAppIf10ActiveViewEv @ 123 NONAME + _ZN16TXnUiEngineAppIf10IsEditModeEv @ 124 NONAME + _ZN16TXnUiEngineAppIf10StringPoolEv @ 125 NONAME + _ZN16TXnUiEngineAppIf11FocusedNodeEv @ 126 NONAME + _ZN16TXnUiEngineAppIf11SetUiEngineEP11CXnUiEngine @ 127 NONAME + _ZN16TXnUiEngineAppIf12RefreshMenuLEv @ 128 NONAME + _ZN16TXnUiEngineAppIf13FindNodeByIdLERK6TDesC8S2_ @ 129 NONAME + _ZN16TXnUiEngineAppIf13FindNodeByIdLERK7TDesC16S2_ @ 130 NONAME + _ZN16TXnUiEngineAppIf16FindNodeByClassLERK6TDesC8S2_ @ 131 NONAME + _ZN16TXnUiEngineAppIf16FindNodeByClassLERK7TDesC16S2_ @ 132 NONAME + _ZN16TXnUiEngineAppIf16GetThemeResourceERK7TDesC16R5RFile @ 133 NONAME + _ZN16TXnUiEngineAppIf16IsMenuDisplayingEv @ 134 NONAME + _ZN16TXnUiEngineAppIf19GetPluginNodeArrayLER13RPointerArrayI12CXnNodeAppIfE @ 135 NONAME + _ZN16TXnUiEngineAppIf23FindContentSourceNodesLERK6TDesC8 @ 136 NONAME + _ZN16TXnUiEngineAppIf9RenderUILEP12CXnNodeAppIf @ 137 NONAME + _ZN16TXnUiEngineAppIf9RootNodeLEv @ 138 NONAME + _ZN17CXnControlAdapter10ConstructLER15CXnNodePluginIf @ 139 NONAME + _ZN17CXnControlAdapter10LoadBitmapERK7TDesC16 @ 140 NONAME + _ZN17CXnControlAdapter10SetVisibleEi @ 141 NONAME + _ZN17CXnControlAdapter11SizeChangedEv @ 142 NONAME + _ZN17CXnControlAdapter11SkinChangedEv @ 143 NONAME + _ZN17CXnControlAdapter12FocusChangedE8TDrawNow @ 144 NONAME + _ZN17CXnControlAdapter12SetComponentEP12CXnComponent @ 145 NONAME + _ZN17CXnControlAdapter14ContentBitmapsERP10CFbsBitmapS2_ @ 146 NONAME + _ZN17CXnControlAdapter14OfferKeyEventLERK9TKeyEvent10TEventCode @ 147 NONAME + _ZN17CXnControlAdapter15SetLocalUiZoomLE10TAknUiZoom @ 148 NONAME + _ZN17CXnControlAdapter16GetBitmapAndMaskERK7TDesC16S2_RP10CFbsBitmapS5_ @ 149 NONAME + _ZN17CXnControlAdapter17SetContentBitmapsEP10CFbsBitmapS1_ @ 150 NONAME + _ZN17CXnControlAdapter17SetContentBitmapsERK7TDesC16S2_ @ 151 NONAME + _ZN17CXnControlAdapter18ExitPowerSaveModeLENS_10TModeEventE @ 152 NONAME + _ZN17CXnControlAdapter18ResetStylusCounterEv @ 153 NONAME + _ZN17CXnControlAdapter19EnterPowerSaveModeLENS_10TModeEventE @ 154 NONAME + _ZN17CXnControlAdapter19HandleControlEventLEP11CCoeControlN19MCoeControlObserver9TCoeEventE @ 155 NONAME + _ZN17CXnControlAdapter19HandleLongTapEventLERK6TPointS2_ @ 156 NONAME + _ZN17CXnControlAdapter19HandlePointerEventLERK13TPointerEvent @ 157 NONAME + _ZN17CXnControlAdapter20DoExitPowerSaveModeLENS_10TModeEventE @ 158 NONAME + _ZN17CXnControlAdapter21DoEnterPowerSaveModeLENS_10TModeEventE @ 159 NONAME + _ZN17CXnControlAdapter21HandlePropertyChangeLEP11CXnProperty @ 160 NONAME + _ZN17CXnControlAdapter22EnableLongTapAnimationEi @ 161 NONAME + _ZN17CXnControlAdapter23DoHandlePropertyChangeLEP11CXnProperty @ 162 NONAME + _ZN17CXnControlAdapter23MeasureAdaptiveContentLERK5TSize @ 163 NONAME + _ZN17CXnControlAdapter26HandleScreenDeviceChangedLEv @ 164 NONAME + _ZN17CXnControlAdapter4NewLER15CXnNodePluginIf @ 165 NONAME + _ZN17CXnControlAdapter8SetBlankEi @ 166 NONAME + _ZN17CXnControlAdapter8SetDataLERK6TDesC8RK7TDesC16i @ 167 NONAME + _ZN17CXnControlAdapter9ComponentEv @ 168 NONAME + _ZN17CXnControlAdapterC1Ev @ 169 NONAME + _ZN17CXnControlAdapterC2Ev @ 170 NONAME + _ZN17CXnControlAdapterD0Ev @ 171 NONAME + _ZN17CXnControlAdapterD1Ev @ 172 NONAME + _ZN17CXnControlAdapterD2Ev @ 173 NONAME + _ZN19MXnComponentFactory16MakeXnComponentLER15CXnNodePluginIfRP12CXnComponent @ 174 NONAME + _ZN19MXnComponentFactory18CreateXnComponentLER15CXnNodePluginIfRP12CXnComponent @ 175 NONAME + _ZN19MXnComponentFactory21MakeXnControlAdapterLER15CXnNodePluginIfP17CXnControlAdapter @ 176 NONAME + _ZN19MXnComponentFactory26DoesNodeNeedComponentImplLERK6TDesC8 @ 177 NONAME + _ZN19MXnComponentFactoryC2Ev @ 178 NONAME + _ZN19MXnComponentFactoryD0Ev @ 179 NONAME + _ZN19MXnComponentFactoryD1Ev @ 180 NONAME + _ZN19MXnComponentFactoryD2Ev @ 181 NONAME + _ZN19TXnUiEnginePluginIf10StringPoolEv @ 182 NONAME + _ZN19TXnUiEnginePluginIf11PluginNodeLEP15CXnNodePluginIf @ 183 NONAME + _ZN19TXnUiEnginePluginIf12FocusedNodeLEv @ 184 NONAME + _ZN19TXnUiEnginePluginIf13AddDirtyNodeLER15CXnNodePluginIf @ 185 NONAME + _ZN19TXnUiEnginePluginIf13FindNodeByIdLERK6TDesC8S2_ @ 186 NONAME + _ZN19TXnUiEnginePluginIf13FindNodeByIdLERK7TDesC16S2_ @ 187 NONAME + _ZN19TXnUiEnginePluginIf14SetFocusedNodeEP15CXnNodePluginIf @ 188 NONAME + _ZN19TXnUiEnginePluginIf16FindNodeByClassLERK7TDesC16 @ 189 NONAME + _ZN19TXnUiEnginePluginIf16IsMenuDisplayingEv @ 190 NONAME + _ZN19TXnUiEnginePluginIf16ScreenDeviceSizeEv @ 191 NONAME + _ZN19TXnUiEnginePluginIf17DisableRenderUiLCEv @ 192 NONAME + _ZN19TXnUiEnginePluginIf18IsDialogDisplayingEv @ 193 NONAME + _ZN19TXnUiEnginePluginIf18IsTextEditorActiveEv @ 194 NONAME + _ZN19TXnUiEnginePluginIf18VerticalTwipValueLEP11CXnPropertyi @ 195 NONAME + _ZN19TXnUiEnginePluginIf19VerticalPixelValueLEP11CXnPropertyi @ 196 NONAME + _ZN19TXnUiEnginePluginIf20HorizontalTwipValueLEP11CXnPropertyi @ 197 NONAME + _ZN19TXnUiEnginePluginIf21HorizontalPixelValueLEP11CXnPropertyi @ 198 NONAME + _ZN19TXnUiEnginePluginIf23EnablePartialTouchInputER15CXnNodePluginIfi @ 199 NONAME + _ZN19TXnUiEnginePluginIf8EditModeEv @ 200 NONAME + _ZN19TXnUiEnginePluginIf9LayoutUILEP15CXnNodePluginIf @ 201 NONAME + _ZN19TXnUiEnginePluginIf9RenderUILEP15CXnNodePluginIf @ 202 NONAME + _ZN19TXnUiEnginePluginIf9ResourcesEv @ 203 NONAME + _ZN19TXnUiEnginePluginIf9RootNodeLEv @ 204 NONAME + _ZN20CXnComponentNodeImpl10ConstructLEP7CXnType @ 205 NONAME + _ZN20CXnComponentNodeImpl12SetComponentEP12CXnComponent @ 206 NONAME + _ZN20CXnComponentNodeImpl14MakeInterfaceLERK6TDesC8 @ 207 NONAME + _ZN20CXnComponentNodeImpl25SetComponentNeedsCreationEi @ 208 NONAME + _ZN20CXnComponentNodeImpl4NewLEP7CXnType @ 209 NONAME + _ZN20CXnComponentNodeImpl9ComponentEv @ 210 NONAME + _ZN20CXnComponentNodeImplC1Ev @ 211 NONAME + _ZN20CXnComponentNodeImplC2Ev @ 212 NONAME + _ZN20CXnComponentNodeImplD0Ev @ 213 NONAME + _ZN20CXnComponentNodeImplD1Ev @ 214 NONAME + _ZN20CXnComponentNodeImplD2Ev @ 215 NONAME + _ZN8CXnUtils11CreateFontLER15CXnNodePluginIfRP5CFontRi @ 216 NONAME + _ZN8CXnUtils11CreateFontLERK7TDesC16i10TFontStyleRP5CFontRi @ 217 NONAME + _ZN8CXnUtils11GetRgbValueER4TRgbRK6TDesC8 @ 218 NONAME + _ZN8CXnUtils11StripQuotesERP7HBufC16 @ 219 NONAME + _ZN8CXnUtils12FindResourceER12CArrayPtrSegI11CXnResourceERK7TDesC16Ri @ 220 NONAME + _ZN8CXnUtils12ScaleBitmapLERK5TRectP10CFbsBitmapS4_ @ 221 NONAME + _ZN8CXnUtils13TextAlignmentER15CXnNodePluginIf @ 222 NONAME + _ZN8CXnUtils15ConvertHslToRgbEiii @ 223 NONAME + _ZN8CXnUtils18CollapseWhiteSpaceER15CXnNodePluginIfR6TDes16 @ 224 NONAME + _ZN8CXnUtils18ResolveSkinItemIDLERK7TDesC16R11TAknsItemIDRi @ 225 NONAME + _ZN8CXnUtils20HandlePowerSaveModeLEP7CXnNodeii @ 226 NONAME + _ZNK11CXnProperty7EqualsLERS_ @ 227 NONAME + _ZNK12CXnNodeAppIf12GetPropertyLER11CXnProperty @ 228 NONAME + _ZNK12CXnNodeAppIf12GetPropertyLERK6TDesC8 @ 229 NONAME + _ZNK12CXnNodeAppIf19InternalDomNodeTypeEv @ 230 NONAME + _ZNK12CXnNodeAppIf7ParentLEv @ 231 NONAME + _ZNK12CXnNodeAppIf9GetPCDataEv @ 232 NONAME + _ZNK14CXnApplication9AppDllUidEv @ 233 NONAME + _ZNK15CXnAppUiAdapter4ViewEv @ 234 NONAME + _ZNK15CXnNodePluginIf12GetPropertyLER11CXnProperty @ 235 NONAME + _ZNK15CXnNodePluginIf12GetPropertyLERK6TDesC8 @ 236 NONAME + _ZNK15CXnNodePluginIf7ControlEv @ 237 NONAME + _ZNK15CXnNodePluginIf7ParentLEv @ 238 NONAME + _ZNK15CXnNodePluginIf9GetPCDataEv @ 239 NONAME + _ZNK16TXnUiEngineAppIf14WidgetsVisibleEv @ 240 NONAME + _ZNK17CXnControlAdapter15LongTapDetectorEv @ 241 NONAME + _ZNK17CXnControlAdapter16ComponentControlEi @ 242 NONAME + _ZNK17CXnControlAdapter16DrawContentImageEv @ 243 NONAME + _ZNK17CXnControlAdapter16IsDrawingAllowedEv @ 244 NONAME + _ZNK17CXnControlAdapter22CountComponentControlsEv @ 245 NONAME + _ZNK17CXnControlAdapter4DrawERK5TRect @ 246 NONAME + _ZNK17CXnControlAdapter4DrawERK5TRectR9CWindowGc @ 247 NONAME + _ZNK19TXnUiEnginePluginIf14WidgetsVisibleEv @ 248 NONAME + _ZNK20CXnComponentNodeImpl25DoesComponentNeedCreationEv @ 249 NONAME + _ZTI11CXnDocument @ 250 NONAME + _ZTI11CXnProperty @ 251 NONAME + _ZTI12CXnComponent @ 252 NONAME + _ZTI14CXnApplication @ 253 NONAME + _ZTI15CXnAppUiAdapter @ 254 NONAME + _ZTI16CXnViewsNodeImpl @ 255 NONAME + _ZTI16MXnNodePredicate @ 256 NONAME + _ZTI17CXnControlAdapter @ 257 NONAME + _ZTI18CXnListQueryDialog @ 258 NONAME + _ZTI19MXnComponentFactory @ 259 NONAME + _ZTI20CXnComponentNodeImpl @ 260 NONAME + _ZTI27CXnNodeBreadthFirstIteratorI7CXnNodeE @ 261 NONAME + _ZTIN21CXnControlAdapterImpl13TIconProviderE @ 262 NONAME + _ZTV11CXnDocument @ 263 NONAME + _ZTV11CXnProperty @ 264 NONAME + _ZTV12CXnComponent @ 265 NONAME + _ZTV14CXnApplication @ 266 NONAME + _ZTV15CXnAppUiAdapter @ 267 NONAME + _ZTV16CXnViewsNodeImpl @ 268 NONAME + _ZTV16MXnNodePredicate @ 269 NONAME + _ZTV17CXnControlAdapter @ 270 NONAME + _ZTV18CXnListQueryDialog @ 271 NONAME + _ZTV19MXnComponentFactory @ 272 NONAME + _ZTV20CXnComponentNodeImpl @ 273 NONAME + _ZTV27CXnNodeBreadthFirstIteratorI7CXnNodeE @ 274 NONAME + _ZTVN21CXnControlAdapterImpl13TIconProviderE @ 275 NONAME + _ZThn52_N17CXnControlAdapter19HandleControlEventLEP11CCoeControlN19MCoeControlObserver9TCoeEventE @ 276 NONAME + _ZThn60_N17CXnControlAdapter19HandleLongTapEventLERK6TPointS2_ @ 277 NONAME diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/group/xnlayoutengine.mmp --- a/idlehomescreen/xmluirendering/uiengine/group/xnlayoutengine.mmp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/group/xnlayoutengine.mmp Wed May 12 13:22:51 2010 +0300 @@ -65,11 +65,6 @@ SOURCE xneditmode.cpp SOURCE xneditor.cpp SOURCE xnpropertysubscriber.cpp -SOURCE xngesturehelper.cpp -SOURCE xngesture.cpp -SOURCE xngesturerecogniser.cpp -SOURCE xnpointarray.cpp -SOURCE xnhittest.cpp SOURCE xnplugindata.cpp SOURCE xnviewdata.cpp SOURCE xnrootdata.cpp @@ -81,11 +76,13 @@ SOURCE xnwallpaperview.cpp SOURCE xnwallpapercontainer.cpp SOURCE xneffectmanager.cpp -SOURCE xnbgcontrol.cpp SOURCE xninactivitymonitor.cpp SOURCE xnfocuscontrol.cpp SOURCE xnextrenderingpluginwrapper.cpp SOURCE xnbackgroundmanager.cpp +SOURCE xnviewcontroladapter.cpp +SOURCE xnspbgcleaner.cpp +SOURCE xnwaitdialog.cpp START RESOURCE xnuiengine.rss HEADER @@ -93,6 +90,11 @@ LANGUAGE_IDS END +START RESOURCE xnwallpaperview.rss +HEADER +TARGETPATH APP_RESOURCE_DIR +LANGUAGE_IDS +END USERINCLUDE ../inc // uiengine USERINCLUDE ../../inc // xmluirendering @@ -108,6 +110,7 @@ LIBRARY bafl.lib LIBRARY eikcoctl.lib LIBRARY eikcore.lib +LIBRARY eikdlg.lib LIBRARY egul.lib LIBRARY fbscli.lib LIBRARY ws32.lib @@ -150,6 +153,8 @@ LIBRARY extrenderingplugin.lib LIBRARY disknotifyhandler.lib LIBRARY platformenv.lib +LIBRARY hspluginsettings.lib +LIBRARY akntouchgesturefw.lib #if defined(_XN3_DEBUG_) || defined(AI3_DEBUG_PERFORMANCE) LIBRARY flogger.lib diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnappuiadapterimpl.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnappuiadapterimpl.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnappuiadapterimpl.h Wed May 12 13:22:51 2010 +0300 @@ -21,7 +21,8 @@ // System includes #include - +#include // for MProgressDialogCallback +#include "xnpropertysubscriber.h" // for CXnPropertySubscriber // Forward declarations class CXnUiEngine; @@ -34,6 +35,7 @@ class CHsCcProviderClient; class CXnEffectManager; class MHsContentControl; +class CXnWaitDialog; // Constants @@ -46,7 +48,9 @@ * @lib xn3layoutengine.lib * @since Series 60 3.1 */ -NONSHARABLE_CLASS( CXnAppUiAdapterImpl ) : public CBase +NONSHARABLE_CLASS( CXnAppUiAdapterImpl ) : public CBase, + public MXnPropertyChangeObserver, + public MProgressDialogCallback { public: // Constructors and destructor @@ -116,7 +120,15 @@ * @return Content control UI interface, NULL if not present */ MHsContentControlUi* HsContentController( const TDesC8& aType ) const; - + + /** + * Gets the Content control factory + * + * @since S60 5.0 + * @return Content control factory + */ + CHsContentControlFactory* HsContentControlFactory(); + /** * Get the effect manager * @@ -148,6 +160,15 @@ */ void HandleResourceChangeL( TInt aType ); +public: // From MProgressDialogCallback + + /** + * Callback method from MProgressDialogCallback interface. + * Gets called when a dialog is dismissed. + * @param aButtonId Id of the pushed button. + */ + void DialogDismissedL( TInt aButtonId ); + private: /** @@ -156,6 +177,18 @@ CXnAppUiAdapterImpl( TUid aApplicationUid, CXnAppUiAdapter& aAdapter ); +private: + // from MXnPropertyChangeObserver + void PropertyChangedL( const TUint32 aKey, const TInt aValue ); + +private: + // new functions + + /** + * Launches wait dialog during backup/restore. + */ + void DisplayWaitDialogL(); + private: // Data /** AppUi, Not owned. */ @@ -177,7 +210,11 @@ /** Effect manager, Owned */ CXnEffectManager* iEffectManager; /** Resource offset */ - TInt iResourceOffset; + TInt iResourceOffset; + /** Wait dialog, Owned */ + CXnWaitDialog* iXnWaitDialog; + /** Publish&Subscribe observer for Backup & Restore, Owned */ + CXnPropertySubscriber* iBackupRestoreObserver; }; #endif // XNAPPUIADAPTERIMPL_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnbackgroundmanager.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnbackgroundmanager.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnbackgroundmanager.h Wed May 12 13:22:51 2010 +0300 @@ -20,7 +20,7 @@ // System includes #include -#include +#include #include #include @@ -28,6 +28,7 @@ class CXnViewManager; class CXnViewData; class CAknsLayeredBackgroundControlContext; +class CXnOomSysHandler; namespace hspswrapper { @@ -46,6 +47,13 @@ { public: + enum WppType + { + ENone, + ECommon, + EPageSpecific + }; + /** * Two-phased constructor. * @param aWrapper HSPS wrapper @@ -74,7 +82,7 @@ * @since S60 5.0 * @param aFileName WallpaperImage image path and filename * @return Error code. - */ + */ TInt AddWallpaperL( const TDesC& aFileName ); /** @@ -86,11 +94,11 @@ void DeleteWallpaper( CXnViewData& aViewData ); /** - * Checks whether page specific wallpaper feature is activated or not. + * Returns wallpaper type. * * @since S60 5.0 */ - TBool ActivatedL(); + CXnBackgroundManager::WppType WallpaperType(); /** * Shows wallpaper change dialog @@ -106,7 +114,15 @@ * @param aOldView Old view * @param aNewView New view */ - void WallpaperChanged( CXnViewData& aOldView, CXnViewData& aNewView ); + void WallpaperChanged( const CXnViewData& aOldView, + const CXnViewData& aNewView ); + + /** + * Draws wallpaper immediately, or once the window comes visible. + * + * @since S60 5.0 + */ + void UpdateScreen(); public: // Functions from base classes @@ -147,7 +163,7 @@ /** * From MDiskNotifyHandlerCallback. */ - void HandleNotifyDisk( TInt aError, const TDiskEvent& aEvent ); + void HandleNotifyDisk( TInt aError, const TDiskEvent& aEvent ); private: @@ -172,8 +188,15 @@ void CheckFeatureTypeL(); TInt AddPageSpecificWallpaperL( const TDesC& aFileName ); TInt AddCommonWallpaperL( const TDesC& aFileName, TBool aSave = ETrue ); - void ReadWallpaperFromCenrepL(); - void UpdateScreen(); + void ReadWallpaperFromCenrepL(); + void DrawEditModeBackgroundSkin() const; + CXnOomSysHandler& OomSysHandler() const; + void DrawStatusPaneMask() const; + + /** + * Callback function to be used with CPeriodic. + */ + static TInt TimerCallback( TAny *aPtr ); private: // data @@ -217,11 +240,10 @@ TRect iRect; /** - * States whether page specific wallpaper is supported or - * same wallpaper is shown in all pages. + * Stores wallpaper type. */ - TBool iFeatureSuppoted; - + CXnBackgroundManager::WppType iType; + /** * Internal wallpaper update in progress */ @@ -239,6 +261,13 @@ */ CFbsBitmap* iBgImage; + /** + * Pointer to status pane mask. Drawn on top of a wallpaper in + * the status pane area. + * Own. + */ + CFbsBitmap* iSpMask; + /** * Path of the wallpaper image, including filename. * This is used only if same wallpaper @@ -247,6 +276,18 @@ */ HBufC* iBgImagePath; + /** + * Periodic timer. + * Own. + */ + CPeriodic* iTimer; + + /** + * OOM system handler. + * Own. + */ + CXnOomSysHandler* iOomSysHandler; + }; #endif // CXNBACKGROUNDMANAGER_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnbgcontrol.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnbgcontrol.h Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* 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: Background appearance drawer -* -*/ - - -#ifndef _XNBGCONTROL_H -#define _XNBGCONTROL_H - -// System includes -#include -#include - -// User includes -#include "xnuistatelistener.h" - -// Forward declarations - -/** - * Background appearance drawer - * - * @ingroup group_xnlayoutengine - * @lib xn3layoutengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CXnBgControl ) : public CCoeControl , public MXnUiStateObserver - { -public: - // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CXnBgControl* NewL(); - - /** - * Two-phased constructor. Leaving on stack - */ - static CXnBgControl* NewLC(); - - /** - * Destructor - */ - ~CXnBgControl(); - -private: - // private constructors - - /** - * Leaving constructor - */ - void ConstructL(); - - /** - * C++ default constructor - */ - CXnBgControl(); - -public: - // from CCoeControl - - /** - * @see CCoeControl - */ - TInt CountComponentControls() const; - - /** - * @see CCoeControl - */ - CCoeControl* ComponentControl( TInt aIndex ) const; - - /** - * @see CCoeControl - */ - void SizeChanged(); - - /** - * @see CCoeControl - */ - void Draw( const TRect& aRect ) const; - - /** - * @see CCoeControl - */ - void HandlePointerEventL( const TPointerEvent& aPointerEvent ); - -public: - // new functions - void SetCompoundControl( CCoeControl* aControl ); - - /** - * Service for removing grabbing controls - */ - void ResetGrabbingL(); - - /** - * Prepares control for destroying - */ - void PrepareDestroy(); - -private: - // new functions - - /** - * Removes recursively grabbing controls - */ - void RemoveGrabbingControL( const CCoeControl* aControl, const TPointerEvent& aEvent ) const; - -private: - // from MXnUiStateObserver - - /** - * @see MXnUiStateObserver - */ - void NotifyForegroundChanged( TForegroundStatus aStatus ); - - /** - * @see MXnUiStateObserver - */ - void NotifyLightStatusChanged( TBool aLightsOn ); - - /** - * @see MXnUiStateObserver - */ - void NotifyInCallStateChaged( TBool aInCall ); - -private: - // data - - /** Compound Control, Not owned */ - CCoeControl* iControl; - - /** stored point of EButton1Down */ - TPoint iHitpoint; - - }; - -#endif // _XNBGCONTROL_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xncontroladapterimpl.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xncontroladapterimpl.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xncontroladapterimpl.h Wed May 12 13:22:51 2010 +0300 @@ -25,9 +25,7 @@ #include #include #include - -// User includes -#include "xngesturehelper.h" +#include // Forward declarations class CXnNodePluginIf; @@ -45,19 +43,7 @@ const TInt KSpaceChar = 32; const TInt KRightParenthesis = ')'; -/** - * XnGestureHelper namespace - * Used for the whole gesture family - Gesture recognizer, gesture helper, - * Point array - */ -namespace XnGestureHelper - { - class CXnGestureHelper; - } - -using XnGestureHelper::CXnGestureHelper; - - +using namespace AknTouchGestureFw; // Class declaration /** @@ -68,7 +54,8 @@ * @since Series 60 3.1 */ NONSHARABLE_CLASS( CXnControlAdapterImpl ) : public CBase, - public MAknsEffectAnimObserver + public MAknsEffectAnimObserver, + public MAknTouchGestureFwObserver { public: @@ -444,12 +431,11 @@ CXnProperty* aProperty ); /** - * Forwards event to gesture helper + * Sets up gesture on buttondown event * * @param aPointerEvent Event to be forwarded - * @return ETrue when swipe took place, EFalse otherwise */ - TBool PassEventToGestureHelperL( + void InitializeGestureL( const TPointerEvent& aPointerEvent ); /* @@ -464,6 +450,14 @@ */ RPointerArray< CXnControlAdapter >& ChildAdapters(); +private: // from MAknTouchGestureFwObserver + /** + * Implements gesture handling + * + * @see MAknTouchGestureFwObserver + */ + void HandleTouchGestureL( MAknTouchGestureFwEvent& aEvent ); + protected: // New functions @@ -483,6 +477,7 @@ void DrawBackgroundDataL( const TRect& aRect, CXnNode& aNode, CWindowGc& aGc ); void DrawEditModeBgData( CXnNode& aNode, CWindowGc& aGc ); + void DrawPlusSign( CXnNode& aNode, CWindowGc& aGc ); void DrawTransparentColorL( CXnNode& aNode, CWindowGc& aGc, CFbsBitmap* aMask ); void DrawBackgroundSkinL( CXnNode& aNode, CFbsBitmap* aMask, @@ -492,6 +487,7 @@ void DrawBackgroundImageL( const TRect& aRect, CXnNode& aNode, CWindowGc& aGc, CFbsBitmap* aBitmap, CFbsBitmap* aMask ); RFs& FsSession(); + TBool IsDragThresholdExceeded( const TPoint& aPoint ); private: // Data @@ -550,12 +546,16 @@ TAknsItemID iAnimIID; /** flag: skin animation id is resolved from the CSS property */ TBool iAnimIDResolved; - /** pointer to gesturehelper */ - CXnGestureHelper* iGestureHelper; /** flag: for storing blank state */ TBool iBlank; /** flag: to detect whether longtap occured */ TBool iLongtap; + /** Gesture framework, owned. */ + CAknTouchGestureFw* iGestureFw; + /** Gesture destination, Not owned. */ + CXnNode* iGestureDestination; + /** Starting point of button down event. */ + TPoint iButtonDownStartPoint; }; #endif //__XNCONTROLADAPTERIMPL_H__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xneditor.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xneditor.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xneditor.h Wed May 12 13:22:51 2010 +0300 @@ -39,6 +39,7 @@ class CXnViewData; class CRepository; class CXnBackgroundManager; +class CXnOomSysHandler; namespace hspswrapper { @@ -139,7 +140,7 @@ * @since S60 5.0 * @param aContentInfo content info */ - void ReplaceWidgetL( CHsContentInfo& aContentInfo, TBool aUseHsps = ETrue ); + void ReplaceWidgetL( CHsContentInfo& aContentInfo ); /** * Commit a new order of plugins to the HSPS. * @@ -199,9 +200,13 @@ // from MHsContentController TInt WidgetListL( CHsContentInfoArray& aArray ); - + + TInt WidgetListL( CHsContentInfo& aInfo, CHsContentInfoArray& aArray ); + TInt ViewListL( CHsContentInfoArray& aArray ); - + + TInt ViewListL( CHsContentInfo& aInfo, CHsContentInfoArray& aArray ); + TInt AppListL( CHsContentInfoArray& aArray ); TInt AddWidgetL( CHsContentInfo& aInfo ); @@ -236,20 +241,21 @@ private: // new functions - void TemplatedWidgetsL( RPointerArray< CHsContentInfo >& aWidgets ); - - void HSPSPluginsL( RPointerArray< CHsContentInfo >& aWidgets, - const TDesC8& aType ); - - CPublisherInfo* PublisherInfoL( const CHsContentInfo& aContentInfo ); + CPublisherInfo* PublisherInfoL( const CHsContentInfo& aContentInfo ); TInt TemplateWidgetCanBeAddedRemovedL( CHsContentInfo& aContentInfo ); TInt NonTemplateWidgetCanBeAddedRemovedL( CHsContentInfo& aContentInfo ); TBool IsCurrentViewFull(); - void FilterWidgetListL( CHsContentInfoArray& aContentInfoArray, + + /** + * Filters plugins from the list and checks whether the plugins can be added or removed. + */ + void FilterPluginsL( CHsContentInfoArray& aContentInfoArray, TBool aIgnoreViewFull ); + void FilterViewListL( CHsContentInfoArray& aContentInfoArray ); + CXnOomSysHandler& OomSysHandler() const; /** * Notifies the MHsContentControl and the MHsContentControlUi if widget list was changed. @@ -260,7 +266,51 @@ * Notifies the MHsContentControl and the MHsContentControlUi if view list was changed. */ void ViewListChanged(); + + /** + * Creates content info for defined plugin + */ + CHsContentInfo* CreateContentInfoLC( CXnPluginData& aPlugin, + RPointerArray< CHsContentInfo >& aInfos ); + + /** + * Appends plugin configurations to the content info array. + */ + void AppendPluginsL( + RPointerArray< hspswrapper::CPluginInfo > aPlugins, + RPointerArray< CHsContentInfo >& aWidgets ); + + /** + * Resets runtime cache. + */ + void ResetCache(); + + /** + * Retrieves native application configuration plugins from HSPS + */ + void HspsApplicationPluginsL( RPointerArray< CHsContentInfo >& aWidgets ); + + /** + * Retrieves native view configuration plugins from HSPS + */ + void HspsViewPluginsL( RPointerArray< CHsContentInfo >& aWidgets ); + + /** + * Retrieves widget and template configuration plugins from HSPS + */ + void HspsWidgetPluginsL( RPointerArray< CHsContentInfo >& aWidgets ); + void DoHspsWidgetPluginsL(); + + /** + * Retrieves publishers from CPS and them with the HSPS's template plugins + */ + void CpsWidgetPluginsL( RPointerArray< CHsContentInfo >& aWidgets ); + /** + * Checks whether the view is full + */ + TBool IsViewFull( CXnViewData& aViewData ); + private: // from MXnViewObserver @@ -312,6 +362,9 @@ TBool iWidgetsVisibilityState; /** Central repository , to choose plugin, owned*/ CRepository* iRepository; + /** Plugins cache, owned */ + RPointerArray< hspswrapper::CPluginInfo > iPluginsCache; + CXnOomSysHandler* iOomSysHandler; }; #endif // C_XNEDITOR_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xneffectmanager.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xneffectmanager.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xneffectmanager.h Wed May 12 13:22:51 2010 +0300 @@ -20,14 +20,42 @@ #ifndef CXNEFFECTMANAGER_H #define CXNEFFECTMANAGER_H -// INCLUDES +// System incldues #include -// CLASS DECLARATION +// User includes + +// Forward declarations class CXnPluginData; class CXnViewData; class CXnNode; +// Constants + +// Control effect context ids +#define KGfxContextAddWidget TUid::Uid( 0x102750F4 ) +#define KGfxContextRemoveWidget TUid::Uid( 0x102750F4 ) +#define KGfxContextActivateNextView TUid::Uid( 0x102750F1 ) +#define KGfxContextActivatePrevView TUid::Uid( 0x102750F2 ) +#define KGfxContextBgAppear TUid::Uid( 0x102750F3 ) + +// Control effect action ids +#define KGfxControlActionAppear 3 +#define KGfxControlActionDisappear 4 + +#define KGfxControlActionAppearPrt 3 +#define KGfxControlActionDisappearPrt 5 +#define KGfxControlActionAppearLsc 6 +#define KGfxControlActionDisappearLsc 7 + +#define KGfxControlActionBgImgToImgAppear 3 +#define KGfxControlActionBgAnimToImgAppear 5 + +// Full screen effect ids +#define KGfxContextOpenWallpaperView 1007 +#define KGfxContextCloseWallpaperView 1008 + +// Class declaration /** * Struct which holds needed info of effect. */ @@ -35,7 +63,6 @@ { CXnNode* iNode; TInt iState; - TInt iType; TInt iId; }; @@ -48,6 +75,8 @@ NONSHARABLE_CLASS( CXnEffectManager ) : public CBase { public: + // constructor and destructor + /** * Two-phased constructor. * @return new instance of CXnEffectManager. @@ -58,23 +87,14 @@ * Destructor. */ ~CXnEffectManager(); - - /** - * Begin handling of control effect. - * @param aId effect id - * @aPlugin Plugin data - */ - void BeginControlEffectL( TInt aId, CXnPluginData& aPlugin ); - - /** - * Begin handling of control effect. - * @param aId effect id - * @aPlugins Array of plugin datas - */ - void BeginControlEffectL( TInt aId, RPointerArray& aPlugins ); + +public: + // new functions /** * Begin handling of fullscreen effect. + * + * @since S60 5.2 * @param aId effect id * @aView view data */ @@ -82,58 +102,56 @@ /** * When UiRendered is called effect is ended and will be drawn + * + * @since S60 5.2 */ void UiRendered(); /** * When UiLayouted is called effect is started if it was not started earlier. + * + * @since S60 5.2 */ void UiLayouted(); private: + // new functions + /** * Starts fullscreen effect. + * + * @since S60 5.2 * @param aEffect effect data * @return ETrue if effect started, otherwise EFalse */ TBool DoBeginFullscreenEffect( TXnEffect& aEffect ); - - /** - * Starts control effect. - * @param aEffect effect data - * @return ETrue if effect started, otherwise EFalse - */ - TBool DoBeginControlEffect( TXnEffect& aEffect ); /** * Removes and destroys effect from effect list. + * + * @since S60 5.2 * @param aEffect effect data */ void RemoveEffect( TXnEffect* aEffect ); - - /** - * Return number of ongoing effects of given type. - * @param aType effect type, fullscreen or control - * - * @return Number of ongoing effects of given type - */ - TInt EffectCount( TInt aType ); + +private: + // constructors /** - * C++ default constructor. + * C++ default constructor */ CXnEffectManager(); /** - * By default Symbian 2nd phase constructor is private. + * 2nd phase constructor */ void ConstructL(); -private: // data - /** - * List of started effects. - */ - RPointerArray iEffects; +private: + // data + + /** List of started effects, owned */ + RPointerArray iEffects; }; #endif // CXNEFFECTMANAGER_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnextrenderingpluginwrapper.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnextrenderingpluginwrapper.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnextrenderingpluginwrapper.h Wed May 12 13:22:51 2010 +0300 @@ -21,6 +21,7 @@ // System includes #include #include +#include // User includes #include "xncontroladapter.h" @@ -39,7 +40,7 @@ * @lib extrenderingplugin.lib * @since S60 v5.0 */ -NONSHARABLE_CLASS( CXnExtRenderingPluginWrapper ) : public CXnControlAdapter +NONSHARABLE_CLASS( CXnExtRenderingPluginWrapper ) : public CXnControlAdapter, public MXnExtEventHandler { public: // Constructor and destructor /** @@ -83,6 +84,16 @@ TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); + /** + * Routes the data stream for the external rendering plugin. + * + * @since Series 60 5.2 + * @param aData Data stream. + * @param aType Type of the stream. + * @param aIndex Index of the data. + */ + void SetDataL( const TDesC8& aData, const TDesC& aType, TInt aIndex ); + public: // New functions /** @@ -93,8 +104,16 @@ /** * @see CXnControlAdapter */ - void DoExitPowerSaveModeL( TModeEvent aEvent ); - + void DoExitPowerSaveModeL( TModeEvent aEvent ); + + /** + * Routes the events from the external rendering plug-ins to content plug-ins + * @since Series 60 5.2 + * @param aEvent Event string + * @param aDestination Destination content plug-in. + */ + void HandleEventL( const TDesC& aEvent, const TDesC8& aDestination ); + private: // Data /** diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnfocuscontrol.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnfocuscontrol.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnfocuscontrol.h Wed May 12 13:22:51 2010 +0300 @@ -22,9 +22,6 @@ // System includes #include -// User includes -#include "xninactivitymonitor.h" - // Forward declarations class CXnAppUiAdapter; class CWindowGc; @@ -36,8 +33,7 @@ * @lib xn3layoutengine.lib * @since S60 5.0 */ -NONSHARABLE_CLASS( CXnFocusControl ) : public CBase, - public MXnInactivityObserver +NONSHARABLE_CLASS( CXnFocusControl ) : public CBase { public: // Constructors and destructor @@ -70,14 +66,6 @@ */ CXnFocusControl( CXnAppUiAdapter& aAppUiAdapter ); -private: - // from MXnInactivityObserver - - /** - * @see MXnInactivityObserver - */ - void InactivityTimerExpired(); - public: // new functions @@ -116,8 +104,6 @@ /** AppUiAdapter, Not owned */ CXnAppUiAdapter& iAppUiAdapter; - /** Inactivity monitor, Owned */ - CXnInactivityMonitor* iMonitor; /** Flag to indicate whether it is allowed to show focus */ TBool iVisible; /** Flag to indicate refusal */ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xngesture.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xngesture.h Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,367 +0,0 @@ -/* -* 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: Gesture class -* -*/ - - -#ifndef _XNGESTURE_H_ -#define _XNGESTURE_H_ - -// System includes -#include - -// User includes -#include "xnpointarray.h" -#include "xngesturerecogniser.h" - -// Namespace declaration - -/** - * XnGestureHelper namespace - * Used for the whole gesture family - Gesture recognizer, gesture helper, - * Point array - */ -namespace XnGestureHelper - { - - /** - * Struct for a point in floating-point represanation - */ - NONSHARABLE_STRUCT( TRealPoint ) - { - inline TRealPoint(); - inline TRealPoint( const TRealPoint& aPoint ); - inline TRealPoint( TReal aX, TReal aY ); - inline TBool operator==( const TRealPoint& aPoint ) const; - - TReal32 iX; - TReal32 iY; - }; - - // Class declaration - - /** - * TGesture represents the gesture that the user has made. - * Implements MGestureEvent interface to allow clients to - * inspect the gesture - * - * @ingroup group_xnlayoutengine - */ - NONSHARABLE_CLASS( CXnGesture ) : public CBase - { - public: - - /** - * X and Y axes, or both - */ - enum TAxis - { - EAxisBoth, - EAxisHorizontal, - EAxisVertical - }; - - public: - - /** destructor */ - ~CXnGesture(); - - /** - * Sets the gesture as empty. resets timers to receive points - * immediately - */ - void Reset(); - - /** - * Check the gesture if it is empty - * - * @return ETrue if the gesture has no points - */ - TBool IsEmpty() const; - - /** - * Add a point to the sequence of points that forms the gesture - * Call Reset() just before adding the first point - * - * @param aPoint the point to add - * @return error code - */ - TInt AddPoint( const TPoint& aPoint ); - - /** - * Checks if the point it is close to holding point - * - * @param aPoint Point to be examined - * @return ETrue if the point is very near the holding point - */ - TBool IsNearHoldingPoint( const TPoint& aPoint ) const; - - /** - * Set the latest point as the holding point - */ - void SetHoldingPoint(); - - /** - * Checks if the examined point is at the last point's position - * - * @param aPoint Point to be examined - * @return ETrue if aPoint is the same as point added last - */ - TBool IsLatestPoint( const TPoint& aPoint ) const; - - /** - * After call, Code(...) will return appropriate holding gesture code. - */ - void StartHolding(); - - /** - * After call, Code(...) will return a "hold released" gesture code - * when the gesture is completed. Meanwhile, code will be drag. - */ - void ContinueHolding(); - - /** - * Set as stylus released - */ - void SetReleased(); - - /** - * Set the gesture as complete. Gesture is completed at pointer up - */ - void SetComplete(); - - /** - * After call, Code(...) will return a "cancelled" gesture code - */ - void SetCancelled(); - - /** - * Checks if the gesture is a tap - * - * @return Whether the current gesture is a tap - * (and hence not a swipe). Does not consider holding or - * other state information (such as whether the gesture was - * just started or is dragging). Results are based purely on - * the current stream of points. - */ - TBool IsTap() const; - - /** - * From MGestureEvent - * Checks and return current gesture status at desired axis - * - * @param aRelevantAxis Axis to be examined - * @return Gesture status - */ - TXnGestureCode Code( TAxis aRelevantAxis ) const; - - /** - * From MGestureEvent - * Checks and returns holding status - * - * @return Return holding - */ - TBool IsHolding() const; - - /** - * From MGestureEvent - * Returns first position form iPoints - * - * @return Returns first point - */ - TPoint StartPos() const; - - /** - * From MGestureEvent - * Returns current (last) position from iPoints - * - * @return Returns last point - */ - TPoint CurrentPos() const; - - /** - * From MGestureEvent - * Returns speed of X, Y movement - * - * @return Speed in X, Y axis - */ - TRealPoint Speed() const; - - /** - * From MGestureEvent - * Scales the speed - * - * @return Scaled speed - */ - TRealPoint SpeedPercent( const TRect& aEdges ) const; - - /** - * From MGestureEvent - * Cheks and returns distance between start and current position - * - * @return Distance between two points - */ - TPoint Distance() const; - - private: - - /** Information of an earlier gesture */ - struct TGestureRecord - { - enum TType - { - ETypeOther, - ETypeTap, - ETypeDoubleTap - }; - - TGestureRecord(); - TGestureRecord( TType aType, TTime aCompletionTime, TPoint aPos ); - - /** type of the gesture */ - TType iType; - /** completion time fo the gesture */ - TTime iCompletionTime; - /** point of completion */ - TPoint iPos; - }; - - /** - * Checks and returns gesture - * - * @param aRelevantAxis See @ref MGestureEvent::Code - * @return gesture code by analysing the sequence of points - */ - TXnGestureCode CodeFromPoints( TAxis aRelevantAxis ) const; - - /** - * Returns elapsed time - * - * @return elapsed time between the latest and previous points - */ - inline TTimeIntervalMicroSeconds32 TimeFromPreviousPoint() const; - - /** - * Checks whether the movement has stopped - * - * @return ETrue if user has stopped moving the stylus before lifting - * it - */ - inline TBool IsMovementStopped() const; - - /** - * Offset of the last entry - * - * @return aOffset'th last entry in the list of points - */ - inline const TXnPointEntry& NthLastEntry( TInt aOffset ) const; - - /** - * Calles NthLastEntry for previous point - * - * @return previous point (may not be exactly the point before last) - */ - inline const TXnPointEntry& PreviousEntry() const; - - /** - * Returns the point before the last one - * - * @return position of point received just before the latest point - */ - inline TPoint PreviousPos() const; - - /** - * Return if the tap was a double tap - * - * @return ETrue if tap should be a double tap - */ - TBool IsTapDoubleTap() const; - - /** - * Returns current gesture type - * - * @return the type of the current gesture - */ - TGestureRecord::TType Type() const; - - private: - // Enumerators for holding and completion state - - /** - * the different states that indicate whether user has made a holding - * gesture - */ - enum THoldingState - { - /** before holding activated (i.e., holding not activated) */ - ENotHolding = 0, - /** holding activated just now (lasts just one callback round) */ - EHoldStarting, - /** holding activated earlier */ - EHolding - }; - - /** - * Completion states - */ - enum TCompletionState - { - // Note: implementation assumes this order of enums - ENotComplete = 0, - ECancelled, - EComplete, - EReleased - }; - - private: - // Members - - /** - * sequence of points that make up the gesture, owned. - */ - RArray< TXnPointEntry > iPoints; - - /** - * index in iPoints of the point in which user started holding - */ - TInt iHoldingPointIndex; - - /** - * state that indicates is user has held the pointer down in one - * position for long time to indicate a holding gesture - */ - THoldingState iHoldingState; - - /** - * gesture only becomes complete when user lifts the pointer - */ - TCompletionState iState; - - /** - * time when the stylus was lifted. - */ - TTime iCompletionTime; - - /** - * previous gesture information for double tap - */ - TGestureRecord iPreviousGesture; - }; - } // namespace XnGestureHelper - -// Inline functions -#include "xngesture.inl" - -#endif // _XNGESTURE_H_ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xngesture.inl --- a/idlehomescreen/xmluirendering/uiengine/inc/xngesture.inl Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* 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: Gesture class - inline section -* -*/ - - -// Protection for nested includes -#ifndef _XNGESTURE_INL_ -#define _XNGESTURE_INL_ - -// ----------------------------------------------------------------------------- -// TRealPoint inline implementation -// ----------------------------------------------------------------------------- -// -namespace XnGestureHelper - { - - // ------------------------------------------------------------------------- - // Default Constructor for the real point - // ------------------------------------------------------------------------- - // - inline TRealPoint::TRealPoint() : - iX( 0 ), iY( 0 ) - { - } - - - // ------------------------------------------------------------------------- - // Copy constructor for real point - // ------------------------------------------------------------------------- - // - inline TRealPoint::TRealPoint( const TRealPoint& aPoint ) : - iX( aPoint.iX ), iY( aPoint.iY ) - { - } - - // ------------------------------------------------------------------------- - // Copy constructor for real point - // ------------------------------------------------------------------------- - // - inline TRealPoint::TRealPoint( TReal aX, TReal aY ) : - iX( aX ), iY( aY ) - { - } - - // ------------------------------------------------------------------------- - // Default constructor for real point - // ------------------------------------------------------------------------- - // - inline TBool TRealPoint::operator==( const TRealPoint& aPoint ) const - { - return iX == aPoint.iX && iY == aPoint.iY; - } - } - -#endif //_XNGESTURE_INL_ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xngesturedefs.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xngesturedefs.h Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* 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 helper constant definitions -* -*/ - - -#ifndef _XNGESTUREDEFS_H_ -#define _XNGESTUREDEFS_H_ - -// System includes -#include - -/** - * This flag controls whether helpers emits a double tap or a tap gesture - * for a second tap - */ -#define _GESTURE_DOUBLE_TAP_SUPPORT - -/** - * XnGestureHelper namespace - * Used for the whole gesture family - Gesture recognizer, gesture helper, - * Point array - */ -namespace XnGestureHelper - { - /** time to hold the stylus in the same position to activate - * holding, in microseconds - */ - const TInt KHoldDuration = 500000; - - /** - * time to tap again for the second tap to be a double tap, in - * microseconds - */ - const TInt KMaxDoubleTapDuration = 400000; - - /** - * time in which speed becomes zero if user stops stylus movement before - * lifting the pointer, in microseconds - */ - const TInt KSpeedStopTime = 100000; - - /** - * tolerance in degrees to either side of an angle, for direction to be - * the same as reference angle - */ - const TReal KAngleTolerance = 25; - - /** - * maximum pointer movement from pointer down position for a gesture be - * a tap or hold gesture - */ - const TInt KSamePointTolerance = 3; - - /** - * minimum length of a valid swipe in pixels. should be larger than - * KTapTolerance - */ - const TReal KMinSwipeLength = 5; - - /** Nth pointer event before the latest point */ - const TInt KPreviousPointOffset = 3; - - - /** - * Panic codes - */ - enum TGesturePanic - { - EGesturePanicIllegalLogic - }; - - /** - * Panics the thread - * - * @param aReason Panic reason - */ - inline void Panic( TGesturePanic aReason ) - { - _LIT( KComponentName, "XnGestureHelper" ); - User::Panic( KComponentName, aReason ); - } - } // namespace XnGestureHelper - -#endif // _XNGESTUREDEFS_H_ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xngesturehelper.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xngesturehelper.h Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,185 +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: Gesture helper implementation -* -*/ - - -#ifndef _XNGESTUREHELPER_H_ -#define _XNGESTUREHELPER_H_ - -// System includes -#include - -// Forward declarations -class CXnNode; -struct TPointerEvent; - - -/** - * Swipe directions (left, right, none) - */ -enum TSwipeResult - { - ESwipeNone = 0, - ESwipeLeft, - ESwipeRight - }; - -/** - * XnGestureHelper namespace - * Used for the whole gesture family - Gesture recognizer, gesture helper, - * Point array - */ -namespace XnGestureHelper - { - - // Forward declarations - class CHoldingTimer; - class CXnGesture; - - // Constants - const TReal32 KGestureMinSpeedX = 300; - const TInt KGestureMinLengthX = 100; - const TInt KGestureMaxDeltaY = 100; - - /** - * Implementation of CGestureHelper interface - * - * @ingroup group_xnlayoutengine - */ - NONSHARABLE_CLASS( CXnGestureHelper ) : public CBase - { - - /** private implementation class */ - friend class CHoldingTimer; - - public: - - /** 2-phase constructor */ - static CXnGestureHelper* NewL( CXnNode& aNode ); - - /** Destructor */ - ~CXnGestureHelper(); - - /** - * See GestureHelper, SetHoldingEnabled function - * - * @see CGestureHelper::SetHoldingEnabled - */ - void SetHoldingEnabled( TBool aEnabled ); - - /** - * See Gesturehelper, IsHoldingEnabled function - * - * @see CGestureHelper::IsHoldingEnabled - */ - TBool IsHoldingEnabled() const; - - /** - * Gets the owner - * - * @return Owner - */ - CXnNode* Owner() const; - - /** - * Sets destination - * - * @aParam Destination - */ - void SetDestination( CXnNode* aDestination ); - - /** - * Gets destination - * - * @return Destination - */ - CXnNode* Destination() const; - - /** - * See GestureHelper Handlepointervent - * - * @see CGestureHelper::HandlePointerEventL - */ - TSwipeResult HandlePointerEventL( const TPointerEvent& aEvent ); - - /** Reset helper state */ - void Reset(); - - private: - - /** Constructor */ - CXnGestureHelper( CXnNode& aNode ); - - /** - * Returns if the helper is processing - * - * @return ETrue if the helper has not started processing a gesture - */ - inline TBool IsIdle() const; - - /** - * Add a point to the sequence of points that make up the gesture - */ - inline void AddPointL( const TPointerEvent& aEvent ); - - /** - * Add a point to the sequence of points that make up the gesture - * - * @return - */ - inline TInt AddPoint( const TPointerEvent& aEvent ); - - /** - * Activates holding and notifies observer that holding has been - * started - */ - void StartHoldingL(); - - /** - * Check if swipe if between defined values - * - * @return Swiping left/right/none - */ - TSwipeResult ValidSwipe(); - - private: - - /** - * Gesture owner, Not owned. - */ - CXnNode& iOwner; - - /** - * Gesture is the logical representation of a sequence of points - * arriving at certain times - */ - CXnGesture* iGesture; - - /** - * holding is activated when user keeps pointer down in the same place - * for a longer period. the holding timer activates off when enough - * time has passed. - */ - CHoldingTimer* iHoldingTimer; - - /** - * Gesture destination, Not owned. - */ - CXnNode* iDestination; - }; - } // GestureHelper - -#endif // _XNGESTUREHELPER_H_ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xngesturerecogniser.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xngesturerecogniser.h Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +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: Algorithm to recognise gesture from a stream of points -* -*/ - - -#ifndef _XNGESTURERECOGNISER_H_ -#define _XNGESTURERECOGNISER_H_ - -// System includes -#include - - -/** - * XnGestureHelper namespace - * Used for the whole gesture family - Gesture recognizer, gesture helper, - * Point array - */ -namespace XnGestureHelper - { - - // Forward declarations - class TXnPointArray; - - /** - * flag that indicates gesture code is a holding code - * clients should use MGestureEvent::IsHolding - */ - const TInt EFlagHold = 0x10000000; - - /** - * Gesture codes and states - */ - enum TXnGestureCode - { - // states - /** gesture just started (user pressed stylus down)*/ - EGestureStart = 0x00000001, - /** user moved stylus (may be holding or not holding) */ - EGestureDrag = 0x00000002, - /** user lifted stylus while user was holding */ - EGestureReleased = 0x00000003, - - // gestures - /** gesture was not recognised */ - EGestureUnknown = 0x00000005, - /** these codes are sent when user lifts stylus - * (if holding not started) - */ - EGestureTap = 0x00000006, - /** first tap emits EGestureTap */ - EGestureDoubleTap = 0x00000007, - /** swipe left */ - EGestureSwipeLeft = 0x00000008, - /** swipe right */ - EGestureSwipeRight = 0x00000009, - /** swipe up */ - EGestureSwipeUp = 0x0000000A, - /** swipe down */ - EGestureSwipeDown = 0x0000000B, - /** - * these codes are sent when user initiates holding by keeping stylus - * in same place for a longer duration - */ - EGestureHoldLeft = EGestureSwipeLeft | EFlagHold, - EGestureHoldRight = EGestureSwipeRight | EFlagHold, - EGestureHoldUp = EGestureSwipeUp | EFlagHold, - EGestureHoldDown = EGestureSwipeDown | EFlagHold - }; - - //Class declaration - - /** - * Set of algorithms to recognise gesture from a stream of points - * Note: Not a static class or a function pointer, just to make it - * sligthly easier to replace it with a heavier implementation - * - * @ingroup group_xnlayoutengine - */ - NONSHARABLE_CLASS( TXnGestureRecogniser ) - { - public: - - /** - * Translates points into a gesture code - * @param aPoints Points that form the gestures. Client is not - * required to pass in repeated points (sequential - * points that are almost in the same place) - * @param aIsHolding ETrue if gesture was ended at pointer being held - * down at same position - * EFalse if gesture ended at pointer being released - * @return recognised gesture id or EUnknownGesture - */ - TXnGestureCode GestureCode( const TXnPointArray& aPoints ) const; - }; - } // namespace XnGestureHelper - -#endif // _XNGESTURERECOGNISER_H_ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnhittest.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnhittest.h Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,176 +0,0 @@ -/* -* 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 to hold hit region information -* -*/ - - -#ifndef _XNHITTEST_H -#define _XNHITTEST_H - -// System includes -#include -#include - -// Forward declarations -class CXnControlAdapter; - -namespace XnHitTest - { - const TInt EIgnoreEventsUntilNextPointerUp = 0x01; - const TInt EIgnoreStylusUpTriggers = 0x02; - } - -// Class declaration - -/** - * Holds hit region information - * - * @ingroup group_xnlayoutengine - * @lib xn3layoutengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CXnHitTest ) : public CBase, - public MCoeMessageMonitorObserver - { -public: - // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CXnHitTest* NewL(); - - /** - * Two-phased constructor. Leaving on stack - */ - static CXnHitTest* NewLC(); - - ~CXnHitTest(); - -private: - CXnHitTest(); - -private: - // from MCoeMessageMonitorObserver - - /** - * @see MCoeMessageMonitorObserver documentation - */ - void MonitorWsMessage( const TWsEvent& aEvent ); - -public: - // New functions - - /** - * Adds a control to hit region. - * - * @since S60 5.0 - * @param aControl The control to be added. - */ - void AddControl( CXnControlAdapter* aControl ); - - /** - * Removes a control from hit region. - * - * @since S60 5.0 - * @param aControl The control to be removed. - */ - void RemoveControl( CXnControlAdapter* aControl ); - - /** - * Set flags - * - * @since S60 5.0 - * @param aFlags flags to be added - */ - void SetFlags( const TInt aFlags ); - - /** - * Clear flags - * - * @since S60 5.0 - * @param aFlags flags to be cleared, 0x0F default - */ - void ClearFlags( const TInt aFlags = 0x0F ); - - /** - * Get flags - * - * @since S60 5.0 - * @return Flags - */ - TInt Flags() const; - - /** - * Flushes hit test state - * - * @since S60 5.0 - */ - void Flush(); - - /** - * Gets hit region count - * - * @since S60 5.0 - * @return Count - */ - TInt HitRegionCount() const; - - /** - * Gets hit region - * - * @since S60 5.0 - * @return Region - */ - CXnControlAdapter* HitRegion() const; - - /** - * Tests whether a pointer event occurred inside the control's hit region. - * - * @since S60 5.0 - * @param aPointEvent The pointer event. - * @param aControl - * @return ETrue if the specified point lies inside the hit region, - * EFalse if not. - */ - TBool HitRegionContainsL( const TPointerEvent& aPointerEvent, - const CXnControlAdapter& aControl ); - - /** - * Gets the last pointer event - * - * @since S60 5.0 - * @return Last pointer event - */ - const TPointerEvent& PointerEvent() const; - -protected: - /** - * Two-phased constructor. - */ - void ConstructL(); - -private: - // data - - /** Hit region */ - RPointerArray< CXnControlAdapter > iHitRegion; - /** Pointer event */ - TPointerEvent iPointerEvent; - /** Flags */ - TInt iFlags; - }; - -#endif // _XNHITTEST_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnkeyeventdispatcher.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnkeyeventdispatcher.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnkeyeventdispatcher.h Wed May 12 13:22:51 2010 +0300 @@ -160,15 +160,28 @@ */ void ClearPassiveFocusedNodesL(); + /** + * Clears dispatcher's internal state. + * + * @since S60 5.2 + */ + void ClearStateL(); + + /** + * Returns the last pointer event + * + * @since S60 5.2 + * @return Last pointer event + */ + const TPointerEvent& PointerEvent() const; + private: // new functions void SetNodeL( CXnNode* aToLose, CXnNode* aToGain, TBool aNotify, TInt aSource = 0 ); - void ResolveAndSetFocusL(); - - void ClearStateL(); + void ResolveAndSetFocusL(); protected: // New functions @@ -223,6 +236,8 @@ CEikButtonGroupContainer* iCbaContainer; /** For storing the nodes that have passive focus. */ RPointerArray< CXnNode > iPassiveFocusedNodes; + /** Last pointer event */ + TPointerEvent iPointerEvent; }; #endif //__XNKEYEVENTDISPATCHER_H__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnplugindata.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnplugindata.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnplugindata.h Wed May 12 13:22:51 2010 +0300 @@ -30,9 +30,9 @@ class CXnControlAdapter; class CXnViewData; class CXnODT; -class CXnDataPluginLoader; class CXnViewManager; class CPeriodic; + // Constants // Class declaration @@ -56,8 +56,7 @@ EIsEmpty, EIsRemovable, EIsActive, - EIsInitial, - EIsDataPluginsReady + EIsInitial }; public: @@ -112,9 +111,11 @@ // New functions /** - * Loads content to plugin + * Loads content to plugin + * + * @return KErrNone if succesful, error code otherwise */ - virtual void LoadL(); + virtual TInt Load(); /** * Destroys content from plugin @@ -242,25 +243,6 @@ inline const TDesC8& Type() const; /** - * Sets new plugin state - * - * @param aConfigurationState Plugin state - */ - void SetPluginStateL( const TDesC8& aPluginState ); - - /* - * Reverts plugin state back to confirmed from wait for confirmation - */ - void RevertPluginState(); - - /** - * Returns plugin state - * - * @return Plugin state - */ - inline const TDesC8& PluginState() const; - - /** * void SetPublisherNameL( const TDesC8& aPublisherName ) * Sets the name of the publisher * @@ -356,6 +338,13 @@ virtual void InitialFocusNodesL( RPointerArray< CXnNode >& aList ) const; /** + * Returns list of popup nodes + * + * @param aList List of popup nodes + */ + virtual void PopupNodesL( RPointerArray< CXnNode >& aList ) const; + + /** * Sets the plugin occupied */ inline void SetOccupied(); @@ -366,14 +355,7 @@ * @return ETrue when occupied EFalse when not */ inline TBool Occupied() const; - - /* - * Sets the plugin removable - * - * @param aRemovable ETrue when removable EFalse when not - */ - inline void SetRemovable( TBool aRemovable ); - + /* * Checks whether removable * @@ -405,14 +387,13 @@ * @param aVisible sets the popup visible or invisible * @param aNode a pointer to the popup node */ - void SetIsDisplayingPopup ( TBool aVisible, CXnNode* aNode ); + void SetIsDisplayingPopup( TBool aVisible, CXnNode* aNode ); /** * Checks if the popup is displayed */ - TBool IsDisplayingPopup () const; - - + TBool IsDisplayingPopup() const; + /** * Returns list of plugindata * @@ -421,45 +402,54 @@ inline RPointerArray< CXnPluginData >& PluginData() const; /** - * Loads data plugins associated to the plugin data + * Loads publishers, called by CXnViewData + * + * @param aReason Load reason + */ + TInt LoadPublishers( TInt aReason ); + + /** + * Queries whether this plugins publishers are virgin * + * @return ETrue if virgin, EFalse otherwise */ - virtual void LoadDataPluginsL(); + TBool VirginPublishers() const; + + /** + * Show content removed error note + */ + void ShowContentRemovedError(); /** - * Deletes data plugins associated to the plugin data - */ - virtual void DestroyDataPluginsL(); + * Show oom error note + */ + void ShowOutOfMemError(); /** - * Indicates that all data plugins are loaded by data plugin loader + * Sets locking_status attribute (locked/none) * - * @param aStatus Loading status + * @param aStatus "locked" / "none" */ - virtual void DataPluginsLoadCompletedL( TInt aStatus ); - - /** - * Returns data plugin loading status - * - * @return ETrue if data plugins are loaded or there is no data - * plugins associated to the plugin. - * EFalse otherwise - */ - virtual TBool DataPluginsLoaded() const; - - + void SetLockingStatus( const TDesC8& aStatus ); + private: // New functions + + void LoadPublishers(); - static TInt RunL( TAny* aAny ); + void DestroyPublishers(); + + void DoDestroyPublishersL(); + + void DoShowContentRemovedErrorL(); + + static TInt PeriodicEventL( TAny* aAny ); protected: // data - /** Data plugin loader, Owned */ + /** Data publisher loader, Owned */ CPeriodic* iLoader; - /** Data plugin load index */ - TInt iLoadIndex; /** Plugins data */ mutable RPointerArray< CXnPluginData > iPluginsData; /** List of plugin resources, Owned */ @@ -474,7 +464,6 @@ RPointerArray< CXnNode > iInitialFocusNodes; /** List of popup focus nodes, Not owned */ RPointerArray< CXnNode > iPopupNodes; - /** Parent, Not owned */ CXnPluginData* iParent; /** View manager, Not owned */ @@ -493,12 +482,12 @@ HBufC8* iPluginName; /** Plugin type, Owned */ HBufC8* iPluginType; - /** Plugin state, Owned */ - HBufC8* iPluginState; /** Publisher name, Owned */ HBufC* iPublisherName; /** Flags to define this plugin's state */ TBitFlags32 iFlags; + /** Flag to indicate whether this data's publishers are virgins */ + TBool iVirginPublishers; }; // Inline functions diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnplugindata.inl --- a/idlehomescreen/xmluirendering/uiengine/inc/xnplugindata.inl Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnplugindata.inl Wed May 12 13:22:51 2010 +0300 @@ -135,15 +135,6 @@ }; // --------------------------------------------------------------------------- -// Returns plugin state -// --------------------------------------------------------------------------- -// -inline const TDesC8& CXnPluginData::PluginState() const - { - return iPluginState ? *iPluginState : KNullDesC8(); - }; - -// --------------------------------------------------------------------------- // Returns the publisher name // --------------------------------------------------------------------------- // @@ -171,22 +162,6 @@ }; // --------------------------------------------------------------------------- -// Sets removable -// --------------------------------------------------------------------------- -// -inline void CXnPluginData::SetRemovable( TBool aRemovable ) - { - if( aRemovable ) - { - iFlags.Set( EIsRemovable ); - } - else - { - iFlags.Clear( EIsRemovable ); - } - }; - -// --------------------------------------------------------------------------- // Returns removable // --------------------------------------------------------------------------- // diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnpointarray.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnpointarray.h Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* 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: Array of points -* -*/ - - -#ifndef _XNPOINTARRAY_H_ -#define _XNPOINTARRAY_H_ - -// System includes -#include - -/** - * XnGestureHelper namespace - * Used for the whole gesture family - Gesture recognizer, gesture helper, - * Point array - */ -namespace XnGestureHelper - { - - /** - * Represents a single point given at certain time - */ - struct TXnPointEntry - { - - /** constructor */ - inline TXnPointEntry( const TPoint& aPos, const TTime& aTime ); - - TPoint iPos; - TTime iTime; - }; - - /** - * Array of points that wraps another point array - * The purpose of this class is to allow deriving classes to override [] - * and in that member function adjust the point, e.g., by setting one - * axis to always a constant value. This allows providing a sequence of - * points to the recogniser in which the other axis is ignored. - * - * @ingroup group_xnlayoutengine - */ - NONSHARABLE_CLASS( TXnPointArray ) - { - public: - - /** - * Constructor - * - * @param aPoints points array to wrap (and filter) - */ - TXnPointArray( const RArray< TXnPointEntry >& aPoints ); - - /** - * Length of the array - * - * @return Length of the array - */ - TInt Count() const; - - /** - * Returns point at position, may be filtered - * virtual so deriving classes can modify the point - * (e.g., filter one axis) - * - * @return A filtered point at aIndex. Default implementation same - * as Raw(...) - */ - virtual TPoint operator[]( TInt aIndex ) const; - - /** - * Nonfiltered index - * - * @return An raw, non-filtered point at aIndex - */ - const TPoint& Raw( TInt aIndex ) const; - - private: - - /** Array of points, Not owned */ - const RArray< TXnPointEntry >& iPoints; - }; - } // namespace XnGestureHelper - - -// Inline functions -#include "xnpointarray.inl" - -#endif // _XNPOINTARRAY_H_ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnpointarray.inl --- a/idlehomescreen/xmluirendering/uiengine/inc/xnpointarray.inl Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* 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: Array of points - inline functions -* -*/ - - -#ifndef _XNPOINTARRAY_INL_ -#define _XNPOINTARRAY_INL_ - -namespace XnGestureHelper - { - - // ----------------------------------------------------------------------- - // TXnPointEntry's Constructor - // ----------------------------------------------------------------------- - // - inline TXnPointEntry::TXnPointEntry( const TPoint& aPos, - const TTime& aTime ) : iPos( aPos ), iTime( aTime ) - { - }; - } - -#endif // _XNPOINTARRAY_INL_ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnpopupcontroladapter.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnpopupcontroladapter.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnpopupcontroladapter.h Wed May 12 13:22:51 2010 +0300 @@ -30,6 +30,7 @@ class CXnNodePluginIf; class CXnNode; class CXnUiEngine; +class CXnPluginData; class CAknStylusPopUpMenu; // Class declaration @@ -103,8 +104,8 @@ private: // New functions - void PopulateMenuL( CXnNode* aItem, CXnNode& aPlugin ); - void ShowMenuL( CXnNode& aPlugin, TPoint aPosition ); + void PopulateMenuL( CXnPluginData& aPlugin, CXnNode* aItem ); + void ShowMenuL( CXnPluginData& aPlugin, TPoint aPosition ); void HideMenuL(); private: diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnrootdata.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnrootdata.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnrootdata.h Wed May 12 13:22:51 2010 +0300 @@ -80,7 +80,7 @@ /** * @see CXnPluginData */ - void LoadL(); + TInt Load(); /** * @see CXnPluginData diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnspbgcleaner.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnspbgcleaner.h Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Declares statuspane's background cleaner. +* +*/ + +#ifndef __XNSPBGCLEANER_ +#define __XNSPBGCLEANER_ + +// Forward declarations + +/** + * Statuspane background cleaner. + * + * @class CXnSpBgCleaner xnspbgcleaner.h + */ +NONSHARABLE_CLASS( CXnSpBgCleaner ) : public CCoeControl + { +public: + /** + * Two-phased constructors. + */ + static CXnSpBgCleaner* NewL(); + static CXnSpBgCleaner* NewLC(); + + /** Destructor */ + ~CXnSpBgCleaner(); + +private: + /** constructor */ + CXnSpBgCleaner(); + + /** 2nd phase constructor */ + void ConstructL(); + +protected: // from base class CCoeControl + + /** + * Handles a change to the control's resources + * + * @see CCoeControl::HandleResourceChange + */ + void HandleResourceChange( TInt aType ); + + /** + * Sets the control's extent, specifying a rectangle. + * + * @see CCoeControl::SizeChanged + */ + void SizeChanged(); + + /* + * Draws the control. + * + * @see CCoeControl::Draw + */ + void Draw( const TRect& aRect ) const; + + }; + +#endif // __XNSPBGCLEANER_ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnuiengineimpl.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnuiengineimpl.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnuiengineimpl.h Wed May 12 13:22:51 2010 +0300 @@ -38,7 +38,6 @@ class CXnEditor; class CXnResource; class CXnEditMode; -class CXnHitTest; class CXnViewManager; class CXnViewData; class CXnPluginData; @@ -58,8 +57,7 @@ const TInt ERefreshMenu = 0x04; const TInt EIgnoreState = 0x08; const TInt EViewDirty = 0x10; - const TInt EEffectStarted = 0x20; - const TInt EFirstPassDraw = 0x40; + const TInt EEffectStarted = 0x20; } NONSHARABLE_STRUCT( TXnDirtyRegion ) @@ -72,7 +70,24 @@ iRegion.Close(); } }; - + + +NONSHARABLE_STRUCT( TXnSplitScreenState ) + { + /** Partial screen editor node. Not own */ + CXnNode* iPartialScreenEditorNode; + /** Is partial screen input open */ + TBool iPartialScreenOpen; + /** Partial screen block progression. Own. */ + const TDesC8* iPartialScreenBlock; + + // ctor + TXnSplitScreenState() : + iPartialScreenEditorNode( NULL ), + iPartialScreenOpen( EFalse ), + iPartialScreenBlock( NULL ) {} + }; + // Class declaration @@ -197,6 +212,16 @@ const TDesC8& aNamespace = KNullDesC8 ); /** + * Find content source nodes from namespace. Ownership is not transferred. + * + * @since S60 5.2 + * @param aNamespace Namespace + * @return Content source nodes from namespace + */ + CXnPointerArray* CXnUiEngineImpl::FindContentSourceNodesL( + const TDesC8& aNamespace ); + + /** * Gets resources of the UI * * @since Series 60 3.1 @@ -443,25 +468,6 @@ RPointerArray< CXnNode >* Plugins(); /** - * Gets hit test - * - * @since S60 5.1 - * @return the hittest - */ - CXnHitTest& HitTest() const; - - /** - * Positions stylus popup according given position - * - * @since S60 5.1 - * @param aNode stylus popup node - * @param aReference a reference node where popup should fit - * @param aPosition stylus popup position to set. - */ - void PositionStylusPopupL( CXnNode& aNode, CXnNode& aReference, - const TPoint& aPosition ); - - /** * Gets theme resource file * * @since S60 5.1 @@ -495,7 +501,32 @@ * @param aDispather Event dispatcher */ void SetEventDispatcher( CXnKeyEventDispatcher* aDispatcher ); - + + /** + * Enables partial touch input + * + * @since Series 60 5.2 + * @param aNode Editor Node + * @param TBool Partial input is enabled + */ + void EnablePartialTouchInput( CXnNode& aNode, TBool aEnable ); + + /** + * Is partial input active + * + * @since Series 60 5.2 + * @return TBool is partial input active + */ + TBool IsPartialInputActive(); + + /** + * Checks if text editor is focused or partioal touch input open. + * + * @since Series 60 5.2 + * @return TBool True if partial input is open or editor focused + */ + TBool IsTextEditorActive(); + private: IMPORT_C static void EnableRenderUi( TAny* aAny ); @@ -553,6 +584,47 @@ void AddRedrawRectL( TRect aRect, CXnNode& aNode ); void ReportScreenDeviceChangeL(); + + /** + * Handle partial touch input + * + * @since Series 60 5.2 + * @param TInt aType + */ + void HandlePartialTouchInputL( CXnNode& aNode, TBool aEnable ); + + /** + * Set node visible + * + * @since Series 60 5.2 + * @param aNode node to hide/show + * @param TBool aVisible boolean to set node visible + */ + void SetNodeVisibleL( CXnNode* aNode, TBool aVisible ); + + /** + * Set partial screen block + * + * @since Series 60 5.2 + * @param CXnNode aParent parent node + * @param TDesC8 aBlockProgression set layout direction + */ + void SetPartialScreenBlockProgressionL( + CXnNode* aParent, const TDesC8& aBlockProgression ); + + /** + * Handles skin change resource change + * + * @since Series 60 5.2 + */ + void HandleSkinChangeL(); + + /** + * Handles KEikDynamicLayoutVariantSwitch resource change + * + * @since Series 60 5.2 + */ + void HandleDynamicLayoutVariantSwitchL(); private: //Derived functions @@ -664,10 +736,10 @@ TRect iClientRect; /** Owned. Edit mode storage; */ CXnEditMode* iEditMode; - /** Owned. hittest */ - CXnHitTest* iHitTest; /** Disable count */ TInt iDisableCount; + /**Split screen states*/ + TXnSplitScreenState iSplitScreenState; }; #endif // _CXNUIENGINEIMPL_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnuistatelistener.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnuistatelistener.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnuistatelistener.h Wed May 12 13:22:51 2010 +0300 @@ -156,6 +156,13 @@ public: // New functions + /** + * Prepares for application exit + * + * @since S60 5.0 + */ + void PrepareToExit(); + /* * Adds MXnUiStateObserver * diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnviewadapter.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnviewadapter.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnviewadapter.h Wed May 12 13:22:51 2010 +0300 @@ -32,7 +32,6 @@ class CXnAppUiAdapter; class CXnControlAdapter; class CXnKeyEventDispatcher; -class CXnBgControl; class CXnBackgroundManager; class CXnFocusControl; @@ -77,7 +76,7 @@ * * @since S60 5.0 */ - void PrepareDestroy(); + void PrepareToExit(); /** * Gets event dispatcher @@ -88,14 +87,6 @@ CXnKeyEventDispatcher* EventDispatcher() const; /** - * Gets bg control - * - * @since S60 5.0 - * return Bg control - */ - CCoeControl& BgControl() const; - - /** * Gets background manager * * @since S60 5.0 @@ -112,12 +103,19 @@ CXnFocusControl& FocusControl() const; /** - * updates rsk by mode + * updates rsk by UI state * * @since S60 5.0 */ - void UpdateRskByModeL(); - + void UpdateRskByUiStateL( const CXnViewData& aViewData ); + + /** + * Closes all popups for this container. + * + * @since S60 5.0 + */ + void CloseAllPopupsL(); + public: // from CAknView @@ -161,7 +159,7 @@ */ void NotifyInCallStateChaged( TBool aInCall ); -private: +public: // new functions /** @@ -173,6 +171,9 @@ */ void ChangeControlsStateL( TBool aAwake ); +private: + // new functions + /** * Activates new container ro view. * Deactivates internally previous container if it exists. @@ -181,9 +182,11 @@ * @since S60 5.0 * @param aContainer Container to activate * @param aEnterEditState ETrue if activated container should be set to edit state. + * @param aForceActivation if ETrue forces deactivation and then activation even if + * the conntainer remains the same */ void ActivateContainerL( CXnViewData& aContainer, - TBool aEnterEditState = EFalse ); + TBool aEnterEditState = EFalse, TBool aForceActivation = EFalse ); /** * Deactivates the current container from view. @@ -191,6 +194,29 @@ * @since S60 5.0 */ void DeactivateContainerL(); + + /** + * Activates default container to view. + * Deactivates internally previous container if it exists. + * + * @since S60 5.0 + * @param aEnterEditState ETrue if default container should be set to edit state. + */ + void ActivateDefaultContainerL( TBool aEnterEditState = EFalse ); + + /** + * Sets edit state property of container + * + * @since S60 5.0 + * @param aView container + * @param aEnter ETrue if container should be set to edit state. + */ + void EnterEditStateL( CXnViewData& aView, TBool aEnter ); + + /** + * Callback function to be used with CPeriodic. + */ + static TInt TimerCallback( TAny *aPtr ); private: @@ -209,8 +235,6 @@ /** AppUi, Not owned */ CXnAppUiAdapter& iAppUiAdapter; - /** Bg control, Owned */ - CXnBgControl* iBgControl; /** Background manager, Owned */ CXnBackgroundManager* iBgManager; /** Focus control, Owned */ @@ -226,7 +250,9 @@ /** Active container, Not owned */ const CXnViewData* iContainer; /** Flags */ - TBitFlags32 iFlags; + TBitFlags32 iFlags; + /** Timer to set window group order after default view is activated, owned */ + CPeriodic* iTimer; }; #endif // XNVIEWADAPTER_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnviewcontroladapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnviewcontroladapter.h Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,134 @@ +/* +* 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: View control adater. +* +*/ + +#ifndef _XNVIEWCONTROLADAPTER_H +#define _XNVIEWCONTROLADAPTER_H + +// System includes +#include + +// User includes +#include "xncontroladapter.h" +#include "xnuistatelistener.h" + +// Forward declarations +class CXnNodePluginIf; +class CXnBackgroundManager; +class CXnAppUiAdapter; +class CXnViewFlicker; + +// Class declaration +/** +* @ingroup group_xnlayoutengine +* @lib xn3layoutengine.lib +* @since S60 5.2 +*/ +NONSHARABLE_CLASS( CXnViewControlAdapter ) : public CXnControlAdapter, + public MXnUiStateObserver + { +public: + // Constructors and destructor + + /** + * 2 phase construction. + */ + static CXnViewControlAdapter* NewL( CXnNodePluginIf& aNode ); + + /** + * Destructor. + */ + ~CXnViewControlAdapter(); + +public: + // From base classes + + /** + * @see CCoeControl documentation + */ + void MakeVisible( TBool aVisible ); + + /** + * @see CCoeControl + */ + void Draw( const TRect& aRect ) const; + + /** + * @see CCoeControl + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + +public: + // new functions + + /** + * Resets grabbing + * + * @since S60 5.2 + */ + void ResetGrabbing(); + +private: + // new functions + + void RemoveGrabbingControL( + const CCoeControl* aControl, const TPointerEvent& aEvent ) const; + +private: + // from MXnUiStateObserver + + /** + * @see MXnUiStateObserver + */ + void NotifyForegroundChanged( TForegroundStatus aStatus ); + + /** + * @see MXnUiStateObserver + */ + void NotifyLightStatusChanged( TBool aLightsOn ); + + /** + * @see MXnUiStateObserver + */ + void NotifyInCallStateChaged( TBool aInCall ); + +private: + // constructors + + /** + * C++ default constructor + */ + CXnViewControlAdapter( CXnNodePluginIf& aNode ); + + /** + * 2nd phase constructor + */ + void ConstructL( CXnNodePluginIf& aNode ); + +private: + // data + + /** Node */ + CXnNodePluginIf& iNode; + /** AppUi */ + CXnAppUiAdapter& iAppUi; + /** stored point of EButton1Down */ + TPoint iHitpoint; + }; + +#endif // _XNVIEWCONTROLADAPTER_H + +// End of File diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.h Wed May 12 13:22:51 2010 +0300 @@ -62,7 +62,7 @@ /** * @see CXnPluginData */ - void LoadL(); + TInt Load(); /** * @see CXnPluginData @@ -93,36 +93,21 @@ * @see CXnPluginData */ void AppearanceNodesL( RPointerArray< CXnNode >& aList ) const; - - /* - * @see CXnPluginData - */ - void LoadDataPluginsL(); - /* - * @see CXnPluginData - */ - void DataPluginsLoadCompletedL( TInt aStatus ); - - /* - * @see CXnPluginData + /** + * @see CXnPluginData */ - void DestroyDataPluginsL(); - - /* - * @see CXnPluginData - */ - TBool DataPluginsLoaded() const; - + void PopupNodesL( RPointerArray< CXnNode >& aList ) const; + public: // New functions /** * Sets viewdata to active/ not active * - * @param aActive ETrue active, EFalse not active + * @param aActive ETrue active, EFalse not active */ - void SetActiveL( TBool aActive ); + void SetActive( TBool aActive ); /** * Returns if active or not @@ -144,20 +129,6 @@ inline TBool Initial() const; /** - * Sets focused node - * - * @param aNode Focused node - */ - inline void SetFocusedNode( CXnNode* aNode ); - - /** - * Returns focused node - * - * @return focused node - */ - inline CXnNode* FocusedNode() const; - - /** * Sets this view data to use empty widget * * @param aUse ETrue use, EFalse don't use @@ -177,7 +148,7 @@ * @param aNode Node * @return Plugin data */ - CXnPluginData& Plugin( CXnNode* aNode ); + CXnPluginData* Plugin( CXnNode* aNode ); /** * Finds and reurns plugin/view data for namespace @@ -232,24 +203,35 @@ const TDesC& WallpaperImagePath() const; /** - * Sets view's locking_status attribute (locked/none) to determine if view - * is prevented from removing/deleting or not + * Loads publishers to this view + */ + void LoadPublishers(); + + /** + * Destroys all publishers in this view * - * @param aLockingStatusString attr. locking_status ("locked"/"none") + * @param aReason Destroy reason */ - void SetLockingStatus( const TDesC8& aLockingStatusString ); + void DestroyPublishers( TInt aReason ); + +private: + // new functions + + static TInt DoLoadPublishersL( TAny* aAny ); + + void DoDestroyPublishersL( TInt aReason ); private: // data - /** Focused Node, Not owned */ - CXnNode* iFocusedNode; - /** Pointer to wallpaper image, Owned */ - CFbsBitmap* iBgImage; - + CFbsBitmap* iBgImage; /** Path of the wallpaper image, including filename */ - HBufC* iBgImagePath; + HBufC* iBgImagePath; + /** Publisher load index */ + TInt iLoadIndex; + /** Flag to indicate whether content removed error should be shown */ + TBool iShowContentRemoved; }; #include "xnviewdata.inl" diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.inl --- a/idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.inl Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.inl Wed May 12 13:22:51 2010 +0300 @@ -47,24 +47,6 @@ }; // --------------------------------------------------------------------------- -// Sets focused node -// --------------------------------------------------------------------------- -// -inline void CXnViewData::SetFocusedNode( CXnNode* aNode ) - { - iFocusedNode = aNode; - }; - -// --------------------------------------------------------------------------- -// Returns focused node -// --------------------------------------------------------------------------- -// -inline CXnNode* CXnViewData::FocusedNode() const - { - return iFocusedNode; - }; - -// --------------------------------------------------------------------------- // Sets to use empty widget // --------------------------------------------------------------------------- // diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnwaitdialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnwaitdialog.h Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Declares wait dialog that doesn't consume key events. +* +*/ + + +#ifndef _XNWAITDIALOG_H +#define _XNWAITDIALOG_H + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + + +/** + * Wait Dialog without key event handling + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CXnWaitDialog ) : public CAknWaitDialog + { + +public: + // Constructors and destructor + + /** + * Class constructor + * + * @param aSelfPtr Pointer to itself. The pointer needs to be + * valid when the dialog is dismissed and must not + * be on the stack. + * @param aVisibilityDelayOff If set ETrue the dialog will be visible + * immediality. Use only when the length of + * the process is ALWAYS over 1.5 seconds. + */ + CXnWaitDialog( CEikDialog** aSelfPtr, TBool aVisibilityDelayOff ); + + /** + * Destructor + */ + ~CXnWaitDialog(); + +public: // From CAknWaitDialog + + /** + * From CAknWaitDialog + * @since S60 5.2 + * @param aKeyEvent the key event + * @param aType the type of the event + * @return TKeyResponse key event was used by this control or not + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + }; +#endif // _XNWAITDIALOG_H + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnwallpaperview.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnwallpaperview.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnwallpaperview.h Wed May 12 13:22:51 2010 +0300 @@ -21,29 +21,22 @@ #ifndef CXNWALLPAPERVIEW_H #define CXNWALLPAPERVIEW_H -// INCLUDES +// System includes #include +// User includes + +// Forward declarations class CXnWallpaperContainer; +class CXnAppUiAdapter; class CXnUiEngine; class TVwsViewId; class CPeriodic; - -// CONSTANTS -const TUid KWallpaperViewUid = { 0x200286DB }; +class CXnSpBgCleaner; +class CAknWaitDialog; -/** -* Data structure to be used with timer callback. -* -* @since S60 v5.0 -*/ -NONSHARABLE_STRUCT( TXnWallpaperViewData ) - { - TBool iMultiple; - TUid iAppUid; - TUid iViewUid; - CPeriodic* iTimer; // Not own. - }; +// Constants +const TUid KWallpaperViewUid = { 0x200286DB }; // CLASS DECLARATION @@ -55,6 +48,13 @@ */ NONSHARABLE_CLASS( CXnWallpaperView ) : public CAknView { + /** View states */ + enum TViewState + { + EIdle, + EImageSelection, + EViewDeactivation + }; public: /** @@ -99,8 +99,16 @@ /** * Callback function to be used with CPeriodic. */ - static TInt TimerCallbackL( TAny *aPtr ); + static TInt TimerCallback( TAny *aPtr ); + void DoHandleCallBackL(); + /** + * Show error dialog + * + * @param aResourceId Resource id to string to be displayed. + */ + static void ShowErrorDialogL( const TInt aResourceId ); + private: // data /** @@ -108,23 +116,56 @@ * Own. */ CXnWallpaperContainer* iContainer; - + /** - * Reference to uiengine. + * UiEngine + * Not owned. */ CXnUiEngine& iEngine; /** - * Data structure, that is transferred to TimerCallback. + * AppUi + * Not owned. + */ + CXnAppUiAdapter& iAppUi; + + /** + * Switch for multiple image selection. */ - TXnWallpaperViewData iData; + TBool iMultiple; + + /** + * Previous view id + */ + TVwsViewId iPreviousViewUid; + + /** + * States of wallpaperview + */ + TViewState iViewState; /** * Periodic timer. * Own. */ CPeriodic* iTimer; - + + /** + * Resource file offset + */ + TInt iResourceOffset; + + /** + * Statuspane background cleaner. + * Own. + */ + CXnSpBgCleaner* iXnSpBgCleaner; + + /** + * Wait dialog. + * Own. + */ + CAknWaitDialog* iWaitDialog; }; #endif // CXNWALLPAPERVIEW_H diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/inc/xnwidgetextensionadapter.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnwidgetextensionadapter.h Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnwidgetextensionadapter.h Wed May 12 13:22:51 2010 +0300 @@ -18,9 +18,12 @@ #ifndef __XNWIDGETEXTENSIONADAPTER_H__ #define __XNWIDGETEXTENSIONADAPTER_H__ -// INCLUDES +// System includes +#include + +// User includes #include "xncontroladapter.h" -#include +#include "xnuistatelistener.h" // Forward declarations class CXnAppUiAdapter; @@ -35,81 +38,128 @@ * @lib xnlayoutengine.lib * @since Series 60 5.0 */ -NONSHARABLE_CLASS( CXnWidgetExtensionAdapter ) : public CXnControlAdapter/*, - public MCoeMessageMonitorObserver*/ +NONSHARABLE_CLASS( CXnWidgetExtensionAdapter ) : public CXnControlAdapter, + public MXnUiStateObserver, + public MXnUiResourceChangeObserver { - public: // Constructors and destructor +public: // Constructors and destructor - enum TPositionHint - { - ENone, - EAboveLeft, - EAboveRight, - EBelowLeft, - EBelowRight, - ELeft, - ERight - }; - /** - * Two-phased constructor. - */ - static CXnWidgetExtensionAdapter* NewL( CXnNodePluginIf& aNode ); - - /** - * Destructor. - */ - ~CXnWidgetExtensionAdapter(); - - private: // Functions from base classes - /** - * @see CCoeControl documentation - */ - void MakeVisible( TBool aVisible ); + enum TPositionHint + { + ENone, + EAboveLeft, + EAboveRight, + EBelowLeft, + EBelowRight, + ELeft, + ERight + }; + /** + * Two-phased constructor. + */ + static CXnWidgetExtensionAdapter* NewL( CXnNodePluginIf& aNode ); + + /** + * Destructor. + */ + ~CXnWidgetExtensionAdapter(); +public: + /** + * From CCoeAppUiBase. + * Informs the components about the screen layout switch. + */ + void HandleScreenDeviceChangedL(); - /** - * see CCoeControl - */ - void HandlePointerEventL(const TPointerEvent& aPointerEvent); + +private: + // Functions from base classes + /** + * @see CCoeControl documentation + */ + void MakeVisible( TBool aVisible ); + + /** + * see CCoeControl + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + /** + * see CCoeControl + */ + void Draw( const TRect& aRect ) const; + + /** + * @see CXnControlAdapter + */ + void DoHandlePropertyChangeL( CXnProperty* aProperty = NULL ); - /** - * see CCoeControl - */ - void Draw(const TRect& aRect) const; +private: + // from MXnUiStateObserver + + /** + * @see MXnUiStateObserver + */ + void NotifyForegroundChanged( TForegroundStatus aStatus ); - private: // Constructors - /** - * C++ default constructor. - */ - CXnWidgetExtensionAdapter( CXnNodePluginIf& aNode ); + /** + * @see MXnUiStateObserver + */ + void NotifyLightStatusChanged( TBool aLightsOn ); + + /** + * @see MXnUiStateObserver + */ + void NotifyInCallStateChaged( TBool aInCall ); + +private: + // from MXnUiResourceChangeObserver + + /** + * @see MXnUiResourceChangeObserver + */ + void NotifyStatusPaneSizeChanged(); - /** - * Two-phased constructor. - */ - void ConstructL(); - - private: // New functions - /** - * Hides this control - */ - void HidePopupL(); - - void CalculatePosition(); - - private: - - // Data - // UiEngine, not owned - CXnUiEngine* iUiEngine; - - // Node - CXnNodePluginIf& iNode; - - // position hint - TPositionHint iPositionHint; - - CXnAppUiAdapter* iAppUiAdapter; + /** + * @see MXnUiResourceChangeObserver + */ + void NotifyResourceChanged( TInt aType ); + +private: + // Constructors + /** + * C++ default constructor. + */ + CXnWidgetExtensionAdapter( CXnNodePluginIf& aNode ); + /** + * Two-phased constructor. + */ + void ConstructL(); + +private: + // New functions + + void HidePopupL(); + void ChangePopupPosition(); + + void CalculatePosition(); + +private: + // Data + + /** UiEngine, not owned */ + CXnUiEngine* iUiEngine; + /** Node, not owned */ + CXnNodePluginIf& iNode; + /** Position hint */ + TPositionHint iPositionHint; + /** AppUi, not owned */ + CXnAppUiAdapter* iAppUiAdapter; + /** Flag to indicate whether is permanent */ + TBool iPermanent; + /** Is popup element */ + TBool iPopup; }; #endif // __XNWIDGETEXTENSIONADAPTER_H__ diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnappuiadapter.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnappuiadapter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnappuiadapter.cpp Wed May 12 13:22:51 2010 +0300 @@ -18,6 +18,7 @@ // System includes #include #include +#include // User includes #include "xnappuiadapter.h" @@ -25,12 +26,13 @@ #include "xnviewadapter.h" #include "xnuiengineappif.h" #include "xnfocuscontrol.h" +#include "hscontentcontrolfactory.h" +#include "xnviewadapter.h" #include "xuikon_builds_cfg.hrh" +#include "debug.h" -#ifdef _XN_PERFORMANCE_TEST_ -#include "xntimemon.h" -#endif +_LIT8( KActivateDefaultView, "activatedefault" ); // ============================ MEMBER FUNCTIONS =============================== @@ -41,7 +43,7 @@ // ----------------------------------------------------------------------------- // EXPORT_C CXnAppUiAdapter::CXnAppUiAdapter( TUid aApplicationUid ) - : iApplicationUid( aApplicationUid ) + : iExitingApp( EFalse ), iApplicationUid( aApplicationUid ) { } @@ -52,16 +54,16 @@ // EXPORT_C void CXnAppUiAdapter::ConstructL() { -#ifdef _XN_PERFORMANCE_TEST_ - TInt start( 0 ); - TInt end( 0 ); - TInt diff( 0 ); - CXnTimeMon::PrintUserMem( _L( "CXnAppUiAdapter::ConstructL(): - Calling CAknViewAppUi::BaseConstructL().." ) ); - User::AllocSize( start ); -#endif //_XN_PERFORMANCE_TEST_ + __TICK( "CXnAppUiAdapter::ConstructL" ); + __TIME_MARK( time ); + __PRINTS( "*** CXnAppUiAdapter::ConstructL - BaseConstructL" ); + __TIME_MARK( time2 ); + + EnableLocalScreenClearer( EFalse ); + CAknViewAppUi::BaseConstructL( EAknEnableSkin | EAknEnableMSK | EAknSingleClickCompatible ); - + CAknToolbar* toolbar( CurrentFixedToolbar() ); if ( toolbar ) @@ -70,25 +72,19 @@ toolbar->DisableToolbarL( ETrue ); } - -#ifdef _XN_PERFORMANCE_TEST_ - User::AllocSize( end ); - diff = end - start; - RDebug::Print( _L( "CAknViewAppUi::BaseConstructL allocation: %d" ), diff ); - CXnTimeMon::PrintUserMem( _L( "CXnAppUiAdapter::ConstructL(): - Calling CXnAppUiAdapterImpl::NewL().." ) ); - User::AllocSize( start ); -#endif //_XN_PERFORMANCE_TEST_ + + CEikStatusPane* sp( StatusPane() ); + if ( sp ) + { + sp->EnableTransparent( ETrue ); + } + + __TIME_ENDMARK( "CXnAppUiAdapter::ConstructL - BaseConstructL, done", time2 ); iImpl = CXnAppUiAdapterImpl::NewL( iApplicationUid, *this ); iImpl->ConstructL(); - -#ifdef _XN_PERFORMANCE_TEST_ - User::AllocSize( end ); - diff = end-start; - RDebug::Print( _L( "Xuikon launch allocation: %d" ), diff ); - - CXnTimeMon::PrintUserMem( _L( "CXnAppUiAdapter::ConstructL() .. all done." ) ); -#endif //_XN_PERFORMANCE_TEST_ + + __TIME_ENDMARK( "CXnAppUiAdapter::ConstructL, done", time ); } // ----------------------------------------------------------------------------- @@ -97,7 +93,7 @@ // ----------------------------------------------------------------------------- // EXPORT_C CXnAppUiAdapter::~CXnAppUiAdapter() - { + { delete iUiEngineAppIf; delete iImpl; @@ -110,9 +106,8 @@ // EXPORT_C void CXnAppUiAdapter::HandleResourceChangeL( TInt aType ) { -#ifdef _XN_PERFORMANCE_TEST_ - RDebug::Print( _L( "CXnAppUiAdapter::HandleResourceChangeL - start" ) ); -#endif //_XN_PERFORMANCE_TEST_ + __PRINTS( "*** CXnAppUiAdapter::HandleResourceChangeL" ); + __TIME_MARK( time ); CAknViewAppUi::HandleResourceChangeL( aType ); @@ -121,9 +116,7 @@ iImpl->HandleResourceChangeL( aType ); } -#ifdef _XN_PERFORMANCE_TEST_ - RDebug::Print( _L( "CXnAppUiAdapter::HandleResourceChangeL - end" ) ); -#endif //_XN_PERFORMANCE_TEST_ + __TIME_ENDMARK( "CXnAppUiAdapter::HandleResourceChangeL, done", time ); } // ----------------------------------------------------------------------------- @@ -155,14 +148,15 @@ } // ----------------------------------------------------------------------------- -// CXnAppUiAdapter::LoadDataPluginsL +// CXnAppUiAdapter::LoadPublisher // // ----------------------------------------------------------------------------- // -EXPORT_C void CXnAppUiAdapter::LoadDataPluginsL( - RPointerArray< CXnNodeAppIf >& /*aList*/ ) +EXPORT_C TInt CXnAppUiAdapter::LoadPublisher( CXnNodeAppIf& /*aPublisher*/, + TInt /*aReason*/ ) { // Default empty implementation + return KErrNone; } // ----------------------------------------------------------------------------- @@ -170,10 +164,11 @@ // // ----------------------------------------------------------------------------- // -EXPORT_C void CXnAppUiAdapter::DestroyDataPluginsL( - RPointerArray< CXnNodeAppIf >& /*aList*/ ) +EXPORT_C TInt CXnAppUiAdapter::DestroyPublisher( CXnNodeAppIf& /*aPublisher*/, + TInt /*aReason*/ ) { // Default empty implementation + return KErrNone; } // ----------------------------------------------------------------------------- @@ -189,17 +184,6 @@ } // ----------------------------------------------------------------------------- -// CXnAppUiAdapter::SetOnlineStateL -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CXnAppUiAdapter::SetOnlineStateL( - RPointerArray< CXnNodeAppIf >& /*aList*/ ) - { - // Default empty implementation - } - -// ----------------------------------------------------------------------------- // CXnAppUiAdapter::View // // ----------------------------------------------------------------------------- @@ -210,16 +194,6 @@ } // ----------------------------------------------------------------------------- -// CXnAppUiAdapter::HandlePageSwitch -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CXnAppUiAdapter::HandlePageSwitch() - { - // Default empty implementation - } - -// ----------------------------------------------------------------------------- // CXnAppUiAdapter::HandleEnterEditModeL // // ----------------------------------------------------------------------------- @@ -228,7 +202,119 @@ { // Default empty implementation } - + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::HandleEventL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnAppUiAdapter::HandleEventL( const TDesC& /*aEvent*/, + CXnNodeAppIf& /*aDestination*/ ) + { + // Default empty implementation + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::RemoveViewL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnAppUiAdapter::RemoveViewL( CAknView& aView ) + { + if ( iExitingApp ) return; // framework will destroy view + TVwsViewId activeViewId(KNullUid,KNullUid); + TBool activateDefaultView( EFalse ); + if ( GetActiveViewId( activeViewId ) == KErrNone && + activeViewId.iViewUid == aView.Id() ) + { + // currently active, deactivate + activateDefaultView = ETrue; + DeactivateActiveViewIfOwnerMatchL(); + } + + if ( iView == &aView ) { iView = NULL; } + CCoeAppUi::DeregisterView( aView ); + + const TInt count( iViews->Count() ); + for ( TInt i = 0; i < count; ++i ) + { + CAknView* view( iViews->At( i ) ); + if ( view == &aView && + view->Id() == aView.Id() ) + { + iViews->Delete( i ); + delete view; + view = NULL; + break; + } + } + + if ( activateDefaultView ) + { + // check which view is active now. + activeViewId = TVwsViewId(KNullUid,KNullUid); + GetActiveViewId( activeViewId ); + + TVwsViewId defaultViewId( KNullUid,KNullUid ); + // activate default if needed + if ( GetDefaultViewId( defaultViewId ) == KErrNone && + activeViewId != defaultViewId ) + { + ActivateViewL( defaultViewId ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::PrepareToExit +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnAppUiAdapter::PrepareToExit() + { + iExitingApp = ETrue; + + if ( iImpl ) + { + iImpl->UiStateListener().PrepareToExit(); + + iImpl->ViewAdapter().PrepareToExit(); + + iImpl->HsContentControlFactory()->PrepareToExit(); + } + + CAknViewAppUi::PrepareToExit(); + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::HandleUiReadyEventL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnAppUiAdapter::HandleUiReadyEventL() + { + // Default empty implementation + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::ProcessMessageL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnAppUiAdapter::ProcessMessageL( TUid aUid, + const TDesC8& /*aParams*/ ) + { + if ( aUid.iUid == KUidApaMessageSwitchOpenFileValue ) + { + // activate default homescreen view. + // customcontrol is set so that window group order is not changed + SetCustomControl( 1 ); + TRAP_IGNORE( ActivateLocalViewL( + View().Id(), TUid::Null(), KActivateDefaultView() ) ); + SetCustomControl( 0 ); + } + } + // ----------------------------------------------------------------------------- // CXnAppUiAdapter::ReloadUiL // @@ -335,7 +421,7 @@ // // ----------------------------------------------------------------------------- // -void CXnAppUiAdapter::ShowFocus() +void CXnAppUiAdapter::ShowFocus() { return iImpl->ViewAdapter().FocusControl().MakeVisible( ETrue ); } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnappuiadapterimpl.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnappuiadapterimpl.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnappuiadapterimpl.cpp Wed May 12 13:22:51 2010 +0300 @@ -19,8 +19,12 @@ #include #include #include +#include #include #include +#include +#include +#include // User includes #include "xnappuiadapter.h" @@ -28,13 +32,17 @@ #include "xnviewmanager.h" #include "xnviewadapter.h" #include "xnuistatelistener.h" +#include "xnbackgroundmanager.h" #include "hscontentcontrolfactory.h" #include "xneditor.h" #include "xnwallpaperview.h" #include "xneffectmanager.h" +#include "xnwaitdialog.h" #include "xnappuiadapterimpl.h" +#include "debug.h" + // Constants _LIT( KResourceDrive, "z:" ); _LIT( KResourceFile, "xnuiengine.rsc" ); @@ -72,9 +80,15 @@ // void CXnAppUiAdapterImpl::ConstructL() { -#ifdef _XN_PERFORMANCE_TEST_ - RDebug::Print( _L( "CXnAppUiAdapterImpl::ConstructL() - start" ) ); -#endif //_XN_PERFORMANCE_TEST_ + __PRINTS( "*** CXnAppUiAdapterImpl::ConstructL" ); + __TIME_MARK( time ); + + const TInt KMaxUidLength( 10 ); + _LIT8( KUint, "%u" ); + TBuf8< KMaxUidLength > uid; + uid.Format( KUint, iApplicationUid.iUid ); + + HSPluginSettingsIf::CHomescreenSettings::InitializeL( uid ); TFileName resFile; resFile.Append( KResourceDrive ); @@ -85,7 +99,7 @@ iResourceOffset = CCoeEnv::Static()->AddResourceFileL( resFile ); - iContentControlFactory = CHsContentControlFactory::NewL(); + iContentControlFactory = CHsContentControlFactory::NewL( iAdapter ); iUiStateListener = CXnUiStateListener::NewL( iAdapter ); @@ -99,17 +113,22 @@ iViewAdapter = CXnViewAdapter::NewL( iAdapter ); iViewManager->LoadUiL(); - + iCcProviderClient = CHsCcProviderClient::NewL( iViewManager->Editor() ); CXnWallpaperView* wallpaper = CXnWallpaperView::NewL( *iUiEngine ); + CleanupStack::PushL( wallpaper ); + + // wallpaper view is owned by CAknViewAppUi iAdapter.AddViewL( wallpaper ); - - iEffectManager = CXnEffectManager::NewL(); + CleanupStack::Pop( wallpaper ); -#ifdef _XN_PERFORMANCE_TEST_ - RDebug::Print( _L( "CXnAppUiAdapterImpl::ConstructL() - end" ) ); -#endif //_XN_PERFORMANCE_TEST_ + iEffectManager = CXnEffectManager::NewL(); + + iBackupRestoreObserver = CXnPropertySubscriber::NewL( + KUidSystemCategory, conn::KUidBackupRestoreKey, *this ); + + __TIME_ENDMARK( "CXnAppUiAdapterImpl::ConstructL, done", time ); } // ----------------------------------------------------------------------------- @@ -119,17 +138,14 @@ // void CXnAppUiAdapterImpl::ReloadUiL() { -#ifdef _XN_PERFORMANCE_TEST_ - RDebug::Print( _L( "CXnAppUiAdapterImpl::ReloadUiL() - start" ) ); -#endif //_XN_PERFORMANCE_TEST_ + __PRINTS( "*** CXnAppUiAdapterImpl::ReloadUiL" ); + __TIME_MARK( time ); iViewAdapter->ReloadUiL(); iViewManager->ReloadUiL(); - -#ifdef _XN_PERFORMANCE_TEST_ - RDebug::Print( _L( "CXnAppUiAdapterImpl::ReloadUiL() - end" ) ); -#endif //_XN_PERFORMANCE_TEST_ + + __TIME_ENDMARK( "CXnAppUiAdapterImpl::ReloadUiL, done", time ); } // ----------------------------------------------------------------------------- @@ -138,14 +154,14 @@ // ----------------------------------------------------------------------------- // CXnAppUiAdapterImpl::~CXnAppUiAdapterImpl() - { - if ( iViewAdapter ) + { + if ( iXnWaitDialog ) { - iViewAdapter->PrepareDestroy(); + TRAP_IGNORE( iXnWaitDialog->ProcessFinishedL(); ); } - delete iContentControlFactory; - + delete iBackupRestoreObserver; + delete iUiEngine; delete iUiStateListener; @@ -155,8 +171,11 @@ delete iCcProviderClient; delete iEffectManager; + + CCoeEnv::Static()->DeleteResourceFile( iResourceOffset ) ; + HSPluginSettingsIf::CHomescreenSettings::UnInitialize(); - CCoeEnv::Static()->DeleteResourceFile( iResourceOffset ) ; + delete iContentControlFactory; } // ----------------------------------------------------------------------------- @@ -212,6 +231,16 @@ } // ----------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::HsContentControlFactory +// Gets Content control factory +// ----------------------------------------------------------------------------- +// +CHsContentControlFactory* CXnAppUiAdapterImpl::HsContentControlFactory() + { + return iContentControlFactory; + } + +// ----------------------------------------------------------------------------- // CXnAppUiAdapterImpl::EffectManager // Get effect manager. // ----------------------------------------------------------------------------- @@ -241,4 +270,54 @@ iUiStateListener->HandleResourceChangeL( aType ); } +// ----------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::DisplayWaitDialogL +// Displays wait dialog during backup/restore. +// ----------------------------------------------------------------------------- +// +void CXnAppUiAdapterImpl::DisplayWaitDialogL() + { + if ( !iXnWaitDialog ) + { + iXnWaitDialog = new( ELeave ) CXnWaitDialog( + reinterpret_cast( &iXnWaitDialog ), ETrue ); + iXnWaitDialog->SetCallback( this ); + iXnWaitDialog->ExecuteLD( R_BACKUP_RESTORE_WAIT_DIALOG ); + } + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::BackupRestoreEvent +// Property changed notification callback +// ----------------------------------------------------------------------------- +// +void CXnAppUiAdapterImpl::PropertyChangedL( const TUint32 aKey, const TInt aValue ) + { + const TUint mask( conn::KBURPartTypeMask ^ conn::EBURNormal ); + if ( aKey == conn::KUidBackupRestoreKey ) + { + if ( aValue & mask ) + { + // Any type of backup or restore operation started + DisplayWaitDialogL(); + } + else if ( iXnWaitDialog ) + { + // Any type of backup or restore operation ended + iXnWaitDialog->ProcessFinishedL(); + // ProcessFinishedL() will NULL iXnWaitDialog + } + } + } + +// ---------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::DialogDismissedL() +// Callback method from MProgressDialogCallback interface. +// ---------------------------------------------------------------------------- +// +void CXnAppUiAdapterImpl::DialogDismissedL(TInt /*aButtonId*/) + { + // No implementation required. + } + // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp Wed May 12 13:22:51 2010 +0300 @@ -26,26 +26,35 @@ #include "xnappuiadapter.h" #include "xnwallpaperview.h" #include "xnrootdata.h" +#include "xnuiengine.h" +#include "xnoomsyshandler.h" +#include "xneffectmanager.h" // SYSTEM INCLUDE FILES +#include +#include #include #include -#include +#include #include -#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include +#include using namespace hspswrapper; +// Constants _LIT8( KSingle, "single" ); const TUid KDummyUid = { 0x0000000 }; +const TInt KSkinGfxInnerRectShrink( 5 ); +const TInt KCallbackDelay( 500000 ); // 500ms // ============================ MEMBER FUNCTIONS =============================== @@ -67,8 +76,9 @@ { CreateWindowL(); + iRect = TRect(); iBgContext = CAknsLayeredBackgroundControlContext::NewL( - KAknsIIDQsnBgScreenIdle, TRect(), ETrue, 1 ); + KAknsIIDQsnBgScreenIdle, iRect, ETrue, 1 ); TRect bgRect; AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, bgRect ); @@ -90,7 +100,13 @@ User::LeaveIfError( iDiskNotifier->NotifyDisk() ); // Reads from cenrep wheteher page specific wallpaper is enabled or not - CheckFeatureTypeL(); + CheckFeatureTypeL(); + + iTimer = CPeriodic::NewL( CActive::EPriorityIdle ); + + GfxTransEffect::Register( this, KGfxContextBgAppear ); + + iOomSysHandler = CXnOomSysHandler::NewL(); } // ----------------------------------------------------------------------------- @@ -114,6 +130,9 @@ // CXnBackgroundManager::~CXnBackgroundManager() { + GfxTransEffect::Deregister( this ); + + delete iTimer; CleanCache(); iSkinSrv.Close(); delete iDiskNotifier; @@ -121,6 +140,8 @@ delete iBgContext; delete iBgImage; delete iBgImagePath; + delete iOomSysHandler; + delete iSpMask; } // ----------------------------------------------------------------------------- @@ -129,23 +150,54 @@ // void CXnBackgroundManager::Draw(const TRect& aRect) const { - if( iFeatureSuppoted ) + CFbsBitmap* wallpaper( NULL ); + if( iType == EPageSpecific ) { CXnViewData& viewData( iViewManager.ActiveViewData() ); - CFbsBitmap* wallpaper = viewData.WallpaperImage(); - if( wallpaper ) - { - SystemGc().BitBlt( TPoint(0, 0), wallpaper ); - return; - } + wallpaper = viewData.WallpaperImage(); + } + else if( iType == ECommon ) + { + wallpaper = iBgImage; } - else if( iBgImage ) + + // Draw bg image + if( wallpaper ) + { + TSize bitmapSize = wallpaper->SizeInPixels(); + + // If image is smaller that screen size it needs to be centralized + if( iRect.Height() > bitmapSize.iHeight && iRect.Width() > bitmapSize.iWidth ) + { + TInt width = bitmapSize.iWidth / 2; + TInt height = bitmapSize.iHeight / 2; + + TPoint point = iRect.Center(); + point.SetXY( point.iX - width, point.iY - height ); + + SystemGc().SetBrushColor( KRgbBlack ); + SystemGc().Clear( aRect ); + SystemGc().DrawBitmap( TRect( point, bitmapSize), wallpaper ); + } + else + { + SystemGc().DrawBitmap( iRect, wallpaper ); + } + DrawStatusPaneMask(); + } + + // Skin bg is used by default + else + { + MAknsSkinInstance* skin( AknsUtils::SkinInstance() ); + AknsDrawUtils::Background( skin, iBgContext, this, SystemGc(), aRect ); + } + + // Draw edit mode background highlight + if( iViewManager.UiEngine().IsEditMode() ) { - SystemGc().BitBlt( TPoint(0, 0), iBgImage ); - return; - } - MAknsSkinInstance* skin( AknsUtils::SkinInstance() ); - AknsDrawUtils::Background( skin, iBgContext, this, SystemGc(), aRect ); + DrawEditModeBackgroundSkin(); + } } // ----------------------------------------------------------------------------- @@ -155,11 +207,11 @@ void CXnBackgroundManager::SizeChanged() { iRect = Rect(); - if( iFeatureSuppoted ) + if( iType == EPageSpecific ) { TRAP_IGNORE( UpdateWallpapersL() ); } - else + else if( iType == ECommon ) { if( iBgImagePath ) { @@ -169,6 +221,34 @@ } } iBgContext->SetRect( iRect ); + + // create status pane mask image and set size + if( iSpMask ) + { + delete iSpMask; + iSpMask = NULL; + } + + TRect spRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, spRect ); + + TInt err( KErrNone ); + + if( Layout_Meta_Data::IsLandscapeOrientation() ) + { + TRAP( err, iSpMask = AknsUtils::CreateBitmapL( AknsUtils::SkinInstance(), + KAknsIIDQgnGrafBgLscTopMaskIcon ) ); + } + else + { + TRAP( err, iSpMask = AknsUtils::CreateBitmapL( AknsUtils::SkinInstance(), + KAknsIIDQgnGrafBgPrtTopMaskIcon ) ); + } + + if( iSpMask ) + { + AknIconUtils::SetSize( iSpMask, spRect.Size(), EAspectRatioNotPreserved ); + } } // ----------------------------------------------------------------------------- @@ -252,15 +332,22 @@ // TInt CXnBackgroundManager::AddWallpaperL( const TDesC& aFileName ) { - TInt retVal = KErrNone; - if( iFeatureSuppoted ) + TInt retVal( KErrNone ); + + GfxTransEffect::Begin( this, KGfxControlActionAppear ); + + if ( iType == EPageSpecific ) { retVal = AddPageSpecificWallpaperL( aFileName ); } - else + else if ( iType == ECommon ) { retVal = AddCommonWallpaperL( aFileName ); } + + GfxTransEffect::SetDemarcation( this, Position() ); + GfxTransEffect::End( this ); + return retVal; } @@ -270,7 +357,7 @@ // void CXnBackgroundManager::DeleteWallpaper( CXnViewData& aViewData ) { - if( iFeatureSuppoted ) + if( iType == EPageSpecific ) { const TDesC& path = aViewData.WallpaperImagePath(); if( path != KNullDesC ) @@ -280,7 +367,7 @@ aViewData.SetWallpaperImage( NULL ); } } - else + else if( iType == ECommon ) { if( iBgImagePath ) { @@ -294,29 +381,33 @@ } // --------------------------------------------------------------------------- -// CXnBackgroundManager::ActivatedL +// CXnBackgroundManager::WallpaperType // --------------------------------------------------------------------------- // -TBool CXnBackgroundManager::ActivatedL() +CXnBackgroundManager::WppType CXnBackgroundManager::WallpaperType() { - return iFeatureSuppoted; + return iType; } - + // ----------------------------------------------------------------------------- // CXnBackgroundManager::WallpaperChanged // ----------------------------------------------------------------------------- // -void CXnBackgroundManager::WallpaperChanged( CXnViewData& aOldView, CXnViewData& aNewView ) +void CXnBackgroundManager::WallpaperChanged( const CXnViewData& aOldView, + const CXnViewData& aNewView ) { - if( iFeatureSuppoted && + if( iType == EPageSpecific && aOldView.WallpaperImagePath().Compare( aNewView.WallpaperImagePath() ) ) { UpdateScreen(); - TInt err = AknsWallpaperUtils::SetIdleWallpaper( aNewView.WallpaperImagePath(), NULL ); - if( err == KErrNone ) + + // Since AknsWallpaperUtils::SetIdleWallpaper() call is slow, it is called + // asynchronously. In that way we can avoid it slowing down page switching. + if ( iTimer->IsActive() ) { - iIntUpdate++; + iTimer->Cancel(); } + iTimer->Start(KCallbackDelay, KCallbackDelay, TCallBack( TimerCallback, this ) ); } } @@ -327,7 +418,7 @@ void CXnBackgroundManager::SaveWallpaperL() { // Save wallpaper to HSPS - if( iFeatureSuppoted ) + if( iType == EPageSpecific ) { TBuf8 wallpaper8; CXnViewData& viewData( iViewManager.ActiveViewData() ); @@ -449,8 +540,19 @@ } else if ( selectedIndex == 1 ) { - iViewManager.AppUiAdapter().ActivateLocalViewL( KWallpaperViewUid, - KDummyUid, KSingle ); + if ( CXnOomSysHandler::HeapAvailable( CXnOomSysHandler::EMem6MB ) ) + { + CXnAppUiAdapter& appui( iViewManager.AppUiAdapter() ); + + appui.EffectManager()->BeginFullscreenEffectL( + KGfxContextOpenWallpaperView, iViewManager.ActiveViewData() ); + + appui.ActivateLocalViewL( KWallpaperViewUid, KDummyUid, KSingle ); + } + else + { + OomSysHandler().HandlePotentialOomL(); + } } } CleanupStack::Pop( query ); @@ -584,7 +686,7 @@ // void CXnBackgroundManager::RemovableDiskInsertedL() { - if( iFeatureSuppoted ) + if( iType == EPageSpecific ) { CXnRootData& rootData = iViewManager.ActiveAppData(); if( !&rootData ) @@ -601,7 +703,7 @@ if( path != KNullDesC && !bitmap ) { TInt err = CacheWallpaperL( path, *viewData ); - if( err == KErrNone ) + if( err == KErrNone && viewData == &iViewManager.ActiveViewData() ) { drawingNeeded = ETrue; } @@ -610,6 +712,13 @@ if( drawingNeeded ) { UpdateScreen(); + + TInt err = AknsWallpaperUtils::SetIdleWallpaper( + iViewManager.ActiveViewData().WallpaperImagePath(), NULL ); + if( err == KErrNone ) + { + iIntUpdate++; + } } } else @@ -627,7 +736,7 @@ // void CXnBackgroundManager::CheckFeatureTypeL() { - iFeatureSuppoted = EFalse; + iType = ECommon; CRepository* repository = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); CleanupStack::PushL( repository ); if ( repository ) @@ -637,7 +746,7 @@ TInt err = repository->Get( KAIWallpaperChangeType, type ); if ( err == KErrNone && type == 1) { - iFeatureSuppoted = ETrue; + iType = EPageSpecific; } else { @@ -662,43 +771,43 @@ CXnViewData& viewData( iViewManager.ActiveViewData() ); const TDesC& old = viewData.WallpaperImagePath(); - if( aFileName.Compare( old ) ) + // Remove old from the cache + if( old != KNullDesC ) { - // Remove old from the cache - if( old != KNullDesC ) - { - RemoveWallpaperFromCache( old ); - } + RemoveWallpaperFromCache( old ); + } - // Add new to the cache - if( aFileName != KNullDesC ) + // Add new to the cache + if( aFileName != KNullDesC ) + { + err = CacheWallpaperL( aFileName, viewData ); + + if( err == KErrNone ) { - if( CacheWallpaperL( aFileName, viewData ) == KErrNone ) - { - SaveWallpaperL(); // to HSPS - } - else - { - // image is corrupted or format is not supported - return KErrCACorruptContent; - } + SaveWallpaperL(); // to HSPS } - // WallpaperImage changed back to default. Update view data. else { - viewData.SetWallpaperImagePathL( KNullDesC ); - viewData.SetWallpaperImage( NULL ); - } - - // Update screen - UpdateScreen(); - - err = AknsWallpaperUtils::SetIdleWallpaper( aFileName, NULL ); - if( err == KErrNone ) - { - iIntUpdate++; + return err; } } + // WallpaperImage changed back to default. Update view data. + else + { + viewData.SetWallpaperImagePathL( KNullDesC ); + viewData.SetWallpaperImage( NULL ); + SaveWallpaperL(); // to HSPS + } + + // Update screen + UpdateScreen(); + + err = AknsWallpaperUtils::SetIdleWallpaper( aFileName, NULL ); + if( err == KErrNone ) + { + iIntUpdate++; + } + return err; } @@ -724,13 +833,13 @@ { iBgImagePath = aFileName.AllocL(); - TBool err( KErrNone ); + err = KErrNone; TRAP( err, iSkinSrv.AddWallpaperL( aFileName, iRect.Size() ) ); - if( err ) + if( err != KErrNone ) { - // image is corrupted or format is not supported - return KErrCACorruptContent; + return err; } + TRAP( err, iBgImage = iSkinSrv.WallpaperImageL( aFileName ) ); if( err ) { @@ -776,13 +885,13 @@ { if ( wallpaperType == 0 ) { - if( iFeatureSuppoted ) + if( iType == EPageSpecific ) { CXnViewData& viewData( iViewManager.ActiveViewData() ); RemoveWallpaperFromCache( viewData.WallpaperImagePath() ); RemoveWallpaperL( viewData ); } - else + else if( iType == ECommon ) { if( iBgImagePath ) { @@ -803,11 +912,11 @@ err = repository->Get( KPslnIdleBackgroundImagePath, wallpaper ); if ( err == KErrNone ) { - if( iFeatureSuppoted ) + if( iType == EPageSpecific ) { AddPageSpecificWallpaperL( wallpaper ); } - else + else if( iType == ECommon ) { AddCommonWallpaperL( wallpaper, EFalse ); } @@ -836,4 +945,63 @@ } } +// ----------------------------------------------------------------------------- +// CXnBackgroundManager::DrawEditModeBackgroundSkin +// ----------------------------------------------------------------------------- +// +void CXnBackgroundManager::DrawEditModeBackgroundSkin() const + { + TRect shrunkRect = iRect; + + shrunkRect.Shrink( + KSkinGfxInnerRectShrink, + KSkinGfxInnerRectShrink ); + + AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), SystemGc(), + iRect, shrunkRect, KAknsIIDQgnHomeEditBg, KAknsIIDDefault ); + } + +// ----------------------------------------------------------------------------- +// CXnBackgroundManager::TimerCallback +// ----------------------------------------------------------------------------- +// +TInt CXnBackgroundManager::TimerCallback(TAny *aPtr) + { + CXnBackgroundManager* bgManager = reinterpret_cast( aPtr ); + bgManager->iTimer->Cancel(); + + TInt err = AknsWallpaperUtils::SetIdleWallpaper( bgManager-> + iViewManager.ActiveViewData().WallpaperImagePath(), NULL ); + if( err == KErrNone ) + { + bgManager->iIntUpdate++; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CXnBackgroundManager::DrawStatusPaneMask +// ----------------------------------------------------------------------------- +// +void CXnBackgroundManager::DrawStatusPaneMask() const + { + if( iSpMask ) + { + TSize bmpSize = iSpMask->SizeInPixels(); + TRect spRect( 0, 0, bmpSize.iWidth, bmpSize.iHeight ); + SystemGc().DrawBitmap( spRect, iSpMask ); + } + } + +// ----------------------------------------------------------------------------- +// CXnBackgroundManager::OOMSysHandler +// ----------------------------------------------------------------------------- +// +CXnOomSysHandler& CXnBackgroundManager::OomSysHandler() const + { + __ASSERT_DEBUG( iOomSysHandler , User::Panic( _L("xnbackgroundmanager"), 0 ) ); + + return *iOomSysHandler; + } + // End of File diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnbgcontrol.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnbgcontrol.cpp Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,326 +0,0 @@ -/* -* 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: Background appearance drawer -* -*/ - -// System includes -#include - -// User includes -#include "xnappuiadapter.h" -#include "xnuiengine.h" -#include "xneditmode.h" - -#include "xnbgcontrol.h" - -// Constants - -// ============================ LOCAL FUNCTIONS ================================ - -// ============================ MEMBER FUNCTIONS =============================== -// ----------------------------------------------------------------------------- -// CXnBgControl::NewL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CXnBgControl* CXnBgControl::NewL() - { - CXnBgControl* self = CXnBgControl::NewLC(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::NewLC() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CXnBgControl* CXnBgControl::NewLC() - { - CXnBgControl* self = new ( ELeave ) CXnBgControl(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::~CXnBgControl() -// C++ default destructor. -// ----------------------------------------------------------------------------- -// -CXnBgControl::~CXnBgControl() - { - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::CXnBgControl() -// C++ default constructor. -// ----------------------------------------------------------------------------- -// -CXnBgControl::CXnBgControl() - : iHitpoint( TPoint( -1,-1 ) ) - { - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::ConstructL() -// 2nd phase constructor -// ----------------------------------------------------------------------------- -// -void CXnBgControl::ConstructL() - { - CreateWindowL(); - - TRgb backgroundColour = KRgbWhite; - if( KErrNone == Window().SetTransparencyAlphaChannel() ) - { - backgroundColour.SetAlpha( 0 ); - } - Window().SetBackgroundColor( backgroundColour ); - - EnableDragEvents(); - - Window().SetPointerGrab( ETrue ); - - - ActivateL(); - - MakeVisible( ETrue ); - - SetComponentsToInheritVisibility( ETrue ); - - static_cast< CXnAppUiAdapter* >( iAvkonAppUi ) - ->UiStateListener().AddObserver( *this ); - - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::CountComponentControls() -// -// ----------------------------------------------------------------------------- -// -TInt CXnBgControl::CountComponentControls() const - { - if ( iControl ) - { - return 1; - } - - return 0; - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::ComponentControl() -// -// ----------------------------------------------------------------------------- -// -CCoeControl* CXnBgControl::ComponentControl( TInt aIndex ) const - { - if ( aIndex == 0 ) - { - return iControl; - } - - return NULL; - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::SizeChanged() -// -// ----------------------------------------------------------------------------- -// -void CXnBgControl::SizeChanged() - { - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::Draw() -// -// ----------------------------------------------------------------------------- -// -void CXnBgControl::Draw( const TRect& aRect ) const - { - CXnAppUiAdapter* appui( - static_cast< CXnAppUiAdapter* >( iAvkonAppUi ) ); - - TInt state( appui->UiEngine().EditMode()->EditState() ); - - CWindowGc& gc( SystemGc() ); - - if ( state == CXnEditMode::EShootContent ) - { - // No background needed for dragging widget screenshot - } - else - { - gc.Clear( aRect ); - } - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::SetCompoundControl() -// -// ----------------------------------------------------------------------------- -// -void CXnBgControl::HandlePointerEventL( const TPointerEvent& aPointerEvent ) - { - switch( aPointerEvent.iType ) - { - case TPointerEvent::EButton1Down: - iHitpoint = aPointerEvent.iPosition; - break; - - case TPointerEvent::EButton1Up: - break; - - default: - break; - } - - CXnAppUiAdapter* appui( static_cast< CXnAppUiAdapter* >( iAvkonAppUi ) ); - - appui->UiEngine().DisableRenderUiLC(); - - CCoeControl::HandlePointerEventL( aPointerEvent ); - - appui->UiEngine().RenderUIL(); - - CleanupStack::PopAndDestroy(); - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::SetCompoundControl() -// -// ----------------------------------------------------------------------------- -// -void CXnBgControl::SetCompoundControl( CCoeControl* aControl ) - { - if ( iControl == aControl ) - { - return; - } - - if ( iControl ) - { - // Remove parents - iControl->SetParent( NULL ); - iControl->SetMopParent( NULL ); - - iControl->MakeVisible( EFalse ); - } - - if ( aControl ) - { - // Set self as parent - aControl->SetParent( this ); - aControl->SetMopParent( this ); - - aControl->MakeVisible( ETrue ); - } - - iControl = aControl; - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::ResetGrabbingL() -// Service for removing grabbing controls -// ----------------------------------------------------------------------------- -// -void CXnBgControl::ResetGrabbingL() - { - TPointerEvent event; - event.iType = TPointerEvent::EButton1Up; - - RemoveGrabbingControL( this, event ); - - iHitpoint.SetXY( -1, -1 ); - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::PrepareDestroy() -// Prepares control for destroying -// ----------------------------------------------------------------------------- -// -void CXnBgControl::PrepareDestroy() - { - static_cast< CXnAppUiAdapter* >( iAvkonAppUi ) - ->UiStateListener().RemoveObserver( *this ); - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::RemoveGrabbingControL() -// Removes recursively grabbing controls -// ----------------------------------------------------------------------------- -// -void CXnBgControl::RemoveGrabbingControL( const CCoeControl* aControl, - const TPointerEvent& aEvent ) const - { - TInt count = aControl->CountComponentControls(); - - for( TInt i = 0; i < count; i++ ) - { - CCoeControl* child = aControl->ComponentControl( i ); - - if( child && child->Rect().Contains( iHitpoint ) ) - { - child->CCoeControl::HandlePointerEventL( aEvent ); - RemoveGrabbingControL( child, aEvent ); - } - } - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::NotifyForegroundChanged() -// Notifies foreground changes. -// ----------------------------------------------------------------------------- -// -void CXnBgControl::NotifyForegroundChanged( TForegroundStatus aStatus ) - { - switch( aStatus ) - { - case EForeground: - break; - - case EUnknown: - case EBackground: - case EPartialForeground: - default: - TRAP_IGNORE( ResetGrabbingL(); ) - break; - } - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::NotifyLightStatusChanged() -// Notifies primary display light status is changed. -// ----------------------------------------------------------------------------- -// -void CXnBgControl::NotifyLightStatusChanged( TBool /*aLightsOn*/ ) - { - - } - -// ----------------------------------------------------------------------------- -// CXnBgControl::NotifyInCallStateChaged() -// Notifies in-call state is changed. -// ----------------------------------------------------------------------------- -// -void CXnBgControl::NotifyInCallStateChaged( TBool /*aInCall*/ ) - { - - } - -// End of file - diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xncomponent.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xncomponent.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xncomponent.cpp Wed May 12 13:22:51 2010 +0300 @@ -150,3 +150,16 @@ { return NULL; } + +// ----------------------------------------------------------------------------- +// CXnComponent::SetDataL +// Set data stream +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnComponent::SetDataL( const TDesC8& aData, const TDesC& aType, TInt aIndex ) + { + if ( iAdapter ) + { + iAdapter->SetDataL( aData, aType, aIndex ); + } + } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xncomponentfactory.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xncomponentfactory.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xncomponentfactory.cpp Wed May 12 13:22:51 2010 +0300 @@ -97,10 +97,6 @@ if ( type == KView ) { - CXnAppUiAdapter* appui = static_cast< CXnAppUiAdapter* >( iAvkonAppUi ); - - adapter->SetContainerWindowL( appui->ViewAdapter().BgControl() ); - aNode.ViewNodeImpl()->SetComponent( aTargetComponent ); } else @@ -130,9 +126,7 @@ // Don't activate tooltip yet adapter->ActivateL(); } - - adapter->MakeVisible( EFalse ); - + CleanupStack::Pop( aTargetComponent ); return response; diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xncomposer.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xncomposer.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xncomposer.cpp Wed May 12 13:22:51 2010 +0300 @@ -38,7 +38,6 @@ #include "xnbackgroundmanager.h" // Constants -_LIT8( KStateWaitConfirmation, "WaitForConfirmation" ); _LIT8( KStateError, "Error" ); _LIT8( KXmluiml, "xmluiml" ); @@ -46,7 +45,6 @@ _LIT8( KViews, "views" ); _LIT8( KWidget, "widget" ); _LIT8( KUseEmptyWidget, "use_empty_widget" ); -_LIT8( KRemovable, "removable" ); _LIT8( KEmptyWidgetUid, "0x2001F47F" ); @@ -61,7 +59,8 @@ // Get property value from configuration. // -------------------------------------------------------------------------- // -static HBufC* ItemValueL( CHspsConfiguration& aConfiguration, const TDesC8& aItemId, const TDesC8& aName ) +static HBufC* ItemValueL( CHspsConfiguration& aConfiguration, + const TDesC8& aItemId, const TDesC8& aName ) { HBufC* ret = NULL; @@ -103,7 +102,7 @@ // @return returns pointer to desired node, NULL if nothing found // --------------------------------------------------------------------------- // -CXnDomNode* FindNodeByName( CXnDomNode* aNode, const TDesC8& aName ) +static CXnDomNode* FindNodeByName( CXnDomNode* aNode, const TDesC8& aName ) { if ( !aNode ) { @@ -132,12 +131,57 @@ } // --------------------------------------------------------------------------- +// Finds template publisher name +// +// --------------------------------------------------------------------------- +// +static const TDesC8& FindTemplatePublisherName( CXnDomNode* aNode ) + { + if ( !aNode ) + { + return KNullDesC8(); + } + + CXnDomList& list( aNode->ChildNodes() ); + + for ( TInt i = 0; i < list.Length(); i++ ) + { + CXnDomNode* node = static_cast< CXnDomNode* >( list.Item( i ) ); + + // Find element + if ( node->Name() == KConfigurationModel ) + { + CXnDomList& attributes( node->AttributeList() ); + + CXnDomAttribute* name( + static_cast< CXnDomAttribute* >( + attributes.FindByName( XnPropertyNames::action::KName ) ) ); + + // Find attribute name="publisher" + if ( name && name->Value() == KPublisher ) + { + CXnDomAttribute* value( + static_cast< CXnDomAttribute* >( + attributes.FindByName( XnPropertyNames::action::KValue ) ) ); + + if ( value ) + { + return value->Value(); + } + } + } + } + + return KNullDesC8(); + } + +// --------------------------------------------------------------------------- // FindNodeById // Finds recursively node by id // @return returns pointer to desired node, NULL if nothing found // --------------------------------------------------------------------------- // -CXnDomNode* FindNodeById( CXnDomNode* aNode, const TDesC8& aId ) +static CXnDomNode* FindNodeById( CXnDomNode* aNode, const TDesC8& aId ) { if ( !aNode ) { @@ -347,25 +391,6 @@ return EFalse; } -// -------------------------------------------------------------------------- -// Removable -// Determines whether this plugin is removable -// -------------------------------------------------------------------------- -// -static TBool Removable( CXnDomNode& aPlugin ) - { - CXnDomAttribute* attribute( - static_cast< CXnDomAttribute* >( - aPlugin.AttributeList().FindByName( KRemovable ) ) ); - - if ( attribute && attribute->Value() == XnPropertyNames::KFalse ) - { - return EFalse; - } - - return ETrue; - } - // ======== MEMBER FUNCTIONS ======== // -------------------------------------------------------------------------- // CXnComposer::NewL @@ -567,8 +592,7 @@ } aViewData.SetConfigurationIdL( configuration->ConfId() ); - aViewData.SetPluginStateL( KStateWaitConfirmation ); - + // Find a resource which can be internalized const CObjectMap* resourceObject = FindObject( configuration->Resources(), KTagXuikon ); @@ -613,15 +637,19 @@ CXnBackgroundManager& bgManager = appui->ViewAdapter().BgManager(); // if page specific wallpaper feature is enabled - if( bgManager.ActivatedL() ) + if( bgManager.WallpaperType() == CXnBackgroundManager::EPageSpecific ) { HBufC* bgImage = ItemValueL( *configuration, KWallpaper, KPath ); - CleanupStack::PushL( bgImage ); - if( bgImage && bgImage->Length() > 0 ) + if ( bgImage ) { - bgManager.CacheWallpaperL( bgImage->Des(), aViewData ); + CleanupStack::PushL( bgImage ); + bgImage->Des().Trim(); + if( bgImage && bgImage->Length() > 0 ) + { + bgManager.CacheWallpaperL( bgImage->Des(), aViewData ); + } + CleanupStack::PopAndDestroy( bgImage ); } - CleanupStack::PopAndDestroy( bgImage ); } if ( pluginNode ) { @@ -656,8 +684,12 @@ widget->SetOwner( node ); if ( count < plugins.Count() ) - { - widget->SetPluginIdL( plugins[ count ]->PluginId() ); + { + CPluginMap* plugin( plugins[count] ); + + widget->SetPluginIdL( plugin->PluginId() ); + + widget->SetLockingStatus( plugin->LockingStatus() ); } count++; @@ -713,8 +745,7 @@ } aPluginData.SetConfigurationIdL( configuration->ConfId() ); - aPluginData.SetPluginStateL( KStateWaitConfirmation ); - + // Find a resource which can be internalized const CObjectMap* resourceObject = FindObject( configuration->Resources(), KTagXuikon ); @@ -754,24 +785,11 @@ if ( info.Type() == KKeyTemplate ) { - CXnDomNode* node( FindNodeByName( widgetRoot, KContentSourceNode ) ); + const TDesC8& name( FindTemplatePublisherName( widgetRoot ) ); - if ( node ) - { - CXnDomList& attributes( node->AttributeList() ); - - CXnDomAttribute* attribute( static_cast< CXnDomAttribute* >( - attributes.FindByName( KName ) ) ); + aPluginData.SetPublisherNameL( name ); + } - if ( attribute ) - { - aPluginData.SetPublisherNameL( attribute->Value() ); - } - } - } - - aPluginData.SetRemovable( Removable( *widgetRoot ) ); - retval = KErrNone; } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xncontroladapter.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xncontroladapter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xncontroladapter.cpp Wed May 12 13:22:51 2010 +0300 @@ -127,7 +127,11 @@ iLongTapDetector->SetTimeDelayBeforeAnimation( KLongTapStartDelay ); iLongTapDetector->SetLongTapDelay( KLongTapTimeDelay ); + iCurrentLongTapStartDelay = KLongTapStartDelay; + iCurrentLongTapTimeDelay = KLongTapTimeDelay; } + + CCoeControl::MakeVisible( EFalse ); } // ----------------------------------------------------------------------------- @@ -582,3 +586,32 @@ { return iImpl->ChildAdapters(); } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::SetLongTapDelay +// ----------------------------------------------------------------------------- +// +void CXnControlAdapter::SetLongTapDelays( const TInt aStartDelay, + const TInt aLongTapDelay ) + { + if ( iCurrentLongTapTimeDelay != aLongTapDelay) + { + iLongTapDetector->SetLongTapDelay( aLongTapDelay ); + iCurrentLongTapTimeDelay = aLongTapDelay; + } + if ( iCurrentLongTapStartDelay != aStartDelay ) + { + iLongTapDetector->SetTimeDelayBeforeAnimation( aStartDelay ); + iCurrentLongTapStartDelay = aStartDelay; + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::SetDataL +// Empty default implemenatation for setting the data stream. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::SetDataL( const TDesC8& /*aData*/, const TDesC& /*aType*/, TInt /*aIndex*/ ) + { + + } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp Wed May 12 13:22:51 2010 +0300 @@ -39,6 +39,7 @@ #include "xncontroladapterimpl.h" #include "xncontroladapter.h" #include "xnmenuadapter.h" +#include "xnviewcontroladapter.h" #include "xncomponentnodeimpl.h" #include "xntype.h" #include "xnnodepluginif.h" @@ -52,7 +53,6 @@ #include "xndomlist.h" #include "xnodt.h" #include "xnresource.h" -#include "xnhittest.h" #include "xnplugindata.h" #include "xnnode.h" #include "xnpanic.h" @@ -60,17 +60,19 @@ #include "xnscrollablecontroladapter.h" #include "xnfocuscontrol.h" #include "xneditmode.h" -#include "xnbgcontrol.h" _LIT8(KScrollableBoxNodeName, "scrollablebox"); - -using namespace XnGestureHelper; -#include "xngesture.h" // Constants const TInt KSkinGfxInnerRectShrink = 5; const TInt KFocusGrowValue = 3; +const TInt KLongTapStartShortDelay( 150000 ); // 0.15s for Sk +const TInt KLongTapStartLongDelay( 500000 ); // 0.5s +const TInt KLongTapTimeShortDelay( 600000 ); // 0.6s for SK +const TInt KLongTapTimeLongDelay( 1500000 ); // 1.5s + +const TInt KDragThreshold = 20; // pixels // LOCAL FUNCTION PROTOTYPES static TRgb ConvertHslToRgb( TInt aHue, TInt aSaturation, TInt aLightness ); @@ -358,7 +360,7 @@ CXnResource& aResource, CFbsBitmap*& aBitmap, CFbsBitmap*& aBitmapMask, - TRect /*aRect*/, + TRect aRect, RFs& aFsSession ) { RFile file; @@ -371,7 +373,9 @@ CFbsBitmap* frameBuffer = new ( ELeave ) CFbsBitmap; CleanupStack::PushL( frameBuffer ); - frameBuffer->Create( TSize( 0, 0 ), EColor16M ); + TSize contentSize( aRect.Size() ); + + frameBuffer->Create( contentSize, EColor16M ); TFontSpec fontSpec; CSvgEngineInterfaceImpl* svgEngine = @@ -381,14 +385,9 @@ svgEngine->Load( file ); - TSize contentSize = svgEngine->ContentDimensions(); - TInt domHandle; svgEngine->PrepareDom( file, domHandle ); - svgEngine->SetSvgDimensionToFrameBuffer( - contentSize.iWidth, contentSize.iHeight ); - CFbsBitmap* target = new ( ELeave ) CFbsBitmap; target->Create( contentSize, EColor16M ); svgEngine->RenderDom( domHandle, target ); @@ -3355,44 +3354,6 @@ // ----------------------------------------------------------------------------- // SoftkeyNode -// Gets the node of softkey according to index -// ----------------------------------------------------------------------------- -// -static CXnNode* SoftkeyNodeL( CXnNode* aMenuBarNode, const TDesC8& aSoftkey ) - { - if ( aMenuBarNode ) - { - XnMenuInterface::MXnMenuInterface* menuIf( NULL ); - XnComponentInterface::MakeInterfaceL( menuIf, aMenuBarNode->AppIfL() ); - CXnNodePluginIf* skNode( NULL ); - if ( menuIf ) - { - if ( aSoftkey == XnPropertyNames::softkey::type::KLeft ) - { - skNode = menuIf->SoftKeyL( - XnMenuInterface::MXnMenuInterface::ELeft ); - } - else if ( aSoftkey == XnPropertyNames::softkey::type::KMiddle ) - { - skNode = menuIf->SoftKeyL( - XnMenuInterface::MXnMenuInterface::ECenter ); - } - else if ( aSoftkey == XnPropertyNames::softkey::type::KRight ) - { - skNode = menuIf->SoftKeyL( - XnMenuInterface::MXnMenuInterface::ERight ); - } - } - if ( skNode ) - { - return &skNode->Node(); - } - } - return NULL; - } - -// ----------------------------------------------------------------------------- -// SoftkeyNode // Gets the node of softkey according to pointer location // ----------------------------------------------------------------------------- // @@ -3520,6 +3481,8 @@ if ( control && control->RefusesFocusLoss() ) { + focused->HideTooltipsL(); + // It is now time to give up holding focus focused->UnsetStateL( XnPropertyNames::style::common::KFocus ); @@ -3651,11 +3614,8 @@ iAnimation->Stop(); delete iAnimation; } - - if ( iGestureHelper ) - { - delete iGestureHelper; - } + + delete iGestureFw; } // ----------------------------------------------------------------------------- @@ -3719,29 +3679,21 @@ for ( ; temp; temp = temp->Parent() ) { if ( temp == menuBar ) - { - // This is softkey node - const TDesC8* pos( NULL ); - node = NULL; - - if ( aKeyEvent.iScanCode == EStdKeyDevice0 ) - { - pos = &XnPropertyNames::softkey::type::KLeft; - } - else if ( aKeyEvent.iScanCode == EStdKeyDevice1 ) + { + // This is softkey node + XnMenuInterface::MXnMenuInterface* menuIf( NULL ); + XnComponentInterface::MakeInterfaceL( menuIf, menuBar->AppIfL() ); + + if ( menuIf ) { - pos = &XnPropertyNames::softkey::type::KRight; - } - else if ( aKeyEvent.iScanCode == EStdKeyDevice3 ) - { - pos = &XnPropertyNames::softkey::type::KMiddle; + CXnNodePluginIf* eventNode( menuIf->KeyEventNode() ); + + if ( eventNode ) + { + node = &eventNode->Node(); + } } - - if ( pos ) - { - node = SoftkeyNodeL( menuBar, *pos ); - } - + break; } } @@ -3756,7 +3708,7 @@ aKeyEvent.iScanCode == EStdKeyDevice3 ) // MSK { if ( aType == EEventKeyDown ) - { + { iLongtap = EFalse; if ( aKeyEvent.iScanCode == EStdKeyDevice3 || @@ -3896,14 +3848,17 @@ CancelFocusRefusalL( *engine ); appui.HideFocus(); - - CCoeControl& bg( appui.ViewAdapter().BgControl() ); - - // Ignore events - bg.IgnoreEventsUntilNextPointerUp(); - static_cast(&bg)->ResetGrabbingL(); - - // Indicate long tap has taken plave + + if ( !menuBar ) + { + CXnViewControlAdapter* control = static_cast< CXnViewControlAdapter* >( + appui.ViewManager().ActiveViewData().ViewNode()->Control() ); + + control->IgnoreEventsUntilNextPointerUp(); + control->ResetGrabbing(); + } + + // Indicate long tap has taken place iLongtap = ETrue; CXnNode* hold = BuildTriggerNodeL( *engine, @@ -3919,6 +3874,23 @@ } // ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::IsDragThresholdExceeded +// Checks if drag threshold is exceeded +// ----------------------------------------------------------------------------- +// +TBool CXnControlAdapterImpl::IsDragThresholdExceeded( const TPoint& aPoint ) + { + TBool ret = EFalse; + TPoint distance = aPoint - iButtonDownStartPoint; + if ( Abs( distance.iX ) >= KDragThreshold || + Abs( distance.iY ) >= KDragThreshold ) + { + ret = ETrue; + } + return ret; + } + +// ----------------------------------------------------------------------------- // CXnControlAdapterImpl::HandlePointerEventL // Handle pointer events // ----------------------------------------------------------------------------- @@ -3930,19 +3902,17 @@ CXnNode* node( &iNode.Node() ); CXnUiEngine* engine( node->UiEngine() ); - - // Forward event to gesture helper - if( PassEventToGestureHelperL( aPointerEvent ) ) - { - CXnAppUiAdapter& appui( engine->AppUiAdapter() ); - CCoeControl& bg( appui.ViewAdapter().BgControl() ); - static_cast(&bg)->ResetGrabbingL(); - - // Swipe took place, consume this event - return ETrue; - } - + if ( !engine->IsPartialInputActive() ) + { + InitializeGestureL( aPointerEvent ); + } + else + { + // reset destination + iGestureDestination = NULL; + } + TBool menuBar( node == engine->MenuBarNode() ); if ( menuBar ) @@ -3959,7 +3929,8 @@ CAknLongTapDetector* detector( iAdapter->LongTapDetector() ); - if ( detector ) + if ( ( detector && ( !engine->IsPartialInputActive() || + event.iType == TPointerEvent::EButton1Up ) ) ) { if ( menuBar ) { @@ -3972,11 +3943,15 @@ if ( prop && prop->StringValue() == XnPropertyNames::KTrue ) { + iAdapter->SetLongTapDelays( KLongTapStartShortDelay, + KLongTapTimeShortDelay ); detector->PointerEventL( event ); } } else { + iAdapter->SetLongTapDelays( KLongTapStartLongDelay, + KLongTapTimeLongDelay ); detector->PointerEventL( event ); } } @@ -3995,6 +3970,7 @@ if ( event.iType == TPointerEvent::EButton1Down ) { iLongtap = EFalse; + node->HideTooltipsL(); if ( !menuBar ) { @@ -4003,6 +3979,8 @@ if ( !menuBar && !engine->FocusedNode() ) { + // save starting point + iButtonDownStartPoint = event.iPosition; // Require focus to be shown engine->AppUiAdapter().ShowFocus(); @@ -4017,20 +3995,19 @@ node->SetStateL( XnPropertyNames::style::common::KFocus, XnEventSource::EStylus ); - node->SetStateL( - XnPropertyNames::style::common::KPressedDown ); } } else if ( event.iType == TPointerEvent::EDrag ) { if ( node->IsStateSet( XnPropertyNames::style::common::KFocus ) ) { - if ( !node->MarginRect().Contains( event.iPosition ) ) + if ( IsDragThresholdExceeded( event.iPosition ) || + !node->MarginRect().Contains( event.iPosition ) ) { - // Remove pressed down - node->UnsetStateL( XnPropertyNames::style::common::KPressedDown ); - node->HideTooltipsL(); - } + // Remove focus + node->UnsetStateL( + XnPropertyNames::style::common::KFocus ); + } } } else if ( event.iType == TPointerEvent::EButton1Up ) @@ -4042,15 +4019,16 @@ node->SetStateL( XnPropertyNames::style::common::KActive ); } else if ( ( node->MarginRect().Contains( event.iPosition ) && - node->IsStateSet( XnPropertyNames::style::common::KFocus ) && - node->IsStateSet( XnPropertyNames::style::common::KPressedDown ) ) ) + node->IsStateSet( XnPropertyNames::style::common::KFocus ) ) ) { #ifdef RD_TACTILE_FEEDBACK MTouchFeedback* feedback( MTouchFeedback::Instance() ); if ( feedback ) { - feedback->InstantFeedback( ETouchFeedbackBasic ); + feedback->InstantFeedback( iAdapter, ETouchFeedbackBasic, + ETouchFeedbackVibra, + aPointerEvent ); } #endif node->SetStateL( XnPropertyNames::style::common::KActive ); @@ -4082,6 +4060,12 @@ DrawFocusAppearance( node, aGc ); } + // Draw plus sign for empty plugins in edit mode. + if( node.UiEngine()->EditMode()->EditState() ) + { + const_cast< CXnControlAdapterImpl* >( this )->DrawPlusSign( node, aGc ); + } + if ( iAnimation ) { TRect rect = iComponent->Node()->Rect(); @@ -4109,11 +4093,7 @@ CXnNode& aNode, CWindowGc& aGc ) { - // For widgets and plugins, drawing is handled differently in edit mode - const TDesC8& widgetType = aNode.DomNode()->Name(); - if( ( widgetType == XnPropertyNames::KWidget || - widgetType == XnPropertyNames::KPlugin ) && - aNode.UiEngine()->EditMode()->EditState() ) + if( aNode.UiEngine()->EditMode()->EditState() ) { DrawEditModeBgData( aNode, aGc ); return; @@ -4170,13 +4150,26 @@ { TRect rect = aNode.PaddingRect(); DrawBackgroundSkin( KAknsIIDQgnHomeEditBgWidget, aGc, rect ); - - CXnPluginData& data( aNode.UiEngine()->ViewManager()->ActiveViewData().Plugin( &aNode ) ); - if( !data.Occupied() ) // Empty widget + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::DrawPlusSign +// +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::DrawPlusSign( CXnNode& aNode, CWindowGc& aGc ) + { + const TDesC8& widgetType = aNode.DomNode()->Name(); + if( widgetType == XnPropertyNames::KPlugin ) + { + CXnPluginData* data( aNode.UiEngine()->ViewManager()->ActiveViewData().Plugin( &aNode ) ); + if( data && !data->Occupied() ) // Empty widget { // Draw + -icon // Make rect as 50% of the widget's height. // It needs to be square in order to keep aspect ratio. + TRect rect = aNode.PaddingRect(); TInt w = rect.Width(); TInt h = rect.Height(); rect.Shrink( ( w - h * 0.5 ) * 0.5, h * 0.25 ); @@ -4281,7 +4274,6 @@ aRect = aNode.PaddingRect(); } - //CXnProperty* colorProperty( aNode.BackgroundColorL() ); CXnProperty* colorProperty( aBgColor ); if ( colorProperty ) { @@ -5475,7 +5467,8 @@ if ( CreateGestureHelperL( aNode.Node() ) ) { - iGestureHelper = CXnGestureHelper::NewL( aNode.Node() ); + iGestureFw = CAknTouchGestureFw::NewL( *this, aAdapter ); + iGestureFw->SetGestureInterestL( EAknTouchGestureFwGroupFlick ); } } @@ -5815,104 +5808,58 @@ } // ----------------------------------------------------------------------------- -// PassEventToGestureHelperL -// Forwards event to gesturehelper +// InitializeGestureL +// Sets up gesture // ----------------------------------------------------------------------------- // -TBool CXnControlAdapterImpl::PassEventToGestureHelperL( +void CXnControlAdapterImpl::InitializeGestureL( const TPointerEvent& aPointerEvent ) { - TBool ret( EFalse ); + if ( !iGestureFw || aPointerEvent.iType != TPointerEvent::EButton1Down ) + { + return; + } + + CXnUiEngine* engine( iNode.Node().UiEngine() ); + // Set default destination + iGestureDestination = &iNode.Node(); + + RPointerArray< CXnPluginData >& plugins( + engine->ViewManager()->ActiveViewData().PluginData() ); - CXnNode* node( &iNode.Node() ); - CXnUiEngine* engine( node->UiEngine() ); - - if ( iGestureHelper && iGestureHelper->Owner() == node ) - { - if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) - { - // Set default destination - iGestureHelper->SetDestination( iGestureHelper->Owner() ); + for ( TInt i = 0; i < plugins.Count(); i++ ) + { + CXnPluginData* plugin( plugins[i] ); + + if ( plugin->Occupied() ) + { + CXnNode* widget( plugin->Node()->LayoutNode() ); - RPointerArray< CXnPluginData >& plugins( - engine->ViewManager()->ActiveViewData().PluginData() ); - - for ( TInt i = 0; i < plugins.Count(); i++ ) + if ( widget->MarginRect().Contains( aPointerEvent.iPosition ) ) { - CXnPluginData* plugin( plugins[i] ); - - if ( plugin->Occupied() ) + // Resolve swipe destination + CXnProperty* prop( widget->GetPropertyL( + XnPropertyNames::common::KSwipeDestination ) ); + + if ( prop ) { - CXnNode* widget( plugin->Node()->LayoutNode() ); - - if ( widget->MarginRect().Contains( aPointerEvent.iPosition ) ) - { - // Resolve swipe destination - CXnProperty* prop( widget->GetPropertyL( - XnPropertyNames::common::KSwipeDestination ) ); + const TDesC8& value( prop->StringValue() ); - if ( prop ) - { - const TDesC8& value( prop->StringValue() ); - - if( value == XnPropertyNames::KWidget ) - { - // Set widget as destination - iGestureHelper->SetDestination( widget ); - } - else if( value == XnPropertyNames::KNone ) - { - // Set no destination - iGestureHelper->SetDestination( NULL ); - } - } - - break; + if( value == XnPropertyNames::KWidget ) + { + // Set widget as destination + iGestureDestination = widget; + } + else if( value == XnPropertyNames::KNone ) + { + // Set no destination + iGestureDestination = NULL; } } + break; } } - - TSwipeResult result( iGestureHelper->HandlePointerEventL( aPointerEvent ) ); - - const TDesC8* swipe( NULL ); - - if ( result == ESwipeLeft ) - { - swipe = &XnPropertyNames::action::trigger::name::swipe::direction::KLeft; - } - else if ( result == ESwipeRight ) - { - swipe = &XnPropertyNames::action::trigger::name::swipe::direction::KRight; - } - - if ( swipe ) - { - CXnNode* destination( iGestureHelper->Destination() ); - - if ( destination ) - { - if ( destination == iGestureHelper->Owner() ) - { - CancelFocusRefusalL( *engine ); - } - - // Remove focus - engine->AppUiAdapter().HideFocus(); - - CXnNode* trigger( BuildSwipeTriggerNodeLC( *engine, *swipe ) ); - destination->ReportXuikonEventL( *trigger ); - CleanupStack::PopAndDestroy( trigger ); - - // If needed we can call here for example HandleSwipeL() - - // Consume this event - ret = ETrue; - } - } - } - - return ret; + } } // ----------------------------------------------------------------------------- @@ -5939,6 +5886,52 @@ return iAdapter->ControlEnv()->FsSession(); } +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::HandleTouchGestureL( MAknTouchGestureFwEvent& aEvent ) + { + if ( aEvent.Group() == EAknTouchGestureFwGroupFlick ) + { + TAknTouchGestureFwType type = aEvent.Type(); + + const TDesC8* swipe( NULL ); + + if ( type == EAknTouchGestureFwFlickLeft ) + { + swipe = &XnPropertyNames::action::trigger::name::swipe::direction::KLeft; + } + else if ( type == EAknTouchGestureFwFlickRight ) + { + swipe = &XnPropertyNames::action::trigger::name::swipe::direction::KRight; + } + + if ( swipe && iGestureDestination ) + { + CXnUiEngine* engine = iNode.Node().UiEngine(); + if ( iGestureDestination == &iNode.Node() ) + { + CancelFocusRefusalL( *engine ); + } + + // Remove focus + engine->AppUiAdapter().HideFocus(); + + CXnNode* trigger( BuildSwipeTriggerNodeLC( *engine, *swipe ) ); + iGestureDestination->ReportXuikonEventL( *trigger ); + CleanupStack::PopAndDestroy( trigger ); + + CXnAppUiAdapter& appui( engine->AppUiAdapter() ); + CXnViewData& data( appui.ViewManager().ActiveViewData() ); + + CXnViewControlAdapter* control = + static_cast< CXnViewControlAdapter* >( data.ViewNode()->Control() ); + + control->ResetGrabbing(); + } + } + } + // ============================= TIconProvider =============================== diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xneditmode.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xneditmode.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xneditmode.cpp Wed May 12 13:22:51 2010 +0300 @@ -18,9 +18,7 @@ // System includes #include #include -#include #include -#include #ifdef RD_TACTILE_FEEDBACK #include @@ -38,10 +36,12 @@ #include "xnuiengine.h" #include "xncontroladapter.h" #include "xnpopupcontroladapter.h" +#include "xnviewcontroladapter.h" #include "xnfocuscontrol.h" #include "xneditor.h" #include "xntype.h" #include "xnmenu.h" +#include "xnbackgroundmanager.h" #include "xneditmode.h" @@ -335,37 +335,55 @@ // ----------------------------------------------------------------------------- // void CXnEditMode::MakeVisible( TBool aVisible ) - { + { + CXnAppUiAdapter& appui( iUiEngine.AppUiAdapter() ); + CXnViewControlAdapter* control = + static_cast< CXnViewControlAdapter* >( + appui.ViewManager().ActiveViewData().ViewNode()->Control() ); + RWindow& window( Window() ); + TBool visible( IsVisible() ? ETrue : EFalse ); - if ( aVisible == visible ) { - return; + if( aVisible ) + { + // If a new Homescreen page has been added in Edit mode, bring the control back to the front + control->DrawableWindow()->SetPointerGrab( EFalse ); + + window.SetOrdinalPosition( 0 ); + window.SetPointerGrab( ETrue ); + window.ClaimPointerGrab(); + } + + return; } CCoeControl::MakeVisible( aVisible ); - - CXnAppUiAdapter& appui( iUiEngine.AppUiAdapter() ); // Remove focus appui.HideFocus(); - - CCoeControl& bg( appui.ViewAdapter().BgControl() ); - + if ( aVisible ) { - bg.DrawableWindow()->SetPointerGrab( EFalse ); + control->DrawableWindow()->SetPointerGrab( EFalse ); - Window().SetOrdinalPosition( 0 ); - Window().SetPointerGrab( ETrue ); - Window().ClaimPointerGrab(); + window.SetOrdinalPosition( 0 ); + window.SetPointerGrab( ETrue ); + window.ClaimPointerGrab(); + + TRAP_IGNORE( appui.HandleEnterEditModeL( ETrue ) ); } else { - Window().SetPointerGrab( EFalse ); + window.SetPointerGrab( EFalse ); + + control->DrawableWindow()->SetPointerGrab( ETrue ); - bg.DrawableWindow()->SetPointerGrab( ETrue ); + TRAP_IGNORE( appui.HandleEnterEditModeL( EFalse ) ); } + + // Update background + appui.ViewAdapter().BgManager().UpdateScreen(); } // ----------------------------------------------------------------------------- @@ -483,10 +501,10 @@ if ( node ) { - CXnPluginData& plugin( iUiEngine.ViewManager()-> + CXnPluginData* plugin( iUiEngine.ViewManager()-> ActiveViewData().Plugin( node ) ); - if ( plugin.Occupied() ) + if ( plugin && plugin->Occupied() ) { StartDragL( *node ); @@ -542,7 +560,10 @@ else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) { #ifdef RD_TACTILE_FEEDBACK - Feedback( ETouchFeedbackBasic ); + MTouchFeedback* feedback( MTouchFeedback::Instance() ); + feedback->InstantFeedback( this,ETouchFeedbackBasic, + ETouchFeedbackVibra, + aPointerEvent ); #endif // Cancel if ( !iTargetNode || !iDraggingNode || @@ -563,10 +584,10 @@ if ( node && !iDragged ) { - CXnPluginData& plugin( iUiEngine.ViewManager()-> + CXnPluginData* plugin( iUiEngine.ViewManager()-> ActiveViewData().Plugin( node ) ); - if ( plugin.Occupied() ) + if ( plugin && plugin->Occupied() ) { CXnNode* popup( iUiEngine.StylusPopupNode() ); @@ -635,12 +656,12 @@ CXnNode* focused( iUiEngine.FocusedNode() ); if ( focused && ( aKeyEvent.iScanCode == EStdKeyDevice3 || - aKeyEvent.iScanCode == EStdKeyEnter ) ) + aKeyEvent.iCode == EKeyEnter ) ) { - CXnPluginData& plugin( iUiEngine.ViewManager()-> + CXnPluginData* plugin( iUiEngine.ViewManager()-> ActiveViewData().Plugin( focused ) ); - if ( plugin.Occupied() ) + if ( plugin && plugin->Occupied() ) { // Open context menu CXnNode* menubar( iUiEngine.MenuBarNode() ); @@ -659,7 +680,7 @@ if ( menuIf ) { - menuIf->TryDisplayingMenuBarL( *id ); + menuIf->TryDisplayingMenuBarL( *id, ETrue ); iUiEngine.Editor()->SetTargetPlugin( focused ); } } @@ -706,7 +727,7 @@ void CXnEditMode::StartDragL( CXnNode& aNode ) { CXnControlAdapter* control( aNode.Control() ); - + TRect rect( control->Rect() ); // Clear first with alpha @@ -725,11 +746,25 @@ CWindowGc* gc( control->CustomGc() ); control->SetCustomGc( iMapGc ); + + TBool focusStateChanged( EFalse ); + if( aNode.IsStateSet( XnPropertyNames::style::common::KFocus ) ) + { + aNode.UnsetStateL( XnPropertyNames::style::common::KFocus ); + focusStateChanged = ETrue; + } + control->DrawNow( rect ); - + control->SetCustomGc( gc ); - + + if( focusStateChanged ) + { + aNode.SetStateL( XnPropertyNames::style::common::KFocus ); + iUiEngine.RenderUIL( &aNode ); + } + if ( iWidget->SizeInPixels() != rect.Size() ) { iWidget->Resize( rect.Size() ); @@ -797,10 +832,7 @@ if ( aState == CXnEditMode::EDragAndDrop ) { iState = aState; - - iUiEngine.AppUiAdapter().HandleEnterEditModeL( ETrue ); - SetStatusPaneTitleL(); - + MakeVisible( ETrue ); } @@ -809,11 +841,11 @@ { iDraggingNode = NULL; iTargetNode = NULL; + + iUiEngine.Editor()->SetTargetPlugin( NULL ); iState = aState; - - iUiEngine.AppUiAdapter().HandleEnterEditModeL( EFalse ); - + MakeVisible( EFalse ); } } @@ -829,27 +861,6 @@ } // ----------------------------------------------------------------------------- -// CXnEditMode::SetStatusPaneTitleL() -// ----------------------------------------------------------------------------- -// -void CXnEditMode::SetStatusPaneTitleL() - { - TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle ); - CEikStatusPaneBase::TPaneCapabilities subPaneTitle = - iUiEngine.AppUiAdapter().StatusPane()->PaneCapabilities( titlePaneUid ); - if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() ) - { - CAknTitlePane* title = static_cast< CAknTitlePane* >( - iUiEngine.AppUiAdapter().StatusPane()->ControlL( titlePaneUid ) ); - TResourceReader reader; - CEikonEnv::Static()->CreateResourceReaderLC( - reader, R_QTN_HS_TITLE_EDITMODE ); - title->SetFromResourceL( reader ); - CleanupStack::PopAndDestroy(); // reader internal state - } - } - -// ----------------------------------------------------------------------------- // CXnEditMode::StopDraggingL() // ----------------------------------------------------------------------------- // diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp Wed May 12 13:22:51 2010 +0300 @@ -61,6 +61,8 @@ #include "xneditor.h" #include "xnpanic.h" +#include "xnoomsyshandler.h" + using namespace hspswrapper; using namespace cpswrapper; @@ -68,13 +70,7 @@ _LIT8( KEventPluginUnInstalled, "PluginUninstalled" ); _LIT8( KEventRootConfActivated, "AppConfActivated" ); _LIT8( KEventPluginUpdated, "PluginUpdated" ); -_LIT8( KEventPluginActivated, "PluginActivated" ); _LIT8( KEventPluginInstalled, "PluginInstalled" ); -_LIT8( KEventPluginAdded, "PluginAdded" ); -_LIT8( KEventPluginRemoved, "PluginRemoved" ); -_LIT8( KEventPluginReplaced, "PluginReplaced" ); - -_LIT8( KAi3Uid, "0x102750f0" ); _LIT8( KEmptyWidgetUid, "0x2001F47F" ); _LIT8( KDownload, "Editor/DownloadCaption" ); @@ -99,7 +95,7 @@ // ====================== LOCAL FUNTION PROTOTYPES ============================ static void DeletePluginInfos( TAny* aObject ); static void DeleteItemMaps( TAny* aObject ); -static void DeleteWidgetInfo( TAny* aObject ); +static void DeleteContentInfo( TAny* aObject ); static TPtrC ParseWidgetName( const CHsContentInfo& aContentInfo ); static void SetPropertyL( CXnNode& aNode, const TDesC8& aAttribute, @@ -136,13 +132,13 @@ } // --------------------------------------------------------------------------- -// DeleteWidgetInfo +// DeleteContentInfo // --------------------------------------------------------------------------- // -static void DeleteWidgetInfo( TAny* aObject ) +static void DeleteContentInfo( TAny* aObject ) { - reinterpret_cast< - RPointerArray< CHsContentInfo >* >( aObject )->ResetAndDestroy(); + reinterpret_cast* >( + aObject )->ResetAndDestroy(); } // --------------------------------------------------------------------------- @@ -219,11 +215,11 @@ if ( aPredicate ) { - CXnPluginData& plugin( viewData.Plugin( aPredicate ) ); + CXnPluginData* plugin( viewData.Plugin( aPredicate ) ); - if ( !plugin.Occupied() ) + if ( plugin && !plugin->Occupied() ) { - return &plugin; + return plugin; } } @@ -233,11 +229,11 @@ { CXnNode* node( nodes[i] ); - CXnPluginData& plugin( viewData.Plugin( node ) ); + CXnPluginData* plugin( viewData.Plugin( node ) ); - if ( !plugin.Occupied() ) + if ( plugin && !plugin->Occupied() ) { - return &plugin; + return plugin; } } @@ -312,6 +308,7 @@ iCpsWrapper = CCpsWrapper::NewL( *this ); iHspsWrapper = CHspsWrapper::NewL( aUid, this ); iRepository= CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); + iOomSysHandler = CXnOomSysHandler::NewL(); } // --------------------------------------------------------------------------- @@ -321,11 +318,15 @@ CXnEditor::~CXnEditor() { iViewManager.RemoveObserver( *this ); - + if( iPluginsCache.Count() ) + { + iPluginsCache.ResetAndDestroy(); + } delete iCpsWrapper; delete iHspsWrapper; delete iPublisherMap; delete iRepository; + delete iOomSysHandler; } // ----------------------------------------------------------------------------- @@ -334,28 +335,14 @@ // TBool CXnEditor::IsCurrentViewFull() { - TBool viewFull = ETrue; - - RPointerArray< CXnPluginData >& plugins( - iViewManager.ActiveViewData().PluginData() ); - - for ( TInt i = 0; i < plugins.Count(); i++ ) - { - if ( !plugins[i]->Occupied() ) - { - viewFull = EFalse; - break; - } - } - - return viewFull; + return IsViewFull( iViewManager.ActiveViewData() ); } // ----------------------------------------------------------------------------- -// CXnEditor::FilterWidgetListL +// CXnEditor::FilterPluginsL // ----------------------------------------------------------------------------- // -void CXnEditor::FilterWidgetListL( CHsContentInfoArray& aContentInfoArray, +void CXnEditor::FilterPluginsL( CHsContentInfoArray& aContentInfoArray, TBool aIgnoreViewFull ) { RPointerArray< CHsContentInfo >& list( aContentInfoArray.Array() ); @@ -429,14 +416,6 @@ if ( plugin->PublisherName() == aInfo.PublisherId() ) { - if ( plugin->Removable() ) - { - // To enable widget remove - aInfo.SetPluginIdL( plugin->PluginId() ); - - retval |= ECanBeRemoved; - } - widgetCount++; } } @@ -478,14 +457,6 @@ if ( plugin->PluginUid().CompareF( aInfo.Uid() ) == 0 ) { - if ( plugin->Removable() ) - { - // To enable widget remove - aInfo.SetPluginIdL( plugin->PluginId() ); - - retval |= ECanBeRemoved; - } - widgetCount++; } } @@ -508,40 +479,17 @@ { RPointerArray< CHsContentInfo >& list( aContentInfoArray.Array() ); - RPointerArray< CXnPluginData >& views( - iViewManager.ActiveAppData().PluginData() ); - - TInt viewAmount( iViewManager.ViewAmount() ); - - const TInt KMaxViewAmount( 6 ); + TBool canBeAdded( EFalse ); + CXnRootData& appData( iViewManager.ActiveAppData() ); + if ( appData.PluginData().Count() < appData.MaxPages() ) + { + canBeAdded = ETrue; + } for ( TInt i = 0; i < list.Count(); i++ ) { - CHsContentInfo* info( list[i] ); - - info->SetCanBeAdded( EFalse ); - info->SetCanBeRemoved( EFalse ); - - for ( TInt j = 0 ; j < views.Count(); j++ ) - { - CXnPluginData* view( views[j] ); - - if ( view->PluginUid().CompareF( info->Uid() ) == 0 ) - { - // To enable view remove - info->SetPluginIdL( view->PluginId() ); - // Last view cannot be removed - if ( views.Count() > 1 ) - { - info->SetCanBeRemoved( ETrue ); - } - } - } - - if ( viewAmount < KMaxViewAmount ) - { - info->SetCanBeAdded( ETrue ); - } + CHsContentInfo* info( list[i] ); + info->SetCanBeAdded( canBeAdded ); } } @@ -594,7 +542,7 @@ // CXnEditor::ReplaceWidgetL // --------------------------------------------------------------------------- // -void CXnEditor::ReplaceWidgetL( CHsContentInfo& aContentInfo, TBool aUseHsps ) +void CXnEditor::ReplaceWidgetL( CHsContentInfo& aContentInfo ) { RPointerArray< CXnPluginData > plugins; CleanupClosePushL( plugins ); @@ -609,6 +557,15 @@ if( plugin->PluginId() == aContentInfo.PluginId() ) { + if ( aContentInfo.Type() == KNullDesC8 ) + { + aContentInfo.SetTypeL( plugin->Type() ); + } + + if ( aContentInfo.PublisherId() == KNullDesC ) + { + aContentInfo.SetPublisherIdL( plugin->PublisherName() ); + } match = plugin; break; } @@ -616,7 +573,7 @@ if( match ) { - iViewManager.ReplaceWidgetToPluginL( aContentInfo, *match, aUseHsps ); + iViewManager.ReplaceWidgetToPluginL( aContentInfo, *match ); } CleanupStack::PopAndDestroy( &plugins ); @@ -631,11 +588,18 @@ return iRepository->Get( KAICCPluginUIDKey, aUid ); } +// --------------------------------------------------------------------------- // CXnEditor::AddWidgetL // --------------------------------------------------------------------------- // void CXnEditor::AddWidgetL() { + if ( !CXnOomSysHandler::HeapAvailable( VIEW_MIN_MEM ) ) + { + OomSysHandler().HandlePotentialOomL(); + return; + } + TBuf8 oPaqDataStr; MHsContentControlUi* ui( NULL ); @@ -668,13 +632,15 @@ CleanupStack::PushL( info ); RPointerArray< CHsContentInfo >& widgets( info->Array() ); - - // get installed widgets from HSPS (type: "widget") - HSPSPluginsL( widgets, KKeyWidget ); - // get installed widgets from HSPS - TemplatedWidgetsL( widgets ); - FilterWidgetListL( *info, ETrue ); + // get installed widgets and template configurations from HSPS + HspsWidgetPluginsL( widgets ); + + // get installed widgets from HSPS (type: "template") + CpsWidgetPluginsL( widgets ); + + // check whether the plugins can be added or removed + FilterPluginsL( *info, ETrue ); CDesCArrayFlat* array = new ( ELeave ) CDesCArrayFlat( 8 ); CleanupStack::PushL( array ); @@ -814,11 +780,11 @@ return; } - CXnPluginData& plugin( iViewManager.ActiveViewData().Plugin( aNode ) ); + CXnPluginData* plugin( iViewManager.ActiveViewData().Plugin( aNode ) ); - if( plugin.Removable() ) + if( plugin && plugin->Removable() ) { - TRAPD( err, err = iViewManager.UnloadWidgetFromPluginL( plugin ) ); + TRAPD( err, err = iViewManager.UnloadWidgetFromPluginL( *plugin ) ); if ( err != KErrNone ) { @@ -850,15 +816,17 @@ for ( TInt i = 0; i < aPluginArray->Count(); i++ ) { - CXnPluginData& plugin( viewData.Plugin( ( *aPluginArray )[i] ) ); - - const TDesC8& id( plugin.PluginId() ); - - if ( id != KNullDesC8 ) + CXnPluginData* plugin( viewData.Plugin( ( *aPluginArray )[i] ) ); + if ( plugin ) { - ids->AppendL( id ); - } - } + const TDesC8& id( plugin->PluginId() ); + + if ( id != KNullDesC8 ) + { + ids->AppendL( id ); + } + } + } iHspsWrapper->MovePluginsL( configurationId, *ids ); @@ -878,19 +846,18 @@ RPointerArray< CPublisherInfo >& publisherInfo( iPublisherMap->PublisherInfo() ); - - const TDesC& widgetName( aContentInfo.Name() ); + const TDesC& publisherId( aContentInfo.PublisherId() ); CPublisherInfo* info = NULL; for ( TInt i = 0; i < publisherInfo.Count(); i++ ) { - info = publisherInfo[i]; + CPublisherInfo* temp = publisherInfo[i]; - if ( info->WidgetName() == widgetName && - info->PublisherId() == publisherId ) + if ( temp->PublisherId() == publisherId ) { + info = temp; break; } } @@ -899,106 +866,59 @@ } // --------------------------------------------------------------------------- -// CXnEditor::TemplatedWidgetsL +// CXnEditor::CpsWidgetPluginsL // --------------------------------------------------------------------------- // -void CXnEditor::TemplatedWidgetsL( RPointerArray< CHsContentInfo >& aWidgets ) +void CXnEditor::CpsWidgetPluginsL( RPointerArray< CHsContentInfo >& aWidgets ) { - RPointerArray< CHsContentInfo > widgetTemplates; - CleanupStack::PushL( TCleanupItem( DeleteWidgetInfo, &widgetTemplates ) ); - - // Gets all the installed templates from CPS - HSPSPluginsL( widgetTemplates, KKeyTemplate ); - - delete iPublisherMap; - iPublisherMap = NULL; - - iPublisherMap = iCpsWrapper->GetTemplatedPublishersL(); - - RPointerArray< CPublisherInfo >& publisherInfo( - iPublisherMap->PublisherInfo() ); - + // Get publishers from CPS + + if( !iPublisherMap ) + { + iPublisherMap = iCpsWrapper->GetTemplatedPublishersL(); + } + + RPointerArray< CPublisherInfo >& publisherInfo( iPublisherMap->PublisherInfo() ); + + // Find templates for the published data for ( TInt i = 0; i < publisherInfo.Count(); i++ ) { CPublisherInfo* info( publisherInfo[i] ); - for ( TInt j = 0; j < widgetTemplates.Count(); j++ ) - { - const TDesC& name( widgetTemplates[j]->Name() ); - - if ( name == info->TemplateType() ) - { - CHsContentInfo* contentInfo = CHsContentInfo::NewLC(); - - contentInfo->SetNameL( info->WidgetName() ); - contentInfo->SetPublisherIdL( info->PublisherId() ); - contentInfo->SetMaxWidgets( info->MaxWidgets() ); - contentInfo->SetUidL( widgetTemplates[j]->Uid() ); - contentInfo->SetTypeL( widgetTemplates[j]->Type() ); - contentInfo->SetDescriptionL( info->Description() ); - contentInfo->SetIconPathL( info->LogoIcon() ); - - contentInfo->SetIsWrt( - ( info->ContentType() == KWRTTemplate() ) ); - - aWidgets.AppendL( contentInfo ); - CleanupStack::Pop( contentInfo ); - - break; + for ( TInt j = 0; j < iPluginsCache.Count(); j++ ) + { + if( iPluginsCache[j]->Name().Length() > 0 ) + { + // 8 to 16bit conv + HBufC* nameBuf = HBufC::NewLC( iPluginsCache[j]->Name().Length() ); + nameBuf->Des().Copy( iPluginsCache[j]->Name() ); + TBool matchingNames = ( nameBuf->Des() == info->TemplateType() ); + CleanupStack::PopAndDestroy(); + if ( matchingNames ) + { + + // Add published widget + CHsContentInfo* contentInfo = CHsContentInfo::NewLC(); + + contentInfo->SetNameL( info->WidgetName() ); + contentInfo->SetPublisherIdL( info->PublisherId() ); + contentInfo->SetMaxWidgets( info->MaxWidgets() ); + contentInfo->SetUidL( iPluginsCache[j]->Uid() ); + contentInfo->SetTypeL( iPluginsCache[j]->Type() ); + contentInfo->SetDescriptionL( info->Description() ); + contentInfo->SetIconPathL( info->LogoIcon() ); + contentInfo->SetIsWrt( info->ContentType() == KWRTTemplate() ); + + aWidgets.AppendL( contentInfo ); + + CleanupStack::Pop( contentInfo ); + break; + } } } - } - - CleanupStack::PopAndDestroy(); // cleanupitem + } } -// --------------------------------------------------------------------------- -// CXnEditor::HSPSPluginsL -// --------------------------------------------------------------------------- -// -void CXnEditor::HSPSPluginsL( RPointerArray< CHsContentInfo >& aWidgets, - const TDesC8& aType ) - { - RPointerArray< hspswrapper::CPluginInfo > plugins; - CleanupStack::PushL( TCleanupItem( DeletePluginInfos, &plugins ) ); - - if ( aType == KApplication ) - { - iHspsWrapper->GetAppConfigurationsL( plugins ); - } - else - { - iHspsWrapper->GetPluginsL( plugins, KPluginInterface, aType ); - } - - for ( TInt i = 0; i < plugins.Count(); i++ ) - { - if ( plugins[i]->Uid().CompareF( KEmptyWidgetUid ) == 0 ) - { - // Skip empty - continue; - } - - CHsContentInfo* contentInfo = CHsContentInfo::NewLC(); - - contentInfo->SetNameL( plugins[i]->Name() ); - contentInfo->SetUidL( plugins[i]->Uid() ); - contentInfo->SetTypeL( aType ); - - if ( aType == KKeyWidget || aType == KKeyTemplate ) - { - contentInfo->SetMaxWidgets( plugins[i]->MultiInstance() ); - } - - contentInfo->SetDescriptionL( plugins[i]->Description() ); - contentInfo->SetIconPathL( plugins[i]->LogoIcon() ); - - aWidgets.AppendL( contentInfo ); - CleanupStack::Pop( contentInfo ); - } - - CleanupStack::PopAndDestroy( &plugins ); - } // --------------------------------------------------------------------------- // CXnEditor::ToggleWidgetsVisibiltyL @@ -1078,10 +998,14 @@ // void CXnEditor::SetTargetPlugin( CXnNode* aNode ) { - iTargetPlugin = aNode; + TBool editState( iViewManager.UiEngine().EditMode()->EditState() ); + + if ( editState ) + { + iTargetPlugin = aNode; + } } -// --------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // CXnEditor::NotifyViewActivatedL // ----------------------------------------------------------------------------- @@ -1166,9 +1090,7 @@ HBufC8* publisherId = CnvUtfConverter::ConvertFromUnicodeToUtf8L( info->PublisherId() ); CleanupStack::PushL( publisherId ); - - aPluginData.SetPublisherNameL( info->PublisherId() ); - + CItemMap* itemMap( 0 ); CPropertyMap* property( 0 ); CPropertyMap* propertyIn( 0 ); @@ -1406,6 +1328,7 @@ // void CXnEditor::NotifyWidgetUnregisteredL( const TDesC& aPublisher ) { + ResetCache(); RemoveUnRegisteredWidgetL( aPublisher ); WidgetListChanged(); } @@ -1416,6 +1339,7 @@ // void CXnEditor::NotifyWidgetRegisteredL() { + ResetCache(); WidgetListChanged(); } @@ -1425,6 +1349,7 @@ // void CXnEditor::NotifyViewDeactivatedL( const CXnViewData& /*aViewData*/) { + iTargetPlugin = NULL; } // --------------------------------------------------------------------------- @@ -1472,31 +1397,14 @@ const TDesC8& aEvent, const TDesC8& /*aAppConfUid*/, const TDesC8& aPluginName, - const TDesC8& aOrigUid, + const TDesC8& /*aOrigUid*/, const TDesC8& aPluginUid, const TDesC8& aPluginId ) { - // Someone else has modified the configuration. Handle UI side here. - if( aEvent == KEventPluginAdded || - aEvent == KEventPluginRemoved || - aEvent == KEventPluginReplaced ) + if ( aEvent == KEventPluginUnInstalled ) { - if( aOrigUid != KNullDesC8 && - aOrigUid != KAi3Uid ) - { - CHsContentInfo* info = CHsContentInfo::NewLC(); - - info->SetNameL( aPluginName ); - info->SetUidL( aPluginUid ); - info->SetPluginIdL( aPluginId ); - - ReplaceWidgetL( *info, EFalse ); - - CleanupStack::PopAndDestroy( info ); - } - } - else if ( aEvent == KEventPluginUnInstalled ) - { + ResetCache(); + CHsContentInfo* info = CHsContentInfo::NewLC(); info->SetNameL( aPluginName ); @@ -1514,10 +1422,14 @@ } else if ( aEvent == KEventPluginInstalled ) { + ResetCache(); + WidgetListChanged(); } else if ( aEvent == KEventPluginUpdated ) { + ResetCache(); + // If the plugin is in use then reload the widget if ( aPluginId.Length() > 0 ) { @@ -1529,9 +1441,6 @@ CleanupStack::PopAndDestroy( info ); } WidgetListChanged(); - } - else if ( aEvent == KEventPluginActivated ) - { } return KErrNone; @@ -1595,19 +1504,137 @@ } // ----------------------------------------------------------------------------- +// CXnEditor::AppendPluginsL +// ----------------------------------------------------------------------------- +// +void CXnEditor::AppendPluginsL( + RPointerArray< hspswrapper::CPluginInfo > aPlugins, + RPointerArray< CHsContentInfo >& aWidgets ) + { + // Append plugins to the content info array + for ( TInt i = 0; i < aPlugins.Count(); i++ ) + { + + // Block the empty and template plugins from the list + if ( aPlugins[i]->Uid().CompareF( KEmptyWidgetUid ) == 0 + || aPlugins[i]->Type() == KKeyTemplate ) + { + continue; + } + + CHsContentInfo* contentInfo = CHsContentInfo::NewLC(); + contentInfo->SetNameL( aPlugins[i]->Name() ); + contentInfo->SetUidL( aPlugins[i]->Uid() ); + contentInfo->SetTypeL( aPlugins[i]->Type() ); + if ( aPlugins[i]->Type() == KKeyWidget + || aPlugins[i]->Type() == KKeyTemplate ) + { + contentInfo->SetMaxWidgets( aPlugins[i]->MultiInstance() ); + } + contentInfo->SetDescriptionL( aPlugins[i]->Description() ); + contentInfo->SetIconPathL( aPlugins[i]->LogoIcon() ); + + aWidgets.AppendL( contentInfo ); + CleanupStack::Pop( contentInfo ); + } + } + +// ----------------------------------------------------------------------------- +// CXnEditor::ResetCache +// ----------------------------------------------------------------------------- +// +void CXnEditor::ResetCache() + { + // Force loading of widget/template plugin configurations + iPluginsCache.ResetAndDestroy(); + + // Forece reloading of CPS publishers + delete iPublisherMap; + iPublisherMap = NULL; + } + +// ----------------------------------------------------------------------------- +// CXnEditor::HspsApplicationPluginsL +// ----------------------------------------------------------------------------- +// +void CXnEditor::HspsApplicationPluginsL( RPointerArray< CHsContentInfo >& aWidgets ) + { + RPointerArray< hspswrapper::CPluginInfo > plugins; + CleanupStack::PushL( TCleanupItem( DeletePluginInfos, &plugins ) ); + + iHspsWrapper->GetAppConfigurationsL( plugins ); + + // Append plugins to the content info array + AppendPluginsL( plugins, aWidgets ); + + CleanupStack::PopAndDestroy( &plugins ); + } + +// ----------------------------------------------------------------------------- +// CXnEditor::HspsViewPluginsL +// ----------------------------------------------------------------------------- +// +void CXnEditor::HspsViewPluginsL( RPointerArray< CHsContentInfo >& aWidgets ) + { + RPointerArray< hspswrapper::CPluginInfo > plugins; + CleanupStack::PushL( TCleanupItem( DeletePluginInfos, &plugins ) ); + + iHspsWrapper->GetPluginsL( plugins, KPluginInterface, KView ); + + // Append plugins to the content info array + AppendPluginsL( plugins, aWidgets ); + + CleanupStack::PopAndDestroy( &plugins ); + } + +// ----------------------------------------------------------------------------- +// CXnEditor::HspsWidgetPluginsL +// ----------------------------------------------------------------------------- +// +void CXnEditor::HspsWidgetPluginsL( RPointerArray< CHsContentInfo >& aWidgets ) + { + __ASSERT_DEBUG( aWidgets.Count() == 0, User::Leave( KErrGeneral ) ); + + // If widget/template plugins haven't been fetched yet + if( iPluginsCache.Count() == 0 ) + { + // Fetch the plugins into the runtime cache + TRAPD( err, DoHspsWidgetPluginsL() ); + if( err ) + { + ResetCache(); + User::LeaveIfError( err ); + } + } + + // Append plugins to the content info array + AppendPluginsL( iPluginsCache, aWidgets ); + } + +// ----------------------------------------------------------------------------- +// CXnEditor::DoHspsWidgetPluginsL +// ----------------------------------------------------------------------------- +// +void CXnEditor::DoHspsWidgetPluginsL() + { + iHspsWrapper->GetPluginsL( iPluginsCache, KPluginInterface, KKeyWidget ); + iHspsWrapper->GetPluginsL( iPluginsCache, KPluginInterface, KKeyTemplate ); + } + +// ----------------------------------------------------------------------------- // from MHsContentController // ----------------------------------------------------------------------------- // TInt CXnEditor::WidgetListL( CHsContentInfoArray& aArray ) { - RPointerArray< CHsContentInfo >& array( aArray.Array() ); + // append the list with native widget and template plugins from HSPS + HspsWidgetPluginsL( aArray.Array() ); + + // append the list with published template plugins from CPS + CpsWidgetPluginsL( aArray.Array() ); - // get installed widgets from HSPS (type: "widget") - HSPSPluginsL( array, KKeyWidget ); - // get installed widgets from HSPS - TemplatedWidgetsL( array ); - - FilterWidgetListL( aArray, EFalse ); + // check whether the plugins can be added or removed + FilterPluginsL( aArray, ETrue ); return KErrNone; } @@ -1616,12 +1643,76 @@ // from MHsContentController // ----------------------------------------------------------------------------- // +TInt CXnEditor::WidgetListL( CHsContentInfo& aInfo, CHsContentInfoArray& aArray ) + { + TInt err( KErrNone ); + RPointerArray< CXnPluginData > widgets; + CleanupClosePushL( widgets ); + + if ( aInfo.Type() == KApplication ) + { + if ( aInfo.Uid().CompareF( iViewManager.ActiveAppData().PluginUid() ) == 0 ) + { + // Get widgets included in active application configuration + err = iViewManager.PluginDataL( KNullDesC8(), widgets ); + } + else + { + // Invalid application configuration + err = KErrArgument; + } + } + else if ( aInfo.Type() == KView ) + { + // Get widgets included in a view + err = iViewManager.PluginDataL( aInfo.PluginId(), widgets ); + } + else + { + err = KErrArgument; + } + + if ( !err ) + { + // Get installed widget content infos + RPointerArray< CHsContentInfo > array; + CleanupStack::PushL( TCleanupItem( DeleteContentInfo, &array ) ); + + // get installed widgets and template configurations from HSPS + HspsWidgetPluginsL( array ); + + // get published widgets + CpsWidgetPluginsL( array ); + + // Create content info for each found widget + for ( TInt i = 0; i < widgets.Count(); i++ ) + { + CHsContentInfo* info = CreateContentInfoLC( *widgets[i], array ); + if ( info ) + { + aArray.Array().AppendL( info ); + CleanupStack::Pop( info ); + } + } + CleanupStack::PopAndDestroy(); // array + } + + CleanupStack::PopAndDestroy(); // widgets + + return err; + } + +// ----------------------------------------------------------------------------- +// from MHsContentController +// ----------------------------------------------------------------------------- +// TInt CXnEditor::ViewListL( CHsContentInfoArray& aArray ) { RPointerArray< CHsContentInfo >& array( aArray.Array() ); - // get installed views from HSPS - HSPSPluginsL( array, KView ); + + // get installed view configurations from HSPS + HspsViewPluginsL( array ); FilterViewListL( aArray ); @@ -1632,11 +1723,62 @@ // from MHsContentController // ----------------------------------------------------------------------------- // +TInt CXnEditor::ViewListL( CHsContentInfo& aInfo, CHsContentInfoArray& aArray ) + { + TInt err( KErrNone ); + + if ( aInfo.Type() == KApplication ) + { + if ( aInfo.Uid().CompareF( iViewManager.ActiveAppData().PluginUid() ) == 0 ) + { + // Get list of views in active application configuration + CXnRootData& appData( iViewManager.ActiveAppData() ); + RPointerArray< CXnPluginData >& views( appData.PluginData() ); + + // Get installed view content infos + RPointerArray< CHsContentInfo > array; + CleanupStack::PushL( TCleanupItem( DeleteContentInfo, &array ) ); + HspsViewPluginsL( array ); + + // Create content info for each found view + for ( TInt i = 0; i < views.Count(); i++ ) + { + CHsContentInfo* info = CreateContentInfoLC( *views[i], array ); + if ( info ) + { + CXnViewData* view = static_cast < CXnViewData* >( views[ i ] ); + info->SetIsFull( IsViewFull( *view ) ); + aArray.Array().AppendL( info ); + CleanupStack::Pop( info ); + } + } + CleanupStack::PopAndDestroy(); // array + } + else + { + // Invalid application configuration + err = KErrArgument; + } + } + else + { + // Invalid argument + err = KErrArgument; + } + + return err; + } + +// ----------------------------------------------------------------------------- +// from MHsContentController +// ----------------------------------------------------------------------------- +// TInt CXnEditor::AppListL( CHsContentInfoArray& aArray ) { RPointerArray< CHsContentInfo >& array( aArray.Array() ); - HSPSPluginsL( array, KApplication ); + // get installed application configurations from HSPS + HspsApplicationPluginsL( array ); return KErrNone; } @@ -1658,18 +1800,16 @@ return KErrArgument; } - if ( !aInfo.CanBeAdded() ) + // the widget can not be added. Return proper error code + if ( IsCurrentViewFull() ) { - // the widget can not be added. Return proper error code - if ( IsCurrentViewFull() ) - { - return KHsErrorViewFull; - } - else - { - return KHsErrorMaxInstanceCountExceeded; - } + return KHsErrorViewFull; } + else if ( !aInfo.CanBeAdded() ) + { + return KHsErrorMaxInstanceCountExceeded; + } + CXnPluginData* plugin( NULL ); @@ -1805,36 +1945,59 @@ { TInt err( KErrNone ); + + CXnViewData& viewData( iViewManager.ActiveViewData() ); - // Get active application configuration - CHspsConfiguration* app( iHspsWrapper->GetAppConfigurationL() ); - CleanupStack::PushL( app ); - - // Get list of views included in active application configuration - RPointerArray< CPluginMap >& plugins( app->PluginMaps() ); - CPluginMap* plugin( NULL ); - - // Find active view - for ( TInt i = 0; i < plugins.Count() && !plugin; i++ ) + CHspsConfiguration* view( iHspsWrapper->GetPluginConfigurationL( viewData.PluginId() ) ); + CleanupStack::PushL( view ); + if ( view ) { - if ( plugins[ i ]->ActivationState() ) - { - plugin = plugins[ i ]; - } - } - - if ( plugin ) - { - CHspsConfiguration* view( iHspsWrapper->GetPluginConfigurationL( plugin->PluginId() ) ); - CleanupStack::PushL( view ); - aInfo.SetNameL( view->PluginInfo().Name() ); + aInfo.SetPluginIdL( viewData.PluginId() ); aInfo.SetUidL( view->PluginInfo().Uid() ); aInfo.SetTypeL( view->PluginInfo().Type() ); aInfo.SetDescriptionL( view->PluginInfo().Description() ); aInfo.SetIconPathL( view->PluginInfo().LogoIcon() ); + aInfo.SetIsFull( IsViewFull( viewData ) ); + } + else + { + err = KErrNotFound; + } - CleanupStack::PopAndDestroy( view ); + CleanupStack::PopAndDestroy( view ); + + return err; + } + +// ----------------------------------------------------------------------------- +// from MHsContentController +// ----------------------------------------------------------------------------- +// +TInt CXnEditor::ActiveAppL( CHsContentInfo& aInfo ) + { + + TInt err( KErrNone ); + CHspsConfiguration* app = iHspsWrapper->GetAppConfigurationL(); + CleanupStack::PushL( app ); + + if ( app->PluginInfo().Uid().Length() > 0 ) + { + aInfo.SetNameL( app->PluginInfo().Name() ); + aInfo.SetUidL( app->PluginInfo().Uid() ); + aInfo.SetTypeL( app->PluginInfo().Type() ); + aInfo.SetDescriptionL( app->PluginInfo().Description() ); + aInfo.SetIconPathL( app->PluginInfo().LogoIcon() ); + + CXnRootData& appData( iViewManager.ActiveAppData() ); + if ( appData.PluginData().Count() < appData.MaxPages() ) + { + aInfo.SetIsFull( EFalse ); + } + else + { + aInfo.SetIsFull( ETrue ); + } } else { @@ -1846,31 +2009,66 @@ } // ----------------------------------------------------------------------------- -// from MHsContentController +// CXnEditor::CreateContentInfoLC +// ----------------------------------------------------------------------------- +// +CHsContentInfo* CXnEditor::CreateContentInfoLC( CXnPluginData& aPlugin, + RPointerArray< CHsContentInfo >& aInfos ) + { + CHsContentInfo* contentInfo( NULL ); + if ( aPlugin.Occupied() ) + { + for ( TInt i = 0; i < aInfos.Count() && !contentInfo; i++ ) + { + CHsContentInfo* info = aInfos[i]; + if ( aPlugin.PluginUid().CompareF( info->Uid() ) == 0 && + ( ( aPlugin.PublisherName().Length() == 0 ) || + ( aPlugin.PublisherName().CompareF( info->PublisherId() ) == 0 ) ) ) + { + contentInfo = info->CloneL(); + CleanupStack::PushL( contentInfo ); + contentInfo->SetPluginIdL( aPlugin.PluginId() ); + contentInfo->SetCanBeRemoved( aPlugin.Removable() ); + } + } + } + return contentInfo; + } + +// ----------------------------------------------------------------------------- +// CXnEditor::IsViewFull // ----------------------------------------------------------------------------- // -TInt CXnEditor::ActiveAppL( CHsContentInfo& aInfo ) +TBool CXnEditor::IsViewFull( CXnViewData& aViewData ) { + TBool isFull( ETrue ); - TInt err( KErrNone ); - CHspsConfiguration* app = iHspsWrapper->GetAppConfigurationL(); - CleanupStack::PushL( app ); + RPointerArray< CXnPluginData >& plugins( + aViewData.PluginData() ); - if ( app->PluginInfo().Uid().Length() > 0 ) + for ( TInt i = 0; i < plugins.Count(); i++ ) { - aInfo.SetNameL( app->PluginInfo().Name() ); - aInfo.SetUidL( app->PluginInfo().Uid() ); - aInfo.SetTypeL( app->PluginInfo().Type() ); - aInfo.SetDescriptionL( app->PluginInfo().Description() ); - aInfo.SetIconPathL( app->PluginInfo().LogoIcon() ); - } - else - { - err = KErrNotFound; + CXnPluginData* plugin = plugins[ i ]; + + if ( !plugin->Occupied() ) + { + isFull = EFalse; + break; + } } - CleanupStack::PopAndDestroy( app ); - return err; + return isFull; + } + +// ----------------------------------------------------------------------------- +// CXnBackgroundManager::OOMSysHandler +// ----------------------------------------------------------------------------- +// +CXnOomSysHandler& CXnEditor::OomSysHandler() const + { + __ASSERT_DEBUG( iOomSysHandler , User::Panic( _L("xneditor"), 0 ) ); + + return *iOomSysHandler; } // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xneffectmanager.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xneffectmanager.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xneffectmanager.cpp Wed May 12 13:22:51 2010 +0300 @@ -16,7 +16,13 @@ */ -// INCLUDE FILES +// System includes +#include +#include +#include +#include + +// User includes #include "xneffectmanager.h" #include "xnplugindata.h" #include "xnviewdata.h" @@ -24,23 +30,15 @@ #include "xndomnode.h" #include "xncontroladapter.h" -// SYSTEM INCLUDE FILES -#include -#include -#include // For transition effects -#include // For transition effects - -// CONSTANTS -const TInt KEffectTypeFullscreen = 1; -const TInt KEffectTypeControl = 2; - +// Constants const TInt KWaitForLayout = 1; const TInt KEffectStarted = 2; // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- -// C++ default constructor. +// CXnEffectManager::CXnEffectManager +// // ----------------------------------------------------------------------------- // CXnEffectManager::CXnEffectManager() @@ -48,7 +46,8 @@ } // ----------------------------------------------------------------------------- -// Symbian 2nd phase constructor. +// CXnEffectManager::ConstructL +// // ----------------------------------------------------------------------------- // void CXnEffectManager::ConstructL() @@ -56,12 +55,13 @@ } // ----------------------------------------------------------------------------- -// Two-phased constructor. +// CXnEffectManager::NewL +// // ----------------------------------------------------------------------------- // CXnEffectManager* CXnEffectManager::NewL() { - CXnEffectManager* self = new (ELeave) CXnEffectManager(); + CXnEffectManager* self = new ( ELeave ) CXnEffectManager(); CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); @@ -69,7 +69,8 @@ } // ----------------------------------------------------------------------------- -// Destructor. +// CXnEffectManager::~CXnEffectManager +// // ----------------------------------------------------------------------------- // CXnEffectManager::~CXnEffectManager() @@ -79,53 +80,14 @@ } // ----------------------------------------------------------------------------- -// CXnEffectManager::BeginControlEffectL -// ----------------------------------------------------------------------------- +// CXnEffectManager::BeginFullscreenEffectL // -void CXnEffectManager::BeginControlEffectL( TInt /*aId*/, CXnPluginData& /*aPlugin*/ ) - { - /* - TXnEffect* effect = new (ELeave) TXnEffect; - CleanupStack::PushL( effect ); - effect->iId = aId; - effect->iType = KEffectTypeControl; - effect->iNode = aPlugin.Node()->LayoutNode(); - iEffects.AppendL( effect ); - CleanupStack::Pop( effect ); - - if ( effect->iNode && !effect->iNode->IsLaidOut() ) - { - effect->iState = KWaitForLayout; - } - else - { - DoBeginControlEffect( *effect ); - } - */ - } - -// ----------------------------------------------------------------------------- -// CXnEffectManager::BeginControlEffectL -// ----------------------------------------------------------------------------- -// -void CXnEffectManager::BeginControlEffectL( TInt aId, - RPointerArray& aPlugins ) - { - TInt count = aPlugins.Count(); - for ( TInt i = 0; i < count; i++ ) - { - BeginControlEffectL( aId, *aPlugins[i] ); - } - } - -// ----------------------------------------------------------------------------- -// CXnEffectManager::BeginFullscreenEffectL // ----------------------------------------------------------------------------- // void CXnEffectManager::BeginFullscreenEffectL( TInt aId, CXnViewData& aView ) { // Only one fullscreen effect at time - if ( EffectCount( KEffectTypeFullscreen ) != 0 ) + if ( iEffects.Count() != 0 ) { return; } @@ -133,7 +95,6 @@ TXnEffect* effect = new (ELeave) TXnEffect; CleanupStack::PushL( effect ); effect->iId = aId; - effect->iType = KEffectTypeFullscreen; effect->iNode = aView.ViewNode(); iEffects.AppendL( effect ); CleanupStack::Pop( effect ); @@ -150,23 +111,18 @@ // ----------------------------------------------------------------------------- // CXnEffectManager::UiRendered +// // ----------------------------------------------------------------------------- // void CXnEffectManager::UiRendered() { for ( TInt i = 0; i < iEffects.Count(); ) { - TXnEffect* effect = iEffects[i]; - if ( effect && effect->iState == KEffectStarted ) + TXnEffect* effect( iEffects[i] ); + + if ( effect && effect->iState == KEffectStarted ) { - if ( effect->iType == KEffectTypeFullscreen ) - { - GfxTransEffect::EndFullScreen(); - } - else if ( effect->iType == KEffectTypeControl ) - { - GfxTransEffect::End( effect->iNode->Control() ); - } + GfxTransEffect::EndFullScreen(); RemoveEffect( effect ); } else @@ -178,26 +134,22 @@ // ----------------------------------------------------------------------------- // CXnEffectManager::UiLayouted +// // ----------------------------------------------------------------------------- // void CXnEffectManager::UiLayouted() { for ( TInt i = 0; i < iEffects.Count(); ) { - TBool effectStarted = ETrue; - TXnEffect* effect = iEffects[i]; + TBool effectStarted( ETrue ); + + TXnEffect* effect( iEffects[i] ); + if ( effect && effect->iNode && effect->iState == KWaitForLayout && - effect->iNode->IsLaidOut()) + effect->iNode->IsLaidOut() ) { - if ( effect->iType == KEffectTypeFullscreen ) - { - effectStarted = DoBeginFullscreenEffect( *effect ); - } - else if ( effect->iType == KEffectTypeControl ) - { - effectStarted = DoBeginControlEffect( *effect ); - } + effectStarted = DoBeginFullscreenEffect( *effect ); } if ( effectStarted ) @@ -214,14 +166,16 @@ // ----------------------------------------------------------------------------- // CXnEffectManager::DoBeginFullscreenEffect +// // ----------------------------------------------------------------------------- // TBool CXnEffectManager::DoBeginFullscreenEffect( TXnEffect& aEffect ) { - CCoeEnv* coe( CCoeEnv::Static() ); + CCoeEnv* env( CCoeEnv::Static() ); - if ( coe->WsSession().GetFocusWindowGroup() != - coe->RootWin().Identifier() ) + RWsSession& session( env->WsSession() ); + + if ( session.GetFocusWindowGroup() != env->RootWin().Identifier() ) { // Window group is not focused return EFalse; @@ -229,74 +183,40 @@ const TInt flags( AknTransEffect::TParameter::EActivateExplicitCancel ); const TUid targetAppUid( iAvkonAppUi->Application()->AppDllUid() ); - + + // Must give some time before starting effect, because otherwise + // fullscreen effect may contain unwanted parts (dialog, note, etc.) + // which was shown when fullscreen effect is about to be started + session.Finish(); + User::After( 1000 ); + // Set effect begin point GfxTransEffect::BeginFullScreen( aEffect.iId , iAvkonAppUi->ClientRect(), AknTransEffect::EParameterType, AknTransEffect::GfxTransParam( targetAppUid, flags ) ); aEffect.iState = KEffectStarted; + return ETrue; } // ----------------------------------------------------------------------------- -// CXnEffectManager::DoBeginControlEffect -// ----------------------------------------------------------------------------- -// -TBool CXnEffectManager::DoBeginControlEffect( TXnEffect& aEffect ) - { - TBool ret = EFalse; - CCoeEnv* coe( CCoeEnv::Static() ); - - if ( coe->WsSession().GetFocusWindowGroup() != - coe->RootWin().Identifier() ) - { - // Window group is not focused - return ret; - } - - // Set effect begin point - if ( aEffect.iNode ) - { - GfxTransEffect::Begin( aEffect.iNode->Control() , aEffect.iId ); - aEffect.iState = KEffectStarted; - ret = ETrue; - } - - return ret; - } - -// ----------------------------------------------------------------------------- // CXnEffectManager::RemoveEffect +// // ----------------------------------------------------------------------------- // void CXnEffectManager::RemoveEffect( TXnEffect* aEffect ) { - TInt index = iEffects.Find( aEffect ); + TInt index( iEffects.Find( aEffect ) ); + if ( index != KErrNotFound ) { - TXnEffect* temp = iEffects[index]; - iEffects.Remove( index ); + TXnEffect* temp( iEffects[index] ); delete temp; + temp = NULL; + + iEffects.Remove( index ); } } -// ----------------------------------------------------------------------------- -// CXnEffectManager::EffectCount -// ----------------------------------------------------------------------------- -// -TInt CXnEffectManager::EffectCount( TInt aType ) - { - TInt effectCount = 0; - TInt count = iEffects.Count(); - for ( TInt i = 0; i < count; i++ ) - { - if ( iEffects[i]->iType == aType ) - { - effectCount++; - } - } - return effectCount; - } - // End of File diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnextrenderingpluginwrapper.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnextrenderingpluginwrapper.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnextrenderingpluginwrapper.cpp Wed May 12 13:22:51 2010 +0300 @@ -18,6 +18,10 @@ // System include files // User include files +#include "xnnode.h" +#include "xnuiengine.h" +#include "xnappuiadapter.h" + #include "xnextrenderingpluginwrapper.h" // ======== MEMBER FUNCTIONS ======== @@ -49,6 +53,7 @@ iNode = &aNode; CXnControlAdapter::ConstructL( aNode ); + iAdapter->SetEventHandler( this ); } // ---------------------------------------------------------------------------- @@ -210,5 +215,32 @@ { iAdapter->ExitPowerSaveModeL(); } - + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::HandleEventL() +// +// ---------------------------------------------------------------------------- +// +void CXnExtRenderingPluginWrapper::HandleEventL( const TDesC& aEvent, const TDesC8& aDestination ) + { + + CXnNode* node = iNode->Node().UiEngine()->FindNodeByIdL( aDestination ); + CXnAppUiAdapter* appui = static_cast(iAvkonAppUi); + if ( !appui || !node ) + { + User::Leave( KErrNotFound ); + } + appui->HandleEventL( aEvent, node->AppIfL() ); + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::SetDataL() +// +// ---------------------------------------------------------------------------- +// +void CXnExtRenderingPluginWrapper::SetDataL( const TDesC8& aData, const TDesC& aType, TInt aIndex ) + { + iAdapter->SetDataL( aData, aType, aIndex ); + } + // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnfocuscontrol.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnfocuscontrol.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnfocuscontrol.cpp Wed May 12 13:22:51 2010 +0300 @@ -68,7 +68,6 @@ // CXnFocusControl::~CXnFocusControl() { - delete iMonitor; } // ----------------------------------------------------------------------------- @@ -88,17 +87,6 @@ // void CXnFocusControl::ConstructL() { - iMonitor = CXnInactivityMonitor::NewL( *this ); - } - -// ----------------------------------------------------------------------------- -// CXnFocusControl::InactivityTimerExpired() -// -// ----------------------------------------------------------------------------- -// -void CXnFocusControl::InactivityTimerExpired() - { - MakeVisible( EFalse ); } // ----------------------------------------------------------------------------- @@ -126,12 +114,12 @@ iRefused = EFalse; - iMonitor->Stop(); - CXnNode* node( iAppUiAdapter.UiEngine().FocusedNode() ); if ( node ) { + node->HideTooltipsL(); + CXnControlAdapter* control( node->Control() ); if ( control && control->RefusesFocusLoss() ) @@ -156,8 +144,6 @@ iRefused = EFalse; iVisible = aVisible; - - iMonitor->Start(); } } } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xngesture.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xngesture.cpp Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,752 +0,0 @@ -/* -* 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: Gesture class -* -*/ - -#include - -#include "xngesture.h" -#include "xngesturedefs.h" - -using namespace XnGestureHelper; - -// ======== LOCAL FUNCTIONS =================================================== - -/** - * Point array for which only x axis is relevant - */ -class TXAxisPointArray : public TXnPointArray - { -public: - TXAxisPointArray( const RArray< TXnPointEntry >& aPoints ) - : TXnPointArray( aPoints ) - { - } - - // from TXnPointArray - TPoint operator[]( TInt aIndex ) const - { - return TPoint( Raw( aIndex ).iX, 0 ); - } - }; - -/** - * Point array for which only y axis is relevant - */ -class TYAxisPointArray : public TXnPointArray - { -public: - TYAxisPointArray( const RArray< TXnPointEntry >& aPoints ) - : TXnPointArray( aPoints ) - { - } - - // from TXnPointArray - TPoint operator[]( TInt aIndex ) const - { - return TPoint( 0, Raw( aIndex ).iY ); - } - }; - -/** @return the current time */ -TTime CurrentTime() - { - TTime time; - time.UniversalTime(); - return time; - } - -// ---------------------------------------------------------------------------- -// destructor -// ---------------------------------------------------------------------------- -// -CXnGesture::~CXnGesture() - { - iPoints.Close(); - } - -// ---------------------------------------------------------------------------- -// Reset -// ---------------------------------------------------------------------------- -// -void CXnGesture::Reset() - { - // store previous gesture data before resetting the state - if ( iPoints.Count() > 0 ) - { - iPreviousGesture = TGestureRecord( Type(), iCompletionTime, - iPoints[iPoints.Count() - 1].iPos ); - } - else - { - iPreviousGesture = TGestureRecord(); - } - - iPoints.Reset(); - iHoldingState = ENotHolding; - iState = ENotComplete; - iHoldingPointIndex = 0; - } - -// ---------------------------------------------------------------------------- -// Reset -// ---------------------------------------------------------------------------- -// -TBool CXnGesture::IsEmpty() const - { - return iPoints.Count() == 0; - } - -// ---------------------------------------------------------------------------- -// Add a point to the sequence of points that together make up the gesture -// ---------------------------------------------------------------------------- -// -TInt CXnGesture::AddPoint( const TPoint& aPoint ) - { - if ( !IsLatestPoint( aPoint ) ) - { - return iPoints.Append( TXnPointEntry( aPoint, CurrentTime() ) ); - } - return KErrNone; - } - -/** - * @return ETrue if the point is within a specified distance of the other point - */ -inline TBool IsNear( const TPoint& aPointUnderTest, const TPoint& aPoint, - TInt aMargin ) - { - TRect rect( - aPoint.iX - aMargin, aPoint.iY - aMargin, - aPoint.iX + aMargin, aPoint.iY + aMargin ); - return rect.Contains( aPointUnderTest ); - } - -// ---------------------------------------------------------------------------- -// IsNearHoldingPoint -// ---------------------------------------------------------------------------- -// -TBool CXnGesture::IsNearHoldingPoint( const TPoint& aPoint ) const - { - return IsNear( aPoint, iPoints[iHoldingPointIndex].iPos, - KSamePointTolerance ); - } - -// ---------------------------------------------------------------------------- -// IsLatestPoint -// ---------------------------------------------------------------------------- -// -TBool CXnGesture::IsLatestPoint( const TPoint& aPoint ) const - { - if ( iPoints.Count() > 0 ) - { - return aPoint == CurrentPos(); - } - return EFalse; - } - -// ---------------------------------------------------------------------------- -// StartHolding -// ---------------------------------------------------------------------------- -// -void CXnGesture::StartHolding() - { - iHoldingState = EHoldStarting; - - // remove all points that were introduced after holding started - for ( TInt i = iPoints.Count() - 1; i > iHoldingPointIndex; i-- ) - { - iPoints.Remove( i ); - } - } - -// ---------------------------------------------------------------------------- -// SetHoldingPoint -// ---------------------------------------------------------------------------- -// -void CXnGesture::SetHoldingPoint() - { - iHoldingPointIndex = iPoints.Count() - 1; - } - -// ---------------------------------------------------------------------------- -// ContinueHolding -// ---------------------------------------------------------------------------- -// -void CXnGesture::ContinueHolding() - { - iHoldingState = EHolding; - } - -// ---------------------------------------------------------------------------- -// SetReleased -// ---------------------------------------------------------------------------- -// -void CXnGesture::SetReleased() - { - // IsMovementStopped expects SetComplete to be called before SetRelea - __ASSERT_DEBUG( EComplete == iState, Panic( EGesturePanicIllegalLogic ) ); - iState = EReleased; - } - -/** - * @return elapsed time between aStartTime and aEndTime - */ -inline TTimeIntervalMicroSeconds32 Elapsed( - const TTime& aStartTime, - const TTime& aEndTime ) - { - return aEndTime.MicroSecondsFrom( aStartTime ).Int64(); - } - -// ---------------------------------------------------------------------------- -// SetComplete -// ---------------------------------------------------------------------------- -// -void CXnGesture::SetComplete() - { - __ASSERT_DEBUG( iPoints.Count() > 0, Panic( EGesturePanicIllegalLogic ) ); - iState = EComplete; - iCompletionTime = CurrentTime(); - } - -// ---------------------------------------------------------------------------- -// SetComplete -// ---------------------------------------------------------------------------- -// -void CXnGesture::SetCancelled() - { - iState = ECancelled; - } - -// ---------------------------------------------------------------------------- -// IsTap -// ---------------------------------------------------------------------------- -// -TBool CXnGesture::IsTap() const - { - return CodeFromPoints( EAxisBoth ) == EGestureTap; - } - -/** - * Translates a non-holding code into a holding code - * @param aCode original gesture code - * @return a gesture code with hold flag applied - */ -inline TXnGestureCode Hold( TXnGestureCode aCode ) - { - if ( aCode != EGestureStart && - aCode != EGestureDrag && - aCode != EGestureReleased && - aCode != EGestureUnknown ) - { - return static_cast< TXnGestureCode >( aCode | EFlagHold ); - } - return aCode; - } - -// ---------------------------------------------------------------------------- -// Code -// ---------------------------------------------------------------------------- -// -TXnGestureCode CXnGesture::Code( TAxis aRelevantAxis ) const - { - switch ( iState ) - { - case ENotComplete: - // "start" event if only first point received - // need to check that not holding, in case user pressed stylus - // down, and activated holding without moving the stylus - if ( iPoints.Count() == 1 && !IsHolding() ) - { - return EGestureStart; - } - // "drag" event if holding not started or holding started earlier - else if ( iHoldingState != EHoldStarting ) - { - return EGestureDrag; - } - // holding was just started - else - { - return Hold( CodeFromPoints( aRelevantAxis ) ); - } - - case EComplete: - { - TXnGestureCode code = CodeFromPoints( aRelevantAxis ); - -#ifdef _GESTURE_DOUBLE_TAP_SUPPORT - if ( EGestureTap == code && IsTapDoubleTap() ) - { - code = EGestureDoubleTap; - } -#endif // _GESTURE_DOUBLE_TAP_SUPPORT - - return code; - } - - case EReleased: - return EGestureReleased; - - case ECancelled: // fallthrough - default: - return EGestureUnknown; - } - } - -// ---------------------------------------------------------------------------- -// IsHolding -// ---------------------------------------------------------------------------- -// -TBool CXnGesture::IsHolding() const - { - return iHoldingState >= EHoldStarting; - } - -// ---------------------------------------------------------------------------- -// StartPos -// ---------------------------------------------------------------------------- -// -TPoint CXnGesture::StartPos() const - { - // at least one point will be in the array during callback (pointer down pos) - return iPoints[0].iPos; - } - -// ---------------------------------------------------------------------------- -// CurrentPos -// ---------------------------------------------------------------------------- -// -TPoint CXnGesture::CurrentPos() const - { - // at least on point will be in the array during callback (pointer down pos) - return iPoints[iPoints.Count() - 1].iPos; - } - -// ---------------------------------------------------------------------------- -// IsMovementStopped -// ---------------------------------------------------------------------------- -// -inline TBool CXnGesture::IsMovementStopped() const - { - // iCompletionTime is only only valid if client has called SetComplete - if ( iState >= EComplete ) - { - return Elapsed( NthLastEntry( 1 ).iTime, iCompletionTime ) - .Int() > KSpeedStopTime; - } - return EFalse; - } - -namespace - { - const TInt KFloatingPointAccuracy = 0.000001; - - /** @return percentage (0.0-1.0) how far aPos is from aEdge1 towards aEdge2 */ - inline TReal32 Proportion( TReal32 aPos, TReal32 aEdge1, TReal32 aEdge2 ) - { - if ( Abs( aEdge2 - aEdge1 ) > KFloatingPointAccuracy ) - { - return ( aPos - aEdge1 ) / ( aEdge2 - aEdge1 ); - } - return 0; // avoid division by zero - } - - /** Edges (pixels) at which speed should be -100% or 100% */ - NONSHARABLE_STRUCT( TEdges ) - { - TReal32 iMin; - TReal32 iMax; - }; - - /** - * scale which allows different (coordinate -> percentage) mapping - * between -100% to 0% and 0 and 100% - */ - NONSHARABLE_STRUCT( TScale ) - { - TScale( TInt aZero, const TEdges& aEdges ) - : iMin( aEdges.iMin ), iZero( aZero ), iMax( aEdges.iMax ) - { - } - - /** @return aPos as a percentage between -100% and 100% in aScale */ - TReal32 Percent( TReal32 aPos ) const; - - /// coordinate where speed is -100% - TReal32 iMin; - /// coordinate where speed is 0% - TReal32 iZero; - /// coordinate where speed is 100% - TReal32 iMax; - }; - - /** @convert aPos into a percentage between -100% and 100% in aScale */ - TReal32 TScale::Percent( TReal32 aPos ) const - { - TReal32 percent; - if ( aPos < iZero ) - { - // return negative percentages on the lower side of zero point - percent = -1 * Proportion( aPos, iZero, iMin ); - } - else - { - percent = Proportion( aPos, iZero, iMax ); - } - // constrain between -100% and 100% - return Min( Max( percent, -1.0F ), 1.0F ); - } - - /** Scale in x and y dimensions */ - NONSHARABLE_STRUCT( TScale2D ) - { - TRealPoint Percent( const TPoint& aPos ) const - { - return TRealPoint( - iX.Percent( aPos.iX ), - iY.Percent( aPos.iY ) ); - } - - TScale iX; - TScale iY; - }; - - enum TDirection { ESmaller, ELarger }; - - /** @return the direction of pos compared to the previous pos */ - inline TDirection Direction( TInt aPos, TInt aPreviousPos ) - { - return aPos < aPreviousPos ? ESmaller : ELarger; - } - - /** Direction in x and y dimensions */ - NONSHARABLE_STRUCT( TDirection2D ) - { - TDirection iX; - TDirection iY; - }; - - /** Return the direction (up/down) of signal at aIndex */ - inline TDirection2D Direction( - TInt aIndex, - const RArray< TXnPointEntry >& aPoints ) - { - const TPoint& pos = aPoints[aIndex].iPos; - const TPoint& prevPos = aPoints[aIndex - 1].iPos; - TDirection2D dir = { - Direction( pos.iX, prevPos.iX ), - Direction( pos.iY, prevPos.iY ) }; - return dir; - } - - /** - * @return a position in the aLow and aHigh, so that it aProportion of - * of length is above the pos - */ - TReal32 ProportionalLength( TReal32 aLow, TReal32 aHigh, TReal32 aProportion ) - { - return ( aHigh - aLow ) * aProportion / ( 1 + aProportion ); - } - - /** - * @return aVariableEdge scaled to new position, when the other edge changes - * from aOldEdge to aNewEdge, so that aOrigin maintains the *same - * relative position* between aVariableEdge and the other edge - */ - inline TReal32 ScaledEdge( - TReal32 aOrigin, - TReal32 aVariableEdge, - TReal32 aOldEdge, - TReal aNewEdge ) - { - TReal32 proportion = Proportion( aOrigin, aVariableEdge, aOldEdge ); - return ( proportion * aNewEdge - aOrigin ) / ( proportion - 1 ); - } - - TScale Rescale( - TReal32 aPos, - TDirection aDir, - TDirection aPrevDir, - const TScale& aPrevScale, - const TEdges& aEdges ) - { - TScale scale( aPrevScale ); - if ( aPrevDir != aDir ) - { - // the code duplication is accepted here, since it is difficult - // to factor out while maintaining the understandability of this - // anyway complex algorithm - if ( aDir == ESmaller ) - { - scale.iMin = aEdges.iMin; - if ( aPrevScale.iZero < aPos ) - { - TReal32 proportionAboveZero = Proportion( - aPos, aPrevScale.iZero, aPrevScale.iMax ); - scale.iZero = aPos - ProportionalLength( - aEdges.iMin, aPos, proportionAboveZero ); - } - else - { - // adjust zero pos so that proportion between aPos, Min, - // and Zero pos stay the same (Min will move to 0, - // aPos stays the same) - scale.iZero = ScaledEdge( aPos, aPrevScale.iZero, - aPrevScale.iMin, aEdges.iMin ); - } - - // adjust the upper edge to take into account the movement of - // zero pos - scale.iMax = ScaledEdge( aPos, aPrevScale.iMax, - aPrevScale.iZero, scale.iZero ); - } - else // ELarger - { - scale.iMax = aEdges.iMax; - if ( aPos < aPrevScale.iZero ) - { - TReal32 proportionBelowZero = Proportion( - aPos, aPrevScale.iZero, aPrevScale.iMin ); - scale.iZero = aPos + ProportionalLength( - aPos, aEdges.iMax, proportionBelowZero ); - } - else - { - // adjust zero pos so that proportion between aPos, Max, and - // Zero pos stay the same (Max will move edge, aPos stays - // the same) - scale.iZero = ScaledEdge( aPos, aPrevScale.iZero, - aPrevScale.iMax, aEdges.iMax ); - } - - // adjust the lower edge to take into account the movement of - // zero pos - scale.iMin = ScaledEdge( aPos, aPrevScale.iMin, - aPrevScale.iZero, scale.iZero ); - } - } - return scale; - } - - /** Edges in x and y dimensions */ - NONSHARABLE_STRUCT( TEdges2D ) - { - TEdges iX; - TEdges iY; - }; - - /** - * @param aEdges edges of the area in which gesture points are accepted - * @return the scale of latest point in the list of points - */ - TScale2D Scale( const RArray< TXnPointEntry >& aPoints, const TEdges2D& aEdges ) - { - TScale2D scale = { TScale( aPoints[0].iPos.iX, aEdges.iX ), - TScale( aPoints[0].iPos.iY, aEdges.iY ) }; - TInt count = aPoints.Count(); - if ( count > 1 ) - { - // iterate the whole point list to arrive to the current scale - TDirection2D dir( Direction( 1, aPoints ) ); - for ( TInt i = 1; i < count; i++ ) - { - // get direction at i - TDirection2D newDir( Direction( i, aPoints ) ); - // get new scale at i - scale.iX = Rescale( - aPoints[i - 1].iPos.iX, - newDir.iX, - dir.iX, - scale.iX, - aEdges.iX ); - scale.iY = Rescale( - aPoints[i - 1].iPos.iY, - newDir.iY, - dir.iY, - scale.iY, - aEdges.iY ); - dir = newDir; - } - } - return scale; - } - } // unnamed namespace - -TRealPoint CXnGesture::SpeedPercent( const TRect& aEdges ) const - { - // x and y coordinates are easier to handle separately, extract from TRect: - // ((iMinX, iMinY), (iMaxX, iMaxY)) -> ((iMinX, iMaxX), (iMinY, iMaxY)) - TEdges2D edges = { - { aEdges.iTl.iX, aEdges.iBr.iX }, - { aEdges.iTl.iY, aEdges.iBr.iY } }; - // work out the current scale (coordinate -> percentage mapping) from - // the history of points (i.e., points of current gesture). Then - // calculate the percentage of the current position. - return Scale( iPoints, edges ).Percent( CurrentPos() ); - } - -// ---------------------------------------------------------------------------- -// Speed -// ---------------------------------------------------------------------------- -// -TRealPoint CXnGesture::Speed() const - { - const TReal32 KMicroSecondsInSecond = 1000000; - - // Speed is only evaluated at the end of the swipe - // if user stops at the end of the swipe before lifting stylus, - // speed is zero. If time is zero, return 0 speed (infinite does - // not make sense either). Will need to consider also earlier points - // and their times or start time, if this zero-speed behavior is a problem - TRealPoint speed; - TReal32 time = static_cast< TReal32 >( TimeFromPreviousPoint().Int() ) - / KMicroSecondsInSecond; - if ( !IsMovementStopped() && time > 0 ) - { - TPoint distance = CurrentPos() - PreviousPos(); - speed.iX = static_cast< TReal32 >( distance.iX ) / time; - speed.iY = static_cast< TReal32 >( distance.iY ) / time; - } - return speed; - } - -// ---------------------------------------------------------------------------- -// Distance -// ---------------------------------------------------------------------------- -// -TPoint CXnGesture::Distance() const - { - return CurrentPos() - StartPos(); - } - -// ---------------------------------------------------------------------------- -// TimeFromPreviousPoint -// ---------------------------------------------------------------------------- -// -inline TTimeIntervalMicroSeconds32 CXnGesture::TimeFromPreviousPoint() const - { - const TInt KLatestEntryOffset = 1; - return Elapsed( PreviousEntry().iTime, NthLastEntry( KLatestEntryOffset ).iTime ); - } - -// ---------------------------------------------------------------------------- -// CodeFromPoints -// ---------------------------------------------------------------------------- -// -TXnGestureCode CXnGesture::CodeFromPoints( TAxis aRelevantAxis ) const - { - // select the correct filter based on aRelevantAxis - // these filter_ objects are array decorators that will eliminate either - // x, y or neither coordinate of each point - TXAxisPointArray filterY( iPoints ); - TYAxisPointArray filterX( iPoints ); - TXnPointArray filterNone( iPoints ); - TXnPointArray& filter = - aRelevantAxis == EAxisHorizontal ? static_cast< TXnPointArray& >( filterY ) : - aRelevantAxis == EAxisVertical ? static_cast< TXnPointArray& >( filterX ) : - /* otherwise EAxisBoth */ filterNone; - - // currently the gesture recogniser does not have any state, so it is fast - // to instantiate. The call is not static however, to allow the recogniser - // to be replaced by a more complicated implementation that has state. - // then it may make sense to make the recogniser a member variable. - return TXnGestureRecogniser().GestureCode( filter ); - } - -// ---------------------------------------------------------------------------- -// return nth point from the end of the points array -// ---------------------------------------------------------------------------- -// -inline const TXnPointEntry& CXnGesture::NthLastEntry( TInt aOffset ) const - { - return iPoints[Max( iPoints.Count() - aOffset, 0 )]; - } - -// ---------------------------------------------------------------------------- -// PreviousEntry -// ---------------------------------------------------------------------------- -// -inline const TXnPointEntry& CXnGesture::PreviousEntry() const - { - return NthLastEntry( KPreviousPointOffset ); - } - -// ---------------------------------------------------------------------------- -// PreviousPos -// ---------------------------------------------------------------------------- -// -inline TPoint CXnGesture::PreviousPos() const - { - return PreviousEntry().iPos; - } - -// ---------------------------------------------------------------------------- -// SetComplete -// ---------------------------------------------------------------------------- -// -TBool CXnGesture::IsTapDoubleTap() const - { - return iPreviousGesture.iType == TGestureRecord::ETypeTap && - Elapsed( iPreviousGesture.iCompletionTime, iCompletionTime ).Int() <= - KMaxDoubleTapDuration && - IsNear( iPreviousGesture.iPos, iPoints[iPoints.Count() - 1].iPos, - KSamePointTolerance ); - } - -// ---------------------------------------------------------------------------- -// Type -// ---------------------------------------------------------------------------- -// -CXnGesture::TGestureRecord::TType CXnGesture::Type() const - { - if ( CodeFromPoints( EAxisBoth ) == EGestureTap && !IsHolding() ) - { - if ( IsTapDoubleTap() ) - { - return CXnGesture::TGestureRecord::ETypeDoubleTap; - } - else - { - return CXnGesture::TGestureRecord::ETypeTap; - } - } - else - { - return CXnGesture::TGestureRecord::ETypeOther; - } - } - -// ---------------------------------------------------------------------------- -// TGestureRecord constructor -// ---------------------------------------------------------------------------- -// -CXnGesture::TGestureRecord::TGestureRecord() - { - iType = ETypeOther; - } - -// ---------------------------------------------------------------------------- -// TGestureRecord constructor -// ---------------------------------------------------------------------------- -// -CXnGesture::TGestureRecord::TGestureRecord( - CXnGesture::TGestureRecord::TType aType, - TTime aCompletionTime, - TPoint aPos ) - : iType( aType ), iCompletionTime( aCompletionTime ), iPos( aPos ) - { - } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xngesturehelper.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xngesturehelper.cpp Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,420 +0,0 @@ -/* -* 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 helper implementation -* -*/ - -// System includes -#include -#include - -// User includes -#include "xngesturehelper.h" -#include "xngesture.h" -#include "xngesturedefs.h" -#include "xnnode.h" - -using namespace XnGestureHelper; - -namespace XnGestureHelper - { - NONSHARABLE_CLASS( CHoldingTimer ) : public CTimer - { - public: - /** Two-phase constructor */ - static CHoldingTimer* NewL( CXnGestureHelper& aHelper ) - { - CHoldingTimer* self = new ( ELeave ) CHoldingTimer( aHelper ); - CleanupStack::PushL( self ); - self->ConstructL(); - // "hold event" sending is enabled by default - self->iIsEnabled = ETrue; - CActiveScheduler::Add( self ); - CleanupStack::Pop( self ); - return self; - } - - /** Destructor */ - ~CHoldingTimer() - { - Cancel(); - } - - /** Set whether sending holding events is currently enabled */ - void SetEnabled( TBool aEnabled ) - { - iIsEnabled = aEnabled; - // cancel in case hold timer is already running - Cancel(); - } - - /** @return whether sending holding events is currently enabled */ - TBool IsEnabled() const - { - return iIsEnabled; - } - - /** Start the timer. Calls CXnGestureHelper::StartHoldingL upon - * completion */ - void Start() - { - // if sending hold events is disabled, do not ever start the hold - // timer, and hence hold events will never be triggered - if ( iIsEnabled ) - { - Cancel(); - After( KHoldDuration ); - } - } - - private: - /** Constructor */ - CHoldingTimer( CXnGestureHelper& aHelper ) - : // give higher priority to new pointer events with - 1 - CTimer( EPriorityUserInput - 1 ), - iHelper( aHelper ) - { - } - - void RunL() // From CActive - { - iHelper.StartHoldingL(); - } - - private: - /// helper object that will be called back when timer is triggered - CXnGestureHelper& iHelper; - /// whether sending holding events is currently enabled - TBool iIsEnabled; - }; - } // namespace GestureHelper - -/** -* @return position from event. Use this instead of using aEvent direction to -* avoid accidentally using TPointerEvent::iPosition -*/ -inline TPoint Position( const TPointerEvent& aEvent ) - { - // use parent position, since the capturer is using full screen area, - // and because the (Alfred) drag events are not local to visual even when - // coming from the client - return aEvent.iParentPosition; - } - -// ---------------------------------------------------------------------------- -// Two-phase constructor -// ---------------------------------------------------------------------------- -// -CXnGestureHelper* CXnGestureHelper::NewL( CXnNode& aNode ) - { - CXnGestureHelper* self = new ( ELeave ) CXnGestureHelper( aNode ); - CleanupStack::PushL( self ); - self->iHoldingTimer = CHoldingTimer::NewL( *self ); - self->iGesture = new ( ELeave ) CXnGesture(); - CleanupStack::Pop( self ); - return self; - } - -// ---------------------------------------------------------------------------- -// Constructor -// ---------------------------------------------------------------------------- -// -CXnGestureHelper::CXnGestureHelper( CXnNode& aNode ) - : iOwner( aNode ) - { - } - -// ---------------------------------------------------------------------------- -// Destructor -// ---------------------------------------------------------------------------- -// -CXnGestureHelper::~CXnGestureHelper() - { - delete iHoldingTimer; - delete iGesture; - } - -// ---------------------------------------------------------------------------- -// SetHoldingEnabled -// ---------------------------------------------------------------------------- -// -void CXnGestureHelper::SetHoldingEnabled( TBool aEnabled ) - { - iHoldingTimer->SetEnabled( aEnabled ); - } - -// ---------------------------------------------------------------------------- -// IsHoldingEnabled -// ---------------------------------------------------------------------------- -// -TBool CXnGestureHelper::IsHoldingEnabled() const - { - return iHoldingTimer->IsEnabled(); - } - -// ---------------------------------------------------------------------------- -// Reset state -// ---------------------------------------------------------------------------- -// -void CXnGestureHelper::Reset() - { - iHoldingTimer->Cancel(); - iGesture->Reset(); - } - -/** -* Helper function that calls Reset on the pointer to CXnGestureHelper -*/ -static void ResetHelper( TAny* aHelper ) - { - static_cast< CXnGestureHelper* >( aHelper )->Reset(); - } - -// ---------------------------------------------------------------------------- -// Sets gesture destination -// ---------------------------------------------------------------------------- -// -void CXnGestureHelper::SetDestination( CXnNode* aDestination ) - { - iDestination = aDestination; - } - -// ---------------------------------------------------------------------------- -// Gets gesture destination -// ---------------------------------------------------------------------------- -// -CXnNode* CXnGestureHelper::Destination() const - { - return iDestination; - } - -// ---------------------------------------------------------------------------- -// Gets gesture owner -// ---------------------------------------------------------------------------- -// -CXnNode* CXnGestureHelper::Owner() const - { - return &iOwner; - } - -// ---------------------------------------------------------------------------- -// Handle a pointer event -// ---------------------------------------------------------------------------- -// -TSwipeResult CXnGestureHelper::HandlePointerEventL( const TPointerEvent& aEvent ) - { - TSwipeResult ret = ESwipeNone; - switch ( aEvent.iType ) - { - case TPointerEvent::EButton1Down: - // If no up event was received during previous gesture, cancel - // previous event and reset state - if ( !IsIdle() ) - { - iGesture->SetCancelled(); - // ambiguous what is the right thing when "cancel" event leaves - // and "start" does not. Leaving for cancel *after* "start" could - // be unexpected to client, as client would have handled start - // event successfully. Assume that leaving upon cancellation - // can be ignored. - Reset(); - } - // adding the first point implicitly makes the state "not idle" - AddPointL( aEvent ); - // If AddPointL leaves, IsIdle will return EFalse for other events - // types, hence further pointer events will be ignored. - // Therefore, holding will NOT be started if AddPointL leaves, - // since the callback would trigger a gesture callback, and that - // would access an empty points array. - iHoldingTimer->Start(); - break; - - case TPointerEvent::EDrag: - // ignore the event in case not in "recording" state. this may - // happen if holding was triggered, or client sends up event after - // down event was received in a different *client* state, and - // client did not forward the down event to here. - // Also, while stylus down, the same event is received repeatedly - // even if stylus does not move. Filter out by checking if point - // is the same as the latest point - if ( !IsIdle() && !iGesture->IsLatestPoint( Position( aEvent ) ) ) - { - AddPointL( aEvent ); - if ( !( iGesture->IsHolding() || - iGesture->IsNearHoldingPoint( Position( aEvent ) ) ) ) - { - // restart hold timer, since pointer has moved - iHoldingTimer->Start(); - // Remember the point in which holding was started - iGesture->SetHoldingPoint(); - } - } - break; - - case TPointerEvent::EButton1Up: - // ignore up event if no down event received - if ( !IsIdle() ) - { - // reset in case the down event is not received for a reason - // in client, and instead drag or up events are received. - // reset via cleanup stack to ensure Reset is run even if - // observer leaves - CleanupStack::PushL( TCleanupItem( &ResetHelper, this ) ); - iGesture->SetComplete(); - // if adding of the point fails, notify client with a - // cancelled event. It would be wrong to send another - // gesture code when the up point is not known - if ( AddPoint( aEvent ) != KErrNone ) - { - iGesture->SetCancelled(); - } - else - { - // send gesture code if holding has not been started - if ( !iGesture->IsHolding() ) - { - // if client leaves, the state is automatically reset. - // In this case the client will not get the released event - ret = ValidSwipe(); - } - // send an event that stylus was lifted - iGesture->SetReleased(); - } - // reset state - CleanupStack::PopAndDestroy( this ); - } - break; - - default: - break; - } - return ret; - } - -// ---------------------------------------------------------------------------- -// Is the helper idle? -// inline ok in cpp file for a private member function -// ---------------------------------------------------------------------------- -// -inline TBool CXnGestureHelper::IsIdle() const - { - return iGesture->IsEmpty(); - } - -// ---------------------------------------------------------------------------- -// Add a point to the sequence of points that together make up the gesture -// inline ok in cpp file for a private member function -// ---------------------------------------------------------------------------- -// -inline void CXnGestureHelper::AddPointL( const TPointerEvent& aEvent ) - { - User::LeaveIfError( AddPoint( aEvent ) ); - } - -// ---------------------------------------------------------------------------- -// Add a point to the sequence of points that together make up the gesture -// inline ok in cpp file for a private member function -// ---------------------------------------------------------------------------- -// -inline TInt CXnGestureHelper::AddPoint( const TPointerEvent& aEvent ) - { - return iGesture->AddPoint( Position ( aEvent ) ); - } - -/** -* Helper function that calls ContinueHolding on the pointer to TGesture -*/ -static void ContinueHolding( TAny* aGesture ) - { - static_cast< CXnGesture* >( aGesture )->ContinueHolding(); - } - -// ---------------------------------------------------------------------------- -// Add a point to the sequence of points that together make up the gesture -// ---------------------------------------------------------------------------- -// -void CXnGestureHelper::StartHoldingL() - { - // hold & tap event is specifically filtered out. Use case: in list fast - // scrolling activation (e.g. enhanced coverflow), tap & hold should not - // start fast scroll. In addition, after long tap on start position, - // drag and drag & hold swiping should emit normal swipe and swipe&hold - // events. Therefore, tap & hold is not supported. - if ( !iGesture->IsTap() ) - { - // holding has just started, and gesture code should be provided to client. - // set gesture state so that it produces a gesture code (other than drag) - iGesture->StartHolding(); - - // create an item in the cleanup stack that will set the gesture state - // to holding-was-started-earlier state. NotifyL may leave, but the - // holding-was-started-earlier state must still be successfully set, - // otherwise, the holding gesture code will be sent twice - CleanupStack::PushL( TCleanupItem( &ContinueHolding, iGesture ) ); - - // set holding state to "post holding" - CleanupStack::PopAndDestroy( iGesture ); - } - } - -// ---------------------------------------------------------------------------- -// Check if swipe is valid -// ---------------------------------------------------------------------------- -// -TSwipeResult CXnGestureHelper::ValidSwipe() - { - TSwipeResult ret = ESwipeNone; - TBool validSwipe(ETrue); - - // check if swipe is between defined values - TInt distanceX = Abs( iGesture->Distance().iX ); - TInt speedX = Abs( static_cast< TInt >( iGesture->Speed().iX ) ); - - TInt minLength( iOwner.MarginRect().Width() / 2 ); - - TInt dy( Abs( iGesture->StartPos().iY - iGesture->CurrentPos().iY ) ); - - if ( distanceX < minLength ) - { - validSwipe = EFalse; - } - - if ( speedX < KGestureMinSpeedX ) - { - validSwipe = EFalse; - } - - if ( dy > KGestureMaxDeltaY ) - { - validSwipe = EFalse; - } - - // check the direction of swipe - if ( validSwipe ) - { - switch ( iGesture->Code( CXnGesture::EAxisHorizontal ) ) - { - case EGestureSwipeLeft: - ret = ESwipeLeft; - break; - case EGestureSwipeRight: - ret = ESwipeRight; - break; - default: // fall through - break; - } - } - - return ret; - } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xngesturerecogniser.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xngesturerecogniser.cpp Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,228 +0,0 @@ -/* -* 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 helper implementation -* -*/ - -#include - -#include "xngesturerecogniser.h" -#include "xngesturedefs.h" -#include "xnpointarray.h" - -using namespace XnGestureHelper; - -/** - * Vector class (math) - */ -NONSHARABLE_CLASS( TVector ) - { -public: - /** - * Constructor - * @param aFrom starting point of the vector - * @param aTo ending point of the vector - */ - TVector( const TPoint& aFrom, const TPoint& aTo ) - : iX( aTo.iX - aFrom.iX ), - iY( aTo.iY - aFrom.iY ) - { - } - - /** @return angle of the vector */ - TReal Angle() const - { - TReal angle = 0; - TReal length = Length(); - if ( length != 0 ) - { - Math::ACos( angle, iX / Length() ); - if ( iY < 0 ) - { - angle = 2 * KPi - angle; - } - } - return Degrees( angle ); - } - - /** @return length of the vector */ - TReal Length() const - { - TReal length = 0; - Math::Sqrt( length, iX * iX + iY * iY ); - return length; - } - -private: - /** @return radians in degrees */ - inline TReal Degrees( TReal aRadians ) const - { - return aRadians * 180 / KPi; - } - -public: - /// x coordinate that represent the vector - TReal iX; - /// y coordinate that represent the vector - TReal iY; - }; - -/** - * @return ETrue if points for a tap event - */ -inline TBool IsTap( const TXnPointArray& aPoints ) - { - // with tap, the pointer is not allowed to leave the tap area and come back - // therefore, gesture length is not an acceptable test for tap, as it tests - // only the last point. therefore, check if *any* point is outside tap area. - TInt i = aPoints.Count(); // latest point if most likely to be outside tap area - while ( --i >= 0 ) - { - // use the raw point (from which no axis has been filtered out) - // because tap should consider both axes even when Code() ignores one axis - if ( KSamePointTolerance < Abs( aPoints.Raw( i ).iX - aPoints.Raw( 0 ).iX ) || - KSamePointTolerance < Abs( aPoints.Raw( i ).iY - aPoints.Raw( 0 ).iY ) ) - { - return EFalse; - } - } - return ETrue; - } - -/** - * @return Length of the gesture in points - */ -inline TReal GestureLength( const TXnPointArray& aPoints ) - { - return TVector( aPoints[0], aPoints[aPoints.Count() - 1] ).Length(); - } - -/** - * @return ETrue if aAngleUnderTest is almost aAngle - * Closeness of the angles is controlled by KAngleTolerance - */ -static TBool IsNear( TReal aAngleUnderTest, TReal aAngle ) - { - return aAngle - KAngleTolerance <= aAngleUnderTest && - aAngleUnderTest <= aAngle + KAngleTolerance; - } - -/** - * @return the angle as a direction flags of TGesture - */ -inline TXnGestureCode Direction( TReal aAngle ) - { - TXnGestureCode direction = EGestureUnknown; - - if ( IsNear( aAngle, 90.0 ) ) - { - direction = EGestureSwipeDown; - } - else if ( IsNear( aAngle, 180.0 ) ) - { - direction = EGestureSwipeLeft; - } - else if ( IsNear( aAngle, 270.0 ) ) - { - direction = EGestureSwipeUp; - } - else if ( 360.0 - KAngleTolerance <= aAngle || aAngle <= KAngleTolerance ) - { - direction = EGestureSwipeRight; - } - else // for lint warning - { - // unknown angle - } - - return direction; - } - -/** @return direction between points */ -inline TXnGestureCode Direction( const TPoint& aFromPoint, const TPoint& aToPoint ) - { - return Direction( TVector( aFromPoint, aToPoint ).Angle() ); - } - -/** @return overall direction between points */ -static TXnGestureCode GeneralDirection( const TXnPointArray& aPoints ) - { - return Direction( aPoints[0], aPoints[aPoints.Count() - 1]); - } - -/** -* @return the last received point that is different that the latest point, -* or first point if no point is different than latest -*/ -inline TPoint PreviousPoint( const TXnPointArray& aPoints ) - { - TPoint latestPoint = aPoints[aPoints.Count() - 1]; - TInt i = aPoints.Count() - 1; - while ( --i >= 0 ) - { - if ( latestPoint != aPoints[i] ) - { - return aPoints[i]; - } - } - return aPoints[0]; - } - -/** @return direction between last two points */ -inline TXnGestureCode LastDirection( const TXnPointArray& aPoints ) - { - if ( aPoints.Count() > 1 ) - { - // return direction between latest and previous points. - // pick the previous point that is different than the last point - // because while using an x or y filter array, more than one - // sequential points may look like the same point because - // the differing coordinate coordinate is filtered out. For example, - // if dragging left and slightly up, many y coordinates will have the - // same value, while only x differs. - return Direction( PreviousPoint( aPoints ), aPoints[aPoints.Count() - 1] ); - } - return EGestureUnknown; - } - -// ---------------------------------------------------------------------------- -// Return gesture code of a gesture formed by a sequence of points -// ---------------------------------------------------------------------------- -// -TXnGestureCode TXnGestureRecogniser::GestureCode( const TXnPointArray& aPoints ) const - { - __ASSERT_DEBUG( aPoints.Count() > 0, Panic( EGesturePanicIllegalLogic ) ); - - if (aPoints.Count() <= 0) - return EGestureUnknown; - - if ( IsTap( aPoints ) ) - { - return EGestureTap; - } - - if ( GestureLength( aPoints ) >= KMinSwipeLength ) - { - TXnGestureCode direction = GeneralDirection( aPoints ); - if ( direction != LastDirection( aPoints ) ) - { - direction = EGestureUnknown; - } - return direction; - } - - // the pointer was moved but was either not moved far enough, or was - // brought back to close to the starting point - return EGestureUnknown; - } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnhittest.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnhittest.cpp Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,193 +0,0 @@ -/* -* 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: Data class to hold widget info -* -*/ - -// INCLUDES -#include - -#include "xncontroladapter.h" -#include "xnhittest.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CXnHitTest::NewL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CXnHitTest* CXnHitTest::NewL() - { - CXnHitTest* self = CXnHitTest::NewLC(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CXnHitTest::NewLC() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CXnHitTest* CXnHitTest::NewLC() - { - CXnHitTest* self = new ( ELeave ) CXnHitTest; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// ----------------------------------------------------------------------------- -// CXnHitTest::CXnHitTest() -// C++ default constructor -// ----------------------------------------------------------------------------- -// -CXnHitTest::CXnHitTest() - { - } - -// ----------------------------------------------------------------------------- -// CXnHitTest::~CXnHitTest() -// C++ default destructor. -// ----------------------------------------------------------------------------- -// -CXnHitTest::~CXnHitTest() - { - CCoeEnv::Static()->RemoveMessageMonitorObserver( *this ); - iHitRegion.Reset(); - } - -// ----------------------------------------------------------------------------- -// CXnHitTest::ConstructL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -void CXnHitTest::ConstructL() - { - CCoeEnv::Static()->AddMessageMonitorObserverL( *this ); - } - -// ----------------------------------------------------------------------------- -// CXnHitTest::MonitorWsMessage() -// ----------------------------------------------------------------------------- -// -void CXnHitTest::MonitorWsMessage( const TWsEvent& aEvent ) - { - TInt type( aEvent.Type() ); - - if ( type == EEventPointer ) - { - iPointerEvent = *aEvent.Pointer(); - } - } - -// ----------------------------------------------------------------------------- -// CXnHitTest::AddControl() -// ----------------------------------------------------------------------------- -// -void CXnHitTest::AddControl( CXnControlAdapter* aControl ) - { - if ( iHitRegion.Find( aControl ) == KErrNotFound ) - { - iHitRegion.Append( aControl ); - } - } - -// ----------------------------------------------------------------------------- -// CXnHitTest::RemoveControl() -// ----------------------------------------------------------------------------- -// -void CXnHitTest::RemoveControl( CXnControlAdapter* aControl ) - { - TInt index( iHitRegion.Find( aControl ) ); - - if ( index != KErrNotFound ) - { - iHitRegion.Remove( index ); - } - } - -// ----------------------------------------------------------------------------- -// CXnHitTest::SetFlags() -// ----------------------------------------------------------------------------- -// -void CXnHitTest::SetFlags( const TInt aFlags ) - { - iFlags |= aFlags; - } - -// ----------------------------------------------------------------------------- -// CXnHitTest::ClearFlags() -// ----------------------------------------------------------------------------- -// -void CXnHitTest::ClearFlags( const TInt aFlags ) - { - iFlags &= ~aFlags; - } - -// ----------------------------------------------------------------------------- -// CXnHitTest::Flags() -// ----------------------------------------------------------------------------- -// -TInt CXnHitTest::Flags() const - { - return iFlags; - } - -// ----------------------------------------------------------------------------- -// CXnHitTest::Flush() -// ----------------------------------------------------------------------------- -// -void CXnHitTest::Flush() - { - iFlags = 0; - - iHitRegion.Reset(); - } - -// ----------------------------------------------------------------------------- -// CXnHitTest::HitRegionCount() -// ----------------------------------------------------------------------------- -// -TInt CXnHitTest::HitRegionCount() const - { - return iHitRegion.Count(); - } - -// ----------------------------------------------------------------------------- -// CXnHitTest::HitRegion() -// ----------------------------------------------------------------------------- -// -CXnControlAdapter* CXnHitTest::HitRegion() const - { - TInt count( HitRegionCount() ); - - if ( count > 0 ) - { - return iHitRegion[count - 1]; - } - - return NULL; - } - -// ----------------------------------------------------------------------------- -// CXnHitTest::PointerEvent() -// ----------------------------------------------------------------------------- -// -const TPointerEvent& CXnHitTest::PointerEvent() const - { - return iPointerEvent; - } - -// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnkeyeventdispatcher.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnkeyeventdispatcher.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnkeyeventdispatcher.cpp Wed May 12 13:22:51 2010 +0300 @@ -40,6 +40,8 @@ ( k == EStdKeyLeftArrow || k == EStdKeyRightArrow || \ k == EStdKeyUpArrow || k == EStdKeyDownArrow ) +const TInt KOneView = 1; + // ----------------------------------------------------------------------------- // SetInitialFocusL // ----------------------------------------------------------------------------- @@ -190,12 +192,15 @@ CCoeControl* destination = reinterpret_cast< CCoeControl* >( handle ); TPointerEvent& event( *aEvent.Pointer() ); + + // Store event + iPointerEvent = *aEvent.Pointer(); if ( iCbaContainer ) { CEikCba* cba = static_cast< CEikCba* >( iCbaContainer->ButtonGroup() ); - + if ( destination == cba && iCbaContainer->IsVisible() ) { CXnMenuAdapter* adapter( MenuAdapter( iMenuNode ) ); @@ -205,12 +210,34 @@ TRAP_IGNORE( adapter->HandlePointerEventL( *aEvent.Pointer() ) ); } + + // if focus was lost due to longtap & button not being released + // appui will set flag to ignorekeyevent for this control as it has + // lost focus ( voice command become active ) after longtap detected. + // this causes cba button to stay in pressed state. send this buttonup + // event manually so that cba can draw itself correctly + // case id: ou1cimx1#265200 + if ( event.iType == TPointerEvent::EButton1Up && + !cba->IsFocused() ) + { + TRAP_IGNORE( cba->HandlePointerEventL( event ) ); + } } } } } // ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::PointerEvent() +// +// ----------------------------------------------------------------------------- +// +const TPointerEvent& CXnKeyEventDispatcher::PointerEvent() const + { + return iPointerEvent; + } + +// ----------------------------------------------------------------------------- // CXnKeyEventDispatcher::OfferKeyEventL // Handles key events. // ----------------------------------------------------------------------------- @@ -220,9 +247,7 @@ TEventCode aType ) { TKeyResponse resp( EKeyWasNotConsumed ); - - iEventCode = aType; - + CXnNode* node( NULL ); TBool keyYesNoApps( EFalse ); @@ -235,7 +260,7 @@ // When menu is focused or LSK/RSK is pressed, // then forward events to menuadapter. // Note that MSK is handled directly in the base class as it used only - // for activating + // for activation node = iMenuNode; } else if ( aKeyEvent.iScanCode == EStdKeyApplication0 || @@ -245,8 +270,9 @@ keyYesNoApps = ETrue; iFocusChanged = EFalse; + // AppsKey, YesKey, NoKey events must be always handled, and if we don't - // have a focused node, then let the view node do the job + // have a focused node, then let the view handle the event node = ( !iNode ) ? iUiEngine.ActiveView() : iNode; } else @@ -262,8 +288,30 @@ if ( !iNode ) { // Find initial location for focus - ResolveAndSetFocusL(); - + ResolveAndSetFocusL(); + + // If focus is still not set, we are in normal mode and the view is empty. + // left and right arrows lead to next/previous view. When other arrows + // are pressed, the focus is hidden. + if( !iNode ) + { + if( iUiEngine.ViewManager()->ViewAmount() != KOneView && + aKeyEvent.iScanCode == EStdKeyRightArrow ) + { + iUiEngine.ViewManager()->ActivateNextViewL(); + } + else if( iUiEngine.ViewManager()->ViewAmount() != KOneView && + aKeyEvent.iScanCode == EStdKeyLeftArrow ) + { + iUiEngine.ViewManager()->ActivatePreviousViewL(); + } + else + { + // hide focus if view is not switched + appui.HideFocus(); + } + } + return EKeyWasConsumed; } } @@ -273,6 +321,10 @@ if ( editmode->OfferKeyEventL( aKeyEvent, aType ) == EKeyWasConsumed ) { + iFocusChanged = EFalse; + iKeyEventNode = NULL; + iEventCode = EEventNull; + return EKeyWasConsumed; } @@ -288,8 +340,7 @@ if ( iFocusChanged && ( aType == EEventKeyUp ) ) { - // Pass keyup event to - // previously focused node + // Pass keyup event to the previously focused node node = iKeyEventNode; } } @@ -300,7 +351,9 @@ { // We are waiting for down event return resp; - } + } + + iEventCode = aType; } if ( !node ) @@ -480,7 +533,10 @@ } else { - iCbaContainer->MakeVisible( ETrue ); + if ( !iCbaContainer->IsVisible() ) + { + iCbaContainer->MakeVisible( ETrue ); + } } } else @@ -616,10 +672,10 @@ CXnViewData& activeViewData( iUiEngine.ViewManager()->ActiveViewData() ); - const CXnPluginData& pluginData( + const CXnPluginData* pluginData( activeViewData.Plugin( iNode ) ); - if ( &pluginData == &aPluginData ) + if ( pluginData == &aPluginData ) { // The plugin is removed which was holding focus ClearStateL(); @@ -661,10 +717,10 @@ // first, search only in plugins which have popup window open for ( TInt i = 0; i < list.Count(); i++ ) { - CXnPluginData& plugin( activeView.Plugin( list[i] ) ); - if ( plugin.IsDisplayingPopup() ) + CXnPluginData* plugin( activeView.Plugin( list[i] ) ); + if ( plugin && plugin->IsDisplayingPopup() ) { - plugin.InitialFocusNodesL( initial ); + plugin->InitialFocusNodesL( initial ); } } @@ -674,8 +730,11 @@ { for ( TInt i = 0; i < list.Count(); i++ ) { - CXnPluginData& plugin( activeView.Plugin( list[i] ) ); - plugin.InitialFocusNodesL( initial ); + CXnPluginData* plugin( activeView.Plugin( list[i] ) ); + if ( plugin ) + { + plugin->InitialFocusNodesL( initial ); + } } } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnlistquerydialogadapter.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnlistquerydialogadapter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnlistquerydialogadapter.cpp Wed May 12 13:22:51 2010 +0300 @@ -35,7 +35,9 @@ #include "xndomlist.h" #include "xndomattribute.h" + // ======== LOCAL FUNCTIONS ======== + // --------------------------------------------------------------------------- // Finds recursively node by type // @return returns pointer to desired node, NULL if nothing found @@ -225,9 +227,17 @@ // ----------------------------------------------------------------------------- // void CXnListQueryDialogAdapter::ReplaceItemL(const TDesC& aText, TInt aIndex ) - { + { + if ( iDialog ) + { + iDialog->DismissQueryL(); + } + + iDialog = NULL; + aIndex += iStaticItems.Count(); TInt count( iItemArray->Count()); + if( aIndex >= count ) { iItemArray->AppendL( aText ); @@ -236,7 +246,7 @@ { iItemArray->Delete( aIndex ); iItemArray->InsertL( aIndex, aText ); - } + } } // ----------------------------------------------------------------------------- @@ -244,13 +254,22 @@ // ----------------------------------------------------------------------------- // void CXnListQueryDialogAdapter::InsertItemL(const TDesC& aText, TInt aIndex ) - { + { + if ( iDialog ) + { + iDialog->DismissQueryL(); + } + + iDialog = NULL; + aIndex += iStaticItems.Count(); TInt count( iItemArray->Count()); + if( count < aIndex ) { aIndex = count; } + iItemArray->InsertL( aIndex, aText ); } @@ -260,11 +279,19 @@ // void CXnListQueryDialogAdapter::DeleteItem( TInt aIndex ) { + if ( iDialog ) + { + TRAP_IGNORE( iDialog->DismissQueryL() ); + } + + iDialog = NULL; + aIndex += iStaticItems.Count(); + if( aIndex < iItemArray->Count()) { iItemArray->Delete( aIndex ); - } + } } // ----------------------------------------------------------------------------- @@ -273,16 +300,23 @@ // void CXnListQueryDialogAdapter::TryDisplayingDialogL( ) { + if ( iDialog ) + { + iDialog->DismissQueryL(); + } + + iDialog = NULL; + CXnAppUiAdapter& appui( static_cast< CXnAppUiAdapter& >( *iAvkonAppUi ) ); appui.HideFocus(); TInt selectedIndex( 0 ); - CAknListQueryDialog* query = - new ( ELeave ) CAknListQueryDialog( &selectedIndex ); - - query->PrepareLC( R_XML_LISTQUERY ); + CAknListQueryDialog* dialog = + new ( ELeave ) CAknListQueryDialog( &selectedIndex ); + dialog->PrepareLC( R_XML_LISTQUERY ); + /* Not tested CAknPopupHeadingPane* heading( query->QueryHeading() ); if ( heading ) @@ -303,13 +337,17 @@ } } */ - query->SetItemTextArray( iItemArray ); - query->SetOwnershipType( ELbmDoesNotOwnItemArray ); - - if ( query->RunLD() ) + dialog->SetItemTextArray( iItemArray ); + dialog->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + iDialog = dialog; + + if ( dialog->RunLD() ) { ActivateItemL( selectedIndex ); - } + } + + iDialog = NULL; } // ----------------------------------------------------------------------------- @@ -346,6 +384,11 @@ CXnDomAttribute* attribute = static_cast (eventNode->AttributeList().FindByName( XnPropertyNames::action::event::KName )); + if ( !attribute ) + { + return; + } + HBufC8* nameStr( attribute->Value().AllocLC()); TPtr8 namePtr = nameStr->Des(); diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnnode.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnnode.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnnode.cpp Wed May 12 13:22:51 2010 +0300 @@ -822,41 +822,6 @@ return iImpl->NavIndexL(); } -CXnProperty* CXnNode::VisibleRowsL() - { - return iImpl->VisibleRowsL(); - } - -CXnProperty* CXnNode::GridColumnsL() - { - return iImpl->GridColumnsL(); - } - -CXnProperty* CXnNode::GridOrientationL() - { - return iImpl->GridOrientationL(); - } - -CXnProperty* CXnNode::GridVerDirectionL() - { - return iImpl->GridVerDirectionL(); - } - -CXnProperty* CXnNode::GridHorDirectionL() - { - return iImpl->GridHorDirectionL(); - } - -CXnProperty* CXnNode::FocusHorLoopingL() - { - return iImpl->FocusHorLoopingL(); - } - -CXnProperty* CXnNode::FocusVerLoopingL() - { - return iImpl->FocusVerLoopingL(); - } - CXnProperty* CXnNode::ZIndexL() { return iImpl->ZIndexL(); @@ -877,21 +842,6 @@ return iImpl->FocusBackgroundL(); } -CXnProperty* CXnNode::RefL() - { - return iImpl->RefL(); - } - -CXnProperty* CXnNode::GridScrollBarMarginL() - { - return iImpl->GridScrollBarMarginL(); - } - -CXnProperty* CXnNode::GridScrollBarWidthL() - { - return iImpl->GridScrollBarWidthL(); - } - // ----------------------------------------------------------------------------- // CXnNode::SetDomNode // Sets the DOM node pointer @@ -966,51 +916,6 @@ } // ----------------------------------------------------------------------------- -// CXnNode::RestartTimedTrigger -// Restarts the timed trigger. -// ----------------------------------------------------------------------------- -// -void CXnNode::RestartTimedTrigger( TInt aDelay ) - { - CPeriodic* timer = iImpl->PeriodicTimer(); - if ( timer ) - { - if ( timer->IsActive() ) - { - timer->Cancel(); - if ( aDelay > 0 ) - { - timer->After( aDelay ); - } - else - { - iImpl->DeletePeriodic(); - } - } - } - } - -// ----------------------------------------------------------------------------- -// CXnNode::SetTriggerDelay -// Sets default trigger delay -// ----------------------------------------------------------------------------- -// -void CXnNode::SetTriggerDelay( TTimeIntervalMicroSeconds32 aDelay ) - { - iTriggerDelay = aDelay; - } - -// ----------------------------------------------------------------------------- -// CXnNode::TriggerDelay -// Returns default trigger delay -// ----------------------------------------------------------------------------- -// -TTimeIntervalMicroSeconds32 CXnNode::TriggerDelay() - { - return iTriggerDelay; - } - -// ----------------------------------------------------------------------------- // CXnNode::SetDirtyL // Marks the node dirty // ----------------------------------------------------------------------------- diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnnodeappif.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnnodeappif.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnnodeappif.cpp Wed May 12 13:22:51 2010 +0300 @@ -21,6 +21,8 @@ #include "xntype.h" #include "xnuiengine.h" #include "xndomnode.h" +#include "xncomponent.h" +#include "xncomponentnodeimpl.h" // ============================ MEMBER FUNCTIONS =============================== @@ -279,3 +281,12 @@ } return KNullDesC8; } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::Component +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnComponent& CXnNodeAppIf::Component() + { + return *iNode->ComponentNodeImpl()->Component(); + } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp Wed May 12 13:22:51 2010 +0300 @@ -43,28 +43,26 @@ #include "xneditmode.h" #include "xneditor.h" #include "xntext.h" -#include "xnhittest.h" #include "xnscrollablecontroladapter.h" #include "xnviewdata.h" +#include "xnrootdata.h" #include "xnpanic.h" #include "xnlistquerydialogadapter.h" #include "xneffectmanager.h" #include "xnviewadapter.h" #include "xnbackgroundmanager.h" +#include "xntexteditor.h" // Local constants -_LIT8( KRef, "ref" ); _LIT8( KId, "id" ); _LIT8( KName, "name" ); _LIT8( KToolTip, "tooltip" ); _LIT8( KMenuBar, "menubar" ); +_LIT8( KTextEditor, "texteditor" ); +_LIT8( KPlugin, "plugin" ); _LIT8( KActionsHandler, "actionshandler" ); -const TReal KS60ScrollbarDefaultWidth = 1.5; -const TReal KS60ScrollbarDefaultMargin = 0.25; -const TReal KS60ScrollbarDefaultWidthPenEnabled = 3; -const TReal KS60ScrollbarDefaultMarginPenEnabled = 0.5; const TInt KUnitMaxLen = 2; const TInt KOneView = 1; @@ -86,30 +84,6 @@ _LIT8( KGainEnd, "gainend" ); _LIT8( KLoseEnd, "loseend" ); -// Local classes -struct TXnTimedTrigger - { - CXnNodeImpl* iNodeImpl; - CXnUiEngine* iEngine; - CXnNode* iNode; - CXnNode* iEventData; - CXnDomNode* iActionNode; - CXnDomNode* iTriggerNode; - }; - -struct CGridPropertyCache : public CBase - { - CXnProperty* iVisibleRows; - CXnProperty* iGridColumns; - CXnProperty* iGridOrientation; - CXnProperty* iGridVerDirection; - CXnProperty* iGridHorDirection; - CXnProperty* iFocusHorLooping; - CXnProperty* iFocusVerLooping; - CXnProperty* iGridScrollBarWidth; - CXnProperty* iGridScrollBarMargin; - }; - struct CLayoutPropertyCache : public CBase { CLayoutPropertyCache() : @@ -280,9 +254,6 @@ // Local function prototypes static TBool IsTriggerRunnableL( CXnDomNode& aTriggerNode ); -static CXnNode* RefNodeL( - CXnNodeImpl* aThis, CXnProperty* aRef, CXnUiEngine* aUiEngine ); -static const TDesC8* CheckRefAttributeL( CXnProperty* aRef ); static TBool DoMatchTriggerForKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType, @@ -292,17 +263,16 @@ RPointerArray< CXnNode >& aFocusCandidates ); static void RunAppUiNotificationL( CXnUiEngine& aEngine, CXnNode& aNode, CXnDomNode& aEventNode, CXnDomNode& aTriggerNode, CXnNode& aEventData ); -static void RunAppExit( CXnUiEngine& aEngine ); static void RunFullScreenEffectL( CXnUiEngine& aEngine, CXnDomNode& aEventNode ); -static void RunActivateViewL( - CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnDomNode& aEventNode ); -static void RunActivateNextViewL( CXnUiEngine& aEngine ); -static void RunActivatePreviousViewL( CXnUiEngine& aEngine ); -static void RunAddViewL( CXnUiEngine& aEngine ); -static void RunRemoveViewL( CXnUiEngine& aEngine ); +static void RunActivateNextViewL( CXnUiEngine& aEngine, CXnDomNode& aEventNode ); +static void RunActivatePreviousViewL( CXnUiEngine& aEngine, CXnDomNode& aEventNode ); +static void RunAddViewL( CXnUiEngine& aEngine, CXnDomNode& aEventNode ); +static void RunRemoveViewL( CXnUiEngine& aEngine, CXnDomNode& aEventNode ); static void RunActivateL( CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnDomNode& aEventNode ); +static void RunActivateEditorL( CXnNodeImpl* aThis, CXnNode& aLayoutNode, + CXnUiEngine& aEngine, CXnDomNode& aEventNode, TBool aActivate ); static void RunDeactivateL( CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnDomNode& aEventNode ); static void RunSystemSetPCDataL( @@ -334,8 +304,6 @@ static void RunTryDisplayingListQueryDialogL( CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnDomNode& aEventNode ); static void RunSetInitialFocusL( CXnUiEngine& aEngine ); -static void ResolveTriggerDelayL( - CXnUiEngine& aEngine, CXnDomNode& aNode, TInt& aDelay ); static TBool RunEventL( CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnNode& aNode, CXnDomNode& aEventNode, CXnDomNode& aTriggerNode, CXnNode& aEventData ); @@ -461,6 +429,23 @@ // ============================= LOCAL FUNCTIONS =============================== // ----------------------------------------------------------------------------- +// ResolveEffectId +// ----------------------------------------------------------------------------- +// +static TInt ResolveEffectId( CXnDomNode& aEventNode ) + { + TInt effect( 0 ); + const TDesC8& value( aEventNode.AttributeValue( + XnPropertyNames::common::KEffectId ) ); + if( value != KNullDesC8 ) + { + TLex8 lex( value ); + lex.Val( effect ); + } + return effect; + } + +// ----------------------------------------------------------------------------- // Checks whether trigger is runnable // ----------------------------------------------------------------------------- // @@ -907,197 +892,197 @@ TInt level( XnDirtyLevel::ENone ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::WidthL, + aNode, aPseudoClass, &CXnNode::WidthL, aLayoutPropertyCache->iWidth, aLayoutPropertyCache->iWidths, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::HeightL, + aNode, aPseudoClass, &CXnNode::HeightL, aLayoutPropertyCache->iHeight, aLayoutPropertyCache->iHeights, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::MarginLeftL, + aNode, aPseudoClass, &CXnNode::MarginLeftL, aLayoutPropertyCache->iMarginLeft, aLayoutPropertyCache->iMarginLefts, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::MarginRightL, + aNode, aPseudoClass, &CXnNode::MarginRightL, aLayoutPropertyCache->iMarginRight, aLayoutPropertyCache->iMarginRights, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderLeftL, + aNode, aPseudoClass, &CXnNode::BorderLeftL, aLayoutPropertyCache->iBorderLeft, aLayoutPropertyCache->iBorderLefts, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderRightL, + aNode, aPseudoClass, &CXnNode::BorderRightL, aLayoutPropertyCache->iBorderRight, aLayoutPropertyCache->iBorderRights, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::PaddingLeftL, + aNode, aPseudoClass, &CXnNode::PaddingLeftL, aLayoutPropertyCache->iPaddingLeft, aLayoutPropertyCache->iPaddingLefts, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::PaddingRightL, + aNode, aPseudoClass, &CXnNode::PaddingRightL, aLayoutPropertyCache->iPaddingRight, aLayoutPropertyCache->iPaddingRights, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::MarginTopL, + aNode, aPseudoClass, &CXnNode::MarginTopL, aLayoutPropertyCache->iMarginTop, aLayoutPropertyCache->iMarginTops, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::MarginBottomL, + aNode, aPseudoClass, &CXnNode::MarginBottomL, aLayoutPropertyCache->iMarginBottom, aLayoutPropertyCache->iMarginBottoms, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderTopL, + aNode, aPseudoClass, &CXnNode::BorderTopL, aLayoutPropertyCache->iBorderTop, aLayoutPropertyCache->iBorderTops, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderBottomL, + aNode, aPseudoClass, &CXnNode::BorderBottomL, aLayoutPropertyCache->iBorderBottom, aLayoutPropertyCache->iBorderBottoms, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::PaddingTopL, + aNode, aPseudoClass, &CXnNode::PaddingTopL, aLayoutPropertyCache->iPaddingTop, aLayoutPropertyCache->iPaddingTops, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::PaddingBottomL, + aNode, aPseudoClass, &CXnNode::PaddingBottomL, aLayoutPropertyCache->iPaddingBottom, aLayoutPropertyCache->iPaddingBottoms, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderWidthL, + aNode, aPseudoClass, &CXnNode::BorderWidthL, aLayoutPropertyCache->iBorderWidth, aLayoutPropertyCache->iBorderWidths, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::BlockProgressionL, + aNode, aPseudoClass, &CXnNode::BlockProgressionL, aLayoutPropertyCache->iBlockProgression, aLayoutPropertyCache->iBlockProgressions, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::DirectionL, + aNode, aPseudoClass, &CXnNode::DirectionL, aLayoutPropertyCache->iDirection, aLayoutPropertyCache->iDirections, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::PositionL, + aNode, aPseudoClass, &CXnNode::PositionL, aLayoutPropertyCache->iPosition, aLayoutPropertyCache->iPositions, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::MaxHeightL, + aNode, aPseudoClass, &CXnNode::MaxHeightL, aLayoutPropertyCache->iMaxHeight, aLayoutPropertyCache->iMaxHeights, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::MinHeightL, + aNode, aPseudoClass, &CXnNode::MinHeightL, aLayoutPropertyCache->iMinHeight, aLayoutPropertyCache->iMinHeights, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::MaxWidthL, + aNode, aPseudoClass, &CXnNode::MaxWidthL, aLayoutPropertyCache->iMaxWidth, aLayoutPropertyCache->iMaxWidths, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::MinWidthL, + aNode, aPseudoClass, &CXnNode::MinWidthL, aLayoutPropertyCache->iMinWidth, aLayoutPropertyCache->iMinWidths, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::DisplayL, + aNode, aPseudoClass, &CXnNode::DisplayL, aLayoutPropertyCache->iDisplay, aLayoutPropertyCache->iDisplays, level, ETrue ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::VisibilityL, + aNode, aPseudoClass, &CXnNode::VisibilityL, aLayoutPropertyCache->iVisibility, aLayoutPropertyCache->iVisibilities, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::LeftL, + aNode, aPseudoClass, &CXnNode::LeftL, aLayoutPropertyCache->iLeft, aLayoutPropertyCache->iLefts, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::RightL, + aNode, aPseudoClass, &CXnNode::RightL, aLayoutPropertyCache->iRight, aLayoutPropertyCache->iRights, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::TopL, + aNode, aPseudoClass, &CXnNode::TopL, aLayoutPropertyCache->iTop, aLayoutPropertyCache->iTops, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::BottomL, + aNode, aPseudoClass, &CXnNode::BottomL, aLayoutPropertyCache->iBottom, aLayoutPropertyCache->iBottoms, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderLeftStyleL, + aNode, aPseudoClass, &CXnNode::BorderLeftStyleL, aLayoutPropertyCache->iBorderLeftStyle, aLayoutPropertyCache->iBorderLeftStyles, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderRightStyleL, + aNode, aPseudoClass, &CXnNode::BorderRightStyleL, aLayoutPropertyCache->iBorderRightStyle, aLayoutPropertyCache->iBorderRightStyles, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderTopStyleL, + aNode, aPseudoClass, &CXnNode::BorderTopStyleL, aLayoutPropertyCache->iBorderTopStyle, aLayoutPropertyCache->iBorderTopStyles, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderBottomStyleL, + aNode, aPseudoClass, &CXnNode::BorderBottomStyleL, aLayoutPropertyCache->iBorderBottomStyle, aLayoutPropertyCache->iBorderBottomStyles, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderStyleL, + aNode, aPseudoClass, &CXnNode::BorderStyleL, aLayoutPropertyCache->iBorderStyle, aLayoutPropertyCache->iBorderStyles, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::DisplayPriorityL, + aNode, aPseudoClass, &CXnNode::DisplayPriorityL, aLayoutPropertyCache->iDisplayPriority, aLayoutPropertyCache->iDisplayPriorities, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::NavIndexL, + aNode, aPseudoClass, &CXnNode::NavIndexL, aLayoutPropertyCache->iNavIndex, aLayoutPropertyCache->iNavIndexes, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::ZIndexL, + aNode, aPseudoClass, &CXnNode::ZIndexL, aLayoutPropertyCache->iZIndex, aLayoutPropertyCache->iZIndexes, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::BackgroundColorL, + aNode, aPseudoClass, &CXnNode::BackgroundColorL, aLayoutPropertyCache->iBackgroundColor, aLayoutPropertyCache->iBackgroundColors, level ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::BackgroundImageL, + aNode, aPseudoClass, &CXnNode::BackgroundImageL, aLayoutPropertyCache->iBackgroundImage, aLayoutPropertyCache->iBackgroundImages, level, ETrue ); EnableStatePropertyL( - aNode, aPseudoClass, CXnNode::FocusBackgroundL, + aNode, aPseudoClass, &CXnNode::FocusBackgroundL, aLayoutPropertyCache->iFocusBackground, aLayoutPropertyCache->iFocusBackgrounds, level ); @@ -1122,197 +1107,197 @@ TInt level( XnDirtyLevel::ENone ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::WidthL, + aNode, aPseudoClass, &CXnNode::WidthL, aLayoutPropertyCache->iWidth, aLayoutPropertyCache->iWidths, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::HeightL, + aNode, aPseudoClass, &CXnNode::HeightL, aLayoutPropertyCache->iHeight, aLayoutPropertyCache->iHeights, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::MarginLeftL, + aNode, aPseudoClass, &CXnNode::MarginLeftL, aLayoutPropertyCache->iMarginLeft, aLayoutPropertyCache->iMarginLefts, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::MarginRightL, + aNode, aPseudoClass, &CXnNode::MarginRightL, aLayoutPropertyCache->iMarginRight, aLayoutPropertyCache->iMarginRights, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderLeftL, + aNode, aPseudoClass, &CXnNode::BorderLeftL, aLayoutPropertyCache->iBorderLeft, aLayoutPropertyCache->iBorderLefts, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderRightL, + aNode, aPseudoClass, &CXnNode::BorderRightL, aLayoutPropertyCache->iBorderRight, aLayoutPropertyCache->iBorderRights, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::PaddingLeftL, + aNode, aPseudoClass, &CXnNode::PaddingLeftL, aLayoutPropertyCache->iPaddingLeft, aLayoutPropertyCache->iPaddingLefts, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::PaddingRightL, + aNode, aPseudoClass, &CXnNode::PaddingRightL, aLayoutPropertyCache->iPaddingRight, aLayoutPropertyCache->iPaddingRights, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::MarginTopL, + aNode, aPseudoClass, &CXnNode::MarginTopL, aLayoutPropertyCache->iMarginTop, aLayoutPropertyCache->iMarginTops, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::MarginBottomL, + aNode, aPseudoClass, &CXnNode::MarginBottomL, aLayoutPropertyCache->iMarginBottom, aLayoutPropertyCache->iMarginBottoms, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderTopL, + aNode, aPseudoClass, &CXnNode::BorderTopL, aLayoutPropertyCache->iBorderTop, aLayoutPropertyCache->iBorderTops, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderBottomL, + aNode, aPseudoClass, &CXnNode::BorderBottomL, aLayoutPropertyCache->iBorderBottom, aLayoutPropertyCache->iBorderBottoms, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::PaddingTopL, + aNode, aPseudoClass, &CXnNode::PaddingTopL, aLayoutPropertyCache->iPaddingTop, aLayoutPropertyCache->iPaddingTops, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::PaddingBottomL, + aNode, aPseudoClass, &CXnNode::PaddingBottomL, aLayoutPropertyCache->iPaddingBottom, aLayoutPropertyCache->iPaddingBottoms, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderWidthL, + aNode, aPseudoClass, &CXnNode::BorderWidthL, aLayoutPropertyCache->iBorderWidth, aLayoutPropertyCache->iBorderWidths, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::BlockProgressionL, + aNode, aPseudoClass, &CXnNode::BlockProgressionL, aLayoutPropertyCache->iBlockProgression, aLayoutPropertyCache->iBlockProgressions, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::DirectionL, + aNode, aPseudoClass, &CXnNode::DirectionL, aLayoutPropertyCache->iDirection, aLayoutPropertyCache->iDirections, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::PositionL, + aNode, aPseudoClass, &CXnNode::PositionL, aLayoutPropertyCache->iPosition, aLayoutPropertyCache->iPositions, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::MaxHeightL, + aNode, aPseudoClass, &CXnNode::MaxHeightL, aLayoutPropertyCache->iMaxHeight, aLayoutPropertyCache->iMaxHeights, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::MinHeightL, + aNode, aPseudoClass, &CXnNode::MinHeightL, aLayoutPropertyCache->iMinHeight, aLayoutPropertyCache->iMinHeights, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::MaxWidthL, + aNode, aPseudoClass, &CXnNode::MaxWidthL, aLayoutPropertyCache->iMaxWidth, aLayoutPropertyCache->iMaxWidths, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::MinWidthL, + aNode, aPseudoClass, &CXnNode::MinWidthL, aLayoutPropertyCache->iMinWidth, aLayoutPropertyCache->iMinWidths, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::DisplayL, + aNode, aPseudoClass, &CXnNode::DisplayL, aLayoutPropertyCache->iDisplay, aLayoutPropertyCache->iDisplays, aStates, level, ETrue ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::VisibilityL, + aNode, aPseudoClass, &CXnNode::VisibilityL, aLayoutPropertyCache->iVisibility, aLayoutPropertyCache->iVisibilities, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::LeftL, + aNode, aPseudoClass, &CXnNode::LeftL, aLayoutPropertyCache->iLeft, aLayoutPropertyCache->iLefts, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::RightL, + aNode, aPseudoClass, &CXnNode::RightL, aLayoutPropertyCache->iRight, aLayoutPropertyCache->iRights, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::TopL, + aNode, aPseudoClass, &CXnNode::TopL, aLayoutPropertyCache->iTop, aLayoutPropertyCache->iTops, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::BottomL, + aNode, aPseudoClass, &CXnNode::BottomL, aLayoutPropertyCache->iBottom, aLayoutPropertyCache->iBottoms, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderLeftStyleL, + aNode, aPseudoClass, &CXnNode::BorderLeftStyleL, aLayoutPropertyCache->iBorderLeftStyle, aLayoutPropertyCache->iBorderLeftStyles, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderRightStyleL, + aNode, aPseudoClass, &CXnNode::BorderRightStyleL, aLayoutPropertyCache->iBorderRightStyle, aLayoutPropertyCache->iBorderRightStyles, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderTopStyleL, + aNode, aPseudoClass, &CXnNode::BorderTopStyleL, aLayoutPropertyCache->iBorderTopStyle, aLayoutPropertyCache->iBorderTopStyles, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderBottomStyleL, + aNode, aPseudoClass, &CXnNode::BorderBottomStyleL, aLayoutPropertyCache->iBorderBottomStyle, aLayoutPropertyCache->iBorderBottomStyles, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::BorderStyleL, + aNode, aPseudoClass, &CXnNode::BorderStyleL, aLayoutPropertyCache->iBorderStyle, aLayoutPropertyCache->iBorderStyles, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::DisplayPriorityL, + aNode, aPseudoClass, &CXnNode::DisplayPriorityL, aLayoutPropertyCache->iDisplayPriority, aLayoutPropertyCache->iDisplayPriorities, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::NavIndexL, + aNode, aPseudoClass, &CXnNode::NavIndexL, aLayoutPropertyCache->iNavIndex, aLayoutPropertyCache->iNavIndexes, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::ZIndexL, + aNode, aPseudoClass, &CXnNode::ZIndexL, aLayoutPropertyCache->iZIndex, aLayoutPropertyCache->iZIndexes, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::BackgroundColorL, + aNode, aPseudoClass, &CXnNode::BackgroundColorL, aLayoutPropertyCache->iBackgroundColor, aLayoutPropertyCache->iBackgroundColors, aStates, level ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::BackgroundImageL, + aNode, aPseudoClass, &CXnNode::BackgroundImageL, aLayoutPropertyCache->iBackgroundImage, aLayoutPropertyCache->iBackgroundImages, aStates, level, ETrue ); DisableStatePropertyL( - aNode, aPseudoClass, CXnNode::FocusBackgroundL, + aNode, aPseudoClass, &CXnNode::FocusBackgroundL, aLayoutPropertyCache->iFocusBackground, aLayoutPropertyCache->iFocusBackgrounds, aStates, level ); @@ -1359,7 +1344,6 @@ static void SetCachedProperty( CXnProperty* aProperty, CLayoutPropertyCache*& aLayoutPropertyCache, - CXnProperty*& aRef, CXnProperty*& aName, CXnProperty*& aValue, CXnProperty*& aLabel, @@ -1368,7 +1352,6 @@ CXnProperty*& aId, CXnProperty*& aPath, CXnProperty*& aMaskPath, - CGridPropertyCache*& aGridPropertyCache, TBool aInitializing, TBool aArrayOnly) { @@ -1461,10 +1444,6 @@ { aMaskPath = aProperty; } - else if ( name == KRef ) - { - aRef = aProperty; - } else if ( name == XnPropertyNames::style::common::KMarginLeft ) { DoSetCachedProperty( @@ -1729,105 +1708,6 @@ aLayoutPropertyCache->iNavIndexes, aInitializing, aArrayOnly ); } - else if ( name == XnPropertyNames::grid::KS60VisibleRows ) - { - if ( !aGridPropertyCache ) - { - aGridPropertyCache = new CGridPropertyCache; - } - if ( aGridPropertyCache ) - { - aGridPropertyCache->iVisibleRows = aProperty; - } - } - else if ( name == XnPropertyNames::grid::KS60GridColumns ) - { - if ( !aGridPropertyCache ) - { - aGridPropertyCache = new CGridPropertyCache; - } - if ( aGridPropertyCache ) - { - aGridPropertyCache->iGridColumns = aProperty; - } - } - else if ( name == XnPropertyNames::grid::KS60GridOrientation ) - { - if ( !aGridPropertyCache ) - { - aGridPropertyCache = new CGridPropertyCache; - } - if ( aGridPropertyCache ) - { - aGridPropertyCache->iGridOrientation = aProperty; - } - } - else if ( name == XnPropertyNames::grid::KS60GridVerDirection ) - { - if ( !aGridPropertyCache ) - { - aGridPropertyCache = new CGridPropertyCache; - } - if ( aGridPropertyCache ) - { - aGridPropertyCache->iGridVerDirection = aProperty; - } - } - else if ( name == XnPropertyNames::grid::KS60GridHorDirection ) - { - if ( !aGridPropertyCache ) - { - aGridPropertyCache = new CGridPropertyCache; - } - if ( aGridPropertyCache ) - { - aGridPropertyCache->iGridHorDirection = aProperty; - } - } - else if ( name == XnPropertyNames::grid::KS60FocusHorLooping ) - { - if ( !aGridPropertyCache ) - { - aGridPropertyCache = new CGridPropertyCache; - } - if ( aGridPropertyCache ) - { - aGridPropertyCache->iFocusHorLooping = aProperty; - } - } - else if ( name == XnPropertyNames::grid::KS60FocusVerLooping ) - { - if ( !aGridPropertyCache ) - { - aGridPropertyCache = new CGridPropertyCache; - } - if ( aGridPropertyCache ) - { - aGridPropertyCache->iFocusVerLooping = aProperty; - } - } - else if ( name == XnPropertyNames::grid::KS60GridScrollbarWidth ) - { - if ( !aGridPropertyCache ) - { - aGridPropertyCache = new CGridPropertyCache; - } - if ( aGridPropertyCache ) - { - aGridPropertyCache->iGridScrollBarWidth = aProperty; - } - } - else if ( name == XnPropertyNames::grid::KS60GridScrollbarMargin ) - { - if ( !aGridPropertyCache ) - { - aGridPropertyCache = new CGridPropertyCache; - } - if ( aGridPropertyCache ) - { - aGridPropertyCache->iGridScrollBarMargin = aProperty; - } - } } // ----------------------------------------------------------------------------- @@ -2294,20 +2174,6 @@ } // ----------------------------------------------------------------------------- -// CheckRefAttributeL -// ----------------------------------------------------------------------------- -// -static const TDesC8* CheckRefAttributeL( CXnProperty* aRef ) - { - if ( !aRef ) - { - return NULL; - } - - return &aRef->StringValue(); - } - -// ----------------------------------------------------------------------------- // DoMatchTriggerForKeyEventL // ----------------------------------------------------------------------------- // @@ -2450,187 +2316,6 @@ } // ----------------------------------------------------------------------------- -// MatchTimedTriggerPropertiesL -// ----------------------------------------------------------------------------- -// -static TBool MatchTimedTriggerPropertiesL( CXnDomNode& aTriggerNode ) - { - CXnDomList& children = aTriggerNode.ChildNodes(); - TInt count = children.Length(); - if ( count > 0 ) - { - for ( TInt i = 0; i < count; ++i ) - { - CXnDomNode* child = static_cast< CXnDomNode* >( children.Item( i ) ); - const TDesC8& name = child->AttributeValue( XnPropertyNames::action::KName ); - if ( name == XnPropertyNames::action::trigger::KDelay ) - { - return ETrue; - } - } - } - return EFalse; - } - -// ----------------------------------------------------------------------------- -// MatchStylusTriggerL -// ----------------------------------------------------------------------------- -// -static TBool MatchStylusTriggerL( - CXnNode& aMatchingTriggerNode, - CXnDomNode& aTreeTriggerNode ) - { - TInt ret( EFalse ); - - CXnDomList& treeChildren = aTreeTriggerNode.ChildNodes(); - TInt treeCount = treeChildren.Length(); - - RPointerArray< CXnNode >& matchingChildren = aMatchingTriggerNode.Children(); - TInt matchCount = matchingChildren.Count(); - - if ( treeCount == 0 ) - { - // If stylus-trigger does not have properties, trigger is run with stylus up. - for ( TInt i = 0; i < matchCount; ++i ) - { - CXnNode* node = matchingChildren[i]; - CXnProperty* nameProperty = node->NameL(); - if ( nameProperty ) - { - const TDesC8& name = nameProperty->StringValue(); - if ( name == - XnPropertyNames::action::trigger::name::stylus::KStylusEventType ) - { - CXnProperty* valueProperty = node->ValueL(); - if ( valueProperty ) - { - const TDesC8& name = valueProperty->StringValue(); - if ( name == XnPropertyNames::action::trigger::name::KDownAndUp ) - { - return ETrue; - } - } - } - } - } - return EFalse; - } - - // Fetch trigger data defined in the theme - TInt treeTriggerState( 1 ); - HBufC8* treeTriggerType( NULL ); - for ( TInt i = 0; i < treeCount; ++i ) - { - CXnDomNode* domNode = static_cast< CXnDomNode* >( treeChildren.Item( i ) ); - CXnDomList& attrs = domNode->AttributeList(); - CXnDomAttribute* nameAttribute = static_cast< CXnDomAttribute* >( - attrs.FindByName( XnPropertyNames::action::KName ) ); - CXnDomAttribute* valueAttribute = static_cast< CXnDomAttribute* >( - attrs.FindByName( XnPropertyNames::action::KValue ) ); - if ( !nameAttribute || !valueAttribute ) - { - continue; - } - if ( nameAttribute->Value() == - XnPropertyNames::action::trigger::name::stylus::KStylusState ) - { - TLex8 lex( valueAttribute->Value() ); - lex.Val( treeTriggerState ); - } - else if ( nameAttribute->Value() == - XnPropertyNames::action::trigger::name::stylus::KStylusEventType ) - { - // just in case - if ( treeTriggerType ) - { - CleanupStack::PopAndDestroy( treeTriggerType ); - treeTriggerType = NULL; - } - const TDesC8& value = valueAttribute->Value(); - treeTriggerType = HBufC8::NewL( value.Length() ); - TPtr8 ptr = treeTriggerType->Des(); - ptr = value; - CleanupStack::PushL( treeTriggerType ); - } - } - - // If not defined, use the default value 'up' - if ( !treeTriggerType ) - { - treeTriggerType = HBufC8::NewL( 10 ); - TPtr8 ptr = treeTriggerType->Des(); - ptr.Append( XnPropertyNames::action::trigger::name::KDownAndUp ); - CleanupStack::PushL( treeTriggerType ); - } - - // Fetch matching trigger data. - TInt matchTriggerState( 1 ); - HBufC8* matchTriggerType( NULL ); - for ( TInt i = 0; i < matchCount; ++i ) - { - CXnNode* matchNode = matchingChildren[i]; - CXnProperty* nameProperty = matchNode->NameL(); - CXnProperty* valueProperty = matchNode->ValueL(); - if ( nameProperty && valueProperty ) - { - if ( nameProperty->StringValue() == - XnPropertyNames::action::trigger::name::stylus::KStylusState ) - { - TLex8 lex( valueProperty->StringValue() ); - lex.Val( matchTriggerState ); - } - else if ( nameProperty->StringValue() == - XnPropertyNames::action::trigger::name::stylus::KStylusEventType ) - { - // just in case - if ( matchTriggerType ) - { - CleanupStack::PopAndDestroy( matchTriggerType ); - matchTriggerType = NULL; - } - const TDesC8& value = valueProperty->StringValue(); - matchTriggerType = HBufC8::NewL( value.Length() ); - TPtr8 ptr = matchTriggerType->Des(); - ptr = value; - CleanupStack::PushL( matchTriggerType ); - } - } - } - - if ( treeTriggerState == matchTriggerState ) - { - // just in case - if ( !matchTriggerType ) - { - ret = EFalse; - } - else if ( treeTriggerType->Des() == matchTriggerType->Des() ) - { - ret = ETrue; - } - // still, if trigger type is 'KUp' it should match to 'KDownAndUp' event - else if ( treeTriggerType->Des() == - XnPropertyNames::action::trigger::name::KUp ) - { - if ( matchTriggerType->Des() == - XnPropertyNames::action::trigger::name::KDownAndUp ) - { - ret = ETrue; - } - } - } - if ( matchTriggerType ) - { - CleanupStack::PopAndDestroy( matchTriggerType ); - } - if ( treeTriggerType ) - { - CleanupStack::PopAndDestroy( treeTriggerType ); - } - return ret; - } - -// ----------------------------------------------------------------------------- // MatchActivateTriggerPropertiesL // Checks if triggered node properties match // ones defined in theme @@ -2728,7 +2413,7 @@ CXnDomList& attributeList( aTriggerNode.AttributeList() ); const TDesC8& reason( - XnPropertyNames::action::trigger::name::uidefinitionmodification::KReason ); + XnPropertyNames::action::trigger::name::orientation::KReason ); CXnDomAttribute* attribute( static_cast< CXnDomAttribute* > ( attributeList.FindByName( reason ) ) ); @@ -2742,9 +2427,9 @@ const TDesC8& value( attribute->Value() ); if ( value == - XnPropertyNames::action::trigger::name::uidefinitionmodification::reason::KLandscape || + XnPropertyNames::action::trigger::name::orientation::reason::KLandscape || value == - XnPropertyNames::action::trigger::name::uidefinitionmodification::reason::KPortrait ) + XnPropertyNames::action::trigger::name::orientation::reason::KPortrait ) { CXnProperty* reasonProp( aEventData.GetPropertyL( reason ) ); @@ -2893,7 +2578,7 @@ CXnNode& aEventData, CXnDomNode& aActionNode, CXnDomNode& aTriggerNode, - TInt aSource ) + TInt /*aSource*/ ) { const TDesC8& nameString( aTriggerNode.AttributeValue( KName ) ); @@ -2907,61 +2592,15 @@ if ( nameString == eventNameString ) { - if ( nameString == XnPropertyNames::action::trigger::name::KStylus ) - { - if ( !MatchStylusTriggerL( aEventData, aTriggerNode ) ) - { - return EFalse; - } - } // Check if triggernode properties match the ones defined in theme // This is for identifying keyup in activate-trigger - else if ( nameString == XnPropertyNames::action::trigger::name::KActivate ) + if ( nameString == XnPropertyNames::action::trigger::name::KActivate ) { if ( !MatchActivateTriggerPropertiesL( aEventData, aTriggerNode ) ) { return EFalse; } } - // Check if the trigger is timed trigger - else if ( MatchTimedTriggerPropertiesL( aTriggerNode ) ) - { - if ( !aThis->PeriodicTimer() ) - { - aThis->CreatePeriodicL(); - } - - if ( !aThis->PeriodicTimer()->IsActive() ) - { - TXnTimedTrigger* params = new ( ELeave ) TXnTimedTrigger; - CleanupStack::PushL( params ); - - params->iNodeImpl = aThis; - params->iEngine = &aEngine; - params->iNode = &aNode; - params->iEventData = &aEventData; - params->iActionNode = &aActionNode; - params->iTriggerNode = &aTriggerNode; - - TInt delay( 0 ); - - ResolveTriggerDelayL( aEngine, aTriggerNode, delay ); - aNode.SetTriggerDelay( delay ); - - CleanupStack::Pop( params ); - - aThis->PeriodicTimer()->Start( - TTimeIntervalMicroSeconds32( delay ), - TTimeIntervalMicroSeconds32( delay ), - TCallBack( CXnNodeImpl::PeriodicEventL, params ) ); - - return ETrue; - } - else - { - return EFalse; - } - } else if ( nameString == XnPropertyNames::action::trigger::name::KTitleToScroll || nameString == XnPropertyNames::action::trigger::name::KTitleScrolled ) { @@ -2994,27 +2633,6 @@ return EFalse; } } - else if ( aSource != XnEventSource::EUnknown ) - { - CXnDomAttribute* attr = static_cast< CXnDomAttribute* > - ( aTriggerNode.AttributeList().FindByName( - XnPropertyNames::common::KEventFilter ) ); - if ( attr ) - { - if ( attr->Value().Find(XnPropertyNames::action::trigger::name::KStylus) - != KErrNotFound && - aSource == XnEventSource::EStylus ) - { - return EFalse; - } - else if ( attr->Value().Find(XnPropertyNames::action::trigger::name::KKeyEvent) - != KErrNotFound && - aSource == XnEventSource::EKey ) - { - return EFalse; - } - } - } RunEventsL( aThis, aEngine, aNode, aActionNode, aTriggerNode, aEventData ); @@ -3104,7 +2722,7 @@ else if ( aString == XnPropertyNames::action::event::KSetActiveFocus ) { CXnNode* previousNode = aEngine.FocusedNode(); - if ( previousNode != node ) + if ( previousNode && previousNode != node ) { if ( IsNodeNavigableL( *node ) ) { @@ -3138,71 +2756,16 @@ } // ----------------------------------------------------------------------------- -// RunAppExit -// ----------------------------------------------------------------------------- -// -static void RunAppExit( CXnUiEngine& aEngine ) - { - CXnAppUiAdapter& adapter( aEngine.AppUiAdapter() ); - - adapter.Exit(); - } - -// ----------------------------------------------------------------------------- // RunFullScreenEffectL // ----------------------------------------------------------------------------- // static void RunFullScreenEffectL( CXnUiEngine& aEngine, CXnDomNode& aEventNode ) { - CXnDomList& list( aEventNode.AttributeList() ); - const TDesC8& effectid( XnPropertyNames::common::KEffectId ); - CXnDomAttribute* attribute( static_cast< CXnDomAttribute* > - ( list.FindByName( effectid ) ) ); - - if ( attribute ) - { - - const TDesC8& value( attribute->Value() ); - TLex8 lex( value ); - TInt effect; - lex.Val( effect ); - + TInt effectId = ResolveEffectId( aEventNode ); + if( effectId ) + { aEngine.AppUiAdapter().EffectManager()->BeginFullscreenEffectL( - effect, aEngine.ViewManager()->ActiveViewData() ); - - } - } - -// ----------------------------------------------------------------------------- -// RunActivateViewL -// ----------------------------------------------------------------------------- -// -static void RunActivateViewL( - CXnNodeImpl* aThis, - CXnUiEngine& aEngine, - CXnDomNode& aEventNode ) - { - CXnDomList& children( aEventNode.ChildNodes() ); - - TInt count( children.Length() ); - - for ( TInt i = 0; i < count; ++i ) - { - CXnDomNode* node = static_cast< CXnDomNode* >( children.Item( i ) ); - - const TDesC8& type( node->Name() ); - - if ( type == XnPropertyNames::action::KProperty ) - { - const TDesC8& id( node->AttributeValue( XnPropertyNames::action::KValue ) ); - - CXnNode* viewNode( aEngine.FindNodeByIdL( id, aThis->Namespace() ) ); - - if ( viewNode ) - { - aEngine.ActivateViewL( *viewNode ); - } - } + effectId, aEngine.ViewManager()->ActiveViewData() ); } } @@ -3210,36 +2773,40 @@ // RunActivateNextViewL // ----------------------------------------------------------------------------- // -static void RunActivateNextViewL( CXnUiEngine& aEngine ) - { - aEngine.ViewManager()->ActivateNextViewL(); +static void RunActivateNextViewL( CXnUiEngine& aEngine, CXnDomNode& aEventNode ) + { + TInt effectid = ResolveEffectId( aEventNode ); + aEngine.ViewManager()->ActivateNextViewL( /*effectid*/ ); } // ----------------------------------------------------------------------------- // RunActivatePreviousViewL // ----------------------------------------------------------------------------- // -static void RunActivatePreviousViewL( CXnUiEngine& aEngine ) - { - aEngine.ViewManager()->ActivatePreviousViewL(); +static void RunActivatePreviousViewL( CXnUiEngine& aEngine, CXnDomNode& aEventNode ) + { + TInt effectid = ResolveEffectId( aEventNode ); + aEngine.ViewManager()->ActivatePreviousViewL( /*effectid*/ ); } // ----------------------------------------------------------------------------- // RunAddViewL // ----------------------------------------------------------------------------- // -static void RunAddViewL( CXnUiEngine& aEngine ) - { - aEngine.ViewManager()->AddViewL(); +static void RunAddViewL( CXnUiEngine& aEngine, CXnDomNode& aEventNode ) + { + TInt effectid = ResolveEffectId( aEventNode ); + aEngine.ViewManager()->AddViewL( effectid ); } // ----------------------------------------------------------------------------- // RunRemoveViewL // ----------------------------------------------------------------------------- // -static void RunRemoveViewL( CXnUiEngine& aEngine ) - { - aEngine.ViewManager()->RemoveViewL(); +static void RunRemoveViewL( CXnUiEngine& aEngine, CXnDomNode& aEventNode ) + { + TInt effectid = ResolveEffectId( aEventNode ); + aEngine.ViewManager()->RemoveViewL( effectid ); } // ----------------------------------------------------------------------------- @@ -3278,6 +2845,60 @@ } // ----------------------------------------------------------------------------- +// RunActivateEditorL +// ----------------------------------------------------------------------------- +// +static void RunActivateEditorL( + CXnNodeImpl* aThis, + CXnNode& aLayoutNode, + CXnUiEngine& aEngine, + CXnDomNode& aEventNode, + TBool aActivate ) + { + CXnNode* editorNode( NULL ); + CXnDomList& children = aEventNode.ChildNodes(); + TInt count = children.Length(); + for ( TInt i = 0; i < count; ++i ) + { + CXnDomNode* dnode = static_cast< CXnDomNode* >( children.Item( i ) ); + const TDesC8& type = dnode->Name(); + if ( type == XnPropertyNames::action::KProperty ) + { + const TDesC8& id = dnode->AttributeValue( KId ); + CXnNode* node = aEngine.FindNodeByIdL( id, aThis->Namespace() ); + if( node && node->Type()->Type() == KTextEditor ) + { + editorNode = node; + break; + } + } + } + + if( !editorNode && aLayoutNode.Type()->Type() == KTextEditor ) + { + editorNode = &aLayoutNode; + } + + if( editorNode ) + { + XnTextEditorInterface::MXnTextEditorInterface* editorControl = NULL; + + XnComponentInterface::MakeInterfaceL( editorControl, editorNode->AppIfL() ); + if( editorControl ) + { + if( aActivate ) + { + editorControl->HandleEditorEvent(CXnTextEditor::KActivateTextEditor); + } + else + { + editorControl->HandleEditorEvent(CXnTextEditor::KDeactivateTextEditor); + } + } + } + } + +// ----------------------------------------------------------------------------- // RunEditL // ----------------------------------------------------------------------------- // @@ -3285,14 +2906,33 @@ CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnDomNode& aEventNode ) - { - TBool keyEditMode(EFalse); - + { aEngine.DisableRenderUiLC(); // Set plugins to edit state - RPointerArray< CXnPluginData>& plugins( - aEngine.ViewManager()->ActiveViewData().PluginData() ); + RPointerArray< CXnPluginData >& views( + aEngine.ViewManager()->ActiveAppData().PluginData() ); + + CXnViewData* view( NULL ); + + for ( TInt i = 0; i < views.Count(); i++ ) + { + view = static_cast< CXnViewData* >( views[i] ); + + CXnPluginData* plugin( view->Plugin( aThis->Node() ) ); + + if ( plugin && plugin == view ) + { + break; + } + } + + if ( !view ) + { + return; + } + + RPointerArray< CXnPluginData >& plugins( view->PluginData() ); CXnDomStringPool* sp( aEventNode.StringPool() ); @@ -3327,7 +2967,7 @@ // Find nodes by class else if ( name == XnPropertyNames::common::KClass ) { - CXnPointerArray* array = aEngine.FindNodeByClassL( value ); + CXnPointerArray* array = aEngine.FindNodeByClassL( value, aThis->Namespace() ); CleanupStack::PushL( array ); if ( array ) @@ -3352,71 +2992,33 @@ CleanupStack::PopAndDestroy( array ); } - else if ( name == XnPropertyNames::common::KKeyMoveMode ) - { - if ( value == XnPropertyNames::KTrue ) - { - keyEditMode = ETrue; - } - } - } - } - } - if ( keyEditMode ) - { - for ( TInt i = 0; i < plugins.Count(); i++ ) - { - if ( plugins[i]->Occupied() ) - { - CXnNode* node( plugins[i]->Owner()->LayoutNode() ); - - node->SetStateL( XnPropertyNames::style::common::KEdit ); - } - } - - aEngine.EditMode()->SetEditModeL( CXnEditMode::EKeyMove ); - - // Put focus to parent plugin if focused node is not a plugin already - CXnNode* focusedNode = aEngine.FocusedNode(); + } + } + } + + TBool useEmpty( view->UseEmptyWidget() ); + + for ( TInt i = 0; i < plugins.Count(); i++ ) + { + CXnNode* node( plugins[i]->Owner()->LayoutNode() ); - if ( focusedNode && focusedNode->DomNode()->Name() != _L8( "plugin" ) ) - { - for ( CXnNode* candidate = - focusedNode; candidate; candidate = candidate->Parent() ) - { - if ( candidate->DomNode()->Name() == _L8( "plugin" ) ) - { - candidate->SetStateL( XnPropertyNames::style::common::KFocus ); - break; - } - } - } - } - else - { - TBool useEmpty( aEngine.ViewManager()->ActiveViewData().UseEmptyWidget() ); - - for ( TInt i = 0; i < plugins.Count(); i++ ) - { - CXnNode* node( plugins[i]->Owner()->LayoutNode() ); - - node->SetStateL( XnPropertyNames::style::common::KEdit ); - - if ( !plugins[i]->Occupied() && useEmpty ) - { - // Make empty space visible - SetStringPropertyToNodeL( *sp, *node, - XnPropertyNames::style::common::KVisibility, - XnPropertyNames::style::common::visibility::KVisible ); - } - } - - aEngine.EditMode()->SetEditModeL( CXnEditMode::EDragAndDrop ); - } + node->SetStateL( XnPropertyNames::style::common::KEdit ); + + if ( !plugins[i]->Occupied() && useEmpty ) + { + // Make empty space visible + SetStringPropertyToNodeL( *sp, *node, + XnPropertyNames::style::common::KVisibility, + XnPropertyNames::style::common::visibility::KVisible ); + } + } + + aEngine.EditMode()->SetEditModeL( CXnEditMode::EDragAndDrop ); + aEngine.AppUiAdapter().ViewAdapter().CloseAllPopupsL(); CleanupStack::PopAndDestroy(); - aEngine.AppUiAdapter().ViewAdapter().UpdateRskByModeL(); + aEngine.AppUiAdapter().ViewAdapter().UpdateRskByUiStateL( *view ); } // ----------------------------------------------------------------------------- @@ -3427,9 +3029,29 @@ CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnDomNode& aEventNode ) - { - TBool keyEditMode( - aEngine.EditMode()->EditState() == CXnEditMode::EKeyMove ); + { + // Set plugins to edit state + RPointerArray< CXnPluginData >& views( + aEngine.ViewManager()->ActiveAppData().PluginData() ); + + CXnViewData* view( NULL ); + + for ( TInt i = 0; i < views.Count(); i++ ) + { + view = static_cast< CXnViewData* >( views[i] ); + + CXnPluginData* plugin( view->Plugin( aThis->Node() ) ); + + if ( plugin && plugin == view ) + { + break; + } + } + + if ( !view ) + { + return; + } CXnDomList& children( aEventNode.ChildNodes() ); @@ -3461,7 +3083,7 @@ } else if ( name == XnPropertyNames::common::KClass ) { - CXnPointerArray* array( aEngine.FindNodeByClassL( value ) ); + CXnPointerArray* array( aEngine.FindNodeByClassL( value, aThis->Namespace() ) ); CleanupStack::PushL( array ); const TInt count = array->Container().Count(); @@ -3483,47 +3105,31 @@ } } } - - RPointerArray< CXnPluginData>& plugins( - aEngine.ViewManager()->ActiveViewData().PluginData() ); - + + RPointerArray< CXnPluginData>& plugins( view->PluginData() ); + CXnDomStringPool* sp( aEventNode.StringPool() ); - if ( keyEditMode ) - { - for ( TInt i = 0; i < plugins.Count(); i++ ) - { - if ( plugins[i]->Occupied() ) - { - CXnNode* node( plugins[i]->Owner()->LayoutNode() ); - - node->UnsetStateL( XnPropertyNames::style::common::KEdit ); - } - } - } - else - { - TBool useEmpty( aEngine.ViewManager()->ActiveViewData().UseEmptyWidget() ); + TBool useEmpty( view->UseEmptyWidget() ); + + for ( TInt i = 0; i < plugins.Count(); i++ ) + { + CXnNode* node( plugins[i]->Owner()->LayoutNode() ); + + node->UnsetStateL( XnPropertyNames::style::common::KEdit ); - for ( TInt i = 0; i < plugins.Count(); i++ ) - { - CXnNode* node( plugins[i]->Owner()->LayoutNode() ); - - node->UnsetStateL( XnPropertyNames::style::common::KEdit ); - - if ( !plugins[i]->Occupied() && useEmpty ) - { - // Make empty space blank - SetStringPropertyToNodeL( *sp, *node, - XnPropertyNames::style::common::KVisibility, - XnPropertyNames::style::common::visibility::KBlank ); - } - } - } + if ( !plugins[i]->Occupied() && useEmpty ) + { + // Make empty space blank + SetStringPropertyToNodeL( *sp, *node, + XnPropertyNames::style::common::KVisibility, + XnPropertyNames::style::common::visibility::KBlank ); + } + } - aEngine.EditMode()->SetEditModeL( CXnEditMode::ENone ); - - aEngine.AppUiAdapter().ViewAdapter().UpdateRskByModeL(); + aEngine.EditMode()->SetEditModeL( CXnEditMode::ENone ); + + aEngine.AppUiAdapter().ViewAdapter().UpdateRskByUiStateL( *view ); } // ----------------------------------------------------------------------------- @@ -3762,28 +3368,6 @@ } // ----------------------------------------------------------------------------- -// RunResetStylusCounterL -// ----------------------------------------------------------------------------- -// -static void RunResetStylusCounterL( - CXnNodeImpl* aThis, - CXnUiEngine& aEngine, - const TDesC8& aId ) - { - CXnNode* node( aEngine.FindNodeByIdL( aId, aThis->Namespace() ) ); - - if ( node ) - { - CXnControlAdapter* adapter( node->Control() ); - - if ( adapter ) - { - adapter->ResetStylusCounter(); - } - } - } - -// ----------------------------------------------------------------------------- // GetSystemSetDataL // ----------------------------------------------------------------------------- // @@ -3871,6 +3455,37 @@ { *aClassId = &value; } + else + { + // Everyting is within the same property tag + // e.g. + + // Save name... + *aName = &name; + + // ...and value + if ( aValues ) + { + HBufC8* valueH = HBufC8::NewLC( value.Length() + KUnitMaxLen ); + TPtr8 ptr( valueH->Des() ); + ptr.Append( value ); + aValues->AppendL( valueH ); //take ownership + CleanupStack::Pop( valueH ); + } + + // ...and type + const TDesC8& type = node->AttributeValue( + XnPropertyNames::action::event::systemset::KType ); + *aType = &type; + + // ...and id + const TDesC8& id = node->AttributeValue( + XnPropertyNames::action::event::systemset::KId ); + HBufC8* utfName = HBufC8::NewL( id.Length() ); + TPtr8 ptr = utfName->Des(); + ptr = id; + aId = utfName; + } } } } @@ -3909,7 +3524,8 @@ if ( menuIf ) { - menuIf->TryDisplayingMenuBarL( *menuId ); + aEngine.Editor()->SetTargetPlugin( aEngine.FocusedNode() ); + menuIf->TryDisplayingMenuBarL( *menuId, EFalse ); } CleanupStack::PopAndDestroy( menuId ); @@ -4054,11 +3670,11 @@ for( TInt i = 0; i < pluginNodes.Count(); i++ ) { - CXnPluginData& data( viewData.Plugin( pluginNodes[i] ) ); + CXnPluginData* data( viewData.Plugin( pluginNodes[i] ) ); - if( data.Occupied() ) - { - plugins.AppendL( &data ); + if( data && data->Occupied() ) + { + plugins.AppendL( data ); } } @@ -4158,7 +3774,7 @@ } else if ( name && classId && type ) { - CXnPointerArray* array = aEngine.FindNodeByClassL( *classId ); + CXnPointerArray* array = aEngine.FindNodeByClassL( *classId, aThis->Namespace() ); CleanupStack::PushL( array ); const TInt count = array->Container().Count(); @@ -4201,35 +3817,6 @@ } // ----------------------------------------------------------------------------- -// ResolveTriggerDelayL -// ----------------------------------------------------------------------------- -// -static void ResolveTriggerDelayL( - CXnUiEngine& /*aEngine*/, - CXnDomNode& aNode, - TInt& aDelay ) - { - CXnDomList& children = aNode.ChildNodes(); - for ( TInt i = 0; i < children.Length(); i++ ) - { - CXnDomNode* child = static_cast< CXnDomNode* >( children.Item( i ) ); - const TDesC8& name = child->AttributeValue( XnPropertyNames::action::KName ); - if ( name == XnPropertyNames::action::trigger::KDelay ) - { - const TDesC8& value = child->AttributeValue( XnPropertyNames::action::KValue ); - if ( value != KNullDesC8 ) - { - TInt triggerDelay( 0 ); - TLex8 lex; - lex.Assign( value ); - lex.Val( triggerDelay ); - aDelay = triggerDelay; - } - } - } - } - -// ----------------------------------------------------------------------------- // RunEventL // ----------------------------------------------------------------------------- // @@ -4301,19 +3888,6 @@ RunResetEditL( aThis, aEngine, aEventNode ); return ETrue; } - else if ( nameString == XnPropertyNames::action::event::KResetStylusCounter ) - { - HBufC8* id( NULL ); - - GetSystemSetDataL( aEventNode, id ); - CleanupStack::PushL( id ); - - RunResetStylusCounterL( aThis, aEngine, *id ); - - CleanupStack::PopAndDestroy( id ); - - return EFalse; - } else if ( nameString == XnPropertyNames::action::event::KRunAddWidgetQuery ) { aEngine.Editor()->AddWidgetL(); @@ -4322,34 +3896,21 @@ { aEngine.Editor()->RemoveWidgetL( aEngine.FocusedNode() ); } - else if ( nameString == XnPropertyNames::action::event::KRunFullScreenEffect ) - { - TInt viewCount( aEngine.ViewManager()->ViewAmount() ); - - if ( viewCount > KOneView ) - { - RunFullScreenEffectL( aEngine, aEventNode ); - } - } else if ( nameString == XnPropertyNames::action::event::KActivateNextView ) { - RunActivateNextViewL( aEngine ); + RunActivateNextViewL( aEngine, aEventNode ); } else if ( nameString == XnPropertyNames::action::event::KActivatePreviousView ) { - RunActivatePreviousViewL( aEngine ); + RunActivatePreviousViewL( aEngine, aEventNode ); } else if ( nameString == XnPropertyNames::action::event::KAddView ) { - RunAddViewL( aEngine ); + RunAddViewL( aEngine, aEventNode ); } else if ( nameString == XnPropertyNames::action::event::KRemoveView ) { - RunRemoveViewL( aEngine ); - } - else if ( nameString == XnPropertyNames::action::event::KActivateView ) - { - RunActivateViewL( aThis, aEngine, aEventNode ); + RunRemoveViewL( aEngine, aEventNode ); } else if ( nameString == XnPropertyNames::action::event::KActivate ) { @@ -4373,10 +3934,6 @@ RunDeactivateL( aThis, aEngine, aEventNode ); return ETrue; } - else if ( nameString == XnPropertyNames::action::event::KExit ) - { - RunAppExit( aEngine ); - } else if ( nameString == XnPropertyNames::action::event::KTryDisplayingMenu ) { RunTryDisplayingMenuL( aEngine, aEventNode ); @@ -4408,6 +3965,8 @@ else if ( nameString == XnPropertyNames::action::event::KReportEnterEditMode ) { + RunFullScreenEffectL( aEngine, aEventNode ); + CXnNode* trigger( BuildTriggerNodeL( aEngine, XnPropertyNames::action::trigger::name::KEditMode ) ); CleanupStack::PushL( trigger ); @@ -4431,6 +3990,8 @@ } else if( nameString == XnPropertyNames::action::event::KReportExitEditMode ) { + RunFullScreenEffectL( aEngine, aEventNode ); + CXnNode* trigger( BuildTriggerNodeL( aEngine, XnPropertyNames::action::trigger::name::KEditMode ) ); CleanupStack::PushL( trigger ); @@ -4452,35 +4013,21 @@ return ETrue; } - else if ( nameString == XnPropertyNames::action::event::KRestartTriggerTimer ) - { - TInt delay( 0 ); - - ResolveTriggerDelayL( aEngine, aEventNode, delay ); - - if ( delay > 0 ) - { - aNode.RestartTimedTrigger( delay ); - } - else - { - TTimeIntervalMicroSeconds32 delayms = aNode.TriggerDelay(); - aNode.RestartTimedTrigger( delayms.Int() ); - } - - return ETrue; - } - else if ( nameString == XnPropertyNames::action::event::KCancelTriggerTimer ) - { - aNode.RestartTimedTrigger(); - return ETrue; - } else if ( nameString == XnPropertyNames::action::event::KSetWallpaper ) { aEngine.AppUiAdapter().ViewAdapter().BgManager().SetWallpaperL(); return ETrue; } - + else if ( nameString == XnPropertyNames::action::event::KActivateTextEditor) + { + RunActivateEditorL( aThis, aNode, aEngine, aEventNode, ETrue ); + return ETrue; + } + else if ( nameString == XnPropertyNames::action::event::KDeactivateTextEditor) + { + RunActivateEditorL( aThis, aNode, aEngine, aEventNode, EFalse ); + return ETrue; + } return EFalse; } @@ -4810,7 +4357,7 @@ { const TDesC8& loopValue = navLoopProperty->StringValue(); if ( loopValue != KNullDesC8 && - loopValue == XnPropertyNames::grid::s60_focus_looping::KStop ) + loopValue == XnPropertyNames::style::common::s60_focus_looping::KStop ) { return NULL; } @@ -5302,12 +4849,6 @@ // find node below or above to the right if ( !nextNode ) { - if ( !stayInNamespace && aEngine && - aEngine->ViewManager()->ViewAmount() != KOneView ) - { - aEngine->ViewManager()->ActivateNextViewL(); - return nextNode; - } CXnNode* candidateAbove = NULL; CXnNode* candidateBelow = NULL; @@ -5428,6 +4969,13 @@ // loop to the right if ( !nextNode ) { + if ( !stayInNamespace && aEngine && + aEngine->ViewManager()->ViewAmount() != KOneView ) + { + aEngine->ViewManager()->ActivateNextViewL(); + return nextNode; + } + CXnNode* candidateAbove = NULL; CXnNode* candidateBelow = NULL; @@ -5731,12 +5279,6 @@ if ( !nextNode ) { - if ( !stayInNamespace && aEngine && - aEngine->ViewManager()->ViewAmount() != KOneView ) - { - aEngine->ViewManager()->ActivatePreviousViewL(); - return nextNode; - } CXnNode* candidateAbove = NULL; CXnNode* candidateBelow = NULL; @@ -5860,6 +5402,13 @@ // loop to the left if ( !nextNode ) { + if ( !stayInNamespace && aEngine && + aEngine->ViewManager()->ViewAmount() != KOneView ) + { + aEngine->ViewManager()->ActivatePreviousViewL(); + return nextNode; + } + CXnNode* candidateAbove = NULL; CXnNode* candidateBelow = NULL; @@ -6396,8 +5945,6 @@ // static CXnNode* FindPluginNode( CXnNode& aNode ) { - _LIT8( KPlugin, "plugin" ); - CXnNode* pluginNode = NULL; CXnNode* tmp = &aNode; @@ -6451,13 +5998,12 @@ { CXnAppUiAdapter& appui = static_cast< CXnAppUiAdapter& >( *iAvkonAppUi ); - CXnPluginData& plugin( + CXnPluginData* plugin( appui.ViewManager().ActiveViewData().Plugin( &aNode ) ); - // find if node is in a widget that contatins some opened popup window - - TBool containsPopUp = plugin.IsDisplayingPopup(); - + // find if node is in a widget that contatins some opened popup window + TBool containsPopUp = ( plugin ? plugin->IsDisplayingPopup() : EFalse ); + CXnNode* nextNode( NULL ); RPointerArray< CXnNode >& array = aEngine.ViewManager()->AppearanceNodes(); if ( aKeyEvent.iScanCode == EStdKeyDownArrow ) @@ -6478,6 +6024,19 @@ } if ( nextNode ) { + // focus plugin node if in edit mode + if( aEngine.IsEditMode() ) + { + if( nextNode->Type()->Type() != KPlugin ) + { + CXnNode* pluginNode = FindPluginNode( *nextNode ); + if( pluginNode ) + { + nextNode = pluginNode; + } + } + } + if( nextNode && nextNode->ScrollableControl() ) { nextNode->ScrollableControl()->ShowItem( *nextNode ); @@ -6976,7 +6535,7 @@ if ( navLoopProperty ) { const TDesC8& loopValue = navLoopProperty->StringValue(); - if ( loopValue == XnPropertyNames::grid::s60_focus_looping::KStop ) + if ( loopValue == XnPropertyNames::style::common::s60_focus_looping::KStop ) { return EFalse; } @@ -7295,9 +6854,7 @@ iPropertyPseudoClasses.Reset(); iStates.Reset(); iChildren.ResetAndDestroy(); - delete iGridPropertyCache; delete iLayoutPropertyCache; - DeletePeriodic(); } // ----------------------------------------------------------------------------- @@ -7496,17 +7053,6 @@ // const TDesC8& CXnNodeImpl::GetPCData() { - if ( iRef ) - { - CXnNode* refNode( NULL ); - TRAP_IGNORE( refNode = RefNodeL( this, iRef, iUiEngine ) ); - - if ( refNode ) - { - return refNode->GetPCData(); - } - } - return iDomNode->PCData(); } @@ -7525,7 +7071,7 @@ // Searchs and shoes tooltips // ----------------------------------------------------------------------------- // -void CXnNodeImpl::ShowPopupsL( TRect aRect, TInt /*aSource*/ ) +void CXnNodeImpl::ShowPopupsL( TRect aRect, TInt aSource ) { if ( iHandleTooltip ) { @@ -7540,7 +7086,7 @@ XnComponentInterface::MakeInterfaceL( popup, tooltipNode ); - if ( popup ) + if ( popup && aSource != XnEventSource::EStylus ) { popup->ShowPopupL( aRect ); } @@ -7753,15 +7299,6 @@ { TInt level( XnDirtyLevel::ENone ); - const TDesC8* refid( CheckRefAttributeL( iRef ) ); - - if ( refid && aProperty->Property()->Name() != XnPropertyNames::common::KId ) - { - delete aProperty; - - return level; - } - const TDesC8& name( aProperty->Property()->Name() ); CXnProperty* prop( GetPropertyL( name ) ); @@ -7790,7 +7327,6 @@ SetCachedProperty( aProperty, iLayoutPropertyCache, - iRef, iName, iValue, iLabel, @@ -7799,7 +7335,6 @@ iId, iPath, iMaskPath, - iGridPropertyCache, EFalse, EFalse ); } @@ -7809,7 +7344,6 @@ SetCachedProperty( aProperty, iLayoutPropertyCache, - iRef, iName, iValue, iLabel, @@ -7818,7 +7352,6 @@ iId, iPath, iMaskPath, - iGridPropertyCache, EFalse, EFalse ); } @@ -7878,15 +7411,6 @@ // void CXnNodeImpl::InitializePropertyL( CXnProperty* aProperty ) { - const TDesC8* refid( CheckRefAttributeL( iRef ) ); - - if ( refid && aProperty->Property()->Name() != XnPropertyNames::common::KId ) - { - delete aProperty; - - return; - } - if ( aProperty->Property()->PseudoClass() != CXnDomProperty::ENone ) { InsertPropertyPseudoClassL( @@ -7895,7 +7419,6 @@ SetCachedProperty( aProperty, iLayoutPropertyCache, - iRef, iName, iValue, iLabel, @@ -7904,7 +7427,6 @@ iId, iPath, iMaskPath, - iGridPropertyCache, ETrue, ETrue ); } @@ -7913,7 +7435,6 @@ SetCachedProperty( aProperty, iLayoutPropertyCache, - iRef, iName, iValue, iLabel, @@ -7922,7 +7443,6 @@ iId, iPath, iMaskPath, - iGridPropertyCache, ETrue, EFalse ); } @@ -7937,13 +7457,6 @@ // CXnProperty* CXnNodeImpl::GetPropertyL( const TDesC8& aKey ) { - CXnNode* refNode( RefNodeL( this, iRef, iUiEngine ) ) ; - - if ( refNode && aKey != KRef && aKey != KId ) - { - return refNode->GetPropertyL( aKey ); - } - CXnDomProperty* attribute = NULL; CXnProperty* property = iPropertyList->GetProperty( aKey ); @@ -8476,17 +7989,10 @@ // Returns a property. // ----------------------------------------------------------------------------- // -static CXnProperty* PropertyL( CXnNodeImpl* aThis, CXnProperty* aProperty, - CXnProperty* ( CXnNode::* aFunc )(), CXnUiEngine* aUiEngine, - TAny* aLayoutPropertyCache, CXnNode* aParent, CXnProperty* aRef ) - { - CXnNode* refNode( RefNodeL( aThis, aRef, aUiEngine ) ) ; - - if ( refNode ) - { - return ( refNode->*aFunc )(); - } - +static CXnProperty* PropertyL( CXnProperty* aProperty, + CXnProperty* ( CXnNode::* aFunc )(), + TAny* aLayoutPropertyCache, CXnNode* aParent ) + { if ( aLayoutPropertyCache && aProperty ) { CXnDomProperty* attribute = aProperty->Property(); @@ -8519,93 +8025,16 @@ } // ----------------------------------------------------------------------------- -// ReferredPropertyL -// Returns a referred property. -// ----------------------------------------------------------------------------- -// -static CXnProperty* ReferredPropertyL( - RPointerArray< CXnProperty >* aPropertyArray, - RArray< CXnDomProperty::TPseudoClass >& aStates ) - { - if ( !aPropertyArray ) - { - return NULL; - } - for ( TInt i = aPropertyArray->Count() - 1; i >= 0; --i ) - { - CXnProperty* tmp = ( *aPropertyArray )[i]; - for ( TInt j = aStates.Count() - 1; j >= 0; --j ) - { - if ( aStates[j] == tmp->Property()->PseudoClass() ) - { - return tmp; - } - } - for ( TInt j = aStates.Count() - 1; j >= 0; --j ) - { - if ( tmp->Property()->PseudoClass() == CXnDomProperty::ENone ) - { - return tmp; - } - } - } - for ( TInt i = aPropertyArray->Count() - 1; i >= 0; --i ) - { - CXnProperty* tmp = ( *aPropertyArray )[i]; - if ( tmp->Property()->PseudoClass() == CXnDomProperty::ENone ) - { - return tmp; - } - } - return NULL; - } - -// ----------------------------------------------------------------------------- -// RefNodeL -// Returns referred node. -// ----------------------------------------------------------------------------- -// -static CXnNode* RefNodeL( - CXnNodeImpl* aThis, - CXnProperty* aRef, - CXnUiEngine* aUiEngine ) - { - const TDesC8* refid( CheckRefAttributeL( aRef ) ); - - if ( refid ) - { - CXnNode* node( aUiEngine->FindNodeByIdL( *refid, aThis->Namespace() ) ); - - if ( node ) - { - return node; - } - } - - return NULL; - } - -// ----------------------------------------------------------------------------- // CXnNodeImpl::WidthL // Returns width property. // ----------------------------------------------------------------------------- // CXnProperty* CXnNodeImpl::WidthL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iWidths ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iWidth : NULL; - return PropertyL( this, property, &CXnNode::WidthL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::WidthL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8615,20 +8044,10 @@ // CXnProperty* CXnNodeImpl::HeightL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if (refNode) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iHeights ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iHeight : NULL; - return PropertyL( this, property, &CXnNode::HeightL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::HeightL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8638,22 +8057,12 @@ // CXnProperty* CXnNodeImpl::MarginLeftL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iMarginLefts ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iMarginLeft : NULL; - return PropertyL( this, property, &CXnNode::MarginLeftL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::MarginLeftL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8663,22 +8072,12 @@ // CXnProperty* CXnNodeImpl::MarginRightL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iMarginRights ) : - NULL; - return ReferredPropertyL(propertyArray, iStates); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iMarginRight : NULL; - return PropertyL( this, property, &CXnNode::MarginRightL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::MarginRightL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8688,21 +8087,11 @@ // CXnProperty* CXnNodeImpl::BorderLeftL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iBorderLefts ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iBorderLeft : NULL; - return PropertyL( this, property, &CXnNode::BorderLeftL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::BorderLeftL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8712,22 +8101,12 @@ // CXnProperty* CXnNodeImpl::BorderRightL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iBorderRights ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iBorderRight : NULL; - return PropertyL( this, property, &CXnNode::BorderRightL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::BorderRightL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8737,22 +8116,12 @@ // CXnProperty* CXnNodeImpl::PaddingLeftL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iPaddingLefts ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iPaddingLeft : NULL; - return PropertyL( this, property, &CXnNode::PaddingLeftL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::PaddingLeftL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8762,20 +8131,10 @@ // CXnProperty* CXnNodeImpl::PaddingRightL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iPaddingRights ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iPaddingRight : NULL; - return PropertyL( this, property, &CXnNode::PaddingRightL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::PaddingRightL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8785,20 +8144,10 @@ // CXnProperty* CXnNodeImpl::MarginTopL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iMarginTops ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iMarginTop : NULL; - return PropertyL( this, property, &CXnNode::MarginTopL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::MarginTopL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8808,20 +8157,10 @@ // CXnProperty* CXnNodeImpl::MarginBottomL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iMarginBottoms ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iMarginBottom : NULL; - return PropertyL( this, property, &CXnNode::MarginBottomL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::MarginBottomL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8831,20 +8170,10 @@ // CXnProperty* CXnNodeImpl::BorderTopL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iBorderTops ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iBorderTop : NULL; - return PropertyL( this, property, &CXnNode::BorderTopL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::BorderTopL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8854,20 +8183,10 @@ // CXnProperty* CXnNodeImpl::BorderBottomL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iBorderBottoms ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iBorderBottom : NULL; - return PropertyL( this, property, &CXnNode::BorderBottomL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::BorderBottomL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8877,20 +8196,10 @@ // CXnProperty* CXnNodeImpl::PaddingTopL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iPaddingTops ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iPaddingTop : NULL; - return PropertyL( this, property, &CXnNode::PaddingTopL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::PaddingTopL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8900,20 +8209,10 @@ // CXnProperty* CXnNodeImpl::PaddingBottomL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iPaddingBottoms ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iPaddingBottom : NULL; - return PropertyL( this, property, &CXnNode::PaddingBottomL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::PaddingBottomL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8923,20 +8222,10 @@ // CXnProperty* CXnNodeImpl::BorderWidthL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iBorderWidths ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iBorderWidth : NULL; - return PropertyL( this, property, &CXnNode::BorderWidthL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::BorderWidthL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8946,20 +8235,10 @@ // CXnProperty* CXnNodeImpl::BlockProgressionL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iBlockProgressions ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iBlockProgression : NULL; - return PropertyL( this, property, &CXnNode::BlockProgressionL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::BlockProgressionL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8969,20 +8248,10 @@ // CXnProperty* CXnNodeImpl::DirectionL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iDirections ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iDirection : NULL; - return PropertyL( this, property, &CXnNode::DirectionL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::DirectionL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -8992,20 +8261,10 @@ // CXnProperty* CXnNodeImpl::PositionL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iPositions ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iPosition : NULL; - return PropertyL( this, property, &CXnNode::PositionL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::PositionL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9015,20 +8274,10 @@ // CXnProperty* CXnNodeImpl::MaxHeightL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iMaxHeights ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iMaxHeight : NULL; - return PropertyL( this, property, &CXnNode::MaxHeightL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::MaxHeightL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9038,20 +8287,10 @@ // CXnProperty* CXnNodeImpl::MinHeightL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iMinHeights ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iMinHeight : NULL; - return PropertyL( this, property, &CXnNode::MinHeightL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::MinHeightL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9061,20 +8300,10 @@ // CXnProperty* CXnNodeImpl::MaxWidthL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iMaxWidths ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iMaxWidth : NULL; - return PropertyL( this, property, &CXnNode::MaxWidthL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::MaxWidthL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9084,20 +8313,10 @@ // CXnProperty* CXnNodeImpl::MinWidthL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iMinWidths ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iMinWidth : NULL; - return PropertyL( this, property, &CXnNode::MinWidthL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::MinWidthL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9107,20 +8326,10 @@ // CXnProperty* CXnNodeImpl::DisplayL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iDisplays ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iDisplay : NULL; - return PropertyL( this, property, &CXnNode::DisplayL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::DisplayL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9130,20 +8339,10 @@ // CXnProperty* CXnNodeImpl::LeftL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iLefts ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iLeft : NULL; - return PropertyL( this, property, &CXnNode::LeftL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::LeftL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9153,20 +8352,10 @@ // CXnProperty* CXnNodeImpl::RightL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iRights ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iRight : NULL; - return PropertyL( this, property, &CXnNode::RightL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::RightL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9176,20 +8365,10 @@ // CXnProperty* CXnNodeImpl::TopL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iTops ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iTop : NULL; - return PropertyL( this, property, &CXnNode::TopL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::TopL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9199,20 +8378,10 @@ // CXnProperty* CXnNodeImpl::BottomL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iBottoms ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iBottom : NULL; - return PropertyL( this, property, &CXnNode::BottomL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::BottomL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9222,20 +8391,10 @@ // CXnProperty* CXnNodeImpl::BorderLeftStyleL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iBorderLeftStyles ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iBorderLeftStyle : NULL; - return PropertyL( this, property, &CXnNode::BorderLeftStyleL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::BorderLeftStyleL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9245,20 +8404,10 @@ // CXnProperty* CXnNodeImpl::BorderRightStyleL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iBorderRightStyles ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iBorderRightStyle : NULL; - return PropertyL( this, property, &CXnNode::BorderRightStyleL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::BorderRightStyleL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9268,20 +8417,10 @@ // CXnProperty* CXnNodeImpl::BorderTopStyleL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iBorderTopStyles ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iBorderTopStyle : NULL; - return PropertyL( this, property, &CXnNode::BorderTopStyleL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::BorderTopStyleL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9291,20 +8430,10 @@ // CXnProperty* CXnNodeImpl::BorderBottomStyleL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iBorderBottomStyles ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iBorderBottomStyle : NULL; - return PropertyL( this, property, &CXnNode::BorderBottomStyleL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::BorderBottomStyleL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9314,20 +8443,10 @@ // CXnProperty* CXnNodeImpl::BorderStyleL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iBorderStyles ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iBorderStyle : NULL; - return PropertyL( this, property, &CXnNode::BorderStyleL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::BorderStyleL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9339,9 +8458,8 @@ { CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iBorderImage : NULL; - return PropertyL( this, property, &CXnNode::BorderImageL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::BorderImageL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9351,20 +8469,10 @@ // CXnProperty* CXnNodeImpl::DisplayPriorityL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iDisplayPriorities ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iDisplayPriority : NULL; - return PropertyL( this, property, &CXnNode::DisplayPriorityL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::DisplayPriorityL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9374,9 +8482,7 @@ // CXnProperty* CXnNodeImpl::NameL() { - return PropertyL( this, iName, &CXnNode::NameL, - iUiEngine, this, - iParent, iRef ); + return PropertyL( iName, &CXnNode::NameL, this, iParent ); } // ----------------------------------------------------------------------------- @@ -9386,9 +8492,7 @@ // CXnProperty* CXnNodeImpl::ValueL() { - return PropertyL( this, iValue, &CXnNode::ValueL, - iUiEngine, this, - iParent, iRef ); + return PropertyL( iValue, &CXnNode::ValueL, this, iParent ); } // ----------------------------------------------------------------------------- @@ -9398,20 +8502,10 @@ // CXnProperty* CXnNodeImpl::VisibilityL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iVisibilities ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iVisibility : NULL; - return PropertyL( this, property, &CXnNode::VisibilityL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::VisibilityL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9421,9 +8515,7 @@ // CXnProperty* CXnNodeImpl::LabelL() { - return PropertyL( this, iLabel, &CXnNode::LabelL, - iUiEngine, this, - iParent, iRef ); + return PropertyL( iLabel, &CXnNode::LabelL, this, iParent ); } // ----------------------------------------------------------------------------- @@ -9433,9 +8525,7 @@ // CXnProperty* CXnNodeImpl::InitialFocusL() { - return PropertyL( this, iInitialFocus, &CXnNode::InitialFocusL, - iUiEngine, this, - iParent, iRef ); + return PropertyL( iInitialFocus, &CXnNode::InitialFocusL, this, iParent ); } // ----------------------------------------------------------------------------- @@ -9445,9 +8535,7 @@ // CXnProperty* CXnNodeImpl::ClassL() { - return PropertyL( this, iClass, &CXnNode::ClassL, - iUiEngine, this, - iParent, iRef ); + return PropertyL( iClass, &CXnNode::ClassL, this, iParent ); } // ----------------------------------------------------------------------------- @@ -9491,9 +8579,7 @@ // CXnProperty* CXnNodeImpl::PathL() { - return PropertyL( this, iPath, &CXnNode::PathL, - iUiEngine, this, - iParent, iRef ); + return PropertyL( iPath, &CXnNode::PathL, this, iParent ); } // ----------------------------------------------------------------------------- @@ -9503,9 +8589,7 @@ // CXnProperty* CXnNodeImpl::MaskPathL() { - return PropertyL( this, iMaskPath, &CXnNode::MaskPathL, - iUiEngine, this, - iParent, iRef ); + return PropertyL( iMaskPath, &CXnNode::MaskPathL, this, iParent ); } // ----------------------------------------------------------------------------- @@ -9515,118 +8599,10 @@ // CXnProperty* CXnNodeImpl::NavIndexL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iNavIndexes ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iNavIndex : NULL; - return PropertyL( this, property, &CXnNode::NavIndexL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); - } - -// ----------------------------------------------------------------------------- -// CXnNodeImpl::VisibleRowsL -// Returns visible-rows property. -// ----------------------------------------------------------------------------- -// -CXnProperty* CXnNodeImpl::VisibleRowsL() - { - CXnProperty* property = - iGridPropertyCache ? iGridPropertyCache->iVisibleRows : NULL; - return PropertyL( this, property, &CXnNode::VisibleRowsL, - iUiEngine, iGridPropertyCache, - iParent, iRef ); - } - -// ----------------------------------------------------------------------------- -// CXnNodeImpl::GridColumnsL -// Returns grid-columns property. -// ----------------------------------------------------------------------------- -// -CXnProperty* CXnNodeImpl::GridColumnsL() - { - CXnProperty* property = - iGridPropertyCache ? iGridPropertyCache->iGridColumns : NULL; - return PropertyL( this, property, &CXnNode::GridColumnsL, - iUiEngine, iGridPropertyCache, - iParent, iRef ); - } - -// ----------------------------------------------------------------------------- -// CXnNodeImpl::GridOrientationL -// Returns grid-orientation property. -// ----------------------------------------------------------------------------- -// -CXnProperty* CXnNodeImpl::GridOrientationL() - { - CXnProperty* property = - iGridPropertyCache ? iGridPropertyCache->iGridOrientation : NULL; - return PropertyL( this, property, &CXnNode::GridOrientationL, - iUiEngine, iGridPropertyCache, - iParent, iRef ); - } - -// ----------------------------------------------------------------------------- -// CXnNodeImpl::GridVerDirectionL -// Returns grid-ver-direction property. -// ----------------------------------------------------------------------------- -// -CXnProperty* CXnNodeImpl::GridVerDirectionL() - { - CXnProperty* property = - iGridPropertyCache ? iGridPropertyCache->iGridVerDirection : NULL; - return PropertyL( this, property, &CXnNode::GridVerDirectionL, - iUiEngine, iGridPropertyCache, - iParent, iRef ); - } - -// ----------------------------------------------------------------------------- -// CXnNodeImpl::GridHorDirectionL -// Returns grid-hor-direction property. -// ----------------------------------------------------------------------------- -// -CXnProperty* CXnNodeImpl::GridHorDirectionL() - { - CXnProperty* property = - iGridPropertyCache ? iGridPropertyCache->iGridHorDirection : NULL; - return PropertyL( this, property, &CXnNode::GridHorDirectionL, - iUiEngine, iGridPropertyCache, - iParent, iRef ); - } - -// ----------------------------------------------------------------------------- -// CXnNodeImpl::FocusHorLoopingL -// Returns focus-hor-looping property. -// ----------------------------------------------------------------------------- -// -CXnProperty* CXnNodeImpl::FocusHorLoopingL() - { - CXnProperty* property = - iGridPropertyCache ? iGridPropertyCache->iFocusHorLooping : NULL; - return PropertyL( this, property, &CXnNode::FocusHorLoopingL, - iUiEngine, iGridPropertyCache, - iParent, iRef ); - } - -// ----------------------------------------------------------------------------- -// CXnNodeImpl::FocusVerLoopingL -// Returns focus-ver-looping property. -// ----------------------------------------------------------------------------- -// -CXnProperty* CXnNodeImpl::FocusVerLoopingL() - { - CXnProperty* property = - iGridPropertyCache ? iGridPropertyCache->iFocusVerLooping : NULL; - return PropertyL( this, property, &CXnNode::FocusVerLoopingL, - iUiEngine, iGridPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::NavIndexL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9636,20 +8612,10 @@ // CXnProperty* CXnNodeImpl::ZIndexL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iZIndexes ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iZIndex : NULL; - return PropertyL( this, property, &CXnNode::ZIndexL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::ZIndexL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9659,20 +8625,10 @@ // CXnProperty* CXnNodeImpl::BackgroundColorL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iBackgroundColors ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iBackgroundColor : NULL; - return PropertyL( this, property, &CXnNode::BackgroundColorL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::BackgroundColorL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9682,20 +8638,10 @@ // CXnProperty* CXnNodeImpl::BackgroundImageL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iBackgroundImages ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iBackgroundImage : NULL; - return PropertyL( this, property, &CXnNode::BackgroundImageL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); + return PropertyL( property, &CXnNode::BackgroundImageL, + iLayoutPropertyCache, iParent ); } // ----------------------------------------------------------------------------- @@ -9705,174 +8651,11 @@ // CXnProperty* CXnNodeImpl::FocusBackgroundL() { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - - if ( refNode ) - { - RPointerArray< CXnProperty >* propertyArray = - refNode->Impl()->iLayoutPropertyCache ? - &( refNode->Impl()->iLayoutPropertyCache->iFocusBackgrounds ) : - NULL; - return ReferredPropertyL( propertyArray, iStates ); - } - CXnProperty* property = iLayoutPropertyCache ? iLayoutPropertyCache->iFocusBackground : NULL; - return PropertyL( this, property, &CXnNode::FocusBackgroundL, - iUiEngine, iLayoutPropertyCache, - iParent, iRef ); - } - -// ----------------------------------------------------------------------------- -// CXnNodeImpl::RefL -// Returns ref property. -// ----------------------------------------------------------------------------- -// -CXnProperty* CXnNodeImpl::RefL() - { - return iRef; - } - -// ----------------------------------------------------------------------------- -// CXnNodeImpl::GridScrollBarWidthL -// Returns grid-scrollbar-width property. -// ----------------------------------------------------------------------------- -// -CXnProperty* CXnNodeImpl::GridScrollBarWidthL() - { - CXnProperty* property = NULL; - - if ( iGridPropertyCache && iGridPropertyCache->iGridScrollBarWidth) - { - property = PropertyL( - this, - iGridPropertyCache->iGridScrollBarWidth, - &CXnNode::GridScrollBarWidthL, - iUiEngine, iGridPropertyCache, - iParent, - iRef ); - } - - if ( !property && iRef ) - { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - - if ( refNode ) - { - property = refNode->GridScrollBarWidthL(); - } - } - - if ( !property ) - { - TReal sbWidth( KS60ScrollbarDefaultWidth ); - // Set default value - CXnDomDocument& doc = iUiEngine->ODT()->DomDocument(); - CXnDomProperty* domProperty = CXnDomProperty::NewL( - XnPropertyNames::grid::KS60GridScrollbarWidth, doc.StringPool() ); - CleanupStack::PushL( domProperty ); - CXnDomPropertyValue* propertyValue = CXnDomPropertyValue::NewL( - doc.StringPool() ); - CleanupStack::PushL( propertyValue ); - if ( AknLayoutUtils::PenEnabled() ) - { - sbWidth = KS60ScrollbarDefaultWidthPenEnabled; - } - propertyValue->SetFloatValueL( CXnDomPropertyValue::EUnitValue, sbWidth ); - domProperty->PropertyValueList().AddItemL( propertyValue ); - CleanupStack::Pop( propertyValue ); - - property = CXnProperty::NewL( domProperty ); - CleanupStack::Pop( domProperty ); - CleanupStack::PushL( property ); - - // If this is a reference node, set property to the referred node, not this. - CXnNode* node = RefNodeL( this, iRef, iUiEngine ); - if ( node ) - { - node->SetPropertyL( property ); - } - else - { - this->SetPropertyL( property ); // deletes existing one - } - - CleanupStack::Pop( property ); - } - - return property; - } - -// ----------------------------------------------------------------------------- -// CXnNodeImpl::GridScrollBarMarginL -// Returns grid-scrollbar-margin property. -// ----------------------------------------------------------------------------- -// -CXnProperty* CXnNodeImpl::GridScrollBarMarginL() - { - CXnProperty* property = NULL; - if ( iGridPropertyCache && iGridPropertyCache->iGridScrollBarMargin ) - { - property = PropertyL( - this, - iGridPropertyCache->iGridScrollBarMargin, - &CXnNode::GridScrollBarMarginL, - iUiEngine, iGridPropertyCache, - iParent, - iRef ); - } - - if ( !property && iRef ) - { - CXnNode* refNode = RefNodeL( this, iRef, iUiEngine ); - - if ( refNode ) - { - property = refNode->GridScrollBarMarginL(); - } - } - - if ( !property ) - { - TReal sbMarginWidth( KS60ScrollbarDefaultMargin ); - // Set default value - CXnDomDocument& doc = iUiEngine->ODT()->DomDocument(); - CXnDomProperty* domProperty = - CXnDomProperty::NewL( - XnPropertyNames::grid::KS60GridScrollbarMargin, - doc.StringPool() ); - CleanupStack::PushL( domProperty ); - CXnDomPropertyValue* propertyValue = CXnDomPropertyValue::NewL( - doc.StringPool() ); - CleanupStack::PushL( propertyValue ); - if ( AknLayoutUtils::PenEnabled() ) - { - sbMarginWidth = KS60ScrollbarDefaultMarginPenEnabled; - } - propertyValue->SetFloatValueL( - CXnDomPropertyValue::EUnitValue, sbMarginWidth ); - domProperty->PropertyValueList().AddItemL( propertyValue ); - CleanupStack::Pop( propertyValue ); - - property = CXnProperty::NewL( domProperty ); - CleanupStack::Pop( domProperty ); - CleanupStack::PushL( property ); - - // If this is a reference node, set property to the referred node, not this. - CXnNode* node = RefNodeL( this, iRef, iUiEngine ); - if ( node ) - { - node->SetPropertyL( property ); - } - else - { - this->SetPropertyL( property ); // deletes existing one - } - - CleanupStack::Pop(property); - } - return property; + return PropertyL( property, &CXnNode::FocusBackgroundL, + iLayoutPropertyCache, iParent ); } // ---------------------------------------------------------------------------- @@ -10097,57 +8880,6 @@ } } -// ---------------------------------------------------------------------------- -// CXnNodeImpl::PeriodicEventL -// ---------------------------------------------------------------------------- -// -TInt CXnNodeImpl::PeriodicEventL( TAny* aPtr ) - { - TXnTimedTrigger* params = static_cast< TXnTimedTrigger* >( aPtr ); - CXnNodeImpl* impl = params->iNodeImpl; - CXnUiEngine* engine = params->iEngine; - CXnNode* node = params->iNode; - CXnNode* eventData = params->iEventData; - CXnDomNode* actionNode = params->iActionNode; - CXnDomNode* triggerNode = params->iTriggerNode; - RunEventsL( impl, *engine, *node, *actionNode, *triggerNode, *eventData ); - delete params; - impl->DeletePeriodic(); - return EFalse; - } - -// ---------------------------------------------------------------------------- -// CXnNodeImpl::PeriodicTimer -// ---------------------------------------------------------------------------- -// -CPeriodic* CXnNodeImpl::PeriodicTimer() - { - return iPeriodicTimer; - } - -// ---------------------------------------------------------------------------- -// CXnNodeImpl::CreatePeriodicL -// ---------------------------------------------------------------------------- -// -void CXnNodeImpl::CreatePeriodicL() - { - iPeriodicTimer = CPeriodic::NewL( CActive::EPriorityIdle ); - } - -// --------------------------------------------------------- -// CXnNodeImpl::DeletePeriodic -// --------------------------------------------------------- -// -void CXnNodeImpl::DeletePeriodic() - { - if ( iPeriodicTimer ) - { - iPeriodicTimer->Cancel(); - delete iPeriodicTimer; - iPeriodicTimer = NULL; - } - } - // ----------------------------------------------------------------------------- // CXnNodeImpl::SetDirtyL // ----------------------------------------------------------------------------- @@ -10299,15 +9031,34 @@ } if ( source != -1 && target != -1 ) { + TBool swap = EFalse; + CXnPluginData* data( aTarget->UiEngine()->ViewManager()-> + ActiveViewData().Plugin( aTarget ) ); + if ( data && !data->Occupied() ) + { + // target is empty widget, swap widget places + swap = ETrue; + } + if ( target < source ) { iChildren.InsertL( aSource, target ); iChildren.Remove( source + 1 ); + if ( swap ) + { + iChildren.Remove( target + 1 ); + iChildren.InsertL( aTarget, source ); + } } else if ( source < target ) { iChildren.Remove( source ); iChildren.InsertL( aSource, target ); + if ( swap ) + { + iChildren.Insert( aTarget, source ); + iChildren.Remove( target ); + } } // put the locked nodes to the original places @@ -10409,4 +9160,3 @@ } return aRect; } - diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnnodepluginif.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnnodepluginif.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnnodepluginif.cpp Wed May 12 13:22:51 2010 +0300 @@ -366,96 +366,6 @@ } // ----------------------------------------------------------------------------- -// CXnNodePluginIf::VisibleRowsL -// ----------------------------------------------------------------------------- -// -EXPORT_C CXnProperty* CXnNodePluginIf::VisibleRowsL() - { - return iNode->VisibleRowsL(); - } - -// ----------------------------------------------------------------------------- -// CXnNodePluginIf::GridColumnsL -// ----------------------------------------------------------------------------- -// -EXPORT_C CXnProperty* CXnNodePluginIf::GridColumnsL() - { - return iNode->GridColumnsL(); - } - -// ----------------------------------------------------------------------------- -// CXnNodePluginIf::GridOrientationL -// ----------------------------------------------------------------------------- -// -EXPORT_C CXnProperty* CXnNodePluginIf::GridOrientationL() - { - return iNode->GridOrientationL(); - } - -// ----------------------------------------------------------------------------- -// CXnNodePluginIf::GridVerDirectionL -// ----------------------------------------------------------------------------- -// -EXPORT_C CXnProperty* CXnNodePluginIf::GridVerDirectionL() - { - return iNode->GridVerDirectionL(); - } - -// ----------------------------------------------------------------------------- -// CXnNodePluginIf::GridHorDirectionL -// ----------------------------------------------------------------------------- -// -EXPORT_C CXnProperty* CXnNodePluginIf::GridHorDirectionL() - { - return iNode->GridHorDirectionL(); - } - -// ----------------------------------------------------------------------------- -// CXnNodePluginIf::FocusHorLoopingL -// ----------------------------------------------------------------------------- -// -EXPORT_C CXnProperty* CXnNodePluginIf::FocusHorLoopingL() - { - return iNode->FocusHorLoopingL(); - } - -// ----------------------------------------------------------------------------- -// CXnNodePluginIf::FocusVerLoopingL -// ----------------------------------------------------------------------------- -// -EXPORT_C CXnProperty* CXnNodePluginIf::FocusVerLoopingL() - { - return iNode->FocusVerLoopingL(); - } - -// ----------------------------------------------------------------------------- -// CXnNodePluginIf::RefL -// ----------------------------------------------------------------------------- -// -EXPORT_C CXnProperty* CXnNodePluginIf::RefL() - { - return iNode->RefL(); - } - -// ----------------------------------------------------------------------------- -// CXnNodePluginIf::GridScrollBarWidthL -// ----------------------------------------------------------------------------- -// -EXPORT_C CXnProperty* CXnNodePluginIf::GridScrollBarWidthL() - { - return iNode->GridScrollBarWidthL(); - } - -// ----------------------------------------------------------------------------- -// CXnNodePluginIf::GridScrollBarMarginL -// ----------------------------------------------------------------------------- -// -EXPORT_C CXnProperty* CXnNodePluginIf::GridScrollBarMarginL() - { - return iNode->GridScrollBarMarginL(); - } - -// ----------------------------------------------------------------------------- // CXnNodePluginIf::SetHandleTooltip // ----------------------------------------------------------------------------- // @@ -542,9 +452,7 @@ { const TDesC8& type( iNode->Type()->Type() ); - if ( iNode->IsAdaptive( ETrue ) || - type == _L8( "grid" ) || - type == _L8( "list" ) ) + if ( iNode->IsAdaptive( ETrue ) ) { iNode->SetDirtyL( XnDirtyLevel::ELayoutAndRender ); } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnodtparser.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnodtparser.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnodtparser.cpp Wed May 12 13:22:51 2010 +0300 @@ -32,6 +32,7 @@ #include "xnuiengine.h" #include "xntype.h" #include "xncontroladapter.h" +#include "xnviewcontroladapter.h" #include "xnpopupcontroladapter.h" #include "xnwidgetextensionadapter.h" #include "xnscrollablecontroladapter.h" @@ -51,7 +52,7 @@ #include "xnodtparser.h" -_LIT8( KWidgetBgSkinId, "SKIN(268458534 9886)" ); +_LIT8( KWidgetBgSkinId, "SKIN(268458534 9916)" ); // CONSTANTS _LIT8( KXMLUIMLNodeName, "xmluiml" ); @@ -60,8 +61,6 @@ _LIT8( KBoxNodeName, "box" ); _LIT8( KButtonNodeName, "button" ); _LIT8( KStylusPopupNodeName, "styluspopup" ); -_LIT8( KListNodeName, "list" ); -_LIT8( KGridNodeName, "grid" ); _LIT8( KImageNodeName, "image" ); _LIT8( KTooltipNodeName, "tooltip" ); _LIT8( KMenuBarNodeName, "menubar" ); @@ -74,8 +73,6 @@ _LIT8( KTriggerNodeName, "trigger" ); _LIT8( KEventNodeName, "event" ); _LIT8( KTextNodeName, "text" ); -_LIT8( KGridCellTemplateNodeName, "gridcelltemplate" ); -_LIT8( KListRowTemplateNodeName, "listrowtemplate" ); _LIT8( KMarqueeNodeName, "marquee" ); _LIT8( KObjectNodeName, "object" ); _LIT8( KTracksterNodeName, "trackster" ); @@ -502,12 +499,8 @@ returnValue->SetViewNodeImpl( impl ); CleanupStack::Pop( impl ); } - else if ( name == KGridCellTemplateNodeName || - name == KListRowTemplateNodeName || - name == KBoxNodeName || + else if ( name == KBoxNodeName || name == KButtonNodeName || - name == KListNodeName || - name == KGridNodeName || name == KImageNodeName || name == KMenuBarNodeName || name == KTooltipNodeName || @@ -770,6 +763,15 @@ CXnNode* owner( widgetNode->Parent() ); + CXnControlAdapter* widgetControl( widgetNode->Control() ); + + RPointerArray< CXnControlAdapter >& + childAdapters( owner->Control()->ChildAdapters() ); + + childAdapters.Remove( childAdapters.Find( widgetControl ) ); + + childAdapters.Compress(); + RPointerArray< CXnNode >& children( owner->Children() ); TInt index( children.Find( widgetNode ) ); @@ -784,9 +786,7 @@ CXnDomNode* owner( aPluginData.Owner() ); owner->DeleteChild( aPluginData.Node() ); - } - - owner->Control()->RemoveChildAdapters(); + } } // ----------------------------------------------------------------------------- @@ -1180,7 +1180,7 @@ if ( aName != KBoxNodeName && aName != KButtonNodeName && aName != KStylusPopupNodeName && aName != KScrollableBoxNodeName&& aName != KWidgetExtensionNodeName && - aName != KPopUpNodeName && + aName != KPopUpNodeName && aName != KViewNodeName && aName != XnPropertyNames::listquerydialog::KListQueryDialog ) { return CreateExternalControlL( aNode, aName ); @@ -1227,12 +1227,15 @@ } } } - - __ASSERT_DEBUG( parentAdapter, User::Leave( KErrGeneral ) ); CXnControlAdapter* adapter( NULL ); - - if( aName == KStylusPopupNodeName ) + + if( aName == KViewNodeName ) + { + adapter = CXnViewControlAdapter::NewL( aNode.PluginIfL() ); + CleanupStack::PushL( adapter ); + } + else if( aName == KStylusPopupNodeName ) { adapter = CXnPopupControlAdapter::NewL( aNode.PluginIfL() ); CleanupStack::PushL( adapter ); @@ -1271,12 +1274,24 @@ CleanupStack::PushL( adapter ); } - parentAdapter->AppendChildL( *adapter, aNode ); - CleanupStack::Pop( adapter ); + if ( parentAdapter ) + { + parentAdapter->AppendChildL( *adapter, aNode ); + } - component->SetControlAdapter( adapter ); + component->SetControlAdapter( adapter ); // ovnership transferred + CleanupStack::Pop( adapter ); - aNode.ComponentNodeImpl()->SetComponent( component ); + __ASSERT_DEBUG( adapter, User::Leave( KErrGeneral ) ); + + if( aName == KViewNodeName ) + { + aNode.ViewNodeImpl()->SetComponent( component ); + } + else + { + aNode.ComponentNodeImpl()->SetComponent( component ); + } component->SetNode( aNode.PluginIfL() ); diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnplugindata.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnplugindata.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnplugindata.cpp Wed May 12 13:22:51 2010 +0300 @@ -17,8 +17,12 @@ // System includes #include +#include +#include +#include // User includes +#include #include "xnappuiadapter.h" #include "xncomposer.h" #include "xnodtparser.h" @@ -29,11 +33,12 @@ #include "xnviewdata.h" #include "xnviewmanager.h" #include "xnoomsyshandler.h" +#include "xnpanic.h" + +#include "debug.h" // Constants -_LIT8( KStateWaitConfirmation, "WaitForConfirmation" ); -_LIT8( KStateConfirmed, "Confirmed" ); -_LIT8( KStateError, "Error" ); +_LIT8( KLockingStatusLocked, "locked" ); // ============================ LOCAL FUNCTIONS ================================ @@ -73,8 +78,6 @@ { // Plugin data is removable by default iFlags.Set( EIsRemovable ); - // Assume plugins ready - iFlags.Set( EIsDataPluginsReady ); } // ----------------------------------------------------------------------------- @@ -86,8 +89,6 @@ : iParent( NULL ), iManager( aManager ) { // This constructor overload is used by CXnRootData - // Assume plugins are ready - iFlags.Set( EIsDataPluginsReady ); } // ----------------------------------------------------------------------------- @@ -97,8 +98,6 @@ // CXnPluginData::~CXnPluginData() { - RevertPluginState(); - if ( iLoader ) { iLoader->Cancel(); @@ -120,62 +119,47 @@ } // ----------------------------------------------------------------------------- -// CXnPluginData::LoadL() +// CXnPluginData::Load() // ----------------------------------------------------------------------------- // -void CXnPluginData::LoadL() +TInt CXnPluginData::Load() { - if ( Occupied() || PluginState().CompareF( KStateError ) == 0 ) + if ( Occupied() ) { - return; + return KErrInUse; } if ( !CXnOomSysHandler::HeapAvailable( WIDGET_MIN_MEM ) ) - { - ViewManager().OomSysHandler().HandlePotentialOomL(); - return; + { + return KErrNoMemory; } iFlags.Clear( EIsEmpty ); - iFlags.Set( EIsRemovable ); + + TInt err( KErrNone ); - TRAPD( error, - - if ( iManager.Composer().ComposeWidgetL( *this ) == KErrNone ) - { - iManager.Parser().LoadWidgetL( *this ); - } - ); - - if ( Empty() ) + TRAP( err, err = iManager.Composer().ComposeWidgetL( *this ) ); + + if ( err == KErrNone ) { - // All done - return; + TRAP( err, iManager.Parser().LoadWidgetL( *this ) ); } - if ( error || !Occupied() ) + if ( err == KErrNone ) { - if( error == KErrNoMemory ) - { - ViewManager().OomSysHandler().HandlePotentialOomL(); - } + // Mark publishers as virgin + iVirginPublishers = ETrue; - // Mark this plugin ready, View Manager will remove it - DataPluginsLoadCompletedL( KErrGeneral ); + // Succesfully composed, try schedule publishers' loading + LoadPublishers(); } - else - { - if ( Active() ) - { - // Load data plugins will set confirmation state to "wait" - LoadDataPluginsL(); - } - else - { - // Composed succesfully to inactive page. Set confirmed - SetPluginStateL( KStateConfirmed ); - } - } + else if ( err == KXnErrPluginFailure ) + { + // Widget's configuration is broken, remove it + TRAP_IGNORE( iManager.UnloadWidgetFromPluginL( *this, ETrue ) ); + } + + return err; } // ----------------------------------------------------------------------------- @@ -186,109 +170,146 @@ { if ( Occupied() ) { - TRAP_IGNORE( - DestroyDataPluginsL(); - iManager.Parser().DestroyWidgetL( *this ); - ); + DestroyPublishers(); + + TRAP_IGNORE( iManager.Parser().DestroyWidgetL( *this ) ); } Flush(); } // ----------------------------------------------------------------------------- -// CXnPluginData::LoadDataPluginsL +// CXnPluginData::LoadPublishers // Loads data plugins associated to the plugin // ----------------------------------------------------------------------------- // -void CXnPluginData::LoadDataPluginsL() +void CXnPluginData::LoadPublishers() { - if ( !Active() || !Occupied() ) - { - iFlags.Set( EIsDataPluginsReady ); - + if ( !Active() || !Occupied() || iContentSourceNodes.Count() == 0 ) + { return; } - if ( iContentSourceNodes.Count() == 0 ) - { - DataPluginsLoadCompletedL( KErrNone ); - } - else + iLoader->Cancel(); + + iLoader->Start( TTimeIntervalMicroSeconds32( 50 ), + TTimeIntervalMicroSeconds32( 50 ), + TCallBack( PeriodicEventL, this ) ); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::PeriodicEventL() +// +// ----------------------------------------------------------------------------- +// +/* static */ TInt CXnPluginData::PeriodicEventL( TAny* aAny ) + { + CXnPluginData* self = static_cast< CXnPluginData* >( aAny ); + + self->iLoader->Cancel(); + + TInt reason( EAiFwPluginStartup ); + + if ( self->LoadPublishers( reason ) != KErrNone ) { - iLoader->Cancel(); + self->iManager.UnloadWidgetFromPluginL( *self, ETrue ); - iFlags.Clear( EIsDataPluginsReady ); - - iLoadIndex = 0; - - iLoader->Start( TTimeIntervalMicroSeconds32( 0 ), - TTimeIntervalMicroSeconds32( 0 ), - TCallBack( RunL, this ) ); - } + self->ShowContentRemovedError(); + } + + return KErrNone; } // ----------------------------------------------------------------------------- -// CXnPluginData::DataPluginsLoadCompletedL -// Indicates that all data plugins are loaded +// CXnPluginData::LoadPublishers() +// // ----------------------------------------------------------------------------- // -void CXnPluginData::DataPluginsLoadCompletedL( TInt aStatus ) - { - iFlags.Set( EIsDataPluginsReady ); +TInt CXnPluginData::LoadPublishers( TInt aReason ) + { + __PRINTS( "*** CXnPluginData::LoadPublishers" ); + + TInt err( KErrNone ); - const TDesC8& state( aStatus == KErrNone - ? KStateConfirmed() : KStateError() ); + TRAP( err, + for ( TInt i = 0; i < iContentSourceNodes.Count(); i++ ) + { + CXnNodeAppIf& plugin( iContentSourceNodes[i]->AppIfL() ); + + TInt retval( + iManager.AppUiAdapter().LoadPublisher( plugin, aReason ) ); + + if ( !err ) + { + err = retval; + } + } + ); + + iVirginPublishers = EFalse; - SetPluginStateL( state ); - - iManager.SetDataPluginLoadCompleteL( *this ); + if ( !Removable() ) + { + // Not allowed to remove even it fails + return KErrNone; + } + + __PRINTS( "*** CXnPluginData::LoadPublishers - done" ); + + return err; } // ----------------------------------------------------------------------------- -// CXnPluginData::DataPluginsLoaded -// Queries whether all data plugins are loaded -// ----------------------------------------------------------------------------- -// -TBool CXnPluginData::DataPluginsLoaded() const - { - return ( iFlags.IsSet( EIsDataPluginsReady ) ? ETrue : EFalse ); - } - -// ----------------------------------------------------------------------------- -// CXnPluginData::DestroyDataPluginsL +// CXnPluginData::DestroyPublishers // Remove data plugins associated to the plugin // ----------------------------------------------------------------------------- // -void CXnPluginData::DestroyDataPluginsL() - { +void CXnPluginData::DestroyPublishers() + { + __PRINTS( "*** CXnPluginData::DestroyPublishers" ); + if ( Occupied() ) { - iFlags.Set( EIsDataPluginsReady ); - - if ( iLoader->IsActive() ) - { - // Not all plugins loaded yet - iLoader->Cancel(); - - RevertPluginState(); - } + // If not all plugins loaded yet + iLoader->Cancel(); - // Create list of data plugins to be removed - RPointerArray< CXnNodeAppIf > list; - CleanupClosePushL( list ); - - for ( TInt i = 0; i < iContentSourceNodes.Count(); i++ ) - { - list.AppendL( &iContentSourceNodes[i]->AppIfL() ); - } - - // Destruction is synchronous - iManager.AppUiAdapter().DestroyDataPluginsL( list ); - - CleanupStack::PopAndDestroy( &list ); + TRAP_IGNORE( DoDestroyPublishersL() ); User::Heap().Compress(); } + + __PRINTS( "*** CXnPluginData::DestroyPublishers - done" ); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::VirginPublishers +// +// ----------------------------------------------------------------------------- +// +TBool CXnPluginData::VirginPublishers() const + { + return iVirginPublishers; + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::DoDestroyPublishersL +// Remove data plugins associated to the plugin +// ----------------------------------------------------------------------------- +// +void CXnPluginData::DoDestroyPublishersL() + { + __TIME_MARK( time ); + + for ( TInt i = 0; i < iContentSourceNodes.Count(); i++ ) + { + CXnNodeAppIf& plugin( iContentSourceNodes[i]->AppIfL() ); + + // Destruction is synchronous + iManager.AppUiAdapter().DestroyPublisher( + plugin, EAiFwPluginShutdown ); + } + + __TIME_ENDMARK( "CXnPluginData::DoDestroyPublishersL, done", time ); } // ----------------------------------------------------------------------------- @@ -379,38 +400,6 @@ } // ----------------------------------------------------------------------------- -// CXnPluginData::SetPluginStateL() -// ----------------------------------------------------------------------------- -// -void CXnPluginData::SetPluginStateL( const TDesC8& aPluginState ) - { - if ( PluginState().CompareF( aPluginState ) != 0 ) - { - delete iPluginState; - iPluginState = NULL; - - iPluginState = aPluginState.AllocL(); - - // Tell new state to HSPS as well - iManager.UpdatePluginStateL( *this ); - } - } - -// ----------------------------------------------------------------------------- -// CXnPluginData::RevertPluginState() -// ----------------------------------------------------------------------------- -// -void CXnPluginData::RevertPluginState() - { - // Need to change state if it is not error - if ( Occupied() && PluginState().CompareF( KStateError ) != 0 ) - { - // For now on it is confirmed - TRAP_IGNORE( SetPluginStateL( KStateConfirmed ) ); - } - } - -// ----------------------------------------------------------------------------- // CXnPluginData::SetResources() // ----------------------------------------------------------------------------- // @@ -540,12 +529,9 @@ iFlags.ClearAll(); // This is default - iFlags.Set( EIsRemovable ); - iFlags.Set( EIsDataPluginsReady ); + iFlags.Set( EIsRemovable ); iNode = NULL; - - iLoadIndex = 0; delete iConfigurationId; iConfigurationId = NULL; @@ -562,9 +548,6 @@ delete iPluginType; iPluginType = NULL; - delete iPluginState; - iPluginState = NULL; - delete iPublisherName; iPublisherName = NULL; @@ -614,8 +597,7 @@ // Takes ownership iPluginId = id; - iFlags.Set( EIsEmpty ); - iFlags.Clear( EIsRemovable ); + iFlags.Set( EIsEmpty ); } // ----------------------------------------------------------------------------- @@ -624,8 +606,7 @@ // ----------------------------------------------------------------------------- // void CXnPluginData::SetIsDisplayingPopup ( TBool aVisible, CXnNode* aNode ) - { - + { if ( aVisible ) { iPopupNodes.InsertInAddressOrder( aNode ); @@ -633,6 +614,7 @@ else { TInt index( iPopupNodes.Find( aNode ) ); + if ( index != KErrNotFound ) { iPopupNodes.Remove( index ); @@ -640,7 +622,6 @@ } } - //------------------------------------------------------------------------------ // CXnPluginData::IsDisplayingPopup() // @@ -652,41 +633,70 @@ } // ----------------------------------------------------------------------------- -// CXnPluginData::RunL() +// CXnPluginData::PopupNodesL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::PopupNodesL( RPointerArray< CXnNode >& aList ) const + { + for ( TInt i = 0; i < iPopupNodes.Count(); i++ ) + { + aList.AppendL( iPopupNodes[i] ); + } + } + +//------------------------------------------------------------------------------ +// CXnPluginData::ShowContentRemovedError() +// +//------------------------------------------------------------------------------ +// +void CXnPluginData::ShowContentRemovedError() + { + TRAP_IGNORE( DoShowContentRemovedErrorL() ); + } + +//------------------------------------------------------------------------------ +// CXnPluginData::DoShowContentRemovedErrorL() +// +//------------------------------------------------------------------------------ +// +void CXnPluginData::DoShowContentRemovedErrorL() + { + HBufC* msg( StringLoader::LoadLC( R_QTN_HS_ERROR_WIDGETS_REMOVED ) ); + + CAknErrorNote* note = new ( ELeave ) CAknErrorNote; + CleanupStack::PushL( note ); + + note->ExecuteLD( *msg ); + + CleanupStack::Pop( note ); + CleanupStack::PopAndDestroy( msg ); + } + +//------------------------------------------------------------------------------ +// CXnPluginData::ShowOutOfMemErrorL() +// +//------------------------------------------------------------------------------ +// +void CXnPluginData::ShowOutOfMemError() + { + TRAP_IGNORE( ViewManager().OomSysHandler().HandlePotentialOomL() ); + } + +// ----------------------------------------------------------------------------- +// CXnViewData::SetLockingStatus // // ----------------------------------------------------------------------------- // -/* static */ TInt CXnPluginData::RunL( TAny* aAny ) +void CXnPluginData::SetLockingStatus( const TDesC8& aStatus ) { - CXnPluginData* self = static_cast< CXnPluginData* >( aAny ); - - self->iLoader->Cancel(); - - RPointerArray< CXnNodeAppIf >list; - CleanupClosePushL( list ); - - for ( TInt i = 0; i < self->iContentSourceNodes.Count(); i++ ) + if ( aStatus.CompareF( KLockingStatusLocked ) == 0 ) { - list.AppendL( &self->iContentSourceNodes[i]->AppIfL() ); - } - - // State is "wait" until data plugins are loaded - self->SetPluginStateL( KStateWaitConfirmation ); - - TRAPD( err, self->iManager.AppUiAdapter().LoadDataPluginsL( list ) ); - - if ( err && self->Removable() ) - { - self->DataPluginsLoadCompletedL( err ); + iFlags.Clear( EIsRemovable ); } else { - self->DataPluginsLoadCompletedL( KErrNone ); + iFlags.Set( EIsRemovable ); } - - CleanupStack::PopAndDestroy( &list ); - - return KErrNone; } // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnpointarray.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnpointarray.cpp Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* 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: Array of points -* -*/ - -#include "xnpointarray.h" - -using namespace XnGestureHelper; - -// ---------------------------------------------------------------------------- -// TXnPointArray constructor -// ---------------------------------------------------------------------------- -// -TXnPointArray::TXnPointArray( const RArray< TXnPointEntry >& aPoints ) - : iPoints( aPoints ) - { - } - -// ---------------------------------------------------------------------------- -// TXnPointArray length -// ---------------------------------------------------------------------------- -// -TInt TXnPointArray::Count() const - { - return iPoints.Count(); - } - -// ---------------------------------------------------------------------------- -// point at index, no filtering -// ---------------------------------------------------------------------------- -// -TPoint TXnPointArray::operator[]( TInt aIndex ) const - { - return iPoints[aIndex].iPos; - } - -// ---------------------------------------------------------------------------- -// Unfiltered point at index -// ---------------------------------------------------------------------------- -// -const TPoint& TXnPointArray::Raw( TInt aIndex ) const - { - return iPoints[aIndex].iPos; - } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnpopupcontroladapter.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnpopupcontroladapter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnpopupcontroladapter.cpp Wed May 12 13:22:51 2010 +0300 @@ -24,14 +24,19 @@ // User includes #include "xnappuiadapter.h" +#include "xnviewadapter.h" +#include "xnkeyeventdispatcher.h" +#include "xnviewmanager.h" +#include "xnviewdata.h" +#include "xnplugindata.h" #include "xnproperty.h" #include "xncontroladapter.h" +#include "xndomnode.h" #include "xnnodepluginif.h" #include "xnnode.h" #include "xntype.h" #include "xnuiengine.h" #include "xneditor.h" -#include "xnhittest.h" #include "xnfocuscontrol.h" #include "xnpopupcontroladapter.h" @@ -49,18 +54,20 @@ // ----------------------------------------------------------------------------- // FindWidgetMenuItemL +// // ----------------------------------------------------------------------------- // -CXnNode* FindWidgetMenuItemL( const TDesC8& aSource, - CXnNode& aPlugin ) - { - if( aPlugin.Children().Count() == 0 ) +static CXnNode* FindWidgetMenuItemL( CXnPluginData& aPlugin, + const TDesC8& aSource ) + { + if ( !aPlugin.Occupied() ) { return NULL; } - - // Get element from the element - RPointerArray< CXnNode >& children( aPlugin.Children()[0]->Children() ); + + CXnNode* widget( aPlugin.Node()->LayoutNode() ); + + RPointerArray< CXnNode >& children( widget->Children() ); for ( TInt i = children.Count() - 1; i >= 0; i-- ) { @@ -159,6 +166,8 @@ } } + iUiEngine->Editor()->SetTargetPlugin( NULL ); + iMenuItems.Reset(); iCommandId = 0; @@ -192,7 +201,17 @@ { HideMenuL(); - TPointerEvent event( iUiEngine->HitTest().PointerEvent() ); + CXnViewManager* manager( iUiEngine->ViewManager() ); + CXnPluginData* plugin( manager->ActiveViewData().Plugin( &aPlugin ) ); + + if ( !plugin ) + { + return; + } + + CXnViewAdapter& adapter( iUiEngine->AppUiAdapter().ViewAdapter() ); + + const TPointerEvent& event( adapter.EventDispatcher()->PointerEvent() ); delete iStylusPopupMenu; iStylusPopupMenu = NULL; @@ -204,10 +223,10 @@ for ( TInt i = 0; i < children.Count(); i++ ) { - PopulateMenuL( children[i], aPlugin ); + PopulateMenuL( *plugin, children[i] ); } - ShowMenuL( aPlugin, event.iParentPosition ); + ShowMenuL( *plugin, event.iParentPosition ); } // ----------------------------------------------------------------------------- @@ -223,7 +242,8 @@ // CXnPopupControlAdapter::PopulateMenuL // ----------------------------------------------------------------------------- // -void CXnPopupControlAdapter::PopulateMenuL( CXnNode* aItem, CXnNode& aPlugin ) +void CXnPopupControlAdapter::PopulateMenuL( CXnPluginData& aPlugin, + CXnNode* aItem ) { CXnNode* menuitem( NULL ); CXnProperty* prop( NULL ); @@ -240,7 +260,7 @@ if ( source ) { CXnNode* widgetItem( - FindWidgetMenuItemL( source->StringValue(), aPlugin ) ); + FindWidgetMenuItemL( aPlugin, source->StringValue() ) ); if ( widgetItem ) { @@ -248,11 +268,13 @@ // Get label from the view item prop = aItem->LabelL(); + if ( !prop ) { // no localization in view, check from widget prop = widgetItem->LabelL(); } + // Pretend the original item is this widget item aItem = widgetItem; } @@ -268,8 +290,10 @@ } else if ( type == KDynMenuItem && iObserver ) { + CXnNode* plugin( aPlugin.Owner()->LayoutNode() ); + // Let observer decide whether dynmenuitem is visible or not - if ( iObserver->DynInitMenuItemL( aItem->AppIfL(), &aPlugin.AppIfL() ) ) + if ( iObserver->DynInitMenuItemL( aItem->AppIfL(), &plugin->AppIfL() ) ) { menuitem = aItem; } @@ -277,8 +301,10 @@ if ( menuitem ) { - CXnProperty* display = menuitem->DisplayL(); - if ( display && display->StringValue() == XnPropertyNames::style::common::display::KNone ) + CXnProperty* display( menuitem->DisplayL() ); + + if ( display && display->StringValue() == + XnPropertyNames::style::common::display::KNone ) { return; } @@ -305,23 +331,26 @@ // CXnPopupControlAdapter::ShowMenuL // ----------------------------------------------------------------------------- // -void CXnPopupControlAdapter::ShowMenuL( CXnNode& aPlugin, TPoint aPosition ) +void CXnPopupControlAdapter::ShowMenuL( CXnPluginData& aPlugin, + TPoint aPosition ) { if ( iMenuItems.Count() > 0 && !iMenuShown ) { iUiEngine->AppUiAdapter().HideFocus(); - - iUiEngine->Editor()->SetTargetPlugin( &aPlugin ); + + CXnNode* plugin( aPlugin.Owner()->LayoutNode() ); + + iUiEngine->Editor()->SetTargetPlugin( plugin ); if ( AknLayoutUtils::LayoutMirrored() ) { iStylusPopupMenu->SetPosition( aPosition, - CAknStylusPopUpMenu::EPositionTypeRightBottom ); + CAknStylusPopUpMenu::EPositionTypeRightBottom ); } else { iStylusPopupMenu->SetPosition( aPosition, - CAknStylusPopUpMenu::EPositionTypeLeftBottom ); + CAknStylusPopUpMenu::EPositionTypeLeftBottom ); } iStylusPopupMenu->ShowMenu(); diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnpropertysubscriber.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnpropertysubscriber.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnpropertysubscriber.cpp Wed May 12 13:22:51 2010 +0300 @@ -85,7 +85,7 @@ // void CXnPropertySubscriber::DoCancel() { - iProperty.Close(); + iProperty.Cancel(); } // ----------------------------------------------------------------------------- @@ -103,3 +103,14 @@ iPropertyChangeObserver.PropertyChangedL( iKey, intValue ); } } + +// --------------------------------------------------------- +// --------------------------------------------------------- +// +TInt CXnPropertySubscriber::RunError(TInt /*aError*/) + { + return KErrNone; + } + +// End of file + diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnrootdata.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnrootdata.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnrootdata.cpp Wed May 12 13:22:51 2010 +0300 @@ -38,8 +38,10 @@ #include "xnplugindata.h" #include "xnrootdata.h" +#include "debug.h" + // Constants -const TInt KScheduleInterval( 1000000 ); +const TInt KScheduleInterval( 2000000 ); // ============================ LOCAL FUNCTIONS ================================ @@ -130,109 +132,96 @@ iParser = CXnODTParser::NewL( iManager, *iEcomHandler ); - iLoadTimer = CPeriodic::NewL( CActive::EPriorityStandard ); - iDestroyTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + iLoadTimer = CPeriodic::NewL( CActive::EPriorityLow ); + iDestroyTimer = CPeriodic::NewL( CActive::EPriorityLow ); } // ----------------------------------------------------------------------------- -// CXnRootData::LoadL() +// CXnRootData::Load() // // ----------------------------------------------------------------------------- // -void CXnRootData::LoadL() +TInt CXnRootData::Load() { if ( Occupied() ) { - return; - } - - // Load application root configuration - TRAPD( error, - - iODT = iManager.Composer().ComposeRootL( *this ); - - if ( iODT ) - { - iManager.Parser().LoadRootL( *this, iApplicationUid ); - } - ); - - if ( !iODT || error || !Occupied() ) - { - // Can't recover - Panic( EXnInvalidConfiguration ); + return KErrInUse; } - RPointerArray< CXnViewData > failedPlugins; - CleanupClosePushL( failedPlugins ); - - TBool succeed( EFalse ); - - for ( TInt i = 0; i < iPluginsData.Count(); i++ ) - { - CXnViewData* plugin( - static_cast< CXnViewData* >( iPluginsData[ i ] ) ); + TInt err( KErrNone ); - if ( plugin->Initial() ) - { - plugin->LoadL(); + // Load application root configuration + TRAP( err, iODT = iManager.Composer().ComposeRootL( *this ) ); - if ( plugin->Occupied() ) - { - succeed = ETrue; - } - else - { - // Failed to load - failedPlugins.AppendL( plugin ); - } - - break; - } - } - - for ( TInt i = 0; !succeed && i < iPluginsData.Count(); i++ ) - { - CXnViewData* plugin( - static_cast< CXnViewData* >( iPluginsData[ i ] ) ); - - if ( failedPlugins.Find( plugin ) == KErrNotFound ) - { - plugin->SetInitial(); - - plugin->LoadL(); - - if ( plugin->Occupied() ) - { - succeed = ETrue; - } - else - { - // Failed to load - failedPlugins.AppendL( plugin ); - } - } - } - - if ( !succeed ) + if ( !iODT ) { // Can't recover Panic( EXnInvalidConfiguration ); } - - for ( TInt i = failedPlugins.Count() - 1; i >= 0; i-- ) - { - CXnPluginData* toDestroy( failedPlugins[i] ); - - TInt index( iPluginsData.Find( toDestroy ) ); - - iPluginsData.Remove( index ); - - delete toDestroy; - toDestroy = NULL; + + if ( !err ) + { + TRAP( err, iManager.Parser().LoadRootL( *this, iApplicationUid ) ); } - CleanupStack::PopAndDestroy( &failedPlugins ); + if ( !err ) + { + for ( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + CXnViewData* plugin( + static_cast< CXnViewData* >( iPluginsData[ i ] ) ); + + if ( plugin->Initial() ) + { + err = plugin->Load(); + + if ( plugin->Occupied() ) + { + // Initial view is succesfully composed. Some plugins + // may have failed but it doesn't matter as those are removed + return KErrNone; + } + + // Initial view failed, remove it + iPluginsData.Remove( i ); + + delete plugin; + plugin = NULL; + break; + } + } + + // Initial view loading failed, fallback to load any of the views + while( iPluginsData.Count() ) + { + CXnViewData* plugin( + static_cast< CXnViewData* >( iPluginsData[ 0 ] ) ); + + // Ignore error + plugin->Load(); + + if ( plugin->Occupied() ) + { + // Return error because of fallback condition + return KXnErrPluginFailure; + } + + // View failed, remove it + iPluginsData.Remove( 0 ); + + delete plugin; + plugin = NULL; + } + } + else if ( err == KErrNoMemory ) + { + ShowOutOfMemError(); + } + + // Configuration loading failed totally + Panic( EXnInvalidConfiguration ); + + return err; } // ----------------------------------------------------------------------------- @@ -481,6 +470,8 @@ // /* static */ TInt CXnRootData::RunLoadL( TAny* aAny ) { + __PRINTS( "*** CXnRootData::RunLoadL" ); + CXnRootData* self = static_cast< CXnRootData* >( aAny ); if ( self->iFlags.IsSet( EIsDispose ) ) @@ -542,7 +533,10 @@ if ( !self->AllViewsLoaded() && toLoad ) { - toLoad->LoadL(); + if ( toLoad->Load() == KErrNoMemory ) + { + self->ShowOutOfMemError(); + } } if ( self->AllViewsLoaded() ) @@ -551,6 +545,8 @@ } } + __PRINTS( "*** CXnRootData::RunLoadL - done" ); + return KErrNone; } @@ -581,6 +577,8 @@ // /* static */ TInt CXnRootData::RunDestroyL( TAny* aAny ) { + __PRINTS( "*** CXnRootData::RunDestroyL" ); + CXnRootData* self = static_cast< CXnRootData* >( aAny ); if( self->iFlags.IsSet( EIsDispose ) ) @@ -638,6 +636,8 @@ } } + __PRINTS( "*** CXnRootData::RunDestroyL - done" ); + return KErrNone; } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnspbgcleaner.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnspbgcleaner.cpp Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms 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: +* statuspane's background cleaner implementation +* +*/ + +// System includes +#include +#include +#include + +// User includes +#include "xnspbgcleaner.h" + +// CONSTANTS + +// ============================ LOCAL FUNCTIONS ================================ + +// ============================ MEMBER FUNCTIONS =============================== + +// --------------------------------------------------------- +// CXnSpBgCleaner::NewL +// --------------------------------------------------------- +// +CXnSpBgCleaner* CXnSpBgCleaner::NewL() + { + CXnSpBgCleaner* self = CXnSpBgCleaner::NewLC(); + CleanupStack::Pop(); // self; + return self; + } + +// --------------------------------------------------------- +// CXnSpBgCleaner::NewLC +// --------------------------------------------------------- +// +CXnSpBgCleaner* CXnSpBgCleaner::NewLC() + { + CXnSpBgCleaner* self = new ( ELeave ) CXnSpBgCleaner(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------- +// CXnSpBgCleaner::CXnSpBgCleaner +// --------------------------------------------------------- +// +CXnSpBgCleaner::CXnSpBgCleaner() + { + } + +// --------------------------------------------------------- +// CXnSpBgCleaner::ConstructL +// --------------------------------------------------------- +// +void CXnSpBgCleaner::ConstructL() + { + CreateWindowL(); + + TRect statusPaneRect; + AknLayoutUtils::LayoutMetricsRect( + AknLayoutUtils::EStatusPane, statusPaneRect ); + + SetRect( statusPaneRect ); + SetNonFocusing(); + + Window().SetOrdinalPosition( -1 ); + Window().SetBackgroundColor( TRgb::Color16MA(0) ); + Window().SetVisible( ETrue ); + + ActivateL(); + } + +// --------------------------------------------------------- +// CXnSpBgCleaner::~CXnSpBgCleaner +// --------------------------------------------------------- +// +CXnSpBgCleaner::~CXnSpBgCleaner() + { + } + +// --------------------------------------------------------- +// CXnSpBgCleaner::SizeChanged +// --------------------------------------------------------- +// +void CXnSpBgCleaner::SizeChanged() + { + CCoeControl::SizeChanged(); + DrawDeferred(); + } + +// --------------------------------------------------------- +// CXnSpBgCleaner::Draw +// --------------------------------------------------------- +// +void CXnSpBgCleaner::Draw( const TRect& /*aRect*/ ) const + { + CWindowGc& gc = SystemGc(); + TRgb color( TRgb::Color16MA(0) ); + gc.SetPenColor( color ); + gc.SetBrushColor( color ); + gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); + gc.SetPenStyle(CGraphicsContext::ESolidPen ); + gc.SetBrushStyle(CGraphicsContext::ESolidBrush ); + gc.Clear(); + } + +// --------------------------------------------------------- +// CXnSpBgCleaner::HandleResourceChange +// --------------------------------------------------------- +// +void CXnSpBgCleaner::HandleResourceChange( TInt aType ) + { + CCoeControl::HandleResourceChange( aType ); + + if ( KEikDynamicLayoutVariantSwitch == aType ) + { + TRect statusPaneRect; + AknLayoutUtils::LayoutMetricsRect( + AknLayoutUtils::EStatusPane, statusPaneRect ); + SetRect( statusPaneRect ); + } + } + +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnuiengine.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnuiengine.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengine.cpp Wed May 12 13:22:51 2010 +0300 @@ -138,6 +138,17 @@ } // ----------------------------------------------------------------------------- +// CXnUiEngine::FindContentSourceNodesL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +CXnPointerArray* CXnUiEngine::FindContentSourceNodesL( + const TDesC8& aNamespace ) + { + return iUiEngineImpl->FindContentSourceNodesL( aNamespace ); + } + +// ----------------------------------------------------------------------------- // CXnUiEngine::RenderUIL // Forwards the call to the ui engine implementation // ----------------------------------------------------------------------------- @@ -253,15 +264,6 @@ } // ----------------------------------------------------------------------------- -// CXnUiEngine::ActivateViewL -// Activate a view -// ----------------------------------------------------------------------------- -// -void CXnUiEngine::ActivateViewL( CXnNode& /*aViewNode*/ ) - { - } - -// ----------------------------------------------------------------------------- // CXnUiEngine::ViewManager // ----------------------------------------------------------------------------- // @@ -487,25 +489,6 @@ } // ----------------------------------------------------------------------------- -// CXnUiEngine::HitTest -// ----------------------------------------------------------------------------- -// -CXnHitTest& CXnUiEngine::HitTest() const - { - return iUiEngineImpl->HitTest(); - } - -// ----------------------------------------------------------------------------- -// CXnUiEngine::PositionStylusPopupL -// ----------------------------------------------------------------------------- -// -void CXnUiEngine::PositionStylusPopupL( CXnNode& aNode, - CXnNode& aReference, const TPoint& aPosition ) - { - iUiEngineImpl->PositionStylusPopupL( aNode, aReference, aPosition ); - } - -// ----------------------------------------------------------------------------- // CXnUiEngine::GetThemeResource // ----------------------------------------------------------------------------- // @@ -539,6 +522,33 @@ iUiEngineImpl->SetEventDispatcher( aDispatcher ); } +// ----------------------------------------------------------------------------- +// CXnUiEngine::EnablePartialTouchInput() +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::EnablePartialTouchInput( CXnNode& aNode, TBool aEnable ) + { + iUiEngineImpl->EnablePartialTouchInput(aNode, aEnable); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::isPartialInputActive() +// ----------------------------------------------------------------------------- +// +TBool CXnUiEngine::IsPartialInputActive() + { + return iUiEngineImpl->IsPartialInputActive(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::IsTextEditorActive() +// ----------------------------------------------------------------------------- +// +TBool CXnUiEngine::IsTextEditorActive() + { + return iUiEngineImpl->IsTextEditorActive(); + } + #ifndef EKA2 GLDEF_C TInt E32Dll( TDllReason ) { diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnuiengine.rss --- a/idlehomescreen/xmluirendering/uiengine/src/xnuiengine.rss Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengine.rss Wed May 12 13:22:51 2010 +0300 @@ -27,8 +27,10 @@ #include #include #include +#include #include #include + // ========== RESOURCE DEFINITIONS ============================================ RESOURCE RSS_SIGNATURE { } @@ -102,11 +104,11 @@ buf = qtn_hs_delete_current_page; } -RESOURCE TITLE_PANE r_qtn_hs_title_editmode - { - txt = qtn_hs_title_editing; - } - +RESOURCE TBUF r_hs_error_content_removed + { + buf = qtn_hs_error_content_removed; + } + RESOURCE DIALOG r_yes_no_hs_remove_view { flags = EGeneralQueryFlags; @@ -155,13 +157,52 @@ }; softkeys = R_AVKON_SOFTKEYS_SELECT_BACK; } + +RESOURCE DIALOG r_hs_content_removed_view + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = r_hs_error_content_removed; + bmpfile = AVKON_ICON_FILE; + bmpid = EMbmAvkonQgn_note_error; + bmpmask = EMbmAvkonQgn_note_error_mask; + }; + } + }; + } RESOURCE TBUF r_qtn_hs_operation_failed_no_disk { buf = qtn_hs_operation_failed_no_disk; } -RESOURCE TBUF r_qtn_hs_corrupted_image_note +RESOURCE DIALOG r_backup_restore_wait_dialog { - buf = qtn_hs_corrupted_image_note; + flags = EAknWaitNoteFlags; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control= AVKON_NOTE + { + layout = EWaitLayout; + singular_label = qtn_hs_backup_use_prevented; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + }; + } + }; } + +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnuiengineappif.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnuiengineappif.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengineappif.cpp Wed May 12 13:22:51 2010 +0300 @@ -142,38 +142,33 @@ } // ----------------------------------------------------------------------------- -// CXnUiEngine::FindNodeByClassL +// CXnUiEngine::FindContentSourceNodesL // Forwards the call to the ui engine implementation // ----------------------------------------------------------------------------- // EXPORT_C RPointerArray< CXnNodeAppIf > TXnUiEngineAppIf::FindContentSourceNodesL( const TDesC8& aNamespace ) - { + { + CXnPointerArray* array = iUiEngine->FindContentSourceNodesL( aNamespace ); + CleanupStack::PushL( array ); + RPointerArray< CXnNodeAppIf > interfaceArray; CleanupClosePushL( interfaceArray ); - - CXnViewManager* manager( iUiEngine->ViewManager() ); - - CXnPluginData* data( manager->ActiveViewData().Plugin( aNamespace ) ); - - if ( data ) + + const TInt count = array->Container().Count(); + interfaceArray.ReserveL( count ); + + for ( TInt i = 0; i < count; i++ ) { - RPointerArray< CXnNode > nodes; - CleanupClosePushL( nodes ); - - data->ContentSourceNodesL( nodes ); - - for ( TInt i = 0; i < nodes.Count(); i++ ) - { - interfaceArray.AppendL( &nodes[i]->AppIfL() ); - } - - CleanupStack::PopAndDestroy( &nodes ); + CXnNode* node = static_cast< CXnNode* >( array->Container()[i] ); + // Append cannot fail because ReserveL call before this loop has + // allocated the array buffer + interfaceArray.Append( &( node->AppIfL() ) ); } - + CleanupStack::Pop( &interfaceArray ); - - return interfaceArray; + CleanupStack::PopAndDestroy( array ); + return interfaceArray; } // ----------------------------------------------------------------------------- @@ -202,16 +197,6 @@ } // ----------------------------------------------------------------------------- -// TXnUiEngineAppIf::ActivateViewL -// Activate a view -// ----------------------------------------------------------------------------- -// -EXPORT_C void TXnUiEngineAppIf::ActivateViewL( CXnNodeAppIf& aViewNode ) - { - iUiEngine->ActivateViewL( aViewNode.Node() ); - } - -// ----------------------------------------------------------------------------- // TXnUiEngineAppIf::ActiveView // Return the active view // ----------------------------------------------------------------------------- diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp Wed May 12 13:22:51 2010 +0300 @@ -21,6 +21,8 @@ #include #include #include +#include +#include // User includes #include "xnuiengine.h" @@ -32,6 +34,7 @@ #include "xndompropertyvalue.h" #include "xnmenuadapter.h" #include "xnpopupcontroladapter.h" +#include "xnviewcontroladapter.h" #include "xnviewdata.h" #include "xnnodebreadthfirstiterator.h" #include "xntype.h" @@ -48,12 +51,13 @@ #include "xndomdocument.h" #include "xndomnode.h" #include "xneditmode.h" -#include "xnhittest.h" #include "xnnode.h" #include "xnpanic.h" #include "xneffectmanager.h" #include "xneditor.h" #include "xnbackgroundmanager.h" +#include "xntexteditor.h" +#include "xnrootdata.h" #ifdef _XN_PERFORMANCE_TEST_ #include "xntimemon.h" @@ -78,6 +82,7 @@ _LIT8( KScrollableBoxNodeName, "scrollablebox" ); _LIT8( KMenuBar, "menubar" ); _LIT8( KPopUpNodeName, "popup" ); +_LIT8( KEditorNodeName, "texteditor" ); _LIT8( KPlugin, "plugin" ); @@ -269,7 +274,6 @@ CXnUiEngine& aUiEngine ); static void FillFocusCandidatesL( CXnNode* aParent, RPointerArray< CXnNode >& aArray ); -static TInt DetermineStatusPaneLayout( CXnProperty* aProperty ); static TBool SetAdaptivesL( CXnNode& aNode ); static void FindNodeByClassL( CXnNode* aRootNode, const TDesC8& aClassId, @@ -282,6 +286,24 @@ #endif // ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +CXnNode* FindPlugin( CXnNode& aNode ) + { + CXnNode* pluginNode( NULL ); + for( CXnNode* node = &aNode; node; node = node->Parent() ) + { + if( node->DomNode()->Name() == KPlugin ) + { + pluginNode = node; + break; + } + } + return pluginNode; + } + // ----------------------------------------------------------------------------- // GrowIfNeeded() // When a plugin is focused, the focus is a bit bigger than its control @@ -7881,18 +7903,18 @@ if ( Layout_Meta_Data::IsLandscapeOrientation() ) { reasonString = &XnPropertyNames::action::trigger::name:: - uidefinitionmodification::reason::KLandscape; + orientation::reason::KLandscape; } else { reasonString = &XnPropertyNames::action::trigger::name:: - uidefinitionmodification::reason::KPortrait; + orientation::reason::KPortrait; } reasonValue->SetStringValueL( CXnDomPropertyValue::EString, *reasonString ); CXnProperty* reason = CXnProperty::NewL( XnPropertyNames::action::trigger:: - name::uidefinitionmodification::KReason, reasonValue, *sp ); + name::orientation::KReason, reasonValue, *sp ); CleanupStack::Pop( reasonValue ); @@ -7923,52 +7945,6 @@ } // ----------------------------------------------------------------------------- -// DetermineStatusPaneLayout -// ----------------------------------------------------------------------------- -// -static TInt DetermineStatusPaneLayout( CXnProperty* aProperty ) - { - TInt spane( KErrNotFound ); - - if ( aProperty ) - { - const TDesC8& value( aProperty->StringValue() ); - - // Currently supported status pane layout - if ( value == XnPropertyNames::view::statuspanelayout::KNone ) - { - spane = R_AVKON_STATUS_PANE_LAYOUT_EMPTY; - } - if ( value == XnPropertyNames::view::statuspanelayout::KBasic ) - { - spane = R_AVKON_STATUS_PANE_LAYOUT_IDLE; - } - else if ( value == XnPropertyNames::view::statuspanelayout::KBasicFlat ) - { - spane = R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT; - } - else if ( value == - XnPropertyNames::view::statuspanelayout::KWideScreen ) - { - spane = R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE; - } - else if ( value == - XnPropertyNames::view::statuspanelayout::KWideScreenFlat ) - { - spane = R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT; - } - else if ( value == - XnPropertyNames::view::statuspanelayout:: - KWideScreenFlat3Softkeys ) - { - spane = R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT_NO_SOFTKEYS; - } - } - - return spane; - } - -// ----------------------------------------------------------------------------- // SetAdaptivesL // ----------------------------------------------------------------------------- // @@ -8090,9 +8066,7 @@ void CXnUiEngineImpl::ConstructL() { iEditMode = CXnEditMode::NewL( *iUiEngine ); - - iHitTest = CXnHitTest::NewL(); - + iCurrentGraphicsDevice = CCoeEnv::Static()->ScreenDevice(); // Update the units here, even the refence client rect is only a quess. @@ -8127,10 +8101,14 @@ iViewManager.RemoveObserver( *this ); delete iEditMode; - delete iHitTest; iFocusCandidateList.Reset(); - iRedrawRegions.ResetAndDestroy(); + + if ( iRedrawRegions.Count() ) + { + iRedrawRegions.ResetAndDestroy(); + } + iDirtyList.Reset(); } @@ -8299,7 +8277,7 @@ rect = ClientRect(); // Move it to 0, 0 - rect.Move( -rect.iTl.iX, -rect.iTl.iY ); + //rect.Move( -rect.iTl.iX, -rect.iTl.iY ); } else { @@ -8309,7 +8287,15 @@ { AddToRedrawListL( node, rect ); - adapter->SetRect( rect ); + // popup calculates its position based on _s60-position-hint property + if( node->Type()->Type() == KPopUpNodeName ) + { + adapter->DoHandlePropertyChangeL(); + } + else + { + adapter->SetRect( rect ); + } CXnProperty* prop = node->GetPropertyL( XnPropertyNames::common::KSizeAware ); if ( prop && prop->StringValue() == @@ -8351,6 +8337,8 @@ TraceTreeL(iCurrentView ); #endif + __PRINTS("*** CXnUiEngineImpl::RenderUIL ***"); + for( TInt i=0; iiControl; @@ -8361,7 +8349,9 @@ // Mark tree rendered iCurrentView->SetRenderedL(); // Error occured during dirty set, redraw whole window - control->DrawNow(); + control->DrawNow(); + + __PRINTS("* CXnUiEngineImpl::RenderUIL - redraw region error -> full redraw ***"); } else { @@ -8376,7 +8366,10 @@ // Make bounding rect over the dirty areas TRect boundingRect( redrawRegion.BoundingRect() ); - control->DrawNow( boundingRect ); + __PRINT( __DBG_FORMAT( "* CXnUiEngineImpl::RenderUIL - redrawing bounding rect iTl.iX: %d, iTl.iY: %d, iBr.iX: %d, iBr.iY: %d" ), + boundingRect.iTl.iX, boundingRect.iTl.iY, boundingRect.iBr.iX, boundingRect.iBr.iY ); + + control->DrawNow( boundingRect ); } else { @@ -8384,26 +8377,30 @@ { // Draw every dirty area separately TRect redrawRect( redrawRegion[i] ); - + + __PRINT( __DBG_FORMAT( "* CXnUiEngineImpl::RenderUIL - redrawing rect iTl.iX: %d, iTl.iY: %d, iBr.iX: %d, iBr.iY: %d" ), + redrawRect.iTl.iX, redrawRect.iTl.iY, redrawRect.iBr.iX, redrawRect.iBr.iY ); + control->DrawNow( redrawRect ); } } } + else + { + __PRINTS("* CXnUiEngineImpl::RenderUIL - nothing to redraw ***"); + } } + redrawRegion.Clear(); } RefreshMenuL(); - if ( iLayoutControl & XnLayoutControl::EFirstPassDraw ) - { - iViewManager.SetFirstPassDrawCompleteL(); - iLayoutControl &= ~XnLayoutControl::EFirstPassDraw; - } - iLayoutControl &= ~XnLayoutControl::ERenderUI; iAppUiAdapter.EffectManager()->UiRendered(); + + __PRINTS("*** CXnUiEngineImpl::RenderUIL - done ***"); } // ----------------------------------------------------------------------------- @@ -8453,9 +8450,31 @@ const TDesC8& aNamespace ) { // Find the namespace where to start node id look-up - CXnPluginData* pluginData( - iViewManager.ActiveViewData().Plugin( aNamespace ) ); - + CXnViewData& active( iViewManager.ActiveViewData() ); + + CXnPluginData* pluginData( active.Plugin( aNamespace ) ); + + if ( aNamespace != KNullDesC8 && !pluginData ) + { + RPointerArray< CXnPluginData >& views( + iViewManager.ActiveAppData().PluginData() ); + + for ( TInt i = 0; i < views.Count(); i++ ) + { + CXnViewData* view = static_cast< CXnViewData* >( views[i] ); + + if ( view != &active ) + { + pluginData = view->Plugin( aNamespace ); + + if ( pluginData ) + { + break; + } + } + } + } + if ( !pluginData ) { return NULL; @@ -8495,9 +8514,31 @@ const TDesC8& aClassId, const TDesC8& aNamespace ) { // Find the namespace where to start node class look-up - CXnPluginData* pluginData( - iViewManager.ActiveViewData().Plugin( aNamespace ) ); - + CXnViewData& active( iViewManager.ActiveViewData() ); + + CXnPluginData* pluginData( active.Plugin( aNamespace ) ); + + if ( aNamespace != KNullDesC8 && !pluginData ) + { + RPointerArray< CXnPluginData >& views( + iViewManager.ActiveAppData().PluginData() ); + + for ( TInt i = 0; i < views.Count(); i++ ) + { + CXnViewData* view = static_cast< CXnViewData* >( views[i] ); + + if ( view != &active ) + { + pluginData = view->Plugin( aNamespace ); + + if ( pluginData ) + { + break; + } + } + } + } + CXnPointerArray* array = CXnPointerArray::NewL(); CleanupStack::PushL( array ); @@ -8511,6 +8552,65 @@ return array; } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::FindContentSourceNodesL() +// ----------------------------------------------------------------------------- +// +CXnPointerArray* CXnUiEngineImpl::FindContentSourceNodesL( + const TDesC8& aNamespace ) + { + CXnViewData& active( iViewManager.ActiveViewData() ); + + CXnPluginData* pluginData( active.Plugin( aNamespace ) ); + + if ( aNamespace != KNullDesC8 && !pluginData ) + { + RPointerArray< CXnPluginData >& views( + iViewManager.ActiveAppData().PluginData() ); + + for ( TInt i = 0; i < views.Count(); i++ ) + { + CXnViewData* view = static_cast< CXnViewData* >( views[i] ); + + if ( view != &active ) + { + pluginData = view->Plugin( aNamespace ); + + if ( pluginData ) + { + break; + } + } + } + } + + CXnPointerArray* array = CXnPointerArray::NewL(); + CleanupStack::PushL( array ); + + if ( pluginData ) + { + RPointerArray< CXnNode > list; + CleanupClosePushL( list ); + + pluginData->ContentSourceNodesL( list ); + + const TInt count( list.Count() ); + + array->Container().ReserveL( count ); + + for ( TInt i = 0; i < count; i++ ) + { + array->Container().Append( list[i] ); + } + + CleanupStack::PopAndDestroy( &list ); + } + + CleanupStack::Pop( array ); + + return array; + } // ----------------------------------------------------------------------------- // CXnUiEngineImpl::Resources() @@ -8527,7 +8627,10 @@ // void CXnUiEngineImpl::SetFocusedNodeL( CXnNode* aFocusedNode, TInt aSource ) { - iKeyEventDispatcher->SetNodeL( aFocusedNode, aSource ); + if ( iKeyEventDispatcher ) + { + iKeyEventDispatcher->SetNodeL( aFocusedNode, aSource ); + } } // ----------------------------------------------------------------------------- @@ -8537,7 +8640,12 @@ // CXnNode* CXnUiEngineImpl::FocusedNode() { - return iKeyEventDispatcher->FocusedNode(); + if ( iKeyEventDispatcher ) + { + return iKeyEventDispatcher->FocusedNode(); + } + + return NULL; } // ----------------------------------------------------------------------------- @@ -8561,36 +8669,19 @@ iControlAdapterList = &iViewManager.Controls(); iCurrentViewControlAdapter = iCurrentView->Control(); - iLayoutControl |= XnLayoutControl::EFirstPassDraw; - iDirtyList.Reset(); iRedrawRegions.ResetAndDestroy(); - - // Set status pane layout - CXnProperty* prop( iCurrentView->GetPropertyL( - XnPropertyNames::view::KStatusPaneLayout ) ); - - // Is there status pane declaration available - TInt spane( DetermineStatusPaneLayout( prop ) ); - - if ( spane != KErrNotFound ) - { - CEikStatusPane* sp( iAppUiAdapter.StatusPane() ); - - if ( sp && sp->CurrentLayoutResId() != spane ) - { - sp->SwitchLayoutL( spane ); - sp->ApplyCurrentSettingsL(); - } - } // Remove previous menubar and stylus popup node iMenuNode = NULL; iStylusPopupNode = NULL; - iKeyEventDispatcher->ResetMenuNodeL(); - + if ( iKeyEventDispatcher ) + { + iKeyEventDispatcher->ResetMenuNodeL(); + } + RPointerArray< CXnNode >& children( iCurrentView->Children() ); for ( TInt count = children.Count() - 1; count >= 0 ; --count ) @@ -8622,14 +8713,17 @@ // Set menu node even if its NULL, to allow keyevent dispatcher // to handle no softkeys - iKeyEventDispatcher->SetMenuNodeL( iMenuNode ); - + if ( iKeyEventDispatcher ) + { + iKeyEventDispatcher->SetMenuNodeL( iMenuNode ); + } + ReportScreenDeviceChangeL(); SetClientRectL( iAppUiAdapter.ClientRect(), EFalse ); RootNode()->SetDirtyL(); - iUiEngine->RenderUIL(); + ForceRenderUIL(); } // ----------------------------------------------------------------------------- @@ -8639,7 +8733,6 @@ void CXnUiEngineImpl::NotifyWidgetAdditionL( const CXnPluginData& /*aPluginData*/ ) { - iLayoutControl |= XnLayoutControl::EFirstPassDraw; } // ----------------------------------------------------------------------------- @@ -8685,9 +8778,9 @@ { if ( aPlugin && &aPlugin->Node() ) { - CXnPluginData& data( viewData.Plugin( &aPlugin->Node() ) ); + CXnPluginData* data( viewData.Plugin( &aPlugin->Node() ) ); - if ( !data.Occupied() ) + if ( data && !data->Occupied() ) { retval = ETrue; } @@ -8699,9 +8792,9 @@ if ( node ) { - CXnPluginData& data( viewData.Plugin( node ) ); + CXnPluginData* data( viewData.Plugin( node ) ); - if ( data.Removable() && data.Occupied() ) + if ( data && data->Removable() && data->Occupied() ) { retval = ETrue; } @@ -8830,7 +8923,11 @@ { if ( iLayoutControl & XnLayoutControl::ERefreshMenu ) { - iKeyEventDispatcher->RefreshMenuL(); + if ( iKeyEventDispatcher ) + { + iKeyEventDispatcher->RefreshMenuL(); + } + iLayoutControl &= ~XnLayoutControl::ERefreshMenu; } } @@ -8916,7 +9013,7 @@ // ----------------------------------------------------------------------------- // void CXnUiEngineImpl::HandleResourceChangeL( TInt aType ) - { + { if ( iMenuNode ) { CXnControlAdapter* adapter( iMenuNode->Control() ); @@ -8929,61 +9026,114 @@ if ( aType == KEikDynamicLayoutVariantSwitch ) { - // Must return here if there is no current view or - // controladapterlist. This may occur when the phone - // is booted for the first time and the location/date - // query is visible. - if ( !ActiveView() ) - { - return; - } - - // Update client rect - SetClientRectL( iAppUiAdapter.ClientRect(), EFalse ); - - // Update background rect - // Bg rect is always screen size. - TRect bgRect; - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, bgRect ); - iAppUiAdapter.ViewAdapter().BgManager().SetRect( bgRect ); - - iEditMode->HandleScreenDeviceChangedL(); - - // Force relayout - DisableRenderUiLC(); - - RootNode()->SetDirtyL(); - - ReportScreenDeviceChangeL(); - - for ( TInt i = 0; i < iControlAdapterList->Count(); i++ ) - { - CXnControlAdapter* adapter( ( *iControlAdapterList )[i] ); - - adapter->HandleScreenDeviceChangedL(); - } - - ForceRenderUIL(); - - CleanupStack::PopAndDestroy(); + HandleDynamicLayoutVariantSwitchL(); } else if ( aType == KAknsMessageSkinChange ) { - // Force relayout - DisableRenderUiLC(); + HandleSkinChangeL(); + } + else if( iCurrentViewControlAdapter ) + { + iCurrentViewControlAdapter->HandleResourceChange( aType ); + } + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::HandleSkinChangeL +// Handles a skin change to the controls +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::HandleSkinChangeL() + { + // Force relayout + DisableRenderUiLC(); + + RootNode()->SetDirtyL(); + + for ( TInt i = 0; i < iControlAdapterList->Count(); i++ ) + { + CXnControlAdapter* adapter( ( *iControlAdapterList )[i] ); + adapter->SkinChanged(); + } + + ForceRenderUIL(); + + CleanupStack::PopAndDestroy(); + + // Handle inactive views + RPointerArray< CXnPluginData >& views( + iAppUiAdapter.ViewManager().ActiveAppData().PluginData() ); + + for ( TInt i = 0; i < views.Count(); i++ ) + { + CXnViewData* view = static_cast< CXnViewData* >( views[i] ); + if ( view && !view->Active() ) + { + RPointerArray< CXnControlAdapter > controls; + CleanupClosePushL( controls ); + view->ControlsL( controls ); + for ( TInt j = 0; j < controls.Count(); j++ ) + { + controls[j]->SkinChanged(); + } + CleanupStack::PopAndDestroy( &controls ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::HandleDynamicLayoutVariantSwitchL +// Handles a KEikDynamicLayoutVariantSwitch resource change +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::HandleDynamicLayoutVariantSwitchL() + { + // Must return here if there is no current view or + // controladapterlist. This may occur when the phone + // is booted for the first time and the location/date + // query is visible. + if ( !ActiveView() ) + { + return; + } + + // remove focus + iAppUiAdapter.HideFocus(); + + // Update client rect + SetClientRectL( iAppUiAdapter.ClientRect(), EFalse ); + + // Update background rect + // Bg rect is always screen size. + TRect bgRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, bgRect ); + iAppUiAdapter.ViewAdapter().BgManager().SetRect( bgRect ); + + iEditMode->HandleScreenDeviceChangedL(); + + // Force relayout + DisableRenderUiLC(); + + RootNode()->SetDirtyL(); + + ReportScreenDeviceChangeL(); + + iViewManager.OrientationChanged(); + + if ( !iControlAdapterList ) + { + iControlAdapterList = &iViewManager.Controls(); + } + for ( TInt i = 0; i < iControlAdapterList->Count(); i++ ) + { + CXnControlAdapter* adapter( ( *iControlAdapterList )[i] ); - RootNode()->SetDirtyL(); - - for ( TInt i = 0; i < iControlAdapterList->Count(); i++ ) - { - CXnControlAdapter* adapter( ( *iControlAdapterList )[i] ); - adapter->SkinChanged(); - } - - ForceRenderUIL(); - - CleanupStack::PopAndDestroy(); - } + adapter->HandleScreenDeviceChangedL(); + } + + ForceRenderUIL(); + + CleanupStack::PopAndDestroy(); } // ----------------------------------------------------------------------------- @@ -8993,7 +9143,12 @@ // TBool CXnUiEngineImpl::IsMenuDisplaying() { - return iKeyEventDispatcher->IsMenuFocused(); + if ( iKeyEventDispatcher ) + { + return iKeyEventDispatcher->IsMenuFocused(); + } + + return EFalse; } // ----------------------------------------------------------------------------- @@ -9022,7 +9177,10 @@ // void CXnUiEngineImpl::AddPassiveFocusedNodeL( CXnNode* aNode ) { - iKeyEventDispatcher->AddPassiveFocusedNodeL( aNode ); + if ( iKeyEventDispatcher ) + { + iKeyEventDispatcher->AddPassiveFocusedNodeL( aNode ); + } } // ----------------------------------------------------------------------------- @@ -9031,7 +9189,10 @@ // void CXnUiEngineImpl::RemovePassiveFocusedNodeL( CXnNode* aNode ) { - iKeyEventDispatcher->RemovePassiveFocusedNodeL( aNode ); + if ( iKeyEventDispatcher ) + { + iKeyEventDispatcher->RemovePassiveFocusedNodeL( aNode ); + } } // ----------------------------------------------------------------------------- @@ -9040,7 +9201,10 @@ // void CXnUiEngineImpl::ClearPassiveFocusedNodesL() { - iKeyEventDispatcher->ClearPassiveFocusedNodesL(); + if ( iKeyEventDispatcher ) + { + iKeyEventDispatcher->ClearPassiveFocusedNodesL(); + } } // ----------------------------------------------------------------------------- @@ -9183,11 +9347,15 @@ } TBool retval( EFalse ); - if ( iDisableCount > 0 && - !( iLayoutControl & XnLayoutControl::EIgnoreState ) ) - { - retval = ETrue; - } + + if ( !( iLayoutControl & XnLayoutControl::EIgnoreState ) ) + { + if ( iDisableCount > 0 ) + { + retval = ETrue; + } + } + return retval; } @@ -9270,6 +9438,10 @@ { // Force relayout and redraw from current view iDirtyList.Reset(); + if ( !iCurrentView ) + { + iCurrentView = iViewManager.ViewNode(); + } iDirtyList.AppendL( iCurrentView ); TXnDirtyRegion* dirtyRegion = FindDirtyRegionL( *iCurrentView ); if( dirtyRegion ) @@ -9385,8 +9557,6 @@ UpdateInternalUnits( iHorizontalUnitInPixels, iVerticalUnitInPixels, iClientRect ); - iAppUiAdapter.ViewAdapter().BgControl().SetRect( aRect ); - if ( aDrawNow ) { RootNode()->SetDirtyL(); @@ -9505,248 +9675,6 @@ } // ----------------------------------------------------------------------------- -// CXnUiEngineImpl::HitTest -// ----------------------------------------------------------------------------- -// -CXnHitTest& CXnUiEngineImpl::HitTest() const - { - return *iHitTest; - } - -// ----------------------------------------------------------------------------- -// CXnUiEngineImpl::PositionStylusPopupL -// ----------------------------------------------------------------------------- -// -void CXnUiEngineImpl::PositionStylusPopupL( CXnNode& aNode, - CXnNode& aReference, const TPoint& aPosition ) - { - CXnDomStringPool* sp( aNode.DomNode()->StringPool() ); - TXnDirtyRegion* dirtyRegion = FindDirtyRegionL( *iCurrentView ); - RRegion region; - region.Copy( dirtyRegion->iRegion ); - CleanupClosePushL( region ); - - // Set initial position to (0, 0) to calculate popup metrics - CXnProperty* top = CXnProperty::NewL( - XnPropertyNames::style::common::KTop, 0, - CXnDomPropertyValue::EPx, *sp ); - CleanupStack::PushL( top ); - aNode.SetPropertyL( top ); - CleanupStack::Pop( top ); - top = NULL; - CXnProperty* left = CXnProperty::NewL( - XnPropertyNames::style::common::KLeft, 0, - CXnDomPropertyValue::EPx, *sp ); - CleanupStack::PushL( left ); - aNode.SetPropertyL( left ); - CleanupStack::Pop( left ); - left = NULL; - - // Make it visible - CXnProperty* display = CXnProperty::NewL( - XnPropertyNames::style::common::KDisplay, - XnPropertyNames::style::common::display::KBlock, - CXnDomPropertyValue::EString, *sp ); - CleanupStack::PushL( display ); - aNode.SetPropertyL( display ); - CleanupStack::Pop( display ); - - if ( !aNode.IsLaidOut() || !aReference.IsLaidOut() ) - { - ForceRenderUIL( ETrue ); - } - - if ( !aNode.IsLaidOut() || !aReference.IsLaidOut() ) - { - // Something went wrong - CleanupStack::PopAndDestroy( ®ion ); - - return; - } - - TRect rectToFit( aReference.MarginRect() ); - TRect marginRect( aNode.MarginRect() ); - - if ( marginRect.Height() > rectToFit.Height() || - marginRect.Width() > rectToFit.Width() ) - { - // Won't fit even how much is moved - CleanupStack::PopAndDestroy( ®ion ); - - return; - } - - TPoint tl; - TPoint br; - - // Remove the initial 0,0 from redraw region and rects - dirtyRegion->iRegion.Clear(); - ClearRects( aNode, ETrue ); - CXnProperty* positionHint( aNode.GetPropertyL( - XnPropertyNames::styluspopup::KPositionHint ) ); - - // Default - const TDesC8* value( &XnPropertyNames::styluspopup::positionhint::KAbove ); - - if ( positionHint ) - { - value = &positionHint->StringValue(); - } - - if ( *value == XnPropertyNames::styluspopup::positionhint::KAbove ) - { - if ( AknLayoutUtils::LayoutMirrored() ) - { - tl = aPosition; - tl.iY -= marginRect.Height(); - tl.iX -= marginRect.Width(); - - // Will the popup float out? - if ( !rectToFit.Contains( tl ) ) - { - // top left floated out - TInt y( rectToFit.iTl.iY - tl.iY + 1 ); - - if ( y >= 0 ) - { - // y-coordinate floated out, move it position - // so that it will be inside reference rect - tl.iY = tl.iY + y; - } - - TInt x( rectToFit.iTl.iX - tl.iX + 1 ); - - if ( x >= 0 ) - { - // x-coordinate floated out, move it position - // so that it will be inside reference rect - tl.iX = tl.iX + x; - } - } - } - else - { - tl = aPosition; - tl.iY -= marginRect.Height(); - - // Will the popup float out? - if ( !rectToFit.Contains( tl ) ) - { - // top left floated out - TInt y( rectToFit.iTl.iY - tl.iY + 1 ); - - if ( y >= 0 ) - { - // y-coordinate floated out, move it position - // so that it will be inside reference rect - tl.iY = tl.iY + y; - } - } - - br = TPoint( tl.iX + marginRect.Width(), - tl.iY + marginRect.Height() ); - - if ( !rectToFit.Contains( br ) ) - { - // bottom right floated out - TInt x( br.iX - rectToFit.iBr.iX + 1 ); - - if ( x >= 0 ) - { - // x-coordinate floated out, move it position - // so that it will be inside reference rect - tl.iX = tl.iX - x; - } - } - } - } - else // value == XnPropertyNames::styluspopup::positionhint::KBelow - { - if ( AknLayoutUtils::LayoutMirrored() ) - { - tl = aPosition; - tl.iX = tl.iX - marginRect.Width(); - - if ( !rectToFit.Contains( tl ) ) - { - // Top left floated out - TInt x( rectToFit.iTl.iX - tl.iX + 1 ); - - if ( x >= 0 ) - { - // x-coordinate floated out, move it position - // so that it will be inside reference rect - tl.iX = tl.iX + x; - } - } - - br = TPoint( tl.iX + marginRect.Width(), - tl.iY + marginRect.Height() ); - - if ( !rectToFit.Contains( br ) ) - { - // bottom right floated out - TInt y( br.iY - rectToFit.iBr.iY + 1 ); - - if ( y >= 0 ) - { - // y-coordinate floated out, move it position - // so that it will be inside reference rect - tl.iY = tl.iY - y; - } - } - } - else - { - tl = aPosition; - br = TPoint( tl.iX + marginRect.Width(), - tl.iY + marginRect.Height() ); - - // Will the popup float out? - if ( !rectToFit.Contains( br ) ) - { - // Bottom right floated out - TInt x( br.iX - rectToFit.iBr.iX + 1 ); - - if ( x >= 0 ) - { - // x-coordinate floated out, move it position - // so that it will be inside reference rect - tl.iX = tl.iX - x; - } - - TInt y( br.iY - rectToFit.iBr.iY + 1 ); - - if ( y >= 0 ) - { - // y-coordinate floated out, move it position - // so that it will be inside reference rect - tl.iY = tl.iY - y; - } - } - } - } - - // Set positions - top = CXnProperty::NewL( - XnPropertyNames::style::common::KTop, tl.iY, - CXnDomPropertyValue::EPx, *sp ); - CleanupStack::PushL( top ); - aNode.SetPropertyL( top ); - CleanupStack::Pop( top ); - left = CXnProperty::NewL( - XnPropertyNames::style::common::KLeft, tl.iX, - CXnDomPropertyValue::EPx, *sp ); - CleanupStack::PushL( left ); - aNode.SetPropertyL( left ); - CleanupStack::Pop( left ); - - // Copy stored region back - dirtyRegion->iRegion.Copy( region ); - CleanupStack::PopAndDestroy( ®ion ); - } - -// ----------------------------------------------------------------------------- // CXnUiEngineImpl::GetThemeResource // ----------------------------------------------------------------------------- // @@ -9947,6 +9875,96 @@ } // ----------------------------------------------------------------------------- +// CXnUiEngineImpl::HandlePartialTouchInputL() +// ----------------------------------------------------------------------------- +void CXnUiEngineImpl::HandlePartialTouchInputL( CXnNode& aNode, TBool aEnable ) + { + CXnNode* editorplugin = FindPlugin( aNode ); + if ( !editorplugin ) + { + User::Leave( KErrNotFound ); + } + + DisableRenderUiLC(); + + if ( aEnable ) + { + iSplitScreenState.iPartialScreenOpen = ETrue; + iSplitScreenState.iPartialScreenEditorNode = &aNode; + + // make sure that we always get up event + CXnViewControlAdapter* control = static_cast< CXnViewControlAdapter* >( + iViewManager.ActiveViewData().ViewNode()->Control() ); + + control->ResetGrabbing(); + + // Block progression must be bottom-to-top when partial screen is open + // Previous value needs to be stored first + CXnProperty* prop( + editorplugin->Parent()->GetPropertyL( + XnPropertyNames::style::common::KBlockProgression ) ); + if ( prop ) + { + iSplitScreenState.iPartialScreenBlock = &prop->StringValue(); + } + else + { + iSplitScreenState.iPartialScreenBlock = + &XnPropertyNames::style::common::block_progression::KTB(); + } + + SetPartialScreenBlockProgressionL( + editorplugin->Parent(), + XnPropertyNames::style::common::block_progression::KBT ); + + // Hide all plugins except the one that contains given editor node + RPointerArray< CXnNode >& plugins( *Plugins() ); + for( TInt i=0; iMakeVisible( EFalse ); + } + + else + { + // Show plugin nodes again + RPointerArray< CXnNode >& plugins( *Plugins() ); + + for( TInt i=0; iParent(), + *iSplitScreenState.iPartialScreenBlock ); + + iSplitScreenState.iPartialScreenBlock = NULL; + iSplitScreenState.iPartialScreenEditorNode = NULL; + iSplitScreenState.iPartialScreenOpen = EFalse; + + // Show statuspane again + iAppUiAdapter.StatusPane()->MakeVisible(ETrue); + } + + RootNode()->SetDirtyL(); + ForceRenderUIL(); + CleanupStack::PopAndDestroy(); + } + +// ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- CCoeControl* CXnUiEngineImpl::WindowOwningControl( CXnNode& aNode ) { @@ -10027,7 +10045,7 @@ // ----------------------------------------------------------------------------- void CXnUiEngineImpl::NotifyStatusPaneSizeChanged() { - TRAP_IGNORE( iUiEngine->SetClientRectL( iAppUiAdapter.ClientRect() ) ); + TRAP_IGNORE( iUiEngine->SetClientRectL( iAppUiAdapter.ClientRect(), EFalse ) ); } // ----------------------------------------------------------------------------- @@ -10038,4 +10056,98 @@ TRAP_IGNORE( HandleResourceChangeL( aType ) ); } +// ----------------------------------------------------------------------------- +// EnablePartialTouchInput +// ----------------------------------------------------------------------------- +void CXnUiEngineImpl::EnablePartialTouchInput( CXnNode& aNode, TBool aEnable ) + { + if( aEnable && !iSplitScreenState.iPartialScreenOpen || + !aEnable && iSplitScreenState.iPartialScreenOpen ) + { + TRAP_IGNORE( HandlePartialTouchInputL( aNode, aEnable ) ); + } + } + +// ----------------------------------------------------------------------------- +// SetNodeVisibleL +// ----------------------------------------------------------------------------- +void CXnUiEngineImpl::SetNodeVisibleL( CXnNode* aNode , TBool aVisible ) + { + CXnDomStringPool* sp( iUiEngine->ODT()->DomDocument().StringPool()); + + if(!aVisible) + { + CXnProperty* display = CXnProperty::NewL( + XnPropertyNames::style::common::KDisplay, + XnPropertyNames::style::common::display::KNone, + CXnDomPropertyValue::EString, *sp ); + + CleanupStack::PushL( display ); + aNode->SetPropertyL(display); + CleanupStack::Pop( display ); + } + else + { + CXnProperty* visible = CXnProperty::NewL( + XnPropertyNames::style::common::KDisplay, + XnPropertyNames::style::common::display::KBlock, + CXnDomPropertyValue::EString, *sp ); + + CleanupStack::PushL( visible ); + aNode->SetPropertyL(visible); + CleanupStack::Pop( visible ); + } + } + +// ----------------------------------------------------------------------------- +// SetPartialScreenBlockProgressionL +// ----------------------------------------------------------------------------- +void CXnUiEngineImpl::SetPartialScreenBlockProgressionL( + CXnNode* aParent, const TDesC8& aBlockProgression ) + { + CXnDomStringPool* sp( iUiEngine->ODT()->DomDocument().StringPool()); + if( aParent && sp ) + { + CXnProperty* block_progression = CXnProperty::NewL( + XnPropertyNames::style::common::KBlockProgression, + aBlockProgression, + CXnDomPropertyValue::EString, *sp ); + if ( block_progression ) + { + CleanupStack::PushL( block_progression ); + aParent->SetPropertyL(block_progression); + CleanupStack::Pop( block_progression ); + } + } + } + +// ----------------------------------------------------------------------------- +// isPartialInputActive +// ----------------------------------------------------------------------------- +TBool CXnUiEngineImpl::IsPartialInputActive() + { + return iSplitScreenState.iPartialScreenOpen; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::IsTextEditorActive() +// ----------------------------------------------------------------------------- +// +TBool CXnUiEngineImpl::IsTextEditorActive() + { + if( iSplitScreenState.iPartialScreenOpen ) + { + return ETrue; + } + CXnNode* focusedNode = FocusedNode(); + if( focusedNode ) + { + if( focusedNode->Type()->Type() == KEditorNodeName ) + { + return ETrue; + } + } + return EFalse; + } + // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnuienginepluginif.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnuienginepluginif.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuienginepluginif.cpp Wed May 12 13:22:51 2010 +0300 @@ -28,7 +28,6 @@ #include "xneditor.h" #include "xnviewdata.h" #include "xndomnode.h" -#include "xnhittest.h" #include "xnpanic.h" // ============================ MEMBER FUNCTIONS =============================== @@ -182,15 +181,6 @@ } // ----------------------------------------------------------------------------- -// TXnUiEnginePluginIf::RestorePreviousFocusedNode -// Forwards the call to the ui engine implementation -// ----------------------------------------------------------------------------- -// -EXPORT_C void TXnUiEnginePluginIf::RestorePreviousFocusedNode() - { - } - -// ----------------------------------------------------------------------------- // TXnUiEnginePluginIf::StringPool // Forwards the call to the ui engine implementation // ----------------------------------------------------------------------------- @@ -245,16 +235,6 @@ } // ----------------------------------------------------------------------------- -// TXnUiEnginePluginIf::ActivateViewL -// Activate a view -// ----------------------------------------------------------------------------- -// -EXPORT_C void TXnUiEnginePluginIf::ActivateViewL( CXnNodePluginIf& aViewNode ) - { - iUiEngine->ActivateViewL( aViewNode.Node() ); - } - -// ----------------------------------------------------------------------------- // TXnUiEnginePluginIf::ScreenDeviceSize // Get the size of the current screen device // ----------------------------------------------------------------------------- @@ -330,35 +310,8 @@ } // ----------------------------------------------------------------------------- -// TXnUiEnginePluginIf::HitRegion -// ----------------------------------------------------------------------------- -// -EXPORT_C CXnControlAdapter* TXnUiEnginePluginIf::HitRegion() const - { - return iUiEngine->HitTest().HitRegion(); - } - -// ----------------------------------------------------------------------------- -// TXnUiEnginePluginIf::DeactivateFocusedNodeL -// Deactivates focused node -// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::PluginNodeL // -EXPORT_C void TXnUiEnginePluginIf::DeactivateFocusedNodeL() - { - } - -// ----------------------------------------------------------------------------- -// TXnUiEnginePluginIf::ShowFocus -// Queries wheter focus is visible -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool TXnUiEnginePluginIf::ShowFocus() - { - return EFalse; - } - -// ----------------------------------------------------------------------------- -// TXnUiEnginePluginIf::PluginNodeL // ----------------------------------------------------------------------------- // EXPORT_C CXnNodePluginIf& TXnUiEnginePluginIf::PluginNodeL( @@ -370,14 +323,17 @@ if ( manager ) { - CXnPluginData& pluginData( + CXnPluginData* pluginData( manager->ActiveViewData().Plugin( &aNode->Node() ) ); + + if ( pluginData ) + { + CXnDomNode* domNode( pluginData->Owner() ); - CXnDomNode* domNode( pluginData.Owner() ); - - if ( domNode ) - { - node = domNode->LayoutNode(); + if ( domNode ) + { + node = domNode->LayoutNode(); + } } } @@ -390,44 +346,6 @@ } // ----------------------------------------------------------------------------- -// TXnUiEnginePluginIf::SetFocusVisibleL -// Sets focus visibility of active view -// ----------------------------------------------------------------------------- -// -EXPORT_C void TXnUiEnginePluginIf::SetFocusVisibleL( TBool /*aVisible*/ ) - { - } - -// ----------------------------------------------------------------------------- -// TXnUiEnginePluginIf::FocusVisible -// Gets focus visibility of active view -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool TXnUiEnginePluginIf::FocusVisible() - { - return EFalse; - } - -// ----------------------------------------------------------------------------- -// TXnUiEnginePluginIf::EnableSwipeL -// Sets swipe enabled or disabled -// ----------------------------------------------------------------------------- -// -EXPORT_C void TXnUiEnginePluginIf::EnableSwipeL( TBool /*aEnable*/ ) - { - } - -// ----------------------------------------------------------------------------- -// TXnUiEnginePluginIf::SwipeEnabledL -// queries whether swipe is enabled or not -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool TXnUiEnginePluginIf::SwipeEnabledL() - { - return EFalse; - } - -// ----------------------------------------------------------------------------- // TXnUiEnginePluginIf::DisableRenderUiLC // // ----------------------------------------------------------------------------- @@ -437,5 +355,26 @@ iUiEngine->DisableRenderUiLC(); } +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::EnablePartialTouchInput +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void TXnUiEnginePluginIf::EnablePartialTouchInput( + CXnNodePluginIf& aNode, TBool aEnable ) + { + iUiEngine->EnablePartialTouchInput(aNode.Node(), aEnable); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::IsTextEditorActive +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool TXnUiEnginePluginIf::IsTextEditorActive() + { + return iUiEngine->IsTextEditorActive(); + } + // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnuistatelistener.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnuistatelistener.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuistatelistener.cpp Wed May 12 13:22:51 2010 +0300 @@ -96,6 +96,17 @@ } // ----------------------------------------------------------------------------- +// CXnUiStateListener::PrepareToExit() +// Prepares for application exit +// ----------------------------------------------------------------------------- +// +void CXnUiStateListener::PrepareToExit() + { + iUiStateObservers.Reset(); + iResourceChangeObservers.Reset(); + } + +// ----------------------------------------------------------------------------- // CXnUiStateListener::AddObserver() // Adds MXnUiStateObserver // ----------------------------------------------------------------------------- diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp Wed May 12 13:22:51 2010 +0300 @@ -18,6 +18,7 @@ // System includes #include #include +#include // User includes #include "xnappuiadapter.h" @@ -36,7 +37,6 @@ #include "xnnodeimpl.h" #include "xnnode.h" #include "xntype.h" -#include "xnbgcontrol.h" #include "xnfocuscontrol.h" #include "xneditor.h" #include "xnbackgroundmanager.h" @@ -44,14 +44,19 @@ #include "xnviewadapter.h" #include "xnmenu.h" #include "xneditmode.h" +#include "xnrootdata.h" + +#include "debug.h" // Constants const TUid KXmlViewUid = { 1 }; +_LIT8( KActivateDefaultView, "activatedefault" ); +_LIT8( KMenuBar, "menubar" ); // Data types enum { - EIsActivated, + EIsActivated, EIsInCall, EIsLightsOn, EIsForeground, @@ -61,6 +66,52 @@ // ============================= LOCAL FUNCTIONS =============================== // ----------------------------------------------------------------------------- +// DetermineStatusPaneLayout +// ----------------------------------------------------------------------------- +// +static TInt DetermineStatusPaneLayout( CXnProperty* aProperty ) + { + TInt spane( KErrNotFound ); + + if ( aProperty ) + { + const TDesC8& value( aProperty->StringValue() ); + + // Currently supported status pane layout + if ( value == XnPropertyNames::view::statuspanelayout::KNone ) + { + spane = R_AVKON_STATUS_PANE_LAYOUT_EMPTY; + } + if ( value == XnPropertyNames::view::statuspanelayout::KBasic ) + { + spane = R_AVKON_STATUS_PANE_LAYOUT_IDLE; + } + else if ( value == XnPropertyNames::view::statuspanelayout::KBasicFlat ) + { + spane = R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT; + } + else if ( value == + XnPropertyNames::view::statuspanelayout::KWideScreen ) + { + spane = R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE; + } + else if ( value == + XnPropertyNames::view::statuspanelayout::KWideScreenFlat ) + { + spane = R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT; + } + else if ( value == + XnPropertyNames::view::statuspanelayout:: + KWideScreenFlat3Softkeys ) + { + spane = R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT_NO_SOFTKEYS; + } + } + + return spane; + } + +// ----------------------------------------------------------------------------- // BuildTriggerL // ----------------------------------------------------------------------------- // @@ -155,11 +206,11 @@ // ----------------------------------------------------------------------------- // CXnViewAdapter::~CXnViewAdapter() - { + { + delete iTimer; delete iActivate; delete iDeactivate; - delete iEditState; - delete iBgControl; + delete iEditState; delete iBgManager; delete iFocusControl; } @@ -187,11 +238,11 @@ { BaseConstructL(); + iTimer = CPeriodic::NewL( CActive::EPriorityIdle ); + // Base class CAknViewAppUi takes ownership of iViewAdapter iAppUiAdapter.AddViewL( this ); - - iBgControl = CXnBgControl::NewL(); - iBgControl->SetMopParent( this ); + iAppUiAdapter.SetDefaultViewL( *this ); iBgManager = CXnBackgroundManager::NewL( iAppUiAdapter.ViewManager(), iAppUiAdapter.ViewManager().Editor().HspsWrapper() ); @@ -240,21 +291,18 @@ } // ----------------------------------------------------------------------------- -// CXnViewAdapter::PrepareDestroy +// CXnViewAdapter::PrepareToExit // Sets view to be destroyed // ----------------------------------------------------------------------------- // -void CXnViewAdapter::PrepareDestroy() - { - iAppUiAdapter.UiStateListener().RemoveObserver( *this ); - iBgControl->PrepareDestroy(); - - TRAP_IGNORE( DeactivateContainerL() ); - +void CXnViewAdapter::PrepareToExit() + { iAppUiAdapter.RemoveFromStack( iEventDispatcher ); delete iEventDispatcher; iEventDispatcher = NULL; + iAppUiAdapter.UiEngine().SetEventDispatcher( NULL ); + iContainer = NULL; iFlags.Set( EIsDestructionRunning ); @@ -271,16 +319,6 @@ } // ----------------------------------------------------------------------------- -// CXnViewAdapter::BgControl -// Returns bg control. -// ----------------------------------------------------------------------------- -// -CCoeControl& CXnViewAdapter::BgControl() const - { - return *iBgControl; - } - -// ----------------------------------------------------------------------------- // CXnViewAdapter::BgManager // Returns background manager. // ----------------------------------------------------------------------------- @@ -291,7 +329,7 @@ } // ----------------------------------------------------------------------------- -// CXnViewAdapter::BgControl +// CXnViewAdapter::FocusControl // Returns focus control. // ----------------------------------------------------------------------------- // @@ -317,17 +355,25 @@ // void CXnViewAdapter::DoActivateL( const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, - const TDesC8& /*aCustomMessage*/ ) + const TDesC8& aCustomMessage ) { if ( iFlags.IsSet( EIsDestructionRunning ) ) { return; } + + __TICK( "CXnViewAdapter::DoActivateL" ); + __TIME_MARK( time ); iFlags.Set( EIsActivated ); + // State must be cleared before adding to stack + iEventDispatcher->ClearStateL(); iAppUiAdapter.AddToStackL( *this, iEventDispatcher ); + // enable statuspane transparancy + CEikStatusPane* sp( iAppUiAdapter.StatusPane() ); + CEikButtonGroupContainer* bgc( iAppUiAdapter.Cba() ); if ( bgc ) @@ -338,12 +384,72 @@ iAppUiAdapter.RemoveFromStack( cba ); } - - iBgControl->MakeVisible( ETrue ); + iBgManager->MakeVisible( ETrue ); + + // Set status pane layout + CXnViewData& viewData( iAppUiAdapter.ViewManager().ActiveViewData() ); + CXnProperty* prop( viewData.Node()->LayoutNode()->GetPropertyL( + XnPropertyNames::view::KStatusPaneLayout ) ); + + // Is there status pane declaration available + TInt spane( DetermineStatusPaneLayout( prop ) ); + + if ( spane != KErrNotFound ) + { + if ( sp && sp->CurrentLayoutResId() != spane ) + { + sp->SwitchLayoutL( spane ); + sp->ApplyCurrentSettingsL(); + } + } + if ( sp && !sp->IsTransparent() ) + { + sp->EnableTransparent( ETrue ); + sp->DrawNow(); + } + // Set the active container - ActivateContainerL( iAppUiAdapter.ViewManager().ActiveViewData() ); + if ( aCustomMessage == KActivateDefaultView ) + { + __PRINTS( "*** CXnViewAdapter::DoActivateL - activating default container" ); + + ActivateDefaultContainerL(); + + iTimer->Cancel(); + iTimer->Start( 1000, 1000, TCallBack( TimerCallback, this ) ); + } + else + { + __PRINTS( "*** CXnViewAdapter::DoActivateL - activating container" ); + + ActivateContainerL( viewData ); + } + + __TIME_ENDMARK( "CXnViewAdapter::DoActivateL, done", time ); + + __TICK( "CXnViewAdapter::DoActivateL - HS UI Ready" ); + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::TimerCallback +// +// ----------------------------------------------------------------------------- +// +TInt CXnViewAdapter::TimerCallback( TAny *aPtr ) + { + __PRINTS( "*** CXnViewAdapter::TimerCallback" ); + + CXnViewAdapter* self = reinterpret_cast< CXnViewAdapter* >( aPtr ); + self->iTimer->Cancel(); + + self->iCoeEnv->WsSession().SetWindowGroupOrdinalPosition( + self->iCoeEnv->RootWin().Identifier(), 0 ); + + __PRINTS( "*** CXnViewAdapter::TimerCallback, done" ); + + return KErrNone; } // ----------------------------------------------------------------------------- @@ -358,16 +464,20 @@ return; } + __PRINTS( "*** CXnViewAdapter::DoDeactivate" ); + __TIME_MARK( time ); + iAppUiAdapter.RemoveFromStack( iEventDispatcher ); TRAP_IGNORE( DeactivateContainerL() ); - iBgControl->MakeVisible( EFalse ); iBgManager->MakeVisible( EFalse ); iFocusControl->MakeVisible( EFalse ); iFlags.Clear( EIsActivated ); + + __TIME_ENDMARK( "CXnViewAdapter::DoDeactivate, done", time ); } // ----------------------------------------------------------------------------- @@ -376,24 +486,28 @@ // ----------------------------------------------------------------------------- // void CXnViewAdapter::ActivateContainerL( CXnViewData& aContainer, - TBool aEnterEditState ) - { - if ( iContainer == &aContainer ) - { + TBool aEnterEditState, TBool aForceActivation ) + { + // Returns if the container remains the same and activation is not forced + // Otherwise the old container is deactivated and the new is activated + if ( iFlags.IsSet( EIsDestructionRunning ) || + ( ( !aForceActivation ) && ( iContainer == &aContainer ) ) ) + { return; } - // Deactivate previous + // Find previous container and then deactivate it + const CXnViewData* previous( iContainer ); DeactivateContainerL(); - + if ( iFlags.IsClear( EIsActivated ) ) { // Some other view than this in this appui is currently active, // postpone container activation return; } - - // Update + + // Update iContainer = &aContainer; // Disable layout and redraw until container activation is done @@ -418,9 +532,66 @@ // This container is in-call state NotifyInCallStateChaged( ETrue ); } - + + if ( aEnterEditState || iAppUiAdapter.UiEngine().IsEditMode() ) + { + EnterEditStateL( aContainer, ETrue ); + } + else + { + EnterEditStateL( aContainer, EFalse ); + } + iAppUiAdapter.ViewManager().NotifyContainerChangedL( aContainer ); + if ( previous && iContainer ) + { + iBgManager->WallpaperChanged( *previous, *iContainer ); + } + + CXnControlAdapter* adapter( node->Control() ); + adapter->MakeVisible( ETrue ); + + iAppUiAdapter.UiEngine().RenderUIL(); + + CleanupStack::PopAndDestroy(); // DisableRenderUiLC + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::ActivateDefaultContainerL +// Activates default container +// ----------------------------------------------------------------------------- +// +void CXnViewAdapter::ActivateDefaultContainerL( TBool aEnterEditState ) + { + CXnRootData& rootData( iAppUiAdapter.ViewManager().ActiveAppData() ); + + RPointerArray< CXnPluginData >& views( rootData.PluginData() ); + + if ( !views.Count() ) + { + return; + } + + // first view is default + CXnViewData* viewData = static_cast( views[0] ); + + if ( viewData ) + { + EnterEditStateL( *viewData, aEnterEditState ); + // Deactivate container even though it hasn't changed to close all + // popups and other windows + ActivateContainerL( *viewData, aEnterEditState, ETrue ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::EnterEditStateL +// Sets edit state property +// ----------------------------------------------------------------------------- +// +void CXnViewAdapter::EnterEditStateL( CXnViewData& aView, TBool aEnter ) + { if ( !iEditState ) { iEditState = BuildEditStateTriggerL( iAppUiAdapter.UiEngine() ); @@ -429,30 +600,30 @@ CXnProperty* prop( iEditState->GetPropertyL( XnPropertyNames::action::KValue ) ); - if ( aEnterEditState || iAppUiAdapter.UiEngine().IsEditMode() ) + if ( !prop ) + { + return; + } + + if ( aEnter ) { static_cast< CXnDomPropertyValue* >( prop->Property()->PropertyValueList().Item( 0 ) ) ->SetStringValueL( CXnDomPropertyValue::EString, - XnPropertyNames::action::trigger::name::editmode::KEnter() ); + XnPropertyNames::action::trigger::name::editmode::KEnter() ); } else { static_cast< CXnDomPropertyValue* >( prop->Property()->PropertyValueList().Item( 0 ) ) ->SetStringValueL( CXnDomPropertyValue::EString, - XnPropertyNames::action::trigger::name::editmode::KExit() ); + XnPropertyNames::action::trigger::name::editmode::KExit() ); } - node->ReportXuikonEventL( *iEditState ); - - CXnControlAdapter* adapter( node->Control() ); - - iBgControl->SetCompoundControl( adapter ); - - iAppUiAdapter.UiEngine().RenderUIL(); - - CleanupStack::PopAndDestroy(); // DisableRenderUiLC + if ( aView.Node() && aView.Node()->LayoutNode() ) + { + aView.Node()->LayoutNode()->ReportXuikonEventL( *iEditState ); + } } // ----------------------------------------------------------------------------- @@ -462,11 +633,13 @@ // void CXnViewAdapter::DeactivateContainerL() { - if ( !iContainer ) + if ( !iContainer || iFlags.IsSet( EIsDestructionRunning ) ) { return; } + CloseAllPopupsL(); + // Run controls to powersave mode ChangeControlsStateL( EFalse ); @@ -478,8 +651,7 @@ CXnNode* node( iContainer->Node()->LayoutNode() ); node->ReportXuikonEventL( *iDeactivate ); - - iBgControl->SetCompoundControl( NULL ); + node->Control()->MakeVisible( EFalse ); iContainer = NULL; } @@ -547,9 +719,9 @@ { return; } - + TBool incallNow( iFlags.IsSet( EIsInCall ) ? ETrue : EFalse ); - + if ( incallNow == aInCall ) { return; @@ -563,8 +735,10 @@ { iFlags.Clear( EIsInCall ); } + + CXnViewData& view( iAppUiAdapter.ViewManager().ActiveViewData() ); - TRAP_IGNORE( UpdateRskByModeL() ); + TRAP_IGNORE( UpdateRskByUiStateL( view ) ); } // ----------------------------------------------------------------------------- @@ -627,13 +801,35 @@ } // ----------------------------------------------------------------------------- -// CXnViewAdapter::UpdateRskByModeL() +// CXnViewAdapter::UpdateRskByUiStateL() // // ----------------------------------------------------------------------------- // -void CXnViewAdapter::UpdateRskByModeL() +void CXnViewAdapter::UpdateRskByUiStateL( const CXnViewData& aViewData ) { - CXnNode* menubar( iAppUiAdapter.UiEngine().MenuBarNode() ); + CXnNode* menubar( NULL ); + + CXnDomNode* view( aViewData.Node() ); + + if ( view && view->LayoutNode() ) + { + RPointerArray< CXnNode >& children( view->LayoutNode()->Children() ); + + for ( TInt count = children.Count() - 1; count >= 0 ; --count ) + { + CXnNode* node( children[count] ); + + // Check that the given type of a control is parent + // (or ancestor) of this control + const TDesC8& type( node->Type()->Type() ); + + if ( type == KMenuBar ) + { + menubar = node; + break; + } + } + } if( menubar ) { @@ -671,11 +867,46 @@ { menuIf->SetSoftKeyL( &node->PluginIfL() , XnMenuInterface::MXnMenuInterface::ERight ); node->SetDirtyL( XnDirtyLevel::ERender ); + + TRAP_IGNORE( iAppUiAdapter.UiEngine().RefreshMenuL() ); } } } } } +// ----------------------------------------------------------------------------- +// CXnViewAdapter::CloseAllPopupsL() +// +// ----------------------------------------------------------------------------- +// +void CXnViewAdapter::CloseAllPopupsL() + { + if ( !iContainer ) + { + return; + } + + RPointerArray< CXnNode > popups; + CleanupClosePushL( popups ); + + iContainer->PopupNodesL( popups ); + + for ( TInt i = 0; i < popups.Count(); i++ ) + { + CXnProperty* display = CXnProperty::NewL( + XnPropertyNames::style::common::KDisplay, + XnPropertyNames::style::common::display::KNone, + CXnDomPropertyValue::EString, + *iAppUiAdapter.UiEngine().ODT()->DomDocument().StringPool() ); + + CleanupStack::PushL( display ); + popups[i]->SetPropertyL(display); + CleanupStack::Pop( display ); + } + + CleanupStack::PopAndDestroy( &popups ); + } + // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnviewcontroladapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewcontroladapter.cpp Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,232 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for wrapper for a box +* +*/ + +// System includes +#include +#include + +// User includes +#include "xnappuiadapter.h" +#include "xnuiengine.h" +#include "xnnode.h" +#include "xndomnode.h" +#include "xnnodepluginif.h" +#include "xnproperty.h" +#include "xnviewadapter.h" +#include "xnbackgroundmanager.h" +#include "xnviewdata.h" +#include "xnviewmanager.h" +#include "xnviewcontroladapter.h" + +// Constants + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnViewControlAdapter::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnViewControlAdapter* CXnViewControlAdapter::NewL( CXnNodePluginIf& aNode ) + { + CXnViewControlAdapter* self = new( ELeave ) CXnViewControlAdapter( aNode ); + + CleanupStack::PushL( self ); + self->ConstructL( aNode ); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnViewControlAdapter::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnViewControlAdapter::ConstructL( CXnNodePluginIf& aNode ) + { + CreateWindowL(); + + CXnControlAdapter::ConstructL( aNode ); + + if( Window().SetTransparencyAlphaChannel() == KErrNone ) + { + Window().SetBackgroundColor( ~0 ); + } + + Window().SetPointerGrab( EFalse ); + + EnableDragEvents(); + + ActivateL(); + + SetComponentsToInheritVisibility( ETrue ); + + iAppUi.UiStateListener().AddObserver( *this ); + } + +// ----------------------------------------------------------------------------- +// CXnViewControlAdapter::CXnViewControlAdapter +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnViewControlAdapter::CXnViewControlAdapter( CXnNodePluginIf& aNode ) + : iNode( aNode ), iAppUi( static_cast< CXnAppUiAdapter& >( *iAvkonAppUi ) ), + iHitpoint( TPoint( -1,-1 ) ) + { + } + +// ----------------------------------------------------------------------------- +// CXnViewControlAdapter::~CXnViewControlAdapter +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnViewControlAdapter::~CXnViewControlAdapter() + { + iAppUi.UiStateListener().RemoveObserver( *this ); + } + +// ----------------------------------------------------------------------------- +// CXnViewControlAdapter::MakeVisible +// +// ----------------------------------------------------------------------------- +// +void CXnViewControlAdapter::MakeVisible( TBool aVisible ) + { + if ( aVisible == IsVisible() ) + { + return; + } + + if ( aVisible ) + { + if ( !iAppUi.UiEngine().IsEditMode() ) + { + Window().SetPointerGrab( ETrue ); + } + } + else + { + Window().SetPointerGrab( EFalse ); + + ResetGrabbing(); + } + + CCoeControl::MakeVisible( aVisible ); + } + +// ----------------------------------------------------------------------------- +// CXnViewControlAdapter::Draw +// +// ----------------------------------------------------------------------------- +// +void CXnViewControlAdapter::Draw( const TRect& aRect ) const + { + SystemGc().Clear( aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnViewControlAdapter::HandlePointerEventL +// +// ----------------------------------------------------------------------------- +// +void CXnViewControlAdapter::HandlePointerEventL( + const TPointerEvent& aPointerEvent ) + { + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + iHitpoint = aPointerEvent.iPosition; + } + + iAppUi.UiEngine().DisableRenderUiLC(); + + CXnControlAdapter::HandlePointerEventL( aPointerEvent ); + + iAppUi.UiEngine().RenderUIL(); + + CleanupStack::PopAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// CXnViewControlAdapter::ResetGrabbing() +// +// ----------------------------------------------------------------------------- +// +void CXnViewControlAdapter::ResetGrabbing() + { + TPointerEvent event; + event.iType = TPointerEvent::EButton1Up; + + TRAP_IGNORE( RemoveGrabbingControL( this, event ) ); + + iHitpoint.SetXY( -1, -1 ); + } + +// ----------------------------------------------------------------------------- +// CXnViewControlAdapter::RemoveGrabbingControL() +// Removes recursively grabbing controls +// ----------------------------------------------------------------------------- +// +void CXnViewControlAdapter::RemoveGrabbingControL( const CCoeControl* aControl, + const TPointerEvent& aEvent ) const + { + TInt count( aControl->CountComponentControls() ); + + for( TInt i = 0; i < count; i++ ) + { + CCoeControl* child( aControl->ComponentControl( i ) ); + + if( child && child->Rect().Contains( iHitpoint ) ) + { + child->CCoeControl::HandlePointerEventL( aEvent ); + RemoveGrabbingControL( child, aEvent ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnViewControlAdapter::NotifyForegroundChanged() +// +// ----------------------------------------------------------------------------- +// +void CXnViewControlAdapter::NotifyForegroundChanged( TForegroundStatus aStatus ) + { + if ( aStatus == EBackground || aStatus == EPartialForeground ) + { + ResetGrabbing(); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewControlAdapter::NotifyLightStatusChanged() +// +// ----------------------------------------------------------------------------- +// +void CXnViewControlAdapter::NotifyLightStatusChanged( TBool /*aLightsOn*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CXnViewControlAdapter::NotifyInCallStateChaged() +// +// ----------------------------------------------------------------------------- +// +void CXnViewControlAdapter::NotifyInCallStateChaged( TBool /*aInCall*/ ) + { + } + +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnviewdata.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnviewdata.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewdata.cpp Wed May 12 13:22:51 2010 +0300 @@ -17,8 +17,10 @@ // System includes #include +#include // User includes +#include "xnappuiadapter.h" #include "xncomposer.h" #include "xnodtparser.h" #include "xnviewmanager.h" @@ -27,11 +29,13 @@ #include "xndomnode.h" #include "xnnode.h" #include "xnoomsyshandler.h" +#include "xnpanic.h" + +#include "debug.h" // Constants -_LIT8( KStateConfirmed, "Confirmed" ); -_LIT8( KStateError, "Error" ); -_LIT8( KLockingStatusLocked, "locked" ); +const TInt KLoadDelay( 10000 ); +const TInt KInterval( 10000 ); // ============================ LOCAL FUNCTIONS ================================ @@ -94,11 +98,11 @@ } // ----------------------------------------------------------------------------- -// CXnViewData::SetActiveL() +// CXnViewData::SetActive() // // ----------------------------------------------------------------------------- // -void CXnViewData::SetActiveL( TBool aActive ) +void CXnViewData::SetActive( TBool aActive ) { TBool active( Active() ); @@ -106,81 +110,80 @@ { return; } - + if ( aActive ) - { + { + iFlags.Set( EIsActive ); iFlags.Clear( EIsInitial ); - - iFlags.Set( EIsActive ); - - LoadDataPluginsL(); + + LoadPublishers(); } else { - DestroyDataPluginsL(); + DestroyPublishers( EAiFwPageShutdown ); iFlags.Clear( EIsActive ); } } // ----------------------------------------------------------------------------- -// CXnViewData::LoadL() +// CXnViewData::Load() // ----------------------------------------------------------------------------- // -void CXnViewData::LoadL() +TInt CXnViewData::Load() { - if ( Occupied() || PluginState().CompareF( KStateError ) == 0 ) + if ( Occupied() ) { - return; + return KErrInUse; } if ( !CXnOomSysHandler::HeapAvailable( VIEW_MIN_MEM ) ) + { + return KErrNoMemory; + } + + TInt err( KErrNone ); + + TRAP( err, err = iManager.Composer().ComposeViewL( *this ) ); + + if ( err == KErrNone ) { - ViewManager().OomSysHandler().HandlePotentialOomL(); - return; + TRAP( err, iManager.Parser().LoadViewL( *this ) ); } - TRAPD( error, - - if( iManager.Composer().ComposeViewL( *this ) == KErrNone ) - { - iManager.Parser().LoadViewL( *this ); - } - ); - - if ( error || !Occupied() ) - { - if( error == KErrNoMemory ) - { - ViewManager().OomSysHandler().HandlePotentialOomL(); - } + if ( err == KErrNone ) + { + iVirginPublishers = ETrue; - // Set error state - iFlags.Clear( EIsInitial ); - - SetPluginStateL( KStateError ); - } - else - { - // Must confirm here, as widgets loading may fail, which - // then results his view to be doomed unnceccesarily - SetPluginStateL( KStateConfirmed ); - - // Load view initial widgets + // Load view's initial widgets for ( TInt i = 0; i < iPluginsData.Count(); i++ ) { if ( iPluginsData[i]->PluginId() != KNullDesC8 ) - { - iPluginsData[i]->LoadL(); + { + TInt err2( iPluginsData[i]->Load() ); + + if ( err2 == KXnErrPluginFailure ) + { + // Content removed error note must be + // displayed once when this view is activated + iShowContentRemoved = ETrue; + + err = err2; + } + else if ( err2 == KErrNoMemory ) + { + err = err2; + break; + } } - } - - if ( Active() ) - { - LoadDataPluginsL(); } - } + + // Succesfully enough composed, publishers + // will be loaded when view is activated + } + + return err; } // ----------------------------------------------------------------------------- @@ -191,16 +194,20 @@ void CXnViewData::Destroy() { if ( Occupied() ) - { - TRAP_IGNORE( DestroyDataPluginsL() ); + { + // View is deleted, pretend plugin is removed from UI + DestroyPublishers( EAiFwPluginShutdown ); iManager.Parser().DestroyView( *this ); } + delete iBgImage; iBgImage = NULL; - Flush(); + delete iBgImagePath; iBgImagePath = NULL; + + Flush(); } // ----------------------------------------------------------------------------- @@ -208,22 +215,31 @@ // Finds plugin or view data based on node // ----------------------------------------------------------------------------- // -CXnPluginData& CXnViewData::Plugin( CXnNode* aNode ) - { +CXnPluginData* CXnViewData::Plugin( CXnNode* aNode ) + { + if ( !aNode ) + { + return NULL; + } + + CXnDomNode* view( Node() ); + if ( aNode->ViewNodeImpl() ) { // Reached view, return self - if ( Node()->LayoutNode() == aNode ) + if ( view && view->LayoutNode() == aNode ) { - return *this; + return this; } } for ( TInt i = 0; i < iPluginsData.Count(); i++ ) { - if ( iPluginsData[i]->Owner()->LayoutNode() == aNode ) + CXnDomNode* plugin( iPluginsData[i]->Owner() ); + + if ( plugin && plugin->LayoutNode() == aNode ) { - return *iPluginsData[i]; + return iPluginsData[i]; } } @@ -303,9 +319,12 @@ // void CXnViewData::SetWallpaperImagePathL( const TDesC& aFileName ) { - delete iBgImagePath; - iBgImagePath = NULL; - iBgImagePath = aFileName.AllocL(); + if( !iBgImagePath || iBgImagePath->Des() != aFileName ) + { + delete iBgImagePath; + iBgImagePath = NULL; + iBgImagePath = aFileName.AllocL(); + } } // ----------------------------------------------------------------------------- @@ -373,6 +392,23 @@ } // ----------------------------------------------------------------------------- +// CXnViewData::PopupNodesL() +// Gets this view data's popup nodes +// ----------------------------------------------------------------------------- +// +void CXnViewData::PopupNodesL( RPointerArray< CXnNode >& aList ) const + { + // Get my Popup nodes + CXnPluginData::PopupNodesL( aList ); + + for ( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + // And Popup nodes which my plugin holds + iPluginsData[i]->PopupNodesL( aList ); + } + } + +// ----------------------------------------------------------------------------- // CXnViewData::InitialFocusNodesL() // Gets this view data's initial focus nodes // ----------------------------------------------------------------------------- @@ -397,12 +433,12 @@ // void CXnViewData::ContentSourceNodesL( RPointerArray< CXnNode >& aList ) const { - // Get my data provider nodes + // Get my data publisher nodes CXnPluginData::ContentSourceNodesL( aList ); for ( TInt i = 0; i < iPluginsData.Count(); i++ ) { - // And appearance nodes which my plugin holds + // And publisher nodes which my plugin holds iPluginsData[i]->ContentSourceNodesL( aList ); } } @@ -422,87 +458,155 @@ } // ----------------------------------------------------------------------------- -// CXnViewData::LoadDataPluginsL +// CXnViewData::LoadPublishers // Loads data plugins associated to the plugin // ----------------------------------------------------------------------------- // -void CXnViewData::LoadDataPluginsL() +void CXnViewData::LoadPublishers() { - if( Occupied() && Active() ) + if( !Active() || !Occupied() ) { - // Load own plugins first, and after that data plugins for widgets - CXnPluginData::LoadDataPluginsL(); + return; } + + iLoader->Cancel(); + + iLoadIndex = 0; + + iLoader->Start( TTimeIntervalMicroSeconds32( KLoadDelay ), + TTimeIntervalMicroSeconds32( KInterval ), + TCallBack( DoLoadPublishersL, this ) ); } // ----------------------------------------------------------------------------- -// CXnPluginData::DataPluginsLoadCompletedL -// Indicates that all data plugins are loaded +// CXnViewData::DoLoadPublishersL() +// // ----------------------------------------------------------------------------- // -void CXnViewData::DataPluginsLoadCompletedL( TInt aStatus ) - { - if ( aStatus == KErrNone ) +/* static */ TInt CXnViewData::DoLoadPublishersL( TAny* aAny ) + { + __PRINTS( "*** CXnViewData::DoLoadPublishersL" ); + + CXnViewData* self = static_cast< CXnViewData* >( aAny ); + + CXnAppUiAdapter* appui = static_cast< CXnAppUiAdapter* >( iAvkonAppUi ); + + RPointerArray< CXnPluginData >& plugins( self->PluginData() ); + + for ( TInt i = self->iLoadIndex; i < plugins.Count(); i++ ) + { + if ( !plugins[i]->Occupied() ) + { + self->iLoadIndex++; + } + else + { + break; + } + } + + if ( self->iLoadIndex < plugins.Count() ) { - for( TInt i = 0; i < iPluginsData.Count(); i++ ) + CXnPluginData* plugin( plugins[self->iLoadIndex] ); + + self->iLoadIndex++; + + TInt reason( plugin->VirginPublishers() ? + EAiFwSystemStartup : EAiFwPageStartup ); + + TInt ret( plugin->LoadPublishers( reason ) ); + + if ( ret == KErrAlreadyExists ) { - iPluginsData[i]->LoadDataPluginsL(); - } + ret = KErrNone; + } + + if( ret != KErrNone ) + { + self->iManager.UnloadWidgetFromPluginL( *plugin, ETrue ); + self->iShowContentRemoved = ETrue; + } } + else + { + TInt reason( self->VirginPublishers() ? + EAiFwSystemStartup : EAiFwPageStartup ); + + self->iVirginPublishers = EFalse; + + self->iLoader->Cancel(); + + self->iLoadIndex = 0; + + for ( TInt i = 0; i < self->iContentSourceNodes.Count(); i++ ) + { + CXnNodeAppIf& plugin( self->iContentSourceNodes[i]->AppIfL() ); + + appui->LoadPublisher( plugin, reason ); + } + + if ( self->iShowContentRemoved ) + { + self->ShowContentRemovedError(); + self->iShowContentRemoved = EFalse; + } + + // Fire UI ready blindly here, it will be handled in AiFw if needed + appui->HandleUiReadyEventL(); + } + + __PRINTS( "*** CXnViewData::DoLoadPublishersL - done" ); - CXnPluginData::DataPluginsLoadCompletedL( aStatus ); + return KErrNone; } // ----------------------------------------------------------------------------- -// CXnViewData::DestroyDataPluginsL +// CXnViewData::DestroyPublishers // Remove data plugins associated to the plugin // ----------------------------------------------------------------------------- // -void CXnViewData::DestroyDataPluginsL() +void CXnViewData::DestroyPublishers( TInt aReason ) { - CXnPluginData::DestroyDataPluginsL(); + __PRINTS( "*** CXnViewData::DestroyPublishers" ); - for( TInt i = 0; i < iPluginsData.Count(); i++ ) + if ( Occupied() ) { - iPluginsData[i]->DestroyDataPluginsL(); + // If not all plugins loaded yet + iLoader->Cancel(); + + TRAP_IGNORE( DoDestroyPublishersL( aReason ) ); + + User::Heap().Compress(); } + + __PRINTS( "*** CXnViewData::DestroyPublishers - done" ); } // ----------------------------------------------------------------------------- -// CXnPluginData::DataPluginsLoaded() +// CXnPluginData::DoDestroyPublishersL +// Remove data plugins associated to the plugin // ----------------------------------------------------------------------------- // -TBool CXnViewData::DataPluginsLoaded() const +void CXnViewData::DoDestroyPublishersL( TInt aReason ) { - TBool loaded( CXnPluginData::DataPluginsLoaded() ); + __TIME_MARK( time ); + + // Create list of data plugins to be removed + RPointerArray< CXnNode > publishers; + CleanupClosePushL( publishers ); - for( TInt i = 0; loaded && i < iPluginsData.Count(); i++ ) + TRAP_IGNORE( ContentSourceNodesL( publishers ) ); + + for ( TInt i = 0; i < publishers.Count(); i++ ) { - CXnPluginData* plugin( iPluginsData[i] ); + // Destruction is synchronous + iManager.AppUiAdapter().DestroyPublisher( + publishers[i]->AppIfL(), aReason ); + } - if( plugin->Occupied() ) - { - loaded = plugin->DataPluginsLoaded(); - } - } + CleanupStack::PopAndDestroy( &publishers ); - return loaded; + __TIME_ENDMARK( "CXnViewData::DoDestroyPublishersL, done", time ); } -// ----------------------------------------------------------------------------- -// Sets view's locking_status attribute ("locked"/"none") -// ----------------------------------------------------------------------------- -// -void CXnViewData::SetLockingStatus( const TDesC8& aLockingStatusString ) - { - if( ( aLockingStatusString != KNullDesC8 ) && - ( aLockingStatusString.Match( KLockingStatusLocked ) == 0 ) ) - { - iFlags.Clear( EIsRemovable ); - } - else - { - iFlags.Set( EIsRemovable ); - } - } // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp Wed May 12 13:22:51 2010 +0300 @@ -16,14 +16,18 @@ */ // System includes +#include #include #include #include #include #include #include - #include +#include +#include +#include +#include // User includes #include "xnapplication.h" @@ -51,51 +55,19 @@ #include "xnnodepluginif.h" #include "xnoomsyshandler.h" #include "xnbackgroundmanager.h" +#include "xneffectmanager.h" // Constants _LIT8( KEmptyWidgetUid, "0x2001f47f" ); -_LIT8( KStateError, "Error" ); - - _LIT8( KTemplateViewUID, "0x20026f50" ); -enum - { - EFirstPassDrawComplete, - EDataPluginsComplete, - EViewIsValid, - }; - - -/* -const TAknsItemID KSkinIds[] = { - KAknsIIDQgnHomePage11, - KAknsIIDQgnHomePage21, - KAknsIIDQgnHomePage22, - KAknsIIDQgnHomePage31, - KAknsIIDQgnHomePage32, - KAknsIIDQgnHomePage33, - KAknsIIDQgnHomePage41, - KAknsIIDQgnHomePage42, - KAknsIIDQgnHomePage43, - KAknsIIDQgnHomePage44, - KAknsIIDQgnHomePage51, - KAknsIIDQgnHomePage52, - KAknsIIDQgnHomePage53, - KAknsIIDQgnHomePage54, - KAknsIIDQgnHomePage55, - KAknsIIDQgnHomePage61, - KAknsIIDQgnHomePage62, - KAknsIIDQgnHomePage63, - KAknsIIDQgnHomePage64, - KAknsIIDQgnHomePage65, - KAknsIIDQgnHomePage66 - }; -*/ +const TInt KPSCategoryUid( 0x200286E3 ); +const TInt KPSCrashCountKey( 1 ); +const TInt KStabilityInterval( 60000000 ); // 1 minute +const TInt KCrashRestoreDefaultThreshold( 3 ); +const TInt KCrashRestoreAllTreshold( 4 ); // ============================ LOCAL FUNCTIONS =============================== - - // ----------------------------------------------------------------------------- // BuildTriggerL // Builds a trigger node @@ -140,38 +112,6 @@ } // ----------------------------------------------------------------------------- -// SetOnlineStateL -// -// ----------------------------------------------------------------------------- -// -static void SetOnlineStateL( CXnAppUiAdapter& aAdapter, - CXnViewData& aViewData ) - { - if( !aViewData.Active() ) - { - // Only active view can change online/offline state - return; - } - - RPointerArray< CXnNode > nodes; - CleanupClosePushL( nodes ); - - RPointerArray< CXnNodeAppIf > list; - CleanupClosePushL( list ); - - aViewData.ContentSourceNodesL( nodes ); - - for ( TInt i = 0; i < nodes.Count(); i++ ) - { - list.AppendL( &nodes[i]->AppIfL() ); - } - - aAdapter.SetOnlineStateL( list ); - - CleanupStack::PopAndDestroy( 2, &nodes ); // &list - } - -// ----------------------------------------------------------------------------- // resolveIconId // ----------------------------------------------------------------------------- // @@ -338,7 +278,9 @@ // ----------------------------------------------------------------------------- // CXnViewManager::~CXnViewManager() - { + { + delete iStabilityTimer; + iObservers.Reset(); delete iRootData; @@ -354,9 +296,7 @@ iControls.Reset(); iAppearanceNodes.Reset(); - - iFailedPlugins.Reset(); - + delete iComposer; delete iEditor; delete iOomSysHandler; @@ -368,7 +308,7 @@ // ----------------------------------------------------------------------------- // void CXnViewManager::ConstructL() - { + { iOomSysHandler = CXnOomSysHandler::NewL(); // Create resource list @@ -385,6 +325,10 @@ iHspsWrapper = &iEditor->HspsWrapper(); iComposer = CXnComposer::NewL( *iHspsWrapper ); + + iIsLandscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation(); + + DoRobustnessCheckL(); } // ----------------------------------------------------------------------------- @@ -400,9 +344,12 @@ iRootData = CXnRootData::NewL( *this, iApplicationUid ); // Load root configuration and initial view. - iRootData->LoadL(); + iRootData->Load(); + + CleanupStack::PopAndDestroy(); // DisableRenderUiLC(); - CleanupStack::PopAndDestroy(); // DisableRenderUiLC(); + // Activate initial view already here to get publishers loaded + ActiveViewData().SetActive( ETrue ); } // ----------------------------------------------------------------------------- @@ -426,9 +373,7 @@ // Schedule application configuration destroyal iRootData->Destroy(); iRootData = NULL; - - iFlags.ClearAll(); - + User::Heap().Compress(); LoadUiL(); @@ -445,7 +390,7 @@ // CXnViewManager::LoadWidgetToPluginL() // ----------------------------------------------------------------------------- // -TInt CXnViewManager::LoadWidgetToPluginL( CHsContentInfo& aContentInfo, +TInt CXnViewManager::LoadWidgetToPluginL( const CHsContentInfo& aContentInfo, CXnPluginData& aPluginData ) { // Plugin must not have widget when about to add @@ -502,14 +447,25 @@ NotifyConfigureWidgetL( aContentInfo, aPluginData ); - aPluginData.LoadL(); - - UpdateCachesL(); - - NotifyWidgetAdditionL( aPluginData ); + retval = aPluginData.Load(); + + if ( retval == KErrNone ) + { + UpdateCachesL(); + + NotifyWidgetAdditionL( aPluginData ); - // Report widget amount in the view - ReportWidgetAmountL( viewData ); + // Report widget amount in the view + ReportWidgetAmountL( viewData ); + } + else if ( retval == KErrNoMemory ) + { + aPluginData.ShowOutOfMemError(); + } + else if ( retval == KXnErrPluginFailure ) + { + aPluginData.ShowContentRemovedError(); + } CleanupStack::PopAndDestroy(); // DisableRenderUiLC } @@ -521,15 +477,21 @@ // CXnViewManager::UnloadWidgetFromPluginL() // ----------------------------------------------------------------------------- // -TInt CXnViewManager::UnloadWidgetFromPluginL( CXnPluginData& aPluginData ) - { - TBool error( aPluginData.PluginState().CompareF( KStateError ) == 0 ); - - // Plugins in error state are always removed - if ( !error && !aPluginData.Occupied() ) +TInt CXnViewManager::UnloadWidgetFromPluginL( CXnPluginData& aPluginData, + TBool aForce ) + { + if ( !aForce ) { - // Plugin must have widget when about to remove - return KErrNotFound; + if( !aPluginData.Occupied() ) + { + // Plugin must have widget when about to remove + return KErrNotFound; + } + if ( !aPluginData.Removable() ) + { + // Not allowed to remove locked + return KErrArgument; + } } CXnViewData& viewData( @@ -585,8 +547,7 @@ if ( active ) { - iUiEngine->RenderUIL(); - SetOnlineStateL( iAppUiAdapter, ActiveViewData() ); + iUiEngine->RenderUIL(); } CleanupStack::PopAndDestroy(); // DisableRenderUiLC @@ -599,20 +560,15 @@ // CXnViewManager::ReplaceWidgetToPluginL // ----------------------------------------------------------------------------- // -TInt CXnViewManager::ReplaceWidgetToPluginL( CHsContentInfo& aContentInfo, - CXnPluginData& aPluginData, TBool aUseHsps ) +TInt CXnViewManager::ReplaceWidgetToPluginL( const CHsContentInfo& aContentInfo, + CXnPluginData& aPluginData ) { - TInt ret = KErrNone; + TInt retval( KErrNone ); - // if aUseHsps is false, the plugin was already replaced by - // another process - if( aUseHsps ) - { - ret = iHspsWrapper->ReplacePluginL( aPluginData.PluginId(), + retval = iHspsWrapper->ReplacePluginL( aPluginData.PluginId(), aContentInfo.Uid() ); - } - if ( ret == KErrNone ) + if ( retval == KErrNone ) { iUiEngine->DisableRenderUiLC(); @@ -628,28 +584,39 @@ NotifyConfigureWidgetL( aContentInfo, aPluginData ); - aPluginData.LoadL(); - - UpdateCachesL(); + retval = aPluginData.Load(); - // notify addition if not replaced with empty widget - // NotifyWidgetAdditionL will call RenderUIL() - if( uid != KEmptyWidgetUid ) + if ( retval == KErrNone ) { - NotifyWidgetAdditionL( aPluginData ); + UpdateCachesL(); + + // notify addition if not replaced with empty widget + // NotifyWidgetAdditionL will call RenderUIL() + if( uid != KEmptyWidgetUid ) + { + NotifyWidgetAdditionL( aPluginData ); + } + else + { + if( aPluginData.Active() ) + { + iUiEngine->RenderUIL(); + } + } } - else + else if ( retval == KErrNoMemory ) { - if( aPluginData.Active() ) - { - iUiEngine->RenderUIL(); - } + aPluginData.ShowOutOfMemError(); } - + else if ( retval == KXnErrPluginFailure ) + { + aPluginData.ShowContentRemovedError(); + } + CleanupStack::PopAndDestroy(); // DisableRenderUiLC } - return ret; + return retval; } // ----------------------------------------------------------------------------- @@ -767,6 +734,41 @@ } // ----------------------------------------------------------------------------- +// CXnViewManager::PluginDataL() +// Returns list of plugins from all views or from the defined view +// ----------------------------------------------------------------------------- +// +TInt CXnViewManager::PluginDataL( const TDesC8& aViewId, + RPointerArray< CXnPluginData >& aList ) const + { + TInt err( KErrNone ); + TBool found( EFalse ); + + RPointerArray< CXnPluginData >& views( iRootData->PluginData() ); + + for ( TInt i = 0; i < views.Count(); i++ ) + { + if ( !aViewId.Length() || views[i]->PluginId().Compare( aViewId ) == 0 ) + { + found = ETrue; + RPointerArray< CXnPluginData >& plugins( views[i]->PluginData() ); + + for ( TInt j = 0; j < plugins.Count(); j++ ) + { + aList.AppendL( plugins[ j ] ); + } + } + } + if ( !found ) + { + // View not found + err = KErrArgument; + } + + return err; + } + +// ----------------------------------------------------------------------------- // CXnViewManager::Resources() // Finds the resources from the active view data // ----------------------------------------------------------------------------- @@ -852,26 +854,82 @@ { return iRootData->NextViewData(); } - + // ----------------------------------------------------------------------------- // CXnViewManager::ActivateNextViewL() // Activates the next view // ----------------------------------------------------------------------------- // -void CXnViewManager::ActivateNextViewL() - { - CXnViewData& current( ActiveViewData() ); +void CXnViewManager::ActivateNextViewL( TInt /*aEffectId*/ ) + { CXnViewData& next( NextViewData() ); - + if ( !next.Occupied() ) - { - next.LoadL(); + { + if ( next.Load() == KErrNoMemory ) + { + next.ShowOutOfMemError(); + return; + } } // Activate view if ( next.Occupied() && !next.Active() ) - { - iAppUiAdapter.ViewAdapter().ActivateContainerL( next ); + { + CXnControlAdapter* thisView( + ActiveViewData().ViewNode()->Control() ); + + CXnControlAdapter* nextView( + next.ViewNode()->Control() ); + + GfxTransEffect::Register( thisView, KGfxContextActivateNextView ); + GfxTransEffect::Register( nextView, KGfxContextActivateNextView ); + + TInt ret( GfxTransEffect::BeginGroup() ); + + CFbsBitmap* currentBg( ActiveViewData().WallpaperImage() ); + CFbsBitmap* nextBg( next.WallpaperImage() ); + + if ( currentBg || nextBg ) + { + CCoeControl* bg( &iAppUiAdapter.ViewAdapter().BgManager() ); + + if ( !currentBg && nextBg ) + { + GfxTransEffect::Begin( bg, KGfxControlActionBgAnimToImgAppear ); + } + else + { + GfxTransEffect::Begin( bg, KGfxControlActionBgImgToImgAppear ); + } + + GfxTransEffect::SetDemarcation( bg, bg->Position() ); + GfxTransEffect::End( bg ); + } + + if ( iIsLandscapeOrientation ) + { + GfxTransEffect::Begin( thisView, KGfxControlActionDisappearLsc ); + GfxTransEffect::Begin( nextView, KGfxControlActionAppearLsc ); + } + else + { + GfxTransEffect::Begin( thisView, KGfxControlActionDisappearPrt ); + GfxTransEffect::Begin( nextView, KGfxControlActionAppearPrt ); + } + + TRAP_IGNORE( iAppUiAdapter.ViewAdapter().ActivateContainerL( next ) ); + + GfxTransEffect::SetDemarcation( thisView, thisView->Position() ); + GfxTransEffect::End( thisView ); + + GfxTransEffect::SetDemarcation( nextView, nextView->Position() ); + GfxTransEffect::End( nextView ); + + GfxTransEffect::EndGroup( ret ); + + GfxTransEffect::Deregister( thisView ); + GfxTransEffect::Deregister( nextView ); } } @@ -880,20 +938,76 @@ // Activates the previous view // ----------------------------------------------------------------------------- // -void CXnViewManager::ActivatePreviousViewL() - { - CXnViewData& current( ActiveViewData() ); +void CXnViewManager::ActivatePreviousViewL( TInt /*aEffectId*/ ) + { CXnViewData& prev( PreviousViewData() ); if ( !prev.Occupied() ) { - prev.LoadL(); + if ( prev.Load() == KErrNoMemory ) + { + prev.ShowOutOfMemError(); + return; + } } // Activate view if ( prev.Occupied() && !prev.Active() ) - { - iAppUiAdapter.ViewAdapter().ActivateContainerL( prev ); + { + CXnControlAdapter* thisView( + ActiveViewData().ViewNode()->Control() ); + + CXnControlAdapter* prevView( + prev.ViewNode()->Control() ); + + GfxTransEffect::Register( thisView, KGfxContextActivatePrevView ); + GfxTransEffect::Register( prevView, KGfxContextActivatePrevView ); + + TInt ret( GfxTransEffect::BeginGroup() ); + + CFbsBitmap* currentBg( ActiveViewData().WallpaperImage() ); + CFbsBitmap* prevBg( prev.WallpaperImage() ); + + if ( currentBg || prevBg ) + { + CCoeControl* bg( &iAppUiAdapter.ViewAdapter().BgManager() ); + + if ( !currentBg && prevBg ) + { + GfxTransEffect::Begin( bg, KGfxControlActionBgAnimToImgAppear ); + } + else + { + GfxTransEffect::Begin( bg, KGfxControlActionBgImgToImgAppear ); + } + + GfxTransEffect::SetDemarcation( bg, bg->Position() ); + GfxTransEffect::End( bg ); + } + + if ( iIsLandscapeOrientation ) + { + GfxTransEffect::Begin( thisView, KGfxControlActionDisappearLsc ); + GfxTransEffect::Begin( prevView, KGfxControlActionAppearLsc ); + } + else + { + GfxTransEffect::Begin( thisView, KGfxControlActionDisappearPrt ); + GfxTransEffect::Begin( prevView, KGfxControlActionAppearPrt ); + } + + TRAP_IGNORE( iAppUiAdapter.ViewAdapter().ActivateContainerL( prev ) ); + + GfxTransEffect::SetDemarcation( thisView, thisView->Position() ); + GfxTransEffect::End( thisView ); + + GfxTransEffect::SetDemarcation( prevView, prevView->Position() ); + GfxTransEffect::End( prevView ); + + GfxTransEffect::EndGroup( ret ); + + GfxTransEffect::Deregister( thisView ); + GfxTransEffect::Deregister( prevView ); } } @@ -902,7 +1016,7 @@ // Adds a new view based on info // ----------------------------------------------------------------------------- // -TInt CXnViewManager::AddViewL( CHsContentInfo& aInfo ) +TInt CXnViewManager::AddViewL( const CHsContentInfo& aInfo ) { if ( iRootData->PluginData().Count() >= iRootData->MaxPages() ) { @@ -930,8 +1044,13 @@ newView->SetOwner( iRootData->Node() ); - newView->LoadL(); + retval = newView->Load(); + if ( retval == KErrNoMemory ) + { + newView->ShowOutOfMemError(); + } + if ( newView->Occupied() ) { // Load succeed, add the new view behind the current view @@ -974,7 +1093,7 @@ // Adds a new view // ----------------------------------------------------------------------------- // -void CXnViewManager::AddViewL() +void CXnViewManager::AddViewL( TInt aEffectId ) { if ( iRootData->PluginData().Count() >= iRootData->MaxPages() ) { @@ -1013,10 +1132,22 @@ newView->SetOwner( iRootData->Node() ); - newView->LoadL(); - + status = newView->Load(); + + if ( status == KErrNoMemory ) + { + newView->ShowOutOfMemError(); + } + if ( newView->Occupied() ) { + // Start transition effect + if( aEffectId ) + { + iAppUiAdapter.EffectManager()->BeginFullscreenEffectL( + aEffectId, ActiveViewData() ); + } + // Load succeed, add the new view behind the current view RPointerArray< CXnPluginData >& views( iRootData->PluginData() ); @@ -1071,11 +1202,14 @@ { if ( !view->Removable() ) { - return retval; + return KErrArgument; } if ( view->Active() ) { + // Destroy publishers here, must be plugin shutdown + view->DestroyPublishers( EAiFwPluginShutdown ); + // Activate the next view, or first if in the last view CXnViewData& next( NextViewData() ); iAppUiAdapter.ViewAdapter().ActivateContainerL( next ); @@ -1087,7 +1221,11 @@ retval = iHspsWrapper->RemovePluginL( view->PluginId() ); // Notify observers of view list change - NotifyViewRemovalL( *view ); + TRAPD( err, NotifyViewRemovalL( *view ) ); + if ( err != KErrNone ) + { + // ignored + } iRootData->DestroyViewData( view ); @@ -1106,7 +1244,7 @@ // Removes active view if more than one view. // ----------------------------------------------------------------------------- // -void CXnViewManager::RemoveViewL() +void CXnViewManager::RemoveViewL( TInt aEffectId ) { if ( iRootData->PluginData().Count() <= 1 || !ActiveViewData().Removable() ) @@ -1131,13 +1269,28 @@ if ( query->RunLD() ) { + // Start transition effect + if( aEffectId ) + { + iAppUiAdapter.EffectManager()->BeginFullscreenEffectL( + aEffectId, ActiveViewData() ); + } + // Activate the next view, or first if in the last view CXnViewData& next( NextViewData() ); + if ( !next.Occupied() ) + { + next.Load(); + } + + CXnViewData* view( static_cast< CXnViewData* >( views[ index ] ) ); + + // Destroy publishers here, must be plugin shutdown + view->DestroyPublishers( EAiFwPluginShutdown ); + iAppUiAdapter.ViewAdapter().ActivateContainerL( next ); - - CXnViewData* view( static_cast< CXnViewData* >( views[ index ] ) ); - + // Remove wallpaper from cache iAppUiAdapter.ViewAdapter().BgManager().DeleteWallpaper( *view ); @@ -1145,7 +1298,11 @@ iHspsWrapper->RemovePluginL( view->PluginId() ); // Notify observers of view list change - NotifyViewRemovalL( *view ); + TRAPD( err, NotifyViewRemovalL( *view ) ); + if ( err != KErrNone ) + { + // ignored + } iRootData->DestroyViewData( view ); @@ -1193,7 +1350,7 @@ return KErrArgument; } - if ( iRootData->PluginUid().Compare( aPluginUid ) == 0 ) + if ( iRootData->PluginUid().CompareF( aPluginUid ) == 0 ) { // Nothing to do return KErrNone; @@ -1251,7 +1408,6 @@ return iRootData->PluginData().Count(); } - // ----------------------------------------------------------------------------- // CXnViewManager::ViewIndex() // Gets index of current view @@ -1266,58 +1422,49 @@ } // ----------------------------------------------------------------------------- +// CXnViewManager::MaxPages() +// Gets the maximum allowed page count for this app configuration +// ----------------------------------------------------------------------------- +// +TInt CXnViewManager::MaxPages() const + { + return iRootData->MaxPages(); + } + +// ----------------------------------------------------------------------------- // CXnViewManager::NotifyContainerChangedL() // Notifies container is changed, this is called always by CXnViewAdapter // ----------------------------------------------------------------------------- void CXnViewManager::NotifyContainerChangedL( CXnViewData& aViewToActivate ) { -#ifdef _XN_PERFORMANCE_TEST_ - RDebug::Print( _L( "CXnViewManager::NotifyContainerChangedL - start" ) ); -#endif //_XN_PERFORMANCE_TEST_ - - InvalidateActiveView(); - CXnViewData& viewToDeactivate( ActiveViewData() ); if ( &aViewToActivate != &viewToDeactivate ) - { - // Store focus - CXnNode* focused( iUiEngine->FocusedNode() ); - - if ( focused ) - { - viewToDeactivate.SetFocusedNode( focused ); - } - + { NotifyViewDeactivatedL( viewToDeactivate ); - - // Switch active view data - iAppUiAdapter.HandlePageSwitch(); - - viewToDeactivate.SetActiveL( EFalse ); - aViewToActivate.SetActiveL( ETrue ); - - iHspsWrapper->SetActivePluginL( aViewToActivate.PluginId() ); - + + viewToDeactivate.SetActive( EFalse ); + aViewToActivate.SetActive( ETrue ); + + iHspsWrapper->SetActivePluginL( aViewToActivate.PluginId() ); + // Cache update is needed after view activation - UpdateCachesL(); - UpdateWallpaperL( viewToDeactivate, aViewToActivate ); + UpdateCachesL(); } else { // Activate first view - aViewToActivate.SetActiveL( ETrue ); + aViewToActivate.SetActive( ETrue ); // Cache update is needed after view activation UpdateCachesL(); + + // Schedule remaining views loading + iRootData->LoadRemainingViews(); } NotifyViewActivatedL( aViewToActivate ); UpdatePageManagementInformationL(); - - #ifdef _XN_PERFORMANCE_TEST_ - RDebug::Print( _L( "CXnViewManager::NotifyContainerChangedL - end" ) ); -#endif //_XN_PERFORMANCE_TEST_ } // ----------------------------------------------------------------------------- @@ -1386,12 +1533,6 @@ for ( TInt i = 0; i < iObservers.Count(); i++ ) { iObservers[i]->NotifyConfigureWidgetL( aContentInfo, aPluginData ); - } - - if ( aPluginData.Active() ) - { - // Active view configuration is about to change - InvalidateActiveView(); } } @@ -1445,136 +1586,6 @@ } // ----------------------------------------------------------------------------- -// CXnViewManager::SetFirstPassDrawCompleteL() -// ----------------------------------------------------------------------------- -// -void CXnViewManager::SetFirstPassDrawCompleteL() - { - if ( iFlags.IsClear( EFirstPassDrawComplete ) ) - { - iFlags.Set( EFirstPassDrawComplete ); - - ValidateActiveViewL(); - } - } - -// ----------------------------------------------------------------------------- -// CXnViewManager::SetDataPluginLoadCompleteL() -// ----------------------------------------------------------------------------- -// -void CXnViewManager::SetDataPluginLoadCompleteL( - const CXnPluginData& aPluginData ) - { - if ( !aPluginData.Active() ) - { - // Not interested - return; - } - - if ( ActiveViewData().DataPluginsLoaded() ) - { - if ( iFlags.IsClear( EDataPluginsComplete ) ) - { - iFlags.Set( EDataPluginsComplete ); - - ValidateActiveViewL(); - } - } - } - -// ----------------------------------------------------------------------------- -// CXnViewManager::ValidateActiveViewL() -// ----------------------------------------------------------------------------- -// -void CXnViewManager::ValidateActiveViewL() - { - if ( iFlags.IsSet( EViewIsValid ) ) - { - // Already ok - return; - } - - if ( iFlags.IsClear( EFirstPassDrawComplete ) || - iFlags.IsClear( EDataPluginsComplete ) ) - { - // Not able to confirm yet - return; - } - - RPointerArray< CXnPluginData >& plugins( ActiveViewData().PluginData() ); - - TInt count( iFailedPlugins.Count() ); - - for ( TInt i = 0; i < plugins.Count(); i++ ) - { - CXnPluginData* plugin( plugins[i] ); - - const TDesC8& state( plugin->PluginState() ); - - if ( state.CompareF( KStateError ) == 0 && plugin->Removable() ) - { - if ( iFailedPlugins.Find( plugin ) == KErrNotFound ) - { - iFailedPlugins.AppendL( plugin ); - } - } - } - - // This condition prevents recursion - if ( iFailedPlugins.Count() > 0 && count == 0 ) - { - // Disable layout and redraw until all plugins are removed - iUiEngine->DisableRenderUiLC(); - - for ( TInt i = 0; i < iFailedPlugins.Count(); i++ ) - { - UnloadWidgetFromPluginL( *iFailedPlugins[i] ); - } - - HBufC* msg( StringLoader::LoadLC( R_QTN_HS_ERROR_WIDGETS_REMOVED ) ); - - CAknErrorNote* note = new ( ELeave ) CAknErrorNote; - CleanupStack::PushL( note ); - - note->ExecuteLD( *msg ); - - CleanupStack::Pop( note ); - CleanupStack::PopAndDestroy( msg ); - - iUiEngine->RenderUIL(); - - CleanupStack::PopAndDestroy(); // DisableRenderUiLC() - - iFailedPlugins.Reset(); - } - - // All failed plugins are handled - if( iFailedPlugins.Count() == 0 ) - { - iFlags.Set( EViewIsValid ); - - SetOnlineStateL( iAppUiAdapter, ActiveViewData() ); - - // Remaining views can be now loaded - iRootData->LoadRemainingViews(); - } - } - -// ----------------------------------------------------------------------------- -// CXnViewManager::InvalidateActiveView() -// ----------------------------------------------------------------------------- -// -void CXnViewManager::InvalidateActiveView() - { - // Need to cancel async activities while view is invalidated - iRootData->CancelLoadRemainingViews(); - - iFlags.Clear( EFirstPassDrawComplete ); - iFlags.Clear( EDataPluginsComplete ); - iFlags.Clear( EViewIsValid ); - } - -// ----------------------------------------------------------------------------- // CXnViewManager::ReportWidgetAmountL() // ----------------------------------------------------------------------------- // @@ -1641,15 +1652,6 @@ } // ----------------------------------------------------------------------------- -// CXnViewManager::UpdateWallpaperL -// ----------------------------------------------------------------------------- -// -void CXnViewManager::UpdateWallpaperL( CXnViewData& aCurrent, CXnViewData& aNew ) - { - iAppUiAdapter.ViewAdapter().BgManager().WallpaperChanged( aCurrent, aNew ); - } - -// ----------------------------------------------------------------------------- // CXnViewManager::ShowOperationFailedMessageL // ----------------------------------------------------------------------------- // @@ -1676,7 +1678,7 @@ } // ----------------------------------------------------------------------------- -// CXnViewManager::UpdateViewSwitcherInformationL() +// CXnViewManager::UpdatePageManagementInformationL() // ----------------------------------------------------------------------------- // void CXnViewManager::UpdatePageManagementInformationL() @@ -1720,40 +1722,6 @@ } // ----------------------------------------------------------------------------- -// CXnViewManager::UpdatePluginStateL() -// ----------------------------------------------------------------------------- -// -void CXnViewManager::UpdatePluginStateL( CXnPluginData& aPluginData ) - { - if ( aPluginData.ConfigurationId().Length() == 0 && - aPluginData.PluginId().Length() ) - { - CHspsConfiguration* configuration( - iHspsWrapper->GetPluginConfigurationL( aPluginData.PluginId() ) ); - CleanupStack::PushL( configuration ); - aPluginData.SetConfigurationIdL( configuration->ConfId() ); - CleanupStack::PopAndDestroy( configuration ); - } - - if ( aPluginData.ConfigurationId().Length() && - aPluginData.PluginId().Length() ) - { - iHspsWrapper->SetConfStateL( - aPluginData.ConfigurationId(), aPluginData.PluginState() ); - } - } - -// ----------------------------------------------------------------------------- -// CXnViewManager::MaxPages() -// -// ----------------------------------------------------------------------------- -// -TInt32 CXnViewManager::MaxPages() - { - return iRootData->MaxPages(); - } - -// ----------------------------------------------------------------------------- // CXnViewManager::ResolveIconIndex // // ----------------------------------------------------------------------------- @@ -1771,4 +1739,87 @@ return index; } + +// ----------------------------------------------------------------------------- +// CXnViewManager::SystemStabileTimerCallback +// ----------------------------------------------------------------------------- +TInt CXnViewManager::SystemStabileTimerCallback( TAny* aAny ) + { + CXnViewManager* self = static_cast( aAny ); + + self->ResetCrashCount(); + + if( self->iStabilityTimer ) + { + self->iStabilityTimer->Cancel(); + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ResetCrashCount +// ----------------------------------------------------------------------------- +void CXnViewManager::ResetCrashCount() + { + RProperty::Set( TUid::Uid( KPSCategoryUid ), KPSCrashCountKey, 0 ); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ShowErrorNoteL +// ----------------------------------------------------------------------------- +void CXnViewManager::ShowErrorNoteL() + { + CAknQueryDialog* query = CAknQueryDialog::NewL(); + query->PrepareLC( R_HS_CONTENT_REMOVED_VIEW ); + + HBufC* queryText( StringLoader::LoadLC( R_HS_ERROR_CONTENT_REMOVED ) ); + query->SetPromptL( queryText->Des() ); + CleanupStack::PopAndDestroy( queryText ); + + query->RunLD(); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::DoRobustnessCheckL +// ----------------------------------------------------------------------------- +void CXnViewManager::DoRobustnessCheckL() + { + TInt crashCount = 0; + RProperty::Get( TUid::Uid( KPSCategoryUid ), + KPSCrashCountKey, + crashCount ); + + if( crashCount == KCrashRestoreDefaultThreshold ) + { + TInt err = iHspsWrapper->RestoreDefaultConfL(); + ShowErrorNoteL(); + } + else if( crashCount >= KCrashRestoreAllTreshold ) + { + TInt err = iHspsWrapper->RestoreRootL(); + ResetCrashCount(); + return; + } + + if( crashCount > 0 ) + { + // Start stability timer to ensure that + // if system is stabile at least KStabilityInterval + // then crash count is reset to 0. + iStabilityTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + iStabilityTimer->Start( KStabilityInterval, + KStabilityInterval, + TCallBack( SystemStabileTimerCallback, this ) ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::OrientationChanged +// ----------------------------------------------------------------------------- +void CXnViewManager::OrientationChanged() + { + iIsLandscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation(); + } + // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnwaitdialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnwaitdialog.cpp Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms 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 of wait dialog that doesn't consume key events. +* +*/ + +// System includes + +// User includes +#include "xnwaitdialog.h" + +// CONSTANTS + +// ============================ LOCAL FUNCTIONS ================================ + +// ============================ MEMBER FUNCTIONS =============================== + +// --------------------------------------------------------------------------- +// CXnWaitDialog::CXnWaitDialog +// --------------------------------------------------------------------------- +// +CXnWaitDialog::CXnWaitDialog( CEikDialog** aSelfPtr, + TBool aVisibilityDelayOff ) + : CAknWaitDialog( aSelfPtr, aVisibilityDelayOff ) + { + } + +// --------------------------------------------------------------------------- +// CXnWaitDialog::~CXnWaitDialog +// --------------------------------------------------------------------------- +// +CXnWaitDialog::~CXnWaitDialog() + { + } + +// --------------------------------------------------------------------------- +// CXnWaitDialog::OfferKeyEventL +// --------------------------------------------------------------------------- +// +TKeyResponse CXnWaitDialog::OfferKeyEventL( + const TKeyEvent& /*aKeyEvent*/, + TEventCode /*aType*/ ) + { + return EKeyWasConsumed; // consume all keys while open + } + +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnwallpapercontainer.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnwallpapercontainer.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnwallpapercontainer.cpp Wed May 12 13:22:51 2010 +0300 @@ -57,9 +57,14 @@ void CXnWallpaperContainer::ConstructL() { CreateWindowL(); - TRect rect = iAvkonAppUi->ClientRect(); + iBgContext = CAknsBasicBackgroundControlContext::NewL( - KAknsIIDQsnBgScreen, rect, EFalse ); + KAknsIIDQsnBgScreen, TRect(), ETrue ); + + TRect rect; + + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect ); + SetRect( rect ); } @@ -97,8 +102,11 @@ { if ( iBgContext ) { - iBgContext->SetRect(Rect()); - TRect rect = Rect(); + TRect rect; + + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, rect ); + + iBgContext->SetRect( rect ); } } @@ -107,13 +115,16 @@ // ----------------------------------------------------------------------------- // void CXnWallpaperContainer::HandleResourceChange(TInt aType) - { - TRect rect; + { if ( aType == KEikDynamicLayoutVariantSwitch ) { - AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect); - SetRect(rect); + TRect rect; + + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect ); + + SetRect( rect ); } + CCoeControl::HandleResourceChange(aType); } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.cpp Wed May 12 13:22:51 2010 +0300 @@ -15,18 +15,9 @@ * */ - -// INCLUDE FILES -#include "xnwallpaperview.h" -#include "xnwallpapercontainer.h" -#include "xnuiengine.h" -#include "xnappuiadapter.h" -#include "xnviewadapter.h" -#include "xnbackgroundmanager.h" -#include - -// SYSTEM INCLUDE FILES +// System includes #include +#include #include #include #include @@ -34,9 +25,31 @@ #include #include #include +#include +#include +#include + +// User includes +#include +#include "xnwallpaperview.h" +#include "xnwallpapercontainer.h" +#include "xnuiengine.h" +#include "xnappuiadapter.h" +#include "xnviewadapter.h" +#include "xnbackgroundmanager.h" +#include "xneffectmanager.h" +#include "xnviewmanager.h" +#include "xnspbgcleaner.h" + +// Constants +_LIT( KResourceDrive, "z:" ); +_LIT( KResourceFile, "xnwallpaperview.rsc" ); _LIT8( KMulti, "multi" ); -const TInt KFileArrayGranularity = 6; + +const TInt KFileArrayGranularity( 6 ); +const TInt KShortDelay = 1000; +const TInt KLongDelay = 1000 * 1000; // ============================ MEMBER FUNCTIONS =============================== @@ -44,8 +57,8 @@ // C++ default constructor. // ----------------------------------------------------------------------------- // -CXnWallpaperView::CXnWallpaperView( CXnUiEngine& aEngine ) : - iEngine( aEngine ) +CXnWallpaperView::CXnWallpaperView( CXnUiEngine& aEngine ) + : iEngine( aEngine ), iAppUi( iEngine.AppUiAdapter() ) { } @@ -55,8 +68,21 @@ // void CXnWallpaperView::ConstructL() { - BaseConstructL(); + TFileName resFile; + resFile.Append( KResourceDrive ); + resFile.Append( KDC_APP_RESOURCE_DIR ); + resFile.Append( KResourceFile ); + + CCoeEnv* env( CCoeEnv::Static() ); + + BaflUtils::NearestLanguageFile( env->FsSession(), resFile ); + + iResourceOffset = env->AddResourceFileL( resFile ); + + BaseConstructL( R_WALLPAPER_VIEW ); + iTimer = CPeriodic::NewL( CActive::EPriorityIdle ); + iViewState = EIdle; } // ----------------------------------------------------------------------------- @@ -78,11 +104,15 @@ // CXnWallpaperView::~CXnWallpaperView() { - if ( iContainer ) + if ( iWaitDialog ) { - delete iContainer; - iContainer = NULL; + TRAP_IGNORE( iWaitDialog->ProcessFinishedL(); ); } + + CCoeEnv::Static()->DeleteResourceFile( iResourceOffset ); + + delete iContainer; + delete iXnSpBgCleaner; delete iTimer; } @@ -99,38 +129,59 @@ // CXnWallpaperView::DoActivateL // ----------------------------------------------------------------------------- // -void CXnWallpaperView::DoActivateL( - const TVwsViewId& aPrevViewId, - TUid /*aCustomMessageId*/, - const TDesC8& aCustomMessage ) +void CXnWallpaperView::DoActivateL( const TVwsViewId& aPrevViewId, + TUid /*aCustomMessageId*/, const TDesC8& aCustomMessage ) { - iAvkonAppUi->StatusPane()->SwitchLayoutL( - R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ); - iAvkonAppUi->StatusPane()->DrawNow(); + // switch layout + CEikStatusPane* sp( iAppUi.StatusPane() ); + + // setup status pane layout + sp->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ); + // apply changes + sp->ApplyCurrentSettingsL(); + // disable transparancy + sp->EnableTransparent( EFalse ); + + // create background cleaner for sp + if ( !iXnSpBgCleaner ) + { + iXnSpBgCleaner = CXnSpBgCleaner::NewL(); + AppUi()->AddToStackL( *this, iXnSpBgCleaner ); + } + + // update sp + iXnSpBgCleaner->DrawNow(); + sp->DrawNow(); + + // update cba + CEikButtonGroupContainer* bgc( Cba() ); + CEikCba* cba = static_cast< CEikCba* >( bgc->ButtonGroup() ); + + if ( cba ) + { + bgc->SetBoundingRect( TRect() ); + cba->DrawNow(); + } + if ( !iContainer ) { iContainer = CXnWallpaperContainer::NewL(); - iAvkonAppUi->AddToStackL( *this, iContainer ); + iAppUi.AddToStackL( *this, iContainer ); iContainer->ActivateL(); iContainer->DrawNow(); } - iData.iAppUid = aPrevViewId.iAppUid; - iData.iViewUid = aPrevViewId.iViewUid; - iData.iMultiple = EFalse; - iData.iTimer = iTimer; + iPreviousViewUid = aPrevViewId; + iMultiple = ( (aCustomMessage == KMulti) ? ETrue : EFalse ); + + iAppUi.EffectManager()->UiRendered(); - if( aCustomMessage == KMulti ) - { - iData.iMultiple = ETrue; - } + iWaitDialog = NULL; + iViewState = EImageSelection; // Run image selection dialog asynchronously - if ( iTimer->IsActive() ) - { - iTimer->Cancel(); - } - iTimer->Start( 0, 1000, TCallBack( TimerCallbackL, &iData ) ); + iTimer->Cancel(); + iTimer->Start( KShortDelay, KLongDelay, TCallBack( TimerCallback, this ) ); } // ----------------------------------------------------------------------------- @@ -139,61 +190,150 @@ // void CXnWallpaperView::DoDeactivate() { + iTimer->Cancel(); // cancel timer + + if ( iWaitDialog ) + { + TRAP_IGNORE( iWaitDialog->ProcessFinishedL(); ); + } + if ( iContainer ) { - iAvkonAppUi->RemoveFromStack( iContainer ); + iAppUi.RemoveFromStack( iContainer ); delete iContainer; iContainer = NULL; } + + if ( iXnSpBgCleaner ) + { + AppUi()->RemoveFromStack( iXnSpBgCleaner ); + delete iXnSpBgCleaner; + iXnSpBgCleaner = NULL; + } + + iViewState = EIdle; + iAppUi.EffectManager()->UiRendered(); } // ----------------------------------------------------------------------------- // CXnWallpaperView::TimerCallback // ----------------------------------------------------------------------------- // -TInt CXnWallpaperView::TimerCallbackL(TAny *aPtr) +TInt CXnWallpaperView::TimerCallback( TAny *aPtr ) + { + CXnWallpaperView* self = reinterpret_cast< CXnWallpaperView* >( aPtr ); + TRAPD( err, self->DoHandleCallBackL(); ); + if ( KErrNone != err ) + { + // activate default view in case of any error + TVwsViewId defaultView; + if ( self->iAppUi.GetDefaultViewId( defaultView ) != KErrNone ) + { + // use default if we got wrong viewid as previous view + defaultView.iAppUid = self->iAppUi.Application()->AppDllUid(); + defaultView.iViewUid = TUid::Uid( 1 ); + } + // try activating default view + TRAP_IGNORE( self->iAppUi.ActivateViewL( defaultView ); ); + } + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CXnWallpaperView::DoHandleCallBackL +// ----------------------------------------------------------------------------- +// +void CXnWallpaperView::DoHandleCallBackL() { - TInt errAddWallpaper = KErrNone; - - TXnWallpaperViewData* data = reinterpret_cast( aPtr ); - data->iTimer->Cancel(); + iTimer->Cancel(); - CDesCArrayFlat* files = - new (ELeave) CDesCArrayFlat( KFileArrayGranularity ); - CleanupStack::PushL( files ); - TBool selected = EFalse; - - TRAPD( err, selected = MGFetch::RunL( *files, EImageFile, data->iMultiple ) ); - if ( err == KErrNone && - selected && - files->MdcaCount() > 0 ) + if ( iViewState == EImageSelection ) { - // set wallpaper. - if( files->MdcaCount() == 1 ) + CDesCArrayFlat* files = + new (ELeave) CDesCArrayFlat( KFileArrayGranularity ); + CleanupStack::PushL( files ); + + TInt err( KErrNone ); + TBool selected( EFalse ); + + CXnBackgroundManager& bg( iAppUi.ViewAdapter().BgManager() ); + + selected = MGFetch::RunL( *files, EImageFile, iMultiple ); + + if ( selected && files->MdcaCount() > 0 ) { - CXnAppUiAdapter* appui = static_cast< CXnAppUiAdapter* >( iAvkonAppUi ); - CXnBackgroundManager& bgManager = appui->ViewAdapter().BgManager(); - errAddWallpaper = bgManager.AddWallpaperL( files->MdcaPoint( 0 ) ); + // set wallpaper + if( files->MdcaCount() == 1 ) + { + TFileName fileName( files->MdcaPoint( 0 ) ); + RFs& fs = CEikonEnv::Static()->FsSession(); + if ( BaflUtils::FileExists( fs, fileName ) ) + { + // if wallpaper adding will take more than 1,5 sec waitdlg will appear + iWaitDialog = new( ELeave ) CAknWaitDialog( + reinterpret_cast( &iWaitDialog ), EFalse ); + iWaitDialog->ExecuteLD( R_CHANGE_WALLPAPER_WAIT_DIALOG ); + + // add wallpaper + err = bg.AddWallpaperL( fileName ); + + // notify waitdlg we're done. + iWaitDialog->ProcessFinishedL(); + // ProcessFinishedL() will NULL iWaitDialog + } + } } + + CleanupStack::PopAndDestroy( files ); + + if( err == KErrTooBig || err == KErrNoMemory ) + { + ShowErrorDialogL( R_QTN_HS_TOO_BIG_IMAGE_NOTE ); + } + else if( err == KErrCancel || err == KErrCouldNotConnect ) + { + // Ignore these. + } + else if( err != KErrNone ) + { + ShowErrorDialogL( R_QTN_HS_CORRUPTED_IMAGE_NOTE ); + } + + // restart timer to deactivate view. View activation fails if + // any dialog was shown just before calling iAppUi.ActivateViewL + // specially when theme effects are on. + iViewState = EViewDeactivation; + iTimer->Start( KLongDelay, KLongDelay, TCallBack( TimerCallback, this ) ); } - CleanupStack::PopAndDestroy( files ); - - if( errAddWallpaper == KErrCACorruptContent ) + else if ( iViewState == EViewDeactivation ) + { + iAppUi.EffectManager()->BeginFullscreenEffectL( + KGfxContextCloseWallpaperView, + iAppUi.ViewManager().ActiveViewData() ); + iAppUi.ActivateViewL( iPreviousViewUid ); + } + else { - //load message text - HBufC* msg = StringLoader::LoadLC( R_QTN_HS_CORRUPTED_IMAGE_NOTE ); - //ensure that dialog will not disappear immediatelly - by const. param - CAknErrorNote* dialog = new (ELeave) CAknErrorNote( true ); - CleanupStack::PushL( dialog ); - //show dialog to user and destroy it - dialog->ExecuteLD( *msg ); - CleanupStack::Pop( dialog ); - CleanupStack::PopAndDestroy( msg ); + iViewState = EIdle; + User::Leave( KErrUnknown ); } - - iAvkonAppUi->ActivateViewL( TVwsViewId( data->iAppUid, data->iViewUid ) ); + } - return EFalse; +// ----------------------------------------------------------------------------- +// CXnWallpaperView::ShowErrorDialogL +// ----------------------------------------------------------------------------- +// +void CXnWallpaperView::ShowErrorDialogL( const TInt aResourceId ) + { + //load message text + HBufC* msg = StringLoader::LoadLC( aResourceId ); + //ensure that dialog will not disappear immediatelly - by const. param + CAknErrorNote* dialog = new (ELeave) CAknErrorNote( true ); + CleanupStack::PushL( dialog ); + //show dialog to user and destroy it + dialog->ExecuteLD( *msg ); + CleanupStack::Pop( dialog ); + CleanupStack::PopAndDestroy( msg ); } diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.rss Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,92 @@ +/* +* 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: +* +* +*/ + +// System includes +#include +#include +#include +#include +#include +#include +#include + +// RESOURCE IDENTIFIER +NAME XNWP // 4 letter ID + +RESOURCE RSS_SIGNATURE + { + } + +// ---------------------------------------------------- +// r_wallpaper_view +// +// ---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_wallpaper_view + { + cba = R_AVKON_SOFTKEYS_CANCEL; + menubar = 0; + toolbar = 0; + } + +// ---------------------------------------------------- +// r_qtn_hs_corrupted_image_note +// +// ---------------------------------------------------- +// +RESOURCE TBUF r_qtn_hs_corrupted_image_note + { + buf = qtn_hs_corrupted_image_note; + } + +// ---------------------------------------------------- +// r_qtn_hs_too_big_image_note +// +// ---------------------------------------------------- +// +RESOURCE TBUF r_qtn_hs_too_big_image_note + { + buf = qtn_hs_too_big_image_note; + } + +// ---------------------------------------------------- +// r_change_wallpaper_wait_dialog +// +// ---------------------------------------------------- +// +RESOURCE DIALOG r_change_wallpaper_wait_dialog + { + flags = EAknWaitNoteFlags; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control= AVKON_NOTE + { + layout = EWaitLayout; + singular_label = qtn_gen_note_processing; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + }; + } + }; + } + +// End of file diff -r e01a28ecba3f -r 45cc9ca502a9 idlehomescreen/xmluirendering/uiengine/src/xnwidgetextensionadapter.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnwidgetextensionadapter.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnwidgetextensionadapter.cpp Wed May 12 13:22:51 2010 +0300 @@ -13,22 +13,22 @@ * */ - +// System includes #include #include #include #include +#include +#include +#include +#include -#include - +// User includes #include "xnwidgetextensionadapter.h" #include "xncontroladapter.h" - #include "xncomponentnodeimpl.h" #include "xncomponent.h" - #include "xnuiengine.h" -#include "xnhittest.h" #include "xnnode.h" #include "xnnodepluginif.h" @@ -46,13 +46,14 @@ #include "xnviewdata.h" #include "xnplugindata.h" - -_LIT8( KPopUpText, "popup" ); +// Constants +_LIT8( KPopup, "popup" ); _LIT8( KPositionHint, "_s60-position-hint" ); _LIT8( KWidgetNodeName, "widget" ); _LIT8( KParentIdName, "parentid" ); _LIT8( KDisplay, "display" ); _LIT8( KNone, "none" ); + // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- @@ -78,7 +79,29 @@ // CXnWidgetExtensionAdapter::~CXnWidgetExtensionAdapter() { + if ( iAppUiAdapter ) + { + iAppUiAdapter->UiStateListener().RemoveObserver( + *( static_cast< MXnUiStateObserver* >( this ) ) ); + iAppUiAdapter->UiStateListener().RemoveObserver( + *( static_cast< MXnUiResourceChangeObserver* >( this ) ) ); + } + GfxTransEffect::Deregister( this ); } +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::HandleScreenDeviceChangedL +// +// ----------------------------------------------------------------------------- +// +void CXnWidgetExtensionAdapter::HandleScreenDeviceChangedL() + { + if( IsVisible() ) + { + CCoeControl::MakeVisible( EFalse ); + } + CXnControlAdapter::HandleScreenDeviceChangedL(); + + } // ----------------------------------------------------------------------------- // CXnWidgetExtensionAdapter::CXnWidgetExtensionAdapter @@ -97,26 +120,47 @@ // void CXnWidgetExtensionAdapter::ConstructL() { + iAppUiAdapter = static_cast< CXnAppUiAdapter* >( iAvkonAppUi ); + CreateWindowL(); + Window().SetRequiredDisplayMode( EColor16MA ); // this adapter handles both widgetextension and popup nodes // we have to decide which one of them is the recent one CXnType* typeInfo = iNode.Node().Type(); + User::LeaveIfNull( typeInfo ); const TDesC8& type = typeInfo->Type(); + + iPermanent = EFalse; - if ( ( type != KPopUpText ) && - ( Window().SetTransparencyAlphaChannel() == KErrNone ) ) + if ( type == KPopup ) { - Window().SetBackgroundColor( ~0 ); + iPopup = ETrue; + CXnProperty* prop( iNode.Node().GetPropertyL( + XnPropertyNames::popup::KPopupType ) ); + + if ( prop && prop->StringValue() == + XnPropertyNames::popup::popuptype::KPermanent ) + { + iPermanent = ETrue; + } } + else + { + if ( Window().SetTransparencyAlphaChannel() == KErrNone ) + { + Window().SetBackgroundColor( ~0 ); + } + } + iUiEngine = iNode.Node().UiEngine(); CXnControlAdapter::ConstructL( iNode ); - EnableDragEvents(); - - iAppUiAdapter = static_cast< CXnAppUiAdapter* >( iAvkonAppUi ); - + + EnableDragEvents(); + + GfxTransEffect::Register( this, KGfxPreviewPopupControlUid ); } // ----------------------------------------------------------------------------- @@ -126,30 +170,181 @@ // void CXnWidgetExtensionAdapter::MakeVisible( TBool aVisible ) { - - TBool visible( IsVisible() ? ETrue : EFalse ); - if ( visible == aVisible ) + if ( IsVisible() == aVisible ) + { + return; + } + + CXnPluginData* plugin( + iAppUiAdapter->ViewManager().ActiveViewData().Plugin( &iNode.Node() ) ); + + if ( !plugin ) { return; } SetPointerCapture( aVisible ); + + plugin->SetIsDisplayingPopup( aVisible, &iNode.Node() ); - CXnPluginData& plugin( - iAppUiAdapter->ViewManager().ActiveViewData().Plugin( &iNode.Node() ) ); - - plugin.SetIsDisplayingPopup( aVisible, &iNode.Node() ); - - CXnType* typeInfo = iNode.Node().Type(); - const TDesC8& type = typeInfo->Type(); - - if ( type != KPopUpText ) + if ( !iPopup ) { DrawableWindow()->FadeBehind( aVisible ); } - if ( aVisible && type == KPopUpText ) + if ( !iPermanent ) + { + if ( aVisible ) + { + iAppUiAdapter->UiStateListener().AddObserver( + *( static_cast< MXnUiStateObserver* >( this ) ) ); + iAppUiAdapter->UiStateListener().AddObserver( + *( static_cast< MXnUiResourceChangeObserver* >( this ) ) ); + } + else + { + iAppUiAdapter->UiStateListener().RemoveObserver( + *( static_cast< MXnUiStateObserver* >( this ) ) ); + iAppUiAdapter->UiStateListener().RemoveObserver( + *( static_cast< MXnUiResourceChangeObserver* >( this ) ) ); + } + } + + if ( aVisible && iPopup ) + { + ChangePopupPosition(); + } + + TBool effectStarted = EFalse; + if ( iAppUiAdapter->IsForeground() ) + { + if ( aVisible ) + { + GfxTransEffect::Begin( this, KGfxControlAppearAction ); + } + else + { + GfxTransEffect::Begin( this, KGfxControlDisappearAction ); + } + effectStarted = ETrue; + } + + CCoeControl::MakeVisible( aVisible ); + + if ( effectStarted ) + { + GfxTransEffect::SetDemarcation( this, iPosition ); + GfxTransEffect::End( this ); + } + } + +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::HandlePointerEventL +// +// ----------------------------------------------------------------------------- +// +void CXnWidgetExtensionAdapter::HandlePointerEventL( + const TPointerEvent& aPointerEvent ) + { + + // in case of popup, we have to make sure that + // it will be closed after tapping outside of the + // area of itself and its parent + if ( iPopup ) { + // check if the tap was inside of popup + TRect popupRect = this->Rect(); + popupRect.Move(this->Position() ); + TBool isInPopupWindow = popupRect.Contains( + aPointerEvent.iParentPosition ); + + if ( !isInPopupWindow ) + { + // if tap was outside of window, check if tap was + // inside of the parrent + CXnProperty* parentIdProp( iNode.Node().GetPropertyL( + KParentIdName ) ); + + if ( parentIdProp ) + { + const TDesC8& parentIdVal = parentIdProp->StringValue(); + CXnNode* parentN(iUiEngine->FindNodeByIdL( parentIdVal, + iNode.Node().Namespace() ) ); + + if ( parentN ) + { + TRect clientRect = + static_cast ( *iAppUiAdapter ).ClientRect(); + TRect parentRect = parentN->Rect(); + parentRect.Move( clientRect.iTl ); + + if ( !parentRect.Contains( aPointerEvent.iParentPosition ) ) + { + // tap was neither in popup nor in its parent - + // we can close it + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + HidePopupL(); + return; + } + } + else + { + // tap was made inside of popup parent + // we pass the event to it after + // recalculating the taping point + TPointerEvent newPointerEvent; + newPointerEvent.Copy( aPointerEvent ); + newPointerEvent.iPosition = TPoint( + aPointerEvent.iParentPosition - clientRect.iTl ); + parentN->Control()->HandlePointerEventL( newPointerEvent ); + return; + } + } + } + else + { + HidePopupL(); + } + } + } + + CXnControlAdapter::HandlePointerEventL( aPointerEvent ); + } + +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::Draw +// +// ----------------------------------------------------------------------------- +// +void CXnWidgetExtensionAdapter::Draw( const TRect& aRect ) const + { + SystemGc().Clear( aRect ); + CXnControlAdapter::Draw( aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::DoHandlePropertyChangeL +// +// ----------------------------------------------------------------------------- +// +void CXnWidgetExtensionAdapter::DoHandlePropertyChangeL( CXnProperty* /*aProperty*/ ) + { + if( iNode.Node().IsLaidOut() && IsVisible() ) + { + ChangePopupPosition(); + } + } + +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::ChangePopupPosition +// +// ----------------------------------------------------------------------------- +// +void CXnWidgetExtensionAdapter::ChangePopupPosition() + { + if ( iPopup ) + { // read position-hint property and set-up its variable CXnProperty* positionHintProp = NULL; TRAP_IGNORE( positionHintProp = iNode.Node().GetPropertyL( KPositionHint ) ); @@ -203,100 +398,6 @@ } } } - - CCoeControl::MakeVisible( aVisible ); - } - -// ----------------------------------------------------------------------------- -// CXnWidgetExtensionAdapter::HandlePointerEventL -// -// ----------------------------------------------------------------------------- -// -void CXnWidgetExtensionAdapter::HandlePointerEventL( - const TPointerEvent& aPointerEvent ) - { - - CXnType* typeInfo = iNode.Node().Type(); - const TDesC8& type = typeInfo->Type(); - - // in case of popup, we have to make sure that - // it will be closed after tapping outside of the - // area of itself and its parent - if ( type == KPopUpText ) - { - - // check if the tap was inside of popup - TRect popupRect = this->Rect(); - popupRect.Move(this->Position() ); - TBool isInPopupWindow = popupRect.Contains( - aPointerEvent.iParentPosition ); - - if ( !isInPopupWindow ) - { - - // if tap was outside of window, check if tap was - // inside of the parrent - CXnProperty* parentIdProp = iNode.Node().GetPropertyL( - KParentIdName ); - - if ( parentIdProp ) - { - const TDesC8& parentIdVal = parentIdProp->StringValue(); - CXnNode* parentN(iUiEngine->FindNodeByIdL( parentIdVal, - iNode.Node().Namespace() ) ); - - if ( parentN ) - { - TRect clientRect = - static_cast ( *iAppUiAdapter ).ClientRect(); - TRect parentRect = parentN->Rect(); - parentRect.Move( clientRect.iTl ); - - if ( !parentRect.Contains( aPointerEvent.iParentPosition ) ) - { - // tap was neither in popup nor in its parent - - // we can close it - if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) - { - CXnDomStringPool* sp = - iNode.Node().DomNode()->StringPool(); - CXnProperty* prop = CXnProperty::NewL( KDisplay, KNone, - CXnDomPropertyValue::EString, *sp ); - CleanupStack::PushL( prop ); - iNode.Node().SetPropertyL( prop ); - CleanupStack::Pop( prop ); - return; - } - } - else - { - // tap was made inside of popup parent - // we pass the event to it after - // recalculating the taping point - TPointerEvent newPointerEvent; - newPointerEvent.Copy( aPointerEvent ); - newPointerEvent.iPosition = TPoint( - aPointerEvent.iParentPosition - clientRect.iTl ); - parentN->Control()->HandlePointerEventL( newPointerEvent ); - return; - } - } - } - } - } - - CXnControlAdapter::HandlePointerEventL( aPointerEvent ); - - } - -// ----------------------------------------------------------------------------- -// CXnWidgetExtensionAdapter::Draw -// -// ----------------------------------------------------------------------------- -// -void CXnWidgetExtensionAdapter::Draw( const TRect& aRect ) const - { - CXnControlAdapter::Draw( aRect ); } // ----------------------------------------------------------------------------- @@ -305,12 +406,11 @@ // ----------------------------------------------------------------------------- void CXnWidgetExtensionAdapter::CalculatePosition() { - // widget's rectangle TRect controlRect; - // get popup's window size - TRect popupRect = this->Rect(); + // get popup's size. + TSize popupSize = iNode.BorderRect().Size(); TRect clientRect = static_cast( *iAppUiAdapter ).ClientRect(); @@ -358,16 +458,16 @@ // if this position does not fit the screen, // and if below left is more suitable, use it - if ( spaceAbove < popupRect.Height() && spaceBelow > spaceAbove ) + if ( spaceAbove < popupSize.iHeight && spaceBelow > spaceAbove ) { rect = TRect( TPoint( controlRect.iTl.iX, controlRect.iBr.iY ), - TPoint( controlRect.iTl.iX + popupRect.Width(), controlRect.iBr.iY + popupRect.Height() ) ); + TPoint( controlRect.iTl.iX + popupSize.iWidth, controlRect.iBr.iY + popupSize.iHeight ) ); } else { // use the above-left position - rect = TRect( TPoint( controlRect.iTl.iX, controlRect.iTl.iY - popupRect.Height() ), - TPoint( controlRect.iTl.iX + popupRect.Width(), controlRect.iTl.iY ) ); + rect = TRect( TPoint( controlRect.iTl.iX, controlRect.iTl.iY - popupSize.iHeight ), + TPoint( controlRect.iTl.iX + popupSize.iWidth, controlRect.iTl.iY ) ); } break; @@ -376,15 +476,15 @@ // if this position does not fit the screen, // and if below right is more suitable, use it - if ( spaceAbove < popupRect.Height() && spaceBelow > spaceAbove ) + if ( spaceAbove < popupSize.iHeight && spaceBelow > spaceAbove ) { - rect = TRect( TPoint( controlRect.iBr.iX - popupRect.Width(), controlRect.iBr.iY ), - TPoint( controlRect.iBr.iX, controlRect.iBr.iY + popupRect.Height() ) ); + rect = TRect( TPoint( controlRect.iBr.iX - popupSize.iWidth, controlRect.iBr.iY ), + TPoint( controlRect.iBr.iX, controlRect.iBr.iY + popupSize.iHeight ) ); } else { // use the above-right position - rect = TRect( TPoint( controlRect.iBr.iX - popupRect.Width(), controlRect.iTl.iY - popupRect.Height() ), + rect = TRect( TPoint( controlRect.iBr.iX - popupSize.iWidth, controlRect.iTl.iY - popupSize.iHeight ), TPoint( controlRect.iBr.iX, controlRect.iTl.iY ) ); } break; @@ -393,16 +493,16 @@ // if this position does not fit the screen, // and if above left is more suitable, use it - if ( spaceBelow < popupRect.Height() && spaceBelow < spaceAbove ) + if ( spaceBelow < popupSize.iHeight && spaceBelow < spaceAbove ) { - rect = TRect( TPoint( controlRect.iTl.iX, controlRect.iTl.iY - popupRect.Height() ), - TPoint( controlRect.iTl.iX + popupRect.Width(), controlRect.iTl.iY ) ); + rect = TRect( TPoint( controlRect.iTl.iX, controlRect.iTl.iY - popupSize.iHeight ), + TPoint( controlRect.iTl.iX + popupSize.iWidth, controlRect.iTl.iY ) ); } else { // use the below-left position rect = TRect( TPoint( controlRect.iTl.iX, controlRect.iBr.iY ), - TPoint( controlRect.iTl.iX + popupRect.Width(), controlRect.iBr.iY + popupRect.Height() ) ); + TPoint( controlRect.iTl.iX + popupSize.iWidth, controlRect.iBr.iY + popupSize.iHeight ) ); } break; @@ -410,16 +510,16 @@ // if this position does not fit the screen, // and if above right is more suitable, use it - if ( spaceBelow < popupRect.Height() && spaceBelow < spaceAbove ) + if ( spaceBelow < popupSize.iHeight && spaceBelow < spaceAbove ) { - rect = TRect( TPoint( controlRect.iBr.iX - popupRect.Width(), controlRect.iTl.iY - popupRect.Height() ), + rect = TRect( TPoint( controlRect.iBr.iX - popupSize.iWidth, controlRect.iTl.iY - popupSize.iHeight ), TPoint( controlRect.iBr.iX, controlRect.iTl.iY ) ); } else { // use the below-right position - rect = TRect( TPoint( controlRect.iBr.iX - popupRect.Width(), controlRect.iBr.iY ), - TPoint( controlRect.iBr.iX, controlRect.iBr.iY + popupRect.Height() ) ); + rect = TRect( TPoint( controlRect.iBr.iX - popupSize.iWidth, controlRect.iBr.iY ), + TPoint( controlRect.iBr.iX, controlRect.iBr.iY + popupSize.iHeight ) ); } break; @@ -427,33 +527,33 @@ // if this position does not fit the screen, // and if left or above-left is more suitable, use it - if ( spaceRight < popupRect.Width() ) + if ( spaceRight < popupSize.iWidth ) { // use the left position if the space is big enough - if ( spaceLeft >= popupRect.Width() ) + if ( spaceLeft >= popupSize.iWidth ) { // use left position - rect = TRect( TPoint( controlRect.iTl.iX - popupRect.Width(), controlRect.iTl.iY ), - TPoint( controlRect.iTl.iX, controlRect.iTl.iY + popupRect.Height() ) ); + rect = TRect( TPoint( controlRect.iTl.iX - popupSize.iWidth, controlRect.iTl.iY ), + TPoint( controlRect.iTl.iX, controlRect.iTl.iY + popupSize.iHeight ) ); } - else if ( spaceAbove >= popupRect.Height() ) + else if ( spaceAbove >= popupSize.iHeight ) { // use the above-right position - rect = TRect( TPoint( controlRect.iBr.iX - popupRect.Width(), controlRect.iTl.iY - popupRect.Height() ), + rect = TRect( TPoint( controlRect.iBr.iX - popupSize.iWidth, controlRect.iTl.iY - popupSize.iHeight ), TPoint( controlRect.iBr.iX, controlRect.iTl.iY ) ); } else { // use the below-right position - rect = TRect( TPoint( controlRect.iBr.iX - popupRect.Width(), controlRect.iBr.iY ), - TPoint( controlRect.iBr.iX, controlRect.iBr.iY + popupRect.Height() ) ); + rect = TRect( TPoint( controlRect.iBr.iX - popupSize.iWidth, controlRect.iBr.iY ), + TPoint( controlRect.iBr.iX, controlRect.iBr.iY + popupSize.iHeight ) ); } } else { // use the right position rect = TRect( TPoint( controlRect.iBr.iX, controlRect.iTl.iY ), - TPoint( controlRect.iBr.iX + popupRect.Width(), controlRect.iTl.iY + popupRect.Height() ) ); + TPoint( controlRect.iBr.iX + popupSize.iWidth, controlRect.iTl.iY + popupSize.iHeight ) ); } break; @@ -462,32 +562,32 @@ // if this position does not fit the screen, // and if right is more suitable, use it - if ( spaceLeft < popupRect.Width() ) + if ( spaceLeft < popupSize.iWidth ) { // use the right position, if it the space is big enough - if ( spaceRight >= popupRect.Width() ) + if ( spaceRight >= popupSize.iWidth ) { rect = TRect( TPoint( controlRect.iBr.iX, controlRect.iTl.iY ), - TPoint( controlRect.iBr.iX + popupRect.Width(), controlRect.iTl.iY + popupRect.Height() ) ); + TPoint( controlRect.iBr.iX + popupSize.iWidth, controlRect.iTl.iY + popupSize.iHeight ) ); } - else if ( spaceAbove >= popupRect.Height() ) + else if ( spaceAbove >= popupSize.iHeight ) { // use the above-left position - rect = TRect( TPoint( controlRect.iTl.iX, controlRect.iTl.iY - popupRect.Height() ), - TPoint( controlRect.iTl.iX + popupRect.Width(), controlRect.iTl.iY ) ); + rect = TRect( TPoint( controlRect.iTl.iX, controlRect.iTl.iY - popupSize.iHeight ), + TPoint( controlRect.iTl.iX + popupSize.iWidth, controlRect.iTl.iY ) ); } else { // use the below-left position rect = TRect( TPoint( controlRect.iTl.iX, controlRect.iBr.iY ), - TPoint( controlRect.iTl.iX + popupRect.Width(), controlRect.iBr.iY + popupRect.Height() ) ); + TPoint( controlRect.iTl.iX + popupSize.iWidth, controlRect.iBr.iY + popupSize.iHeight ) ); } } else { // use the left position - rect = TRect( TPoint( controlRect.iTl.iX - popupRect.Width(), controlRect.iTl.iY ), - TPoint( controlRect.iTl.iX, controlRect.iTl.iY + popupRect.Height() ) ); + rect = TRect( TPoint( controlRect.iTl.iX - popupSize.iWidth, controlRect.iTl.iY ), + TPoint( controlRect.iTl.iX, controlRect.iTl.iY + popupSize.iHeight ) ); } break; default: @@ -513,7 +613,107 @@ { rect.Move( contentRect.iBr.iX - rect.iBr.iX, 0 ); } + this->SetRect( rect ); } + +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::NotifyForegroundChanged +// +// ----------------------------------------------------------------------------- +// +void CXnWidgetExtensionAdapter::NotifyForegroundChanged( + TForegroundStatus aStatus ) + { + if ( iPopup && aStatus != EForeground ) + { + TRAP_IGNORE( HidePopupL() ); + } + else if ( !iPopup && aStatus == EForeground ) + { + if ( !DrawableWindow()->IsFaded() ) + { + DrawableWindow()->FadeBehind( ETrue ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::NotifyLightStatusChanged +// +// ----------------------------------------------------------------------------- +// +void CXnWidgetExtensionAdapter::NotifyLightStatusChanged( TBool aLightsOn ) + { + if ( !aLightsOn ) + { + TRAP_IGNORE( HidePopupL() ); + } + } + +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::NotifyInCallStateChaged +// +// ----------------------------------------------------------------------------- +// +void CXnWidgetExtensionAdapter::NotifyInCallStateChaged( TBool /*aInCall*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::HidePopupL +// +// ----------------------------------------------------------------------------- +// +void CXnWidgetExtensionAdapter::HidePopupL() + { + if ( IsVisible() ) + { + CXnDomStringPool* sp( iNode.Node().DomNode()->StringPool() ); + + CXnProperty* prop = CXnProperty::NewL( + KDisplay, KNone, CXnDomPropertyValue::EString, *sp ); + + CleanupStack::PushL( prop ); + + iNode.Node().SetPropertyL( prop ); + + CleanupStack::Pop( prop ); + } + } + +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::NotifyStatusPaneSizeChanged +// +// ----------------------------------------------------------------------------- +// +void CXnWidgetExtensionAdapter::NotifyStatusPaneSizeChanged() + { + } + +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::NotifyResourceChanged +// +// ----------------------------------------------------------------------------- +// +void CXnWidgetExtensionAdapter::NotifyResourceChanged( TInt aType ) + { + + // if type is widget extension and fade has changed + // we have to always fade main window + if ( !iPopup && aType == KEikMessageWindowsFadeChange ) + { + if ( !DrawableWindow()->IsFaded() ) + { + DrawableWindow()->FadeBehind( ETrue ); + } + } + + else if( iPopup && aType == KAknSplitInputDisabled ) + { + HidePopupL(); + } + } + // End of File diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdvaluetext.h --- a/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdvaluetext.h Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdvaluetext.h Wed May 12 13:22:51 2010 +0300 @@ -29,7 +29,6 @@ struct THnMdCommonPointers; class CDesC16Array; class CDesC8Array; -class CArrayFix; // CLASS DECLARATION diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/hierarchynavigator/hnpresentationmodel/inc/hneventhandler.h --- a/menufw/hierarchynavigator/hnpresentationmodel/inc/hneventhandler.h Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hneventhandler.h Wed May 12 13:22:51 2010 +0300 @@ -184,6 +184,12 @@ * Reference to App UI - Event observer. */ MHnControllerInterface& iControllerInterface; + + /** + * ETrue if a standard asynchroneous action is being executed by + * this event handler. + */ + TBool iIsExecutingStandardAsyncAction; }; diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/hierarchynavigator/hnpresentationmodel/src/hneventhandler.cpp --- a/menufw/hierarchynavigator/hnpresentationmodel/src/hneventhandler.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hneventhandler.cpp Wed May 12 13:22:51 2010 +0300 @@ -32,7 +32,7 @@ // --------------------------------------------------------------------------- -// Safe constructor. Initializes refrerece to the Meta Data Model in which +// Safe constructor. Initializes refrerece to the Meta Data Model in which // the event-to-action mappings are stored. // --------------------------------------------------------------------------- // @@ -43,7 +43,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // CHnEventHandler::~CHnEventHandler() @@ -52,10 +52,10 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // -CHnEventHandler* CHnEventHandler::NewLC( +CHnEventHandler* CHnEventHandler::NewLC( MHnMdModelEventObserver& aModelObserver, MHnControllerInterface& aController ) { @@ -67,21 +67,21 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // -CHnEventHandler* CHnEventHandler::NewL( +CHnEventHandler* CHnEventHandler::NewL( MHnMdModelEventObserver& aModelObserver, MHnControllerInterface& aController ) { - CHnEventHandler* self=CHnEventHandler::NewLC( aModelObserver, + CHnEventHandler* self=CHnEventHandler::NewLC( aModelObserver, aController ); - CleanupStack::Pop(self); + CleanupStack::Pop(self); return self; } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // void CHnEventHandler::ConstructL() @@ -89,45 +89,70 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // - TInt CHnEventHandler::ExecuteStandardActionL( CHnActionModel* aActionModel ) { - delete iServiceHandler; - iServiceHandler = NULL; - iServiceHandler = CHnServiceHandler::NewL( - aActionModel->Service(), - aActionModel->Interface(), - aActionModel->CommandName(), - aActionModel->ServiceMode(), - aActionModel->ConstructorLC(), - aActionModel->CommandLC() ); + const TDesC8& service = aActionModel->Service(); + const TDesC8& interface = aActionModel->Interface(); + const TDesC8& commandName = aActionModel->CommandName(); + const TServiceMode mode = aActionModel->ServiceMode(); + CLiwGenericParamList* constructor = aActionModel->ConstructorLC(); + CLiwGenericParamList* serviceCommand = aActionModel->CommandLC(); + + if ( iServiceHandler && ( iIsExecutingStandardAsyncAction + || !iServiceHandler->ServiceHandlerMatchesModel( + service, interface, constructor ) ) ) + { + delete iServiceHandler; // this will cancel async. action execution + iServiceHandler = NULL; + iIsExecutingStandardAsyncAction = EFalse; + } + + if ( !iServiceHandler ) + { + iServiceHandler = CHnServiceHandler::NewL( service, interface, + commandName, mode, constructor, serviceCommand ); + CleanupStack::Pop( serviceCommand ); + CleanupStack::Pop( constructor ); + } + else + { + iServiceHandler->PrepareForNextExecutionL( + commandName, mode, serviceCommand ); + CleanupStack::Pop( serviceCommand ); + CleanupStack::PopAndDestroy( constructor ); + constructor = NULL; + } - CleanupStack::Pop( 2 ); - TInt res = iServiceHandler->ExecuteL( this, 0 ); + __ASSERT_DEBUG( !iIsExecutingStandardAsyncAction, User::Invariant() ); + if ( mode == EServiceModeAsynchronous ) + { + iIsExecutingStandardAsyncAction = ETrue; + } + TInt res = iServiceHandler->ExecuteL( this, 0 ); return res; } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // -TInt CHnEventHandler::ExtractUidFromActionL( const TDesC8& aInterface, +TInt CHnEventHandler::ExtractUidFromActionL( const TDesC8& aInterface, TUid& aUid ) { DEBUG16(("_MM_: CHnEventHandler::ExtractUidFromActionL UIext - uid %S", &aInterface )); - + TLex8 lex( aInterface ); lex.Inc( 2 ); return lex.Val( (TUint32 &) aUid.iUid, EHex ); } - + // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // TInt CHnEventHandler::ExecuteInternalActionL( CHnActionModel* aActionModel ) @@ -136,32 +161,32 @@ CLiwGenericParamList* params = aActionModel->CommandLC(); if ( aActionModel->CommandName() == KServiceOpenSuite ) { - ret = iEventObserver.HandleModelEventL( KNewSuiteLoadedMdEvent(), + ret = iEventObserver.HandleModelEventL( KNewSuiteLoadedMdEvent(), *params ); } else if ( aActionModel->CommandName() == KServiceSwitchWidget ) { - ret = iEventObserver.HandleModelEventL( KSwitchWidgetMdEvent(), + ret = iEventObserver.HandleModelEventL( KSwitchWidgetMdEvent(), *params ); } else if ( aActionModel->CommandName() == KServiceStartEditMode ) { - ret = iEventObserver.HandleModelEventL( KStartEditModeMdEvent(), + ret = iEventObserver.HandleModelEventL( KStartEditModeMdEvent(), *params ); } else if ( aActionModel->CommandName() == KServiceStopEditMode ) { - ret = iEventObserver.HandleModelEventL( KStopEditModeMdEvent(), + ret = iEventObserver.HandleModelEventL( KStopEditModeMdEvent(), *params ); } else if ( aActionModel->CommandName() == KServiceBack ) { - ret = iEventObserver.HandleModelEventL( KBackMdEvent(), + ret = iEventObserver.HandleModelEventL( KBackMdEvent(), *params ); } else if ( aActionModel->CommandName() == KSetFocus ) { - ret = iEventObserver.HandleModelEventL( KSetFocusEvent(), + ret = iEventObserver.HandleModelEventL( KSetFocusEvent(), *params ); } @@ -170,7 +195,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // TInt CHnEventHandler::ExecuteExtensionManagerActionL( @@ -178,28 +203,28 @@ { TUid uid; TInt err = ExtractUidFromActionL( aActionModel->Interface(), uid ); - + if ( KErrNone == err ) { HBufC* cmd = HnConvUtils::Str8ToStrFastLC( aActionModel->CommandName() ); CLiwGenericParamList* command = aActionModel->CommandLC(); - err = iControllerInterface.ExecuteExtensionActionL( uid, *cmd, command ); + err = iControllerInterface.ExecuteExtensionActionL( uid, *cmd, command ); CleanupStack::PopAndDestroy( command ); CleanupStack::PopAndDestroy( cmd ); } - + return err; } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // EXPORT_C TInt CHnEventHandler::ExecuteActionL( CHnActionModel* aActionModel ) { ASSERT( aActionModel ); TInt err( KErrNone ); - + if( aActionModel->Service() == KServiceMultimediaMenu ) { if ( aActionModel->Interface().Length() == 0 ) @@ -215,7 +240,7 @@ { err = ExecuteStandardActionL( aActionModel ); } - + return err; } @@ -226,5 +251,6 @@ CLiwGenericParamList& /*aEventParamList*/, const CLiwGenericParamList& /*aInParamList*/ ) { + iIsExecutingStandardAsyncAction = EFalse; return KErrNone; } diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/hierarchynavigator/hnutilities/bwins/hnutilitiesu.def --- a/menufw/hierarchynavigator/hnutilities/bwins/hnutilitiesu.def Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/hierarchynavigator/hnutilities/bwins/hnutilitiesu.def Wed May 12 13:22:51 2010 +0300 @@ -5,39 +5,41 @@ ?ToGenericParamListL@CHnMdBaseKey@@UBEXAAVCLiwGenericParamList@@@Z @ 4 NONAME ; void CHnMdBaseKey::ToGenericParamListL(class CLiwGenericParamList &) const ?NumToStr8LC@HnConvUtils@@SAPAVHBufC8@@ABH@Z @ 5 NONAME ; class HBufC8 * HnConvUtils::NumToStr8LC(int const &) ?StoreSuiteWidgetTypeL@CHnRepositoryManager@@QAEHABVTDesC16@@W4THnSuiteWidgetType@@@Z @ 6 NONAME ; int CHnRepositoryManager::StoreSuiteWidgetTypeL(class TDesC16 const &, enum THnSuiteWidgetType) - ?StrToStr8L@HnConvUtils@@SAPAVHBufC8@@ABVTDesC16@@@Z @ 7 NONAME ; class HBufC8 * HnConvUtils::StrToStr8L(class TDesC16 const &) - ?NewL@CHnRepositoryManager@@SAPAV1@XZ @ 8 NONAME ; class CHnRepositoryManager * CHnRepositoryManager::NewL(void) - ?VariantToStringL@HnLiwUtils@@SAHAAVTLiwVariant@@AAVRBuf16@@@Z @ 9 NONAME ; int HnLiwUtils::VariantToStringL(class TLiwVariant &, class RBuf16 &) - ?SetGenericParamListL@HnLiwUtils@@SAXABV?$RPointerArray@VCHnMdBaseKey@@@@AAVCLiwGenericParamList@@@Z @ 10 NONAME ; void HnLiwUtils::SetGenericParamListL(class RPointerArray const &, class CLiwGenericParamList &) - ?GetStringL@HnLiwUtils@@SAHABVCLiwGenericParamList@@ABVTDesC8@@HAAVRBuf8@@@Z @ 11 NONAME ; int HnLiwUtils::GetStringL(class CLiwGenericParamList const &, class TDesC8 const &, int, class RBuf8 &) - ?CreateL@HnMdKeyFactory@@SAPAVCHnMdBaseKey@@ABVTDesC8@@00@Z @ 12 NONAME ; class CHnMdBaseKey * HnMdKeyFactory::CreateL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &) - ?CreateL@HnMdKeyFactory@@SAPAVCHnMdBaseKey@@VTXmlEngElement@@@Z @ 13 NONAME ; class CHnMdBaseKey * HnMdKeyFactory::CreateL(class TXmlEngElement) - ?Str8ToStrLC@HnConvUtils@@SAPAVHBufC16@@ABVTDesC8@@@Z @ 14 NONAME ; class HBufC16 * HnConvUtils::Str8ToStrLC(class TDesC8 const &) - ?GetIterableItemCountL@HnLiwUtils@@SAHAAVCLiwIterable@@@Z @ 15 NONAME ; int HnLiwUtils::GetIterableItemCountL(class CLiwIterable &) - ?ReadSuiteWidgetTypeL@CHnRepositoryManager@@QAEHABVTDesC16@@AAW4THnSuiteWidgetType@@@Z @ 16 NONAME ; int CHnRepositoryManager::ReadSuiteWidgetTypeL(class TDesC16 const &, enum THnSuiteWidgetType &) - ?StrToInt@HnConvUtils@@SAHABVTDesC16@@AAJ@Z @ 17 NONAME ; int HnConvUtils::StrToInt(class TDesC16 const &, long &) - ??1CHnServiceHandler@@UAE@XZ @ 18 NONAME ; CHnServiceHandler::~CHnServiceHandler(void) - ?NewLC@CHnServiceHandler@@SAPAV1@ABVTDesC8@@00W4TServiceMode@@PAVCLiwGenericParamList@@2@Z @ 19 NONAME ; class CHnServiceHandler * CHnServiceHandler::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, enum TServiceMode, class CLiwGenericParamList *, class CLiwGenericParamList *) - ?Str8ToUint@HnConvUtils@@SAHABVTDesC8@@AAI@Z @ 20 NONAME ; int HnConvUtils::Str8ToUint(class TDesC8 const &, unsigned int &) - ?Str8ToInt@HnConvUtils@@SAHABVTDesC8@@AAJ@Z @ 21 NONAME ; int HnConvUtils::Str8ToInt(class TDesC8 const &, long &) - ?NewL@CHnServiceHandler@@SAPAV1@ABVTDesC8@@00W4TServiceMode@@PAVCLiwGenericParamList@@2@Z @ 22 NONAME ; class CHnServiceHandler * CHnServiceHandler::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, enum TServiceMode, class CLiwGenericParamList *, class CLiwGenericParamList *) - ?AddSubKeyL@CHnMdBaseKey@@QAEXPAV1@@Z @ 23 NONAME ; void CHnMdBaseKey::AddSubKeyL(class CHnMdBaseKey *) - ?Str8ToInt@HnConvUtils@@SAHABVTDesC8@@AAH@Z @ 24 NONAME ; int HnConvUtils::Str8ToInt(class TDesC8 const &, int &) - ?ToVariantL@CHnMdBaseKey@@UBEXAAVTLiwVariant@@@Z @ 25 NONAME ; void CHnMdBaseKey::ToVariantL(class TLiwVariant &) const - ?Str8ToStr@HnConvUtils@@SAPAVHBufC16@@ABVTDesC8@@@Z @ 26 NONAME ; class HBufC16 * HnConvUtils::Str8ToStr(class TDesC8 const &) - ?HandleNotifyL@CHnServiceHandler@@EAEHHHAAVCLiwGenericParamList@@ABV2@@Z @ 27 NONAME ; int CHnServiceHandler::HandleNotifyL(int, int, class CLiwGenericParamList &, class CLiwGenericParamList const &) - ?DeleteSuiteRelatedL@CHnRepositoryManager@@QAEHABVTDesC16@@@Z @ 28 NONAME ; int CHnRepositoryManager::DeleteSuiteRelatedL(class TDesC16 const &) - ?GetInt64L@HnLiwUtils@@SAHABVCLiwGenericParamList@@ABVTDesC8@@HAA_J@Z @ 29 NONAME ; int HnLiwUtils::GetInt64L(class CLiwGenericParamList const &, class TDesC8 const &, int, long long &) - ??1CHnRepositoryManager@@UAE@XZ @ 30 NONAME ; CHnRepositoryManager::~CHnRepositoryManager(void) - ?CreateL@HnMdKeyFactory@@SAPAVCHnMdBaseKey@@ABVTDesC8@@0ABVTDesC16@@@Z @ 31 NONAME ; class CHnMdBaseKey * HnMdKeyFactory::CreateL(class TDesC8 const &, class TDesC8 const &, class TDesC16 const &) - ?GetVariantL@HnLiwUtils@@SAHABVCLiwGenericParamList@@ABVTDesC8@@HAAVTLiwVariant@@@Z @ 32 NONAME ; int HnLiwUtils::GetVariantL(class CLiwGenericParamList const &, class TDesC8 const &, int, class TLiwVariant &) - ?GetStringL@HnLiwUtils@@SAHABVCLiwGenericParamList@@ABVTDesC8@@AAVRBuf16@@@Z @ 33 NONAME ; int HnLiwUtils::GetStringL(class CLiwGenericParamList const &, class TDesC8 const &, class RBuf16 &) - ?GetStringL@HnLiwUtils@@SAHABVCLiwGenericParamList@@ABVTDesC8@@HAAVRBuf16@@@Z @ 34 NONAME ; int HnLiwUtils::GetStringL(class CLiwGenericParamList const &, class TDesC8 const &, int, class RBuf16 &) - ?ExecuteL@CHnServiceHandler@@QAEHAAVCLiwGenericParamList@@AAVTRequestStatus@@@Z @ 35 NONAME ; int CHnServiceHandler::ExecuteL(class CLiwGenericParamList &, class TRequestStatus &) - ?VariantToStringL@HnLiwUtils@@SAHAAVTLiwVariant@@AAVRBuf8@@@Z @ 36 NONAME ; int HnLiwUtils::VariantToStringL(class TLiwVariant &, class RBuf8 &) - ?StrToInt@HnConvUtils@@SAHABVTDesC16@@AAH@Z @ 37 NONAME ; int HnConvUtils::StrToInt(class TDesC16 const &, int &) - ?CreateLC@HnMdKeyFactory@@SAPAVCHnMdBaseKey@@VTXmlEngElement@@@Z @ 38 NONAME ; class CHnMdBaseKey * HnMdKeyFactory::CreateLC(class TXmlEngElement) - ?StrToStr8LC@HnConvUtils@@SAPAVHBufC8@@ABVTDesC16@@@Z @ 39 NONAME ; class HBufC8 * HnConvUtils::StrToStr8LC(class TDesC16 const &) - ?EvaluateLC@CHnMdBaseKey@@QAEPAV1@ABVCLiwGenericParamList@@H@Z @ 40 NONAME ; class CHnMdBaseKey * CHnMdBaseKey::EvaluateLC(class CLiwGenericParamList const &, int) - ?GetVariantL@HnLiwUtils@@SAHABVCLiwGenericParamList@@ABVTDesC8@@AAVTLiwVariant@@@Z @ 41 NONAME ; int HnLiwUtils::GetVariantL(class CLiwGenericParamList const &, class TDesC8 const &, class TLiwVariant &) + ?PrepareForNextExecutionL@CHnServiceHandler@@QAEXABVTDesC8@@W4TServiceMode@@PAVCLiwGenericParamList@@@Z @ 7 NONAME ; void CHnServiceHandler::PrepareForNextExecutionL(class TDesC8 const &, enum TServiceMode, class CLiwGenericParamList *) + ?StrToStr8L@HnConvUtils@@SAPAVHBufC8@@ABVTDesC16@@@Z @ 8 NONAME ; class HBufC8 * HnConvUtils::StrToStr8L(class TDesC16 const &) + ?NewL@CHnRepositoryManager@@SAPAV1@XZ @ 9 NONAME ; class CHnRepositoryManager * CHnRepositoryManager::NewL(void) + ?VariantToStringL@HnLiwUtils@@SAHAAVTLiwVariant@@AAVRBuf16@@@Z @ 10 NONAME ; int HnLiwUtils::VariantToStringL(class TLiwVariant &, class RBuf16 &) + ?SetGenericParamListL@HnLiwUtils@@SAXABV?$RPointerArray@VCHnMdBaseKey@@@@AAVCLiwGenericParamList@@@Z @ 11 NONAME ; void HnLiwUtils::SetGenericParamListL(class RPointerArray const &, class CLiwGenericParamList &) + ?GetStringL@HnLiwUtils@@SAHABVCLiwGenericParamList@@ABVTDesC8@@HAAVRBuf8@@@Z @ 12 NONAME ; int HnLiwUtils::GetStringL(class CLiwGenericParamList const &, class TDesC8 const &, int, class RBuf8 &) + ?CreateL@HnMdKeyFactory@@SAPAVCHnMdBaseKey@@ABVTDesC8@@00@Z @ 13 NONAME ; class CHnMdBaseKey * HnMdKeyFactory::CreateL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &) + ?CreateL@HnMdKeyFactory@@SAPAVCHnMdBaseKey@@VTXmlEngElement@@@Z @ 14 NONAME ; class CHnMdBaseKey * HnMdKeyFactory::CreateL(class TXmlEngElement) + ?Str8ToStrLC@HnConvUtils@@SAPAVHBufC16@@ABVTDesC8@@@Z @ 15 NONAME ; class HBufC16 * HnConvUtils::Str8ToStrLC(class TDesC8 const &) + ?GetIterableItemCountL@HnLiwUtils@@SAHAAVCLiwIterable@@@Z @ 16 NONAME ; int HnLiwUtils::GetIterableItemCountL(class CLiwIterable &) + ?ReadSuiteWidgetTypeL@CHnRepositoryManager@@QAEHABVTDesC16@@AAW4THnSuiteWidgetType@@@Z @ 17 NONAME ; int CHnRepositoryManager::ReadSuiteWidgetTypeL(class TDesC16 const &, enum THnSuiteWidgetType &) + ?StrToInt@HnConvUtils@@SAHABVTDesC16@@AAJ@Z @ 18 NONAME ; int HnConvUtils::StrToInt(class TDesC16 const &, long &) + ?ServiceHandlerMatchesModel@CHnServiceHandler@@QBEHABVTDesC8@@0PBVCLiwGenericParamList@@@Z @ 19 NONAME ; int CHnServiceHandler::ServiceHandlerMatchesModel(class TDesC8 const &, class TDesC8 const &, class CLiwGenericParamList const *) const + ??1CHnServiceHandler@@UAE@XZ @ 20 NONAME ; CHnServiceHandler::~CHnServiceHandler(void) + ?NewLC@CHnServiceHandler@@SAPAV1@ABVTDesC8@@00W4TServiceMode@@PAVCLiwGenericParamList@@2@Z @ 21 NONAME ; class CHnServiceHandler * CHnServiceHandler::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, enum TServiceMode, class CLiwGenericParamList *, class CLiwGenericParamList *) + ?Str8ToUint@HnConvUtils@@SAHABVTDesC8@@AAI@Z @ 22 NONAME ; int HnConvUtils::Str8ToUint(class TDesC8 const &, unsigned int &) + ?Str8ToInt@HnConvUtils@@SAHABVTDesC8@@AAJ@Z @ 23 NONAME ; int HnConvUtils::Str8ToInt(class TDesC8 const &, long &) + ?NewL@CHnServiceHandler@@SAPAV1@ABVTDesC8@@00W4TServiceMode@@PAVCLiwGenericParamList@@2@Z @ 24 NONAME ; class CHnServiceHandler * CHnServiceHandler::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, enum TServiceMode, class CLiwGenericParamList *, class CLiwGenericParamList *) + ?AddSubKeyL@CHnMdBaseKey@@QAEXPAV1@@Z @ 25 NONAME ; void CHnMdBaseKey::AddSubKeyL(class CHnMdBaseKey *) + ?Str8ToInt@HnConvUtils@@SAHABVTDesC8@@AAH@Z @ 26 NONAME ; int HnConvUtils::Str8ToInt(class TDesC8 const &, int &) + ?ToVariantL@CHnMdBaseKey@@UBEXAAVTLiwVariant@@@Z @ 27 NONAME ; void CHnMdBaseKey::ToVariantL(class TLiwVariant &) const + ?Str8ToStr@HnConvUtils@@SAPAVHBufC16@@ABVTDesC8@@@Z @ 28 NONAME ; class HBufC16 * HnConvUtils::Str8ToStr(class TDesC8 const &) + ?HandleNotifyL@CHnServiceHandler@@EAEHHHAAVCLiwGenericParamList@@ABV2@@Z @ 29 NONAME ; int CHnServiceHandler::HandleNotifyL(int, int, class CLiwGenericParamList &, class CLiwGenericParamList const &) + ?DeleteSuiteRelatedL@CHnRepositoryManager@@QAEHABVTDesC16@@@Z @ 30 NONAME ; int CHnRepositoryManager::DeleteSuiteRelatedL(class TDesC16 const &) + ?GetInt64L@HnLiwUtils@@SAHABVCLiwGenericParamList@@ABVTDesC8@@HAA_J@Z @ 31 NONAME ; int HnLiwUtils::GetInt64L(class CLiwGenericParamList const &, class TDesC8 const &, int, long long &) + ??1CHnRepositoryManager@@UAE@XZ @ 32 NONAME ; CHnRepositoryManager::~CHnRepositoryManager(void) + ?CreateL@HnMdKeyFactory@@SAPAVCHnMdBaseKey@@ABVTDesC8@@0ABVTDesC16@@@Z @ 33 NONAME ; class CHnMdBaseKey * HnMdKeyFactory::CreateL(class TDesC8 const &, class TDesC8 const &, class TDesC16 const &) + ?GetVariantL@HnLiwUtils@@SAHABVCLiwGenericParamList@@ABVTDesC8@@HAAVTLiwVariant@@@Z @ 34 NONAME ; int HnLiwUtils::GetVariantL(class CLiwGenericParamList const &, class TDesC8 const &, int, class TLiwVariant &) + ?GetStringL@HnLiwUtils@@SAHABVCLiwGenericParamList@@ABVTDesC8@@AAVRBuf16@@@Z @ 35 NONAME ; int HnLiwUtils::GetStringL(class CLiwGenericParamList const &, class TDesC8 const &, class RBuf16 &) + ?GetStringL@HnLiwUtils@@SAHABVCLiwGenericParamList@@ABVTDesC8@@HAAVRBuf16@@@Z @ 36 NONAME ; int HnLiwUtils::GetStringL(class CLiwGenericParamList const &, class TDesC8 const &, int, class RBuf16 &) + ?ExecuteL@CHnServiceHandler@@QAEHAAVCLiwGenericParamList@@AAVTRequestStatus@@@Z @ 37 NONAME ; int CHnServiceHandler::ExecuteL(class CLiwGenericParamList &, class TRequestStatus &) + ?VariantToStringL@HnLiwUtils@@SAHAAVTLiwVariant@@AAVRBuf8@@@Z @ 38 NONAME ; int HnLiwUtils::VariantToStringL(class TLiwVariant &, class RBuf8 &) + ?StrToInt@HnConvUtils@@SAHABVTDesC16@@AAH@Z @ 39 NONAME ; int HnConvUtils::StrToInt(class TDesC16 const &, int &) + ?CreateLC@HnMdKeyFactory@@SAPAVCHnMdBaseKey@@VTXmlEngElement@@@Z @ 40 NONAME ; class CHnMdBaseKey * HnMdKeyFactory::CreateLC(class TXmlEngElement) + ?StrToStr8LC@HnConvUtils@@SAPAVHBufC8@@ABVTDesC16@@@Z @ 41 NONAME ; class HBufC8 * HnConvUtils::StrToStr8LC(class TDesC16 const &) + ?EvaluateLC@CHnMdBaseKey@@QAEPAV1@ABVCLiwGenericParamList@@H@Z @ 42 NONAME ; class CHnMdBaseKey * CHnMdBaseKey::EvaluateLC(class CLiwGenericParamList const &, int) + ?GetVariantL@HnLiwUtils@@SAHABVCLiwGenericParamList@@ABVTDesC8@@AAVTLiwVariant@@@Z @ 43 NONAME ; int HnLiwUtils::GetVariantL(class CLiwGenericParamList const &, class TDesC8 const &, class TLiwVariant &) diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/hierarchynavigator/hnutilities/eabi/hnutilitiesu.def --- a/menufw/hierarchynavigator/hnutilities/eabi/hnutilitiesu.def Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/hierarchynavigator/hnutilities/eabi/hnutilitiesu.def Wed May 12 13:22:51 2010 +0300 @@ -27,22 +27,24 @@ _ZN14HnMdKeyFactory7CreateLERK6TDesC8S2_S2_ @ 26 NONAME _ZN14HnMdKeyFactory8CreateLCE14TXmlEngElement @ 27 NONAME _ZN17CHnServiceHandler13HandleNotifyLEiiR20CLiwGenericParamListRKS0_ @ 28 NONAME - _ZN17CHnServiceHandler4NewLERK6TDesC8S2_S2_12TServiceModeP20CLiwGenericParamListS5_ @ 29 NONAME - _ZN17CHnServiceHandler5NewLCERK6TDesC8S2_S2_12TServiceModeP20CLiwGenericParamListS5_ @ 30 NONAME - _ZN17CHnServiceHandler8ExecuteLEP18MLiwNotifyCallbacki @ 31 NONAME - _ZN17CHnServiceHandler8ExecuteLER20CLiwGenericParamListR14TRequestStatus @ 32 NONAME - _ZN17CHnServiceHandlerD0Ev @ 33 NONAME - _ZN17CHnServiceHandlerD1Ev @ 34 NONAME - _ZN17CHnServiceHandlerD2Ev @ 35 NONAME - _ZN20CHnRepositoryManager19DeleteSuiteRelatedLERK7TDesC16 @ 36 NONAME - _ZN20CHnRepositoryManager20ReadSuiteWidgetTypeLERK7TDesC16R18THnSuiteWidgetType @ 37 NONAME - _ZN20CHnRepositoryManager21StoreSuiteWidgetTypeLERK7TDesC1618THnSuiteWidgetType @ 38 NONAME - _ZN20CHnRepositoryManager4NewLEv @ 39 NONAME - _ZN20CHnRepositoryManager5NewLCEv @ 40 NONAME - _ZN20CHnRepositoryManagerD0Ev @ 41 NONAME - _ZN20CHnRepositoryManagerD1Ev @ 42 NONAME - _ZN20CHnRepositoryManagerD2Ev @ 43 NONAME - _ZNK12CHnMdBaseKey10ToVariantLER11TLiwVariant @ 44 NONAME - _ZNK12CHnMdBaseKey19ToGenericParamListLER20CLiwGenericParamList @ 45 NONAME - _ZThn4_N17CHnServiceHandler13HandleNotifyLEiiR20CLiwGenericParamListRKS0_ @ 46 NONAME + _ZN17CHnServiceHandler24PrepareForNextExecutionLERK6TDesC812TServiceModeP20CLiwGenericParamList @ 29 NONAME + _ZN17CHnServiceHandler4NewLERK6TDesC8S2_S2_12TServiceModeP20CLiwGenericParamListS5_ @ 30 NONAME + _ZN17CHnServiceHandler5NewLCERK6TDesC8S2_S2_12TServiceModeP20CLiwGenericParamListS5_ @ 31 NONAME + _ZN17CHnServiceHandler8ExecuteLEP18MLiwNotifyCallbacki @ 32 NONAME + _ZN17CHnServiceHandler8ExecuteLER20CLiwGenericParamListR14TRequestStatus @ 33 NONAME + _ZN17CHnServiceHandlerD0Ev @ 34 NONAME + _ZN17CHnServiceHandlerD1Ev @ 35 NONAME + _ZN17CHnServiceHandlerD2Ev @ 36 NONAME + _ZN20CHnRepositoryManager19DeleteSuiteRelatedLERK7TDesC16 @ 37 NONAME + _ZN20CHnRepositoryManager20ReadSuiteWidgetTypeLERK7TDesC16R18THnSuiteWidgetType @ 38 NONAME + _ZN20CHnRepositoryManager21StoreSuiteWidgetTypeLERK7TDesC1618THnSuiteWidgetType @ 39 NONAME + _ZN20CHnRepositoryManager4NewLEv @ 40 NONAME + _ZN20CHnRepositoryManager5NewLCEv @ 41 NONAME + _ZN20CHnRepositoryManagerD0Ev @ 42 NONAME + _ZN20CHnRepositoryManagerD1Ev @ 43 NONAME + _ZN20CHnRepositoryManagerD2Ev @ 44 NONAME + _ZNK12CHnMdBaseKey10ToVariantLER11TLiwVariant @ 45 NONAME + _ZNK12CHnMdBaseKey19ToGenericParamListLER20CLiwGenericParamList @ 46 NONAME + _ZNK17CHnServiceHandler26ServiceHandlerMatchesModelERK6TDesC8S2_PK20CLiwGenericParamList @ 47 NONAME + _ZThn4_N17CHnServiceHandler13HandleNotifyLEiiR20CLiwGenericParamListRKS0_ @ 48 NONAME diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/hierarchynavigator/hnutilities/inc/hnservicehandler.h --- a/menufw/hierarchynavigator/hnutilities/inc/hnservicehandler.h Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnservicehandler.h Wed May 12 13:22:51 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -22,7 +22,7 @@ //#include #include #include -#include +#include #include "hnglobals.h" @@ -36,7 +36,7 @@ class CHnServiceHandler; /** - * Class represeting request to LIW service. + * Class represeting request to LIW service. * The request can be synchronous or asynchronous. * * @since S60 5.0 @@ -59,7 +59,7 @@ * @return Fully cosntructed object. */ IMPORT_C static CHnServiceHandler* NewL( - const TDesC8& aService, const TDesC8& aInterface, + const TDesC8& aService, const TDesC8& aInterface, const TDesC8& aCommand, TServiceMode aMode, CLiwGenericParamList* aConstructor, CLiwGenericParamList* aServiceCommand ); @@ -98,7 +98,7 @@ * @return Error code. */ IMPORT_C TInt ExecuteL( CLiwGenericParamList& aOutParamList, TRequestStatus& aStatus ); - + /** * Executes the query on the service, with external * notification callback. @@ -110,17 +110,42 @@ */ IMPORT_C TInt ExecuteL( MLiwNotifyCallback* aCallback, TInt aCmdOptions = 0 ); - - + + /** * Executes the query on the service. * Deprecated - Do not Use this method!!!! Will be removed asap. - * + * * since S60 v5.0 * @return Error code. */ IMPORT_C TInt ExecuteL(); + + /** + * Checks if an action model matches an existing service. + * + * since S60 v5.0 + * @param aService service. + * @param aInterface interface. + * @param aConstructor constructor. + * @return true if an action model matches the service. + */ + IMPORT_C TBool ServiceHandlerMatchesModel( + const TDesC8& aService, + const TDesC8& aInterface, + const CLiwGenericParamList* aConstructor ) const; + /** + * Allows for reusing the object when a request needs to be invoked on + * the same interface of the same service. + * + * @param aCommand Request to the Service. + * @param aMode Asynchronous or Synchronous Request. + * @param aServiceCommand Additional Parameters for the Request. + */ + IMPORT_C void PrepareForNextExecutionL( const TDesC8& aCommand, + TServiceMode aMode, CLiwGenericParamList* aServiceCommand ); + private: /** @@ -129,7 +154,7 @@ * @since S60 5.0 * @param aMode Synchronous or asynchronous. */ - CHnServiceHandler( TServiceMode aMode ); + CHnServiceHandler( TServiceMode aMode ); /** @@ -140,7 +165,7 @@ * @param aInterface Interface name. * @param aCommandName Request to the Service. * @param aConstructor Parameters used during Service construction. - * @param aServiceCommand Additional Parameters for the Request. + * @param aServiceCommand Additional Parameters for the Request. */ void ConstructL( const TDesC8& aService, const TDesC8& aInterface, @@ -148,7 +173,7 @@ CLiwGenericParamList* aConstructor, CLiwGenericParamList* aServiceCommand ); - + /** * Handles notifications caused by an asynchronous Request. * @@ -168,12 +193,12 @@ /** * Creates interface. - * + * * @param aConstructor constructor * @return Error code. */ TInt SetServiceInterfaceL( CLiwGenericParamList* aConstructor ); - + private: // data /** @@ -187,7 +212,7 @@ * Own. */ RBuf8 iInterfaceName; - + /** * Command (Request) name. * Own. @@ -198,62 +223,62 @@ * Service mode. */ TServiceMode iMode; - + /** * Stores input parameters (not data) of the service search method\ * (ExecuteServiceCmdL). - * Own. + * Own. */ CLiwGenericParamList* iConstructor; /** - * + * * Own. */ CLiwGenericParamList* iCommand; - + /** * Parameters for the Request. * Own. */ CLiwGenericParamList* iInput; - + /** * Request results from ExecuteL(); * Own. */ CLiwGenericParamList* iOutputForAS; - + /** - * Request results from + * Request results from * ExecuteL( CLiwGenericParamList& aOutParamList, TRequestStatus& aStatus ). * Own. */ CLiwGenericParamList* iOutputForAO; - + /** - * Service interface. + * Service interface. */ MLiwInterface* iServiceInterface; - + /** * Service Handler. * Own. */ CLiwServiceHandler* iServiceHandler; - + /** * Client status. * Not Own. */ TRequestStatus* iClientStatus; - + /** * Waits for asynchronous queries. * Own. */ CActiveSchedulerWait* iWait; - + }; #endif // C_HNMDSERVICEHANDLER_H diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/hierarchynavigator/hnutilities/src/hnservicehandler.cpp --- a/menufw/hierarchynavigator/hnutilities/src/hnservicehandler.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/hierarchynavigator/hnutilities/src/hnservicehandler.cpp Wed May 12 13:22:51 2010 +0300 @@ -119,7 +119,7 @@ delete iConstructor; delete iCommand; delete iOutputForAS; - + if ( iServiceHandler ) { iServiceHandler->Reset(); @@ -131,6 +131,59 @@ // // --------------------------------------------------------------------------- // +EXPORT_C TBool CHnServiceHandler::ServiceHandlerMatchesModel( + const TDesC8& aService, + const TDesC8& aInterface, + const CLiwGenericParamList* aConstructor ) const + { + __ASSERT_DEBUG( aConstructor, User::Invariant() ); + + TBool ret = ( aInterface == iInterfaceName && aService == iServiceName ); + + if ( ret ) + { + const TInt count = iConstructor->Count(); + ret = ( count == aConstructor->Count() ); + for ( TInt i = 0; ret && i < count; ++i ) + { + ret = ( ( *iConstructor )[i] == ( *aConstructor )[i] ); + } + } + + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnServiceHandler::PrepareForNextExecutionL( + const TDesC8& aCommand, TServiceMode aMode, + CLiwGenericParamList* aServiceCommand ) + { + __ASSERT_DEBUG( aServiceCommand && aServiceCommand != iCommand, + User::Invariant() ); + + { // braces for scope only + RBuf8 copy; + CleanupClosePushL( copy ); + copy.CreateL( aCommand ); + iCommandName.Swap( copy ); + CleanupStack::PopAndDestroy( © ); + } + + iMode = aMode; + + delete iCommand; + iCommand = aServiceCommand; + // Ownership of aServiceCommand has been taken. Do not add any piece of + // code that could leave after this line. + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// EXPORT_C TInt CHnServiceHandler::ExecuteL( MLiwNotifyCallback* aCallback, TInt aCmdOptions) { @@ -205,7 +258,7 @@ else { // KErrNone ensures that CHnQueryResultCollector::HandleQueryResultsL() - // is called, empty results are added to list, and + // is called, empty results are added to list, and // CHnMdItem::ResultsCollectedL doesn't get confused User::RequestComplete( iClientStatus, KErrNone ); } @@ -227,7 +280,7 @@ { iOutputForAO->Reset(); iOutputForAO->AppendL( aEventParamList ); - + TLiwGenericParam param; TInt error(KErrNone); param.PushL(); diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/matrixmenu/group/matrixmenu.mmp diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/matrixmenu/inc/mmappui.h --- a/menufw/menufwui/matrixmenu/inc/mmappui.h Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/matrixmenu/inc/mmappui.h Wed May 12 13:22:51 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: Application UI class -* Version : %version: MM_83.1.2.1.23.1.20 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_83.1.2.1.23.1.21 % << Don't touch! Updated by Synergy at check-out. * */ @@ -71,35 +71,35 @@ */ NONSHARABLE_CLASS(CMmAppUi) : public CAknAppUi, public MHnControllerInterface, - public MAknToolbarObserver, + public MAknToolbarObserver, public MMmWidgetObserver, public MMmActionRequest, public MAknsSkinChangeObserver - { + { public: - /** - * 2nd phase constructor. - * - * @since S60 v5.0 - */ - void ConstructL(); + /** + * 2nd phase constructor. + * + * @since S60 v5.0 + */ + void ConstructL(); - /** - * C++ default constructor. This needs to be public due to - * the way the framework constructs the AppUi. - * - * @since S60 v5.0 - */ - CMmAppUi(); + /** + * C++ default constructor. This needs to be public due to + * the way the framework constructs the AppUi. + * + * @since S60 v5.0 + */ + CMmAppUi(); - /** - * Virtual Destructor. - * - * @since S60 v5.0 - */ - ~CMmAppUi(); + /** + * Virtual Destructor. + * + * @since S60 v5.0 + */ + ~CMmAppUi(); // from base class CEikAppUi @@ -124,9 +124,9 @@ * @param aDocumentName Not used by this app. * @param aTail Command line tail. */ - TBool ProcessCommandParametersL( TApaCommand aCommand, - TFileName& aDocumentName, - const TDesC8& aTail ); + TBool ProcessCommandParametersL( TApaCommand aCommand, + TFileName& aDocumentName, + const TDesC8& aTail ); /** * From CAknAppUi. @@ -138,7 +138,7 @@ */ void ProcessCommandL(TInt aCommand); - /** + /** * From CEikAppUi. * Takes care of Command Line tail handling. * @@ -146,9 +146,9 @@ * @param aUid UID of the message. * @param aParams Message params. */ - void ProcessMessageL( TUid aUid, const TDesC8& aParams ); + void ProcessMessageL( TUid aUid, const TDesC8& aParams ); - /** + /** * From MCoeMessageObserver. * Handles window server messages. * @@ -163,7 +163,7 @@ TUid aMessageUid, const TDesC8& aMessageParameters ); - /** + /** * From MEikMenuObserver (CEikAppUi). * Handles dynamic menu pane initialization. * @@ -339,6 +339,17 @@ void SkinPackageChanged( const TAknsSkinStatusPackageChangeReason aReason ); + /** + * From MMmDragAndDropObserver. + * Method is invoked on the observer, when the move item event is needed. + * + * @since S60 v5.0 + * @param aRecipientId Index of item on which the move event invokes. + * @param aEventParameters Event parameters. + */ + void HandleTriggerMoveItemL( const TInt aRecipientId, + CLiwGenericParamList* aEventParameters ); + private: /** @@ -379,29 +390,29 @@ }; /** - * Indicates if edit mode is on. - * - * @since S60 v5.0 - * @return Returns edit mode status. - */ + * Indicates if edit mode is on. + * + * @since S60 v5.0 + * @return Returns edit mode status. + */ TBool IsEditMode(); /** - * Adjusts highlight when entering or leaving edit mode. - * - * @since S60 v5.0 - * @param aOriginalHighlight Highlight that would normally be set - * @return A modified value of highlight - */ + * Adjusts highlight when entering or leaving edit mode. + * + * @since S60 v5.0 + * @param aOriginalHighlight Highlight that would normally be set + * @return A modified value of highlight + */ TInt AdjustEditModeHighlightL( TInt aOriginalHighlight ); /** - * Manages the container lookup. - * - * @since S60 v5.0 - * @return Pointer to the container to be loaded, of NULL - * if a new container should be created. - */ + * Manages the container lookup. + * + * @since S60 v5.0 + * @return Pointer to the container to be loaded, of NULL + * if a new container should be created. + */ CMmWidgetContainer* GetAppropriateContainerToLoadL(); /** @@ -426,16 +437,16 @@ // from base class CEikAppUi - /** - * From CEikAppUi. - * Takes care of command handling. - * - * @since S60 v5.0 - * @param aCommand Command to be handled. - */ - void HandleCommandL( TInt aCommand ); + /** + * From CEikAppUi. + * Takes care of command handling. + * + * @since S60 v5.0 + * @param aCommand Command to be handled. + */ + void HandleCommandL( TInt aCommand ); - /** + /** * From CEikAppUi. * Handles Window Server events. * @@ -445,18 +456,18 @@ */ void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination ); - /** + /** * Indicates if root (main) view is displayed. * * @since S60 v5.0 * @return ETrue if root displayed, EFalse otherwise. */ - TBool IsRootdisplayedL(); + TBool IsRootdisplayedL(); - /** - * Handles pen down events for an item. - * - * @since S60 v5.0 + /** + * Handles pen down events for an item. + * + * @since S60 v5.0 * @param aIndex Item index. */ void HandleHighlightItemPenDownL( TInt aIndex ); @@ -513,12 +524,12 @@ */ void InsertL(); - /** + /** * Handles the "Back" softkey event. * * @since S60 v5.0 */ - void HandleBackCommandL(); + void HandleBackCommandL(); /** * Refreshes toolbar. @@ -732,7 +743,7 @@ * @since S60 v5.0 */ void StartLayoutSwitchFullScreen( TInt aKastorEffect - = AknTransEffect::ELayoutSwitchStart); + = AknTransEffect::ELayoutSwitchStart); /** * Ends fullscreen @@ -932,7 +943,7 @@ */ CMMExtensionManager* iMmExtManager; - /** + /** * Screen state. */ TBool iScreenOn; @@ -1000,6 +1011,11 @@ */ TBool iHasFocus; + /** + * ETrue if Matrix is hidden from TS which is used on startup. + */ + TBool isHiddenFromFS; + /** * Own. * Popup menu displayed after long tap. diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/matrixmenu/loc/matrix_menu.loc --- a/menufw/menufwui/matrixmenu/loc/matrix_menu.loc Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/matrixmenu/loc/matrix_menu.loc Wed May 12 13:22:51 2010 +0300 @@ -29,13 +29,13 @@ //d: Displayed in Status Pane. //l: title_pane_t2/opt9 //r: 1.0 -#define qtn_org_root_editing_title "Organizing Menu" +#define qtn_org_root_editing_title "Editing Menu" //d: Title of a folder in Edit Mode. //d: Displayed in Status Pane. %U is the name of the opened folder. //l: title_pane_t2/opt9 //r: 1.0 -#define qtn_org_folder_editing_title "Organizing %U" +#define qtn_org_folder_editing_title "Editing %U" //d: Label of the menu item. //d: Opens selected item. diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/matrixmenu/src/mmappui.cpp --- a/menufw/menufwui/matrixmenu/src/mmappui.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/matrixmenu/src/mmappui.cpp Wed May 12 13:22:51 2010 +0300 @@ -12,8 +12,8 @@ * Contributors: * * Description: Application UI class -* Version : %version: MM_176.1.28.1.61 % << Don't touch! Updated by Synergy at check-out. -* Version : %version: MM_176.1.28.1.61 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_176.1.28.1.69 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_176.1.28.1.69 % << Don't touch! Updated by Synergy at check-out. * */ @@ -93,10 +93,12 @@ iEikonEnv->SetSystem( ETrue ); TInt appUiFlags = AknLayoutUtils::PenEnabled() ? - EAknEnableSkin | EAknSingleClickCompatible : + EAknEnableSkin | EAknSingleClickCompatible : EAknEnableSkin | EAknEnableMSK; BaseConstructL( appUiFlags ); - + //hide Menu from TS at startup + HideApplicationFromFSW( ETrue ); + isHiddenFromFS = ETrue; FeatureManager::InitializeLibL(); iIsKastorEffectStarted = EFalse; StartLayoutSwitchFullScreen( AknTransEffect::EApplicationStart ); @@ -211,11 +213,17 @@ iIsKastorEffectStarted = ETrue; TInt lastItemIndex = iCurrentContainer->NumberOfItems() - 1; - if ( lastItemIndex >= 0 && iCurrentContainer->ItemIsFullyVisible( lastItemIndex ) && - !iCurrentContainer->IsHighlightVisible() ) - { - iCurrentContainer->SetManualHighlightL( lastItemIndex, EFalse ); - } + if ( lastItemIndex >= 0 && iCurrentContainer->ItemIsFullyVisible( lastItemIndex ) + && !iCurrentContainer->IsHighlightVisible() ) + { + iCurrentContainer->SetManualHighlightL( lastItemIndex, EFalse ); + } +/* else if( !iCurrentContainer->IsHighlightVisible() + && iCurrentContainer->Widget()->TopItemIndex() > -1) + { + iCurrentContainer->SetManualHighlightL( + iCurrentContainer->Widget()->TopItemIndex(), EFalse ); + } */ iCurrentContainer->SetRect( ClientRect() ); iDummyContainer->SetRect( ClientRect() ); @@ -299,9 +307,9 @@ } if ( iCurrentContainer ) - { - iCurrentContainer->EndLongTapL(); - } + { + iCurrentContainer->EndLongTapL(); + } } // --------------------------------------------------------------------------- @@ -320,18 +328,18 @@ if( !aParams.Compare( KNullDesC8 ) ) { if ( !iAppkeyHandler->IsActive() ) - { + { //make dummy container visible when returning //to menu by AppKey - iDummyContainer->MakeVisible( ETrue ); + iDummyContainer->MakeVisible( ETrue ); RefreshUiPanesL( ETrue ); iCurrentContainer->MakeVisible( EFalse ); iDummyContainer->DrawNow(); CleanupForExitL( EExitKeyApplication ); - User::LeaveIfError( iCoeEnv->WsSession().SetWindowGroupOrdinalPosition( - CEikonEnv::Static()->RootWin().Identifier(), 0 ) ); - iAppkeyHandler->StartL(); - } + User::LeaveIfError( iCoeEnv->WsSession().SetWindowGroupOrdinalPosition( + CEikonEnv::Static()->RootWin().Identifier(), 0 ) ); + iAppkeyHandler->StartL(); + } } // first refresh model, show afterwords @@ -611,7 +619,7 @@ GfxTransEffect::BeginFullScreen( effect, rect, AknTransEffect::EParameterType, - AknTransEffect::GfxTransParam( appUid ) ); + AknTransEffect::GfxTransParam( appUid , KUidMatrixMenuApp ) ); } } @@ -625,61 +633,61 @@ // --------------------------------------------------------------------------- // TInt CMmAppUi::GetKastorEffectL( CHnItemModel* aItemModel ) - { - TInt effect( AknTransEffect::ENone ); + { + TInt effect( AknTransEffect::ENone ); if ((IsEditMode() || iEditModeStatus == ETransitionFromEditMode) && !AknLayoutUtils::PenEnabled()) { return effect; } - switch( aItemModel->GetItemType() ) - { - case EItemTypeApplication: - { - if( !IsEditMode() && !aItemModel->IsDrmExpired() ) - { - if( aItemModel->IsRunning() ) - { - effect = AknTransEffect::EApplicationStartSwitchRect; - } - else - { - effect = AknTransEffect::EApplicationStartRect; - } - } - break; - } - case EItemTypeSuite: - { - if( !IsEditMode() ) - { - effect = EMenuOpenFolderEffect; - iIsKastorEffectStarted = ETrue; - } - break; - } - case EItemTypeParentFolder: - { + switch( aItemModel->GetItemType() ) + { + case EItemTypeApplication: + { + if( !IsEditMode() && !aItemModel->IsDrmExpired() ) + { + if( aItemModel->IsRunning() ) + { + effect = AknTransEffect::EApplicationStartSwitchRect; + } + else + { + effect = AknTransEffect::EApplicationStartRect; + } + } + break; + } + case EItemTypeSuite: + { + if( !IsEditMode() ) + { + effect = EMenuOpenFolderEffect; + iIsKastorEffectStarted = ETrue; + } + break; + } + case EItemTypeParentFolder: + { effect = EMenuCloseFolderEffect; iIsKastorEffectStarted = ETrue; - break; - } - case EItemTypeFolder: - { - if (!(IsEditMode() && aItemModel->IsDeleteLocked())) + break; + } + case EItemTypeFolder: + { + if (!(IsEditMode() && aItemModel->IsDeleteLocked())) { effect = EMenuOpenFolderEffect; iIsKastorEffectStarted = ETrue; } - break; - } - case EItemTypeUnknown: - default: - { - effect = AknTransEffect::ENone; - break; - } - } + break; + } + case EItemTypeUnknown: + default: + { + effect = AknTransEffect::ENone; + break; + } + } return effect; } @@ -959,7 +967,7 @@ IsEditMode() && !Layout_Meta_Data::IsPenEnabled() ) { DEBUG(("_Mm_:CMmAppUi::HandleKeyPressedL - enter in edit mode")); - HandleCommandL( EAknSoftkeyOk ); + HandleCommandL( EAknSoftkeyOk ); resp = EKeyWasConsumed; } @@ -1068,29 +1076,29 @@ void CMmAppUi::HandleDragStopL( TInt aModelItemIndex ) { MMPERF(("CMmAppUi::HandleDragStopL - START")); - if ( IsEditMode() ) + if( IsEditMode() ) { TInt itemId = iCurrentSuiteModel->IdByIndex( aModelItemIndex ); TMcsItemType typeCurr = iCurrentSuiteModel->GetItemType( aModelItemIndex ); TBool isOverFolder = ( AknLayoutUtils::PenEnabled() && ( typeCurr == EItemTypeParentFolder || typeCurr == EItemTypeFolder ) ); - TBool isDeleteLocked = (itemId != KErrNotFound) ? - iCurrentSuiteModel->GetItemModel( itemId )->IsDeleteLocked(): - EFalse; + TBool isDeleteLocked = (itemId != KErrNotFound) + ? iCurrentSuiteModel->GetItemModel( itemId )->IsDeleteLocked() + : EFalse; - TBuf8< KMaxLength > beforeCustomId; + TBuf8 beforeCustomId; beforeCustomId.Num( KErrNotFound ); - if ( aModelItemIndex + 1 < iCurrentContainer->NumberOfItems() ) + if( aModelItemIndex + 1 < iCurrentContainer->NumberOfItems() ) { beforeCustomId.Num( iCurrentSuiteModel->GetItemModel( iCurrentSuiteModel->IdByIndex( aModelItemIndex + 1 ) )->CustomId() ); } - TBuf8< KMaxLength > draggedCustomId; + TBuf8 draggedCustomId; draggedCustomId.Num( KErrNotFound ); CHnItemModel* draggedModel = iCurrentSuiteModel->GetItemModel( iIdDragged ); - if (draggedModel) + if( draggedModel ) { draggedCustomId.Num( iCurrentSuiteModel->GetItemModel( iIdDragged )->CustomId() ); } @@ -1114,11 +1122,13 @@ tempKeys->ToGenericParamListL( *eventParameters ); CleanupStack::PopAndDestroy( tempKeys ); - if ( iIdDragged != itemId - && isOverFolder && !isDeleteLocked) + TBool allowMoveInto = iCurrentContainer->AllowMove(); + + if( iIdDragged != itemId && isOverFolder && !isDeleteLocked + && allowMoveInto ) { iCurrentSuiteModel->RemoveItemL( iIdDragged ); - if ( iItemDragged < aModelItemIndex ) + if( iItemDragged < aModelItemIndex ) { // indices of all items after iItemDragged have been // decreased when the dragged item got removed from the @@ -1131,41 +1141,33 @@ iCurrentContainer->HandleItemRemovalL(); iCurrentContainer->CancelDragL( EFalse ); - if( typeCurr == EItemTypeParentFolder ) - { - StartLayoutSwitchFullScreen( EMenuCloseFolderEffect ); - } - else - { - StartLayoutSwitchFullScreen( EMenuOpenFolderEffect ); - } iHNInterface->TriggerHnEventL( KKeyIdMoveInto, itemId, eventParameters ); iMakeHightlightedItemFullyVisible = ETrue; } - else if ( iIdDragged == itemId ) + else if( iIdDragged == itemId ) { iCurrentContainer->CancelDragL( ETrue ); - TBool result = iHNInterface->TriggerHnEventL( KKeyIdMove, itemId, eventParameters ); + iCurrentContainer->SetTriggerMoveItemL( itemId, eventParameters ); // fix for: edit->move, then LSK->Up->LSK->LSK FAST... (short options show up) - if ( result != KErrNone && !AknLayoutUtils::PenEnabled() ) - { - CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC(); - TLiwGenericParam command(KHnRequest, TLiwVariant( KEvaluateMdModel)); - paramList->AppendL(command); - HandleRequestL(*paramList); - CleanupStack::PopAndDestroy(paramList); - } + if( !AknLayoutUtils::PenEnabled() ) + { + CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC(); + TLiwGenericParam command(KHnRequest, TLiwVariant( KEvaluateMdModel)); + paramList->AppendL( command ); + HandleRequestL( *paramList ); + CleanupStack::PopAndDestroy( paramList ); + } } else { iCurrentContainer->CancelDragL( ETrue ); - if (!AknLayoutUtils::PenEnabled()) + if( !AknLayoutUtils::PenEnabled() ) { CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC(); TLiwGenericParam command(KHnRequest, TLiwVariant( KEvaluateMdModel)); - paramList->AppendL(command); - HandleRequestL(*paramList); - CleanupStack::PopAndDestroy(paramList); + paramList->AppendL( command ); + HandleRequestL( *paramList ); + CleanupStack::PopAndDestroy( paramList ); } } @@ -1219,9 +1221,9 @@ HandleHighlightItemSingleClickedL( iCurrentContainer->Widget()->CurrentItemIndex() ); } else if ( aEventType == MEikListBoxObserver::EEventPanningStarted ) - { - iKeyClickLocked = ETrue; - } + { + iKeyClickLocked = ETrue; + } DEBUG(("_Mm_:CMmAppUi::HandleListBoxEventL OUT")); } @@ -1231,13 +1233,13 @@ // --------------------------------------------------------------------------- // void CMmAppUi::HandleLongTapEventL( const TPoint& aPenEventLocation ) - { + { TBool popupMenuDisplayed(EFalse); - if (iPopupMenu) - { - delete iPopupMenu; - iPopupMenu = NULL; - } + if (iPopupMenu) + { + delete iPopupMenu; + iPopupMenu = NULL; + } iPopupMenu = CAknStylusPopUpMenu::NewL(this,aPenEventLocation); if ( AknLayoutUtils::LayoutMirrored() ) @@ -1252,71 +1254,71 @@ } if( iCurrentSuiteModel == iHNInterface->GetLastSuiteModelL() - && iCurrentContainer->IsHighlightVisible() - && iCurrentContainer->GetSuiteModelL()->GetItemModelsCount() > 1 ) - { - MMPERF(("CMmAppUi::DynInitMenuPaneL - START")); - //fill the main menu structure, look for cascade menus - //reset the helper hash map - iCascadeMenuMap.Close(); + && iCurrentContainer->IsHighlightVisible() + && iCurrentContainer->GetSuiteModelL()->GetItemModelsCount() > 1 ) + { + MMPERF(("CMmAppUi::DynInitMenuPaneL - START")); + //fill the main menu structure, look for cascade menus + //reset the helper hash map + iCascadeMenuMap.Close(); - MHnMenuItemModelIterator* menuIterator = - iCurrentSuiteModel->GetMenuStructureL( - iCurrentSuiteModel->IdByIndex( - iCurrentContainer->GetHighlight() ) ); + MHnMenuItemModelIterator* menuIterator = + iCurrentSuiteModel->GetMenuStructureL( + iCurrentSuiteModel->IdByIndex( + iCurrentContainer->GetHighlight() ) ); - // check if there is a menu structure available - // for the specified item - if ( menuIterator ) - { - //create item sorting helper objects - RArray positionArray; - CleanupClosePushL( positionArray ); - RHashMap menuItemMap; - CleanupClosePushL( menuItemMap ); + // check if there is a menu structure available + // for the specified item + if ( menuIterator ) + { + //create item sorting helper objects + RArray positionArray; + CleanupClosePushL( positionArray ); + RHashMap menuItemMap; + CleanupClosePushL( menuItemMap ); while ( menuIterator->HasNextSpecific() ) { CHnMenuItemModel* childItem = menuIterator->GetNextSpecific(); - CEikMenuPaneItem::SData childData; - childData.iCommandId = childItem->Command(); - childData.iText = childItem->NameL(). - Left( CEikMenuPaneItem::SData::ENominalTextLength ); - childData.iFlags = 0; - childData.iCascadeId = 0; + CEikMenuPaneItem::SData childData; + childData.iCommandId = childItem->Command(); + childData.iText = childItem->NameL(). + Left( CEikMenuPaneItem::SData::ENominalTextLength ); + childData.iFlags = 0; + childData.iCascadeId = 0; - positionArray.AppendL( childItem->Position() ); - menuItemMap.InsertL( childItem->Position(), childData ); + positionArray.AppendL( childItem->Position() ); + menuItemMap.InsertL( childItem->Position(), childData ); } - positionArray.Sort(); + positionArray.Sort(); - //add items in correct order - for ( TInt i = 0; i < positionArray.Count(); ++i ) - { - iPopupMenu-> - AddMenuItemL( - menuItemMap.FindL( positionArray[i] ).iText, - menuItemMap.FindL( positionArray[i] ).iCommandId ); - } + //add items in correct order + for ( TInt i = 0; i < positionArray.Count(); ++i ) + { + iPopupMenu-> + AddMenuItemL( + menuItemMap.FindL( positionArray[i] ).iText, + menuItemMap.FindL( positionArray[i] ).iCommandId ); + } - if (positionArray.Count()>0) - { - iPopupMenu->ShowMenu(); - popupMenuDisplayed = ETrue; - } - CleanupStack::PopAndDestroy( &menuItemMap ); - CleanupStack::PopAndDestroy( &positionArray ); - } - MMPERF(("CMmAppUi::DynInitMenuPaneL - STOP")); - } + if (positionArray.Count()>0) + { + iPopupMenu->ShowMenu(); + popupMenuDisplayed = ETrue; + } + CleanupStack::PopAndDestroy( &menuItemMap ); + CleanupStack::PopAndDestroy( &positionArray ); + } + MMPERF(("CMmAppUi::DynInitMenuPaneL - STOP")); + } - if ( !popupMenuDisplayed && iCurrentContainer ) - { - iCurrentContainer->EndLongTapL( ETrue ); - HandleHighlightItemSingleClickedL( - iCurrentContainer->Widget()->CurrentItemIndex() ); - } + if ( !popupMenuDisplayed && iCurrentContainer ) + { + iCurrentContainer->EndLongTapL( ETrue ); + HandleHighlightItemSingleClickedL( + iCurrentContainer->Widget()->CurrentItemIndex() ); + } } // --------------------------------------------------------------------------- @@ -1326,7 +1328,7 @@ void CMmAppUi::HandleHighlightItemDoubleClickedL( TInt aIndex ) { if ( iKeyClickLocked ) - return; + return; if ( iCurrentSuiteModel->WidgetType() == EListWidget && iCurrentContainer->GetPreviousHighlight() == aIndex ) @@ -1445,9 +1447,9 @@ RefreshCbaL(); iGarbage.ResetAndDestroy(); ResetContainerMap(); - iCurrentSuiteModel = NULL; - iCurrentContainer = NULL; - } + iCurrentSuiteModel = NULL; + iCurrentContainer = NULL; + } TRAPD( err, iHNInterface->LoadSuitesFromUriL( aMessage ) ); @@ -1482,23 +1484,23 @@ { TInt itemId( KErrNotFound ); TBool suiteModelHasItems = iCurrentContainer->GetSuiteModelL()->GetItemModelsCount() > 1; - TBool highlightVisible = iCurrentContainer->IsHighlightVisible(); - if ( !highlightVisible && suiteModelHasItems ) - { + TBool highlightVisible = iCurrentContainer->IsHighlightVisible(); + if ( !highlightVisible && suiteModelHasItems ) + { // if there is no highlight, but there are items, show menuitems for logically // current suite highlight fetched from suite model. - TInt suiteHighlight = iCurrentSuiteModel->GetSuiteHighlight(); - ASSERT( suiteHighlight != KErrNotFound ); - itemId = iCurrentSuiteModel->IdByIndex( suiteHighlight ); - ignoreItemSpecific = ETrue; - } - else - { - TBool idByContainer = highlightVisible && suiteModelHasItems; - itemId = idByContainer ? - iCurrentSuiteModel->IdByIndex( iCurrentContainer->GetHighlight() ) : - iCurrentSuiteModel->IdByIndex( KErrNotFound ); - } + TInt suiteHighlight = iCurrentSuiteModel->GetSuiteHighlight(); + ASSERT( suiteHighlight != KErrNotFound ); + itemId = iCurrentSuiteModel->IdByIndex( suiteHighlight ); + ignoreItemSpecific = ETrue; + } + else + { + TBool idByContainer = highlightVisible && suiteModelHasItems; + itemId = idByContainer ? + iCurrentSuiteModel->IdByIndex( iCurrentContainer->GetHighlight() ) : + iCurrentSuiteModel->IdByIndex( KErrNotFound ); + } menuIterator = iCurrentSuiteModel->GetMenuStructureL( itemId ); } @@ -1530,42 +1532,42 @@ { CHnMenuItemModel* menuItem = menuIterator->GetNext(); if ( (menuItem->MenuItemType() == CHnMenuItemModel::EItemApplication) || !ignoreItemSpecific ) - { - CEikMenuPaneItem::SData menuData; - menuData.iCommandId = menuItem->Command(); - menuData.iText = menuItem->NameL(). - Left( CEikMenuPaneItem::SData::ENominalTextLength ); - menuData.iFlags = 0; + { + CEikMenuPaneItem::SData menuData; + menuData.iCommandId = menuItem->Command(); + menuData.iText = menuItem->NameL(). + Left( CEikMenuPaneItem::SData::ENominalTextLength ); + menuData.iFlags = 0; - //check for children - MHnMenuItemModelIterator* childIterator = - menuItem->GetMenuStructure(); - if ( childIterator->HasNext() ) - { - //this is a cascade item - //one menu item can contain only one cascade menu - //check if there are available cascade menu containers - TInt freeResource = GetNextCascadeMenuResourceId(); - if ( freeResource != KErrNotFound ) - { - //error checking - if( !iCascadeMenuMap.Insert( freeResource, - childIterator ) ) - { - //add item only if there is an - //available resource - menuData.iCascadeId = freeResource; - } - } - } - else - { - //normal entry - menuData.iCascadeId = 0; - } - positionArray.AppendL( menuItem->Position() ); - menuItemMap.InsertL( menuItem->Position(), menuData ); - } + //check for children + MHnMenuItemModelIterator* childIterator = + menuItem->GetMenuStructure(); + if ( childIterator->HasNext() ) + { + //this is a cascade item + //one menu item can contain only one cascade menu + //check if there are available cascade menu containers + TInt freeResource = GetNextCascadeMenuResourceId(); + if ( freeResource != KErrNotFound ) + { + //error checking + if( !iCascadeMenuMap.Insert( freeResource, + childIterator ) ) + { + //add item only if there is an + //available resource + menuData.iCascadeId = freeResource; + } + } + } + else + { + //normal entry + menuData.iCascadeId = 0; + } + positionArray.AppendL( menuItem->Position() ); + menuItemMap.InsertL( menuItem->Position(), menuData ); + } } aMenuPane->Reset(); @@ -1805,15 +1807,21 @@ if( iCurrentContainer != aWidgetContainer ) { - TBool highlightVisibleBefore = iCurrentContainer != NULL && - iCurrentContainer->IsHighlightVisible(); + // We want a highlight to be visible while switching between + // grid and list views but no highlight should be visible + // after opening a folder. + TBool highlightVisibleBefore = + iCurrentContainer && + aWidgetContainer && + iCurrentContainer->IsHighlightVisible() && + iCurrentContainer->WidgetType() != aWidgetContainer->WidgetType(); HandleWidgetChangeRefreshL( aWidgetContainer ); if ( highlightVisibleBefore ) - { - iCurrentContainer->SetHighlightVisibilityL( ETrue ); - } + { + iCurrentContainer->SetHighlightVisibilityL( ETrue ); + } } else { @@ -2034,8 +2042,8 @@ // --------------------------------------------------------------------------- // void CMmAppUi::SetEditModeL( TBool aIsEditMode ) - { - MMPERF(("CMmAppUi::SetEditModeL %d - START",aIsEditMode)); + { + MMPERF(("CMmAppUi::SetEditModeL %d - START",aIsEditMode)); if ( IsEditMode() != aIsEditMode && iCurrentSuiteModel ) { @@ -2046,20 +2054,20 @@ iCurrentContainer->StopMovingL(); if ( aIsEditMode ) - { - iEditModeStatus = ETransitionToEditMode; - } + { + iEditModeStatus = ETransitionToEditMode; + } else - { - if ( iEditModeStatus == ETransitionToEditMode ) - { - iEditModeStatus = EFastTransitionFromEditMode; - } - else - { - iEditModeStatus = ETransitionFromEditMode; - } - } + { + if ( iEditModeStatus == ETransitionToEditMode ) + { + iEditModeStatus = EFastTransitionFromEditMode; + } + else + { + iEditModeStatus = ETransitionFromEditMode; + } + } HandleHighlightOffsetL( aIsEditMode ? EOffsetNext : EOffsetPrevious ); iCurrentSuiteModel->SetSuiteHighlightL( @@ -2109,7 +2117,7 @@ TEventCode type = static_cast< TEventCode >( aEvent.Type() ); if ( ( type == EEventFocusLost || type == KAknFullOrPartialForegroundLost ) - && iCurrentContainer ) + && iCurrentContainer ) { iCurrentContainer->CacheWidgetPosition(); } @@ -2131,8 +2139,8 @@ HandleFocusGainedL(); } else if ( type == EEventFocusLost ) - { - HandleFocusLostL(); + { + HandleFocusLostL(); } else if ( type == KAknFullOrPartialForegroundGained ) { @@ -2235,8 +2243,8 @@ } break; case ESuiteItemsUpdated: - { - ClearTransitionFromEditModeFlag(); + { + ClearTransitionFromEditModeFlag(); iCurrentContainer->DrawView(); } break; @@ -2258,13 +2266,13 @@ // --------------------------------------------------------------------------- // void CMmAppUi::ClearTransitionFromEditModeFlag() - { - if ( iEditModeStatus == ETransitionFromEditMode || - iEditModeStatus == EFastTransitionFromEditMode ) - { - iEditModeStatus = ENoEditMode; - } - } + { + if ( iEditModeStatus == ETransitionFromEditMode || + iEditModeStatus == EFastTransitionFromEditMode ) + { + iEditModeStatus = ENoEditMode; + } + } // --------------------------------------------------------------------------- // @@ -2373,7 +2381,7 @@ ShowSuiteL(); iGarbage.ResetAndDestroy(); - if ( iEditModeStatus == ETransitionToEditMode ) + if ( iEditModeStatus == ETransitionToEditMode ) { iEditModeStatus = EEditMode; } @@ -2500,8 +2508,8 @@ DEBUG(("\t_Mm_:Top item index reset")); iCurrentContainer->ResetWidgetPosition(); iCurrentContainer->Widget()->UpdateScrollBarsL(); - iCurrentContainer->MakeVisible( ETrue ); - iCurrentContainer->DrawNow(); + iCurrentContainer->MakeVisible( ETrue ); + iCurrentContainer->DrawNow(); } } @@ -2516,7 +2524,7 @@ { TInt appToShowUid(0); TInt idleid(0); - if (aExitType == EExitToIdle) + if (aExitType == EExitToIdle || aExitType == EExitToPhone) { User::LeaveIfError(RProperty::Get(KPSUidAiInformation, KActiveIdleUid, appToShowUid)); @@ -2655,37 +2663,37 @@ { DEBUG(("_Mm_:CMmAppUi::SetMiddleSoftKeyL - IN")); if ( iCurrentSuiteModel && !AknLayoutUtils::PenEnabled() && !IsEditMode() ) - { - DEBUG(("\t_Mm_:suite highlight: %d", - iCurrentSuiteModel->GetSuiteHighlight())); + { + DEBUG(("\t_Mm_:suite highlight: %d", + iCurrentSuiteModel->GetSuiteHighlight())); - TBool idByContainer = iCurrentContainer->IsHighlightVisible() && - iCurrentContainer->GetSuiteModelL()->GetItemModelsCount() > 1; - TInt itemId = idByContainer ? - iCurrentSuiteModel->IdByIndex( iCurrentContainer->GetHighlight() ) : - iCurrentSuiteModel->IdByIndex( KErrNotFound ); - CHnItemModel* itemModel = iCurrentSuiteModel->GetItemModel( itemId ); + TBool idByContainer = iCurrentContainer->IsHighlightVisible() && + iCurrentContainer->GetSuiteModelL()->GetItemModelsCount() > 1; + TInt itemId = idByContainer ? + iCurrentSuiteModel->IdByIndex( iCurrentContainer->GetHighlight() ) : + iCurrentSuiteModel->IdByIndex( KErrNotFound ); + CHnItemModel* itemModel = iCurrentSuiteModel->GetItemModel( itemId ); - CHnButtonModel* mskModel = NULL; + CHnButtonModel* mskModel = NULL; - if ( itemModel ) - { - mskModel = itemModel->GetMiddleSoftKey(); - } + if ( itemModel ) + { + mskModel = itemModel->GetMiddleSoftKey(); + } - if ( mskModel ) - { - TInt event = (mskModel->GetEventId() == KErrNotFound) ? - KKeyIdSelect : mskModel->GetEventId(); - Cba()->SetCommandL( CEikButtonGroupContainer::EMiddleSoftkeyPosition, - event, mskModel->GetButtonText()); - } - else - { - // reset to default - RefreshCbaL(); - } - } + if ( mskModel ) + { + TInt event = (mskModel->GetEventId() == KErrNotFound) ? + KKeyIdSelect : mskModel->GetEventId(); + Cba()->SetCommandL( CEikButtonGroupContainer::EMiddleSoftkeyPosition, + event, mskModel->GetButtonText()); + } + else + { + // reset to default + RefreshCbaL(); + } + } DEBUG(("_Mm_:CMmAppUi::SetMiddleSoftKeyL - OUT")); } @@ -2825,6 +2833,16 @@ // // --------------------------------------------------------------------------- // +void CMmAppUi::HandleTriggerMoveItemL( const TInt aRecipientId, + CLiwGenericParamList* aEventParameters) + { + iHNInterface->TriggerHnEventL( KKeyIdMove, aRecipientId, aEventParameters); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// void CMmAppUi::RefreshIconsL() { iSkinChangeNeeded = EFalse; @@ -2833,6 +2851,10 @@ paramList->AppendL(command); HandleRequestL(*paramList); CleanupStack::PopAndDestroy(paramList); + if( iCurrentContainer ) + { + iCurrentContainer->HandleResourceChange( KAknsMessageSkinChange ); + } } // --------------------------------------------------------------------------- @@ -2892,125 +2914,133 @@ // --------------------------------------------------------------------------- // void CMmAppUi::HandleFocusGainedL() - { - DEBUG(("_Mm_:CMmAppUi::HandleWsEventL " - "- EEventFocusGained")); + { + DEBUG(("_Mm_:CMmAppUi::HandleWsEventL " + "- EEventFocusGained")); - iHasFocus = ETrue; + iHasFocus = ETrue; // Tricky: lack of iCurrentSuiteModel indicates that suite evaluation is in // progress - do not call HandlePresentationChangeL if evalution has not // finished. - if ( iCurrentContainer && !iCurrentContainer->IsVisible() && - iCurrentSuiteModel ) - { - HandlePresentationChangeL( iCurrentContainer ); - } + if ( iCurrentContainer && !iCurrentContainer->IsVisible() && + iCurrentSuiteModel ) + { + HandlePresentationChangeL( iCurrentContainer ); + } - if ( iCurrentSuiteModel && iCurrentContainer ) - { - iDummyContainer->MakeVisible( EFalse ); - iCurrentContainer->MakeVisible( ETrue ); - iCurrentContainer->DrawNow(); - } - if( IsForeground() ) - { - RefreshUiPanesL(); - } - if ( iCurrentContainer ) - { - iCurrentContainer->SetHasFocusL( ETrue ); - } - if ( iCurrentSuiteModel ) + if ( iCurrentSuiteModel && iCurrentContainer ) + { + iDummyContainer->MakeVisible( EFalse ); + iCurrentContainer->MakeVisible( ETrue ); + iCurrentContainer->DrawNow(); + } + if( IsForeground() ) + { + RefreshUiPanesL(); + } + if ( iCurrentContainer ) + { + iCurrentContainer->SetHasFocusL( ETrue ); + } + if ( iCurrentSuiteModel ) { iCurrentSuiteModel->SetVisibleL( ETrue ); } - } + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // void CMmAppUi::HandleFocusLostL() - { - DEBUG(("_Mm_:CMmAppUi::HandleWsEventL " - "- EEventFocusLost")); + { + DEBUG(("_Mm_:CMmAppUi::HandleWsEventL " + "- EEventFocusLost")); - iHasFocus = EFalse; + iHasFocus = EFalse; - if( iCurrentContainer ) - { - //This is needed in case some popup is displayed - //while touching item in grid. Highlight - //should be reset to normal then. - if( AknLayoutUtils::PenEnabled() ) - { - if( iCurrentContainer->WidgetType() == EGridWidget && !IsEditMode() ) - { - iCurrentContainer->Widget()->View()->ItemDrawer()-> - SetFlags( CListItemDrawer::EDisableHighlight ); - } - iCurrentContainer->Widget()->View()-> - ItemDrawer()->ClearFlags( CListItemDrawer::EPressedDownState ); - iCurrentContainer->Widget()->View()->DrawItem( - iCurrentContainer->Widget()->CurrentItemIndex() ) ; - } - if( IsEditMode() && iCurrentContainer->IsDraggable() ) - { - iCurrentContainer->CancelDragL( EFalse ); - iCurrentContainer->DrawNow(); - } - iCurrentContainer->SetHasFocusL( EFalse ); - } - if ( iCurrentSuiteModel ) - { - iCurrentSuiteModel->SetVisibleL( EFalse ); - } + if( iCurrentContainer ) + { + //This is needed in case some popup is displayed + //while touching item in grid. Highlight + //should be reset to normal then. + if( AknLayoutUtils::PenEnabled() ) + { + if( iCurrentContainer->WidgetType() == EGridWidget && !IsEditMode() ) + { + iCurrentContainer->Widget()->View()->ItemDrawer()-> + SetFlags( CListItemDrawer::EDisableHighlight ); + } + iCurrentContainer->Widget()->View()-> + ItemDrawer()->ClearFlags( CListItemDrawer::EPressedDownState ); + iCurrentContainer->Widget()->View()->DrawItem( + iCurrentContainer->Widget()->CurrentItemIndex() ) ; + } + if( IsEditMode() && iCurrentContainer->IsDraggable() ) + { + HandleDragStopL( iCurrentContainer->GetHighlight() ); + iCurrentContainer->DrawNow(); + } + iCurrentContainer->SetHasFocusL( EFalse ); + } + if ( iCurrentSuiteModel ) + { + iCurrentSuiteModel->SetVisibleL( EFalse ); + } - } + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // void CMmAppUi::HandleFullOrPartialForegroundGainedL() - { - DEBUG(("_Mm_:CMmAppUi::HandleWsEventL " - "- KAknFullOrPartialForegroundGained")); - if (iCurrentContainer && iCurrentSuiteModel ) - { - iCurrentContainer->HandleForegroundGainedL(); - iDummyContainer->MakeVisible( EFalse ); - iCurrentContainer->MakeVisible( ETrue ); - RefreshUiPanesL(); - } - if (iSkinChangeNeeded && !iSkinChangeInProgress) - { - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - if (skinInstance && !skinInstance->IsUpdateInProgress()) - { - RefreshIconsL(); - } - } - } + { + DEBUG(("_Mm_:CMmAppUi::HandleWsEventL " + "- KAknFullOrPartialForegroundGained")); + //show Menu in TS when launched for the first time + if( isHiddenFromFS ) + { + HideApplicationFromFSW( EFalse ); + isHiddenFromFS = EFalse; + } + + if (iCurrentContainer && iCurrentSuiteModel ) + { + iCurrentContainer->HandleForegroundGainedL(); + iDummyContainer->MakeVisible( EFalse ); + iCurrentContainer->MakeVisible( ETrue ); + RefreshUiPanesL(); + } + if (iSkinChangeNeeded && !iSkinChangeInProgress) + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + if (skinInstance && !skinInstance->IsUpdateInProgress()) + { + RefreshIconsL(); + + } + } + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // void CMmAppUi::HandleFullOrPartialForegroundLostL() - { - DEBUG(("_Mm_:CMmAppUi::HandleWsEventL " - "- KAknFullOrPartialForegroundLost")); - if ( iCurrentContainer ) - { - iCurrentContainer->HandleBackgroundGainedL(); - if ( IsRootdisplayedL() ) - { - iCurrentContainer->RestoreWidgetPosition(); - iCurrentContainer->CacheWidgetPosition(); - } - } - } + { + DEBUG(("_Mm_:CMmAppUi::HandleWsEventL " + "- KAknFullOrPartialForegroundLost")); + if ( iCurrentContainer ) + { + iCurrentContainer->HandleBackgroundGainedL(); + if ( IsRootdisplayedL() ) + { + iCurrentContainer->RestoreWidgetPosition(); + iCurrentContainer->CacheWidgetPosition(); + } + } + } // End of File diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/matrixmenu/src/mmgui.cpp diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/bwins/mmwidgetsu.def --- a/menufw/menufwui/mmwidgets/bwins/mmwidgetsu.def Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/bwins/mmwidgetsu.def Wed May 12 13:22:51 2010 +0300 @@ -37,4 +37,6 @@ ?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) + ?AllowMove@CMmWidgetContainer@@QBEHXZ @ 39 NONAME ; int CMmWidgetContainer::AllowMove(void) const + ?SetTriggerMoveItemL@CMmWidgetContainer@@QAEXHPAVCLiwGenericParamList@@@Z @ 40 NONAME ; void CMmWidgetContainer::SetTriggerMoveItemL(int, class CLiwGenericParamList *) diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/eabi/mmwidgetsu.def --- a/menufw/menufwui/mmwidgets/eabi/mmwidgetsu.def Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/eabi/mmwidgetsu.def Wed May 12 13:22:51 2010 +0300 @@ -38,4 +38,6 @@ _ZN19CMmListBoxContainer20SetDefaultHighlightLEi @ 37 NONAME _ZThn52_N18CMmWidgetContainer23HandleBackgroundGainedLEv @ 38 NONAME _ZThn52_N18CMmWidgetContainer23HandleForegroundGainedLEv @ 39 NONAME + _ZN18CMmWidgetContainer19SetTriggerMoveItemLEiP20CLiwGenericParamList @ 40 NONAME + _ZNK18CMmWidgetContainer9AllowMoveEv @ 41 NONAME diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/group/mmwidgets.mmp --- a/menufw/menufwui/mmwidgets/group/mmwidgets.mmp Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/group/mmwidgets.mmp Wed May 12 13:22:51 2010 +0300 @@ -22,6 +22,8 @@ TARGETTYPE dll UID 0x1000008d 0x2001E658 +ALWAYS_BUILD_AS_ARM +OPTION ARMCC -O3 -Otime --cpu 6 CAPABILITY CAP_GENERAL_DLL VENDORID VID_DEFAULT diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/inc/mmcacheforitem.h --- a/menufw/menufwui/mmwidgets/inc/mmcacheforitem.h Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmcacheforitem.h Wed May 12 13:22:51 2010 +0300 @@ -77,11 +77,14 @@ inline TBool IsValid() const; /** - * Marks this cache as valid or invalid. - * - * @param aValid (Self-explanatory). - */ - inline void SetValidL( TBool aValid ); + * Marks this cache object as valid. + */ + inline void MarkAsValidL(); + + /** + * Marks this cache object as invalid. + */ + inline void MarkAsInvalid(); /** * Returns information whether at the moment of updating this cache object @@ -249,7 +252,7 @@ /** * 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. + * using the MarkAsValidL method. * Own. */ CArrayPtr* iIconList; diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/inc/mmcacheforitem.inl --- a/menufw/menufwui/mmwidgets/inc/mmcacheforitem.inl Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmcacheforitem.inl Wed May 12 13:22:51 2010 +0300 @@ -48,15 +48,12 @@ // // ----------------------------------------------------------------------------- // -inline void CMmCacheForItem::SetValidL( TBool aValid ) +inline void CMmCacheForItem::MarkAsValidL() { - if ( !!iIsValid != !!aValid ) // Ex-OR + if ( !iIsValid ) { - iIsValid = aValid; - if ( iIsValid ) - { - UpdateIconListL(); - } + iIsValid = ETrue; + UpdateIconListL(); } } @@ -64,6 +61,15 @@ // // ----------------------------------------------------------------------------- // +inline void CMmCacheForItem::MarkAsInvalid() + { + iIsValid = EFalse; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// inline TBool CMmCacheForItem::IsCurrent() { return iIsCurrent; diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/inc/mmdraganddropobserver.h --- a/menufw/menufwui/mmwidgets/inc/mmdraganddropobserver.h Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmdraganddropobserver.h Wed May 12 13:22:51 2010 +0300 @@ -24,7 +24,7 @@ * Whenever a drag begins HandleDragStartL() is invoked. * When the highlight changes during drag, HandleDragOverL() is invoked. * When item is dropped, HandleDragStopL() is invoked. - * The set of the three methods fully notifies the observer about the state + * The set of the three methods fully notifies the observer about the state * of the drag. * * @code @@ -52,7 +52,7 @@ * @param aModelItemIndex Index of item that the dragged item hovers over. */ virtual void HandleDragOverL( TInt aModelItemIndex ) = 0; - + /** * Method is invoked on the observer, when the item is dropped. * @@ -60,7 +60,7 @@ * @param aModelItemIndex Index of item on which the draging stops. */ virtual void HandleDragStopL( TInt aModelItemIndex ) = 0; - + /** * Method is invoked on the observer, when the dragged item index changes. * @@ -68,7 +68,17 @@ * @param aModelItemIndex Index of item on which the draging stops. */ virtual void HandleDraggedIndexUpdatedL( TInt aModelItemIndex ) = 0; - + + /** + * Method is invoked on the observer, when the move item event is needed. + * + * @since S60 v5.0 + * @param aRecipientId Index of item on which the move event invokes. + * @param aEventParameters Event parameters. + */ + virtual void HandleTriggerMoveItemL( const TInt aRecipientId, + CLiwGenericParamList* aEventParameters) = 0; + }; - + #endif // M_MMDRAGANDDROPOBSERVER_H diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/inc/mmdraweranimator.h --- a/menufw/menufwui/mmwidgets/inc/mmdraweranimator.h Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmdraweranimator.h Wed May 12 13:22:51 2010 +0300 @@ -22,11 +22,12 @@ #include #include + #ifdef RD_UI_TRANSITION_EFFECTS_LIST #include #include #include -#endif +#endif class CMmListBoxItemDrawer; class TMmFloatingItem; @@ -56,11 +57,11 @@ */ NONSHARABLE_CLASS( CMmDrawerAnimator ) : public CActive { - + public: /** * Two-phased constructor. - * + * * @since S60 v5.0 * @param aDrawer Item drawer used to draw item. */ @@ -68,15 +69,15 @@ /** * Two-phased constructor. - * + * * @since S60 v5.0 * @param aDrawer Item drawer used to draw item. */ static CMmDrawerAnimator* NewLC( CMmListBoxItemDrawer& aDrawer ); - + /** * Destructor. - * + * * @since S60 v5.0 */ virtual ~CMmDrawerAnimator(); @@ -90,9 +91,9 @@ * @since S60 v5.0 */ void AnimateDragItemTransitionL( ); - + /** - * Animates an item with index aItemFrom into position + * Animates an item with index aItemFrom into position * indexed by aItemTo. * * @since S60 v5.0 @@ -117,14 +118,14 @@ * @return Is system ready so new animation can proceed. */ TBool IsReadyForNewAnimation(); - + /** * Cancel currently running or pending animations. * * @since S60 v5.0 */ void CancelAnimationsL(); - + /** * Triggers animation. * This methods sets the Activeobject into active state @@ -134,41 +135,39 @@ * @return Error code */ TInt Trigger(); - - /** - * Marks next redraw to be cancelled. - * - * @return Indicates if redraw occured due to cancel. - */ - TBool CancelNextRedrawL(); - + /** * Make the next animation redraw the whole screen; */ void SetNextRedrawToWholeScreen(); - + /** * Indicates that draweranimator is in garbage. - * This is used when suite model has been destroyed so there isn't - * anything to draw, therefore any animator attempts should be + * This is used when suite model has been destroyed so there isn't + * anything to draw, therefore any animator attempts should be * dropped. */ void PrepareForGarbage(); - + + /** + * Calls move event. + */ + void TriggerMoveItemL(); + private: - + /** * Default constructor. - * + * * @since S60 v3.0 * @param aDrawer Object used to draw items in widgets. */ CMmDrawerAnimator( CMmListBoxItemDrawer& aDrawer ); - + /** * 2nd phase constructor. * - * @since S60 v3.0 + * @since S60 v3.0 */ void ConstructL(); @@ -196,10 +195,10 @@ * @return Error code for error handling. */ TInt RunError( TInt aError ); - + /** * Adjusts rect to non touch. - * + * * @since S60 v3.0 * @param aRefreshRect Refresh rect. * @return Adjusted rect. @@ -207,67 +206,67 @@ TRect AdjustRefreshRectToNonTouch( const TRect& aRefreshRect ); private: // Data - + /** * Timer - */ + */ RTimer iTimer; - + /** * Associated item drawer. - */ + */ CMmListBoxItemDrawer& iDrawer; - + /** * Number of animation frames - */ + */ TInt iAnimateFrames; /** * Delay between redrawing. - */ + */ TTimeIntervalMicroSeconds iDelay; - + /** * Last redraw time - */ + */ TTime iLastRedrawTime; - + /** * Effects api. - */ + */ MAknListBoxTfx *iTransTfx; - + /** * Effects api. - */ + */ MAknListBoxTfxInternal *iTransTfxInternal; - + /** * Highlight noted when last redraw occured. */ TInt iLastNotedHighlight; - + /** * Top item index noted when last redraw occured. */ TInt iLastNotedTopItem; - + /** * Vertical offset noted when last redraw occured. */ TInt iLastNotedVerticalOffset; - + /** * Holds the previous animation refresh rectangle. */ TRect iPreviousRefreshRect; - + /** * Holds the number of frames to animate. */ const TInt iUsualAnimationFramesCount; - + /** * Holds the previous animation refresh rectangle. */ diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/inc/mmgrid.h --- a/menufw/menufwui/mmwidgets/inc/mmgrid.h Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmgrid.h Wed May 12 13:22:51 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: CMmGrid declaration -* Version : %version: MM_32.1.22 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_32.1.24 % << Don't touch! Updated by Synergy at check-out. * */ @@ -22,7 +22,7 @@ #include #include -#include +#include class CMmGridModel; class CMmListBoxItemDrawer; @@ -32,7 +32,7 @@ /** * Multimedia Menu Grid Widget - * + * * @code * @endcode * @lib mmwidgets @@ -42,27 +42,27 @@ NONSHARABLE_CLASS( CMmGrid ) : public CAknGrid { public: - + /** * Two-phased constructor. - * + * * @param aParent Parent control. * @param aFlags Additional Flags. * @param aTemplateLibrary Template library for drawer. */ static CMmGrid* NewL( const CCoeControl* aParent, TInt aFlags, CMmTemplateLibrary* aTemplateLibrary ); - + /** * Two-phased constructor. - * + * * @param aParent Parent control. * @param aFlags Additional Flags. * @param aTemplateLibrary Template library for drawer. */ static CMmGrid* NewLC(const CCoeControl* aParent, TInt aFlags, CMmTemplateLibrary* aTemplateLibrary ); - + /** * Destructor. */ @@ -75,7 +75,7 @@ * @param aRect Rect within which grid should be drawn. */ void Draw( const TRect& aRect ) const; - + /** * Draws the grid view. * @@ -85,19 +85,19 @@ /** * Creates the item drawer for grid. - * + * * @since S60 v3.0 */ void CreateItemDrawerL(); - + /** * Creates the item drawer for grid. - * - * @param aTemplateLibrary Template library for drawer. + * + * @param aTemplateLibrary Template library for drawer. * @since S60 v3.0 */ void CreateItemDrawerL( CMmTemplateLibrary* aTemplateLibrary ); - + /** * Creates the view class instance for grid. * @@ -105,7 +105,7 @@ * @return Griv view. */ CListBoxView* MakeViewClassInstanceL(); - + /** * Handles scrolling event. * @@ -113,9 +113,9 @@ * @param aScrollBar Scrollbar being scrolled. * @param aEventType Type of scrollbar event. */ - void HandleScrollEventL( CEikScrollBar* aScrollBar, + void HandleScrollEventL( CEikScrollBar* aScrollBar, TEikScrollEvent aEventType ); - + /** * Handles pointer event. * @@ -123,7 +123,7 @@ * @param aPointerEvent Type of pointer event. */ void HandlePointerEventL( const TPointerEvent& aPointerEvent ); - + /** * Sets item drawer and view background context. * @@ -132,14 +132,14 @@ */ void SetItemDrawerAndViewBgContext( CAknsBasicBackgroundControlContext* aBgContext ); - + /** * Handles changes in scrollbar visibility. * * @since S60 v3.0 */ TBool HandleScrollbarVisibilityChangeL(); - + /** * Checks if all items from model fit in given rectangle. * @@ -147,14 +147,14 @@ * @return Do items fit in view rectangle. */ TBool AllItemsFitInViewRect(); - + /** * Updates scrollbar changes. * * @since S60 v3.0 */ void UpdateScrollBarsL(); - + /** * Sets the marquee adapter. * @@ -162,7 +162,7 @@ * @param aAdapter Marquee adapter. */ void SetMarqueeAdapter( CMmMarqueeAdapter* aAdapter ); - + /** * Sets up the layout (orientation and items' sizes). * @@ -175,29 +175,29 @@ * * @since S60 v3.0 * @return Grid model. - */ + */ CMmGridModel * MmModel(); - + /** * This function from @c CAknGrid handles key events. - * + * * It has been overridden to allow for correct handling of * left and right rocker keys when mirrored layout is used. - * + * * @param aKeyEvent event to handle * @param aType type of the key event * @return response code ( @c EKeyWasConsumed, @c EKeyWasNotConsumed ) */ TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); - + /** - * This function from CAknGrid is overriden to make grid + * This function from CAknGrid is overriden to make grid * behavior correct in the mirrored layout. * Please note that it is necessary because of the hackish * solution used to draw items in mirrored layout. */ void HandleViewRectSizeChangeL(); - + /** * Overridden function from CAknGrid. */ @@ -206,19 +206,19 @@ /** * Set the vertical item offset; * @param aOffset The offset to set to the widget. - * + * * @since S60 v5.0 */ void SetVerticalItemOffset( TInt aOffset ); /** * Gets the current widget vertical item offset. - * + * * @since S60 v5.0 * @return The current widget vertical item offset. */ TInt VerticalItemOffset() const; - + /** * Simply sets the item height members in widget and view. */ @@ -231,33 +231,33 @@ /** * Counts the number of component controls which this component owns. - */ + */ TInt CountComponentControls() const; /** * Disables/enables child component (scrollbar) drawing. */ void SetDisableChildComponentDrawing( TBool aDisable ); - + private: /** * Default constructor. - * - * @since S60 v3.0 + * + * @since S60 v3.0 */ CMmGrid(); - + /** * 2nd phase constructor. - * - * @since S60 v3.0 + * + * @since S60 v3.0 * @param aParent Parent control. * @param aFlags Additional Flags. * @param aTemplateLibrary Template library for drawer. */ void ConstructL( const CCoeControl* aParent, TInt aFlags, CMmTemplateLibrary* aTemplateLibrary ); - + /** * Handles changes in resource. * @@ -268,7 +268,7 @@ */ void DoHandleResourceChangeL( TBool aIsLandscape, TSize& aCellSize, TSize& aViewLayout ); - + /** * Handles changes in resource. * @@ -278,55 +278,44 @@ */ void DoHandleResourceChangeL( TSize& aCellSize, TSize& aViewLayout ); - + /** * Sets up the layout (for use in non-leaving SetupLayout()) - * - * @since S60 v3.0 + * + * @since S60 v3.0 */ void DoSetupLayoutL(); - + /** * Handles pointer events when edit mode is enabled. - * + * * This method is only called during edit mode. It selectively passes * only some of the pointer events to CAknGrid::HandlePointerEventL * in order to disable flicking and panning. - * + * * @param aPointerEvent pointer event */ void HandlePointerEventInEditModeL( const TPointerEvent& aPointerEvent ); - + /** * Handles pointer events when edit mode is disabled. - * + * * @param aPointerEvent pointer event */ void HandlePointerEventInNormalModeL( const TPointerEvent& aPointerEvent ); - - /** - * Handles button repeat event in normal mode. - * - * Such event is requested when handling button1down event so that - * certain actions (i.e. setting highlight visibility) can be made - * with a small delay - this improves menu behavior on flicking. - * - * @param aPointerEvent pointer event - */ - void HandleButtonRepeatEventInNormalModeL( const TPointerEvent& aPointerEvent ); - + /** * Scrolls the view if pointer is close to the top/bottom edge. - * + * * This method is used only when edit mode is active. In a way it * brings back the focus based scrolling behavior that was present * in CAknGrid before ODE scrolling was introduced. */ void HandleScrollingInEditMode( const TPointerEvent& aPointerEvent ); - + /** * Checks if pointer position is within the scroll-triggering area. - * + * * @param aPointerEvent pointer event * @return true if pointer above the top scrolling threshold. */ @@ -335,37 +324,37 @@ /** * Checks if pointer position is within the scroll-triggering area. - * + * * @param aPointerEvent pointer event * @return true if pointer below the bottom scrolling threshold. */ TBool IsPointerInBottomScrollingThreshold( const TPointerEvent& aPointerEvent ) const; - + /** * Scrolls the view if the pointer is near top/bottom edge of the screen. - * + * * Assumes that current item index is the index of the item under the * pointer. The time value returned is based on the distance of the pointer * from the top/bottom edge of the grid view (this makes the scrolling speed * dependent of how close the pointer is to the edge). * If there is no need to continue scrolling because the beginning/end of * the list has already been reached, 0 is returned. - * + * * @param aPointerEvent pointer event * @return time to wait before calling this method again (in microseconds) * or 0 if already at the beginning/end of the list */ TInt ScrollIfNeeded( const TPointerEvent& aPointerEvent ); - + /** - * Minimal scrolling (setting top item index and vertical offset) with + * Minimal scrolling (setting top item index and vertical offset) with * boundary checking and WITHOUT redrawing. - * + * * @param aDistanceInPixels Distance to scroll. */ void ScrollWithoutRedraw( TInt aDistanceInPixels ); - + /** * Updates the dispapearing highlight. * @@ -382,46 +371,46 @@ * be drawn correctly in mirrored layout. */ void FixViewForMirroredLayout(); - + /** * Gets the offset margin of scrollbar related to view rectangle. - * + * * @return The distance from view rect side to scrollbar. */ TInt ScrollBarOffset(); - + /** * Redraws the background under the vertical scrollbar in mirrored layout. - * + * * The reason such method is needed is that view rectangle is shifted * to the right in mirrored layout and does not cover the scrollbar * 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, + 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. + * which actually scrolls the view and causes a redraw. */ - void HandleRedrawTimerEvent(); - + void HandleRedrawTimerEventL(); + private: /** * Callback function for @c iRedrawTimer. - * It simply calls @c HandleRedrawTimerEvent and returns 0. - * + * It simply calls @c HandleRedrawTimerEventL and returns 0. + * * @param aPtr A pointer to CMmGrid object. * @return 0 (always). */ @@ -430,53 +419,53 @@ private: /** * Grid model. - */ + */ CMmGridModel* iMmModel; - + /** * Item drawer. - */ + */ CMmListBoxItemDrawer* iMmDrawer; /** * Marquee adapter. - */ + */ CMmMarqueeAdapter* iMarqueeAdapter; - + /** * Scrollbar visibility flag. - */ + */ TBool iScrollbarVisibilityChanged; /** * Item index which is current in grid. - */ + */ TInt iCurrentItemIndex; - + /** * Currently top view item index. - */ + */ TInt iCurrentTopItemIndex; - + /** * Layout of grid. - */ + */ TSize iViewLayout; - + /** * A flag that indicates that highlight is visible because * the user is pressing the screen (continuously) and that * highlight should remain visible only as long as the screen - * is being pressed. + * is being pressed. */ TBool iHighlightVisibleUntilButton1Up; - + /** * Blocks scrollbar drawing. When this flag is set scrollbars components - * are blocked in the CountComponentControls() method; + * 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. @@ -487,7 +476,7 @@ * 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, @@ -496,7 +485,7 @@ * iRedrawTimer completes. */ TInt iSkippedScrollbarEventsCount; - + /** * A timer that initiates redraws at certain time intervals. * It is used to refresh the view while scrolling with diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/inc/mmgridview.h --- a/menufw/menufwui/mmwidgets/inc/mmgridview.h Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmgridview.h Wed May 12 13:22:51 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: CMmGridView declaration -* Version : %version: MM_24.1.9 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_24.1.10 % << Don't touch! Updated by Synergy at check-out. * */ @@ -22,7 +22,7 @@ #include #include -#include +#include /** * Multimedia Menu Grid View. @@ -38,25 +38,25 @@ public: /** * Two-phased constructor. - * + * * @since S60 v3.0 */ static CMmGridView* NewL(); - + /** * Two-phased constructor. - * + * * @since S60 v3.0 */ static CMmGridView* NewLC(); /** * Destructor. - * + * * @since S60 v3.0 */ virtual ~CMmGridView(); - + /** * Draws the grid within the given clipping rectangle. * @@ -64,44 +64,44 @@ * @param aClipRect Clipping rectangle. */ void Draw( const TRect* aClipRect ) const; - + /** * Gets item position. - * + * * This fuction from @c CAknGridView is overridden so that it * returns 'mirrored' item positions when mirrored layout is - * used. - * + * used. + * * @since S60 v3.0 * @param aItemIndex Item index. * @return Item position. */ TPoint ItemPos( TInt aItemIndex ) const; - + /** * Converts an (x, y) pixel position to an item index. - * + * * This fuction from @c CAknGridView has been overridden in order * to make it work properly when mirrored layout is used. - * + * * @param aPosition Pixel position in the viewing rectangle. * @param aItemIndex Reference to the item index. * @return Whether there was an item at aPosition. - */ + */ TBool XYPosToItemIndex(TPoint aPosition, TInt& aItemIndex) const; - + /** * Returns this view's gc. - * + * * @return pointer to gc */ CWindowGc* Gc(); - + /** * @see CAknGridView::UpdateSelectionL - * + * * This method of CAknGridView is overriden to so that - * correct effects are displayed when moving highlight with + * correct effects are displayed when moving highlight with * rocker key in mirrored layout. * Please note that it is necessary because of the hackish * solution used to draw items in mirrored layout. @@ -110,9 +110,9 @@ /** * @see CAknGridView::MoveCursorL - * + * * This method of CAknGridView is overriden to so that - * correct effects are displayed when moving highlight with + * correct effects are displayed when moving highlight with * rocker key in mirrored layout. * Please note that it is necessary because of the hackish * solution used to draw items in mirrored layout. @@ -122,18 +122,18 @@ /** * Gets the current widget vertical item offset. - * + * * @since S60 v5.0 * @return The current widget vertical item offset. */ TInt VerticalItemOffset() const; - + /** * This function sets item height in pixels. * @param aItemHeight New height in pixels for this view’s items. - */ + */ void SetItemHeight(TInt aItemHeight); - + /** * Updates various member variables in this grid view and related objects * with item dimensions taken from the template library. @@ -141,21 +141,21 @@ void UpdateItemHeightAndWidth(); private: - + /** * Default constructor. - * - * @since S60 v3.0 + * + * @since S60 v3.0 */ CMmGridView(); /** * 2nd phase constructor. - * - * @since S60 v3.0 + * + * @since S60 v3.0 */ void ConstructL(); - + /** * Draws the grid within the given clipping rectangle. * @@ -163,17 +163,17 @@ * @param aClipRect Clipping rectangle. */ void DoDraw( const TRect* aClipRect ) const; - + /** * Gets item position. - * + * * AVKON implementation of ItemPos method does not always work properly. * It fails when: * aItemIndex < TopItemIndex() - NumberOfColsInView() * Because of that problem this method was created. It is now used in * CMmGridView::ItemPos in place where base class (AVKON) implementation * was used previously. - * + * * @param aItemIndex Item index. * @return Item position. */ @@ -183,24 +183,24 @@ /** * Stores cursor movement flag during CMmGridView::MoveCursorL execution. - * + * * When CMmGridView::MoveCursorL is not executing this member variable is * always set to ECursorFirstItem. This is part of the hack that allows * for correct effects to be displayed when using rocker key in mirrored * layout. */ TCursorMovement iLastCurMove; - + /** * Stores previosly highlighted item index during CMmGridView::MoveCursorL * execution. - * + * * When CMmGridView::MoveCursorL is not executing this member variable is * always set to KErrNotFound. This is part of the hack that allows * for correct effects to be displayed when using rocker key in mirrored * layout. */ - TInt iOldIndex; + TInt iOldIndex; }; #endif // C_MMGRIDVIEW_H diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/inc/mmlistbox.h --- a/menufw/menufwui/mmwidgets/inc/mmlistbox.h Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmlistbox.h Wed May 12 13:22:51 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: CMmListBox -* Version : %version: MM_22.1.16 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_22.1.17 % << Don't touch! Updated by Synergy at check-out. * */ @@ -389,12 +389,12 @@ * This function typically calls @c ProcessScrollEventL, * which actually scrolls the view and causes a redraw. */ - void HandleRedrawTimerEvent(); + void HandleRedrawTimerEventL(); private: /** * Callback function for @c iRedrawTimer. - * It simply calls @c HandleRedrawTimerEvent and returns 0. + * It simply calls @c HandleRedrawTimerEventL and returns 0. * * @param aPtr A pointer to CMmListBox object. * @return 0 (always). diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/inc/mmlistboxitemdrawer.h --- a/menufw/menufwui/mmwidgets/inc/mmlistboxitemdrawer.h Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmlistboxitemdrawer.h Wed May 12 13:22:51 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: CMmListBoxItemDrawer -* Version : %version: MM_38.1.15 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_38.1.17 % << Don't touch! Updated by Synergy at check-out. * */ @@ -94,42 +94,42 @@ * @since S60 v3.0 */ ~CMmListBoxItemDrawer(); - + /** * Enables/disables cached data use. - * + * * When aEnable is true: * Enables the use of cached data when drawing items. * This significantly improves performance. * Do not ever try to use this feature in edit mode. - * + * * When aEnable is false: * Restores the normal mode where data needed for drawing * items is retrieved from the model and the cached data * is updated with the information retrieved from the model - * + * * @param aEnable Self-explanatory. */ void EnableCachedDataUse( TBool aEnable ); - + /** * Returns ETrue if item drawer is using cached data. * To start/stop using cached data, use the @c EnableCachedDataUse * method. - * + * * @return ETrue if cached data is used, EFalse otherwise. */ TBool CachedDataUseIsEnabled() const; - + /** * This method should be called whenever items(s) are removed * in order to remove corresponding entries in the local * items data cache. - * + * * @param aItemCount current item count */ void TrimCacheSize( TInt aItemCount ); - + /** * Invalidates the cached data for all items. */ @@ -154,7 +154,7 @@ * @return Size of item. */ TSize GetItemSize( TInt aItemIndex, TBool aItemIsCurrent ) const; - + /** * Gets rect of indicator. * @@ -238,6 +238,14 @@ void SetRedrawItemBackground( TBool aRedraw ); /** + * Sets condition if separator line should be drawn. + * + * @since S60 v3.0 + * @param aRedraw Should separator line be drawn. + */ + void SetDrawSeparatorLines( TBool aDraw ); + + /** * Checks if item background redrawing is enabled. * * @since S60 v3.0 @@ -372,14 +380,14 @@ * @param aPosition Floating item index to be removed. */ void RemoveFloatingItem( TInt aPosition ); - + /** * Removes all floating items. * * @since S60 5.0 */ void RemoveFloatingItems(); - + /** * Gets floating item at particular index in the * floating item array. @@ -469,6 +477,14 @@ */ void SetHighlightShown( TBool aDrawn ); + /** + * Draws background. + * + * @since S60 v3.0 + * @param aItemTextRect Item rectangle. + */ + void DrawBackground( const TRect& aItemTextRect ) const; + protected: /** * From CListItemDrawer. Draws an item. @@ -499,26 +515,19 @@ TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aItemIsSelected ) const; /** - * Draws the actual item contents for the specified item in the specified + * Draws the actual item contents for the specified item in the specified * rectangle. * - * @param aItemIndex Index of the item to draw. - * @param aActualItemRect Area to draw into. - * @param aItemIsCurrent @c ETrue if the item is current. - * @param aViewIsEmphasized @c ETrue if the view is emphasised. + * @param aItemIndex Index of the item to draw. + * @param aActualItemRect Area to draw into. + * @param aItemIsCurrent @c ETrue if the item is current. + * @param aViewIsEmphasized @c ETrue if the view is emphasised. * @param aViewIsDimmed Ignored * @param aItemIsSelected @c ETrue if the item is selected. */ void DrawActualItem(TInt aItemIndex, const TRect& aActualItemRect, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aViewIsDimmed, TBool aItemIsSelected) const; - /** - * Draws background and separator lines. - * - * @since S60 v3.0 - * @param aItemTextRect Item rectangle. - */ - void DrawBackgroundAndSeparatorLines( const TRect& aItemTextRect ) const; /** * Sets up item currently drawn item subcells. @@ -667,11 +676,11 @@ void SetupIconSubcellL( RArray& aTemplateChildArray, TInt aChildIndex, TInt aItemIndex, RBuf& aItemText, TInt& aSubcellIncrement ) const; - + /** * Determines whether a bitmap of given size needs scaling to be displayed * in a rectangular area of some given target size. - * + * * This method assumes that the bitmap will always be scaled with aspect * ratio preserved. A bitmap does not need scaling if its size meets either * of the two conditions: @@ -683,8 +692,8 @@ * 1 pixel. * Please note that a bitmap which is too small (i.e. neither its width or its * height is close to the target width/height) will be regarded as one that - * needs scaling. - * + * needs scaling. + * * @param aBmpSize size of the bitmap * @param aTargetSize size of the area where bitmap will be displayed * @return ETrue if bitmap does not need scaling @@ -728,13 +737,13 @@ * * @param aItemIndex An index of a currently drawn item. * @param aItemIsCurrent Is aItemIndex the current item index. - * @param aAllowHighlightForNonDraggedItem Should highlight be shown + * @param aAllowHighlightForNonDraggedItem Should highlight be shown * (set in case when effects are used). * @return ETrue if highlight is drawn for the actually drawn item. */ - TBool GetHighlightVisibility( TInt aItemIndex, + TBool GetHighlightVisibility( TInt aItemIndex, TBool aItemIsCurrent, TBool aAllowHighlightForNonDraggedItem ) const; - + /** * Returns backdrop visibility. * @@ -799,6 +808,11 @@ TBool iRedrawBackground; /** + * Draw separators flag. + */ + TBool iDrawSeparatorLines; + + /** * Ratio of zooming animation. */ TReal iIconAnimationZoomRatio; @@ -886,7 +900,7 @@ * Not own. */ CMmTemplateLibrary* iTemplateLibrary; - + /** * Storage for cached items data. The data is updated during normal operation * and used when iUseCache is ETrue. @@ -905,7 +919,7 @@ * Stores information on the last used subcells configuration. * Such information is needed to determine whether it is necessary to * setup subcells before drawing a particular item or is it possible - * to skip this step because the subcells are already set properly. + * to skip this step because the subcells are already set properly. */ mutable TMmSubcellsSetupCode iLastSubcellsSetupCode; @@ -913,17 +927,17 @@ * 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. */ diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/inc/mmlistboxview.h --- a/menufw/menufwui/mmwidgets/inc/mmlistboxview.h Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmlistboxview.h Wed May 12 13:22:51 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: MM_12.1.6 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_12.1.7 % << Don't touch! Updated by Synergy at check-out. * */ @@ -210,6 +210,13 @@ */ void DisableScrollToItem( TBool aDisable ); + /** + * Gets number of items in model. + * + * @return + */ + TInt ModelItemsCount(); + private: /** diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/inc/mmwidgetcontainer.h --- a/menufw/menufwui/mmwidgets/inc/mmwidgetcontainer.h Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmwidgetcontainer.h Wed May 12 13:22:51 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: MM_48.1.37 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_48.1.38 % << Don't touch! Updated by Synergy at check-out. * */ @@ -30,6 +30,7 @@ #include #include #include +#include #include "hnsuiteobserver.h" #include "mmvisibilityobserver.h" @@ -62,7 +63,7 @@ * @ingroup group_mmwidgets */ class TMmWidgetPosition - { + { public: /** * Default constructor. @@ -71,34 +72,34 @@ TMmWidgetPosition(); public: // data - /** - * The vertical item offset cache. - */ - TInt iVerticalItemOffset; + /** + * The vertical item offset cache. + */ + TInt iVerticalItemOffset; - /** - * The top item index cache. - */ - TInt iTopItemIndex; + /** + * The top item index cache. + */ + TInt iTopItemIndex; - /** - * Tells if the cached values are valid. - */ - TBool iValid; + /** + * Tells if the cached values are valid. + */ + TBool iValid; - /** - * The mode (portrait/landscape) for which the cache is valid. - */ - TBool iLandscape; + /** + * The mode (portrait/landscape) for which the cache is valid. + */ + TBool iLandscape; - /** - * Id from model (not index) of the currently highlighted item. - * It should only be set if the currently highlighted item is - * visible (fully or partially), otherwise it must remain - * initialized to KErrNotFound. - */ - TInt iHighlightedItemId; - }; + /** + * Id from model (not index) of the currently highlighted item. + * It should only be set if the currently highlighted item is + * visible (fully or partially), otherwise it must remain + * initialized to KErrNotFound. + */ + TInt iHighlightedItemId; + }; /** * Interface for widget containers. @@ -114,7 +115,7 @@ public MMmVisibilityObserver, public MEikListBoxObserver, public MAknLongTapDetectorCallBack - { + { public: /** @@ -142,13 +143,13 @@ public: // Highlight related methods - /** - * Sets the default highlight. - * + /** + * Sets the default highlight. + * * @since S60 v3.0 * @param aRedraw Is highlight to redraw. */ - virtual void SetDefaultHighlightL( TBool aRedraw = ETrue ) = 0; + virtual void SetDefaultHighlightL( TBool aRedraw = ETrue ) = 0; /** * Sets the highlight. @@ -157,7 +158,7 @@ * @param aItemIndex Index to set the highlight at. * @param aRedraw Is highlight to redraw. */ - IMPORT_C virtual void SetManualHighlightL(TInt aItemIndex, TBool aRedraw = ETrue ); + IMPORT_C virtual void SetManualHighlightL(TInt aItemIndex, TBool aRedraw = ETrue ); /** * Gets the highlight from the widget. @@ -165,7 +166,7 @@ * @since S60 v3.0 * @return Current Highlight in the widget. */ - IMPORT_C virtual TInt GetHighlight(); + IMPORT_C virtual TInt GetHighlight(); /** * Gets the highlight from the widget. @@ -173,7 +174,7 @@ * @since S60 v3.0 * @return Previous Highlight in the widget. */ - IMPORT_C virtual TInt GetPreviousHighlight(); + IMPORT_C virtual TInt GetPreviousHighlight(); /** * Set highlight visibility. @@ -181,22 +182,22 @@ * @since S60 v3.0 * @param aVisible Visibility status. */ - IMPORT_C virtual void SetHighlightVisibilityL( TBool aVisible ); - + IMPORT_C virtual void SetHighlightVisibilityL( TBool aVisible ); + /** * Set highlight visibility. * * @since S60 v3.0 * @return Visibility status. */ - IMPORT_C virtual TBool IsHighlightVisible(); + IMPORT_C virtual TBool IsHighlightVisible(); /** * Handle item addition. * * @since S60 v3.0 */ - IMPORT_C virtual void HandleItemAdditionL(); + IMPORT_C virtual void HandleItemAdditionL(); /** @@ -204,14 +205,14 @@ * * @since S60 v3.0 */ - IMPORT_C virtual void HandleItemRemovalL(); + IMPORT_C virtual void HandleItemRemovalL(); /** * Handle item removal. * * @since S60 v3.0 */ - IMPORT_C CHnSuiteModel* GetSuiteModelL(); + IMPORT_C CHnSuiteModel* GetSuiteModelL(); /** * Retrieve type of widget. @@ -219,40 +220,40 @@ * @since S60 v3.0 * @return Type of widget. */ - IMPORT_C virtual THnSuiteWidgetType WidgetType(); + IMPORT_C virtual THnSuiteWidgetType WidgetType(); - /** - * Removes all LIW objects owned by this object. + /** + * Removes all LIW objects owned by this object. * * LIW objects owned by non-LIW objects that are owned by * this object are also removed. - */ - virtual void RemoveLiwObjects(); + */ + virtual void RemoveLiwObjects(); - /** - * Sets the long tap observer. + /** + * Sets the long tap observer. * * @param aObserver Observer to receive long tap events. - */ - IMPORT_C virtual void SetLongTapObserver( MMmLongTapObserver* aObserver ); + */ + IMPORT_C virtual void SetLongTapObserver( MMmLongTapObserver* aObserver ); - /** - * Informs the container that long tap event is finished (e.g. because - * a command from the context menu has been issued). - * - * @param aStopTimer ETrue when the highlight timer should be stopped. - */ - IMPORT_C virtual void EndLongTapL( TBool aStopTimer = ETrue ); + /** + * Informs the container that long tap event is finished (e.g. because + * a command from the context menu has been issued). + * + * @param aStopTimer ETrue when the highlight timer should be stopped. + */ + IMPORT_C virtual void EndLongTapL( TBool aStopTimer = ETrue ); public: - /** - * Sets suite model. - * - * @since S60 v3.0 - * @param aModel Suite model. - */ - virtual void SetSuiteModelL( CHnSuiteModel* aModel ); + /** + * Sets suite model. + * + * @since S60 v3.0 + * @param aModel Suite model. + */ + virtual void SetSuiteModelL( CHnSuiteModel* aModel ); /** * Gets Multimedia Menu model. @@ -260,7 +261,7 @@ * @since S60 v3.0 * @return Model. */ - virtual CMmListBoxModel* GetMmModel() = 0; + virtual CMmListBoxModel* GetMmModel() = 0; /** * Sets widget observer. @@ -268,7 +269,7 @@ * @since S60 v3.0 * @param aObserver Widget observer. */ - IMPORT_C virtual void SetObserver( MMmWidgetObserver* aObserver); + IMPORT_C virtual void SetObserver( MMmWidgetObserver* aObserver); /** * Gets item rectangle according to item index. @@ -277,7 +278,7 @@ * @param aItemIndex Item index. * @return Item rectangle. */ - IMPORT_C TRect GetItemRectL( TInt aItemIndex ); + IMPORT_C TRect GetItemRectL( TInt aItemIndex ); /** * Sets empty text visible when model has no items. @@ -285,7 +286,7 @@ * @since S60 v3.0 * @param aText Text to be shown when view is empty. */ - virtual void SetEmptyTextL(const TDesC& aText) = 0 ; + virtual void SetEmptyTextL(const TDesC& aText) = 0 ; /** * Sets flag. @@ -293,7 +294,7 @@ * @since S60 v3.0 * @param Flag Flag. */ - virtual void SetFlag(TInt Flag); + virtual void SetFlag(TInt Flag); /** * Gets widget. @@ -301,7 +302,7 @@ * @since S60 v3.0 * @return Widget. */ - virtual CEikListBox* Widget(); + virtual CEikListBox* Widget(); /** * Sets background context for item drawer and view. @@ -309,8 +310,8 @@ * @since S60 v3.0 * @param aBgContext Background context. */ - virtual void SetItemDrawerAndViewBgContext( - CAknsBasicBackgroundControlContext * aBgContext ) =0; + virtual void SetItemDrawerAndViewBgContext( + CAknsBasicBackgroundControlContext * aBgContext ) =0; /** * Sets edit mode so UI is aware. @@ -318,7 +319,7 @@ * @since S60 v3.0 * @param aIsEditMode Is edit mode. */ - virtual void SetEditModeL( TBool aIsEditMode ); + virtual void SetEditModeL( TBool aIsEditMode ); /** * Tells if UI is aware of edit mode. @@ -326,32 +327,32 @@ * @since S60 v5.0 * @return Edit mode status. */ - virtual TBool IsEditMode() const; + virtual TBool IsEditMode() const; /** * Sets up widget layout (needed for grid). * * @since S60 v3.0 */ - virtual void SetupWidgetLayoutL() =0; + virtual void SetupWidgetLayoutL() =0; /** * Constructor. */ - CMmWidgetContainer(); + CMmWidgetContainer(); /** * Destructor. */ ~CMmWidgetContainer(); - + /** * Enables/disables animation during long tap. * Tactile feedback is also enabled and disabled with the animation. * Changes made with this method will be effective on the next long * tap, i.e. it is not possible to stop an already started animation * by using this method. - * + * * @param aEnable ETrue - enable, EFalse - disable long tap animation * and long tap tactile feedback */ @@ -404,7 +405,7 @@ * @param aPointerEvent Pointer event. */ void HandlePointerEventsInEditModeL(const TPointerEvent& aPointerEvent, - TBool aAbortAnimations ); + TBool aAbortAnimations ); /** * Set draggable. @@ -655,14 +656,38 @@ * 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; + /** + * Determines if folder can be moved to another one. + */ + IMPORT_C TBool AllowMove() const; + + /** + * Sets allow move param. + * @param aAllowMove. ETrue if move item is allowed. + */ + void SetAllowMove( TBool aAllowMove ); + + /** + * Sets parameters for move event. + * @param aRecipientId Item id to be moved. + * @param aEventParameters Event parameters. + */ + IMPORT_C void SetTriggerMoveItemL( const TInt aRecipientId, + CLiwGenericParamList* aEventParameters ); + + /** + * Calls move event. + */ + void TriggerMoveItemL(); + public: // from MMmVisibilityObserver /** @@ -703,7 +728,7 @@ * * @since S60 v3.0 */ - void ConstructL(); + void ConstructL(); /** * Sets highlight locally. @@ -712,9 +737,9 @@ * @since S60 v3.0 * @param aItemIndex Index of the item. */ - void SetHighlightL(TInt aItemIndex); + void SetHighlightL(TInt aItemIndex); - /** + /** * Checks whether given point collides with specific item's re-order area. * * This function gets called during drag-and-drop operations to @@ -755,13 +780,13 @@ private: - /** - * Called when the number of items in widget model changed. - * @since S60 v5.0 - * - * @param aChange Type of change - */ - void HandleNumberOfItemsChangedL( TItemsChangeType aChange ); + /** + * Called when the number of items in widget model changed. + * @since S60 v5.0 + * + * @param aChange Type of change + */ + void HandleNumberOfItemsChangedL( TItemsChangeType aChange ); /** * Manages zooming of folder. @@ -769,7 +794,7 @@ * @since S60 v3.0 * @param aDraggedItemOverIcons Is dragged over icons flag. */ - void ManageFolderZoomingL( TBool aDraggedItemOverIcons ); + void ManageFolderZoomingL( TBool aDraggedItemOverIcons ); /** * Cancels gragging of item if relevant( Edit Mode is activated ) @@ -807,7 +832,7 @@ * @return Distance between two points in pixels. */ TInt DeltaSquare( const TPoint aTapPoint, - const TPoint aPos ); + const TPoint aPos ); /** * Checks, whether given item is a folder or root folder. @@ -817,17 +842,17 @@ TBool IsFolderL( TInt aItemIndex ); /** - * Checks, whether given item has IsDeleteLockedL flag set. - * @param aItemIndex Item index to check. - * @returns IsDeleteLockedL flag - */ - TBool IsDeleteLockedL( TInt aItemIndex ); + * Checks, whether given item has IsDeleteLockedL flag set. + * @param aItemIndex Item index to check. + * @returns IsDeleteLockedL flag + */ + TBool IsDeleteLockedL( TInt aItemIndex ); - /** - * Gets column count in current view. - * @returns Column count in current view. - */ - virtual TInt ColumnsInCurrentView(); + /** + * Gets column count in current view. + * @returns Column count in current view. + */ + virtual TInt ColumnsInCurrentView(); /** * Gets row count in current view. @@ -835,35 +860,35 @@ */ virtual TInt RowsInCurrentView(); - /** - * Scrolls the view move mode non-touch so that move indicators are visible. - */ - void ScrollViewIfNeededL(); + /** + * Scrolls the view move mode non-touch so that move indicators are visible. + */ + void ScrollViewIfNeededL(); /** * Scrolls the view in pixels. * @param aPixels THe number of pixels to scroll. If negative, the view is scrolled down. */ - void ScrollInPixelsL( TInt aPixels ); + void ScrollInPixelsL( TInt aPixels ); /** * Sets up the scrolling effect movement type. * @param aDown True if scrolling is downwards. */ - void SetupScrollingEffectsL( TBool aDown ); + void SetupScrollingEffectsL( TBool aDown ); protected: - /** - * Own. - */ - CEikListBox* iWidget; + /** + * Own. + */ + CEikListBox* iWidget; /** * Key event observer. */ - MMmKeyEventObserver* iKeyEventObserver; + MMmKeyEventObserver* iKeyEventObserver; /** * Drag and drop observer. @@ -888,24 +913,24 @@ protected: - /** - * Current Highlight. - */ - TInt iCurrentHighlight; + /** + * Current Highlight. + */ + TInt iCurrentHighlight; /** * Has drag occurred. */ TBool iDragOccured; - /** - * Processed display elelments for better performance. - */ + /** + * Processed display elelments for better performance. + */ CMmPostEvaluationProcessor* iPostProcessor; - /** - * Set when long tap is in progress (stylus popup displayed over container) - */ + /** + * Set when long tap is in progress (stylus popup displayed over container) + */ TBool iLongTapInProgress; private: @@ -915,51 +940,51 @@ * Background context. * Own. */ - CAknsBasicBackgroundControlContext* iBgContext; + CAknsBasicBackgroundControlContext* iBgContext; /** * Last drag point. */ - TPoint iLastDragPoint; + TPoint iLastDragPoint; /** * First tap point. */ - TPoint iTapPoint; + TPoint iTapPoint; /** * First tap point. */ - TPoint iItemRelativeTapPoint; + TPoint iItemRelativeTapPoint; - /** + /** * Last drag highlight. */ - TInt iLastDragHighlight; + TInt iLastDragHighlight; /** * Dragged item index. */ - TBool iDraggedIndex; + TBool iDraggedIndex; /** * Edit mode status. */ - TBool iIsEditMode; + TBool iIsEditMode; - /** + /** * Destination of item index. */ - TInt iItemIndexDestination; + TInt iItemIndexDestination; - /** + /** * Previous Highlight. */ - TInt iPreviousHighlight; + TInt iPreviousHighlight; - /** - * The current rect of the widget control. - */ + /** + * The current rect of the widget control. + */ TRect iWidgetRect; /** @@ -969,9 +994,9 @@ */ TBool iAllowLongPress; - /** - * Cache for widget position. - */ + /** + * Cache for widget position. + */ TMmWidgetPosition iWidgetPositionCache; /** @@ -1001,6 +1026,31 @@ */ MMmLongTapObserver* iLongTapObserver; - }; + /** + * Stores previously set highlight visibility. + * ETrue - hightlight visible, EFalse - highlight disabled. + * Please note that in most cases it is better to read + * ESingleClickDisabledHighlight flag of itemdrawer than rely + * on this member variable to determine if highlight is visible + * (@c IsHighlightVisible). + */ + TBool iPreviousHighlightVisibility; + + /** + * Defines if move item is allowed. + */ + TBool iAllowMove; + + /** + * Defines item id to be moved. + */ + TInt iRecipientId; + + /** + * Event parameters for move item. + */ + CLiwGenericParamList *iEventParameters; + + }; #endif // MMMWIDGETCONTAINER_H diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/inc/mmwidgetsconstants.h --- a/menufw/menufwui/mmwidgets/inc/mmwidgetsconstants.h Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmwidgetsconstants.h Wed May 12 13:22:51 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: Constants for the matrixmenu -* Version : %version: 33.1.11 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: 33.1.13 % << Don't touch! Updated by Synergy at check-out. * */ @@ -27,257 +27,256 @@ * Grid constants' namespace. */ namespace MmGrid - { - /** - * X component of the 4x3 layout. - */ - const TInt K4By3LayoutX = 4; + { + /** + * X component of the 4x3 layout. + */ + const TInt K4By3LayoutX = 4; - /** - * Y component of the 4x3 layout. - */ - const TInt K4By3LayoutY = 3; + /** + * Y component of the 4x3 layout. + */ + const TInt K4By3LayoutY = 3; - /** - * X component of the 3x4 layout. - */ + /** + * X component of the 3x4 layout. + */ - const TInt K3By4LayoutX = 3; + const TInt K3By4LayoutX = 3; - /** - * Y component of the 3x4 layout. - */ - const TInt K3By4LayoutY = 4; + /** + * Y component of the 3x4 layout. + */ + const TInt K3By4LayoutY = 4; - /** - * X component of the 4x5 layout. - */ - const TInt K4By5LayoutX = 4; + /** + * X component of the 4x5 layout. + */ + const TInt K4By5LayoutX = 4; - /** - * Y component of the 5x4 layout. - */ - const TInt K4By5LayoutY = 5; + /** + * Y component of the 5x4 layout. + */ + const TInt K4By5LayoutY = 5; - /** - * X component of the 5x4 layout. - */ - const TInt K5By4LayoutX = 5; + /** + * X component of the 5x4 layout. + */ + const TInt K5By4LayoutX = 5; - /** - * Y component of the 5x4 layout. - */ - const TInt K5By4LayoutY = 4; + /** + * Y component of the 5x4 layout. + */ + const TInt K5By4LayoutY = 4; - /** - * Below this value, default highlight in 3x4 grid - * is set up on the first item. Otherwize, on the default - * highlight. - */ - const TInt K3By4Threshold(5); + /** + * Below this value, default highlight in 3x4 grid + * is set up on the first item. Otherwize, on the default + * highlight. + */ + const TInt K3By4Threshold(5); - /** - * Below this value, default highlight in 4x3 grid - * is set up on the first item. Otherwize, on the default - * highlight. - */ - const TInt K4By3Threshold(6); + /** + * Below this value, default highlight in 4x3 grid + * is set up on the first item. Otherwize, on the default + * highlight. + */ + const TInt K4By3Threshold(6); - /** - * Below this value, default highlight in 5x4 grid - * is set up on the first item. Otherwize, on the default - * highlight. - */ - const TInt K5By4Threshold(8); + /** + * Below this value, default highlight in 5x4 grid + * is set up on the first item. Otherwize, on the default + * highlight. + */ + const TInt K5By4Threshold(8); + + /** + * Below this value, default highlight in 4x5 grid + * is set up on the first item. Otherwize, on the default + * highlight. + */ + const TInt K4By5Threshold(10); - /** - * Below this value, default highlight in 4x5 grid - * is set up on the first item. Otherwize, on the default - * highlight. - */ - const TInt K4By5Threshold(10); + /** + * Default highlight in 3x4 grid. + */ + const TInt K3By4DefaultHighlight(4); - /** - * Default highlight in 3x4 grid. - */ - const TInt K3By4DefaultHighlight(4); + /** + * Default highlight in 4x3 grid. + */ + const TInt K4By3DefaultHighlight(5); - /** - * Default highlight in 4x3 grid. - */ - const TInt K4By3DefaultHighlight(5); + /** + * Default highlight in 5x4 grid. + */ + const TInt K5By4DefaultHighlight(7); - /** - * Default highlight in 5x4 grid. - */ - const TInt K5By4DefaultHighlight(7); + /** + * Default highlight in 4x5 grid. + */ + const TInt K4By5DefaultHighlight(8); - /** - * Default highlight in 4x5 grid. - */ - const TInt K4By5DefaultHighlight(8); + /** + * Number of rows in portrait/non-zoom mode; + */ + const TInt KRowsPortraitZoomNormal(4); - /** - * Number of rows in portrait/non-zoom mode; - */ - const TInt KRowsPortraitZoomNormal(4); + /** + * Number of columns in landscape/non-zoom mode; + */ + const TInt KColsPortraitZoomNormal(3); - /** - * Number of columns in landscape/non-zoom mode; - */ - const TInt KColsPortraitZoomNormal(3); + /** + * Number of rows in portrait/non-zoom mode; + */ + const TInt KRowsLandscapeZoomNormal(3); - /** - * Number of rows in portrait/non-zoom mode; - */ - const TInt KRowsLandscapeZoomNormal(3); + /** + * Number of columns in landscape/non-zoom mode; + */ + const TInt KColsLandscapeZoomNormal(4); - /** - * Number of columns in landscape/non-zoom mode; - */ - const TInt KColsLandscapeZoomNormal(4); - - } + /** + * Focus based scrolling item threshold for grid. + */ + const TReal KFocusScrollingThreshold( 0.27 ); + } /** * Listbox constants' namespace. */ namespace MmListBox - { - /** - * Threshold value, determinign if a partial should - * be shown in a list. - */ - const TInt KPartialItemShowThreshold (0); + { + /** + * Threshold value, determinign if a partial should + * be shown in a list. + */ + const TInt KPartialItemShowThreshold( 0 ); - /** - * Default highlight in 4x5 grid. - */ - const TInt KCols(1); - } + /** + * Default highlight in 4x5 grid. + */ + const TInt KCols( 1 ); + + /** + * Focus based scrolling item threshold for list. + */ + const TReal KFocusScrollingThreshold( 0.55 ); + } /** * Drag and drop related constants. */ namespace MmEffects - { - /** - * Threshold for items shift. - */ - const TReal KShiftRatio(0.25); + { + /** + * Threshold for items shift. + */ + const TReal KShiftRatio( 0.25 ); - /** - * Drag and drop speed limit. - */ - const TInt KDragSpeedIgnoreThreshold(15 * 15); + /** + * Drag and drop speed limit. + */ + const TInt KDragSpeedIgnoreThreshold( 15 * 15 ); - /** - * Number of frames to animate. - */ - const TInt KMaximumAnimationFramesCount( 6 ); - - /** - * Number of frames to animate. - */ - const TInt KUsualAnimationFramesCount( 3 ); + /** + * Number of frames to animate. + */ + const TInt KMaximumAnimationFramesCount( 6 ); - /** - * Number of frames to animate on non-touch devices. - */ - const TInt KUsualAnimationFramesCountNonTouch( 2 ); + /** + * Number of frames to animate. + */ + const TInt KUsualAnimationFramesCount( 3 ); - /** - * No animation frames count. - */ - const TInt KNoAnimationFramesCount( 1 ); + /** + * Number of frames to animate on non-touch devices. + */ + const TInt KUsualAnimationFramesCountNonTouch( 2 ); - /** - * Delay between redrawing frames. - */ - const TInt KAnimationFrameDelay( 40000 ); + /** + * No animation frames count. + */ + const TInt KNoAnimationFramesCount( 1 ); - /** - * Text alpha during drag. - */ - const TInt KDragTextAlpha( 50 ); + /** + * Delay between redrawing frames. + */ + const TInt KAnimationFrameDelay( 35000 ); - /** - * Focus based scrolling item threshold. - */ - const TReal KFocusScrollingThreshold( 0.55 ); + /** + * Text alpha during drag. + */ + const TInt KDragTextAlpha( 50 ); - /** - * Focus based scrolling item threshold for listbox landscape mode. - */ - const TReal KFocusScrollingThresholdListboxLanscape( 1.0 ); - - /** - * Value of drag ignore. - */ - const TInt KDragIgnoreRectValue(200); + /** + * Value of drag ignore. + */ + const TInt KDragIgnoreRectValue( 200 ); - /** - * Time between two butto repeat events. - */ - const TInt KDragRepeatRespawn(2); + /** + * Time between two butto repeat events. + */ + const TInt KDragRepeatRespawn( 2 ); - /** - * Determines the speed of focus-based scrolling in edit mode. - */ - const TInt KEditModeScrollingDelayFactor = 4000; - } + /** + * Determines the speed of focus-based scrolling in edit mode. + */ + const TInt KEditModeScrollingDelayFactor = 4000; + } /** * Templates' related constants. */ namespace MmTemplateContants - { - /** - * If a custom (non LCT) template is used, this is - * its default scrollbar width. - */ - const TInt KCustomTemplateScrolbarWidth (25); + { + /** + * If a custom (non LCT) template is used, this is + * its default scrollbar width. + */ + const TInt KCustomTemplateScrolbarWidth (25); - const TInt KTemplateChildTextLength (64); + const TInt KTemplateChildTextLength (64); - const TInt KSubCellsCount (6); + const TInt KSubCellsCount (6); - const TInt KItemSubCellsText (300); + const TInt KItemSubCellsText (300); - const TInt KMoveIndicatorStartingPos ( 32 ); + const TInt KMoveIndicatorStartingPos ( 32 ); - } + } /** * Shortcut constants. */ namespace MmShortcutConstants - { - /** - * Possible scancodes when interpreting shortcut key. - */ - const TInt KScanCodes[] = { '1','2','3','4','5','6','7','8','9', + { + /** + * Possible scancodes when interpreting shortcut key. + */ + const TInt KScanCodes[] = { '1','2','3','4','5','6','7','8','9', #ifndef __WINS__ '*', #else EStdKeyNkpAsterisk, #endif - '0', EStdKeyHash }; + '0', EStdKeyHash }; - /** - * Number of available scancodes. - */ - const TInt KScanCodeCount = 12; - } + /** + * Number of available scancodes. + */ + const TInt KScanCodeCount = 12; + } namespace MmMarqueeConstants - { - const TInt KTextTrimmingThreshold (80); - const TInt KClippingBufLength (80); - const TInt KLoops (1); - const TInt KScrollAmount (6); - const TInt KScrollDelay (1000000); - } + { + const TInt KTextTrimmingThreshold (80); + const TInt KClippingBufLength (80); + const TInt KLoops (1); + const TInt KScrollAmount (6); + const TInt KScrollDelay (1000000); + } /** * Matrix Template Library panic notice. */ @@ -307,7 +306,7 @@ _LIT8( KImageVisual8, "imagevisual" ); _LIT8( KImagePath8, "imagepath" ); _LIT8( KGridLayout8, "gridlayout" ); -_LIT8( KEnabled8, "enabled" ); +_LIT8( KEnabled8, "enabled" ); _LIT8( KRow8, "row" ); _LIT8( KCol8, "col" ); _LIT8( KPositionX8, "positionx" ); @@ -374,18 +373,18 @@ _LIT8( KUiaccelAagridCellImagePaneG38, "uiaccel_aagrid_cell_image_pane_g3" ); _LIT8( KUiaccelAagridCellImagePaneG48, "uiaccel_aagrid_cell_image_pane_g4" ); -_LIT8( KCellHcAppsPane8, "cell_hc_apps_pane" ); +_LIT8( KCellHcAppsPane8, "cell_hc_apps_pane" ); _LIT8( KCellHcAppsPaneT18, "cell_hc_apps_pane_t1" ); _LIT8( KCellHcAppsPaneG18, "cell_hc_apps_pane_g1" ); _LIT8( KCellHcAppsPaneG28, "cell_hc_apps_pane_g2" ); _LIT8( KCellHcAppsPaneG38, "cell_hc_apps_pane_g3" ); -_LIT8( KCellAppPane8, "cell_app_pane" ); +_LIT8( KCellAppPane8, "cell_app_pane" ); _LIT8( KCellAppsPaneG18, "cell_app_pane_g1" ); _LIT8( KCellAppsPaneT18, "cell_app_pane_t1" ); _LIT8( KCellAppsPaneG28, "cell_app_pane_g2" ); -_LIT8( KListSingleHcAppsPane8, "list_single_hc_apps_pane" ); +_LIT8( KListSingleHcAppsPane8, "list_single_hc_apps_pane" ); _LIT8( KListSingleHcAppsPaneT18, "list_single_hc_apps_pane_t1" ); _LIT8( KListSingleHcAppsPaneG18, "list_single_hc_apps_pane_g1" ); _LIT8( KListSingleHcAppsPaneG28, "list_single_hc_apps_pane_g2" ); @@ -444,7 +443,7 @@ /** * 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. + * but it is sufficient for our purposes. */ const TInt KDragTreshold = 18; diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/src/mmcacheforitem.cpp --- a/menufw/menufwui/mmwidgets/src/mmcacheforitem.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmcacheforitem.cpp Wed May 12 13:22:51 2010 +0300 @@ -133,7 +133,7 @@ if ( iSubcellsSetupCode != aSubcellsSetupCode || (!!iIsCurrent) != (!!aIsItemCurrent) ) { - SetValidL( EFalse ); + MarkAsInvalid(); } } diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/src/mmdraweranimator.cpp --- a/menufw/menufwui/mmwidgets/src/mmdraweranimator.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmdraweranimator.cpp Wed May 12 13:22:51 2010 +0300 @@ -1,20 +1,20 @@ /* -* 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: -* Version : %version: MM_41 % << Don't touch! Updated by Synergy at check-out. -* -*/ + * 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: + * Version : %version: MM_41 % << Don't touch! Updated by Synergy at check-out. + * + */ #include @@ -23,31 +23,31 @@ #include "mmfloatingitem.h" #include "mmwidgetcontainer.h" - // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// -CMmDrawerAnimator::CMmDrawerAnimator(CMmListBoxItemDrawer& aDrawer) : - CActive( AknLayoutUtils::PenEnabled() ? - EPriorityRealTime : - EPriorityAbsoluteRealTime8 ), iDrawer(aDrawer), +// +CMmDrawerAnimator::CMmDrawerAnimator( CMmListBoxItemDrawer& aDrawer ) : + CActive( AknLayoutUtils::PenEnabled() + ? EPriorityAbsoluteVeryLow + : EPriorityAbsoluteRealTime8 ), iDrawer( aDrawer ), iLastNotedHighlight( KErrNotFound ), iLastNotedTopItem( KErrNotFound ), iLastNotedVerticalOffset( 0 ), - iUsualAnimationFramesCount( AknLayoutUtils::PenEnabled() ? - MmEffects::KUsualAnimationFramesCount : - MmEffects::KUsualAnimationFramesCountNonTouch ) + iUsualAnimationFramesCount( AknLayoutUtils::PenEnabled() + ? MmEffects::KUsualAnimationFramesCount + : MmEffects::KUsualAnimationFramesCountNonTouch ), + iPreparedForGarbage( EFalse ) { } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// -CMmDrawerAnimator* CMmDrawerAnimator::NewLC(CMmListBoxItemDrawer& aDrawer) +// +CMmDrawerAnimator* CMmDrawerAnimator::NewLC( CMmListBoxItemDrawer& aDrawer ) { - CMmDrawerAnimator* self = new ( ELeave ) CMmDrawerAnimator(aDrawer); - CleanupStack::PushL(self); + CMmDrawerAnimator* self = new ( ELeave ) CMmDrawerAnimator( aDrawer ); + CleanupStack::PushL( self ); self->ConstructL(); return self; } @@ -55,10 +55,10 @@ // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// -CMmDrawerAnimator* CMmDrawerAnimator::NewL(CMmListBoxItemDrawer& aDrawer) +// +CMmDrawerAnimator* CMmDrawerAnimator::NewL( CMmListBoxItemDrawer& aDrawer ) { - CMmDrawerAnimator* self = CMmDrawerAnimator::NewLC(aDrawer); + CMmDrawerAnimator* self = CMmDrawerAnimator::NewLC( aDrawer ); CleanupStack::Pop( self ); return self; } @@ -66,18 +66,17 @@ // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// +// void CMmDrawerAnimator::ConstructL() { User::LeaveIfError( iTimer.CreateLocal() ); // Initialize timer - CActiveScheduler::Add( this); // Add to scheduler - iPreparedForGarbage = EFalse; + CActiveScheduler::Add( this ); // Add to scheduler } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// +// CMmDrawerAnimator::~CMmDrawerAnimator() { Cancel(); // Cancel any request, if outstanding @@ -88,141 +87,129 @@ // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// +// void CMmDrawerAnimator::DoCancel() { iTimer.Cancel(); + if( iDrawer.GetFloatingItemCount() == 0 ) + { + TRAP_IGNORE(TriggerMoveItemL()); + } } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// -TBool CMmDrawerAnimator::CancelNextRedrawL() - { - RunL(); - TTime currentTime; - currentTime.HomeTime(); - return (currentTime.MicroSecondsFrom(iLastRedrawTime) - <= MmEffects::KAnimationFrameDelay); - } -// ----------------------------------------------------------------------------- // -// ----------------------------------------------------------------------------- -// void CMmDrawerAnimator::RunL() - { - if ( iPreparedForGarbage ) - { - return; - } - - TTime currentTime; - currentTime.HomeTime(); - - if (currentTime.MicroSecondsFrom(iLastRedrawTime) - >= MmEffects::KAnimationFrameDelay && iDrawer.GetFloatingItemCount() > 0) - { - Cancel(); - - TRect refreshRect; - for(int i=0; i< iDrawer.GetFloatingItemCount(); i++) - { - TMmFloatingItem& current = iDrawer.GetFloatingItemAtIndex(i); - TSize itemSize = iDrawer.GetItemSize(current.GetDrawnItemIndex(), EFalse); + { + if( iPreparedForGarbage ) + { + return; + } + + if( iDrawer.GetFloatingItemCount() > 0 ) + { + TRect refreshRect; + for( int i = 0; i < iDrawer.GetFloatingItemCount(); i++ ) + { + TMmFloatingItem& current = iDrawer.GetFloatingItemAtIndex( i ); + TSize itemSize = iDrawer.GetItemSize(current.GetDrawnItemIndex(), EFalse); + + TRect beforeRect( current.GetItemPosition(), itemSize ); + current.MakeStep(); + TRect afterRect( current.GetItemPosition(), itemSize ); - TRect beforeRect(current.GetItemPosition(), itemSize); - current.MakeStep(); - TRect afterRect(current.GetItemPosition(), itemSize); - - if (current.GetFloatingItemType() == EDrag ) - { - TInt dragTrail = iDrawer.GetFloatingItemIndex( EPostDragRefreshItem ); - if (dragTrail != KErrNotFound) - { - refreshRect = (refreshRect == TRect(0,0,0,0)) ? beforeRect : refreshRect; - refreshRect.BoundingRect( afterRect ); - } - } - else - { - refreshRect = (refreshRect == TRect(0,0,0,0)) ? beforeRect : refreshRect; - refreshRect.BoundingRect( beforeRect ); - refreshRect.BoundingRect( afterRect ); - } - } - const TInt highlightedItemIndex = iDrawer.Widget()->View()->CurrentItemIndex(); - if ( iLastNotedHighlight != highlightedItemIndex ) - { + if( current.GetFloatingItemType() == EDrag ) + { + TInt dragTrail = iDrawer.GetFloatingItemIndex( EPostDragRefreshItem ); + if( dragTrail != KErrNotFound ) + { + refreshRect = ( refreshRect == TRect() ) ? beforeRect : refreshRect; + refreshRect.BoundingRect( afterRect ); + static_cast ( iDrawer.Widget()->Parent() )-> + SetAllowMove( EFalse ); + } + } + else + { + refreshRect = (refreshRect == TRect() ) ? beforeRect : refreshRect; + refreshRect.BoundingRect( beforeRect ); + refreshRect.BoundingRect( afterRect ); + } + } + const TInt highlightedItemIndex = iDrawer.Widget()->View()->CurrentItemIndex(); + if( iLastNotedHighlight != highlightedItemIndex ) + { TRect highlightedItemRect( iDrawer.Widget()->View()->ItemPos( highlightedItemIndex ), - iDrawer.Widget()->View()->ItemSize( highlightedItemIndex ) ); + iDrawer.Widget()->View()->ItemSize( highlightedItemIndex ) ); refreshRect.BoundingRect( highlightedItemRect ); iLastNotedHighlight = highlightedItemIndex; - } + } + + + TInt currentVerticalOffset = static_cast( + iDrawer.Widget()->Parent() )->VerticalItemOffset(); - - TInt currentVerticalOffset = static_cast( - iDrawer.Widget()->Parent() )->VerticalItemOffset(); + if( iLastNotedTopItem != iDrawer.Widget()->TopItemIndex() + || iLastNotedVerticalOffset != currentVerticalOffset ) + { + iDrawer.Widget()->DrawNow(); + iLastNotedTopItem = iDrawer.Widget()->TopItemIndex(); + iLastNotedVerticalOffset = currentVerticalOffset; + } + else + { + if( refreshRect != TRect() ) + { + TRect prev( iPreviousRefreshRect ); + iPreviousRefreshRect = refreshRect; + refreshRect.BoundingRect( prev ); + + // expand rect if non-touch + refreshRect = TRect( AdjustRefreshRectToNonTouch( refreshRect ) ); + + // never draw on the outside of widget's view rectangle + refreshRect.Intersection( iDrawer.Widget()->View()->ViewRect() ); - if (iLastNotedTopItem != iDrawer.Widget()->TopItemIndex() || - iLastNotedVerticalOffset != currentVerticalOffset ) - { - iDrawer.Widget()->DrawNow(); - iLastNotedTopItem = iDrawer.Widget()->TopItemIndex(); - iLastNotedVerticalOffset = currentVerticalOffset; - } - else - { - if ( refreshRect != TRect(0,0,0,0)) - { - TRect prev(iPreviousRefreshRect); - iPreviousRefreshRect = refreshRect; - refreshRect.BoundingRect(prev); - - // expand rect if non-touch - refreshRect = TRect( AdjustRefreshRectToNonTouch( refreshRect ) ); - - // never draw on the outside of widget's view rectangle - refreshRect.Intersection( iDrawer.Widget()->View()->ViewRect() ); - - iDrawer.Widget()->View()->Draw( &refreshRect ); - } - } + iDrawer.Widget()->View()->Draw( &refreshRect ); + } + } + + iLastRedrawTime.HomeTime(); + + } - - iLastRedrawTime.HomeTime(); - - } - - if (iDrawer.GetFloatingItemCount() > 0) - { - Trigger(); - } - else - { - Cancel(); - + if( iDrawer.GetFloatingItemCount() > 0 ) + { + Trigger(); + } + else + { + TriggerMoveItemL(); + Cancel(); + #ifdef RD_UI_TRANSITION_EFFECTS_LIST - if ( iTransTfx && iTransTfxInternal->EffectsDisabled() ) - { - iTransTfx->EnableEffects( ETrue ); - - if ( iTransTfx ) - { - iTransTfxInternal->Remove( MAknListBoxTfxInternal::EListEverything ); - iDrawer.Widget()->DrawNow(); - iTransTfxInternal->Draw( iDrawer.Widget()->Rect() ); - } - } + if( iTransTfx && iTransTfxInternal->EffectsDisabled() ) + { + iTransTfx->EnableEffects( ETrue ); + + if( iTransTfx ) + { + iTransTfxInternal->Remove( MAknListBoxTfxInternal::EListEverything ); + iDrawer.Widget()->DrawNow(); + iTransTfxInternal->Draw( iDrawer.Widget()->Rect() ); + } + } #endif - } + } } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// +// TRect CMmDrawerAnimator::AdjustRefreshRectToNonTouch( const TRect& aRefreshRect ) { TRect rect( aRefreshRect ); @@ -231,13 +218,10 @@ TRect indicatorRect( iDrawer.GetIndicatorRect() ); TSize itemSize( iDrawer.GetItemSize( iDrawer.Widget()->CurrentItemIndex(), ETrue ) ); - + TInt horizontalMargin( ( indicatorRect.Width() - itemSize.iWidth ) / 2 ); TInt verticalMargin( ( indicatorRect.Height() - itemSize.iHeight ) / 2 ); - rect.iBr.iX += horizontalMargin; - rect.iBr.iY += verticalMargin; - rect.iTl.iX -= horizontalMargin; - rect.iTl.iY -= verticalMargin; + rect.Grow(horizontalMargin, verticalMargin); } return rect; } @@ -245,35 +229,34 @@ // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// +// TInt CMmDrawerAnimator::Trigger() { - if ( iPreparedForGarbage ) - { - return KErrCancel; - } - - if (!IsActive() && iDrawer.GetFloatingItemCount() > 0 ) + if( iPreparedForGarbage ) + { + return KErrCancel; + } + + if( !IsActive() && iDrawer.GetFloatingItemCount() > 0 ) { #ifdef RD_UI_TRANSITION_EFFECTS_LIST - iTransTfx = CAknListLoader::TfxApi( iDrawer.Gc() ); - iTransTfxInternal = CAknListLoader::TfxApiInternal( - iDrawer.Gc() ); - - if ( iTransTfx && !iTransTfxInternal->EffectsDisabled() ) - { - iTransTfx->EnableEffects( EFalse ); - - if ( iTransTfxInternal ) - { - iTransTfxInternal->Remove( MAknListBoxTfxInternal::EListEverything ); - iTransTfxInternal->Draw( iDrawer.Widget()->Rect() ); - } - } + iTransTfx = CAknListLoader::TfxApi( iDrawer.Gc() ); + iTransTfxInternal = CAknListLoader::TfxApiInternal( iDrawer.Gc() ); + + if( iTransTfx && !iTransTfxInternal->EffectsDisabled() ) + { + iTransTfx->EnableEffects( EFalse ); + + if( iTransTfxInternal ) + { + iTransTfxInternal->Remove( MAknListBoxTfxInternal::EListEverything ); + iTransTfxInternal->Draw( iDrawer.Widget()->Rect() ); + } + } #endif - - iTimer.After(iStatus, TTimeIntervalMicroSeconds32( - MmEffects::KAnimationFrameDelay ) ); + + iTimer.After( iStatus, TTimeIntervalMicroSeconds32( + MmEffects::KAnimationFrameDelay ) ); SetActive(); } return KErrNone; @@ -282,8 +265,8 @@ // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// -TInt CMmDrawerAnimator::RunError(TInt aError) +// +TInt CMmDrawerAnimator::RunError( TInt aError ) { return aError; } @@ -291,39 +274,39 @@ // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// -void CMmDrawerAnimator::AnimateDragItemTransitionL( ) - { - if (KErrNotFound != iDrawer.GetFloatingItemIndex(EDrag)) +// +void CMmDrawerAnimator::AnimateDragItemTransitionL() + { + if( KErrNotFound != iDrawer.GetFloatingItemIndex( EDrag ) ) { TMmFloatingItem floatingItem( - iDrawer.GetFloatingItemL(EDrag).GetDrawnItemIndex(), - iDrawer.GetFloatingItemL(EDrag).GetItemPosition(), + iDrawer.GetFloatingItemL( EDrag ).GetDrawnItemIndex(), + iDrawer.GetFloatingItemL( EDrag ).GetItemPosition(), EDragTransition, iUsualAnimationFramesCount, - iDrawer.Widget()->View()); + iDrawer.Widget()->View() ); TPoint pointEnd = iDrawer.Widget()->View()->ItemPos( floatingItem.GetDrawnItemIndex() ); floatingItem.SetPositionStep( pointEnd - floatingItem.GetItemPosition() ); iDrawer.AddFloatingItemL( floatingItem, 0 ); - iDrawer.RemoveFloatingItem( iDrawer.GetFloatingItemIndex(EDrag) ); + iDrawer.RemoveFloatingItem( iDrawer.GetFloatingItemIndex( EDrag ) ); } } - + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // TBool CMmDrawerAnimator::IsReadyForNewAnimation() { - if ( iPreparedForGarbage ) - { - return EFalse; - } - - for(int i=0; i< iDrawer.GetFloatingItemCount(); i++) + if( iPreparedForGarbage ) { - TMmFloatingItemType type - = iDrawer.GetFloatingItemAtIndex(i).GetFloatingItemType(); - if ( type != EDrag && type != EZoomTransition ) + return EFalse; + } + + for( int i = 0; i < iDrawer.GetFloatingItemCount(); i++ ) + { + TMmFloatingItemType type = + iDrawer.GetFloatingItemAtIndex( i ).GetFloatingItemType(); + if( type != EDrag && type != EZoomTransition ) { return EFalse; } @@ -337,32 +320,32 @@ // void CMmDrawerAnimator::CancelAnimationsL() { - for(int i=0; i< iDrawer.GetFloatingItemCount(); i++) + for( int i = 0; i < iDrawer.GetFloatingItemCount(); i++ ) { - TMmFloatingItem& current = iDrawer.GetFloatingItemAtIndex(i); - if (current.GetFloatingItemType() != EDrag) + TMmFloatingItem& current = iDrawer.GetFloatingItemAtIndex( i ); + if( current.GetFloatingItemType() != EDrag ) { current.InvalidateFloatingItem(); } } } - // ----------------------------------------------------------------------------- - // - // ----------------------------------------------------------------------------- - // +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// void CMmDrawerAnimator::AnimateItemSwapL( TInt aItemFrom, TInt aItemTo ) { - TMmFloatingItem floatingItem( aItemTo, - iDrawer.Widget()->View()->ItemPos( aItemFrom ), + TMmFloatingItem floatingItem( aItemTo, + iDrawer.Widget()->View()->ItemPos( aItemFrom ), ESwapTransition, iUsualAnimationFramesCount, iDrawer.Widget()->View() ); - - for(int i=0; i< iDrawer.GetFloatingItemCount(); i++) + + for( int i = 0; i < iDrawer.GetFloatingItemCount(); i++ ) { - TMmFloatingItem& current = iDrawer.GetFloatingItemAtIndex(i); + TMmFloatingItem& current = iDrawer.GetFloatingItemAtIndex( i ); - if (current.GetFloatingItemType() == EZoomTransition + if( current.GetFloatingItemType() == EZoomTransition && current.GetDrawnItemIndex() == aItemFrom ) { current.InvalidateFloatingItem(); @@ -371,15 +354,15 @@ } } - floatingItem.SetPositionStep( iDrawer.Widget()->View()->ItemPos(aItemTo)- - iDrawer.Widget()->View()->ItemPos(aItemFrom) ); - iDrawer.AddFloatingItemL(floatingItem); + floatingItem.SetPositionStep( iDrawer.Widget()->View()->ItemPos(aItemTo) + - iDrawer.Widget()->View()->ItemPos(aItemFrom) ); + iDrawer.AddFloatingItemL( floatingItem ); } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// +// void CMmDrawerAnimator::AnimateItemZoomL( TInt aItemIndex, TBool aZoomIn ) { TMmFloatingItem floatingItem( aItemIndex, @@ -392,24 +375,26 @@ (aZoomIn) ? KZoomStateZoomRatio : KNormalStateZoomRatio ); TInt animationFound = EFalse; - for(int i=0; i< iDrawer.GetFloatingItemCount(); i++) + for( int i = 0; i < iDrawer.GetFloatingItemCount(); i++ ) { - TMmFloatingItem& current = iDrawer.GetFloatingItemAtIndex(i); - if (current.GetFloatingItemType() == EZoomTransition && - current.GetDrawnItemIndex() == aItemIndex ) + TMmFloatingItem& current = iDrawer.GetFloatingItemAtIndex( i ); + if( current.GetFloatingItemType() == EZoomTransition + && current.GetDrawnItemIndex() == aItemIndex ) { current.InvalidateFloatingItem(); floatingItem.SetSizeStep( current.GetCurrentZoomRatio(), (aZoomIn) ? KZoomStateZoomRatio : KNormalStateZoomRatio); animationFound = ETrue; + static_cast ( iDrawer.Widget()->Parent() )-> + SetAllowMove( EFalse ); break; } } - - if ( (aZoomIn != EFalse || animationFound != EFalse) ) + + if( ( aZoomIn != EFalse || animationFound != EFalse ) ) { // This covers the situation, when a zoom out animation is requested - // whilst no zoom in occured earlier. In this case the request is + // whilst no zoom in occured earlier. In this case the request is // neglected. iDrawer.AddFloatingItemL( floatingItem ); } @@ -418,20 +403,30 @@ // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// +// void CMmDrawerAnimator::SetNextRedrawToWholeScreen() - { - iPreviousRefreshRect = iDrawer.Widget()->View()->ViewRect(); - } + { + iPreviousRefreshRect = iDrawer.Widget()->View()->ViewRect(); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// +// void CMmDrawerAnimator::PrepareForGarbage() - { -// Cancel any outstanding requests - Cancel(); - iPreparedForGarbage = ETrue; - } + { + // Cancel any outstanding requests + Cancel(); + iPreparedForGarbage = ETrue; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmDrawerAnimator::TriggerMoveItemL() + { + static_cast ( iDrawer.Widget()->Parent() )-> + TriggerMoveItemL(); + } //End of file diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/src/mmgrid.cpp --- a/menufw/menufwui/mmwidgets/src/mmgrid.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmgrid.cpp Wed May 12 13:22:51 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: MM_98 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_103 % << Don't touch! Updated by Synergy at check-out. * */ @@ -257,13 +257,13 @@ // void CMmGrid::HandlePointerEventInEditModeL( const TPointerEvent& aPointerEvent ) { + CMmWidgetContainer* parent = static_cast( Parent() ); 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() ) { @@ -275,7 +275,17 @@ if ( aPointerEvent.iType == TPointerEvent::EButton1Up || aPointerEvent.iType == TPointerEvent::EButton1Down ) { + TBool highlightWasVisible = parent->IsHighlightVisible(); CAknGrid::HandlePointerEventL( aPointerEvent ); + // Tricky: Do not allow the base class implementation of HandlePointerEventL + // to remove the highlight on EButton1Up event when context menu + // is displayed for an item + if ( aPointerEvent.iType == TPointerEvent::EButton1Up && + highlightWasVisible && parent->LongTapInProgress() + && !parent->IsHighlightVisible() ) + { + ItemDrawer()->ClearFlags( CListItemDrawer::ESingleClickDisabledHighlight ); + } } else if ( View()->XYPosToItemIndex( aPointerEvent.iPosition, itemUnderPointerIndex ) ) @@ -308,72 +318,7 @@ // void CMmGrid::HandlePointerEventInNormalModeL( const TPointerEvent& aPointerEvent ) { - CMmWidgetContainer* parent = static_cast( Parent() ); - if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) - { - const TInt KIgnoreRectSize = 40; - TRect ignoreDragRect(aPointerEvent.iPosition, - TSize(KIgnoreRectSize, KIgnoreRectSize)); - ignoreDragRect.Move( - KIgnoreRectSize / 2, - KIgnoreRectSize / 2 ); - Window().RequestPointerRepeatEvent( 50000, ignoreDragRect ); - } - else if ( aPointerEvent.iType == TPointerEvent::EButtonRepeat ) - { - HandleButtonRepeatEventInNormalModeL( aPointerEvent ); - } - CAknGrid::HandlePointerEventL(aPointerEvent); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMmGrid::HandleButtonRepeatEventInNormalModeL( - const TPointerEvent& aPointerEvent ) - { - TInt itemUnderPointerIndex = KErrNotFound; - TBool itemFound = View()->XYPosToItemIndex( - aPointerEvent.iPosition, itemUnderPointerIndex ); - if ( !itemFound ) - { - return; - } - - View()->ItemDrawer()->SetFlags( CListItemDrawer::EPressedDownState ); - CMmWidgetContainer* parent = static_cast( Parent() ); - TBool highlightWasVisible = parent->IsHighlightVisible(); - - if( itemUnderPointerIndex == View()->CurrentItemIndex() ) - { -#ifdef RD_UI_TRANSITION_EFFECTS_LIST - MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( - iMmDrawer->Gc() ); - if ( transApi ) - { - transApi->Remove( MAknListBoxTfxInternal::EListHighlight ); - View()->DrawItem( itemUnderPointerIndex ); - TRect itemUnderPointerIndexRect ( - View()->ItemPos(itemUnderPointerIndex), - View()->ItemSize(itemUnderPointerIndex)); - transApi->Draw( itemUnderPointerIndexRect ); - } - else - { - View()->DrawItem( itemUnderPointerIndex ); - } -#else - View()->DrawItem( itemUnderPointerIndex ); -#endif - } - else - { - TInt previouslyHighlightedItemIndex = View()->CurrentItemIndex(); - parent->SetManualHighlightL( itemUnderPointerIndex , EFalse ); - if ( highlightWasVisible ) - { - View()->DrawItem( previouslyHighlightedItemIndex ); - } - } + CAknGrid::HandlePointerEventL(aPointerEvent); } // ----------------------------------------------------------------------------- @@ -408,7 +353,7 @@ const TPointerEvent& aPointerEvent ) const { TInt topScrollingTreshold = Rect().iTl.iY - + ( MmEffects::KFocusScrollingThreshold + + ( MmGrid::KFocusScrollingThreshold * TReal( View()->ItemSize().iHeight ) ); return ( aPointerEvent.iPosition.iY < topScrollingTreshold ); @@ -422,7 +367,7 @@ const TPointerEvent& aPointerEvent ) const { TInt bottomScrollingTreshold = Rect().iBr.iY - - ( MmEffects::KFocusScrollingThreshold + - ( MmGrid::KFocusScrollingThreshold * TReal( View()->ItemSize().iHeight ) ); return ( aPointerEvent.iPosition.iY > bottomScrollingTreshold ); @@ -541,12 +486,6 @@ { HandlePointerEventInNormalModeL( aPointerEvent ); } - - if ( iMmDrawer->GetFloatingItemCount() > 0 && - iMmDrawer->GetAnimator()->IsActive() ) - { - iMmDrawer->GetAnimator()->CancelNextRedrawL(); - } } // ----------------------------------------------------------------------------- @@ -1016,7 +955,7 @@ // // ----------------------------------------------------------------------------- // -void CMmGrid::HandleRedrawTimerEvent() +void CMmGrid::HandleRedrawTimerEventL() { if ( iSkippedScrollbarEventsCount ) { @@ -1033,7 +972,9 @@ TInt CMmGrid::RedrawTimerCallback( TAny* aPtr ) { CMmGrid* self = static_cast( aPtr ); - self->HandleRedrawTimerEvent(); + TRAP_IGNORE( self->HandleRedrawTimerEventL() ); + // Do not bother returning a meaningful error code, CPeriodic will ignore it + // anyway. return 0; } diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/src/mmgridview.cpp --- a/menufw/menufwui/mmwidgets/src/mmgridview.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmgridview.cpp Wed May 12 13:22:51 2010 +0300 @@ -95,7 +95,7 @@ TInt mirroredItemCol = colNum - itemCol - 1; aItemIndex = aItemIndex - itemCol + mirroredItemCol; } - + // return CAknGridView::ItemPos( aItemIndex ); return CorrectItemPos( aItemIndex ); } @@ -109,19 +109,19 @@ // it the assertion below fails, review this implementation to make sure that // primary vertical case is handled correctly ASSERT( !IsPrimaryVertical() ); - + ASSERT( aItemIndex >= 0 ); const TInt colNum = NumberOfColsInView(); TInt itemRow = aItemIndex / colNum; TInt itemCol = aItemIndex % colNum; - + TInt topItemRow = TopItemIndex() / colNum; // __ASSERT_DEBUG( TopItemIndex() % colNum == 0, User::Invariant() ); - + // it is safe to assume that size between items is (0, 0) because we // explicitly set such value in CMmGrid::DoSetupLayoutL const TSize sizeBetweenItems( 0, 0 ); - + TPoint itemPos( iViewRect.iTl.iX + itemCol * ( ColumnWidth() + sizeBetweenItems.iWidth ), @@ -240,7 +240,18 @@ iWin->Invalidate( *aClipRect ); iWin->BeginRedraw( *aClipRect ); } - CAknGridView::Draw( aClipRect ); + + if ( !itemDrawer->IsEditMode() ) + { + itemDrawer->DrawBackground(ViewRect()); + itemDrawer->SetRedrawItemBackground( EFalse ); + CAknGridView::Draw( aClipRect ); + itemDrawer->SetRedrawItemBackground( ETrue ); + } + else + { + CAknGridView::Draw( aClipRect ); + } if ( aClipRect ) { @@ -288,7 +299,7 @@ CMmListBoxItemDrawer* itemDrawer = STATIC_CAST( CMmListBoxItemDrawer*, ItemDrawer() ); static_cast(itemDrawer->Widget())->SetItemHeight( aItemHeight ); - + CAknGridView::SetItemHeight(aItemHeight); } diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/src/mmitemsdatacache.cpp --- a/menufw/menufwui/mmwidgets/src/mmitemsdatacache.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmitemsdatacache.cpp Wed May 12 13:22:51 2010 +0300 @@ -110,7 +110,7 @@ const TInt count = iItemCacheArr.Count(); for ( TInt i = 0; i < count; ++i ) { - iItemCacheArr[i]->SetValidL( EFalse ); + iItemCacheArr[i]->MarkAsInvalid(); } } diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/src/mmlistbox.cpp --- a/menufw/menufwui/mmwidgets/src/mmlistbox.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmlistbox.cpp Wed May 12 13:22:51 2010 +0300 @@ -48,18 +48,18 @@ // ----------------------------------------------------------------------------- // CMmListBox::CMmListBox() : AKNDOUBLELISTBOXNAME(R_LIST_PANE_LINES_AB_COLUMN) - { - // No implementation required - } + { + // No implementation required + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // CMmListBox::~CMmListBox() - { - delete iRedrawTimer; - } + { + delete iRedrawTimer; + } // ----------------------------------------------------------------------------- // @@ -67,30 +67,30 @@ // CMmListBox* CMmListBox::NewLC( const CCoeControl* aParent, TInt aFlags, CMmTemplateLibrary* aTemplateLibrary ) - { - CMmListBox* self = new (ELeave)CMmListBox(); - CleanupStack::PushL(self); - self->ConstructL( aParent, aFlags, aTemplateLibrary ); - return self; - } + { + CMmListBox* self = new (ELeave)CMmListBox(); + CleanupStack::PushL(self); + self->ConstructL( aParent, aFlags, aTemplateLibrary ); + return self; + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBox::SetListFlag( TInt aFlag ) - { - iListBoxFlags = iListBoxFlags | aFlag; - } + { + iListBoxFlags = iListBoxFlags | aFlag; + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBox::ClearListFlag( TInt aFlag ) - { - iListBoxFlags = iListBoxFlags & !aFlag; - } + { + iListBoxFlags = iListBoxFlags & !aFlag; + } // ----------------------------------------------------------------------------- // @@ -98,11 +98,11 @@ // CMmListBox* CMmListBox::NewL( const CCoeControl* aParent, TInt aFlags, CMmTemplateLibrary* aTemplateLibrary ) - { - CMmListBox* self = CMmListBox::NewLC( aParent, aFlags, aTemplateLibrary ); - CleanupStack::Pop( self ); - return self; - } + { + CMmListBox* self = CMmListBox::NewLC( aParent, aFlags, aTemplateLibrary ); + CleanupStack::Pop( self ); + return self; + } // ----------------------------------------------------------------------------- // @@ -110,9 +110,9 @@ // void CMmListBox::ConstructL( const CCoeControl* aParent, TInt aFlags, CMmTemplateLibrary* aTemplateLibrary ) - { - iDisableChildComponentDrawing = EFalse; - iModel = iMmModel = CMmListBoxModel::NewL(); + { + iDisableChildComponentDrawing = EFalse; + iModel = iMmModel = CMmListBoxModel::NewL(); CreateItemDrawerL( aTemplateLibrary ); EnableExtendedDrawingL(); @@ -121,7 +121,7 @@ CEikListBox::ConstructL(aParent,aFlags); iMmDrawer->SetView( this ); iRedrawTimer = CPeriodic::NewL( EPriorityRealTime ); - } + } // ----------------------------------------------------------------------------- // Clearing ELeftDownInViewRect flag before invoking the base class @@ -135,25 +135,35 @@ void CMmListBox::HandlePointerEventInEditModeL( const TPointerEvent& aPointerEvent ) { + CMmWidgetContainer* parent = static_cast( Parent() ); 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 ) { + TBool highlightWasVisible = parent->IsHighlightVisible(); CEikFormattedCellListBoxTypedef::HandlePointerEventL( aPointerEvent ); + // Tricky: Do not allow the base class implementation of HandlePointerEventL + // to remove the highlight on EButton1Up event when context menu + // is displayed for an item + if ( aPointerEvent.iType == TPointerEvent::EButton1Up && + highlightWasVisible && parent->LongTapInProgress() + && !parent->IsHighlightVisible() ) + { + ItemDrawer()->ClearFlags( CListItemDrawer::ESingleClickDisabledHighlight ); + } } else if ( View()->XYPosToItemIndex( aPointerEvent.iPosition, itemUnderPointerIndex ) ) @@ -200,7 +210,7 @@ const TPointerEvent& aPointerEvent ) const { TInt topScrollingTreshold = Rect().iTl.iY - + ( MmEffects::KFocusScrollingThreshold + + ( MmListBox::KFocusScrollingThreshold * TReal( View()->ItemSize().iHeight ) ); return ( aPointerEvent.iPosition.iY < topScrollingTreshold ); @@ -214,7 +224,7 @@ const TPointerEvent& aPointerEvent ) const { TInt bottomScrollingTreshold = Rect().iBr.iY - - ( MmEffects::KFocusScrollingThreshold + - ( MmListBox::KFocusScrollingThreshold * TReal( View()->ItemSize().iHeight ) ); return ( aPointerEvent.iPosition.iY > bottomScrollingTreshold ); @@ -227,50 +237,50 @@ TInt CMmListBox::ScrollIfNeeded( const TPointerEvent& aPointerEvent ) { TInt nextScrollDelay = 0; - - TBool readyForScrolling = - iMmDrawer->GetAnimator()->IsReadyForNewAnimation() - && iMmDrawer->GetFloatingItemCount() != 0; - - if ( IsPointerInTopScrollingThreshold( aPointerEvent ) ) - { - // scroll up by one row - TInt newCurrentItemIndex = CurrentItemIndex() - 1; + + TBool readyForScrolling = + iMmDrawer->GetAnimator()->IsReadyForNewAnimation() + && iMmDrawer->GetFloatingItemCount() != 0; - if ( newCurrentItemIndex >= 0 ) - { - nextScrollDelay = MmEffects::KEditModeScrollingDelayFactor * - Max( 1, aPointerEvent.iPosition.iY - Rect().iTl.iY ); - if (readyForScrolling) - { - View()->VScrollTo( View()->CalcNewTopItemIndexSoItemIsVisible( + if ( IsPointerInTopScrollingThreshold( aPointerEvent ) ) + { + // scroll up by one row + TInt newCurrentItemIndex = CurrentItemIndex() - 1; + + if ( newCurrentItemIndex >= 0 ) + { + nextScrollDelay = MmEffects::KEditModeScrollingDelayFactor * + Max( 1, aPointerEvent.iPosition.iY - Rect().iTl.iY ); + if (readyForScrolling) + { + View()->VScrollTo( View()->CalcNewTopItemIndexSoItemIsVisible( newCurrentItemIndex ) ); View()->SetCurrentItemIndex( newCurrentItemIndex ); UpdateScrollBarThumbs(); - } - } - } - else if ( IsPointerInBottomScrollingThreshold( aPointerEvent) ) - { - // scroll down by one row - TInt lastItemIndex = iModel->NumberOfItems() - 1; - TInt newCurrentItemIndex = CurrentItemIndex() + 1; - - - if ( newCurrentItemIndex <= lastItemIndex ) - { - nextScrollDelay = MmEffects::KEditModeScrollingDelayFactor * - Max( 1, Rect().iBr.iY - aPointerEvent.iPosition.iY ); + } + } + } + else if ( IsPointerInBottomScrollingThreshold( aPointerEvent) ) + { + // scroll down by one row + TInt lastItemIndex = iModel->NumberOfItems() - 1; + TInt newCurrentItemIndex = CurrentItemIndex() + 1; + - if (readyForScrolling) - { - View()->VScrollTo( View()->CalcNewTopItemIndexSoItemIsVisible( - newCurrentItemIndex ) ); - View()->SetCurrentItemIndex( newCurrentItemIndex ); + if ( newCurrentItemIndex <= lastItemIndex ) + { + nextScrollDelay = MmEffects::KEditModeScrollingDelayFactor * + Max( 1, Rect().iBr.iY - aPointerEvent.iPosition.iY ); + + if (readyForScrolling) + { + View()->VScrollTo( View()->CalcNewTopItemIndexSoItemIsVisible( + newCurrentItemIndex ) ); + View()->SetCurrentItemIndex( newCurrentItemIndex ); UpdateScrollBarThumbs(); - } - } - } + } + } + } return nextScrollDelay; } @@ -298,14 +308,9 @@ HandlePointerEventInEditModeL( aPointerEvent ); } else - { + { CEikFormattedCellListBoxTypedef::HandlePointerEventL( aPointerEvent ); - } - - if ( iMmDrawer->GetAnimator()->IsActive() ) - { - iMmDrawer->GetAnimator()->CancelNextRedrawL(); - } + } } @@ -373,7 +378,7 @@ // // ----------------------------------------------------------------------------- // -void CMmListBox::ProcessScrollEventL( CEikScrollBar* aScrollBar, +void CMmListBox::ProcessScrollEventL( CEikScrollBar* aScrollBar, TEikScrollEvent aEventType ) { CEikFormattedCellListBoxTypedef::HandleScrollEventL( @@ -384,7 +389,7 @@ // // ----------------------------------------------------------------------------- // -void CMmListBox::HandleRedrawTimerEvent() +void CMmListBox::HandleRedrawTimerEventL() { if ( iSkippedScrollbarEventsCount ) { @@ -393,7 +398,7 @@ } iSkippedScrollbarEventsCount = 0; } - + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -401,7 +406,9 @@ TInt CMmListBox::RedrawTimerCallback( TAny* aPtr ) { CMmListBox* self = static_cast( aPtr ); - self->HandleRedrawTimerEvent(); + TRAP_IGNORE( self->HandleRedrawTimerEventL() ); + // Do not bother returning a meaningful error code, CPeriodic will ignore it + // anyway. return 0; } @@ -422,32 +429,32 @@ + View()->ItemSize( currentItemIndex ).iHeight; if ( currentItemIndex == BottomItemIndex() - && currentItemIndex != previousItemIndex - && itemY > View()->ViewRect().iBr.iY ) - { - if( aType == EEventKey ) - { + && currentItemIndex != previousItemIndex + && itemY > View()->ViewRect().iBr.iY ) + { + if( aType == EEventKey ) + { #ifdef RD_UI_TRANSITION_EFFECTS_LIST - MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( - View()->ItemDrawer()->Gc() ); - TBool effects = transApi && !transApi->EffectsDisabled(); - if ( effects ) - { - transApi->SetMoveType( MAknListBoxTfxInternal::EListScrollDown ); - } + MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( + View()->ItemDrawer()->Gc() ); + TBool effects = transApi && !transApi->EffectsDisabled(); + if ( effects ) + { + transApi->SetMoveType( MAknListBoxTfxInternal::EListScrollDown ); + } #endif - iView->VScrollTo( - iView->CalcNewTopItemIndexSoItemIsVisible( currentItemIndex ) ); + iView->VScrollTo( + iView->CalcNewTopItemIndexSoItemIsVisible( currentItemIndex ) ); #ifdef RD_UI_TRANSITION_EFFECTS_LIST - if ( effects ) - { - transApi->Draw( Rect() ); - } + if ( effects ) + { + transApi->Draw( Rect() ); + } #endif - } - SetCurrentItemIndex( currentItemIndex ); - } + } + SetCurrentItemIndex( currentItemIndex ); + } RedrawIfNecessary( itemIndex, CurrentItemIndex()); return ret; @@ -496,13 +503,13 @@ if ( differenceIndex == 1 ) { if( sizeAllBefore != sizeAllAfter ) - { + { redrawIndex = Min( aPreviousCurrent, aCurrent ); - } + } else - { - return redrawConsumed; - } + { + return redrawConsumed; + } } else if ( differenceIndex > 1 && sizeAllBefore == sizeAllAfter ) { @@ -521,14 +528,14 @@ lastPotentialItemIndex = iView->BottomItemIndex(); if ( aPreviousCurrent < TopItemIndex() ) - { - lastPotentialItemIndex = BottomItemIndex() ; - } + { + lastPotentialItemIndex = BottomItemIndex() ; + } else if ( BottomItemIndex() < aPreviousCurrent ) - { - lastPotentialItemIndex = BottomItemIndex() + 1; - } - + { + lastPotentialItemIndex = BottomItemIndex() + 1; + } + while ( redrawIndex < lastPotentialItemIndex +1 ) { view->DrawSingleItem( redrawIndex++ ); @@ -558,22 +565,22 @@ // ----------------------------------------------------------------------------- // CMmListBoxModel* CMmListBox::MmModel() - { - return iMmModel; - } + { + return iMmModel; + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBox::SetMmModel( CMmListBoxModel* aMmModel ) - { - if ( iMmModel != aMmModel ) - { - delete iMmModel; - iMmModel = aMmModel; - } - } + { + if ( iMmModel != aMmModel ) + { + delete iMmModel; + iMmModel = aMmModel; + } + } // ----------------------------------------------------------------------------- // @@ -598,45 +605,45 @@ // ----------------------------------------------------------------------------- // void CMmListBox::SetItemDrawerAndViewBgContext (CAknsBasicBackgroundControlContext * aBgContext) - { - iMmDrawer->SetBgContext (aBgContext); - } + { + iMmDrawer->SetBgContext (aBgContext); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // TBool CMmListBox::HandleScrollbarVisibilityChangeL() - { - TBool ret = EFalse; - if ( AllItemsFitInViewRect() ) - { - if ( ScrollBarFrame()->VerticalScrollBar()->IsVisible() + { + TBool ret = EFalse; + if ( AllItemsFitInViewRect() ) + { + if ( ScrollBarFrame()->VerticalScrollBar()->IsVisible() || iMmDrawer->TemplateLibrary()->GetScrollbarVisibility() ) - { - ScrollBarFrame()->VerticalScrollBar()->MakeVisible( EFalse ); - iMmDrawer->SetScrollbarVisibilityL( EFalse ); + { + ScrollBarFrame()->VerticalScrollBar()->MakeVisible( EFalse ); + iMmDrawer->SetScrollbarVisibilityL( EFalse ); #ifdef RD_UI_TRANSITION_EFFECTS_LIST - MAknListBoxTfxInternal *trans = CAknListLoader::TfxApiInternal( ItemDrawer()->Gc() ); - if ( trans ) - { - trans->Remove( MAknListBoxTfxInternal::EListEverything ); - } + MAknListBoxTfxInternal *trans = CAknListLoader::TfxApiInternal( ItemDrawer()->Gc() ); + if ( trans ) + { + trans->Remove( MAknListBoxTfxInternal::EListEverything ); + } #endif - ret = ETrue; //redraw is needed - } - } - else if ( !ScrollBarFrame()->VerticalScrollBar()->IsVisible() - || !iMmDrawer->TemplateLibrary()->GetScrollbarVisibility() ) - { - ScrollBarFrame()->VerticalScrollBar()->MakeVisible( ETrue ); - iMmDrawer->SetScrollbarVisibilityL( ETrue ); - ret = ETrue; //redraw is needed - } - return ret; - } + ret = ETrue; //redraw is needed + } + } + else if ( !ScrollBarFrame()->VerticalScrollBar()->IsVisible() + || !iMmDrawer->TemplateLibrary()->GetScrollbarVisibility() ) + { + ScrollBarFrame()->VerticalScrollBar()->MakeVisible( ETrue ); + iMmDrawer->SetScrollbarVisibilityL( ETrue ); + ret = ETrue; //redraw is needed + } + return ret; + } // ----------------------------------------------------------------------------- @@ -644,23 +651,23 @@ // ----------------------------------------------------------------------------- // TBool CMmListBox::AllItemsFitInViewRect() - { - CMmListBoxView* view = static_cast< CMmListBoxView* >(iView); - TInt totalHeight = view->GetTotalHeight( view->TopItemIndex(), view->BottomItemIndex()); - if ( view->TopItemIndex() == 0 && iMmModel->NumberOfItems() <= view->BottomItemIndex() + 1 - && totalHeight <= iView->ViewRect().Height() ) - { - return ETrue; - } - else - { - return EFalse; - } - } + { + CMmListBoxView* view = static_cast< CMmListBoxView* >(iView); + TInt totalHeight = view->GetTotalHeight( view->TopItemIndex(), view->BottomItemIndex()); + if ( view->TopItemIndex() == 0 && iMmModel->NumberOfItems() <= view->BottomItemIndex() + 1 + && totalHeight <= iView->ViewRect().Height() ) + { + return ETrue; + } + else + { + return EFalse; + } + } /** * Helper class whose only purpose is to ensure that - * ScrollToItem method will be always re-enabled. + * ScrollToItem method will be always re-enabled. */ struct TScrollToItemEnabler { @@ -673,77 +680,77 @@ // ----------------------------------------------------------------------------- // void CMmListBox::UpdateScrollBarsL() - { - TBool redrawNeeded = HandleScrollbarVisibilityChangeL(); - if (ScrollBarFrame()->VerticalScrollBar()->IsVisible()) - { - CMmListBoxView* view = static_cast( View() ); - view->DisableScrollToItem( ETrue ); - TScrollToItemEnabler reverter = { view }; - CleanupClosePushL( reverter ); - CEikFormattedCellListBoxTypedef::UpdateScrollBarsL(); - CleanupStack::PopAndDestroy( &reverter ); - } - iMmDrawer->TemplateLibrary()->SetScrollbarWidthL( + { + TBool redrawNeeded = HandleScrollbarVisibilityChangeL(); + if (ScrollBarFrame()->VerticalScrollBar()->IsVisible()) + { + CMmListBoxView* view = static_cast( View() ); + view->DisableScrollToItem( ETrue ); + TScrollToItemEnabler reverter = { view }; + CleanupClosePushL( reverter ); + CEikFormattedCellListBoxTypedef::UpdateScrollBarsL(); + CleanupStack::PopAndDestroy( &reverter ); + } + iMmDrawer->TemplateLibrary()->SetScrollbarWidthL( ScrollBarFrame()->VerticalScrollBar()->Rect().Width() ); - FixViewForMirroredLayout(); - if ( redrawNeeded ) - { - DrawNow(); - } - } + FixViewForMirroredLayout(); + if ( redrawNeeded ) + { + DrawNow(); + } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBox::UpdateScrollBarsNoRedrawL() - { - HandleScrollbarVisibilityChangeL(); - if ( ScrollBarFrame()->VerticalScrollBar()->IsVisible() ) - { - CMmListBoxView* view = static_cast( View() ); - view->DisableScrollToItem( ETrue ); - TScrollToItemEnabler reverter = { view }; - CleanupClosePushL( reverter ); - CEikFormattedCellListBoxTypedef::UpdateScrollBarsL(); - CleanupStack::PopAndDestroy( &reverter ); - iMmDrawer->TemplateLibrary()->SetScrollbarWidthL( - ScrollBarFrame()->VerticalScrollBar()->Rect().Width() ); - } - } + { + HandleScrollbarVisibilityChangeL(); + if ( ScrollBarFrame()->VerticalScrollBar()->IsVisible() ) + { + CMmListBoxView* view = static_cast( View() ); + view->DisableScrollToItem( ETrue ); + TScrollToItemEnabler reverter = { view }; + CleanupClosePushL( reverter ); + CEikFormattedCellListBoxTypedef::UpdateScrollBarsL(); + CleanupStack::PopAndDestroy( &reverter ); + iMmDrawer->TemplateLibrary()->SetScrollbarWidthL( + ScrollBarFrame()->VerticalScrollBar()->Rect().Width() ); + } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBox::SetMarqueeAdapter( CMmMarqueeAdapter* aAdapter ) - { - iMarqueeAdapter = aAdapter; - iMarqueeAdapter->SetControl( const_cast< CMmListBox *>(this) ); - } + { + iMarqueeAdapter = aAdapter; + iMarqueeAdapter->SetControl( const_cast< CMmListBox *>(this) ); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBox::SetMarqueeDrawing( TBool aIsMarqueeBeingDrawn ) - { - iMmDrawer->SetMarqueeDrawing( aIsMarqueeBeingDrawn ); - } + { + iMmDrawer->SetMarqueeDrawing( aIsMarqueeBeingDrawn ); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBox::HandleItemRemovalL() - { - CEikFormattedCellListBoxTypedef::HandleItemRemovalL(); + { + CEikFormattedCellListBoxTypedef::HandleItemRemovalL(); DrawNow(); //avkon does not redraw the items for listbox when item is //removed. This needs to be forced here. UpdateScrollBarsL(); - } + } // ----------------------------------------------------------------------------- // If a parent to the supplied control has its Gc set, this function will find @@ -807,7 +814,7 @@ #ifdef RD_UI_TRANSITION_EFFECTS_LIST MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( gc ); - + if ( transApi ) { transApi->SetListType( MAknListBoxTfxInternal::EListBoxTypeMainPane ); @@ -830,7 +837,7 @@ { TRect clientRect; this->RestoreClientRectFromViewRect(clientRect); -#ifdef RD_UI_TRANSITION_EFFECTS_LIST +#ifdef RD_UI_TRANSITION_EFFECTS_LIST if ( transApi ) { transApi->StartDrawing( MAknListBoxTfxInternal::EListView ); @@ -871,7 +878,7 @@ // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// +// void CMmListBox::DrawView() { iDisableChildComponentDrawing = ETrue; @@ -884,41 +891,41 @@ // ----------------------------------------------------------------------------- // void CMmListBox::SetVerticalItemOffset( TInt aOffset ) - { - static_cast( View() )->SetItemOffsetInPixels( aOffset ); - UpdateScrollBarThumbs(); - } + { + static_cast( View() )->SetItemOffsetInPixels( aOffset ); + UpdateScrollBarThumbs(); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // TInt CMmListBox::VerticalItemOffset() const - { - return static_cast( View() )->VerticalItemOffset(); - } + { + return static_cast( View() )->VerticalItemOffset(); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBox::SetItemHeight( TInt aItemHeight ) - { - if ( aItemHeight != iItemHeight ) - { - iItemHeight = aItemHeight; - TRAP_IGNORE( UpdateScrollBarsNoRedrawL() ); - } - } + { + if ( aItemHeight != iItemHeight ) + { + iItemHeight = aItemHeight; + TRAP_IGNORE( UpdateScrollBarsNoRedrawL() ); + } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBox::UpdateScrollBarThumbs() - { - CEikFormattedCellListBox::UpdateScrollBarThumbs(); - } + { + CEikFormattedCellListBox::UpdateScrollBarThumbs(); + } // ----------------------------------------------------------------------------- // @@ -928,9 +935,9 @@ { TInt componentControls(0); if ( !iDisableChildComponentDrawing ) - { + { componentControls = CEikFormattedCellListBoxTypedef::CountComponentControls(); - } + } return componentControls; } // ----------------------------------------------------------------------------- @@ -946,7 +953,7 @@ // // ----------------------------------------------------------------------------- // -void CMmListBox::HandleScrollEventL( CEikScrollBar* aScrollBar, +void CMmListBox::HandleScrollEventL( CEikScrollBar* aScrollBar, TEikScrollEvent aEventType ) { if ( aEventType == EEikScrollThumbDragVert && !iScrollbarThumbIsBeingDragged ) diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp --- a/menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp Wed May 12 13:22:51 2010 +0300 @@ -1,22 +1,22 @@ /* -* 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: -* -*/ - + * 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: + * + */ #include +#include #include "mmwidgetsconstants.h" #include "hnconvutils.h" #include @@ -47,13 +47,13 @@ #include "mmmarqueeadapter.h" #include "mmfloatingitem.h" #include "mmgridview.h" +#include "mmlistboxview.h" #include "mmcacheforitem.h" #include "mmitemsdatacache.h" #include "mmwidgetcontainer.h" #include "hnsuitemodel.h" #include "menudebug.h" - // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -71,24 +71,25 @@ iTemplateLibrary = aTemplateLibrary; iMmModel = aMmListBoxModel; iRedrawBackground = ETrue; + iDrawSeparatorLines = EFalse; iZoomIconIndex = -1; iIconAnimationZoomRatio = 1; // this is needed to get iColors initialized on first use: iLastDrawnItemWasFloating = ETrue; SetFlags( CListItemDrawer::EDisableHighlight ); - } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // CMmListBoxItemDrawer::~CMmListBoxItemDrawer() - { - iFloatingItems.Close(); - delete iItemsDataCache; - delete iAnimator; - delete iSubcellText; - } + { + iFloatingItems.Close(); + delete iItemsDataCache; + delete iAnimator; + delete iSubcellText; + } // ----------------------------------------------------------------------------- // @@ -97,7 +98,7 @@ void CMmListBoxItemDrawer::EnableCachedDataUse( TBool aEnable ) { iUseCache = aEnable; - if ( aEnable ) + if( aEnable ) { RemoveFloatingItems(); } @@ -129,6 +130,7 @@ { iItemsDataCache->Invalidate(); // this is needed to get iColors initialized on first use: + iLastDrawnItemWasFloating = ETrue; } // ----------------------------------------------------------------------------- @@ -137,18 +139,18 @@ // CMmListBoxItemDrawer* CMmListBoxItemDrawer::NewLC( CMmListBoxModel* aMmListBoxModel, - const CFont* aFont, - CFormattedCellListBoxData* aFormattedCellData, - TMmWidgetType aWidgetType, - CMmTemplateLibrary* aTemplateLibrary ) - { - CMmListBoxItemDrawer* self = new (ELeave)CMmListBoxItemDrawer( - aMmListBoxModel, aFont, aFormattedCellData, aWidgetType, - aTemplateLibrary ); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } + const CFont* aFont, + CFormattedCellListBoxData* aFormattedCellData, + TMmWidgetType aWidgetType, + CMmTemplateLibrary* aTemplateLibrary ) + { + CMmListBoxItemDrawer* self = new ( ELeave ) CMmListBoxItemDrawer( + aMmListBoxModel, aFont, aFormattedCellData, aWidgetType, + aTemplateLibrary ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } // ----------------------------------------------------------------------------- // @@ -156,24 +158,24 @@ // CMmListBoxItemDrawer* CMmListBoxItemDrawer::NewL( CMmListBoxModel* aMmListBoxModel, - const CFont* aFont, - CFormattedCellListBoxData* aFormattedCellData, - TMmWidgetType aWidgetType, - CMmTemplateLibrary* aTemplateLibrary ) - { - CMmListBoxItemDrawer* self = CMmListBoxItemDrawer::NewLC( - aMmListBoxModel, aFont, aFormattedCellData, aWidgetType, - aTemplateLibrary ); - CleanupStack::Pop( self ); - return self; + const CFont* aFont, + CFormattedCellListBoxData* aFormattedCellData, + TMmWidgetType aWidgetType, + CMmTemplateLibrary* aTemplateLibrary ) + { + CMmListBoxItemDrawer* self = CMmListBoxItemDrawer::NewLC( + aMmListBoxModel, aFont, aFormattedCellData, aWidgetType, + aTemplateLibrary ); + CleanupStack::Pop( self ); + return self; - } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // -void CMmListBoxItemDrawer::SetView(CEikListBox * aView) +void CMmListBoxItemDrawer::SetView( CEikListBox * aView ) { iWidget = aView; } @@ -192,40 +194,40 @@ // ----------------------------------------------------------------------------- // void CMmListBoxItemDrawer::ConstructL() - { - iAnimator = CMmDrawerAnimator::NewL( *this ); - iItemsDataCache = CMmItemsDataCache::NewL(); - iIsEditMode = EFalse; - iHighlightShown = EFalse; - iDrawMoveIndicators = ETrue; - } + { + iAnimator = CMmDrawerAnimator::NewL( *this ); + iItemsDataCache = CMmItemsDataCache::NewL(); + iIsEditMode = EFalse; + iHighlightShown = EFalse; + iDrawMoveIndicators = ETrue; + } -// ----xm------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBoxItemDrawer::DrawEmptyItem( TInt aItemIndex, - TPoint aItemRectPos, TBool aViewIsDimmed ) const + TPoint aItemRectPos, TBool aViewIsDimmed ) const { TRect r( aItemRectPos, iItemCellSize ); CFormattedCellListBoxItemDrawer::DrawEmptyItem( aItemIndex, aItemRectPos, aViewIsDimmed ); - const_cast(this)->DrawFloatingItems(r); + const_cast ( this )->DrawFloatingItems( r ); } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // -TInt CMmListBoxItemDrawer::GetFloatingItemIndex(TMmFloatingItemType aType) const +TInt CMmListBoxItemDrawer::GetFloatingItemIndex( TMmFloatingItemType aType ) const { - TInt ret (KErrNotFound); - TInt i(iFloatingItems.Count()-1); - for(; i >= 0; i--) + TInt ret( KErrNotFound ); + TInt i( iFloatingItems.Count() - 1 ); + for( ; i >= 0; i-- ) { - if (iFloatingItems[i].GetFloatingItemType() == aType) + if( iFloatingItems[i].GetFloatingItemType() == aType ) { ret = i; break; @@ -241,9 +243,9 @@ // TMmFloatingItem& CMmListBoxItemDrawer::GetFloatingItemL(TMmFloatingItemType aType) { - TInt index = GetFloatingItemIndex(aType); + TInt index = GetFloatingItemIndex( aType ); User::LeaveIfError( index ); - return iFloatingItems[ index ]; + return iFloatingItems[index]; } // ----------------------------------------------------------------------------- @@ -274,6 +276,7 @@ { iAnimator->AnimateItemZoomL( aItemIndex, ETrue ); iAnimator->Trigger(); + static_cast (Widget()->Parent() )->SetAllowMove( EFalse ); } // ----------------------------------------------------------------------------- @@ -290,43 +293,44 @@ // // ----------------------------------------------------------------------------- // -void CMmListBoxItemDrawer::DrawFloatingItems(TRect currentlyDrawnRect) +void CMmListBoxItemDrawer::DrawFloatingItems( TRect currentlyDrawnRect ) { + TBool redrawItemBackground = IsRedrawItemBackgroundEnabled(); SetRedrawItemBackground( EFalse ); - for(TInt i(iFloatingItems.Count()-1); i >= 0 ; i--) + for( TInt i( iFloatingItems.Count() - 1 ); i >= 0; i-- ) { TMmFloatingItemType type = iFloatingItems[i].GetFloatingItemType(); - if ( iFloatingItems[i].IsFloatingItemValid() ) + if( iFloatingItems[i].IsFloatingItemValid() ) { TInt drawnItemIndex = iFloatingItems[i].GetDrawnItemIndex(); TSize size = iWidget->View()->ItemSize( drawnItemIndex ); TRect rect( iFloatingItems[i].GetItemPosition(), iFloatingItems[i].GetItemPosition() + size); - if (rect.Intersects(currentlyDrawnRect)) - { - TInt tempZoomIconIndex = iZoomIconIndex; - TInt tempZoomRatio = iIconAnimationZoomRatio; + if( rect.Intersects( currentlyDrawnRect ) ) + { + TInt tempZoomIconIndex = iZoomIconIndex; + TInt tempZoomRatio = iIconAnimationZoomRatio; - iZoomIconIndex = iFloatingItems[i].GetDrawnItemIndex(); - iIconAnimationZoomRatio = iFloatingItems[i].GetCurrentZoomRatio(); + iZoomIconIndex = iFloatingItems[i].GetDrawnItemIndex(); + iIconAnimationZoomRatio = iFloatingItems[i].GetCurrentZoomRatio(); - if ( ItemHasFloatingType( drawnItemIndex, EDrag) || - ItemHasFloatingType( drawnItemIndex, EDragTransition) ) - { - ClearFlags( CListItemDrawer::EPressedDownState ); - } + if ( ItemHasFloatingType( drawnItemIndex, EDrag) || + ItemHasFloatingType( drawnItemIndex, EDragTransition) ) + { + ClearFlags( CListItemDrawer::EPressedDownState ); + } - DrawActualItem( drawnItemIndex, rect, ETrue, EFalse, EFalse, EFalse ); - iIconAnimationZoomRatio = tempZoomRatio; - iZoomIconIndex = tempZoomIconIndex; - } + DrawActualItem( drawnItemIndex, rect, ETrue, EFalse, EFalse, EFalse ); + iIconAnimationZoomRatio = tempZoomRatio; + iZoomIconIndex = tempZoomIconIndex; + } } else - { - iFloatingItems.Remove(i); - } + { + iFloatingItems.Remove( i ); + } } - SetRedrawItemBackground( ETrue ); + SetRedrawItemBackground( redrawItemBackground ); } // ----------------------------------------------------------------------------- @@ -335,11 +339,11 @@ // TInt CMmListBoxItemDrawer::GetValidFloatingItemCount(TMmFloatingItemType aType) { - TInt count (0); + TInt count( 0 ); - for(TInt i(iFloatingItems.Count()-1); i >= 0; i--) + for( TInt i( iFloatingItems.Count() - 1 ); i >= 0; i-- ) { - if (iFloatingItems[i].GetFloatingItemType() == aType + if( iFloatingItems[i].GetFloatingItemType() == aType && iFloatingItems[i].IsFloatingItemValid() ) count++; } @@ -349,19 +353,19 @@ // // ----------------------------------------------------------------------------- // -void CMmListBoxItemDrawer::DrawItem(TInt aItemIndex, TPoint aItemRectPos, +void CMmListBoxItemDrawer::DrawItem( TInt aItemIndex, TPoint aItemRectPos, TBool aItemIsSelected, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aViewIsDimmed) const + { + if( !Widget()->View()->RedrawDisabled() ) { - if ( !Widget()->View()->RedrawDisabled() ) - { - TBool highlightVisible = + TBool highlightVisible = !( Flags() & CListItemDrawer::ESingleClickDisabledHighlight ); - aItemIsCurrent = aItemIsCurrent && highlightVisible; - DoDrawItem( aItemIndex, aItemRectPos, aItemIsSelected, - aItemIsCurrent, aViewIsEmphasized, aViewIsDimmed); - } + aItemIsCurrent = aItemIsCurrent && highlightVisible; + DoDrawItem( aItemIndex, aItemRectPos, aItemIsSelected, + aItemIsCurrent, aViewIsEmphasized, aViewIsDimmed ); } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -370,25 +374,25 @@ TBool aItemIsSelected, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aViewIsDimmed) const { - TSize itemCellSize = TSize( GetItemSize( aItemIndex, aItemIsCurrent )); - TRect actualItemRect(aItemRectPos, itemCellSize); + TSize itemCellSize = TSize( GetItemSize( aItemIndex, aItemIsCurrent ) ); + TRect actualItemRect( aItemRectPos, itemCellSize ); #ifdef RD_UI_TRANSITION_EFFECTS_LIST - MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( iGc ); - if ( transApi ) - { - transApi->StartDrawing( MAknListBoxTfxInternal::EListView ); - transApi->StopDrawing(); - transApi->BeginRedraw( MAknListBoxTfxInternal::EListItem, - actualItemRect, aItemIndex ); - } + MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( iGc ); + if( transApi ) + { + transApi->StartDrawing( MAknListBoxTfxInternal::EListView ); + transApi->StopDrawing(); + transApi->BeginRedraw( MAknListBoxTfxInternal::EListItem, + actualItemRect, aItemIndex ); + } #endif const_cast(this)->iLeftOverAreaUnderAnimatedItem = EFalse; - for(TInt i(iFloatingItems.Count()-1); i >= 0; i--) + for( TInt i( iFloatingItems.Count() - 1 ); i >= 0; i-- ) { - if ( iFloatingItems[i].GetDrawnItemIndex() == aItemIndex - && iFloatingItems[i].IsFloatingItemValid() ) + if( iFloatingItems[i].GetDrawnItemIndex() == aItemIndex + && iFloatingItems[i].IsFloatingItemValid() ) { const_cast(this)->iLeftOverAreaUnderAnimatedItem = ETrue; break; @@ -396,20 +400,20 @@ } DrawActualItem(aItemIndex, actualItemRect, aItemIsCurrent, aViewIsEmphasized, - aViewIsDimmed, aItemIsSelected); + aViewIsDimmed, aItemIsSelected); const_cast(this)->iLeftOverAreaUnderAnimatedItem = EFalse; const_cast(this)->DrawFloatingItems(actualItemRect); - if (!AknLayoutUtils::PenEnabled() && IsEditMode()) + if( !AknLayoutUtils::PenEnabled() && IsEditMode() ) { - const_cast(this)->DrawActualIndicatorItem( - aItemIndex, actualItemRect ); + const_cast ( this )->DrawActualIndicatorItem( + aItemIndex, actualItemRect ); } #ifdef RD_UI_TRANSITION_EFFECTS_LIST - if ( transApi ) - { + if( transApi ) + { transApi->EndRedraw( MAknListBoxTfxInternal::EListItem, aItemIndex ); } #endif @@ -421,12 +425,12 @@ // // ----------------------------------------------------------------------------- // -void CMmListBoxItemDrawer::DrawItemText(TInt aItemIndex, - const TRect &aItemTextRect, TBool aItemIsCurrent, - TBool aViewIsEmphasized, TBool aItemIsSelected ) const +void CMmListBoxItemDrawer::DrawItemText( TInt aItemIndex, + const TRect &aItemTextRect, TBool aItemIsCurrent, + TBool aViewIsEmphasized, TBool aItemIsSelected ) const { TRAP_IGNORE( DoDrawItemTextL( aItemIndex, aItemTextRect, aItemIsCurrent, - aViewIsEmphasized, aItemIsSelected ) ); + aViewIsEmphasized, aItemIsSelected ) ); } // ----------------------------------------------------------------------------- @@ -434,16 +438,16 @@ // ----------------------------------------------------------------------------- // void CMmListBoxItemDrawer::DoDrawItemTextL( TInt aItemIndex, const TRect - &aItemTextRect, TBool aItemIsCurrent, TBool aViewIsEmphasized, - TBool /* aItemIsSelected */) const + &aItemTextRect, TBool aItemIsCurrent, TBool aViewIsEmphasized, + TBool /* aItemIsSelected */) const { CMmCacheForItem* cache = iItemsDataCache->GetItemCacheL( aItemIndex ); cache->InvalidateIfCacheMayNotBeUsed( aItemIsCurrent, iLastSubcellsSetupCode ); - if ( IsRedrawItemBackgroundEnabled() ) + if( IsRedrawItemBackgroundEnabled() ) { - DrawBackgroundAndSeparatorLines( aItemTextRect ); + DrawBackground( aItemTextRect ); } if ( !iUseCache || !cache->IsValid() ) @@ -454,54 +458,63 @@ FormattedCellData()->SetIconArray( cache->GetIconListL() ); - TBool isFloating = !iUseCache && IsFloating( aItemIndex ); - if ( !!isFloating != !!iLastDrawnItemWasFloating ) // Ex-OR - { - iLastDrawnItemWasFloating = isFloating; - iColors = SetupColors( isFloating ); - } + TBool isFloating = !iUseCache && IsFloating( aItemIndex ); + if( !!isFloating != !!iLastDrawnItemWasFloating ) // Ex-OR + { + iLastDrawnItemWasFloating = isFloating; + iColors = SetupColors( isFloating ); + } - CFormattedCellListBoxData* data = static_cast(iData); - data->EnableMarqueeL( EFalse ); + CFormattedCellListBoxData* data = static_cast(iData); + data->EnableMarqueeL( EFalse ); TBool highlightShown = ETrue; - if (FormattedCellData()->RespectFocus() && !aViewIsEmphasized) - { + if( FormattedCellData()->RespectFocus() && !aViewIsEmphasized ) + { #ifdef RD_UI_TRANSITION_EFFECTS_LIST - MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iGc ); - if ( transApi ) - { - transApi->Remove( MAknListBoxTfxInternal::EListHighlight ); - } + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iGc ); + if( transApi ) + { + transApi->Remove( MAknListBoxTfxInternal::EListHighlight ); + } #endif - highlightShown = EFalse; - } + highlightShown = EFalse; + } data->Draw( Properties(aItemIndex), *iGc, &( cache->GetItemText() ), aItemTextRect, - GetHighlightVisibility( aItemIndex, aItemIsCurrent, highlightShown ), iColors ); + GetHighlightVisibility( aItemIndex, aItemIsCurrent, highlightShown ), iColors ); #ifdef RD_UI_TRANSITION_EFFECTS_LIST - MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iGc ); - if ( transApi ) - { - transApi->StartDrawing( MAknListBoxTfxInternal::EListItem ); - } + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iGc ); + if( transApi ) + { + transApi->StartDrawing( MAknListBoxTfxInternal::EListItem ); + } #endif - if ( iMarqueeAdapter && aItemIsCurrent ) - { - DEBUG(("CMmListBoxItemDrawer::DoDrawItemTextL - DrawMarquee")); - iMarqueeAdapter->DrawMarqueeL( *iGc ); - } + if( iMarqueeAdapter && aItemIsCurrent ) + { + DEBUG(("CMmListBoxItemDrawer::DoDrawItemTextL - DrawMarquee")); + iMarqueeAdapter->DrawMarqueeL( *iGc ); + } #ifdef RD_UI_TRANSITION_EFFECTS_LIST - if ( transApi ) - { - transApi->StopDrawing(); - } + if( transApi ) + { + transApi->StopDrawing(); + } #endif - ColumnData()->SetIconArray( NULL ); + if( iDrawSeparatorLines ) + { + CMmListBoxView* view = static_cast( iWidget->View() ); + if( aItemIndex != ( view->ModelItemsCount() - 1 )) + { + AknListUtils::DrawSeparator( *iGc, aItemTextRect, iColors.iBack ); + } + } + ColumnData()->SetIconArray( NULL ); + } // ----------------------------------------------------------------------------- @@ -517,29 +530,42 @@ // // ----------------------------------------------------------------------------- // +void CMmListBoxItemDrawer::SetDrawSeparatorLines( TBool aDraw ) + { + iDrawSeparatorLines = aDraw; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// TBool CMmListBoxItemDrawer::IsRedrawItemBackgroundEnabled() const { return iRedrawBackground; } -void CMmListBoxItemDrawer::DrawBackgroundAndSeparatorLines( const TRect& aItemTextRect ) const +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::DrawBackground( const TRect& aItemTextRect ) const { MAknsSkinInstance *skin = AknsUtils::SkinInstance(); CCoeControl* control = FormattedCellData()->Control(); - if ( IsRedrawItemBackgroundEnabled() ) + if( IsRedrawItemBackgroundEnabled() ) { #ifdef RD_UI_TRANSITION_EFFECTS_LIST - MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iGc ); - if ( transApi ) + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iGc ); + if( transApi ) { transApi->StartDrawing( MAknListBoxTfxInternal::EListView ); } #endif TBool bgDrawn( EFalse ); - if ( control ) + if( control ) { - if ( CAknEnv::Static()->TransparencyEnabled() ) + if( CAknEnv::Static()->TransparencyEnabled() ) { bgDrawn = AknsDrawUtils::Background( skin, iBgContext, control, *iGc, aItemTextRect, @@ -553,12 +579,12 @@ KAknsDrawParamBottomLevelRGBOnly ); } } - if ( !bgDrawn ) + if( !bgDrawn ) { iGc->Clear( aItemTextRect ); } #ifdef RD_UI_TRANSITION_EFFECTS_LIST - if ( transApi ) + if( transApi ) { transApi->StopDrawing(); } @@ -594,7 +620,7 @@ ItemCellSize().iHeight * iIconAnimationZoomRatio); aSubCellTemplate.iRectAccordingToParent.iTl = TPoint(0, 0); - SetupSubCellL( aSubCellTemplate, aIndex , aItemIndex); + SetupSubCellL( aSubCellTemplate, aIndex, aItemIndex ); } // ----------------------------------------------------------------------------- @@ -602,72 +628,72 @@ // ----------------------------------------------------------------------------- // void CMmListBoxItemDrawer::SetupSubCellL( TTemplateChild aSubCellTemplate, - TInt aIndex, TInt aItemIndex ) const - { + TInt aIndex, TInt aItemIndex ) const + { CFormattedCellListBoxData* data = static_cast(iData); TInt width = aSubCellTemplate.iRectAccordingToParent.iBr.iX - aSubCellTemplate.iRectAccordingToParent.iTl.iX; TInt height = aSubCellTemplate.iRectAccordingToParent.iBr.iY - aSubCellTemplate.iRectAccordingToParent.iTl.iY; - data->SetTransparentSubCellL(aIndex, ETrue); - data->SetSubCellSizeL( aIndex, TSize(width,height)); - data->SetSubCellIconSize( aIndex, TSize(width,height) ); - data->SetSubCellPositionL( aIndex, aSubCellTemplate.iRectAccordingToParent.iTl); - data->SetGraphicsSubCellL( aIndex, aSubCellTemplate.iIsImage ); - data->SetSubCellAlignmentL( aIndex, aSubCellTemplate.iTextAlign ); - const CFont* font = AknLayoutUtils::FontFromId(aSubCellTemplate.iFontId); - data->SetSubCellFontL (aIndex, font); - data->SetSubCellBaselinePosL( aIndex, - CAknLayoutFont::AsCAknLayoutFontOrNull( font )->TextPaneTopToBaseline() - + aSubCellTemplate.iRectAccordingToParent.iTl.iY ); + data->SetTransparentSubCellL( aIndex, ETrue ); + data->SetSubCellSizeL( aIndex, TSize( width, height ) ); + data->SetSubCellIconSize( aIndex, TSize( width, height ) ); + data->SetSubCellPositionL( aIndex, aSubCellTemplate.iRectAccordingToParent.iTl); + data->SetGraphicsSubCellL( aIndex, aSubCellTemplate.iIsImage ); + data->SetSubCellAlignmentL( aIndex, aSubCellTemplate.iTextAlign ); + const CFont* font = AknLayoutUtils::FontFromId(aSubCellTemplate.iFontId); + data->SetSubCellFontL (aIndex, font); + data->SetSubCellBaselinePosL( aIndex, + CAknLayoutFont::AsCAknLayoutFontOrNull( font )->TextPaneTopToBaseline() + + aSubCellTemplate.iRectAccordingToParent.iTl.iY ); -// If some text is clipped then marquee will do the drawing right after the subcell is drawn by ListBoxData. -// Setting the subcell size to zero prevents ListBoxData from drawing the text. - if (!aSubCellTemplate.iIsImage - && !iIsMarqueeBeingDrawn - && ( aItemIndex == iWidget->View()->CurrentItemIndex() ) - && !IsEditMode() - && iWidgetType == EListbox - && iSubcellText + // If some text is clipped then marquee will do the drawing right after the subcell is drawn by ListBoxData. + // Setting the subcell size to zero prevents ListBoxData from drawing the text. + if (!aSubCellTemplate.iIsImage + && !iIsMarqueeBeingDrawn + && ( aItemIndex == iWidget->View()->CurrentItemIndex() ) + && !IsEditMode() + && iWidgetType == EListbox + && iSubcellText && iMarqueeAdapter->IsMarqueeEnabled() ) - { - if (iMarqueeAdapter && IsTextClippedL( aSubCellTemplate, *iSubcellText ) - && STATIC_CAST(CMmWidgetContainer*,Widget()->Parent())->IsHighlightVisible() ) - { - data->SetSubCellSizeL( aIndex, TSize(0,0)); - const_cast(this)->AddSubcellMarqueeElementL( - aSubCellTemplate, aIndex, aItemIndex); - } - else if (iMarqueeAdapter) + { + if (iMarqueeAdapter && IsTextClippedL( aSubCellTemplate, *iSubcellText ) + && STATIC_CAST(CMmWidgetContainer*,Widget()->Parent())->IsHighlightVisible() ) { - iMarqueeAdapter->StopMarqueeDrawing(aIndex); + data->SetSubCellSizeL( aIndex, TSize( 0, 0 ) ); + const_cast ( this )->AddSubcellMarqueeElementL( + aSubCellTemplate, aIndex, aItemIndex ); } - } + else if( iMarqueeAdapter ) + { + iMarqueeAdapter->StopMarqueeDrawing( aIndex ); + } + } - if ( iMarqueeAdapter && iIsMarqueeBeingDrawn - && iMarqueeAdapter->SubcellMarqueeElementExists( aIndex ) ) - { - if (aItemIndex != iWidget->View()->CurrentItemIndex() ) + if( iMarqueeAdapter && iIsMarqueeBeingDrawn + && iMarqueeAdapter->SubcellMarqueeElementExists( aIndex ) ) + { + if( aItemIndex != iWidget->View()->CurrentItemIndex() ) { - iMarqueeAdapter->StopMarqueeDrawing(aIndex); + iMarqueeAdapter->StopMarqueeDrawing( aIndex ); } - else - { - data->SetSubCellSizeL(aIndex, TSize(0, 0)); - } + else + { + data->SetSubCellSizeL( aIndex, TSize( 0, 0 ) ); + } } - } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // CFormattedCellListBoxData::TColors CMmListBoxItemDrawer::SetupColors( TBool aDragged ) const - { - CFormattedCellListBoxData::TColors colors; - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + { + CFormattedCellListBoxData::TColors colors; + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - if ( !aDragged ) - { + if( !aDragged ) + { AknsUtils::GetCachedColor( skin, colors.iText, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG9 ); AknsUtils::GetCachedColor( skin, colors.iBack , KAknsIIDQsnTextColors, @@ -676,9 +702,9 @@ KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG11 ); AknsUtils::GetCachedColor( skin, colors.iHighlightedBack, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ); - } - else - { + } + else + { AknsUtils::GetCachedColor( skin, colors.iText, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG11 ); AknsUtils::GetCachedColor( skin, colors.iBack , KAknsIIDQsnTextColors, @@ -687,10 +713,10 @@ KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG11 ); AknsUtils::GetCachedColor( skin, colors.iHighlightedBack, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ); - } + } - return colors; - } + return colors; + } // ----------------------------------------------------------------------------- // @@ -698,8 +724,8 @@ // TInt CMmListBoxItemDrawer::GetItemHeight( TInt aItemIndex, TBool aItemIsCurrent ) const { - TSize ret(TInt(0),TInt(0)); - ret = GetItemSize(aItemIndex, aItemIsCurrent); + TSize ret( TInt( 0 ), TInt( 0 ) ); + ret = GetItemSize( aItemIndex, aItemIsCurrent ); return ret.iHeight; } @@ -709,14 +735,14 @@ // TInt CMmListBoxItemDrawer::GetFloatingItemCount() { - for( TInt i=0; i< iFloatingItems.Count(); i++) - { - TMmFloatingItem& current = GetFloatingItemAtIndex(i); - if (current.GetDrawnItemIndex() == KErrNotFound) - { - RemoveFloatingItem(i); - } - } + for( TInt i = 0; i < iFloatingItems.Count(); i++ ) + { + TMmFloatingItem& current = GetFloatingItemAtIndex( i ); + if( current.GetDrawnItemIndex() == KErrNotFound ) + { + RemoveFloatingItem( i ); + } + } return iFloatingItems.Count(); } @@ -727,7 +753,7 @@ // TMmFloatingItem& CMmListBoxItemDrawer::GetFloatingItemAtIndex( TInt aIndex ) { - return iFloatingItems[ aIndex ]; + return iFloatingItems[aIndex]; } // ----------------------------------------------------------------------------- @@ -736,10 +762,10 @@ // void CMmListBoxItemDrawer::RemoveFloatingItem( TInt aPosition ) { - if (aPosition != KErrNotFound) - { - iFloatingItems.Remove( aPosition ); - } + if( aPosition != KErrNotFound ) + { + iFloatingItems.Remove( aPosition ); + } } // ----------------------------------------------------------------------------- @@ -759,7 +785,7 @@ TInt aPosition ) { EnableCachedDataUse( EFalse ); - if (aPosition != KErrNotFound) + if( aPosition != KErrNotFound ) { iFloatingItems.InsertL( aFloatingItem, aPosition ); } @@ -775,50 +801,40 @@ // TSize CMmListBoxItemDrawer::GetItemSize( TInt aItemIndex, TBool aItemIsCurrent ) const { - if ( aItemIndex < 0 ) + if( aItemIndex < 0 ) { return TSize( 1, 1 ); } - TSize size; + TSize size; - CMmCacheForItem* cache = NULL; - TRAPD( cacheError, cache = iItemsDataCache->GetItemCacheL( aItemIndex ) ); - if ( cacheError != KErrNone ) - { - cache = NULL; - } + CMmCacheForItem* cache = NULL; + TRAPD( cacheError, cache = iItemsDataCache->GetItemCacheL( aItemIndex ) ); + if( cacheError != KErrNone ) + { + cache = NULL; + } - if ( cache ) - { - cache->InvalidateIfCacheMayNotBeUsed( - aItemIsCurrent, iLastSubcellsSetupCode ); - } + if( cache ) + { + cache->InvalidateIfCacheMayNotBeUsed( + aItemIsCurrent, iLastSubcellsSetupCode ); + } - if ( !iUseCache || !cache || !cache->IsValid() ) + if( !iUseCache || !cache || !cache->IsValid() ) { const TDesC8& mm_template = iMmModel->GetAttributeAsText (aItemIndex, KMmTemplate8); TRect viewRect = iWidget->View()->ViewRect(); + TBool landscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation(); - TBool landscapeOrientation = viewRect.Width() > viewRect.Height(); - // Layout_Meta_Data::IsLandscapeOrientation cannot be used here because it - // might happen that GetSize (this method) gets called immediately after - // layout change but before AppUi calls SetRect on the container of iWidget - // (Layout_Meta_Data::IsLandscapeOrientation always reflects the current state, - // whereas ViewRect might sometimes be out of date). - // In such situation iTemplateLibrary->GetSize (called just below) would - // cause the template library to fill the internal cache for landscape mode - // with parameters calculated according to the outdated ViewRect. - - - if ( iTemplateLibrary->GetSize( size, iWidgetType, mm_template, + if( iTemplateLibrary->GetSize( size, iWidgetType, mm_template, landscapeOrientation, aItemIsCurrent, viewRect ) != KErrNone ) { size = TSize( 1, 1 ); } - if ( cache ) + if( cache ) { cache->SetSize( size ); } @@ -851,19 +867,19 @@ void CMmListBoxItemDrawer::SetDraggableL( TBool aDraggable ) { - iDraggable = aDraggable; + iDraggable = aDraggable; - if (!iDraggable) + if( !iDraggable ) { - for(int i=0; i< iFloatingItems.Count(); i++) + for( int i = 0; i < iFloatingItems.Count(); i++ ) { - if (iFloatingItems[i].GetFloatingItemType() == EZoomTransition - && iFloatingItems[i].GetZoomingStatus() > 0) + if( iFloatingItems[i].GetFloatingItemType() == EZoomTransition + && iFloatingItems[i].GetZoomingStatus() > 0 ) { AnimateItemZoomOutL( iFloatingItems[i].GetDrawnItemIndex() ); } - else if (iFloatingItems[i].GetFloatingItemType() == EDrag - || iFloatingItems[i].IsManualDelete()) + else if( iFloatingItems[i].GetFloatingItemType() == EDrag + || iFloatingItems[i].IsManualDelete() ) { iFloatingItems[i].InvalidateFloatingItem(); } @@ -877,7 +893,7 @@ // void CMmListBoxItemDrawer::SetEditModeL( TBool aEditMode ) { - if ( aEditMode ) + if( aEditMode ) { EnableCachedDataUse( EFalse ); } @@ -897,9 +913,9 @@ // ----------------------------------------------------------------------------- // TBool CMmListBoxItemDrawer::IsEditMode() const - { - return iIsEditMode; - } + { + return iIsEditMode; + } // ----------------------------------------------------------------------------- // @@ -925,58 +941,58 @@ floatingItem.SetManualDelete( ETrue ); TMmFloatingItem postDragRefresh( item.GetDrawnItemIndex(), - item.GetItemPosition(), EPostDragRefreshItem, - MmEffects::KNoAnimationFramesCount, iWidget->View() ); + item.GetItemPosition(), EPostDragRefreshItem, + MmEffects::KNoAnimationFramesCount, iWidget->View() ); - iFloatingItems.Remove(dragFloatingItem); + iFloatingItems.Remove( dragFloatingItem ); - if (postDragRefresh.GetItemPosition() != floatingItem.GetItemPosition()) - { - iFloatingItems.Append( postDragRefresh ); - } - iFloatingItems.Insert( floatingItem, 0 ); - } - } + if (postDragRefresh.GetItemPosition() != floatingItem.GetItemPosition()) + { + iFloatingItems.Append( postDragRefresh ); + } + iFloatingItems.Insert( floatingItem, 0 ); + } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // -void CMmListBoxItemDrawer::SetDraggedIndexL(TInt aDraggedItemIndex, - TPoint aPoint) +void CMmListBoxItemDrawer::SetDraggedIndexL( TInt aDraggedItemIndex, + TPoint aPoint ) { TInt dragFloatingItem = KErrNotFound; do - { - dragFloatingItem = GetFloatingItemIndex(EDrag); - if (dragFloatingItem != KErrNotFound) - { - TMmFloatingItem & item = GetFloatingItemAtIndex( dragFloatingItem ); + { + dragFloatingItem = GetFloatingItemIndex( EDrag ); + if( dragFloatingItem != KErrNotFound ) + { + TMmFloatingItem & item = GetFloatingItemAtIndex( dragFloatingItem ); - TMmFloatingItem postDragRefresh( item.GetDrawnItemIndex(), - item.GetItemPosition(), EPostDragRefreshItem, - MmEffects::KNoAnimationFramesCount, iWidget->View() ); + TMmFloatingItem postDragRefresh( item.GetDrawnItemIndex(), + item.GetItemPosition(), EPostDragRefreshItem, + MmEffects::KNoAnimationFramesCount, iWidget->View() ); - if (postDragRefresh.GetItemPosition() != aPoint) - { - iFloatingItems.Append( postDragRefresh ); - } - } + if( postDragRefresh.GetItemPosition() != aPoint ) + { + iFloatingItems.Append( postDragRefresh ); + } + } - RemoveFloatingItem( dragFloatingItem ); + RemoveFloatingItem( dragFloatingItem ); - } - while ( dragFloatingItem != KErrNotFound ); + } + while( dragFloatingItem != KErrNotFound ); - if ( aDraggedItemIndex != KErrNotFound ) - { - TMmFloatingItem floatingItem( aDraggedItemIndex, aPoint, EDrag, - MmEffects::KNoAnimationFramesCount, iWidget->View() ); - floatingItem.SetManualDelete( ETrue ); - AddFloatingItemL(floatingItem, 0); + if( aDraggedItemIndex != KErrNotFound ) + { + TMmFloatingItem floatingItem( aDraggedItemIndex, aPoint, EDrag, + MmEffects::KNoAnimationFramesCount, iWidget->View() ); + floatingItem.SetManualDelete( ETrue ); + AddFloatingItemL( floatingItem, 0 ); - ClearFlags( CListItemDrawer::EPressedDownState ); - } + ClearFlags( CListItemDrawer::EPressedDownState ); + } iAnimator->Trigger(); } @@ -995,45 +1011,45 @@ // ----------------------------------------------------------------------------- // void CMmListBoxItemDrawer::SetBgContext( - CAknsBasicBackgroundControlContext * aBgContext ) - { - iBgContext = aBgContext; - } + CAknsBasicBackgroundControlContext * aBgContext ) + { + iBgContext = aBgContext; + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBoxItemDrawer::SetScrollbarVisibilityL( TBool aIsScrollbarVisible ) - { - iTemplateLibrary->SetScrollbarVisibilityL( aIsScrollbarVisible ); - } + { + iTemplateLibrary->SetScrollbarVisibilityL( aIsScrollbarVisible ); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // TRect CMmListBoxItemDrawer::AdjustItemRect( TInt aItemIndex ) const - { - TSize size = iWidget->View()->ItemSize (iWidget->View()->CurrentItemIndex () ); - TRect rect(iWidget->View()->ItemPos (iWidget->View()->CurrentItemIndex () ), - iWidget->View()->ItemPos (iWidget->View()->CurrentItemIndex () ) + size); - if ( !AknLayoutUtils::PenEnabled () && iIsIndicatorItem) - { - TBool landscapeOrientation = - Layout_Meta_Data::IsLandscapeOrientation (); - const TDesC8& mm_template = iMmModel->GetAttributeAsText ( - 0, KMmTemplate8); - TRect relativeToParentRect = TRect (TPoint (0, 0), TPoint (0, 0)); - relativeToParentRect = iTemplateLibrary->GetMoveIndicatorRect( - iWidgetType, mm_template, landscapeOrientation, - aItemIndex == iWidget->View()->CurrentItemIndex () ); - rect.Move (relativeToParentRect.iTl); - rect.iBr.iX = rect.iBr.iX + relativeToParentRect.Width (); - rect.iBr.iY = rect.iBr.iY + relativeToParentRect.Height (); - } - return rect; - } + { + TSize size = iWidget->View()->ItemSize (iWidget->View()->CurrentItemIndex () ); + TRect rect(iWidget->View()->ItemPos (iWidget->View()->CurrentItemIndex () ), + iWidget->View()->ItemPos (iWidget->View()->CurrentItemIndex () ) + size); + if( !AknLayoutUtils::PenEnabled() && iIsIndicatorItem ) + { + TBool landscapeOrientation = + Layout_Meta_Data::IsLandscapeOrientation(); + const TDesC8& mm_template = iMmModel->GetAttributeAsText ( + 0, KMmTemplate8); + TRect relativeToParentRect = TRect( TPoint( 0, 0 ), TPoint( 0, 0 ) ); + relativeToParentRect = iTemplateLibrary->GetMoveIndicatorRect( + iWidgetType, mm_template, landscapeOrientation, + aItemIndex == iWidget->View()->CurrentItemIndex () ); + rect.Move( relativeToParentRect.iTl ); + rect.iBr.iX = rect.iBr.iX + relativeToParentRect.Width(); + rect.iBr.iY = rect.iBr.iY + relativeToParentRect.Height(); + } + return rect; + } // ----------------------------------------------------------------------------- // @@ -1044,52 +1060,54 @@ if ( iDrawMoveIndicators ) { iIsIndicatorItem = ETrue; + TBool redrawItemBackground = + IsRedrawItemBackgroundEnabled( ); SetRedrawItemBackground( EFalse ); - DrawActualItem( aItemIndex, AdjustItemRect( aItemIndex ) , EFalse, EFalse, EFalse, EFalse); + DrawActualItem( aItemIndex, AdjustItemRect( aItemIndex ) , EFalse, EFalse, EFalse, EFalse); - SetRedrawItemBackground( ETrue ); - iIsIndicatorItem = EFalse; - } - } + SetRedrawItemBackground( redrawItemBackground ); + iIsIndicatorItem = EFalse; + } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBoxItemDrawer::ReplaceSubCellText( const TDesC& aText ) - { - delete iSubcellText; - iSubcellText = NULL; - if( aText.Compare( KNullDesC() ) ) - { - iSubcellText = aText.Alloc(); - } - } + { + delete iSubcellText; + iSubcellText = NULL; + if( aText.Compare( KNullDesC() ) ) + { + iSubcellText = aText.Alloc(); + } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBoxItemDrawer::AddSubcellMarqueeElementL( TTemplateChild aSubCellTemplate, TInt aIndex, TInt aItemIndex ) - { - TRgb textColor; - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - AknsUtils::GetCachedColor( skin, textColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 ); - iMarqueeAdapter->AddMarqueeElementL( aSubCellTemplate.iRectAccordingToParent, *iSubcellText, - aSubCellTemplate.iFontId, textColor, aSubCellTemplate.iTextAlign, aIndex, - aSubCellTemplate.iRectAccordingToParent.iTl.iY, - aItemIndex); - } + { + TRgb textColor; + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsUtils::GetCachedColor( skin, textColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 ); + iMarqueeAdapter->AddMarqueeElementL( aSubCellTemplate.iRectAccordingToParent, *iSubcellText, + aSubCellTemplate.iFontId, textColor, aSubCellTemplate.iTextAlign, aIndex, + aSubCellTemplate.iRectAccordingToParent.iTl.iY, + aItemIndex); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBoxItemDrawer::SetMarqueeAdapter( CMmMarqueeAdapter* aAdapter ) - { - iMarqueeAdapter = aAdapter; - } + { + iMarqueeAdapter = aAdapter; + } // ----------------------------------------------------------------------------- // @@ -1113,17 +1131,17 @@ TInt maxClipWidth = aTemplateChild.iRectAccordingToParent.Width(); const CFont* font = AknLayoutUtils::FontFromId(aTemplateChild.iFontId); return AknBidiTextUtils::ConvertToVisualAndClipL( clipbuf, *font, - aTemplateChild.iRectAccordingToParent.Width(), maxClipWidth ); - } + aTemplateChild.iRectAccordingToParent.Width(), maxClipWidth ); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // -void CMmListBoxItemDrawer::SetNumberOfColsInView(TInt aNumberOfColumns) - { - iNumberOfColsInWidget = aNumberOfColumns; - } +void CMmListBoxItemDrawer::SetNumberOfColsInView( TInt aNumberOfColumns ) + { + iNumberOfColsInWidget = aNumberOfColumns; + } // ----------------------------------------------------------------------------- // @@ -1141,80 +1159,86 @@ child.iIsImage = EFalse; } - if ( IsDraggable() && aItemIndex == iZoomIconIndex ) - { - const TReal KNormalZoomRatio = 1.0; - TReal zoomDelta = ( iIconAnimationZoomRatio - KNormalZoomRatio ) / 2.0; - TSize size = child.iRectAccordingToParent.Size(); - TSize sizeDelta( size.iWidth * zoomDelta, size.iHeight * zoomDelta ); - child.iRectAccordingToParent.Grow( sizeDelta ); - } - - TSize targetSize = child.iRectAccordingToParent.Size(); + if( IsEditMode() && IsDraggable() && aItemIndex == iZoomIconIndex ) + { + const TReal KNormalZoomRatio = 1.0; + TReal zoomDelta = ( iIconAnimationZoomRatio - KNormalZoomRatio ) / 2.0; + TSize size = child.iRectAccordingToParent.Size(); + TSize sizeDelta( size.iWidth * zoomDelta, size.iHeight * zoomDelta ); + child.iRectAccordingToParent.Grow( sizeDelta ); + TInt targetZoom( KZoomStateZoomRatio * 100 ); + Math::Round( zoomDelta, ( zoomDelta * 1000 ), 0); + if( (TInt)zoomDelta == targetZoom ) + { + static_cast (Widget()->Parent())->SetAllowMove( ETrue ); + } + } - CHnIconHolder* iconHolder = iMmModel->GetAttributeAsRefCountedGraphics( - aItemIndex, child.iData, &targetSize ); - icon = iconHolder ? iconHolder->GetGulIcon() : NULL; - if ( icon ) + TSize targetSize = child.iRectAccordingToParent.Size(); + + CHnIconHolder* iconHolder = iMmModel->GetAttributeAsRefCountedGraphics( + aItemIndex, child.iData, &targetSize ); + icon = iconHolder ? iconHolder->GetGulIcon() : NULL; + if( icon ) + { + CFbsBitmap* bitmap = icon->Bitmap(); + ASSERT( bitmap ); + //resize the item if it is a move indicator + if( iIsIndicatorItem ) { - CFbsBitmap* bitmap = icon->Bitmap(); - ASSERT( bitmap ); - //resize the item if it is a move indicator - if( iIsIndicatorItem ) - { AknIconUtils::SetSize( bitmap, child.iRectAccordingToParent.Size(), - EAspectRatioNotPreserved ); - } - else - { + EAspectRatioNotPreserved ); + } + else + { TSize bmpSize = bitmap->SizeInPixels(); TBool setSizeRequired = bitmap->DisplayMode() == ENone; if ( targetSize.iWidth && targetSize.iHeight && ( setSizeRequired || !BitmapFitsIntoTarget( bmpSize, targetSize ) ) ) { - CFbsBitmap* mask = icon->Mask(); - if ( mask ) - { + CFbsBitmap* mask = icon->Mask(); + if( mask ) + { __ASSERT_DEBUG( bmpSize == mask->SizeInPixels(), User::Invariant() ); AknIconUtils::SetSize( mask, targetSize, EAspectRatioPreservedAndUnusedSpaceRemoved ); } AknIconUtils::SetSize( bitmap, targetSize, EAspectRatioPreservedAndUnusedSpaceRemoved ); - } } + } TInt iconIndex = iItemsDataCache->GetItemCacheL( aItemIndex )->AppendIconL( iconHolder ); - HBufC8* number = HnConvUtils::NumToStr8LC( iconIndex ); - const TInt newLength = aItemText.Length() + number->Length(); + HBufC8* number = HnConvUtils::NumToStr8LC( iconIndex ); + const TInt newLength = aItemText.Length() + number->Length(); + if( aItemText.MaxLength() < newLength ) + { + aItemText.ReAllocL( newLength ); + } + CleanupStack::PopAndDestroy( number ); + aItemText.AppendNum( iconIndex ); + + SetupSubCellL( child, aSubcellIncrement, aItemIndex ); + + if( aChildIndex < aTemplateChildArray.Count() - 1 ) + { + const TInt newLength = aItemText.Length() + KTab().Length(); if( aItemText.MaxLength() < newLength ) { aItemText.ReAllocL( newLength ); } - CleanupStack::PopAndDestroy( number ); - aItemText.AppendNum( iconIndex ); - - SetupSubCellL( child, aSubcellIncrement, aItemIndex ); + aItemText.Append( KTab ); + } - if ( aChildIndex < aTemplateChildArray.Count() - 1 ) - { - const TInt newLength = aItemText.Length() + KTab().Length(); - if( aItemText.MaxLength() < newLength ) - { - aItemText.ReAllocL( newLength ); - } - aItemText.Append( KTab ); - } - - aSubcellIncrement++; - iLastSubcellsSetupCode.AddSubcellInfo( TMmSubcellsSetupCode::EGraphicsSubcell ); - } - else - { - // Mark the fact that subcell was not set to ensure that TMmSubcellsSetupCode - // works properly. + aSubcellIncrement++; + iLastSubcellsSetupCode.AddSubcellInfo( TMmSubcellsSetupCode::EGraphicsSubcell ); + } + else + { + // Mark the fact that subcell was not set to ensure that TMmSubcellsSetupCode + // works properly. iLastSubcellsSetupCode.AddSubcellInfo( TMmSubcellsSetupCode::ESkippedSubcell ); - } - } + } + } // ----------------------------------------------------------------------------- // @@ -1236,61 +1260,61 @@ // ----------------------------------------------------------------------------- // void CMmListBoxItemDrawer::SetupTextSubcellL( - RArray& aTemplateChildArray, TInt aChildIndex, - TInt aItemIndex, RBuf& aItemText, TInt& aSubcellIncrement ) const - { - TTemplateChild child = aTemplateChildArray[aChildIndex]; - RBuf itemChildText; - CleanupClosePushL( itemChildText ); - const TDesC8& mmTitleDes8 = iMmModel->GetAttributeAsText( aItemIndex, - child.iData ); - itemChildText.Assign( HnConvUtils::Str8ToStr( mmTitleDes8 ) ); + RArray& aTemplateChildArray, TInt aChildIndex, + TInt aItemIndex, RBuf& aItemText, TInt& aSubcellIncrement ) const + { + TTemplateChild child = aTemplateChildArray[aChildIndex]; + RBuf itemChildText; + CleanupClosePushL( itemChildText ); + const TDesC8& mmTitleDes8 = iMmModel->GetAttributeAsText( aItemIndex, + child.iData ); + itemChildText.Assign( HnConvUtils::Str8ToStr( mmTitleDes8 ) ); - AppendText( aItemText, itemChildText ); + AppendText( aItemText, itemChildText ); - const_cast(this)->ReplaceSubCellText( - itemChildText ); - CleanupStack::PopAndDestroy( &itemChildText ); + const_cast ( this )->ReplaceSubCellText( + itemChildText ); + CleanupStack::PopAndDestroy( &itemChildText ); - SetupSubCellL( child, aSubcellIncrement, aItemIndex ); + SetupSubCellL( child, aSubcellIncrement, aItemIndex ); - if ( aChildIndex < aTemplateChildArray.Count() - 1 ) - { - AppendText( aItemText, KTab ); - } + if( aChildIndex < aTemplateChildArray.Count() - 1 ) + { + AppendText( aItemText, KTab ); + } - aSubcellIncrement++; - iLastSubcellsSetupCode.AddSubcellInfo( TMmSubcellsSetupCode::ETextSubcell ); - } + aSubcellIncrement++; + iLastSubcellsSetupCode.AddSubcellInfo( TMmSubcellsSetupCode::ETextSubcell ); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBoxItemDrawer::AppendText( RBuf& aBuffer, const TDesC& aTextToAppend ) const - { - TInt newLength = aBuffer.Length() + aTextToAppend.Length(); - TInt error = KErrNone; + { + TInt newLength = aBuffer.Length() + aTextToAppend.Length(); + TInt error = KErrNone; - if( aBuffer.MaxLength() < newLength ) - { - error = aBuffer.ReAlloc( newLength ); - } - if ( error == KErrNone ) - { - aBuffer.Append( aTextToAppend ); - } - } + if( aBuffer.MaxLength() < newLength ) + { + error = aBuffer.ReAlloc( newLength ); + } + if( error == KErrNone ) + { + aBuffer.Append( aTextToAppend ); + } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmListBoxItemDrawer::SetupBackdropSubcellL( - RArray& aTemplateChildArray, TInt aItemIndex, - RBuf& aItemText, TInt& aSubcellIncrement ) const - { + RArray& aTemplateChildArray, TInt aItemIndex, + RBuf& aItemText, TInt& aSubcellIncrement ) const + { CGulIcon* icon = NULL; - for ( TInt i = 0; i < aTemplateChildArray.Count() /*&& - aItemIndex != iWidget->View()->CurrentItemIndex()*/; ++i ) + for( TInt i = 0; i < aTemplateChildArray.Count() /*&& + aItemIndex != iWidget->View()->CurrentItemIndex()*/; ++i ) { TTemplateChild child = aTemplateChildArray[i]; if( child.iImageVisualId == EImageVisualIdEditMode && @@ -1300,14 +1324,14 @@ aItemIndex == iWidget->View()->CurrentItemIndex() ); CHnIconHolder* iconHolder = iMmModel->GetAttributeAsRefCountedGraphics( aItemIndex, child.iData, &itemSize ); icon = iconHolder ? iconHolder->GetGulIcon() : NULL; - if ( icon ) + if( icon ) { CFbsBitmap* bitmap = icon->Bitmap(); - child.iRectAccordingToParent = TRect( TPoint( 0, 0 ), - TPoint( itemSize.iWidth, itemSize.iHeight ) ); - AknIconUtils::SetSize( bitmap, itemSize, - EAspectRatioNotPreserved ); - TInt iconIndex = iItemsDataCache->GetItemCacheL( aItemIndex )->AppendIconL( iconHolder ); + child.iRectAccordingToParent = TRect( TPoint( 0, 0 ), + TPoint( itemSize.iWidth, itemSize.iHeight ) ); + AknIconUtils::SetSize( bitmap, itemSize, + EAspectRatioNotPreserved ); + TInt iconIndex = iItemsDataCache->GetItemCacheL( aItemIndex )->AppendIconL( iconHolder ); HBufC8* number = HnConvUtils::NumToStr8LC( iconIndex ); TInt newLength = aItemText.Length() + number->Length(); @@ -1330,7 +1354,7 @@ } } } - } + } // ----------------------------------------------------------------------------- // @@ -1340,10 +1364,10 @@ TInt aItemIndex ) const { CMmCacheForItem* cache = iItemsDataCache->GetItemCacheL( aItemIndex ); - cache->SetValidL( EFalse ); + cache->MarkAsInvalid(); const TDesC8& mmTemplate = iMmModel->GetAttributeAsText( aItemIndex, KMmTemplate8 ); - if ( !mmTemplate.Compare( KNullDesC8 ) || !mmTemplate.Compare( KEmpty8 ) ) + if( !mmTemplate.Compare( KNullDesC8 ) || !mmTemplate.Compare( KEmpty8 ) ) { User::Leave( KErrNotFound ); } @@ -1360,68 +1384,68 @@ RArray templateChildArray; CleanupClosePushL( templateChildArray ); - if ( !iIsIndicatorItem ) - { - iTemplateLibrary->GetChildrenL( iWidgetType, templateChildArray, mmTemplate, - landscapeOrientation, aItemIsCurrent, IsEditMode() ); - } + if( !iIsIndicatorItem ) + { + iTemplateLibrary->GetChildrenL( iWidgetType, templateChildArray, mmTemplate, + landscapeOrientation, aItemIsCurrent, IsEditMode() ); + } else if ( !AknLayoutUtils::PenEnabled() ) - { - iTemplateLibrary->GetMoveIndicatorChildrenL( iWidgetType, templateChildArray, - mmTemplate, landscapeOrientation, aItemIsCurrent ); - } + { + iTemplateLibrary->GetMoveIndicatorChildrenL( iWidgetType, templateChildArray, + mmTemplate, landscapeOrientation, aItemIsCurrent ); + } iLastSubcellsSetupCode.Clear(); //Backdrop icon as first element to draw TInt subcellIncrement( 0 ); - if ( GetBackdropVisibility( aItemIndex, aItemIsCurrent ) ) + if( GetBackdropVisibility( aItemIndex, aItemIsCurrent ) ) { SetupBackdropSubcellL( templateChildArray, aItemIndex, itemText, subcellIncrement ); iItemHasBackdrop = ETrue; } else - { - iItemHasBackdrop = EFalse; - } + { + iItemHasBackdrop = EFalse; + } - for ( TInt i( 0 ) ; i < templateChildArray.Count() && !iLeftOverAreaUnderAnimatedItem; i++ ) - { - TTemplateChild child = templateChildArray[i]; + for ( TInt i( 0 ) ; i < templateChildArray.Count() && !iLeftOverAreaUnderAnimatedItem; i++ ) + { + TTemplateChild child = templateChildArray[i]; if ( child.iImageVisualId == EImageVisualIdEditMode && child.iIsImage ) { continue; } else if( !child.iIsImage ) - { - SetupTextSubcellL( templateChildArray, i, aItemIndex, itemText, subcellIncrement ); - } - else - { - SetupIconSubcellL( templateChildArray, i, aItemIndex, itemText, subcellIncrement ); - } - } - TInt subcellsJustSet = subcellIncrement; - iCurrentNumberOfSubcellsSet = Max( iCurrentNumberOfSubcellsSet, subcellsJustSet ); - __ASSERT_DEBUG( iCurrentNumberOfSubcellsSet <= MmTemplateContants::KSubCellsCount, - User::Invariant() ); + { + SetupTextSubcellL( templateChildArray, i, aItemIndex, itemText, subcellIncrement ); + } + else + { + 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 < iCurrentNumberOfSubcellsSet; i++ ) - { - SetupSubNoCellL( i, aItemIndex ); - } + for( TInt i = subcellIncrement; i < iCurrentNumberOfSubcellsSet; i++ ) + { + SetupSubNoCellL( i, aItemIndex ); + } - iLastSubcellsSetupCode.AddTemplateInfo( - iItemsDataCache->GetTemplateIdentifierL( mmTemplate ) ); - iLastSubcellsSetupCode.AddIsCurrentInfo( aItemIsCurrent ); + iLastSubcellsSetupCode.AddTemplateInfo( + iItemsDataCache->GetTemplateIdentifierL( mmTemplate ) ); + iLastSubcellsSetupCode.AddIsCurrentInfo( aItemIsCurrent ); - CleanupStack::PopAndDestroy( &templateChildArray ); + CleanupStack::PopAndDestroy( &templateChildArray ); - cache->SetSubcellsSetupCode( iLastSubcellsSetupCode ); - // the line below is here only to make the cached information complete - GetItemSize( aItemIndex, aItemIsCurrent ); - cache->SetValidL( ETrue ); - } + cache->SetSubcellsSetupCode( iLastSubcellsSetupCode ); + // the line below is here only to make the cached information complete + GetItemSize( aItemIndex, aItemIsCurrent ); + cache->MarkAsValidL(); + } // ----------------------------------------------------------------------------- // @@ -1437,10 +1461,10 @@ // ----------------------------------------------------------------------------- // void CMmListBoxItemDrawer::SetHighlightShown( TBool aDrawn ) - { - iHighlightShown = aDrawn; - iDrawMoveIndicators = aDrawn; - } + { + iHighlightShown = aDrawn; + iDrawMoveIndicators = aDrawn; + } // ----------------------------------------------------------------------------- // @@ -1451,16 +1475,16 @@ TBool isFloating( EFalse ); TInt index = GetFloatingItemIndex( EDrag ); - if (index == KErrNotFound) - { - index = GetFloatingItemIndex( EDragTransition ); - } + if( index == KErrNotFound ) + { + index = GetFloatingItemIndex( EDragTransition ); + } - if ( KErrNotFound != index ) + if( KErrNotFound != index ) { TMmFloatingItem& current = const_cast(this)->GetFloatingItemAtIndex( index ); TInt drawnIndex = current.GetDrawnItemIndex(); - if ( drawnIndex == aItemIndex ) + if( drawnIndex == aItemIndex ) { isFloating = ETrue; } @@ -1472,53 +1496,53 @@ // // ----------------------------------------------------------------------------- // -void CMmListBoxItemDrawer::DrawActualItem(TInt aItemIndex, - const TRect& aActualItemRect, TBool aItemIsCurrent, - TBool aViewIsEmphasized, TBool /*aViewIsDimmed*/, - TBool aItemIsSelected) const - { - if (Properties(aItemIndex).IsSelectionHidden()) - { - aItemIsSelected = EFalse; - } - DrawItemText(aItemIndex,aActualItemRect,aItemIsCurrent, - aViewIsEmphasized,aItemIsSelected); - } +void CMmListBoxItemDrawer::DrawActualItem( TInt aItemIndex, + const TRect& aActualItemRect, TBool aItemIsCurrent, + TBool aViewIsEmphasized, TBool /*aViewIsDimmed*/, + TBool aItemIsSelected ) const + { + if( Properties( aItemIndex ).IsSelectionHidden() ) + { + aItemIsSelected = EFalse; + } + DrawItemText( aItemIndex, aActualItemRect, aItemIsCurrent, + aViewIsEmphasized, aItemIsSelected ); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // TBool CMmListBoxItemDrawer::GetHighlightVisibility( TInt aItemIndex, - TBool aItemIsCurrent, TBool aAllowHighlightForNonDraggedItem ) const - { - TBool highlightVisibility(EFalse); - if (!iItemHasBackdrop && !iLeftOverAreaUnderAnimatedItem ) //never draw highlight when item has backdrop or when left over area under animated item - { - TBool currentlyDraggedItem = - ItemHasFloatingType( aItemIndex, EDrag ) || - ItemHasFloatingType( aItemIndex, EDragTransition ); + TBool aItemIsCurrent, TBool aAllowHighlightForNonDraggedItem ) const + { + TBool highlightVisibility( EFalse ); + if( !iItemHasBackdrop && !iLeftOverAreaUnderAnimatedItem ) //never draw highlight when item has backdrop or when left over area under animated item + { + TBool currentlyDraggedItem = + ItemHasFloatingType( aItemIndex, EDrag ) || + ItemHasFloatingType( aItemIndex, EDragTransition ); - if ( ( STATIC_CAST(CMmWidgetContainer*,Widget()->Parent())->IsHighlightVisible() - && aItemIsCurrent && aAllowHighlightForNonDraggedItem ) - || currentlyDraggedItem ) - { - highlightVisibility = ETrue; - } - } - return highlightVisibility; - } + if( ( STATIC_CAST(CMmWidgetContainer*,Widget()->Parent())->IsHighlightVisible() + && aItemIsCurrent && aAllowHighlightForNonDraggedItem ) + || currentlyDraggedItem ) + { + highlightVisibility = ETrue; + } + } + return highlightVisibility; + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // TBool CMmListBoxItemDrawer::GetBackdropVisibility( TInt aItemIndex, - TBool aItemIsCurrent ) const - { - TBool currentlyDraggedItem = - ItemHasFloatingType( aItemIndex, EDrag ) || - ItemHasFloatingType( aItemIndex, EDragTransition ); + TBool aItemIsCurrent ) const + { + TBool currentlyDraggedItem = + ItemHasFloatingType( aItemIndex, EDrag ) || + ItemHasFloatingType( aItemIndex, EDragTransition ); return IsEditMode() /* draw the backdrop only in edit mode */ && !currentlyDraggedItem /* backdrop is disabled for dragged items */ @@ -1526,26 +1550,26 @@ && !iLeftOverAreaUnderAnimatedItem /* is the currently drawn item the area left over behind dragged item*/ && !( STATIC_CAST( CMmWidgetContainer*,Widget()->Parent() )->IsHighlightVisible() && aItemIsCurrent );/*if the timer is active then we want to draw highlight (not backdrop) on the current index*/ - } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // TBool CMmListBoxItemDrawer::ItemHasFloatingType( TInt aItemIndex, - TMmFloatingItemType aFloatingType) const - { - TBool hasFloatingType( EFalse ); - for ( TInt i = iFloatingItems.Count() - 1 ; i >= 0; i-- ) + TMmFloatingItemType aFloatingType ) const + { + TBool hasFloatingType( EFalse ); + for( TInt i = iFloatingItems.Count() - 1; i >= 0; i-- ) { - const TMmFloatingItem& item = iFloatingItems[i]; - if ( item.GetFloatingItemType() == aFloatingType - && item.GetDrawnItemIndex() == aItemIndex ) + const TMmFloatingItem& item = iFloatingItems[i]; + if( item.GetFloatingItemType() == aFloatingType + && item.GetDrawnItemIndex() == aItemIndex ) { hasFloatingType = ETrue; break; } } - return hasFloatingType; - } + return hasFloatingType; + } // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/src/mmlistboxview.cpp --- a/menufw/menufwui/mmwidgets/src/mmlistboxview.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmlistboxview.cpp Wed May 12 13:22:51 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: - * Version : %version: MM_50 % << Don't touch! Updated by Synergy at check-out. + * Version : %version: MM_52 % << Don't touch! Updated by Synergy at check-out. * */ @@ -151,7 +151,7 @@ } TInt ret(i - aStartIndex); - + if ( !AknLayoutUtils::PenEnabled() && totalHeight > aHeight ) { ret--; // exclude partial item @@ -198,6 +198,15 @@ return ret; } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBoxView::ModelItemsCount() + { + return iModel->NumberOfItems(); + } + // ----------------------------------------------------------------------------- // @@ -299,7 +308,7 @@ { cc = itemDrawer->FormattedCellData()->SkinBackgroundContext (); } - + itemDrawer->SetTopItemIndex (iTopItemIndex); if ( iModel->NumberOfItems () > 0) @@ -327,12 +336,29 @@ TInt lastPotentialItemIndex = Min (iModel->NumberOfItems (), iTopItemIndex + GetNumberOfItemsThatFitInRect( ViewRect (), ETrue ) ); - while (i < lastPotentialItemIndex) - { - DrawItem(i++); - } - RedrawBackground(); + if ( !itemDrawer->IsEditMode() ) + { + itemDrawer->DrawBackground( ViewRect() ); + itemDrawer->SetRedrawItemBackground( EFalse ); + itemDrawer->SetDrawSeparatorLines( ETrue ); + while (i < lastPotentialItemIndex) + { + DrawItem(i++); + } + itemDrawer->SetRedrawItemBackground( ETrue ); + itemDrawer->SetDrawSeparatorLines( EFalse ); + } + else + { + while (i < lastPotentialItemIndex) + { + DrawItem(i++); + } + // this redraws background in the view portion not covered by items + RedrawBackground(); + } + if ( CAknEnv::Static()->TransparencyEnabled () && !drawingInitiated) { @@ -360,10 +386,12 @@ CurrentItemIndex()); view->SetPreviouslyDrawnCurrentItemIndex( CurrentItemIndex() ); } - + if ( !redrawConsumed ) { - DrawSingleItem ( aItemIndex ); + itemDrawer->SetDrawSeparatorLines( ETrue ); + DrawSingleItem ( aItemIndex ); + itemDrawer->SetDrawSeparatorLines( EFalse ); } } @@ -446,11 +474,11 @@ { // we need to update the iItemHeight member in widget also (there are two different item height value holders - in widget and here in widget view) iItemHeight = aItemHeight; - + CMmListBoxItemDrawer* itemDrawer = STATIC_CAST( CMmListBoxItemDrawer*, ItemDrawer() ); static_cast(itemDrawer->Widget())->SetItemHeight( aItemHeight ); - + } // ----------------------------------------------------------------------------- @@ -466,7 +494,7 @@ TInt itemHeight = itemDrawer-> GetItemHeight( aItemIndex, aItemIndex == CurrentItemIndex() ); - + // ItemIsPartiallyVisible uses fixed iItemHeight, but we have to support // variable item height in lists, unfortunately ItemIsPartiallyVisible // is not virtual @@ -476,13 +504,13 @@ itemPosition.iY + itemHeight >= iViewRect.iTl.iY ) || ( itemPosition.iY <= iViewRect.iBr.iY && itemPosition.iY + itemHeight > iViewRect.iBr.iY ); - + TBool itemIsFullyVisible = ItemIsVisible( aItemIndex ) && !itemPartiallyVisible; TBool itemIsAboveVisibleArea = !itemIsFullyVisible && ItemPos( aItemIndex ).iY < ViewRect().iTl.iY; - + TBool itemIsBeneathVisibleArea = !itemIsFullyVisible && !itemIsAboveVisibleArea && ItemPos( aItemIndex ).iY + itemDrawer-> GetItemHeight( aItemIndex, aItemIndex == CurrentItemIndex() ) > @@ -496,7 +524,7 @@ if ( itemIsBeneathVisibleArea ) { - const TInt viewHeight = ViewRect().Height(); + const TInt viewHeight = ViewRect().Height(); newTopItemIndex = aItemIndex; for ( ;; ) { @@ -576,7 +604,7 @@ usedPortionHeight)); usedPortionOfViewRect.Move(0, CFormattedCellListBoxView::ItemPos(iTopItemIndex).iY); - + RedrawBackground(usedPortionOfViewRect, iViewRect); #endif } @@ -603,7 +631,7 @@ TSize size = itemDrawer->GetItemSize( aItemIndex, highlightVisible && CurrentItemIndex() == aItemIndex ); itemDrawer->SetItemCellSize( size ); - + // CMmListBoxView* view= CONST_CAST( CMmListBoxView*, this ); // view->SetItemHeight( size.iHeight ); // The above line (currently commented-out) was originaly needed to correct @@ -611,8 +639,8 @@ // rocker keys. It seems that this is no longer needed. If anything should // change, please note that now the SetItemHeight method does much more than // it used to, so simply uncommenting this line would be a bad idea (consider - // setting the iItemHeight member variable directly). - + // setting the iItemHeight member variable directly). + CFormattedCellListBoxView::DrawItem (aItemIndex); //To eliminate the effect of undrawn fragment of background, when the last diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp --- a/menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp Wed May 12 13:22:51 2010 +0300 @@ -12,11 +12,10 @@ * Contributors: * * Description: -* Version : %version: MM_71.1.17.1.51 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_71.1.17.1.59 % << Don't touch! Updated by Synergy at check-out. * */ - #include #include #include @@ -83,32 +82,34 @@ return CMmListBoxContainer::NewL( aRect, aObjectProvider, aTemplateLibrary ); } - // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmWidgetContainer::ConstructL() - { + { iBgContext = CAknsBasicBackgroundControlContext::NewL( - KAknsIIDQsnBgAreaMainAppsGrid, Rect(), EFalse); + KAknsIIDQsnBgAreaMainAppsGrid, Rect(), EFalse ); iLongTapDetector = CAknLongTapDetector::NewL( this ); - iLongTapDetector->EnableLongTapAnimation(ETrue); - } + iLongTapDetector->EnableLongTapAnimation( ETrue ); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // CMmWidgetContainer::CMmWidgetContainer() - : iIsFaded( EFalse ) + : iMarqueeAdapter( NULL ) + , iLongTapInProgress( EFalse ) + , iBgContext( NULL ) + , iIsFaded( EFalse ) , iHasFocus( ETrue ) , iInForeground( ETrue ) + , iAllowMove( EFalse ) + , iRecipientId( KErrNotFound ) + , iEventParameters( NULL ) { - iMarqueeAdapter = NULL; - iBgContext = NULL; iWidgetPositionCache.iValid = EFalse; - iLongTapInProgress = EFalse; } // ----------------------------------------------------------------------------- @@ -122,6 +123,7 @@ delete iBgContext; delete iPostProcessor; delete iLongTapDetector; + delete iEventParameters; } // ----------------------------------------------------------------------------- @@ -130,7 +132,7 @@ // EXPORT_C void CMmWidgetContainer::EnableLongTapAnimation( TBool aEnable ) { - if ( iLongTapDetector ) + if( iLongTapDetector ) { iLongTapDetector->EnableLongTapAnimation( aEnable ); } @@ -142,22 +144,22 @@ // void CMmWidgetContainer::SizeChanged() { - if ( iWidget && iWidgetRect != Rect() ) + if( iWidget && iWidgetRect != Rect() ) { - CMmTemplateLibrary * templateLibrary = - static_cast ( - Widget()->View()->ItemDrawer() )->TemplateLibrary(); - if ( Rect() != templateLibrary->GetParentRect( - Layout_Meta_Data::IsLandscapeOrientation() ) ) - { - templateLibrary->CleanAndClearCache(); - } + CMmTemplateLibrary * templateLibrary = + static_cast ( + Widget()->View()->ItemDrawer() )->TemplateLibrary(); + if( Rect() != templateLibrary->GetParentRect( + Layout_Meta_Data::IsLandscapeOrientation() ) ) + { + templateLibrary->CleanAndClearCache(); + } iWidget->View()->SetViewRect( Rect() ); iWidget->SetRect( Rect() ); iWidgetRect = Rect(); } - if ( iBgContext ) + if( iBgContext ) { TRect rect = iCoeEnv->ScreenDevice()->SizeInPixels(); iBgContext->SetRect( rect ); @@ -172,7 +174,7 @@ // // ----------------------------------------------------------------------------- // -void CMmWidgetContainer::Draw( const TRect& /*aRect*/ ) const +void CMmWidgetContainer::Draw( const TRect& /*aRect*/) const { // do nothing } @@ -180,14 +182,14 @@ // // ----------------------------------------------------------------------------- // -TTypeUid::Ptr CMmWidgetContainer::MopSupplyObject(TTypeUid aId) +TTypeUid::Ptr CMmWidgetContainer::MopSupplyObject( TTypeUid aId ) { - if (aId.iUid == MAknsControlContext::ETypeId && iBgContext ) + if( aId.iUid == MAknsControlContext::ETypeId && iBgContext ) { - return MAknsControlContext::SupplyMopObject(aId, iBgContext ); + return MAknsControlContext::SupplyMopObject( aId, iBgContext ); } - return CCoeControl::MopSupplyObject(aId); + return CCoeControl::MopSupplyObject( aId ); } // ----------------------------------------------------------------------------- @@ -200,19 +202,19 @@ iLastDragPoint = aPointerEvent.iPosition; iLastDragHighlight = GetHighlight(); if( !iWidget->View()->XYPosToItemIndex( - aPointerEvent.iPosition, iDraggedIndex ) ) + aPointerEvent.iPosition, iDraggedIndex ) ) { iDraggedIndex = KErrNotFound; } iItemRelativeTapPoint = aPointerEvent.iPosition - iWidget->View()->ItemPos( - iDraggedIndex ); + iDraggedIndex ); } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // -void CMmWidgetContainer::HandleButtonUpL(const TPointerEvent& /*aPointerEvent*/ ) +void CMmWidgetContainer::HandleButtonUpL( const TPointerEvent& /*aPointerEvent*/) { iTapPoint = TPoint( 0, 0 ); CancelDragL( EFalse ); @@ -227,18 +229,23 @@ if ( aType == KEikDynamicLayoutVariantSwitch || aType == KAknsMessageSkinChange ) { - static_cast( iDrawer )->InvalidateCache(); + static_cast ( iDrawer )->InvalidateCache(); CMmTemplateLibrary * templateLibrary = static_cast( iDrawer )->TemplateLibrary(); templateLibrary->CleanAndClearCache(); } + TBool highlightVisibleBefore = iWidget->IsVisible() && IsHighlightVisible(); CCoeControl::HandleResourceChange( aType ); + if( highlightVisibleBefore ) + { + TRAP_IGNORE( SetHighlightVisibilityL( ETrue ) ); + } - if ( aType == KEikDynamicLayoutVariantSwitch && !IsHighlightVisible() ) - { - SetDefaultHighlightL( EFalse ); - } + if( aType == KEikDynamicLayoutVariantSwitch && !IsHighlightVisible() ) + { + TRAP_IGNORE( SetDefaultHighlightL( EFalse ) ); + } } // ----------------------------------------------------------------------------- @@ -248,7 +255,7 @@ EXPORT_C void CMmWidgetContainer::ItemIconZoomL( TInt /*aItemIndex */) { TInt index = GetHighlight(); - if (index != iDraggedIndex) + if( index != iDraggedIndex ) { iDrawer->AnimateItemZoomInL( index ); } @@ -259,65 +266,65 @@ // ----------------------------------------------------------------------------- // EXPORT_C CHnSuiteModel* CMmWidgetContainer::GetSuiteModelL() - { - return GetMmModel()->GetSuiteModel(); - } + { + return GetMmModel()->GetSuiteModel(); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // -void CMmWidgetContainer::HandleDragL(const TPointerEvent& aPointerEvent, +void CMmWidgetContainer::HandleDragL( const TPointerEvent& aPointerEvent, TBool aAbortAnimation ) { DEBUG(("\t_Mm_:CMmWidgetContainer::HandleDragL: iLastDragHighlight = %d ", - iLastDragHighlight )); + iLastDragHighlight )); TInt highlight = GetHighlight(); DEBUG(("\t_Mm_:CMmWidgetContainer::HandleDragL: highlight = %d ", highlight )); - TPoint dragDelta ( iLastDragPoint - aPointerEvent.iPosition); + TPoint dragDelta( iLastDragPoint - aPointerEvent.iPosition ); TInt dragSpeed = dragDelta.iX * dragDelta.iX + dragDelta.iY * dragDelta.iY; - TBool tooFast = (dragSpeed > MmEffects::KDragSpeedIgnoreThreshold); + TBool tooFast = ( dragSpeed > MmEffects::KDragSpeedIgnoreThreshold ); - if (iLastDragHighlight != highlight ) + if( iLastDragHighlight != highlight ) { - iDragAndDropObserver->HandleDragOverL( GetHighlight() ); + iDragAndDropObserver->HandleDragOverL( GetHighlight() ); } - if (!tooFast) - { - TSize itemSize = iWidget->View()->ItemSize( highlight ); - TPoint itemPos = iWidget->View()->ItemPos( highlight ); + if( !tooFast ) + { + TSize itemSize = iWidget->View()->ItemSize( highlight ); + TPoint itemPos = iWidget->View()->ItemPos( highlight ); - if ( PointInItemReorderAreaL( highlight, aPointerEvent.iPosition ) ) - { - CHnSuiteModel* model = GetMmModel()->GetSuiteModel(); - CHnItemModel* onItemModel = model->GetItemModel( model->IdByIndex( highlight )); - if (iDrawer->GetAnimator()->IsReadyForNewAnimation() && !aAbortAnimation - && onItemModel->GetItemType() != EItemTypeParentFolder - && iDraggedIndex != highlight) - { - GetMmModel()->ReorderModelL( iDraggedIndex, highlight ); - AnimateShiftL( highlight ); - iDrawer->SetDraggedIndexL( highlight, - aPointerEvent.iPosition - iItemRelativeTapPoint ); - iDraggedIndex = highlight; - iDragAndDropObserver->HandleDraggedIndexUpdatedL( highlight ); - } - } - } + if ( PointInItemReorderAreaL( highlight, aPointerEvent.iPosition ) ) + { + CHnSuiteModel* model = GetMmModel()->GetSuiteModel(); + CHnItemModel* onItemModel = model->GetItemModel( model->IdByIndex( highlight )); + if (iDrawer->GetAnimator()->IsReadyForNewAnimation() && !aAbortAnimation + && onItemModel->GetItemType() != EItemTypeParentFolder + && iDraggedIndex != highlight) + { + GetMmModel()->ReorderModelL( iDraggedIndex, highlight ); + AnimateShiftL( highlight ); + iDrawer->SetDraggedIndexL( highlight, + aPointerEvent.iPosition - iItemRelativeTapPoint ); + iDraggedIndex = highlight; + iDragAndDropObserver->HandleDraggedIndexUpdatedL( highlight ); + } + } + } if ( DeltaSquare( iTapPoint, aPointerEvent.iPosition ) > KDragDelta && - !iDrawer->IsDraggable() ) - { - iDrawer->SetDraggedIndexL( iDraggedIndex, iTapPoint - iItemRelativeTapPoint ); - iDrawer->SetDraggableL( ETrue ); - } - else if ( iDrawer->IsDraggable() ) - { - iDrawer->SetDraggedPointL( aPointerEvent.iPosition - iItemRelativeTapPoint ); - } + !iDrawer->IsDraggable() ) + { + iDrawer->SetDraggedIndexL( iDraggedIndex, iTapPoint - iItemRelativeTapPoint ); + iDrawer->SetDraggableL( ETrue ); + } + else if( iDrawer->IsDraggable() ) + { + iDrawer->SetDraggedPointL( aPointerEvent.iPosition - iItemRelativeTapPoint ); + } DEBUG(("\t_Mm_:CMmWidgetContainer::HandleDragL: iLastDragHighlight = %d ", iLastDragHighlight )); DEBUG(("\t_Mm_:CMmWidgetContainer::HandleDragL: highlight = %d ", highlight )); @@ -329,24 +336,24 @@ // // ----------------------------------------------------------------------------- // -void CMmWidgetContainer::AnimateShiftL(TInt aHighlight) - { +void CMmWidgetContainer::AnimateShiftL( TInt aHighlight ) + { TInt lowerVal = (iDraggedIndex < aHighlight)? iDraggedIndex : aHighlight; TInt higherVal = (iDraggedIndex < aHighlight)? aHighlight : iDraggedIndex; - TInt switchOperation = (iDraggedIndex < aHighlight) ? EFalse : ETrue; + TInt switchOperation = ( iDraggedIndex < aHighlight ) ? EFalse : ETrue; - for(TInt iter(lowerVal); iter < higherVal; iter++ ) - { - TInt from = iter + 1; - TInt to = iter; - if (switchOperation) - { - from = iter; - to = iter + 1; - } - iDrawer->AnimateItemSwapL( from, to ); + for( TInt iter( lowerVal ); iter < higherVal; iter++ ) + { + TInt from = iter + 1; + TInt to = iter; + if( switchOperation ) + { + from = iter; + to = iter + 1; + } + iDrawer->AnimateItemSwapL( from, to ); } - } + } // ----------------------------------------------------------------------------- // @@ -354,7 +361,7 @@ // EXPORT_C void CMmWidgetContainer::CancelDragL( TBool aAnimate ) { - if (aAnimate) + if( aAnimate ) { iDrawer->AnimateDragItemTransitionL(); } @@ -362,7 +369,7 @@ SetHighlightAfterDrag(); iDraggedIndex = -1; - iDrawer->SetDraggedIndexL( iDraggedIndex, TPoint(0,0) ); + iDrawer->SetDraggedIndexL( iDraggedIndex, TPoint( 0, 0 ) ); SetDraggableL( EFalse ); TInt dragFloatingItem; @@ -371,9 +378,7 @@ dragFloatingItem = iDrawer->GetFloatingItemIndex( EDrag ); iDrawer->RemoveFloatingItem( dragFloatingItem ); } - while ( dragFloatingItem != KErrNotFound ); - - iDrawer->GetAnimator()->CancelNextRedrawL(); + while( dragFloatingItem != KErrNotFound ); } @@ -382,24 +387,24 @@ // ----------------------------------------------------------------------------- // -TBool CMmWidgetContainer::IsFolderL(TInt aItemIndex) - { - TBool result = EFalse; +TBool CMmWidgetContainer::IsFolderL( TInt aItemIndex ) + { + TBool result = EFalse; - CHnSuiteModel* model = GetMmModel()->GetSuiteModel(); - if (model) - { - CHnItemModel* onItemModel = model->GetItemModel( model->IdByIndex( aItemIndex )); - if (onItemModel) - { - result = onItemModel->GetItemType() == EItemTypeParentFolder || - onItemModel->GetItemType() == EItemTypeFolder; - } - } + CHnSuiteModel* model = GetMmModel()->GetSuiteModel(); + if( model ) + { + CHnItemModel* onItemModel = model->GetItemModel( model->IdByIndex( aItemIndex )); + if( onItemModel ) + { + result = onItemModel->GetItemType() == EItemTypeParentFolder + || onItemModel->GetItemType() == EItemTypeFolder; + } + } - return result; + return result; - } + } // ----------------------------------------------------------------------------- // @@ -407,20 +412,20 @@ // TBool CMmWidgetContainer::IsNoItemDragged() - { - TBool noItemDragged = EFalse; - noItemDragged = ( KErrNotFound == iDraggedIndex ) ? ETrue : noItemDragged; - CHnSuiteModel* model = GetMmModel()->GetSuiteModel(); - if ( !noItemDragged && model) - { - CHnItemModel* onItemModel = model->GetItemModel( model->IdByIndex( iDraggedIndex )); - if (onItemModel) - { - noItemDragged = ( onItemModel->GetItemType() == EItemTypeParentFolder ); - } - } - return noItemDragged; - } + { + TBool noItemDragged = EFalse; + noItemDragged = ( KErrNotFound == iDraggedIndex ) ? ETrue : noItemDragged; + CHnSuiteModel* model = GetMmModel()->GetSuiteModel(); + if( !noItemDragged && model ) + { + CHnItemModel* onItemModel = model->GetItemModel( model->IdByIndex( iDraggedIndex )); + if( onItemModel ) + { + noItemDragged = ( onItemModel->GetItemType() == EItemTypeParentFolder ); + } + } + return noItemDragged; + } // ----------------------------------------------------------------------------- // @@ -428,15 +433,15 @@ // EXPORT_C void CMmWidgetContainer::SetHasFocusL( TBool aHasFocus ) { - if ( !!aHasFocus != !!iHasFocus ) // logical Ex-OR + if( !!aHasFocus != !!iHasFocus ) // logical Ex-OR { iHasFocus = aHasFocus; StartOrStopMarquee(); } - if ( !aHasFocus ) - { - SetHighlightVisibilityL( EFalse ); - } + if( !aHasFocus ) + { + SetHighlightVisibilityL( EFalse ); + } } // ----------------------------------------------------------------------------- @@ -445,7 +450,7 @@ // EXPORT_C void CMmWidgetContainer::SetIsFaded( TBool aIsFaded ) { - if ( !!aIsFaded != !!iIsFaded ) // logical Ex-OR + if( !!aIsFaded != !!iIsFaded ) // logical Ex-OR { iIsFaded = aIsFaded; StartOrStopMarquee(); @@ -465,139 +470,192 @@ // // ----------------------------------------------------------------------------- // -TBool CMmWidgetContainer::IsDeleteLockedL( TInt aItemIndex ) - { - TBool result = ETrue; +EXPORT_C TBool CMmWidgetContainer::AllowMove() const + { + return iAllowMove; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::SetAllowMove( TBool aAllowMove ) + { + iAllowMove = aAllowMove; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::SetTriggerMoveItemL( const TInt aRecipientId, + CLiwGenericParamList* aEventParameters ) + { + iRecipientId = aRecipientId; + if( !iEventParameters ) + { + iEventParameters = CLiwGenericParamList::NewL(); + } + else + { + iEventParameters->Reset(); + } + + iEventParameters->AppendL(*aEventParameters); + } - CHnSuiteModel* model = GetMmModel()->GetSuiteModel(); - if (model) - { - CHnItemModel* onItemModel = model->GetItemModel(model->IdByIndex( - aItemIndex)); - if (onItemModel) - { - result = onItemModel->IsDeleteLocked(); - } - } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::TriggerMoveItemL() + { + if( iRecipientId != KErrNotFound && iDragAndDropObserver ) + { + iDragAndDropObserver->HandleTriggerMoveItemL( iRecipientId, + iEventParameters ); + iRecipientId = KErrNotFound; + iEventParameters->Reset(); + } + } - return result; - } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmWidgetContainer::IsDeleteLockedL( TInt aItemIndex ) + { + TBool result = ETrue; + + CHnSuiteModel* model = GetMmModel()->GetSuiteModel(); + if( model ) + { + CHnItemModel* onItemModel = model->GetItemModel( model->IdByIndex( + aItemIndex ) ); + if( onItemModel ) + { + result = onItemModel->IsDeleteLocked(); + } + } + + return result; + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmWidgetContainer::ManageFolderZoomingL( TBool aDraggedItemOverIcons ) - { - TBool isAnimated; + { + TBool isAnimated( EFalse ); - isAnimated = EFalse; - for(int i=0; i< iDrawer->GetFloatingItemCount(); i++) - { - TMmFloatingItem& current = iDrawer->GetFloatingItemAtIndex(i); - if (/*current.GetFloatingItemType() != EZoomTransition &&*/ - current.GetFloatingItemType() != EPostHighlightChangeRefreshItem && - current.GetDrawnItemIndex() == GetHighlight() ) - { - isAnimated = ETrue; - break; - } - } + for( int i = 0; i < iDrawer->GetFloatingItemCount(); i++ ) + { + TMmFloatingItem& current = iDrawer->GetFloatingItemAtIndex( i ); + if( /*current.GetFloatingItemType() != EZoomTransition &&*/ + current.GetFloatingItemType() != EPostHighlightChangeRefreshItem + && current.GetDrawnItemIndex() == GetHighlight() ) + { + isAnimated = ETrue; + break; + } + } - if (!isAnimated) - { - if ( GetHighlight() != iDraggedIndex && - IsFolderL( GetHighlight() ) && - !IsDeleteLockedL( GetHighlight() ) && - iDrawer->IsDraggable() ) - { - iDrawer->AnimateItemZoomInL( GetHighlight() ); - } - } + if( !isAnimated ) + { + if( GetHighlight() != iDraggedIndex + && IsFolderL( GetHighlight() ) + && !IsDeleteLockedL( GetHighlight() ) + && iDrawer->IsDraggable() ) + { + iDrawer->AnimateItemZoomInL( GetHighlight() ); + } + } - isAnimated = EFalse; - for(int i=0; i< iDrawer->GetFloatingItemCount(); i++) - { - TMmFloatingItem& current = iDrawer->GetFloatingItemAtIndex(i); - if (current.GetFloatingItemType() != EZoomTransition && - current.GetFloatingItemType() != EPostHighlightChangeRefreshItem && - current.GetDrawnItemIndex() == iLastDragHighlight ) - { - isAnimated = ETrue; - break; - } - } + isAnimated = EFalse; + for( int i = 0; i < iDrawer->GetFloatingItemCount(); i++ ) + { + TMmFloatingItem& current = iDrawer->GetFloatingItemAtIndex( i ); + if( current.GetFloatingItemType() != EZoomTransition + && current.GetFloatingItemType() != EPostHighlightChangeRefreshItem + && current.GetDrawnItemIndex() == iLastDragHighlight ) + { + isAnimated = ETrue; + break; + } + } - if (!isAnimated) - { - if ( ( !aDraggedItemOverIcons && IsFolderL( iLastDragHighlight ) ) || - iLastDragHighlight != Widget()->CurrentItemIndex() ) - { - iDrawer->AnimateItemZoomOutL( iLastDragHighlight ); - } - } - } + if( !isAnimated ) + { + if( ( !aDraggedItemOverIcons && IsFolderL( iLastDragHighlight ) ) + || iLastDragHighlight != Widget()->CurrentItemIndex() ) + { + iDrawer->AnimateItemZoomOutL( iLastDragHighlight ); + } + } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmWidgetContainer::HandlePointerEventsInEditModeL( - const TPointerEvent& aPointerEvent, TBool aAbortAnimations ) - { + const TPointerEvent& aPointerEvent, TBool aAbortAnimations ) + { - TInt pointedItem = KErrNotFound; - TBool draggedItemOverIcons = iWidget->View()->XYPosToItemIndex( - aPointerEvent.iPosition, pointedItem ); + TInt pointedItem = KErrNotFound; + TBool draggedItemOverIcons = iWidget->View()->XYPosToItemIndex( + aPointerEvent.iPosition, pointedItem ); - if (aPointerEvent.iType == TPointerEvent::EButton1Down) + if( aPointerEvent.iType == TPointerEvent::EButton1Down ) { -//TODO: PROTO OF 2PHASE HIGHLIGHT EDITMODE BEHAVIOUR -// if (!IsFolderL(pointedItem)) -// { -// iDrawer->ClearFlags( CListItemDrawer::EPressedDownState ); -// } - HandleButtonDownL(aPointerEvent); + //TODO: PROTO OF 2PHASE HIGHLIGHT EDITMODE BEHAVIOUR + // if (!IsFolderL(pointedItem)) + // { + // iDrawer->ClearFlags( CListItemDrawer::EPressedDownState ); + // } + HandleButtonDownL( aPointerEvent ); iDragAndDropObserver->HandleDragStartL( GetHighlight() ); } - else if ( (aPointerEvent.iType == TPointerEvent::EDrag || - aPointerEvent.iType == TPointerEvent::EButtonRepeat) && - iDraggedIndex != KErrNotFound) + else if( ( aPointerEvent.iType == TPointerEvent::EDrag + || aPointerEvent.iType == TPointerEvent::EButtonRepeat ) + && iDraggedIndex != KErrNotFound ) { -//TODO: PROTO OF 2PHASE HIGHLIGHT EDITMODE BEHAVIOUR -// if (!IsFolderL(pointedItem)) -// { -// iDrawer->SetFlags( CListItemDrawer::EPressedDownState ); -// } + //TODO: PROTO OF 2PHASE HIGHLIGHT EDITMODE BEHAVIOUR + // if (!IsFolderL(pointedItem)) + // { + // iDrawer->SetFlags( CListItemDrawer::EPressedDownState ); + // } TPointerEvent pointerEvent = aPointerEvent; if( WidgetType() == EListWidget ) - { - pointerEvent.iPosition.iX = - iWidget->View()->ItemPos( pointedItem ).iX + - iItemRelativeTapPoint.iX; - } + { + pointerEvent.iPosition.iX = + iWidget->View()->ItemPos( pointedItem ).iX + + iItemRelativeTapPoint.iX; + } - if (GetHighlight() != Widget()->CurrentItemIndex() ) - { - SetHighlightL( Widget()->CurrentItemIndex() ); - } + if( GetHighlight() != Widget()->CurrentItemIndex() ) + { + SetHighlightL( Widget()->CurrentItemIndex() ); + } ManageFolderZoomingL( draggedItemOverIcons ); - HandleDragL(pointerEvent, aAbortAnimations); + HandleDragL( pointerEvent, aAbortAnimations ); } else if (aPointerEvent.iType == TPointerEvent::EButton1Up && iDrawer->IsDraggable()) { - if ( !draggedItemOverIcons ) - { - SetManualHighlightL( iDraggedIndex ); - } + if( !draggedItemOverIcons ) + { + SetManualHighlightL( iDraggedIndex ); + } iDragAndDropObserver->HandleDragStopL( GetHighlight() ); - HandleButtonUpL(aPointerEvent); + iAllowMove = EFalse ; + HandleButtonUpL( aPointerEvent ); } - } + } // ----------------------------------------------------------------------------- // @@ -606,70 +664,70 @@ void CMmWidgetContainer::HandlePointerEventL(const TPointerEvent& aPointerEvent ) { if ( iMarqueeAdapter && aPointerEvent.iType == TPointerEvent::EButton1Down ) - { - iMarqueeAdapter->StopMarqueeDrawing(); - } + { + iMarqueeAdapter->StopMarqueeDrawing(); + } TInt index = KErrNotFound; TBool itemExists = iWidget->View()->XYPosToItemIndex( aPointerEvent.iPosition, index ); - - if ( iLongTapDetector ) + + if( iLongTapDetector ) { - if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + if( aPointerEvent.iType == TPointerEvent::EButton1Down ) { iLongTapDetector->EnableLongTapAnimation( itemExists && GetMmModel()->GetNumberOfSpecificMenuItemsL( index ) > 0 ); } TPointerEvent longTapPointerEvent = aPointerEvent; - if ( aPointerEvent.iType == TPointerEvent::EButtonRepeat ) + if( aPointerEvent.iType == TPointerEvent::EButtonRepeat ) { longTapPointerEvent.iType = TPointerEvent::EDrag; } iLongTapDetector->PointerEventL( longTapPointerEvent ); } - CCoeControl::HandlePointerEventL(aPointerEvent); + CCoeControl::HandlePointerEventL( aPointerEvent ); if ( aPointerEvent.iType == TPointerEvent::EButton1Down && itemExists ) { SetHighlightL( index ); } - else if ( aPointerEvent.iType == TPointerEvent::EDrag - // the line below is needed to enable edit mode in the list widget - // because behaviour in the grid and list is different - || (aPointerEvent.iType == TPointerEvent::EButtonRepeat && WidgetType() == EGridWidget )) - { - if ( itemExists ) - { - if ( GetHighlight() != index ) - { - SetHighlightVisibilityL( EFalse ); - if ( IsEditMode() ) - { - SetHighlightL( index ); - } - } - } - else - { - SetHighlightVisibilityL( EFalse ); - } - } + else if( aPointerEvent.iType == TPointerEvent::EDrag + // the line below is needed to enable edit mode in the list widget + // because behaviour in the grid and list is different + || (aPointerEvent.iType == TPointerEvent::EButtonRepeat && WidgetType() == EGridWidget )) + { + if( itemExists ) + { + if( GetHighlight() != index ) + { + SetHighlightVisibilityL( EFalse ); + if( IsEditMode() ) + { + SetHighlightL( index ); + } + } + } + else + { + SetHighlightVisibilityL( EFalse ); + } + } - TInt lastTopItemIndex = Widget()->TopItemIndex(); + TInt lastTopItemIndex = Widget()->TopItemIndex(); TBool abortAnimation = lastTopItemIndex != Widget()->TopItemIndex(); - if (abortAnimation) + if( abortAnimation ) { iDrawer->GetAnimator()->CancelAnimationsL(); } - if ( IsEditMode() && iDragAndDropObserver ) - { - HandlePointerEventsInEditModeL(aPointerEvent, abortAnimation); - } + if( IsEditMode() && iDragAndDropObserver ) + { + HandlePointerEventsInEditModeL( aPointerEvent, abortAnimation ); + } } // ----------------------------------------------------------------------------- @@ -677,12 +735,12 @@ // ----------------------------------------------------------------------------- // EXPORT_C TRect CMmWidgetContainer::GetItemRectL( TInt aItemIndex ) - { - User::LeaveIfNull( iWidget ); - TPoint pos = iWidget->View()->ItemPos( aItemIndex ); - TSize size = iDrawer->GetItemSize( aItemIndex, EFalse ); - return TRect( pos.iX, pos.iY, pos.iX + size.iWidth, pos.iY + size.iHeight ); - } + { + User::LeaveIfNull( iWidget ); + TPoint pos = iWidget->View()->ItemPos( aItemIndex ); + TSize size = iDrawer->GetItemSize( aItemIndex, EFalse ); + return TRect( pos.iX, pos.iY, pos.iX + size.iWidth, pos.iY + size.iHeight ); + } // ----------------------------------------------------------------------------- // @@ -700,9 +758,9 @@ // ----------------------------------------------------------------------------- // TBool CMmWidgetContainer::IsEditMode() const - { - return iIsEditMode; - } + { + return iIsEditMode; + } // ----------------------------------------------------------------------------- // @@ -711,15 +769,16 @@ void CMmWidgetContainer::SetEditModeL( TBool aIsEditMode ) { iIsEditMode = aIsEditMode; + iAllowMove = EFalse; StartOrStopMarquee(); ASSERT(iDrawer); iDrawer->SetEditModeL( aIsEditMode ); - if ( !AknLayoutUtils::PenEnabled() && aIsEditMode ) - { + if( !AknLayoutUtils::PenEnabled() && aIsEditMode ) + { iDraggedIndex = iWidget->CurrentItemIndex(); ScrollViewIfNeededL(); //only edit mode non-touch - } + } // scrollbar does not work when scrolling is disabled // iWidget->DisableScrolling( aIsEditMode ); @@ -734,37 +793,43 @@ // activate the model CHnSuiteModel* suiteModel = GetMmModel()->GetSuiteModel(); - if ( suiteModel ) + if( suiteModel ) { suiteModel->SetActiveL( aEnable ); } -#ifdef RD_UI_TRANSITION_EFFECTS_LIST - MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( - iDrawer->Gc() ); -#endif - if ( !aEnable ) + + if( ( !!aEnable != !!iPreviousHighlightVisibility ) // Ex-OR + || ( !!aEnable != !!IsHighlightVisible() ) ) // Ex-OR { - iWidget->View()->ItemDrawer()->SetFlags( - CListItemDrawer::ESingleClickDisabledHighlight ); #ifdef RD_UI_TRANSITION_EFFECTS_LIST - if ( transApi ) - { - transApi->Remove( MAknListBoxTfxInternal::EListHighlight ); - } + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( + iDrawer->Gc() ); #endif - } - else - { - iWidget->View()->ItemDrawer()->ClearFlags( - CListItemDrawer::ESingleClickDisabledHighlight ); - } - - if ( IsVisible() ) - { - TInt highlight = GetHighlight(); - CListBoxView* view = Widget()->View(); - Widget()->DrawNow( TRect( view->ItemPos( highlight ), - view->ItemSize( highlight ) ) ); + if( !aEnable ) + { + iWidget->View()->ItemDrawer()->SetFlags( + CListItemDrawer::ESingleClickDisabledHighlight ); +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if( transApi ) + { + transApi->Remove( MAknListBoxTfxInternal::EListHighlight ); + } +#endif + } + else + { + iWidget->View()->ItemDrawer()->ClearFlags( + CListItemDrawer::ESingleClickDisabledHighlight ); + } + + if( IsVisible() ) + { + TInt highlight = GetHighlight(); + CListBoxView* view = Widget()->View(); + Widget()->DrawNow( TRect( view->ItemPos( highlight ), + view->ItemSize( highlight ) ) ); + } + iPreviousHighlightVisibility = aEnable; } } @@ -774,8 +839,8 @@ // EXPORT_C TBool CMmWidgetContainer::IsHighlightVisible() { - return !( iWidget->View()->ItemDrawer()->Flags() & - CListItemDrawer::ESingleClickDisabledHighlight ); + return !( iWidget->View()->ItemDrawer()->Flags() + & CListItemDrawer::ESingleClickDisabledHighlight ); } // ----------------------------------------------------------------------------- @@ -783,7 +848,7 @@ // ----------------------------------------------------------------------------- // EXPORT_C TBool CMmWidgetContainer::IsDraggable() - { + { iDrawer = STATIC_CAST(CMmListBoxItemDrawer*, iWidget->View()->ItemDrawer()); return iDrawer->IsDraggable(); } @@ -802,7 +867,7 @@ // // ----------------------------------------------------------------------------- // -CCoeControl* CMmWidgetContainer::ComponentControl(TInt aIndex) const +CCoeControl* CMmWidgetContainer::ComponentControl( TInt aIndex ) const { switch( aIndex ) { @@ -825,12 +890,12 @@ // // ----------------------------------------------------------------------------- // -EXPORT_C void CMmWidgetContainer::SetObserver( MMmWidgetObserver* aObserver ) +EXPORT_C void CMmWidgetContainer::SetObserver( MMmWidgetObserver* aObserver ) { //iWidget->SetListBoxObserver( aObserver ); iListBoxObserver = aObserver; iKeyEventObserver = aObserver; - iDragAndDropObserver = aObserver; + iDragAndDropObserver = aObserver; } // ----------------------------------------------------------------------------- @@ -845,7 +910,7 @@ // // ----------------------------------------------------------------------------- // -EXPORT_C TInt CMmWidgetContainer::GetHighlight( ) +EXPORT_C TInt CMmWidgetContainer::GetHighlight() { return iCurrentHighlight; } @@ -855,24 +920,24 @@ // ----------------------------------------------------------------------------- // void CMmWidgetContainer::SetManualHighlightL( TInt aItemIndex, - TBool aRedraw ) - { - SetHighlightL( aItemIndex ); + TBool aRedraw ) + { + SetHighlightL( aItemIndex ); - if ( aItemIndex >= 0 && aItemIndex < GetMmModel()->NumberOfItems() ) - { - if ( aItemIndex != iWidget->CurrentItemIndex() ) - { - iWidget->View()->SetCurrentItemIndex( aItemIndex ); - } + if( aItemIndex >= 0 && aItemIndex < GetMmModel()->NumberOfItems() ) + { + if( aItemIndex != iWidget->CurrentItemIndex() ) + { + iWidget->View()->SetCurrentItemIndex( aItemIndex ); + } - if ( aRedraw ) - { - iWidget->SetCurrentItemIndex( aItemIndex ); - iWidget->DrawNow(); - } - } - } + if( aRedraw ) + { + iWidget->SetCurrentItemIndex( aItemIndex ); + iWidget->DrawNow(); + } + } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -881,49 +946,48 @@ { ASSERT( aItemIndex >= KErrNotFound ); - if (aItemIndex == KErrNotFound) + if( aItemIndex == KErrNotFound ) { - iCurrentHighlight = iPreviousHighlight = KErrNotFound; + iCurrentHighlight = iPreviousHighlight = KErrNotFound; SetDefaultHighlightL( EFalse ); } - else if (aItemIndex >= 0 && aItemIndex < GetMmModel()->NumberOfItems()) + else if( aItemIndex >= 0 && aItemIndex < GetMmModel()->NumberOfItems() ) { iPreviousHighlight = iCurrentHighlight; iCurrentHighlight = aItemIndex; - if ( iPreviousHighlight != iCurrentHighlight ) + if( iPreviousHighlight != iCurrentHighlight ) { HideOptionsMenuIfDisplayed(); } CHnSuiteModel* suiteModel = GetMmModel()->GetSuiteModel(); - if (suiteModel) + if( suiteModel ) { suiteModel->SetSuiteHighlightL( iCurrentHighlight ); } } + if( IsEditMode() ) + { + TMmFloatingItem postDragCurrent( GetHighlight(), + Widget()->View()->ItemPos( GetHighlight() ), + EPostHighlightChangeRefreshItem, + MmEffects::KNoAnimationFramesCount, Widget()->View() ); - if ( IsEditMode() ) - { - TMmFloatingItem postDragCurrent( GetHighlight(), - Widget()->View()->ItemPos( GetHighlight() ), - EPostHighlightChangeRefreshItem, - MmEffects::KNoAnimationFramesCount, Widget()->View() ); - - iDrawer->AddFloatingItemL( postDragCurrent ); + iDrawer->AddFloatingItemL( postDragCurrent ); - if ( GetPreviousHighlight() != GetHighlight() ) - { - TMmFloatingItem postDragPrevious( GetPreviousHighlight(), - Widget()->View()->ItemPos( GetPreviousHighlight() ), - EPostHighlightChangeRefreshItem, - MmEffects::KNoAnimationFramesCount, Widget()->View() ); + if( GetPreviousHighlight() != GetHighlight() ) + { + TMmFloatingItem postDragPrevious( GetPreviousHighlight(), + Widget()->View()->ItemPos( GetPreviousHighlight() ), + EPostHighlightChangeRefreshItem, + MmEffects::KNoAnimationFramesCount, Widget()->View() ); - iDrawer->AddFloatingItemL( postDragPrevious ); - } - } + iDrawer->AddFloatingItemL( postDragPrevious ); + } + } } // ----------------------------------------------------------------------------- @@ -946,7 +1010,7 @@ void CMmWidgetContainer::HideOptionsMenuIfDisplayed() { CEikMenuBar* menuBar = CEikonEnv::Static()->AppUiFactory()->MenuBar(); - if ( menuBar && menuBar->IsDisplayed() ) + if( menuBar && menuBar->IsDisplayed() ) { menuBar->StopDisplayingMenuBar(); } @@ -957,7 +1021,7 @@ // // ----------------------------------------------------------------------------- // -void CMmWidgetContainer::SetFlag(TInt /*Flag*/) +void CMmWidgetContainer::SetFlag( TInt /*Flag*/) { } @@ -983,25 +1047,25 @@ TBool highlightVisibleWhenEventReceived = IsHighlightVisible(); - if ( IsEditMode() && IsDraggable() ) - return resp; + if( IsEditMode() && IsDraggable() ) + return resp; resp = HandleKeyEventL( aKeyEvent, aType ); - if ( iMarqueeAdapter && ( aType == EEventKeyDown ) ) - { - iMarqueeAdapter->StopMarqueeDrawing(); - } + if( iMarqueeAdapter && ( aType == EEventKeyDown ) ) + { + iMarqueeAdapter->StopMarqueeDrawing(); + } - if (!AknLayoutUtils::PenEnabled() && iIsEditMode ) + if( !AknLayoutUtils::PenEnabled() && iIsEditMode ) { - if ((GetHighlight() + ColumnsInCurrentView() > NumberOfItems() - 1) - && aKeyEvent.iScanCode == EStdKeyDownArrow) - // the second condition is needed to block moving item down when there is no item below the moved item. - { - return resp; - } + if( ( GetHighlight() + ColumnsInCurrentView() > NumberOfItems() - 1 ) + && aKeyEvent.iScanCode == EStdKeyDownArrow ) + // the second condition is needed to block moving item down when there is no item below the moved item. + { + return resp; + } - if (aType == EEventKey ) + if( aType == EEventKey ) { TInt prevIndex = GetHighlight(); static_cast(iDrawer)->SetHighlightShown( EFalse ); @@ -1011,45 +1075,45 @@ ScrollViewIfNeededL(); //only edit mode non-touch if ( prevIndex != GetHighlight() - && KErrNotFound != prevIndex ) - { - iDraggedIndex = prevIndex; + && KErrNotFound != prevIndex ) + { + iDraggedIndex = prevIndex; iDragAndDropObserver->HandleDragStartL( iDraggedIndex ); GetMmModel()->ReorderModelL( iDraggedIndex, GetHighlight() ); - iDrawer->AnimateItemSwapL( iDraggedIndex , GetHighlight() ); + iDrawer->AnimateItemSwapL( iDraggedIndex, GetHighlight() ); AnimateShiftL( GetHighlight() ); - } + } return resp; } } - if ( resp == EKeyWasNotConsumed ) + if( resp == EKeyWasNotConsumed ) { resp = iWidget->OfferKeyEventL( aKeyEvent, aType ); } - if ( iKeyEventObserver ) - { - resp = iKeyEventObserver->HandleKeyPressedL( aKeyEvent, aType ); - } + if( iKeyEventObserver ) + { + resp = iKeyEventObserver->HandleKeyPressedL( aKeyEvent, aType ); + } if ( ( aKeyEvent.iScanCode == EStdKeyDevice3 || - aKeyEvent.iScanCode == EStdKeyEnter || - aKeyEvent.iScanCode == EStdKeyNkpEnter ) && aType == EEventKeyDown ) - { - if ( highlightVisibleWhenEventReceived ) - { - iAllowLongPress = EFalse; - } - else - { - iAllowLongPress = ETrue; + aKeyEvent.iScanCode == EStdKeyEnter || + aKeyEvent.iScanCode == EStdKeyNkpEnter ) && aType == EEventKeyDown ) + { + if( highlightVisibleWhenEventReceived ) + { + iAllowLongPress = EFalse; + } + else + { + iAllowLongPress = ETrue; - SetHighlightVisibilityL( ETrue ); - SetDefaultHighlightL( ETrue ); - HandleForegroundGainedL(); - } - } + SetHighlightVisibilityL( ETrue ); + SetDefaultHighlightL( ETrue ); + HandleForegroundGainedL(); + } + } return resp; } @@ -1058,10 +1122,10 @@ // ----------------------------------------------------------------------------- // TInt CMmWidgetContainer::ColumnsInCurrentView() - { - //should be overridden by deriving classes - return NumberOfItems(); - } + { + //should be overridden by deriving classes + return NumberOfItems(); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -1069,8 +1133,8 @@ TInt CMmWidgetContainer::RowsInCurrentView() { //should be overridden by deriving classes - CListBoxView *view = ((CListBoxView*) Widget()->View()); - return view->NumberOfItemsThatFitInRect( Rect());//Widget()->View()->ViewRect()); + CListBoxView *view = ( (CListBoxView* ) Widget()->View() ); + return view->NumberOfItemsThatFitInRect( Rect() );//Widget()->View()->ViewRect()); } // ----------------------------------------------------------------------------- @@ -1078,7 +1142,7 @@ // ----------------------------------------------------------------------------- // void CMmWidgetContainer::HandleRockerPressL() - { + { TKeyEvent ke; ke.iScanCode = EStdKeyNull; ke.iCode = EStdKeyNull; @@ -1088,7 +1152,7 @@ { iKeyEventObserver->HandleKeyPressedL( ke, EEventUser ); } - } + } // ----------------------------------------------------------------------------- // @@ -1098,37 +1162,37 @@ TEventCode aType ) { TKeyResponse resp = EKeyWasNotConsumed; - TBool arrowKeyPressed = aKeyEvent.iScanCode == EStdKeyRightArrow || - aKeyEvent.iScanCode == EStdKeyLeftArrow || - aKeyEvent.iScanCode == EStdKeyUpArrow || - aKeyEvent.iScanCode == EStdKeyDownArrow; + TBool arrowKeyPressed = aKeyEvent.iScanCode == EStdKeyRightArrow + || aKeyEvent.iScanCode == EStdKeyLeftArrow + || aKeyEvent.iScanCode == EStdKeyUpArrow + || aKeyEvent.iScanCode == EStdKeyDownArrow; TBool arrowHasHandling = ( aKeyEvent.iScanCode == EStdKeyRightArrow - && WidgetType() != EListWidget ) - || ( aKeyEvent.iScanCode == EStdKeyLeftArrow - && WidgetType() != EListWidget ) - || aKeyEvent.iScanCode == EStdKeyUpArrow - || aKeyEvent.iScanCode == EStdKeyDownArrow; + && WidgetType() != EListWidget ) + || ( aKeyEvent.iScanCode == EStdKeyLeftArrow + && WidgetType() != EListWidget ) + || aKeyEvent.iScanCode == EStdKeyUpArrow + || aKeyEvent.iScanCode == EStdKeyDownArrow; // handle arrow: draw highlight when arrow used - if ( arrowHasHandling ) + if( arrowHasHandling ) { - if ( !IsHighlightVisible() ) + if( !IsHighlightVisible() ) { - if ( aType == EEventKey || aType == EEventKeyUp ) + if( aType == EEventKey || aType == EEventKeyUp ) { SetHighlightVisibilityL( ETrue ); SetDefaultHighlightL( ETrue ); } - // override avkon's default highlight setting - resp = EKeyWasConsumed; + // 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 ) + if( aKeyEvent.iRepeats > 0 ) { // if repeated key events we move focus on EEventKey - if ( aType == EEventKey ) + if( aType == EEventKey ) { SetHighlightL( iWidget->CurrentItemIndex() ); } @@ -1136,13 +1200,13 @@ else { // if single event we move focus on EEventKeyUp - if ( aType == EEventKeyUp ) + if( aType == EEventKeyUp ) { SetHighlightL( iWidget->CurrentItemIndex() ); } } } - } + } else if( arrowKeyPressed ) { // ignore left and right arrows in list @@ -1150,19 +1214,19 @@ } // rocker select (short press) else if ( ( aKeyEvent.iScanCode == EStdKeyDevice3 ) && ( aType == EEventKeyDown ) ) - { - HandleRockerPressL(); - resp = EKeyWasConsumed; - } + { + HandleRockerPressL(); + resp = EKeyWasConsumed; + } else if ( iAllowLongPress && aType == EEventKey && aKeyEvent.iRepeats > 0 && - ( aKeyEvent.iScanCode == EStdKeyDevice3 - || aKeyEvent.iScanCode == EStdKeyEnter - || aKeyEvent.iScanCode == EStdKeyNkpEnter ) ) - { - HandleRockerPressL(); - resp = EKeyWasConsumed; - iAllowLongPress = EFalse; - } + ( aKeyEvent.iScanCode == EStdKeyDevice3 + || aKeyEvent.iScanCode == EStdKeyEnter + || aKeyEvent.iScanCode == EStdKeyNkpEnter ) ) + { + HandleRockerPressL(); + resp = EKeyWasConsumed; + iAllowLongPress = EFalse; + } return resp; } @@ -1172,20 +1236,22 @@ // // ----------------------------------------------------------------------------- // -void CMmWidgetContainer::SetSuiteModelL(CHnSuiteModel* aModel) +void CMmWidgetContainer::SetSuiteModelL( CHnSuiteModel* aModel ) { CHnSuiteModel* prevModel = GetMmModel()->GetSuiteModel(); - TInt numberOfItemsBefore (0); + TInt numberOfItemsBefore( 0 ); numberOfItemsBefore = GetMmModel()->NumberOfItems(); GetMmModel()->SetSuiteModelL( aModel ); + TBool highlightVisibleBefore = iWidget->IsVisible() && IsHighlightVisible(); + // This needs to be in place (disabling redraw) // to udpate widget internal state, however to wait for // drawing until all highlight set matters are solved. - iWidget->MakeVisible(EFalse); - if ( GetMmModel()->NumberOfItems() >= numberOfItemsBefore ) + iWidget->MakeVisible( EFalse ); + if( GetMmModel()->NumberOfItems() >= numberOfItemsBefore ) { HandleItemAdditionL(); } @@ -1193,15 +1259,20 @@ { HandleItemRemovalL(); } - if ( prevModel && aModel ) + if( prevModel && aModel ) { SetupWidgetLayoutL(); } - iWidget->MakeVisible(ETrue); + iWidget->MakeVisible( ETrue ); + + if( highlightVisibleBefore ) + { + SetHighlightVisibilityL( ETrue ); + } Widget()->View()->ItemDrawer()->ClearFlags( - CListItemDrawer::EPressedDownState ); - iPostProcessor->StartAt( iWidget->BottomItemIndex() + 1 ); + CListItemDrawer::EPressedDownState ); + iPostProcessor->StartAt( iWidget->BottomItemIndex() + 1 ); } // --------------------------------------------------------------------------- @@ -1209,19 +1280,18 @@ // --------------------------------------------------------------------------- // void CMmWidgetContainer::SetupDrawer() - { - iDrawer = STATIC_CAST(CMmListBoxItemDrawer*, iWidget->View()->ItemDrawer()); - } - + { + iDrawer = STATIC_CAST(CMmListBoxItemDrawer*, iWidget->View()->ItemDrawer()); + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // EXPORT_C THnSuiteWidgetType CMmWidgetContainer::WidgetType() - { - return EUnspecified; - } + { + return EUnspecified; + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- @@ -1245,11 +1315,11 @@ // Fix for EMWK-7NYKRJ // Matrix Menu: Scrollbar highligted when App Key is pressed while it is held - if ( AknLayoutUtils::PenEnabled() ) + if( AknLayoutUtils::PenEnabled() ) { CEikScrollBar* scrollBar = iWidget->ScrollBarFrame()->VerticalScrollBar(); - if ( scrollBar && scrollBar->IsVisible() ) + if( scrollBar && scrollBar->IsVisible() ) { TPointerEvent fakeButton1UpEvent; fakeButton1UpEvent.iType = TPointerEvent::EButton1Up; @@ -1274,21 +1344,21 @@ // --------------------------------------------------------------------------- // TInt CMmWidgetContainer::DeltaSquare( const TPoint aTapPoint, - const TPoint aPos ) - { - TInt delta( KErrNotFound ); - TInt height = aTapPoint.iY - aPos.iY; - TInt width = aTapPoint.iX - aPos.iX; + const TPoint aPos ) + { + TInt delta( KErrNotFound ); + TInt height = aTapPoint.iY - aPos.iY; + TInt width = aTapPoint.iX - aPos.iX; if( WidgetType() == EListWidget ) - { - delta = height * height + height * height; - } + { + delta = height * height + height * height; + } else - { - delta = height * height + width * width; - } - return delta; - } + { + delta = height * height + width * width; + } + return delta; + } // --------------------------------------------------------------------------- // @@ -1310,120 +1380,118 @@ // --------------------------------------------------------------------------- // EXPORT_C void CMmWidgetContainer::HandleItemAdditionL() - { - // only the the descended method should be invoked. - // this is needed to avoid codescanner warning - User::Leave( KErrNotSupported ); - } - + { + // only the the descended method should be invoked. + // this is needed to avoid codescanner warning + User::Leave( KErrNotSupported ); + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // EXPORT_C void CMmWidgetContainer::HandleItemRemovalL() - { - // only the the descended method should be invoked. - // this is needed to avoid codescanner warning - User::Leave( KErrNotSupported ); - } + { + // only the the descended method should be invoked. + // this is needed to avoid codescanner warning + User::Leave( KErrNotSupported ); + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // EXPORT_C void CMmWidgetContainer::StopMovingL() - { - if ( !AknLayoutUtils::PenEnabled() && iDragAndDropObserver ) - iDragAndDropObserver->HandleDragStopL( GetHighlight() ); - } - + { + if( !AknLayoutUtils::PenEnabled() && iDragAndDropObserver ) + iDragAndDropObserver->HandleDragStopL( GetHighlight() ); + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // void CMmWidgetContainer::ScrollViewIfNeededL() - { - if ((iWidget->BottomItemIndex() / ColumnsInCurrentView() - - iWidget->TopItemIndex() / ColumnsInCurrentView() ) <= 1 ) - { - return; - } + { + if( ( iWidget->BottomItemIndex() / ColumnsInCurrentView() + - iWidget->TopItemIndex() / ColumnsInCurrentView() ) <= 1 ) + { + return; + } - TBool needToScrollUp = - GetHighlight() - iWidget->TopItemIndex() < ColumnsInCurrentView() - && iWidget->TopItemIndex() != 0; + TBool needToScrollUp = + GetHighlight() - iWidget->TopItemIndex() < ColumnsInCurrentView() + && iWidget->TopItemIndex() != 0; - TBool needToScrollDown = - iWidget->BottomItemIndex() - GetHighlight() < ColumnsInCurrentView() - && iWidget->BottomItemIndex() / ColumnsInCurrentView() - != ( NumberOfItems() - 1 ) / ColumnsInCurrentView(); + TBool needToScrollDown = + iWidget->BottomItemIndex() - GetHighlight() < ColumnsInCurrentView() + && iWidget->BottomItemIndex() / ColumnsInCurrentView() + != ( NumberOfItems() - 1 ) / ColumnsInCurrentView(); - if ( WidgetType() == EGridWidget ) - { - // TODO: temporary - invisible partial items in MCL grid :/ - needToScrollDown = - iWidget->BottomItemIndex() - ColumnsInCurrentView() - GetHighlight() < ColumnsInCurrentView() - && ( iWidget->BottomItemIndex() / ColumnsInCurrentView() ) - 1 - != ( NumberOfItems() - 1 ) / ColumnsInCurrentView() - && iWidget->BottomItemIndex() - iWidget->TopItemIndex() - > ColumnsInCurrentView() * RowsInCurrentView(); - } + if( WidgetType() == EGridWidget ) + { + // TODO: temporary - invisible partial items in MCL grid :/ + needToScrollDown = + iWidget->BottomItemIndex() - ColumnsInCurrentView() - GetHighlight() < ColumnsInCurrentView() + && ( iWidget->BottomItemIndex() / ColumnsInCurrentView() ) - 1 + != ( NumberOfItems() - 1 ) / ColumnsInCurrentView() + && iWidget->BottomItemIndex() - iWidget->TopItemIndex() + > ColumnsInCurrentView() * RowsInCurrentView(); + } - if ( needToScrollUp ) - { + if( needToScrollUp ) + { #ifdef RD_UI_TRANSITION_EFFECTS_LIST - MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iDrawer->Gc() ); - if ( transApi ) - { - transApi->SetMoveType( MAknListBoxTfxInternal::EListScrollUp ); - } + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iDrawer->Gc() ); + if( transApi ) + { + transApi->SetMoveType( MAknListBoxTfxInternal::EListScrollUp ); + } #endif - iDrawer->RemoveFloatingItems(); - iWidget->View()->VScrollTo( - iWidget->TopItemIndex() - ColumnsInCurrentView() ); + iDrawer->RemoveFloatingItems(); + iWidget->View()->VScrollTo( + iWidget->TopItemIndex() - ColumnsInCurrentView() ); #ifdef RD_UI_TRANSITION_EFFECTS_LIST - if ( transApi ) - { - transApi->Draw( Rect() ); - } + if( transApi ) + { + transApi->Draw( Rect() ); + } #endif - UpdateViewScrollBarThumbs(); - } - else if ( needToScrollDown ) - { + UpdateViewScrollBarThumbs(); + } + else if( needToScrollDown ) + { #ifdef RD_UI_TRANSITION_EFFECTS_LIST - MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iDrawer->Gc() ); - if ( transApi ) - { - transApi->SetMoveType( MAknListBoxTfxInternal::EListScrollDown ); - } + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iDrawer->Gc() ); + if( transApi ) + { + transApi->SetMoveType( MAknListBoxTfxInternal::EListScrollDown ); + } #endif - iDrawer->RemoveFloatingItems(); - iWidget->View()->VScrollTo( - iWidget->TopItemIndex() + ColumnsInCurrentView() ); + iDrawer->RemoveFloatingItems(); + iWidget->View()->VScrollTo( + iWidget->TopItemIndex() + ColumnsInCurrentView() ); #ifdef RD_UI_TRANSITION_EFFECTS_LIST - if ( transApi ) - { - transApi->Draw( Rect() ); - } + if( transApi ) + { + transApi->Draw( Rect() ); + } #endif - UpdateViewScrollBarThumbs(); - } - } + UpdateViewScrollBarThumbs(); + } + } //---------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // void CMmWidgetContainer::UpdateViewScrollBarThumbs() - { + { - } + } //---------------------------------------------------------------------------- // @@ -1431,15 +1499,15 @@ // void CMmWidgetContainer::StartOrStopMarquee() { - if ( iMarqueeAdapter ) + if( iMarqueeAdapter ) { TBool marqueeShouldBeEnabled = iHasFocus && iInForeground && !iIsFaded && !IsEditMode(); - // logical Ex-OR + // logical Ex-OR if ( !!marqueeShouldBeEnabled != !!iMarqueeAdapter->IsMarqueeEnabled() ) { - if ( !marqueeShouldBeEnabled ) + if( !marqueeShouldBeEnabled ) { iMarqueeAdapter->StopMarqueeDrawing(); } @@ -1454,89 +1522,89 @@ // --------------------------------------------------------------------------- // void CMmWidgetContainer::SetHighlightAfterDrag() - { - if ( AknLayoutUtils::PenEnabled() && - iDraggedIndex != KErrNotFound && - iDraggedIndex != Widget()->CurrentItemIndex() - && iDraggedIndex < NumberOfItems() ) - { - TBool isFolder(EFalse); - CHnSuiteModel* model = GetMmModel()->GetSuiteModel(); - CHnItemModel* onItemModel = model->GetItemModel( - model->IdByIndex( Widget()->CurrentItemIndex() )); - if (onItemModel) - { - isFolder = onItemModel->GetItemType() == EItemTypeParentFolder || - onItemModel->GetItemType() == EItemTypeFolder; - } - if (!isFolder) - { - Widget()->View()->SetCurrentItemIndex( iDraggedIndex ); - } - } - } + { + if( AknLayoutUtils::PenEnabled() + && iDraggedIndex != KErrNotFound + && iDraggedIndex != Widget()->CurrentItemIndex() + && iDraggedIndex < NumberOfItems() ) + { + TBool isFolder( EFalse ); + CHnSuiteModel* model = GetMmModel()->GetSuiteModel(); + CHnItemModel* onItemModel = model->GetItemModel( + model->IdByIndex( Widget()->CurrentItemIndex() )); + if( onItemModel ) + { + isFolder = onItemModel->GetItemType() == EItemTypeParentFolder + || onItemModel->GetItemType() == EItemTypeFolder; + } + if( !isFolder ) + { + Widget()->View()->SetCurrentItemIndex( iDraggedIndex ); + } + } + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // void CMmWidgetContainer::ValidateWidgetCurrentItemIndex() - { - if (Widget()->CurrentItemIndex() >= GetMmModel()->NumberOfItems() - || Widget()->CurrentItemIndex() == KErrNotFound ) - { - iCurrentHighlight = GetMmModel()->NumberOfItems(); - if( iCurrentHighlight > 0 ) - { - Widget()->View()->SetCurrentItemIndex( --iCurrentHighlight ); - } - else - { - iCurrentHighlight = KErrNotFound ; - } - } - } + { + if( Widget()->CurrentItemIndex() >= GetMmModel()->NumberOfItems() + || Widget()->CurrentItemIndex() == KErrNotFound ) + { + iCurrentHighlight = GetMmModel()->NumberOfItems(); + if( iCurrentHighlight > 0 ) + { + Widget()->View()->SetCurrentItemIndex( --iCurrentHighlight ); + } + else + { + iCurrentHighlight = KErrNotFound; + } + } + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // EXPORT_C void CMmWidgetContainer::CacheWidgetPosition() - { - iWidgetPositionCache.iVerticalItemOffset = VerticalItemOffset(); - iWidgetPositionCache.iTopItemIndex = Widget()->TopItemIndex(); - iWidgetPositionCache.iLandscape - = Layout_Meta_Data::IsLandscapeOrientation(); - iWidgetPositionCache.iHighlightedItemId = KErrNotFound; + { + iWidgetPositionCache.iVerticalItemOffset = VerticalItemOffset(); + iWidgetPositionCache.iTopItemIndex = Widget()->TopItemIndex(); + iWidgetPositionCache.iLandscape + = Layout_Meta_Data::IsLandscapeOrientation(); + iWidgetPositionCache.iHighlightedItemId = KErrNotFound; - TInt highlightedItemIndex = Widget()->CurrentItemIndex(); - CHnSuiteModel* suiteModel = GetMmModel()->GetSuiteModel(); - if ( suiteModel && highlightedItemIndex != KErrNotFound - && suiteModel->GetSuiteHighlight() == highlightedItemIndex - && ItemIsVisible( highlightedItemIndex ) ) - { - iWidgetPositionCache.iHighlightedItemId = + TInt highlightedItemIndex = Widget()->CurrentItemIndex(); + CHnSuiteModel* suiteModel = GetMmModel()->GetSuiteModel(); + if( suiteModel && highlightedItemIndex != KErrNotFound + && suiteModel->GetSuiteHighlight() == highlightedItemIndex + && ItemIsVisible( highlightedItemIndex ) ) + { + iWidgetPositionCache.iHighlightedItemId = suiteModel->IdByIndex( highlightedItemIndex ); - } + } - iWidgetPositionCache.iValid = ETrue; - } + iWidgetPositionCache.iValid = ETrue; + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // EXPORT_C void CMmWidgetContainer::RestoreWidgetPosition() - { - if (iWidgetPositionCache.iValid) - { - if ( iWidgetPositionCache.iLandscape - == Layout_Meta_Data::IsLandscapeOrientation() ) - { + { + if( iWidgetPositionCache.iValid ) + { + if( iWidgetPositionCache.iLandscape + == Layout_Meta_Data::IsLandscapeOrientation() ) + { // If view position was cached during boundary effect, correct the // cached position. - if ( iWidgetPositionCache.iTopItemIndex == 0 && - iWidgetPositionCache.iVerticalItemOffset > 0 ) + if( iWidgetPositionCache.iTopItemIndex == 0 + && iWidgetPositionCache.iVerticalItemOffset > 0 ) { iWidgetPositionCache.iVerticalItemOffset = 0; // This corrects the position cached during the upper boundary @@ -1544,139 +1612,139 @@ // effect. } - Widget()->View()->SetTopItemIndex(iWidgetPositionCache.iTopItemIndex); - SetVerticalItemOffset(iWidgetPositionCache.iVerticalItemOffset); - TRAP_IGNORE( AlignBottomOfViewL() ); + Widget()->View()->SetTopItemIndex(iWidgetPositionCache.iTopItemIndex); + SetVerticalItemOffset( iWidgetPositionCache.iVerticalItemOffset ); + TRAP_IGNORE( AlignBottomOfViewL() ); - // Important: If an item that was previously highlighted and visible is - // still highlighted and yet somehow is not visible after the position - // has been restored, fix the problem by scrolling the view until that - // item is visible again: - CHnSuiteModel* suiteModel = GetMmModel()->GetSuiteModel(); - if ( suiteModel && IsHighlightVisible() ) - { - TInt highlightedItemIndex = suiteModel->GetSuiteHighlight(); - TInt highlightedItemId = highlightedItemIndex != KErrNotFound ? - suiteModel->IdByIndex( highlightedItemIndex ) : KErrNotFound; - if ( highlightedItemId != KErrNotFound - && highlightedItemId == iWidgetPositionCache.iHighlightedItemId - && !ItemIsVisible( highlightedItemIndex ) ) - { - TRAP_IGNORE( ScrollToItemL( highlightedItemIndex ) ); - } - } - } - else - { - TRAP_IGNORE( ScrollToItemL(Widget()->CurrentItemIndex()) ); - } + // Important: If an item that was previously highlighted and visible is + // still highlighted and yet somehow is not visible after the position + // has been restored, fix the problem by scrolling the view until that + // item is visible again: + CHnSuiteModel* suiteModel = GetMmModel()->GetSuiteModel(); + if( suiteModel && IsHighlightVisible() ) + { + TInt highlightedItemIndex = suiteModel->GetSuiteHighlight(); + TInt highlightedItemId = highlightedItemIndex != KErrNotFound ? + suiteModel->IdByIndex( highlightedItemIndex ) : KErrNotFound; + if ( highlightedItemId != KErrNotFound + && highlightedItemId == iWidgetPositionCache.iHighlightedItemId + && !ItemIsVisible( highlightedItemIndex ) ) + { + TRAP_IGNORE( ScrollToItemL( highlightedItemIndex ) ); + } + } + } + else + { + TRAP_IGNORE( ScrollToItemL(Widget()->CurrentItemIndex()) ); + } - iWidgetPositionCache.iValid = EFalse; - } - } + iWidgetPositionCache.iValid = EFalse; + } + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // -void CMmWidgetContainer::MakeVisible(TBool aVisible) - { - if ( !aVisible ) - { - RestoreWidgetPosition(); - CacheWidgetPosition(); - iDrawer->RemoveFloatingItems(); - } - else if ( aVisible ) - { - RestoreWidgetPosition(); - } - CCoeControl::MakeVisible(aVisible); - iWidget->MakeVisible(aVisible); - if ( !aVisible ) +void CMmWidgetContainer::MakeVisible( TBool aVisible ) + { + if( !aVisible ) + { + RestoreWidgetPosition(); + CacheWidgetPosition(); + iDrawer->RemoveFloatingItems(); + } + else if( aVisible ) { - SetHighlightVisibilityL( EFalse ); + RestoreWidgetPosition(); } - } + CCoeControl::MakeVisible( aVisible ); + iWidget->MakeVisible( aVisible ); + if( !aVisible ) + { + TRAP_IGNORE( SetHighlightVisibilityL( EFalse ) ); + } + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // EXPORT_C void CMmWidgetContainer::ResetWidgetPosition() - { - iWidgetPositionCache.iVerticalItemOffset = 0; - iWidgetPositionCache.iTopItemIndex = 0; - iWidgetPositionCache.iValid = EFalse; - iWidgetPositionCache.iHighlightedItemId = KErrNotFound; - Widget()->SetTopItemIndex(0); - SetVerticalItemOffset(0); - } + { + iWidgetPositionCache.iVerticalItemOffset = 0; + iWidgetPositionCache.iTopItemIndex = 0; + iWidgetPositionCache.iValid = EFalse; + iWidgetPositionCache.iHighlightedItemId = KErrNotFound; + Widget()->SetTopItemIndex( 0 ); + SetVerticalItemOffset( 0 ); + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // EXPORT_C void CMmWidgetContainer::NumberOfItemsChangedL( TItemsChangeType aChange ) - { - if ( AknLayoutUtils::PenEnabled() ) - { - CacheWidgetPosition(); - Widget()->View()->SetDisableRedraw( ETrue ); + { + if( AknLayoutUtils::PenEnabled() ) + { + CacheWidgetPosition(); + Widget()->View()->SetDisableRedraw( ETrue ); - HandleNumberOfItemsChangedL( aChange ); + HandleNumberOfItemsChangedL( aChange ); - Widget()->View()->SetDisableRedraw( EFalse ); - RestoreWidgetPosition(); - } - else - { - // there is no need to cache and restore widget position in non-touch; - // moreover, it can cause some problems with scrolling when adding - // new folder - HandleNumberOfItemsChangedL( aChange ); - } - } + Widget()->View()->SetDisableRedraw( EFalse ); + RestoreWidgetPosition(); + } + else + { + // there is no need to cache and restore widget position in non-touch; + // moreover, it can cause some problems with scrolling when adding + // new folder + HandleNumberOfItemsChangedL( aChange ); + } + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // void CMmWidgetContainer::HandleNumberOfItemsChangedL( TItemsChangeType aChange ) - { - SetHighlightVisibilityL( EFalse ); - if ( aChange == EItemsAdded ) - { - HandleItemAdditionL(); - } - else if ( aChange == EItemsRemoved ) - { - HandleItemRemovalL(); - } - } + { + SetHighlightVisibilityL( EFalse ); + if( aChange == EItemsAdded ) + { + HandleItemAdditionL(); + } + else if( aChange == EItemsRemoved ) + { + HandleItemRemovalL(); + } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // TBool CMmWidgetContainer::AlignBottomOfViewL() - { - TInt scrollConsumed( EFalse ); - TInt pixelsToScroll( 0 ); + { + TInt scrollConsumed( EFalse ); + TInt pixelsToScroll( 0 ); - if ( NumberOfItems() > 0 ) - { - pixelsToScroll = CalcBottomPixelsToScroll(); - } + if( NumberOfItems() > 0 ) + { + pixelsToScroll = CalcBottomPixelsToScroll(); + } - if ( pixelsToScroll != 0 ) - { - ScrollInPixelsL( pixelsToScroll ); - scrollConsumed = ETrue; - } + if( pixelsToScroll != 0 ) + { + ScrollInPixelsL( pixelsToScroll ); + scrollConsumed = ETrue; + } - return scrollConsumed; - } + return scrollConsumed; + } // ----------------------------------------------------------------------------- // @@ -1687,11 +1755,11 @@ const TInt firstItemIndex( 0 ); TInt lastItemIndex = NumberOfItems() - 1; TInt viewHeight = Widget()->View()->ViewRect().Height(); - TInt lastItemBottomY = Widget()->View()->ItemPos(lastItemIndex).iY - + Widget()->ItemHeight(); + TInt lastItemBottomY = Widget()->View()->ItemPos( lastItemIndex ).iY + + Widget()->ItemHeight(); TInt pixelsToScroll( 0 ); - if ( Widget()->ScrollBarFrame()->VerticalScrollBar()->IsVisible() ) + if( Widget()->ScrollBarFrame()->VerticalScrollBar()->IsVisible() ) { pixelsToScroll = Min( 0, lastItemBottomY - viewHeight ); } @@ -1703,7 +1771,6 @@ return pixelsToScroll; } - // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -1717,155 +1784,156 @@ // // ----------------------------------------------------------------------------- // -EXPORT_C TBool CMmWidgetContainer::ItemIsFullyVisible(TInt aIndex) - { - return ItemIsVisible( aIndex ) - && !Widget()->View()->ItemIsPartiallyVisible(aIndex); - } +EXPORT_C TBool CMmWidgetContainer::ItemIsFullyVisible( TInt aIndex ) + { + return ItemIsVisible( aIndex ) + && !Widget()->View()->ItemIsPartiallyVisible( aIndex ); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // -void CMmWidgetContainer::ScrollInPixelsL(TInt aPixels) - { - SetupScrollingEffectsL( aPixels > 0 ); +void CMmWidgetContainer::ScrollInPixelsL( TInt aPixels ) + { + SetupScrollingEffectsL( aPixels > 0 ); - if ( AknLayoutUtils::PenEnabled() ) - { - Widget()->HandlePhysicsScrollEventL(aPixels); - } - else - { - // non-touch avkon doesn't seem to support scrolling by given - // amount of pixels - TInt delta = aPixels / Widget()->View()->ItemHeight(); + if( AknLayoutUtils::PenEnabled() ) + { + Widget()->HandlePhysicsScrollEventL( aPixels ); + } + else + { + // non-touch avkon doesn't seem to support scrolling by given + // amount of pixels + TInt delta = aPixels / Widget()->View()->ItemHeight(); - Widget()->View()->VScrollTo( Widget()->TopItemIndex() + - delta * ColumnsInCurrentView() ); - } - } + Widget()->View()->VScrollTo( Widget()->TopItemIndex() + + delta * ColumnsInCurrentView() ); + } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // -EXPORT_C TBool CMmWidgetContainer::ScrollToItemL(TInt aIndex) - { - TInt scrollConsumed(EFalse); - if (aIndex >= 0 && aIndex <= NumberOfItems()) - { - scrollConsumed = AlignBottomOfViewL(); - if ( !scrollConsumed && Widget()->View()->ItemIsPartiallyVisible(aIndex)) - { -// the case when the item is partially visible at top or -// bottom of screen. Th e view is scrolled the offset to -// make the item entirely visible. - TInt offsetBottom = Widget()->View()->ItemPos(aIndex).iY - + Widget()->ItemHeight() - - Widget()->View()->ViewRect().Height(); - TInt offsetTop = Widget()->View()->ItemPos(aIndex).iY; - TBool takeTop = Abs(offsetTop) < Abs(offsetBottom); - TInt offset = (takeTop) ? offsetTop : offsetBottom; - if (offset != 0) - { - ScrollInPixelsL( offset ); - scrollConsumed = ETrue; - } +EXPORT_C TBool CMmWidgetContainer::ScrollToItemL( TInt aIndex ) + { + TInt scrollConsumed( EFalse ); + if( aIndex >= 0 && aIndex <= NumberOfItems() ) + { + scrollConsumed = AlignBottomOfViewL(); + if ( !scrollConsumed && Widget()->View()->ItemIsPartiallyVisible(aIndex)) + { + // the case when the item is partially visible at top or + // bottom of screen. Th e view is scrolled the offset to + // make the item entirely visible. + TInt offsetBottom = Widget()->View()->ItemPos( aIndex ).iY + + Widget()->ItemHeight() + - Widget()->View()->ViewRect().Height(); + TInt offsetTop = Widget()->View()->ItemPos( aIndex ).iY; + TBool takeTop = Abs( offsetTop ) < Abs( offsetBottom ); + TInt offset = ( takeTop ) ? offsetTop : offsetBottom; + if( offset != 0 ) + { + ScrollInPixelsL( offset ); + scrollConsumed = ETrue; + } - } - else if (!Widget()->View()->ItemIsVisible(aIndex)) - { -// the case when the item is not visible on screen - SetupScrollingEffectsL( aIndex > Widget()->BottomItemIndex() ); - Widget()->ScrollToMakeItemVisible(aIndex); - AlignBottomOfViewL(); - scrollConsumed = ETrue; - } - } - return scrollConsumed; - } + } + else if( !Widget()->View()->ItemIsVisible( aIndex ) ) + { + // the case when the item is not visible on screen + SetupScrollingEffectsL( aIndex > Widget()->BottomItemIndex() ); + Widget()->ScrollToMakeItemVisible( aIndex ); + AlignBottomOfViewL(); + scrollConsumed = ETrue; + } + } + return scrollConsumed; + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // -void CMmWidgetContainer::SetupScrollingEffectsL(TBool aDown) - { +void CMmWidgetContainer::SetupScrollingEffectsL( TBool aDown ) + { #ifdef RD_UI_TRANSITION_EFFECTS_LIST - MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( - iDrawer->Gc()); - if (transApi) - { - MAknListBoxTfxInternal::TMovementType movementType; - movementType = (aDown == (TInt)ETrue ) ? MAknListBoxTfxInternal::EListScrollDown - : MAknListBoxTfxInternal::EListScrollUp; - transApi->SetMoveType(movementType); - } + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( + iDrawer->Gc() ); + if( transApi ) + { + MAknListBoxTfxInternal::TMovementType movementType; + movementType = ( aDown == (TInt ) ETrue ) + ? MAknListBoxTfxInternal::EListScrollDown + : MAknListBoxTfxInternal::EListScrollUp; + transApi->SetMoveType( movementType ); + } #endif - } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // EXPORT_C void CMmWidgetContainer::PrepareForGarbage() - { -// This is called when the suite model is destoyed and the container is set to be destroyed -// by the garbage collector. There should be no redraws done to the widget in this period -// because this will cause the screen to be redrawn only containing the balnk background. -// Before garbage cleanup an asynchronous redraw event may intend to redraw the widget. -// SetDisableRedraw() prevents redrawing. Animator is also prepared for garbage so there is -// no instance which can enable redraw of the widget. - Widget()->View()->SetDisableRedraw( ETrue ); - iDrawer->RemoveFloatingItems(); -// Prapares the animator for garbage, which means it blocks any animator drawing. - iDrawer->GetAnimator()->PrepareForGarbage(); - } + { + // This is called when the suite model is destoyed and the container is set to be destroyed + // by the garbage collector. There should be no redraws done to the widget in this period + // because this will cause the screen to be redrawn only containing the balnk background. + // Before garbage cleanup an asynchronous redraw event may intend to redraw the widget. + // SetDisableRedraw() prevents redrawing. Animator is also prepared for garbage so there is + // no instance which can enable redraw of the widget. + Widget()->View()->SetDisableRedraw( ETrue ); + iDrawer->RemoveFloatingItems(); + // Prapares the animator for garbage, which means it blocks any animator drawing. + iDrawer->GetAnimator()->PrepareForGarbage(); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmWidgetContainer::HandleLongTapEventL( const TPoint& aPenEventLocation, - const TPoint& aPenEventScreenLocation ) - { - TInt index( KErrNotFound ); - if ( iWidget->View()->XYPosToItemIndex( aPenEventLocation, index ) ) - { - SetHighlightVisibilityL( ETrue ); - iLongTapInProgress = ETrue; - if ( iLongTapObserver ) - { - iLongTapObserver->HandleLongTapEventL( aPenEventScreenLocation ); - } - } - } + const TPoint& aPenEventScreenLocation ) + { + TInt index( KErrNotFound ); + if( iWidget->View()->XYPosToItemIndex( aPenEventLocation, index ) ) + { + SetHighlightVisibilityL( ETrue ); + iLongTapInProgress = ETrue; + if( iLongTapObserver ) + { + iLongTapObserver->HandleLongTapEventL( aPenEventScreenLocation ); + } + } + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // EXPORT_C void CMmWidgetContainer::SetLongTapObserver( MMmLongTapObserver* aObserver ) - { - iLongTapObserver = aObserver; - } + { + iLongTapObserver = aObserver; + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // EXPORT_C void CMmWidgetContainer::EndLongTapL( TBool aStopTimer ) - { - if ( iLongTapInProgress ) - { - iLongTapInProgress = EFalse; - if( aStopTimer ) - { - SetHighlightVisibilityL( EFalse ); - } - } - } + { + if( iLongTapInProgress ) + { + iLongTapInProgress = EFalse; + if( aStopTimer ) + { + SetHighlightVisibilityL( EFalse ); + } + } + } // --------------------------------------------------------------------------- // @@ -1874,84 +1942,70 @@ void CMmWidgetContainer::HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ) { -// handle same behaviour in edit mode and normal mode - switch ( aEventType ) - { - case MEikListBoxObserver::EEventPenDownOnItem: - { - iDragOccured = EFalse; - if ( !iLongTapInProgress ) - { - SetHighlightVisibilityL( ETrue ); - } - break; - } - case MEikListBoxObserver::EEventItemSingleClicked: - { - if ( !iDragOccured && !iLongTapInProgress ) - { - SetHighlightL( Widget()->CurrentItemIndex() ); - SetHighlightVisibilityL( EFalse ); - } - iDragOccured = EFalse; - break; - } - case MEikListBoxObserver::EEventItemDraggingActioned: - { - SetHighlightVisibilityL( EFalse ); - iDragOccured = ETrue; - break; - } - case MEikListBoxObserver::EEventPanningStarted: - case MEikListBoxObserver::EEventPanningStopped: - case MEikListBoxObserver::EEventFlickStarted: - case MEikListBoxObserver::EEventFlickStopped: - { - SetHighlightVisibilityL( EFalse ); - break; - } - } + // handle same behaviour in edit mode and normal mode + switch( aEventType ) + { + case MEikListBoxObserver::EEventPenDownOnItem: + case MEikListBoxObserver::EEventItemSingleClicked: + { + iDragOccured = EFalse; + break; + } + case MEikListBoxObserver::EEventItemDraggingActioned: + { + iDragOccured = ETrue; + break; + } + } -// handle different behaviour in edit mode and normal mode - if ( !IsEditMode() ) - { - switch ( aEventType ) - { - case MEikListBoxObserver::EEventFlickStarted: - { - static_cast( - Widget()->View()->ItemDrawer() )-> - EnableCachedDataUse( ETrue ); - break; - } - case MEikListBoxObserver::EEventFlickStopped: - { - static_cast( - Widget()->View()->ItemDrawer() )-> - EnableCachedDataUse( EFalse ); - DrawView(); - break; - } - } - } - else - { - switch ( aEventType ) - { - case MEikListBoxObserver::EEventFlickStopped: - { - // this fixes some problems with messed edit mode - // caused by kinetic scrolling - iDrawer->GetAnimator()->SetNextRedrawToWholeScreen(); - break; - } - } - } + // handle different behaviour in edit mode and normal mode + if( !IsEditMode() ) + { + switch( aEventType ) + { + case MEikListBoxObserver::EEventFlickStarted: + case MEikListBoxObserver::EEventPanningStarted: + { + static_cast( + Widget()->View()->ItemDrawer() )-> + EnableCachedDataUse( ETrue ); + break; + } + case MEikListBoxObserver::EEventFlickStopped: + { + static_cast( + Widget()->View()->ItemDrawer() )-> + EnableCachedDataUse( EFalse ); + DrawView(); + break; + } + case MEikListBoxObserver::EEventPanningStopped: + { + static_cast( + Widget()->View()->ItemDrawer() )-> + EnableCachedDataUse( EFalse ); + break; + } + } + } + else + { + switch( aEventType ) + { + case MEikListBoxObserver::EEventFlickStopped: + { + // this fixes some problems with messed edit mode + // caused by kinetic scrolling + iDrawer->GetAnimator()->SetNextRedrawToWholeScreen(); + break; + } + } + } - if ( iListBoxObserver && !iLongTapInProgress && !iDrawer->IsDraggable() ) + if ( aEventType == MEikListBoxObserver::EEventItemSingleClicked && + iListBoxObserver && !iLongTapInProgress && !iDrawer->IsDraggable() ) { iListBoxObserver->HandleListBoxEventL( aListBox, aEventType ); } } - //End of file diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menusuites/foldersuite/bwins/dummyCu.def --- a/menufw/menusuites/foldersuite/bwins/dummyCu.def Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?E32Main@@YAHXZ @ 1 NONAME ; int E32Main(void) - diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menusuites/foldersuite/data/matrixmenudata.dtd --- a/menufw/menusuites/foldersuite/data/matrixmenudata.dtd Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menusuites/foldersuite/data/matrixmenudata.dtd Wed May 12 13:22:51 2010 +0300 @@ -296,5 +296,114 @@ --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menusuites/foldersuite/data/matrixmenudata.xml --- a/menufw/menusuites/foldersuite/data/matrixmenudata.xml Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menusuites/foldersuite/data/matrixmenudata.xml Wed May 12 13:22:51 2010 +0300 @@ -12,11 +12,13 @@ mask_id="16399" icon_skin_minor_id="0x1ead" icon_skin_major_id="0x101F86E3"> --> - - + + + + - - - - - - - + + - - - - - - + + + @@ -114,90 +92,77 @@ + + - + - + icon_file="aimcsplugin.mif" + icon_id="16394" + mask_id="16395" + long_name="&qtn_apps_connectivity_list;"/> + - + icon_file="aimcsplugin.mif" + icon_id="16392" + mask_id="16393" + long_name="&qtn_apps_installations_list;"/> + - - - - - - + + + + + + - - - - + icon_id="16404" + mask_id="16405" + param="messaging:audiomsg"/> - - - - - - + + + + + + + + + + + diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menusuites/foldersuite/eabi/dummyCu.def --- a/menufw/menusuites/foldersuite/eabi/dummyCu.def Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z7E32Mainv @ 1 NONAME - diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menusuites/foldersuite/group/foldersuite.mmp --- a/menufw/menusuites/foldersuite/group/foldersuite.mmp Mon Mar 22 15:12:36 2010 +0200 +++ b/menufw/menusuites/foldersuite/group/foldersuite.mmp Wed May 12 13:22:51 2010 +0300 @@ -21,7 +21,7 @@ #include TARGET foldersuite -TARGETTYPE NONE +TARGETTYPE NONE APP_LAYER_SYSTEMINCLUDE diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menusuites/foldersuite/loc/matrixmenudata.loc Binary file menufw/menusuites/foldersuite/loc/matrixmenudata.loc has changed diff -r e01a28ecba3f -r 45cc9ca502a9 menufw/menusuites/foldersuite/src/dummyC.cpp --- a/menufw/menusuites/foldersuite/src/dummyC.cpp Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +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: -* -*/ - -#include - -EXPORT_C int E32Main() -{ - return 0; -} diff -r e01a28ecba3f -r 45cc9ca502a9 package_definition.xml --- a/package_definition.xml Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/rom/tscontextservices.iby --- a/taskswitcher/contextengine/rom/tscontextservices.iby Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/rom/tscontextservices.iby Wed May 12 13:22:51 2010 +0300 @@ -21,10 +21,5 @@ // 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 e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswpreviewprovider/inc/previewmsg.h --- a/taskswitcher/contextengine/tsfswpreviewprovider/inc/previewmsg.h Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/inc/previewmsg.h Wed May 12 13:22:51 2010 +0300 @@ -38,7 +38,9 @@ // From PreviewProvider ECOM plugin to PreviewProviderClient. EPreviewReady, EAckPreviewReady, - EUnregisterReady + EUnregisterReady, + EBitmapRotationNeeded90, + EBitmapRotationNeeded270 }; } diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswpreviewprovider/inc/tspreviewobserver.h --- a/taskswitcher/contextengine/tsfswpreviewprovider/inc/tspreviewobserver.h Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/inc/tspreviewobserver.h Wed May 12 13:22:51 2010 +0300 @@ -51,7 +51,17 @@ * * @param aWgId Window group id of the application. */ - virtual void HandleFswPpApplicationUnregistered( TInt aWgId ) = 0; + virtual void HandleFswPpApplicationUnregistered( TInt aWgId ) = 0; + + /** + * Called when screenshot for the application needs rotation. Client should + * rotate bitmap for the given aWgId by 90 degrees, otherwise it will be + * displayed incorrectly. + * + * @param aWgId Window group id of the application + * @param aClockwise marks direction of the rotation (ETrue - clockwise, EFalse - counter clockwise) + */ + virtual void HandleFswPpApplicationBitmapRotation( TInt aWgId, TBool aClockwise ) = 0; }; #endif // TSPREVIEWOBSERVER_H diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswpreviewprovider/inc/tspropertylistener.h --- a/taskswitcher/contextengine/tsfswpreviewprovider/inc/tspropertylistener.h Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/inc/tspropertylistener.h Wed May 12 13:22:51 2010 +0300 @@ -30,7 +30,9 @@ { EOperationNone, EOperationUnregister, - EOperationBitmapUpdated + EOperationBitmapUpdated, + EOperationBitmapRotation90, + EOperationBitmapRotation270 }; /** diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswpreviewprovider/src/tspreviewproviderclient.cpp --- a/taskswitcher/contextengine/tsfswpreviewprovider/src/tspreviewproviderclient.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/src/tspreviewproviderclient.cpp Wed May 12 13:22:51 2010 +0300 @@ -205,6 +205,20 @@ SetProperties( handle, id, EOperationUnregister ); } break; + case NPreviewMsg::EBitmapRotationNeeded90: + { + const TInt id = in.ReadInt32L(); + const TInt handle = in.ReadInt32L(); + SetProperties( handle, id, EOperationBitmapRotation90 ); + } + break; + case NPreviewMsg::EBitmapRotationNeeded270: + { + const TInt id = in.ReadInt32L(); + const TInt handle = in.ReadInt32L(); + SetProperties( handle, id, EOperationBitmapRotation270 ); + } + break; } TSLOG_OUT(); diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswpreviewprovider/src/tspropertylistener.cpp --- a/taskswitcher/contextengine/tsfswpreviewprovider/src/tspropertylistener.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/src/tspropertylistener.cpp Wed May 12 13:22:51 2010 +0300 @@ -69,6 +69,16 @@ iObs.HandleFswPpApplicationChange( iWgId, iFbsBitmapId ); break; } + case EOperationBitmapRotation90: + { + iObs.HandleFswPpApplicationBitmapRotation( iWgId, ETrue ); + break; + } + case EOperationBitmapRotation270: + { + iObs.HandleFswPpApplicationBitmapRotation( iWgId, EFalse ); + break; + } default: break; } diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/inc/previewprovidercrp.h --- a/taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/inc/previewprovidercrp.h Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/inc/previewprovidercrp.h Wed May 12 13:22:51 2010 +0300 @@ -152,6 +152,11 @@ void UnregisterComplete( TInt aWgId ); /** + * Notifies the PreviewProviderClient that specific bitmap needs rotation. + */ + void BitmapRotationNeeded( TInt aWgId, TBool aClockwise ); + + /** * Uses window server front buffer to create a screenshot. * @param aFront preallocated destination bitmap * @param aFront Front buffer. @@ -171,6 +176,9 @@ TSize iScreenshotSize; TDisplayMode iScreenshotMode; RArray iWgIds; + TTime iScreenChangedTime; // fix for orientation changed/wg group changed problem + TBool iClockwiseRot; // for marking rotation direction + TBool iLastWgIdRedraw; }; #endif // PREVIEWPROVIDERCRP_H diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/src/previewprovidercrp.cpp --- a/taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/src/previewprovidercrp.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/src/previewprovidercrp.cpp Wed May 12 13:22:51 2010 +0300 @@ -33,6 +33,7 @@ // CONSTANTS const TInt KImpId( 0x20016BEC ); +const TInt KMinTimeForOrientationSwitch = 1; // 1 second // -------------------------------------------------------------------------- // CPreviewProviderCRP::CreateL @@ -52,7 +53,8 @@ // -------------------------------------------------------------------------- // void CPreviewProviderCRP::ConstructL() - { + { + iLastWgIdRedraw = ETrue; } // -------------------------------------------------------------------------- @@ -145,7 +147,10 @@ TSLOG_IN(); BaseConstructL( aEnv, aId, aOwner ); - aEnv.RegisterEventHandler( this, this, TWservCrEvent::EWindowGroupChanged ); + aEnv.RegisterEventHandler( this, this, TWservCrEvent::EWindowGroupChanged | + TWservCrEvent::EDeviceOrientationChanged | + TWservCrEvent::EScreenDrawing ); + iScreenChangedTime = 0; TSLOG_OUT(); } @@ -165,10 +170,40 @@ if ( iWgIds.FindInOrder( iPrevId ) >= 0 || ( iPrevId == 0 && iPrevReg != 0 ) ) { - TRAP_IGNORE( ScreenshotL() ); + TTime currTime; + currTime.HomeTime(); + TTimeIntervalSeconds secondsFrom; + TInt err = currTime.SecondsFrom( iScreenChangedTime, secondsFrom ); + if ( err != KErrNone || secondsFrom.Int() > KMinTimeForOrientationSwitch ) + { + if ( iLastWgIdRedraw ) + { + TRAP_IGNORE( ScreenshotL() ); + } + } + else + { + // Reset time to allow screenshot taking on next wg change + iScreenChangedTime = 0; + // Order screenshot rotation + BitmapRotationNeeded( iPrevId?iPrevId:iPrevReg, iClockwiseRot ); + } iPrevReg = 0; } iPrevId = wgId; + iLastWgIdRedraw = EFalse; + } + else if ( aEvent.Type() == TWservCrEvent::EDeviceOrientationChanged ) + { + iScreenChangedTime.HomeTime(); + if ( iLastWgIdRedraw ) + { + TRAP_IGNORE( ScreenshotL() ); + } + } + else if ( aEvent.Type() == TWservCrEvent::EScreenDrawing ) + { + iLastWgIdRedraw = ETrue; } TSLOG_OUT(); @@ -217,6 +252,28 @@ TSLOG_OUT(); } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::BitmapRotationNeeded +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::BitmapRotationNeeded( TInt aWgId, TBool aClockwise ) + { + TSLOG_CONTEXT( BitmapRotationNeeded, TSLOG_LOCAL ); + TSLOG_IN(); + + const TInt msg[] = { + aClockwise ? NPreviewMsg::EBitmapRotationNeeded90 : NPreviewMsg::EBitmapRotationNeeded270, + aWgId, + 0 + }; + TPckgC buf(msg); + SendMessage(buf); + + TSLOG_OUT(); + } + + // -------------------------------------------------------------------------- // CPreviewProviderCRP::Register // -------------------------------------------------------------------------- @@ -300,6 +357,10 @@ { iScreenshotSize = sz; } + + // Mark direction for possible rotation + iClockwiseRot = iScreenshotSize.iWidth > iScreenshotSize.iHeight; + // Use the the same DisplayMode as for the source image // so override the display mode, ignoring any requests. iScreenshotMode = screenConfig->DisplayMode(); diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswserver/engine/group/tsfswengine.mmp --- a/taskswitcher/contextengine/tsfswserver/engine/group/tsfswengine.mmp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswserver/engine/group/tsfswengine.mmp Wed May 12 13:22:51 2010 +0300 @@ -28,6 +28,8 @@ SOURCE tsfsalwaysshownapplist.cpp SOURCE tsfswidgetlist.cpp SOURCE tsfswiconcache.cpp +SOURCE tsfswdatalist.cpp +SOURCE tscpsnotifier.cpp MW_LAYER_SYSTEMINCLUDE @@ -50,7 +52,9 @@ LIBRARY egul.lib LIBRARY widgetregistryclient.lib LIBRARY featmgr.lib +LIBRARY bitmaptransforms.lib +LIBRARY liwservicehandler.lib LIBRARY tspreviewprovider.lib LIBRARY tsfswutils.lib diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswserver/engine/inc/tscpsnotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/inc/tscpsnotifier.h Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,112 @@ +/* +* 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 TSCPSNOTIFIER_H +#define TSCPSNOTIFIER_H + +#include +#include + +class CLiwGenericParamList; +class CLiwServiceHandler; +class MLiwInterface; +class CLiwDefaultMap; +class CLiwMap; +class CTsFswEngine; + +NONSHARABLE_CLASS(CTSCpsNotifier) : + public CBase, + private MLiwNotifyCallback + { +public: + /** + * Two-phased constructor. + */ + static CTSCpsNotifier* NewL( CTsFswEngine& aEngine ); + + /** + * Destructor. + */ + virtual ~CTSCpsNotifier(); + +private: + /** + * Constructor. + */ + CTSCpsNotifier( CTsFswEngine& aEngine ); + + /** + * + */ + void ConstructL(); +private: + // Form base class MLiwNotifyCallback. + /** + * Callback from LIW framework to process an event that was expected. + * @see MLiwNotifyCallback::HandleNotifyL + */ + TInt HandleNotifyL( TInt aCmdId, + TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& aInParamList ); + +private: + /** + * Create and return map filled with widgets identifiers + */ + CLiwDefaultMap* WidgetFilterLC(); + + /** + * Initalise CPS service interface + */ + void InitCpsInterfaceL(); + + /** + * Request for CPS notifications abou widgets + */ + void ExecuteRegistrationCommandL( TUint aOption ); + + /** + * Obtain widget information and + * forward widgets data change handling to iEngine + */ + void HandleWidgetUpdateL( const CLiwMap& aChangeMap ); + + /** + * Obtain from CPS information about widget + */ + void GetWidgetDataL( const TDesC& aContentId, + TInt& aWidgetId, + TInt& aBitmapHandle ); + + /** + * Obtain from CPS information about widget from data map + */ + void GetWidgetDataFromDataMapL( const CLiwMap& aDataMap, + TInt& aWidgetId, + TInt& aBitmapHandle ); + +private: + + MLiwInterface* iCpsInterface;//own + + CLiwServiceHandler* iServiceHandler;//own + + CTsFswEngine& iEngine;//not own + }; + +#endif //TSCPSNOTIFIER_H diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswserver/engine/inc/tsfswdatalist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/inc/tsfswdatalist.h Wed May 12 13:22:51 2010 +0300 @@ -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: Non-closeable app list class + * +*/ + + +#ifndef TSFSWDATALIST_H +#define TSFSWDATALIST_H + +#include +#include +#include +#include +#include +#include "tsfswentry.h" +#include "tsfswobservers.h" + +class CTsFswEngine; +class CTsFsAlwaysShownAppList; +class CTsFsHiddenAppList; +class CTsFsWidgetList; +class CTsFswIconCache; +class CApaWindowGroupName; + +/** + * Engine's data list. + */ +NONSHARABLE_CLASS( CTsFswDataList ) : public CBase + { +public: + /** + * Two-phased constructor. + * + * @param aParent + */ + static CTsFswDataList* NewL( CTsFswEngine& aEngine ); + + /* + * Destructor + */ + ~CTsFswDataList(); + +private: + /** + * Constructor. + */ + CTsFswDataList( CTsFswEngine& aEngine ); + + /** + * Performs 2nd phase construction. + */ + void ConstructL(); + +public: + /** + * 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 + */ + const RTsFswArray& FswDataL(); + + /** + * Gets the window group list and reconstructs the fsw content. + * @return TBool ETrue if the content iData has been modified + */ + TBool CollectTasksL(); + + /** + * Return contained iAlwaysShownAppList member. + */ + CTsFsAlwaysShownAppList* AlwaysShownApps(); + + /** + * Return contained iHiddenAppList member. + */ + CTsFsHiddenAppList* HiddenApps(); + + /** + * Return containd iWidgetList member + */ + CTsFsWidgetList* Widgets(); + + /** + * Set flag iTaskListDirty; + */ + void SetDirty(); + + /** + * Set flag iAppDataRefreshNeeded + */ + void SetAppDataRefreshNeeded(); + + /** + * Store or updarte screenshot bitmap for specified window group. + */ + TBool StoreScreenshot( TInt aWgId, CFbsBitmap* aBmp ); + + /** + * remove screenshot bitmap. + */ + TBool RemoveScreenshot( TInt aWgId ); + + /** + * Obtain screenshot if exists + */ + CFbsBitmap** FindScreenshot( TInt aWgId ); + + /** + * Moves entry on given window app/widget id to + * the first position on conten data list + */ + void MoveEntryAtStart( TInt aAppId, TBool aWidget ); + + /** + * If application uid exists in the contained CTsFsAlwaysShownAppList + * @return ETrue application uid exists in the list + * EFalse application uid doesn't exist in the list + * @param TInt aWgId the window group application + */ + TBool IsAlwaysShownAppL( TInt aWgId ); + + /** + * Finds out the app uid for the given window group id. + * @param aWgId a valid window group id + * @param aUid requested uid + * @return error code + */ + TInt AppUidForWgId( TInt aWgId, TUid& aUid ); + + /** + * 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 ); + +private: + /** + * Adds running apps to the list. + * @param aAppsList array to add to + */ + void CollectAppsL( RTsFswArray& aAppsList ); + + /** + * 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. + * In case of widget, update window group field in 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 ConsiderOldDataL( CTsFswEntry& aEntry, + const TUid& aAppUid, + TBool& aChanged, + RTsFswArray& aNewList ); + + /** + * Adds running widgets to the list. + * @param aWidgetsList array to add to + */ + void CollectWidgetsL( RTsFswArray& aWidgetsList ); + + /** + * 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 ); + + /** + * Returns the most top 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 FindMostTopParentWgId( 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 ); + + /** + * 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 + * @return TBool ETrue if the list has been modified + */ + TBool AssignScreenshotHandle( TInt aWgIdForScreenshot, TInt aBitmapHandle ); + + /** + * Checks if the app to which the screenshot belongs is in the task list + * and updates the entry when found. + * @param aWgIdForScreenshot wgid for the screenshot, + * in case of widget it stands for widget id + * @param aBitmapHandle handle for screenshot bitmap + * @param aAsigned result of operation + */ + void AssignScreenshotHandle( TInt aWgIdForScreenshot, + TInt aBitmapHandle, + TBool& aAsigned ); + + /** + * 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 ); + + /** + * Fit existing class contained data list into give one. + * Data is being changed with application type consideration that is based + * on aConsiderWidgets param. + * Function removes or add entries into data depend on given list. + * @param aListToFit list with actual data + * @param aConsiderWidgets application type + * @return ETrue if change occours on data list, EFalse otherwise + */ + TBool FitDataToListL( RTsFswArray& aListToFit, TBool aConsiderWidgets ); + + /** + * Checks if there is an entry for same app in the given list. + * @param aEntry entry + * @param aNewList ref to list + * @return ETrue if app was found + */ + TBool CheckIfExists( const CTsFswEntry& aEntry, + const RTsFswArray& aNewList ) const; + +private: + CTsFswEngine& iEngine; + + RTsFswArray iData; // current fsw content, i.e. the task list + + // 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; + + // app icon provider/container instance, own + CTsFswIconCache* iAppIcons; + + // true if web widgets are supported by the system + TBool iWidgetsSupported; + + // 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; + + // 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; + }; + +#endif //TSFSWDATALIST_H diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswserver/engine/inc/tsfswengine.h --- a/taskswitcher/contextengine/tsfswserver/engine/inc/tsfswengine.h Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswserver/engine/inc/tsfswengine.h Wed May 12 13:22:51 2010 +0300 @@ -32,13 +32,14 @@ #include "tsfswentry.h" #include "tsfswobservers.h" -class CTsFsAlwaysShownAppList; -class CTsFsHiddenAppList; -class CTsFsWidgetList; class MTsFswEngineObserver; -class CTsFswIconCache; class CTsFastSwapPreviewProvider; class CApaWindowGroupName; +class CBitmapRotator; +class CTsRotationTask; +class CTSCpsNotifier; + +class CTsFswDataList; // descriptor big enough to store hex repr of 32-bit integer plus 0x prefix typedef TBuf<10> TAppUidHexString; @@ -60,12 +61,12 @@ * @param aObserver ref to observer */ IMPORT_C static CTsFswEngine* NewL( MTsFswEngineObserver& aObserver ); - + /** * @copydoc NewL */ IMPORT_C static CTsFswEngine* NewLC( MTsFswEngineObserver& aObserver ); - + /** * Destructor. */ @@ -78,13 +79,13 @@ * @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 @@ -104,6 +105,23 @@ */ IMPORT_C TUid ForegroundAppUidL( TInt aType ); +public: + /** + * Callback for rotation completion. Takes ownership of a given + * bitmap. + */ + void RotationComplete( TInt aWgId, + CFbsBitmap* aBitmap, + CTsRotationTask* aCompletedTask, + TInt aError ); + + /** + * Called by CPS publisher when changes occours on widgets' CPS data. + * Copies screenshot with use of delivered bitmap handle. + * Moves last changed widget with entry into start position. + */ + void HandleWidgetUpdateL( TInt aWidgetId, TInt aBitmapHandle ); + private: // from CActive void RunL(); @@ -112,7 +130,7 @@ // from MTsFswTaskListObserver void UpdateTaskList(); - + // from MTsFswResourceObserver void HandleResourceChange( TInt aType ); @@ -122,82 +140,27 @@ // from MTsFastSwapPreviewObserver void HandleFswPpApplicationChange( TInt aWgId, TInt aFbsHandle ); void HandleFswPpApplicationUnregistered( TInt aWgId ); + void HandleFswPpApplicationBitmapRotation( TInt aWgId, TBool aClockwise ); + + void RotateL( CFbsBitmap& aBitmap, TInt aWgId, TBool aClockwise ); 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. @@ -206,24 +169,7 @@ * @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 @@ -254,73 +200,79 @@ void PublishFgAppUidL(); /** - * Helper function to publish something to CFW. - * @param aType context type - * @param aValue value to publish + * Close running widget + * @param aOffset - widget info offset + */ + void CloseWidgetL( TInt aOffset ); + + /** + * Removes screenshot bitmap from contained iDataList */ - //void PublishContextL( const TDesC& aType, const TDesC& aValue ); + void RemoveScreenshot( TInt aWgId ); -private: // data + /** + * Add or overwrite screenshot datamap into iDataList + * @return ETrue if content was changed + */ + TBool StoreScreenshot( TInt aWgId, CFbsBitmap* aBmp ); + +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; + // For rotating bitmaps + RPointerArray iRotaTasks; + + CTsFswDataList* iDataList;//own + + //Used to observ wigets' actions on CPS service + CTSCpsNotifier* iCpsWidgetPublisher;//owned + }; + +/** + * Listener for rotation complete event + */ +NONSHARABLE_CLASS( CTsRotationTask ) : public CActive + { +public: + CTsRotationTask( CTsFswEngine& aEngine ); + ~CTsRotationTask(); + void StartLD( TInt aWgId, CFbsBitmap* aBitmapHandle, TBool aClockwise ); +private: + void RunL(); + void DoCancel(); +private: + // Data + CTsFswEngine& iEngine; + TInt iWgId; + CFbsBitmap* iBitmap; // owned for the duration of transformation + CBitmapRotator* iRotator; // owned }; #endif diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswserver/engine/inc/tsfswidgetlist.h --- a/taskswitcher/contextengine/tsfswserver/engine/inc/tsfswidgetlist.h Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswserver/engine/inc/tsfswidgetlist.h Wed May 12 13:22:51 2010 +0300 @@ -21,7 +21,7 @@ #include #include - + const TUint32 KWidgetAppUidValue = 0x10282822; /** @@ -38,21 +38,28 @@ /** * Initializes the list that stores widgets. * @return - - */ + */ void InitializeWidgetListL(); /** * Returns a ref to the list of running widgets. */ const RWidgetInfoArray& RunningWidgets() const { return iRunningWidgets; } + + /** + * Check if widget's uid is recognized as CWRT type. + */ + TBool IsCWRTWidget( TUid aUid ); private: /** Constructor */ CTsFsWidgetList(); void ResetArrayOfWidgetInfo( RWidgetInfoArray& aWidgetInfoArr ); - + static void CleanupConnect( TAny* aThis ); + TBool IsValBetween( TInt aMinor, TInt aMajor, TInt aBetween ); + private: /** Contains list of widgets that are currently running */ RWidgetInfoArray iRunningWidgets; diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswserver/engine/inc/tsfswobservers.h --- a/taskswitcher/contextengine/tsfswserver/engine/inc/tsfswobservers.h Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswserver/engine/inc/tsfswobservers.h Wed May 12 13:22:51 2010 +0300 @@ -56,12 +56,6 @@ * 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; }; /** diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswserver/engine/src/tscpsnotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/src/tscpsnotifier.cpp Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,348 @@ +/* +* 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 the License "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: Internal class definition for WidgetUI application. +* +*/ + + +#include "tscpsnotifier.h" +#include "tsfswengine.h" +#include +#include +#include +#include +#include + +_LIT8( KCPService, "Service.ContentPublishing" ); +_LIT8( KCPInterface, "IDataSource" ); + +_LIT8( KType, "type" ); +_LIT( KCpData, "cp_data" ); + +_LIT8( KPublisherId, "publisher" ); +_LIT8( KContentType, "content_type" ); +_LIT8( KContentId, "content_id" ); + +_LIT8( KGetList, "GetList"); +_LIT8( KDataMap, "data_map" ); +_LIT8( KWidgetId, "widget_id"); +_LIT8( KBitmapHandle, "bitmap_handle"); + +_LIT( KWidgetUi, "widget_ui"); +_LIT( KScreenshot, "screenshot"); + +_LIT8( KFilter, "filter" ); +_LIT8( KResults, "results"); +_LIT8( KOperation, "operation" ); +_LIT8( KRequestNotification, "RequestNotification" ); +_LIT( KUpdate, "update" ); +_LIT( K16Add, "add" ); +_LIT( KAddUpdate, "add:update" ); +_LIT8( KChangeInfo, "change_info" ); + +_LIT( KAll, "all"); + +// ================= MEMBER FUNCTIONS ======================= + +// -------------------------------------------------------------------------- +// CTSCpsNotifier::NewL +// -------------------------------------------------------------------------- +// +CTSCpsNotifier* CTSCpsNotifier::NewL(CTsFswEngine& aEngine ) + { + CTSCpsNotifier* self = new (ELeave) CTSCpsNotifier(aEngine); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// -------------------------------------------------------------------------- +// CTSCpsNotifier::~CTSCpsNotifier +// -------------------------------------------------------------------------- +// +CTSCpsNotifier::~CTSCpsNotifier() + { + TRAP_IGNORE(ExecuteRegistrationCommandL( KLiwOptCancel )); + + if( iCpsInterface ) + { + iCpsInterface->Close(); + iCpsInterface = NULL; + } + if( iServiceHandler ) + { + iServiceHandler->Reset(); + delete iServiceHandler; + iServiceHandler = NULL; + } + } + +// -------------------------------------------------------------------------- +// CTSCpsNotifier::CTSCpsNotifier +// -------------------------------------------------------------------------- +// +CTSCpsNotifier::CTSCpsNotifier(CTsFswEngine& aEngine): + iEngine(aEngine) + { + } + +// -------------------------------------------------------------------------- +// CTSCpsNotifier::ConstructL +// -------------------------------------------------------------------------- +// +void CTSCpsNotifier::ConstructL() + { + InitCpsInterfaceL(); + ExecuteRegistrationCommandL( 0 ); + } + +// -------------------------------------------------------------------------- +// CTSCpsNotifier::WidgetFilterLC +// -------------------------------------------------------------------------- +// +CLiwDefaultMap* CTSCpsNotifier::WidgetFilterLC() + { + //Create filter criteria for requested entries in form of LIW map: + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + filter->InsertL( KPublisherId, TLiwVariant( KWidgetUi )); + filter->InsertL( KContentType, TLiwVariant( KScreenshot )); + return filter; + } + +// -------------------------------------------------------------------------- +// CTSCpsNotifier::ExecuteRegistrationCommandL +// -------------------------------------------------------------------------- +// +void CTSCpsNotifier::ExecuteRegistrationCommandL( + TUint aOption ) + { + CLiwDefaultMap* filter = WidgetFilterLC(); + filter->InsertL( KContentId, TLiwVariant( KAll )); + filter->InsertL( KOperation, TLiwVariant( KAddUpdate )); + + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + // Fill in input list for RequestNotification command + inParamList.AppendL( TLiwGenericParam( KType, TLiwVariant( KCpData ))); + inParamList.AppendL( TLiwGenericParam( KFilter, TLiwVariant( filter ))); + + iCpsInterface->ExecuteCmdL( + KRequestNotification, + inParamList, + outParamList, + aOption, + this ); + + outParamList.Reset(); + inParamList.Reset(); + CleanupStack::PopAndDestroy( filter ); + } + +// -------------------------------------------------------------------------- +// CTSCpsNotifier::HandleNotifyL +// -------------------------------------------------------------------------- +// +TInt CTSCpsNotifier::HandleNotifyL( + TInt /*aCmdId*/, + TInt /*aEventId*/, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/ ) + { + TInt pos(0); + aEventParamList.FindFirst( pos, KChangeInfo ); + if (pos != KErrNotFound) + { + // Get list of maps + TLiwVariant variant = ( aEventParamList )[pos].Value(); + variant.PushL(); + const CLiwList* changeMapsList = variant.AsList(); + + TPtrC operation; + // Iter through list content + for (TInt i = 0; i < changeMapsList->Count(); ++i) + { + if ( changeMapsList->AtL( i, variant )) + { + const CLiwMap* changeMap = variant.AsMap(); + // Check what triggered a notification + if ( changeMap->FindL( KOperation, variant )) + { + operation.Set( variant.AsDes()); + } + if (!operation.Compare(KUpdate) || !operation.Compare(K16Add)) + { + HandleWidgetUpdateL( *changeMap ); + } + } + } + CleanupStack::PopAndDestroy( &variant ); + } + return KErrNone; + } + +// -------------------------------------------------------------------------- +// CTSCpsNotifier::InitCpsInterfaceL +// -------------------------------------------------------------------------- +// +void CTSCpsNotifier::InitCpsInterfaceL() + { + if( !iServiceHandler ) + { + iServiceHandler = CLiwServiceHandler::NewL(); + } + + CLiwGenericParamList& inParam = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParam = iServiceHandler->OutParamListL(); + + CLiwCriteriaItem* crit = CLiwCriteriaItem::NewLC( KLiwCmdAsStr, KCPInterface, + KCPService ); + crit->SetServiceClass( TUid::Uid(KLiwClassBase) ); + + RCriteriaArray a; + a.AppendL(crit); + iServiceHandler->AttachL( a ); + CleanupStack::Pop(crit); + iServiceHandler->ExecuteServiceCmdL( *crit, inParam, outParam ); + delete crit; + a.Reset(); + + // find service interface + TInt pos = 0; + MLiwInterface* msgInterface = NULL; + outParam.FindFirst( pos, KCPInterface ); + if ( pos != KErrNotFound ) + { + msgInterface = (outParam)[pos].Value().AsInterface(); + } + + outParam.Reset(); + inParam.Reset(); + iCpsInterface = msgInterface; + } + +// -------------------------------------------------------------------------- +// CTSCpsNotifier::HandleWidgetUpdateL +// -------------------------------------------------------------------------- +// +void CTSCpsNotifier::HandleWidgetUpdateL(const CLiwMap& aChangeMap) + { + //ectract content_id which is widget bundled name + TPtrC contentid; + TLiwVariant contentIdVar; + contentIdVar.PushL(); + if (aChangeMap.FindL(KContentId, contentIdVar)) + { + contentid.Set( contentIdVar.AsDes()); + } + + TInt widgetId(0); + TInt bitmapHandle(0); + GetWidgetDataL(contentid, widgetId, bitmapHandle); + iEngine.HandleWidgetUpdateL(widgetId, bitmapHandle ); + CleanupStack::PopAndDestroy( &contentIdVar ); + } + +// -------------------------------------------------------------------------- +// CTSCpsNotifier::GetWidgetData +// -------------------------------------------------------------------------- +// +void CTSCpsNotifier::GetWidgetDataL(const TDesC& aContentId, TInt& aWidgetId, + TInt& aBitmapHandle) + { + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + + TLiwGenericParam type( KType, TLiwVariant( KCpData ) ); + inParamList->AppendL( type ); + + //append filter to input param + CLiwDefaultMap* filter = WidgetFilterLC(); + filter->InsertL(KContentId, TLiwVariant(aContentId)); + TLiwGenericParam item( KFilter, filter); + inParamList->AppendL( item ); + + // It is assumed that interface is already initiated + iCpsInterface->ExecuteCmdL( KGetList, *inParamList, *outParamList); + + type.Reset(); + item.Reset(); + inParamList->Reset(); + + //extracts data map + TInt pos = 0; + outParamList->FindFirst( pos, KResults ); + if( pos != KErrNotFound ) + // results present + { + //extract iterator on results list + TLiwVariant variant = (*outParamList)[pos].Value(); + CLiwIterable* iterable = variant.AsIterable(); + iterable->Reset(); + + //get next result + if( iterable->NextL( variant ) ) + { + //extract content map + CLiwDefaultMap *map = CLiwDefaultMap::NewLC(); + variant.Get( *map ); + if( map && map->FindL( KDataMap, variant) ) + { + CLiwDefaultMap *dataMap = CLiwDefaultMap::NewLC(); + variant.Get( *dataMap ); + if( dataMap ) + { + GetWidgetDataFromDataMapL(*dataMap, aWidgetId, aBitmapHandle); + } + CleanupStack::PopAndDestroy( dataMap ); + } + variant.Reset(); + CleanupStack::PopAndDestroy( map ); + } + iterable->Reset(); + } + outParamList->Reset(); + CleanupStack::PopAndDestroy( filter ); + } + +// -------------------------------------------------------------------------- +// CTSCpsNotifier::GetWidgetDataFromDataMap +// -------------------------------------------------------------------------- +// +void CTSCpsNotifier::GetWidgetDataFromDataMapL(const CLiwMap& aDataMap, + TInt& aWidgetId, TInt& aBitmapHandle) + { + TLiwVariant bitmapHandleVar; + bitmapHandleVar.PushL(); + if( aDataMap.FindL( KBitmapHandle, bitmapHandleVar )) + { + aBitmapHandle = bitmapHandleVar.AsTInt32(); + } + CleanupStack::PopAndDestroy(&bitmapHandleVar); + + TLiwVariant widgetIdVar; + widgetIdVar.PushL(); + if( aDataMap.FindL( KWidgetId, widgetIdVar )) + { + aWidgetId = widgetIdVar.AsTInt32(); + } + CleanupStack::PopAndDestroy(&widgetIdVar); + } + +// END OF FILE + + + + diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswserver/engine/src/tsfsalwaysshownapplist.cpp --- a/taskswitcher/contextengine/tsfswserver/engine/src/tsfsalwaysshownapplist.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswserver/engine/src/tsfsalwaysshownapplist.cpp Wed May 12 13:22:51 2010 +0300 @@ -25,8 +25,7 @@ Also, there will be no Close option for such apps. */ const TUint32 KTsFsUidArray[] = { - 0x102750F0 // Idle App Uid - ,0x0EFC346A //Search App Uid + 0x0EFC346A //Search App Uid /* never show menu app */ //,0x101F4CD2 // Menu App Uid }; diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswserver/engine/src/tsfshiddenapplist.cpp --- a/taskswitcher/contextengine/tsfswserver/engine/src/tsfshiddenapplist.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswserver/engine/src/tsfshiddenapplist.cpp Wed May 12 13:22:51 2010 +0300 @@ -37,7 +37,8 @@ */ const TUint32 KTsFsAlwaysHiddenUidArray[] = { - 0x100056CF // screensaver + 0x100056CF, // screensaver + 0x102750F0 // Idle App Uid }; // ----------------------------------------------------------------------------- diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswserver/engine/src/tsfswdatalist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/src/tsfswdatalist.cpp Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,803 @@ +/* +* 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 "tsfswdatalist.h" +#include "tsfswengine.h" +#include "tsfsalwaysshownapplist.h" +#include "tsfshiddenapplist.h" +#include "tsfswidgetlist.h" +#include "tsfswiconcache.h" +#include "enginelogging.h" +#include // for CleanupResetAndDestroyPushL +#include +#include + + + +// ================= MEMBER FUNCTIONS ======================= + +// -------------------------------------------------------------------------- +// CTsFswDataList::NewL +// -------------------------------------------------------------------------- +// +CTsFswDataList* CTsFswDataList::NewL(CTsFswEngine& aEngine) + { + CTsFswDataList* self = new (ELeave) CTsFswDataList(aEngine); + CleanupStack::PushL (self ); + self->ConstructL ( ); + CleanupStack::Pop ( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::CTsFswDataList +// -------------------------------------------------------------------------- +// +CTsFswDataList::CTsFswDataList(CTsFswEngine& aEngine) : + iEngine(aEngine) + { + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::~CTsFswDataList +// -------------------------------------------------------------------------- +// +CTsFswDataList::~CTsFswDataList( ) + { + // 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(); + + delete iHiddenAppList; + delete iAlwaysShownAppList; + delete iWidgetList; + iAppArcSession.Close(); + iWsSession.Close(); + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::ConstructL +// -------------------------------------------------------------------------- +// +void CTsFswDataList::ConstructL( ) + { + User::LeaveIfError( iWsSession.Connect() ); + User::LeaveIfError( iAppArcSession.Connect() ); + iHiddenAppList = CTsFsHiddenAppList::NewL( iEngine ); + iAlwaysShownAppList = CTsFsAlwaysShownAppList::NewL(); + + iWidgetsSupported = FeatureManager::FeatureSupported( KFeatureIdWebWidgets ); + if ( iWidgetsSupported ) + { + iWidgetList = CTsFsWidgetList::NewL(); + } + + // create app icon retriever instance + iAppIcons = CTsFswIconCache::NewL(); + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::FswDataL +// -------------------------------------------------------------------------- +// +const RTsFswArray& CTsFswDataList::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; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::CollectTasksL +// -------------------------------------------------------------------------- +// +TBool CTsFswDataList::CollectTasksL() + { + // clear dirty flag + TBool changed = iTaskListDirty; + iTaskListDirty = EFalse; + + RTsFswArray newAppsList; + RTsFswArray newWidgetsList; + + CleanupResetAndDestroyPushL(newAppsList); + CleanupResetAndDestroyPushL(newWidgetsList); + + CollectAppsL(newAppsList); + CollectWidgetsL(newWidgetsList); + + changed |= FitDataToListL(newAppsList, EFalse); + changed |= FitDataToListL(newWidgetsList, ETrue); + + CleanupStack::PopAndDestroy( &newWidgetsList ); + CleanupStack::PopAndDestroy( &newAppsList ); + + return changed; + } + + +// -------------------------------------------------------------------------- +// CTsFswDataList::AlwaysShown() +// -------------------------------------------------------------------------- +// +CTsFsAlwaysShownAppList* CTsFswDataList::AlwaysShownApps() + { + return iAlwaysShownAppList; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::HiddenApps() +// -------------------------------------------------------------------------- +// +CTsFsHiddenAppList* CTsFswDataList::HiddenApps() + { + return iHiddenAppList; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::Widgets() +// -------------------------------------------------------------------------- +// +CTsFsWidgetList* CTsFswDataList::Widgets() + { + return iWidgetList; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::SetDirty() +// -------------------------------------------------------------------------- +// +void CTsFswDataList::SetDirty() + { + iTaskListDirty = ETrue; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::SetAppDataRefreshNeeded() +// -------------------------------------------------------------------------- +// +void CTsFswDataList::SetAppDataRefreshNeeded() + { + iAppDataRefreshNeeded = ETrue; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::ForwardScreenshot +// -------------------------------------------------------------------------- +// +TBool CTsFswDataList::StoreScreenshot(TInt aId, CFbsBitmap* aBmp) + { + TBool changed = EFalse; + CFbsBitmap** oldbmp = iScreenshots.Find( aId ); + if ( oldbmp ) + { + delete *oldbmp; + } + if ( iScreenshots.Insert( aId, aBmp ) != KErrNone ) + { + delete aBmp; + iScreenshots.Remove( aId ); + } + else + { + changed = AssignScreenshotHandle( aId, aBmp->Handle() ); + } + return changed; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::RemoveScreenshotByWgId +// -------------------------------------------------------------------------- +// +TBool CTsFswDataList::RemoveScreenshot(TInt aId) + { + TBool changed = EFalse; + CFbsBitmap** bmp = iScreenshots.Find( aId ); + if ( bmp ) + { + delete *bmp; + iScreenshots.Remove( aId ); + changed = AssignScreenshotHandle( aId, 0 ); + } + return changed; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::FindScreenshotByWgId +// -------------------------------------------------------------------------- +// +CFbsBitmap** CTsFswDataList::FindScreenshot(TInt aId) + { + CFbsBitmap** result = 0; + result = iScreenshots.Find( aId ); + return result; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::MoveEntryAtStart +// -------------------------------------------------------------------------- +// +void CTsFswDataList::MoveEntryAtStart(TInt aAppId, TBool aWidget) + { + TSLOG_CONTEXT( MoveEntryAtStart, TSLOG_LOCAL ); + + TInt appId(0); + //check embeded case + if( !aWidget ) + { + TInt wgId(0); + CApaWindowGroupName::FindByAppUid(TUid::Uid(aAppId), iWsSession, wgId); + TInt parentWgId = FindMostTopParentWgId( wgId ); + if( parentWgId != KErrNotFound ) + { + TUid appUid = TUid::Uid(0); + AppUidForWgId(parentWgId, appUid); + appId = appUid.iUid; + } + } + + if( !appId ) + { + appId = aAppId; + } + + for ( TInt i = 0; i < iData.Count(); ++i ) + { + if( iData[i]->AppUid().iUid == appId && iData[i]->Widget() == aWidget) + { + CTsFswEntry* entry = iData[i]; + iData.Remove(i); + iData.Insert(entry, 0); + break; + } + } + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFswDataList:: +// -------------------------------------------------------------------------- +// +void CTsFswDataList::CollectAppsL(RTsFswArray& aAppsList) + { + TSLOG_CONTEXT( CollectTasksL, TSLOG_LOCAL ); + TSLOG_IN(); + + // 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 ); + + // 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 + if ( iWidgetsSupported && appUid.iUid == KWidgetAppUidValue ) + { + //continue, leave widgetui, do nothing + } + // add item to task list if it is always-shown OR it is not hidden + // and it is not on cover ui + else if (mustShow || (!onHiddenList && !windowName->Hidden() && (appScreen + == 0 || appScreen == -1) && scrNumErr == KErrNone)) + { + AddEntryL(wgId, appUid, windowName, aAppsList, EFalse); + } + CleanupStack::PopAndDestroy( windowName ); + } + CleanupStack::PopAndDestroy( &allWgIds ); + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::AddEntryL +// -------------------------------------------------------------------------- +// +TBool CTsFswDataList::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 = ConsiderOldDataL( *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 ); + + entry->SetAlwaysShown( iAlwaysShownAppList->IsAlwaysShownApp( aAppUid ) ); + if ( aWgName ) + { + entry->SetSystemApp( aWgName->IsSystem() ); + } + } + TInt h = LookupScreenshotHandle( aWgId ); + if ( h ) + { + entry->SetScreenshotHandle( h ); + } + // add to new list, ownership is transferred + aNewList.AppendL( entry ); + CleanupStack::Pop( entry ); + return changed; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::ConsiderOldDataL +// -------------------------------------------------------------------------- +// +TBool CTsFswDataList::ConsiderOldDataL( 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 ) + { + iData[entryIdx]->SetWgId( aEntry.WgId()); + // 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; + } +// -------------------------------------------------------------------------- +// CTsFswDataList::CollectWidgetsL +// -------------------------------------------------------------------------- +// +void CTsFswDataList::CollectWidgetsL(RTsFswArray& aWidgetsList) + { + if( iWidgetsSupported ) + { + iWidgetList->InitializeWidgetListL(); + const RWidgetInfoArray& arr( iWidgetList->RunningWidgets() ); + for ( TInt i = 0, ie = arr.Count(); i != ie; ++i ) + { + //verify if widget is working in full screen mode + if( arr[i]->iFileSize ) + { + // wgid will be a special negative value + // windowgroupname is not needed here so pass NULL + AddEntryL( -(i+1), arr[i]->iUid, 0, aWidgetsList, ETrue ); + } + } + } + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::FindParentWgId +// -------------------------------------------------------------------------- +// +TInt CTsFswDataList::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 && info.iParentId > 0) + { + parent = info.iParentId; + break; + } + } + } + allWgIds.Close(); + return parent; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::FindMostTopParentWgId +// -------------------------------------------------------------------------- +// +TInt CTsFswDataList::FindMostTopParentWgId( TInt aWgId ) + { + TInt parent( KErrNotFound ); + parent = FindParentWgId( aWgId ); + if( parent != KErrNotFound) + { + TInt topParent = FindMostTopParentWgId(parent); + if( topParent != KErrNotFound ) + { + parent = topParent; + } + } + return parent; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::FindAppNameLC +// -------------------------------------------------------------------------- +// +HBufC* CTsFswDataList::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; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::AssignScreenshotHandle +// Called when a screenshot arrives to check if there is a corresponding +// application in the task list. Firstly try to match screenshot into parental +// application then into standalone one. +// -------------------------------------------------------------------------- +// +TBool CTsFswDataList::AssignScreenshotHandle( TInt aWgIdForScreenshot, + TInt aBitmapHandle ) + { +// aWgIdForScreenshot, aBitmapHandle); + TBool changed = EFalse; + TInt parentWgId = FindMostTopParentWgId( aWgIdForScreenshot ); + // now parentWgId is a valid wgid or KErrNotFound (-1) + if (parentWgId != KErrNotFound) + { + AssignScreenshotHandle( parentWgId, aBitmapHandle, changed ); + } + if (!changed) + { + AssignScreenshotHandle( aWgIdForScreenshot, aBitmapHandle, changed ); + } + return changed; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::AssignScreenshotHandle +// Called when a screenshot arrives to check if there is a corresponding +// application in the task list. It might be tried to be match into parental +// or standalone application. +// -------------------------------------------------------------------------- +// +void CTsFswDataList::AssignScreenshotHandle(TInt aWgIdForScreenshot, + TInt aBitmapHandle, TBool& aAsigned) + { + aAsigned = EFalse; + for (TInt i = 0, ie = iData.Count(); i != ie; ++i) + { + if (iData[i]->Widget()) + { + TInt widgetId = iData[i]->AppUid().iUid; + if (widgetId == aWgIdForScreenshot) + { + iData[i]->SetScreenshotHandle(aBitmapHandle); + aAsigned = ETrue; + break; + } + continue; + } + TInt appWgId = iData[i]->WgId(); + if (appWgId == aWgIdForScreenshot) + { + iData[i]->SetScreenshotHandle(aBitmapHandle); + aAsigned = ETrue; + break; + } + } + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::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 CTsFswDataList::LookupScreenshotHandle( TInt aWgIdForApp ) + { + CFbsBitmap** bmp = NULL; + + 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 ( FindMostTopParentWgId( *wgid ) == aWgIdForApp ) + { + THashMapIter iter2( iScreenshots ); + TBool hasChild = false; + while ( const TInt* wgid2 = iter2.NextKey() ) + { + if ( FindParentWgId( *wgid2 ) == *wgid ) + { + hasChild = true; + break; + } + } + if ( !hasChild ) + { + bmp = iter.CurrentValue(); + if ( bmp ) + { + return (*bmp)->Handle(); + } + } + } + } + if ( !bmp ) + { + bmp = iScreenshots.Find( aWgIdForApp ); + if ( bmp ) + { + // there is a screenshot stored for this wgid + 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; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::FitDataToListL +// -------------------------------------------------------------------------- +// +TBool CTsFswDataList::FitDataToListL(RTsFswArray& aListToFit, + TBool aConsiderWidgets) + { + TSLOG_CONTEXT( FitDataToListL, TSLOG_LOCAL ); + TBool changed = EFalse; + TInt listCount = aListToFit.Count(); + TInt dataCount = iData.Count(); + + //remove items that dont't exists in newly collected list + //consider widget and non-widget type + for (TInt i = dataCount -1; i >= 0; --i) + { + if ( (iData[i]->Widget() == aConsiderWidgets) && + !CheckIfExists(*iData[i], aListToFit) ) + { + delete iData[i]; + iData.Remove(i); + changed = ETrue; + } + } + + //add new item at start + for (TInt i = 0; i < aListToFit.Count(); ++i) + { + if (!CheckIfExists(*aListToFit[i], iData)) + { + iData.Insert(aListToFit[i], 0); + aListToFit[i] = 0; + changed = ETrue; + } + } + + TSLOG1_OUT( "change flag = %d", changed ); + return changed; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::CheckIfExists +// -------------------------------------------------------------------------- +// +TBool CTsFswDataList::CheckIfExists(const CTsFswEntry& aEntry, + const RTsFswArray& aList) const + { + TSLOG_CONTEXT( FitDataToListL, TSLOG_LOCAL ); + TBool exists(EFalse); + TInt dataCount = aList.Count(); + for (TInt entryIdx = 0; entryIdx < dataCount; ++entryIdx) + { + if (aList[entryIdx]->AppUid() == aEntry.AppUid()) + { + exists = ETrue; + break; + } + } + TSLOG_OUT(); + return exists; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::AppUidForWgIdL +// -------------------------------------------------------------------------- +// +TBool CTsFswDataList::IsAlwaysShownAppL( TInt aWgId ) + { + return iAlwaysShownAppList->IsAlwaysShownApp( AppUidForWgIdL(aWgId) ); + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::AppUidForWgId +// -------------------------------------------------------------------------- +// +TInt CTsFswDataList::AppUidForWgId( TInt aWgId, TUid& aUid ) + { + TRAPD(err, aUid = AppUidForWgIdL( aWgId ) ); + return err; + } + +// -------------------------------------------------------------------------- +// CTsFswDataList::AppUidForWgIdL +// -------------------------------------------------------------------------- +// +TUid CTsFswDataList::AppUidForWgIdL( TInt aWgId ) + { + CApaWindowGroupName* windowName = + CApaWindowGroupName::NewLC( iWsSession, aWgId ); + TUid appUid = windowName->AppUid(); + CleanupStack::PopAndDestroy( windowName ); + return appUid; + } + +// end of file diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswserver/engine/src/tsfswengine.cpp --- a/taskswitcher/contextengine/tsfswserver/engine/src/tsfswengine.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswserver/engine/src/tsfswengine.cpp Wed May 12 13:22:51 2010 +0300 @@ -17,10 +17,11 @@ #include "tsfswengine.h" +#include "tscpsnotifier.h" +#include "tsfswdatalist.h" #include "tsfsalwaysshownapplist.h" #include "tsfshiddenapplist.h" #include "tsfswidgetlist.h" -#include "tsfswiconcache.h" #include "tspreviewprovider.h" #include "tsfswclient.h" #include @@ -29,11 +30,12 @@ #include // for CleanupResetAndDestroyPushL #include #include - +#include +#include #include "enginelogging.h" // time to wait before refreshing content -const TInt KContentRefreshDelay = 500000; // 0.5 sec +const TInt KContentRefreshDelay = 50000; // 0.05 sec // for screenshots, they are scaled down to (screensize/this_factor). const TInt KScreenSizeFactor = 2; @@ -41,6 +43,15 @@ // format to get a lowercase hex string prefixed with 0x _LIT( KHexFmt, "0x%x" ); +const TUid KTsCameraUid = { 0x101F857a }; + +//close command for widget +const TInt KCloseWidgetCmd(9); +//handle close cmd for s60 widgets +_LIT(KWidgetAppName, "widgetlauncher.exe"); +//handle close cmd for CWRT widgets +_LIT(KWidgetAppNameWgt,"wgtwidgetlauncher.exe"); + // -------------------------------------------------------------------------- // CTsFswEngine::NewL // -------------------------------------------------------------------------- @@ -85,20 +96,11 @@ User::LeaveIfError( iWsSession.Connect() ); User::LeaveIfError( iAppArcSession.Connect() ); - iHiddenAppList = CTsFsHiddenAppList::NewL( *this ); - iAlwaysShownAppList = CTsFsAlwaysShownAppList::NewL(); - + iDataList = CTsFswDataList::NewL(*this); 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; + iDataList->SetAppDataRefreshNeeded(); CollectTasksL(); // listen for app screenshots @@ -115,6 +117,7 @@ iSwiProp.Subscribe( iStatus ); SetActive(); } + iCpsWidgetPublisher = CTSCpsNotifier::NewL(*this); } // -------------------------------------------------------------------------- @@ -129,26 +132,19 @@ 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; + for ( TInt i = 0; i < iRotaTasks.Count(); i++ ) + { + iRotaTasks[i]->Cancel(); + delete iRotaTasks[i]; + } + iRotaTasks.Close(); + delete iDataList; + delete iCpsWidgetPublisher; } // -------------------------------------------------------------------------- @@ -158,43 +154,8 @@ 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; + return iDataList->FswDataL(); } // -------------------------------------------------------------------------- @@ -206,36 +167,12 @@ TSLOG_CONTEXT( CloseAppL, TSLOG_LOCAL ); TSLOG1_IN( "aWgId = %d", aWgId ); - if ( iWidgetsSupported && aWgId < 0 && iWidgetAppUiWgId ) + if( iWidgetsSupported && 0 > aWgId ) { - // 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; - } + // convert aWgId to an index in the list of running widgets and close widget + CloseWidgetL( -aWgId -1 ); } - - TUid appUid = AppUidForWgIdL( aWgId ); - if ( !iAlwaysShownAppList->IsAlwaysShownApp( appUid ) ) + else if( !iDataList->IsAlwaysShownAppL( aWgId ) ) { // send window group event to kill the app TWsEvent event; @@ -244,7 +181,6 @@ iEnv->WsSession().SendEventToWindowGroup( aWgId, event ); TSLOG0( TSLOG_INFO, "event sent to wg" ); } - TSLOG_OUT(); } @@ -260,7 +196,7 @@ if ( iWidgetsSupported && aWgId < 0 ) { // for widgets clients see a wgid that is -1*(index+1) - const RWidgetInfoArray& arr( iWidgetList->RunningWidgets() ); + const RWidgetInfoArray& arr( iDataList->Widgets()->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 @@ -285,17 +221,14 @@ // void CTsFswEngine::SwitchToWidgetL( TInt aWidgetIndex ) { - const RWidgetInfoArray& arr( iWidgetList->RunningWidgets() ); - RApaLsSession ls; - User::LeaveIfError( ls.Connect() ); - CleanupClosePushL( ls ); + const RWidgetInfoArray& arr( iDataList->Widgets()->RunningWidgets() ); 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 ); + iAppArcSession.StartApp( *cmdLine ); + CleanupStack::PopAndDestroy(cmdLine); } // -------------------------------------------------------------------------- @@ -308,24 +241,13 @@ 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. + iDataList->SetDirty(); + if ( !iUpdateStarter->IsActive() ) { - // There can be many calls in a row, use a timer to prevent degrading - // device performance. - if ( !iUpdateStarter->IsActive() ) - { - iUpdateStarter->Start( KContentRefreshDelay, 0, + iUpdateStarter->Start( KContentRefreshDelay, 0, TCallBack( UpdateStarterCallback, this ) ); - } - } - else - { - iTaskListDirty = ETrue; } // screenshot taking support - call Register and Unregister when needed @@ -367,7 +289,7 @@ CApaWindowGroupName* wgn = CApaWindowGroupName::NewLC( iWsSession, allWgIds[i].iId ); TUid newUid = wgn->AppUid(); - TBool hidden = wgn->Hidden() || iHiddenAppList->IsHiddenL( + TBool hidden = wgn->Hidden() || iDataList->HiddenApps()->IsHiddenL( newUid, iWsSession, allWgIds[i].iId ); CleanupStack::PopAndDestroy( wgn ); @@ -428,220 +350,12 @@ 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 ); - + TBool changed = iDataList->CollectTasksL(); 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 // -------------------------------------------------------------------------- @@ -652,100 +366,13 @@ } // -------------------------------------------------------------------------- -// 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 ) { + TSLOG_CONTEXT( CopyBitmapL, TSLOG_LOCAL ); + CFbsBitmap* ret = new (ELeave) CFbsBitmap; CleanupStack::PushL( ret ); CFbsBitmap* bmp = new (ELeave) CFbsBitmap; @@ -785,6 +412,7 @@ CleanupStack::PopAndDestroy( bmp ); CleanupStack::Pop( ret ); + TSLOG_OUT(); return ret; } @@ -853,25 +481,24 @@ TSLOG_CONTEXT( HandleFswPpApplicationChange, TSLOG_LOCAL ); TSLOG2_IN( "aWgId = %d aFbsHandle = %d", aWgId, aFbsHandle ); + TUid appUid; + TInt err = iDataList->AppUidForWgId( aWgId, appUid ); + if ( err || appUid == KTsCameraUid ) + { + // Dont't assign screenshot to camera app + TSLOG0( TSLOG_LOCAL, "Screenshot for camera - ignore" ); + iPreviewProvider->AckPreview(aFbsHandle); + TSLOG_OUT(); + return; + } + CFbsBitmap* bmp = 0; - TRAPD( err, bmp = CopyBitmapL( aFbsHandle, EFalse ) ); + TRAP( 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() ); - } + iDataList->MoveEntryAtStart(appUid.iUid, EFalse); + StoreScreenshot(aWgId, bmp); } TSLOG_OUT(); @@ -887,83 +514,86 @@ 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 ); - } - + RemoveScreenshot(aWgId); + TSLOG_OUT(); } // -------------------------------------------------------------------------- -// CTsFswEngine::AssignScreenshotHandle -// Called when a screenshot arrives to check if there is a corresponding -// application in the task list. +// CTsFswEngine::HandleFswPpApplicationBitmapRotation +// Callback from CTsFastSwapPreviewProvider // -------------------------------------------------------------------------- // -void CTsFswEngine::AssignScreenshotHandle( TInt aWgIdForScreenshot, - TInt aBitmapHandle ) +void CTsFswEngine::HandleFswPpApplicationBitmapRotation( TInt aWgId, TBool aClockwise ) { - 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 ) + TSLOG_CONTEXT( HandleFswPpApplicationBitmapRotation, TSLOG_LOCAL ); + TSLOG1_IN( "aWgId = %d", aWgId ); + + CFbsBitmap** bmp = iDataList->FindScreenshot(aWgId); + + if ( bmp ) { - 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; - } + // Rotate bitmap + TRAP_IGNORE( RotateL( **bmp, aWgId, aClockwise ) ); + // Bitmap in a array is invalid, remove it + RemoveScreenshot(aWgId); } - if ( changed ) - { - iObserver.FswDataChanged(); - } + + TSLOG_OUT(); } + // -------------------------------------------------------------------------- -// 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) +// CTsFswEngine::RotateL +// Callback from CTsFastSwapPreviewProvider +// -------------------------------------------------------------------------- +// +void CTsFswEngine::RotateL( CFbsBitmap& aBitmap, TInt aWgId, TBool aClockwise ) + { + CFbsBitmap* rotaBitmap = new (ELeave) CFbsBitmap; + CleanupStack::PushL( rotaBitmap ); + User::LeaveIfError( rotaBitmap->Duplicate( aBitmap.Handle() ) ); + CTsRotationTask* rotaTask = new (ELeave) CTsRotationTask( *this ); + CleanupStack::PushL( rotaTask ); + User::LeaveIfError( iRotaTasks.Append( rotaTask ) ); + rotaTask->StartLD( aWgId, rotaBitmap, aClockwise ); // ownership transferred + CleanupStack::Pop( rotaTask ); + CleanupStack::Pop( rotaBitmap ); + } + + +// -------------------------------------------------------------------------- +// CTsFswEngine::RotationComplete +// Callback from CTsFastSwapPreviewProvider // -------------------------------------------------------------------------- // -TInt CTsFswEngine::LookupScreenshotHandle( TInt aWgIdForApp ) +void CTsFswEngine::RotationComplete( TInt aWgId, + CFbsBitmap* aBitmap, + CTsRotationTask* aCompletedTask, + TInt aError ) { - CFbsBitmap** bmp = iScreenshots.Find( aWgIdForApp ); - if ( bmp ) - { - // there is a screenshot stored for this wgid - return (*bmp)->Handle(); - } - else if ( aWgIdForApp > 0 ) + TSLOG_CONTEXT( RotationComplete, TSLOG_LOCAL ); + TSLOG_IN(); + + TSLOG1( TSLOG_INFO, "---> rotation completed with status: %d", aError ); + TInt idx = iRotaTasks.Find( aCompletedTask ); + if ( idx != KErrNotFound ) { - // 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(); - } - } + // Update task list + iRotaTasks.Remove(idx); + } + + if ( aError == KErrNone ) + { + StoreScreenshot(aWgId, aBitmap); } - else if ( aWgIdForApp < 0 ) + else { - // Must be a widget, wgid is useless in this case. - // Do not do anything for now => no screenshot for widgets. + // Rotation failed, cleanup bitmap + delete aBitmap; } - return 0; + + TSLOG_OUT(); } // -------------------------------------------------------------------------- @@ -982,7 +612,7 @@ // refresh the app list during the next task list update. if ( operationStatus == Swi::ESwisStatusSuccess ) { - iAppDataRefreshNeeded = ETrue; + iDataList->SetAppDataRefreshNeeded(); } } iSwiProp.Subscribe( iStatus ); @@ -1039,5 +669,182 @@ EColor64K ); // displaymode is ignored } +// -------------------------------------------------------------------------- +// CTsFswEngine::CloseWidgetL +// -------------------------------------------------------------------------- +// +void CTsFswEngine::CloseWidgetL(TInt aOffset ) + { + TSLOG_CONTEXT( CloseWidgetL, TSLOG_LOCAL ); + TSLOG1_IN( "aOffset = %d", aOffset ); + if( iDataList->Widgets()->RunningWidgets().Count() <= aOffset ) + { + User::Leave(KErrArgument); + } + const CWidgetInfo* widgetInfo(iDataList->Widgets()->RunningWidgets()[aOffset]); + const TPtrC bundleName(*widgetInfo->iBundleName); + CApaCommandLine* const cmdLine = CApaCommandLine::NewLC(); + + HBufC8* const + opaque( HBufC8::NewLC( bundleName.Size() + 3 * sizeof( TUint32 ) ) ); + TPtr8 des ( opaque->Des() ); + RDesWriteStream stream; + stream.Open( des ); + CleanupClosePushL( stream ); + stream.WriteUint32L ( widgetInfo->iUid.iUid ); + stream.WriteUint32L ( bundleName.Length() ); + stream.WriteL ( reinterpret_cast< const TUint8* >( bundleName.Ptr() ), bundleName.Size()); + stream.WriteInt32L ( KCloseWidgetCmd ); + CleanupStack::PopAndDestroy( &stream ); + cmdLine->SetCommandL( EApaCommandBackgroundAndWithoutViews ); + cmdLine->SetOpaqueDataL( *opaque ); + CleanupStack::PopAndDestroy( opaque ); + + if (iDataList->Widgets()->IsCWRTWidget(widgetInfo->iUid)) + { + cmdLine->SetExecutableNameL( KWidgetAppNameWgt); + } + else + { + cmdLine->SetExecutableNameL( KWidgetAppName ); + } + + iAppArcSession.StartApp( *cmdLine ); + CleanupStack::PopAndDestroy( cmdLine ); + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::StoreScreenshot +// -------------------------------------------------------------------------- +// +TBool CTsFswEngine::StoreScreenshot(TInt aWgId, CFbsBitmap* aBmp) + { + TSLOG_CONTEXT( StoreScreenshot, TSLOG_LOCAL ); + //iDataList would take ownership + TBool change = EFalse; + change = iDataList->StoreScreenshot(aWgId, aBmp); + if(change) + { + iObserver.FswDataChanged(); + } + TSLOG1_OUT( "Screenshot for = %d", aWgId ); + return change; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::RemoveScreenshot() +// -------------------------------------------------------------------------- +// +void CTsFswEngine::RemoveScreenshot(TInt aWgId) + { + TBool change = EFalse; + change = iDataList->RemoveScreenshot(aWgId); + if( change ) + { + iObserver.FswDataChanged(); + } + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::HandleWidgetUpdateL() +// -------------------------------------------------------------------------- +// +void CTsFswEngine::HandleWidgetUpdateL(TInt aWidgetId, TInt aBitmapHandle) + { + TSLOG_CONTEXT( HandleWidgetUpdateL, TSLOG_LOCAL ); + + iDataList->MoveEntryAtStart(aWidgetId, ETrue); + + CFbsBitmap* bmp = 0; + TBool contentChanged(EFalse); + if( aBitmapHandle ) + { + TRAPD( err, bmp = CopyBitmapL( aBitmapHandle, EFalse ) ); + if ( err == KErrNone ) + { + contentChanged = StoreScreenshot(aWidgetId, bmp); + } + } + if(!contentChanged) + { + iObserver.FswDataChanged(); + } + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsRotationListener::CTsRotationListener +// -------------------------------------------------------------------------- +// +CTsRotationTask::CTsRotationTask(CTsFswEngine& aEngine ) +: CActive(EPriorityStandard), + iEngine(aEngine) + { + CActiveScheduler::Add( this ); + } + + +// -------------------------------------------------------------------------- +// CTsRotationListener::~CTsRotationListener +// -------------------------------------------------------------------------- +// +CTsRotationTask::~CTsRotationTask() + { + Cancel(); + delete iRotator; + delete iBitmap; + } + + +// -------------------------------------------------------------------------- +// CTsRotationListener::Start +// -------------------------------------------------------------------------- +// +void CTsRotationTask::StartLD( TInt aWgId, + CFbsBitmap* aBitmap, + TBool aClockwise ) + { + TSLOG_CONTEXT( StartLD, TSLOG_LOCAL ); + TSLOG_IN(); + + iWgId = aWgId; + iBitmap = aBitmap; + iRotator = CBitmapRotator::NewL(); + if ( aClockwise ) + { + iRotator->Rotate(&iStatus, *iBitmap, CBitmapRotator::ERotation90DegreesClockwise); + } + else + { + iRotator->Rotate(&iStatus, *iBitmap, CBitmapRotator::ERotation270DegreesClockwise); + } + SetActive(); + + TSLOG_OUT(); + } + + +// -------------------------------------------------------------------------- +// CTsRotationListener::RunL +// -------------------------------------------------------------------------- +// +void CTsRotationTask::RunL() + { + iEngine.RotationComplete( iWgId, iBitmap, this, iStatus.Int() ); // bitmap ownership transferred + iBitmap = NULL; + delete this; + } + + +// -------------------------------------------------------------------------- +// CTsRotationListener::DoCancel +// -------------------------------------------------------------------------- +// +void CTsRotationTask::DoCancel() + { + iRotator->Cancel(); + } // end of file diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswserver/engine/src/tsfswiconcache.cpp --- a/taskswitcher/contextengine/tsfswserver/engine/src/tsfswiconcache.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswserver/engine/src/tsfswiconcache.cpp Wed May 12 13:22:51 2010 +0300 @@ -23,8 +23,8 @@ #include // size for the created app icons -const TInt KAppIconWidth = 96; -const TInt KAppIconHeight = 96; +const TInt KAppIconWidth = 300; +const TInt KAppIconHeight = 300; // -------------------------------------------------------------------------- // CTsFswIconCache::NewL diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswserver/engine/src/tsfswidgetlist.cpp --- a/taskswitcher/contextengine/tsfswserver/engine/src/tsfswidgetlist.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswserver/engine/src/tsfswidgetlist.cpp Wed May 12 13:22:51 2010 +0300 @@ -18,6 +18,7 @@ #include "tsfswidgetlist.h" #include +#include // -------------------------------------------------------------------------- // CTsFsWidgetList::NewL @@ -67,6 +68,12 @@ User::LeaveIfError( iWidgetRegistryClientSession.Connect() ); CleanupStack::PushL( TCleanupItem( CleanupConnect, this) ); iWidgetRegistryClientSession.RunningWidgetsL(iRunningWidgets); + //modify useless file size information with mode flag + for ( TInt i(iRunningWidgets.Count() - 1); 0 <= i; --i ) + { + iRunningWidgets[i]->iFileSize = + iWidgetRegistryClientSession.IsWidgetInFullView(iRunningWidgets[i]->iUid); + } CleanupStack::Pop(); // clean WidgetRegistryClientSession item iWidgetRegistryClientSession.Disconnect(); } @@ -85,5 +92,35 @@ } } +// -------------------------------------------------------------------------- +// CTsFsWidgetList::IsCWRTWidget +// -------------------------------------------------------------------------- +// +TBool CTsFsWidgetList::IsCWRTWidget( TUid aUid ) + { + TBool ret(EFalse); + if(IsValBetween(KWidgetUidCWRTInternalMemoryStart, + KWidgetUidCWRTInternalMemoryStop, aUid.iUid) || + IsValBetween(KWidgetUidCWRTExternalMemoryStart, + KWidgetUidCWRTExternalMemoryStop, aUid.iUid) ) + { + ret = ETrue;//it is cwrt widget + } + return ret; + } + +// -------------------------------------------------------------------------- +// CTsFsWidgetList::IsValBetween +// -------------------------------------------------------------------------- +// +TBool CTsFsWidgetList::IsValBetween( TInt aMinor, TInt aMajor, TInt aBetween ) + { + TBool ret(EFalse); + if ( aBetween >= aMinor && aBetween < aMajor ) + { + ret = ETrue; + } + return ret; + } // end of file diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswserver/server/inc/tsfswserver.h --- a/taskswitcher/contextengine/tsfswserver/server/inc/tsfswserver.h Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswserver/server/inc/tsfswserver.h Wed May 12 13:22:51 2010 +0300 @@ -66,8 +66,6 @@ // from MTsFswEngineObserver void FswDataChanged(); - TInt FswDataListenerCount(); - private: TInt iSessionCount; CTsFswEngine* iEngine; diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/contextengine/tsfswserver/server/src/tsfswserver.cpp --- a/taskswitcher/contextengine/tsfswserver/server/src/tsfswserver.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/contextengine/tsfswserver/server/src/tsfswserver.cpp Wed May 12 13:22:51 2010 +0300 @@ -188,25 +188,6 @@ } // -------------------------------------------------------------------------- -// 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 // -------------------------------------------------------------------------- // diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/rom/taskswitcher.iby --- a/taskswitcher/taskswitcherui/rom/taskswitcher.iby Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/rom/taskswitcher.iby Wed May 12 13:22:51 2010 +0300 @@ -20,8 +20,8 @@ // 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 +data=DATAZ_/private/10003a3f/apps/taskswitcher_reg.rsc private/10003a3f/import/apps/taskswitcher_reg.rsc +file=ABI_DIR/BUILD_DIR/taskswitcher.exe PROGRAMS_DIR/taskswitcher.exe // backup registration data=DATAZ_/private/20016BF0/backup_registration.xml private/20016BF0/backup_registration.xml diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/rom/taskswitcherresources.iby --- a/taskswitcher/taskswitcherui/rom/taskswitcherresources.iby Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/rom/taskswitcherresources.iby Wed May 12 13:22:51 2010 +0300 @@ -18,6 +18,6 @@ #define TASKSWITCHERRES_IBY // resources for taskswitcher app -data=DATAZ_/APP_RESOURCE_DIR/tstaskswitcher.rsc APP_RESOURCE_DIR/hgteleport.rsc +data=DATAZ_/APP_RESOURCE_DIR/taskswitcher.rsc APP_RESOURCE_DIR/taskswitcher.rsc #endif diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/sis/stubs/taskswitcher_stub.pkg --- a/taskswitcher/taskswitcherui/sis/stubs/taskswitcher_stub.pkg Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/sis/stubs/taskswitcher_stub.pkg Wed May 12 13:22:51 2010 +0300 @@ -32,9 +32,9 @@ ;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\taskswitcher.exe" +""-"Z:\resource\apps\taskswitcher.r??" +""-"Z:\private\10003a3f\import\apps\taskswitcher_reg.rsc" ""-"Z:\sys\bin\tsappecom.dll" ""-"Z:\resource\plugins\tsappecom.rsc" diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/sis/stubs/taskswitcher_stub.sis Binary file taskswitcher/taskswitcherui/sis/stubs/taskswitcher_stub.sis has changed diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/sis/taskswitcher.pkg --- a/taskswitcher/taskswitcherui/sis/taskswitcher.pkg Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/sis/taskswitcher.pkg Wed May 12 13:22:51 2010 +0300 @@ -25,9 +25,9 @@ ;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/taskswitcher.exe" - "!:\sys\bin\taskswitcher.exe" +"/epoc32/data/z/resource/apps/taskswitcher.rsc" - "!:\resource\apps\taskswitcher.rsc" +"/epoc32/data/z/private/10003a3f/apps/taskswitcher_reg.rsc" - "!:\private\10003a3f\import\apps\taskswitcher_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 e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/data/taskswitcher.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/data/taskswitcher.rss Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,283 @@ +/* +* 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_no_apps { buf = qtn_task_switcher_no_apps; } +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 e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/data/taskswitcher_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/data/taskswitcher_reg.rss Wed May 12 13:22:51 2010 +0300 @@ -0,0 +1,32 @@ +/* +* 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="taskswitcher"; + localisable_resource_file="\\resource\\apps\\taskswitcher"; + localisable_resource_id = R_LOCALISABLE_APP_INFO; + hidden = KAppIsHidden; + launch = KAppLaunchInBackground; + } diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/data/tstaskswitcher.rss --- a/taskswitcher/taskswitcherui/taskswitcherapp/data/tstaskswitcher.rss Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,282 +0,0 @@ -/* -* 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 e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/data/tstaskswitcher_reg.rss --- a/taskswitcher/taskswitcherui/taskswitcherapp/data/tstaskswitcher_reg.rss Mon Mar 22 15:12:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* 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 e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/group/tsapp.mmp --- a/taskswitcher/taskswitcherui/taskswitcherapp/group/tsapp.mmp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/group/tsapp.mmp Wed May 12 13:22:51 2010 +0300 @@ -24,6 +24,7 @@ EPOCSTACKSIZE 0x5000 // 20KB TARGET taskswitcher.exe + TARGETTYPE exe UID 0x100039CE KTsAppUidValue CAPABILITY CAP_APPLICATION NetworkControl PowerMgmt @@ -88,14 +89,14 @@ LIBRARY tsfswutils.lib SOURCEPATH ../data -START RESOURCE tstaskswitcher.rss +START RESOURCE taskswitcher.rss HEADER TARGETPATH APP_RESOURCE_DIR LANGUAGE_IDS END SOURCEPATH ../data -START RESOURCE tstaskswitcher_reg.rss -DEPENDS tstaskswitcher.rsg +START RESOURCE taskswitcher_reg.rss +DEPENDS taskswitcher.rsg TARGETPATH /private/10003a3f/apps END diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappui.h --- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappui.h Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappui.h Wed May 12 13:22:51 2010 +0300 @@ -44,6 +44,17 @@ { public: + enum { + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + //TODO make maping to NGA transition id + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ENoneTransition = 0, + EForegroundTransition = 3, + EBackgroundTransition = 4, + EActivationTransition = 5, + EActivationAppShowTransition = 1507, + + }; /** * Perform the second phase construction of a CTsAppUi object * this needs to be public due to the way the framework constructs the AppUi @@ -70,7 +81,9 @@ /** * Function start transition */ - void StartTransion( TUint aTransitionType ); + void StartTransion( TUint aTransitionType, + TUid aNextAppUid = TUid::Null(), + TInt aWgId = 0 ); /** * from MGfxTransEffectObserver @@ -78,7 +91,20 @@ void TransitionFinished(const CCoeControl* aControl, TUint aAction); void MoveAppToForeground( TUint aTransitionType ); - void MoveAppToBackground( TUint aTransitionType ); + void MoveAppToBackground( TUint aTransitionType, + TUid aAppUid = TUid::Null(), + TInt aWgId = 0 ); + + /** + * Functions for showing/hiding popups. + */ + void RequestPopUpL(); + void DisablePopUpL(); + + /** + * Function for layout change check + */ + TBool LayoutChangeAllowed(); public: /** @@ -96,11 +122,15 @@ void HandleResourceChangeL( TInt aType ); void HandleForegroundEventL( TBool aForeground ); void HandleCommandL( TInt aCommand ); + void HandleWsEventL(const TWsEvent& aEvent, + CCoeControl* aDestination); void StartTransition( TUint aTranstionId, TBool aVisibility, TBool aLayers, TUint aSubCom ); + + void StartAppActivateTransition( TUid aNextAppUid, TInt aWgId ); private: // New functions @@ -128,8 +158,33 @@ * task switcher app */ void FreeMemoryRequest(); + + /** + * Returns id of window group lying beneath task + * switcher window group. + * In case of embeded app it returns top paren window group. + * + * @param aIgnoreParentChild if set to ETrue, parent/child relationship + * will be ignored when deteriminig window + * group id + */ + TInt WgIdOfUnderlyingApp( TBool aIgnoreParentChild ); static TInt GoToBackgroundTimerCallback( TAny* aParam ); + + /* + * Returns id of top parent window group for embeded window group. + * @param aChildWg embeded window group id + * @return top parent window group id or 0 in case od standlalone + */ + TInt GetTopParentWg( TInt aChildWg); + + /* + * Returns id of parent window group for embeded window group. + * @param aChildWg embeded window group id + * @return parent window group id or 0 in case od standlalone + */ + TInt GetParentWg( TInt aChildWg ); private: @@ -139,6 +194,9 @@ // Listener for app key long press P&S, owned CTsPropertyListener* iPropListener; + // Listener for orientation layout changes + CTsPropertyListener* iLayoutListener; + // Tells if Taskswitcher is in foreground or in background TBool iForeground; @@ -148,9 +206,6 @@ // Device state CTsDeviceState* iDeviceState; - // Buffer to keeping some memory allocation while being in background. - TUint8* iMemAllocBuf; - CPeriodic* iGoToBackgroundTimer; TBool iEffectsEnabled; @@ -159,6 +214,19 @@ * Cenrep listener for the tfxserver enabled/disabled key. */ CTsCenrepListener* iThemeEffectsEnabledWatcher; + + // Owned window for showing controls + RWindowGroup iWg; + + // Monitors popup mode + TBool iIsPopUpShown; + + // For starting in background + TBool iUiStarted; + TBool iDisableAppKeyHandling; + + TInt iUnderAppWgId; + }; #endif // TSAPPUI_H diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappview.h --- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappview.h Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappview.h Wed May 12 13:22:51 2010 +0300 @@ -22,6 +22,7 @@ #include #include #include +#include #include "tsdevicestate.h" #include "tsdatachangeobserver.h" #include "tseventcontrolerobserver.h" @@ -49,13 +50,15 @@ * @param aRect Area where view should draw itself. */ static CTsAppView* NewL(const TRect& aRect, - CTsDeviceState& aDeviceState); + CTsDeviceState& aDeviceState, + RWindowGroup& aWg); /** * @copydoc NewL */ static CTsAppView* NewLC(const TRect& aRect, - CTsDeviceState& aDeviceState); + CTsDeviceState& aDeviceState, + RWindowGroup& aWg); /** * Destructor. @@ -93,6 +96,27 @@ * Forward app key handling to fasswaparea control. */ void HandleAppKey(TInt aType); + + /** + * Orders window invalidation to perform full + * background redraw. + */ + void OrderFullWindowRedraw(); + + /** + * Orders window invalidation to perform full + * background redraw. + */ + void EnableDragEvents( TBool aEnable ); + + /** + * Checks if app with the given wg id is closing + * + * @param aWgId id of window group which is checked + * if it is closing + * @return ETrue if application is being closed, EFalse otherwise + */ + TBool AppCloseInProgress( TInt aWgId ); protected: // from MCoeControlObserver @@ -116,7 +140,7 @@ /** * @copydoc NewL */ - void ConstructL( const TRect& aRect ); + void ConstructL( const TRect& aRect, RWindowGroup& aWg ); /** * C++ constructor. @@ -156,7 +180,7 @@ /** * Updates the text in the applications and suggestions heading panes. */ - void UpdateHeadingsL(); + void UpdateHeadingsL( TInt aNewCount ); /** * Disables transition animations for taskswitcher app. @@ -164,13 +188,30 @@ */ void DisableAppSwitchEffects(); + /** + * Launches feedback through MTouchFeedback::Instance() + * + * @param aType - The logical feedback type to play. + * @param aFeedbackType - Feedback types to be played as a bitmask + * combination of enumeration items from + * TTouchFeedbackType + * @param aPointerEvent - Pointer event, which triggered this feedback. + */ + void LaunchFeedback( TTouchLogicalFeedback aType, + TTouchFeedbackType aFeedbackType, + const TPointerEvent& aPointerEvent); + /** + * Area, where drag events are being handled. + */ + TRect DragArea(); + public://From MTsEventControlerObserver /** * Declare drag gesture handling. * @param aOffset - drag distance */ - virtual void MoveOffset(const TPoint& aOffset); + virtual void MoveOffset(const TPoint& aOffset, TBool aDrawNow); /** * Declare tap gesture handling. @@ -187,7 +228,7 @@ /** * */ - virtual void Drag( + virtual void DragL( const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent); /** diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontroler.h --- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontroler.h Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontroler.h Wed May 12 13:22:51 2010 +0300 @@ -152,10 +152,24 @@ TBool aLandscape); /** + * Returns ETrue if avkon physics is running, EFalse if not. + */ + TBool IsPhysicsRunning(); + + /** * Stops currently ongoing animation */ void StopAnimation(); + /** + * Enables/disables event handling based on passed value. + * + * @param aEnable ETrue - enables event handling + * EFalse - disables event handling + */ + void EnableEventHandling( TBool aEnable ); + void EnableDragEventHandling( TBool aEnable ); + private: /** * Controler observer. Not own @@ -171,6 +185,12 @@ * Physics helper. Own */ CTsPhysicsEngine* iPhysicsHelper; + + /** + * Flag to enable/disable event handling + */ + TBool iHandleEvents; + TBool iHandleDragEvents; }; #endif // TSEVENTCONTROLER_H diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontrolerobserver.h --- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontrolerobserver.h Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontrolerobserver.h Wed May 12 13:22:51 2010 +0300 @@ -33,7 +33,7 @@ * Declare drag gesture handling. * @param aOffset - drag distance */ - virtual void MoveOffset(const TPoint& aOffset)=0; + virtual void MoveOffset(const TPoint& aOffset, TBool aDrawNow)=0; /** * Declare tap gesture handling. @@ -51,7 +51,7 @@ * Declare drag gesture handling. * @param aEvent - drag event */ - virtual void Drag(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent) =0; + virtual void DragL(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent) =0; /** * Declare animation stop handling diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswaparea.h --- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswaparea.h Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswaparea.h Wed May 12 13:22:51 2010 +0300 @@ -155,6 +155,12 @@ * Handling short/long app key. */ void HandleAppKey(TInt aType); + + /* + * Updates components visibility, used to switch off + * grid scrollbar visibility for transition effects + */ + void UpdateComponentVisibility(); private: @@ -178,7 +184,7 @@ * Implements drag gesture handling * @see MTsEventControlerObserver */ - void MoveOffset(const TPoint&); + void MoveOffset(const TPoint&, TBool); /** * Implements tap gesture handling @@ -196,7 +202,7 @@ * Implements drag gesture handling * @see MTsEventControlerObserver */ - void Drag(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent); + void DragL(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent); /** * Implements animation stop handling @@ -212,6 +218,11 @@ */ TPoint ViewPos()const; + /** + * Checks if the app with the given window group id is closing + */ + TBool IsAppClosing( TInt aWgId ); + public: // from CCoeControl TInt CountComponentControls() const; @@ -256,7 +267,7 @@ /** * Shows the content from iArray on the screen. */ - void RenderContentL(); + void RenderContentL( TBool aSuppressAnimation = EFalse ); /** * Creates the ganes grid control. @@ -264,6 +275,11 @@ void ReCreateGridL(); /** + * Setup grid layout + */ + void LayoutGridL(); + + /** * Returns rectangles for fast swap area controls */ void GetFastSwapAreaRects( RArray& aRects ); @@ -284,12 +300,6 @@ * 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. @@ -313,11 +323,6 @@ 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. @@ -374,7 +379,24 @@ * consume EEventKeyUp that follows after event that swiched on the highlight. */ TKeyResponse ShowHighlightOnKeyEvent(const TKeyEvent& aKeyEvent, TEventCode aType); - + + /** + * Returns current screen orientation: + * + * @return 1 if landscape, 0 if portait + */ + TInt GetCurrentScreenOrientation(); + + /** + * Retrieves variety value, based on current screen resolution. + * + * @param aVariety result of the function, 0 value means portrait + * value of 1 indicates landscape + * @return ETrue if screen resolution differs from vale returned by + * layout meta data functions. + */ + TBool GetVariety( TInt& aVariety ); + private: // Data // parent control @@ -400,9 +422,6 @@ CAknStylusPopUpMenu* iPopup; // the aIndex argument of ShowPopupL is stored here TInt iAppIndexForPopup; - - // Timestamp of the last application close operation - TTime iTimeOfLastClose; // Observer ptr, may be NULL, not owned MTsDataChangeObserver* iDcObserver; @@ -411,23 +430,31 @@ CTsEventControler& iEvtHandler; TInt iMaxItemsOnScreen; - TInt iPreviousNoOfItems; // Tap event TPointerEvent iTapEvent; CTsFastSwapTimer* iHighlightTimer; + // View offset position, used by animation physics + TInt iLogicalViewPosOffset; + // Grid scrolling TInt iGridItemWidth; TInt iGridItemGap; CTsFastSwapTimer* iRedrawTimer; // owned - CTsFastSwapTimer* iUpdateGridTimer;//owned + CTsFastSwapTimer* iOrientationSignalTimer; // owned + TInt iPrevScreenOrientation; + TBool iIgnoreLayoutSwitch; // Key event handling TBool iConsumeEvent; TBool iKeyEvent; + + // App closing handling + RArray iIsClosing; + TInt iWidgetClosingCount; }; #endif // TSFASTSWAPAREA_H diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswapgrid.h --- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswapgrid.h Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswapgrid.h Wed May 12 13:22:51 2010 +0300 @@ -77,9 +77,9 @@ public: // From CCoeControl void HandlePointerEventL( const TPointerEvent &aPointerEvent ); - TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); void HandleResourceChange( TInt aType ); void SizeChanged(); + void Draw( const TRect& aRect ) const; public: //From MTsDeviceStateObserver /** @@ -117,6 +117,23 @@ void ResetCloseHit(); /** + * Sets color for the screenshot stroke. + * + * @param aColor color for the thumbnail + * @param aHighlightedColor color for thumbnail when item is highlighted + */ + void SetStrokeColors( TRgb aColor, + TRgb aHighlightedColor ); + + /** + * Sets items for which stroke will be drawn + * + * @param aItemIndex array of item indexes for which stroke + * is drawn + */ + void SetStrokeItemsL( RArray& aItemIndex ); + + /** * Sets grid behaviour * * @param aBehaviour behaviour to be set @@ -160,43 +177,19 @@ TRect VisibleViewRect(); /** - * Launch tactile ETouchFeedbackSensitive feedback. + * Updates layout data for item drawer. Should be called when + * layout maybe out of date */ - void LaunchTactileFeedback(); - - /** - * Set tactile feedback support. - * - * @param aSupport new support value - */ - void SetTactileFeedbackSupport(TBool aSupport); + void UpdateItemDrawerLayoutDataL(); /** - * 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 + * Enables/disables avkon event handling. * - * @param aItem idem index - * @return ETrue if item was added - * EFalse if item was not added because it was there before + * @param aEnable if set to ETrue, pointer events will be forwarded + * to CAknGrid base class if necessary. If set to EFalse, + * no pointer events will be forwarded. */ - 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; + void EnableAknEventHandling( TBool aEnable ); private: // From CAknGrid virtual void CreateItemDrawerL(); @@ -209,7 +202,7 @@ /** * Loads close icon bitmap and mask */ - void LoadCloseIcon(); + void LoadCloseIconAndStrokeParams(); /** * Redraws grid and parent controls @@ -221,9 +214,6 @@ // Grid's parent const CCoeControl* iParent; - // Background context for grid - CAknsFrameBackgroundControlContext* iBgContext; - // Close icon handling RArray iCloseItems; TInt iCloseIconHitIdx; @@ -237,11 +227,8 @@ // Visible view rectangle (horizontal scrolling support) TRect iVisibleViewRect; - // Feedback support - TBool iTactileFeedbackSupport; - - mutable RArray iFullyVisibleItems; - mutable RArray iPartialVisibleItems; + // Flag controlling input handling by grid + TBool iAknEventHandlingEnabled; }; @@ -254,7 +241,7 @@ public: // Constructor and destructor CTsGridItemDrawer( CTsFastSwapGrid* aGrid, - CFormattedCellListBoxData* aData ); + CFormattedCellListBoxData* aData ); ~CTsGridItemDrawer(); public: // New functions @@ -263,7 +250,8 @@ * Sets close icon drawn for items that can be closed. * Ownership transferred. */ - void SetCloseIcon( CFbsBitmap* aBmp, CFbsBitmap* aMask ); + void SetCloseIcon( CFbsBitmap* aBmp, CFbsBitmap* aBmpMask, + CFbsBitmap* aBmpPressed, CFbsBitmap* aBmpPressedMask ); /** * Initializes close icon rectangles. @@ -294,6 +282,41 @@ * if set to EFalse, background will not be redrawn */ void SetRedrawBackground( TBool aEnable ); + + /** + * Sets color for the screenshot stroke. + * + * @param aColor color for the thumbnail + * @param aHighlightedColor color for thumbnail when item is highlighted + */ + void SetStrokeColors( TRgb aNormalColor, + TRgb aHighlightedColor ); + + /** + * Sets items for which stroke will be drawn + * + * @param aItemIndex array of item indexes for which stroke + * is drawn. + */ + void SetStrokeItemsL( RArray& aItemIndex ); + + /** + * Sets stroke offset and size: values must be relative + * to item rectangle. + * + * @param aStrokeOffset offset of the stroke rectangle relative + * to item rectangle + * @param aStrokeSize size of the stroke rectangle + */ + void SetStrokeOffset( TPoint aStrokeOffset, TSize aStrokeSize ); + + /** + * Set screen rectangle, used by the item drawer to determine + * drawn area. + * + * @param aRect screen rectangle + */ + void SetScreenRect( TRect aRect ); private: // From CFormattedCellListBoxItemDrawer void DrawActualItem( TInt aItemIndex, const TRect& aActualItemRect, @@ -331,16 +354,24 @@ // Owned CFbsBitmap* iCloseIcon; CFbsBitmap* iCloseIconMask; + CFbsBitmap* iCloseIconPressed; + CFbsBitmap* iCloseIconPressedMask; TRect iScreenRect; TInt iLeftOffset; TInt iRightOffset; - // Layout data + // Close button data TRect iCloseIconRect; TRect iCloseButtonRect; TBool iRedrawBackground; + + // Stroke data + TRgb iStrokeColor; + TRgb iHighlightStrokeColor; + RArray iStrokeItems; + TRect iStrokeRect; }; diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/inc/tsphysicsengine.h --- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsphysicsengine.h Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsphysicsengine.h Wed May 12 13:22:51 2010 +0300 @@ -71,10 +71,12 @@ void HandleDragEvent(AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent); /** + * Checks if the physics is running */ TBool IsRunning() const; /** + * Stops physics */ void Stop(); @@ -107,9 +109,22 @@ TTime iStartTime; /** + * Drag start position + */ + TPoint iStartPosition; + + /** * Taskswitcher physics for item switch animation */ CTsPhysics* iTaskswitcherPhysics; + + /** + * Marks direction in which drag events are made: + * Values: 0 - uninitialized + * 1 - drag right + * -1 - drag left + */ + TInt iDragDirection; }; diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/loc/taskswitcher.loc --- a/taskswitcher/taskswitcherui/taskswitcherapp/loc/taskswitcher.loc Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/loc/taskswitcher.loc Wed May 12 13:22:51 2010 +0300 @@ -41,7 +41,13 @@ //l:heading_pane_t1 //r:5.0 // -#define qtn_task_switcher_heading_applications "Open applications" +#define qtn_task_switcher_heading_applications "Open applications (%d)" + +//d:Text for no appliactions +//l:none +//r:5.0 +// +#define qtn_task_switcher_no_apps "No open application" //d:Text for appliactions that has no name //l:none diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp --- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp Wed May 12 13:22:51 2010 +0300 @@ -27,12 +27,13 @@ #include #include #include -#include +#include #include #include #include #include #include +#include // AknCapServer UID, used for P&S category @@ -41,6 +42,8 @@ // Taskswitcher UI, used as P&S key const TInt KTaskswitcherStateKey = KTsAppUidValue; +const TUid KTransitionsUid = {0x10281F90}; + // Values for Taskswitcher launching P&S const TInt KTaskswitcherBackgroundValue = 1; const TInt KTaskswitcherForegroundValue = KTaskswitcherBackgroundValue << 1; @@ -54,11 +57,12 @@ //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; +const TInt KWaitBeforeGoingToBackground = 200000; + +const TUid KTsAppUid = { KTsAppUidValue }; // ----------------------------------------------------------------------------- // CTsAppUi::ConstructL() @@ -82,7 +86,10 @@ #endif // Initialise app UI with standard value. - BaseConstructL( CAknAppUi::EAknEnableSkin | CAknAppUi::EAknEnableMSK ); + BaseConstructL( CAknAppUi::EAknEnableSkin | + CAknAppUi::EAknEnableMSK | + CAknAppUi::EAknSingleClickCompatible); + SetFullScreenApp(EFalse); #ifndef _DEBUG // set as system application (in release build) so we never get closed @@ -110,26 +117,46 @@ // Create commonly used instances (device state only?) iDeviceState = CTsDeviceState::NewL(); + // Create custom window group + iWg = RWindowGroup(CCoeEnv::Static()->WsSession()); + iWg.Construct((TUint32)&iWg, ETrue); + iWg.EnableScreenChangeEvents(); + // Create UI - iAppView = CTsAppView::NewL( ApplicationRect(), *iDeviceState ); + iAppView = CTsAppView::NewL( ApplicationRect(), *iDeviceState, iWg ); AddToStackL( iAppView ); //Enable effects GfxTransEffect::Enable(); - GfxTransEffect::Register(iAppView,TUid::Uid(KTsAppUidValue)); + GfxTransEffect::Register(iAppView,KTransitionsUid); GfxTransEffect::SetTransitionObserver(this); // Listen for change in the value of the ts state property. iPropListener = new ( ELeave ) CTsPropertyListener( KTaskswitcherStateCategory, KTaskswitcherStateKey, *this ); + + // Listen for layout changes + iLayoutListener = new ( ELeave ) CTsPropertyListener( + KPSUidUikon, KUikLayoutState, *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() ); + //iApplicationTask.SetWgId( iCoeEnv->RootWin().Identifier() ); + iApplicationTask.SetWgId( iWg.Identifier() ); // And finally, go to background. - MoveAppToBackground( AknTransEffect::ENone ); - + MoveAppToBackground( ENoneTransition ); + + iEikonEnv->RootWin().SetOrdinalPosition(-1, ECoeWinPriorityNeverAtFront); + iEikonEnv->RootWin().EnableReceiptOfFocus(EFalse); + + RWindowGroup& windowGroup = CCoeEnv::Static()->RootWin(); + windowGroup.EnableGroupListChangeEvents(); + + iIsPopUpShown = EFalse; + iUiStarted = EFalse; + iDisableAppKeyHandling = EFalse; + TSLOG_OUT(); } @@ -160,6 +187,7 @@ delete iGoToBackgroundTimer; delete iPropListener; + delete iLayoutListener; // destroy UI first if ( iAppView ) @@ -169,8 +197,9 @@ } delete iDeviceState; - delete iMemAllocBuf; delete iThemeEffectsEnabledWatcher; + + iWg.Close(); } // ----------------------------------------------------------------------------- @@ -186,7 +215,7 @@ // CTsAppUi::StartTransion // ----------------------------------------------------------------------------- // -void CTsAppUi::StartTransion( TUint aTransitionType ) +void CTsAppUi::StartTransion( TUint aTransitionType, TUid aNextAppUid, TInt aWgId ) { if( !EffectsEnabled() ) { @@ -194,23 +223,20 @@ } switch(aTransitionType) { - case AknTransEffect::EApplicationStart: + case EForegroundTransition: StartTransition( aTransitionType, ETrue, EFalse, CAknTransitionUtils::EForceVisible); break; - case AknTransEffect::EApplicationExit: + case EBackgroundTransition: StartTransition( aTransitionType, EFalse, EFalse, CAknTransitionUtils::EForceInvisible ); break; - case AknTransEffect::EApplicationStartRect: - StartTransition( aTransitionType, - EFalse, - ETrue, - CAknTransitionUtils::EForceInvisible ); + case EActivationTransition: + StartAppActivateTransition( aNextAppUid, aWgId ); break; } } @@ -224,6 +250,7 @@ TBool /*aLayers*/, TUint aSubCom ) { + TRAP_IGNORE( RequestPopUpL() ); const TDesC8* ptr = reinterpret_cast(iAppView); GfxTransEffect::Abort(iAppView); GfxTransEffect::Begin( iAppView, aTranstionId ); @@ -238,16 +265,56 @@ } // ----------------------------------------------------------------------------- +// CTsAppUi::StartAppActivateTransition +// ----------------------------------------------------------------------------- +// +void CTsAppUi::StartAppActivateTransition( TUid aNextAppUid, TInt aWgId ) + { + // Check what type of transition will be trigerred + if ( aWgId == iUnderAppWgId ) + { + // App under task switcher was launched + StartTransition( EBackgroundTransition, + EFalse, + ETrue, + CAknTransitionUtils::EForceInvisible ); + } + else + { + // App start animation + TRAP_IGNORE( RequestPopUpL() ); + const TDesC8* ptr = reinterpret_cast(iAppView); + GfxTransEffect::Abort(iAppView); + TInt groupId = GfxTransEffect::BeginGroup(); + GfxTransEffect::BeginFullScreen( + EActivationAppShowTransition, ApplicationRect(), + AknTransEffect::EParameterType, + AknTransEffect::GfxTransParam( aNextAppUid , KTsAppUid ) ); + GfxTransEffect::Begin( iAppView, EBackgroundTransition ); + GfxTransEffect::SetDemarcation( iAppView, iAppView->Rect() ); + GfxTransEffect::NotifyExternalState( ECaptureComponentsBegin, ptr ); + iAppView->MakeVisible( EFalse ); + CAknTransitionUtils::MakeVisibleSubComponents( + iAppView, + static_cast(CAknTransitionUtils::EForceInvisible) ); + GfxTransEffect::NotifyExternalState( ECaptureComponentsEnd, ptr ); + GfxTransEffect::End( iAppView ); + GfxTransEffect::EndFullScreen(); + GfxTransEffect::EndGroup(groupId); + } + } + +// ----------------------------------------------------------------------------- // CTsAppUi::TransitionFinished // ----------------------------------------------------------------------------- // -void CTsAppUi::TransitionFinished(const CCoeControl* /*aControl*/, +void CTsAppUi::TransitionFinished(const CCoeControl* aControl, TUint /*aAction*/) { - /*if( aControl == iAppView ) + if ( aControl == iAppView ) { - @TODO IMPLEMENT - }*/ + TRAP_IGNORE( DisablePopUpL() ); + } } // ----------------------------------------------------------------------------- @@ -267,12 +334,12 @@ case EAknSoftkeyExit: case EAknSoftkeyBack: // RSK => just hide - MoveAppToBackground( AknTransEffect::EApplicationExit ); + MoveAppToBackground( EBackgroundTransition ); break; case ETsCmdHelp: { - MoveAppToBackground( AknTransEffect::EApplicationExit ); + MoveAppToBackground( EBackgroundTransition ); CArrayFix* buf = CCoeAppUi::AppHelpContextL(); HlpLauncher::LaunchHelpApplicationL( iCoeEnv->WsSession(), buf ); } @@ -314,13 +381,27 @@ // 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.) + iDisableAppKeyHandling = EFalse; + if ( !iUiStarted ) + { + // Ignore foreground events if UI is starting + return; + } if ( aForeground ) { HandleSwitchToForegroundEvent(); } + // exclude cases with dialogs like power menu, memory card else { - HandleSwitchToBackgroundEvent(); + if( !IsFaded() ) + { + HandleSwitchToBackgroundEvent(); + } + else + { + iDisableAppKeyHandling = ETrue; + } } // Call Base class method @@ -340,31 +421,40 @@ TInt value( 0 ); - if ( RProperty::Get( aCategory, aKey, value ) == KErrNone ) + if ( aCategory == KTaskswitcherStateCategory ) { - if ( iForeground && (value & KTaskswitcherBackgroundValue) ) - { - MoveAppToBackground( AknTransEffect::EApplicationExit ); - } - else if ( !iForeground && (value & KTaskswitcherForegroundValue) ) + if ( RProperty::Get( aCategory, aKey, value ) == KErrNone ) { - MoveAppToForeground( AknTransEffect::EApplicationStart ); - } - else if( value & KTaskswitcherLongAppKeyPressed ) - { - if(!iForeground) + if ( iForeground && (value & KTaskswitcherBackgroundValue) ) + { + MoveAppToBackground( EBackgroundTransition ); + } + else if ( !iForeground && (value & KTaskswitcherForegroundValue) ) + { + MoveAppToForeground( EForegroundTransition ); + } + else if( value & KTaskswitcherLongAppKeyPressed ) { - MoveAppToBackground( AknTransEffect::EApplicationExit ); + if(!iForeground) + { + MoveAppToBackground( EBackgroundTransition ); + } + else if( !iDisableAppKeyHandling ) + { + iAppView->HandleAppKey(KAppKeyTypeLong); + } } - else + else if( value & KTaskswitcherShortAppKeyPressed && !iDisableAppKeyHandling ) { - iAppView->HandleAppKey(KAppKeyTypeLong); + iAppView->HandleAppKey(KAppKeyTypeShort); } } - else if( value & KTaskswitcherShortAppKeyPressed ) - { - iAppView->HandleAppKey(KAppKeyTypeShort); - } + } + else if ( aCategory == KPSUidUikon && iIsPopUpShown ) + { + TRAP_IGNORE( + DisablePopUpL(); + HandleResourceChangeL(KEikDynamicLayoutVariantSwitch) ); } TSLOG_OUT(); @@ -376,12 +466,15 @@ // void CTsAppUi::HandleResourceChangeL( TInt aType ) { + TSLOG_CONTEXT( CTsAppUi::HandleResourceChangeL, TSLOG_LOCAL ); + TSLOG_IN(); // Must call base class implementation first, // sizes from LayoutMetricsRect etc. will only be correct after this. CAknAppUi::HandleResourceChangeL( aType ); - if( aType == KEikDynamicLayoutVariantSwitch && iAppView ) + if( aType == KEikDynamicLayoutVariantSwitch && iAppView && !LayoutChangeAllowed() ) { - iAppView->SetRect( ApplicationRect() ); + // Keep displayed orientation + return; } // forward event iDeviceState->HandleResourceChange( aType ); @@ -389,24 +482,25 @@ { iAppView->HandleResourceChange( aType ); } + TSLOG_OUT(); } // ----------------------------------------------------------------------------- // CTsAppUi::MoveAppToBackground() // ----------------------------------------------------------------------------- // -void CTsAppUi::MoveAppToBackground( TUint aTransitionType ) +void CTsAppUi::MoveAppToBackground( TUint aTransitionType, TUid aAppUid, TInt aWgId ) { TSLOG_CONTEXT( MoveAppToBackground, TSLOG_LOCAL ); TSLOG_IN(); - if ( AknTransEffect::ENone == aTransitionType || !EffectsEnabled() ) + if ( ENoneTransition == aTransitionType || !EffectsEnabled() ) { GoToBackgroundTimerCallback( this ); } else { - StartTransion(AknTransEffect::EApplicationExit); + StartTransion(aTransitionType, aAppUid, aWgId); iGoToBackgroundTimer->Cancel(); iGoToBackgroundTimer->Start( KWaitBeforeGoingToBackground, @@ -456,6 +550,8 @@ TSLOG_CONTEXT( MoveAppToForeground, TSLOG_LOCAL ); TSLOG_IN(); + iUiStarted = ETrue; + // Request window server to bring our application // to foreground iApplicationTask.BringToForeground(); @@ -476,21 +572,17 @@ 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() ) + + + if( iForeground ) { iForeground = EFalse; SetTaskswitcherStateProperty( KTaskswitcherBackgroundValue ); - //allocating extra memory space - if ( !iMemAllocBuf ) - { - iMemAllocBuf = - (TUint8*) User::Alloc( KMemoryToBeReservedInBytes ); - } - // notify view iAppView->HandleSwitchToBackgroundEvent(); + + iWg.SetOrdinalPosition(-1, ECoeWinPriorityNormal); } TSLOG_OUT(); @@ -508,10 +600,6 @@ // 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 ) @@ -524,6 +612,8 @@ // notify view iAppView->HandleSwitchToForegroundEvent(); + + iWg.SetOrdinalPosition(iWg.OrdinalPosition(), ECoeWinPriorityAlwaysAtFront); } TSLOG_OUT(); @@ -581,4 +671,168 @@ } +// ----------------------------------------------------------------------------- +// CTsAppUi::RequestPopUpL +// ----------------------------------------------------------------------------- +// +void CTsAppUi::RequestPopUpL() + { + TSLOG_CONTEXT( CTsAppUi::RequestPopUpL, TSLOG_LOCAL ); + TSLOG_IN(); + if(!iIsPopUpShown) + { + iIsPopUpShown = ETrue; + TSizeMode mode = iEikonEnv->ScreenDevice()->GetCurrentScreenModeAttributes(); + TInt isLandscape = mode.iScreenSize.iWidth > mode.iScreenSize.iHeight; + SetFullScreenApp(ETrue); + if(isLandscape) + { + SetOrientationL(EAppUiOrientationLandscape); + } + else + { + SetOrientationL(EAppUiOrientationPortrait); + } + iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront); + } + TSLOG_OUT(); + } + + +// ----------------------------------------------------------------------------- +// CTsAppUi::DisablePopUpL +// ----------------------------------------------------------------------------- +// +void CTsAppUi::DisablePopUpL() + { + TSLOG_CONTEXT( CTsAppUi::DisablePopUpL, TSLOG_LOCAL ); + TSLOG_IN(); + if(iIsPopUpShown) + { + iIsPopUpShown = EFalse; + iEikonEnv->RootWin().SetOrdinalPosition(-1, ECoeWinPriorityNeverAtFront); + SetOrientationL(EAppUiOrientationAutomatic); + SetFullScreenApp(EFalse); + } + TSLOG_OUT(); + } + + +// ----------------------------------------------------------------------------- +// CTsAppUi::LayoutCanBeChanged +// ----------------------------------------------------------------------------- +// +TBool CTsAppUi::LayoutChangeAllowed() + { + // Check if layout switch is necessary + TSizeMode mode = iEikonEnv->ScreenDevice()->GetCurrentScreenModeAttributes(); + TBool isLandscape = mode.iScreenSize.iWidth > mode.iScreenSize.iHeight; + TRect appRect = ApplicationRect(); + TBool isAppLandscape = appRect.Width() > appRect.Height(); + TBool retVal; + if(isLandscape != isAppLandscape) + { + retVal = EFalse; + } + else + { + retVal = ETrue; + } + return retVal; + } + + +// ----------------------------------------------------------------------------- +// CTsAppUi::HandleWsEventL +// ----------------------------------------------------------------------------- +// +void CTsAppUi::HandleWsEventL(const TWsEvent& aEvent, + CCoeControl* aDestination) + { + CAknAppUi::HandleWsEventL(aEvent, aDestination); + TInt eventType = aEvent.Type(); + if ( eventType == EEventWindowGroupListChanged ) + { + TInt wgId = WgIdOfUnderlyingApp(EFalse); + if ( iForeground && + wgId != iUnderAppWgId && + !iAppView->AppCloseInProgress(iUnderAppWgId) ) + { + MoveAppToBackground( ENoneTransition ); + } + if ( WgIdOfUnderlyingApp(ETrue) != iUnderAppWgId ) + { + HandleResourceChangeL(KEikDynamicLayoutVariantSwitch); + } + iUnderAppWgId = wgId; + } + } + + +// ----------------------------------------------------------------------------- +// CTsAppUi::WgIdOfUnderlyingApp +// ----------------------------------------------------------------------------- +// +TInt CTsAppUi::WgIdOfUnderlyingApp( TBool aIgnoreParentChild ) + { + TInt retVal(0); + TApaTaskList taskList( iEikonEnv->WsSession() ); + TInt underlyingWg = taskList.FindByPos(0).WgId(); + if ( aIgnoreParentChild ) + { + retVal = underlyingWg; + } + else + { + TInt parentWg = GetTopParentWg( underlyingWg ); + retVal = parentWg ? parentWg : underlyingWg; + } + return retVal; + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::GetTopParentWg +// ----------------------------------------------------------------------------- +// +TInt CTsAppUi::GetTopParentWg( TInt aChildWg ) + { + TInt parentWg = GetParentWg( aChildWg ); + if( parentWg ) + { + TInt topParentWg = GetTopParentWg( parentWg ); + if( topParentWg ) + { + parentWg = topParentWg; + } + } + return parentWg; + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::GetParentWg +// ----------------------------------------------------------------------------- +// +TInt CTsAppUi::GetParentWg( TInt aChildWg ) + { + TInt retVal(0); + RArray allWgIds; + // Ask for window group list from RWsSession + TInt error = iEikonEnv->WsSession().WindowGroupList( 0, &allWgIds ); + if ( !error ) + { + TInt count( allWgIds.Count() ); + for ( TInt i( 0 ); i < count; i++ ) + { + RWsSession::TWindowGroupChainInfo info = allWgIds[i]; + if ( info.iId == aChildWg && info.iParentId > 0) + { + retVal = info.iParentId; + break; + } + } + } + allWgIds.Close(); + return retVal; + } + // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/src/tsappview.cpp --- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappview.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappview.cpp Wed May 12 13:22:51 2010 +0300 @@ -29,9 +29,7 @@ #include #include #include -#include -#include - +#include #include "tsappview.h" #include "tsappui.h" #include "tsapplogging.h" @@ -39,14 +37,17 @@ #include "tseventcontroler.h" #include "tsuid.hrh" + + // ----------------------------------------------------------------------------- // CTsAppView::NewL // ----------------------------------------------------------------------------- // CTsAppView* CTsAppView::NewL( const TRect& aRect, - CTsDeviceState& aDeviceState ) + CTsDeviceState& aDeviceState, + RWindowGroup& aWg) { - CTsAppView* self = CTsAppView::NewLC( aRect, aDeviceState ); + CTsAppView* self = CTsAppView::NewLC( aRect, aDeviceState, aWg ); CleanupStack::Pop( self ); return self; } @@ -56,11 +57,12 @@ // ----------------------------------------------------------------------------- // CTsAppView* CTsAppView::NewLC( const TRect& aRect, - CTsDeviceState& aDeviceState ) + CTsDeviceState& aDeviceState, + RWindowGroup& aWg) { CTsAppView* self = new (ELeave) CTsAppView( aDeviceState ); CleanupStack::PushL( self ); - self->ConstructL( aRect ); + self->ConstructL( aRect, aWg ); return self; } @@ -100,14 +102,6 @@ // 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; @@ -119,13 +113,13 @@ // CTsAppView::ConstructL // ----------------------------------------------------------------------------- // -void CTsAppView::ConstructL( const TRect& aRect ) +void CTsAppView::ConstructL( const TRect& aRect, RWindowGroup& aWg ) { TSLOG_CONTEXT( CTsAppView::ConstructL, TSLOG_LOCAL ); TSLOG_IN(); // Create a window for this application view - CreateWindowL(); + CreateWindowL(aWg); // Store rect TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; @@ -140,7 +134,7 @@ KAknsIIDQsnFrPopup, iBgContextOuterRect, iBgContextInnerRect, - ETrue ); + EFalse ); iBgContext->SetFrameRects(iBgContextOuterRect, iBgContextInnerRect); iBgContext->SetCenter( KAknsIIDQsnFrPopupCenter ); @@ -174,9 +168,8 @@ } DrawableWindow()->EnableBackup(EWindowBackupFullScreen); - Window().SetOrdinalPosition( 0, ECoeWinPriorityNormal ); SetComponentsToInheritVisibility(ETrue); - MakeVisible(ETrue); + MakeVisible(EFalse); // Ready to be drawn ActivateL(); @@ -221,14 +214,6 @@ 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(); } @@ -264,7 +249,7 @@ CleanupStack::PopAndDestroy( &rects ); - UpdateHeadingsL(); + UpdateHeadingsL(0); } // ----------------------------------------------------------------------------- @@ -321,8 +306,10 @@ { TSLOG_CONTEXT( CTsAppView::SizeChanged, TSLOG_LOCAL ); TSLOG_IN(); + iViewRect = Rect(); UpdatePopupRects(); iBgContext->SetFrameRects(iBgContextOuterRect, iBgContextInnerRect); + iBgContext->SetParentPos(PositionRelativeToScreen()); if ( iFastSwapArea && iAppsHeading ) { RArray rects; @@ -455,19 +442,10 @@ // 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 ); } // ----------------------------------------------------------------------------- @@ -476,8 +454,25 @@ // void CTsAppView::HandleSwitchToForegroundEvent() { + TSLOG_CONTEXT( CTsAppView::HandleSwitchToForegroundEvent, TSLOG_LOCAL ); + TSLOG_IN(); + + // Forward event to interested controls + iFastSwapArea->HandleSwitchToForegroundEvent(); + iFastSwapArea->UpdateComponentVisibility(); + + // Check for layout updates + CTsAppUi* appUi = static_cast(iCoeEnv->AppUi()); + if ( iViewRect != appUi->ApplicationRect() && + appUi->LayoutChangeAllowed() ) + { + HandleDeviceStateChanged( EOrientation ); + } + Window().Invalidate(Rect()); + iEvtHandler->EnableEventHandling(ETrue); + // Fade behind the pop-up iPopupFader.FadeBehindPopup( this, NULL, ETrue ); @@ -486,16 +481,13 @@ // 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); + appui->StartTransion(CTsAppUi::EForegroundTransition); } else { @@ -504,7 +496,10 @@ MakeVisible( ETrue ); } + iFastSwapArea->UpdateComponentVisibility(); DrawDeferred(); + + TSLOG_OUT(); } // ----------------------------------------------------------------------------- @@ -551,7 +546,7 @@ // Called when screen orientation, touch awareness, or the skin has been changed. // ----------------------------------------------------------------------------- // -void CTsAppView::HandleDeviceStateChanged( TChangeType /*aChangeType*/ ) +void CTsAppView::HandleDeviceStateChanged( TChangeType aChangeType ) { TSLOG_CONTEXT( HandleDeviceStateChanged, TSLOG_LOCAL ); TSLOG_IN(); @@ -559,11 +554,20 @@ // 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 ); + if(aChangeType == EOrientation) + { + SetRect( static_cast(iEikonEnv->AppUi())->ApplicationRect() ); + } + else + { + 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 ); + } + + InvalidateWindows(this); TSLOG_OUT(); } @@ -606,16 +610,18 @@ // void CTsAppView::HandlePointerEventL( const TPointerEvent &aPointerEvent ) { - MTouchFeedback* feedback = MTouchFeedback::Instance(); - if(0 != feedback && - (TPointerEvent::EButton1Down == aPointerEvent.iType || - TPointerEvent::EButton1Up == aPointerEvent.iType)) + if( TPointerEvent::EButton1Down == aPointerEvent.iType ) { - feedback->InstantFeedback(this, - ETouchFeedbackBasic, - ETouchFeedbackVibra, - aPointerEvent); - } + LaunchFeedback(ETouchFeedbackBasic, TTouchFeedbackType( + ETouchFeedbackVibra | ETouchFeedbackAudio), aPointerEvent); + + if( !DragArea().Contains(aPointerEvent.iParentPosition)) + { + //move task switcher to background + iEvtHandler->EnableEventHandling(EFalse); + iEikonEnv->EikAppUi()->HandleCommandL(EAknSoftkeyExit); + } + } iFastSwapArea->HandlePointerEventL(aPointerEvent); } @@ -623,28 +629,22 @@ // CTsAppView::DataChanged // ----------------------------------------------------------------------------- // -void CTsAppView::DataChanged( CCoeControl* /*aWhere*/, TInt /*aNewCount*/ ) +void CTsAppView::DataChanged( CCoeControl* /*aWhere*/, TInt aNewCount ) { - TRAP_IGNORE( UpdateHeadingsL() ); + TRAP_IGNORE( UpdateHeadingsL( aNewCount ) ); } // ----------------------------------------------------------------------------- // CTsAppView::UpdateHeadingsL // ----------------------------------------------------------------------------- // -void CTsAppView::UpdateHeadingsL() +void CTsAppView::UpdateHeadingsL( TInt aNewCount ) { -#ifndef TASKSWITCHER_USE_CUSTOM_LAYOUT HBufC* text = StringLoader::LoadLC( - R_TASK_SWITCHER_HEADING_APPLICATIONS ); -#else - _LIT( KTitle, "Task switcher" ); - HBufC* text = KTitle().AllocLC(); -#endif + R_TASK_SWITCHER_HEADING_APPLICATIONS, aNewCount ); iAppsHeading->SetTextL( *text ); iAppsHeading->DrawDeferred(); CleanupStack::PopAndDestroy( text ); - } @@ -657,13 +657,39 @@ iFastSwapArea->HandleAppKey(aType); } + +// ----------------------------------------------------------------------------- +// CTsAppView::OrderBackgrRedraw +// ----------------------------------------------------------------------------- +// +void CTsAppView::OrderFullWindowRedraw() + { + InvalidateWindows(this); + DrawNow(); + } + + +// ----------------------------------------------------------------------------- +// CTsAppView::EnableDragEvents +// ----------------------------------------------------------------------------- +// +void CTsAppView::EnableDragEvents( TBool aEnable ) + { + iEvtHandler->EnableDragEventHandling( aEnable ); + } + + // ----------------------------------------------------------------------------- // CTsAppView::MoveOffset // ----------------------------------------------------------------------------- // -void CTsAppView::MoveOffset(const TPoint& aOffset) +void CTsAppView::MoveOffset(const TPoint& aOffset, TBool aDrawNow) { - iFastSwapArea->MoveOffset(aOffset); + if ( aDrawNow ) + { + DrawDeferred(); + } + iFastSwapArea->MoveOffset(aOffset, aDrawNow); } // ----------------------------------------------------------------------------- @@ -677,11 +703,6 @@ iFastSwapArea->TapL(aPoint); DrawNow(); } - else if( !iAppsHeading->Rect().Contains(aPoint)) - { - //move task switcher to background - iEikonEnv->EikAppUi()->HandleCommandL(EAknSoftkeyExit); - } } // ----------------------------------------------------------------------------- @@ -694,20 +715,18 @@ { iFastSwapArea->LongTapL(aPoint); } - else if( !iAppsHeading->Rect().Contains(aPoint)) - { - //move task switcher to background - iEikonEnv->EikAppUi()->HandleCommandL(EAknSoftkeyExit); - } } // ----------------------------------------------------------------------------- -// CTsAppView::Drag() +// CTsAppView::DragL() // ----------------------------------------------------------------------------- // -void CTsAppView::Drag(const MAknTouchGestureFwDragEvent& aEvent) +void CTsAppView::DragL(const MAknTouchGestureFwDragEvent& aEvent) { - iFastSwapArea->Drag(aEvent); + if(DragArea().Contains(aEvent.StartPosition())) + { + iFastSwapArea->DragL(aEvent); + } } // ----------------------------------------------------------------------------- @@ -728,4 +747,52 @@ return iFastSwapArea->ViewPos(); } +// ----------------------------------------------------------------------------- +// CTsAppView::LaunchFeedback +// ----------------------------------------------------------------------------- +// +void CTsAppView::LaunchFeedback( TTouchLogicalFeedback aLogicalType, + TTouchFeedbackType aFeedbackType, + const TPointerEvent& aPointerEvent) + { + MTouchFeedback* feedback = MTouchFeedback::Instance(); + if(0 != feedback) + { + feedback->InstantFeedback(this, aLogicalType, + aFeedbackType, + aPointerEvent); + } + } + + +// ----------------------------------------------------------------------------- +// CTsAppView::AppCloseInProgress() +// ----------------------------------------------------------------------------- +// +TBool CTsAppView::AppCloseInProgress( TInt aWgId ) + { + return iFastSwapArea->IsAppClosing(aWgId); + } +// ----------------------------------------------------------------------------- +// CTsAppView::DragArea +// ----------------------------------------------------------------------------- +// +TRect CTsAppView::DragArea() + { + TRect dragArea; + if (Layout_Meta_Data::IsLandscapeOrientation()) + { + dragArea.SetRect(iAppsHeading->Rect().iTl.iX, + iAppsHeading->Rect().iTl.iY, iFastSwapArea->Rect().iBr.iX, + iFastSwapArea->Rect().iBr.iY); + } + else + { + dragArea.SetRect(Rect().iTl.iX, iAppsHeading->Rect().iTl.iY, + Rect().iBr.iX, iFastSwapArea->Rect().iBr.iY); + } + return dragArea; + } + + // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/src/tseventcontroler.cpp --- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tseventcontroler.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tseventcontroler.cpp Wed May 12 13:22:51 2010 +0300 @@ -65,7 +65,9 @@ MTsEventControlerObserver& aObserver) : CBase(), - iObserver(aObserver) + iObserver(aObserver), + iHandleEvents(ETrue), + iHandleDragEvents(ETrue) { } @@ -88,15 +90,18 @@ void CTsEventControler::HandleTouchGestureL( AknTouchGestureFw::MAknTouchGestureFwEvent& aEvent) { - if (AknTouchGestureFwEventDrag(aEvent)) + if ( iHandleEvents ) { - HandleDragEventL(*AknTouchGestureFwEventDrag(aEvent)); + if (AknTouchGestureFwEventDrag(aEvent)) + { + HandleDragEventL(*AknTouchGestureFwEventDrag(aEvent)); + } + else if (AknTouchGestureFwEventTap(aEvent)) + { + HandleTapEventL(*AknTouchGestureFwEventTap(aEvent)); + } + //ignore flick and pinch events } - else if (AknTouchGestureFwEventTap(aEvent)) - { - HandleTapEventL(*AknTouchGestureFwEventTap(aEvent)); - } - //ignore flick and pinch events } // ----------------------------------------------------------------------------- @@ -112,7 +117,7 @@ } else if(EAknTouchGestureFwTap == aEvent.Type()) { - if( iPhysicsHelper->IsRunning()) + if( IsPhysicsRunning() ) { iPhysicsHelper->Stop(); } @@ -130,8 +135,14 @@ void CTsEventControler::HandleDragEventL( MAknTouchGestureFwDragEvent& aEvent) { - iObserver.Drag(aEvent); - iPhysicsHelper->HandleDragEvent(aEvent); + if ( iHandleDragEvents ) + { + iObserver.DragL(aEvent); + if ( iHandleEvents && iHandleDragEvents ) + { + iPhysicsHelper->HandleDragEvent(aEvent); + } + } } // ----------------------------------------------------------------------------- @@ -139,10 +150,10 @@ // ----------------------------------------------------------------------------- // void CTsEventControler::ViewPositionChanged(const TPoint& aNewPosition, - TBool /*aDrawNow*/, + TBool aDrawNow, TUint /*aFlags*/) { - iObserver.MoveOffset(aNewPosition); + iObserver.MoveOffset(aNewPosition, aDrawNow); } // ----------------------------------------------------------------------------- @@ -183,6 +194,15 @@ } // ----------------------------------------------------------------------------- +// IsPhysicsRunning +// ----------------------------------------------------------------------------- +// +TBool CTsEventControler::IsPhysicsRunning() + { + return iPhysicsHelper->IsRunning(); + } + +// ----------------------------------------------------------------------------- // StopAnimation // ----------------------------------------------------------------------------- // @@ -191,4 +211,32 @@ iPhysicsHelper->Stop(); } + +// ----------------------------------------------------------------------------- +// EnableEventHandling +// ----------------------------------------------------------------------------- +// +void CTsEventControler::EnableEventHandling( TBool aEnable ) + { + iHandleEvents = aEnable; + if ( !aEnable && IsPhysicsRunning() ) + { + iPhysicsHelper->Stop(); + } + } + + +// ----------------------------------------------------------------------------- +// EnableDragEventHandling +// ----------------------------------------------------------------------------- +// +void CTsEventControler::EnableDragEventHandling( TBool aEnable ) + { + iHandleDragEvents = aEnable; + if ( !aEnable && IsPhysicsRunning() ) + { + iPhysicsHelper->Stop(); + } + } + // end of file diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswaparea.cpp --- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswaparea.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswaparea.cpp Wed May 12 13:22:51 2010 +0300 @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -38,6 +38,7 @@ #include "tsappui.h" #include "tsdatachangeobserver.h" #include "tseventcontroler.h" +#include "tsappview.h" /** command ids for the fsw popup */ enum TPopupCommands @@ -49,19 +50,8 @@ /** 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 KItemToHighlight = 2; const TInt KAppKeyTypeShort = 1; const TInt KAppKeyTypeLong = 2; @@ -69,8 +59,12 @@ const TInt KLayoutItemCount = 4; const TInt KRedrawTime = 250000; // 0.25 sec +const TInt KRedrawTimeForLayoutSwitch = 700000; // 0.7 sec const TInt KHighlighActivationTime = 100000; // 100 ms -const TInt KUpdateGridTime = 1000000; // 1 s +const TInt KUpdateGridTime = 0; // imediately +const TInt KOrientationSwitchTime = 1000000; // 1 sec + +const TInt KMaxGranularity = 4; // ----------------------------------------------------------------------------- // CTsFastSwapArea::NewL @@ -109,7 +103,7 @@ CTsDeviceState& aDeviceState, CTsEventControler& aEventHandler) : iParent(aParent), iDeviceState(aDeviceState), iEvtHandler(aEventHandler), - iPreviousNoOfItems(0) + iIgnoreLayoutSwitch(EFalse), iWidgetClosingCount(0) { // no implementation required } @@ -121,12 +115,14 @@ CTsFastSwapArea::~CTsFastSwapArea() { iArray.ResetAndDestroy(); + iIsClosing.Close(); delete iGrid; delete iFSClient; delete iPopup; delete iHighlightTimer; delete iRedrawTimer; delete iUpdateGridTimer; + delete iOrientationSignalTimer; } // ----------------------------------------------------------------------------- @@ -139,7 +135,7 @@ SetRect( aRect ); - // setup ganes grid + // setup grid ReCreateGridL(); // create stylus popup instance @@ -162,6 +158,9 @@ iUpdateGridTimer = new (ELeave) CTsFastSwapTimer( *this ); iUpdateGridTimer->ConstructL(); + iOrientationSignalTimer = new (ELeave) CTsFastSwapTimer( *this ); + iOrientationSignalTimer->ConstructL(); + ActivateL(); } @@ -185,10 +184,49 @@ iGrid = new( ELeave ) CTsFastSwapGrid; iGrid->ConstructL( this ); + iGrid->DisableSingleClick(ETrue);//enables highlight on pointer iDeviceState.AddObserverL(*iGrid, MTsDeviceStateObserver::ESkin); AknListBoxLayouts::SetupStandardGrid( *iGrid ); + // Setup layout + LayoutGridL(); + + if( wasHighlight ) + { + iGrid->ShowHighlight(); + } + else + { + iGrid->HideHighlight(); + } + + // Setup empty text + HBufC* text = StringLoader::LoadLC( R_TS_FSW_NO_APPS ); + iGrid->SetEmptyGridTextL( *text ); + CleanupStack::PopAndDestroy( text ); + + // Setup grid observers + if ( obs ) + { + iGrid->SetObserver( obs ); + } + iGrid->SetListBoxObserver(this); + iGrid->SetFastSwapGridObserver(this); + iGrid->SetContainerWindowL(*this); + + // 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::LayoutGridL +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::LayoutGridL() + { RArray rects; CleanupClosePushL(rects); rects.ReserveL(KLayoutItemCount); @@ -199,38 +237,32 @@ TAknLayoutRect gridNextItem = rects[3]; CleanupStack::PopAndDestroy(&rects); - TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; iGrid->SetRect(gridAppPane.Rect()); - iGrid->SetVisibleViewRect(gridAppPane.Rect()); + + TInt variety; + TBool disable = GetVariety(variety); + if ( disable ) + { + TRAP_IGNORE(static_cast(iEikonEnv->AppUi())->RequestPopUpL()); + } TAknLayoutScalableParameterLimits gridParams = AknLayoutScalable_Apps::cell_tport_appsw_pane_ParamLimits( variety ); TPoint empty( ELayoutEmpty, ELayoutEmpty ); + // Setup bitmap layout AknListBoxLayouts::SetupFormGfxCell( *iGrid, iGrid->ItemDrawer(), 0, AknLayoutScalable_Apps::cell_tport_appsw_pane_g1( variety ).LayoutLine(), empty, empty ); // Setup text layout - TAknLayoutText textLayout; - textLayout.LayoutText( - Rect(), - AknLayoutScalable_Apps::cell_tport_appsw_pane_t1( variety ).LayoutLine() ); + AknListBoxLayouts::SetupFormTextCell(*iGrid, iGrid->ItemDrawer(), 1, + AknLayoutScalable_Apps::cell_tport_appsw_pane_t1( variety ).LayoutLine(), + empty, empty); - // 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*/, - NULL /*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*/); // Text colors TRgb textColor; AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), textColor, - KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ); + KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG19 ); TRgb highlightTextColor; AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), highlightTextColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG11 ); @@ -240,15 +272,7 @@ colors.iHighlightedText = highlightTextColor; colors.iHighlightedBack = iGrid->ItemDrawer()->HighlightedBackColor(); iGrid->ItemDrawer()->FormattedCellData()->SetSubCellColorsL(1, colors); - - // Setup grid observers - if ( obs ) - { - iGrid->SetObserver( obs ); - } - iGrid->SetListBoxObserver(this); - iGrid->SetFastSwapGridObserver(this); - iGrid->SetContainerWindowL(*this); + iGrid->SetStrokeColors(textColor, highlightTextColor); if ( AknLayoutUtils::LayoutMirrored() ) { @@ -270,22 +294,16 @@ } iGridItemWidth = gridItem.Rect().Width(); - iGrid->ItemDrawer()->ColumnData()->SetDrawBackground(EFalse); + // Update item drawer + iGrid->UpdateItemDrawerLayoutDataL(); // Update state HandleDeviceStateChanged( EDeviceType ); - if( wasHighlight ) - { - iGrid->ShowHighlight(); - } - else + + if ( disable ) { - iGrid->HideHighlight(); + TRAP_IGNORE(static_cast(iEikonEnv->AppUi())->DisablePopUpL()); } - - // 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(); } @@ -300,7 +318,12 @@ TAknLayoutRect gridImage; TAknLayoutRect gridNextItem; - TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; + TInt variety; + TBool disable = GetVariety(variety); + if ( disable ) + { + TRAP_IGNORE(static_cast(iEikonEnv->AppUi())->RequestPopUpL()); + } gridAppPane.LayoutRect( Rect(), AknLayoutScalable_Apps::tport_appsw_pane( variety ) ); @@ -316,6 +339,11 @@ gridNextItem.LayoutRect( gridAppPane.Rect(), AknLayoutScalable_Apps::cell_tport_appsw_pane_cp03( variety ) ); aRects.Append(gridNextItem); + + if ( disable ) + { + TRAP_IGNORE(static_cast(iEikonEnv->AppUi())->DisablePopUpL()); + } } @@ -337,23 +365,31 @@ TSLOG_CONTEXT( CTsFastSwapArea::SizeChanged, TSLOG_LOCAL ); TSLOG_IN(); - if ( iGrid ) + if ( iGrid && !iIgnoreLayoutSwitch ) { // Grid needs to be recreated to proper reinitilize // data with new layout values TInt selIdx = SelectedIndex(); TRAPD(err, - ReCreateGridL(); - iEvtHandler.ReInitPhysicsL(GridWorldSize(), ViewSize(), ETrue);); + /*ReCreateGridL()*/ + LayoutGridL() ); if ( err != KErrNone ) { - TSLOG1( TSLOG_INFO, "ReCreateGridL leaves with %d", err ); + TSLOG1( TSLOG_INFO, "LayoutGridL leaves with %d", err ); } HandleFswContentChanged(); iGrid->SetCurrentDataIndex(selIdx); UpdateGrid(ETrue, EFalse); DrawDeferred(); + + // Order full redraw after switch + if(iRedrawTimer) + { + iRedrawTimer->Cancel(); + iRedrawTimer->After(KRedrawTimeForLayoutSwitch); + } } + TSLOG_OUT(); } @@ -382,14 +418,23 @@ if ( aIndex >= 0 && aIndex < iArray.Count() ) { TInt wgId = iArray[aIndex]->WgId(); + TUid appUid = iArray[aIndex]->AppUid(); // 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. + // Therefore ts must be moved to background. Ignore orientation updates, it + // will be done after task switcher is sent to background + iIgnoreLayoutSwitch = ETrue; CTsAppUi* appui = static_cast( iEikonEnv->AppUi() ); - appui->MoveAppToBackground( AknTransEffect::EApplicationStartRect ); + appui->MoveAppToBackground( CTsAppUi::EActivationTransition, appUid, wgId ); + iIgnoreLayoutSwitch = EFalse; + + // Orientation update + iPrevScreenOrientation = -1; // force orientation reinit + iOrientationSignalTimer->Cancel(); + iOrientationSignalTimer->After(KOrientationSwitchTime); } } @@ -405,8 +450,18 @@ if ( aIndex >= 0 && aIndex < iArray.Count() && CanClose( aIndex ) ) { + TInt selIdx = SelectedIndex(); + if ( selIdx > aIndex && selIdx > 0 ) + { + selIdx--; + } TInt wgId = iArray[aIndex]->WgId(); iFSClient->CloseApp( wgId ); + iIsClosing.Append(wgId); + if ( iArray[aIndex]->Widget() ) + { + iWidgetClosingCount++; + } // 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 @@ -417,18 +472,33 @@ delete iArray[aIndex]; iArray.Remove( aIndex ); NotifyChange(); - if ( !aSuppressRendering ) + + // Hide highlight + if ( iGrid->GridBehaviour() == CTsFastSwapGrid::ETouchOnly ) { - RenderContentL(); + iGrid->HideHighlight(); } - // Update item selection on the screen if last item was deleted - TInt newItemCount = GridItemCount(); + // Update selection + TInt newItemCount = GridItemCount() - 1; if ( aIndex == newItemCount ) { newItemCount--; iGrid->SetCurrentDataIndex(newItemCount); } - iTimeOfLastClose.HomeTime(); + else + { + iGrid->SetCurrentDataIndex(selIdx); + } + // Render contect + if ( !aSuppressRendering ) + { + RenderContentL( ETrue ); + } + + // Orientation update + iPrevScreenOrientation = GetCurrentScreenOrientation(); + iOrientationSignalTimer->Cancel(); + iOrientationSignalTimer->After(KOrientationSwitchTime); } TSLOG_OUT(); @@ -455,7 +525,7 @@ { RenderContentL(); RestoreSelectedIndex(); - iGrid->DrawNow(); + UpdateGrid( ETrue, EFalse ); } } @@ -518,21 +588,8 @@ 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 ) @@ -542,6 +599,20 @@ TSLOG4( TSLOG_INFO, "[%d]: %d %d %S", i, e->WgId(), e->AppUid(), &name ); } #endif + + // Update closing widget count if necessary + if ( iWidgetClosingCount ) + { + TInt widgetCount(0); + for ( TInt i = 0, ie = iArray.Count(); i != ie; ++i ) + { + if ( iArray[i]->Widget() ) + { + widgetCount++; + } + } + iWidgetClosingCount = widgetCount; + } // draw RenderContentL(); @@ -556,36 +627,47 @@ // CTsFastSwapArea::RenderContentL // -------------------------------------------------------------------------- // -void CTsFastSwapArea::RenderContentL() +void CTsFastSwapArea::RenderContentL( TBool aSuppressAnimation ) { TSLOG_CONTEXT( RenderContentL, TSLOG_LOCAL ); TSLOG_IN(); _LIT(KSeparator, "\t"); - CArrayPtr* iconArray = new ( ELeave ) CAknIconArray( iArray.Count() ); + CArrayPtr* iconArray = new ( ELeave ) CAknIconArray( KMaxGranularity ); CleanupStack::PushL( iconArray ); - CDesCArrayFlat* textArray = new ( ELeave ) CDesCArrayFlat( iArray.Count() ); + CDesCArrayFlat* textArray = new ( ELeave ) CDesCArrayFlat( KMaxGranularity ); CleanupStack::PushL( textArray ); RArray closeItemArray; CleanupClosePushL(closeItemArray); + RArray strokeItemArray; + CleanupClosePushL(strokeItemArray); - 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() ) + if ( iArray.Count() ) { - iGrid->SetLayoutL( EFalse, EFalse, ETrue, iArray.Count(), 1, gridItem.Rect().Size(), iGridItemGap ); + iGrid->ItemDrawer()->ColumnData()->SetDrawBackground(EFalse); + static_cast(&iParent)->EnableDragEvents(ETrue); + 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 ); + } } else { - iGrid->SetLayoutL( EFalse, ETrue, ETrue, iArray.Count(), 1, gridItem.Rect().Size(), iGridItemGap ); + iGrid->ItemDrawer()->ColumnData()->SetDrawBackground(ETrue); + static_cast(&iParent)->EnableDragEvents(EFalse); } - + for ( TInt i = 0, ie = iArray.Count(); i != ie; ++i ) { const TDesC& appName( iArray[i]->AppName() ); @@ -608,10 +690,16 @@ CFbsBitmap* mask = 0; if ( !h ) { + // No screenshot, take app icon h = iArray[i]->AppIconBitmapHandle(); maskh = iArray[i]->AppIconMaskHandle(); TSLOG1( TSLOG_INFO, "using appicon, handle = %d", h ); } + else + { + // Screenshot exists, mark it for stroke + strokeItemArray.AppendL(i); + } __ASSERT_DEBUG( h, User::Invariant() ); bitmap = CopyBitmapL( h, sz ); CleanupStack::PushL( bitmap ); @@ -643,27 +731,24 @@ } iGrid->ItemDrawer()->FormattedCellData()->SetIconArrayL(iconArray); iGrid->SetCloseItemsL(closeItemArray); + iGrid->SetStrokeItemsL(strokeItemArray); // Cleanup + CleanupStack::PopAndDestroy(&strokeItemArray); CleanupStack::PopAndDestroy(&closeItemArray); CleanupStack::Pop(textArray); CleanupStack::Pop(iconArray); - iGrid->ScrollBarFrame()->SetScrollBarVisibilityL( + if( iGrid->ScrollBarFrame() ) + { + 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 ); + UpdateGrid( ETrue, !aSuppressAnimation ); + iGrid->HandleItemAdditionL(); TSLOG_OUT(); } @@ -685,7 +770,6 @@ // 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 ); @@ -726,6 +810,11 @@ { // stop listening for changes in fsw content iFSClient->CancelSubscribe(); + // Hide highlight + if ( iGrid->GridBehaviour() == CTsFastSwapGrid::ETouchOnly ) + { + iGrid->HideHighlight(); + } } // ----------------------------------------------------------------------------- @@ -737,11 +826,21 @@ TSLOG_CONTEXT( CTsFastSwapArea::HandleSwitchToForegroundEvent, TSLOG_LOCAL ); TSLOG_IN(); - // get the current task list - HandleFswContentChanged(); - // and then start listening for changes - iFSClient->Subscribe( *this ); + iIsClosing.Reset(); + iWidgetClosingCount = 0; + + CTsGridItemDrawer* itemDrawer = + static_cast( iGrid->ItemDrawer() ); + itemDrawer->SetRedrawBackground(ETrue); + // Update Layout + CTsAppUi* appUi = static_cast(iEikonEnv->AppUi()); + if ( appUi && appUi->EffectsEnabled() ) + { + TRAP_IGNORE( LayoutGridL() ); + } + + // Reset grid if ( iDeviceState.DeviceType() == CTsDeviceState::EFullTouch ) { iGrid->HideHighlight(); @@ -751,12 +850,19 @@ iGrid->ShowHighlight(); } + // get the current task list + HandleFswContentChanged(); + // and then start listening for changes + iFSClient->Subscribe( *this ); + RestoreSelectedIndex(); - UpdateGrid(ETrue, EFalse); + UpdateGrid(EFalse, EFalse); iRedrawTimer->Cancel(); iRedrawTimer->After(KRedrawTime); + itemDrawer->SetRedrawBackground(EFalse); + // give feedback LaunchPopupFeedback(); @@ -784,7 +890,6 @@ // store the currently selected index if there is one SaveSelectedIndex(); } - iGrid->DrawDeferred(); } // ----------------------------------------------------------------------------- @@ -796,7 +901,6 @@ TEventCode aType ) { iKeyEvent = ETrue; - iGrid->SetTactileFeedbackSupport(EFalse); // handle the 'clear' key if ( aType == EEventKey && aKeyEvent.iCode == EKeyBackspace ) { @@ -865,7 +969,7 @@ { if (aType == EEventKey) { - ShowHighlight(); + iGrid->ShowHighlight(); iConsumeEvent = ETrue; } retVal = EKeyWasConsumed; @@ -893,10 +997,12 @@ void CTsFastSwapArea::HandlePointerEventL( const TPointerEvent& aPointerEvent ) { iKeyEvent = EFalse; - iGrid->SetTactileFeedbackSupport(ETrue); if(aPointerEvent.iType == TPointerEvent::EButton1Down) { iTapEvent = aPointerEvent; + iGrid->EnableAknEventHandling(EFalse); + iGrid->HandlePointerEventL(aPointerEvent); + iGrid->EnableAknEventHandling(ETrue); } } @@ -927,7 +1033,7 @@ iSavedSelectedIndex = KErrNotFound; if ( GridItemCount() ) { - // highlight second recent item (that has index 2) if possible + // highlight second recent item (that has index 1) if possible TInt highlightItem = 0; TInt count = GridItemCount(); while( highlightItem < count @@ -937,8 +1043,6 @@ } iSavedSelectedIndex = highlightItem - 1;//count from 0 iGrid->SetCurrentDataIndex( iSavedSelectedIndex ); - TBool forceRedraw(ETrue); - UpdateGrid(forceRedraw); } } @@ -949,6 +1053,7 @@ // void CTsFastSwapArea::ProcessCommandL( TInt aCommandId ) { + static_cast(iEikonEnv->AppUi())->DisablePopUpL(); switch ( aCommandId ) { case EFswCmdClose: @@ -1017,12 +1122,23 @@ } else if(aSource == iRedrawTimer) { - DrawNow(); + static_cast(&iParent)->OrderFullWindowRedraw(); } else if( aSource == iUpdateGridTimer ) { UpdateGrid(ETrue, ETrue); } + else if ( aSource == iOrientationSignalTimer ) + { + TInt currentOrientation = GetCurrentScreenOrientation(); + if ( currentOrientation != iPrevScreenOrientation ) + { + // Order layout change + static_cast(iCoeEnv->AppUi())->HandleResourceChangeL(KEikDynamicLayoutVariantSwitch); + iRedrawTimer->Cancel(); + iRedrawTimer->After(KRedrawTime); + } + } } @@ -1063,6 +1179,7 @@ if(showPopUp) { + static_cast(iEikonEnv->AppUi())->RequestPopUpL(); // give feedback LaunchPopupFeedback(); // save index for later use & show popup @@ -1106,26 +1223,6 @@ } // ----------------------------------------------------------------------------- -// 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 // ----------------------------------------------------------------------------- // @@ -1164,6 +1261,7 @@ { case EEventEnterKeyPressed: case EEventItemClicked: + case EEventItemSingleClicked: { SwitchToApp(SelectedIndex()); } @@ -1187,20 +1285,16 @@ 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; + const TReal + resizedAspectRatio(aTargetAreaSize.iWidth/(TReal)aTargetAreaSize.iHeight); + const TReal + orginalAspectRatio(aSourceSize.iWidth/(TReal)aSourceSize.iHeight); + //this condition avoid empty margins ( bigger output ). to realy fit area change it + const TReal scaleFactor = + ( orginalAspectRatio > resizedAspectRatio ) ? + (aTargetAreaSize.iHeight /(TReal)aSourceSize.iHeight) ://scale by height + (aTargetAreaSize.iWidth /(TReal)aSourceSize.iWidth) ;//scale by width + return TSize(aSourceSize.iWidth * scaleFactor, aSourceSize.iHeight * scaleFactor); } // -------------------------------------------------------------------------- @@ -1210,7 +1304,6 @@ void CTsFastSwapArea::SelectNextItem() { iKeyEvent = ETrue; - iGrid->SetTactileFeedbackSupport(EFalse); TBool forceRedraw(ETrue); TBool animate(ETrue); TInt selectedItem = SelectedIndex(); @@ -1225,15 +1318,6 @@ UpdateGrid(forceRedraw, animate); } -// -------------------------------------------------------------------------- -// CTsFastSwapArea::ShowHiglight -// -------------------------------------------------------------------------- -// -void CTsFastSwapArea::ShowHighlight() - { - iGrid->ShowHighlight(); - UpdateGrid(ETrue, EFalse); - } // -------------------------------------------------------------------------- // CTsFastSwapArea::CenterItem @@ -1251,12 +1335,21 @@ if(visibleItem != SelectedIndex()) { iGrid->SetCurrentDataIndex( visibleItem ); - DrawNow(); + DrawDeferred(); } } - iUpdateGridTimer->Cancel(); - iUpdateGridTimer->After(aRedrawDelay); + // Check if view is outside of grid world + TPoint absViewPos = ViewPos(); + absViewPos.iX -= Rect().Width() / 2; + if( !iEvtHandler.IsPhysicsRunning() && + ( absViewPos.iX < 0 ||( absViewPos.iX + Rect().Width() > GridWorldSize().iWidth && GridItemCount() ) ) + ) + { + // View is outside of grid world - update view + iUpdateGridTimer->Cancel(); + iUpdateGridTimer->After(aRedrawDelay); + } } // -------------------------------------------------------------------------- @@ -1283,11 +1376,12 @@ } else { - MoveOffset(targetPoint); + MoveOffset(targetPoint, ETrue); iEvtHandler.StopAnimation(); } if ( aForceRedraw ) { + iParent.DrawDeferred(); iGrid->DrawNow(); } } @@ -1299,20 +1393,27 @@ // void CTsFastSwapArea::HandleAppKey(TInt aType) { - if( aType == KAppKeyTypeShort ) + if ( iArray.Count() ) { - if(iGrid->IsHighlightVisible()) + if( aType == KAppKeyTypeShort ) { - SelectNextItem(); + if(iGrid->IsHighlightVisible()) + { + SelectNextItem(); + } + else + { + iGrid->ShowHighlight(); + } } - else + else if( aType == KAppKeyTypeLong ) { - ShowHighlight(); + SwitchToApp( SelectedIndex() ); } } - else if( aType == KAppKeyTypeLong ) + else { - SwitchToApp( SelectedIndex() ); + TRAP_IGNORE( iEikonEnv->EikAppUi()->HandleCommandL(EAknSoftkeyExit) ); } } @@ -1320,26 +1421,42 @@ // CTsFastSwapArea::MoveOffset // -------------------------------------------------------------------------- // -void CTsFastSwapArea::MoveOffset(const TPoint& aPoint) +void CTsFastSwapArea::MoveOffset(const TPoint& aPoint, TBool aDrawNow) { 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(); + + //postpone center item request in case of being moved + if(iUpdateGridTimer->IsActive()) + { + iUpdateGridTimer->Cancel(); + iUpdateGridTimer->After(KUpdateGridTime); + } - 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) + if ( aDrawNow ) { - // Center view - gridViewRect.iTl.iX += ( Rect().Width() - GridItemCount() * iGridItemWidth ) / 2; + 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() && GridItemCount() <= iMaxItemsOnScreen) + { + // Center view + gridViewRect.iTl.iX += ( Rect().Width() - GridItemCount() * iGridItemWidth ) / 2; + } + DrawDeferred(); + iGrid->SetRect( gridViewRect ); + iLogicalViewPosOffset = 0; } - iGrid->SetRect( gridViewRect ); - DrawNow(); + else + { + // Update logical view position + iLogicalViewPosOffset = aPoint.iX - ViewPos().iX; + } } // -------------------------------------------------------------------------- @@ -1348,7 +1465,7 @@ // void CTsFastSwapArea::TapL(const TPoint& aPoint) { - if(iGrid->Rect().Contains(aPoint)) + if(Rect().Contains(aPoint) && iArray.Count()) { //provide tap pointer event to grid iGrid->HandlePointerEventL(iTapEvent); @@ -1369,7 +1486,7 @@ void CTsFastSwapArea::LongTapL(const TPoint& aPoint) { TInt index(KErrNotFound); - if( iGrid->GridView()->XYPosToItemIndex(aPoint,index) ) + if( iGrid->GridView()->XYPosToItemIndex(aPoint,index) && iArray.Count() ) { iGrid->SetCurrentItemIndex(index); SaveSelectedIndex(); @@ -1390,16 +1507,18 @@ } // -------------------------------------------------------------------------- -// CTsFastSwapArea::Drag +// CTsFastSwapArea::DragL // -------------------------------------------------------------------------- // -void CTsFastSwapArea::Drag( - const MAknTouchGestureFwDragEvent& /*aEvent*/) +void CTsFastSwapArea::DragL( + const MAknTouchGestureFwDragEvent& aEvent) { - iGrid->SetTactileFeedbackSupport(ETrue); + if( aEvent.State() == EAknTouchGestureFwStop) + { + CenterItem( KUpdateGridTime ); + } + iGrid->HideHighlight(); - CenterItem( KUpdateGridTime ); - DrawNow(); } // ----------------------------------------------------------------------------- @@ -1431,11 +1550,12 @@ 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) + if(gridItemCount && gridItemCount <= iMaxItemsOnScreen) { // View centered retVal.iX += ( Rect().Width() - gridItemCount * iGridItemWidth ) / 2; } + retVal.iX += iLogicalViewPosOffset; return retVal; } @@ -1446,7 +1566,12 @@ TPoint CTsFastSwapArea::ItemViewPosition( TInt aItemIdx ) { TPoint retVal = Rect().iTl; - if ( aItemIdx == 0 ) + if ( aItemIdx < 0 ) + { + // No items + retVal.iX = 0; + } + else if ( aItemIdx == 0 ) { // First item if( AknLayoutUtils::LayoutMirrored() ) @@ -1596,4 +1721,85 @@ } } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::UpdateComponentVisibility +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::UpdateComponentVisibility() + { + // Switch off scrollbars + CEikScrollBarFrame* scrollBar = iGrid->ScrollBarFrame(); + if(scrollBar) + { + TRAP_IGNORE( scrollBar->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, + CEikScrollBarFrame::EOff)); + } + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::GetCurrentScreenOrientation +// ----------------------------------------------------------------------------- +// +TInt CTsFastSwapArea::GetCurrentScreenOrientation() + { + TPixelsAndRotation availableRect; + iEikonEnv->ScreenDevice()->GetDefaultScreenSizeAndRotation(availableRect); + return availableRect.iPixelSize.iWidth > availableRect.iPixelSize.iHeight; + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::GetVariety +// ----------------------------------------------------------------------------- +// +TBool CTsFastSwapArea::GetVariety( TInt& aVariety ) + { + aVariety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; + TInt screenOrientation = GetCurrentScreenOrientation(); + if ( aVariety != screenOrientation ) + { + aVariety = screenOrientation; + return ETrue; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::IsAppClosing +// ----------------------------------------------------------------------------- +// +TBool CTsFastSwapArea::IsAppClosing( TInt aWgId ) + { + TBool retVal(EFalse); + if ( iIsClosing.Count() ) + { + TInt idx = iIsClosing.Find(aWgId); + retVal = idx != KErrNotFound; + if ( retVal ) + { + iIsClosing.Remove(idx); + } + else if ( iWidgetClosingCount ) + { + retVal = ETrue; + iWidgetClosingCount--; + } + } + else + { + // Check current item list + for ( TInt i = 0; i < iArray.Count(); i++ ) + { + TInt wgId = iArray[i]->WgId(); + if ( wgId == aWgId ) + { + retVal = ETrue; + } + } + } + return retVal; + } + // End of file diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswapgrid.cpp --- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswapgrid.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswapgrid.cpp Wed May 12 13:22:51 2010 +0300 @@ -23,6 +23,7 @@ #include #include "tsfastswapgrid.h" +#include "tsapplogging.h" /* ================================================================================ * CTsFastSwapGrid @@ -31,6 +32,8 @@ const TInt KCloseIconRedrawTime = 300000; // 0.3 second +const TInt KStrokeThickness = 1; + // ----------------------------------------------------------------------------- // CTsFastSwapGrid::CTsFastSwapGrid // ----------------------------------------------------------------------------- @@ -39,7 +42,8 @@ : CAknGrid(), iCloseIconHitIdx( KErrNotFound ), iBehaviour( ETouchOnly ), - iHighlightVisible( EFalse ) + iHighlightVisible( EFalse ), + iAknEventHandlingEnabled(ETrue) { } @@ -51,10 +55,7 @@ CTsFastSwapGrid::~CTsFastSwapGrid() { iCloseItems.Close(); - delete iBgContext; delete iCloseIconRedrawTimer; - iFullyVisibleItems.Close(); - iPartialVisibleItems.Close(); } // ----------------------------------------------------------------------------- @@ -63,19 +64,17 @@ // void CTsFastSwapGrid::ConstructL( const CCoeControl* aParent ) { + TSLOG_CONTEXT( CTsFastSwapGrid::ConstructL, TSLOG_LOCAL ); + TSLOG_IN(); + 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 ); iCloseIconRedrawTimer = new (ELeave) CTsFastSwapTimer( *this ); iCloseIconRedrawTimer->ConstructL(); + + TSLOG_OUT(); } // ----------------------------------------------------------------------------- @@ -84,6 +83,9 @@ // void CTsFastSwapGrid::HandlePointerEventL( const TPointerEvent &aPointerEvent ) { + TSLOG_CONTEXT( CTsFastSwapGrid::HandlePointerEventL, TSLOG_LOCAL ); + TSLOG_IN(); + TBool eventHandled( EFalse ); if ( aPointerEvent.iType == TPointerEvent::EButton1Up || aPointerEvent.iType == TPointerEvent::EButton1Down ) @@ -99,7 +101,7 @@ break; } } - if ( hitItem != KErrNotFound ) + if ( hitItem != KErrNotFound && CanCloseItem( hitItem ) ) { // Item found, check if close icon has been hit TPoint itemPos = GridView()->ItemPos( hitItem ); @@ -111,27 +113,27 @@ if ( closeIconRect.Contains( aPointerEvent.iParentPosition ) ) { // Close icon hit + TInt hitDataIdx(hitItem); + if ( AknLayoutUtils::LayoutMirrored() ) + { + // Calculate logical item index + hitDataIdx = Model()->ItemTextArray()->MdcaCount() - 1 - hitItem; + } + iCloseIconHitIdx = hitDataIdx; + eventHandled = ETrue; + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) { - // pointer down - finish processing but do not forward to grid - eventHandled = ETrue; + // Update current item and redraw grid + SetCurrentItemIndex( hitItem ); + DrawNow(); + + iCloseIconRedrawTimer->Cancel(); + iCloseIconRedrawTimer->After(KCloseIconRedrawTime); } 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(); @@ -139,8 +141,6 @@ ETouchFeedbackBasicButton, ETouchFeedbackVibra, aPointerEvent); - iCloseIconRedrawTimer->Cancel(); - iCloseIconRedrawTimer->After(KCloseIconRedrawTime); } if ( GridBehaviour() == EHybrid ) { @@ -150,6 +150,8 @@ { Redraw(); } + iFastSwapGridObserver->HandleCloseEventL( hitDataIdx ); + ResetCloseHit(); } } } @@ -167,9 +169,14 @@ { itemDrawer->SetRedrawBackground( EFalse ); } - CAknGrid::HandlePointerEventL( aPointerEvent ); + if ( iAknEventHandlingEnabled ) + { + CAknGrid::HandlePointerEventL( aPointerEvent ); + } Redraw(); } + + TSLOG_OUT(); } @@ -179,23 +186,15 @@ // void CTsFastSwapGrid::HandleDeviceStateChanged( TChangeType aChangeType ) { + TSLOG_CONTEXT( CTsFastSwapGrid::HandleDeviceStateChanged, TSLOG_LOCAL ); + TSLOG_IN(); + if ( aChangeType == ESkin ) { - LoadCloseIcon(); + LoadCloseIconAndStrokeParams(); } - } - -// ----------------------------------------------------------------------------- -// CTsFastSwapGrid::MopSupplyObject -// ----------------------------------------------------------------------------- -// -TTypeUid::Ptr CTsFastSwapGrid::MopSupplyObject( TTypeUid aId ) - { - if ( aId.iUid == MAknsControlContext::ETypeId ) - { - return MAknsControlContext::SupplyMopObject( aId, iBgContext ); - } - return CCoeControl::MopSupplyObject( aId ); + + TSLOG_OUT(); } @@ -205,10 +204,16 @@ // void CTsFastSwapGrid::HandleResourceChange( TInt aType ) { - if ( aType != KEikDynamicLayoutVariantSwitch ) + TSLOG_CONTEXT( CTsFastSwapGrid::HandleResourceChange, TSLOG_LOCAL ); + TSLOG_IN(); + + if ( aType != KEikDynamicLayoutVariantSwitch && + Model()->ItemTextArray()->MdcaCount() ) { CAknGrid::HandleResourceChange( aType ); } + + TSLOG_OUT(); } @@ -222,6 +227,20 @@ // ----------------------------------------------------------------------------- +// CTsFastSwapGrid::Draw +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::Draw( const TRect& aRect ) const + { + CAknGrid::Draw(aRect); + if ( !Model()->ItemTextArray()->MdcaCount() ) + { + GridView()->DrawEmptyList(); + } + } + + +// ----------------------------------------------------------------------------- // CTsFastSwapGrid::SetFastSwapGridObserver // ----------------------------------------------------------------------------- // @@ -237,25 +256,54 @@ // 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; + TSLOG_CONTEXT( CTsFastSwapGrid::CreateItemDrawerL, TSLOG_LOCAL ); + TSLOG_IN(); CFormattedCellGridData* data = CFormattedCellGridData::NewL(); CleanupStack::PushL( data ); CTsGridItemDrawer* itemDrawer = new ( ELeave ) CTsGridItemDrawer( this, data ); - CleanupStack::PushL( itemDrawer ); + iItemDrawer = itemDrawer; + CleanupStack::Pop( data ); + + TSLOG_OUT(); + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::UpdateItemDrawerLayoutDataL +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::UpdateItemDrawerLayoutDataL() + { + CTsGridItemDrawer* itemDrawer = + static_cast( ItemDrawer() ); + + TPixelsAndRotation screenSize; + iEikonEnv->ScreenDevice()->GetDefaultScreenSizeAndRotation(screenSize); + TRect availableRect = TRect( TPoint(0,0), screenSize.iPixelSize ); + itemDrawer->SetScreenRect(availableRect); + + TAknLayoutRect fastSwapAreaPane; + TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; + fastSwapAreaPane.LayoutRect( availableRect, + AknLayoutScalable_Apps::tport_appsw_pane( variety ) ); + const TInt leftOffset = iParent->Rect().iTl.iX; + const TInt rightOffset = availableRect.Width() - iParent->Rect().iBr.iX; + SetVisibleViewRect(fastSwapAreaPane.Rect()); itemDrawer->SetEdgeOffset( leftOffset, rightOffset ); - iItemDrawer = itemDrawer; - CleanupStack::Pop( itemDrawer ); - CleanupStack::Pop( data ); - LoadCloseIcon(); + + LoadCloseIconAndStrokeParams(); + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::EnableAknEventHandling +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::EnableAknEventHandling( TBool aEnable ) + { + iAknEventHandlingEnabled = aEnable; } // ----------------------------------------------------------------------------- @@ -266,7 +314,6 @@ { if ( aSource == iCloseIconRedrawTimer ) { - iFastSwapGridObserver->HandleCloseEventL( iCloseIconHitIdx ); ResetCloseHit(); } } @@ -316,6 +363,27 @@ // ----------------------------------------------------------------------------- +// CTsFastSwapGrid::SetStrokeColor +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::SetStrokeColors( TRgb aColor, + TRgb aHighlightedColor ) + { + static_cast(iItemDrawer)->SetStrokeColors(aColor, aHighlightedColor); + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::SetStrokeItemsL +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::SetStrokeItemsL( RArray& aItemIndex ) + { + static_cast(iItemDrawer)->SetStrokeItemsL(aItemIndex); + } + + +// ----------------------------------------------------------------------------- // CTsFastSwapGrid::SetBehaviour // ----------------------------------------------------------------------------- // @@ -418,31 +486,38 @@ // ----------------------------------------------------------------------------- -// CTsFastSwapGrid::LoadCloseIconL +// CTsFastSwapGrid::LoadCloseIconAndStrokeParams // ----------------------------------------------------------------------------- // -void CTsFastSwapGrid::LoadCloseIcon() +void CTsFastSwapGrid::LoadCloseIconAndStrokeParams() { // Load and set close icon CFbsBitmap* icon = NULL; - CFbsBitmap* mask = NULL; - - TRAP_IGNORE(AknsUtils::CreateColorIconLC( AknsUtils::SkinInstance(), - KAknsIIDQgnIndiItutListCollapse, - KAknsIIDQsnTextColors, // we use text color here, eventhough this is an icon - EAknsCIQsnTextColorsCG13, // softkey text color + CFbsBitmap* iconMask = NULL; + CFbsBitmap* iconPressed = NULL; + CFbsBitmap* iconPressedMask = NULL; + + TRAP_IGNORE(AknsUtils::CreateIconL( AknsUtils::SkinInstance(), + KAknsIIDQgnIndiTsButtonClose, icon, - mask, + iconMask, KAvkonBitmapFile, EMbmAvkonQgn_indi_button_preview_close, - EMbmAvkonQgn_indi_button_preview_close_mask, - KRgbWhite - ); - CleanupStack::Pop( 2 ); // codescanner::cleanup - ); + EMbmAvkonQgn_indi_button_preview_close_mask + )); + + TRAP_IGNORE(AknsUtils::CreateIconL( AknsUtils::SkinInstance(), + KAknsIIDQgnIndiTsButtonClosePressed, + iconPressed, + iconPressedMask, + KAvkonBitmapFile, + EMbmAvkonQgn_indi_button_preview_close, + EMbmAvkonQgn_indi_button_preview_close_mask + )); TAknLayoutRect gridAppPane; TAknLayoutRect gridItem; + TAknLayoutRect gridImage; TAknLayoutRect gridCloseButton; TAknLayoutRect gridCloseIcon; TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; @@ -451,15 +526,21 @@ AknLayoutScalable_Apps::tport_appsw_pane( variety ) ); gridItem.LayoutRect( gridAppPane.Rect(), AknLayoutScalable_Apps::cell_tport_appsw_pane( variety, 0, 0 ) ); + gridImage.LayoutRect( gridItem.Rect(), + AknLayoutScalable_Apps::cell_tport_appsw_pane_g1( variety ) ); 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 )); + + // Set icon size AknIconUtils::SetSize( icon, gridCloseIcon.Rect().Size(), EAspectRatioPreserved ); - AknIconUtils::SetSize( mask, gridCloseIcon.Rect().Size(), EAspectRatioPreserved ); + AknIconUtils::SetSize( iconPressed, gridCloseIcon.Rect().Size(), EAspectRatioPreserved ); CTsGridItemDrawer* itemDrawer = static_cast(iItemDrawer); - itemDrawer->SetCloseIcon( icon, mask ); + + // Setup close parameters + itemDrawer->SetCloseIcon( icon, iconMask, iconPressed, iconPressedMask ); TRect relGridCloseButton = TRect( TPoint( gridCloseButton.Rect().iTl.iX - gridItem.Rect().iTl.iX, gridCloseButton.Rect().iTl.iY - gridItem.Rect().iTl.iY), gridCloseButton.Rect().Size() ); @@ -467,6 +548,15 @@ gridCloseIcon.Rect().iTl.iY - gridItem.Rect().iTl.iY), gridCloseIcon.Rect().Size() ); itemDrawer->SetCloseIconRect( relGridCloseButton, relGridCloseIconRect ); + + // Setup stroke parameters + TPoint strokeOffset; + strokeOffset.iX = gridImage.Rect().iTl.iX - gridItem.Rect().iTl.iX - KStrokeThickness; + strokeOffset.iY = gridImage.Rect().iTl.iY - gridItem.Rect().iTl.iY - KStrokeThickness; + TSize strokeSize = gridImage.Rect().Size(); + strokeSize.iHeight += KStrokeThickness * 2; + strokeSize.iWidth += KStrokeThickness * 2; + itemDrawer->SetStrokeOffset( strokeOffset, strokeSize ); } @@ -489,99 +579,8 @@ } } -// ----------------------------------------------------------------------------- -// 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 @@ -598,9 +597,10 @@ : CFormattedCellListBoxItemDrawer( aGrid->Model(), NULL, aData ), - iGrid( aGrid ) + iGrid( aGrid ), + iStrokeColor( KRgbBlack ), + iHighlightStrokeColor( KRgbBlack ) { - AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, iScreenRect); } @@ -612,6 +612,9 @@ { delete iCloseIcon; delete iCloseIconMask; + delete iCloseIconPressed; + delete iCloseIconPressedMask; + iStrokeItems.Close(); } @@ -619,12 +622,17 @@ // CTsGridItemDrawer::SetCloseIcon // ----------------------------------------------------------------------------- // -void CTsGridItemDrawer::SetCloseIcon( CFbsBitmap* aBmp, CFbsBitmap* aMask ) +void CTsGridItemDrawer::SetCloseIcon( CFbsBitmap* aBmp, CFbsBitmap* aBmpMask, + CFbsBitmap* aBmpPressed, CFbsBitmap* aBmpPressedMask ) { delete iCloseIcon; iCloseIcon = aBmp; delete iCloseIconMask; - iCloseIconMask = aMask; + iCloseIconMask = aBmpMask; + delete iCloseIconPressed; + iCloseIconPressed = aBmpPressed; + delete iCloseIconPressedMask; + iCloseIconPressedMask = aBmpPressedMask; } @@ -665,7 +673,7 @@ // ----------------------------------------------------------------------------- -// CTsTeleportGridItemDrawer::SetRedrawBackground +// CTsGridItemDrawer::SetRedrawBackground // ----------------------------------------------------------------------------- // void CTsGridItemDrawer::SetRedrawBackground( TBool aEnable ) @@ -675,6 +683,52 @@ // ----------------------------------------------------------------------------- +// CTsGridItemDrawer::SetStrokeColor +// ----------------------------------------------------------------------------- +// +void CTsGridItemDrawer::SetStrokeColors( TRgb aColor, + TRgb aHighlightedColor ) + { + iStrokeColor = aColor; + iHighlightStrokeColor = aHighlightedColor; + } + + +// ----------------------------------------------------------------------------- +// CTsGridItemDrawer::SetStrokeItemsL +// ----------------------------------------------------------------------------- +// +void CTsGridItemDrawer::SetStrokeItemsL( RArray& aItemIndex ) + { + iStrokeItems.Close(); + for ( TInt i = 0; i < aItemIndex.Count(); i++ ) + { + iStrokeItems.AppendL( aItemIndex[i] ); + } + } + + +// ----------------------------------------------------------------------------- +// CTsGridItemDrawer::SetStrokeOffset +// ----------------------------------------------------------------------------- +// +void CTsGridItemDrawer::SetStrokeOffset( TPoint aStrokeOffset, TSize aStrokeSize ) + { + iStrokeRect = TRect( aStrokeOffset, aStrokeSize ); + } + + +// ----------------------------------------------------------------------------- +// CTsGridItemDrawer::SetScreenRect +// ----------------------------------------------------------------------------- +// +void CTsGridItemDrawer::SetScreenRect( TRect aRect ) + { + iScreenRect = aRect; + } + + +// ----------------------------------------------------------------------------- // CTsGridItemDrawer::DrawActualItem // ----------------------------------------------------------------------------- // @@ -682,8 +736,6 @@ 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 @@ -697,15 +749,6 @@ 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; @@ -730,7 +773,25 @@ CFormattedCellListBoxItemDrawer::DrawActualItem(aItemIndex, aActualItemRect, itemIsCurrent, aViewIsEmphasized, aViewIsDimmed, aItemIsSelected ); - if ( iGrid->CanCloseItem( aItemIndex ) && iCloseIcon && iCloseIconMask ) + // Draw stroke + if ( iStrokeItems.Find( aItemIndex ) != KErrNotFound ) + { + TRect strokeRect = iStrokeRect; + strokeRect.Move( aActualItemRect.iTl ); + if ( itemIsCurrent ) + { + iGc->SetPenColor( iHighlightStrokeColor ); + } + else + { + iGc->SetPenColor( iStrokeColor ); + } + // Thumbnail stroke + iGc->DrawRect( strokeRect ); + } + + // Draw close button + if ( iGrid->CanCloseItem( aItemIndex ) && iCloseIcon && iCloseIconPressed ) { TRect closeIconRect = GetCloseButtonRect( aActualItemRect ); // Draw frame @@ -739,27 +800,24 @@ MAknsSkinInstance* skin = AknsUtils::SkinInstance(); if ( iGrid->IsItemCloseHit( aItemIndex ) ) { - AknsDrawUtils::DrawFrame(skin, *iGc, outerRect, innerRect, - KAknsIIDQgnFrSctrlButtonPressed, KAknsIIDQgnFrSctrlButtonCenterPressed); + TRect sourceRect( TPoint(0,0), iCloseIconPressed->SizeInPixels() ); + iGc->DrawBitmapMasked( innerRect, + iCloseIconPressed, + sourceRect, + iCloseIconPressedMask, + ETrue ); } else { - AknsDrawUtils::DrawFrame(skin, *iGc, outerRect, innerRect, - KAknsIIDQgnFrSctrlButton, KAknsIIDQgnFrSctrlButtonCenter); + TRect sourceRect( TPoint(0,0), iCloseIcon->SizeInPixels() ); + iGc->DrawBitmapMasked( innerRect, + iCloseIcon, + sourceRect, + iCloseIconMask, + ETrue ); } - // 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(); - } } // ----------------------------------------------------------------------------- @@ -770,11 +828,7 @@ { 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 ) - ) + if ( viewRect.Intersects( aItemRect ) ) { retVal = ETrue; } diff -r e01a28ecba3f -r 45cc9ca502a9 taskswitcher/taskswitcherui/taskswitcherapp/src/tsphysicsengine.cpp --- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsphysicsengine.cpp Mon Mar 22 15:12:36 2010 +0200 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsphysicsengine.cpp Wed May 12 13:22:51 2010 +0300 @@ -97,15 +97,25 @@ { iPhysics->StopPhysics(); iStartTime.HomeTime(); + iStartPosition = aEvent.CurrentPosition(); + iDragDirection = 0; } else if (AknTouchGestureFw::EAknTouchGestureFwOn == aEvent.State()) { + TInt direction = + aEvent.CurrentPosition().iX > aEvent.PreviousPosition().iX ? -1 : 1; TPoint deltaPoint(aEvent.PreviousPosition() - aEvent.CurrentPosition()); iPhysics->RegisterPanningPosition(deltaPoint); + if (iDragDirection && iDragDirection != direction) + { + iStartTime.HomeTime(); + iStartPosition = aEvent.PreviousPosition(); + } + iDragDirection = direction; } else //AknTouchGestureFw::EAknTouchGestureFwStop { - TPoint drag(aEvent.PreviousPosition() - aEvent.CurrentPosition()); + TPoint drag(iStartPosition - aEvent.CurrentPosition()); iPhysics->StartPhysics(drag, iStartTime); } }