# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1261032049 -7200 # Node ID f72a12da539e18cb77a927dd69b9cd88420bdf82 Revision: 200949 Kit: 200951 diff -r 000000000000 -r f72a12da539e group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build info file for Ado domain uishellservices +* +*/ + + +// uishellservices ado +#include "../homescreen_plat/group/bld.inf" +#include "../idlehomescreen/group/bld.inf" +#include "../menufw/group/bld.inf" +#include "../widgetmanager/group/bld.inf" + +PRJ_PLATFORMS + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + + + +// End of File diff -r 000000000000 -r f72a12da539e homescreen_plat/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 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: Includes all the Domain API specific bld.inf files, which +* export files. +* +*/ + + +#include "../menu_settings_api/group/bld.inf" +#include "../hs_content_control_ui/group/bld.inf" +#include "../hs_renderingplugin_api/group/bld.inf" \ No newline at end of file diff -r 000000000000 -r f72a12da539e homescreen_plat/hs_content_control_ui/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/hs_content_control_ui/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project hs_content_control_api +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/hscontentcontrolui.h APP_LAYER_PLATFORM_EXPORT_PATH(hscontentcontrolui.h) diff -r 000000000000 -r f72a12da539e homescreen_plat/hs_content_control_ui/inc/hscontentcontrolui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/hs_content_control_ui/inc/hscontentcontrolui.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,196 @@ +/* + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef HSCONTENTCONTROLUI_H +#define HSCONTENTCONTROLUI_H + +// System includes +#include +#include + +// Forward declarations +class MHsContentController; + +/** + * Content control UI interface + * + * + * @code + * + * @endcode + * + * @lib hscontentcontrol.lib + * @since S60 v5.0 + */ +class MHsContentControlUi + { +public: + /** + * + */ + virtual void Activate() = 0; + + /** + * + */ + virtual void NotifyWidgetListChanged() = 0; + + /** + * + */ + virtual void NotifyViewListChanged() = 0; + + /** + * + */ + virtual void NotifyAppListChanged() = 0; + + /** + * + */ + virtual void SetContentController( MHsContentController* aController ) = 0; + }; + +/** + * Content control UI base class + * + * + * @code + * + * @endcode + * + * @lib hscontentcontrol.lib + * @since S60 v5.0 + */ +class CHsContentControlUi : public CBase, public MHsContentControlUi + { +public: + /** + * Two-phased constructor. + * @param aImplUid Requested implementation UID + */ + IMPORT_C static CHsContentControlUi* NewL( + TUid aImplUid ); + + /** + * Destructor. + */ + inline ~CHsContentControlUi(); + +public: // From MHsContentControlUi + /** + * + */ + inline void Activate(); + + /** + * + */ + inline void NotifyWidgetListChanged(); + + /** + * + */ + inline void NotifyViewListChanged(); + + /** + * + */ + inline void NotifyAppListChanged(); + + /** + * + */ + void SetContentController( + MHsContentController* aController ); + + +public: // New functions + + /** + * + */ + TUid ImplUid() const; + + /** + * + */ + void SetContentControlTypeL( + const TDesC8& aContentControlType ); + + /** + * + */ + const TDesC8& ContentControlType() const; + +protected: // Data + + /** + * + */ + MHsContentController* iHsContentController; + +private: // Data + + /** + * + */ + TUid iDestructKey; + + /** + * + */ + TUid iImplUid; + + /** + * + */ + HBufC8* iContentControlType; + + }; + +inline CHsContentControlUi::~CHsContentControlUi() + { + delete iContentControlType; + REComSession::DestroyedImplementation( iDestructKey ); + } + +inline void CHsContentControlUi::Activate() + { + // Default implementation of MHsContentControlUi method + } +inline void CHsContentControlUi::NotifyWidgetListChanged() + { + // Default implementation of MHsContentControlUi method + } +inline void CHsContentControlUi::NotifyViewListChanged() + { + // Default implementation of MHsContentControlUi method + } +inline void CHsContentControlUi::NotifyAppListChanged() + { + // Default implementation of MHsContentControlUi method + } + +inline void CHsContentControlUi::SetContentController( + MHsContentController* aController ) + { + iHsContentController = aController; + } + +#endif // HSCONTENTCONTROLUI_H +// End of file diff -r 000000000000 -r f72a12da539e homescreen_plat/hs_renderingplugin_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/hs_renderingplugin_api/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,24 @@ +/* +* 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: External rendering plugin API bld file +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/xnextrenderingpluginadapter.h APP_LAYER_PLATFORM_EXPORT_PATH(xnextrenderingpluginadapter.h) diff -r 000000000000 -r f72a12da539e homescreen_plat/hs_renderingplugin_api/inc/xnextrenderingpluginadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/hs_renderingplugin_api/inc/xnextrenderingpluginadapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,111 @@ +/* +* 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: External rendering plugin adapter header +* +*/ + +#ifndef XNEXTRENDERINGPLUGINADAPTER_H +#define XNEXTRENDERINGPLUGINADAPTER_H + +// System includes +#include +#include +#include + +// User includes + +/** + * CXnExtRenderingPluginAdapter class + * + * + * @code + * + * @endcode + * + * @lib extrenderingplugin.lib + * @since S60 v5.0 + */ +class CXnExtRenderingPluginAdapter : public CCoeControl + { +public: // Constructor and destructor + /** + * Two-phased constructor. + */ + IMPORT_C static CXnExtRenderingPluginAdapter* NewL( TUid aImplUid ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CXnExtRenderingPluginAdapter(); + +private: // Constructors + /** + * Constructor + */ + // CXnExtRenderingPluginAdapter(); + + /** + * Second phase constructor + */ + // void ConstructL(); + +public: // New functions, + + /** + * Returns the implementation uid. + */ + IMPORT_C TUid ImplUid() const; + + /** + * Enters power save mode. + */ + IMPORT_C virtual void EnterPowerSaveModeL(); + + /** + * Exits power save mode. + */ + IMPORT_C virtual void ExitPowerSaveModeL(); + + /** + * Informs skin change. + */ + IMPORT_C virtual void SkinChanged(); + + /** + * Informs focuschange. + */ + IMPORT_C virtual void FocusChanged( TDrawNow aDrawNow ); + + /** + * Informs size change. + */ + IMPORT_C virtual void SizeChanged(); + +private: // Data + + /** + * Destruct key + */ + TUid iDestructKey; + + /** + * Implementation UID + */ + TUid iImplUid; + }; + + +#endif // XNEXTRENDERINGPLUGINADAPTER_H + +// End of file diff -r 000000000000 -r f72a12da539e homescreen_plat/menu_settings_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/menu_settings_api/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project menu_settings_api +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/mmenuinternalPSkeys.h APP_LAYER_PLATFORM_EXPORT_PATH(mmenuinternalPSkeys.h) + diff -r 000000000000 -r f72a12da539e homescreen_plat/menu_settings_api/inc/mmenuinternalPSkeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/menu_settings_api/inc/mmenuinternalPSkeys.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2007-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: Menu PS Keys +* Version : +* +*/ + +#ifndef MMENUINTERNALPSKEYS_H +#define MMENUINTERNALPSKEYS_H + +// Matrix Menu P&S category +const TUid KMMenuPSCat = {0x101F4CD2}; +// Key that stores last used - current view (it is text value) +const TUint KMMenuLastViewKey = 0x01; +// name of folder view +_LIT(KMMenuFolderView, "foldersuite"); + +#endif // MMENUINTERNALPSKEYS_H diff -r 000000000000 -r f72a12da539e homescreen_plat/menu_settings_api/menu_settings_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/menu_settings_api/menu_settings_api.metaxml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,13 @@ + + + Menu Settings API + Provides infromation about Menu current state. + c++ + menufw + + + + no + no + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/2001952b.txt Binary file idlehomescreen/data/2001952b.txt has changed diff -r 000000000000 -r f72a12da539e idlehomescreen/data/clean_themes.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/clean_themes.bat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,21 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem +rmdir \epoc32\RELEASE\winscw\udeb\Z\private\200159c0 /s /q +rmdir \epoc32\data\Z\resource\homescreen /s /q +rmdir \epoc32\data\Z\private\200159c0 /s /q +rmdir \epoc32\winscw\c\private\10202be9\persists /s /q +rmdir \epoc32\winscw\c\private\200159c0 /s /q +rmdir \epoc32\winscw\c\private\102750f0 /s /q \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build info file for activeidle3 themes +* +*/ + + +#include "../vga_tch/group/bld.inf" // Buzzidle +#include "../qhd_tch/group/bld.inf" // Flashidle + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +gnumakefile validate.mk + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/data/group/hsps_definition.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/group/hsps_definition.xsd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/group/hsps_manifest.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/group/hsps_manifest.xsd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/group/validate.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/group/validate.cmd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,50 @@ +@ECHO OFF +SETLOCAL + +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: Validates ActiveIdle3 plugin configurations +rem + +SET PATH_LINT=C:\Apps\libxml2-2.6.23.win32\bin\xmllint.exe +SET PATH_MANIFEST_XSD=hsps_manifest.xsd +SET PATH_DEFINITION_XSD=hsps_definition.xsd + +IF NOT EXIST %PATH_MANIFEST_XSD% GOTO ERR_XSD +IF NOT EXIST %PATH_DEFINITION_XSD% GOTO ERR_XSD + +SET ARGS_MANIFEST=--schema %PATH_MANIFEST_XSD% --noout +SET ARGS_DEFINITION=--schema %PATH_DEFINITION_XSD% --noout + +echo. +echo Validating plugin configurations against the HSPS schema files... +echo. + +FOR /F %%j in ('dir ..\manifest.dat /s/b^|find "\hsps\00\" ') do %PATH_LINT% %%j %ARGS_MANIFEST% 2>&1|find "error" + +FOR /F %%j in ('dir ..\*.xml /s/b^|find "\hsps\00\" ') do %PATH_LINT% %%j %ARGS_DEFINITION% 2>&1|find "error" + +GOTO END + +:ERR_LINT +ECHO XMLLint was not found! Personlize the PATH_LINT variable in %0 and download the tool. +GOTO END + +:ERR_XSD +ECHO Schema files were not found (%PATH_MANIFEST_XSD% and %PATH_DEFINITION_XSD%)! +GOTO END + +:END + +ENDLOCAL \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/group/validate.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/group/validate.mk Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +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: Validates HSPS plugin configurations +# + + +FINAL : + echo VALIDATE + validate + echo VALIDATATION DONE +MAKMAKE FREEZE LIB CLEANLIB RESOURCE RELEASABLES CLEAN BLD SAVESPACE : do_nothing \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/gfx/icon.mif Binary file idlehomescreen/data/qhd_tch/desktop_20026f4f/gfx/icon.mif has changed diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,79 @@ +/* +* 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: 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/desktop_20026f4f/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/desktop_20026f4f/hsps/widgetconfiguration.xml +../hsps/00/desktopconfiguration.dtd /epoc32/data/Z/resource/homescreen/desktop_20026f4f/hsps/desktopconfiguration.dtd + +../xuikon/00/desktop.dat /epoc32/data/Z/resource/homescreen/desktop_20026f4f/xuikon/desktop_20026f4f.dat +../xuikon/00/desktop.css /epoc32/data/Z/resource/homescreen/desktop_20026f4f/xuikon/desktop.css +../xuikon/00/desktop.xml /epoc32/data/Z/resource/homescreen/desktop_20026f4f/xuikon/desktop.xml + +// logo icon +../gfx/icon.mif /epoc32/data/Z/resource/homescreen/desktop_20026f4f/hsps/icon.mif + +// Arabic languages +//***************** +../xuikon/37/desktop.css /epoc32/data/Z/resource/homescreen/desktop_20026f4f/xuikon/37/desktop.css +../xuikon/50/desktop.css /epoc32/data/Z/resource/homescreen/desktop_20026f4f/xuikon/50/desktop.css +../xuikon/57/desktop.css /epoc32/data/Z/resource/homescreen/desktop_20026f4f/xuikon/57/desktop.css +../xuikon/94/desktop.css /epoc32/data/Z/resource/homescreen/desktop_20026f4f/xuikon/94/desktop.css + +// Support for S60 localization +//***************************** +#ifndef __DESKTOPCONFIGURATION_LOC__ +#define __DESKTOPCONFIGURATION_LOC__ +../loc/desktopconfiguration.loc APP_LAYER_LOC_EXPORT_PATH(desktopconfiguration.loc) +#endif // __DESKTOPCONFIGURATION_LOC__ + + +// Support for S60 builds +//*********************** +../rom/desktop_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(desktop_20026f4f_resources.iby) +../rom/desktop_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(desktop_20026f4f_customer.iby) +../rom/desktop_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(desktop_20026f4f_variant.iby) +../rom/desktop.iby CORE_APP_LAYER_IBY_EXPORT_PATH(desktop_20026f4f.iby) + + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME desktop_20026f4f +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/desktopconfiguration.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/desktopconfiguration.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,32 @@ + + + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,40 @@ + + + + qhd_tch + + widget + + + 0x2001f48a + + + 0x101fb657 + + + 0x20026f4f + + + &qtn_desktop_configuration_name; + sc + 1.0 + + + widgetconfiguration.xml + + + desktopconfiguration.dtd + + 2 + + RnD description desktop plugin + mif(icon.mif 16384 16385) + + + + + + desktop.o0000 + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/loc/desktopconfiguration.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/loc/desktopconfiguration.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,22 @@ +/* +* 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 Desktop plugin configuration (HSPS) +* +*/ + +// d: Shortcuts +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_desktop_configuration_name "Shortcut" diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/rom/desktop.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/rom/desktop.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Shortcut widget HSPS-plugin IBY file. +* +*/ + +#ifndef __DESKTOP_IBY__ +#define __DESKTOP_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\desktop_20026f4f\hsps\00\manifest.dat \private\200159c0\install\desktop_20026f4f\hsps\00\manifest.dat + +#endif // defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +#endif // __DESKTOP_IBY__ \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/rom/desktop_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/rom/desktop_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Shortcut widget HSPS-plugin IBY file. +* +*/ +#ifndef __DESKTOP_20026F4F_CUSTOMER_IBY__ +#define __DESKTOP_20026F4F_CUSTOMER_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\desktop_20026f4f\xuikon\00\desktop.o0000 \private\200159c0\install\desktop_20026f4f\xuikon\00\desktop.o0000 +data=ZPRIVATE\200159c0\install\desktop_20026f4f\hsps\00\desktopconfiguration.dtd \private\200159c0\install\desktop_20026f4f\hsps\00\desktopconfiguration.dtd + +#endif // defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +#endif // __DESKTOP_20026F4F_CUSTOMER_IBY__ + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/rom/desktop_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/rom/desktop_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Shortcut widget HSPS-plugin IBY file. +* +*/ + +#ifndef __DESKTOP_20026F4F_RESOURCES_IBY__ +#define __DESKTOP_20026F4F_RESOURCES_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + + +// Enabled by DTD-localization tools, language specific +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\desktop_20026f4f\xuikon\37\desktop_20026f4f.o0037 \private\200159c0\install\desktop_20026f4f\xuikon\37\desktop_20026f4f.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\desktop_20026f4f\xuikon\50\desktop_20026f4f.o0050 \private\200159c0\install\desktop_20026f4f\xuikon\50\desktop_20026f4f.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\desktop_20026f4f\xuikon\57\desktop_20026f4f.o0057 \private\200159c0\install\desktop_20026f4f\xuikon\57\desktop_20026f4f.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\desktop_20026f4f\xuikon\94\desktop_20026f4f.o0094 \private\200159c0\install\desktop_20026f4f\xuikon\94\desktop_20026f4f.o0094 +#endif + +data=ZPRIVATE\200159c0\install\desktop_20026f4f\hsps\00\icon.mif \private\200159c0\install\desktop_20026f4f\hsps\00\icon.mif +data=ZPRIVATE\200159c0\install\desktop_20026f4f\hsps\00\desktopconfiguration.dtd \private\200159c0\install\desktop_20026f4f\hsps\00\desktopconfiguration.dtd + +#endif // defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +#endif // __DESKTOP_20026F4F_RESOURCES_IBY__ + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/rom/desktop_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/rom/desktop_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Shortcut widget HSPS-plugin IBY file. +* +*/ + +#ifndef __DESKTOP_20026F4F_VARIANT_IBY__ +#define __DESKTOP_20026F4F_VARIANT_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\desktop_20026f4f\hsps\00\widgetconfiguration.xml \private\200159c0\install\desktop_20026f4f\hsps\00\widgetconfiguration.xml + +#endif // defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +#endif // __DESKTOP_20026F4F_VARIANT_IBY__ + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/xuikon/00/desktop.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/xuikon/00/desktop.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,124 @@ +widget#desktop_widget +{ + block-progression: rl; + direction: ltr; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 3px; + background-color: none; +} + +button.button +{ + width: 74px; + margin-right: 3px; + nav-index: appearance; +} + +button#button1 +{ + margin-left: 0px; +} + +button#button6 +{ + margin-right: 0px; +} + +image.icon +{ + _s60-aspect-ratio: preserve; +} + +/* For presence */ +image.second_icon +{ + margin-top:0%; + width: 25%; + height: 25%; + position: absolute; + bottom: 0%; + left: 70%; + top: 3%; + _s60-aspect-ratio:preserve; +} + +tooltip.tooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + + +text.tooltiptext +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; + overflow: visible; +} + +/********************* + extension +**********************/ +tooltip.tooltipext +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.textcaptionext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.textext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/xuikon/00/desktop.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/xuikon/00/desktop.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,11 @@ + + + 2001CB4F + 101FB657 + 200184C8 + DesktopWidget + Desktop + 1.0 + desktop.xml + desktop.css + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/xuikon/00/desktop.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/xuikon/00/desktop.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/xuikon/37/desktop.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/xuikon/37/desktop.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,130 @@ +widget#desktop_widget +{ + block-progression: rl; + direction: rtl; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 3px; + background-color: none; +} + +button.button +{ + width: 74px; + margin-right: 3px; + nav-index: appearance; +} + +button#button1 +{ + margin-left: 0px; +} + +button#button6 +{ + margin-right: 0px; +} + +image.icon +{ + _s60-aspect-ratio: preserve; +} + +/* For presence */ +image.second_icon +{ + margin-top:0%; + width: 25%; + height: 25%; + position: absolute; + bottom: 0%; + left: 70%; + top: 3%; + _s60-aspect-ratio:preserve; +} + +tooltip.tooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + + +text.tooltiptext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + height: 85%; + text-align: center; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + padding-right: 1u; + padding-left: 1u; + padding-bottom: 1u; +} + +/********************* + extension +**********************/ +tooltip.tooltipext +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.textcaptionext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.textext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/xuikon/50/desktop.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/xuikon/50/desktop.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,130 @@ +widget#desktop_widget +{ + block-progression: rl; + direction: rtl; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 3px; + background-color: none; +} + +button.button +{ + width: 74px; + margin-right: 3px; + nav-index: appearance; +} + +button#button1 +{ + margin-left: 0px; +} + +button#button6 +{ + margin-right: 0px; +} + +image.icon +{ + _s60-aspect-ratio: preserve; +} + +/* For presence */ +image.second_icon +{ + margin-top:0%; + width: 25%; + height: 25%; + position: absolute; + bottom: 0%; + left: 70%; + top: 3%; + _s60-aspect-ratio:preserve; +} + +tooltip.tooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + + +text.tooltiptext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + height: 85%; + text-align: center; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + padding-right: 1u; + padding-left: 1u; + padding-bottom: 1u; +} + +/********************* + extension +**********************/ +tooltip.tooltipext +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.textcaptionext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.textext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/xuikon/57/desktop.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/xuikon/57/desktop.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,130 @@ +widget#desktop_widget +{ + block-progression: rl; + direction: rtl; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 3px; + background-color: none; +} + +button.button +{ + width: 74px; + margin-right: 3px; + nav-index: appearance; +} + +button#button1 +{ + margin-left: 0px; +} + +button#button6 +{ + margin-right: 0px; +} + +image.icon +{ + _s60-aspect-ratio: preserve; +} + +/* For presence */ +image.second_icon +{ + margin-top:0%; + width: 25%; + height: 25%; + position: absolute; + bottom: 0%; + left: 70%; + top: 3%; + _s60-aspect-ratio:preserve; +} + +tooltip.tooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + + +text.tooltiptext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + height: 85%; + text-align: center; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + padding-right: 1u; + padding-left: 1u; + padding-bottom: 1u; +} + +/********************* + extension +**********************/ +tooltip.tooltipext +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.textcaptionext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.textext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/desktop_20026f4f/xuikon/94/desktop.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/xuikon/94/desktop.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,130 @@ +widget#desktop_widget +{ + block-progression: rl; + direction: rtl; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 3px; + background-color: none; +} + +button.button +{ + width: 74px; + margin-right: 3px; + nav-index: appearance; +} + +button#button1 +{ + margin-left: 0px; +} + +button#button6 +{ + margin-right: 0px; +} + +image.icon +{ + _s60-aspect-ratio: preserve; +} + +/* For presence */ +image.second_icon +{ + margin-top:0%; + width: 25%; + height: 25%; + position: absolute; + bottom: 0%; + left: 70%; + top: 3%; + _s60-aspect-ratio:preserve; +} + +tooltip.tooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + + +text.tooltiptext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + height: 85%; + text-align: center; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + padding-right: 1u; + padding-left: 1u; + padding-bottom: 1u; +} + +/********************* + extension +**********************/ +tooltip.tooltipext +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.textcaptionext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.textext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/empty_2001f47f/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/empty_2001f47f/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,55 @@ +/* +* 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/empty_2001f47f/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/empty_2001f47f/hsps/widgetconfiguration.xml +../xuikon/00/empty.dat /epoc32/data/Z/resource/homescreen/empty_2001f47f/xuikon/empty_2001f47f.dat +../xuikon/00/empty.css /epoc32/data/Z/resource/homescreen/empty_2001f47f/xuikon/empty.css +../xuikon/00/empty.xml /epoc32/data/Z/resource/homescreen/empty_2001f47f/xuikon/empty.xml + +// Support for S60 builds +//*********************** +../rom/empty_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(empty_2001f47f_variant.iby) +../rom/empty.iby CORE_APP_LAYER_IBY_EXPORT_PATH(empty_2001f47f.iby) + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME empty_2001f47f +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/empty_2001f47f/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/empty_2001f47f/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ + + + + + + + qhd_tch + + + + widget + + + + + + 0x2001f48a + + + + + + 0x101fb657 + + + + + + 0x2001f47f + + + + + + &qtn_empty_2001f47f_name; + + empty + + 1.0 + + + + + + widgetconfiguration.xml + + + + + empty.o0000 + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/empty_2001f47f/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/empty_2001f47f/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,5 @@ + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/empty_2001f47f/rom/empty.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/empty_2001f47f/rom/empty.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* 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: +* Empty widget HSPS-plugin IBY file +* +*/ + +#ifndef __EMPTY_2001F47F_IBY__ +#define __EMPTY_2001F47F_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\empty_2001f47f\xuikon\00\empty.o0000 \private\200159c0\install\empty_2001f47f\xuikon\00\empty.o0000 +data=ZPRIVATE\200159c0\install\empty_2001f47f\hsps\00\manifest.dat \private\200159c0\install\empty_2001f47f\hsps\00\manifest.dat + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __EMPTY_2001F47F_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/empty_2001f47f/rom/empty_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/empty_2001f47f/rom/empty_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* Empty widget HSPS-plugin variant specific IBY file. +* +*/ + +#ifndef __EMPTY_2001F47F_VARIANT_IBY__ +#define __EMPTY_2001F47F_VARIANT_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\empty_2001f47f\hsps\00\widgetconfiguration.xml \private\200159c0\install\empty_2001f47f\hsps\00\widgetconfiguration.xml + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __EMPTY_2001F47F_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/empty_2001f47f/xuikon/00/empty.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/empty_2001f47f/xuikon/00/empty.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,6 @@ +widget +{ + display: none; + visibility: hidden; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/empty_2001f47f/xuikon/00/empty.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/empty_2001f47f/xuikon/00/empty.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,11 @@ + + + E029CF57 + 101FB657 + 11001001 + empty + empty + 1.0 + empty.xml + empty.css + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/empty_2001f47f/xuikon/00/empty.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/empty_2001f47f/xuikon/00/empty.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,4 @@ + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ +/* +* 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: The information required for building +* +*/ + +//#include "../shortcut_2001f483/group/bld.inf" +//#include "../shortcut2_2001f484/group/bld.inf" +#include "../desktop_20026f4f/group/bld.inf" +#include "../empty_2001f47f/group/bld.inf" +#include "../onerow_2001f480/group/bld.inf" +#include "../tworows_2001f488/group/bld.inf" +#include "../threerows_2001f486/group/bld.inf" +#include "../threetextrows_2001f487/group/bld.inf" +#include "../wideimage_2001f489/group/bld.inf" +#include "../posterwideimage_2001fdbc/group/bld.inf" +#include "../profile_2001cb7c/group/bld.inf" +#include "../view_2001f48b/group/bld.inf" +#include "../templateview_20026f50/group/bld.inf" +#include "../root_2001f482/group/bld.inf" + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/onerow_2001f480/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,67 @@ +/* +* 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/onerow_2001f480/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/onerow_2001f480/hsps/widgetconfiguration.xml +../xuikon/00/onerow.dat /epoc32/data/Z/resource/homescreen/onerow_2001f480/xuikon/onerow_2001f480.dat +../xuikon/00/onerow.css /epoc32/data/Z/resource/homescreen/onerow_2001f480/xuikon/onerow.css +../xuikon/00/onerow.xml /epoc32/data/Z/resource/homescreen/onerow_2001f480/xuikon/onerow.xml + +// Arabic languages +//***************** +../xuikon/37/onerow.css /epoc32/data/Z/resource/homescreen/onerow_2001f480/xuikon/37/onerow.css +../xuikon/50/onerow.css /epoc32/data/Z/resource/homescreen/onerow_2001f480/xuikon/50/onerow.css +../xuikon/57/onerow.css /epoc32/data/Z/resource/homescreen/onerow_2001f480/xuikon/57/onerow.css +../xuikon/94/onerow.css /epoc32/data/Z/resource/homescreen/onerow_2001f480/xuikon/94/onerow.css + + +// Support for S60 builds +//*********************** +// export iby files +../rom/onerow_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(onerow_2001f480_resources.iby) +../rom/onerow_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(onerow_2001f480_customer.iby) +../rom/onerow_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(onerow_2001f480_variant.iby) +../rom/onerow.iby CORE_APP_LAYER_IBY_EXPORT_PATH(onerow_2001f480.iby) + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME onerow_2001f480 +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/onerow_2001f480/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,63 @@ + + + + + + + qhd_tch + + + + template + + + + + + 0x2001f48a + + + + + + 0x101fb657 + + + + + + 0x2001f480 + + + + + + onerow + + oner + + 1.0 + + + + + + widgetconfiguration.xml + + + + + + + + + + + + onerow.o0000 + + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/onerow_2001f480/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/onerow_2001f480/rom/onerow.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/rom/onerow.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* Onerow widget HSPS-plugin IBY file. +* +*/ + +#ifndef __ONEROW_2001F480_IBY__ +#define __ONEROW_2001F480_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\onerow_2001f480\hsps\00\manifest.dat \private\200159c0\install\onerow_2001f480\hsps\00\manifest.dat + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __ONEROW_2001F480_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/onerow_2001f480/rom/onerow_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/rom/onerow_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* Onerow widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __ONEROW_2001F480_CUSTOMER_IBY__ +#define __ONEROW_2001F480_CUSTOMER_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\onerow_2001f480\xuikon\00\onerow.o0000 \private\200159c0\install\onerow_2001f480\xuikon\00\onerow.o0000 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __ONEROW_2001F480_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/onerow_2001f480/rom/onerow_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/rom/onerow_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,40 @@ +/* +* 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: +* Onerow widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __ONEROW_2001F480_RESOURCES_IBY__ +#define __ONEROW_2001F480_RESOURCES_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\onerow_2001f480\xuikon\37\onerow.o0037 \private\200159c0\install\onerow_2001f480\xuikon\37\onerow.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\onerow_2001f480\xuikon\50\onerow.o0050 \private\200159c0\install\onerow_2001f480\xuikon\50\onerow.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\onerow_2001f480\xuikon\57\onerow.o0057 \private\200159c0\install\onerow_2001f480\xuikon\57\onerow.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\onerow_2001f480\xuikon\94\onerow.o0094 \private\200159c0\install\onerow_2001f480\xuikon\94\onerow.o0094 +#endif + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __ONEROW_2001F480_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/onerow_2001f480/rom/onerow_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/rom/onerow_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* Onerow widget HSPS-plugin variant specific IBY file. +* +*/ + +#ifndef __ONEROW_2001F480_VARIANT_IBY__ +#define __ONEROW_2001F480_VARIANT_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\onerow_2001f480\hsps\00\widgetconfiguration.xml \private\200159c0\install\onerow_2001f480\hsps\00\widgetconfiguration.xml + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __ONEROW_2001F480_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/00/onerow.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/00/onerow.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +widget#onerow_template +{ + block-progression:rl; +} + +image#image_container +{ + padding-top:8px; + padding-bottom:8px; + padding-left:8px; + padding-right:8px; + height: 90%; + width: 20%; + nav-index:appearance; + _s60-aspect-ratio:preserve; +} + +text +{ + padding-left:8px; + padding-right:8px; + font-line-space: 15; + text-align:left; + text-overflow-mode: wrap; + max-line-amount: 2; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + nav-index:appearance; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/00/onerow.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/00/onerow.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + 2001CB4F + 101FB657 + 110012F6 + onerow + onerow + 1.0 + onerow.xml + onerow.css + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/00/onerow.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/00/onerow.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/37/onerow.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/37/onerow.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +widget#onerow_template +{ + direction: rtl; + block-progression:rl; +} + +image#image_container +{ + padding-top:8px; + padding-bottom:8px; + padding-left:8px; + padding-right:8px; + height: 90%; + width: 20%; + nav-index:appearance; + _s60-aspect-ratio:preserve; +} + +text +{ + padding-left:8px; + padding-right:8px; + font-line-space: 15; + text-align: right; + text-overflow-mode: wrap; + max-line-amount: 2; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + nav-index:appearance; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/50/onerow.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/50/onerow.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +widget#onerow_template +{ + direction: rtl; + block-progression:rl; +} + +image#image_container +{ + padding-top:8px; + padding-bottom:8px; + padding-left:8px; + padding-right:8px; + height: 90%; + width: 20%; + nav-index:appearance; + _s60-aspect-ratio:preserve; +} + +text +{ + padding-left:8px; + padding-right:8px; + font-line-space: 15; + text-align: right; + text-overflow-mode: wrap; + max-line-amount: 2; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + nav-index:appearance; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/57/onerow.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/57/onerow.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +widget#onerow_template +{ + direction: rtl; + block-progression:rl; +} + +image#image_container +{ + padding-top:8px; + padding-bottom:8px; + padding-left:8px; + padding-right:8px; + height: 90%; + width: 20%; + nav-index:appearance; + _s60-aspect-ratio:preserve; +} + +text +{ + padding-left:8px; + padding-right:8px; + font-line-space: 15; + text-align: right; + text-overflow-mode: wrap; + max-line-amount: 2; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + nav-index:appearance; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/94/onerow.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/onerow_2001f480/xuikon/94/onerow.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +widget#onerow_template +{ + direction: rtl; + block-progression:rl; +} + +image#image_container +{ + padding-top:8px; + padding-bottom:8px; + padding-left:8px; + padding-right:8px; + height: 90%; + width: 20%; + nav-index:appearance; + _s60-aspect-ratio:preserve; +} + +text +{ + padding-left:8px; + padding-right:8px; + font-line-space: 15; + text-align: right; + text-overflow-mode: wrap; + max-line-amount: 2; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + nav-index:appearance; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,57 @@ +/* +* 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/posterwideimage_2001fdbc/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/posterwideimage_2001fdbc/hsps/widgetconfiguration.xml +../xuikon/00/posterwideimage.dat /epoc32/data/Z/resource/homescreen/posterwideimage_2001fdbc/xuikon/posterwideimage_2001fdbc.dat +../xuikon/00/posterwideimage.css /epoc32/data/Z/resource/homescreen/posterwideimage_2001fdbc/xuikon/posterwideimage.css +../xuikon/00/posterwideimage.xml /epoc32/data/Z/resource/homescreen/posterwideimage_2001fdbc/xuikon/posterwideimage.xml + + +// Support for S60 builds +//*********************** +../rom/posterwideimage_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(posterwideimage_2001fdbc_variant.iby) +../rom/posterwideimage.iby CORE_APP_LAYER_IBY_EXPORT_PATH(posterwideimage_2001fdbc.iby) + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME posterwideimage_2001fdbc +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,61 @@ + + + + + + + qhd_tch + + + + template + + + + + + 0x2001f48a + + + + + + 0x101fb657 + + + + + + 0x2001fdbc + + + + + + posterwideimage + + posterwide + + 1.0 + + + + + + widgetconfiguration.xml + + + + + + posterwideimage.o0000 + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/loc/wideimage.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/loc/wideimage.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for WideImage widget (Xuikon) +* +*/ + +// d: Loading content +// l: ai_gene_pane_1_t1/opt4 +// w: +// r: TB9.2 +#define qtn_ai_loading_content "Loading content..." \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/rom/posterwideimage.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/rom/posterwideimage.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* 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: +* PosterWideImage widget HSPS-plugin IBY file. +* +*/ + +#ifndef __POSTERWIDEIMAGE_2001FDBC_IBY__ +#define __POSTERWIDEIMAGE_2001FDBC_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\posterwideimage_2001fdbc\xuikon\00\posterwideimage.o0000 \private\200159c0\install\posterwideimage_2001fdbc\xuikon\00\posterwideimage.o0000 +data=ZPRIVATE\200159c0\install\posterwideimage_2001fdbc\hsps\00\manifest.dat \private\200159c0\install\posterwideimage_2001fdbc\hsps\00\manifest.dat + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __POSTERWIDEIMAGE_2001FDBC_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/rom/posterwideimage_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/rom/posterwideimage_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* PosterWideImage widget HSPS-plugin variant specific IBY file. +* +*/ + +#ifndef __POSTERWIDEIMAGE_2001FDBC_VARIANT_IBY__ +#define __POSTERWIDEIMAGE_2001FDBC_VARIANT_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\posterwideimage_2001fdbc\hsps\00\widgetconfiguration.xml \private\200159c0\install\posterwideimage_2001fdbc\hsps\00\widgetconfiguration.xml + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __POSTERWIDEIMAGE_2001FDBC_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/xuikon/00/posterwideimage.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/xuikon/00/posterwideimage.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,25 @@ +widget#posterwideimage_template +{ + padding-top: 4px; + padding-left: 10px; + padding-right: 10px; + padding-bottom: 5px; + nav-index:appearance; + background-color: none; +} + +image#wide_image +{ + display: none; +} + +text#wide_text +{ + padding-left: 5px; + text-align: center; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; +} + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/xuikon/00/posterwideimage.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/xuikon/00/posterwideimage.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + 2001CB4F + 101FB657 + 110012F5 + posterwideimage + posterwideimage + 1.0 + posterwideimage.xml + posterwideimage.css + wideimage.dtd + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/xuikon/00/posterwideimage.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/xuikon/00/posterwideimage.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Loading Content + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/xuikon/00/wideimage.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/posterwideimage_2001fdbc/xuikon/00/wideimage.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/gfx/icon.mif Binary file idlehomescreen/data/qhd_tch/profile_2001cb7c/gfx/icon.mif has changed diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,70 @@ +/* +* 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: +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// Support for productization and Carbide.Ui customization +//******************************************************** +../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 +../xuikon/00/profile.dat /epoc32/data/Z/resource/homescreen/profile_2001cb7c/xuikon/profile_2001cb7c.dat +../xuikon/00/profile.css /epoc32/data/Z/resource/homescreen/profile_2001cb7c/xuikon/profile.css +../xuikon/00/profile.xml /epoc32/data/Z/resource/homescreen/profile_2001cb7c/xuikon/profile.xml +../xuikon/00/profilewidget.dtd /epoc32/data/Z/resource/homescreen/profile_2001cb7c/xuikon/profilewidget.dtd + +// logo icon +../gfx/icon.mif /epoc32/data/Z/resource/homescreen/profile_2001cb7c/hsps/icon.mif + +// Arabic languages +//***************** +../xuikon/37/profile.css /epoc32/data/Z/resource/homescreen/profile_2001cb7c/xuikon/37/profile.css +../xuikon/50/profile.css /epoc32/data/Z/resource/homescreen/profile_2001cb7c/xuikon/50/profile.css +../xuikon/57/profile.css /epoc32/data/Z/resource/homescreen/profile_2001cb7c/xuikon/57/profile.css +../xuikon/94/profile.css /epoc32/data/Z/resource/homescreen/profile_2001cb7c/xuikon/94/profile.css + +// Support for S60 localization +//***************************** +// export localizable loc files (engineering versions) +../loc/profilewidget.loc APP_LAYER_LOC_EXPORT_PATH(profilewidget.loc) + +// Support for S60 builds +//*********************** +../rom/profilewidget_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(profile_2001cb7c_resources.iby) +../rom/profilewidget_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(profile_2001cb7c_customer.iby) +../rom/profilewidget_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(profile_2001cb7c_variant.iby) +../rom/profilewidget.iby CORE_APP_LAYER_IBY_EXPORT_PATH(profile_2001cb7c.iby) + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME profile_2001cb7c +OPTION DTD_TYPE widget +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,32 @@ + + + + + qhd_tch + widget + + + 0x2001f48a + + + 0x101fb657 + + + 0x2001cb7c + + + &qtn_hs_profile_edit; + profile + 1.0 + + + widgetconfiguration.xml + + RnD description profile plugin + skin(270501603 8433):mif(icon.mif 16384 16385) + + + profile.o0000 + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/loc/profilewidget.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/loc/profilewidget.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,24 @@ +/* +* 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: Edit active profile +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.1 +#define qtn_hs_profile_edit "Edit active profile" +#define qtn_hs_profile_desc "localized RnD profilewidget description." diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/rom/profilewidget.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/rom/profilewidget.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* profile widget HSPS-plugin IBY file. +* +*/ + +#ifndef __PROFILEWIDGET_2001CB7C_IBY__ +#define __PROFILEWIDGET_2001CB7C_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\profile_2001cb7c\hsps\00\manifest.dat \private\200159c0\install\profile_2001cb7c\hsps\00\manifest.dat + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __PROFILEWIDGET_2001CB7C_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/rom/profilewidget_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/rom/profilewidget_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* profile widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __PROFILEWIDGET_2001CB7C_CUSTOMER_IBY__ +#define __PROFILEWIDGET_2001CB7C_CUSTOMER_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// 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 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __PROFILEWIDGET_2001CB7C_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/rom/profilewidget_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/rom/profilewidget_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* profile widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __PROFILEWIDGET_2001CB7C_RESOURCES_IBY__ +#define __PROFILEWIDGET_2001CB7C_RESOURCES_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +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 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __PROFILEWIDGET_2001CB7C_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/rom/profilewidget_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/rom/profilewidget_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* profile widget HSPS-plugin variant specific IBY file. +* +*/ + +#ifndef __PROFILEWIDGET_2001CB7C_VARIANT_IBY__ +#define __PROFILEWIDGET_2001CB7C_VARIANT_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\profile_2001cb7c\hsps\00\widgetconfiguration.xml \private\200159c0\install\profile_2001cb7c\hsps\00\widgetconfiguration.xml + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __PROFILEWIDGET_2001CB7C_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,157 @@ +widget#profilewidget +{ + padding-top: 3px; + padding-left: 3px; + padding-right: 3px; + padding-bottom: 3px; + background-color: none; +} + +box#clock_profile_container +{ + direction: ltr; + block-progression: lr; +} + +clock +{ + width: 152px; + margin-right: 3px; + padding-top: 2px; + padding-bottom: 2px; + _s60-format: locale; + _s60-ampm-font-size: 16px; + _s60-digital-font-size: 56px; + color: "SKIN(268458534 13056 74)"; + background-color: "SKIN(268458534 9886)"; + nav-index: appearance; +} + +box.clock_profile +{ + background-color: "SKIN(268458534 9886)"; + + nav-index: appearance; +} + +box#date_profiles_container +{ + width: auto; + block-progression: tb; +} + +box#date_container +{ + width: auto; + height: 26px; + block-progression: lr; + margin-bottom: 3px; + padding-bottom: 2px; +} + +box#date_content +{ + width: adaptive; + height: adaptive; + margin-left: auto; + margin-right: auto; +} + +text#date_text +{ + text-align: center; + margin-left: 2px; + margin-right: 2px; + width: adaptive; + height: adaptive; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + _s60-text-valign: top; + color:"SKIN(268458534 13056 74)"; +} + +box#profile_softindicator +{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 2px; + padding-right: 2px; + direction: ltr; +} + +image#SatIdleModeIcon +{ + display: block; + width: 18px; + height: 20px; + position: static; + margin-top: auto; +} + +/* Default system profiles */ +text.systemprofileitem +{ + display: block; +} + +/* Placeholders for profiles added by user */ +text.userprofileitem +{ + display: none; +} + +/****************** + SOFT INDICATOR WIDGET AREA +*******************/ +newsticker.SIText +{ + text-align: center; + display: block; + visibility: visible; + width: auto; + margin-left: 2px; + margin-right: 2px; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + + white-space-collapse: collapse; + + _s60-scroll-behaviour: scroll-alternate; + + _s60-display-time: 2000; + _s60-scroll-loop: false; + _s60-start-delay: 0; + _s60-restart-after-update: true; +} + +box#NT_CUGMCN +{ + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +box#NT_SATVHZ +{ + display: none; + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +title#title_vhz +{ + display: none; +} + +title#title_sat +{ + display: none; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + 2001CB4F + 101FB657 + 110012F5 + profile + profile + 1.0 + profile.xml + profile.css + profilewidget.dtd + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <property class="DeviceStatus/MCNIndicator"/> + + + <property class="DeviceStatus/CUGIndicator"/> + + + <property class="Profile/ActiveProfileNameAndIconChar" /> + <!--<property class="Profile/ActiveProfileName" name="ordinal" value="1"/>--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <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 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profilewidget.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profilewidget.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/37/profile.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/37/profile.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,156 @@ +widget#profilewidget +{ + padding-top: 3px; + padding-left: 3px; + padding-right: 3px; + padding-bottom: 3px; + background-color: none; +} + +box#clock_profile_container +{ + direction: rtl; + block-progression: lr; +} + +clock +{ + width: 152px; + margin-left: 3px; + padding-top: 2px; + padding-bottom: 2px; + _s60-format: locale; + _s60-ampm-font-size: 16px; + _s60-digital-font-size: 56px; + color: "SKIN(268458534 13056 74)"; + background-color: "SKIN(268458534 9886)"; + nav-index: appearance; +} + +box.clock_profile +{ + background-color: "SKIN(268458534 9886)"; + nav-index: appearance; +} + +box#date_profiles_container +{ + width: auto; + block-progression: tb; +} + +box#date_container +{ + width: auto; + height: 26px; + block-progression: rl; + margin-bottom: 3px; + padding-bottom: 2px; +} + +box#date_content +{ + width: adaptive; + height: adaptive; + margin-left: auto; + margin-right: auto; +} + +text#date_text +{ + text-align: center; + margin-left: 2px; + margin-right: 2px; + width: adaptive; + height: adaptive; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + _s60-text-valign: top; + color:"SKIN(268458534 13056 74)"; +} + +box#profile_softindicator +{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 2px; + padding-right: 2px; + direction: rtl; +} + +image#SatIdleModeIcon +{ + display: block; + width: 18px; + height: 20px; + position: static; + margin-top: auto; +} + +/* Default system profiles */ +text.systemprofileitem +{ + display: block; +} + +/* Placeholders for profiles added by user */ +text.userprofileitem +{ + display: none; +} + +/****************** + SOFT INDICATOR WIDGET AREA +*******************/ +newsticker.SIText +{ + text-align: center; + display: block; + visibility: visible; + width: auto; + margin-left: 2px; + margin-right: 2px; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + + white-space-collapse: collapse; + + _s60-scroll-behaviour: scroll-alternate; + + _s60-display-time: 2000; + _s60-scroll-loop: false; + _s60-start-delay: 0; + _s60-restart-after-update: true; +} + +box#NT_CUGMCN +{ + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +box#NT_SATVHZ +{ + display: none; + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +title#title_vhz +{ + display: none; +} + +title#title_sat +{ + display: none; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/50/profile.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/50/profile.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,156 @@ +widget#profilewidget +{ + padding-top: 3px; + padding-left: 3px; + padding-right: 3px; + padding-bottom: 3px; + background-color: none; +} + +box#clock_profile_container +{ + direction: rtl; + block-progression: lr; +} + +clock +{ + width: 152px; + margin-left: 3px; + padding-top: 2px; + padding-bottom: 2px; + _s60-format: locale; + _s60-ampm-font-size: 16px; + _s60-digital-font-size: 56px; + color: "SKIN(268458534 13056 74)"; + background-color: "SKIN(268458534 9886)"; + nav-index: appearance; +} + +box.clock_profile +{ + background-color: "SKIN(268458534 9886)"; + nav-index: appearance; +} + +box#date_profiles_container +{ + width: auto; + block-progression: tb; +} + +box#date_container +{ + width: auto; + height: 26px; + block-progression: rl; + margin-bottom: 3px; + padding-bottom: 2px; +} + +box#date_content +{ + width: adaptive; + height: adaptive; + margin-left: auto; + margin-right: auto; +} + +text#date_text +{ + text-align: center; + margin-left: 2px; + margin-right: 2px; + width: adaptive; + height: adaptive; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + _s60-text-valign: top; + color:"SKIN(268458534 13056 74)"; +} + +box#profile_softindicator +{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 2px; + padding-right: 2px; + direction: rtl; +} + +image#SatIdleModeIcon +{ + display: block; + width: 18px; + height: 20px; + position: static; + margin-top: auto; +} + +/* Default system profiles */ +text.systemprofileitem +{ + display: block; +} + +/* Placeholders for profiles added by user */ +text.userprofileitem +{ + display: none; +} + +/****************** + SOFT INDICATOR WIDGET AREA +*******************/ +newsticker.SIText +{ + text-align: center; + display: block; + visibility: visible; + width: auto; + margin-left: 2px; + margin-right: 2px; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + + white-space-collapse: collapse; + + _s60-scroll-behaviour: scroll-alternate; + + _s60-display-time: 2000; + _s60-scroll-loop: false; + _s60-start-delay: 0; + _s60-restart-after-update: true; +} + +box#NT_CUGMCN +{ + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +box#NT_SATVHZ +{ + display: none; + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +title#title_vhz +{ + display: none; +} + +title#title_sat +{ + display: none; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/57/profile.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/57/profile.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,156 @@ +widget#profilewidget +{ + padding-top: 3px; + padding-left: 3px; + padding-right: 3px; + padding-bottom: 3px; + background-color: none; +} + +box#clock_profile_container +{ + direction: rtl; + block-progression: lr; +} + +clock +{ + width: 152px; + margin-left: 3px; + padding-top: 2px; + padding-bottom: 2px; + _s60-format: locale; + _s60-ampm-font-size: 16px; + _s60-digital-font-size: 56px; + color: "SKIN(268458534 13056 74)"; + background-color: "SKIN(268458534 9886)"; + nav-index: appearance; +} + +box.clock_profile +{ + background-color: "SKIN(268458534 9886)"; + nav-index: appearance; +} + +box#date_profiles_container +{ + width: auto; + block-progression: tb; +} + +box#date_container +{ + width: auto; + height: 26px; + block-progression: rl; + margin-bottom: 3px; + padding-bottom: 2px; +} + +box#date_content +{ + width: adaptive; + height: adaptive; + margin-left: auto; + margin-right: auto; +} + +text#date_text +{ + text-align: center; + margin-left: 2px; + margin-right: 2px; + width: adaptive; + height: adaptive; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + _s60-text-valign: top; + color:"SKIN(268458534 13056 74)"; +} + +box#profile_softindicator +{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 2px; + padding-right: 2px; + direction: rtl; +} + +image#SatIdleModeIcon +{ + display: block; + width: 18px; + height: 20px; + position: static; + margin-top: auto; +} + +/* Default system profiles */ +text.systemprofileitem +{ + display: block; +} + +/* Placeholders for profiles added by user */ +text.userprofileitem +{ + display: none; +} + +/****************** + SOFT INDICATOR WIDGET AREA +*******************/ +newsticker.SIText +{ + text-align: center; + display: block; + visibility: visible; + width: auto; + margin-left: 2px; + margin-right: 2px; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + + white-space-collapse: collapse; + + _s60-scroll-behaviour: scroll-alternate; + + _s60-display-time: 2000; + _s60-scroll-loop: false; + _s60-start-delay: 0; + _s60-restart-after-update: true; +} + +box#NT_CUGMCN +{ + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +box#NT_SATVHZ +{ + display: none; + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +title#title_vhz +{ + display: none; +} + +title#title_sat +{ + display: none; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/94/profile.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/94/profile.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,156 @@ +widget#profilewidget +{ + padding-top: 3px; + padding-left: 3px; + padding-right: 3px; + padding-bottom: 3px; + background-color: none; +} + +box#clock_profile_container +{ + direction: rtl; + block-progression: lr; +} + +clock +{ + width: 152px; + margin-left: 3px; + padding-top: 2px; + padding-bottom: 2px; + _s60-format: locale; + _s60-ampm-font-size: 16px; + _s60-digital-font-size: 56px; + color: "SKIN(268458534 13056 74)"; + background-color: "SKIN(268458534 9886)"; + nav-index: appearance; +} + +box.clock_profile +{ + background-color: "SKIN(268458534 9886)"; + nav-index: appearance; +} + +box#date_profiles_container +{ + width: auto; + block-progression: tb; +} + +box#date_container +{ + width: auto; + height: 26px; + block-progression: rl; + margin-bottom: 3px; + padding-bottom: 2px; +} + +box#date_content +{ + width: adaptive; + height: adaptive; + margin-left: auto; + margin-right: auto; +} + +text#date_text +{ + text-align: center; + margin-left: 2px; + margin-right: 2px; + width: adaptive; + height: adaptive; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + _s60-text-valign: top; + color:"SKIN(268458534 13056 74)"; +} + +box#profile_softindicator +{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 2px; + padding-right: 2px; + direction: rtl; +} + +image#SatIdleModeIcon +{ + display: block; + width: 18px; + height: 20px; + position: static; + margin-top: auto; +} + +/* Default system profiles */ +text.systemprofileitem +{ + display: block; +} + +/* Placeholders for profiles added by user */ +text.userprofileitem +{ + display: none; +} + +/****************** + SOFT INDICATOR WIDGET AREA +*******************/ +newsticker.SIText +{ + text-align: center; + display: block; + visibility: visible; + width: auto; + margin-left: 2px; + margin-right: 2px; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + + white-space-collapse: collapse; + + _s60-scroll-behaviour: scroll-alternate; + + _s60-display-time: 2000; + _s60-scroll-loop: false; + _s60-start-delay: 0; + _s60-restart-after-update: true; +} + +box#NT_CUGMCN +{ + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +box#NT_SATVHZ +{ + display: none; + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +title#title_vhz +{ + display: none; +} + +title#title_sat +{ + display: none; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/root_2001f482/conf/root2001f482.confml Binary file idlehomescreen/data/qhd_tch/root_2001f482/conf/root2001f482.confml has changed diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/root_2001f482/conf/root2001f482.gcfml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/conf/root2001f482.gcfml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/root_2001f482/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,70 @@ +/* +* 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/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 + + + +//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) + +// Support for S60 localization +//***************************** + + +// 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) + + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME root_2001f482 +OPTION DTD_TYPE widget +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/root_2001f482/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,33 @@ + + + + qhd_tch + + application + + + 0x102750F0 + + + 0x101fb657 + + + 0x2001f482 + + statuslicenceerestorable + + + &qtn_root_2001f482_name; + ai3_root + 2.0 + + + rootconfiguration.xml + + + root.o0000 + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/root_2001f482/hsps/00/rootconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/hsps/00/rootconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/root_2001f482/rom/root.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/rom/root.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* 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 IBY file. +* +*/ + +#ifndef __ROOT_2001F482_IBY__ +#define __ROOT_2001F482_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\root_2001f482\xuikon\00\root.o0000 \private\200159c0\install\root_2001f482\xuikon\00\root.o0000 +data=ZPRIVATE\200159c0\install\root_2001f482\hsps\00\manifest.dat \private\200159c0\install\root_2001f482\hsps\00\manifest.dat + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __ROOT_2001F482_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/root_2001f482/rom/root_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/rom/root_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* 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 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/root_2001f482/rom/root_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/rom/root_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* 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 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/root_2001f482/rom/root_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/rom/root_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* 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 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/root_2001f482/xuikon/00/Root.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/xuikon/00/Root.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,3 @@ +views +{ +} \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/root_2001f482/xuikon/00/Root.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/xuikon/00/Root.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,11 @@ + + + E029CF57 + 101FB657 + 11001233 + DemoRoot + Root + 1.0 + Root.xml + Root.css + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/root_2001f482/xuikon/00/Root.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/xuikon/00/Root.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,4 @@ + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/gfx/shortcut2logo.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/gfx/shortcut2logo.svg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,72 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* The information required for building +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// Support for productization and Carbide.Ui customization +//******************************************************** +../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/hsps/widgetconfiguration.xml +../hsps/00/shortcut2configuration.dtd /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/hsps/shortcut2configuration.dtd + +../xuikon/00/shortcut2.dat /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/xuikon/shortcut2_2001f484.dat +../xuikon/00/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/xuikon/shortcut2.css +../xuikon/00/shortcut2.xml /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/xuikon/shortcut2.xml + +// logo icon +../gfx/shortcut2logo.svg /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/hsps/shortcut2logo.svg + +// Arabic languages +//***************** +../xuikon/37/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/xuikon/37/shortcut2.css +../xuikon/50/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/xuikon/50/shortcut2.css +../xuikon/57/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/xuikon/57/shortcut2.css +../xuikon/94/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/xuikon/94/shortcut2.css + + +// Support for S60 localization +//***************************** +#ifndef __SHORTCUT2CONFIGURATION_LOC__ +#define __SHORTCUT2CONFIGURATION_LOC__ + ../loc/shortcut2configuration.loc APP_LAYER_LOC_EXPORT_PATH(shortcut2configuration.loc) +#endif // __SHORTCUT2CONFIGURATION_LOC__ + +// Support for S60 builds +//*********************** +../rom/shortcut2_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001f484_resources.iby) +../rom/shortcut2_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001f484_customer.iby) +../rom/shortcut2_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001f484_variant.iby) +../rom/shortcut2.iby CORE_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001f484.iby) + + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME shortcut2_2001f484 +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,71 @@ + + + + + + + qhd_tch + + + + widget + + + + + + 0x2001f48a + + + + + + 0x101fb657 + + + + + + 0x2001f484 + + + + + + &qtn_shortcut2_configuration_name; + + sc2 + + 1.0 + + + + + + widgetconfiguration.xml + + + + + + shortcut2configuration.dtd + + + + + + + &qtn_shortcut2_configuration_desc; + shortcut2logo.svg + + + + + + + shortcut2.o0000 + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/hsps/00/shortcut2configuration.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/hsps/00/shortcut2configuration.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,34 @@ + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,5 @@ + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/loc/shortcut2configuration.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/loc/shortcut2configuration.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for Shortcuts 2 plugin configuration (HSPS) +* +*/ + +// d: Shortcuts +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_shortcut2_configuration_name "Shortcut 2" +#define qtn_shortcut2_configuration_desc "localized RnD shortcut 2 description." diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* Shortcut2 widget HSPS-plugin IBY file. +* +*/ + +#ifndef __SHORTCUT2_2001F484_IBY__ +#define __SHORTCUT2_2001F484_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\shortcut2_2001f484\hsps\00\manifest.dat \private\200159c0\install\shortcut2_2001f484\hsps\00\manifest.dat + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __SHORTCUT2_2001F484_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Shortcut2 widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __SHORTCUT2_2001F484_CUSTOMER_IBY__ +#define __SHORTCUT2_2001F484_CUSTOMER_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\shortcut2_2001f484\xuikon\00\shortcut2.o0000 \private\200159c0\install\shortcut2_2001f484\xuikon\00\shortcut2.o0000 +data=ZPRIVATE\200159c0\install\shortcut2_2001f484\hsps\00\shortcut2configuration.dtd \private\200159c0\install\shortcut2_2001f484\hsps\00\shortcut2configuration.dtd + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __SHORTCUT2_2001F484_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Shortcut2 widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __SHORTCUT2_2001F484_RESOURCES_IBY__ +#define __SHORTCUT2_2001F484_RESOURCES_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\shortcut2_2001f484\xuikon\37\shortcut2.o0037 \private\200159c0\install\shortcut2_2001f484\xuikon\37\shortcut2.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\shortcut2_2001f484\xuikon\50\shortcut2.o0050 \private\200159c0\install\shortcut2_2001f484\xuikon\50\shortcut2.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\shortcut2_2001f484\xuikon\57\shortcut2.o0057 \private\200159c0\install\shortcut2_2001f484\xuikon\57\shortcut2.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\shortcut2_2001f484\xuikon\94\shortcut2.o0094 \private\200159c0\install\shortcut2_2001f484\xuikon\94\shortcut2.o0094 +#endif + +data=ZPRIVATE\200159c0\install\shortcut2_2001f484\hsps\00\shortcut2configuration.dtd \private\200159c0\install\shortcut2_2001f484\hsps\00\shortcut2configuration.dtd +data=ZPRIVATE\200159c0\install\shortcut2_2001f484\hsps\00\shortcut2logo.svg \private\200159c0\install\shortcut2_2001f484\hsps\00\shortcut2logo.svg + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __SHORTCUT2_2001F484_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* Shortcut2 widget HSPS-plugin variant specific IBY file. +* +*/ + +#ifndef __SHORTCUT2_2001F484_VARIANT_IBY__ +#define __SHORTCUT2_2001F484_VARIANT_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\shortcut2_2001f484\hsps\00\widgetconfiguration.xml \private\200159c0\install\shortcut2_2001f484\hsps\00\widgetconfiguration.xml + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __SHORTCUT2_2001F484_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/00/shortcut2.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/00/shortcut2.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ +widget#shortcutPluginContainer +{ + block-progression: rl; + direction: ltr; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 3px; + background-color: none; +} + +button.shortcutButton +{ + width: 74px; + margin-right: 3px; + nav-index: appearance; +} + +button.shortcutButton:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + focus-background:"SKIN(268458534 9896)"; +} + +button.shortcutButton:hold +{ + background-color: "SKIN(268458534 9956)"; +} + +image.shortcutIcon +{ + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/00/shortcut2.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/00/shortcut2.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,11 @@ + + + 2001CB4F + 101FB657 + 11001552 + Shortcut2 + Shortcut2 + 1.0 + shortcut2.xml + shortcut2.css + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/00/shortcut2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/00/shortcut2.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/37/shortcut2.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/37/shortcut2.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ +widget#shortcutPluginContainer +{ + block-progression: rl; + direction: rtl; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 3px; + background-color: none; +} + +button.shortcutButton +{ + width: 74px; + margin-right: 3px; + nav-index: appearance; +} + +button.shortcutButton:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + focus-background:"SKIN(268458534 9896)"; +} + +button.shortcutButton:hold +{ + background-color: "SKIN(268458534 9956)"; +} + +image.shortcutIcon +{ + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/50/shortcut2.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/50/shortcut2.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ +widget#shortcutPluginContainer +{ + block-progression: rl; + direction: rtl; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 3px; + background-color: none; +} + +button.shortcutButton +{ + width: 74px; + margin-right: 3px; + nav-index: appearance; +} + +button.shortcutButton:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + focus-background:"SKIN(268458534 9896)"; +} + +button.shortcutButton:hold +{ + background-color: "SKIN(268458534 9956)"; +} + +image.shortcutIcon +{ + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/57/shortcut2.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/57/shortcut2.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ +widget#shortcutPluginContainer +{ + block-progression: rl; + direction: rtl; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 3px; + background-color: none; +} + +button.shortcutButton +{ + width: 74px; + margin-right: 3px; + nav-index: appearance; +} + +button.shortcutButton:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + focus-background:"SKIN(268458534 9896)"; +} + +button.shortcutButton:hold +{ + background-color: "SKIN(268458534 9956)"; +} + +image.shortcutIcon +{ + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/94/shortcut2.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/94/shortcut2.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ +widget#shortcutPluginContainer +{ + block-progression: rl; + direction: rtl; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 3px; + background-color: none; +} + +button.shortcutButton +{ + width: 74px; + margin-right: 3px; + nav-index: appearance; +} + +button.shortcutButton:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + focus-background:"SKIN(268458534 9896)"; +} + +button.shortcutButton:hold +{ + background-color: "SKIN(268458534 9956)"; +} + +image.shortcutIcon +{ + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/gfx/shortcut1logo.png Binary file idlehomescreen/data/qhd_tch/shortcut_2001f483/gfx/shortcut1logo.png has changed diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* The information required for building +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// Support for productization and Carbide.Ui customization +//******************************************************** +../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/shortcut_2001f483/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/shortcut_2001f483/hsps/widgetconfiguration.xml +../hsps/00/shortcutconfiguration.dtd /epoc32/data/Z/resource/homescreen/shortcut_2001f483/hsps/shortcutconfiguration.dtd + +../xuikon/00/shortcut.dat /epoc32/data/Z/resource/homescreen/shortcut_2001f483/xuikon/shortcut_2001f483.dat +../xuikon/00/shortcut.css /epoc32/data/Z/resource/homescreen/shortcut_2001f483/xuikon/shortcut.css +../xuikon/00/shortcut.xml /epoc32/data/Z/resource/homescreen/shortcut_2001f483/xuikon/shortcut.xml + +// logo icon +../gfx/shortcut1logo.png /epoc32/data/Z/resource/homescreen/shortcut_2001f483/hsps/shortcut1logo.png + +// Arabic languages +//***************** +../xuikon/37/shortcut.css /epoc32/data/Z/resource/homescreen/shortcut_2001f483/xuikon/37/shortcut.css +../xuikon/50/shortcut.css /epoc32/data/Z/resource/homescreen/shortcut_2001f483/xuikon/50/shortcut.css +../xuikon/57/shortcut.css /epoc32/data/Z/resource/homescreen/shortcut_2001f483/xuikon/57/shortcut.css +../xuikon/94/shortcut.css /epoc32/data/Z/resource/homescreen/shortcut_2001f483/xuikon/94/shortcut.css + + +// Support for S60 localization +//***************************** +#ifndef __SHORTCUTCONFIGURATION_LOC__ +#define __SHORTCUTCONFIGURATION_LOC__ +../loc/shortcutconfiguration.loc APP_LAYER_LOC_EXPORT_PATH(shortcutconfiguration.loc) +#endif // __SHORTCUTCONFIGURATION_LOC__ + +// Support for S60 builds +//*********************** +../rom/shortcut_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f483_resources.iby) +../rom/shortcut_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f483_customer.iby) +../rom/shortcut_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f483_variant.iby) +../rom/shortcut.iby CORE_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f483.iby) + + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME shortcut_2001f483 +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ + + + + qhd_tch + + widget + + + 0x2001f48a + + + 0x101fb657 + + + 0x2001f483 + + + &qtn_shortcut1_configuration_name; + sc + 1.0 + + + widgetconfiguration.xml + + + shortcutconfiguration.dtd + + + + &qtn_shortcut1_configuration_desc; + shortcut1logo.png + + + + + shortcut.o0000 + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/hsps/00/shortcutconfiguration.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/hsps/00/shortcutconfiguration.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,33 @@ + + + + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,5 @@ + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/loc/shortcutconfiguration.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/loc/shortcutconfiguration.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for Shortcut1 plugin configuration (HSPS) +* +*/ + + +// d: Shortcuts +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_shortcut1_configuration_name "Shortcut 1" +#define qtn_shortcut1_configuration_desc "localized RnD shortcut 1 description." + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* Shortcut widget HSPS-plugin IBY file. +* +*/ + +#ifndef __SHORTCUT_2001F483_IBY__ +#define __SHORTCUT_2001F483_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\shortcut_2001f483\hsps\00\manifest.dat \private\200159c0\install\shortcut_2001f483\hsps\00\manifest.dat + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __SHORTCUT_2001F483_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Shortcut widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __SHORTCUT_2001F483_CUSTOMER_IBY__ +#define __SHORTCUT_2001F483_CUSTOMER_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\shortcut_2001f483\xuikon\00\shortcut.o0000 \private\200159c0\install\shortcut_2001f483\xuikon\00\shortcut.o0000 +data=ZPRIVATE\200159c0\install\shortcut_2001f483\hsps\00\shortcutconfiguration.dtd \private\200159c0\install\shortcut_2001f483\hsps\00\shortcutconfiguration.dtd + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __SHORTCUT_2001F483_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Shortcut widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __SHORTCUT_2001F483_RESOURCES_IBY__ +#define __SHORTCUT_2001F483_RESOURCES_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\shortcut_2001f483\xuikon\37\shortcut.o0037 \private\200159c0\install\shortcut_2001f483\xuikon\37\shortcut.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\shortcut_2001f483\xuikon\50\shortcut.o0050 \private\200159c0\install\shortcut_2001f483\xuikon\50\shortcut.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\shortcut_2001f483\xuikon\57\shortcut.o0057 \private\200159c0\install\shortcut_2001f483\xuikon\57\shortcut.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\shortcut_2001f483\xuikon\94\shortcut.o0094 \private\200159c0\install\shortcut_2001f483\xuikon\94\shortcut.o0094 +#endif + +data=ZPRIVATE\200159c0\install\shortcut_2001f483\hsps\00\shortcutconfiguration.dtd \private\200159c0\install\shortcut_2001f483\hsps\00\shortcutconfiguration.dtd +data=ZPRIVATE\200159c0\install\shortcut_2001f483\hsps\00\shortcut1logo.png \private\200159c0\install\shortcut_2001f483\hsps\00\shortcut1logo.png + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __SHORTCUT_2001F483_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* Shortcut widget HSPS-plugin variant specific IBY file. +* +*/ + +#ifndef __SHORTCUT_2001F483_VARIANT_IBY__ +#define __SHORTCUT_2001F483_VARIANT_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\shortcut_2001f483\hsps\00\widgetconfiguration.xml \private\200159c0\install\shortcut_2001f483\hsps\00\widgetconfiguration.xml + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __SHORTCUT_2001F483_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/00/Shortcut.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/00/Shortcut.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ +widget#shortcutPluginContainer +{ + block-progression: rl; + direction: ltr; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 3px; + background-color: none; +} + +button.shortcutButton +{ + width: 74px; + margin-right: 3px; + nav-index: appearance; +} + +button.shortcutButton:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + focus-background:"SKIN(268458534 9896)"; +} + +button.shortcutButton:hold +{ + background-color: "SKIN(268458534 9956)"; +} + +image.shortcutIcon +{ + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/00/Shortcut.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/00/Shortcut.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/00/shortcut.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/00/shortcut.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,11 @@ + + + 2001CB4F + 101FB657 + 11001551 + Shortcut + Shortcut + 1.0 + Shortcut.xml + Shortcut.css + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/37/Shortcut.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/37/Shortcut.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ +widget#shortcutPluginContainer +{ + block-progression: rl; + direction: rtl; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 3px; + background-color: none; +} + +button.shortcutButton +{ + width: 74px; + margin-right: 3px; + nav-index: appearance; +} + +button.shortcutButton:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + focus-background:"SKIN(268458534 9896)"; +} + +button.shortcutButton:hold +{ + background-color: "SKIN(268458534 9956)"; +} + +image.shortcutIcon +{ + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/50/Shortcut.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/50/Shortcut.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ +widget#shortcutPluginContainer +{ + block-progression: rl; + direction: rtl; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 3px; + background-color: none; +} + +button.shortcutButton +{ + width: 74px; + margin-right: 3px; + nav-index: appearance; +} + +button.shortcutButton:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + focus-background:"SKIN(268458534 9896)"; +} + +button.shortcutButton:hold +{ + background-color: "SKIN(268458534 9956)"; +} + +image.shortcutIcon +{ + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/57/Shortcut.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/57/Shortcut.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ +widget#shortcutPluginContainer +{ + block-progression: rl; + direction: rtl; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 3px; + background-color: none; +} + +button.shortcutButton +{ + width: 74px; + margin-right: 3px; + nav-index: appearance; +} + +button.shortcutButton:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + focus-background:"SKIN(268458534 9896)"; +} + +button.shortcutButton:hold +{ + background-color: "SKIN(268458534 9956)"; +} + +image.shortcutIcon +{ + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/94/Shortcut.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/94/Shortcut.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ +widget#shortcutPluginContainer +{ + block-progression: rl; + direction: rtl; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 3px; + background-color: none; +} + +button.shortcutButton +{ + width: 74px; + margin-right: 3px; + nav-index: appearance; +} + +button.shortcutButton:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + focus-background:"SKIN(268458534 9896)"; +} + +button.shortcutButton:hold +{ + background-color: "SKIN(268458534 9956)"; +} + +image.shortcutIcon +{ + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,71 @@ +/* +* 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/templateview_20026f50/hsps/manifest.dat +../hsps/00/templateviewconfiguration.xml /epoc32/data/Z/resource/homescreen/templateview_20026f50/hsps/templateviewconfiguration.xml + +../xuikon/00/templateview.dat /epoc32/data/Z/resource/homescreen/templateview_20026f50/xuikon/templateview_20026f50.dat +../xuikon/00/templateview.css /epoc32/data/Z/resource/homescreen/templateview_20026f50/xuikon/templateview.css +../xuikon/00/templateview.xml /epoc32/data/Z/resource/homescreen/templateview_20026f50/xuikon/templateview.xml +../xuikon/00/view.dtd /epoc32/data/Z/resource/homescreen/templateview_20026f50/xuikon/view.dtd + +// Arabic languages +//***************** +../xuikon/37/templateview.css /epoc32/data/Z/resource/homescreen/templateview_20026f50/xuikon/37/templateview.css +../xuikon/50/templateview.css /epoc32/data/Z/resource/homescreen/templateview_20026f50/xuikon/50/templateview.css +../xuikon/57/templateview.css /epoc32/data/Z/resource/homescreen/templateview_20026f50/xuikon/57/templateview.css +../xuikon/94/templateview.css /epoc32/data/Z/resource/homescreen/templateview_20026f50/xuikon/94/templateview.css + + +// Support for S60 localization +//***************************** +#ifndef __TEMPLATEVIEW_LOC__ +#define __TEMPLATEVIEW_LOC__ +../loc/templateview.loc APP_LAYER_LOC_EXPORT_PATH(templateview.loc) +#endif // __TEMPLATEVIEW_LOC__ + +// Support for S60 builds +//*********************** +../rom/templateview_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(templateview_20026f50_resources.iby) +../rom/templateview_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(templateview_20026f50_customer.iby) +../rom/templateview_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(templateview_20026f50_variant.iby) +../rom/templateview.iby CORE_APP_LAYER_IBY_EXPORT_PATH(templateview_20026f50.iby) + + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME templateview_20026f50 +OPTION DTD_TYPE widget +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ + + + + qhd_tch + view + + + 0x2001f48a + + + 0x101fb657 + + + 0x20026f50 + + + Template view + + ai3_templateview + + 1.0 + + + templateviewconfiguration.xml + + + + templateview.o0000 + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/hsps/00/templateviewconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/hsps/00/templateviewconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/loc/templateview.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/loc/templateview.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,256 @@ +/* +* 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: right softkey caption in inactive call state +// l: text_softkey call +// w: +// r: TB9.2 +#define text_softkey_call "Call" diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/rom/templateview.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/rom/templateview.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* Template view widget HSPS-plugin IBY file. +* +*/ + +#ifndef __AI3TEMPLATEVIEW_20026F50_IBY__ +#define __AI3TEMPLATEVIEW_20026F50_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\templateview_20026f50\hsps\00\manifest.dat \private\200159c0\install\templateview_20026f50\hsps\00\manifest.dat + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3TEMPLATEVIEW_20026F50_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/rom/templateview_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/rom/templateview_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* Template view widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __AI3TEMPLATEVIEW_20026F50_CUSTOMER_IBY__ +#define __AI3TEMPLATEVIEW_20026F50_CUSTOMER_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\templateview_20026f50\xuikon\00\templateview.o0000 \private\200159c0\install\templateview_20026f50\xuikon\00\templateview.o0000 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3TEMPLATEVIEW_20026F50_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/rom/templateview_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/rom/templateview_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* Template view widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __AI3TEMPLATEVIEW_20026F50_RESOURCES_IBY__ +#define __AI3TEMPLATEVIEW_20026F50_RESOURCES_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\templateview_20026f50\xuikon\00\templateview.o0000 \private\200159c0\install\templateview_20026f50\xuikon\00\templateview.o0000 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3TEMPLATEVIEW_20026F50_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/rom/templateview_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/rom/templateview_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* Template view widget HSPS-plugin variant specific IBY file. +* +*/ + +#ifndef __AI3TEMPLATEVIEW_20026F50_VARIANT_IBY__ +#define __AI3TEMPLATEVIEW_20026F50_VARIANT_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\templateview_20026f50\hsps\00\templateviewconfiguration.xml \private\200159c0\install\templateview_20026f50\hsps\00\templateviewconfiguration.xml + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3TEMPLATEVIEW_20026F50_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ +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: tb; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + + _s60-longtap: true; + + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + + 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; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + E029CF57 + 101FB657 + 11001234 + TemplateView + TemplateView + 1.0 + templateview.xml + templateview.css + view.dtd + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,330 @@ + + + + + + + + + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/view.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/view.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,409 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/37/templateview.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/37/templateview.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ +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: tb; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + background-color: "SKIN(268458534 9916)"; + + _s60-longtap: true; + + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + + 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; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/50/templateview.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/50/templateview.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ +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: tb; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + background-color: "SKIN(268458534 9916)"; + + _s60-longtap: true; + + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + + 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; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/57/templateview.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/57/templateview.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ +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: tb; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + background-color: "SKIN(268458534 9916)"; + + _s60-longtap: true; + + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + + 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; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/94/templateview.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/94/templateview.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ +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: tb; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + background-color: "SKIN(268458534 9916)"; + + _s60-longtap: true; + + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + + 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; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threerows_2001f486/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,66 @@ +/* +* 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/threerows_2001f486/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/threerows_2001f486/hsps/widgetconfiguration.xml +../xuikon/00/threerows.dat /epoc32/data/Z/resource/homescreen/threerows_2001f486/xuikon/threerows_2001f486.dat +../xuikon/00/threerows.css /epoc32/data/Z/resource/homescreen/threerows_2001f486/xuikon/threerows.css +../xuikon/00/threerows.xml /epoc32/data/Z/resource/homescreen/threerows_2001f486/xuikon/threerows.xml + +// Arabic languages +//***************** +../xuikon/37/threerows.css /epoc32/data/Z/resource/homescreen/threerows_2001f486/xuikon/37/threerows.css +../xuikon/50/threerows.css /epoc32/data/Z/resource/homescreen/threerows_2001f486/xuikon/50/threerows.css +../xuikon/57/threerows.css /epoc32/data/Z/resource/homescreen/threerows_2001f486/xuikon/57/threerows.css +../xuikon/94/threerows.css /epoc32/data/Z/resource/homescreen/threerows_2001f486/xuikon/94/threerows.css + + +// Support for S60 builds +//*********************** +../rom/threerows_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(threerows_2001f486_resources.iby) +../rom/threerows_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(threerows_2001f486_customer.iby) +../rom/threerows_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(threerows_2001f486_variant.iby) +../rom/threerows.iby CORE_APP_LAYER_IBY_EXPORT_PATH(threerows_2001f486.iby) + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME threerows_2001f486 +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threerows_2001f486/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,63 @@ + + + + + + + qhd_tch + + + + template + + + + + + 0x2001f48a + + + + + + 0x101fb657 + + + + + + 0x2001f486 + + + + + + threerows + + thrs + + 1.0 + + + + + + widgetconfiguration.xml + + + + + + + + + + + + threerows.o0000 + + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threerows_2001f486/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threerows_2001f486/rom/threerows.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/rom/threerows.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* threerows widget HSPS-plugin IBY file. +* +*/ + +#ifndef __THREEROWS_2001F486_IBY__ +#define __THREEROWS_2001F486_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\threerows_2001f486\hsps\00\manifest.dat \private\200159c0\install\threerows_2001f486\hsps\00\manifest.dat + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __THREEROWS_2001F486_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threerows_2001f486/rom/threerows_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/rom/threerows_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* threerows widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __THREEROWS_2001F486_CUSTOMER_IBY__ +#define __THREEROWS_2001F486_CUSTOMER_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\threerows_2001f486\xuikon\00\threerows.o0000 \private\200159c0\install\threerows_2001f486\xuikon\00\threerows.o0000 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __THREEROWS_2001F486_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threerows_2001f486/rom/threerows_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/rom/threerows_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,40 @@ +/* +* 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: +* threerows widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __THREEROWS_2001F486_RESOURCES_IBY__ +#define __THREEROWS_2001F486_RESOURCES_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\threerows_2001f486\xuikon\37\threerows.o0037 \private\200159c0\install\threerows_2001f486\xuikon\37\threerows.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\threerows_2001f486\xuikon\50\threerows.o0050 \private\200159c0\install\threerows_2001f486\xuikon\50\threerows.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\threerows_2001f486\xuikon\57\threerows.o0057 \private\200159c0\install\threerows_2001f486\xuikon\57\threerows.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\threerows_2001f486\xuikon\94\threerows.o0094 \private\200159c0\install\threerows_2001f486\xuikon\94\threerows.o0094 +#endif + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __THREEROWS_2001F486_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threerows_2001f486/rom/threerows_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/rom/threerows_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* threerows widget HSPS-plugin variant specific IBY file. +* +*/ + +#ifndef __THREEROWS_2001F486_VARIANT_IBY__ +#define __THREEROWS_2001F486_VARIANT_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\threerows_2001f486\hsps\00\widgetconfiguration.xml \private\200159c0\install\threerows_2001f486\hsps\00\widgetconfiguration.xml + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __SHORTCUT_2001F486_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/00/threerows.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/00/threerows.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,33 @@ +widget#threerows_template +{ + block-progression:rl; +} + +image#image_container +{ + padding-top:8px; + padding-bottom:8px; + padding-left:8px; + padding-right:8px; + height: 90%; + width: 20%; + _s60-aspect-ratio:preserve; + nav-index:appearance; +} + +box#text_container +{ + block-progression:tb; +} + +text.text_box +{ + padding-left:8px; + padding-right:8px; + text-align:left; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + nav-index:appearance; + _s60-text-valign: top; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/00/threerows.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/00/threerows.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + 2001CB4F + 101FB657 + 110012F8 + threerows + threerows + 1.0 + threerows.xml + threerows.css + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/00/threerows.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/00/threerows.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/37/threerows.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/37/threerows.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,34 @@ +widget#threerows_template +{ + direction: rtl; + block-progression:rl; +} + +image#image_container +{ + padding-top:8px; + padding-bottom:8px; + padding-left:8px; + padding-right:8px; + height: 90%; + width: 20%; + _s60-aspect-ratio:preserve; + nav-index:appearance; +} + +box#text_container +{ + block-progression:tb; +} + +text.text_box +{ + padding-left:8px; + padding-right:8px; + text-align: right; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + nav-index:appearance; + _s60-text-valign: top; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/50/threerows.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/50/threerows.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,34 @@ +widget#threerows_template +{ + direction: rtl; + block-progression:rl; +} + +image#image_container +{ + padding-top:8px; + padding-bottom:8px; + padding-left:8px; + padding-right:8px; + height: 90%; + width: 20%; + _s60-aspect-ratio:preserve; + nav-index:appearance; +} + +box#text_container +{ + block-progression:tb; +} + +text.text_box +{ + padding-left:8px; + padding-right:8px; + text-align: right; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + nav-index:appearance; + _s60-text-valign: top; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/57/threerows.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/57/threerows.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,35 @@ +widget#threerows_template +{ + direction: rtl; + block-progression:rl; +} + +image#image_container +{ + padding-top:8px; + padding-bottom:8px; + padding-left:8px; + padding-right:8px; + height: 90%; + width: 20%; + _s60-aspect-ratio:preserve; + nav-index:appearance; +} + +box#text_container +{ + block-progression:tb; +} + +text.text_box +{ + padding-left:8px; + padding-right:8px; + text-align: right; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + nav-index:appearance; + _s60-text-valign: top; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/94/threerows.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threerows_2001f486/xuikon/94/threerows.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,34 @@ +widget#threerows_template +{ + direction: rtl; + block-progression:rl; +} + +image#image_container +{ + padding-top:8px; + padding-bottom:8px; + padding-left:8px; + padding-right:8px; + height: 90%; + width: 20%; + _s60-aspect-ratio:preserve; + nav-index:appearance; +} + +box#text_container +{ + block-progression:tb; +} + +text.text_box +{ + padding-left:8px; + padding-right:8px; + text-align: right; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + nav-index:appearance; + _s60-text-valign: top; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threetextrows_2001f487/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,68 @@ +/* +* 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/threetextrows_2001f487/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/threetextrows_2001f487/hsps/widgetconfiguration.xml +../xuikon/00/threetextrows.dat /epoc32/data/Z/resource/homescreen/threetextrows_2001f487/xuikon/threetextrows_2001f487.dat +../xuikon/00/threetextrows.css /epoc32/data/Z/resource/homescreen/threetextrows_2001f487/xuikon/threetextrows.css +../xuikon/00/threetextrows.xml /epoc32/data/Z/resource/homescreen/threetextrows_2001f487/xuikon/threetextrows.xml + +// Arabic languages +//***************** +../xuikon/37/threetextrows.css /epoc32/data/Z/resource/homescreen/threetextrows_2001f487/xuikon/37/threetextrows.css +../xuikon/50/threetextrows.css /epoc32/data/Z/resource/homescreen/threetextrows_2001f487/xuikon/50/threetextrows.css +../xuikon/57/threetextrows.css /epoc32/data/Z/resource/homescreen/threetextrows_2001f487/xuikon/57/threetextrows.css +../xuikon/94/threetextrows.css /epoc32/data/Z/resource/homescreen/threetextrows_2001f487/xuikon/94/threetextrows.css + + +// Support for S60 builds +//*********************** +../rom/threetextrows_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(threetextrows_2001f487_resources.iby) +../rom/threetextrows_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(threetextrows_2001f487_customer.iby) +../rom/threetextrows_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(threetextrows_2001f487_variant.iby) +../rom/threetextrows.iby CORE_APP_LAYER_IBY_EXPORT_PATH(threetextrows_2001f487.iby) + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME threetextrows_2001f487 +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +//#endif + +// End of File + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threetextrows_2001f487/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,65 @@ + + + + + + + qhd_tch + + + + template + + + + + + 0x2001f48a + + + + + + 0x101fb657 + + + + + + 0x2001f487 + + + + + + threetextrows + + thtxtrs + + 1.0 + + + + + + widgetconfiguration.xml + + + + + + + + + + + + + + threetextrows.o0000 + + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threetextrows_2001f487/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threetextrows_2001f487/rom/threetextrows.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/rom/threetextrows.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* threetextrows widget HSPS-plugin IBY file. +* +*/ + +#ifndef __THREETEXTROWS_2001F487_IBY__ +#define __THREETEXTROWS_2001F487_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\threetextrows_2001f487\hsps\00\manifest.dat \private\200159c0\install\threetextrows_2001f487\hsps\00\manifest.dat + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __THREETEXTROWS_2001F487_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threetextrows_2001f487/rom/threetextrows_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/rom/threetextrows_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* threetextrows widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __THREETEXTROWS_2001F487_CUSTOMER_IBY__ +#define __THREETEXTROWS_2001F487_CUSTOMER_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\threetextrows_2001f487\xuikon\00\threetextrows.o0000 \private\200159c0\install\threetextrows_2001f487\xuikon\00\threetextrows.o0000 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __THREETEXTROWS_2001F487_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threetextrows_2001f487/rom/threetextrows_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/rom/threetextrows_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,40 @@ +/* +* 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: +* threetextrows widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __THREETEXTROWS_2001F487_RESOURCES_IBY__ +#define __THREETEXTROWS_2001F487_RESOURCES_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\threetextrows_2001f487\xuikon\37\threetextrows.o0037 \private\200159c0\install\threetextrows_2001f487\xuikon\37\threetextrows.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\threetextrows_2001f487\xuikon\50\threetextrows.o0050 \private\200159c0\install\threetextrows_2001f487\xuikon\50\threetextrows.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\threetextrows_2001f487\xuikon\57\threetextrows.o0057 \private\200159c0\install\threetextrows_2001f487\xuikon\57\threetextrows.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\threetextrows_2001f487\xuikon\94\threetextrows.o0094 \private\200159c0\install\threetextrows_2001f487\xuikon\94\threetextrows.o0094 +#endif + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __THREETEXTROWS_2001F487_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threetextrows_2001f487/rom/threetextrows_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/rom/threetextrows_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* threetextrows widget HSPS-plugin variant specific IBY file. +* +*/ + +#ifndef __THREETEXTROWS_2001F487_VARIANT_IBY__ +#define __THREETEXTROWS_2001F487_VARIANT_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\threetextrows_2001f487\hsps\00\widgetconfiguration.xml \private\200159c0\install\threetextrows_2001f487\hsps\00\widgetconfiguration.xml + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __THREETEXTROWS_2001F487_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/00/threetextrows.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/00/threetextrows.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,11 @@ +text.text_box +{ + padding-left:8px; + padding-right:8px; + text-align:left; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + nav-index:appearance; + _s60-text-valign: top; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/00/threetextrows.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/00/threetextrows.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + 2001CB4F + 101FB657 + 110012F9 + threetextrows + threetextrows + 1.0 + threetextrows.xml + threetextrows.css + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/00/threetextrows.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/00/threetextrows.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/37/threetextrows.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/37/threetextrows.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,11 @@ +text.text_box +{ + padding-left:8px; + padding-right:8px; + text-align: right; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + nav-index:appearance; + _s60-text-valign: top; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/50/threetextrows.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/50/threetextrows.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,11 @@ +text.text_box +{ + padding-left:8px; + padding-right:8px; + text-align: right; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + nav-index:appearance; + _s60-text-valign: top; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/57/threetextrows.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/57/threetextrows.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,11 @@ +text.text_box +{ + padding-left:8px; + padding-right:8px; + text-align: right; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + nav-index:appearance; + _s60-text-valign: top; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/94/threetextrows.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/threetextrows_2001f487/xuikon/94/threetextrows.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,11 @@ +text.text_box +{ + padding-left:8px; + padding-right:8px; + text-align: right; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; + nav-index:appearance; + _s60-text-valign: top; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/tworows_2001f488/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,66 @@ +/* +* 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/tworows_2001f488/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/tworows_2001f488/hsps/widgetconfiguration.xml +../xuikon/00/tworows.dat /epoc32/data/Z/resource/homescreen/tworows_2001f488/xuikon/tworows_2001f488.dat +../xuikon/00/tworows.css /epoc32/data/Z/resource/homescreen/tworows_2001f488/xuikon/tworows.css +../xuikon/00/tworows.xml /epoc32/data/Z/resource/homescreen/tworows_2001f488/xuikon/tworows.xml + +// Arabic languages +//***************** +../xuikon/37/tworows.css /epoc32/data/Z/resource/homescreen/tworows_2001f488/xuikon/37/tworows.css +../xuikon/50/tworows.css /epoc32/data/Z/resource/homescreen/tworows_2001f488/xuikon/50/tworows.css +../xuikon/57/tworows.css /epoc32/data/Z/resource/homescreen/tworows_2001f488/xuikon/57/tworows.css +../xuikon/94/tworows.css /epoc32/data/Z/resource/homescreen/tworows_2001f488/xuikon/94/tworows.css + + +// Support for S60 builds +//*********************** +../rom/tworows_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(tworows_2001f488_resources.iby) +../rom/tworows_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(tworows_2001f488_customer.iby) +../rom/tworows_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(tworows_2001f488_variant.iby) +../rom/tworows.iby CORE_APP_LAYER_IBY_EXPORT_PATH(tworows_2001f488.iby) + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME tworows_2001f488 +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/tworows_2001f488/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,63 @@ + + + + + + + qhd_tch + + + + template + + + + + + 0x2001f48a + + + + + + 0x101fb657 + + + + + + 0x2001f488 + + + + + + tworows + + twrs + + 1.0 + + + + + + widgetconfiguration.xml + + + + + + + + + + + + tworows.o0000 + + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/tworows_2001f488/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/tworows_2001f488/rom/tworows.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/rom/tworows.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* tworows widget HSPS-plugin IBY file. +* +*/ + +#ifndef __TWOROWS_2001F488_IBY__ +#define __TWOROWS_2001F488_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\tworows_2001f488\hsps\00\manifest.dat \private\200159c0\install\tworows_2001f488\hsps\00\manifest.dat + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __TWOROWS_2001F488_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/tworows_2001f488/rom/tworows_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/rom/tworows_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* tworows widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __TWOROWS_2001F488_CUSTOMER_IBY__ +#define __TWOROWS_2001F488_CUSTOMER_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\tworows_2001f488\xuikon\00\tworows.o0000 \private\200159c0\install\tworows_2001f488\xuikon\00\tworows.o0000 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __TWOROWS_2001F488_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/tworows_2001f488/rom/tworows_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/rom/tworows_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,40 @@ +/* +* 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: +* tworows widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __TWOROWS_2001F488_RESOURCES_IBY__ +#define __TWOROWS_2001F488_RESOURCES_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools, language specific +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\tworows_2001f488\xuikon\37\tworows.o0037 \private\200159c0\install\tworows_2001f488\xuikon\37\tworows.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\tworows_2001f488\xuikon\50\tworows.o0050 \private\200159c0\install\tworows_2001f488\xuikon\50\tworows.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\tworows_2001f488\xuikon\57\tworows.o0057 \private\200159c0\install\tworows_2001f488\xuikon\57\tworows.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\tworows_2001f488\xuikon\94\tworows.o0094 \private\200159c0\install\tworows_2001f488\xuikon\94\tworows.o0094 +#endif + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __TWOROWS_2001F488_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/tworows_2001f488/rom/tworows_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/rom/tworows_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* tworows widget HSPS-plugin variant specific IBY file. +* +*/ + +#ifndef __TWOROWS_2001F488_VARIANT_IBY__ +#define __TWOROWS_2001F488_VARIANT_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\tworows_2001f488\hsps\00\widgetconfiguration.xml \private\200159c0\install\tworows_2001f488\hsps\00\widgetconfiguration.xml + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __TWOROWS_2001F488_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/00/tworows.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/00/tworows.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,34 @@ +widget#tworows_template +{ + block-progression:rl; +} + +image#image_container +{ + padding-top:8px; + padding-bottom:8px; + padding-left:8px; + padding-right:8px; + height: 90%; + width: 20%; + _s60-aspect-ratio:preserve; + nav-index:appearance; +} + +box#text_container +{ + block-progression:tb; +} + +text.text_box +{ + padding-right:8px; + padding-left:8px; + padding-top:8px; + text-align:left; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color:"SKIN(268458534 13056 74)"; + nav-index:appearance; + _s60-text-valign: top; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/00/tworows.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/00/tworows.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + 2001CB4F + 101FB657 + 110012F7 + tworows + tworows + 1.0 + tworows.xml + tworows.css + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/00/tworows.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/00/tworows.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/37/tworows.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/37/tworows.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,35 @@ +widget#tworows_template +{ + direction: rtl; + block-progression:rl; +} + +image#image_container +{ + padding-top:8px; + padding-bottom:8px; + padding-left:8px; + padding-right:8px; + height: 90%; + width: 20%; + _s60-aspect-ratio:preserve; + nav-index:appearance; +} + +box#text_container +{ + block-progression:tb; +} + +text.text_box +{ + padding-right:8px; + padding-left:8px; + padding-top:8px; + text-align: right; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color:"SKIN(268458534 13056 74)"; + nav-index:appearance; + _s60-text-valign: top; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/50/tworows.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/50/tworows.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,35 @@ +widget#tworows_template +{ + direction: rtl; + block-progression:rl; +} + +image#image_container +{ + padding-top:8px; + padding-bottom:8px; + padding-left:8px; + padding-right:8px; + height: 90%; + width: 20%; + _s60-aspect-ratio:preserve; + nav-index:appearance; +} + +box#text_container +{ + block-progression:tb; +} + +text.text_box +{ + padding-right:8px; + padding-left:8px; + padding-top:8px; + text-align: right; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color:"SKIN(268458534 13056 74)"; + nav-index:appearance; + _s60-text-valign: top; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/57/tworows.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/57/tworows.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,35 @@ +widget#tworows_template +{ + direction: rtl; + block-progression:rl; +} + +image#image_container +{ + padding-top:8px; + padding-bottom:8px; + padding-left:8px; + padding-right:8px; + height: 90%; + width: 20%; + _s60-aspect-ratio:preserve; + nav-index:appearance; +} + +box#text_container +{ + block-progression:tb; +} + +text.text_box +{ + padding-right:8px; + padding-left:8px; + padding-top:8px; + text-align: right; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color:"SKIN(268458534 13056 74)"; + nav-index:appearance; + _s60-text-valign: top; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/94/tworows.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/tworows_2001f488/xuikon/94/tworows.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,35 @@ +widget#tworows_template +{ + direction: rtl; + block-progression:rl; +} + +image#image_container +{ + padding-top:8px; + padding-bottom:8px; + padding-left:8px; + padding-right:8px; + height: 90%; + width: 20%; + _s60-aspect-ratio:preserve; + nav-index:appearance; +} + +box#text_container +{ + block-progression:tb; +} + +text.text_box +{ + padding-right:8px; + padding-left:8px; + padding-top:8px; + text-align: right; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color:"SKIN(268458534 13056 74)"; + nav-index:appearance; + _s60-text-valign: top; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f486.confml Binary file idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f486.confml has changed diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f486.gcfml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f486.gcfml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,77 @@ +/* +* 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_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 +../xuikon/00/View.xml /epoc32/data/Z/resource/homescreen/view_2001f48b/xuikon/view.xml +../xuikon/00/View.dtd /epoc32/data/Z/resource/homescreen/view_2001f48b/xuikon/view.dtd + +// Arabic languages +//***************** +../xuikon/37/View.css /epoc32/data/Z/resource/homescreen/view_2001f48b/xuikon/37/view.css +../xuikon/50/View.css /epoc32/data/Z/resource/homescreen/view_2001f48b/xuikon/50/view.css +../xuikon/57/View.css /epoc32/data/Z/resource/homescreen/view_2001f48b/xuikon/57/view.css +../xuikon/94/View.css /epoc32/data/Z/resource/homescreen/view_2001f48b/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_2001f48b_variant.iby) +//*********************************** +//../conf/view2001f486.confml APP_LAYER_CONFML(view2001f486.confml) +//../conf/view2001f486.gcfml APP_LAYER_GCFML(view2001f486.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_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) + + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME view_2001f48b +OPTION DTD_TYPE widget +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ + + + + + + + qhd_tch + + + + view + + + + + + 0x2001f48a + + + + + + 0x101fb657 + + + + + + 0x2001f48b + + + + + + &qtn_view_2001f48b_name; + + ai3_view1 + + 1.0 + + + + + + viewconfiguration.xml + + + + + + + + view.o0000 + + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/hsps/00/viewconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/hsps/00/viewconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/loc/View.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/loc/View.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,256 @@ +/* +* 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: right softkey caption in inactive call state +// l: text_softkey call +// w: +// r: TB9.2 +#define text_softkey_call "Call" diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/rom/view.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/rom/view.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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_2001F48B_IBY__ +#define __AI3VIEW_2001F48B_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\view_2001f48b\hsps\00\manifest.dat \private\200159c0\install\view_2001f48b\hsps\00\manifest.dat + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3VIEW_2001F48B_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/rom/view_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/rom/view_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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_2001F48B_CUSTOMER_IBY__ +#define __AI3VIEW_2001F48B_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_2001f48b\xuikon\00\view.o0000 \private\200159c0\install\view_2001f48b\xuikon\00\view.o0000 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3VIEW_2001F48B_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/rom/view_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/rom/view_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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_2001F48B_RESOURCES_IBY__ +#define __AI3VIEW_2001F48B_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_2001f48b\xuikon\00\view.o0000 \private\200159c0\install\view_2001f48b\xuikon\00\view.o0000 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3VIEW_2001F48B_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/rom/view_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/rom/view_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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_2001F48B_VARIANT_IBY__ +#define __AI3VIEW_2001F48B_VARIANT_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\view_2001f48b\hsps\00\viewconfiguration.xml \private\200159c0\install\view_2001f48b\hsps\00\viewconfiguration.xml + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __AI3VIEW_2001F48B_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ +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: tb; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + + _s60-longtap: true; + + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + + 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; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.dat Thu Dec 17 08:40:49 2009 +0200 @@ -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 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,409 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,330 @@ + + + + + + + + + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/37/View.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/37/View.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ +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: tb; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + background-color: "SKIN(268458534 9916)"; + + _s60-longtap: true; + + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + + 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; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/50/View.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/50/View.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ +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: tb; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + background-color: "SKIN(268458534 9916)"; + + _s60-longtap: true; + + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + + 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; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/57/View.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/57/View.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ +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: tb; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + background-color: "SKIN(268458534 9916)"; + + _s60-longtap: true; + + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + + 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; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/94/View.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/94/View.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ +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: tb; + padding-top: 3px; +} + +plugin.plugins +{ + height: 82px; + width: 312px; + + margin-bottom: 4px; + margin-right: 5px; + margin-left: 5px; + background-color: "SKIN(268458534 9916)"; + + _s60-longtap: true; + + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + + 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; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/wideimage_2001f489/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,63 @@ +/* +* 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/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 +../xuikon/00/wideimage.dtd /epoc32/data/Z/resource/homescreen/wideimage_2001f489/xuikon/wideimage.dtd + +// Support for S60 localization +//***************************** +#ifndef __WIDEIMAGE_LOC__ +#define __WIDEIMAGE_LOC__ +../loc/wideimage.loc APP_LAYER_LOC_EXPORT_PATH(wideimage.loc) +#endif // __WIDEIMAGE_LOC__ + +// Support for S60 builds +//*********************** +../rom/wideimage_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(wideimage_2001f489_resources.iby) +../rom/wideimage_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(wideimage_2001f489_customer.iby) +../rom/wideimage_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(wideimage_2001f489_variant.iby) +../rom/wideimage.iby CORE_APP_LAYER_IBY_EXPORT_PATH(wideimage_2001f489.iby) + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME wideimage_2001f489 +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/wideimage_2001f489/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ + + + + + + + qhd_tch + + + + template + + + + + + 0x2001f48a + + + + + + 0x101fb657 + + + + + + 0x2001f489 + + + + + + wideimage + + wide + + 1.0 + + + + + + widgetconfiguration.xml + + + + + + + + wideimage.o0000 + + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/wideimage_2001f489/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/wideimage_2001f489/loc/wideimage.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/loc/wideimage.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for WideImage widget (Xuikon) +* +*/ + +// d: Loading content +// l: ai_gene_pane_1_t1/opt4 +// w: +// r: TB9.2 +#define qtn_ai_loading_content "Loading content..." \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/wideimage_2001f489/rom/wideimage.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/rom/wideimage.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* WideImage widget HSPS-plugin IBY file. +* +*/ + +#ifndef __WIDEIMAGE_2001F489_IBY__ +#define __WIDEIMAGE_2001F489_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\wideimage_2001f489\hsps\00\manifest.dat \private\200159c0\install\wideimage_2001f489\hsps\00\manifest.dat + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __WIDEIMAGE_2001F489_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/wideimage_2001f489/rom/wideimage_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/rom/wideimage_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* Wideimage widget HSPS-plugin language specific IBY file. +* +*/ + +#ifndef __WIDEIMAGE_2001F489_CUSTOMER_IBY__ +#define __WIDEIMAGE_2001F489_CUSTOMER_IBY__ + +#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 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __WIDEIMAGE_2001F489_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/wideimage_2001f489/rom/wideimage_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/rom/wideimage_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* 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: IBY file for Homescreen's wideimage_2001f489. +* +*/ + +#ifndef __WIDEIMAGE_2001F489_RESOURCES_IBY__ +#define __WIDEIMAGE_2001F489_RESOURCES_IBY__ + +#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 + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __WIDEIMAGE_2001F489_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/wideimage_2001f489/rom/wideimage_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/rom/wideimage_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* WideImage widget HSPS-plugin variant specific IBY file. +* +*/ + +#ifndef __WIDEIMAGE_2001F489_VARIANT_IBY__ +#define __WIDEIMAGE_2001F489_VARIANT_IBY__ + +#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\wideimage_2001f489\hsps\00\widgetconfiguration.xml \private\200159c0\install\wideimage_2001f489\hsps\00\widgetconfiguration.xml + +#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH + +#endif // __WIDEIMAGE_2001F489_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,22 @@ +widget#wideimage_template +{ + nav-index: appearance; + background-color: none; +} + +image#wide_image +{ + /* Will be updated by content policy */ + display: none; +} + +text#wide_text +{ + padding-left: 5px; + text-align: center; + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + color: "SKIN(268458534 13056 74)"; +} + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + 2001CB4F + 101FB657 + 110012F5 + wideimage + wideimage + 1.0 + wideimage.xml + wideimage.css + wideimage.dtd + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + &qtn_ai_loading_content; + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/desktop_20018eee/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/desktop_20018eee/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,69 @@ +/* +* 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/desktop_20018eee/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/desktop_20018eee/hsps/widgetconfiguration.xml + +../xuikon/00/desktop.dat /epoc32/data/Z/resource/homescreen/desktop_20018eee/xuikon/desktop_20018eee.dat +../xuikon/00/desktop.css /epoc32/data/Z/resource/homescreen/desktop_20018eee/xuikon/desktop.css +../xuikon/00/desktop.xml /epoc32/data/Z/resource/homescreen/desktop_20018eee/xuikon/desktop.xml + + +// Arabic languages +//***************** +../xuikon/37/desktop.css /epoc32/data/Z/resource/homescreen/desktop_20018eee/xuikon/37/desktop.css +../xuikon/50/desktop.css /epoc32/data/Z/resource/homescreen/desktop_20018eee/xuikon/50/desktop.css +../xuikon/57/desktop.css /epoc32/data/Z/resource/homescreen/desktop_20018eee/xuikon/57/desktop.css +../xuikon/94/desktop.css /epoc32/data/Z/resource/homescreen/desktop_20018eee/xuikon/94/desktop.css + + +// Support for S60 builds +//*********************** +../rom/desktop_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(desktop_20018eee_resources.iby) +../rom/desktop_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(desktop_20018eee_customer.iby) +../rom/desktop_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(desktop_20018eee_variant.iby) +../rom/desktop.iby CORE_APP_LAYER_IBY_EXPORT_PATH(desktop_20018eee.iby) + + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME desktop_20018eee +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/desktop_20018eee/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/desktop_20018eee/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,33 @@ + + + + vga_tch + + widget + + + 0x2001f48a + + + 0x101fb657 + + + 0x20018eee + + + Desktop + desktop + 1.0 + + + widgetconfiguration.xml + + + + + + + desktop.o0000 + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/desktop_20018eee/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/desktop_20018eee/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/desktop_20018eee/rom/desktop.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/desktop_20018eee/rom/desktop.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +/* +* 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: +* Top Contacts widget HSPS-plugin core IBY file. +* +*/ + +#ifdef FF_TOPCONTACTSWIDGET_COMPONENT + +#ifndef __TOPCONTACTS_IBY__ +#define __TOPCONTACTS_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\topcontacts\hsps\00\manifest.dat \private\200159c0\install\topcontacts\hsps\00\manifest.dat + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) + +#endif // FF_TOPCONTACTSWIDGET_COMPONENT \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/desktop_20018eee/rom/desktop_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/desktop_20018eee/rom/desktop_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,33 @@ +/* +* 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: +* Top Contacts widget HSPS-plugin customer specific IBY file. +* +*/ + +#ifdef FF_TOPCONTACTSWIDGET_COMPONENT + +#ifndef __DESKTOP_20018EEE_CUSTOMER_IBY__ +#define __DESKTOP_20018EEE_CUSTOMER_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +data=ZPRIVATE\200159c0\install\topcontacts\xuikon\00\TopContacts.o0000 \private\200159c0\install\topcontacts\xuikon\00\TopContacts.o0000 +data=ZPRIVATE\200159c0\install\topcontacts\hsps\00\topcontact_hs_widget.dtd \private\200159c0\install\topcontacts\hsps\00\topcontact_hs_widget.dtd + +#endif // FF_LAYOUT_480_640_VGA3 + +#endif // __DESKTOP_20018EEE_CUSTOMER_IBY__ + +#endif // FF_TOPCONTACTSWIDGET_COMPONENT diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/desktop_20018eee/rom/desktop_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/desktop_20018eee/rom/desktop_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,47 @@ +/* +* 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: +* Top Contacts widget HSPS-plugin language specific IBY file. +* +*/ + +#ifdef FF_TOPCONTACTSWIDGET_COMPONENT + +#ifndef __DESKTOP_20018EEE_RESOURCES_IBY__ +#define __DESKTOP_20018EEE_RESOURCES_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\topcontacts\xuikon\37\topcontacts.o0037 \private\200159c0\install\topcontacts\xuikon\37\topcontacts.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\topcontacts\xuikon\50\topcontacts.o0050 \private\200159c0\install\topcontacts\xuikon\50\topcontacts.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\topcontacts\xuikon\57\topcontacts.o0057 \private\200159c0\install\topcontacts\xuikon\57\topcontacts.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\topcontacts\xuikon\94\topcontacts.o0094 \private\200159c0\install\topcontacts\xuikon\94\topcontacts.o0094 +#endif + + +data=ZPRIVATE\200159c0\install\topcontacts\hsps\00\topcontact_hs_widget.dtd \private\200159c0\install\topcontacts\hsps\00\topcontact_hs_widget.dtd + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __DESKTOP_20018EEE_RESOURCES_IBY__ + +#endif // FF_TOPCONTACTSWIDGET_COMPONENT diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/desktop_20018eee/rom/desktop_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/desktop_20018eee/rom/desktop_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,33 @@ +/* +* 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: +* Top Contacts widget HSPS-plugin variant specific IBY file. +* +*/ + +#ifdef FF_TOPCONTACTSWIDGET_COMPONENT + +#ifndef __DESKTOP_20018EEE_VARIANT_IBY__ +#define __DESKTOP_20018EEE_VARIANT_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\topcontacts\hsps\00\widgetconfiguration.xml \private\200159c0\install\topcontacts\hsps\00\widgetconfiguration.xml + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __DESKTOP_20018EEE_VARIANT_IBY__ + +#endif // FF_TOPCONTACTSWIDGET_COMPONENT diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/desktop_20018eee/xuikon/00/desktop.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/desktop_20018eee/xuikon/00/desktop.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,135 @@ +widget#desktop_widget +{ + width: auto; + height: 70px; + + block-progression: rl; + direction: ltr; +} + +button.button +{ + width: 70px; + height: auto; + + nav-index: appearance; + + margin-left: 4px; + margin-right: 4px; + + background-color: "SKIN(268458534 9906)"; +} + +button#button1 +{ + margin-left: 0px; +} + +button#button6 +{ + margin-right: 0px; +} + +button.button:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image.icon +{ + width: auto; + height: auto; + + _s60-aspect-ratio: preserve; +} + +/* For presence */ +image.second_icon +{ + margin-top:0%; + width: 25%; + height: 25%; + position: absolute; + bottom: 0%; + left: 70%; + top: 3%; + _s60-aspect-ratio:preserve; +} + +tooltip.tooltip +{ + width: adaptive; + max-width: 350px; + height: 33px; + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 6px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 6px; +} + +text.tooltiptext +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + +/********************* + extension +**********************/ +tooltip.tooltipext +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.textcaptionext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.textext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/desktop_20018eee/xuikon/00/desktop.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/desktop_20018eee/xuikon/00/desktop.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,11 @@ + + + 2001CB4F + 101FB657 + 200184C8 + DesktopWidget + Desktop + 1.0 + desktop.xml + desktop.css + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/desktop_20018eee/xuikon/00/desktop.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/desktop_20018eee/xuikon/00/desktop.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/desktop_20018eee/xuikon/37/desktop.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/desktop_20018eee/xuikon/37/desktop.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,139 @@ +widget#desktop_widget +{ + width: auto; + height: 70px; + + block-progression: rl; + direction: rtl; +} + +button.button +{ + width: 70px; + height: auto; + + nav-index: appearance; + + margin-left: 4px; + margin-right: 4px; + background-color: "SKIN(268458534 9906)"; +} + +button#button1 +{ + margin-left: 0px; +} + +button#button6 +{ + margin-right: 0px; +} + +button.button:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image.icon +{ + width: auto; + height: auto; + + _s60-aspect-ratio: preserve; +} + +/* For presence */ +image.second_icon +{ + margin-top:0%; + width: 25%; + height: 25%; + position: absolute; + bottom: 0%; + left: 70%; + top: 3%; + _s60-aspect-ratio:preserve; +} + +tooltip.tooltip +{ + width: 15.0u; /* any fixed lenghts works here if the owerflow is set to + both tooltip and text inside it */ + height: 5.5u; + + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + overflow: visible; +} + + +text.tooltiptext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + width: 100%; + height: 85%; + text-align: center; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + padding-right: 1u; + padding-left: 1u; + padding-bottom: 1u; +} + +/********************* + extension +**********************/ +tooltip.tooltipext +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.textcaptionext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.textext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/desktop_20018eee/xuikon/50/desktop.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/desktop_20018eee/xuikon/50/desktop.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,139 @@ +widget#desktop_widget +{ + width: auto; + height: 70px; + + block-progression: rl; + direction: rtl; +} + +button.button +{ + width: 70px; + height: auto; + + nav-index: appearance; + + margin-left: 4px; + margin-right: 4px; + background-color: "SKIN(268458534 9906)"; +} + +button#button1 +{ + margin-left: 0px; +} + +button#button6 +{ + margin-right: 0px; +} + +button.button:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image.icon +{ + width: auto; + height: auto; + + _s60-aspect-ratio: preserve; +} + +/* For presence */ +image.second_icon +{ + margin-top:0%; + width: 25%; + height: 25%; + position: absolute; + bottom: 0%; + left: 70%; + top: 3%; + _s60-aspect-ratio:preserve; +} + +tooltip.tooltip +{ + width: 15.0u; /* any fixed lenghts works here if the owerflow is set to + both tooltip and text inside it */ + height: 5.5u; + + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + overflow: visible; +} + + +text.tooltiptext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + width: 100%; + height: 85%; + text-align: center; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + padding-right: 1u; + padding-left: 1u; + padding-bottom: 1u; +} + +/********************* + extension +**********************/ +tooltip.tooltipext +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.textcaptionext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.textext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/desktop_20018eee/xuikon/57/desktop.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/desktop_20018eee/xuikon/57/desktop.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,140 @@ + widget#desktop_widget +{ + width: auto; + height: 70px; + + block-progression: rl; + direction: rtl; +} + +button.button +{ + width: 70px; + height: auto; + + nav-index: appearance; + + margin-left: 4px; + margin-right: 4px; + + background-color: "SKIN(268458534 9906)"; +} + +button#button1 +{ + margin-left: 0px; +} + +button#button6 +{ + margin-right: 0px; +} + +button.button:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image.icon +{ + width: auto; + height: auto; + + _s60-aspect-ratio: preserve; +} + +/* For presence */ +image.second_icon +{ + margin-top:0%; + width: 25%; + height: 25%; + position: absolute; + bottom: 0%; + left: 70%; + top: 3%; + _s60-aspect-ratio:preserve; +} + +tooltip.tooltip +{ + width: 15.0u; /* any fixed lenghts works here if the owerflow is set to + both tooltip and text inside it */ + height: 5.5u; + + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + overflow: visible; +} + + +text.tooltiptext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + width: 100%; + height: 85%; + text-align: center; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + padding-right: 1u; + padding-left: 1u; + padding-bottom: 1u; +} + +/********************* + extension +**********************/ +tooltip.tooltipext +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.textcaptionext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.textext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/desktop_20018eee/xuikon/94/desktop.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/desktop_20018eee/xuikon/94/desktop.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,140 @@ +widget#desktop_widget +{ + width: auto; + height: 70px; + + block-progression: rl; + direction: rtl; +} + +button.button +{ + width: 70px; + height: auto; + + nav-index: appearance; + + margin-left: 4px; + margin-right: 4px; + + background-color: "SKIN(268458534 9906)"; +} + +button#button1 +{ + margin-left: 0px; +} + +button#button6 +{ + margin-right: 0px; +} + +button.button:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image.icon +{ + width: auto; + height: auto; + + _s60-aspect-ratio: preserve; +} + +/* For presence */ +image.second_icon +{ + margin-top:0%; + width: 25%; + height: 25%; + position: absolute; + bottom: 0%; + left: 70%; + top: 3%; + _s60-aspect-ratio:preserve; +} + +tooltip.tooltip +{ + width: 15.0u; /* any fixed lenghts works here if the owerflow is set to + both tooltip and text inside it */ + height: 5.5u; + + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + overflow: visible; +} + + +text.tooltiptext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + width: 100%; + height: 85%; + text-align: center; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + padding-right: 1u; + padding-left: 1u; + padding-bottom: 1u; +} + +/********************* + extension +**********************/ +tooltip.tooltipext +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.textcaptionext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.textext +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,67 @@ +/* +* 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/double_row_icon_widget_2001fdbd/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/double_row_icon_widget_2001fdbd/hsps/widgetconfiguration.xml + +../xuikon/00/double_row_icon_widget.dat /epoc32/data/Z/resource/homescreen/double_row_icon_widget_2001fdbd/xuikon/double_row_icon_widget_2001fdbd.dat +../xuikon/00/double_row_icon_widget.css /epoc32/data/Z/resource/homescreen/double_row_icon_widget_2001fdbd/xuikon/double_row_icon_widget.css +../xuikon/00/double_row_icon_widget.xml /epoc32/data/Z/resource/homescreen/double_row_icon_widget_2001fdbd/xuikon/double_row_icon_widget.xml + +// Arabic languages +//***************** +../xuikon/37/double_row_icon_widget.css /epoc32/data/Z/resource/homescreen/double_row_icon_widget_2001fdbd/xuikon/37/double_row_icon_widget.css +../xuikon/50/double_row_icon_widget.css /epoc32/data/Z/resource/homescreen/double_row_icon_widget_2001fdbd/xuikon/50/double_row_icon_widget.css +../xuikon/57/double_row_icon_widget.css /epoc32/data/Z/resource/homescreen/double_row_icon_widget_2001fdbd/xuikon/57/double_row_icon_widget.css +../xuikon/94/double_row_icon_widget.css /epoc32/data/Z/resource/homescreen/double_row_icon_widget_2001fdbd/xuikon/94/double_row_icon_widget.css + + +// Support for S60 builds +//*********************** +../rom/double_row_icon_widget_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(double_row_icon_widget_2001fdbd_resources.iby) +../rom/double_row_icon_widget_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(double_row_icon_widget_2001fdbd_customer.iby) +../rom/double_row_icon_widget_variant.iby CUSTOMER_VARIANT_APP_LAYER_IBY_EXPORT_PATH(double_row_icon_widget_2001fdbd_variant.iby) +../rom/double_row_icon_widget.iby CORE_APP_LAYER_IBY_EXPORT_PATH(double_row_icon_widget_2001fdbd.iby) + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME double_row_icon_widget_2001fdbd +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,32 @@ + + + + vga_tch + + template + + + 0x2001f48a + + + 0x101fb657 + + + 0x2001fdbd + + + double_row_icon_widget + double_r_icon + 1.0 + + + widgetconfiguration.xml + + + + + + double_row_icon_widget.o0000 + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/rom/double_row_icon_widget.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/rom/double_row_icon_widget.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: IBY file for Homescreen's double_row_icon_widget_2001fdbd. +* +*/ + + +#ifndef __DOUBLE_ROW_ICON_WIDGET_2001FDBD_IBY__ +#define __DOUBLE_ROW_ICON_WIDGET_2001FDBD_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\double_row_icon_widget_2001fdbd\hsps\00\manifest.dat \private\200159c0\install\double_row_icon_widget_2001fdbd\hsps\00\manifest.dat + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __DOUBLE_ROW_ICON_WIDGET_2001FDBD_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/rom/double_row_icon_widget_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/rom/double_row_icon_widget_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: IBY file for Homescreen's double_row_icon_widget_2001fdbd. +* +*/ + + +#ifndef __DOUBLE_ROW_ICON_WIDGET_2001FDBD_CUSTOMER_IBY__ +#define __DOUBLE_ROW_ICON_WIDGET_2001FDBD_CUSTOMER_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\double_row_icon_widget_2001fdbd\xuikon\00\double_row_icon_widget.o0000 \private\200159c0\install\double_row_icon_widget_2001fdbd\xuikon\00\double_row_icon_widget.o0000 + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __DOUBLE_ROW_ICON_WIDGET_2001FDBD_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/rom/double_row_icon_widget_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/rom/double_row_icon_widget_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +/* +* 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: IBY file for Homescreen's double_row_icon_widget_2001fdbd. +* +*/ + +#ifndef __DOUBLE_ROW_ICON_WIDGET_2001FDBD_RESOURCES_IBY__ +#define __DOUBLE_ROW_ICON_WIDGET_2001FDBD_RESOURCES_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\double_row_icon_widget_2001fdbd\xuikon\37\double_row_icon_widget.o0037 \private\200159c0\install\double_row_icon_widget_2001fdbd\xuikon\37\double_row_icon_widget.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\double_row_icon_widget_2001fdbd\xuikon\50\double_row_icon_widget.o0050 \private\200159c0\install\double_row_icon_widget_2001fdbd\xuikon\50\double_row_icon_widget.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\double_row_icon_widget_2001fdbd\xuikon\57\double_row_icon_widget.o0057 \private\200159c0\install\double_row_icon_widget_2001fdbd\xuikon\57\double_row_icon_widget.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\double_row_icon_widget_2001fdbd\xuikon\94\double_row_icon_widget.o0094 \private\200159c0\install\double_row_icon_widget_2001fdbd\xuikon\94\double_row_icon_widget.o0094 +#endif + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __DOUBLE_ROW_ICON_WIDGET_2001FDBD_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/rom/double_row_icon_widget_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/rom/double_row_icon_widget_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: IBY file for Homescreen's double_row_icon_widget_2001fdbd. +* +*/ + + +#ifndef __DOUBLE_ROW_ICON_WIDGET_2001FDBD_VARIANT_IBY__ +#define __DOUBLE_ROW_ICON_WIDGET_2001FDBD_VARIANT_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\double_row_icon_widget_2001fdbd\hsps\00\widgetconfiguration.xml \private\200159c0\install\double_row_icon_widget_2001fdbd\hsps\00\widgetconfiguration.xml + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __DOUBLE_ROW_ICON_WIDGET_2001FDBD_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/00/double_row_icon_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/00/double_row_icon_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,66 @@ +widget{ + width:auto; + height:60px; + } +box#double_row_icon_widget{ + direction: ltr; + block-progression:tb; + nav-index:appearance; +} +box#double_row_icon_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box.row{ + direction: ltr; + block-progression:rl; + padding-left : 10px; + padding-right : 10px; +} +box#double_rc_row1_box{ + padding-top : 2px; + padding-bottom: 2px; +} +box#double_rc_row2_box{ + padding-top : 2px; + padding-bottom: 2px; +} + +box.imagebox +{ + height:auto; + width:20px; + direction: ltr; +} + +box.textbox +{ + padding-left : 10px; + direction: ltr; + width:auto; + height:20px; +} + +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: ltr; + block-progression:tb; + text-align:left; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + +image +{ + _s60-aspect-ratio:preserve; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/00/double_row_icon_widget.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/00/double_row_icon_widget.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + 2001CB4F + 101FB657 + 110012F6 + double_row_icon_widget + double_row_icon_widget + 1.0 + double_row_icon_widget.xml + double_row_icon_widget.css + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/00/double_row_icon_widget.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/00/double_row_icon_widget.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/37/double_row_icon_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/37/double_row_icon_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,66 @@ +widget{ + width:auto; + height:60px; + } +box#double_row_icon_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#double_row_icon_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box.row{ + direction: rtl; + block-progression:rl; + padding-left : 10px; + padding-right : 10px; +} +box#double_rc_row1_box{ + padding-top : 2px; + padding-bottom: 2px; +} +box#double_rc_row2_box{ + padding-top : 2px; + padding-bottom: 2px; +} + +box.imagebox +{ + height:auto; + width:20px; + direction: rtl; +} + +box.textbox +{ + padding-left : 10px; + direction: rtl; + width:auto; + height:20px; +} + +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + +image +{ + _s60-aspect-ratio:preserve; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/50/double_row_icon_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/50/double_row_icon_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,66 @@ +widget{ + width:auto; + height:60px; + } +box#double_row_icon_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#double_row_icon_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box.row{ + direction: rtl; + block-progression:rl; + padding-left : 10px; + padding-right : 10px; +} +box#double_rc_row1_box{ + padding-top : 2px; + padding-bottom: 2px; +} +box#double_rc_row2_box{ + padding-top : 2px; + padding-bottom: 2px; +} + +box.imagebox +{ + height:auto; + width:20px; + direction: rtl; +} + +box.textbox +{ + padding-left : 10px; + direction: rtl; + width:auto; + height:20px; +} + +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + +image +{ + _s60-aspect-ratio:preserve; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/57/double_row_icon_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/57/double_row_icon_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,66 @@ +widget{ + width:auto; + height:60px; + } +box#double_row_icon_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#double_row_icon_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box.row{ + direction: rtl; + block-progression:rl; + padding-left : 10px; + padding-right : 10px; +} +box#double_rc_row1_box{ + padding-top : 2px; + padding-bottom: 2px; +} +box#double_rc_row2_box{ + padding-top : 2px; + padding-bottom: 2px; +} + +box.imagebox +{ + height:auto; + width:20px; + direction: rtl; +} + +box.textbox +{ + padding-left : 10px; + direction: rtl; + width:auto; + height:20px; +} + +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + +image +{ + _s60-aspect-ratio:preserve; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/94/double_row_icon_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/94/double_row_icon_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,66 @@ +widget{ + width:auto; + height:60px; + } +box#double_row_icon_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#double_row_icon_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box.row{ + direction: rtl; + block-progression:rl; + padding-left : 10px; + padding-right : 10px; +} +box#double_rc_row1_box{ + padding-top : 2px; + padding-bottom: 2px; +} +box#double_rc_row2_box{ + padding-top : 2px; + padding-bottom: 2px; +} + +box.imagebox +{ + height:auto; + width:20px; + direction: rtl; +} + +box.textbox +{ + padding-left : 10px; + direction: rtl; + width:auto; + height:20px; +} + +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + +image +{ + _s60-aspect-ratio:preserve; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,63 @@ +/* +* 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/double_row_widget_2001fdc2/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/double_row_widget_2001fdc2/hsps/widgetconfiguration.xml + +../xuikon/00/double_row_widget.dat /epoc32/data/Z/resource/homescreen/double_row_widget_2001fdc2/xuikon/double_row_widget_2001fdc2.dat +../xuikon/00/double_row_widget.css /epoc32/data/Z/resource/homescreen/double_row_widget_2001fdc2/xuikon/double_row_widget.css +../xuikon/00/double_row_widget.xml /epoc32/data/Z/resource/homescreen/double_row_widget_2001fdc2/xuikon/double_row_widget.xml + +// Arabic languages +//***************** +../xuikon/37/double_row_widget.css /epoc32/data/Z/resource/homescreen/double_row_widget_2001fdc2/xuikon/37/double_row_widget.css +../xuikon/50/double_row_widget.css /epoc32/data/Z/resource/homescreen/double_row_widget_2001fdc2/xuikon/50/double_row_widget.css +../xuikon/57/double_row_widget.css /epoc32/data/Z/resource/homescreen/double_row_widget_2001fdc2/xuikon/57/double_row_widget.css +../xuikon/94/double_row_widget.css /epoc32/data/Z/resource/homescreen/double_row_widget_2001fdc2/xuikon/94/double_row_widget.css + + +// Support for S60 builds +//*********************** +../rom/double_row_widget_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(double_row_widget_2001fdc2_resources.iby) +../rom/double_row_widget_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(double_row_widget_2001fdc2_customer.iby) +../rom/double_row_widget_variant.iby CUSTOMER_VARIANT_APP_LAYER_IBY_EXPORT_PATH(double_row_widget_2001fdc2_variant.iby) +../rom/double_row_widget.iby CORE_APP_LAYER_IBY_EXPORT_PATH(double_row_widget_2001fdc2.iby) + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME double_row_widget_2001fdc2 +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,32 @@ + + + + vga_tch + + template + + + 0x2001f48a + + + 0x101fb657 + + + 0x2001fdc2 + + + double_row_widget + double_r + 1.0 + + + widgetconfiguration.xml + + + + + + double_row_widget.o0000 + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/rom/double_row_widget.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/rom/double_row_widget.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* 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: IBY file for Homescreen's double_row_widget_2001fdc2. +* +*/ + +#ifndef __DOUBLE_ROW_WIDGET_2001FDC2_IBY__ +#define __DOUBLE_ROW_WIDGET_2001FDC2_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\double_row_widget_2001fdc2\hsps\00\manifest.dat \private\200159c0\install\double_row_widget_2001fdc2\hsps\00\manifest.dat + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __DOUBLE_ROW_WIDGET_2001FDC2_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/rom/double_row_widget_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/rom/double_row_widget_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* 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: IBY file for Homescreen's double_row_widget_2001fdc2. +* +*/ + +#ifndef __DOUBLE_ROW_WIDGET_2001FDC2_CUSTOMER_IBY__ +#define __DOUBLE_ROW_WIDGET_2001FDC2_CUSTOMER_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\double_row_widget_2001fdc2\xuikon\00\double_row_widget.o0000 \private\200159c0\install\double_row_widget_2001fdc2\xuikon\00\double_row_widget.o0000 + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __DOUBLE_ROW_WIDGET_2001FDC2_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/rom/double_row_widget_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/rom/double_row_widget_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +/* +* 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: IBY file for Homescreen's double_row_widget_2001fdc2. +* +*/ + +#ifndef __DOUBLE_ROW_WIDGET_2001FDC2_RESOURCES_IBY__ +#define __DOUBLE_ROW_WIDGET_2001FDC2_RESOURCES_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\double_row_widget_2001fdc2\xuikon\37\double_row_widget.o0037 \private\200159c0\install\double_row_widget_2001fdc2\xuikon\37\double_row_widget.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\double_row_widget_2001fdc2\xuikon\50\double_row_widget.o0050 \private\200159c0\install\double_row_widget_2001fdc2\xuikon\50\double_row_widget.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\double_row_widget_2001fdc2\xuikon\57\double_row_widget.o0057 \private\200159c0\install\double_row_widget_2001fdc2\xuikon\57\double_row_widget.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\double_row_widget_2001fdc2\xuikon\94\double_row_widget.o0094 \private\200159c0\install\double_row_widget_2001fdc2\xuikon\94\double_row_widget.o0094 +#endif + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __DOUBLE_ROW_WIDGET_2001FDC2_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/rom/double_row_widget_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/rom/double_row_widget_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* 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: IBY file for Homescreen's double_row_widget_2001fdc2. +* +*/ + +#ifndef __DOUBLE_ROW_WIDGET_2001FDC2_VARIANT_IBY__ +#define __DOUBLE_ROW_WIDGET_2001FDC2_VARIANT_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\double_row_widget_2001fdc2\hsps\00\widgetconfiguration.xml \private\200159c0\install\double_row_widget_2001fdc2\hsps\00\widgetconfiguration.xml + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __DOUBLE_ROW_WIDGET_2001FDC2_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/00/double_row_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/00/double_row_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,37 @@ +widget{ + width: auto; + height: 60px; + } +box#double_row_widget{ + direction: ltr; + block-progression: tb; + nav-index: appearance; +} + +box#double_row_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} +box.double_text_box{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 10px; + padding-right: 10px; + direction: ltr; +} + +text{ + width: auto; + height: auto; + display: block; + visibility: visible; + position: static; + direction: ltr; + block-progression: tb; + text-align: left; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/00/double_row_widget.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/00/double_row_widget.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + 2001CB4F + 101FB657 + 110012F6 + double_row_widget + double_row_widget + 1.0 + double_row_widget.xml + double_row_widget.css + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/00/double_row_widget.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/00/double_row_widget.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/37/double_row_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/37/double_row_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +widget{ + width: auto; + height: 60px; + } + +box#double_row_widget{ + direction: rtl; + block-progression: tb; + nav-index: appearance; +} + +box#double_row_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} +box.double_text_box{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 10px; + padding-right: 10px; + direction: ltr; +} + +text +{ + width: auto; + height: auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression: tb; + text-align: right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/50/double_row_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/50/double_row_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +widget{ + width: auto; + height: 60px; + } + +box#double_row_widget{ + direction: rtl; + block-progression: tb; + nav-index: appearance; +} + +box#double_row_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} +box.double_text_box{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 10px; + padding-right: 10px; + direction: ltr; +} + +text +{ + width: auto; + height: auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression: tb; + text-align: right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/57/double_row_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/57/double_row_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +widget{ + width: auto; + height: 60px; + } + +box#double_row_widget{ + direction: rtl; + block-progression: tb; + nav-index: appearance; +} + +box#double_row_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} +box.double_text_box{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 10px; + padding-right: 10px; + direction: ltr; +} + +text +{ + width: auto; + height: auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression: tb; + text-align: right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/94/double_row_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/94/double_row_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +widget{ + width: auto; + height: 60px; + } + +box#double_row_widget{ + direction: rtl; + block-progression: tb; + nav-index: appearance; +} + +box#double_row_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} +box.double_text_box{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 10px; + padding-right: 10px; + direction: ltr; +} + +text +{ + width: auto; + height: auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression: tb; + text-align: right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ +/* +* 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: Homescreen's Buzzidle (vga) widgets +* +*/ + + +#include "../double_row_icon_widget_2001fdbd/group/bld.inf" +#include "../double_row_widget_2001fdc2/group/bld.inf" +#include "../root_2001f48f/group/bld.inf" +//#include "../shortcut2_2001fdbb/group/bld.inf" +//#include "../shortcut_2001f490/group/bld.inf" +#include "../single_row_icon_widget_2001fdc0/group/bld.inf" +#include "../single_row_widget_2001fdc1/group/bld.inf" +#include "../triple_row_icon_widget_2001fdbe/group/bld.inf" +#include "../triple_row_widget_2001fdbf/group/bld.inf" +#include "../view1_2001fdb9/group/bld.inf" +#include "../wideimage_10009dff/group/bld.inf" + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/root_2001f48f/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/root_2001f48f/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,69 @@ +/* +* 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/root_2001f48f/hsps/manifest.dat +../hsps/00/rootconfiguration.xml /epoc32/data/z/resource/homescreen/root_2001f48f/hsps/rootconfiguration.xml +//../hsps/00/rootconfiguration.dtd /epoc32/data/z/resource/homescreen/root_2001f48f/hsps/rootconfiguration.dtd + +../xuikon/00/root.dat /epoc32/data/z/resource/homescreen/root_2001f48f/xuikon/root_2001f48f.dat +../xuikon/00/root.css /epoc32/data/z/resource/homescreen/root_2001f48f/xuikon/root.css +../xuikon/00/root.xml /epoc32/data/z/resource/homescreen/root_2001f48f/xuikon/root.xml + + +// Support for S60 localization +//***************************** +//#ifndef __ROOTCONFIGURATION_LOC__ +//#define __ROOTCONFIGURATION_LOC__ +//../loc/rootconfiguration.loc APP_LAYER_LOC_EXPORT_PATH(rootconfiguration.loc) +//#endif // __ROOTCONFIGURATION_LOC__ + +// Support for S60 builds +//*********************** +../rom/root_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(root_2001f48f_resources.iby) +../rom/root_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(root_2001f48f_customer.iby) +../rom/root_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(root_2001f48f_variant.iby) +../rom/root.iby CORE_APP_LAYER_IBY_EXPORT_PATH(root_2001f48f.iby) + + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME root_2001f48f +OPTION DTD_TYPE widget +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/root_2001f48f/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/root_2001f48f/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ + + + + vga_tch + + application + + + 0x102750f0 + + + 0x101fb657 + + + 0x2001f48f + + + AI3 Root/VGA + ai3_root + 2.0 + + statuslicenceerestorable + + + rootconfiguration.xml + + + + + + root.o0000 + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/root_2001f48f/hsps/00/rootconfiguration.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/root_2001f48f/hsps/00/rootconfiguration.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,25 @@ + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/root_2001f48f/hsps/00/rootconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/root_2001f48f/hsps/00/rootconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/root_2001f48f/loc/rootconfiguration.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/root_2001f48f/loc/rootconfiguration.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,23 @@ +/* +* 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: root +// l: ai_gene_pane_1_t1 +// w: +// r: TB9.2 +#define qtn_root_configuration_name "AI3 Root" diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/root_2001f48f/rom/root.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/root_2001f48f/rom/root.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* 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 IBY file. +* +*/ + + +#ifndef __ROOT_2001F48F_IBY__ +#define __ROOT_2001F48F_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\root_2001f48f\xuikon\00\root.o0000 \private\200159c0\install\root_2001f48f\xuikon\00\root.o0000 +data=ZPRIVATE\200159c0\install\root_2001f48f\hsps\00\manifest.dat \private\200159c0\install\root_2001f48f\hsps\00\manifest.dat + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __ROOT_2001F48F_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/root_2001f48f/rom/root_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/root_2001f48f/rom/root_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: Root widget HSPS-plugin language specific IBY file. +* +*/ + + +#ifndef __ROOT_2001F48F_CUSTOMER_IBY__ +#define __ROOT_2001F48F_CUSTOMER_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +//data=ZPRIVATE\200159c0\install\root_2001f48f\hsps\00\rootconfiguration.dtd \private\200159c0\install\root_2001f48f\hsps\00\rootconfiguration.dtd + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __ROOT_2001F48F_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/root_2001f48f/rom/root_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/root_2001f48f/rom/root_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: Root widget HSPS-plugin language specific IBY file. +* +*/ + + +#ifndef __ROOT_2001F48F_RESOURCES_IBY__ +#define __ROOT_2001F48F_RESOURCES_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +//data=ZPRIVATE\200159c0\install\root_2001f48f\hsps\00\rootconfiguration.dtd \private\200159c0\install\root_2001f48f\hsps\00\rootconfiguration.dtd + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __ROOT_2001F48F_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/root_2001f48f/rom/root_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/root_2001f48f/rom/root_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: Root widget HSPS-plugin variant specific IBY file. +* +*/ + + +#ifndef __ROOT_2001F48F_VARIANT_IBY__ +#define __ROOT_2001F48F_VARIANT_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\root_2001f48f\hsps\00\rootconfiguration.xml \private\200159c0\install\root_2001f48f\hsps\00\rootconfiguration.xml + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __ROOT_2001F48F_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/root_2001f48f/xuikon/00/root.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/root_2001f48f/xuikon/00/root.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,3 @@ +views +{ +} \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/root_2001f48f/xuikon/00/root.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/root_2001f48f/xuikon/00/root.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,11 @@ + + + E029CF57 + 101FB657 + 11001233 + NokiaDemoRoot + root + 1.0 + root.xml + root.css + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/root_2001f48f/xuikon/00/root.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/root_2001f48f/xuikon/00/root.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,6 @@ + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The information required for building +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// Support for productization and Carbide.Ui customization +//******************************************************** +../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/hsps/widgetconfiguration.xml +../hsps/00/shortcut2configuration.dtd /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/hsps/shortcut2configuration.dtd + +../xuikon/00/shortcut2.dat /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/xuikon/shortcut2_2001fdbb.dat +../xuikon/00/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/xuikon/shortcut2.css +../xuikon/00/shortcut2.xml /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/xuikon/shortcut2.xml + +// Arabic languages +//***************** +../xuikon/37/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/xuikon/37/shortcut2.css +../xuikon/50/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/xuikon/50/shortcut2.css +../xuikon/57/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/xuikon/57/shortcut2.css +../xuikon/94/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/xuikon/94/shortcut2.css + + +// Support for S60 localization +//***************************** +#ifndef __SHORTCUT2CONFIGURATION_LOC__ +#define __SHORTCUT2CONFIGURATION_LOC__ +../loc/shortcut2configuration.loc APP_LAYER_LOC_EXPORT_PATH(shortcut2configuration.loc) +#endif // __SHORTCUT2CONFIGURATION_LOC__ + +// Support for S60 builds +//*********************** +../rom/shortcut2_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001fdbb_resources.iby) +../rom/shortcut2_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001fdbb_customer.iby) +../rom/shortcut2_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001fdbb_variant.iby) +../rom/shortcut2.iby CORE_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001fdbb.iby) + + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME shortcut2_2001fdbb +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ + + + + vga_tch + + widget + + + 0x2001f48a + + + 0x101fb657 + + + 0x2001fdbb + + + &qtn_hs_sc2_widget; + sc2 + 1.0 + + + widgetconfiguration.xml + + + shortcut2configuration.dtd + + + + + + + shortcut2.o0000 + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/hsps/00/shortcut2configuration.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/hsps/00/shortcut2configuration.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,33 @@ + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,5 @@ + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/loc/shortcut2configuration.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/loc/shortcut2configuration.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for Shortcuts 2 plugin configuration (HSPS) +* +*/ + +// d: Shortcuts +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_shortcut2_configuration_name "Shortcut 2" diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Shortcut2 widget HSPS-plugin IBY file. +* +*/ + +#ifndef __SHORTCUT2_2001FDBB_IBY__ +#define __SHORTCUT2_2001FDBB_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\hsps\00\manifest.dat \private\200159c0\install\shortcut2_2001fdbb\hsps\00\manifest.dat + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __SHORTCUT2_2001FDBB_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Shortcut2 widget HSPS-plugin language specific IBY file. +* +*/ + + +#ifndef __SHORTCUT2_2001FDBB_CUSTOMER_IBY__ +#define __SHORTCUT2_2001FDBB_CUSTOMER_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\xuikon\00\shortcut2.o0000 \private\200159c0\install\shortcut2_2001fdbb\xuikon\00\shortcut2.o0000 +data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\hsps\00\shortcut2configuration.dtd \private\200159c0\install\shortcut2_2001fdbb\hsps\00\shortcut2configuration.dtd + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __SHORTCUT2_2001FDBB_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Shortcut2 widget HSPS-plugin language specific IBY file. +* +*/ + + +#ifndef __SHORTCUT2_2001FDBB_RESOURCES_IBY__ +#define __SHORTCUT2_2001FDBB_RESOURCES_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\xuikon\37\shortcut2.o0037 \private\200159c0\install\shortcut2_2001fdbb\xuikon\37\shortcut2.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\xuikon\50\shortcut2.o0050 \private\200159c0\install\shortcut2_2001fdbb\xuikon\50\shortcut2.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\xuikon\57\shortcut2.o0057 \private\200159c0\install\shortcut2_2001fdbb\xuikon\57\shortcut2.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\xuikon\94\shortcut2.o0094 \private\200159c0\install\shortcut2_2001fdbb\xuikon\94\shortcut2.o0094 +#endif + +data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\hsps\00\shortcut2configuration.dtd \private\200159c0\install\shortcut2_2001fdbb\hsps\00\shortcut2configuration.dtd + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __SHORTCUT2_2001FDBB_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: Shortcut2 widget HSPS-plugin variant specific IBY file. +* +*/ + + +#ifndef __SHORTCUT2_2001FDBB_VARIANT_IBY__ +#define __SHORTCUT2_2001FDBB_VARIANT_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\hsps\00\widgetconfiguration.xml \private\200159c0\install\shortcut2_2001fdbb\hsps\00\widgetconfiguration.xml + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __SHORTCUT2_2001FDBB_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/00/shortcut2.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/00/shortcut2.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,123 @@ +widget#shortcutPlugin2 +{ + width: auto; + height: 70px; + + block-progression: rl; + direction: ltr; +} + +button.shortcutButton +{ + width: 70px; + height: auto; + + nav-index: appearance; + + margin-left: 4px; + margin-right: 4px; + + background-color: "SKIN(268458534 9906)"; +} + +button#shortcutButton7 +{ + margin-left: 0px; +} + +button#shortcutButton12 +{ + margin-right: 0px; +} + +button.shortcutButton:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image.shortcutIcon +{ + width: auto; + height: auto; + + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 430px; + height: 5.5u; + + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 8px; + padding-right: 8px; +} + + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + +/********************* + xSP +**********************/ +tooltip.shortcutTooltipXsp +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; + _s60-position-hint: aboveleft; +} + +text.shortcutTextCaptionXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.shortcutTextXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/00/shortcut2.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/00/shortcut2.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,11 @@ + + + 2001CB4F + 101FB657 + 11001552 + Shortcut2 + shortcut2 + 1.0 + shortcut2.xml + shortcut2.css + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/00/shortcut2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/00/shortcut2.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,349 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/37/shortcut2.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/37/shortcut2.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,122 @@ +widget#shortcutPlugin2 +{ + width: auto; + height: 70px; + + block-progression: rl; + direction: rtl; +} + +button.shortcutButton +{ + width: 70px; + height: auto; + + nav-index: appearance; + + margin-left: 4px; + margin-right: 4px; + + background-color: "SKIN(268458534 9906)"; +} + +button#shortcutButton7 +{ + margin-left: 0px; +} + +button#shortcutButton12 +{ + margin-right: 0px; +} + +button.shortcutButton:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image.shortcutIcon +{ + width: auto; + height: auto; + + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 430px; + height: 5.5u; + + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 8px; + padding-right: 8px; +} + + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + +/********************* + xSP +**********************/ +tooltip.shortcutTooltipXsp +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.shortcutTextCaptionXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.shortcutTextXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/50/shortcut2.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/50/shortcut2.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,122 @@ +widget#shortcutPlugin2 +{ + width: auto; + height: 70px; + + block-progression: rl; + direction: rtl; +} + +button.shortcutButton +{ + width: 70px; + height: auto; + + nav-index: appearance; + + margin-left: 4px; + margin-right: 4px; + + background-color: "SKIN(268458534 9906)"; +} + +button#shortcutButton7 +{ + margin-left: 0px; +} + +button#shortcutButton12 +{ + margin-right: 0px; +} + +button.shortcutButton:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image.shortcutIcon +{ + width: auto; + height: auto; + + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 430px; + height: 5.5u; + + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 8px; + padding-right: 8px; +} + + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + +/********************* + xSP +**********************/ +tooltip.shortcutTooltipXsp +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.shortcutTextCaptionXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.shortcutTextXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/57/shortcut2.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/57/shortcut2.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,122 @@ +widget#shortcutPlugin2 +{ + width: auto; + height: 70px; + + block-progression: rl; + direction: rtl; +} + +button.shortcutButton +{ + width: 70px; + height: auto; + + nav-index: appearance; + + margin-left: 4px; + margin-right: 4px; + + background-color: "SKIN(268458534 9906)"; +} + +button#shortcutButton7 +{ + margin-left: 0px; +} + +button#shortcutButton12 +{ + margin-right: 0px; +} + +button.shortcutButton:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image.shortcutIcon +{ + width: auto; + height: auto; + + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 430px; + height: 5.5u; + + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 8px; + padding-right: 8px; +} + + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + +/********************* + xSP +**********************/ +tooltip.shortcutTooltipXsp +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.shortcutTextCaptionXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.shortcutTextXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/94/shortcut2.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/94/shortcut2.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,122 @@ +widget#shortcutPlugin2 +{ + width: auto; + height: 70px; + + block-progression: rl; + direction: rtl; +} + +button.shortcutButton +{ + width: 70px; + height: auto; + + nav-index: appearance; + + margin-left: 4px; + margin-right: 4px; + + background-color: "SKIN(268458534 9906)"; +} + +button#shortcutButton7 +{ + margin-left: 0px; +} + +button#shortcutButton12 +{ + margin-right: 0px; +} + +button.shortcutButton:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image.shortcutIcon +{ + width: auto; + height: auto; + + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 430px; + height: 5.5u; + + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 8px; + padding-right: 8px; +} + + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + +/********************* + xSP +**********************/ +tooltip.shortcutTooltipXsp +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.shortcutTextCaptionXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.shortcutTextXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The information required for building +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// Support for productization and Carbide.Ui customization +//******************************************************** +../hsps/00/manifest.dat /epoc32/data/z/resource/homescreen/shortcut_2001f490/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/z/resource/homescreen/shortcut_2001f490/hsps/widgetconfiguration.xml +../hsps/00/shortcutconfiguration.dtd /epoc32/data/z/resource/homescreen/shortcut_2001f490/hsps/shortcutconfiguration.dtd + +../xuikon/00/shortcut.dtd /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/shortcut.dtd +../xuikon/00/shortcut.dat /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/shortcut_2001f490.dat +../xuikon/00/shortcut.css /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/shortcut.css +../xuikon/00/shortcut.xml /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/shortcut.xml + +// Arabic languages +//***************** +../xuikon/37/shortcut.css /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/37/shortcut.css +../xuikon/50/shortcut.css /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/50/shortcut.css +../xuikon/57/shortcut.css /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/57/shortcut.css +../xuikon/94/shortcut.css /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/94/shortcut.css + + +// Support for S60 localization +//***************************** +#ifndef __SHORTCUTCONFIGURATION_LOC__ +#define __SHORTCUTCONFIGURATION_LOC__ +../loc/shortcutconfiguration.loc APP_LAYER_LOC_EXPORT_PATH(shortcutconfiguration.loc) +#endif // __SHORTCUTCONFIGURATION_LOC__ + +// Support for S60 builds +//*********************** +../rom/shortcut_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f490_resources.iby) +../rom/shortcut_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f490_customer.iby) +../rom/shortcut_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f490_variant.iby) +../rom/shortcut.iby CORE_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f490.iby) + + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME shortcut_2001f490 +OPTION DTD_TYPE widget +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,32 @@ + + + + vga_tch + + widget + + + 0x2001f48a + + + 0x101fb657 + + + 0x2001f490 + + + &qtn_hs_sc1_widget; + sc + 1.0 + + + widgetconfiguration.xml + + + shortcutconfiguration.dtd + + + + shortcut.o0000 + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/hsps/00/shortcutconfiguration.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/hsps/00/shortcutconfiguration.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,32 @@ + + + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,5 @@ + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/loc/Shortcut.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/loc/Shortcut.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for Shortcut1 widget (Xuikon) +* +*/ + + +// d: Shortcuts +// l: ai_gene_pane_1_t1 +// w: +// r: TB9.1 +#define qtn_hs_sc2_widget "Shortcuts 2" + +// d: Open +// l: control_pane_t1/opt7 +// w: +// r: TB9.1 +#define qtn_msk_open "Open" \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/loc/shortcutconfiguration.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/loc/shortcutconfiguration.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for Shortcut1 plugin configuration (HSPS) +* +*/ + + +// d: Shortcuts +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_shortcut1_configuration_name "Shortcut 1" diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: Shortcut widget HSPS-plugin IBY file. +* +*/ + + +#ifndef __SHORTCUT_2001F490_IBY__ +#define __SHORTCUT_2001F490_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\shortcut_2001f490\hsps\00\manifest.dat \private\200159c0\install\shortcut_2001f490\hsps\00\manifest.dat + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __SHORTCUT_2001F490_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Shortcut widget HSPS-plugin language specific IBY file. +* +*/ + + +#ifndef __SHORTCUT_2001F490_CUSTOMER_IBY__ +#define __SHORTCUT_2001F490_CUSTOMER_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\shortcut_2001f490\xuikon\00\shortcut.o0000 \private\200159c0\install\shortcut_2001f490\xuikon\00\shortcut.o0000 +data=ZPRIVATE\200159c0\install\shortcut_2001f490\hsps\00\shortcutconfiguration.dtd \private\200159c0\install\shortcut_2001f490\hsps\00\shortcutconfiguration.dtd + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __SHORTCUT_2001F490_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Shortcut widget HSPS-plugin language specific IBY file. +* +*/ + + +#ifndef __SHORTCUT_2001F490_RESOURCES_IBY__ +#define __SHORTCUT_2001F490_RESOURCES_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\shortcut_2001f490\xuikon\00\shortcut.o0000 \private\200159c0\install\shortcut_2001f490\xuikon\00\shortcut.o0000 +data=ZPRIVATE\200159c0\install\shortcut_2001f490\hsps\00\shortcutconfiguration.dtd \private\200159c0\install\shortcut_2001f490\hsps\00\shortcutconfiguration.dtd + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __SHORTCUT_2001F490_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: Shortcut widget HSPS-plugin variant specific IBY file. +* +*/ + + +#ifndef __SHORTCUT_2001F490_VARIANT_IBY__ +#define __SHORTCUT_2001F490_VARIANT_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\shortcut_2001f490\hsps\00\widgetconfiguration.xml \private\200159c0\install\shortcut_2001f490\hsps\00\widgetconfiguration.xml + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __SHORTCUT_2001F490_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,123 @@ +widget#shortcutPlugin +{ + width: auto; + height: 70px; + + block-progression: rl; + direction: ltr; +} + +button.shortcutButton +{ + width: 70px; + height: auto; + + nav-index: appearance; + + margin-left: 4px; + margin-right: 4px; + + background-color: "SKIN(268458534 9906)"; +} + +button#shortcutButton1 +{ + margin-left: 0px; +} + +button#shortcutButton6 +{ + margin-right: 0px; +} + +button.shortcutButton:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image.shortcutIcon +{ + width: auto; + height: auto; + + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 430px; + height: 5.5u; + + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 8px; + padding-right: 8px; +} + + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + +/********************* + xSP +**********************/ +tooltip.shortcutTooltipXsp +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; + _s60-position-hint: aboveleft; +} + +text.shortcutTextCaptionXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.shortcutTextXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + 2001CB4F + 101FB657 + 11001551 + Shortcut + shortcut + 1.0 + shortcut.xml + shortcut.css + shortcut.dtd + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,41 @@ + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/37/Shortcut.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/37/Shortcut.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,122 @@ +widget#shortcutPlugin +{ + width: auto; + height: 70px; + + block-progression: rl; + direction: rtl; +} + +button.shortcutButton +{ + width: 70px; + height: auto; + + nav-index: appearance; + + margin-left: 4px; + margin-right: 4px; + + background-color: "SKIN(268458534 9906)"; +} + +button#shortcutButton1 +{ + margin-left: 0px; +} + +button#shortcutButton6 +{ + margin-right: 0px; +} + +button.shortcutButton:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image.shortcutIcon +{ + width: auto; + height: auto; + + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 430px; + height: 5.5u; + + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 8px; + padding-right: 8px; +} + + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + +/********************* + xSP +**********************/ +tooltip.shortcutTooltipXsp +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.shortcutTextCaptionXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.shortcutTextXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/50/Shortcut.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/50/Shortcut.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,122 @@ +widget#shortcutPlugin +{ + width: auto; + height: 70px; + + block-progression: rl; + direction: rtl; +} + +button.shortcutButton +{ + width: 70px; + height: auto; + + nav-index: appearance; + + margin-left: 4px; + margin-right: 4px; + + background-color: "SKIN(268458534 9906)"; +} + +button#shortcutButton1 +{ + margin-left: 0px; +} + +button#shortcutButton6 +{ + margin-right: 0px; +} + +button.shortcutButton:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image.shortcutIcon +{ + width: auto; + height: auto; + + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 430px; + height: 5.5u; + + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 8px; + padding-right: 8px; +} + + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + +/********************* + xSP +**********************/ +tooltip.shortcutTooltipXsp +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.shortcutTextCaptionXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.shortcutTextXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/57/Shortcut.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/57/Shortcut.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,122 @@ +widget#shortcutPlugin +{ + width: auto; + height: 70px; + + block-progression: rl; + direction: rtl; +} + +button.shortcutButton +{ + width: 70px; + height: auto; + + nav-index: appearance; + + margin-left: 4px; + margin-right: 4px; + + background-color: "SKIN(268458534 9906)"; +} + +button#shortcutButton1 +{ + margin-left: 0px; +} + +button#shortcutButton6 +{ + margin-right: 0px; +} + +button.shortcutButton:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image.shortcutIcon +{ + width: auto; + height: auto; + + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 430px; + height: 5.5u; + + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 8px; + padding-right: 8px; +} + + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + +/********************* + xSP +**********************/ +tooltip.shortcutTooltipXsp +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.shortcutTextCaptionXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.shortcutTextXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/94/Shortcut.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/94/Shortcut.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,122 @@ +widget#shortcutPlugin +{ + width: auto; + height: 70px; + + block-progression: rl; + direction: rtl; +} + +button.shortcutButton +{ + width: 70px; + height: auto; + + nav-index: appearance; + + margin-left: 4px; + margin-right: 4px; + + background-color: "SKIN(268458534 9906)"; +} + +button#shortcutButton1 +{ + margin-left: 0px; +} + +button#shortcutButton6 +{ + margin-right: 0px; +} + +button.shortcutButton:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image.shortcutIcon +{ + width: auto; + height: auto; + + _s60-aspect-ratio: preserve; +} + +tooltip.shortcutTooltip +{ + width: adaptive; + max-width: 430px; + height: 5.5u; + + border-style: solid; + border-width: 5px; + + _s60-start-delay: 1000000; + _s60-display-time: 1000000; + + background-color:"SKIN(268458534 8480)"; + display: block; + padding-left: 8px; + padding-right: 8px; +} + + +text.shortcutTooltipText +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 23px; + width: adaptive; + color: "SKIN(268458534 13056 19)"; +} + +/********************* + xSP +**********************/ +tooltip.shortcutTooltipXsp +{ + width: 15.0u; + height: adaptive; + border-style: solid; + border-width: 5px; + /* delay comes from the xSP server */ + _s60-start-delay: 0; + _s60-display-time: 60000000; /* 6 sec */ + background-color:"SKIN(268458534 8480)"; + overflow: visible; + display: none; + block-progression: tb; + padding-bottom: 1u; + padding-right: 2u; + padding-left: 2u; + padding-top: 1u; +} + +text.shortcutTextCaptionXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + font-weight: bold; + text-align: center; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} + +text.shortcutTextXsp +{ + position: static; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + text-align: left; + width: 30u; + height: 5u; + color: "SKIN(268458534 13056 19)"; + overflow: visible; + display: block; + visibility:visible; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,64 @@ +/* +* 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/single_row_icon_widget_2001fdc0/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/single_row_icon_widget_2001fdc0/hsps/widgetconfiguration.xml + +../xuikon/00/single_row_icon_widget.dat /epoc32/data/Z/resource/homescreen/single_row_icon_widget_2001fdc0/xuikon/single_row_icon_widget_2001fdc0.dat +../xuikon/00/single_row_icon_widget.css /epoc32/data/Z/resource/homescreen/single_row_icon_widget_2001fdc0/xuikon/single_row_icon_widget.css +../xuikon/00/single_row_icon_widget.xml /epoc32/data/Z/resource/homescreen/single_row_icon_widget_2001fdc0/xuikon/single_row_icon_widget.xml + +// Arabic languages +//***************** +../xuikon/37/single_row_icon_widget.css /epoc32/data/Z/resource/homescreen/single_row_icon_widget_2001fdc0/xuikon/37/single_row_icon_widget.css +../xuikon/50/single_row_icon_widget.css /epoc32/data/Z/resource/homescreen/single_row_icon_widget_2001fdc0/xuikon/50/single_row_icon_widget.css +../xuikon/57/single_row_icon_widget.css /epoc32/data/Z/resource/homescreen/single_row_icon_widget_2001fdc0/xuikon/57/single_row_icon_widget.css +../xuikon/94/single_row_icon_widget.css /epoc32/data/Z/resource/homescreen/single_row_icon_widget_2001fdc0/xuikon/94/single_row_icon_widget.css + + +// Support for S60 builds +//*********************** +../rom/single_row_icon_widget_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(single_row_icon_widget_2001fdc0_resources.iby) +../rom/single_row_icon_widget_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(single_row_icon_widget_2001fdc0_customer.iby) +../rom/single_row_icon_widget_variant.iby CUSTOMER_VARIANT_APP_LAYER_IBY_EXPORT_PATH(single_row_icon_widget_2001fdc0_variant.iby) +../rom/single_row_icon_widget.iby CORE_APP_LAYER_IBY_EXPORT_PATH(single_row_icon_widget_2001fdc0.iby) + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME single_row_icon_widget_2001fdc0 +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + + +PRJ_TESTMMPFILES + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,32 @@ + + + + vga_tch + + template + + + 0x2001f48a + + + 0x101fb657 + + + 0x2001fdc0 + + + single_row_icon_widget + single_r_icon + 1.0 + + + widgetconfiguration.xml + + + + + + single_row_icon_widget.o0000 + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/rom/single_row_icon_widget.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/rom/single_row_icon_widget.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* 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: IBY file for Homescreen's single_row_icon_widget_2001fdc0. +* +*/ + + +#ifndef __SINGLE_ROW_WIDGET_2001FDC0_IBY__ +#define __SINGLE_ROW_WIDGET_2001FDC0_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\single_row_icon_widget_2001fdc0\hsps\00\manifest.dat \private\200159c0\install\single_row_icon_widget_2001fdc0\hsps\00\manifest.dat + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) +#endif // __SINGLE_ROW_WIDGET_2001FDC0_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/rom/single_row_icon_widget_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/rom/single_row_icon_widget_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: IBY file for Homescreen's single_row_icon_widget_2001fdc0. +* +*/ + + +#ifndef __SINGLE_ROW_WIDGET_2001FDC0_CUSTOMER_IBY__ +#define __SINGLE_ROW_WIDGET_2001FDC0_CUSTOMER_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\single_row_icon_widget_2001fdc0\xuikon\00\single_row_icon_widget.o0000 \private\200159c0\install\single_row_icon_widget_2001fdc0\xuikon\00\single_row_icon_widget.o0000 + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __SINGLE_ROW_WIDGET_2001FDC0_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/rom/single_row_icon_widget_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/rom/single_row_icon_widget_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +/* +* 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: IBY file for Homescreen's single_row_icon_widget_2001fdc0. +* +*/ + +#ifndef __SINGLE_ROW_WIDGET_2001FDC0_RESOURCES_IBY__ +#define __SINGLE_ROW_WIDGET_2001FDC0_RESOURCES_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\single_row_icon_widget_2001fdc0\xuikon\37\single_row_icon_widget.o0037 \private\200159c0\install\single_row_icon_widget_2001fdc0\xuikon\37\single_row_icon_widget.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\single_row_icon_widget_2001fdc0\xuikon\50\single_row_icon_widget.o0050 \private\200159c0\install\single_row_icon_widget_2001fdc0\xuikon\50\single_row_icon_widget.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\single_row_icon_widget_2001fdc0\xuikon\57\single_row_icon_widget.o0057 \private\200159c0\install\single_row_icon_widget_2001fdc0\xuikon\57\single_row_icon_widget.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\single_row_icon_widget_2001fdc0\xuikon\94\single_row_icon_widget.o0094 \private\200159c0\install\single_row_icon_widget_2001fdc0\xuikon\94\single_row_icon_widget.o0094 +#endif + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __SINGLE_ROW_WIDGET_2001FDC0_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/rom/single_row_icon_widget_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/rom/single_row_icon_widget_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: IBY file for Homescreen's single_row_icon_widget_2001fdc0. +* +*/ + + +#ifndef __SINGLE_ROW_WIDGET_2001FDC0_VARIANT_IBY__ +#define __SINGLE_ROW_WIDGET_2001FDC0_VARIANT_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\single_row_icon_widget_2001fdc0\hsps\00\widgetconfiguration.xml \private\200159c0\install\single_row_icon_widget_2001fdc0\hsps\00\widgetconfiguration.xml + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __SINGLE_ROW_WIDGET_2001FDC0_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/00/single_row_icon_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/00/single_row_icon_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ +widget{ + width:auto; + height:30px; + } +box#single_row_icon_widget{ + direction: ltr; + block-progression:tb; + nav-index:appearance; +} +box#single_row_icon_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box.row{ + direction: ltr; + block-progression:rl; + padding-left : 10px; + padding-right : 10px; + padding-top : 2px; + padding-bottom: 2px; +} + +box#single_rc_image1_box +{ + height:auto; + width:20px; + direction: ltr; +} + +box#single_rc_text1_box +{ + padding-left : 10px; + direction: ltr; + width:auto; + height:20px; +} + +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: ltr; + block-progression:tb; + text-align:left; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + +image +{ + _s60-aspect-ratio:preserve; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/00/single_row_icon_widget.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/00/single_row_icon_widget.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + 2001CB4F + 101FB657 + 110012F6 + single_row_icon_widget + single_row_icon_widget + 1.0 + single_row_icon_widget.xml + single_row_icon_widget.css + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/00/single_row_icon_widget.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/00/single_row_icon_widget.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/37/single_row_icon_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/37/single_row_icon_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ +widget{ + width:auto; + height:30px; + } +box#single_row_icon_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#single_row_icon_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box.row{ + direction: rtl; + block-progression:rl; + padding-left : 10px; + padding-right : 10px; + padding-top : 2px; + padding-bottom: 2px; +} + +box#single_rc_image1_box +{ + height:auto; + width:20px; + direction: ltr; +} + +box#single_rc_text1_box +{ + padding-left : 10px; + direction: rtl; + width:auto; + height:20px; +} + +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + +image +{ + _s60-aspect-ratio:preserve; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/50/single_row_icon_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/50/single_row_icon_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ +widget{ + width:auto; + height:30px; + } +box#single_row_icon_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#single_row_icon_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box.row{ + direction: rtl; + block-progression:rl; + padding-left : 10px; + padding-right : 10px; + padding-top : 2px; + padding-bottom: 2px; +} + +box#single_rc_image1_box +{ + height:auto; + width:20px; + direction: ltr; +} + +box#single_rc_text1_box +{ + padding-left : 10px; + direction: rtl; + width:auto; + height:20px; +} + +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + +image +{ + _s60-aspect-ratio:preserve; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/57/single_row_icon_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/57/single_row_icon_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ +widget{ + width:auto; + height:30px; + } +box#single_row_icon_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#single_row_icon_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box.row{ + direction: rtl; + block-progression:rl; + padding-left : 10px; + padding-right : 10px; + padding-top : 2px; + padding-bottom: 2px; +} + +box#single_rc_image1_box +{ + height:auto; + width:20px; + direction: ltr; +} + +box#single_rc_text1_box +{ + padding-left : 10px; + direction: rtl; + width:auto; + height:20px; +} + +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + +image +{ + _s60-aspect-ratio:preserve; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/94/single_row_icon_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/94/single_row_icon_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ +widget{ + width:auto; + height:30px; + } +box#single_row_icon_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#single_row_icon_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box.row{ + direction: rtl; + block-progression:rl; + padding-left : 10px; + padding-right : 10px; + padding-top : 2px; + padding-bottom: 2px; +} + +box#single_rc_image1_box +{ + height:auto; + width:20px; + direction: ltr; +} + +box#single_rc_text1_box +{ + padding-left : 10px; + direction: rtl; + width:auto; + height:20px; +} + +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + +image +{ + _s60-aspect-ratio:preserve; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,65 @@ +/* +* 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/single_row_widget_2001fdc1/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/single_row_widget_2001fdc1/hsps/widgetconfiguration.xml + +../xuikon/00/single_row_widget.dat /epoc32/data/Z/resource/homescreen/single_row_widget_2001fdc1/xuikon/single_row_widget_2001fdc1.dat +../xuikon/00/single_row_widget.css /epoc32/data/Z/resource/homescreen/single_row_widget_2001fdc1/xuikon/single_row_widget.css +../xuikon/00/single_row_widget.xml /epoc32/data/Z/resource/homescreen/single_row_widget_2001fdc1/xuikon/single_row_widget.xml + +// Arabic languages +//***************** +../xuikon/37/single_row_widget.css /epoc32/data/Z/resource/homescreen/single_row_widget_2001fdc1/xuikon/37/single_row_widget.css +../xuikon/50/single_row_widget.css /epoc32/data/Z/resource/homescreen/single_row_widget_2001fdc1/xuikon/50/single_row_widget.css +../xuikon/57/single_row_widget.css /epoc32/data/Z/resource/homescreen/single_row_widget_2001fdc1/xuikon/57/single_row_widget.css +../xuikon/94/single_row_widget.css /epoc32/data/Z/resource/homescreen/single_row_widget_2001fdc1/xuikon/94/single_row_widget.css + + +// Support for S60 builds +//*********************** +../rom/single_row_widget_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(single_row_widget_2001fdc1_resources.iby) +../rom/single_row_widget_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(single_row_widget_2001fdc1_customer.iby) +../rom/single_row_widget_variant.iby CUSTOMER_VARIANT_APP_LAYER_IBY_EXPORT_PATH(single_row_widget_2001fdc1_variant.iby) +../rom/single_row_widget.iby CORE_APP_LAYER_IBY_EXPORT_PATH(single_row_widget_2001fdc1.iby) + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME single_row_widget_2001fdc1 +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + + +PRJ_TESTMMPFILES + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,32 @@ + + + + vga_tch + + template + + + 0x2001f48a + + + 0x101fb657 + + + 0x2001fdc1 + + + single_row_widget + single_r + 1.0 + + + widgetconfiguration.xml + + + + + + single_row_widget.o0000 + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/rom/single_row_widget.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/rom/single_row_widget.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: IBY file for Homescreen's single_row_widget_2001fdc1. +* +*/ + + +#ifndef __SINGLE_ROW_WIDGET_2001FDC1_IBY__ +#define __SINGLE_ROW_WIDGET_2001FDC1_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\single_row_widget_2001fdc1\hsps\00\manifest.dat \private\200159c0\install\single_row_widget_2001fdc1\hsps\00\manifest.dat + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __SINGLE_ROW_WIDGET_2001FDC1_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/rom/single_row_widget_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/rom/single_row_widget_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: IBY file for Homescreen's single_row_widget_2001fdc1. +* +*/ + + +#ifndef __SINGLE_ROW_WIDGET_2001FDC1_CUSTOMER_IBY__ +#define __SINGLE_ROW_WIDGET_2001FDC1_CUSTOMER_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\single_row_widget_2001fdc1\xuikon\00\single_row_widget.o0000 \private\200159c0\install\single_row_widget_2001fdc1\xuikon\00\single_row_widget.o0000 + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __SINGLE_ROW_WIDGET_2001FDC1_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/rom/single_row_widget_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/rom/single_row_widget_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +/* +* 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: IBY file for Homescreen's single_row_widget_2001fdc1. +* +*/ + +#ifndef __SINGLE_ROW_WIDGET_2001FDC1_RESOURCES_IBY__ +#define __SINGLE_ROW_WIDGET_2001FDC1_RESOURCES_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\single_row_widget_2001fdc1\xuikon\37\single_row_widget.o0037 \private\200159c0\install\single_row_widget_2001fdc1\xuikon\37\single_row_widget.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\single_row_widget_2001fdc1\xuikon\50\single_row_widget.o0050 \private\200159c0\install\single_row_widget_2001fdc1\xuikon\50\single_row_widget.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\single_row_widget_2001fdc1\xuikon\57\single_row_widget.o0057 \private\200159c0\install\single_row_widget_2001fdc1\xuikon\57\single_row_widget.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\single_row_widget_2001fdc1\xuikon\94\single_row_widget.o0094 \private\200159c0\install\single_row_widget_2001fdc1\xuikon\94\single_row_widget.o0094 +#endif + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __SINGLE_ROW_WIDGET_2001FDC1_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/rom/single_row_widget_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/rom/single_row_widget_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: IBY file for Homescreen's single_row_widget_2001fdc1. +* +*/ + + +#ifndef __SINGLE_ROW_WIDGET_2001FDC1_VARIANT_IBY__ +#define __SINGLE_ROW_WIDGET_2001FDC1_VARIANT_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\single_row_widget_2001fdc1\hsps\00\widgetconfiguration.xml \private\200159c0\install\single_row_widget_2001fdc1\hsps\00\widgetconfiguration.xml + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __SINGLE_ROW_WIDGET_2001FDC1_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/00/single_row_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/00/single_row_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,38 @@ +widget{ + width:auto; + height:30px; + } +box#single_row_widget{ + direction: ltr; + block-progression:tb; + nav-index:appearance; +} +box#single_row_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} +box#single_text_box +{ + padding-top : 2px; + padding-bottom: 2px; + padding-left : 10px; + padding-right : 10px; + direction: ltr; +} +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: ltr; + block-progression:tb; + text-align:left; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/00/single_row_widget.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/00/single_row_widget.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + 2001CB4F + 101FB657 + 110012F6 + single_row_widget + single_row_widget + 1.0 + single_row_widget.xml + single_row_widget.css + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/00/single_row_widget.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/00/single_row_widget.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/37/single_row_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/37/single_row_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,38 @@ +widget{ + width:auto; + height:30px; + } +box#single_row_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#single_row_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} +box#single_text_box +{ + padding-top : 2px; + padding-bottom: 2px; + padding-left : 10px; + padding-right : 10px; + direction: ltr; +} +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/50/single_row_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/50/single_row_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,38 @@ +widget{ + width:auto; + height:30px; + } +box#single_row_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#single_row_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} +box#single_text_box +{ + padding-top : 2px; + padding-bottom: 2px; + padding-left : 10px; + padding-right : 10px; + direction: ltr; +} +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/57/single_row_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/57/single_row_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,38 @@ +widget{ + width:auto; + height:30px; + } +box#single_row_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#single_row_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} +box#single_text_box +{ + padding-top : 2px; + padding-bottom: 2px; + padding-left : 10px; + padding-right : 10px; + direction: ltr; +} +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/94/single_row_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/94/single_row_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,38 @@ +widget{ + width:auto; + height:30px; + } +box#single_row_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#single_row_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} +box#single_text_box +{ + padding-top : 2px; + padding-bottom: 2px; + padding-left : 10px; + padding-right : 10px; + direction: ltr; +} +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,63 @@ +/* +* 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/triple_row_icon_widget_2001fdbe/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/triple_row_icon_widget_2001fdbe/hsps/widgetconfiguration.xml + +../xuikon/00/triple_row_icon_widget.dat /epoc32/data/Z/resource/homescreen/triple_row_icon_widget_2001fdbe/xuikon/triple_row_icon_widget_2001fdbe.dat +../xuikon/00/triple_row_icon_widget.css /epoc32/data/Z/resource/homescreen/triple_row_icon_widget_2001fdbe/xuikon/triple_row_icon_widget.css +../xuikon/00/triple_row_icon_widget.xml /epoc32/data/Z/resource/homescreen/triple_row_icon_widget_2001fdbe/xuikon/triple_row_icon_widget.xml + +// Arabic languages +//***************** +../xuikon/37/triple_row_icon_widget.css /epoc32/data/Z/resource/homescreen/triple_row_icon_widget_2001fdbe/xuikon/37/triple_row_icon_widget.css +../xuikon/50/triple_row_icon_widget.css /epoc32/data/Z/resource/homescreen/triple_row_icon_widget_2001fdbe/xuikon/50/triple_row_icon_widget.css +../xuikon/57/triple_row_icon_widget.css /epoc32/data/Z/resource/homescreen/triple_row_icon_widget_2001fdbe/xuikon/57/triple_row_icon_widget.css +../xuikon/94/triple_row_icon_widget.css /epoc32/data/Z/resource/homescreen/triple_row_icon_widget_2001fdbe/xuikon/94/triple_row_icon_widget.css + + +// Support for S60 builds +//*********************** +../rom/triple_row_icon_widget_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(triple_row_icon_widget_2001fdbe_resources.iby) +../rom/triple_row_icon_widget_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(triple_row_icon_widget_2001fdbe_customer.iby) +../rom/triple_row_icon_widget_variant.iby CUSTOMER_VARIANT_APP_LAYER_IBY_EXPORT_PATH(triple_row_icon_widget_2001fdbe_variant.iby) +../rom/triple_row_icon_widget.iby CORE_APP_LAYER_IBY_EXPORT_PATH(triple_row_icon_widget_2001fdbe.iby) + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME triple_row_icon_widget_2001fdbe +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,32 @@ + + + + vga_tch + + template + + + 0x2001f48a + + + 0x101fb657 + + + 0x2001FDBE + + + triple_row_icon_widget + triple_r_icon + 1.0 + + + widgetconfiguration.xml + + + + + + triple_row_icon_widget.o0000 + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/rom/triple_row_icon_widget.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/rom/triple_row_icon_widget.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: IBY file for Homescreen's triple_row_icon_widget_2001fdbe. +* +*/ + + +#ifndef __TRIPLE_ROW_ICON_WIDGET_2001FDBE_IBY__ +#define __TRIPLE_ROW_ICON_WIDGET_2001FDBE_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\triple_row_icon_widget_2001fdbe\hsps\00\manifest.dat \private\200159c0\install\triple_row_icon_widget_2001fdbe\hsps\00\manifest.dat + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __TRIPLE_ROW_ICON_WIDGET_2001FDBE_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/rom/triple_row_icon_widget_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/rom/triple_row_icon_widget_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: IBY file for Homescreen's triple_row_icon_widget_2001fdbe. +* +*/ + + +#ifndef __TRIPLE_ROW_ICON_WIDGET_2001FDBE_CUSTOMER_IBY__ +#define __TRIPLE_ROW_ICON_WIDGET_2001FDBE_CUSTOMER_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\triple_row_icon_widget_2001fdbe\xuikon\00\triple_row_icon_widget.o0000 \private\200159c0\install\triple_row_icon_widget_2001fdbe\xuikon\00\triple_row_icon_widget.o0000 + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __TRIPLE_ROW_ICON_WIDGET_2001FDBE_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/rom/triple_row_icon_widget_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/rom/triple_row_icon_widget_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +/* +* 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: IBY file for Homescreen's triple_row_icon_widget_2001fdbe. +* +*/ + +#ifndef __TRIPLE_ROW_ICON_WIDGET_2001FDBE_RESOURCES_IBY__ +#define __TRIPLE_ROW_ICON_WIDGET_2001FDBE_RESOURCES_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\triple_row_icon_widget_2001fdbe\xuikon\37\triple_row_icon_widget.o0037 \private\200159c0\install\triple_row_icon_widget_2001fdbe\xuikon\37\triple_row_icon_widget.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\triple_row_icon_widget_2001fdbe\xuikon\50\triple_row_icon_widget.o0050 \private\200159c0\install\triple_row_icon_widget_2001fdbe\xuikon\50\triple_row_icon_widget.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\triple_row_icon_widget_2001fdbe\xuikon\57\triple_row_icon_widget.o0057 \private\200159c0\install\triple_row_icon_widget_2001fdbe\xuikon\57\triple_row_icon_widget.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\triple_row_icon_widget_2001fdbe\xuikon\94\triple_row_icon_widget.o0094 \private\200159c0\install\triple_row_icon_widget_2001fdbe\xuikon\94\triple_row_icon_widget.o0094 +#endif + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __TRIPLE_ROW_ICON_WIDGET_2001FDBE_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/rom/triple_row_icon_widget_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/rom/triple_row_icon_widget_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: IBY file for Homescreen's triple_row_icon_widget_2001fdbe. +* +*/ + + +#ifndef __TRIPLE_ROW_ICON_WIDGET_2001FDBE_VARIANT_IBY__ +#define __TRIPLE_ROW_ICON_WIDGET_2001FDBE_VARIANT_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\triple_row_icon_widget_2001fdbe\hsps\00\widgetconfiguration.xml \private\200159c0\install\triple_row_icon_widget_2001fdbe\hsps\00\widgetconfiguration.xml + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __TRIPLE_ROW_ICON_WIDGET_2001FDBE_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/00/triple_row_icon_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/00/triple_row_icon_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,71 @@ +widget{ + width:auto; + height:90px; + } +box#triple_row_icon_widget{ + direction: ltr; + block-progression:tb; + nav-index:appearance; +} +box#triple_row_icon_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box.row{ + direction: ltr; + block-progression:rl; + padding-left : 10px; + padding-right : 10px; +} + +box#triple_rc_row1_box{ + padding-top : 2px; + padding-bottom: 2px; +} + +box#triple_rc_row2_box{ + padding-top : 2px; + padding-bottom: 2px; +} +box#triple_rc_row3_box{ + padding-top : 2px; + padding-bottom: 2px; +} + +box.imagebox +{ + height:auto; + width:20px; + direction: ltr; +} +box.textbox +{ + padding-left : 10px; + direction: ltr; + width:auto; + height:20px; +} + +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: ltr; + block-progression:tb; + text-align:left; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + +image +{ + _s60-aspect-ratio:preserve; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/00/triple_row_icon_widget.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/00/triple_row_icon_widget.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + 2001CB4F + 101FB657 + 110012F6 + triple_row_icon_widget + triple_row_icon_widget + 1.0 + triple_row_icon_widget.xml + triple_row_icon_widget.css + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/00/triple_row_icon_widget.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/00/triple_row_icon_widget.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/37/triple_row_icon_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/37/triple_row_icon_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,71 @@ +widget{ + width:auto; + height:90px; + } +box#triple_row_icon_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#triple_row_icon_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box.row{ + direction: rtl; + block-progression:rl; + padding-left : 10px; + padding-right : 10px; +} + +box#triple_rc_row1_box{ + padding-top : 2px; + padding-bottom: 2px; +} + +box#triple_rc_row2_box{ + padding-top : 2px; + padding-bottom: 2px; +} +box#triple_rc_row3_box{ + padding-top : 2px; + padding-bottom: 2px; +} + +box.imagebox +{ + height:auto; + width:20px; + direction: rtl; +} +box.textbox +{ + padding-left : 10px; + direction: rtl; + width:auto; + height:20px; +} + +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + +image +{ + _s60-aspect-ratio:preserve; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/50/triple_row_icon_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/50/triple_row_icon_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,71 @@ +widget{ + width:auto; + height:90px; + } +box#triple_row_icon_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#triple_row_icon_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box.row{ + direction: rtl; + block-progression:rl; + padding-left : 10px; + padding-right : 10px; +} + +box#triple_rc_row1_box{ + padding-top : 2px; + padding-bottom: 2px; +} + +box#triple_rc_row2_box{ + padding-top : 2px; + padding-bottom: 2px; +} +box#triple_rc_row3_box{ + padding-top : 2px; + padding-bottom: 2px; +} + +box.imagebox +{ + height:auto; + width:20px; + direction: rtl; +} +box.textbox +{ + padding-left : 10px; + direction: rtl; + width:auto; + height:20px; +} + +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + +image +{ + _s60-aspect-ratio:preserve; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/57/triple_row_icon_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/57/triple_row_icon_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,71 @@ +widget{ + width:auto; + height:90px; + } +box#triple_row_icon_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#triple_row_icon_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box.row{ + direction: rtl; + block-progression:rl; + padding-left : 10px; + padding-right : 10px; +} + +box#triple_rc_row1_box{ + padding-top : 2px; + padding-bottom: 2px; +} + +box#triple_rc_row2_box{ + padding-top : 2px; + padding-bottom: 2px; +} +box#triple_rc_row3_box{ + padding-top : 2px; + padding-bottom: 2px; +} + +box.imagebox +{ + height:auto; + width:20px; + direction: rtl; +} +box.textbox +{ + padding-left : 10px; + direction: rtl; + width:auto; + height:20px; +} + +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + +image +{ + _s60-aspect-ratio:preserve; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/94/triple_row_icon_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/94/triple_row_icon_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,71 @@ +widget{ + width:auto; + height:90px; + } +box#triple_row_icon_widget{ + direction: rtl; + block-progression:tb; + nav-index:appearance; +} +box#triple_row_icon_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box.row{ + direction: rtl; + block-progression:rl; + padding-left : 10px; + padding-right : 10px; +} + +box#triple_rc_row1_box{ + padding-top : 2px; + padding-bottom: 2px; +} + +box#triple_rc_row2_box{ + padding-top : 2px; + padding-bottom: 2px; +} +box#triple_rc_row3_box{ + padding-top : 2px; + padding-bottom: 2px; +} + +box.imagebox +{ + height:auto; + width:20px; + direction: rtl; +} +box.textbox +{ + padding-left : 10px; + direction: rtl; + width:auto; + height:20px; +} + +text +{ + width:auto; + height:auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression:tb; + text-align:right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} + +image +{ + _s60-aspect-ratio:preserve; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,64 @@ +/* +* 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/triple_row_widget_2001fdbf/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/triple_row_widget_2001fdbf/hsps/widgetconfiguration.xml + +../xuikon/00/triple_row_widget.dat /epoc32/data/Z/resource/homescreen/triple_row_widget_2001fdbf/xuikon/triple_row_widget_2001fdbf.dat +../xuikon/00/triple_row_widget.css /epoc32/data/Z/resource/homescreen/triple_row_widget_2001fdbf/xuikon/triple_row_widget.css +../xuikon/00/triple_row_widget.xml /epoc32/data/Z/resource/homescreen/triple_row_widget_2001fdbf/xuikon/triple_row_widget.xml + +// Arabic languages +//***************** +../xuikon/37/triple_row_widget.css /epoc32/data/Z/resource/homescreen/triple_row_widget_2001fdbf/xuikon/37/triple_row_widget.css +../xuikon/50/triple_row_widget.css /epoc32/data/Z/resource/homescreen/triple_row_widget_2001fdbf/xuikon/50/triple_row_widget.css +../xuikon/57/triple_row_widget.css /epoc32/data/Z/resource/homescreen/triple_row_widget_2001fdbf/xuikon/57/triple_row_widget.css +../xuikon/94/triple_row_widget.css /epoc32/data/Z/resource/homescreen/triple_row_widget_2001fdbf/xuikon/94/triple_row_widget.css + + +// Support for S60 builds +//*********************** +../rom/triple_row_widget_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(triple_row_widget_2001fdbf_resources.iby) +../rom/triple_row_widget_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(triple_row_widget_2001fdbf_customer.iby) +../rom/triple_row_widget_variant.iby CUSTOMER_VARIANT_APP_LAYER_IBY_EXPORT_PATH(triple_row_widget_2001fdbf_variant.iby) +../rom/triple_row_widget.iby CORE_APP_LAYER_IBY_EXPORT_PATH(triple_row_widget_2001fdbf.iby) + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME triple_row_widget_2001fdbf +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,33 @@ + + + + vga_tch + + template + + + 0x2001f48a + + + 0x101fb657 + + + 0x2001fdbf + + + triple_row_widget + triple_r + 1.0 + + + widgetconfiguration.xml + + + + + + + triple_row_widget.o0000 + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/rom/triple_row_widget.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/rom/triple_row_widget.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* 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: IBY file for Homescreen's triple_row_widget_2001fdbf. +* +*/ + +#ifndef __TRIPLE_ROW_WIDGET_2001FDBF_IBY__ +#define __TRIPLE_ROW_WIDGET_2001FDBF_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\triple_row_widget_2001fdbf\hsps\00\manifest.dat \private\200159c0\install\triple_row_widget_2001fdbf\hsps\00\manifest.dat + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __TRIPLE_ROW_WIDGET_2001FDBF_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/rom/triple_row_widget_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/rom/triple_row_widget_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* 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: IBY file for Homescreen's triple_row_widget_2001fdbf. +* +*/ + +#ifndef __TRIPLE_ROW_WIDGET_2001FDBF_CUSTOMER_IBY__ +#define __TRIPLE_ROW_WIDGET_2001FDBF_CUSTOMER_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\triple_row_widget_2001fdbf\xuikon\00\triple_row_widget_2001fdbf.o0000 \private\200159c0\install\triple_row_widget_2001fdbf\xuikon\00\triple_row_widget.o0000 + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __TRIPLE_ROW_WIDGET_2001FDBF_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/rom/triple_row_widget_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/rom/triple_row_widget_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +/* +* 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: IBY file for Homescreen's triple_row_widget_2001fdbf. +* +*/ + +#ifndef __TRIPLE_ROW_WIDGET_2001FDBF_RESOURCES_IBY__ +#define __TRIPLE_ROW_WIDGET_2001FDBF_RESOURCES_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +#if defined (__LOCALES_37_IBY__) +data=ZPRIVATE\200159c0\install\triple_row_widget_2001fdbf\xuikon\37\triple_row_widget.o0037 \private\200159c0\install\triple_row_widget_2001fdbf\xuikon\37\triple_row_widget.o0037 +#endif +#if defined (__LOCALES_50_IBY__) +data=ZPRIVATE\200159c0\install\triple_row_widget_2001fdbf\xuikon\50\triple_row_widget.o0050 \private\200159c0\install\triple_row_widget_2001fdbf\xuikon\50\triple_row_widget.o0050 +#endif +#if defined (__LOCALES_57_IBY__) +data=ZPRIVATE\200159c0\install\triple_row_widget_2001fdbf\xuikon\57\triple_row_widget.o0057 \private\200159c0\install\triple_row_widget_2001fdbf\xuikon\57\triple_row_widget.o0057 +#endif +#if defined (__LOCALES_94_IBY__) +data=ZPRIVATE\200159c0\install\triple_row_widget_2001fdbf\xuikon\94\triple_row_widget.o0094 \private\200159c0\install\triple_row_widget_2001fdbf\xuikon\94\triple_row_widget.o0094 +#endif + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __TRIPLE_ROW_WIDGET_2001FDBF_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/rom/triple_row_widget_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/rom/triple_row_widget_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* 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: IBY file for Homescreen's triple_row_widget_2001fdbf. +* +*/ + +#ifndef __TRIPLE_ROW_WIDGET_2001FDBF_VARIANT_IBY__ +#define __TRIPLE_ROW_WIDGET_2001FDBF_VARIANT_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\triple_row_widget_2001fdbf\hsps\00\widgetconfiguration.xml \private\200159c0\install\triple_row_widget_2001fdbf\hsps\00\widgetconfiguration.xml + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __TRIPLE_ROW_WIDGET_2001FDBF_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/00/triple_row_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/00/triple_row_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ +widget{ + width: auto; + height: 90px; + } +box#triple_row_widget{ + direction: ltr; + block-progression:tb; + nav-index: appearance; +} +box#triple_row_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} +box.triple_text_box{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 10px; + padding-right: 10px; + direction: ltr; +} + +text{ + width: auto; + height: auto; + display: block; + visibility: visible; + position: static; + direction: ltr; + block-progression: tb; + text-align: left; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/00/triple_row_widget.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/00/triple_row_widget.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + 2001CB4F + 101FB657 + 110012F6 + triple_row_widget + triple_row_widget + 1.0 + triple_row_widget.xml + triple_row_widget.css + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/00/triple_row_widget.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/00/triple_row_widget.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/37/triple_row_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/37/triple_row_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ +widget{ + width: auto; + height: 90px; + } +box#triple_row_widget{ + direction: rtl; + block-progression:tb; + nav-index: appearance; +} +box#triple_row_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} +box.triple_text_box{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 10px; + padding-right: 10px; + direction: ltr; +} + +text{ + width: auto; + height: auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression: tb; + text-align: right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/50/triple_row_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/50/triple_row_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ +widget{ + width: auto; + height: 90px; + } +box#triple_row_widget{ + direction: rtl; + block-progression:tb; + nav-index: appearance; +} +box#triple_row_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} +box.triple_text_box{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 10px; + padding-right: 10px; + direction: ltr; +} + +text{ + width: auto; + height: auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression: tb; + text-align: right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/57/triple_row_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/57/triple_row_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ +widget{ + width: auto; + height: 90px; + } +box#triple_row_widget{ + direction: rtl; + block-progression:tb; + nav-index: appearance; +} +box#triple_row_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} +box.triple_text_box{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 10px; + padding-right: 10px; + direction: ltr; +} + +text{ + width: auto; + height: auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression: tb; + text-align: right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/94/triple_row_widget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/94/triple_row_widget.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ +widget{ + width: auto; + height: 90px; + } +box#triple_row_widget{ + direction: rtl; + block-progression:tb; + nav-index: appearance; +} +box#triple_row_widget:focus{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} +box.triple_text_box{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 10px; + padding-right: 10px; + direction: ltr; +} + +text{ + width: auto; + height: auto; + display: block; + visibility: visible; + position: static; + direction: rtl; + block-progression: tb; + text-align: right; + font-family: EAknLogicalFontPrimaryFont; + font-size:18px; + color:white; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,77 @@ +/* +* 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/view1_2001fdb9/hsps/manifest.dat +../hsps/00/viewconfiguration.xml /epoc32/data/z/resource/homescreen/view1_2001fdb9/hsps/viewconfiguration.xml +//../hsps/00/viewconfiguration.dtd /epoc32/data/z/resource/homescreen/view1_2001fdb9/hsps/viewconfiguration.dtd + +../xuikon/00/view.dat /epoc32/data/z/resource/homescreen/view1_2001fdb9/xuikon/view1_2001fdb9.dat +../xuikon/00/view.xml /epoc32/data/z/resource/homescreen/view1_2001fdb9/xuikon/view.xml +../xuikon/00/view.dtd /epoc32/data/z/resource/homescreen/view1_2001fdb9/xuikon/view.dtd +../xuikon/00/view.css /epoc32/data/z/resource/homescreen/view1_2001fdb9/xuikon/view.css + +// Arabic languages +//***************** +../xuikon/37/view.css /epoc32/data/z/resource/homescreen/view1_2001fdb9/xuikon/37/view.css +../xuikon/50/view.css /epoc32/data/z/resource/homescreen/view1_2001fdb9/xuikon/50/view.css +../xuikon/57/view.css /epoc32/data/z/resource/homescreen/view1_2001fdb9/xuikon/57/view.css +../xuikon/94/view.css /epoc32/data/z/resource/homescreen/view1_2001fdb9/xuikon/94/view.css + + +// Support for S60 localization +//***************************** +//#ifndef __VIEWCONFIGURATION_LOC__ +//#define __VIEWCONFIGURATION_LOC__ +//../loc/viewconfiguration.loc APP_LAYER_LOC_EXPORT_PATH(viewconfiguration.loc) +//#endif // __VIEWCONFIGURATION_LOC__ + +#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(view1_2001fdb9_resources.iby) +../rom/view_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(view1_2001fdb9_customer.iby) +../rom/view_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(view1_2001fdb9_variant.iby) +../rom/view.iby CORE_APP_LAYER_IBY_EXPORT_PATH(view1_2001fdb9.iby) + + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME view1_2001fdb9 +OPTION DTD_TYPE widget +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,33 @@ + + + + vga_tch + + view + + + 0x2001f48a + + + 0x101fb657 + + + 0x2001fdb9 + + + View1 + ai3_nokia + 1.0 + + + viewconfiguration.xml + + + + + + + view.o0000 + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/hsps/00/viewconfiguration.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/hsps/00/viewconfiguration.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,27 @@ + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/hsps/00/viewconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/hsps/00/viewconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/loc/view.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/loc/view.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,250 @@ +/* +* 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: 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 qtn_hs_sk2_call "Call" diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/loc/viewconfiguration.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/loc/viewconfiguration.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,27 @@ +/* +* 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 View1 plugin configuration (HSPS) +* +*/ + + + +// d: AI3 View +// l: ai_gene_pane_1_t1 +// w: +// r: TB9.2 +//#define qtn_view_configuration_name "AI3 View" + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/rom/view.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/rom/view.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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_2001FDB9_IBY__ +#define __AI3VIEW_2001FDB9_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\view1_2001fdb9\hsps\00\manifest.dat \private\200159c0\install\view1_2001fdb9\hsps\00\manifest.dat + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __AI3VIEW_2001FDB9_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/rom/view_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/rom/view_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* 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_2001FDB9_CUSTOMER_IBY__ +#define __AI3VIEW_2001FDB9_CUSTOMER_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\view1_2001fdb9\xuikon\00\view.o0000 \private\200159c0\install\view1_2001fdb9\xuikon\00\view.o0000 +//data=ZPRIVATE\200159c0\install\view1_2001fdb9\hsps\00\viewconfiguration.dtd \private\200159c0\install\view1_2001fdb9\hsps\00\viewconfiguration.dtd + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __AI3VIEW_2001FDB9_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/rom/view_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/rom/view_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* 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_2001FDB9_RESOURCES_IBY__ +#define __AI3VIEW_2001FDB9_RESOURCES_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\view1_2001fdb9\xuikon\00\view.o0000 \private\200159c0\install\view1_2001fdb9\xuikon\00\view.o0000 +//data=ZPRIVATE\200159c0\install\view1_2001fdb9\hsps\00\viewconfiguration.dtd \private\200159c0\install\view1_2001fdb9\hsps\00\viewconfiguration.dtd + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __AI3VIEW_2001FDB9_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/rom/view_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/rom/view_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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_2001FDB9_VARIANT_IBY__ +#define __AI3VIEW_2001FDB9_VARIANT_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\view1_2001fdb9\hsps\00\viewconfiguration.xml \private\200159c0\install\view1_2001fdb9\hsps\00\viewconfiguration.xml + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __AI3VIEW_2001FDB9_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/00/view.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/00/view.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,337 @@ +view#homescreen +{ + position: static; + display: block; + + block-progression: tb; + direction: ltr; + + width: auto; + height: auto; + + background-image: wallpaper; + + _s60-status-pane-layout: widescreen-flat-3softkeys; +} + +box#main_container +{ + position: static; + display: block; + + width: auto; + height: auto; + + margin-top: 5px; + + /* These will be set by screendevicechange triggers: */ + /* landscape + ************ + margin-left: 5px; + margin-right: 5px;*/ + + /* portrait + *********** + margin-left: 17px; + margin-right: 17px;*/ +} + +box.sub_container +{ + position: absolute; + display: block; + + /* These will be set by screendevicechange triggers: */ + /* landscape + ************ + width: 184px; + height: 106px;*/ + + /* portrait + *********** + width: 223px; + height: 132px;*/ +} + +box#clock_container +{ + /* This box belongs to class="sub_container" */ + top: 0px; + left: 0px; +} + +clock#clock +{ + position: static; + display: block; + + margin-top: 3px; + margin-bottom: 3px; + margin-left: 3px; + margin-right: 3px; + + nav-index: appearance; + + background-color: "SKIN(268458534 9906)"; + color: "SKIN(268458534 13056 19)"; + + /* Face is format is fetched from locale */ + _s60-format: locale; + + /* These will be set by screendevicechange triggers: */ + /* landscape + ************ + _s60-ampm-font-size: 3.0u; + _s60-digital-font-size: 56px; + _s60-date-font-size: 3.0u;*/ + + /* portrait + *********** + _s60-ampm-font-size: 3.5u; + _s60-digital-font-size: 56px; + _s60-date-font-size: 3.5u;*/ +} + +clock#clock:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +box#profile_switcher_container +{ + block-progression: tb; + direction: ltr; + + /* These will be set by screendevicechange triggers: */ + /* landscape + ************ + top: 106px; + left: 0px;*/ + + /* portrait + *********** + top: 0px; + left: 223px;*/ +} + +box#profile +{ + position: static; + display: block; + + width: auto; + height: auto; + + margin-top: 3px; + margin-bottom: 6px; + margin-left: 3px; + margin-right: 3px; + + background-color: "SKIN(268458534 9906)"; + + nav-index: appearance; +} + +box#profile:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +/********************** + * MCN, CUG & Profile * + **********************/ +box#mcn_cug_profile_container +{ + width: auto; + height: auto; + + +} + +/************* + * SAT & VHZ * + *************/ +box#sat_vhz_container +{ + display: none; + width: auto; + height: auto; + block-progression: rl; +} + +image#sat_icon +{ + display: none; + visibility: hidden; + width: 18px; + height: 20px; + position: static; + margin-top: auto; +} + +title#sat +{ + display: none; +} +title#vhz +{ + display: none; +} + + +newsticker.statusindicator +{ + width: auto; + height: auto; + + text-align: center; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + color: "SKIN(268458534 13056 19)"; + + white-space-collapse: collapse; + + _s60-scroll-behaviour: alternate; + _s60-display-time: 2000; + _s60-scroll-loop: false; + _s60-start-delay: 0; + _s60-restart-after-update: true; +} + +box#switcher +{ + width: auto; + height: auto; + + block-progression: lr; + + margin-top: 6px; + margin-bottom: 3px; + margin-left: 3px; + margin-right: 3px; + + background-color: "SKIN(268458534 9906)"; + + nav-index: appearance; +} + +box#switcher:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +image#switcher_icon +{ + margin-top: auto; + margin-bottom: auto; + + margin-left: 5px; + height: 4u; + width: 4u; + + path: "SKIN(270501603 8585 19)"; +} + +text#switcher_text +{ + width: auto; + height: auto; + + text-align: left; + + font-size: 3.5u; + font-family: EAknLogicalFontSecondaryFont; + + color:"SKIN(268458534 13056 19)"; +} + +box#plugins_container +{ + position: absolute; + display: block; + + /* These will be set by screendevicechange triggers: */ + /* landscape + ************ + top: 0px; + left: 184px;*/ + + /* portrait + *********** + top: 129px; + left: 0px;*/ + + block-progression: tb; + direction: ltr; + + width: 440px; + height: auto; + + padding-left: 3px; + padding-right: 3px; +} + +/*********** + * Plugins * + ***********/ +plugin +{ + position: static; + + width: auto; + height: adaptive; + + margin-bottom: 6px; + + background-color: "SKIN(268458534 9906)"; + + nav-index: appearance; +} + +plugin:focus +{ + focus-background: "SKIN(268458534 5120 9)"; +} + +plugin:edit +{ + background-color: "SKIN(270501603 8582)"; +} + +/************ + * Profiles * + ************/ +/* Default system profiles */ +text.systemprofileitem +{ + display: block; +} + +/* Placeholders for profiles added by user */ +text.userprofileitem +{ + display: none; +} + +/************ + * Softkeys * + ************/ +softkey.normal_mode_sk +{ + display: block; +} + +softkey.normal_mode_sk:edit +{ + display: none; +} + +softkey.edit_mode_sk +{ + display: none; +} + +softkey.edit_mode_sk:edit +{ + display: block; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/00/view.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/00/view.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,13 @@ + + + E029CF57 + 101FB657 + 11001234 + Nokia + view + 1.0 + view.xml + view.css + view.dtd + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/00/view.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/00/view.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,391 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/00/view.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/00/view.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,933 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <property id="MCNIndicator" class="DeviceStatus/MCNIndicator" /> + + + <property id="CUGIndicator" class="DeviceStatus/CUGIndicator" /> + + + <property id="ActiveProfileIndicator" class="Profile/ActiveProfileNameAndIconChar" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <property id="VHZText" class="DeviceStatus/VHZText" /> + <property class="policy/emptyContent" name="vhz" value="display: none" /> + <property class="policy/Content" name="vhz" value="display: block" /> + <property class="policy/Visibility" name="sat_vhz_container" value="if (vhz,sat,sat_icon) display: block" /> + <property class="policy/Visibility" name="sat_vhz_container" value="if !+(vhz,sat,sat_icon) display: none" /> + + + <property id="Sat_SatIdleModeText" class="SAT/SatIdleModeText" /> + <property class="policy/emptyContent" name="sat" value="display: none" /> + <property class="policy/Content" name="sat" value="display: block" /> + <property class="policy/Visibility" name="sat_vhz_container" value="if (vhz,sat,sat_icon) display: block" /> + <property class="policy/Visibility" name="sat_vhz_container" value="if !+(vhz,sat,sat_icon) display: none" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + qtn_hs_profile_edit + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + &shortcut_emptycaption; + &text_softkey_back; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/37/view.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/37/view.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,547 @@ +view { + display: block; + position: static; + width: 100%; + height: 100%; + direction: rtl; + block-progression: tb; + background-image: wallpaper; + nav-index: appearance; + _s60-focus-visibility: true; + _s60-status-pane-layout: widescreen-flat-3softkeys; + +} + +trigger.western{ + display: none; +} + + +/** Softkeys **/ +softkey.normal_mode_sk +{ + display: block; +} + +softkey.normal_mode_sk:edit +{ + display: none; +} + +softkey.edit_mode_sk +{ + display: none; +} + +softkey.edit_mode_sk:edit +{ + display: block; +} + +/** General **/ + +plugin.widget_full_width{ + /* every plug-in decides its own height */ + height: adaptive; + background-color: "SKIN(268458534 9906)"; + background-size: 100%; + width: 100%; +/* padding-left: 1.7u; + padding-right: 1.7u;*/ + margin-bottom: 0.55u; + nav-index: auto; +} + +plugin.widget_full_width:focus { + focus-background:"SKIN(268458534 9896)"; +} + +plugin:edit { + background-color:"SKIN(270501603 8582)"; +} + +text{ + text-align: center; + font-family: tahoma; + font-size: 3.0u; + /*color:"SKIN(268458534 13056 19)";*/ + color: white; +} + +/************ +Page switcher +************* + +text#switchertext{ + position: static; + text-align: right; + margin-left: 6.0u; +} + +image#switcherimage{ + position: absolute; + top: 1.4u; + left: 2.5u; + height: 3.5u; + width: 3.0u; + _s60-aspect-ratio: preserve; +} +*/ + + +/****************** +container areas +******************/ +box#mainbox{ + width: 100%; + height: 100%; +} + +box.profile_date +{ + background-color: "SKIN(268458534 9916)"; + nav-index: appearance; + height: auto; +} + +box.profile_date:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-color: "SKIN(268458534 5120 9)"; +} + + +/********************************************* +Clock Profiles - portrait specific containers +**********************************************/ + +box#clock_profiles_portrait{ + display: block; + visibility: visible; + direction: rtl; + block-progression: rl; + padding-left: 1.7u; + padding-right: 1.7u; + margin-bottom: 0.55u; + height:13.86u; + visualisationaware:true; +} + +box#profiles_pages_portrait{ + block-progression: tb; + direction: rtl; + height: adaptive; +} + +box#clock_container_portrait{ + display: block; + visibility: visible; + position: static; + nav-index: appearance; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + + margin-left: 0.7u; + visualisationaware:true; + _s60-initial-focus: 1; +} + +box#clock_container_portrait:focus{ + background-color: "SKIN(268458534 5120 9)"; +} + +clock#clock_portrait{ + display: block; + visibility: visible; + position: static; + width: auto; + /*height: 70%;*/ + height: auto; + direction: rtl; + block-progression: tb; + background: none; + nav-index: appearance; + _s60-format: locale; + _s60-ampm-font-size: 16px; + _s60-digital-font-size: 56px; + color: white; +} + +box#date_container_portrait +{ + width: auto; + direction: rtl; + block-progression: rl; + height: 4.05u; + margin-bottom: 0.55u; + padding-top: 3px; + visualisationaware:true; +} + +box#date_content_portrait +{ + width: adaptive; + height: adaptive; +} + +text#datetext2_portrait +{ + text-align: center; + width: auto; + height: auto; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color: white; +} + +box#profile_softindicator_portrait +{ + width: auto; + direction: rtl; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + nav-index: appearance; + height: 9.0u; + visualisationaware:true; +} + +box#NT_CUGMCN_portrait +{ + text-align: center; + width: adaptive; + height: auto; + block-progression: rl; +} + + +box#NT_SATVHZ_portrait +{ + display: none; + text-align: center; + width: adaptive; + height: auto; + block-progression: rl; +} + +title#title_vhz_portrait +{ + display: none; +} + +title#title_sat_portrait +{ + display: none; +} + +/********************************************* +Clock Profiles - landscape specific containers +**********************************************/ + +box#clock_profiles_landscape{ + display: block; + visibility: visible; + direction: rtl; + block-progression: tb; + width: 30%; + height: 100%; + padding-left: 5px; + padding-top: 5px; + visualisationaware:true; +} + +box#profiles_pages_landscape{ + block-progression: tb; + direction: rtl; + height: adaptive; +} + +box#clock_container_landscape{ + + display: block; + visibility: visible; + position: static; + nav-index: appearance; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + height: 10.74u; + width: auto; + margin-bottom: 0.55u; + visualisationaware:true; + _s60-initial-focus: 2; +} + +box#clock_container_landscape:focus{ + background-color: "SKIN(268458534 5120 9)"; +} + +box#date_container_landscape +{ + width: auto; + direction: rtl; + block-progression: rl; + height: 6.7u; + margin-bottom: 0.55u; + visualisationaware:true; +} + +box#profile_softindicator_landscape +{ + width: auto; + direction: rtl; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + nav-index: appearance; + height: 6.7u; + margin-bottom: 0.55u; + visualisationaware:true; +} + +clock#clock_landscape{ + display: block; + visibility: visible; + position: static; + width: 100%; + height: auto; + direction: rtl; + block-progression: tb; + background: none; + nav-index: appearance; + _s60-format: locale; + _s60-ampm-font-size: 16px; + _s60-digital-font-size: 56px; + color: white; +} + +clock:focus{ + background-color: "SKIN(268458534 5120 9)"; +} +/* Date in the clock widget */ +text#datetext{ + nav-index: appearance; + text-align: center; + padding-top: 0.5u; + padding-bottom: 0.5u; + width: 100%; + height: 24%; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color: white; +} +/* Date in the clock widget */ +text#datetext:focus{ + background-color: "SKIN(268458534 5120 9)"; +} + +/* Date in separate widget above profiles */ + +box#date_content_landscape +{ + width: inherit; + height: inherit; +} + +text#datetext2_landscape +{ + text-align: center; + width: auto; + height: auto; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color: white; +} + +box#profile_softindicator:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + focus-background:"SKIN(268458534 5120 9)"; +} + +image#profileicon { + display: block; + visibility: hidden; + width: 18px; + height: 20px; + position: static; + margin-top: auto; + z-index: 2; +} + +image#SatIdleModeIcon +{ + display: block; + visibility: hidden; + width: 18px; + height: 20px; + position: static; + margin-top: auto; +} + +text#profiletext +{ + text-align: center; + margin-left: 2px; + margin-right: 2px; + width: adaptive; + height: adaptive; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color:"SKIN(268458534 13056 19)"; +} + +/* Profiles dialog */ +listquerydialog#profiledialog +{ + /* Avkon dialog is not layout capable */ + display: none; +} + +/* Default system profiles */ +text.systemprofileitem +{ + display: block; +} + +/* Placeholders for profiles added by user */ +text.userprofileitem +{ + display: none; +} + +/****************** + SOFT INDICATOR WIDGET AREA +*******************/ + +newsticker.SIText { + text-align: center; + display: block; + visibility: visible; + width: auto; + margin-left: 2px; + margin-right: 2px; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + white-space-collapse: collapse; + _s60-scroll-behaviour: alternate; + /*_s60-scroll-behaviour: scroll;*/ + _s60-display-time: 2000; + _s60-scroll-loop: false; + _s60-start-delay: 0; + _s60-restart-after-update: true; + color: white; + /*color:"SKIN(268458534 13056 19)";*/ +} + +box#NT_CUGMCN_landscape +{ + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +box#NT_SATVHZ_landscape +{ + display: none; + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +title#title_vhz_landscape +{ + display: none; +} + +title#title_sat_landscape +{ + display: none; +} + +image#SatIdleModeIcon_portrait +{ + display: none; +} + +image#SatIdleModeIcon_landscape +{ + display: none; +} + +/************ +Page switcher +************* +box#switcher{ + display: block; + visibility: visible; + block-progression: rl; + direction: ltr; + height: 4.5u; + background-color: "SKIN(268458534 9906)"; + background-size: 100%; + margin-top: 0.55u; +} + +box#switcher:focus { + background-color: "SKIN(268458534 5120 9)"; +} + +text#switchertext +{ + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: 3.5u; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color:"SKIN(268458534 13056 19)"; + color: white; + padding-top: 0.5u; + padding-bottom: 0.5u; +} + +image#switcherimage +{ + position: static; + height: 3.5u; + width: 3.5u; + margin-top: 0.5u; + margin-left: 2u; +} +*/ + +menuitem#webonlineitem +{ + display: block; +} + +menuitem#webonlineitem:edit +{ + display: none; +} + +menuitem#webofflineitem +{ + display: block; +} + +menuitem#webofflineitem:edit +{ + display: none; +} + +box#main_plugins{ + block-progression: tb; + display: block; + visibility: visible; + padding-left: 1.7u; + padding-right: 1.7u; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/50/view.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/50/view.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,547 @@ +view { + display: block; + position: static; + width: 100%; + height: 100%; + direction: rtl; + block-progression: tb; + background-image: wallpaper; + nav-index: appearance; + _s60-focus-visibility: true; + _s60-status-pane-layout: widescreen-flat-3softkeys; + +} + +trigger.western{ + display: none; +} + + +/** Softkeys **/ +softkey.normal_mode_sk +{ + display: block; +} + +softkey.normal_mode_sk:edit +{ + display: none; +} + +softkey.edit_mode_sk +{ + display: none; +} + +softkey.edit_mode_sk:edit +{ + display: block; +} + +/** General **/ + +plugin.widget_full_width{ + /* every plug-in decides its own height */ + height: adaptive; + background-color: "SKIN(268458534 9906)"; + background-size: 100%; + width: 100%; +/* padding-left: 1.7u; + padding-right: 1.7u;*/ + margin-bottom: 0.55u; + nav-index: auto; +} + +plugin.widget_full_width:focus { + focus-background:"SKIN(268458534 9896)"; +} + +plugin:edit { + background-color:"SKIN(270501603 8582)"; +} + +text{ + text-align: center; + font-family: tahoma; + font-size: 3.0u; + /*color:"SKIN(268458534 13056 19)";*/ + color: white; +} + +/************ +Page switcher +************* + +text#switchertext{ + position: static; + text-align: right; + margin-left: 6.0u; +} + +image#switcherimage{ + position: absolute; + top: 1.4u; + left: 2.5u; + height: 3.5u; + width: 3.0u; + _s60-aspect-ratio: preserve; +} +*/ + + +/****************** +container areas +******************/ +box#mainbox{ + width: 100%; + height: 100%; +} + +box.profile_date +{ + background-color: "SKIN(268458534 9916)"; + nav-index: appearance; + height: auto; +} + +box.profile_date:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-color: "SKIN(268458534 5120 9)"; +} + + +/********************************************* +Clock Profiles - portrait specific containers +**********************************************/ + +box#clock_profiles_portrait{ + display: block; + visibility: visible; + direction: rtl; + block-progression: rl; + padding-left: 1.7u; + padding-right: 1.7u; + margin-bottom: 0.55u; + height:13.86u; + visualisationaware:true; +} + +box#profiles_pages_portrait{ + block-progression: tb; + direction: rtl; + height: adaptive; +} + +box#clock_container_portrait{ + display: block; + visibility: visible; + position: static; + nav-index: appearance; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + + margin-left: 0.7u; + visualisationaware:true; + _s60-initial-focus: 1; +} + +box#clock_container_portrait:focus{ + background-color: "SKIN(268458534 5120 9)"; +} + +clock#clock_portrait{ + display: block; + visibility: visible; + position: static; + width: auto; + /*height: 70%;*/ + height: auto; + direction: rtl; + block-progression: tb; + background: none; + nav-index: appearance; + _s60-format: locale; + _s60-ampm-font-size: 16px; + _s60-digital-font-size: 56px; + color: white; +} + +box#date_container_portrait +{ + width: auto; + direction: rtl; + block-progression: rl; + height: 4.05u; + margin-bottom: 0.55u; + padding-top: 3px; + visualisationaware:true; +} + +box#date_content_portrait +{ + width: adaptive; + height: adaptive; +} + +text#datetext2_portrait +{ + text-align: center; + width: auto; + height: auto; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color: white; +} + +box#profile_softindicator_portrait +{ + width: auto; + direction: rtl; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + nav-index: appearance; + height: 9.0u; + visualisationaware:true; +} + +box#NT_CUGMCN_portrait +{ + text-align: center; + width: adaptive; + height: auto; + block-progression: rl; +} + + +box#NT_SATVHZ_portrait +{ + display: none; + text-align: center; + width: adaptive; + height: auto; + block-progression: rl; +} + +title#title_vhz_portrait +{ + display: none; +} + +title#title_sat_portrait +{ + display: none; +} + +/********************************************* +Clock Profiles - landscape specific containers +**********************************************/ + +box#clock_profiles_landscape{ + display: block; + visibility: visible; + direction: rtl; + block-progression: tb; + width: 30%; + height: 100%; + padding-left: 5px; + padding-top: 5px; + visualisationaware:true; +} + +box#profiles_pages_landscape{ + block-progression: tb; + direction: rtl; + height: adaptive; +} + +box#clock_container_landscape{ + + display: block; + visibility: visible; + position: static; + nav-index: appearance; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + height: 10.74u; + width: auto; + margin-bottom: 0.55u; + visualisationaware:true; + _s60-initial-focus: 2; +} + +box#clock_container_landscape:focus{ + background-color: "SKIN(268458534 5120 9)"; +} + +box#date_container_landscape +{ + width: auto; + direction: rtl; + block-progression: rl; + height: 6.7u; + margin-bottom: 0.55u; + visualisationaware:true; +} + +box#profile_softindicator_landscape +{ + width: auto; + direction: rtl; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + nav-index: appearance; + height: 6.7u; + margin-bottom: 0.55u; + visualisationaware:true; +} + +clock#clock_landscape{ + display: block; + visibility: visible; + position: static; + width: 100%; + height: auto; + direction: rtl; + block-progression: tb; + background: none; + nav-index: appearance; + _s60-format: locale; + _s60-ampm-font-size: 16px; + _s60-digital-font-size: 56px; + color: white; +} + +clock:focus{ + background-color: "SKIN(268458534 5120 9)"; +} +/* Date in the clock widget */ +text#datetext{ + nav-index: appearance; + text-align: center; + padding-top: 0.5u; + padding-bottom: 0.5u; + width: 100%; + height: 24%; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color: white; +} +/* Date in the clock widget */ +text#datetext:focus{ + background-color: "SKIN(268458534 5120 9)"; +} + +/* Date in separate widget above profiles */ + +box#date_content_landscape +{ + width: inherit; + height: inherit; +} + +text#datetext2_landscape +{ + text-align: center; + width: auto; + height: auto; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color: white; +} + +box#profile_softindicator:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + focus-background:"SKIN(268458534 5120 9)"; +} + +image#profileicon { + display: block; + visibility: hidden; + width: 18px; + height: 20px; + position: static; + margin-top: auto; + z-index: 2; +} + +image#SatIdleModeIcon +{ + display: block; + visibility: hidden; + width: 18px; + height: 20px; + position: static; + margin-top: auto; +} + +text#profiletext +{ + text-align: center; + margin-left: 2px; + margin-right: 2px; + width: adaptive; + height: adaptive; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color:"SKIN(268458534 13056 19)"; +} + +/* Profiles dialog */ +listquerydialog#profiledialog +{ + /* Avkon dialog is not layout capable */ + display: none; +} + +/* Default system profiles */ +text.systemprofileitem +{ + display: block; +} + +/* Placeholders for profiles added by user */ +text.userprofileitem +{ + display: none; +} + +/****************** + SOFT INDICATOR WIDGET AREA +*******************/ + +newsticker.SIText { + text-align: center; + display: block; + visibility: visible; + width: auto; + margin-left: 2px; + margin-right: 2px; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + white-space-collapse: collapse; + _s60-scroll-behaviour: alternate; + /*_s60-scroll-behaviour: scroll;*/ + _s60-display-time: 2000; + _s60-scroll-loop: false; + _s60-start-delay: 0; + _s60-restart-after-update: true; + color: white; + /*color:"SKIN(268458534 13056 19)";*/ +} + +box#NT_CUGMCN_landscape +{ + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +box#NT_SATVHZ_landscape +{ + display: none; + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +title#title_vhz_landscape +{ + display: none; +} + +title#title_sat_landscape +{ + display: none; +} + +image#SatIdleModeIcon_portrait +{ + display: none; +} + +image#SatIdleModeIcon_landscape +{ + display: none; +} + +/************ +Page switcher +************* +box#switcher{ + display: block; + visibility: visible; + block-progression: rl; + direction: ltr; + height: 4.5u; + background-color: "SKIN(268458534 9906)"; + background-size: 100%; + margin-top: 0.55u; +} + +box#switcher:focus { + background-color: "SKIN(268458534 5120 9)"; +} + +text#switchertext +{ + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: 3.5u; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color:"SKIN(268458534 13056 19)"; + color: white; + padding-top: 0.5u; + padding-bottom: 0.5u; +} + +image#switcherimage +{ + position: static; + height: 3.5u; + width: 3.5u; + margin-top: 0.5u; + margin-left: 2u; +} +*/ + +menuitem#webonlineitem +{ + display: block; +} + +menuitem#webonlineitem:edit +{ + display: none; +} + +menuitem#webofflineitem +{ + display: block; +} + +menuitem#webofflineitem:edit +{ + display: none; +} + +box#main_plugins{ + block-progression: tb; + display: block; + visibility: visible; + padding-left: 1.7u; + padding-right: 1.7u; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/57/view.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/57/view.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,547 @@ +view { + display: block; + position: static; + width: 100%; + height: 100%; + direction: rtl; + block-progression: tb; + background-image: wallpaper; + nav-index: appearance; + _s60-focus-visibility: true; + _s60-status-pane-layout: widescreen-flat-3softkeys; + +} + +trigger.western{ + display: none; +} + + +/** Softkeys **/ +softkey.normal_mode_sk +{ + display: block; +} + +softkey.normal_mode_sk:edit +{ + display: none; +} + +softkey.edit_mode_sk +{ + display: none; +} + +softkey.edit_mode_sk:edit +{ + display: block; +} + +/** General **/ + +plugin.widget_full_width{ + /* every plug-in decides its own height */ + height: adaptive; + background-color: "SKIN(268458534 9906)"; + background-size: 100%; + width: 100%; +/* padding-left: 1.7u; + padding-right: 1.7u;*/ + margin-bottom: 0.55u; + nav-index: auto; +} + +plugin.widget_full_width:focus { + focus-background:"SKIN(268458534 9896)"; +} + +plugin:edit { + background-color:"SKIN(270501603 8582)"; +} + +text{ + text-align: center; + font-family: tahoma; + font-size: 3.0u; + /*color:"SKIN(268458534 13056 19)";*/ + color: white; +} + +/************ +Page switcher +************* + +text#switchertext{ + position: static; + text-align: right; + margin-left: 6.0u; +} + +image#switcherimage{ + position: absolute; + top: 1.4u; + left: 2.5u; + height: 3.5u; + width: 3.0u; + _s60-aspect-ratio: preserve; +} +*/ + + +/****************** +container areas +******************/ +box#mainbox{ + width: 100%; + height: 100%; +} + +box.profile_date +{ + background-color: "SKIN(268458534 9916)"; + nav-index: appearance; + height: auto; +} + +box.profile_date:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-color: "SKIN(268458534 5120 9)"; +} + + +/********************************************* +Clock Profiles - portrait specific containers +**********************************************/ + +box#clock_profiles_portrait{ + display: block; + visibility: visible; + direction: rtl; + block-progression: rl; + padding-left: 1.7u; + padding-right: 1.7u; + margin-bottom: 0.55u; + height:13.86u; + visualisationaware:true; +} + +box#profiles_pages_portrait{ + block-progression: tb; + direction: rtl; + height: adaptive; +} + +box#clock_container_portrait{ + display: block; + visibility: visible; + position: static; + nav-index: appearance; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + + margin-left: 0.7u; + visualisationaware:true; + _s60-initial-focus: 1; +} + +box#clock_container_portrait:focus{ + background-color: "SKIN(268458534 5120 9)"; +} + +clock#clock_portrait{ + display: block; + visibility: visible; + position: static; + width: auto; + /*height: 70%;*/ + height: auto; + direction: rtl; + block-progression: tb; + background: none; + nav-index: appearance; + _s60-format: locale; + _s60-ampm-font-size: 16px; + _s60-digital-font-size: 56px; + color: white; +} + +box#date_container_portrait +{ + width: auto; + direction: rtl; + block-progression: rl; + height: 4.05u; + margin-bottom: 0.55u; + padding-top: 3px; + visualisationaware:true; +} + +box#date_content_portrait +{ + width: adaptive; + height: adaptive; +} + +text#datetext2_portrait +{ + text-align: center; + width: auto; + height: auto; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color: white; +} + +box#profile_softindicator_portrait +{ + width: auto; + direction: rtl; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + nav-index: appearance; + height: 9.0u; + visualisationaware:true; +} + +box#NT_CUGMCN_portrait +{ + text-align: center; + width: adaptive; + height: auto; + block-progression: rl; +} + + +box#NT_SATVHZ_portrait +{ + display: none; + text-align: center; + width: adaptive; + height: auto; + block-progression: rl; +} + +title#title_vhz_portrait +{ + display: none; +} + +title#title_sat_portrait +{ + display: none; +} + +/********************************************* +Clock Profiles - landscape specific containers +**********************************************/ + +box#clock_profiles_landscape{ + display: block; + visibility: visible; + direction: rtl; + block-progression: tb; + width: 30%; + height: 100%; + padding-left: 5px; + padding-top: 5px; + visualisationaware:true; +} + +box#profiles_pages_landscape{ + block-progression: tb; + direction: rtl; + height: adaptive; +} + +box#clock_container_landscape{ + + display: block; + visibility: visible; + position: static; + nav-index: appearance; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + height: 10.74u; + width: auto; + margin-bottom: 0.55u; + visualisationaware:true; + _s60-initial-focus: 2; +} + +box#clock_container_landscape:focus{ + background-color: "SKIN(268458534 5120 9)"; +} + +box#date_container_landscape +{ + width: auto; + direction: rtl; + block-progression: rl; + height: 6.7u; + margin-bottom: 0.55u; + visualisationaware:true; +} + +box#profile_softindicator_landscape +{ + width: auto; + direction: rtl; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + nav-index: appearance; + height: 6.7u; + margin-bottom: 0.55u; + visualisationaware:true; +} + +clock#clock_landscape{ + display: block; + visibility: visible; + position: static; + width: 100%; + height: auto; + direction: rtl; + block-progression: tb; + background: none; + nav-index: appearance; + _s60-format: locale; + _s60-ampm-font-size: 16px; + _s60-digital-font-size: 56px; + color: white; +} + +clock:focus{ + background-color: "SKIN(268458534 5120 9)"; +} +/* Date in the clock widget */ +text#datetext{ + nav-index: appearance; + text-align: center; + padding-top: 0.5u; + padding-bottom: 0.5u; + width: 100%; + height: 24%; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color: white; +} +/* Date in the clock widget */ +text#datetext:focus{ + background-color: "SKIN(268458534 5120 9)"; +} + +/* Date in separate widget above profiles */ + +box#date_content_landscape +{ + width: inherit; + height: inherit; +} + +text#datetext2_landscape +{ + text-align: center; + width: auto; + height: auto; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color: white; +} + +box#profile_softindicator:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + focus-background:"SKIN(268458534 5120 9)"; +} + +image#profileicon { + display: block; + visibility: hidden; + width: 18px; + height: 20px; + position: static; + margin-top: auto; + z-index: 2; +} + +image#SatIdleModeIcon +{ + display: block; + visibility: hidden; + width: 18px; + height: 20px; + position: static; + margin-top: auto; +} + +text#profiletext +{ + text-align: center; + margin-left: 2px; + margin-right: 2px; + width: adaptive; + height: adaptive; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color:"SKIN(268458534 13056 19)"; +} + +/* Profiles dialog */ +listquerydialog#profiledialog +{ + /* Avkon dialog is not layout capable */ + display: none; +} + +/* Default system profiles */ +text.systemprofileitem +{ + display: block; +} + +/* Placeholders for profiles added by user */ +text.userprofileitem +{ + display: none; +} + +/****************** + SOFT INDICATOR WIDGET AREA +*******************/ + +newsticker.SIText { + text-align: center; + display: block; + visibility: visible; + width: auto; + margin-left: 2px; + margin-right: 2px; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + white-space-collapse: collapse; + _s60-scroll-behaviour: alternate; + /*_s60-scroll-behaviour: scroll;*/ + _s60-display-time: 2000; + _s60-scroll-loop: false; + _s60-start-delay: 0; + _s60-restart-after-update: true; + color: white; + /*color:"SKIN(268458534 13056 19)";*/ +} + +box#NT_CUGMCN_landscape +{ + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +box#NT_SATVHZ_landscape +{ + display: none; + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +title#title_vhz_landscape +{ + display: none; +} + +title#title_sat_landscape +{ + display: none; +} + +image#SatIdleModeIcon_portrait +{ + display: none; +} + +image#SatIdleModeIcon_landscape +{ + display: none; +} + +/************ +Page switcher +************* +box#switcher{ + display: block; + visibility: visible; + block-progression: rl; + direction: ltr; + height: 4.5u; + background-color: "SKIN(268458534 9906)"; + background-size: 100%; + margin-top: 0.55u; +} + +box#switcher:focus { + background-color: "SKIN(268458534 5120 9)"; +} + +text#switchertext +{ + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: 3.5u; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color:"SKIN(268458534 13056 19)"; + color: white; + padding-top: 0.5u; + padding-bottom: 0.5u; +} + +image#switcherimage +{ + position: static; + height: 3.5u; + width: 3.5u; + margin-top: 0.5u; + margin-left: 2u; +} +*/ + +menuitem#webonlineitem +{ + display: block; +} + +menuitem#webonlineitem:edit +{ + display: none; +} + +menuitem#webofflineitem +{ + display: block; +} + +menuitem#webofflineitem:edit +{ + display: none; +} + +box#main_plugins{ + block-progression: tb; + display: block; + visibility: visible; + padding-left: 1.7u; + padding-right: 1.7u; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/94/view.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/94/view.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,547 @@ +view { + display: block; + position: static; + width: 100%; + height: 100%; + direction: rtl; + block-progression: tb; + background-image: wallpaper; + nav-index: appearance; + _s60-focus-visibility: true; + _s60-status-pane-layout: widescreen-flat-3softkeys; + +} + +trigger.western{ + display: none; +} + + +/** Softkeys **/ +softkey.normal_mode_sk +{ + display: block; +} + +softkey.normal_mode_sk:edit +{ + display: none; +} + +softkey.edit_mode_sk +{ + display: none; +} + +softkey.edit_mode_sk:edit +{ + display: block; +} + +/** General **/ + +plugin.widget_full_width{ + /* every plug-in decides its own height */ + height: adaptive; + background-color: "SKIN(268458534 9906)"; + background-size: 100%; + width: 100%; +/* padding-left: 1.7u; + padding-right: 1.7u;*/ + margin-bottom: 0.55u; + nav-index: auto; +} + +plugin.widget_full_width:focus { + focus-background:"SKIN(268458534 9896)"; +} + +plugin:edit { + background-color:"SKIN(270501603 8582)"; +} + +text{ + text-align: center; + font-family: tahoma; + font-size: 3.0u; + /*color:"SKIN(268458534 13056 19)";*/ + color: white; +} + +/************ +Page switcher +************* + +text#switchertext{ + position: static; + text-align: right; + margin-left: 6.0u; +} + +image#switcherimage{ + position: absolute; + top: 1.4u; + left: 2.5u; + height: 3.5u; + width: 3.0u; + _s60-aspect-ratio: preserve; +} +*/ + + +/****************** +container areas +******************/ +box#mainbox{ + width: 100%; + height: 100%; +} + +box.profile_date +{ + background-color: "SKIN(268458534 9916)"; + nav-index: appearance; + height: auto; +} + +box.profile_date:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-color: "SKIN(268458534 5120 9)"; +} + + +/********************************************* +Clock Profiles - portrait specific containers +**********************************************/ + +box#clock_profiles_portrait{ + display: block; + visibility: visible; + direction: rtl; + block-progression: rl; + padding-left: 1.7u; + padding-right: 1.7u; + margin-bottom: 0.55u; + height:13.86u; + visualisationaware:true; +} + +box#profiles_pages_portrait{ + block-progression: tb; + direction: rtl; + height: adaptive; +} + +box#clock_container_portrait{ + display: block; + visibility: visible; + position: static; + nav-index: appearance; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + + margin-left: 0.7u; + visualisationaware:true; + _s60-initial-focus: 1; +} + +box#clock_container_portrait:focus{ + background-color: "SKIN(268458534 5120 9)"; +} + +clock#clock_portrait{ + display: block; + visibility: visible; + position: static; + width: auto; + /*height: 70%;*/ + height: auto; + direction: rtl; + block-progression: tb; + background: none; + nav-index: appearance; + _s60-format: locale; + _s60-ampm-font-size: 16px; + _s60-digital-font-size: 56px; + color: white; +} + +box#date_container_portrait +{ + width: auto; + direction: rtl; + block-progression: rl; + height: 4.05u; + margin-bottom: 0.55u; + padding-top: 3px; + visualisationaware:true; +} + +box#date_content_portrait +{ + width: adaptive; + height: adaptive; +} + +text#datetext2_portrait +{ + text-align: center; + width: auto; + height: auto; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color: white; +} + +box#profile_softindicator_portrait +{ + width: auto; + direction: rtl; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + nav-index: appearance; + height: 9.0u; + visualisationaware:true; +} + +box#NT_CUGMCN_portrait +{ + text-align: center; + width: adaptive; + height: auto; + block-progression: rl; +} + + +box#NT_SATVHZ_portrait +{ + display: none; + text-align: center; + width: adaptive; + height: auto; + block-progression: rl; +} + +title#title_vhz_portrait +{ + display: none; +} + +title#title_sat_portrait +{ + display: none; +} + +/********************************************* +Clock Profiles - landscape specific containers +**********************************************/ + +box#clock_profiles_landscape{ + display: block; + visibility: visible; + direction: rtl; + block-progression: tb; + width: 30%; + height: 100%; + padding-left: 5px; + padding-top: 5px; + visualisationaware:true; +} + +box#profiles_pages_landscape{ + block-progression: tb; + direction: rtl; + height: adaptive; +} + +box#clock_container_landscape{ + + display: block; + visibility: visible; + position: static; + nav-index: appearance; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + height: 10.74u; + width: auto; + margin-bottom: 0.55u; + visualisationaware:true; + _s60-initial-focus: 2; +} + +box#clock_container_landscape:focus{ + background-color: "SKIN(268458534 5120 9)"; +} + +box#date_container_landscape +{ + width: auto; + direction: rtl; + block-progression: rl; + height: 6.7u; + margin-bottom: 0.55u; + visualisationaware:true; +} + +box#profile_softindicator_landscape +{ + width: auto; + direction: rtl; + block-progression: tb; + background-color: "SKIN(268458534 9906)"; + nav-index: appearance; + height: 6.7u; + margin-bottom: 0.55u; + visualisationaware:true; +} + +clock#clock_landscape{ + display: block; + visibility: visible; + position: static; + width: 100%; + height: auto; + direction: rtl; + block-progression: tb; + background: none; + nav-index: appearance; + _s60-format: locale; + _s60-ampm-font-size: 16px; + _s60-digital-font-size: 56px; + color: white; +} + +clock:focus{ + background-color: "SKIN(268458534 5120 9)"; +} +/* Date in the clock widget */ +text#datetext{ + nav-index: appearance; + text-align: center; + padding-top: 0.5u; + padding-bottom: 0.5u; + width: 100%; + height: 24%; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color: white; +} +/* Date in the clock widget */ +text#datetext:focus{ + background-color: "SKIN(268458534 5120 9)"; +} + +/* Date in separate widget above profiles */ + +box#date_content_landscape +{ + width: inherit; + height: inherit; +} + +text#datetext2_landscape +{ + text-align: center; + width: auto; + height: auto; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color: white; +} + +box#profile_softindicator:focus +{ + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + focus-background:"SKIN(268458534 5120 9)"; +} + +image#profileicon { + display: block; + visibility: hidden; + width: 18px; + height: 20px; + position: static; + margin-top: auto; + z-index: 2; +} + +image#SatIdleModeIcon +{ + display: block; + visibility: hidden; + width: 18px; + height: 20px; + position: static; + margin-top: auto; +} + +text#profiletext +{ + text-align: center; + margin-left: 2px; + margin-right: 2px; + width: adaptive; + height: adaptive; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color:"SKIN(268458534 13056 19)"; +} + +/* Profiles dialog */ +listquerydialog#profiledialog +{ + /* Avkon dialog is not layout capable */ + display: none; +} + +/* Default system profiles */ +text.systemprofileitem +{ + display: block; +} + +/* Placeholders for profiles added by user */ +text.userprofileitem +{ + display: none; +} + +/****************** + SOFT INDICATOR WIDGET AREA +*******************/ + +newsticker.SIText { + text-align: center; + display: block; + visibility: visible; + width: auto; + margin-left: 2px; + margin-right: 2px; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + white-space-collapse: collapse; + _s60-scroll-behaviour: alternate; + /*_s60-scroll-behaviour: scroll;*/ + _s60-display-time: 2000; + _s60-scroll-loop: false; + _s60-start-delay: 0; + _s60-restart-after-update: true; + color: white; + /*color:"SKIN(268458534 13056 19)";*/ +} + +box#NT_CUGMCN_landscape +{ + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +box#NT_SATVHZ_landscape +{ + display: none; + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: auto; + block-progression: rl; +} + +title#title_vhz_landscape +{ + display: none; +} + +title#title_sat_landscape +{ + display: none; +} + +image#SatIdleModeIcon_portrait +{ + display: none; +} + +image#SatIdleModeIcon_landscape +{ + display: none; +} + +/************ +Page switcher +************* +box#switcher{ + display: block; + visibility: visible; + block-progression: rl; + direction: ltr; + height: 4.5u; + background-color: "SKIN(268458534 9906)"; + background-size: 100%; + margin-top: 0.55u; +} + +box#switcher:focus { + background-color: "SKIN(268458534 5120 9)"; +} + +text#switchertext +{ + text-align: center; + margin-left: auto; + margin-right: auto; + width: adaptive; + height: 3.5u; + font-family: EAknLogicalFontPrimaryFont; + font-size: 3u; + color:"SKIN(268458534 13056 19)"; + color: white; + padding-top: 0.5u; + padding-bottom: 0.5u; +} + +image#switcherimage +{ + position: static; + height: 3.5u; + width: 3.5u; + margin-top: 0.5u; + margin-left: 2u; +} +*/ + +menuitem#webonlineitem +{ + display: block; +} + +menuitem#webonlineitem:edit +{ + display: none; +} + +menuitem#webofflineitem +{ + display: block; +} + +menuitem#webofflineitem:edit +{ + display: none; +} + +box#main_plugins{ + block-progression: tb; + display: block; + visibility: visible; + padding-left: 1.7u; + padding-right: 1.7u; +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/wideimage_10009dff/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/wideimage_10009dff/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,67 @@ +/* +* 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/wideimage_10009dff/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/z/resource/homescreen/wideimage_10009dff/hsps/widgetconfiguration.xml + +../xuikon/00/wideimage.dat /epoc32/data/z/resource/homescreen/wideimage_10009dff/xuikon/wideimage_10009dff.dat +../xuikon/00/wideimage.css /epoc32/data/z/resource/homescreen/wideimage_10009dff/xuikon/wideimage.css +../xuikon/00/wideimage.xml /epoc32/data/z/resource/homescreen/wideimage_10009dff/xuikon/wideimage.xml +../xuikon/00/wideimage.dtd /epoc32/data/z/resource/homescreen/wideimage_10009dff/xuikon/wideimage.dtd + +// Support for S60 builds +//*********************** +../rom/wideimage_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(wideimage_10009dff_resources.iby) +../rom/wideimage_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(wideimage_10009dff_customer.iby) +../rom/wideimage_variant.iby CUSTOMER_VARIANT_APP_LAYER_IBY_EXPORT_PATH(wideimage_10009dff_variant.iby) +../rom/wideimage.iby CORE_APP_LAYER_IBY_EXPORT_PATH(wideimage_10009dff.iby) + +// Support for S60 localization +//***************************** +#ifndef __WIDEIMAGE_LOC__ +#define __WIDEIMAGE_LOC__ +../loc/wideimage.loc APP_LAYER_LOC_EXPORT_PATH(wideimage.loc) +#endif // __WIDEIMAGE_LOC__ + +// Dtd-localization +//***************** +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME wideimage_10009dff +OPTION DTD_TYPE widget +OPTION LOC_FOLDERS yes +END + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of File + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/wideimage_10009dff/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/wideimage_10009dff/hsps/00/manifest.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ + + + + vga_tch + + template + + + 0x2001f48a + + + 0x101fb657 + + + 0x10009dff + + + wideimage + wide + 1.0 + + + widgetconfiguration.xml + + + + wideimage.o0000 + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/wideimage_10009dff/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/wideimage_10009dff/hsps/00/widgetconfiguration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/wideimage_10009dff/loc/wideimage.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/wideimage_10009dff/loc/wideimage.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for WideImage widget (Xuikon) +* +*/ + +// d: Loading content +// l: ai_gene_pane_1_t1/opt4 +// w: +// r: TB9.2 +#define qtn_ai_loading_content "Loading content..." \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/wideimage_10009dff/rom/wideimage.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/wideimage_10009dff/rom/wideimage.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: IBY file for Homescreen's WideImage widget +* +*/ + + +#ifndef __WIDEIMAGE_10009DFF_IBY__ +#define __WIDEIMAGE_10009DFF_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools +data=ZPRIVATE\200159c0\install\wideimage_10009dff\hsps\00\manifest.dat \private\200159c0\install\wideimage_10009dff\hsps\00\manifest.dat + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __WIDEIMAGE_10009DFF_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/wideimage_10009dff/rom/wideimage_customer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/wideimage_10009dff/rom/wideimage_customer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: WideImage widget HSPS-plugin language specific IBY file. +* +*/ + + +#ifndef __WIDEIMAGE_10009DFF_CUSTOMER_IBY__ +#define __WIDEIMAGE_10009DFF_CUSTOMER_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\wideimage_10009dff\xuikon\00\wideimage.o0000 \private\200159c0\install\wideimage_10009dff\xuikon\00\wideimage.o0000 + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __WIDEIMAGE_10009DFF_CUSTOMER_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/wideimage_10009dff/rom/wideimage_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/wideimage_10009dff/rom/wideimage_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* 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: IBY file for Homescreen's widgetimage_10009dff. +* +*/ + +#ifndef __WIDEIMAGE_10009DFF_RESOURCES_IBY__ +#define __WIDEIMAGE_10009DFF_RESOURCES_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by DTD-localization tools, language specific +data=ZPRIVATE\200159c0\install\wideimage_10009dff\xuikon\00\wideimage.o0000 \private\200159c0\install\wideimage_10009dff\xuikon\00\wideimage.o0000 + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __WIDEIMAGE_10009DFF_RESOURCES_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/wideimage_10009dff/rom/wideimage_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/wideimage_10009dff/rom/wideimage_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -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: WideImage widget HSPS-plugin variant specific IBY file. +* +*/ + + +#ifndef __WIDEIMAGE_10009DFF_VARIANT_IBY__ +#define __WIDEIMAGE_10009DFF_VARIANT_IBY__ + +#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +// Enabled by variation tools, variant specific +data=ZPRIVATE\200159c0\install\wideimage_10009dff\hsps\00\widgetconfiguration.xml \private\200159c0\install\wideimage_10009dff\hsps\00\widgetconfiguration.xml + +#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) + +#endif // __WIDEIMAGE_10009DFF_VARIANT_IBY__ diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/wideimage_10009dff/xuikon/00/wideimage.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/wideimage_10009dff/xuikon/00/wideimage.css Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,47 @@ +widget{ + width:auto; + height:60px; + } + +box#image_container:focus { + touchfeedbackdown: basic; + touchfeedbackdrag: sensitive; + background-image: "SKIN(268458534 24576)"; + background-color: "SKIN(268458534 5120 9)"; +} + +box#image_container:hold +{ + background-color: "SKIN(268458534 5120 9)"; +} + +box#image_container +{ + padding-top : 2px; + padding-bottom: 2px; + padding-left : 10px; + padding-right : 10px; + direction: ltr; + nav-index:appearance; +} + +image#wide_image +{ + display: none; + width:auto; + height:auto; + /*_s60-aspect-ratio:preserve;*/ +} + +text#wide_text +{ + display: block; + width:auto; + height:auto; + padding-left: 5px; + font-family: EAknLogicalFontSecondaryFont; + font-size:18px; + color:white; +} + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/wideimage_10009dff/xuikon/00/wideimage.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/wideimage_10009dff/xuikon/00/wideimage.dat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,12 @@ + + + 2001CB4F + 101FB657 + 110012F5 + wideimage + wideimage + 1.0 + wideimage.xml + wideimage.css + wideimage.dtd + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/wideimage_10009dff/xuikon/00/wideimage.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/wideimage_10009dff/xuikon/00/wideimage.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ + + + + + + + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/data/vga_tch/wideimage_10009dff/xuikon/00/wideimage.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/vga_tch/wideimage_10009dff/xuikon/00/wideimage.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + &qtn_ai_loading_content; + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/cenrep/keys_activeidle.xls Binary file idlehomescreen/exths/cenrep/keys_activeidle.xls has changed diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/conf/activeidle.confml Binary file idlehomescreen/exths/conf/activeidle.confml has changed diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/conf/activeidle_10207467.crml Binary file idlehomescreen/exths/conf/activeidle_10207467.crml has changed diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/data/101fd657.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/exths/data/101fd657.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 8704 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Registery info for AI ShortcutPlugin +* +*/ + +#include + +#include "extrstandbycontainerconst.h" + +RESOURCE REGISTRY_INFO theInfo + { + // UID for the DLL + dll_uid = 0x101FD657; + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = KExtrStandbyContainerIFUid; + implementations = + { + // Info for Active Idle Plugin container + IMPLEMENTATION_INFO + { + implementation_uid = 0x101FD658; + version_no = 1; + display_name = ""; + default_data = ""; + opaque_data = ""; + } + }; + } + }; + } + diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/group/aicontainer.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/exths/group/aicontainer.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,70 @@ +/* +* 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: This is project specification file for the Active Idle. +* +*/ + + +#include +#include + +TARGET aicontainer.dll +CAPABILITY CAP_ECOM_PLUGIN +TARGETTYPE PLUGIN +UID 0x10009D8D 0x101FD657 +VENDORID VID_DEFAULT + +// Module's own directory structure +USERINCLUDE . +USERINCLUDE ../../inc +USERINCLUDE ../inc/plugincontainer +USERINCLUDE ../inc/pluginif +USERINCLUDE ../data + +APP_LAYER_SYSTEMINCLUDE + + +// Symbian OS style base classes for application +SOURCEPATH ../src/plugincontainer + +SOURCE caiplugincontainercontrol.cpp +SOURCE propertyobserver.cpp +SOURCE dllmain.cpp + +// Resources +SOURCEPATH ../data +START RESOURCE 101fd657.rss +TARGET aicontainer.rsc +END + +// Symbian OS general +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY bafl.lib +LIBRARY ecom.lib +LIBRARY ws32.lib +LIBRARY avkon.lib +LIBRARY aknskins.lib +LIBRARY commonengine.lib +LIBRARY eikcore.lib +LIBRARY cdlengine.lib + + +// Central repository +LIBRARY centralrepository.lib +LIBRARY cenrepnotifhandler.lib + +//LIBRARY aknskins.lib + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/group/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/exths/group/backup_registration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/exths/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building the +* whole AI application. +* +*/ + +#ifdef RD_CUSTOMIZABLE_AI + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../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) + +PRJ_MMPFILES +../group/aicontainer.mmp + +PRJ_TESTMMPFILES + + +#endif // RD_CUSTOMIZABLE_AI \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/inc/plugincontainer/aicontainer.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/exths/inc/plugincontainer/aicontainer.hrh Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains declarations for resources of AIPlugins. +* The file can be included in C++ or resource file. +* +*/ + + +#ifndef AIPLUGINS_HRH +#define AIPLUGINS_HRH + + +#include + +// Base index for Enumerates commands. See below. +#define KAICmdBase 1000 + +#define KActiveIdleContainerUid 0x101FD657 + +// Enumerates commands +enum + { + // Commands for idle state: + // General left softkey action + EAISoftkeyLeft = 150 + KAICmdBase, + // General right softkey action + EAISoftkeyRight, + // General Scrollkey selection action + EAISelectionKey, + // General left scrollkey action + EAIScrollkeyLeft, + // General up scrollkey action + EAIScrollkeyUp, + // General right scrollkey action + EAIScrollkeyRight, + // General down scrollkey action + EAIScrollkeyDown, + // Plugin focus moving up action + EAIFocusUp, + // Plugin focus moving down action + EAIFocusDown, + + // Other commands: + // AI has entered security view + EAICmdSecurityInd = 500 + KAICmdBase // NOT to leave + }; + +#endif + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/inc/plugincontainer/aicontainerprivatecrkeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/exths/inc/plugincontainer/aicontainerprivatecrkeys.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Definitions of private keys related to Active Idle container in CenRep +* +*/ + +#ifndef AICONTAINERPRIVATECRKEYS_H +#define AICONTAINERPRIVATECRKEYS_H + +#include + +#endif + diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/inc/plugincontainer/caiplugincontainercontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/exths/inc/plugincontainer/caiplugincontainercontrol.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,341 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It is the control container for the AI plugins +* +*/ + + +#ifndef CAIPLUGINCONTROL_H +#define CAIPLUGINCONTROL_H + +#include +#include + +#include + +#include "extrstandbycontainerif.h" + +#include "ExtrStandbyScr.h" + +#include "propertyobserver.h" + +enum TAIPluginAlignment + { + EAITop = 1, + EAIBottom + }; + +// Background layers +enum TIdleBgLayers + { + EAIBgLayerBackground = 0, + EAIBgLayerWallpaper = 1, + EAIBgLayersN = 2 + }; + +enum TAIPluginState + { + EAIPluginOff = 0, + EAIPluginOn, + EAIPluginError + }; + +// Structure containing plugin information +struct TPluginInfo + { + CExtrStandbyScr* iPlugin; + TBool iResizeable ; + TBool iOnScreen ; + TUid iPluginId; + TAIPluginAlignment iAlignment; + TAIPluginState iState; + TInt iWeight; + TInt32 iCRKeyId; + }; + +class CAknsLayeredBackgroundControlContext; + +// CLASS DECLARATION +/** +* It is the control for the Active Idle. +* +* @since 2.6 +*/ +NONSHARABLE_CLASS(CAIPluginContainerControl) : + public CExtrStandbyContainerIF, + public MCoeControlObserver, + public MCenRepNotifyHandlerCallback, + public MPropertyChangeHandler + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aViewId View identifier. + * @param aContainer Container object. + * @return Pointer to the CAIPluginContainerControl object. + */ + static CAIPluginContainerControl* NewL(CCoeControl *aContainer) ; + /** + * Destructor. + */ + ~CAIPluginContainerControl(); + + public: // From CCoeControl + + /** + * From CCoeControl, returns the amount of component controls. + * @return amount of component controls. + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl, returns a control by index. + * @param aIndex Index of the control. + * @return Control by index. + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * From CCoeControl, informs that the size is changed to update the + * sizes of component controls appropriately. + */ + void SizeChanged(); + + /** + * From CCoeControl, informs that the focus is changed + */ + void FocusChanged(TDrawNow aDrawNow); + + /** + * From CCoeControl, draws the contents of the view. + * @param aRect Area to be redrawn. + */ + void Draw( const TRect& aRect ) const; + + /** + * From CCoeControl, offers a key event to the view. + * @param aKeyEvent Information about the key event. + * @param aType Type of the event. + * @return Information which indicates whether the keypress + * was processed or not. + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * From CCoeControl : Notifier for resourse changing + * @param aType : Type of resource change + */ + void HandleResourceChange( TInt aType ); + + /** + * From CCoeControl : Sets all the plugins dimmed. When dimmed the plugin must not draw anythings + * @param aDimmed + */ + void SetDimmed(TBool aDimmed); + + + /** + * From CCoeControl + * @param TTypeUid aId + */ + TTypeUid::Ptr CAIPluginContainerControl::MopSupplyObject(TTypeUid aId); + + public: // from CExtrStandbyContainerIF + + /** + * Start loading plugin + */ + void StartL(); + /** + * Sets mode for External Homescreen (Full screen or normal) + */ + void SetFullScreenMode(TBool aFullScreenMode); + + public: // from MCoeControlObserver + + void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); + + public: // From PropertyObserver + /** + * Called when a backup or restore operation either starts or ends. + * @param aBackupOperationAttributes Operation attributes + */ + void HandlePropertyChange(const TUid& aCategory, const TUint& aKey, const TInt& aValue); + + protected: // From MCenRepNotifyHandlerCallback + + void HandleNotifyGeneric(TUint32 aId); + + private: + + /** + * C++ constructor. + */ + CAIPluginContainerControl(); + + /** + * Symbian OS constructor. + */ + void ConstructL(CCoeControl* aContainer); + + + /** + * change the plugin focus + */ + void ChangeFocusPluginL( TInt aDirection ); + + /** + * focus on the default focusing plugin + */ + void FocusOnDefaultFocusingPlugin(TDrawNow aDrawNow=ENoDrawNow); + + /** + * Calculate the rect for each plugin and draw + */ + void CalculateRectPlugins(); + + /** + * Handle the Top Plugin + */ + void HandleTopPlugins(TInt& aTopPluginX, TInt& aBottomPluginX); + + /** + * Handle the bottom Plugin + */ + void HandleBottomPlugins(TInt& aTopPluginX, TInt& aBottomPluginX); + + /** + * Calculate the rect for a plugin (top or bottom allignment) + */ + void HandlePlugin(TInt aIndex, + TAIPluginAlignment aAlign, + TInt& aTopPluginX, + TInt& aBottomPluginX); + + /** + * Return the next visible plugin with content + */ + TInt NextVisiblePlugin(TInt aStartIndex); + + /** + * Return the previous visible plugin with content + */ + TInt PreviousVisiblePlugin(TInt aStartIndex); + + /** + * Return the index of the reduceable plugin with the lower weight + */ + TInt FindReduceablePlugin(TInt aOverRunHeight, TInt aCurrentIndex); + + /** + * Return the index of the plugin with the lower weight + */ + TInt FindLowerWeightPlugin(TInt aCurrentIndex); + + /** + * Reduce the plugin and move the others plugin till the current + */ + void ReducePlugin(TInt aPluginToBeReducedIndex,TInt aCurrentIndex,TInt aReduceHeight); + + /** + * Hide the plugin + */ + void HidePlugin(TInt aPluginIndex); + + /** + * Read Plugin Configuration + */ + void ReadPluginsConfigurationsL(); + + /** + * Load all the plugins + */ + void LoadPluginsL(); + + /** + * Load a specific plugin + */ + void LoadPluginL(TInt aIndex); + + /** + * Destroy all the plugins + */ + void DestroyPlugins(); + + /** + * Resets plugin state to default one + */ + void ResetToDefault( TPluginInfo& aPluginInfo ); + + /* + * Checks in which mode AI1 will be executed + * fullscreen or normal + * @since S60 3.2 + * @return TBool + */ + TBool IsInFullScreenModeL(); + + /* + * updates background bitmap + * @since S60 3.2 + * @return void + */ + void UpdateBackgroundL(); + + private: // Data + + // Current plugin Index + TInt iIndexPlugin; + + // Default focusing plugin Index + TInt iIndexDefaultFocusingPlugin; + + // Contains array of plugin loaded. + RPointerArray iPlugins; + + // Current plugin info + TPluginInfo* iCurrentPlugin ; + + // Container + CCoeControl* iContainer; //not own + + //Flag for a status change notification. + // This flag is used only if the notification come when the component is dimmed + TBool iContentStatusChangedNotification ; + + // Previous rect of the AI container + TRect iPrevRect; + + CRepository* iAIRepository; + CCenRepNotifyHandler* iNotifyHandler; + + // ?one_line_short_description_of_data + CPropertyObserver* iBackupObserver; + + // Background context. + CAknsLayeredBackgroundControlContext* iBgContext; + + // Current AI mode, fullscreen - ETrue / normal - EFalse + TBool iIsFullScreenMode; + + // Flag for checking if FW already started + TBool iStarted; + }; + +#endif // CAIPLUGINCONTROL_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/inc/plugincontainer/propertyobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/exths/inc/plugincontainer/propertyobserver.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,133 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + + +#ifndef CPROPERTYOBSERVER_H +#define CPROPERTYOBSERVER_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION + +/** + * MPropertyChangeHandler. + * Abstract interface for handling property change events. + **/ +NONSHARABLE_CLASS( MPropertyChangeHandler ) +{ + public: + /** + * This is a callback function which is called when a property is changed. + * + * @param aCategory UID of the category. + * @param aKey changed key + * @param aValue the new value + * + * Note! references aKey and aValue are only valid while executing + * HandlePropertyChange(). After that the data in which they refer can change. + **/ + virtual void HandlePropertyChange(const TUid& aCategory, + const TUint& aKey, + const TInt& aValue) = 0; +}; + + +// CLASS DECLARATION + +/** + * ?one_line_short_description. + * ?other_description_lines + * + * @lib ? + * @since Series 60 3.0 + **/ +NONSHARABLE_CLASS(CPropertyObserver) : public CActive +{ + public: // Constructors and destructor + /** + * Two-phased constructor. + * @since Series 60 3.0 + * @param MPropertyChangeHandler aHandler + * @param aCategory + * @param aKey + **/ + static CPropertyObserver* NewL(MPropertyChangeHandler& aHandler, + const TUid& aCategory, + const TUint& aKey); + + /** + * Destructor. + **/ + ~CPropertyObserver(); + + private: + /** + * C++ default constructor overload. + **/ + CPropertyObserver(MPropertyChangeHandler& aHandler, + const TUid& aCategory, + const TUint& aKey); + + /** + * By default Symbian 2nd phase constructor is private. + **/ + void ConstructL(); + + protected: // Functions from base classes + /** + * From CActive + **/ + void RunL(); + + /** + * From CActive + **/ + void DoCancel(); + + private: // New functions + /** + * @since Series 60 3.0 + **/ + void Subscribe(); + + /** + * @since Series 60 3.0 + **/ + void NotifyCurrentValue(); + + private: // Data + // Owns + RProperty iProperty; + + // Observed PubSub category + const TUid iCategory; + + // Observed key + const TUint iKey; + + // Refs. Interface towards observants + MPropertyChangeHandler& iHandler; + +}; + + +#endif // CPROPERTYOBSERVER_H + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/inc/pluginif/extrstandbyscrutil.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/exths/inc/pluginif/extrstandbyscrutil.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,112 @@ +/* +* 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: Define the Util API for a external standby screen +* +*/ + + + +// INCLUDES +#include +#include + +// ----------------------------------------------------------------------------- +// CExtrStandbyScr::Draw +// ----------------------------------------------------------------------------- +// +inline void CExtrStandbyScr::Draw(const TRect& /*aRect*/) const + { + if (IsDimmed()) + { + return ; + } + + TRect rect( Rect() ); + + CWindowGc& gc = SystemGc(); + + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + MAknsSkinInstance* aknsInst = AknsUtils::SkinInstance(); + + // draw(clear) background + //AknsDrawUtils::Background( aknsInst, cc, gc, rect ); + // Draw background starting from correct offset. May cause flicker if derived class + // has not registered control position with AknsUtils::RegisterControlPosition + AknsDrawUtils::Background( aknsInst, cc, this, gc, rect ); + + if( IsFocused() ) + { + // draw highlight + TAknLayoutRect highlightParentRect; + highlightParentRect.LayoutRect( rect, + AknLayout::Highlight_for_other_Active_Idle_items_Line_1( rect ) ); + + TAknLayoutRect highlightRectCenter; + highlightRectCenter.LayoutRect( highlightParentRect.Rect(), + SkinLayout::List_highlight_skin_placing__general__Line_1( highlightParentRect.Rect() ) ); + + TAknLayoutRect highlightRectTl; + highlightRectTl.LayoutRect( highlightParentRect.Rect(), + SkinLayout::List_highlight_skin_placing__general__Line_2() ); + + TAknLayoutRect highlightRectBr; + highlightRectBr.LayoutRect( highlightParentRect.Rect(), + SkinLayout::List_highlight_skin_placing__general__Line_5() ); + + TRect highlightRect( highlightRectTl.Rect().iTl, highlightRectBr.Rect().iBr ); + + if( !AknsDrawUtils::DrawFrame( aknsInst, + gc, + highlightRect, + highlightRectCenter.Rect(), + KAknsIIDQsnFrList, + KAknsIIDQsnFrListCenter ) ) + { + // no skin - draw normal list pane highlight + TAknLayoutRect highlighRect; + + // shadow + highlighRect.LayoutRect( highlightParentRect.Rect(), + AknLayout::List_pane_highlight_graphics__various__Line_1( highlightParentRect.Rect() ) ); + highlighRect.DrawRect( gc ); + + // highlight + highlighRect.LayoutRect( highlightParentRect.Rect(), + AknLayout::List_pane_highlight_graphics__various__Line_2( highlightParentRect.Rect() ) ); + highlighRect.DrawRect( gc ); + } + } + + TAknLayoutRect separatorRect; + separatorRect.LayoutRect( rect, AknLayout::First_general_event_elements_Line_1() ); + + TRgb lineColour( separatorRect.Color() ); + + AknsUtils::GetCachedColor( aknsInst, + lineColour, + KAknsIIDQsnLineColors, + EAknsCIQsnLineColorsCG6 /* column separator lines */ ); + + gc.SetPenColor( lineColour ); + gc.SetPenStyle( CWindowGc::ESolidPen ); + + TInt separatorWidth( separatorRect.Rect().Width() -1 ); + TPoint dot( separatorRect.Rect().iTl ); + + for( ; dot.iX < separatorWidth; dot.iX+=2 ) + { + // draw the dots + gc.Plot( dot ); + } + } diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/rom/aicontainer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/exths/rom/aicontainer.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: IBY file for plugintest +* +*/ + + +#ifndef AICONTAINER_IBY +#define AICONTAINER_IBY + +#include + +#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 + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/src/plugincontainer/caiplugincontainercontrol.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/exths/src/plugincontainer/caiplugincontainercontrol.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1114 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* It is the control container for the AI plugins +* +*/ + + +// INCLUDE FILES +#include //feature flags +#include +#include +#include +#include +#include +#include // pub&sub keys and categories for backup and restore +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "aicontainer.hrh" +#include "caiplugincontainercontrol.h" +#include "ExtrStandbyScr.h" + + +const TInt KActOnSendKey = 1; + +// ================= MEMBER FUNCTIONS ======================= + +CAIPluginContainerControl* CAIPluginContainerControl::NewL(CCoeControl *aContainer) + { + CAIPluginContainerControl* self = + new (ELeave) CAIPluginContainerControl() ; + + CleanupStack::PushL( self ); + self->ConstructL(aContainer); + CleanupStack::Pop(self); + + return self; + } + +CAIPluginContainerControl::~CAIPluginContainerControl() + { + + AknsUtils::DeregisterControlPosition(this); + + delete iBackupObserver; + iBackupObserver = NULL; + + if(iNotifyHandler) + { + iNotifyHandler->StopListening(); + } + delete iNotifyHandler; + delete iAIRepository; + delete iBgContext; + + DestroyPlugins() ; + iPlugins.ResetAndDestroy(); + iPlugins.Close(); + REComSession::FinalClose() ; + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::SetDimmed +// --------------------------------------------------------- +// +void CAIPluginContainerControl::SetDimmed(TBool aDimmed) + { + MakeVisible(!aDimmed); + if (iContentStatusChangedNotification) + { + iContentStatusChangedNotification = EFalse; + CalculateRectPlugins(); + } + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::CountComponentControls +// Counts the component controls, so it returns one. +// --------------------------------------------------------- +// +TInt CAIPluginContainerControl::CountComponentControls() const + { + TInt pluginsCount = 0; + + for ( TInt index = 0; index < iPlugins.Count(); index++ ) + { + TPluginInfo* plugin = iPlugins[index]; + + if (plugin->iPlugin) pluginsCount++ ; + } + + return pluginsCount; + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::ComponentControl +// Returns components by index. +// --------------------------------------------------------- +// +CCoeControl* CAIPluginContainerControl::ComponentControl(TInt aIndex) const + { + if (iPlugins.Count()) + { + TInt pluginsPos = -1; + + for ( TInt index = 0; index < iPlugins.Count(); index++ ) + { + TPluginInfo* plugin = iPlugins[index]; + + if (plugin->iPlugin) pluginsPos++ ; + + if (pluginsPos == aIndex) return iPlugins[index]->iPlugin; + } + } + return NULL ; + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::SizeChanged +// Changes the sizes of the components. +// --------------------------------------------------------- +// +void CAIPluginContainerControl::SizeChanged() + { + AknsUtils::RegisterControlPosition(this); + + if(iBgContext) + { + iBgContext->SetRect(Rect()); + iBgContext->SetParentPos(PositionRelativeToScreen()); + } + + + if (!CountComponentControls()) + { + return ; + } + + if ((iPrevRect.IsEmpty() || iPrevRect != Rect())) + { + CalculateRectPlugins() ; + iPrevRect = Rect() ; + } + else + { +// FocusOnDefaultFocusingPlugin(EDrawNow); + } + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::FocusChanged +// --------------------------------------------------------- +// +void CAIPluginContainerControl::FocusChanged(TDrawNow /*aDrawNow*/) + { + if (iCurrentPlugin) + { + if (IsFocused()) + { + TRAP_IGNORE(iCurrentPlugin->iPlugin->PrepareForFocusGainL()); + } + else + { + TRAP_IGNORE(iCurrentPlugin->iPlugin->PrepareForFocusLossL()); + } + // The flag must be drawnow because + // the plugin focusing have to be happer/disapper + iCurrentPlugin->iPlugin->SetFocus(IsFocused(),EDrawNow) ; + } + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::Draw +// --------------------------------------------------------- +// +void CAIPluginContainerControl::Draw( const TRect& /*aRect*/ ) const + { + if (IsDimmed()) + { + return ; + } + TRect rect( Rect() ); + + CWindowGc& gc = SystemGc(); + + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this); + MAknsSkinInstance* aknsInst = AknsUtils::SkinInstance(); + + // Draw background starting from correct offset + AknsDrawUtils::Background( aknsInst, cc, this, gc, rect ); + } + + +// ----------------------------------------------------------------------------- +// CAIPluginContainerControl::MopSupplyObject +// ----------------------------------------------------------------------------- +// +TTypeUid::Ptr CAIPluginContainerControl::MopSupplyObject(TTypeUid aId) + { + if( aId.iUid == MAknsControlContext::ETypeId ) + { + return MAknsControlContext::SupplyMopObject( aId, iBgContext ); + } + return CCoeControl::MopSupplyObject( aId ); + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::OfferKeyEventL +// Processes the key event for the incall view. +// --------------------------------------------------------- +// +TKeyResponse CAIPluginContainerControl::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + + if (iCurrentPlugin) + { + if (CountComponentControls() > 1) + { + switch( aKeyEvent.iScanCode ) + { + case EStdKeyUpArrow: + case EStdKeyDownArrow: + { + if( aKeyEvent.iCode == EKeyUpArrow ) + { + ChangeFocusPluginL(EAIFocusUp); + } + else if( aKeyEvent.iCode == EKeyDownArrow ) + { + ChangeFocusPluginL(EAIFocusDown); + } + return EKeyWasConsumed; + } + } + } + + if( aKeyEvent.iCode == EKeyPhoneEnd ) + { + FocusOnDefaultFocusingPlugin(EDrawNow); + } + return iCurrentPlugin->iPlugin->OfferKeyEventL(aKeyEvent,aType); + } + return EKeyWasNotConsumed; + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::HandleResourceChange +// --------------------------------------------------------- +// +void CAIPluginContainerControl::HandleResourceChange( TInt aType ) + { + switch(aType) + { + case KAknsMessageSkinChange: + { + iPrevRect.SetSize(TSize(0,0)); + } + break; + + case KEikDynamicLayoutVariantSwitch: + { + TRAP_IGNORE(UpdateBackgroundL()); + SetRect(static_cast(iEikonEnv->AppUi())->ClientRect()); + } + break; + + default: + break; + } + + CCoeControl::HandleResourceChange( aType ); + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::StartL +// --------------------------------------------------------- +// +void CAIPluginContainerControl::StartL() + { + // Avoid double start calls + if(!iStarted) + { + iStarted = ETrue; + ReadPluginsConfigurationsL() ; + LoadPluginsL(); + SizeChanged(); + } + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::SetFullScreenMode +// --------------------------------------------------------- +// +void CAIPluginContainerControl::SetFullScreenMode(TBool aFullScreenMode) + { + iIsFullScreenMode = aFullScreenMode; + TRAP_IGNORE(UpdateBackgroundL()); + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::HandleControlEventL +// --------------------------------------------------------- +// +void CAIPluginContainerControl::HandleControlEventL(CCoeControl* /*aControl*/,TCoeEvent aEventType) + { + if ( aEventType == EEventStateChanged ) + { + if (IsDimmed()) + { + iContentStatusChangedNotification = ETrue ; + return ; + } + CalculateRectPlugins() ; + //DrawNow(); + } + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::HandlePropertyChange +// From PropertyObserver +// --------------------------------------------------------- +// +void CAIPluginContainerControl::HandlePropertyChange(const TUid& /*aCategory*/, + const TUint& /*aKey*/, + const TInt& aValue) + { + // see \epoc32\include\connect\sbdefs.h for enum descriptions + + const TUint backupMask( conn::KBURPartTypeMask ^ conn::EBURNormal ); + + if( aValue & backupMask ) // any type of backup or restore operation + { + // backup or restore started + // -> unload plugins + if (CountComponentControls()) + { + DestroyPlugins(); + DrawNow() ; + } + } + else // aValue == conn::EBURUnset || aValue & conn::EBURNormal + { + // backup or restore ended + // -> load plugin again + if (CountComponentControls() == 0) + { + TRAP_IGNORE( + ReadPluginsConfigurationsL(); + LoadPluginsL() + ); + CalculateRectPlugins(); + } + } + } + +// ----------------------------------------------------------------------------- +// CAIPluginContainerControl::HandleNotifyGeneric +// ----------------------------------------------------------------------------- +// +void CAIPluginContainerControl::HandleNotifyGeneric(TUint32 aId) + { + if(aId != NCentralRepositoryConstants::KInvalidNotificationId) + { + if(aId != KAINumOfOperatorPlugins) + { + RProperty::Set( KPSUidAiInformation, KActiveIdleExtHS_LSKLocked, KNullDesC ); + RProperty::Set( KPSUidAiInformation, KActiveIdleExtHS_RSKLocked, KNullDesC ); + DestroyPlugins(); + TRAP_IGNORE(ReadPluginsConfigurationsL(); LoadPluginsL();); + CalculateRectPlugins(); + RProperty::Set( KPSUidAiInformation, KActiveIdleExtHS_PluginConfChange, 1 ); + } + } + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::ReadPluginsConfigurationsL +// --------------------------------------------------------- +// +void CAIPluginContainerControl::ReadPluginsConfigurationsL() + { + TInt numOfPlugins = 0; + TInt error(KErrNone); + error = iAIRepository->Get( KAINumOfOperatorPlugins, numOfPlugins ); + + if( error == KErrNone ) + { + // Reset old array + iPlugins.ResetAndDestroy(); + + // Load operator plug-in UIDs + TInt uid = 0; + for(TInt i = 1; i <= numOfPlugins; i++) + { + error = iAIRepository->Get( KAINumOfOperatorPlugins+i, uid ); + + if( error == KErrNone ) + { + TPluginInfo* pluginItem = new ( ELeave ) TPluginInfo; + CleanupStack::PushL( pluginItem ); + + // Define values + ResetToDefault( *pluginItem ); + pluginItem->iPluginId.iUid = TUid::Uid(uid).iUid; + + iPlugins.AppendL( pluginItem ); + CleanupStack::Pop(); // pluginItem + } + } + } + + iIndexDefaultFocusingPlugin = 0; + } + +// ----------------------------------------------------------------------------- +// CAIPluginContainerControl::LoadPluginsL +// ----------------------------------------------------------------------------- +// +void CAIPluginContainerControl::LoadPluginsL() + { + // Set send key functionality to default + RProperty::Set( + KPSUidAiInformation, + KActiveIdleActOnSendKey, + KActOnSendKey ); + for ( TInt index = 0; index < iPlugins.Count() ; index++) + { + LoadPluginL(index) ; + } + } + +// ----------------------------------------------------------------------------- +// CAIPluginContainerControl::LoadPluginL +// ----------------------------------------------------------------------------- +// +void CAIPluginContainerControl::LoadPluginL(TInt aIndex) + { + CExtrStandbyScr* currentPlugin = NULL; + + TPluginInfo *pluginItem = iPlugins[aIndex]; + + if (pluginItem->iState == EAIPluginOn) + { + TRAPD(err, currentPlugin = CExtrStandbyScr::NewL(pluginItem->iPluginId,this)) ; + + if ( err != KErrNone ) + { + pluginItem->iState = EAIPluginError ; + } + else + { + + if ( err == KErrNone ) + { + TSize MinSize = currentPlugin->GetMinSize() ; + TSize MaxSize = currentPlugin->GetMaxSize() ; + pluginItem->iResizeable = MinSize != MaxSize ; + + currentPlugin->SetObserver(this) ; + + TRAP_IGNORE(currentPlugin->LoadEngineL()) ; + } + + if ( err != KErrNone ) + { + delete currentPlugin ; + pluginItem->iState = EAIPluginError ; + } + else + { + //currentPlugin->SetDimmed(ETrue) ; + pluginItem->iPlugin = currentPlugin ; + pluginItem->iPlugin->ActivateL(); + } + } + } + + } + +// ----------------------------------------------------------------------------- +// CAIPluginContainerControl::DestroyPluginsL +// ----------------------------------------------------------------------------- +// +void CAIPluginContainerControl::DestroyPlugins() + { + TInt index; + + for ( index = 0; index < iPlugins.Count(); index++ ) + { + TPluginInfo* plugin = iPlugins[index]; + + if (plugin->iPlugin) + { + delete plugin->iPlugin; + plugin->iPlugin = NULL; + } + } + iPlugins.ResetAndDestroy(); + iIndexPlugin = -1; + iCurrentPlugin = NULL ; + } + +// ---------------------------------------------------------------------------- +// CAIPluginContainerControl::ResetToDefault +// ---------------------------------------------------------------------------- +// +void CAIPluginContainerControl::ResetToDefault( TPluginInfo& aPluginInfo ) + { + aPluginInfo.iPlugin = NULL; + aPluginInfo.iResizeable = EFalse; + aPluginInfo.iOnScreen = EFalse; + aPluginInfo.iPluginId.iUid = 0; + aPluginInfo.iAlignment = EAITop; + aPluginInfo.iWeight = 0; + aPluginInfo.iCRKeyId = 0; + aPluginInfo.iState = EAIPluginOn; + } + + +// ---------------------------------------------------------------------------- +// CAIPluginContainerControl::IsInFullScreenModeL +// ---------------------------------------------------------------------------- +// +TBool CAIPluginContainerControl::IsInFullScreenModeL() + { + return iIsFullScreenMode; + } + +// ---------------------------------------------------------------------------- +// CAIPluginContainerControl::UpdateBackgroundL +// ---------------------------------------------------------------------------- +// +void CAIPluginContainerControl::UpdateBackgroundL() + { + delete iBgContext; + iBgContext = NULL; + + CAknAppUi* appui = static_cast(iEikonEnv->AppUi()); + TRect rect = appui->ClientRect(); + TAknsItemID backSkinId; + + if(IsInFullScreenModeL() && !Layout_Meta_Data::IsLandscapeOrientation()) + { + backSkinId = KAknsIIDQsnBgScreen; + } + else + { + backSkinId = KAknsIIDQsnBgAreaMainIdle; + } + + iBgContext = CAknsLayeredBackgroundControlContext::NewL( + backSkinId, + rect, + ETrue, + EAIBgLayersN ); + + iBgContext->SetLayerImage( + EAIBgLayerWallpaper, + KAknsIIDWallpaper ); + + TSize wallpapersize; + AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EWallpaperPane, wallpapersize ); + + TRect wallpaperrect(wallpapersize); + wallpaperrect.Move(0, rect.Size().iHeight - wallpapersize.iHeight); + + iBgContext->SetLayerRect( + EAIBgLayerWallpaper, + wallpaperrect ); + + iBgContext->SetParentPos(PositionRelativeToScreen()); + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::CAIPluginContainerControl +// --------------------------------------------------------- +// +CAIPluginContainerControl::CAIPluginContainerControl() + { + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::ConstructL +// --------------------------------------------------------- +// +void CAIPluginContainerControl::ConstructL( CCoeControl* aContainer ) + { + iContainer = aContainer; + CreateWindowL(); + SetParent(iContainer); + + UpdateBackgroundL(); + + iAIRepository = CRepository::NewL( KCRUidActiveIdle ); + iNotifyHandler = CCenRepNotifyHandler::NewL(*this, *iAIRepository); + iNotifyHandler->StartListeningL(); + + // backup/restore observer + iBackupObserver = CPropertyObserver::NewL(*this, KUidSystemCategory, conn::KUidBackupRestoreKey); + + iIndexPlugin = -1; + ActivateL(); + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::ChangeFocusPluginL +// --------------------------------------------------------- +// +void CAIPluginContainerControl::ChangeFocusPluginL(TInt aDirection) + { + if (!iCurrentPlugin) + { + return ; + } + iCurrentPlugin->iPlugin->PrepareForFocusLossL(); + iCurrentPlugin->iPlugin->SetFocus(EFalse,EDrawNow) ; + switch(aDirection) + { + case EAIFocusDown: + iIndexPlugin = NextVisiblePlugin(iIndexPlugin+1) ; + break ; + case EAIFocusUp: + iIndexPlugin = PreviousVisiblePlugin(iIndexPlugin-1) ; + break ; + default: + User::Leave(KErrNotSupported) ; + } + if (iIndexPlugin == -1) + { + iCurrentPlugin = NULL ; + } + else + { + iCurrentPlugin = iPlugins[iIndexPlugin]; + iCurrentPlugin->iPlugin->PrepareForFocusGainL(); + iCurrentPlugin->iPlugin->SetFocus(ETrue,EDrawNow) ; + } + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::FocusOnDefaultFocusingPlugin +// --------------------------------------------------------- +// +void CAIPluginContainerControl::FocusOnDefaultFocusingPlugin(TDrawNow aDrawNow) + { + if (!CountComponentControls()) + { + return ; + } + TInt index = NextVisiblePlugin(iIndexDefaultFocusingPlugin) ; + if (index != iIndexPlugin) + { + if (iCurrentPlugin) + { + TRAP_IGNORE(iCurrentPlugin->iPlugin->PrepareForFocusLossL()); //TRAPPED + iCurrentPlugin->iPlugin->SetFocus(EFalse,aDrawNow) ; + } + iIndexPlugin = index; + } + if (iIndexPlugin == -1) + { + iCurrentPlugin = NULL ; + } + else + { + /*if (iCurrentPlugin && iCurrentPlugin->iPlugin->IsFocused()) + { + return; + } + */ + iCurrentPlugin = iPlugins[iIndexPlugin]; + TRAP_IGNORE(iCurrentPlugin->iPlugin->PrepareForFocusGainL()); //TRAPPED + iCurrentPlugin->iPlugin->ResetToDefaultState(); + iCurrentPlugin->iPlugin->SetFocus(ETrue,aDrawNow) ; + } + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::CalculateRectPlugins +// --------------------------------------------------------- +// +void CAIPluginContainerControl::CalculateRectPlugins() + { + if (CountComponentControls() == 0) + { + DrawNow(); + return ; + } + + TInt paneHeight = Rect().Height(); + + TInt topPluginX=0; + TInt bottomPluginX=paneHeight; + + for ( TInt index = 0; index < iPlugins.Count(); index++) + { + iPlugins[index]->iOnScreen = EFalse ; + } + + HandleTopPlugins(topPluginX,bottomPluginX) ; + HandleBottomPlugins(topPluginX,bottomPluginX) ; + + if (iIndexPlugin == -1) + { + FocusOnDefaultFocusingPlugin(); + } + + DrawNow(); + } + + +// --------------------------------------------------------- +// CAIPluginContainerControl::HandleTopplugins +// --------------------------------------------------------- +// +void CAIPluginContainerControl::HandleTopPlugins(TInt& aTopPluginX, TInt& aBottomPluginX) + { + + for ( TInt index = 0; index < iPlugins.Count(); index++) + { + HandlePlugin(index,EAITop,aTopPluginX,aBottomPluginX); + } // for all plugins + + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::HandleBottomPlugins +// --------------------------------------------------------- +// +void CAIPluginContainerControl::HandleBottomPlugins(TInt& aTopPluginX, TInt& aBottomPluginX) + { + for ( TInt index = iPlugins.Count() -1 ; index >= 0 ; index--) + { + HandlePlugin(index,EAIBottom,aTopPluginX,aBottomPluginX); + } + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::HandlePlugin +// --------------------------------------------------------- +// +void CAIPluginContainerControl::HandlePlugin(TInt aIndex, + TAIPluginAlignment aAlign, + TInt& aTopPluginX, + TInt& aBottomPluginX) + { + TRect rectPlugin ; //Rect of the current plugin + + TPluginInfo* pluginItem = iPlugins[aIndex]; + + if ((pluginItem->iPlugin) && (pluginItem->iAlignment == aAlign)) + { + TSize plugSize = pluginItem->iPlugin->GetPreferedSize(); + + if ((plugSize.iHeight>0) && (plugSize.iWidth >0)) + { + pluginItem->iOnScreen = ETrue; + + TInt overRunHeight = 0 ; + + if (pluginItem->iAlignment == EAITop) + { + if ((aTopPluginX+plugSize.iHeight) > aBottomPluginX) + { + overRunHeight = aTopPluginX+plugSize.iHeight-aBottomPluginX ; + } + } + else + { + + if ((aBottomPluginX-plugSize.iHeight) < aTopPluginX) + { + overRunHeight = aTopPluginX-(aBottomPluginX-plugSize.iHeight) ; + } + } + if (overRunHeight) + { + + while (overRunHeight > 0) + { // loop finding reduceable plugins from the first to the current + TInt reduceablePluginIndex = FindReduceablePlugin(overRunHeight,aIndex) ; + if (reduceablePluginIndex == -1) + { + // no plugin can be reduced. + // get the plugin with the lowerest Weight and hide it + TInt hideblePluginIndex = FindLowerWeightPlugin(aIndex) ; + if ((hideblePluginIndex == -1) || (hideblePluginIndex == aIndex)) + { + HidePlugin(aIndex) ; + return ; + } + else + { + TInt hideblePluginHeight = iPlugins[hideblePluginIndex]->iPlugin->Rect().Size().iHeight ; + // Hide the found plugin and move the other before the current + ReducePlugin(hideblePluginIndex,aIndex,hideblePluginHeight) ; + if (iPlugins[hideblePluginIndex]->iAlignment == EAITop) + { + // recalculate position the the top current plugin + aTopPluginX -= hideblePluginHeight ; + } + else + { + // recalculate position the the bottom current plugin + aBottomPluginX += hideblePluginHeight; + } + overRunHeight -= hideblePluginHeight; + } + } + else + { + // get the height that the found reduaceble plugin can reduce itself + TInt reduceablePluginHeight = iPlugins[reduceablePluginIndex]->iPlugin->GetNextSizeDecrement().iHeight ; + if (reduceablePluginIndex == aIndex) + { + // if it has to be reduced the current plugin + // just recalculate the size of itself + plugSize -= TSize(0,reduceablePluginHeight) ; + if (plugSize.iHeight <= 0) + { + HidePlugin(aIndex) ; + return ; + } + else + { + if (pluginItem->iAlignment == EAITop) + { + rectPlugin.SetRect(TPoint(0,aTopPluginX),plugSize) ; + } + else + { + rectPlugin.SetRect(TPoint(0,aBottomPluginX-plugSize.iHeight),plugSize) ; + } + + pluginItem->iPlugin->SetRect(rectPlugin); + } + } + else + { + // reduce the found plugin and move the other before the current + ReducePlugin(reduceablePluginIndex,aIndex,reduceablePluginHeight) ; + if (iPlugins[reduceablePluginIndex]->iAlignment == EAITop) + { + // recalculate position the the top current plugin + aTopPluginX -= reduceablePluginHeight ; + } + else + { + // recalculate position the the bottom current plugin + aBottomPluginX += reduceablePluginHeight; + } + } + overRunHeight -= reduceablePluginHeight; + } + } + + if (overRunHeight > 0) + { + //no plugin can be reduced go to the next one + return; + } + } // while finding reduceable plugin(s) + + if (pluginItem->iAlignment == EAITop) + { + rectPlugin.SetRect(TPoint(0,aTopPluginX),plugSize) ; + aTopPluginX += plugSize.iHeight; + } + else + { + rectPlugin.SetRect(TPoint(0,aBottomPluginX-plugSize.iHeight),plugSize) ; + aBottomPluginX -= plugSize.iHeight; + } + pluginItem->iPlugin->SetRect(rectPlugin); + //pluginItem->iPlugin->SetDimmed(EFalse); + } + else + { + // No on the screen + HidePlugin(aIndex) ; + } + } + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::NextVisiblePlugin +// --------------------------------------------------------- +// +TInt CAIPluginContainerControl::NextVisiblePlugin(TInt aStartIndex) + { + for ( TInt index = aStartIndex; index < iPlugins.Count(); index++) + { + TPluginInfo* plug = iPlugins[index]; + if (plug->iPlugin && (plug->iOnScreen) && (plug->iPlugin->IsNonFocusing() == EFalse)) + { + return index ; + } + } + return aStartIndex > 0 ? NextVisiblePlugin(0) : -1 ; + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::PreviousVisiblePlugin +// --------------------------------------------------------- +// +TInt CAIPluginContainerControl::PreviousVisiblePlugin(TInt aStartIndex) + { + for ( TInt index = aStartIndex; index >= 0; index--) + { + TPluginInfo* plug = iPlugins[index]; + if (plug->iPlugin && (plug->iOnScreen) && (plug->iPlugin->IsNonFocusing() == EFalse)) + { + return index ; + } + } + return (aStartIndex < (iPlugins.Count()-1)) ? PreviousVisiblePlugin(iPlugins.Count()-1) : -1 ; + } + + +// --------------------------------------------------------- +// CAIPluginContainerControl::FindLowerWeightPlugin +// --------------------------------------------------------- +// +TInt CAIPluginContainerControl::FindLowerWeightPlugin(TInt aCurrentIndex) + { + TInt foundIndex = -1; + TInt plugWeight = -1; + TInt currentWeight = iPlugins[aCurrentIndex]->iWeight ; + + for ( TInt index = 0 ; index <= iPlugins.Count()-1; index++) + { + TPluginInfo* plug = iPlugins[index]; + if ((plug->iOnScreen) && (plug->iWeight<=currentWeight) && + ((foundIndex==-1) || (plug->iWeight<=plugWeight))) + { + foundIndex = index ; + plugWeight = plug->iWeight; + } + } + return foundIndex ; + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::FindReduceablePlugin +// --------------------------------------------------------- +// +TInt CAIPluginContainerControl::FindReduceablePlugin(TInt aOverRunHeight, TInt aCurrentIndex) + { + TInt foundIndex = -1; + TInt plugWeight = -1; + + for ( TInt index = 0 ; index <= iPlugins.Count()-1; index++) + { + TPluginInfo* plug = iPlugins[index]; + //When resize I don't check the Weight with the current plugin + // before we try to reduce a plugin + // if any plugin can be reduced then we have to hide a plugin with a weight less of the current + if ((plug->iResizeable) && (plug->iOnScreen)) //&& (plug->iWeight <= currentWeight)) + { + TInt reduceablePluginHeight = iPlugins[index]->iPlugin->GetNextSizeDecrement().iHeight ; + if (reduceablePluginHeight > 0) + { + // the plugin can still be reduced + if (index == aCurrentIndex) + { + if ((plugWeight == -1) || (plug->iWeight <= plugWeight)) + { + foundIndex = index ; + plugWeight = plug->iWeight ; + } + } + else + { + TSize plugMinSize = plug->iPlugin->GetMinSize() ; + TSize plugSize = plug->iPlugin->Rect().Size(); + TInt plugOverRunHeight = plugSize.iHeight-plugMinSize.iHeight; + if ((plugOverRunHeight >=aOverRunHeight) && + ((plugWeight == -1) || (plug->iWeight <= plugWeight))) // before I check the weight + { + foundIndex = index ; + plugWeight = plug->iWeight ; + } + } + } + } + } + return foundIndex ; + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::ReducePlugin +// --------------------------------------------------------- +// +void CAIPluginContainerControl::ReducePlugin(TInt aPluginToBeReducedIndex, + TInt aCurrentIndex, + TInt aReduceHeight) + { + TInt startIndex; + TInt lastIndex; + TInt lastTopPluginIndex ; + TInt index; + + TAIPluginAlignment reduceAlign = iPlugins[aPluginToBeReducedIndex]->iAlignment ; + + //find the last top plugin in the list + lastTopPluginIndex = -1; + for ( index = 0 ; index < iPlugins.Count() ; index++) + { + if (iPlugins[index]->iAlignment==EAITop) + { + lastTopPluginIndex = index; + } + } + + if (reduceAlign == EAITop) + { + __ASSERT_ALWAYS(aPluginToBeReducedIndex <= lastTopPluginIndex, User::Invariant()); + startIndex = aPluginToBeReducedIndex; + // we don't have to handle the current if is in the top list + // otherwise if the current index is in the bottom we handle all the top plugin + lastIndex = (aCurrentIndex <= lastTopPluginIndex) ? (aCurrentIndex > aPluginToBeReducedIndex ? aCurrentIndex -1 : aCurrentIndex ): lastTopPluginIndex; + } + else + { + // if lastTopPluginIndex==-1 means all the plugin have a botton alignment + startIndex = lastTopPluginIndex+1; + if (startIndex == aCurrentIndex) + {//we don't have to handle the current plugin + startIndex++; + } + __ASSERT_ALWAYS(aPluginToBeReducedIndex >= startIndex, User::Invariant()); + lastIndex = aPluginToBeReducedIndex; + } + + for ( index = startIndex ; index <= lastIndex; index++) + { + TPluginInfo* plug = iPlugins[index]; + + if (plug->iOnScreen && plug->iPlugin) + { + TRect rectPlugin = plug->iPlugin->Rect() ; + if (index == aPluginToBeReducedIndex) + { + TSize newSize(0, aReduceHeight) ; + rectPlugin.Resize(-newSize) ; + if (rectPlugin.Height() == 0) + { + HidePlugin(index) ; + } + else + { + if (reduceAlign == EAIBottom) + { + rectPlugin.Move(0,+aReduceHeight); + } + plug->iPlugin->SetRect(rectPlugin) ; + } + } + else + { + if (reduceAlign == EAITop) + { + rectPlugin.Move(0,-aReduceHeight); + plug->iPlugin->SetRect(rectPlugin); + } + else + { + rectPlugin.Move(0,+aReduceHeight); + plug->iPlugin->SetRect(rectPlugin); + } + } + } + } + } + +// --------------------------------------------------------- +// CAIPluginContainerControl::HidePlugin +// --------------------------------------------------------- +// +void CAIPluginContainerControl::HidePlugin(TInt aIndex) + { + TPluginInfo* plug = iPlugins[aIndex]; + + //plug->iPlugin->SetDimmed(ETrue) ; + plug->iPlugin->SetRect(TRect(0,0,0,0)) ; + plug->iOnScreen = EFalse ; + + if (iIndexPlugin == aIndex) + { // the plugin that is going to dissappear have the focus + TRAP_IGNORE(ChangeFocusPluginL(EAIFocusDown)); //TRAPPED + } + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/src/plugincontainer/dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/exths/src/plugincontainer/dllmain.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// INCLUDE FILES +#include +#include + +#include "caiplugincontainercontrol.h" + +// Provides a key value pair table, this is used to identify +// the correct construction function for the requested interface. +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(0x101FD658, CAIPluginContainerControl::NewL) + }; + +// Function used to return an instance of the proxy table. +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/exths/src/plugincontainer/propertyobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/exths/src/plugincontainer/propertyobserver.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + + +// INCLUDE FILES +#include "propertyobserver.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CPropertyObserver::CPropertyObserver +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CPropertyObserver::CPropertyObserver(MPropertyChangeHandler& aHandler, + const TUid& aCategory, + const TUint& aKey) +: CActive( CActive::EPriorityStandard ), + iCategory( aCategory ), + iKey( aKey ), + iHandler( aHandler ) +{ +} + +// ----------------------------------------------------------------------------- +// CPropertyObserver::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CPropertyObserver::ConstructL(void) +{ + CActiveScheduler::Add( this ); + + User::LeaveIfError( iProperty.Attach( iCategory, iKey ) ); + + // Start observing... + Subscribe(); + + // Notify the initial value if needed... +// NotifyCurrentValue(); +} + +// ----------------------------------------------------------------------------- +// CPropertyObserver::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CPropertyObserver* CPropertyObserver::NewL(MPropertyChangeHandler& aHandler, + const TUid& aCategory, + const TUint& aKey) +{ + CPropertyObserver* self = new( ELeave )CPropertyObserver( aHandler, aCategory, aKey ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; +} + +// Destructor +CPropertyObserver::~CPropertyObserver() +{ + Deque(); + iProperty.Cancel(); + iProperty.Close(); +} + +// ----------------------------------------------------------------------------- +// CPropertyObserver::RunL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CPropertyObserver::RunL(void) +{ + if( iStatus.Int() == KErrNone ) + { + Subscribe(); + NotifyCurrentValue(); + } +} + +// ----------------------------------------------------------------------------- +// CPropertyObserver::DoCancel +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CPropertyObserver::DoCancel(void) +{ + iProperty.Cancel(); +} + +// ----------------------------------------------------------------------------- +// CPropertyObserver::Subscribe +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CPropertyObserver::Subscribe(void) +{ + iProperty.Subscribe( iStatus ); + SetActive(); +} + +// ----------------------------------------------------------------------------- +// CPropertyObserver::NotifyCurrentValue +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CPropertyObserver::NotifyCurrentValue(void) +{ + TInt value; + + if( iProperty.Get( iCategory, iKey, value ) == KErrNone ) + { + iHandler.HandlePropertyChange( iCategory, iKey, value ); + } +} + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build info file for Ado domain uishellservices +* +*/ + +// uishellservices ado +#include "../nativeuicontroller/group/bld.inf" +#include "../exths/group/bld.inf" +#include "../inc/ai3.hrh" // flag FF_HOMESCREEN_COMMON_IDLEFW +#include "../hscontentcontrol/group/bld.inf" +#include "../sapiwrapper/cpswrapper/group/bld.inf" +#include "../sapiwrapper/hspswrapper/group/bld.inf" +#include "../xmluirendering/group/bld.inf" +#include "../xmluicontroller/group/bld.inf" + +#ifdef FF_HOMESCREEN_COMMON_IDLEFW +#include "../data/group/bld.inf" +#endif + +PRJ_PLATFORMS +DEFAULT +// Help exports +#include "../help/group/bld.inf" + +PRJ_EXPORTS +../loc/activeidle3.loc APP_LAYER_LOC_EXPORT_PATH(activeidle3.loc) + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/help/data/xhtml.zip Binary file idlehomescreen/help/data/xhtml.zip has changed diff -r 000000000000 -r f72a12da539e idlehomescreen/help/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/help/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - Initial contribution +* +* Contributors: +* +* +* Description: +* Export help related files. +* +*/ + +#include +PRJ_EXPORTS +:zip ../data/xhtml.zip /epoc32/data/z/resource/ overwrite +:zip ../data/xhtml.zip /epoc32/winscw/c/resource/ overwrite + +../inc/hmsc.hlp.hrh MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/hmsc.hlp.hrh) +../rom/idlehomescreenhelps_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(idlehomescreenhelps_variant.iby) \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/help/inc/hmsc.hlp.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/help/inc/hmsc.hlp.hrh Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// +// hmsc.hlp.hrh generated by CSXHelp Utilities. +// + +#ifndef __HMSC_HLP_HRH__ +#define __HMSC_HLP_HRH__ + +_LIT(KSET_HLP_HOME_SCREEN, "SET_HLP_HOME_SCREEN"); // +_LIT(KSET_HLP_HOME_SCREEN_EDIT, "SET_HLP_HOME_SCREEN_EDIT"); // +_LIT(KSET_HLP_HOME_SCREEN_SHORTCUTS, "SET_HLP_HOME_SCREEN_SHORTCUTS"); // +_LIT(KWM_HLP_WIDGET_COLLECTION, "WM_HLP_WIDGET_COLLECTION"); // +_LIT(KSET_HLP_HOME_SCREEN_NON_TOUCH, "SET_HLP_HOME_SCREEN_NON_TOUCH"); // + +#endif \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/help/rom/idlehomescreenhelps_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/help/rom/idlehomescreenhelps_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __IDLEHOMESCREENHELPS_VARIANT_IBY__ +#define __IDLEHOMESCREENHELPS_VARIANT_IBY__ + +#if defined(FF_S60_HELPS_IN_USE) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x102750F0\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x102750F0\contents.zip) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x102750F0\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x102750F0\index.xml) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x102750F0\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x102750F0\keywords.xml) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x102750F0\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x102750F0\meta.xml) +#endif + +#endif \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/hscontentcontrol/bwins/hscontentcontrol.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/hscontentcontrol/bwins/hscontentcontrol.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,6 @@ +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) + diff -r 000000000000 -r f72a12da539e idlehomescreen/hscontentcontrol/eabi/hscontentcontrol.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/hscontentcontrol/eabi/hscontentcontrol.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,8 @@ +EXPORTS + _ZN19CHsContentControlUi4NewLE4TUid @ 1 NONAME + _ZN24CHsContentControlFactory22GetHsContentControllerERK6TDesC8 @ 2 NONAME + _ZN24CHsContentControlFactory4NewLEv @ 3 NONAME + _ZN24CHsContentControlFactoryD0Ev @ 4 NONAME + _ZN24CHsContentControlFactoryD1Ev @ 5 NONAME + _ZN24CHsContentControlFactoryD2Ev @ 6 NONAME + diff -r 000000000000 -r f72a12da539e idlehomescreen/hscontentcontrol/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/hscontentcontrol/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,26 @@ +/* +* 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: Item id, name and properties +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +hscontentcontrol.mmp diff -r 000000000000 -r f72a12da539e idlehomescreen/hscontentcontrol/group/hscontentcontrol.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/hscontentcontrol/group/hscontentcontrol.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,65 @@ +/* +* 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: project file +* +*/ + +#include + +TARGET hscontentcontrol.dll +TARGETTYPE dll + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +USERINCLUDE ../inc + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src + +SOURCE hscontentcontrolfactory.cpp +SOURCE hscontentcontrolui.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), +//the GCC ARM def file in a BMARM directory, and the ARMV5 def file in a EABI directory. +//If def files are stored in these locations, the project files does not need to specify +//the location of the def files explicitly. If you want to store the def files in some other +//location, you will need to specify in the project file where the .def files are using +//the deffile keyword. + +//The following commented out code shows how the build system uses the implicit +// location for defiles. To create the DEF files Choose Project > Freeze Exports from Carbide +// or run 'abld freeze' from the command-line +//#if defined (WINS) +// DEFFILE ../bwins/hscontentcontrol.def +//#elif defined (GCC32) +// DEFFILE ../bmarm/hscontentcontrol.def +//#else +// DEFFILE ../eabi/hscontentcontrol.def +//#endif + +nostrictdef + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY ecom.lib +LIBRARY charconv.lib + + +#ifdef ENABLE_ABIV2_MODE +DEBUGGABLE +#endif + diff -r 000000000000 -r f72a12da539e idlehomescreen/hscontentcontrol/inc/hscontentcontrolfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/hscontentcontrol/inc/hscontentcontrolfactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef HSCONTENTCONTROLFACTORY_H +#define HSCONTENTCONTROLFACTORY_H + +// System includes +#include + +// Forward declarations +#include +/** + * Content control UI base class + * + * + * @code + * + * @endcode + * + * @lib hscontentcontrol.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CHsContentControlFactory ) : public CBase + { +public: // Constructor and destructor + /** + * Two-phased constructor. + */ + IMPORT_C static CHsContentControlFactory* NewL(); + + /** + * Destructor. + */ + IMPORT_C ~CHsContentControlFactory(); + +private: // Constructors + /** + * Constructor + */ + CHsContentControlFactory(); + + /** Second phase constructor */ + void ConstructL(); + + +public: // New functions + /** + * + */ + IMPORT_C MHsContentControlUi* GetHsContentController( + const TDesC8& aControllerType ); + +private: + /** + * + */ + MHsContentControlUi* FindHsContentController( + const TDesC8& aControllerType ); + + +private: // Data + + /** + * + */ + RPointerArray< CHsContentControlUi > iHsContentControlUis; + + }; + + +#endif // HSCONTENTCONTROLFACTORY_H + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/hscontentcontrol/src/hscontentcontrolfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/hscontentcontrol/src/hscontentcontrolfactory.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,161 @@ +/* + * 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: + * + */ + +// System include files +#include +#include + +// User include files +#include "hscontentcontrolfactory.h" + +// Local constants + +// TODO: Content controller ECom interface UID +const TUid KInterfaceUidContentController = { 0x20026F51 }; + +// ======== LOCAL FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CleanupResetAndDestroy() +// ---------------------------------------------------------------------------- +// +template +static void CleanupResetAndDestroy( TAny* aObj ) + { + if( aObj ) + { + static_cast( aObj )->ResetAndDestroy(); + } + } + +// ---------------------------------------------------------------------------- +// CleanupResetAndDestroyPushL +// ---------------------------------------------------------------------------- +// +template +static void CleanupResetAndDestroyPushL(T& aArray) + { + CleanupStack::PushL( TCleanupItem( &CleanupResetAndDestroy, &aArray ) ); + } + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CHsContentControlFactory::NewL() +// ---------------------------------------------------------------------------- +// +EXPORT_C CHsContentControlFactory* CHsContentControlFactory::NewL() + { + CHsContentControlFactory* self = new ( ELeave ) CHsContentControlFactory(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CHsContentControlFactory::ConstructL() +// ---------------------------------------------------------------------------- +// +void CHsContentControlFactory::ConstructL() + { + } + +// ---------------------------------------------------------------------------- +// CHsContentControlFactory::CHsContentControlFactory() +// ---------------------------------------------------------------------------- +// +CHsContentControlFactory::CHsContentControlFactory() + { + } + +// ---------------------------------------------------------------------------- +// CHsContentControlFactory::~CHsContentControlFactory() +// ---------------------------------------------------------------------------- +// +EXPORT_C CHsContentControlFactory::~CHsContentControlFactory() + { + iHsContentControlUis.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------------- +// CHsContentControlFactory::GetHsContentController() +// --------------------------------------------------------------------------------- +// +EXPORT_C MHsContentControlUi* CHsContentControlFactory::GetHsContentController( + const TDesC8& aControlType ) + { + MHsContentControlUi* retval( FindHsContentController( aControlType ) ); + + if ( !retval ) + { + TRAP_IGNORE( + // Get implementations via ECom + RImplInfoPtrArray plugins; + CleanupResetAndDestroyPushL( plugins ); + + REComSession::ListImplementationsL( + KInterfaceUidContentController, plugins ); + + for ( TInt i = 0; i < plugins.Count(); i++ ) + { + CImplementationInformation* information( plugins[i] ); + + if ( information->OpaqueData().Compare( aControlType ) == 0 ) + { + CHsContentControlUi* ccUi = CHsContentControlUi::NewL( + information->ImplementationUid() ); + + ccUi->SetContentControlTypeL( information->OpaqueData() ); + + iHsContentControlUis.AppendL( ccUi ); + + retval = ccUi; + + // All done + break; + } + } + + CleanupStack::PopAndDestroy(); // plugins + ); // TRAP_IGNORE + } + + return retval; + } + +// ---------------------------------------------------------------------------- +// CHsContentControlFactory::FindHsContentController() +// ---------------------------------------------------------------------------- +// +MHsContentControlUi* CHsContentControlFactory::FindHsContentController( + const TDesC8& aControlType ) + { + for ( TInt i = 0; i < iHsContentControlUis.Count(); i++ ) + { + CHsContentControlUi* cc( iHsContentControlUis[ i ] ); + + if ( cc->ContentControlType().Compare( aControlType ) == 0 ) + { + return cc; + } + } + + return NULL; + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/hscontentcontrol/src/hscontentcontrolui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/hscontentcontrol/src/hscontentcontrolui.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,81 @@ +/* + * 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: + * + */ + +// System include files +#include +#include + +// User include files +#include "hscontentcontrolui.h" + +// Local constants + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------- +// CHsContentControlUi::NewL() +// ----------------------------------------------------------------------- +// +EXPORT_C CHsContentControlUi* CHsContentControlUi::NewL( + TUid aImplUid ) + { + TAny* ptr = REComSession::CreateImplementationL( aImplUid, + _FOFF( CHsContentControlUi, iDestructKey ) ); + + CHsContentControlUi* ccUi = + reinterpret_cast< CHsContentControlUi* > ( ptr ); + + if ( ccUi ) + { + ccUi->iImplUid = aImplUid; + } + + return ccUi; + } + +// ----------------------------------------------------------------------- +// CHsContentControlUi::ImplUid() +// ----------------------------------------------------------------------- +// +TUid CHsContentControlUi::ImplUid() const + { + return iImplUid; + } + +// ----------------------------------------------------------------------- +// CHsContentControlUi::SetContentControlTypeL() +// ----------------------------------------------------------------------- +// +void CHsContentControlUi::SetContentControlTypeL( + const TDesC8& aContentControlType ) + { + delete iContentControlType; + iContentControlType = NULL; + + iContentControlType = aContentControlType.AllocL(); + } + +// ----------------------------------------------------------------------- +// CHsContentControlUi::ContentControlType() +// ----------------------------------------------------------------------- +// +const TDesC8& CHsContentControlUi::ContentControlType() const + { + return iContentControlType ? *iContentControlType : KNullDesC8(); + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/ai3.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/ai3.hrh Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Defines flags to enable debug macros +* +*/ + + +#ifndef AI3_HRH +#define AI3_HRH + +#include +//Enable performance logs +//#define AI3_DEBUG_PERFORMANCE + +//Run AI3 on startup +#define FF_HOMESCREEN_COMMON_IDLEFW + +#define __USE_WIDGET_MANAGER__ + +#endif //AI3_HRH diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/ai3perf.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/ai3perf.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Defines macros to log performance related details +* +*/ + + +#ifndef AI3PERF_H +#define AI3PERF_H +#include "ai3.hrh" +#ifdef AI3_DEBUG_PERFORMANCE +#include "ai3performance.h" + #define AI3_PERF_START(p1,p2) CAi3Perf::TPerfData* p1 = CAi3Perf::StartTestCase(_L(p2)); + #define AI3_PERF_STOP(p1,p2) CAi3Perf::StopTestCase(p1,_L(p2)); +#else + #define AI3_PERF_START(p1,p2) + #define AI3_PERF_STOP(p1,p2) +#endif + +#endif //AI3PERF_H \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/ai3performance.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/ai3performance.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,190 @@ +/* +* 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 AI3PERFORMANCE_H +#define AI3PERFORMANCE_H + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include + +_LIT(KLogFileName,"ai3perf.log"); +_LIT(KLogFileDir,"ai3logs"); +_LIT(KLogFileRootDir,"c:\\logs\\"); + +/** + * @class CAi3Perf + * + * Provides API to measure performance (memory and time). Results are saved to a file. + * + * @since Series 60 5.0 + */ +class CAi3Perf : public CBase + { + public: + /** + * Struct which holds data before measuring is started. + */ + struct TPerfData + { + /** + * Time when measure starts + */ + TTime iStartTime; + + /** + * Memory when measure starts + */ + TInt iStartMemory; + }; + + public: // Constructors and destructor + /** + * Constructor. + */ + static CAi3Perf* NewL(); + + /** + * Destructor. + */ + virtual ~CAi3Perf(); + + public: // New functions + /** + * Prints current amount of memory to file. + * + * @param aMsg User defined message which is printed before amount of memory + */ + inline static void PrintUserMem(const TDesC& aMsg); + + /** + * Saves current amount of memory and time and returns those to user. + * + * @param aMsg User defined message. + * @return TPerfData which holds current memory consumption and time. + */ + inline static TPerfData* StartTestCase(const TDesC& aMsg = KNullDesC); + + /** + * Reads current amount of memory and time and calculates performance using + * values got from StartTestCase. + * + * @param aData Data which has got when calling StartTestCase. + * @param aMsg User defined message. + */ + inline static void StopTestCase(TPerfData* aData, const TDesC& aMsg = KNullDesC); + + /** + * Create file where results are written to. + */ + inline static void CreateLogFile(); + private: + /** + * Internal constructor. + */ + CAi3Perf(); + + /** + * Internal constructor. + */ + void ConstructL(); + }; + +inline void CAi3Perf::PrintUserMem(const TDesC& aMsg) + { + TBuf<512> buffer; + TInt freeRAM; + HAL::Get(HALData::EMemoryRAMFree, freeRAM); + RHeap heap = User::Heap(); + heap.Open(); + TInt _size = heap.Size(); + TInt largest = 0; + TInt available = heap.Available(largest); + heap.Close(); + _LIT( KMemoryFormat, "FreeRAM: %d kB, User: - heap %d kB, available %d kB, largest block %d kB" ); + buffer.Format(KMemoryFormat, freeRAM / 1024, _size / 1024, available / 1024, largest / 1024); + CreateLogFile(); + //Write logs into file + RFileLogger::WriteFormat( KLogFileDir,KLogFileName,EFileLoggingModeAppend,_L("RAM - %S - %S"), &aMsg, &buffer); + } + +inline CAi3Perf::TPerfData* CAi3Perf::StartTestCase(const TDesC& aMsg) + { + CreateLogFile(); + //Write logs into file + RFileLogger::WriteFormat(KLogFileDir,KLogFileName,EFileLoggingModeAppend,_L("Test case %S starts"), &aMsg); + CAi3Perf::TPerfData* data = new (ELeave) TPerfData; + TTime readyTime; + data->iStartTime.HomeTime(); + User::AllocSize(data->iStartMemory); + return data; + } + +inline void CAi3Perf::StopTestCase(CAi3Perf::TPerfData* aData, const TDesC& aMsg) + { + if(!aData) + { + return; + } + TTime readyTime; + readyTime.HomeTime(); + TTimeIntervalMicroSeconds delay = readyTime.MicroSecondsFrom(aData->iStartTime); + TTime transferTime(delay.Int64()); + TBuf<64> timeString; + transferTime.FormatL(timeString, _L("- Elapsed time: %S%C microseconds")); + TBuf<256> tmp; + tmp.Append(timeString); + + RFileLogger::Write(KLogFileDir,KLogFileName,EFileLoggingModeAppend,tmp); + // Memory consumption + TInt endMemory; + User::AllocSize(endMemory); + + CreateLogFile(); + //Write logs into file + RFileLogger::WriteFormat(KLogFileDir,KLogFileName,EFileLoggingModeAppend,_L("- Allocated memory: %d kB"), (endMemory - aData->iStartMemory) / 1024); + delete aData; + aData = NULL; + RFileLogger::WriteFormat(KLogFileDir,KLogFileName,EFileLoggingModeAppend,_L("Test case %S ends"), &aMsg); + } +inline void CAi3Perf::CreateLogFile() + { + RFs fsSession; + RFile file; + User::LeaveIfError(fsSession.Connect()); + TFileName filename; + filename.Append(KLogFileRootDir); + filename.Append(KLogFileDir); + filename.Append(_L("\\")); + //create logs directory if it doesn't exist + fsSession.MkDir(filename); + filename.Append(KLogFileName); + //check if log file already exists + TInt retStatus = file.Open(fsSession,filename,EFileRead); + if(retStatus == KErrNotFound) + file.Create(fsSession,filename,EFileWrite); //create a new log file + file.Close(); + fsSession.Close(); + } +#endif // AI3PERFORMANCE_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/ainativeuiplugins.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/ainativeuiplugins.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,37 @@ +/* +* 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: Native Ui's content publisher plug-ins. +* +*/ + + +#ifndef AINATIVEUIPLUGINS_H +#define AINATIVEUIPLUGINS_H + +#include +#include "aipropertyextension.h" +#include "aiprofilepluginuids.hrh" + +const TUid KDeviceStatusPluginUid = { AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DEVSTAPLUGIN }; +_LIT( KDeviceStatusPluginName, "0x102750F8" ); + +const TUid KShortcutPluginUid = { AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SHORTCUTPLUGIN }; +_LIT( KShortcutPluginName, "Shortcut" ); + +const TUid KProfilePluginUid = { AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_PROFILEPLUGIN }; +_LIT( KProfilePluginName, "Profile" ); + +_LIT8( KNativeUiNamespace, "NativeUiNamespace" ); + +#endif // AINATIVEUIPLUGINS_H diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/c_xnutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/c_xnutils.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,207 @@ +/* +* 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: +* Utility functions of Xuikon. +* +*/ + +#ifndef C_XNUTILS_H +#define C_XNUTILS_H + +// System includes +#include +#include +#include + +// Forward declarations +class CXnNodePluginIf; +class CFont; +class CXnNode; +class CXnResource; +class TAknsItemID; + +// Class declaration +/** + * Utility functions for Xuikon. + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 v3.1 + */ +class CXnUtils : public CBase + { +public: + /** + * Creates the font according the parameters found from the given node. + * Avkon font ids or font-family names can be used. If font family is + * missing or defined as normal, system normal font is created. + * + * @since S60 v3.1 + * @param aNode Text element node. + * @param aFont Font to be created. + * @param aReleaseFont Whether the font needs to be released or not. + */ + IMPORT_C static void CreateFontL( + CXnNodePluginIf& aNode, + CFont*& aFont, + TInt& aReleaseFont ); + + /** + * Creates the font according the given parameters. + * Avkon font ids or font-family names can be used. If font family is + * missing or defined as normal, system normal font is created. + * + * @since S60 v3.2 + * @param aFontName Font name. + * @param aFontSizeInPixels Defines a font size. + * @param aFontStyle Defines the style, i.e. italic, bold, etc. + * @param aFont Font to be created. + * @param aReleaseFont Whether the font needs to be released or not. + */ + IMPORT_C static void CreateFontL( + const TDesC& aFontName, + TInt aFontSizeInPixels, + TFontStyle aFontStyle, + CFont*& aFont, + TInt& aReleaseFont ); + + /** + * Collapses the white spaces and special charachters from the given string + * according to properties found from the given node. + * + * @since S60 v3.1 + * @param aNode Text element node. + * @param aDes Descriptor to be modified. + */ + IMPORT_C static void CollapseWhiteSpace( + CXnNodePluginIf& aNode, TDes &aDes ); + + /** + * Returns the text alignment according to properties found from the given + * node. + * + * @since S60 v3.1 + * @param aNode Text element node. + * @return The text alignment. + */ + IMPORT_C static TGulAlignmentValue TextAlignment( CXnNodePluginIf& aNode ); + + /** + * Scales the source bitmap into a given rectangle of the target bitmap. + * Source and target bitmaps must have the same display mode. + * + * @since S60 v3.1 + * @param aTrgRect A rectangle area where the source bitmap is scaled. + * @param aTrgBitmap A newly created bitmap. + * @param aSrcBitmap An original bitmap. + */ + IMPORT_C static void ScaleBitmapL( + const TRect& aTrgRect, + CFbsBitmap* aTrgBitmap, + CFbsBitmap* aSrcBitmap ); + + /** + * Strips quotes from a descriptor string. + * + * @param aString A string. + */ + IMPORT_C static void StripQuotes( HBufC*& aString ); + + /** + * Resolves a skin item ID from a descriptor string. The skin item ID is + * stored in aItemID + * + * @param aSkinId A skin ID as a string descriptor. + * @param aItemID An item ID to which the values are set from the + * descriptor. + */ + IMPORT_C static TBool ResolveSkinItemIDL( + const TDesC& aSkinId, + TAknsItemID& aItemID ); + + /** + * Resolves a skin item ID and an integer index from a descriptor string. + * The skin item ID is stored in aItemID and the index is stored in aIndex. + * + * @param aSkinId A skin ID as a descriptor string. + * @param aItemID An item ID to which the values are set from the + * descriptor. + * @param aIndex An integer index. + */ + IMPORT_C static TBool ResolveSkinItemIDL( + const TDesC& aSkinId, + TAknsItemID& aItemID, + TInt& aIndex ); + + /** + * Resolves RGB colour value from a string. + * + * @param aValue Resolved RGB value. + * @param aData String from which RGB value is resolved. + */ + IMPORT_C static TBool GetRgbValue( TRgb& aValue, const TDesC8& aData ); + + /** + * Converts HSL value to RGB and returns the RGB value. + * + * @param aHue Hue. + * @param aSaturation Saturation. + * @param aLightness Lightness. + */ + IMPORT_C static TRgb ConvertHslToRgb( + TInt aHue, + TInt aSaturation, + TInt aLightness ); + + /** + * Handles power save mode + * + * @param aNode A node where to start iterate. + * @param aEvent Mode event. + * @param aEnter enter or exit the mode. + * @return ETrue if entered to the mode, EFalse if exited + */ + IMPORT_C static TBool HandlePowerSaveModeL( + CXnNode* aNode, + TBool aEnter, + TInt aEvent ); + + /** + * Finds a CXnResource object by the resource file name. + * + * @param aArray UIEngine's resource array + * @param aResourceFileName resource file name + * @param aBitmapIndex bitmap index + */ + IMPORT_C static CXnResource* FindResource( + CArrayPtrSeg< CXnResource >& aArray, + const TDesC& aResourceFileName, + TInt& aBitmapIndex ); + + /** + * @internal + */ + static TBool DoesScaleBitmapUseFallBack( CFbsBitmap* aSrcBitmap ); + + /** + * @internal + */ + static void ScaleBitmapExtL( + const TRect& aTrgRect, + CFbsBitmap* aTrgBitmap, + CFbsBitmap* aSrcBitmap, + TBool aForceFallBack ); + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/extrstandbycontainerconst.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/extrstandbycontainerconst.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,27 @@ +/* +* 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: +* +*/ + + +#ifndef EXTRSTANDBYCONTAINERCONST_H +#define EXTRSTANDBYCONTAINERCONST_H + +// Standby container interface Uid. +#define KExtrStandbyContainerIFUid 0x101FD656 + +#endif // EXTRSTANDBYCONTAINERCONST_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/extrstandbycontainerif.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/extrstandbycontainerif.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,82 @@ +/* +* 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: Define the inteface for the container of externale standby screen plug-ins +* +*/ + + +#ifndef C_EXTRSTANDBYCONTAINERIF_H +#define C_EXTRSTANDBYCONTAINERIF_H + +#include +#include +#include + +#include "extrstandbycontainerconst.h" + +// Standby container interface Uid. +const TUid KCExtrStandbyContainerIFUid = {KExtrStandbyContainerIFUid}; + +/** +* It is the interface for the Active Idle. +* +* @since Series 60 3.2 +*/ +class CExtrStandbyContainerIF : public CCoeControl + { +public: + +// Constructors and destructor + + /** + * Two-phased constructor. + * @param aImplementationUid Implementation ID of the AI plugin + * @param aInitData Init data. + * @return Pointer to the CAIContainer object. + */ + inline static CExtrStandbyContainerIF* NewL( + TUid aImplementationUid, + CCoeControl *aContainer); + + /** + * Destructor. + */ + inline virtual ~CExtrStandbyContainerIF(); + +// New functions + + /** + * Start Active Idle + */ + virtual void StartL()=0; + + /** + * Sets mode for External Homescreen (Full screen or normal) + * @param TBool, ETrue for full screen EFalse otherwise + * @since S60 3.2 + */ + virtual void SetFullScreenMode(TBool aFullScreenMode)=0; + +private: // Data + + // ECOM framework requires this ID in object destructor + TUid iDtor_ID_Key; + + }; + + #include "extrstandbycontainerif.inl" + +#endif // C_EXTRSTANDBYCONTAINERIF_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/extrstandbycontainerif.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/extrstandbycontainerif.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,46 @@ +/* +* 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: Define the inteface for the container of externale standby screen plug-ins +* +*/ + + +// ----------------------------------------------------------------------------- +// CExtrStandbyContainerIF::NewL +// ----------------------------------------------------------------------------- +// +inline CExtrStandbyContainerIF* CExtrStandbyContainerIF::NewL( + TUid aImplementationUid, + CCoeControl *aContainer ) + { + return REINTERPRET_CAST( CExtrStandbyContainerIF*, + REComSession::CreateImplementationL( + aImplementationUid, + _FOFF( + CExtrStandbyContainerIF, + iDtor_ID_Key ), + aContainer ) ) ; + } + +// ----------------------------------------------------------------------------- +// CExtrStandbyContainerIF::~CExtrStandbyContainerIF +// ----------------------------------------------------------------------------- +// +inline CExtrStandbyContainerIF::~CExtrStandbyContainerIF() + { + // Destroy any instance variables and then + // inform the framework that this specific + // instance of the interface has been destroyed. + REComSession::DestroyedImplementation( iDtor_ID_Key ); + } diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/mxncomponentinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/mxncomponentinterface.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,51 @@ +/* +* 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: Base interface for component data APIs +* +*/ + + +#ifndef __MXNCOMPONENTINTERFACE_H__ +#define __MXNCOMPONENTINTERFACE_H__ + +// INCLUDES +#include +#include "xnnodeappif.h" + +// CLASS DECLARATION +/** +* Base interface for component data APIs +* @lib xnlayoutengine.lib +* @since Series 60 3.1 +*/ +namespace XnComponentInterface + { + _LIT8(KType, ""); + + class MXnComponentInterface + { + public: + static inline const TDesC8& Type() + { + return KType; + } + }; + + template TBool MakeInterfaceL(T*& aTargetInterface, CXnNodeAppIf& aNode) + { + aTargetInterface = static_cast(aNode.MakeInterfaceL(T::Type())); + return aTargetInterface ? ETrue : EFalse; + } + } +#endif //__MXNCOMPONENTINTERFACE_H__ diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/mxndomiterator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/mxndomiterator.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,64 @@ +/* +* 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: Interface class for dom iterators +* +*/ + + + +#ifndef MXN_DOM_ITERATOR_H +#define MXN_DOM_ITERATOR_H + + +// FORWARD DECLARATIONS +class CXnDomNode; + + +// CLASS DECLARATION + +/** +* @ingroup group_domdocument +* Mixin class to let us define different iterators for +* different traversal policies. +* +* @lib xndomdocument.lib +* @since Series 60 3.1 +*/ +class MXnDomIterator + { + public: // Destructor + + /** + * Destructor. + */ + virtual ~MXnDomIterator(){} + + public: // Adding and removing + + /** + * Get first i.e root node. + * @since Series 60 3.1 + */ + virtual CXnDomNode* First()=0; + /** + * Get next node. + * @since Series 60 3.1 + */ + virtual CXnDomNode* NextL()=0; + + }; + +#endif // MXN_DOM_ITERATOR_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/mxndomlistitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/mxndomlistitem.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,84 @@ +/* +* 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: Interface class for dom list items. +* +*/ + + + +#ifndef MXN_DOM_LIST_ITEM_H +#define MXN_DOM_LIST_ITEM_H + +// INCLUDES + +// FORWARD DECLARATIONS + + +// CLASS DECLARATION + +/** +* @ingroup group_domdocument +* Class represents a list item interface. Items are stored into +* a CXnDomList as a instance of this class. +* +* @lib xndomdocument.lib +* @since Series 60 3.1 +*/ +class MXnDomListItem + { + public: // Destructor + + /** + * Destructor. + */ + virtual ~MXnDomListItem(){} + + public: // Serializing + + /** + * This list item's data size in bytes. + * @since Series 60 3.1 + * @return Data size in bytes. + */ + virtual TInt Size() const=0; + + /** + * Externalize list item. + * @since Series 60 3.1 + * @param aStream Output stream + */ + virtual void ExternalizeL( RWriteStream& aStream )const=0; + + /** + * Internalize list item. + * @since Series 60 3.1 + * @param aStream Input stream + */ + virtual void InternalizeL( RReadStream& aStream )=0; + + + + public: //Accessing + /** + * Get the name of this item as UTF8 encoded, if any. + * @since Series 60 3.1 + * @return Name buffer or KNullDesC8 + */ + virtual const TDesC8& Name()=0; + + }; + +#endif // MXN_DOM_LIST_ITEM_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/mxndomvisitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/mxndomvisitor.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,78 @@ +/* +* 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: Visitor class interface +* +*/ + + + +#ifndef MXN_DOM_VISITOR_H +#define MXN_DOM_VISITOR_H + +// CLASS FORWARD +class CXnDomNode; + +// CLASS DECLARATION + +/** +* Visitor class modifies DOM node element's data. +* +* @lib xndomvisitor.dll +* @since Series 60 3.1 +*/ +class MXnDomVisitor + { + public: // New functions + + /** + * Check in-memory plugin version. + * @return ETrue if version match + */ + virtual TBool IsVersion( const TDesC8& aVersion )=0; + + /** + * Modifies data + * @param aData Data to modify + */ + virtual void ModifyDataL( CXnDomNode& aNode )=0; + + /** + * Sets element content type (TContentType) from XnDomNode.h + * @param aNode Node to modify + */ + virtual void SetElementTypeL( CXnDomNode& aNode )=0; + + /** + * Ecom passes a destructor key at the time when plugin is created + * and requires that key when plugin is destroyed. + * @param aKey ECom required destructor key + */ + virtual void SetDtorKey( const TUid aDtorKey )=0; + + /** + * Release resources + */ + virtual void Release()=0; + + protected: + /** + * Plugin can only be destroyed by calling Release(). + */ + ~MXnDomVisitor(){}; + + }; + +#endif // MXN_DOM_VISITOR_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/tracer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/tracer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,90 @@ +/* +* 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: +* +*/ +#ifndef __TTRACER_H__ +#define __TTRACER_H__ + +#include +#include +#include + +//#ifdef _DEBUG +#define TRACER_ENABLED +//#else +//#undef TRACER_ENABLED +//#endif + +/** Macro to initialise the tracer. Set the indentation level to zero. */ +#ifdef TRACER_ENABLED +#define INITTRACE TTracer t +#else +#define INITTRACE +#endif + +/** Macro to trace the function calls. + * @param a Text to display. Usually class::function */ +#ifdef TRACER_ENABLED +#define TRACE(a) TTracer t(_L(a)) +#else +#define TRACE(a) +#endif + +/** Macro to print a string to the trace window. + * @param a Text to print. + */ +#ifdef TRACER_ENABLED +#define TRACESTR(a) TTracer::Print(_L(a)) +#else +#define TRACESTR +#endif + +/** + * @ingroup group_xnutils + * + * Class for tracing function calls. Indentation shows the call tree. + * Also the entry and leave points are time labeled, show timing info is available. + */ +class TTracer +{ +public: + /** Initialising constructor. */ + IMPORT_C TTracer(); + + /** Tracing constructor. + * Writes time lable and "Enter: " + the given string. + */ + IMPORT_C TTracer(TPtrC aString); + + /** Destructor. + * Writes time lable and "Leave: " + the given string. + */ + IMPORT_C ~TTracer(); + + /** Prints the given string to the trace window. + * @param a Text to print. + */ + IMPORT_C static void Print(TPtrC aString); +// static TInt Print(TRefByValue aFmt,...); + +private: + RFs iFs; + + TBuf<255> iString; +// RFileLogger iFLogger; +}; + + +#endif // __TTRACER_H__ diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnapplication.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnapplication.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,75 @@ +/* +* 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: +* Application base class for Xuikon +* +*/ + +#ifndef XNAPPLICATION_H +#define XNAPPLICATION_H + +// System includes +#include + +// Class declaration +/** + * Application base class for Xuikon. + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since Series 60 3.1 + */ +class CXnApplication : public CAknApplication + { +public: + /** + * C++ default constructor. + */ + IMPORT_C CXnApplication( TUid aApplicationUid ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CXnApplication(); + +protected: + /** + * From CApaApplication. + * Returns the application uid. + * + * @since Series 60 3.1 + * @return Application uid + */ + IMPORT_C virtual TUid AppDllUid() const; + + /** + * From CApaApplication. + * Creates a document. + * + * @since Series 60 3.1 + * @param aProcess Application framework process object + * @return Application document + */ + IMPORT_C virtual CApaDocument* CreateDocumentL(); + +private: + // Data + + /** + * application uid + */ + TUid iApplicationUid; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnappuiadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnappuiadapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,284 @@ +/* +* 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: +* Avkon adapter for Xuikon +* +*/ + +#ifndef XNAPPUIADAPTER_H +#define XNAPPUIADAPTER_H + +// System includes +#include + +// Forward declarations +class TXnUiEngineAppIf; +class CXnNodeAppIf; +class CXnDomNode; +class CXnAppUiAdapterImpl; +class CXnUiEngine; +class CXnUiStateListener; +class CXnViewManager; +class CXnViewAdapter; +class MHsContentControlUi; +class CXnEffectManager; +class MHsContentControl; +// Class declaration +/** + * Avkon adapter for Xuikon. + * + * @ingroup group_xnlayoutengine + * @lib xnlayoutengine.lib + * @since Series 60 3.1 + */ +class CXnAppUiAdapter : public CAknViewAppUi + { +public: + /** + * C++ default constructor. + * + * @param aApplicationUid Application UID + */ + IMPORT_C CXnAppUiAdapter( TUid aApplicationUid ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CXnAppUiAdapter(); + +public: + // New functions + + /** + * Get the UI engine + * + * @since Series 60 3.1 + * @return UI engine + */ + IMPORT_C TXnUiEngineAppIf* UiEngineL(); + + /** + * Handle interaction notification from the engine + * + * @since Series 60 3.1 + * @param aOrigin Node that originated the event + * @param aTrigger Trigger information of the event, as created by event + * originator + * @param aTriggerDefinition Trigger information as it exists in the action + * definition in xml + * @param aEvent Event information of the event + */ + IMPORT_C virtual void HandleXuikonEventL( + CXnNodeAppIf& aOrigin, + CXnNodeAppIf& aTrigger, + CXnDomNode& aTriggerDefinition, + CXnDomNode& aEvent ); + + /** + * Handles data plugin loading. + * To be overriden by subclass. + * + * @since S60 5.0 + * @param aList list of plugins to load + */ + IMPORT_C virtual void LoadDataPluginsL( + RPointerArray< CXnNodeAppIf >& aList ); + + /** + * Handles data plugin destroying. + * To be overriden by subclass. + * + * @since S60 5.0 + * @param aList list of plugins to destroy + */ + IMPORT_C virtual void DestroyDataPluginsL( + RPointerArray< CXnNodeAppIf >& aList ); + + /** + * Handles dynamic menuitem element initialisation. + * To be overriden by subclass. + * + * @since S60 5.0 + * @param aItemType Menuitem type + * @param aList List of data plugins + * @return ETrue if menuitem should be shown, EFalse otherwise + */ + 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. + * + * @since S60 5.0 + * @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. + * + * @since S60 5.0 + * @param aEnter enter or exit edit mode + */ + IMPORT_C virtual void HandleEnterEditModeL( TBool aEnter ); + +public: + /** + * From CEikAppUi. + * Second-phase constructor + * + * @since Series 60 3.1 + */ + IMPORT_C void ConstructL(); + +protected: + + /** + * From CAknAppUi. + * + * @since Series 60 3.1 + */ + IMPORT_C void HandleResourceChangeL( TInt aType ); + +public: + // new functions + + /** + * Reloads the UI + */ + void ReloadUiL(); + + /** + * Gets UiEngine + * + * @since S60 5.0 + * @return UiEngine + */ + CXnUiEngine& UiEngine() const; + + /** + * Gets ViewManager + * + * @since S60 5.0 + * @return ViewManager + */ + CXnViewManager& ViewManager() const; + + /** + * Gets ViewAdapter + * + * @since S60 5.0 + * @return ViewAdapter + */ + CXnViewAdapter& ViewAdapter() const; + + /** + * Gets UiStateListener + * + * @since S60 5.0 + * @return UiStateListener + */ + CXnUiStateListener& UiStateListener() const; + + /** + * Gets a Content Control UI + * + * @since S60 5.0 + * @param aType Content control UI type + * @return Interface to content control UI, NULL if not present + */ + MHsContentControlUi* HsContentController( const TDesC8& aType ) const; + + /** + * Get effect manager + * + * @since S60 5.0 + * @return effect manager + */ + CXnEffectManager* EffectManager() const; + + /** + * Gets a Content Control server interface + * + * @since S60 5.0 + * @return Interface to content control server, NULL if not present + */ + MHsContentControl* HsContentControlSrv() const; + + /** + * Queries whether the focus control is visible + * + * @since S60 5.0 + * @return ETrue focus is shown, EFalse otherwise + */ + TBool FocusShown() const; + + /** + * Makes focus control invisible + * + * @since S60 5.0 + */ + void HideFocus(); + + /** + * Makes focus control visible + * + * @since S60 5.0 + */ + void ShowFocus(); + +private: + // Data + + /** + * application uid + */ + TUid iApplicationUid; + + /** + * appui adapter impl. + * Own. + */ + CXnAppUiAdapterImpl* iImpl; + + /** + * Proxy to UiEngine. + * Own. + */ + TXnUiEngineAppIf* iUiEngineAppIf; + }; + +#endif + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnarray.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnarray.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,145 @@ +/* +* 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: Heap-allocated array +* +*/ + + + +#ifndef CXNARRAY_H +#define CXNARRAY_H + +// INCLUDES +#include + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +// CLASS DECLARATION + +/** +* @ingroup group_xnutils +* +* Heap-allocated array +* @since Series 60 3.1 +*/ +class CXnArray : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CXnArray* NewL(); + + /** + * Destructor. + */ + virtual ~CXnArray(); + + public: // New functions + + /** + * Get the underlying container + * @since Series 60 3.1 + * @return Underlying container + */ + + IMPORT_C RArray& Container(); + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // New functions + + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CXnArray(); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + // ?one_line_short_description_of_data + //?data_declaration; + // Reserved pointer for future extension + //TAny* iReserved; + // Internal container + RArray iContainer; + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + + }; + +#endif // CXnARRAY_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnbitmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnbitmap.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Wrapper class for Bitmap. +* +*/ + + + +#ifndef _XNBITMAP_H +#define _XNBITMAP_H + +// INCLUDES +#include "xncomponent.h" +#include "mxncomponentinterface.h" + +// FORWARD DECLARATIONS +class CFbsBitmap; + +// CLASS DECLARATION + +namespace XnImageInterface +{ +_LIT8(KType, "image"); +class MXnImageInterface : public XnComponentInterface::MXnComponentInterface + { + +public: + + static inline const TDesC8& Type() + { + return KType; + } + +public: // New functions + + /** + * Sets content bitmaps. Ownership is transferred. + * @since Series 60 3.1 + * @param aBitmap Bitmap to draw + * @param aMask Mask to use + */ + virtual void SetContentBitmaps(CFbsBitmap* aBitmap, CFbsBitmap* aMask) = 0; + + /** + * Gets content bitmaps. Ownership is not transferred. + * @since Series 60 3.1 + * @param aBitmap Bitmap to draw + * @param aMask Mask to use + */ + virtual void ContentBitmaps(CFbsBitmap*& aBitmap, CFbsBitmap*& aMask) = 0; + +private: + + }; + } + +/** +* @ingroup group_xnbitmapfactory +* @lib xn3bitmapfactory.dll +* @since Series 60 3.1 +*/ +class CXnBitmap : public CXnComponent, public XnImageInterface::MXnImageInterface + { + +public: + + /** + * 2 phase construction. + */ + static CXnBitmap* NewL(); + + /** + * Destructor. + */ + virtual ~CXnBitmap(); + +public: // New functions + /** + * Sets content bitmaps. Ownership is transferred. + * @since Series 60 3.1 + * @param aBitmap Bitmap to draw + * @param aMask Mask to use + */ + void SetContentBitmaps(CFbsBitmap* aBitmap, CFbsBitmap* aMask); + + /** + * Gets content bitmaps. Ownership is not transferred. + * @since Series 60 3.1 + * @param aBitmap Bitmap to draw + * @param aMask Mask to use + */ + void ContentBitmaps(CFbsBitmap*& aBitmap, CFbsBitmap*& aMask); + + +public: // from CCoeControl + /** + * Create a component interface according to the given type. + * @param aType Type of the interface to create + * @return Created interface or NULL if the provided type is not supported. + */ + virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL(const TDesC8& aType); + + +private: + + CXnBitmap(); + void ConstructL(); + +private: + }; + +#endif // _XNBITMAP_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnbreadthfirsttreeiterator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnbreadthfirsttreeiterator.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,237 @@ +/* +* 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: Iterates over a tree, breadth first search algorithm +* +*/ + + +#ifndef XNBREADTHFIRSTTREEITERATOR_H +#define XNBREADTHFIRSTTREEITERATOR_H + +// INCLUDES +#include +#include +#include "xnchilditerator.h" + + +// Constants +/** + * Queue granularity value + */ +const TInt KMemoryAlocQ = 64; + +template < class T > + class CXnBreadthFirstTreeIterator: public CBase, public MXnChildIterator + { +public: + + /** + * Two-phased constructor. + * @param aStartNode object to iterate over + * @param aDepth with default parameter value 0. + */ + static CXnBreadthFirstTreeIterator< T >* NewL( T& aStartNode, + TUint aDepth = 0 ); + + /** + * Destructor. + */ + virtual ~CXnBreadthFirstTreeIterator(); + + /** + * Get the next iterator value. + * @return Next object or NULL if no more values. + */ + T* NextL(); + + /** + * Get the current iterator value. + * @return Current object + */ + T* Value(); + + /** + * Get the previous iterator value. Obsolete! + * @return NULL + */ + T* PreviousL(); + + /** + * Get the current iterator index. Obsolete! + * @return value 0 + */ + TUint Index() const; + +protected: + + /** + * C++ default constructor. + */ + CXnBreadthFirstTreeIterator( T* aStartNode, TUint aDepth = 0 ); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + +private: //Data + // Queue + RPointerArray< T > iQueue; + // Object to iterate over + T* iStart; + // Current object + T* iCurrent; + // Tree depth + TUint iDepth; + // Current index + TUint iIndex; + }; + + + +// ----------------------------------------------------------------------------- +// CXnBreadthFirstTreeIterator< T >::NewL() +// ----------------------------------------------------------------------------- +// +template< class T > CXnBreadthFirstTreeIterator< T >* + CXnBreadthFirstTreeIterator< T >::NewL( T& aStartNode, TUint aDepth ) + { + CXnBreadthFirstTreeIterator< T >* p = + new ( ELeave )CXnBreadthFirstTreeIterator< T >( &aStartNode, + aDepth ); + CleanupStack::PushL( p ); + p->ConstructL(); + CleanupStack::Pop(); + return p; + } + + +// ----------------------------------------------------------------------------- +// XnBreadthFirstTreeIterator< T >::CXnBreadthFirstTreeIterator() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +template< class T > + CXnBreadthFirstTreeIterator< T >::CXnBreadthFirstTreeIterator( + T* aStartNode, TUint aDepth ) : iQueue( KMemoryAlocQ ), iStart( + aStartNode ),iCurrent( aStartNode ),iDepth( aDepth ) + { + + } + +// ----------------------------------------------------------------------------- +// CXnBreadthFirstTreeIterator< T >::~CXnBreadthFirstTreeIterator() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +template< class T > + CXnBreadthFirstTreeIterator< T >::~CXnBreadthFirstTreeIterator() + { + iQueue.Close(); + } + +// ----------------------------------------------------------------------------- +// CXnBreadthFirstTreeIterator< T >::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +template< class T > + void CXnBreadthFirstTreeIterator< T >::ConstructL() + { + iQueue.AppendL( iStart ); + iIndex = 0; + } + +// ----------------------------------------------------------------------------- +// CXnBreadthFirstTreeIterator< T >::NextL() +// ----------------------------------------------------------------------------- +// +template< class T > T* CXnBreadthFirstTreeIterator< T >::NextL() + { + if( iQueue.Count() ) + { + // Dequeue + if ( !iDepth ) + { + iCurrent = iQueue[0]; + iQueue.Remove(0); + } + + RPointerArray< T > currentChildNodes = iCurrent->ChildrenL(); + TInt currentChildCount( currentChildNodes.Count() ); + + if ( iDepth ) + { + if ( (iIndex + 1) < currentChildCount ) + { + for ( TUint tmp = iIndex; (tmp + 1) < currentChildCount; ) + { + T* tmpObject = currentChildNodes[++tmp]; + iIndex = tmp; + currentChildNodes.Reset(); + return tmpObject; + } + } + else + { + currentChildNodes.Reset(); + return NULL; + } + } + // Enqueue + for( TInt i = 0; i < currentChildCount; ++i ) + { + iQueue.AppendL( currentChildNodes[i] ); + } + currentChildNodes.Reset(); + } + else + { + iCurrent = NULL; + iQueue.Reset(); + iQueue.AppendL( iStart ); + } + return iCurrent; + } + +// ----------------------------------------------------------------------------- +// CXnBreadthFirstTreeIterator< T >::Value() +// ----------------------------------------------------------------------------- +// +template< class T > T* CXnBreadthFirstTreeIterator< T >::Value() + { + return iCurrent; + } + +// ----------------------------------------------------------------------------- +// CXnBreadthFirstTreeIterator< T >::PreviousL() +// ----------------------------------------------------------------------------- +// +template< class T > T* CXnBreadthFirstTreeIterator< T >::PreviousL() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnBreadthFirstTreeIterator< T >::Index() +// ----------------------------------------------------------------------------- +// +template< class T > TUint CXnBreadthFirstTreeIterator< T >::Index() const + { + return 0; + } + +#endif // CXNBREADTHFIRSTTREEITERATOR_H + +// End of File \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnchilditerator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnchilditerator.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,77 @@ +/* +* 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: Iterates over a containers children +* +*/ + +#ifndef MXNCHILDITERATOR_H +#define MXNCHILDITERATOR_H + +// INCLUDES +#include + +/** +* @ingroup group_xnutils +* +* Iterates over a containers children +* @since Series 60 3.1 +*/ +class MXnChildIterator + { + public: // Constructors and destructor + + /** + * Destructor. + */ + virtual ~MXnChildIterator() {}; + + public: // New functions + + /** + * Get the current iterator value. + * @since Series 60 3.1 + * @return Current object or NULL if iterator does not point anywhere + */ + virtual CBase* Value() = 0 ; + + /** + * Get the next iterator value. + * @since Series 60 3.1 + * @return Next object or NULL if no more values. If NULL, the iterator is not advanced. + * Therefore, given that iterator->Value() == x and iterator->Next() == NULL, next invocation + * of iterator->Value() will return x. + */ + virtual CBase* NextL() = 0; + + /** + * Get the previous iterator value. + * @since Series 60 3.1 + * @return Previous object or NULL if no more values. If NULL, the iterator is not advanced. + * Therefore, given that iterator->Value() == x and iterator->Previous() == NULL, next invocation + * of iterator->Value() will return x. + */ + virtual CBase* PreviousL() = 0; + + /** + * Get the current iterator index. + * @since Series 60 3.1 + * @return Current index + */ + virtual TUint Index() const = 0; + + }; + +#endif // MXnCHILDITERATOR_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnchilditeratorbuilder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnchilditeratorbuilder.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,56 @@ +/* +* 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: Creates an iterator for an object's children +* +*/ + +#ifndef MXNCHILDITERATORBUILDER_H +#define MXNCHILDITERATORBUILDER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MXnChildIterator; + +/** +* @ingroup group_xnutils +* +* Creates an iterator for an object's children +* @since Series 60 3.1 +*/ +class MXnChildIteratorBuilder + { + public: // Constructors and destructor + + /** + * Destructor. + */ + virtual ~MXnChildIteratorBuilder() {}; + + public: // New functions + + /** + * Builds a child iterator for an object + * @since Series 60 3.1 + * @param aObject Object for which the iterator is built + * @return Child iterator for the object. Ownership is transferred to the caller. + */ + virtual MXnChildIterator* BuildL(CBase& aObject) = 0; + + }; + +#endif // MXnCHILDITERATORBUILDER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnclock.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnclock.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,88 @@ +/* +* 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: Wrapper class for CEikLabel. +* +*/ + + +#ifndef _XNCLOCK_H +#define _XNCLOCK_H + +// INCLUDES +#include "xncomponent.h" +#include +#include "xnnode.h" +#include "mxncomponentinterface.h" + + +// CLASS DECLARATION + +namespace XnClockInterface + { + _LIT8( KType, "clock" ); + + class MXnClockInterface : public XnComponentInterface::MXnComponentInterface + { + public: + + static inline const TDesC8& Type() + { + return KType; + } + + public: // New functions + + private: + }; + } + +/** +* @ingroup group_xnclockfactory +* @lib xnclockfactory.lib +* @since S60 +*/ +class CXnClock : public CXnComponent, public XnClockInterface::MXnClockInterface + { +public: + + /** + * 2 phase construction. + */ + static CXnClock* NewL(); + + /** + * Destructor. + */ + virtual ~CXnClock(); + +public: // New functions + +public: // from CCoeControl + + /** + * Create a component interface according to the given type. + * @param aType Type of the interface to create + * @return Created interface or NULL if the provided type is not supported. + */ + virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL( const TDesC8& aType ); + +private: + + CXnClock(); + void ConstructL(); + }; + +#endif // _XNCLOCK_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xncomparator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xncomparator.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,53 @@ +/* +* 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: Compares two objects. +* +*/ + +#ifndef MXNCOMPARATOR_H +#define MXNCOMPARATOR_H + +// INCLUDES +#include + +/** +* @ingroup group_xnutils +* +* Compares two objects. +* @since Series 60 3.1 +*/ +class MXnComparator + { + public: // Constructors and destructor + + /** + * Destructor. + */ + virtual ~MXnComparator() {}; + + public: // New functions + + /** + * Compares two objects for equality. + * @since Series 60 3.1 + * @param aItem1 First item + * @param aItem1 Second item + * @return ETrue if equal, EFalse if not equal + */ + virtual TBool Equals(CBase& aItem1, CBase& aItem2) = 0; + }; + +#endif // MXnCOMPARATOR_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xncomponent.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xncomponent.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,141 @@ +/* +* 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: +* Xuikon component base class +* +*/ + +#ifndef XNCOMPONENT_H +#define XNCOMPONENT_H + +// System includes +#include + +// Forward declarations +class CXnControlAdapter; +class CXnNodePluginIf; +namespace XnComponentInterface + { + class MXnComponentInterface; + } + +// Class declaration +/** + * Xuikon component base class. + * + * @ingroup group_xnlayoutengine + * @lib ?library + * @since Series 60 3.1 + */ +class CXnComponent : public CBase + { +public: // Constructors and destructor + /** + * Two-phased constructor. + * @param aType Type. + */ + IMPORT_C static CXnComponent* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CXnComponent(); + +public: + // New functions + + /** + * Sets a control adapter. + * + * @since Series 60 3.1 + * @param aAdapter Adapter. + */ + IMPORT_C void SetControlAdapter( CXnControlAdapter* aAdapter ); + + /** + * Returns the control adapter. + * + * @since Series 60 3.1 + * @return Control adapter. + */ + IMPORT_C CXnControlAdapter* ControlAdapter(); + + /** + * Returns component's node. + * + * @since Series 60 3.1 + * @return Node. + */ + IMPORT_C CXnNodePluginIf* Node(); + + /** + * Sets the component's node. + * + * @since Series 60 3.1 + * @param aNode Node + */ + IMPORT_C void SetNode( CXnNodePluginIf& aNode ); + + /** + * Enter power save mode. This is done when application goes to background + * or lights go off. + * Derived classes should override this function and stop animations, + * timers etc. when the function is called. + */ + IMPORT_C virtual void EnterPowerSaveModeL(); + + /** + * Exit power save mode. This is done when application comes to foreground + * or lights go on. + * Derived classes should override this function and restart animations, + * timers etc. when the function is called. + */ + IMPORT_C virtual void ExitPowerSaveModeL(); + + /** + * Create a component interface according to the given type. + * @param aType Type of the interface to create + * @return Created interface or NULL if the provided type is not supported. + */ + IMPORT_C virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL( + const TDesC8& aType ); + +protected: + /** + * C++ default constructor. + */ + IMPORT_C CXnComponent(); + + /** + * Two-phased constructor. + */ + IMPORT_C void ConstructL(); + +private: + // Data + + /** + * Pointer to control adapter. + * Own. + */ + CXnControlAdapter* iAdapter; + + /** + * Component's node. + * Not own. + */ + CXnNodePluginIf* iNode; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xncomponentfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xncomponentfactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,126 @@ +/* +* 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: +* ECom Component factory interface +* +*/ + +#ifndef XNCOMPONENTFACTORY_H +#define XNCOMPONENTFACTORY_H + +// System includes +#include + +// Forward declarations +class CXnComponent; +class CXnControlAdapter; +class CXnNodePluginIf; + +// Class declaration +/** + * Component UI factory interface for creating UI representations of the layout + * areas. + * + * @ingroup group_xnlayoutengine + * @lib xnlayoutengine.lib + * @since Series 60 3.1 + */ +class MXnComponentFactory + { +public: + // Data types + + /** + * Response values from the component factory. Indicate the action + * taken or desired from the factory on the requested area. + */ + enum TXnComponentFactoryResponse + { + /** Successful construction of the component */ + EXnFactoryResponseComponentConstructed, + /** Successful disposal of the component */ + EXnFactoryResponseComponentDisposed, + /** The factory does not know how to create/dispose given component, + * reponsibility is passed onto the next factory in the chain */ + EXnFactoryResponseComponentNotSupported, + /** The factory does not know how to create the given component + * and does not wish the given area to be passed on to any other factory + * for creation - often the area is already handled by a parent area */ + EXnFactoryResponseDenyComponentConstruction + }; + +public: + + IMPORT_C virtual ~MXnComponentFactory(); + +public: + // New functions + + /** + * Create a component + * + * @since Series 60 3.1 + * @param aNode UI node + * @param aTargetComponent Target component + * @return Factory response + */ + IMPORT_C TXnComponentFactoryResponse CreateXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent ); + + /** + * Check whether a node needs a component node implementation + * + * @since Series 60 3.1 + * @param aType Node type + * @return ETrue if a component node implementation is required, EFalse + * otherwise + */ + IMPORT_C TBool DoesNodeNeedComponentImplL( const TDesC8& aType ); + +protected: + // New functions + + /** + * C++ default constructor. Protected in order to allow for derivation. + */ + IMPORT_C MXnComponentFactory(); + +private: + /** + * Create a component + * + * @since Series 60 3.1 + * @param aNode UI node + * @param aTargetComponent Target component + * @return Factory response + */ + IMPORT_C virtual TXnComponentFactoryResponse MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent ) = 0; + + /** + * Create a control adapter + * + * @since Series 60 3.1 + * @param aNode UI node + * @param aParent Parent control + * @return Created control + */ + IMPORT_C virtual CXnControlAdapter* MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent = NULL ) = 0; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xncomponentnodeimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xncomponentnodeimpl.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,133 @@ +/* +* 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: +* Xuikon component node implementation +* +*/ + +#ifndef XNCOMPONENTNODEIMPL_H +#define XNCOMPONENTNODEIMPL_H + +// System includes +#include + +// User includes +#include "xnnodeimpl.h" + +// Forward declarations +class CXnComponent; +namespace XnComponentInterface + { + class MXnComponentInterface; + } + +// Class declaration +/** + * Xuikon component node implementation + * + * @ingroup group_xnlayoutengine + * @lib ?library + * @since Series 60 3.1 + */ +class CXnComponentNodeImpl : public CXnNodeImpl + { +public: + /** + * Two-phased constructor. + * + * @param aType Type. + */ + IMPORT_C static CXnComponentNodeImpl* NewL( CXnType* aType ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CXnComponentNodeImpl(); + +public: + // New functions + + /** + * Get the component + * + * @since Series 60 3.1 + * @return Component + */ + IMPORT_C CXnComponent* Component(); + + /** + * Set the component + * + * @since Series 60 3.1 + * @param aComponent Component + */ + IMPORT_C void SetComponent( CXnComponent* aComponent ); + + /** + * Returns whether a component should be created for the node + * + * @since Series 60 3.1 + * @return Flag indicating whether a component should be created for the node + */ + IMPORT_C TBool DoesComponentNeedCreation() const; + + /** + * Set the flag indicating whether a component should be created for the node + * + * @since Series 60 3.1 + * @param aFlag Flag indicating whether a component should be created for the + * node + */ + IMPORT_C void SetComponentNeedsCreation( TBool aFlag ); + +public: + /** + * From CXnNodeImpl. + * Create a component interface according to the given type. + * + * @param aType Type of the interface to create + * @return Created interface or NULL if the provided type is not supported. + */ + IMPORT_C virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL( + const TDesC8& aType ); + +protected: + /** + * C++ default constructor. + */ + IMPORT_C CXnComponentNodeImpl(); + + /** + * Two-phased constructor. + * + * @param aType Type + */ + IMPORT_C void ConstructL( CXnType* aType ); + +private: + // Data + + /** + * Component. + * Own. + */ + CXnComponent* iComponent; + + /** + * Flag indicating whether a component should be created for the node + */ + TBool iComponentNeedsCreation; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xncontroladapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xncontroladapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,453 @@ +/* +* 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: +* Xuikon control adapter header file +* +*/ + +#ifndef XNCONTROLADAPTER_H +#define XNCONTROLADAPTER_H + +// System includes +#include +#include +#include +#include + +// Forward declarations +class CXnNodePluginIf; +class CXnComponent; +class CXnControlAdapterImpl; +class CXnProperty; +class CXnNode; + +// Class declaration +/** + * Control adapter interface class + * + * @ingroup group_xnlayoutengine + * @lib xnlayoutengine.lib + * @since Series 60 3.1 + */ +class CXnControlAdapter : public CCoeControl, + public MCoeControlObserver, + public MAknLongTapDetectorCallBack + { +public: + // Data types + enum TModeEvent + { + EEventNone = 0, + EEventBackground, + EEventLight, + EEventDisplay, + EEventVisibility + }; + + /** + * Two-phased constructor. + */ + IMPORT_C static CXnControlAdapter* NewL( CXnNodePluginIf& aNode ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CXnControlAdapter(); + +public: + // New functions + + /** + * Sets component pointer. + * + * @since Series 60 3.1 + * @param aComponent Component pointer. + */ + IMPORT_C void SetComponent( CXnComponent* aComponent ); + + /** + * Set component visibility + * + * @since Series 60 3.1 + * @param aVisible ETrue for making visible, EFalse for making invisible + */ + IMPORT_C void SetVisible( TBool aVisible ); + + /** + * Gets the component pointer. + * + * @since Series 60 3.1 + * @return Component pointer. + */ + IMPORT_C CXnComponent* Component(); + + /** + * Checks if the control should be drawn, according to visibility and + * display properties. + * + * @since Series 60 3.1 + * @return ETrue if drawing is ok, EFalse otherwise + */ + IMPORT_C TBool IsDrawingAllowed() const; + + /** + * Gets content bitmaps. Ownership is not transferred. + * + * @since Series 60 3.1 + * @param aBitmap Bitmap to draw + * @param aMask Mask to use + */ + IMPORT_C void ContentBitmaps( CFbsBitmap*& aBitmap, CFbsBitmap*& aMask ); + + /** + * Sets content bitmaps. Ownership is transferred. + * + * @since Series 60 3.1 + * @param aBitmap Bitmap to draw + * @param aMask Mask to use + */ + IMPORT_C void SetContentBitmaps( CFbsBitmap* aBitmap, CFbsBitmap* aMask ); + + /** + * Sets content bitmaps. Ownership is transferred. + * + * @since Series 60 3.1 + * @param aBitmapUrl Url of the bitmap to draw + * @param aMaskUrl Url of the bitmap mask to use + */ + IMPORT_C void SetContentBitmaps( const TDesC& aBitmapUrl, + const TDesC& aMaskUrl ); + + /** + * Load a bitmap from the server. Ownership is transferred. + * + * @since Series 60 3.1 + * @param aBitmapUrl Url of the bitmap to load + * @return Bitmap + */ + IMPORT_C CFbsBitmap* LoadBitmap( const TDesC& aBitmapUrl ); + + /** + * Load a bitmap and mask from the server. Ownership is transferred. + * + * @since Series 60 3.1 + * @param aBitmapUrl Url of the bitmap to load + * @param aMaskUrl Url of the mask to load, if any + * @param aBitmap Fetched bitmap + * @param aMask Fetched mask + */ + IMPORT_C void GetBitmapAndMask( + const TDesC& aBitmapUrl, + const TDesC& aMaskUrl, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask ); + + /** + * Skin change notification. + * + * @since Series 60 3.1 + */ + IMPORT_C virtual void SkinChanged(); + + /** + * Draws the control using a client-specified gc. + * + * @param aRect TRect to draw + * @param aGc Gc used for drawing + */ + IMPORT_C virtual void Draw( const TRect& aRect, CWindowGc& aGc ) const; + + /** + * Enter power save mode. This is done when application goes to background + * or lights go off. + * Derived classes should override this function and stop animations, timers + * etc. when the function is called. + */ + IMPORT_C void EnterPowerSaveModeL( TModeEvent aEvent = EEventNone ); + + /* + * Template method, called by EnterPowerSaveModeL(). Additional + * implementations are done in derived classes. + */ + IMPORT_C virtual void DoEnterPowerSaveModeL( TModeEvent aEvent ); + + /** + * Exit power save mode. This is done when application comes to foreground + * or lights go on. + * Derived classes should override this function and restart animations, + * timers etc. when the function is called. + */ + IMPORT_C void ExitPowerSaveModeL( TModeEvent aEvent = EEventNone ); + + /* + * Template method, called by ExitPowerSaveModeL(). Additional + * implementations are done in derived classes. + */ + IMPORT_C virtual void DoExitPowerSaveModeL( TModeEvent aEvent ); + + /** + * Sets the application local zoom + * + * @param aZoom application local zoom + * @since 3.1 + */ + IMPORT_C virtual void SetLocalUiZoomL( TAknUiZoom aZoom ); + + /** + * This called to measure adaptive content dimensions + * + * @since 3.2 + * @param aAvailableSize where the component's content must fit + * @return The measure content dimensions + */ + IMPORT_C virtual TSize MeasureAdaptiveContentL( + const TSize& aAvailableSize ); + + + /** + * Add a child adapter + * @since Series 60 3.1 + * @param aChild Child adapter + * @param aNode Child layout node. + */ + void AppendChildL(CXnControlAdapter& aChild, CXnNode& aNode); + + + /** + * Resets the stylus state counter, so that the next tap causes 1st stylus + * action. + * + * @since 3.2 + */ + IMPORT_C void ResetStylusCounter(); + + /** + * Sets the control blank + * + * @since S60 5.1 + * @param aBlank, ETrue sets blank, EFalse resets blank + */ + IMPORT_C void SetBlank( TBool aBlank ); + + /** + * Gets the control's long tap detector + * + * @since 5.0 + */ + IMPORT_C CAknLongTapDetector* LongTapDetector() const; + + /** + * Gets the control's associated window. + * + * @since 3.2 + */ + inline RWindow& Window() const; + + /** + * Gets the component of this control which is grabbing the pointer. + * + * @since 5.0 + */ + inline CCoeControl* GrabbingComponent() const; + +public: + /** + * From CCoeControl. + * Handles key events. + * + * @since Series 60 3.1 + * @param aKeyEvent Key event. + * @param aType Event type. + * @return Key response + */ + IMPORT_C TKeyResponse OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * From CCoeControl. + * Handles control events. + * + * @since Series 60 3.1 + * @param aControl Control. + * @param aEventType Event type. + */ + IMPORT_C void HandleControlEventL( + CCoeControl* aControl, + TCoeEvent aEventType ); + + /** + * From CCoeControl. + * Handles pointer events + * + * This method must always be called, even when it's overridden by derived + * classes + * + * @param aPointerEvent pointer event + */ + IMPORT_C void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + /** + * From CCoeControl. + * Handles pointer events + * + * This method must always be called, even when it's overridden by derived + * classes + * + * @param aDrawNow Contains the value that was passed to it by SetFocus(). + */ + IMPORT_C void FocusChanged( TDrawNow aDrawNow ); + + /** + * From MAknLongTapDetectorCallBack. + * Handles the long tap events. + * + * @since Series 60 3.1 + * @param aPenEventLocation Long tap event location relative to parent + * control. + * @param aPenEventScreenLocation Long tap event location relative to + * screen. + */ + IMPORT_C void HandleLongTapEventL( + const TPoint& aPenEventLocation, + const TPoint& aPenEventScreenLocation ); + +protected: + // New functions + + /** + * C++ default constructor. + */ + IMPORT_C CXnControlAdapter(); + + /** + * Two-phased constructor. + */ + IMPORT_C void ConstructL( CXnNodePluginIf& aNode ); + + /** + * Const-version of getting the component pointer. + * For internal use only. + * + * @since Series 60 3.1 + * @return Component pointer. + */ + CXnComponent* Component() const; + + /** + * Draws content image. + * + * @since Series 60 3.1 + */ + IMPORT_C void DrawContentImage() const; + +protected: + /** + * From CCoeControl. + * Draws the control. + * + * This method must always be called, even when it's overridden by derived + * classes + * + * @param aRect TRect to draw + */ + IMPORT_C virtual void Draw( const TRect& aRect ) const; + + /** + * From CCoeControl. + * Return a child control by index. + * + * This method must not be overridden by derived classes + * + * @param aIndex Index of the child to return + * @return Control at the given index + */ + + IMPORT_C CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * From CCoeControl. + * Return count of children. + * + * This method must not be overridden by derived classes. + * + * @return Count of children + */ + IMPORT_C TInt CountComponentControls() const; + + /** + * From CCoeControl. + * Size change notification + */ + IMPORT_C virtual void SizeChanged(); + +public: + /** + * From CCoeAppUiBase. + * Informs the components about the screen layout switch. + */ + IMPORT_C virtual void HandleScreenDeviceChangedL(); + + /** + * Informs the components about the property change. + */ + IMPORT_C void HandlePropertyChangeL( CXnProperty* aProperty = NULL ); + + /* + * Template method, called by HandlePropertyChangeL(). + * Additional implementations are done in derived classes. + */ + IMPORT_C virtual void DoHandlePropertyChangeL( + CXnProperty* aProperty = NULL ); + + /** + * Sets the state of the long tap animation + */ + IMPORT_C void EnableLongTapAnimation( const TBool aAnimation ); + + /** + * Remove all child adapters + */ + void RemoveChildAdapters(); + + /** + * Get child adapter list i.e which are not window owning controls + */ + RPointerArray< CXnControlAdapter >& ChildAdapters(); + + /** + * Determines wheter control refuses focus loss + */ + virtual TBool RefusesFocusLoss() const { return EFalse; }; + +private: + // Data + + /** + * class implementation. + * Own. + */ + CXnControlAdapterImpl* iImpl; + + /** + * Avkon long tap detector implementation. + * Own. + */ + CAknLongTapDetector* iLongTapDetector; + }; + +// Inline functions +#include "xncontroladapter.inl" + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xncontroladapter.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xncontroladapter.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,38 @@ +/* +* 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: +* Xuikon control adapter inline functions +* +*/ + +#ifndef XNCONTROLADAPTER_INL +#define XNCONTROLADAPTER_INL + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +inline RWindow& CXnControlAdapter::Window() const + { + return CCoeControl::Window(); + }; + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +inline CCoeControl* CXnControlAdapter::GrabbingComponent() const + { + return CCoeControl::GrabbingComponent(); + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xndepthfirsttreeiterator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xndepthfirsttreeiterator.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,210 @@ +/* +* 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: Iterates over a tree, depth first +* +*/ + +#ifndef XNDEPTHFIRSTTREEITERATOR_H +#define XNDEPTHFIRSTTREEITERATOR_H + +// INCLUDES +#include +#include "xnchilditerator.h" + +// Constants +/** + * Queue granularity value + */ +const TInt KMemoryAlocS = 64; + + +template < class T > + class CXnDepthFirstTreeIterator: public CBase, public MXnChildIterator + { +public: + /** + * Two-phased constructor. + * @param aStartNode Object to iterate over + */ + static CXnDepthFirstTreeIterator< T >* NewL( T& aStartNode ); + + /** + * Destructor. + */ + virtual ~CXnDepthFirstTreeIterator(); + + /** + * Get the next iterator value. + * @return Next object or NULL if no more values. + */ + T* NextL(); + + /** + * Get the current iterator value. + * @return Current object + */ + T* Value(); + + /** + * Get the previous iterator value. Obsolete! + * @return NULL + */ + T* PreviousL(); + + /** + * Get the current iterator index. Obsolete! + * @return value 0 + */ + TUint Index() const; + + /** + * Get the current iterator level in the tree. + * @return current level + */ + TUint Level() const; + +protected: + + CXnDepthFirstTreeIterator( T* aStartNode ); + + void ConstructL(); + +private: + //Stack + RPointerArray< T > iStack; + //Object to iterate over + T* iStart; + // Current object + T* iCurrent; + + }; + +// ----------------------------------------------------------------------------- +// CXnDepthFirstTreeIterator< T >::NewL() +// ----------------------------------------------------------------------------- +// +template< class T > CXnDepthFirstTreeIterator< T >* + CXnDepthFirstTreeIterator::NewL( T& aStartNode ) + { + CXnDepthFirstTreeIterator* self = + new ( ELeave )CXnDepthFirstTreeIterator< T >( &aStartNode ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnDepthFirstTreeIterator< T >::CXnDepthFirstTreeIterator() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +template< class T > CXnDepthFirstTreeIterator< T >::CXnDepthFirstTreeIterator( + T* aStartNode ) : iStart( aStartNode ), iStack( KMemoryAlocS ) + { + + } + +// ----------------------------------------------------------------------------- +// CXnDepthFirstTreeIterator< T >::~CXnDepthFirstTreeIterator() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +template< class T > + CXnDepthFirstTreeIterator< T >::~CXnDepthFirstTreeIterator() + { + iStack.Close(); + } + +// ----------------------------------------------------------------------------- +// CXnDepthFirstTreeIterator< T >::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +template< class T > void CXnDepthFirstTreeIterator< T >::ConstructL() + { + iStack.AppendL( iStart ); + } + +// ----------------------------------------------------------------------------- +// CXnDepthFirstTreeIterator< T >::NextL() +// ----------------------------------------------------------------------------- +// +template< class T > T* CXnDepthFirstTreeIterator< T >::NextL() + { + if( iStack.Count() ) + { + // Pop + TInt topIndex( iStack.Count() - 1 ); + iCurrent = iStack[topIndex]; + iStack.Remove( topIndex ); + + RPointerArray< T >& currentChildNodes( iCurrent->Children() ); + TInt currentChildCount( currentChildNodes.Count() ); + + // Push left most child to top + for( TInt i = currentChildCount - 1; i >= 0; --i ) + { + iStack.AppendL( currentChildNodes[i] ); + } + } + else + { + iCurrent = NULL; + iStack.Reset(); + iStack.AppendL( iStart ); + } + return iCurrent; + } + +// ----------------------------------------------------------------------------- +// CXnDepthFirstTreeIterator< T >::Value() +// ----------------------------------------------------------------------------- +// +template< class T > T* CXnDepthFirstTreeIterator< T >::Value() + { + return iCurrent; + } + +// ----------------------------------------------------------------------------- +// CXnDepthFirstTreeIterator< T >::PreviousL() +// ----------------------------------------------------------------------------- +// +template< class T > T* CXnDepthFirstTreeIterator< T >::PreviousL() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnDepthFirstTreeIterator< T >::Index() +// ----------------------------------------------------------------------------- +// +template< class T > TUint CXnDepthFirstTreeIterator< T >::Index() const + { + return 0; + } + +// ----------------------------------------------------------------------------- +// CXnDepthFirstTreeIterator< T >::Level() +// Get the current iterator level in the tree. +// ----------------------------------------------------------------------------- +template< class T > TUint CXnDepthFirstTreeIterator< T >::Level() const + { + return iStack.Count(); + } + + +#endif // CXNDEPTHFIRSTTREEITERATOR_H + +// End of File \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xndocument.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xndocument.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,76 @@ +/* +* 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: +* Document base class for Xuikon based applications +* +*/ + +#ifndef XNDOCUMENT_H +#define XNDOCUMENT_H + +// System includes +#include + +// Class declaration +/** + * Document base class for Xuikon. + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since Series 60 3.1 + */ +class CXnDocument : public CAknDocument + { +public: + /** + * C++ default constructor. + */ + IMPORT_C CXnDocument( CEikApplication& aApp, TUid aApplicationUid ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CXnDocument(); + +public: + // New functions + + /** + * Get the application uid + * + * @since Series 60 3.1 + * @return Application uid + */ + IMPORT_C TUid Uid(); + +public: + /** + * From CEikDocument. + * Creates an AppUi + * + * @since Series 60 3.1 + * @return AppUi + */ + virtual CEikAppUi* CreateAppUiL(); + +private: + // Data + + /** + * application uid + */ + TUid iApplicationUid; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xndomattribute.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xndomattribute.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,158 @@ +/* +* 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: Represent single xmluiml attribute +* +*/ + + + +#ifndef XN_DOM_ATTRIBUTE_H +#define XN_DOM_ATTRIBUTE_H + +// INCLUDES +#include +#include +#include "mxndomlistitem.h" + +//CLASS FORWARD + +class CXnDomStringPool; + +// CLASS DECLARATION + +/** +* @ingroup group_domdocument +* Represent attribute name and value as strings. +* +* @lib xndomdocument.lib +* @since Series 60 3.1 +*/ +class CXnDomAttribute : public CBase, public MXnDomListItem + { + public: // Constructors and destructor + + /** + * Two-phased constructor 8 bit. + */ + IMPORT_C static CXnDomAttribute* NewL( + const TDesC8& aName, + CXnDomStringPool& aStringPool ); + + /** + * Two-phased stream constructor. + */ + static CXnDomAttribute* NewL( + RReadStream& aStream, + CXnDomStringPool& aStringPool ); + /** + * Destructor. + */ + IMPORT_C virtual ~CXnDomAttribute(); + + public: // New functions + /** + * Makes a copy from original attribute. + * @since Series 60 3.1 + * @return Pointer to attribute. Attribute ownership is transferred to a caller + */ + IMPORT_C CXnDomAttribute* CloneL(); + + /** + * Makes a copy from original property. + * @since Series 60 3.1 + * @param Original string pool clone. + * @return Pointer to an attribute. Ownership is transferred to a caller. + */ + CXnDomAttribute* CloneL( CXnDomStringPool& aStringPool ); + + /** + * Get the attribute value. + * @since Series 60 3.1 + * @return Pointer to a attribute value string. If value is not set KNullDesC8 is returned. + */ + IMPORT_C const TDesC8& Value(); + + /** + * Set attribute value. + * @since Series 60 3.1 + * @param aValue Attribute string value + */ + IMPORT_C void SetValueL( const TDesC8& aValue ); + + /** + * Get the attributes name string pool index. + * @since Series 60 3.1 + * @return String pool index. + */ + IMPORT_C TInt16 NameStringPoolIndex()const; + + /** + * Get the attributes value string pool index. + * @since Series 60 3.1 + * @return String pool index. + */ + IMPORT_C TInt16 ValueStringPoolIndex()const; + + public: //From CXnDomListItem + + /** + * Documented in CXnDomListItem::Size + */ + IMPORT_C const TDesC8& Name(); + + + /** + * Documented in CXnDomListItem::Size + */ + TInt Size() const; + + /** + * Documented in CXnDomListItem::Size + */ + void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Internalize property. + * @since Series 60 3.1 + * @param aStream Input stream + */ + void InternalizeL( RReadStream& aStream ); + private: + + /** + * C++ default constructor. + */ + CXnDomAttribute( CXnDomStringPool& aStringPool ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( const TDesC8& aName ); + + + private: // Data + //String pool to get string for references, not owned + CXnDomStringPool& iStringPool; + + //Attribute name reference + TInt16 iNameRef; + + //Attribute value reference + TInt16 iValueRef; + + }; + +#endif // XN_DOM_ATTRIBUTE_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xndomdepthiterator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xndomdepthiterator.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,99 @@ +/* +* 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: Depth iterator walks the dom tree by depth first. +* +*/ + + + +#ifndef XN_DOM_DEPTH_ITERATOR_H +#define XN_DOM_DEPTH_ITERATOR_H + +// INCLUDES +#include +#include "mxndomiterator.h" + + +// FORWARD DECLARATIONS +class CXnDomNode; + + +// CLASS DECLARATION + +/** +* @ingroup group_domdocument +* Depth iterator walks through the dom tree using the depth first +* principle. +* +* @lib xndomdocument.lib +*/ +class CXnDomDepthIterator: public CBase, public MXnDomIterator + { +public: + /** + * Two-phased constructor. + * @param aStartNode object to iterate over + */ + IMPORT_C static CXnDomDepthIterator* NewL( CXnDomNode& aStartNode ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CXnDomDepthIterator(); + + /** + * Documented in MXnDomIterator::First + */ + IMPORT_C CXnDomNode* First(); + + /** + * Documented in MXnDomIterator::NextL + */ + IMPORT_C CXnDomNode* NextL(); + +private: + /** + * C++ default constructor + */ + CXnDomDepthIterator( CXnDomNode* aRootNode ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Push node to stack. + * @param aNode Node to push + */ + //void PushL( CXnDomNode& aNode ); + + /** + * Pop node from the stack. + * @return Pointer to node + */ + //CXnDomNode* Pop(); + +private: + // Follow tree hierarchy with stack + RPointerArray< CXnDomNode > iStack; + // First node + CXnDomNode* iStart; + //Current node + CXnDomNode* iCurrent; + }; + +#endif // XN_DOM_DEPTH_ITERATOR_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xndomdocument.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xndomdocument.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,175 @@ +/* +* 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: Represents the entire xmluiml specific xml and css data. +* +*/ + + + +#ifndef XN_DOM_DOCUMENT_H +#define XN_DOM_DOCUMENT_H + +// INCLUDES +#include +#include + + +//FORWARD DECLARATIONS +class CXnDomStringPool; +class CXnDomNode; +// CLASS DECLARATION + +/** +* @ingroup group_domdocument +* Provides the primary access to the document's data. +* +* @lib xndomdocument.lib +* @since Series 60 3.1 +*/ +class CXnDomDocument: public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CXnDomDocument* NewL(); + /** + * Two-phased stream constructor. + */ + IMPORT_C static CXnDomDocument* NewL( RReadStream& aStream ); + /** + * Construct CXnDomDocument from streamed HBufC8. + */ + IMPORT_C static CXnDomDocument* NewL( const HBufC8* aBufStream ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CXnDomDocument(); + + public: // New functions + /** + * Makes a clone of this document. + * @since Series 60 3.1 + * @return Pointer to a document. Caller has the ownership. + */ + IMPORT_C CXnDomDocument* CloneL(); + + /** + * Factory method to create node elements, because elements cannot exist outside + * the context of a document. + * @since Series 60 3.1 + * @param aName UTF-8 encoded Element name + * @param aNamespace UTF-8 encoded Element namespace + * @return A new CXnDomNode type instance. Ownership is transferred to caller. + */ + IMPORT_C CXnDomNode* CreateElementNSL( const TDesC8& aName, const TDesC8& aNamespace ); + + /** + * Set the root of the document tree. Root node provides primary access to + * document data. This class owns root node. + * @since Series 60 3.1 + * @param aRootNode Documents's root node. Document takes ownership. + */ + IMPORT_C void SetRootNode( CXnDomNode* aRootNode ); + + /** + * Get the root node of the document. + * @since Series 60 3.1 + * @return Pointer to CXnDomNode type node + */ + IMPORT_C CXnDomNode* RootNode() const; + + /** + * Get the last node of the document. + * @since Series 60 3.1 + * @return Pointer to CXnDomNode type node + */ + IMPORT_C CXnDomNode* LastNode() const; + + /** + * Get the size of the document's data. + * @since Series 60 3.1 + * @return Document's data size + */ + IMPORT_C TInt Size() const; + + /** + * Get document node count. + * @since Series 60 3.1 + * @return Count of all nodes in a document + */ + IMPORT_C TInt DomNodeCount() const; + + /** + * Externalize document's data. + * @since Series 60 3.1 + * @param aStream Output stream + */ + IMPORT_C void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Internalize document's data. + * @since Series 60 3.1 + * @param aStream Input stream + */ + IMPORT_C void InternalizeL( RReadStream& aStream ); + + /** + * Returns document's data as a streamed buffer. + * @since Series 60 3.1 + * @return Pointer to a new HBufC8 buffer which holds streamed document. + * Ownership is transferred to a caller. + */ + IMPORT_C HBufC8* MarshallL(); + + /** + * Get reference to string pool + * @return Reference to string pool implementation + */ + IMPORT_C CXnDomStringPool& StringPool() const; + + /** + * Read contents from a stream. + * @param aStream Input stream + * @return void + */ + IMPORT_C CXnDomNode* ReadL( RReadStream& aStream ); + + private: + + /** + * C++ default constructor. + */ + CXnDomDocument(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + //Document owns the root node. + CXnDomNode* iRootNode; + + //Namespace map stores namespaces used in dom + CXnDomStringPool* iDomStringPool; + + + }; + +#endif // XN_DOM_DOCUMENT_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xndomlist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xndomlist.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,247 @@ +/* +* 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: List class to hold MXnDomListItem objects. +* +*/ + + + +#ifndef XN_DOM_LIST_H +#define XN_DOM_LIST_H + +// INCLUDES +#include +#include + + +// FORWARD DECLARATIONS +class MXnDomListItem; +class CXnDomStringPool; + +// CLASS DECLARATION + +/** +* @ingroup group_domdocument +* Represents streamable list object, which holds MXnDomListItem objects. +* +* @lib xndomdocument.lib +* @since Series 60 3.1 +*/ +class CXnDomList : public CBase + { + public: + enum TListType + { + ENodeList=0, + EAttributeList, + EPropertyList, + EPropertyValueList + }; + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnDomList* NewL( TListType aListType, + CXnDomStringPool& aStringPool, + TInt aGranularity=4); + + /** + * Two-phased stream constructor. + */ + static CXnDomList* NewL( + RReadStream& aStream, + CXnDomStringPool& aStringPool ); + + /** + * Destructor. + */ + virtual ~CXnDomList(); + + public: // Adding and removing + + /** + * Frees memory allocated for all items in a list. + * @since Series 60 3.1 + */ + IMPORT_C void Reset(); + + /** + * List owns items. + * @since Series 60 3.1 + * @param aListItem to add + */ + IMPORT_C void AddItemL( MXnDomListItem* aListItem ); + + /** + * List owns items. + * @since Series 60 3.1 + * @param aListItem to add + * @param aIndex Index in list where the item is added + */ + IMPORT_C void AddItemL( MXnDomListItem* aListItem, TInt aIndex ); + + /** + * Remove item from list. + * @since Series 60 3.1 + * @param Index to aList item to remove + */ + IMPORT_C void RemoveItem( TInt aIndex ); + + /** + * Delete item from list. + * @since Series 60 3.1 + * @param Index to aList item to delete + */ + IMPORT_C void DeleteItem( TInt aIndex ); + + /** + * Remove item from list. + * @since Series 60 3.1 + * @param aList item to remove + */ + IMPORT_C void RemoveItem( MXnDomListItem* aItem ); + + /** + * Delete item from list. + * @since Series 60 3.1 + * @param aList item to delete + */ + IMPORT_C void DeleteItem( MXnDomListItem* aItem ); + + public: // Accessing + /** + * List items are accessed by index, i.e like arrays + * @since Series 60 3.1 + * @param aIndex list item index + * @return Pointer to a a list item + */ + IMPORT_C MXnDomListItem* Item( TInt aIndex )const; + + /** + * Number of items in a list. + * @since Series 60 3.1 + * @return Item count + */ + IMPORT_C TInt Length() const; + + /** + * Get the first item in a list. + * @since Series 60 3.1 + * @return Pointer to the first item in a list + */ + IMPORT_C MXnDomListItem* First(); + + /** + * The last item in a list + * @since Series 60 3.1 + * @return Pointer to the last item in a list + */ + IMPORT_C MXnDomListItem* Last(); + + /** + * Find list item by item name. Searches list items + * which have name attribute. + * @since Series 60 3.1 + * @param aName UTF8 encoded item's name to be searched + * @return Pointer to the list item, NULL if not exist. + */ + IMPORT_C MXnDomListItem* FindByName( const TDesC8& aName ); + + /** + * Get item index + * @since Series 60 3.1 + * @param aItem Item to be searched + * @return Item index or KErrNotFound if not found + */ + IMPORT_C TInt ItemIndex( const MXnDomListItem& aItem )const; + + /** + * Get reference to the dom's string pool. + * @since Series 60 3.1 + * @return Reference to string pool + */ + IMPORT_C CXnDomStringPool& StringPool() const; + + /** + * Count items in a list. + */ + TInt Count() const; + public: // Serializing + + /** + * Get list's data size in bytes. + * @since Series 60 3.1 + * @return Data size in bytes + */ + TInt Size() const; + + /** + * Externalize list's data. + * @since Series 60 3.1 + * @param aStream Output stream + */ + void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Internalize list's data. + * @since Series 60 3.1 + * @param aStream Input stream + */ + void InternalizeL( RReadStream& aStream ); + + public: //Utility + + /** + * Get list item type. + * @since Series 60 3.1 + * @return List item type + */ + TListType Type() const + { + return iListType; + } + + + private: + + /** + * C++ default constructor. + */ + CXnDomList( TListType aListType, + CXnDomStringPool& aStringPool, + TInt aGranularity=4 ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + protected: + //List type + TListType iListType; + + //Items are stored into a segmented array + RPointerArray iList; + + private: // Data + // StringPool, not owned + CXnDomStringPool& iStringPool; + + + }; + +#endif // XN_DOM_LIST_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xndomnode.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xndomnode.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,396 @@ +/* +* 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: Primary datatype for the entire Document Object Model. +* +*/ + + + +#ifndef XN_DOM_NODE_H +#define XN_DOM_NODE_H + +// INCLUDES +#include +#include +#include "mxndomlistitem.h" + +// FORWARD DECLARATIONS +enum TContentType + { + EEmpty = 0, + EAny, + EPCData + }; + +class CXnDomList; +class CXnDomStringPool; +class CXnNode; + +// CLASS DECLARATION + +/** +* @ingroup group_domdocument +* Class represents a single node in the document tree. +* +* @lib xndomdocument.lib +* @since Series 60 3.1 +*/ +class CXnDomNode : public CBase, public MXnDomListItem + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnDomNode* NewL( + const TDesC8& aName, + const TDesC8& aNS, + CXnDomStringPool& aStringPool ); + + /** + * Two-phased stream constructor. + */ + static CXnDomNode* NewL( RReadStream& aStream, CXnDomStringPool& aStringPool ); + + /** + * Destructor. + */ + virtual ~CXnDomNode(); + + public: // New functions + /** + * Makes a clone from this node and it's child nodes. + * @since Series 60 3.1 + * @param aStringPool. A new string pool. + * @return Pointer to a clone node. Caller has the ownership. + */ + IMPORT_C CXnDomNode* CloneL( CXnDomStringPool& aStringPool ); + + /** + * Makes a clone only from this node. + * @since Series 60 3.1 + * @param aStringPool. A new string pool. + * @return Pointer to a clone node. Caller has the ownership. + */ + IMPORT_C CXnDomNode* CloneWithoutKidsL( CXnDomStringPool& aStringPool ); + + /** + * Contructs a ref node from this node and its child's. + * @since Series 60 3.1 + * @return Pointer to a ref node. Caller has the ownership. + */ + IMPORT_C CXnDomNode* CreateRefNodeL(); + + /** + * Get the namespace of this node. + * @since Series 60 3.1 + * @return Pointer to the namespace buffer + */ + IMPORT_C const TDesC8& Namespace(); + + /** + * Node's attributes exist in a list. + * @since Series 60 3.1 + * @return Reference to a attribute list. + */ + IMPORT_C CXnDomList& AttributeList()const; + + /** + * Node's properties exist in a list. + * @since Series 60 3.1 + * @return Reference to a property list. + */ + IMPORT_C CXnDomList& PropertyList(); + + /** + * Node need to know it's parent. + * @since Series 60 3.1 + * @param aParent Pointer to this node parent + */ + IMPORT_C void SetParent( CXnDomNode* aParent ); + + /** + * Node's parent is enquered e.g to traverse the document. + * @since Series 60 3.1 + * @return Pointer to a parent node + */ + IMPORT_C CXnDomNode* Parent() const; + + /** + * Node id is for a uiengine use. + * @since Series 60 3.1 + * @param aNodeId Unique identifier + */ + IMPORT_C void SetNodeId( const TInt aNodeId ); + + /** + * Get the node unique identifier. + * @since Series 60 3.1 + * @return Node unique identifier + */ + IMPORT_C TInt NodeId() const; + + /** + * Get the node unique identifier. + * @since Series 60 3.1 + * @return Node unique identifier + */ + IMPORT_C TInt ItemIndex( const MXnDomListItem& aItem )const; + + /** + * Access to child nodes. + * @since Series 60 3.1 + * @return Pointer to a list of child nodes + */ + IMPORT_C CXnDomList& ChildNodes(); + + /** + * Child nodes of this node are needed to be able to + * traverse the document. + * @since Series 60 3.1 + * @param aNode Node owns it's childs + */ + IMPORT_C void AddChildL( CXnDomNode* aNode ); + + /** + * Child nodes of this node are needed to be able to + * traverse the document. + * @since Series 60 3.1 + * @param aNode Node owns it's childs + * @param aIndex Index in list where the node is added + */ + IMPORT_C void AddChildL( CXnDomNode* aNode, TInt aIndex ); + + /** + * Removes node from the child list and frees memory allocated + * for a child node and it descendants. + * @since Series 60 3.1 + * @param aNode Node to be released + */ + IMPORT_C void DeleteChild( CXnDomNode* aNode ); + + /** + * Replaces a child node with the other node. Memory allocated for + * the node is freed. + * @since Series 60 3.1 + * @param aNode Node to be replaced + * @param aNewNode New node + */ + IMPORT_C void ReplaceChildL( CXnDomNode* aNode, CXnDomNode* aNewNode ); + + /** + * Get the character data + * @since Series 60 3.1 + * @return Reference to a buffer + */ + IMPORT_C const TDesC8& PCData(); + + /** + * Append PCData into node. Thus it is possible to have + * "a c e " PCData. + * @since Series 60 3.1 + * @param aPCData UTF-8 encoded parsed character data + */ + IMPORT_C void AppendPCDataL( const TDesC8& aPCData ); + + /** + * Set parsed character data. + * @since Series 60 3.1 + * @param aPCData UTF-8 encoded parsed character data + */ + IMPORT_C void SetPCDataL( const TDesC8& aPCData ); + + /** + * Set content type + * @since Series 60 3.1 + * @return content type + */ + IMPORT_C const TContentType& ContentType(); + + /** + * Get content type + * @since Series 60 3.1 + * @param aContentType content type + */ + IMPORT_C void SetContentType( const TContentType& aContentType ); + + /** + * Recursive function to count all child nodes belonging + * to this node. + * @since Series 60 3.1 + * @return This node and it's all childs count + */ + IMPORT_C TInt DescendantCount() const; + + /** + * Get reference to the dom's string pool. + * @since Series 60 3.1 + * @return Reference to string pool + */ + IMPORT_C CXnDomStringPool& StringPool() const; + + /** + * Mark this node as a reference node. + * @since Series 60 3.1 + * @param aRefNode ETrue if node is a reference node + */ + IMPORT_C void SetRefNode( TBool aRefNode=ETrue ); + + /** + * Check if this node is referring to some global node. + * @since Series 60 3.1 + * @return ETrue if this is a reference node. + */ + IMPORT_C TBool IsRefNode() const; + + /** + * Deletes attributes when they are not needed anymore. + * I.e. UIEngine has copied them into property list. + * @since Series 60 3.1 + */ + IMPORT_C void DeleteAttributeList(); + + /** + * Returns value of given attribute + * @param aAttribute Name of the attribute + * @since S60 3.1 + * @return Value of an attribute + */ + IMPORT_C const TDesC8& AttributeValue(const TDesC8& aAttribute) const; + + public: //From MXnDomListItem + + + /** + * Documented in CXnDomListItem::Size + */ + TInt Size() const; + + /** + * Documented in CXnDomListItem::ExternalizeL + * NOTE: This function is not implemented yet! + */ + void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Documented in CXnDomListItem::InternalizeL + */ + void InternalizeL( RReadStream& aStream ); + + /** + * Similar to InternalizeL, but does not expect dedicated odt document + */ + void ReadL( RReadStream& aStream ); + + + /** + * Documented in CXnDomListItem::Name + */ + IMPORT_C const TDesC8& Name(); + + + public: + + /** + * Sets pointer to associated layout node + * @since S60 3.1 + * @param aNode Pointer to associated layout node + */ + IMPORT_C void SetLayoutNode(CXnNode* aNode); + + /** + * Returns pointer to associated layout node + * @since S60 3.1 + * @return Pointer to associated layout node + */ + IMPORT_C CXnNode* LayoutNode(); + + /** + * Set the namespace for this node. + * @since Series 60 3.1 + * @param aNS New namespace + */ + IMPORT_C void SetNamespaceL(const TDesC8& aNS); + + /** + * Makes a clone from this node and it's child nodes. Sets new namespace. + * @since Series 60 3.1 + * @param aStringPool. A new string pool. + * @param aNS. A new namespace. + * @return Pointer to a clone node. Caller has the ownership. + */ + IMPORT_C CXnDomNode* CloneL( CXnDomStringPool& aStringPool, const TDesC8& aNS ); + + /** + * Set ownership of node and its children + * @since Series 60 5.1 + * @param aNS. A new namespace. + * @return void + */ + IMPORT_C void SetOwnershipL( const TDesC8& aNS ); + + private: + /** + * C++ default constructor. + */ + CXnDomNode( CXnDomStringPool& aStringPool ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( const TDesC8& aName, const TDesC8& aNS ); + + private: // Data + + //iNameRef refers to a name string in a string pool + TInt iNameRef; + + //iNSRef refers to a namespace string in a string pool + TInt iNSRef; + + //iStringPool is used to resolve strings based on references + CXnDomStringPool& iStringPool; + + //Type of the elements content + TContentType iContentType; + + //Parsed character data + HBufC8* iPCData; + + //Node's parent pointer + CXnDomNode* iParentNode; + + //Node unique identifier + TInt iNodeId; + + //Node's childs are collected into a list. Childs are owned by node + CXnDomList* iChildList; + + //Node is the owner of the attributes + CXnDomList* iAttributeList; + + //Node is the owner of the properties + CXnDomList* iPropertyList; + + //Flag is set if this node is reference node + TBool iRefNode; + + // Not owned + CXnNode* iLayoutNode; + }; + +#endif // XN_DOM_NODE_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xndomproperty.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xndomproperty.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,227 @@ +/* +* 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: Represents a CSS property. +* +*/ + + + +#ifndef XN_DOM_PROPERTY_H +#define XN_DOM_PROPERTY_H + +// INCLUDES +#include +#include +#include "mxndomlistitem.h" + + +// FORWARD DECLARATIONS +class CXnDomPropertyValue; +class CXnDomList; +class CXnDomStringPool; + +// CLASS DECLARATION + +/** +* @ingroup group_domdocument +* Represents a CSS property. +* +* @lib xndomdocument.lib +* @since Series 60 3.1 +*/ +class CXnDomProperty : public CBase, public MXnDomListItem + { + public: + /** + * Property value's pseudo class type + */ + enum TPseudoClass + { + ENone=0, + EFocus, + EPassiveFocus, + EActive, + EHold, + EEnabled, + EDisabled, + EHover, + ELink, + EVisited, + EEdit, + EPressedDown + }; + public: // Constructors and destructor + /** + * Two-phased constructor. + */ + IMPORT_C static CXnDomProperty* NewL( + const TDesC8& aName, + CXnDomStringPool& aStringPool ); + + /** + * Two-phased stream constructor. + */ + static CXnDomProperty* NewL( + RReadStream& aStream, + CXnDomStringPool& aStringPool ); + /** + * Two-phased constructor. + */ + IMPORT_C static CXnDomProperty* NewL( + TInt16 aStringPoolIndex, + CXnDomStringPool& aStringPool ); + /** + * Destructor. + */ + IMPORT_C virtual ~CXnDomProperty(); + + public: // New functions + /** + * Make a copy from original property. + * @since Series 60 3.1 + * @return Pointer to a property. Ownership is transferred to a caller. + */ + IMPORT_C CXnDomProperty* CloneL(); + + /** + * Make a copy from original property. + * @since Series 60 3.1 + * @param Original string pool clone. + * @return Pointer to a property. Ownership is transferred to a caller. + */ + IMPORT_C CXnDomProperty* CloneL( CXnDomStringPool& aStringPool ); + + /** + * Get property value list. + * @since Series 60 3.1 + * @return Reference to property value list. + */ + IMPORT_C CXnDomList& PropertyValueList(); + + /** + * Test if property has any value. + * @since Series 60 3.1 + * @return ETrue if at least one value exist + */ + IMPORT_C TBool IsValueSet(); + + /** + * Test property's capability to inherit value. + * @since Series 60 3.1 + * @return ETrue if property's value can be inherited + */ + IMPORT_C TBool Inherited(); + + /** + * Set property to be capable to inherit value. + * @since Series 60 3.1 + * @param aInherited ETrue inherit capable + */ + IMPORT_C void SetInherited( TBool aInherited ); + + /** + * Get reference to the dom's string pool. + * @since Series 60 3.1 + * @return Reference to string pool + */ + IMPORT_C CXnDomStringPool& StringPool() const; + + /** + * Get the property's string pool index. + * @since Series 60 3.1 + * @return String pool index. + */ + IMPORT_C TInt16 StringPoolIndex()const; + + public: //Pseudo class utility + /** + * Get value's pseudo class + * @since Series 60 3.1 + * @return Value's pseudo class + */ + IMPORT_C TPseudoClass PseudoClass()const; + + /** + * Set value's pseudo class + * @since Series 60 3.1 + * @param aPseudoClass Pseudo class enumeration + */ + IMPORT_C void SetPseudoClass( TPseudoClass aPseudoClass ); + + public: //From CXnDomListItem + + /** + * Documented in CXnDomListItem::Name + */ + IMPORT_C const TDesC8& Name(); + + /** + * Documented in CXnDomListItem::Size + */ + TInt Size() const; + + /** + * Documented in CXnDomListItem::ExternalizeL + */ + void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Documented in CXnDomListItem::InternalizeL + */ + void InternalizeL( RReadStream& aStream ); + + private: + + /** + * C++ default constructor. + */ + CXnDomProperty( CXnDomStringPool& aStringPool); + + /** + * C++ constructor with string pool index. + */ + CXnDomProperty( TInt16 aStringPoolIndex, CXnDomStringPool& aStringPool); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( const TDesC8& aName ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + //String pool to get string for references, not owned + CXnDomStringPool& iStringPool; + + // Pseudo class type for value + TPseudoClass iPseudoClass; + + //Property's name reference to string pool + TInt16 iNameRef; + + //Property owns a value list which has property's values + CXnDomList* iPropValList; + + //Property is capable to inherit + TBool iInherited; + + + }; + +#endif // XN_DOM_PROPERTY_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xndompropertyvalue.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xndompropertyvalue.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,304 @@ +/* +* 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: Property's value encapsulation. +* +*/ + + + +#ifndef XN_DOM_PROPERTY_VALUE_H +#define XN_DOM_PROPERTY_VALUE_H + +// INCLUDES +#include +#include +#include "mxndomlistitem.h" + + +//CLASS FORWARD +class CXnDomStringPool; +class TRgb; +// CLASS DECLARATION + +/** +* @ingroup group_domdocument +* Serializable class to hold property's value. +* +* @lib XnDomDocument.lib +* @since Series 60 3.1 +*/ +class CXnDomPropertyValue : public CBase, public MXnDomListItem + { + public: //Enumerations + + /** + * CSS Primitive value type + */ + enum TPrimitiveValueType + { + EUnknown = 0, + ENumber, + EPercentage, + EEms, + EExs, + EPx, + ECm, + EMm, + EIn, + EPt, + EPc, + EDeg, + ERad, + EGrad, + EMs, + ES, + EHz, + EKHz, + EDimension, + EString, + EUri, + EIdent, + EAttr, + ECounter, + ERect, + ERgbColor, + ERgbaColor, + EFunction, + EUnitValue + }; + + /** + * Ident type + */ + enum TIdentType + { + ENotSet = 0, + EAuto, + ENone, + EInherit + }; + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CXnDomPropertyValue* NewL( CXnDomStringPool& aStringPool ); + + /** + * Two-phased stream constructor. + */ + static CXnDomPropertyValue* NewL( + RReadStream& aStream, + CXnDomStringPool& aStringPool ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CXnDomPropertyValue(); + + public: // New functions + /** + * Clone property value. + * @since Series 60 3.1 + * @return Pointer to a property value. Ownership is transferred to a caller + */ + IMPORT_C CXnDomPropertyValue* CloneL(); + + /** + * Clone property value. + * @since Series 60 3.1 + * @param aStringPool StringPool clone which holds actual strings. + * @return Pointer to a property value. Ownership is transferred to a caller + */ + CXnDomPropertyValue* CloneL( CXnDomStringPool& aStringPool ); + + /** + * Release object's data. + * @since Series 60 3.1 + */ + IMPORT_C void ReleaseData(); + + /** + * Get the property's value. If value type is not recognized, + * function will leave with KErrNotSupported. + * @since Series 60 3.1 + * @return Property's value + */ + IMPORT_C TReal FloatValueL() const; + + /** + * Set the property's value based on a given type. If type is not recognized, + * function will leave with KErrNotSupported. + * @since Series 60 3.1 + * @param aValueType Type of a value. + * @param aFloatValue Property's value. + */ + IMPORT_C void SetFloatValueL( TPrimitiveValueType aValueType, TReal aFloatValue ); + + /** + * Get the property's string value. If value is not a string type, + * function will leave with KErrNotSupported. + * @since Series 60 3.1 + * @return Pointer to the property's string value. + */ + IMPORT_C const TDesC8& StringValueL() ; + + /** + * Get the property's string value. If value is not a string type, + * function will return KNullDesC8. + * @since Series 60 5.0 + * @return Reference to string. + */ + IMPORT_C const TDesC8& StringValue() ; + + /** + * Set the property's string value based on a given type. If type is not recognized, + * function will leave with KErrNotSupported. + * @since Series 60 3.1 + * @param aValueType Type of a value. + * @param aStringValue Property's string value. + */ + IMPORT_C void SetStringValueL( + TPrimitiveValueType aValueType, + const TDesC8& aStringValue ); + + /** + * Get the property's color value. + * @since Series 60 3.1 + * @return Property's color value (TRgb). + */ + IMPORT_C const TRgb& RgbColorValueL() const; + + /** + * Sets the RGB Color value + * @since Series 60 3.1 + * @param aRgb Instance of TRgb. + */ + IMPORT_C void SetRgbColorL( const TRgb& aRgb ); + + /** + * Returns the primitive value type + * @since Series 60 3.1 + * @return Primitive value type + */ + IMPORT_C TPrimitiveValueType PrimitiveValueType() const; + + /** + * Checks if string value is "inherit" + * @since Series 60 3.1 + * @return ETrue if TPrimitiveValueType::EIdent and string value is "inherit". + */ + IMPORT_C TBool IsInheritIdent(); + + /** + * Checks if string value is "auto" + * @since Series 60 3.1 + * @return ETrue if TPrimitiveValueType::EIdent and string value is "auto". + */ + IMPORT_C TBool IsAutoIdent(); + + /** + * Checks if string value is "none" + * @since Series 60 3.1 + * @return ETrue if TPrimitiveValueType::EIdent and string value is "none". + */ + IMPORT_C TBool IsNoneIdent(); + + /** + * Set the property's string pool index + * @since Series 60 3.1 + * @param aValueType Type of a value. + * @param aStringPoolIndex String pool index. + */ + IMPORT_C void SetStringPoolIndexL( + TPrimitiveValueType aValueType, + TInt16 aStringPoolIndex ); + /** + * Get the property's string pool index. If type is not string, + * function will leave with KErrNotSupported. + * @since Series 60 3.1 + * @return String pool index. + */ + IMPORT_C TInt16 StringPoolIndexL()const; + + public: //From MXnDomListItem + /** + * Documented in MXnDomListItem::Size + */ + TInt Size()const; + + /** + * Documented in MXnDomListItem::ExternalizeL + */ + void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Documented in MXnDomListItem::InternalizeL + */ + void InternalizeL( RReadStream& aStream ); + + + /** + * Documented in MXnDomListItem::Name + */ + const TDesC8& Name(){ return KNullDesC8; } + + private: + + /** + * C++ default constructor. + */ + CXnDomPropertyValue( CXnDomStringPool& aStringPool ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + + private: // Data + + // union containing the primitive value data, + // this is an union for memory consumption optimization reasons + union + { + // rgba color + TRgb* iRgbColor; + + // Real value + TReal* iRealValue; + + // String reference + TInt16 iStringRef; + + // Constant string value + TPtrC* iUnknownValue; + + } iData; + + //String pool + CXnDomStringPool& iStringPool; + + // primitive value type + TPrimitiveValueType iPrimitiveValueType; + + //Flag to identify ident + TIdentType iIdent; + + }; + +#endif // XN_DOM_PROPERTY_VALUE_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xndomstringpool.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xndomstringpool.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,124 @@ +/* +* 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: Flyweigth pattern implementation for dom strings. +* +*/ + + + +#ifndef XN_DOM_STRING_POOL_H +#define XN_DOM_STRING_POOL_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION + +/** +* @ingroup group_domdocument +* Class utilize flyweight pattern. Dom strings are stored once +* and referred with index. Class can be serialized. +* +* @lib xndomdocument.lib +* @since Series 60 3.1 +*/ +class CXnDomStringPool : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnDomStringPool* NewL(); + /** + * Two-phased stream constructor. + */ + static CXnDomStringPool* NewL( RReadStream& aStream ); + /** + * Destructor. + */ + virtual ~CXnDomStringPool(); + + public: + /** + * Make a copy from original StringPool. + * @since Series 60 3.1 + * @return Pointer to a string pool. Ownership is transferred to a caller. + */ + CXnDomStringPool* CloneL(); + public: //Adding + + /** + * Set dom string into string pool. + * @param aString String to add to string pool + * @return Index (reference) to string pool + */ + IMPORT_C TInt AddStringL( const TDesC8& aString ); + + public: //Accessing + /** + * Get pointer to the node element name. + * @param aMap Map object which has index to name string + * @return Pointer to the name + */ + const TDesC8& String( const TInt aStringRef ); + + /** + * Get object's data size in bytes. + * @return Data size in bytes + */ + TInt Size() const; + + /** + * Externalize object + * @param aStream Output stream + */ + void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Internalize object + * @param aStream Input stream + */ + void InternalizeL( RReadStream& aStream ); + + /** + * Get index offset to string array for shared resources + * @return An offset that caller must add to its indexes + */ + TUint Offset() const; + + private: + + /** + * C++ default constructor. + */ + CXnDomStringPool(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: + //String pool + RPointerArray iStringPool; + + TUint iStringPoolOffsetCurrent; // Internalize uses + TUint iStringPoolOffsetNext; + }; + +#endif // XN_DOM_STRING_POOL_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnecomelementproxy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnecomelementproxy.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,55 @@ +/* +* 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: Proxy to access xmluiml language specific element plugins. +* +*/ + + + +#ifndef XN_ECOM_ELEMENT_PROXY_H +#define XN_ECOM_ELEMENT_PROXY_H + +// INCLUDES +#include +#include +#include "mxndomvisitor.h" + +// CLASS DECLARATION + +/** +* +* Proxy class to access xmluiml language specific element +* visitor plugins +* +* @lib xnecomelementproxy +* @since Series 60 3.1 +*/ +class TXnEComElementProxy + { + public: // Constructors and destructor + + /** + * Load plugin based on it's namespace. + * Plugin is released calling Release() function. + * @since Series 60 3.1 + * @param aNS Namespace + * @return MXnDomVisitor type object. Ownership is transferred to a caller + */ + public: + IMPORT_C static MXnDomVisitor * CreateImplementationL( const TDesC8& aNS ); + }; + +#endif // XN_ECOM_ELEMENT_PROXY_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnecomhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnecomhandler.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,139 @@ +/* +* 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: Manages ecom plugins +* +*/ + + + +#ifndef CXNECOMHANDLER_H +#define CXNECOMHANDLER_H + +// INCLUDES +#include + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +class CXnArray; + +// CLASS DECLARATION + +/** +* @ingroup group_xnutils +* +* Manages ecom plugins +* @since Series 60 3.1 +*/ +class CXnEcomHandler : public CBase + { + public: // Constructors and destructor + struct CEcomItem; + + /** + * Two-phased constructor. + * @param aRFs File server session + */ + IMPORT_C static CXnEcomHandler* NewL(); + + + /** + * Destructor. + */ + virtual ~CXnEcomHandler(); + + public: // New functions + /** + * Get pointers to plugins + * @param aInterfaceUid Interface uid to use + * @param aType Type of plugin to fetch + * @param aFunctions Array in which to copy plugin pointers + * @since Series 60 3.1 + */ + IMPORT_C void PluginsL(TUid aInterfaceUid, const TDesC8& aType, CXnArray& aFunctions); + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // New functions + + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + + + private: + //?type ?member_function(); + /** + * C++ default constructor. + */ + CXnEcomHandler(); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + // array of ecom plugins + RPointerArray iPlugins; + }; + +#endif // CXNECOMHANDLER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xneditmode.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xneditmode.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,256 @@ +/* +* 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: Edit mode for widget drag and drop. +* +*/ + +#ifndef XNEDITMODE_H +#define XNEDITMODE_H + +// System includes +#include + +// Forward declarations +class CXnUiEngine; +class CXnViewManager; +class CXnNode; +class CFbsBitGc; +class CFbsBitmap; +class CFbsBitmapDevice; +class CWindowToBitmapMappingGc; + +// Class declaration + +/** + * Edit mode. Enables widget drag and drop. + * + * @ingroup group_xnlayoutengine + * @lib xnlayoutengine.lib + * @since Series 60 5.1 + */ +NONSHARABLE_CLASS( CXnEditMode ) : public CCoeControl + { +public: + // Data types + enum TEditState + { + ENone = 0x00, + EWaitDrag = 0x01, + EShootContent = 0x02, + EDragging = 0x04, + EDragAndDrop = 0x08, + EKeyMove = 0x10 + }; + +public: + /** + * Two-phased constructor. + */ + static CXnEditMode* NewL( CXnUiEngine& aUiEngine ); + + /** + * Destructor. + */ + ~CXnEditMode(); + +private: + // from CCoeControl + + /** + * @see CCoeControl + */ + void Draw( const TRect& aRect ) const; + + /** + * @see CCoeControl + */ + void MakeVisible( TBool aVisible ); + + /** + * @see CCoeControl + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + /** + * @see CCoeControl + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * @see CCoeControl + */ + void SizeChanged(); + +public: + // New functions + + /** + * Changes the state of edit mode. + * + * @since Series 60 5.0 + * @param aSet The state of edit mode. + */ + void SetEditModeL( CXnEditMode::TEditState aSet ); + + /** + * Gets the status of the edit mode. + * + * @since Series 60 5.0 + * @return Edit mode state. + */ + CXnEditMode::TEditState EditState() const; + + /** + * This is for to re-initializing the double buffer when the orientations + * is changed + * + * @since Series 60 5.0 + */ + void HandleScreenDeviceChangedL(); + +private: + // new functions + + /** + * Organizing starts using drag and drop. + * + * @since Series 60 5.0 + * @param aNode Node to drag. + */ + void StartDragL( CXnNode& aNode ); + + /** + * Reset the dragging state and deletes screenshot bitmaps. + * + * @since Series 60 5.0 + */ + void StopDragL(); + + /** + * Updates invalid parts of the screen. Calls internally DrawNow + * + * @since Series 60 5.0 + */ + void UpdateScreen(); + + /** + * Sets the title for status pane + * + * @since Series 60 5.0 + */ + void SetStatusPaneTitleL(); + +private: + // Constructors + + /** + * C++ default constructor. + */ + CXnEditMode( CXnUiEngine& aEngine ); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + +private: + // Data + + /** + * UI engine + * Not own. + */ + CXnUiEngine& iUiEngine; + + /** + * View manager + * Not own. + */ + CXnViewManager& iViewManager; + + /** + * Screenshot of part of mainpane + * Owned + */ + CFbsBitmap* iMainpane; + + /** + * Screenshot of widget + * Owned + */ + CFbsBitmap* iWidget; + + /** + * Mapping Gc + * Owned + */ + CWindowToBitmapMappingGc* iMapGc; + + /** + * Bmp device + * Owned + */ + CFbsBitmapDevice* iBmpDevice; + + /** + * Bmp Gc + * Owned + */ + CFbsBitGc* iBmpGc; + + /** + * A pointer to the node that is being dragged. + * Not own. + */ + CXnNode* iDraggingNode; + + /** + * A pointer to the node that is underneath of the dragging node. + * Not own. + */ + CXnNode* iTargetNode; + + /** + * State of edit mode + */ + CXnEditMode::TEditState iState; + + /** + * A point where dragging started from. + */ + TPoint iStylusDownPos; + + /** + * A point where drawing was done last time. + */ + TPoint iPreviousPos; + + /** + * Screenshot draw position + */ + TPoint iDrawPos; + + /** + * Last redraw rect + */ + TRect iLastDrawRect; + + /** + * Flag determine whether drag is occured + */ + TBool iDragged; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnlistquerydialogadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnlistquerydialogadapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,227 @@ +/* +* 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: List query dialog adapter and data interface +* +*/ + +#ifndef __XNLISTQUERYDIALOGADAPTER_H__ +#define __XNLISTQUERYDIALOGADAPTER_H__ + +// INCLUDES +#include "xncontroladapter.h" +#include + +#include "xncomponent.h" +#include "xnnode.h" +#include "mxncomponentinterface.h" + +// FORWARD DECLARATIONS +class CXnNodePluginIf; +class CXnUiEngine; + +// CLASS DECLARATION + +namespace XnListQueryDialogInterface +{ +_LIT8(KType, "listquerydialog"); +class MXnListQueryDialogInterface : public XnComponentInterface::MXnComponentInterface + { + +public: + + static inline const TDesC8& Type() + { + return KType; + } + +public: // New functions + + /** + * Replaces or appends new item into list + * @param aText The new text line + * @param aIndex index + */ + virtual void ReplaceItemL(const TDesC& aText, TInt aIndex ) = 0; + + /** + * Inserts or appends new item into list + * @param aText The new text line + * @param aIndex index + */ + virtual void InsertItemL(const TDesC& aText, TInt aIndex ) = 0; + + /** + * Deletes the item from the given index + * @param aIndex list index + */ + virtual void DeleteItem( TInt aIndex ) = 0; + }; + } + +/** + * List query dialog data interface + * @ingroup group_xnlayoutengine + * @lib xnlayoutengine.lib + * @since 9.2 + */ +class CXnListQueryDialog : public CXnComponent, public XnListQueryDialogInterface::MXnListQueryDialogInterface + { + +public: + + + /** + * 2 phase construction. + */ + static CXnListQueryDialog* NewL(); + + + /** + * Destructor. + */ + virtual ~CXnListQueryDialog(); + +public: // From MXnListQueryDialogInterface + + /** + * Replaces or appends new item into list + * @param aText The new text line + * @param aIndex index + */ + void ReplaceItemL(const TDesC& aText, TInt aIndex ); + + /** + * Inserts or appends new item into list + * @param aText The new text line + * @param aIndex index + */ + void InsertItemL(const TDesC& aText, TInt aIndex ); + + /** + * Deletes the item from the given index + * @param aIndex list index + */ + void DeleteItem( TInt aIndex ); + + +public: // from MXnComponentInterface + + /** + * Create a component interface according to the given type. + * @param aType Type of the interface to create + * @return Created interface or NULL if the provided type is not supported. + */ + XnComponentInterface::MXnComponentInterface* MakeInterfaceL(const TDesC8& aType); + +private: + + CXnListQueryDialog(); + void ConstructL(); + + }; + +// CLASS DECLARATION + +/** +* @ingroup group_xnlayoutengine +* List query dialog adapter interface class +* @lib xnlayoutengine.lib +* @since Series 60 5.0 +*/ +NONSHARABLE_CLASS( CXnListQueryDialogAdapter ) : public CXnControlAdapter + { + public: // Constructors and destructor + /** + * Two-phased constructor. + */ + static CXnListQueryDialogAdapter* NewL( CXnNodePluginIf& aNode ); + + /** + * Destructor. + */ + ~CXnListQueryDialogAdapter(); + + /** + * Replaces or appends new item into list + * @param aText The new text line + * @param aIndex index + */ + void ReplaceItemL(const TDesC& aText, TInt aIndex ); + + /** + * Inserts or appends new item into list + * @param aText The new text line + * @param aIndex index + */ + void InsertItemL(const TDesC& aText, TInt aIndex ); + + /** + * Deletes the item from the given index + * @param aIndex list index + */ + void DeleteItem( TInt aIndex ); + + /** + * Displays the dialog + */ + void TryDisplayingDialogL(); + + private: // Constructors + /** + * C++ default constructor. + */ + CXnListQueryDialogAdapter( CXnNodePluginIf& aNode ); + + /** + * Two-phased constructor. + */ + void ConstructL(); + + private: // New functions + /** + * Sets the selected item active, which runs associated event. + */ + void ActivateItemL( TInt aIndex ); + + /** + * Inserts the index into event. + */ + void ModifyDynamicEventL( TInt aIndex ); + + private: // Data + // Node + CXnNodePluginIf& iNode; + /** + * List items + * own + */ + CDesCArrayFlat* iItemArray; + + /** + * Array of static item nodes + * Not own + */ + RPointerArray< CXnNodePluginIf > iStaticItems; + + /** + * Dynamic item node + * Not own + */ + CXnNodePluginIf* iDynamicItem; + + }; + +#endif // __XNLISTQUERYDIALOGADAPTER_H__ + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnmap.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,176 @@ +/* +* 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: Associative container. +* +*/ + + + +#ifndef CXNMAP_H +#define CXNMAP_H + +// INCLUDES +#include + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +class MXnComparator; +// CLASS DECLARATION + +/** +* @ingroup group_xnutils +* +* Associative container, works like a map or a hashtable +* @since Series 60 3.1 +*/ +class CXnMap : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aComparatorFunctor A comparator used for testing object equality. Must not be NULL. Map assumes ownership of the comparator. + */ + IMPORT_C static CXnMap* NewL(MXnComparator* aComparatorFunctor); + + /** + * Destructor. + */ + virtual ~CXnMap(); + + public: // New functions + + /** + * Puts an object to the map. The map will assume ownership of the object. If an equal object is already in the map, it will be replaced with the new object and the old object will be destroyed. + * @since Series 60 3.1 + * @param aObject Object to add. + * @exception KXnErrAppendingMapItemFailed_1 Appending new map item failed. + * @exception KXnErrAppendingMapItemFailed_2 Appending new map item failed. + */ + IMPORT_C void PutL(CBase* aObject); + + /** + * Gets an object from the map. The map will retain ownership of the object, the caller must not destroy the object. The returned pointer will become invalid if the object is replaced in the map by a subsequent PutL(). + * @since Series 60 3.1 + * @param aObject Object key + * @return The object mapped to the key or NULL if not found. + */ + IMPORT_C CBase* Get(CBase& aObject) const; + + /** + * Gets access to the underlying container + * @since Series 60 3.1 + * @return The undelying container + */ + IMPORT_C RPointerArray& Container(); + + /** + * Find an object from the map. The map will retain ownership of the object, the caller must not destroy the object. The returned pointer will become invalid if the object is replaced in the map by a subsequent PutL(). + * @since Series 60 3.1 + * @param aObject Object key + * @param aComparator Comparator used for finding the object + * @return The object mapped to the key matching the comparator or NULL if not found. + */ + IMPORT_C CBase* Find(CBase& aObject, MXnComparator& aComparator) const; + + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // New functions + + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CXnMap(); + + /** + * 2nd phase constructor. + * @param aComparatorFunctor A comparator used for testing object equality + */ + void ConstructL(MXnComparator* aComparatorFunctor); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + // ?one_line_short_description_of_data + //?data_declaration; + // Reserved pointer for future extension + //TAny* iReserved; + // Internal container + RPointerArray iContainer; + // Comparator functor; + MXnComparator* iComparator; + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + + }; + +#endif // CXnMAP_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnmenu.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnmenu.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,265 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Xuikon Menu Plugin +* +*/ + + + +#ifndef _XNMENU_H +#define _XNMENU_H + +// INCLUDES +#include "xncomponent.h" +#include "mxncomponentinterface.h" + +#if 0 // MSK icon change +class TAknsItemID; +#endif // MSK icon change + +namespace XnMenuInterface +{ +_LIT8(KType, "menu"); + +class MXnMenuObserver + { +public: + /** + * Called when options menu is about to open. Observer can add + * its own menu item to the aMenuItems array. + * @param aMenuItem menu item + * @param aPlugin plugin node + * @return ETrue if the item should be shown, EFalse otherwise + */ + virtual TBool DynInitMenuItemL( CXnNodeAppIf& aMenuItem, CXnNodeAppIf* aPlugin = NULL ) = 0; + }; + +/** +* @ingroup group_xnmenufactory +* @lib xn3menufactory.dll +* @since S60 3.1 +*/ +class MXnMenuInterface : public XnComponentInterface::MXnComponentInterface + { +public: + /** + * Soft key position enum + * These are same as in CEikButtonGroupContainer::TCommandPosition + */ + enum TSoftKeyPosition + { + ELeft = 0, + ERight = 2, + ECenter = 3 /* Not supported when setting icon */ + }; + +public: + + static inline const TDesC8& Type() + { + return KType; + } + +public: // New functions + + /** + * Sets softkey image. If there was no leave, menu takes + * bitmap and mask ownership. + * @since Series 60 3.2 + * @param aBitmap Bitmap to draw + * @param aMask Mask to use + * @param aPos Softkey position + * @param aPreserveAspectRatio ETrue if image's aspect ratio is preserved + * @param aInvertMask ETrue if white mask is used, EFalse if black mask is used + * @param aTransferOwnership ETrue if bitmap and mask ownerhsip is transferred to menuadapter + */ + virtual void SetSoftKeyImageL( + CFbsBitmap* aBitmap, + CFbsBitmap* aMask, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos, + TBool aPreserveAspectRatio = EFalse, TBool aInvertMask = EFalse, + TBool aTransferOwnership = ETrue ) = 0; + + virtual void SetSoftKeyImageL( + CFbsBitmap* aBitmap, + CFbsBitmap* aMask, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos, + CXnNodeAppIf* aNode, + TBool aPreserveAspectRatio = EFalse, TBool aInvertMask = EFalse, + TBool aTransferOwnership = ETrue ) = 0; + +#if 0 // MSK icon change + /** + * Sets soft key image. + * @param aId icon bitmap IID + * @param aBmpFile file path. + * @param aBmp Bitmap ID. + * @param aBmpM Bitmap mask ID. + * @param aPos Softkey position. + * @param aEnable ETrue for set icon, EFalse for use default icon. + */ + virtual void SetSoftKeyImageL( const TAknsItemID& aId, + const TDesC& aBmpFile, + const TInt32 aBmp, + const TInt32 aBmpM, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos, + TBool aEnable ) = 0; + +#endif // MSK icon change + + /** + * Sets softkey text. + * @since Series 60 3.2 + * @param aText Text to draw + * @param aPos Softkey position + */ + virtual void SetSoftKeyTextL( const TDesC& aText, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ) = 0; + + /** + * Sets softkey. + * @param aNode Softey node. + * @param aPos Softkey position. + */ + virtual void SetSoftKeyL( CXnNodePluginIf* aSoftkeyNode, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ) = 0; + + /** + * Returns currently visible softkey node. + * @param aPos Softkey position. + * @return Currently visible softkey. + */ + virtual CXnNodePluginIf* SoftKeyL( XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ) = 0; + + /** + * Sets MXnMenuObserver observer + * @since S60 5.1 + * @param aObserver observer to set + */ + virtual void SetObserver( XnMenuInterface::MXnMenuObserver& aObserver ) = 0; + + /** + * Removes the observer + * @since S60 5.1 + */ + virtual void RemoveObserver() = 0; + + /** + * Tries to display menubar + * @since S60 5.1 + * @param aMenuNodeId the menu node id + */ + virtual void TryDisplayingMenuBarL( const TDesC& aMenuNodeId ) = 0; + }; +} + +class CXnMenu : public CXnComponent, public XnMenuInterface::MXnMenuInterface + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnMenu* NewL(); + + /** + * Destructor. + */ + virtual ~CXnMenu(); + + protected: // New functions + + /** + * @see MXnMenuInterface::SetSoftKeyImage + */ + void SetSoftKeyImageL( + CFbsBitmap* aBitmap, + CFbsBitmap* aMask, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos, + TBool aPreserveAspectRatio, TBool aInvertMask, + TBool aTransferOwnership = ETrue ); + + void SetSoftKeyImageL( + CFbsBitmap* aBitmap, + CFbsBitmap* aMask, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos, + CXnNodeAppIf* aNode, + TBool aPreserveAspectRatio, TBool aInvertMask, + TBool aTransferOwnership = ETrue ); + +#if 0 // MSK icon change + /** + * @see MXnMenuInterface::SetSoftKeyImage + */ + void SetSoftKeyImageL( const TAknsItemID& aId, + const TDesC& aBmpFile, + const TInt32 aBmp, + const TInt32 aBmpM, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos, + TBool aEnable ); +#endif // MSK icon change + + /** + * @see MXnMenuInterface::SetSoftkeyTextL + */ + void SetSoftKeyTextL( const TDesC& aText, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ); + + /** + * @see MXnMenuInterface::SetSoftKeyL + */ + void SetSoftKeyL( CXnNodePluginIf* aSoftkeyNode, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ); + + /** + * @see MXnMenuInterface::SoftKeyL + */ + CXnNodePluginIf* SoftKeyL( XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ); + + /** + * @see MXnMenuInterface::SetObserver + */ + void SetObserver( XnMenuInterface::MXnMenuObserver& aObserver ); + + /** + * @see MXnMenuInterface::RemoveObserver + */ + void RemoveObserver(); + + /** + * @see MXnMenuInterface::TryDisplayingMenuBarL + */ + void TryDisplayingMenuBarL( const TDesC& aMenuNodeId ); + + + /** + * @see MXnComponentInterface::MakeInterfaceL + */ + XnComponentInterface::MXnComponentInterface* MakeInterfaceL( const TDesC8& aType ); + private: + + /** + * C++ default constructor. + */ + CXnMenu(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + }; + +#endif // _XNMENU_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnmenuadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnmenuadapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,398 @@ +/* +* 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: +* +*/ + + + +#ifndef _XNMENUADAPTER_H +#define _XNMENUADAPTER_H + +// INCLUDES +#include "xncontroladapter.h" +#include +#include +#include "xnmenu.h" + +// FORWARD DECLARATIONS +class TXnUiEnginePluginIf; +class CXnNodePluginIf; + +// CONSTANTS + +_LIT8(KXnMenuBar, "menubar"); +_LIT8(KXnMenuItem, "menuitem"); +_LIT8(KXnDynMenuItem, "dynmenuitem"); +_LIT8(KXnWidgetMenuItem, "widgetmenuitem"); +_LIT8(KXnWidgetSoftkey, "widgetsoftkey"); +_LIT8(KXnMenu, "menu"); +_LIT8(KXnLabel, "label"); +_LIT8(KXnImage, "image"); +_LIT8(KXnImagePath, "path"); +_LIT8(KXnMenuExtension, "menuextension"); +_LIT8(KXnMenuItemSettings, "hs_widget_menuitem_settings"); +_LIT8(KXnSource, "source"); +_LIT8(KXnTarget, "target"); + +// CLASS DECLARATION +class TXnMenuItem + { + public : + CXnNodePluginIf* iNode; + TBool iAutomaticSP; + TInt iParentIndex; + CEikMenuPaneItem::SData iData; + TBool iIsCascade; + }; + +// CLASS DECLARATION + +class CXnSoftkeyItem; +/** +* @ingroup group_xnmenufactory +* @lib xn3menufactory.dll +* @since S60 3.1 +*/ +class CXnMenuAdapter : public CXnControlAdapter, public MEikMenuObserver + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnMenuAdapter* NewL( CXnControlAdapter* aParent, CXnNodePluginIf& aNode ); + + /** + * Destructor. + */ + virtual ~CXnMenuAdapter(); + + public: // new functions + virtual void SetContainerL(CEikButtonGroupContainer& aContainer); + virtual TBool IsMenuFocused(); + + /** + * Closes the menu, if it is open. + * @since Series 60 3.2 + */ + virtual void StopDisplayingMenu(); + + /** + * Sets soft key image. If there was no leave, menu takes + * bitmap and mask ownership. + * @since Series 60 3.2 + * @param aBitmap Bitmap to draw + * @param aMask Mask to use + * @param aPos Softkey position + * @param aPreserveAspectRatio ETrue if image's aspect ratio is preserved + * @param aInvertMask ETrue if white mask is used, EFalse if black mask is used + * @param aTransferOwnership ETrue if bitmap and mask ownerhsip is transferred to menuadapter + */ + void SetSoftKeyImageL( + CFbsBitmap* aBitmap, + CFbsBitmap* aMask, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos, + CXnNodeAppIf* aNode, + TBool aPreserveAspectRatio, TBool aInvertMask,TBool aTransferOwnership); + +#if 0 // MSK icon change + /** + * Sets soft key image. + * @param aId icon bitmap IID + * @param aBmpFile file path. + * @param aBmp Bitmap ID. + * @param aBmpM Bitmap mask ID. + * @param aPos Softkey position. + * @param aEnable ETrue for set icon, EFalse for use default icon. + */ + void SetSoftKeyImageL( const TAknsItemID& aId, + const TDesC& aBmpFile, + const TInt32 aBmp, + const TInt32 aBmpM, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos, + TBool aEnable ); +#endif // MSK icon change + + /** + * Sets softkey text. + * @since Series 60 3.2 + * @param aText Text to draw + * @param aPos Softkey position + */ + void SetSoftKeyTextL( const TDesC& aText, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ); + + /** + * Sets softkey. + * @param aNode Softey node. + * @param aPos Softkey position. + */ + void SetSoftKeyL( CXnNodePluginIf* aSoftkeyNode, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ); + + /** + * Gets currently visible softkey. + * @param aPos Softkey position. + * @return Softey node. + */ + CXnNodePluginIf* SoftKeyL( XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ); + + /** + * Finds softkey node by given position + * @since Series 60 5.0 + */ + virtual TBool FindSoftKeyNodeByPosition( const TPoint& aPosition, CXnNodePluginIf*& aNode ); + + /** + * Tries to display menubar + * @since Series 60 5.1 + * @param aMenuNodeId the menu node id + */ + void TryDisplayingMenuL( const TDesC& aMenuNodeId ); + + public: // from CCoeControl + + /** + * See CCoeControl documentation + */ + TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); + + /** + * See CCoeControl documentation + */ + virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); + + /** + * See CCoeControl documentation + */ + virtual void HandleResourceChange(TInt aType); + + /** + * From CCoeAppUiBase. Informs the components about the screen layout switch. + */ + virtual void HandleScreenDeviceChangedL(); + + public: // from MEikMenuObserver + + + /** + * Will panic if we don't override it, because we don't have any resource for it. + * Default implementation will read resources + */ + virtual void RestoreMenuL(CCoeControl* aMenuControl,TInt aResourceId,TMenuType aType); + + /** + * Initialize menu pane dynamically + */ + virtual void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); + + /** + * See CCoeControl documentation + */ + virtual void SetEmphasis(CCoeControl* aMenuControl,TBool aEmphasis); + + /** + * See CCoeControl documentation + */ + virtual void ProcessCommandL(TInt aCommandId); + + /** + * This is done when application goes to background. + */ + void DoEnterPowerSaveModeL(TModeEvent aEvent); + + /** + * This is done when application goes to foreground. + */ + void DoExitPowerSaveModeL(TModeEvent aEvent); + + /* + * Handles menu property change + */ + virtual void HandleMenuPropertyChangeL(CXnNodePluginIf* aNode, CXnProperty* aProperty); + + /* + * Sets a dynamic menuitem initialisation observer + */ + void SetObserver( XnMenuInterface::MXnMenuObserver& aObserver ); + + /* + * Removes the dynamic menuitem initialisation observer + */ + void RemoveObserver(); + + private: + + /** + * C++ default constructor. + */ + CXnMenuAdapter(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( CXnControlAdapter* aParent, CXnNodePluginIf& aNode ); + + /** + * Populate menu from nodes + */ + void PopulateMenuL(); + + /** + * Create menu items. Recursive function + */ + TInt AddMenuItemL( TInt aParentIndex, CXnNodePluginIf* aNode, + RPointerArray< const TDesC8 >& aGroups ); + + /** + * Finds softkey item by position + */ + CXnNodePluginIf* FindSoftkeyItemByPosition( const TPoint& aPosition ); + + /** + * Prepare image for softkey + */ + CEikImage* PrepareSoftkeyImageL( const CXnSoftkeyItem& aItem, const TSize& aSize ); + + /** + * Sets appearance to softkey, either text or image + */ + void SetSoftkeyAppearanceL( CXnSoftkeyItem& aItem ); + + /** + * Initializes softkey items array + */ + void InitSoftkeyItemsL(); + + /** + * Initializes single softkey item image + */ + void InitSoftkeyItemImageL( CXnSoftkeyItem& aItem ); + + /** + * Check wheter msk is available in this layout + */ + TBool IsMskAvailable(); + + /* + * Resolves the softkey node which is in this pointer event location + */ + CXnNodePluginIf* ResolvePointerEventReceiver( const TPoint aPosition ); + + /** + * Tries to display menubar + */ + void TryDisplayingMenuL(); + + /** + * Get cba button rect from laf + */ + TRect ButtonTouchableRectByPosition( TInt aPosition ); + /** + * Finds softkey from node tree + */ + CXnNodePluginIf* FindSoftkeyNodeL(const TDesC8& aNodeType); + /** + * Creates menu bar + */ + void CreateMenuBarL(); + /** + * Updates softkeys if their "need update" state is on + */ + void UpdateSoftkeyAppearancesL(); + /** + * Creates image with right size and set it to left or right softkey + */ + void ChangeSoftkeyImageL(const CXnSoftkeyItem& aSoftkey); + /** + * Inserts menu items to menu pane + */ + void AddItemsToMenuPaneL(CEikMenuPane* aMenuPane, TInt aResourceId); + + /** + * Creates and initialized softkey item (TXnSoftkeyItem holds data for softkey) + * if not created yet and appends it to the array + */ + CXnSoftkeyItem* AppendSoftkeyItemL(CXnNodePluginIf* aNode); + + /** + * Dig type attribute from softkey node. + * Return KNullDesC if not found + */ + const TDesC8& SoftkeyPlaceL(CXnNodePluginIf& aNode); + + /** + * Finds softkey item by position. + */ + CXnNodePluginIf* DoFindSoftkeyItemByPositionL( const TPoint& aPosition ); + + /** + * Get visible softkey item based on position. + */ + CXnSoftkeyItem* SoftkeyItemL(TInt aPosition); + + /** + * Get softkey item based on given node + */ + CXnSoftkeyItem* SoftkeyItemL(CXnNodePluginIf* aNode); + + /** + * Get softkey item based on given node + */ + CXnSoftkeyItem* SoftkeyItemL(CXnNodeAppIf* aNode); + + /** + * Set member flag true based on item. + */ + void SetUpdateAppearanceL(CXnSoftkeyItem* aItem); + + /** + * Finds menu item from focused widget. + */ + CXnNodePluginIf* FindWidgetMenuItemL( CXnNodePluginIf* aNode ); + + /** + * Finds a node from view which 'source' arrtibure matches with the 'target' attribute + * of given node and returns its label. + */ + HBufC* FindSoftkeyLabelL( CXnNodePluginIf* aNode ); + + private: // Data + TXnUiEnginePluginIf* iUiEngine; + CXnNodePluginIf* iRootNode; + CXnNodePluginIf* iMenuBarNode; + CXnNodePluginIf* iPointerEventNode; + CXnNodePluginIf* iKeyEventNode; + CArrayFixFlat< TXnMenuItem > iMenuItems; + TInt iIdCounter; + CEikButtonGroupContainer* iContainer; + CEikMenuBar* iMenuBar; + XnMenuInterface::MXnMenuObserver* iObserver; + TBool iMenuShown; + RPointerArray iSoftkeyItems; + TInt iPreviousMenuPaneId; + TBool iUpdateLskAppearance; + TBool iUpdateMskAppearance; + TBool iUpdateRskAppearance; + CXnSoftkeyItem* iVisibleLSK; + CXnSoftkeyItem* iVisibleRSK; + CXnSoftkeyItem* iVisibleMSK; + }; + + + +#endif // _XNMENUADAPTER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnnewsticker.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnnewsticker.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,243 @@ +/* +* 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: Interface class for CXnNewsticker. +* +*/ + + +#ifndef _XNNEWSTICKER_H +#define _XNNEWSTICKER_H + +// INCLUDES +#include "xncomponent.h" +#include "mxncomponentinterface.h" + +class CGulIcon; + +// CLASS DECLARATION +/** +* Component UI factory interface for creating newsticker text element. +* +* @lib xnnewstickerfactory.dll +* @since Series 60 3.2 +*/ +namespace XnNewstickerInterface +{ +_LIT8(KType, "newsticker"); + +class MXnNewstickerCallbackInterface + { + public: // New functions + + /** + * Called when the title has been shown and is now offscreen. + * @param aTitleIndex The title that has been completely shown. + */ + virtual void TitleScrolled(TInt aTitleIndex) = 0; + + }; + +class MXnNewstickerInterface : public XnComponentInterface::MXnComponentInterface + { + public: // New functions + + static inline const TDesC8& Type() + { + return KType; + } + + /** + * Append new title to the end of the title list. + * @param aTitle The new title to add. + */ + virtual void AppendTitleL(const TDesC& aTitle) = 0; + + /** + * Insert new title to the end of the title list. + * @param aTitle The new title to add. + * @param aIndex The place to add the title. + */ + virtual void InsertTitleL(const TDesC& aTitle, TInt aIndex) = 0; + + /** + * Update title text. + * @param aTitle The new title to add. + * @param aIndex The place to update the title. + */ + virtual void UpdateTitleL(const TDesC& aTitle, TInt aIndex) = 0; + + /** + * Delete the title. + * @param aIndex The title index to delete. + */ + virtual void DeleteTitle(TInt aIndex) = 0; + + /** + * Returns index of the currently selected title. + * @return The index of the current title. + */ + virtual TInt CurrentTitleIndex() = 0; + + /** + * Return the title of the given index. + * @param aIndex The index to return the title. + * @return The title of the given index. + */ + virtual const TDesC& Title(TInt aIndex) = 0; + + /** + * Set the separator image for all titles. + * @param aIcon The separator image. This must be mif icon. + * @return KErrNone if successful, KErrArgument if the icon is not mif. + */ + virtual TInt SetSeparatorImageL(CGulIcon* aIcon) = 0; + + /** + * Delete all titles. + */ + virtual void ClearTitles() = 0; + + /** + * Append the SVG title to be shown. + * @param aByteData The SVG data. + */ + virtual void AppendSvgTitleL(const TDesC8& aByteData) = 0; + + /** + * Insert the SVG title to be shown. + * @param aByteData The SVG data. + */ + virtual void InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex) = 0; + + /** + * Set callback interface. + * @param aCallback The callback interface pointer. + */ + virtual void SetCallbackInterfaceL(MXnNewstickerCallbackInterface* aCallback) = 0; + }; +} + +/** +* @ingroup group_xnnewstickerfactory +* +* Newsticker class implementation. +* +* @lib xnnewstickerfactory.dll +* @since Series 60 3.2 +*/ +class CXnNewsticker : public CXnComponent, public XnNewstickerInterface::MXnNewstickerInterface + { + public: + /** + * 2 phase construction. + */ + static CXnNewsticker* NewL(); + + /** + * Destructor. + */ + virtual ~CXnNewsticker(); + + public: + // Routed from MXnNewstickerInterface. + + /** + * Append new title to the end of the title list. + * @param aTitle The new title to add. + */ + void AppendTitleL(const TDesC& aTitle); + + /** + * Insert new title to the end of the title list. + * @param aTitle The new title to add. + * @param aIndex The place to add the title. + */ + void InsertTitleL(const TDesC& aTitle, TInt aIndex); + + /** + * Update title text. + * @param aTitle The new title to add. + * @param aIndex The place to update the title. + */ + void UpdateTitleL(const TDesC& aTitle, TInt aIndex); + + /** + * Delete the title. + * @param aIndex The title index to delete. + */ + void DeleteTitle(TInt aIndex); + + /** + * Returns index of the currently selected title. + * @return The index of the current title. + */ + TInt CurrentTitleIndex(); + + /** + * Return the title of the given index. + * @param aIndex The index to return the title. + * @return The title of the given index. + */ + const TDesC& Title(TInt aIndex); + + /** + * Set the separator image for all titles. + * @param aIcon The separator image. This must be mif icon. + * @return KErrNone if successful, KErrArgument if the icon is not mif. + */ + TInt SetSeparatorImageL(CGulIcon* aIcon); + + /** + * Delete all titles. + */ + void ClearTitles(); + + /** + * Append the SVG title to be shown. + * @param aByteData The SVG data. + */ + void AppendSvgTitleL(const TDesC8& aByteData); + + /** + * Insert the SVG title to be shown. + * @param aByteData The SVG data. + */ + void InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex); + + /** + * Set callback interface. + * @param aCallback The callback interface pointer. + */ + void SetCallbackInterfaceL( + XnNewstickerInterface::MXnNewstickerCallbackInterface* aCallback); + + /** + * Create a component interface according to the given type. + * @param aType Type of the interface to create + * @return Created interface or NULL if the provided type is not supported. + */ + virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL( + const TDesC8& aType); + + private: + + CXnNewsticker(); + + void ConstructL(); + }; + + +#endif // _XNNEWSTICKER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnnode.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnnode.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1193 @@ +/* +* 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: +* Node of layout tree +* +*/ + +#ifndef XNNODE_H +#define XNNODE_H + +// System includes +#include +#include + +// User includes + +// Forward declarations +class CXnType; +class CXnProperty; +class CXnNodeImpl; +class CXnViewsNodeImpl; +class CXnViewNodeImpl; +class CXnComponentNodeImpl; +class CXnUiEngine; +class CXnNodePluginIf; +class CXnNodeAppIf; +class CXnDomNode; +class CXnControlAdapter; +class CXnScrollableControlAdapter; +namespace XnComponentInterface + { + class MXnComponentInterface; + } + +// Constants +namespace XnDirtyLevel + { + /** Not dirty */ + const TInt ENone = 0; + /** Draw node's appearance */ + const TInt ERender = 1; + /** Layout and draw node's appearance */ + const TInt ELayoutAndRender = 2; + /** Layout and draw node's and its siblings appearance */ + const TInt ELayoutAndRenderSiblings = 3; + } + +namespace XnNodeLayout + { + const TInt ENone = 0; + const TInt EDropped = 1; + const TInt ENotLayouted = 2; + const TInt EDroppedAndNotLayouted = 3; + } + +namespace XnAdaptive + { + const TInt ENone = 0x00; + const TInt EWidth = 0x01; + const TInt EHeight = 0x02; + const TInt EMeasure = 0x04; + const TInt ESizeFixed = 0x08; + const TInt EIgnoreDirty = 0x10; + } + +namespace XnEventSource + { + const TInt EUnknown = 0x00; + const TInt EStylus = 0x01; + const TInt EKey = 0x02; + } + +namespace XnHoldProperty + { + const TInt ENoHold = 0x00; + const TInt EHold = 0x01; + } + +// Class declaration +/** + * Node of the layout tree + * + * @ingroup group_xnlayoutengine + * @lib xnlayoutengine.lib + * @since Series 60 3.1 + */ +NONSHARABLE_CLASS( CXnNode ) : public CBase + { +public: + /** + * Two-phased constructor. + */ + static CXnNode* NewL(); + + /** + * Destructor. + */ + virtual ~CXnNode(); + +public: + // New functions + + /** + * Get the node implementation + * + * @since Series 60 3.1 + * @return Node implementation + */ + CXnNodeImpl* Impl(); + + /** + * Get the root node implementation + * + * @since Series 60 3.1 + * @return Root node implementation + */ + CXnNodeImpl* RootNodeImpl(); + + /** + * Get the view node implementation + * + * @since Series 60 3.1 + * @return View node implementation + */ + CXnViewNodeImpl* ViewNodeImpl(); + + /** + * Get the component node implementation + * + * @since Series 60 3.1 + * @return Component node implementation + */ + CXnComponentNodeImpl* ComponentNodeImpl(); + + /** + * Set UI engine + * + * @since Series 60 3.1 + * @param aEngine UI engine + */ + void SetUiEngine( CXnUiEngine& aEngine ); + + /** + * Get the UI engine + * + * @since Series 60 3.1 + * @return UI engine + */ + CXnUiEngine* UiEngine(); + + /** + * Set the node implementation + * + * @since Series 60 3.1 + * @param aImpl Node implementation + */ + void SetImpl( CXnNodeImpl* aImpl ); + + /** + * Set the Root node implementation + * + * @since Series 60 3.1 + * @param aRootNodeImpl Root node implementation + */ + void SetRootNodeImpl( CXnNodeImpl* aRootNodeImpl ); + + /** + * Set the views implementation + * + * @since Series 60 3.1 + * @param aViewsNodeImpl Views node implementation + */ + void SetViewsNodeImpl( CXnViewsNodeImpl* aViewsNodeImpl ); + + /** + * Set the view node implementation + * + * @since Series 60 3.1 + * @param aViewNodeImpl View node implementation + */ + void SetViewNodeImpl( CXnViewNodeImpl* aViewNodeImpl ); + + /** + * Handle interaction events + * + * @since Series 60 3.1 + * @param aEventData Event data + * @param aSource A source of event, e.g. XnEventSource::EStylus. + * @return Flag indicating whether the event was consumed + */ + TBool ReportXuikonEventL( CXnNode& aEventData, TInt aSource = 0 ); + + /** + * Handle key event + * + * @since Series 60 3.1 + * @param aKeyEvent Key event data + * @param aType Event type + */ + void OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + + /** + * Set the component node implementation + * + * @since Series 60 3.1 + * @param aComponentNodeImpl Component node implementation + */ + void SetComponentNodeImpl( CXnComponentNodeImpl* aComponentNodeImpl ); + + /** + * Set node's layout capability + * + * @since Series 60 3.1 + * @param aLayoutCapable Layout capability + */ + void SetLayoutCapable( const TBool aLayoutCapable ); + + /** + * Get node's layout capability + * + * @since Series 60 3.1 + * @return Layout capability + */ + TBool IsLayoutCapable() const; + + /** + * Set the node's characted data + * + * @since Series 60 3.1 + * @param aData Character data + */ + void SetPCDataL( const TDesC8& aData ); + + /** + * Get the node's characted data + * + * @since Series 60 3.1 + * @return Character data + */ + const TDesC8& GetPCData() const; + + /** + * Set a property. + * + * The list will assume ownership of the property. + * If an equal property is already in the list, it will be + * replaced with the new property and the old property will be destroyed. + * @since Series 60 3.1 + * @param aProperty Property to set. + */ + void SetPropertyL( CXnProperty* aProperty ); + + /** + * Set a property without notification being sent. + * + * @see SetPropertyL + * @param aProperty Property to set. + */ + void SetPropertyWithoutNotificationL( CXnProperty* aProperty ); + + /** + * Set a property NOT replacing an equal property if already in the list. + * + * @see SetPropertyL + * @param aProperty Property to set. + */ + void InitializePropertyL( CXnProperty* aProperty ); + + /** + * Set an array of properties. + * + * Improves the performance when many properties need to be + * set e.g. in construction phase. + * The list will assume ownership of the property. + * If an equal property is already in the list, it will be + * replaced with the new property and the old property will be destroyed. + * @see SetPropertyL + */ + void SetPropertyArrayL( RPointerArray< CXnProperty >* aPropertyArray ); + + /** + * Gets a property. + * + * The list will retain ownership of the property, + * the caller must not destroy the property. The returned pointer will + * become invalid if the property is replaced in the list by a subsequent + * SetL(). + * @since Series 60 3.1 + * @param aKey Name of the property + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* GetPropertyL( const TDesC8& aKey ) const; + + /** + * Set a state + * + * @since Series 60 3.1 + * @param aState State to set. + * @param aSource A source of the event. + */ + void SetStateL( + const TDesC8& aState, + TInt aSource = XnEventSource::EUnknown ); + + /** + * Check whether a state is set + * + * @since Series 60 3.1 + * @return ETrue if set, EFalse if not + */ + TBool IsStateSet( const TDesC8& aState ); + + /** + * Set a state without performing notifications and re-rendering + * + * @since Series 60 3.1 + * @param aState State to set + */ + void SetStateWithoutNotificationL( const TDesC8& aState ); + + /** + * Unset a state + * + * @since Series 60 3.1 + * @param aState State to unset. + */ + void UnsetStateL( const TDesC8& aState ); + + /** + * Get node type + * + * @since Series 60 3.1 + * @return Node type + */ + CXnType* Type(); + + /** + * Set node's content rect + * + * @since Series 60 3.1 + * @param aRect Content rect + */ + void SetRect( const TRect& aRect ); + + /** + * Get node's content rect + * + * @since Series 60 3.1 + * @return Content rect + */ + TRect Rect(); + + /** + * Set node's border rect + * + * @since Series 60 3.1 + * @param aRect Border rect + */ + void SetBorderRect( const TRect& aRect ); + + /** + * Get node's border rect + * + * @since Series 60 3.1 + * @return Border rect + */ + TRect BorderRect(); + + /** + * Set normal flow border rect + * + * @since Series 60 3.1 + * @param aRect border rect + */ + void SetNormalFlowBorderRect( const TRect& aRect ); + + /** + * Get normal flow border rect + * + * @since Series 60 3.1 + * @return Border rect + */ + TRect NormalFlowBorderRect(); + + /** + * Set node's margin rect + * + * @since Series 60 3.1 + * @param aRect Margin rect + */ + void SetMarginRect( const TRect& aRect ); + + /** + * Get node's margin rect + * + * @since Series 60 3.1 + * @return Margin rect + */ + TRect MarginRect(); + + /** + * Set node's padding rect + * + * @since Series 60 3.1 + * @param aRect Padding rect + */ + void SetPaddingRect( const TRect& aRect ); + + /** + * Get node's padding rect + * + * @since Series 60 3.1 + * @return Padding rect + */ + TRect PaddingRect(); + + /** + * Returns the parent. The ownership is not transferred. + * + * @since Series 60 3.1 + * @return The parent area, NULL if not set. + */ + CXnNode* Parent() const; + + /** + * Sets the parent. + * + * @since Series 60 3.1 + * @param aParent Parent area + */ + void SetParent( CXnNode& aParent ); + + /** + * Adds a child node under this node. Assumes ownership of the node. + * + * @since Series 60 3.1 + * @param aChild Child to be added + * @exception KXnErrAddChildToAreaFailed Adding child failed. + */ + void AddChildL( CXnNode* aChild ); + + /** + * Get the child nodes + * + * @since Series 60 3.1 + * @return Child nodes + */ + RPointerArray< CXnNode >& Children(); + + /** + * Set whether the node is dropped from layout + * + * @since Series 60 3.1 + * @param aDropped Flag indicating whether the node is dropped from layout + */ + void SetDropped( const TInt aDropped ); + + /** + * Get whether the node is dropped from layout + * + * @since Series 60 3.1 + * @return Flag indicating whether the node is dropped from layout + */ + TInt IsDropped() const; + + /** + * Set node rendered, which means it will not be rendered again until + * its properties, states or rects change + * + * @since Series 60 3.1 + */ + void SetRenderedL(); + + /** + * Set node laid out, which means it will not be laid out again until + * its properties, states or rects change + * + * @since Series 60 3.1 + */ + void SetLaidOutL(); + + /** + * Get layout state + * + * @since Series 60 3.1 + * @return Layout state + */ + TBool IsLaidOut() const; + + /** + * Set node not rendered and not laid out + * + * @since Series 60 3.1 + */ + void ClearRenderedAndLaidOut(); + + /** + * Get node plugin interface + * + * @since Series 60 3.1 + * @return Node plugin interface + */ + CXnNodePluginIf& PluginIfL(); + + /** + * Get node application interface + * + * @since Series 60 3.1 + * @return Node application interface + */ + CXnNodeAppIf& AppIfL(); + + /** + * Create a component interface according to the given type. + * + * @param aType Type of the interface to create + * @return Created interface or NULL if the provided type is not supported. + */ + XnComponentInterface::MXnComponentInterface* MakeInterfaceL( + const TDesC8& aType ); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* WidthL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* HeightL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MarginLeftL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MarginRightL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderLeftL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderRightL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* PaddingLeftL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* PaddingRightL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MarginTopL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MarginBottomL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderTopL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderBottomL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* PaddingTopL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* PaddingBottomL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderWidthL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BlockProgressionL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* DirectionL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* PositionL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MaxHeightL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MinHeightL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MaxWidthL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MinWidthL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* DisplayL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* VisibilityL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* LeftL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* RightL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* TopL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BottomL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderLeftStyleL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderRightStyleL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderTopStyleL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderBottomStyleL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderStyleL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderImageL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* DisplayPriorityL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* NameL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* ValueL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* LabelL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* InitialFocusL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* ClassL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* IdL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* PathL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MaskPathL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* NavIndexL(); + + /** + * Get property as indicated by method name. + * + * @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(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BackgroundColorL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* FocusBackgroundL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + 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 + * @param aDomNode Corresponding DOM node + */ + void SetDomNode( CXnDomNode* aDomNode ); + + /** + * Returns pointer to associated DOM node. + * + * @since S60 3.1 + * @return Pointer to DOM node + */ + CXnDomNode* DomNode(); + + /** + * Sets handle tooltip flag. + * + * @since S60 3.1 + * @return Pointer to DOM node + */ + void SetHandleTooltip( TBool aFlag ); + + /** + * Measures the adaptive content dimensions. + * + * @since Series 60 3.2 + * @param aAvailableSize A size where adaptive content must fit + * @return the content dimensions + */ + TSize MeasureAdaptiveContentL( const TSize& aAvailableSize ); + + /** + * Checks if the node has adaptive content. + * + * @since Series 60 3.2 + * @return adaptive state (none, width/height or both) + */ + TInt IsAdaptive( TBool aIgnoreSizeFixed = EFalse ) const; + + /** + * Set node's content based state (none, width, height, or both). + * + * @since Series 60 3.2 + * @param aAdaptive state (none, width/height or both) + */ + void SetAdaptiveL( const TInt aAdaptive ); + + /** + * Set fixed size to adaptive node + * + * @since Series 60 3.2 + * @param aFixedSize the node's size determined by layout algorithm + */ + 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. + * + * @since S60 3.2 + */ + void SetDirtyL( TInt aLevel = XnDirtyLevel::ELayoutAndRender, + TBool aDisplayedState = EFalse ); + + /** + * Focuses first focusable node from the focus candidate array + */ + TBool RunFocusChangeL( RPointerArray< CXnNode >& aFocusCandidates ); + + /** + * Change the order of the nodes. This is for drag and drop. + */ + void ReorderNodesL( CXnNode* aSource, CXnNode* aTarget ); + + /** + * Loops through parents until a view node is found. + * If view is not found (or this node is a view), returns + * null. + */ + CXnNode* FindViewNode(); + + /** + * Shows all tooltip nodes associated to this node + */ + void ShowTooltipsL(); + + /** + * Hides all tooltip nodes associated to this node + */ + void HideTooltipsL(); + + /** + * Gets namespace of node + */ + const TDesC8& Namespace(); + + /** + * Gets control of node + */ + CXnControlAdapter* Control() const; + + /** + * Sets scrollable control + */ + void SetScrollableControl( CXnScrollableControlAdapter* aScrollableControl ); + + /** + * Gets scrollable control. + */ + CXnScrollableControlAdapter* ScrollableControl(); + +protected: + /** + * C++ default constructor. + */ + CXnNode(); + + /** + * Two-phased constructor. + */ + void ConstructL(); + +private: + // Data + + /** + * Node implementation. + * Own. + */ + CXnNodeImpl* iImpl; + + /** + * Root node implementation. + * Not own (owned via iImpl). + */ + CXnNodeImpl* iRootNodeImpl; + + /** + * Views node implementation. + * Not own (owned via iImpl). + */ + CXnViewsNodeImpl* iViewsNodeImpl; + + /** + * View node implementation. + * Not own (owned via iImpl). + */ + CXnViewNodeImpl* iViewNodeImpl; + + /** + * Component node implementation. + * Not own (owned via iImpl). + */ + CXnComponentNodeImpl* iComponentNodeImpl; + + /** + * node plugin interface. + * Own. + */ + CXnNodePluginIf* iPluginIf; + + /** + * node application interface. + * Own. + */ + CXnNodeAppIf* iAppIf; + + /** + * delay in microseconds for timer. + */ + TTimeIntervalMicroSeconds32 iTriggerDelay; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnnodeappif.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnnodeappif.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,261 @@ +/* +* 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: +* Application interface to node of layout tree +* +*/ + +#ifndef XNNODEAPPIF_H +#define XNNODEAPPIF_H + +// System includes +#include +#include +#include +#include + +// Forward declarations +class CXnType; +class CXnProperty; +class CXnNode; +class TXnUiEngineAppIf; + +namespace XnComponentInterface + { + class MXnComponentInterface; + } + +// Class declaration +/** + * Application interface to node of layout tree + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since Series 60 3.1 + */ +class CXnNodeAppIf : public CBase + { +public: + /** + * C++ default constructor. + */ + CXnNodeAppIf( CXnNode& aNode ); + +public: + // New functions + + /** + * Get the UI engine + * + * @since Series 60 3.1 + * @return UI engine + */ + IMPORT_C TXnUiEngineAppIf* UiEngineL(); + + /** + * Set the node's characted data + * + * @since Series 60 3.1 + * @param aData Character data + */ + IMPORT_C void SetPCDataL( const TDesC8& aData ); + + /** + * Get the node's characted data + * + * @since Series 60 3.1 + * @return Character data + */ + IMPORT_C const TDesC8& GetPCData() const; + + /** + * Set a property. + * + * The list will assume ownership of the property. + * If an equal property is already in the list, it will be + * replaced with the new property and the old property will be destroyed. + * @since Series 60 3.1 + * @param aProperty Property to set. + */ + IMPORT_C void SetPropertyL( CXnProperty* aProperty ); + + /** + * Set an array of properties. + * + * Improves the performance when many properties need to be + * set e.g. in construction phase. + * The list will assume ownership of the property. + * If an equal property is already in the list, it will be + * replaced with the new property and the old property will be destroyed. + * @since Series 60 3.1 + * @param aPropertyArray Properties to set. + */ + IMPORT_C void SetPropertyArrayL( + RPointerArray< CXnProperty >* aPropertyArray ); + + /** + * Gets a property. + * + * The list will retain ownership of the property, + * the caller must not destroy the property. The returned pointer will + * become invalid if the property is replaced in the list by a subsequent + * SetL(). + * @since Series 60 3.1 + * @param aProperty Property key + * @return The property mapped to the key or NULL if not found. + */ + IMPORT_C CXnProperty* GetPropertyL( CXnProperty& aProperty ) const; + + /** + * Gets a property. + * + * The list will retain ownership of the property, + * the caller must not destroy the property. The returned pointer will + * become invalid if the property is replaced in the list by a subsequent + * SetL(). + * @since Series 60 3.1 + * @param aKey Name of the property + * @return The property mapped to the key or NULL if not found. + */ + IMPORT_C CXnProperty* GetPropertyL( const TDesC8& aKey ) const; + + /** + * Set a state + * + * @since Series 60 3.1 + * @param aState State to set. + */ + IMPORT_C void SetStateL( const TDesC8& aState ); + + /** + * Check whether a state is set + * + * @since Series 60 3.1 + * @return ETrue if set, EFalse if not + */ + IMPORT_C TBool IsStateSet( const TDesC8& aState ); + + /** + * Unset a state + * + * @since Series 60 3.1 + * @param aState State to unset. + */ + IMPORT_C void UnsetStateL( const TDesC8& aState ); + + /** + * Get node type + * + * @since Series 60 3.1 + * @return Node type + */ + IMPORT_C CXnType* Type(); + + /** + * Get node's content rect + * + * @since Series 60 3.1 + * @return Content rect + */ + IMPORT_C TRect Rect(); + + /** + * Get node's border rect + * + * @since Series 60 3.1 + * @return Border rect + */ + IMPORT_C TRect BorderRect(); + + /** + * Get node's margin rect + * + * @since Series 60 3.1 + * @return Margin rect + */ + IMPORT_C TRect MarginRect(); + + /** + * Get node's padding rect + * + * @since Series 60 3.1 + * @return Padding rect + */ + IMPORT_C TRect PaddingRect(); + + /** + * Get the internal node + * @since Series 60 3.1 + * @return Internal node + */ + CXnNode& Node(); + + /** + * Create a component interface according to the given type. + * + * @param aType Type of the interface to create + * @return Created interface or NULL if the provided type is not supported. + */ + IMPORT_C XnComponentInterface::MXnComponentInterface* MakeInterfaceL( + const TDesC8& aType ); + + /** + * Get the child nodes + * + * @since Series 60 3.1 + * @return Child nodes + */ + IMPORT_C RPointerArray< CXnNodeAppIf > ChildrenL(); + + /** + * Get the parent node + * + * @since Series 60 3.1 + * @return parent node + */ + IMPORT_C CXnNodeAppIf* ParentL() const; + + /** + * Get internal dom node type + * + * @return Reference to node type + */ + IMPORT_C const TDesC8& InternalDomNodeType() const; + + /** + * Shows all tooltip nodes associated to this node + */ + IMPORT_C void ShowTooltipsL(); + + /** + * Hides all tooltip nodes associated to this node + */ + IMPORT_C void HideTooltipsL(); + + /** + * Get namespace of this node + */ + IMPORT_C const TDesC8& Namespace(); + +private: + // Data + + /** + * Pointer to internal node object. + * Not own. + */ + CXnNode* iNode; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnnodebreadthfirstiterator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnnodebreadthfirstiterator.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,200 @@ +/* +* 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: Iterates over a tree, breadth first +* +*/ + +#ifndef XNNODEBREADTHFIRSTITERATOR_H +#define XNNODEBREADTHFIRSTITERATOR_H + +#include +#include +#include "xnchilditerator.h" + +// Constants +/** + * Queue granularity value + */ +const TInt KMemoryAloc = 128; + +template< class T > class CXnNodeBreadthFirstIterator : public CBase, + public MXnChildIterator + { +public: + + /** + * Two-phased constructor. + * @param aStartNode Object to iterate over + */ + static CXnNodeBreadthFirstIterator< T >* NewL( T& aStartNode ); + + /** + * Destructor. + */ + virtual ~CXnNodeBreadthFirstIterator(); + + /** + * Get the next iterator value. + * @return Next object or NULL if no more values. + */ + T* NextL(); + + /** + * Get the current iterator value. + * @return Current object + */ + T* Value(); + + /** + * Get the previous iterator value. Obsolete! + * @return NULL + */ + T* PreviousL(); + + /** + * Get the current iterator index. Obsolete! + * @return value 0 + */ + TUint Index() const; + +protected: + + /** + * C++ default constructor. + */ + CXnNodeBreadthFirstIterator( T* aStartNode ); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + +private: + // Queue + RPointerArray< T > iQueue; + // Object to iterate over + T* iStart; + // Current object + T* iCurrent; + }; + + +// ----------------------------------------------------------------------------- +// CXnNodeBreadthFirstIterator< T >::NewL() +// ----------------------------------------------------------------------------- +// +template< class T > CXnNodeBreadthFirstIterator< T >* + CXnNodeBreadthFirstIterator< T >::NewL( T& aStartNode ) + { + CXnNodeBreadthFirstIterator< T >* p = + new ( ELeave )CXnNodeBreadthFirstIterator< T >( &aStartNode ); + CleanupStack::PushL( p ); + p->ConstructL(); + CleanupStack::Pop(); + return p; + } + +// ----------------------------------------------------------------------------- +// CXnNodeBreadthFirstIterator< T >::CXnNodeBreadthFirstIterator() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +template< class T > + CXnNodeBreadthFirstIterator < T >::CXnNodeBreadthFirstIterator( + T* aStartNode ): iStart( aStartNode ), iCurrent( aStartNode ), + iQueue( KMemoryAloc ) + { + } + +// ----------------------------------------------------------------------------- +// CXnNodeBreadthFirstIterator< T >::~CXnNodeBreadthFirstIterator() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +template< class T > + CXnNodeBreadthFirstIterator< T >::~CXnNodeBreadthFirstIterator() + { + iQueue.Close(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeBreadthFirstIterator< T >::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +template< class T > void CXnNodeBreadthFirstIterator< T >::ConstructL() + { + iQueue.AppendL( iStart ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeBreadthFirstIterator< T >::NextL() +// ----------------------------------------------------------------------------- +// +template< class T > T* CXnNodeBreadthFirstIterator< T >::NextL() + { + if( iQueue.Count() ) + { + // Dequeue + iCurrent = iQueue[0]; + iQueue.Remove(0); + + RPointerArray< T >& currentChildNodes = iCurrent->Children(); + TInt currentChildCount( currentChildNodes.Count() ); + + // Enqueue + for( TInt i = 0; i < currentChildCount; ++i ) + { + iQueue.AppendL( currentChildNodes[i] ); + } + } + else + { + iCurrent = NULL; + iQueue.Reset(); + iQueue.AppendL( iStart ); + } + return iCurrent; + } + +// ----------------------------------------------------------------------------- +// CXnNodeBreadthFirstIterator< T >::Value() +// ----------------------------------------------------------------------------- +// +template< class T > T* CXnNodeBreadthFirstIterator< T >::Value() + { + return iCurrent; + } + +// ----------------------------------------------------------------------------- +// CXnNodeBreadthFirstIterator< T >::PreviousL() +// ----------------------------------------------------------------------------- +// +template< class T > T* CXnNodeBreadthFirstIterator< T >::PreviousL() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnNodeBreadthFirstIterator< T >::Index() +// ----------------------------------------------------------------------------- +// +template< class T > TUint CXnNodeBreadthFirstIterator< T >::Index() const + { + return 0; + } + +#endif //CXNNODEBREADTHFIRSTITERATOR_H + +// End of File \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnnodeimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnnodeimpl.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1226 @@ +/* +* 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 part of the bridge pattern of CXnNode +* +*/ + +#ifndef XNNODEIMPL_H +#define XNNODEIMPL_H + +// System includes +#include +#include + +// User includes +#include "xndomproperty.h" +#include "xnnode.h" + +// Forward declarations +class CXnType; +class CXnPropertyList; +class CXnProperty; +class CXnNode; +class CXnUiEngine; +class CGridPropertyCache; +class CLayoutPropertyCache; +class CXnDomNode; +class CXnScrollableControlAdapter; + +namespace XnComponentInterface + { + class MXnComponentInterface; + } + +// Class declaration +/** + * Implementation part of the bridge pattern in CXnNode. + * + * @ingroup group_xnlayoutengine + * @lib xnlayoutengine.lib + * @since Series 60 3.1 + */ +NONSHARABLE_CLASS( CXnNodeImpl ) : public CBase + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + * + * @param aType Type. + */ + static CXnNodeImpl* NewL( CXnType* aType ); + + /** + * Destructor. + */ + virtual ~CXnNodeImpl(); + +public: + // New functions + + /** + * Sets wheter to handle tooltips + * @since S60 5.1 + * @param aFlag ETrue to handle, EFalse otherwise + */ + void SetHandleTooltip( TBool aFlag ); + + /** + * Hides all popups + * @since S60 5.1 + */ + void HidePopupsL(); + + /** + * Shows all popups + * + * @param aRect content rect + * @param aSource Event source + * @since S60 5.1 + */ + void ShowPopupsL( TRect aRect, TInt aSource = XnEventSource::EUnknown ); + + /** + * Set content rect + * + * @since Series 60 3.1 + * @param aRect content rect + */ + void SetRect( const TRect& aRect ); + + /** + * Get content rect + * + * @since Series 60 3.1 + * @return Content rect + */ + TRect Rect(); + + /** + * Set border rect + * + * @since Series 60 3.1 + * @param aRect border rect + */ + void SetBorderRect( const TRect& aRect ); + + /** + * Get border rect + * @since Series 60 3.1 + * @return Border rect + */ + TRect BorderRect(); + + /** + * Set normal flow border rect + * + * @since Series 60 3.1 + * @param aRect border rect + */ + void SetNormalFlowBorderRect( const TRect& aRect ); + + /** + * Get normal flow border rect + * + * @since Series 60 3.1 + * @return Border rect + */ + TRect NormalFlowBorderRect(); + + /** + * Set margin rect + * + * @since Series 60 3.1 + * @param aRect margin rect + */ + void SetMarginRect( const TRect& aRect ); + + /** + * Get margin rect + * + * @since Series 60 3.1 + * @return Margin rect + */ + TRect MarginRect(); + + /** + * Set padding rect + * + * @since Series 60 3.1 + * @param aRect padding rect + */ + void SetPaddingRect( const TRect& aRect ); + + /** + * Get padding rect + * + * @since Series 60 3.1 + * @return Padding rect + */ + TRect PaddingRect(); + + /** + * Set node + * + * @since Series 60 3.1 + * @param aNode Node + */ + void SetNode( CXnNode& aNode ); + + /** + * Get node + * + * @since Series 60 3.1 + * @return Node + */ + CXnNode* Node(); + + /** + * Set UI engine + * + * @since Series 60 3.1 + * @param aEngine UI engine + */ + void SetUiEngine( CXnUiEngine& aEngine ); + + /** + * Get UI engine + * + * @since Series 60 3.1 + * @return UI engine + */ + CXnUiEngine* UiEngine(); + + /** + * Handle interaction events + * + * @since Series 60 3.1 + * @param aEventData Event data + * @param aSource A source of event, e.g. XnEventSource::EStylus. + */ + TBool ReportXuikonEventL( CXnNode& aEventData, TInt aSource = 0 ); + + /** + * Handle key event + * + * @since Series 60 3.1 + * @param aKeyEvent Key event data + * @param aType Event type + */ + void OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + + /** + * Set character data + * + * @since Series 60 3.1 + * @param aData Character data + */ + void SetPCDataL( const TDesC8& aData ); + + /** + * Get character data + * + * @since Series 60 3.1 + * @return Character data + */ + const TDesC8& GetPCData(); + + /** + * Set a property. + * + * The list will assume ownership of the property. + * If an equal property is already in the list, it will be replaced + * with the new property and the old property will be destroyed. + * @since Series 60 3.1 + * @param aProperty Property to set. + * @param aNotify Boolean flag indicating whether notifications should be + * sent + */ + void SetPropertyL( CXnProperty* aProperty, TBool aNotify = ETrue ); + + /** + * Set a property without notification being sent. + * + * @see SetPropertyL + * @param aProperty Property to set. + */ + void SetPropertyWithoutNotificationL( CXnProperty* aProperty ); + + /** + * Set a property NOT replacing an equal property if already in the list. + * + * @see SetPropertyL + * @param aProperty Property to set. + */ + void InitializePropertyL( CXnProperty* aProperty ); + + /** + * Set an array of properties. + * + * Improves the performance when many properties need to be + * set e.g. in construction phase. + * The list will assume ownership of the property. + * If an equal property is already in the list, it will be + * replaced with the new property and the old property will be destroyed. + * @see SetPropertyL + */ + void SetPropertyArrayL( RPointerArray< CXnProperty >& aPropertyArray ); + + /** + * Gets a property. + * + * The list will retain ownership of the property, + * the caller must not destroy the property. The returned pointer will + * become invalid if the property is replaced in the list by a subsequent + * SetL(). + * @since Series 60 3.1 + * @param aKey Property name + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* GetPropertyL( const TDesC8& aKey ); + + /** + * Set a state + * + * @since Series 60 3.1 + * @param aState State to set + * @param aSource A source that triggered this event + */ + void SetStateL( const TDesC8& aState, TInt aSource ); + + /** + * Check whether a state is set + * + * @since Series 60 3.1 + * @return ETrue if set, EFalse if not + */ + TBool IsStateSet( const TDesC8& aState ); + + /** + * Set a state without performing notifications and re-rendering + * + * @since Series 60 3.1 + * @param aState State to set + */ + void SetStateWithoutNotificationL( const TDesC8& aState ); + + /** + * Unset a state + * + * @since Series 60 3.1 + * @param aState State to unset. + */ + void UnsetStateL( const TDesC8& aState ); + + /** + * Get node type + * + * @since Series 60 3.1 + * @return Node type + */ + CXnType* Type(); + + /** + * Returns the parent. The ownership is not transferred. + * + * @since Series 60 3.1 + * @return The parent area, NULL if not set. + */ + CXnNode* Parent() const; + + /** + * Sets the parent. + * + * @since Series 60 3.1 + * @param aParent Parent area + */ + void SetParent( CXnNode& aParent ); + + /** + * Adds a child node. Assumes ownership of the node. + * + * @since Series 60 3.1 + * @param aChild Child to be added + * @exception KXnErrAddChildToAreaFailed Adding child failed. + */ + void AddChildL( CXnNode* aChild ); + + /** + * Get child nodes. + * + * @since Series 60 3.1 + * @return Child nodes + */ + RPointerArray< CXnNode >& Children(); + + /** + * Set whether the node is dropped from layout + * + * @since Series 60 3.1 + * @param aDropped Flag indicating whether the node is dropped from layout + */ + void SetDropped( const TInt aDropped ); + + /** + * Get whether the node is dropped from layout + * + * @since Series 60 3.1 + * @return Flag indicating whether the node is dropped from layout + */ + TInt IsDropped() const; + + /** + * Set layout capability + * + * @since Series 60 3.1 + * @param aLayoutCapable Layout capability + */ + void SetLayoutCapable( const TBool aLayoutCapable ); + + /** + * Get layout capability + * + * @since Series 60 3.1 + * @return Layout capability + */ + TBool IsLayoutCapable() const; + + /** + * Set node rendered, which means it will not be rendered again until its + * properties, states or rects change + * + * @since Series 60 3.1 + */ + void SetRenderedL(); + + /** + * Set node laid out, which means it will not be laid out again until its + * properties, states or rects change + * + * @since Series 60 3.1 + */ + void SetLaidOutL(); + + /** + * Get layout state + * + * @since Series 60 3.1 + * @return Layout state + */ + TBool IsLaidOut() const; + + /** + * Set node not rendered and not laid out + * + * @since Series 60 3.1 + */ + void ClearRenderedAndLaidOut(); + + /** + * Create a component interface according to the given type. + * + * This must be virtual because CXnComponentNodeImpl inherits this. + * @param aType Type of the interface to create + * @return Created interface or NULL if the provided type is not supported. + */ + virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL( + const TDesC8& aType ); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* WidthL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* HeightL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MarginLeftL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MarginRightL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderLeftL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderRightL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* PaddingLeftL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* PaddingRightL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MarginTopL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MarginBottomL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderTopL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderBottomL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* PaddingTopL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* PaddingBottomL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderWidthL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BlockProgressionL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* DirectionL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* PositionL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MaxHeightL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MinHeightL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MaxWidthL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MinWidthL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* DisplayL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* VisibilityL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* LeftL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* RightL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* TopL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BottomL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderLeftStyleL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderRightStyleL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderTopStyleL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderBottomStyleL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderStyleL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BorderImageL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* DisplayPriorityL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* NameL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* ValueL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* LabelL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* InitialFocusL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* ClassL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* IdL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* PathL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* MaskPathL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* NavIndexL(); + + /** + * Get property as indicated by method name. + * + * @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(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* BackgroundColorL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* FocusBackgroundL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + 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 + * @param aDomNode Corresponding DOM node + */ + void SetDomNode( CXnDomNode* aDomNode ); + + /** + * Returns pointer to associated DOM node. + * + * @since S60 3.1 + * @return Pointer to DOM node + */ + CXnDomNode* DomNode(); + + /** + * Measures the adaptive content dimensions. + * + * @since Series 60 3.2 + * @param aAvailableSize A size where adaptive content must fit + * @return the content dimensions + */ + TSize MeasureAdaptiveContentL( const TSize& aAvailableSize ); + + /** + * Checks if the node has adaptive content. + * + * @since Series 60 3.2 + * @return adaptive state (none, width/height or both) + */ + TInt IsAdaptive( TBool aIgnoreSizeFixed = EFalse ) const; + + /** + * Set node's content based state (none, width, height, or both). + * + * @since Series 60 3.2 + * @param aAdaptive state (none, width/height or both) + */ + void SetAdaptiveL( const TInt aAdaptive ); + + /** + * Set fixed size to adaptive node + * + * @since Series 60 3.2 + * @param aFixedSize the node's size determined by layout algorithm + */ + 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. + * + * @since S60 3.2 + */ + void SetDirtyL( TInt aLevel = XnDirtyLevel::ELayoutAndRender, + TBool aDisplayedState = EFalse ); + + /** + * Focuses first focusable node from the focus candidate array + */ + TBool RunFocusChangeL( RPointerArray< CXnNode >& aFocusCandidates ); + + /** + * Change the order of the nodes. This is for drag and drop. + */ + void ReorderNodesL( CXnNode* aSource, CXnNode* aTarget ); + + /** + * Find next node located aDirection from aNode. + */ + CXnNode* FindNextNodeL( + RPointerArray< CXnNode >& aArray, + CXnNode& aNode, + TInt aDirection ); + + /** + * Gets namespace of node + */ + const TDesC8& Namespace(); + + /** + * Sets scrollable control + */ + void SetScrollableControl( CXnScrollableControlAdapter* aScrollableControl ); + + /** + * Gets scrollable control. + */ + CXnScrollableControlAdapter* ScrollableControl(); + +private: + + TInt DoSetPropertyL( CXnProperty* aPropery ); + TRect AdjustRectIfNeeded( TRect aRect ); + +protected: + /** + * C++ default constructor. + */ + CXnNodeImpl(); + + /** + * Two-phased constructor. + */ + void ConstructL( CXnType* aType ); + +private: + // Data + + /** + * Component type. + * Own. + */ + CXnType* iType; + + /** + * Pointer to property list. + * Own. + */ + CXnPropertyList* iPropertyList; + + /** + * Pointer to parent node. + * Not own. + */ + CXnNode* iParent; + + /** + * Pointer to node. + * Not own. + */ + CXnNode* iNode; + + /** + * Content rect. + */ + TRect iRect; + + /** + * Border rect. + */ + TRect iBorderRect; + + /** + * Border rect according to normal flow + */ + TRect iNormalFlowBorderRect; + + /** + * Margin rect + */ + TRect iMarginRect; + + /** + * Padding rect + */ + TRect iPaddingRect; + + /** + * Is node dropped from layout + */ + TInt iDropped; + + /** + * Does node support layout + */ + TBool iLayoutCapable; + + /** + * Children of this node + */ + RPointerArray< CXnNode > iChildren; + + /** + * UI engine. + * Not own. + */ + CXnUiEngine* iUiEngine; + + /** + * Flag indicating render status + */ + TBool iRendered; + + /** + * Flag indicating layout status + */ + TBool iLaidOut; + + /** + * Array containing list of pseudo classes that have class-specific properties + */ + RArray< CXnDomProperty::TPseudoClass > iPropertyPseudoClasses; + + /** + * Array containing list of pseudo classes that have a state set + * + * @see SetStateL + */ + RArray< CXnDomProperty::TPseudoClass > iStates; + + /** + * Local cache for property with name KRef. + * Not own. + */ + CXnProperty* iRef; + + /** + * Local cache for property with name KName. + * Not own. + */ + CXnProperty* iName; + + /** + * Local cache for property with name KValue. + * Not own. + */ + CXnProperty* iValue; + + /** + * Local cache for property with name KLabel. + * Not own. + */ + CXnProperty* iLabel; + + /** + * Local cache for property with name KInitialFocus. + * Not own. + */ + CXnProperty* iInitialFocus; + + /** + * Local cache for property with name KClass. + * Not own. + */ + CXnProperty* iClass; + + /** + * Local cache for property with name KId. + * Not own. + */ + CXnProperty* iId; + + /** + * Local cache for property with name KPath. + * Not own. + */ + CXnProperty* iPath; + + /** + * Local cache for property with name KMaskPath. + * Not own. + */ + CXnProperty* iMaskPath; + + /** + * Local property cache. + * Own. + */ + CGridPropertyCache* iGridPropertyCache; + + /** + * Local property cache. + * Own. + */ + CLayoutPropertyCache* iLayoutPropertyCache; + + /** + * Flag indicating tooltip handling status + */ + TBool iHandleTooltip; + + /** + * Pointer to corresponding node in the DOM tree. + * Not own. + */ + CXnDomNode* iDomNode; + + /** + * Pointer to scrollable control adapter + * Not own. + */ + CXnScrollableControlAdapter* iScrollableControl; + + /** + * States, if the nodes width, height or both are content based. + */ + TInt iAdaptive; + + /** + * The timer for the timed triggers. + * Own. + */ + CPeriodic* iPeriodicTimer; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnnodepluginif.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnnodepluginif.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,499 @@ +/* +* 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: +* Node of layout tree, plugin interface +* +*/ + +#ifndef XNNODEPLUGINIF_H +#define XNNODEPLUGINIF_H + +// System includes +#include + +// Forward declarations +class CXnType; +class CXnProperty; +class CXnNode; +class CXnViewNodeImpl; +class CXnComponentNodeImpl; +class TXnUiEnginePluginIf; +class CXnNodeAppIf; +class CXnControlAdapter; + +namespace XnComponentInterface + { + class MXnComponentInterface; + } + +// Class declaration +/** + * Node of layout tree, plugin interface + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since Series 60 3.1 + */ +class CXnNodePluginIf : public CBase + { +public: + /** + * C++ default constructor. + */ + CXnNodePluginIf( CXnNode& aNode ); + +public: + // New functions + + /** + * Get the view node implementation + * + * @since Series 60 3.1 + * @return View node implementation + */ + IMPORT_C CXnViewNodeImpl* ViewNodeImpl(); + + /** + * Get the component node implementation + * + * @since Series 60 3.1 + * @return Component node implementation + */ + IMPORT_C CXnComponentNodeImpl* ComponentNodeImpl(); + + /** + * Get the UI engine + * + * @since Series 60 3.1 + * @return UI engine + */ + IMPORT_C TXnUiEnginePluginIf* UiEngineL(); + + /** + * Set node's layout capability + * + * @since Series 60 3.1 + * @param aLayoutCapable Layout capability + */ + IMPORT_C void SetLayoutCapable( const TBool aLayoutCapable ); + + /** + * Get node's layout capability + * + * @since Series 60 3.1 + * @return Layout capability + */ + IMPORT_C TBool IsLayoutCapable() const; + + /** + * Set the node's characted data + * + * @since Series 60 3.1 + * @param aData Character data + */ + IMPORT_C void SetPCDataL( const TDesC8& aData ); + + /** + * Get the node's characted data + * + * @since Series 60 3.1 + * @return Character data + */ + IMPORT_C const TDesC8& GetPCData() const; + + /** + * Set a property. + * + * The list will assume ownership of the property. + * If an equal property is already in the list, it will be + * replaced with the new property and the old property will be destroyed. + * + * @since Series 60 3.1 + * @param aProperty Property to set. + */ + IMPORT_C void SetPropertyL( CXnProperty* aProperty ); + + /** + * Set a property without notification being sent. + * + * @see SetPropertyL + * @param aProperty Property to set. + */ + IMPORT_C void SetPropertyWithoutNotificationL( CXnProperty* aProperty ); + + /** + * Gets a property. + * + * The list will retain ownership of the property, + * the caller must not destroy the property. The returned pointer will + * become invalid if the property is replaced in the list by a subsequent + * SetL(). + * + * @since Series 60 3.1 + * @param aProperty Property key + * @return The property mapped to the key or NULL if not found. + */ + IMPORT_C CXnProperty* GetPropertyL( CXnProperty& aProperty ) const; + + /** + * Gets a property. + * + * The list will retain ownership of the property, + * the caller must not destroy the property. The returned pointer will + * become invalid if the property is replaced in the list by a subsequent + * SetL(). + * + * @since Series 60 3.1 + * @param aKey Name of the property + * @return The property mapped to the key or NULL if not found. + */ + IMPORT_C CXnProperty* GetPropertyL( const TDesC8& aKey ) const; + + /** + * Set a state + * + * @since Series 60 3.1 + * @param aState State to set. + */ + IMPORT_C void SetStateL( const TDesC8& aState ); + + /** + * Unset a state + * + * @since Series 60 3.1 + * @param aState State to unset. + */ + IMPORT_C void UnsetStateL( const TDesC8& aState ); + + /** + * Is the node in focused state + * + * @since Series 60 3.1 + * @return ETrue if node is focused. + */ + IMPORT_C TBool IsFocusedState(); + + /** + * Get node type + * + * @since Series 60 3.1 + * @return Node type + */ + IMPORT_C CXnType* Type(); + + /** + * Set node's content rect + * + * @since Series 60 3.1 + * @param aRect Content rect + */ + IMPORT_C void SetRect( const TRect& aRect ); + + /** + * Get node's content rect + * + * @since Series 60 3.1 + * @return Content rect + */ + IMPORT_C TRect Rect(); + + /** + * Set node's border rect + * + * @since Series 60 3.1 + * @param aRect Border rect + */ + IMPORT_C void SetBorderRect( const TRect& aRect ); + + /** + * Get node's border rect + * + * @since Series 60 3.1 + * @return Border rect + */ + IMPORT_C TRect BorderRect(); + + /** + * Set node's margin rect + * + * @since Series 60 3.1 + * @param aRect Margin rect + */ + IMPORT_C void SetMarginRect( const TRect& aRect ); + + /** + * Get node's margin rect + * + * @since Series 60 3.1 + * @return Margin rect + */ + IMPORT_C TRect MarginRect(); + + /** + * Set node's padding rect + * + * @since Series 60 3.1 + * @param aRect Padding rect + */ + IMPORT_C void SetPaddingRect( const TRect& aRect ); + + /** + * Get node's padding rect + * + * @since Series 60 3.1 + * @return Padding rect + */ + IMPORT_C TRect PaddingRect(); + + /** + * Returns the parent. The ownership is not transferred. + * + * @since Series 60 3.1 + * @return The parent area, NULL if not set. + */ + IMPORT_C CXnNodePluginIf* ParentL() const; + + /** + * Adds a child node under this node. Assumes ownership of the node. + * + * @since Series 60 3.1 + * @param aChild Child to be added + * @exception KXnErrAddChildToAreaFailed Adding child failed. + */ + IMPORT_C void AddChildL( CXnNodePluginIf* aChild ); + + /** + * Get the child nodes + * + * @since Series 60 3.1 + * @return Child nodes + */ + IMPORT_C RPointerArray< CXnNodePluginIf > ChildrenL(); + + /** + * Get whether the node is to be drawn + * + * @since Series 60 3.1 + * @return Flag indicating whether the node should be drawn or not + */ + IMPORT_C TBool IsDrawingAllowed() const; + + /* + * Get node application interface + * + * @return Node application interface + */ + IMPORT_C CXnNodeAppIf& AppIfL(); + + /** + * Sets handle tooltip flag. + * + * If set to EFalse, tooltip + * is not handled by node. + * + * @since S60 3.1 + * @return Pointer to DOM node + */ + IMPORT_C void SetHandleTooltip( TBool aFlag ); + + /** + * Offers interface to report trigger event. + * + * @since S60 3.1 + * @param aTriggerName is a name of the trigger + * @params aValueName and aValue delivers an attribute + */ + IMPORT_C void ReportTriggerEventL( + const TDesC8& aTriggerName, + const TDesC8& aValueName, + const TDesC8& aValue ); + + /** + * Gets namespace of node + * + * @since Series 60 5.0 + * @return namespace + */ + IMPORT_C const TDesC8& Namespace(); + + /** + * Gets control of node + * + * @since Series 60 5.0 + * @return Control, NULL if not found + */ + IMPORT_C CXnControlAdapter* Control() const; + + /** + * Get the internal node + * + * @since Series 60 3.1 + * @return Internal node + */ + CXnNode& Node(); + + /** + * Create a component interface according to the given type. + * + * @param aType Type of the interface to create + * @return Created interface or NULL if the provided type is not supported. + */ + IMPORT_C XnComponentInterface::MXnComponentInterface* MakeInterfaceL( + const TDesC8& aType ); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + IMPORT_C CXnProperty* DisplayL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + IMPORT_C CXnProperty* VisibilityL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + IMPORT_C CXnProperty* LabelL(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + IMPORT_C CXnProperty* IdL(); + + /** + * Get property as indicated by method name. + * + * @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(); + + /** + * Get property as indicated by method name. + * + * @see GetPropertyL + * @return The property mapped to the key or NULL if not found. + */ + IMPORT_C CXnProperty* MaskPathL(); + + /** + * Marks node as dirty, adds it to UiEngine's dirty list and + * clears rendered and laidout from the node and its children. + */ + IMPORT_C void SetDirtyL(); + +private: + // Data + + /** + * Pointer to internal node object. + * Not own. + */ + CXnNode* iNode; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnodt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnodt.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,106 @@ +/* +* 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: Class represents an ODT (Object Description Tree) of Xuikon. +* +*/ + + +#ifndef XNODT_H +#define XNODT_H + +#include + +class RWriteStream; +class RReadStream; +class CXnDomDocument; +class CXnResource; +class CXnDomNode; + +/** +* @ingroup group_xnodt +* Class represents an Object Description Tree of Xuikon. +* ODT is cabable of marshaling itself into HBufC8 descriptor and unmarshaling +* from descriptor stream. +* +* @lib XnODT.lib +* @since S60 3.1 +*/ +class CXnODT : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CXnODT* NewL(); + + /** + * Destructor. + */ + virtual ~CXnODT(); + + public: // New functions + + /** + * Internalizes the ODT header. + * @since S60 5.1 + * @param aStream The read stream + * @return void + */ + IMPORT_C static void InternalizeHeaderL( RReadStream& aStream ); + + /** + * Internalizes the Resource List. + * @since S60 5.1 + * @param aStream The read stream + * @return resource list, ownership is passed to the caller + */ + IMPORT_C static CArrayPtrSeg< CXnResource >* InternalizeResourceListL( + RReadStream& aStream ); + + /** + * Internalizes the dom document. + * @since S60 5.1 + * @param aStream The read stream + * @return dom document's root node + */ + IMPORT_C CXnDomNode* InternalizeDomDocumentL( + RReadStream& aStream ); + + /** + * Get the DomDocument. + * @since S60 3.1 + * @return CXnDomDocument& Dom document + */ + IMPORT_C CXnDomDocument& DomDocument() const; + + private: + + /** + * C++ default constructor. + */ + CXnODT(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + CXnDomDocument* iDomDocument; + }; + +#endif // XNODT_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnoomsyshandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnoomsyshandler.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,137 @@ +/* +* 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: +* Helper system for handling Out-Of-Memory cases. +* +*/ + +#ifndef XNOOMSYSHANDLER_H +#define XNOOMSYSHANDLER_H + +// System includes +#include + +// Forward declarations + +// Macros + +// Bytes to kilobytes +#define B2KB(val_in_bytes) (TInt)( val_in_bytes / 1024 ) +// Kilobytes to bytes +#define KB2B(val_in_kbytes) (TInt)( val_in_kbytes * 1024 ) + +#define WIDGET_MIN_MEM CXnOomSysHandler::EMem1MB +#define VIEW_MIN_MEM CXnOomSysHandler::EMem4MB + +/** + * Class helper for handling (and preventing) out-of-memory failures + * + * This Class has only some static method. + * E.g. for showing error popup window or for checking of available memory on + * the heap. etc. + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CXnOomSysHandler ) : public CBase + { +public: // data types + + /** + * Enumeration of predefined values of memory amount for possible use + */ + enum TMemPredefinedValues + { +#ifdef _DEBUG + EMemOutOfRangeTest = 209715200, +#endif + EMinNotDef = 0, + EMem1kB = 1024, + EMem2kB = 2048, + EMem4kB = 4096, + EMem8kB = 8192, + EMem16kB = 16384, + EMem32kB = 32768, + EMem64kB = 65536, + EMem128kB = 131072, + EMem256kB = 262144, + EMem512kB = 524288, + EMem1MB = 1024000, + EMem2MB = 2048000, + EMem3MB = 3072000, + EMem4MB = 4096000 + }; + +public: // Construction / destruction. + /** + * Two-phased constructor. + */ + static CXnOomSysHandler* NewL(); + + /** + * Destructor. + */ + virtual ~CXnOomSysHandler(); + +public: // methods. + /** + * Checks if required amount of free memory is available on heap. + * + * @param aAmount required amount of free memory (in Bytes - use some + * value from TMemPredefinedValues enumeration for your comfort) + * @return ETrue if required memory is available on heap, otherwise EFalse + */ + static TBool HeapAvailable( TInt aAmount = EMinNotDef ); + + /** + * Handle potential OOM failure. + */ + void HandlePotentialOomL(); + +private: // Constructors. + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + + /** + * C++ constructor. + */ + CXnOomSysHandler(); + +private: // functions + /** + * Check whether OOM dialog can be shown. + * Prevents OOM dialogs popping up more often than + * defined in KMinInterval (defined in .cpp). + */ + TBool AllowDialog(); + +private: // Data. + /** + * OOM dialog message. + * + * Allocated early because memory might not + * be available when HandlePotentialOomL is called. + */ + HBufC* iMsg; + + /** + * Stored time stamp representing when dialog was last shown. + */ + TInt64 iPreviousDialogPopupTime; + }; + +#endif // XNOOMSYSHANDLER_H diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnpanic.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnpanic.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,84 @@ +/* +* 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: Panic and error codes +* +*/ + + + +#ifndef XNPANIC_H +#define XNPANIC_H + +// INCLUDES +#include + + +// DATA TYPES +/** + * Definitions for panic values used in Layout Engine + */ +enum TXnPanic + { + EXnInvalidConfiguration = 1, + EXnInvalidDeclaration, + EXnInvalidPublisherInfo, + EXnInvalidState, + EXnCritalPointerNull, + EXnFailedToComposeInitialView + }; + + +/** + * Error code definitions + */ +const TInt KXnErrControlAdapterFailed = -32223; +const TInt KXnErrAdapterNotWindowOwner = -32224; +const TInt KXnErrAppendingChildToControlAdapterFailed = -32225; +const TInt KXnErrAddChildToAreaFailed = -32226; +const TInt KXnErrODTNotFoundFromRepository = -32227; +const TInt KXnErrAddingProperyToListFailed = -32228; +const TInt KXnErrAddingProperyToListFailed_2 = -32229; +const TInt KXnErrAddingProperyToListFailed_3 = -32230; +const TInt KXnErrAddingProperyToListFailed_4 = -32231; +const TInt KXnErrAddingProperyToListFailed_5 = -32232; +const TInt KXnErrDomPropertyValueNULL = -32233; +const TInt KXnErrHorizontalValueNULL = -32234; +const TInt KXnErrWidthNULL = -32235; +const TInt KXnErrWidthNULL_2 = -32236; +const TInt KXnErrOrientationNULL = -32237; +const TInt KXnErrDirectionNULL = -32238; +const TInt KXnErrOrientationPropertyNULL = -32239; +const TInt KXnErrDirectionPropertyNULL = -32240; +const TInt KXnErrPositioningPropertyNULL = -32241; +const TInt KXnErrOrientationPropertyNULL_2 = -32242; +const TInt KXnErrReverseTreeFailed = -32243; +const TInt KXnErrCXnBreadthFirstTreeIteratorNextLAppendToStackFailed_1 = -32244; +const TInt KXnErrCXnBreadthFirstTreeIteratorNextLAppendToStackFailed_2 = -32245; +const TInt KXnErrCXnBreadthFirstTreeIteratorNextLAppendToStackFailed_3 = -32246; +const TInt KXnErrCXnDepthFirstTreeIteratorNextLAppendToStackFailed = -32247; +const TInt KXnErrAppendingPluginFailed = -32248; +const TInt KXnErrAppendingPluginFailedAgain = -32249; +const TInt KXnErrAppendingPluginImplFailed = -32250; +const TInt KXnErrAppendingMapItemFailed_1 = -32251; +const TInt KXnErrAppendingMapItemFailed_2 = -32252; +const TInt KXnErrBlockProgressionPropertyNULL = -32253; +const TInt KXnErrBlockProgressionPropertyNULL_2 = -32254; +const TInt KXnErrPluginFailure = -32255; + +// FUNCTION PROTOTYPES +GLREF_C void Panic(TXnPanic aPanic); + +#endif // XNPANIC_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnpointerarray.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnpointerarray.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,145 @@ +/* +* 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: Heap-allocated pointer array +* +*/ + + + +#ifndef CXNPOINTERARRAY_H +#define CXNPOINTERARRAY_H + +// INCLUDES +#include + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +// CLASS DECLARATION + +/** +* @ingroup group_xnutils +* +* Heap-allocated pointer array which does not own its objects +* @since Series 60 3.1 +*/ +class CXnPointerArray : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CXnPointerArray* NewL(); + + /** + * Destructor. + */ + virtual ~CXnPointerArray(); + + public: // New functions + + /** + * Get the underlying container + * @since Series 60 3.1 + * @return Underlying container + */ + + IMPORT_C RPointerArray& Container(); + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // New functions + + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CXnPointerArray(); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + // ?one_line_short_description_of_data + //?data_declaration; + // Reserved pointer for future extension + //TAny* iReserved; + // Internal container + RPointerArray iContainer; + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + + }; + +#endif // CXnPOINTERARRAY_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnpopup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnpopup.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,122 @@ +/* +* 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: Component for tooltips and other popups +* +*/ + + + +#ifndef _XNPOPUP_H +#define _XNPOPUP_H + +// INCLUDES +#include "xncomponent.h" +#include "xnnode.h" +#include +#include "mxncomponentinterface.h" + +// CLASS DECLARATION + +namespace XnPopupInterface +{ + _LIT8(KType, "tooltip"); + + +class MXnPopupInterface : public XnComponentInterface::MXnComponentInterface + { + +public: + static inline const TDesC8& Type() + { + return KType; + } + +public: // New functions + + /** + * Shows the popup + * @param aContainerRect Rectangle containing the control that has a popup. + * The popup will not overlap with this rect. + */ + virtual void ShowPopupL(const TRect& aContainerRect) = 0; + virtual void ShowPopupL(const TRect& aContainerRect, + TTimeIntervalMicroSeconds32 aShowDelay, + TTimeIntervalMicroSeconds32 aDisplayTime) = 0; + + /** + * Hides the popup + */ + virtual void HidePopupL() = 0; + + +private: + + }; +} + +/** +* @ingroup group_xnpopupfactory +* @lib NONE +* @since Series 60 3.1 +*/ +class CXnPopup : public CXnComponent, public XnPopupInterface::MXnPopupInterface + { +public: + /** + * 2 phase construction. + */ + static CXnPopup* NewL(); + + /** + * Destructor. + */ + virtual ~CXnPopup(); + +public: // functions from base classes + + /** + * From MXnPopupInterface Shows the popup + * @param aContainerRect Rectangle containing the control that has a popup. + * The popup will not overlap with this rect. + * @param aPopupRect Rectangle of the control that has a popup. + * The popup will not overlap with this rect and the popup will be drawn adjacent to this rect. + */ + virtual void ShowPopupL(const TRect& aContainerRect); + virtual void ShowPopupL(const TRect& aContainerRect, + TTimeIntervalMicroSeconds32 aShowDelay, + TTimeIntervalMicroSeconds32 aDisplayTime); + /** + * From MXnPopupInterface Hides the popup + */ + virtual void HidePopupL(); + /** + * Create a component interface according to the given type. + * @param aType Type of the interface to create + * @return Created interface or NULL if the provided type is not supported. + */ + virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL(const TDesC8& aType); + +private: + + CXnPopup(); + void ConstructL(); + +private: + + }; + + +#endif // _XNPOPUP_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnproperty.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnproperty.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,913 @@ +/* +* 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: +* Xuikon property header file +* +*/ + +#ifndef XNPROPERTY_H +#define XNPROPERTY_H + +// System includes +#include + +// User includes +#include "xndompropertyvalue.h" + +// Forward declarations +class CXnDomProperty; +class CXnDomPropertyValue; +class CXnDomStringPool; + +// Constants +namespace XnPropertyNames + { + _LIT8(KTrue, "true"); + _LIT8(KFalse, "false"); + _LIT8(KNone, "none"); + _LIT8(KWidget, "widget"); + _LIT8(KPlugin, "plugin"); + + namespace common + { + _LIT8(KId, "id"); + _LIT8(KClass, "class"); + _LIT8(KPCData, "pcdata"); + _LIT8(KFocusable, "focusable"); + _LIT8(KInitialFocus, "_s60-initial-focus"); + _LIT8(KDisabled, "disabled"); +// _LIT8(KLocked, "locked"); +// _LIT8(KStyleLocked, "stylelocked"); + _LIT8(KLongTap, "_s60-longtap"); + _LIT8(KSwipe, "swipe"); + _LIT8(KSwipeDestination, "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 + { + _LIT8(KStartDelay, "_s60-start-delay"); + _LIT8(KDisplayTime, "_s60-display-time"); + _LIT8(KPositionHint, "_s60-position-hint"); + namespace positionhint + { +// _LIT8(KNone, "none"); + _LIT8(KAboveLeft, "aboveleft"); + _LIT8(KAboveRight, "aboveright"); + _LIT8(KBelowLeft, "belowleft"); + _LIT8(KBelowRight, "belowright"); + _LIT8(KRight, "right"); + _LIT8(KLeft, "left"); + } + } + namespace styluspopup + { + _LIT8(KPositionHint, "_s60-position-hint"); + namespace positionhint + { + _LIT8(KAbove, "above"); +// _LIT8(KBelow, "below"); + } + } + namespace view + { +// _LIT8(KUid, "uid"); + _LIT8(KInitial, "initial"); +// _LIT8(KTitle, "title"); + _LIT8(KFocusVisibility, "_s60-focus-visibility"); + _LIT8(KStatusPaneLayout, "_s60-status-pane-layout"); + namespace statuspanelayout + { + _LIT8( KNone, "none" ); + _LIT8( KBasic, "basic" ); + _LIT8( KBasicFlat, "basic-flat" ); + _LIT8( KWideScreen, "widescreen" ); + _LIT8( KWideScreenFlat, "widescreen-flat" ); + _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"); + } + } + namespace title + { + _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" ); + _LIT8(KDynMenuItem, "dynmenuitem" ); + _LIT8(KMenuExtension, "menuextension" ); + _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 + { + _LIT8(KListQueryDialog, "listquerydialog" ); + _LIT8(KS60Heading, "_s60-heading"); + } + namespace softkey + { + _LIT8(KNodeName, "softkey"); + _LIT8(KTypeAttribute,"type"); + _LIT8(KModeAttribute,"mode"); + namespace type + { + _LIT8(KLeft, "left"); + _LIT8(KRight, "right"); + _LIT8(KMiddle, "middle"); + } + namespace mode + { + _LIT8(KModeCallActive, "mode_callactive"); + _LIT8(KModeCallInactive, "mode_callinactive"); + _LIT8(KModeEdit, "mode_edit"); + } + } + namespace text + { +// _LIT8(KLabel, "label"); + } + namespace image + { + _LIT8(KPath, "path"); + _LIT8(KMaskPath, "maskpath"); + _LIT8(KMaskInverted, "maskinverted"); + _LIT8(KS60AspectRatio, "_s60-aspect-ratio"); + _LIT8(KPreserve, "preserve"); + } + namespace clock + { + _LIT8(KS60Format, "_s60-format"); + namespace format + { + _LIT8(KDigital, "digital"); + _LIT8(KAnalog, "analog"); +// _LIT8(KLocale, "locale"); + } + + _LIT8(KS60AmPmFontSize, "_s60-ampm-font-size" ); + _LIT8(KS60DigitalFontSize, "_s60-digital-font-size"); + _LIT8( KS60DateFontSize, "_s60-date-font-size" ); + } + namespace volumecontrol + { + _LIT8( KMinRange, "minrange" ); + _LIT8( KMaxRange, "maxrange" ); + _LIT8( KSlider, "slider" ); + _LIT8( KIncrease, "increase" ); + _LIT8( KDecrease, "decrease" ); + _LIT8( KMute, "mute" ); + _LIT8( KVolumeLevelAdjustment, "_s60-volume-level-adjustment" ); + } + namespace action + { + _LIT8(KActions, "actions"); + _LIT8(KAction, "action"); + _LIT8(KProperty, "property"); + _LIT8(KName, "name"); + _LIT8(KValue, "value"); + _LIT8(KTrigger, "trigger"); + _LIT8(KEvent, "event"); + namespace trigger + { + _LIT8(KName, "name"); + _LIT8(KDelay, "delay"); + namespace name + { + _LIT8(KLeft, "left"); + _LIT8(KRight, "right"); + _LIT8(KUp, "up"); + _LIT8(KDown, "down"); + _LIT8(KDownAndUp, "downup"); + _LIT8(KActivate, "activate"); + _LIT8(KHold, "hold"); +// _LIT8(KHover, "hover"); + _LIT8(KFocus, "focus"); + _LIT8(KPassiveFocus, "passivefocus"); + _LIT8(KGainFocus, "gainfocus"); + _LIT8(KLoseFocus, "losefocus"); + _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"); + namespace direction + { + _LIT8(KLeft, "left"); + _LIT8(KRight, "right"); + } + } + namespace stylus + { + _LIT8(KStylusState, "stylusstate"); + _LIT8(KStylusEventType, "eventtype"); + } + namespace keyevent + { + _LIT8(KKeyCode, "keycode"); + _LIT8(KScanCode, "scancode"); + _LIT8(KModifiers, "modifiers"); + _LIT8(KEventType, "eventtype"); + _LIT8(KRepeats, "repeats"); + } + namespace uidefinitionmodification + { + _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 + { + _LIT8(KActive, "active"); + _LIT8(KInActive, "inactive"); + } + namespace editmode + { + _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 + { + _LIT8(KSystemPrefix, "system/"); + _LIT8(KName, "name"); + _LIT8(KSetFocus, "system/setfocus"); + _LIT8(KSetInitialFocus, "system/setinitialfocus"); + _LIT8(KSetPassiveFocus, "system/setpassivefocus"); + _LIT8(KSetActiveFocus, "system/setactivefocus"); + _LIT8(KResetPassiveFocus, "system/resetpassivefocus"); + _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(KActivateSelectedItem, "system/activateselecteditem"); + _LIT8(KDestination, "destination"); + _LIT8(KBroadcast, "broadcast"); + _LIT8(KReportEnterEditMode, "system/reportentereditmode" ); + _LIT8(KReportExitEditMode, "system/reportexiteditmode" ); + namespace systemset + { + _LIT8(KId, "id"); + _LIT8(KPseudoClass, "pseudoclass"); + _LIT8(KName, "name"); + _LIT8(KValue, "value"); + _LIT8(KType, "type"); + _LIT8(KUnit, "unit"); + _LIT8(KClass, "class"); + namespace type + { + _LIT8(KNumeric, "numeric"); + _LIT8(KString, "string"); + _LIT8(KAttribute, "attribute"); + _LIT8(KRGB, "rgb"); + _LIT8(KUrl, "url"); + } + } + } + } + namespace style + { + namespace common + { + _LIT8(KDisplay, "display"); + _LIT8(KNavIndex, "nav-index"); + _LIT8(KS60NavLooping, "_s60-nav-looping"); + _LIT8(KFocus, "focus"); + _LIT8(KPressedDown, "presseddown"); + _LIT8(KPassiveFocus, "passivefocus"); + _LIT8(KHold, "hold"); + _LIT8(KActive, "active"); + _LIT8(KEdit, "edit"); + namespace edit + { + _LIT8(KEditable, "editable"); + } + namespace display + { + _LIT8(KBlock, "block"); + _LIT8(KNone, "none"); + } +/* namespace focus + { + _LIT8(KSensitive, "sensitive"); + _LIT8(KNone, "none"); + }*/ + _LIT8(KS60DisplayPriority, "_s60-display-priority"); + _LIT8(KVisibility, "visibility"); + namespace visibility + { + _LIT8(KVisible, "visible"); + _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 + { + _LIT8(KTB, "tb"); + _LIT8(KBT, "bt"); + _LIT8(KRL, "rl"); + _LIT8(KLR, "lr"); + } + _LIT8(KDirection, "direction"); + namespace direction + { + _LIT8(KLTR, "ltr"); + _LIT8(KRTL, "rtl"); + } + _LIT8(KWidth, "width"); + _LIT8(KHeight, "height"); + _LIT8(KMarginTop, "margin-top"); + _LIT8(KMarginRight, "margin-right"); + _LIT8(KMarginBottom, "margin-bottom"); + _LIT8(KMarginLeft, "margin-left"); + _LIT8(KBorderWidth, "border-width"); + namespace border_width + { + _LIT8(KThin, "thin"); + _LIT8(KMedium, "medium"); +// _LIT8(KThick, "thick"); + } + _LIT8(KBorderTopWidth, "border-top-width"); + _LIT8(KBorderRightWidth, "border-right-width"); + _LIT8(KBorderBottomWidth, "border-bottom-width"); + _LIT8(KBorderLeftWidth, "border-left-width"); + _LIT8(KPaddingTop, "padding-top"); + _LIT8(KPaddingRight, "padding-right"); + _LIT8(KPaddingBottom, "padding-bottom"); + _LIT8(KPaddingLeft, "padding-left"); + _LIT8(KPosition, "position"); + namespace position + { + _LIT8(KAbsolute, "absolute"); + _LIT8(KStatic, "static"); +// _LIT8(KFixed, "fixed"); + _LIT8(KRelative, "relative"); + _LIT8(KFloating, "floating"); +// _LIT8(KInherit, "inherit"); + } + _LIT8(KTop, "top"); + _LIT8(KRight, "right"); + _LIT8(KBottom, "bottom"); + _LIT8(KLeft, "left"); + _LIT8(KMinWidth, "min-width"); + _LIT8(KMaxWidth, "max-width"); + _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"); + } + }//style + namespace appearance + { + namespace common + { + //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(KBackGroundImage, "background-image"); + _LIT8(KBackGroundSize, "background-size"); + _LIT8(KBackGroundRepeat, "background-repeat"); + _LIT8(KFallBackImage, "fallback-image"); + namespace backgroundrepeat + { + _LIT8(KRepeat, "repeat"); + _LIT8(KRepeatX, "repeat-x"); + _LIT8(KRepeatY, "repeat-y"); + _LIT8(KSpace, "space"); + _LIT8(KNoRepeat, "no-repeat"); + } + _LIT8(KBackGroundPosition, "background-position"); + namespace backgroundposition + { + _LIT8(KLeft, "left"); + _LIT8(KRight, "right"); + _LIT8(KTop, "top"); + _LIT8(KBottom, "bottom"); +// _LIT8(KCenter, "center"); + } + // Border properties + _LIT8(KBorderStyle, "border-style"); + _LIT8(KBorderTopStyle, "border-top-style"); + _LIT8(KBorderRightStyle, "border-right-style"); + _LIT8(KBorderBottomStyle,"border-bottom-style"); + _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"); + _LIT8(KOutset, "outset"); + } + _LIT8(KBorderColor, "border-color"); + _LIT8(KBorderLeftColor, "border-left-color"); + _LIT8(KBorderRightColor, "border-right-color"); + _LIT8(KBorderTopColor, "border-top-color"); + _LIT8(KBorderBottomColor, "border-bottom-color"); + _LIT8(KBorderImage, "border-image"); + namespace borderimage + { + _LIT8(KStretch, "stretch"); + _LIT8(KRepeat, "repeat"); + _LIT8(KRound, "round"); + } + //Font properties + _LIT8(KFontFamily, "font-family"); + _LIT8(KFontSize, "font-size"); + _LIT8(KFontWeight, "font-weight"); + _LIT8(KFontLineSpace, "font-line-space"); + namespace fontweight + { + _LIT8(KBold, "bold"); + } + _LIT8(KFontStyle, "font-style"); + namespace fontstyle + { + _LIT8(KItalic, "italic"); + } + _LIT8(KTextDecoration, "text-decoration"); + namespace textdecoration + { + _LIT8(KUnderline, "underline"); + _LIT8(KLinethrough, "line-through"); + } + _LIT8(KTextAlign, "text-align"); + namespace textalign + { + _LIT8( KAlignLeft,"left"); + _LIT8( KAlignRight,"right"); + _LIT8( KAlignCenter,"center"); + _LIT8( KAlignJustify,"justify"); + } + _LIT8(KS60TextVAlign, "_s60-text-valign"); + namespace textvalign + { + _LIT8( KAlignTop, "top"); +// _LIT8( KAlignCenter, "center"); + _LIT8( KAlignBottom, "bottom"); + } + _LIT8(KTextEffects, "font-effects"); + namespace fonteffects + { + _LIT8( KEffectsAlgorithmicbold, "algorithmicbold"); + _LIT8( KEffectsDropshadow, "dropshadow"); + _LIT8( KEffectsOutline, "outline"); + _LIT8( KEffectsEmbossed, "embossed"); + _LIT8( KEffectsEngraved, "engraved"); + _LIT8( KEffectsSoftedge, "softedge"); + } + _LIT8(KTextOverflowMode, "text-overflow-mode"); + 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"); + } + //View properties missing + }//common + } + } + +// Class declaration +/** + * Xuikon property class implementation. + * + * @ingroup group_xnlayoutengine + * @lib ?library + * @since Series 60 3.1 + */ +class CXnProperty : public CBase + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + * + * @param aProperty DOM property to embed + */ + IMPORT_C static CXnProperty* NewL( CXnDomProperty* aProperty ); + + /** + * Two-phased constructor. + * + * @param aName Property name + * @param aPropertyValue Property value + * @param aStringPool String pool to use + */ + IMPORT_C static CXnProperty* NewL( + const TDesC8& aName, + CXnDomPropertyValue* aPropertyValue, + CXnDomStringPool& aStringPool ); + + /** + * Two-phased constructor. + * + * @param aName Property name + * @param aPropertyValue Property value + * @param aValueType Property value type + * @param aStringPool String pool to use + */ + IMPORT_C static CXnProperty* NewL( + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + CXnDomPropertyValue::TPrimitiveValueType aValueType, + CXnDomStringPool& aStringPool ); + + /** + * Two-phased constructor. + * + * @param aName Property name + * @param aPropertyValue Property value + * @param aValueType Property value type + * @param aStringPool String pool to use + */ + IMPORT_C static CXnProperty* NewL( + const TDesC8& aPropertyName, + TReal aPropertyValue, + CXnDomPropertyValue::TPrimitiveValueType aValueType, + CXnDomStringPool& aStringPool ); + + /** + * Two-phased constructor. Does not take ownership of the DOM property + * + * @param aProperty DOM property to embed + */ + static CXnProperty* NewSharedL( CXnDomProperty* aProperty ); + + /** + * Destructor. + */ + virtual ~CXnProperty(); + +public: + // new functions + + /** + * Compares two propertys + * + * @since Series 60 3.2 + * @return ETrue if properties equals, EFalse otherwise + */ + IMPORT_C TBool EqualsL( CXnProperty& aProperty ) const; + + /** + * Get the embedded DOM property + * + * @since Series 60 3.1 + * @return Embedded DOM property + */ + IMPORT_C CXnDomProperty* Property(); + + /** + * Get the value of the property as a 16-bit descriptor. Ownership is + * transferred to caller. + * + * @since Series 60 3.1 + * @return String value of the property + */ + IMPORT_C HBufC* StringValueL(); + + /** + * Get the value of the property as an 8-bit descriptor. + * + * @since Series 60 3.1 + * @return String value of the property + */ + IMPORT_C const TDesC8& StringValue(); + + /** + * Get the value of the property as a number + * + * @since Series 60 3.1 + * @return Numeric value of the property + */ + IMPORT_C TReal FloatValueL(); + + /** + * Clone the property + * + * @since Series 60 3.1 + * @return Clone of the property + */ + IMPORT_C CXnProperty* CloneL(); + +private: + /** + * C++ default constructor. + */ + CXnProperty(); + + /** + * Two-phased constructor. + * + * @param aProperty DOM property to embed + */ + void ConstructL( CXnDomProperty* aProperty ); + + /** + * Two-phased constructor. + * + * @param aName Property name + * @param aPropertyValue Property value + * @param aStringPool String pool to use + */ + void ConstructL( + const TDesC8& aName, + CXnDomPropertyValue* aPropertyValue, + CXnDomStringPool& aStringPool ); + + /** + * Two-phased constructor. + * + * @param aName Property name + * @param aPropertyValue Property value + * @param aValueType Property value type + * @param aStringPool String pool to use + */ + void ConstructL( + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + CXnDomPropertyValue::TPrimitiveValueType aValueType, + CXnDomStringPool& aStringPool ); + + /** + * Two-phased constructor. + * + * @param aName Property name + * @param aPropertyValue Property value + * @param aValueType Property value type + * @param aStringPool String pool to use + */ + void ConstructL( + const TDesC8& aPropertyName, + TReal aPropertyValue, + CXnDomPropertyValue::TPrimitiveValueType aValueType, + CXnDomStringPool& aStringPool ); + + /** + * Two-phased constructor. Does not take ownership of the DOM property + * + * @param aProperty DOM property to embed + */ + void ConstructSharedL( CXnDomProperty* aProperty ); + +private: + // Data + + /** + * embedded DOM property. + * Own or Not own, depending on the iIsDomPropertyOwned flag + */ + CXnDomProperty* iProperty; + + /** + * flag indicating whether the DOM property is owned by the + * CXnProperty object + */ + TBool iIsDomPropertyOwned; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnpropertysubscriber.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnpropertysubscriber.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,128 @@ +/* +* 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: +* Subscribes properties from P&S + * +*/ + +#ifndef XNPROPERTYSUBSCRIBER_H +#define XNPROPERTYSUBSCRIBER_H + +// System includes +#include +#include + +// Class declaration +/** + * Observer for property change. + */ +class MXnPropertyChangeObserver + { +public: + /** + * Property changed + * + * @since S60 5.1 + * @param aKey key value + * @param aValue property value + */ + virtual void PropertyChangedL( const TUint32 aKey, const TInt aValue ) = 0; + }; + +/** + * Subcribes property from P&S and listen property changes + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since Series 60 5.0 + */ +NONSHARABLE_CLASS( CXnPropertySubscriber ) : public CActive + { +public: + /** + * Cancel and destroy + */ + ~CXnPropertySubscriber(); + + /** + * Two-phased constructor. + * + * @param aUid P&S property category + * @param aKey P&S property key + * @param aObserver Given property change observer + */ + static CXnPropertySubscriber* NewL( + const TUid aUid, + const TUint32 aKey, + MXnPropertyChangeObserver& aObserver ); + + /** + * Two-phased constructor. + * + * @param aUid P&S property category + * @param aKey P&S property key + * @param aObserver Given property change observer + */ + static CXnPropertySubscriber* NewLC( + const TUid aUid, + const TUint32 aKey, + MXnPropertyChangeObserver& aObserver ); + +private: + /** + * C++ constructor + */ + CXnPropertySubscriber( + MXnPropertyChangeObserver& aObserver, + const TUint32 aKey ); + + /** + * Second-phase constructor + */ + void ConstructL( const TUid aUid, const TUint32 aKey ); + +private: + /** + * From CActive. + * Handle completion + */ + void RunL(); + + /** + * From CActive. + * How to cancel me + */ + void DoCancel(); + +private: + // Data + + /** + * Observer for property changes. + * Not own + */ + MXnPropertyChangeObserver& iPropertyChangeObserver; + + /** + * Property to listen + */ + RProperty iProperty; + + /** + * P&S property key + */ + TUint32 iKey; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnresource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnresource.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,456 @@ +/* +* 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: +* +* Xuikon CXnResource-class defines all information what is needed to maintain +* resources of Application Theme. Every CXnResource-objects defines just one +* resource source, however, the same resource source could be referenced +* multiple times inside a theme - resources are usually shared. +* Xuikon Application Theme Management system supports theme resourcing by +* offering resource conversations and storing services, and offering Rendering +* Engines the following services: +* 1) the way to match a resource quoted in xml- or css-module to the +* corresponding resource source, and 2) a secure way to access a resource +* through the Symbian Platform Security's process separation wall. +* +* +*/ + + +#ifndef XNRESOURCE_H +#define XNRESOURCE_H + +#include +#include // MIME +#include // streams + +/** +* TXnLockingPolicy +* Locking policy flag-definitions for Xuikon. These are bit-masked. +*/ +enum TXnLockingPolicy + { + EXnUnlocked = 0x0000, //0b0000000000000000, + EXnLocked = 0x0001 //0b0000000000000001, + }; + +/** +* TXnCacheType +* Cache-type definitions for Xuikon. +*/ +enum TXnCacheType + { + /** + * ECacheNone. Resource is not cached = direct file access in resources original format. + * + */ + ECacheNone, + + /** + * ECacheFile. Resource is externalized to file stream - it can be internalized from given + * file stream on construct. + */ + ECacheFile, + + /** + * ECacheNone. Resource is externalized in to iBuffer - it can be internalized from this + * buffer on construct. + */ + ECacheMemory + }; + +/** +* Resource file extension definitions for Xuikon. +*/ +_LIT(KRLBFileExtension,".r"); +_LIT(KODTFileExtension,".o"); +_LIT(KDTDFileExtension,".dtd"); +_LIT(KXMLFileExtension,".xml"); +_LIT(KCSSFileExtension,".css"); +_LIT(KDATFileExtension,".dat"); + +_LIT(KFBSFileExtension,".fbs"); +_LIT(KMBMFileExtension,".mbm"); +_LIT(KMIFFileExtension,".mif"); +_LIT(KBMPFileExtension,".bmp"); +_LIT(KJPGFileExtension,".jpg"); +_LIT(KJPEGFileExtension,".jpeg"); +_LIT(KPNGFileExtension,".png"); +_LIT(KGIFFileExtension,".gif"); +_LIT(KAACFileExtension,".aac"); +_LIT(KWAVFileExtension,".wav"); +_LIT(KMIDFileExtension,".mid"); +_LIT(KMP3FileExtension,".mp3"); +_LIT(KM3GFileExtension,".m3g"); +_LIT(KSVGFileExtension,".svg"); +_LIT(KSWFFileExtension,".swf"); +_LIT(KTXTFileExtension,".txt"); + +/** +* TXnResourceType +* Resource-type definitions for Xuikon. +*/ +enum TXnResourceType + { + /** + * EResourceNone. No type at all - juts a file path. + */ + EResourceNone, + + /** + * EResourceRLB. + */ + EResourceRLB, + + /** + * EResourceODT. Resource is ODT (Xuikon Application Theme's binary format) + */ + EResourceODT, + + /** + * EResourceDTD. + */ + EResourceDTD, + + /** + * EResourceXML. + */ + EResourceXML, + + /** + * EResourceCSS. + */ + EResourceCSS, + + /** + * EResourceDAT. + */ + EResourceDAT, + + /** + * EResourceRES. Resource is some media content. + */ + EResourceRES, + + /** + * EResourceFBS. Resource is externalized CFbsBitmap. + */ + EResourceFBS, + + /** + * EResourceMBM. Resource is Symbian MBM-multiple-image. + */ + EResourceMBM, + + /** + * EResourceMIF. Resource is Symbian MIF. + */ + + EResourceMIF, + + /** + * EResourceBMP. Resource is BMP-image. + */ + EResourceBMP, + + /** + * EResourceJPG and EResourceJPEG. Resource is JPEG-compliant image. + */ + EResourceJPG, + EResourceJPEG, + + /** + * EResourcePNG. Resource is in PNG-format. + */ + EResourcePNG, + + /** + * EResourceGIF. Resourec is in GIF-format. + */ + EResourceGIF, + + /** + * EResourceAAC. Resource is a AAC audio file. + */ + EResourceAAC, + + /** + * EResourceWAV. Resource is a WAV audio file + */ + EResourceWAV, + + /** + * EResourceMID. Resource is a MID audio file. + */ + EResourceMID, + + /** + * EResourceMP3. Resource is a MP3 audio file. + */ + EResourceMP3, + + /** + * EResourceM3G. Resource is M3G. + */ + EResourceM3G, + + /** + * EResourceSVG. Resource is SVG. + */ + EResourceSVG, + + /** + * EResourceSWF. Resource is a Macromedia shock wave i.e. flash file + */ + EResourceSWF, + + /** + * EResourceMIME. Resource is in Symbian OS 9.x supported MIME-type format. + */ + EResourceMIME, + + /** + * EResourceTXT. Resource is TXT. + */ + EResourceTXT + + }; + + +/** +* @ingroup group_xnresource +* +* CXnResource is Xuikon-utility class defining resource-structure. +* +* @lib XnResource.lib +* @since S60 3.1 +*/ +class CXnResource : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CXnResource* NewL(); + /** + * Two-phased constructor. + * @param aStream The read stream + */ + IMPORT_C static CXnResource* NewLC( RReadStream& aStream ); + + /** + * CXnResource::CloneL(). Makes a clone of this class. + * @since S60 3.1 + * @return void + */ + IMPORT_C CXnResource* CloneL(); + /** + * Destructor. + */ + virtual ~CXnResource(); + + public: // New functions + + /** + * CXnResource::SetLockingPolicy(). Sets value of iLockingPolicy data member. + * @since S60 3.1 + * @param aLockingPolicy is new value for iLockingPolicy data member. + * @return void + */ + IMPORT_C void SetLockingPolicy( TXnLockingPolicy aLockingPolicy ); + + /** + * CXnResource::LockingPolicy(). Gets value of iLockingPolicy data member. + * @since S60 3.1 + * @return TXnLockingPolicy iLockingPolicy. + */ + IMPORT_C TXnLockingPolicy LockingPolicy() const; + + /** + * CXnResource::SetCacheType(). Sets value of iCacheType data member. + * @since S60 3.1 + * @param aCacheType is new value for iCacheType data member. + * @return void + */ + IMPORT_C void SetCacheType( TXnCacheType aCacheType ); + + /** + * CXnResource::CacheType(). Gets value of iCacheType data member. + * @since S60 3.1 + * @return TXnCacheType iCacheType. + */ + IMPORT_C TXnCacheType CacheType() const; + + /** + * CXnResource::SetResourceType(). Sets value of iResourceType data member. + * @since S60 3.1 + * @param aResourceType is new value of iResourceType data member. + * @return void + */ + IMPORT_C void SetResourceType( TXnResourceType aResourceType ); + + /** + * CXnResource::ResourceType(). Gets value of iResourceType data member.. + * @since S60 3.1 + * @return TXnResourceType iResourceType. + */ + IMPORT_C TXnResourceType ResourceType() const; + + /** + * CXnResource::SetResourceIdL(). Sets value of iResourceId data member. + * @since S60 3.1 + * @param aResourceId is new value of iResourceId data member. + * @return void + */ + + IMPORT_C void SetResourceIdL( const TDesC& aResourceId ); + + /** + * CXnResource::ResourceId(). Gets value of iResourceId data member. + * @since S60 3.1 + * @return TDesC& iResourceId. + */ + IMPORT_C const TDesC& ResourceId() const; + + /** + * CXnResource::SetNameSpaceL(). Sets value of iNameSpace data member. + * @since S60 3.1 + * @param aNameSpace is new value of iNameSpace data member. + * @return void + */ + IMPORT_C void SetNameSpaceL( const TDesC& aNameSpace ); + + /** + * CXnResource::NameSpace(). Gets value of iNameSpace data member. + * @since S60 3.1 + * @return TDesC& iNameSpace + */ + IMPORT_C const TDesC& NameSpace() const; + + /** + * CXnResource::SetFileNameL(). Sets value of iFileName data member. + * @since S60 3.1 + * @param aFileName is new iFileName value. + * @return void + */ + IMPORT_C void SetFileNameL( const TDesC& aFileName ); + + /** + * CXnResource::FileName(). Gets value of iFileName data member. + * @since S60 3.1 + * @return TDes& iFileName. + */ + IMPORT_C const TDesC& FileName() const; + + /** + * CXnResource::SetMimeTypeL(). Sets value of iMimeType data member. + * @since S60 3.1 + * @param aDataType is a new value of iMimeType. + * @return void + */ + IMPORT_C void SetMimeTypeL( const TDataType aDataType ); + + /** + * CXnResource::MimeType(). Get iMimeType of this CXnResource-object. + * @since S60 3.1 + * @return TDataType iMimeType. + */ + IMPORT_C TDataType MimeType() const; + + /** + * CXnResource::WriteStream(). Gets write stream on iBuffer. + * @since S60 3.1 + * @param aOffset a buffer position of iBuffer to write data. + * @return RBufWriteStream& write stream. + */ + IMPORT_C RBufWriteStream& CXnResource::WriteStream( TUint aOffset = 0 ); + + /** + * CXnResource::ReadStream(). Gets read stream on iBuffer. + * @since S60 3.1 + * @param aOffset a buffer position of iBuffer to read data. + * @return RBufReadStream& read stream + */ + IMPORT_C RBufReadStream& CXnResource::ReadStream(TUint aOffset = 0 ); + + /** + * CXnResource::SetOffset(). Sets internal data pointer of iBuffer. + * @since S60 3.1 + * @param aOffset is new offset of iBuffer data pointer. + * @return void + */ + IMPORT_C void SetOffset( TUint aOffset ); + + /** + * CXnResource::Offset(). Internal iBuffer data pointer position. + * @since S60 3.1 + * @return TUint iOffset pointing iBuffer data pointer. + */ + IMPORT_C TUint Offset() const; + + /** + * CXnResource::ExternalizeL(). Externalizes CXnResource-object's member data. + * @since S60 3.1 + * @param aStream is a write stream given. + * @return void + */ + IMPORT_C void ExternalizeL( RWriteStream& aStream) const; + + /** + * CXnResource::InternalizeL(). Internalizes CXnResource-object's member data. + * @since S60 3.1 + * @param aStream is data read stream given. + * @return void + */ + IMPORT_C void InternalizeL( RReadStream& aStream); + + /** + * CXnResource::GetDataStreamLength(). + * @since S60 3.1 + * @return TInt data length of CXnResource-data members for streaming functions. + */ + IMPORT_C TInt GetDataStreamLength() const; + + private: + + /** + * C++ default constructor. + */ + CXnResource(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + TXnLockingPolicy iLockingPolicy; + TXnCacheType iCacheType; + TXnResourceType iResourceType; + TDesC* iResourceID; + TDesC* iNameSpace; + TDesC* iFileName; + TDataType iMimeType; + CBufSeg* iBuffer; + TUint iOffset; + RBufWriteStream iWriteStream; + RBufReadStream iReadStream; + + // Reserved pointer for future extension + TAny* iReserved; + }; + +#endif // XNRESOURCE_H +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xntext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xntext.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,123 @@ +/* +* 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: Wrapper class for CEikLabel. +* +*/ + + + +#ifndef _XNTEXT_H +#define _XNTEXT_H + +// INCLUDES +#include "xncomponent.h" +#include +#include "xnnode.h" +#include "mxncomponentinterface.h" + + +// CLASS DECLARATION + +namespace XnTextInterface +{ +_LIT8(KType, "text"); +class MXnTextInterface : public XnComponentInterface::MXnComponentInterface + { + +public: + + static inline const TDesC8& Type() + { + return KType; + } + +public: // New functions + + /** + * Sets the new content to the underlying CEikLabel + * @param aText The new content + */ + virtual void SetTextL(const TDesC& aText) = 0; + + /** + * Returns the text contained in the underlying CEikLabel + * @return TDesC* The text + */ + virtual const TDesC* Text() = 0; + + +private: + + }; + } + +/** +* @ingroup group_xntextfactory +* @lib xn3textfactory.lib +* @since Series 60 3.1 +*/ +class CXnText : public CXnComponent, public XnTextInterface::MXnTextInterface + { + +public: + + + /** + * 2 phase construction. + */ + static CXnText* NewL(); + + + /** + * Destructor. + */ + virtual ~CXnText(); + +public: // New functions + + /** + * Sets the new content to the underlying CEikLabel + * @param aText The new content + */ + void SetTextL(const TDesC& aText); + + /** + * Returns the text contained in the underlying CEikLabel + * @return TDesC* The text + */ + const TDesC* Text(); + + +public: // from CCoeControl + + /** + * Create a component interface according to the given type. + * @param aType Type of the interface to create + * @return Created interface or NULL if the provided type is not supported. + */ + virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL(const TDesC8& aType); + + + +private: + + CXnText(); + void ConstructL(); + + }; + + +#endif // _XNTEXT_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xntexteditor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xntexteditor.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,111 @@ +/* +* 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: Implementation wrapper for CEikEdwin +* +*/ + +#ifndef _XNTEXTEDITOR_H +#define _XNTEXTEDITOR_H + +// INCLUDES +#include "xncomponent.h" +#include +#include "xnnode.h" +#include "mxncomponentinterface.h" + + +// CLASS DECLARATION + +namespace XnTextEditorInterface + { + _LIT8( KType, "texteditor" ); + + class MXnTextEditorInterface : public XnComponentInterface::MXnComponentInterface + { + public: + + static inline const TDesC8& Type() + { + return KType; + } + + public: // New functions + + /** + * Sets the new text to the underlying CEikEdvin + * @param aText The new content + */ + virtual void SetTextL(const TDesC& aText) = 0; + + /** + * Returns the text contained in the underlying CEikEdvin + * @return HBufC* The text + */ + virtual const HBufC* Text() = 0; + + private: + }; + } + +/** +* @ingroup group_xntexteditorfactory +* @lib xntexteditorfactory.lib +* @since S60 +*/ +class CXnTextEditor : public CXnComponent, public XnTextEditorInterface::MXnTextEditorInterface + { +public: + + /** + * 2 phase construction. + */ + static CXnTextEditor* NewL(); + + /** + * Destructor. + */ + virtual ~CXnTextEditor(); + +public: // New functions + + /** + * Sets the new content to the underlying CEikEdvin + * @param aText The new content + */ + void SetTextL(const TDesC& aText); + + /** + * Returns the text contained in the underlying CEikEdvin + * @return HBufC* The text + */ + const HBufC* Text(); + +public: // from CCoeControl + + /** + * Create a component interface according to the given type. + * @param aType Type of the interface to create + * @return Created interface or NULL if the provided type is not supported. + */ + virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL( const TDesC8& aType ); + +private: + + CXnTextEditor(); + void ConstructL(); + }; + +#endif // _XNTEXTEDITOR_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xntype.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xntype.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,151 @@ +/* +* 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: Hand-made RTTI type object. +* +*/ + + + +#ifndef CXNTYPE_H +#define CXNTYPE_H + +// INCLUDES +#include + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +// CLASS DECLARATION + +/** +* @ingroup group_xnutils +* +* Hand-made RTTI type object. +* @since Series 60 3.1 +*/ +class CXnType : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aType Type identifier + */ + IMPORT_C static CXnType* NewL(const TDesC8& aType); + + /** + * Destructor. + */ + IMPORT_C virtual ~CXnType(); + + public: // New functions + + /** + * Get the type identifier + * @since Series 60 3.1 + * @return Type identifier + */ + IMPORT_C const TDesC8& Type(); + + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // New functions + + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + + + protected: // Functions from base classes + + /** + * C++ default constructor. Protected in order to allow for derivation. + */ + IMPORT_C CXnType(); + + /** + * 2nd phase constructor. Protected in order to allow for derivation. + * @param aType Type identifier + */ + IMPORT_C void ConstructL(const TDesC8& aType); + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + + private: + + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + // ?one_line_short_description_of_data + //?data_declaration; + // Reserved pointer for future extension + //TAny* iReserved; + // Type identifier + const TDesC8* iType; + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + + }; + +#endif // CXnTYPE_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnuiengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnuiengine.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,493 @@ +/* +* 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: +* Xuikon UI engine. +* +*/ + +#ifndef XNUIENGINE_H +#define XNUIENGINE_H + +// System includes +#include +#include + +// Forward declarations +class CXnAppUiAdapter; +class CXnViewManager; +class CXnUiEngineImpl; +class TXnUiEngineAppIf; +class TXnUiEnginePluginIf; +class CCoeControl; +class CXnProperty; +class CXnNode; +class CXnResource; +class CXnODT; +class CXnPointerArray; +class CXnEditor; +class CXnEditMode; +class CXnHitTest; +class CXnKeyEventDispatcher; + +// Class declaration +/** + * Xuikon UI engine. + * + * @ingroup group_xnlayoutengine + * @lib xnlayoutengine.lib + * @since Series 60 3.1 + */ +NONSHARABLE_CLASS( CXnUiEngine ) : public CBase + { +public: + + /** + * Two-phased constructor. + */ + static CXnUiEngine* NewL( CXnAppUiAdapter& aAdapter ); + + /** + * Destructor. + */ + virtual ~CXnUiEngine(); + +public: + // New functions + + /** + * Gets AppUi + * + * @since S60 5.0 + * @return AppUi + */ + CXnAppUiAdapter& AppUiAdapter() const; + + /** + * Calculates the layout of the UI and renders it. + * + * @since Series 60 3.1 + * @param aNode Starting point for the layout + * @exception KXnErrLoadLayoutFileFailed Loading the layout file failed. + */ + void RenderUIL( CXnNode* aNode = NULL ); + + /** + * Calculates the layout of the UI. + * + * @since Series 60 3.1 + * @param aNode Starting point for the layout + */ + void LayoutUIL( CXnNode* aNode = NULL ); + + /** + * Gets the root node of the UI. Ownership is not transferred. + * + * @since Series 60 3.1 + * @return Node + */ + CXnNode* RootNode(); + + /** + * Find a node by its id. Ownership is not transferred. + * + * @since Series 60 3.1 + * @param aAreaId Area id + * @param aNamespace Namespace + * @return Node with the given id + */ + CXnNode* FindNodeByIdL( + const TDesC& aAreaId, + const TDesC& aNamespace = KNullDesC ); + + /** + * 8-bit version of Find a node by its id. Ownership is not transferred. + * + * @since Series 60 3.1 + * @param aAreaId Area id + * @param aNamespace Namespace + * @return Node with the given id + */ + CXnNode* FindNodeByIdL( + const TDesC8& aAreaId, + const TDesC8& aNamespace = KNullDesC8 ); + + /** + * Find nodes by class. Ownership is not transferred. + * + * @since Series 60 3.1 + * @param aClassId Class id + * @return Nodes belonging to the class + */ + CXnPointerArray* FindNodeByClassL( + const TDesC& aClassId, + const TDesC& aNamespace = KNullDesC ); + + /** + * Find nodes by class. Ownership is not transferred. + * + * @since Series 60 3.1 + * @param aClassId Class id + * @return Nodes belonging to the class + */ + CXnPointerArray* FindNodeByClassL( + const TDesC8& aClassId, + const TDesC8& aNamespace = KNullDesC8 ); + + /** + * Find resources (images etc.) of the UI. Ownership is not transferred. + * + * @since Series 60 3.1 + * @return Resources of the UI + */ + CArrayPtrSeg< CXnResource >& Resources(); + + /** + * Set currently focused node + * + * @since Series 60 3.1 + * @param aFocusedNode Focused node + * @param aSource A source of event that triggered focus change. + */ + void SetFocusedNodeL( CXnNode* aFocusedNode, TInt aSource = 0 ); + + /** + * Get currently focused node + * + * @since Series 60 3.2 + * @return Focused node. + */ + CXnNode* FocusedNode(); + + /** + * Checks if the UI is in Edit mode. + * + * @since Series 60 5.0 + * @return ETrue if the current mode is edit, otherwise EFalse. + */ + TBool IsEditMode(); + + /** + * Get the raw ODT + * + * @since Series 60 3.1 + * @return ODT + */ + CXnODT* ODT(); + + /** + * Get a numeric value of a property in vertical pixels + * + * @since Series 60 3.1 + * @param aValue Property + * @param aReferenceValue Value used for percentage calculation + * @return Value in vertical pixels + */ + TInt VerticalPixelValueL( CXnProperty* aValue, TInt aReferenceValue ); + + /** + * Get a numeric value of a property in horizontal pixels + * + * @since Series 60 3.1 + * @param aValue Property + * @param aReferenceValue Value used for percentage calculation + * @return Value in horizontal pixels + */ + TInt HorizontalPixelValueL( CXnProperty* aValue, TInt aReferenceValue ); + + /** + * Get a numeric value of a property in vertical twips + * + * @since Series 60 3.1 + * @param aValue Property + * @param aReferenceValue Value used for percentage calculation + * @return Value in vertical twips + */ + TInt VerticalTwipValueL( CXnProperty* aValue, TInt aReferenceValue ); + + /** + * Get a numeric value of a property in horizontal twips + * + * @since Series 60 3.1 + * @param aValue Property + * @param aReferenceValue Value used for percentage calculation + * @return Value in horizontal pixels + */ + TInt HorizontalTwipValueL( CXnProperty* aValue, TInt aReferenceValue ); + + /** + * Refresh current menu + * + * @since Series 60 3.1 + */ + 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 + * @return view manager + */ + CXnViewManager* ViewManager(); + + /** + * Return the active view + * + * @since Series 60 3.1 + * @return The active view node + */ + CXnNode* ActiveView(); + + /** + * Add a dirty node. + * + * LayoutUiL and RenderUiL will only perform operations on the set of dirty + * nodes. + * + * @since Series 60 3.1 + * @param aNode Dirty node. + */ + void AddDirtyNodeL( CXnNode* aNode, TInt aLevel ); + + /** + * Get application interface. + * + * @since Series 60 3.1 + * @return application interface + */ + TXnUiEngineAppIf& AppIfL(); + + /** + * Get plugin interface. + * + * @since Series 60 3.1 + * @return plugin interface + */ + TXnUiEnginePluginIf& PluginIfL(); + + /** + * Get the size of the current screen device + * + * @since Series 60 3.1 + * @return Size of the current screen device + */ + TSize ScreenDeviceSize() const; + + /** + * Checks whether the dialog is displaying. + * + * @since Series 60 3.1 + * @return ETrue if dialog is displaying. + */ + TBool IsDialogDisplaying(); + + /** + * Checks whether the menu is displaying. + * + * @since Series 60 3.1 + * @return ETrue if menu is displaying. + */ + TBool IsMenuDisplaying(); + + /** + * Returns menubar node. + * + * @since Series 60 3.2 + */ + CXnNode* MenuBarNode() const; + + /** + * Returns stylus popup node. + * + * @since S60 5.0 + */ + CXnNode* StylusPopupNode() const; + + /** + * Set node as passive, and add it to the passive focused node array. + * + * @since Series 60 3.2 + * @param aNode Node to use. + */ + void AddPassiveFocusedNodeL( CXnNode* aNode ); + + /** + * Unset the passive focus from the node, and remove it from the passive + * focused node array. + * @since Series 60 3.2 + * @param aNode Node to use. + */ + void RemovePassiveFocusedNodeL( CXnNode* aNode ); + + /** + * Clear the passive focused node array, and unset the passive focus states. + * + * @since Series 60 3.2 + */ + void ClearPassiveFocusedNodesL(); + + /** + * Sets the main pane rect + * + * @since Series 60 5.0 + */ + void SetClientRectL( TRect aRect, TBool aDrawNow = ETrue ); + + /** + * Gets the main pane rect + * + * @since Series 60 5.0 + */ + TRect ClientRect() const; + + /** + * Sets nodes dropped state + * + * @since S60 3.2 + */ + void SetNodeDroppedL( CXnNode& aNode, TInt aDropped ) const; + + /** + * Checks if node is adaptive, but doesn't have any content + * + * @since Series 60 3.2 + */ + void CheckAdaptiveContentL( + CXnNode& aNode, + TSize aAvailableSize = TSize::EUninitialized ) const; + + /** + * Adds a node which can be focused. + * + * @since Series 60 3.2 + */ + void AddFocusCandidateL( CXnNode *aNode ); + + /** + * Fetch editor to operate on AI3 widgets. + * + * @since Series 60 5.0 + * @return Pointer to Editor + */ + CXnEditor* Editor()const; + + /** + * Gets pointer to edit mode storage. + * + * @since Series 60 5.0 + */ + CXnEditMode* EditMode(); + + /** + * Gets the array that contains plugin nodes for current view. + * + * @since Series 60 5.0 + */ + 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 + * @param aPath path from which file is found + * @param aFile file to which resource is set + * @return errorcode + */ + TInt GetThemeResource( const TDesC& aPath, RFile& aFile ); + + /** + * Analyse added widget + * + * @since S60 5.1 + */ + TBool AnalyseAddedWidgetL( CXnNode& aNode ); + + /** + * Disables layoyt and redraw, places cleanup item to cleanup stack + * for enabling layot and redraw + * + * @since Series 60 5.0 + */ + void DisableRenderUiLC(); + + /** + * Set event dispatcher + * + * @since Series 60 5.0 + * @param aDispather Event dispatcher + */ + void SetEventDispatcher( CXnKeyEventDispatcher* aDispatcher ); + +private: + /** + * C++ default constructor. + */ + CXnUiEngine(); + + /** + * 2nd phase constructor. + */ + void ConstructL( CXnAppUiAdapter& aAdapter ); + +private: + // Data + + /** + * The layout calculation and ui rendering implementation. + * Own. + */ + CXnUiEngineImpl* iUiEngineImpl; + + /** + * Application proxy. + * Own. + */ + TXnUiEngineAppIf* iAppIf; + + /** + * Plugin proxy. + * Own. + */ + TXnUiEnginePluginIf* iPluginIf; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnuiengineappif.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnuiengineappif.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,226 @@ +/* +* 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: +* Layout calculation and UI rendering mechanism. +* +*/ + +#ifndef XNUIENGINEAPPIF_H +#define XNUIENGINEAPPIF_H + +// System inlcudes +#include + +// Forward declarations +class CXnUiEngine; +class CXnNodeAppIf; +class CXnDomStringPool; +class RFile; + +// Class declaration +/** + * Layout engine. + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since Series 60 3.1 + */ +class TXnUiEngineAppIf + { +public: + /** + * C++ default constructor. + */ + TXnUiEngineAppIf( CXnUiEngine& aUiEngine ); + +public: + // New functions + + /** + * Calculates the layout of the UI + * + * @since Series 60 3.1 + * @param aNode Starting point for the layout + * @exception KXnErrLoadLayoutFileFailed Loading the layout file failed. + */ + IMPORT_C void RenderUIL( CXnNodeAppIf* aNode = NULL ); + + /** + * Gets the root node of the UI. Ownership is not transferred. + * + * @since Series 60 3.1 + * @return Node + */ + IMPORT_C CXnNodeAppIf& RootNodeL(); + + /** + * Find a node by its id. Ownership is not transferred. + * + * @since Series 60 3.1 + * @param aNodeId Area id + * @param aNamespace Namespace + * @return Node with the given id + */ + IMPORT_C CXnNodeAppIf* FindNodeByIdL( + const TDesC& aNodeId, + const TDesC& aNamespace = KNullDesC ); + + /** + * Find a node by its id. Ownership is not transferred. + * + * @since Series 60 3.1 + * @param aNodeId Area id + * @param aNamespace Namespace + * @return Node with the given id + */ + IMPORT_C CXnNodeAppIf* FindNodeByIdL( + const TDesC8& aNodeId, + const TDesC8& aNamespace = KNullDesC8 ); + + /** + * Find nodes by class. Ownership of the array is transferred, ownership of + * the nodes is not transferred. + * + * @since Series 60 3.1 + * @param aClassId Class id + * @return Nodes belonging to the class + */ + IMPORT_C RPointerArray< CXnNodeAppIf > FindNodeByClassL( + const TDesC& aClassId, + const TDesC& aNamespace = KNullDesC ); + + /** + * Find nodes by class. Ownership of the array is transferred, ownership of + * the nodes is not transferred. + * + * @since Series 60 3.1 + * @param aClassId Class id + * @return Nodes belonging to the class + */ + IMPORT_C RPointerArray< CXnNodeAppIf > FindNodeByClassL( + const TDesC8& aClassId, + const TDesC8& aNamespace = KNullDesC8 ); + + /** + * Find content source nodes. Ownership of the array is transferred, + * ownership of the nodes is not transferred. + * + * @since S60 5.0 + * @param aNamespace namespace where to find content source nodes + * @return Content source nodes from the namespace + */ + IMPORT_C RPointerArray< CXnNodeAppIf > FindContentSourceNodesL( + const TDesC8& aNamespace ); + + /** + * Get the string pool + * + * @since Series 60 3.1 + * @return String pool + */ + IMPORT_C CXnDomStringPool& StringPool(); + + /** + * Refresh current menu + * + * @since Series 60 3.1 + */ + 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 + * @return The active view node + */ + IMPORT_C CXnNodeAppIf* ActiveView(); + + /** + * Checks whether the menu is displaying. + * + * @since Series 60 3.2 + * @return ETrue if menu is displaying. + */ + IMPORT_C TBool IsMenuDisplaying(); + + /** + * Populate given array with plugin nodes. + * + * @since Series 60 5.0 + * @param aArray Array to populate + * @return Number of added plugin nodes + */ + IMPORT_C TInt GetPluginNodeArrayL( + RPointerArray< CXnNodeAppIf >& aArray ); + + /** + * Gets the currently focused node + * + * @since Series 60 5.0 + * @return Pointer to focused node, NULL if no focus + */ + IMPORT_C CXnNodeAppIf* FocusedNode(); + + /** + * Checks if the UI is in Edit mode. + * + * @since Series 60 5.0 + * @return ETrue if the current mode is edit, otherwise EFalse. + */ + IMPORT_C TBool IsEditMode(); + + /** + * Changes internal ui engine pointer + * + * @since Series 60 5.0 + */ + IMPORT_C void SetUiEngine( CXnUiEngine* aUiEngine ); + + /** + * Gets theme resource file + * + * @since S60 5.1 + * @param aPath path from which file is found + * @param aFile file to which resource is set + * @return errorcode + */ + IMPORT_C TInt GetThemeResource( const TDesC& aPath, RFile& aFile ); + + /** + * Gets widgets visibilty state + * + * @since Series 60 5.0 + * @return ETrue if widgets visible, EFalse otherwise + */ + IMPORT_C TBool WidgetsVisible() const; + +private: + // Data + + /** + * The layout calculation and ui rendering implementation. + * Not own. + */ + CXnUiEngine* iUiEngine; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnuienginepluginif.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnuienginepluginif.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,335 @@ +/* +* 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: +* Xuikon layout engine plugin interface. +* +*/ + +#ifndef XNUIENGINEPLUGINIF_H +#define XNUIENGINEPLUGINIF_H + +// System includes +#include + +// User includes + +// Forward declarations +class CXnUiEngine; +class CXnProperty; +class CXnNodePluginIf; +class CXnDomStringPool; +class CXnResource; +class CXnControlAdapter; +struct TPointerEvent; + +// Class declaration +/** + * Xuikon layout engine plugin interface. + * + * @ingroup group_xnlayoutengine + * @lib xnlayoutengine.lib + * @since Series 60 3.1 + */ +class TXnUiEnginePluginIf + { +public: + /** + * C++ default constructor. + */ + TXnUiEnginePluginIf( CXnUiEngine& aUiEngine ); + +public: + // New functions + + /** + * Calculates the layout of the UI + * + * @since Series 60 3.1 + * @param aNode Starting point for the layout + * @exception KXnErrLoadLayoutFileFailed Loading the layout file failed. + */ + IMPORT_C void RenderUIL( CXnNodePluginIf* aNode = NULL ); + + /** + * Gets the root node of the UI. Ownership is not transferred. + * + * @since Series 60 3.1 + * @return Node + */ + IMPORT_C CXnNodePluginIf& RootNodeL(); + + /** + * Find a node by its id. Ownership is not transferred. + * + * @since Series 60 3.1 + * @param aNodeId Area id + * @param aNamespace Namespace + * @return Node with the given id + */ + IMPORT_C CXnNodePluginIf* FindNodeByIdL( + const TDesC& aNodeId, + const TDesC& aNamespace = KNullDesC ); + + /** + * Find a node by its id. Ownership is not transferred. + * + * @since Series 60 3.1 + * @param aNodeId Area id + * @param aNamespace Namespace + * @return Node with the given id + */ + IMPORT_C CXnNodePluginIf* FindNodeByIdL( + const TDesC8& aNodeId, + const TDesC8& aNamespace = KNullDesC8 ); + + /** + * Find nodes by class. Ownership is not transferred. + * + * @since Series 60 3.1 + * @param aClassId Class id + * @return Nodes belonging to the class + */ + IMPORT_C RPointerArray< CXnNodePluginIf > FindNodeByClassL( + const TDesC& aClassId ); + + /** + * Find resources (images etc.) of the UI. Ownership is not transferred. + * + * @since Series 60 3.1 + * @return Resources of the UI + */ + IMPORT_C CArrayPtrSeg< CXnResource >& Resources(); + + /** + * Get currently focused node. Ownership is not transferred. + * + * @since Series 60 3.1 + * @return Focused node + */ + IMPORT_C CXnNodePluginIf* FocusedNodeL(); + + /** + * Set currently focused node + * + * @since Series 60 3.1 + * @param aFocusedNode Focused node + */ + 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 + * + * @since Series 60 3.1 + * @return String pool + */ + IMPORT_C CXnDomStringPool& StringPool(); + + /** + * Get a numeric value of a property in vertical pixels + * + * @since Series 60 3.1 + * @param aValue Property + * @param aReferenceValue Value used for percentage calculation + * @return Value in vertical pixels + */ + IMPORT_C TInt VerticalPixelValueL( + CXnProperty* aValue, + TInt aReferenceValue ); + + /** + * Get a numeric value of a property in horizontal pixels + * + * @since Series 60 3.1 + * @param aValue Property + * @param aReferenceValue Value used for percentage calculation + * @return Value in horizontal pixels + */ + IMPORT_C TInt HorizontalPixelValueL( + CXnProperty* aValue, + TInt aReferenceValue ); + + /** + * Get a numeric value of a property in vertical twips + * + * @since Series 60 3.1 + * @param aValue Property + * @param aReferenceValue Value used for percentage calculation + * @return Value in vertical twips + */ + IMPORT_C TInt VerticalTwipValueL( + CXnProperty* aValue, + TInt aReferenceValue ); + + /** + * Get a numeric value of a property in horizontal twips + * + * @since Series 60 3.1 + * @param aValue Property + * @param aReferenceValue Value used for percentage calculation + * @return Value in horizontal pixels + */ + IMPORT_C TInt HorizontalTwipValueL( + CXnProperty* aValue, + 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 + * @return Size of the current screen device + */ + IMPORT_C TSize ScreenDeviceSize(); + + /** + * Checks whether the dialog is displaying. + * + * @since Series 60 3.1 + * @return ETrue if dialog is displaying. + */ + IMPORT_C TBool IsDialogDisplaying(); + + /** + * Sets the given node dirty. + * + * @since Series 60 3.1 + * @param aNode A node to be set dirty. + */ + IMPORT_C void AddDirtyNodeL( CXnNodePluginIf& aNode ); + + /** + * Checks whether the menu is displaying. + * + * @since Series 60 3.1 + * @return ETrue if menu is displaying. + */ + IMPORT_C TBool IsMenuDisplaying(); + + /** + * Calculates the layout of the UI. + * + * @since Series 60 3.1 + * @param aNode Starting point for the layout + */ + IMPORT_C void LayoutUIL( CXnNodePluginIf* aNode = NULL ); + + /** + * Gets the edit mode state from UI Engine. + * + * @since Series 60 5.0 + * @return A state of edit mode. + */ + IMPORT_C TInt EditMode(); + + /** + * Gets widgets visibilty state + * + * @since Series 60 5.0 + * @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. + * + * @since Series 60 5.0 + * @param aNode Node to start. + * @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 + * + * @since Series 60 5.0 + */ + IMPORT_C void DisableRenderUiLC(); + +private: + // Data + + /** + * The layout calculation and ui rendering implementation. + * Not own. + */ + CXnUiEngine* iUiEngine; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnviewmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnviewmanager.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,337 @@ +/* +* 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: +* Management of views in UiEngine +* +*/ + +#ifndef XNVIEWMANAGER_H +#define XNVIEWMANAGER_H + +// System includes +#include +#include + +// Forward declarations +class CXnUiEngine; +class CXnComposer; +class CXnODTParser; +class CXnEditor; +class CXnEcomHandler; +class CXnRootData; +class CXnViewData; +class CXnPluginData; +class CXnNode; +class CXnODT; +class CXnResource; +class CXnControlAdapter; +class CXnAppUiAdapter; +class CHsContentInfo; +class CXnViewAdapter; +class CXnOomSysHandler; + +namespace hspswrapper + { + class CHspsWrapper; + } + +using namespace hspswrapper; + +// Classe declaration +/** + * Notifies view changes + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( MXnViewObserver ) + { +public: + // new functions + virtual void NotifyViewActivatedL( const CXnViewData& aViewData ) = 0; + + virtual void NotifyViewDeactivatedL( const CXnViewData& aViewData ) = 0; + + virtual void NotifyConfigureWidgetL( + const CHsContentInfo& aContentInfo, + CXnPluginData& aPluginData ) = 0; + + virtual void NotifyWidgetAdditionL( const CXnPluginData& aPluginData ) = 0; + + virtual void NotifyWidgetRemovalL( const CXnPluginData& aPluginData ) = 0; + + virtual void NotifyViewAdditionL( const CXnPluginData& aPluginData ) = 0; + + virtual void NotifyViewRemovalL( const CXnPluginData& aPluginData ) = 0; + }; + +/** + * Manages views in UiEngine. + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CXnViewManager ) : public CBase + { + // Friend classes + friend class CXnViewAdapter; +public: + /** + * Two-phased constructor. + */ + static CXnViewManager* NewL( + CXnAppUiAdapter& aAdapter ); + + static CXnViewManager* NewLC( + CXnAppUiAdapter& aAdapter ); + + ~CXnViewManager(); + +private: + CXnViewManager( CXnAppUiAdapter& aAdapter ); + void ConstructL(); + +public: + // New functions + + inline void SetUiEngine( CXnUiEngine& aUiEngine ); + + inline CXnUiEngine& UiEngine() const; + + inline CXnComposer& Composer() const; + + inline CXnEditor& Editor() const; + + inline CXnAppUiAdapter& AppUiAdapter() const; + + CXnODT* ODT() const; + + CXnNode* RootNode() const; + + CXnNode* ViewNode() const; + + CXnODTParser& Parser() const; + + CXnEcomHandler& EcomHandler() const; + + const RPointerArray< CXnControlAdapter >& Controls() const; + + RPointerArray< CXnNode >& PluginNodes() const; + + void PluginDataL( RPointerArray< CXnPluginData >& aList, + TBool aGlobal = EFalse ) const; + + RPointerArray< CXnNode >& AppearanceNodes() const; + + CArrayPtrSeg< CXnResource >& Resources() const ; + + void LoadUiL(); + + void ReloadUiL(); + + TInt LoadWidgetToPluginL( + CHsContentInfo& aContentInfo, + CXnPluginData& aPluginData ); + + TInt UnloadWidgetFromPluginL( + CXnPluginData& aPluginData ); + + TInt ReplaceWidgetToPluginL( + CHsContentInfo& aContentInfo, + CXnPluginData& aPluginData, + TBool aUseHsps = ETrue ); + + void ActivateNextViewL(); + + void ActivatePreviousViewL(); + + TInt AddViewL( CHsContentInfo& aInfo ); + + void AddViewL(); + + TInt RemoveViewL( const CHsContentInfo& aInfo ); + + void RemoveViewL(); + + void AddObserver( const MXnViewObserver& aObserver ); + + void RemoveObserver( const MXnViewObserver& aObserver ); + + 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 ); + + TInt ViewAmount() const; + + TInt ViewIndex() const; + + CXnOomSysHandler& OomSysHandler() const; + + /** + * Get maximum pages allowed + * + * @return number of pages allowed + */ + TInt32 MaxPages(); + +private: + void NotifyContainerChangedL( CXnViewData& aViewToActivate ); + + void NotifyViewActivatedL( const CXnViewData& aViewData ); + + void NotifyViewDeactivatedL( const CXnViewData& aViewData ); + + void NotifyViewAdditionL( const CXnViewData& aViewData ); + + void NotifyViewRemovalL( const CXnViewData& aViewData ); + + void NotifyConfigureWidgetL( + const CHsContentInfo& aContentInfo, + CXnPluginData& aPluginData ); + + void NotifyWidgetAdditionL( const CXnPluginData& aPluginData ); + + void NotifyWidgetRemovalL( const CXnPluginData& aPluginData ); + + CXnViewData* ViewData( CXnNode& aNode ) const; + + CXnViewData& PreviousViewData() const; + + CXnViewData& NextViewData() const; + + void UpdateCachesL(); + + void ValidateActiveViewL(); + + void InvalidateActiveView(); + + void ReportWidgetAmountL( const CXnViewData& aViewData ); + + void ShowDiskFullMessageL() const; + +public: + void UpdatePageManagementInformationL(); + +#if 0 // MSK icon change +private: + TInt ResolveIconIndex( TInt aPageCount, TInt aPageNum ) const; +#endif // MSK icon change + +private: + // data + + /** + * AppUi adapter. + * Not own. + */ + CXnAppUiAdapter& iAppUiAdapter; + + /** + * Application uid + */ + TUid iApplicationUid; + + /** + * HSPS wrapper. + * Not own. + */ + CHspsWrapper* iHspsWrapper; + + /** + * UiEngine. + * Not own. + */ + CXnUiEngine* iUiEngine; + + /** + * Comopser. + * Own. + */ + CXnComposer* iComposer; + + /** + * Editor. + * Own. + */ + CXnEditor* iEditor; + + /** + * Application configuration root data. + * Own. + */ + CXnRootData* iRootData; + + /** + * Widget amount trigger. + * Own. + */ + CXnNode* iWidgetAmountTrigger; + + /** + * Resources for current view. + * Own. + */ + mutable CArrayPtrSeg< CXnResource >* iResources; + + /** + * Controls for current view. + * Own. + */ + mutable RPointerArray< CXnControlAdapter > iControls; + + /** + * Appearance nodes. This array needs to be updated when UI furniture + * is changed. + * Own. + */ + mutable RPointerArray< CXnNode > iAppearanceNodes; + + /** + * View observers. + * Own. + */ + RPointerArray< MXnViewObserver > iObservers; + + /** + * Failed plugins. + * Own. + */ + RPointerArray< CXnPluginData > iFailedPlugins; + + /** + * Flags + */ + TBitFlags32 iFlags; + + /** + * OOM system handler. Owned. + */ + CXnOomSysHandler* iOomSysHandler; + }; + +// Inline functions +#include "xnviewmanager.inl" + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnviewmanager.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnviewmanager.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,62 @@ +/* +* 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: +* Viewmanager inline functions +* +*/ + +#ifndef XNVIEWMANAGER_INL +#define XNVIEWMANAGER_INL + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +inline void CXnViewManager::SetUiEngine( CXnUiEngine& aUiEngine ) + { + iUiEngine = &aUiEngine; + }; + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +inline CXnUiEngine& CXnViewManager::UiEngine() const + { + return *iUiEngine; + }; + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +inline CXnComposer& CXnViewManager::Composer() const + { + return *iComposer; + }; + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +inline CXnEditor& CXnViewManager::Editor() const + { + return *iEditor; + }; + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +inline CXnAppUiAdapter& CXnViewManager::AppUiAdapter() const + { + return iAppUiAdapter; + }; + +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnviewnodeimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnviewnodeimpl.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,73 @@ +/* +* 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 of view node +* +*/ + +#ifndef XNVIEWNODEIMPL_H +#define XNVIEWNODEIMPL_H + +// System includes +#include + +// User includes +#include "xncomponentnodeimpl.h" + +// Forward declarations +class CXnType; + +// Class declaration +/** + * Implementation of view node. + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since Series 60 3.1 + */ +NONSHARABLE_CLASS( CXnViewNodeImpl ) : public CXnComponentNodeImpl + { +public: + /** + * Two-phased constructor. + * + * @param aType Type. + */ + static CXnViewNodeImpl* NewL( CXnType* aType ); + + /** + * Destructor. + */ + virtual ~CXnViewNodeImpl(); + +protected: + /** + * C++ default constructor. + */ + CXnViewNodeImpl(); + + /** + * Two-phased constructor. + * + * @param aType Type. + */ + void ConstructL( CXnType* aType ); + +private: + // Data + }; + +#endif + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnvolumecontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnvolumecontrol.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,137 @@ +/* +* 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: Wrapper class for AknVolumeControl +* +*/ + + +#ifndef _XNVOLUMECONTROL_H +#define _XNVOLUMECONTROL_H + +// INCLUDES +#include +#include "xncomponent.h" +#include "mxncomponentinterface.h" + +// FORWARD DECLARATIONS +class MXnVolumeControlObserver; + +// CLASS DECLARATION +namespace XnVolumeControlInterface +{ +_LIT8(KType, "volumecontrol"); +class MXnVolumeControlInterface : public XnComponentInterface::MXnComponentInterface + { +public: + + static inline const TDesC8& Type() + { + return KType; + } + +public: // New functions + + /** + * Commented in xnvolumecontroladapter.h + */ + virtual void SetValue( TInt aValue ) = 0; + + /** + * Commented in xnvolumecontroladapter.h + */ + virtual TInt Value() = 0; + + /** + * Commented in xnvolumecontroladapter.h + */ + virtual void SetRange( TInt aMinimumValue, TInt aMaximumValue ) = 0; + + /** + * Commented in xnvolumecontroladapter.h + */ + virtual void GetRange( TInt& aMiminumValue, TInt& aMaximumValue ) = 0; + + /** + * Commented in xnvolumecontroladapter.h + */ + virtual void SetObserver( MXnVolumeControlObserver* aObserver ) = 0; + +private: + + }; + } + +/** +* @ingroup group_xnvolumecontrolfactory +* @lib xnvolumecontrol.lib +* @since Series 60 3.2 +*/ +class CXnVolumeControl : public CXnComponent, public XnVolumeControlInterface::MXnVolumeControlInterface + { + +public: + /** + * 2 phase construction. + */ + static CXnVolumeControl* NewL(); + + /** + * Destructor. + */ + virtual ~CXnVolumeControl(); + +public: // New functions + + /** + * Commented in xnvolumecontroladapter.h + */ + void SetValue( TInt aValue ); + + /** + * Commented in xnvolumecontroladapter.h + */ + TInt Value(); + + /** + * Commented in xnvolumecontroladapter.h + */ + void SetRange( TInt aMinimumValue, TInt aMaximumValue ); + + /** + * Commented in xnvolumecontroladapter.h + */ + void GetRange( TInt& aMiminumValue, TInt& aMaximumValue ); + + /** + * Commented in xnvolumecontroladapter.h + */ + void SetObserver( MXnVolumeControlObserver* aObserver ); + +public: + + /** + * Create a component interface according to the given type. + * @param aType Type of the interface to create + * @return Created interface or NULL if the provided type is not supported. + */ + virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL(const TDesC8& aType); + +private: + CXnVolumeControl(); + void ConstructL(); + }; + +#endif // _XNVOLUMECONTROL_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/inc/xnvolumecontrolobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnvolumecontrolobserver.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,38 @@ +/* +* 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: Xuikon volume control adapter observer +* +*/ + + +#ifndef __XNVOLUMECONTROLOBSERVER_H +#define __XNVOLUMECONTROLOBSERVER_H + +/** +* @ingroup group_xnvolumecontrolfactory +* @lib xnvolumecontrol.lib +* @since Series 60 3.2 +*/ +class MXnVolumeControlObserver + { + public: // New functions + + /** + * Called when volume value is changed. + * @param aValue New volume value. + */ + virtual void VolumeChanged( TInt aValue ) = 0; + }; + +#endif // __XNVOLUMECONTROLOBSERVER_H diff -r 000000000000 -r f72a12da539e idlehomescreen/loc/activeidle3.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/loc/activeidle3.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,292 @@ +/* +* Copyright (c) 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: It is text of Active Idle 2 application in application shell grid. +// d: When user selects that item, then phone goes to idle state +// d: or call related state. +// l: cell_app_pane_t1 +// w: +// r: TB9.2 +// +#define qtn_apps_idle_grid "Idle" + +// d: It is text shown in note when SIM registration has failed. +// l: popup_note_window +// w: +// r: 3.2 +// +#define text_imsi_unknown_in_hlr "SIM registration failed" + + +// d: It is possible that user activates Idle theme which +// d: contains one or more plug-ins which can not be loaded to framework. +// l: popup_note_window +// w: +// r: 3.2 +// +#define qtn_idle_theme_error_incompatible "Problems with theme. It may not work correctly." + +// d: In case plug-in dies during operation error note is shown. +// l: popup_note_window +// w: +// r: 3.2 +// +#define qtn_idle_theme_error_notloaded "Error in theme." + +// d: Title field for stylus activated popup. +// l: heading_sub_pane_t1 +// w: +// r: 5.0 +// +#define qtn_idle_title_tapped_header "Registered network" + +// d: When user activates the link, SAT application is launched. +// d: Link label for stylus activated popup. +// l: list_single_touch_info_pane_t2/opt1 +// w: +// r: 5.0 +// +#define qtn_idle_title_tapped_link1 "Go to own SIM services" + +// d: When user activates the link, automatic network search is started. +// d: Link label for stylus activated popup. +// l: list_single_touch_info_pane_t2/opt1 +// w: +// r: 5.0 +// +#define qtn_idle_title_tapped_link2 "Search network" + +// d: When user activates the link, calendar application is launched. +// d: Link label for stylus menu popup. +// l: list_single_touch_menu_pane_t1 +// w: +// r: 5.0 +// +#define qtn_idle_navi_tapped_cale "Go to Calendar" + +// d: When user activates the link, profile application is launched. +// d: Link label for stylus menu popup. +// l: list_single_touch_menu_pane_t1 +// w: +// r: 5.0 +// +#define qtn_idle_navi_tapped_all_prof "Show all profiles" + +// d: Back text for SK2 +// l: control_pane_t1/opt7 +// w: +// r: 3.2 +// +#define text_softkey_back "Back" + +// d: New message shortcut +// l: control_pane_t1/opt7 +// w: +// r: 3.2 +// +#define qtn_idle_skey_new_msg "New msg." + +// d: New e-mail shortcut +// l: control_pane_t1/opt7 +// w: +// r: 3.2 +// +#define qtn_apps_email_skey "New mail" + +// d: New SyncML mail shortcut +// l: control_pane_t1/opt7 +// w: +// r: 3.2 +// +#define qtn_apps_syncml_mail_skey "New sync.mail" + +// d: New MMS postcard shortcut +// l: control_pane_t1/opt7 +// w: +// r: 3.2 +// +#define qtn_apps_mmspostcard_skey "New postcard" + +// d: New audio message shortcut +// l: control_pane_t1/opt7 +// w: +// r: 3.2 +// +#define qtn_apps_audio_msg_skey "New audiomsg" + +// d: Select message type shortcut +// l: control_pane_t1/opt7 +// w: +// r: 3.2 +// +#define qtn_set_idle_skey_select_msg_type "Select msg type" + +// d: Change theme shortcut +// l: control_pane_t1/opt7 +// w: +// r: 3.2 +// +#define qtn_apps_idle_skin_skey "Idle theme" + +// d: Heading of add widget dialog. +// l: list_single_pane_t1_cp2 +// w: +// r: 3.2 +// +#define qtn_hs_add_widget "Add content" + +// d: Heading of remove widget dialog. +// l: list_single_pane_t1_cp2 +// w: +// r: 3.2 +// +#define qtn_hs_remove_widget "Remove content" + +// d: Popup shown when trying to add content to full homescreen. +// l: popup_note_window +// w: +// r: 3.2 +// +#define qtn_hs_add_widget_full "Homescreen is already full, remove some content" + +// 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: Information note text which informs user that home is automatically switched to offline because user is roaming. +// l: popup_note_window +// w: +// r: TB9.2 +#define qtn_hs_automatic_offline "Select Options - Switch Home to online to reconnect while roaming outside home network." + +// d: Error note text. In case widget dies during operation, widget information is cleaned from the screen +// l: popup_note_window +// w: +// r: TB9.2 +#define qtn_hs_error_widgets_removed "Problem occurred. Widget(s) removed." + +// d: User can download new HS widgets. String visible in add content list query +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_download_new_widgets "Download" + +// d: Promt text for Add content list query +// l: heading_pane_t1 +// w: +// r: 3.2 +// +#define qtn_hs_select_widget "Select content" + +// d: Popup shown when first web widget is added OR web widget is tapped while offline +// l: popup_note_window +// w: +// r: 5.0 +// +#define qtn_hs_switch_online "Allow all Home screen widgets to access network? (You can disable/enable connection from Home screen options menu)?" + +// d: Popup shown when disabling the home screen network +// l: popup_note_window +// w: +// r: 5.0 +// +#define qtn_hs_disable_network "Would you like to disable Home screen network access for now? To re-enable select Options - Switch Home to online" + +// d: Shown when HSPS fails to personalize an active application configuration +// l: popup_note_window +// w: +// r: 5.0 +// +#define qtn_hs_operation_failed_no_disk "Operation failed. Try again later." + +// d: Edit active profile +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.1 +#define qtn_hs_profile_edit "Edit active profile" + +// d: Notifies when maximum amout of pages has been reached +// l: popup_info_list_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_max_amount_of_pages_note "Maximum amount of pages reached. Cannot create a new one." + +// d: remove widget query +// l: popup_note_window +// w: +// r: TB9.2 +#define qtn_hs_edit_remove_widget "Remove selected content?" + +// d: delete page query +// l: popup_note_window +// w: +// r: TB9.2 +#define qtn_hs_delete_page "Delete page %U?" + +// d: edit mode title +// l: title_pane_t2/opt12 +// w: +// r: TB9.2 +#define qtn_hs_title_editing "Editing" + +// d: delete current page query +// l: popup_note_window +// w: +// r: TB9.2 +#define qtn_hs_delete_current_page "Delete current page?" + +// d: Error note text. OOM failure handled +// l: popup_note_window +// w: +// r: TB9.2 +#define qtn_hs_hs_memory_full "Not enough memory to add more content. Please remove some Homescreen content and try again." + +// d: Heading of change wallpaper dialog. +// l: heading_pane_t1 +// w: +// r: TB9.2 +#define qtn_hs_title_change_wallpaper "Change wallpaper" + +// d: Change wallpaper dialog default item +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_hs_default "Default" + +// d: Change wallpaper dialog image item +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_hs_image "Image" + +// d: Change wallpaper dialog slideshow item +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_hs_slideshow "Slideshow" diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/group/ainatiui.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/group/ainatiui.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 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: +* +*/ + +#include + +#include +#include + +TARGET Ai3NatiUi.dll +TARGETTYPE PLUGIN +UID 0x10009D8D AI_UID_ECOM_DLL_UICONTROLLER_NATIVE +VENDORID VID_DEFAULT +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../src +SOURCE appui.cpp +SOURCE document.cpp +SOURCE application.cpp +SOURCE ainativeuiview.cpp +SOURCE nativeuicontroller.cpp +SOURCE ainavipanerenderer.cpp +SOURCE ainavipaneanimator.cpp +SOURCE aistatuspanel.cpp +SOURCE aititlepanerenderer.cpp +SOURCE ainativerenderer.cpp +SOURCE aidialogrenderer.cpp +SOURCE aisoftkeyrenderer.cpp +SOURCE ainativeuimodel.cpp +SOURCE aistatuspanetouchui.cpp +SOURCE aitoolbarrenderer.cpp +SOURCE aitoolbarbutton.cpp +SOURCE ainotifierrenderer.cpp + + +START RESOURCE ai3natiui.rss +TARGET Ai3NatiUi.rsc +END + +START RESOURCE ai3nativeui.rss +HEADER +TARGET AiNativeUi.rsc +TARGETPATH APP_RESOURCE_DIR +LANGUAGE_IDS +END + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY avkon.lib +LIBRARY aknskins.lib +LIBRARY apparc.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY commonengine.lib +LIBRARY efsrv.lib +LIBRARY fbscli.lib +LIBRARY aknicon.lib +LIBRARY eikdlg.lib +LIBRARY egul.lib +LIBRARY centralrepository.lib +LIBRARY cenrepnotifhandler.lib +LIBRARY aknlayout2scalable.lib +LIBRARY cdlengine.lib +LIBRARY aifw.lib +LIBRARY aiutils.lib +LIBRARY bafl.lib +LIBRARY flogger.lib +LIBRARY aiidleint.lib +LIBRARY featmgr.lib +LIBRARY profileeng.lib +LIBRARY networkhandling.lib +LIBRARY viewcli.lib +LIBRARY gdi.lib +LIBRARY aknnotify.lib + +#ifdef RD_TACTILE_FEEDBACK +LIBRARY touchfeedback.lib +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifdef RD_CUSTOMIZABLE_AI + +#include + +PRJ_PLATFORMS +DEFAULT + + +PRJ_EXPORTS + +// uncomment following line after old xuikon has been removed! +../rom/nativeuicontroller.iby CORE_APP_LAYER_IBY_EXPORT_PATH(nativeuicontroller.iby) +../rom/nativeuicontroller_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(nativeuicontroller_resources.iby) + +../loc/ainativeui.loc APP_LAYER_LOC_EXPORT_PATH(ainativeui.loc) + +#ifdef __COVER_DISPLAY +../inc/AiSecondaryDisplayApi.h APP_LAYER_PUBLIC_EXPORT_PATH(SecondaryDisplay/AiSecondaryDisplayApi.h) +#endif + +PRJ_MMPFILES +ainatiui.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + +#endif // RD_CUSTOMIZABLE_AI + diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/aidialogrenderer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/aidialogrenderer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,96 @@ +/* +* 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: Dialog renderer. +* +*/ + + +#ifndef C_AIDIALOGRENDERER_H +#define C_AIDIALOGRENDERER_H + + +#include +#include "ainativerenderer.h" + + +class CAknNoteDialog; + +namespace AiNativeUiController +{ + +/** + * Dialog renderer. + * + * Used to show CAknNoteDialog on screen. + * + * @since S60 3.2 + */ +class CAiDialogRenderer : public CAiNativeRenderer + { +public: + + static CAiDialogRenderer* NewLC(); + + virtual ~CAiDialogRenderer(); + +// from base class CAiNativeRenderer + + void DoPublishL( MAiPropertyExtension& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); + + void DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent ); + + void FocusObtainedL(); + +private: + + CAiDialogRenderer(); + + /** + * Show dialog. + * + * @since S60 3.2 + */ + void ShowDialogL(); + + +private: // data + + /** + * Dialog. + * Own. + */ + CAknNoteDialog* iDialog; + + /** + * Text to be rendered in the dialog. + * Own. + */ + HBufC* iText; + + /// Indicates SIM registration failure. + TBool iShowDialog; + +#ifdef __COVER_DISPLAY + /** + * Dialog ID to be published. + * Own. + */ + TInt iDialogId; +#endif + + }; + +} // namespace AiNativeUiController + +#endif // C_AIDIALOGRENDERER_H diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/ainativerenderer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/ainativerenderer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,257 @@ +/* +* 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: Base class for renderers in native ui controller. +* +*/ + + +#ifndef M_AINATIVERENDERER_H +#define M_AINATIVERENDERER_H + +#include +#include "aidevicestatuscontentmodel.h" +#include "aiscutcontentmodel.h" +#include "aiprofileplugincontentmodel.h" + + +class RFile; +class MAiPropertyExtension; + +namespace AiNativeUiController +{ + +/** + * Base class for renderers in native ui controller. + * + * @since S60 3.2 + */ +class CAiNativeRenderer : public CBase + { + +public: + + virtual ~CAiNativeRenderer(); + + /** + * Publish resource. + * + * @since S60 3.2 + * @param aPlugin is publishing plugin. + * @param aContent is id of the content. + * @param aResource is id of the resource. + * @param aIndex is index of the content. + * @return KErrNone if publish is successful. + */ + virtual TInt Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aResource, + TInt aIndex ); + + /** + * Publish unicode text. + * + * @since S60 3.2 + * @param aPlugin is publishing plugin. + * @param aContent is id of the content. + * @param aText is published text. + * @param aIndex is index of the content. + * @return KErrNone if publish is successful. + */ + virtual TInt Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC16& aText, + TInt aIndex ); + + /** + * Publish data. + * + * @since S60 3.2 + * @param aPlugin is publishing plugin. + * @param aContent is id of the content. + * @param aBuf is published data. + * @param aIndex is index of the content. + * @return KErrNone if publish is successful. + */ + virtual TInt Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC8& aBuf, + TInt aIndex ); + + /** + * Publish content of the file. + * + * @since S60 3.2 + * @param aPlugin is publishing plugin. + * @param aContent is id of the content. + * @param aFile is reference to opened file. + * @param aIndex is index of the content. + * @return KErrNone if publish is successful. + */ + virtual TInt Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + RFile& aFile, + TInt aIndex ); + + /** + * Clean content. + * + * @since S60 3.2 + * @param aPlugin is publishing plugin. + * @param aContent is id of the content. + * @param aIndex is index of the content. + * @return KErrNone if cleaning works. + */ + virtual TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent ); + + /** + * Renderer must implement this method if it needs to support resource publishing. + * + * Default implementation leaves with KErrNotFound. + * + * @since S60 3.2 + * @param aPlugin is publishing plugin. + * @param aContent is id of the content. + * @param aResource is id of the resource. + * @param aIndex is index of the content. + */ + virtual void DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aResource, + TInt aIndex ); + + /** + * Renderer must implement this method if it needs to support unicode text publishing. + * + * Default implementation leaves with KErrNotFound. + * + * @since S60 3.2 + * @param aPlugin is publishing plugin. + * @param aContent is id of the content. + * @param aText is published text. + * @param aIndex is index of the content. + */ + virtual void DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC16& aText, + TInt aIndex ); + + /** + * Renderer must implement this method if it needs to support data publishing. + * + * Default implementation leaves with KErrNotFound. + * + * @since S60 3.2 + * @param aPlugin is publishing plugin. + * @param aContent is id of the content. + * @param aBuf is published data. + * @param aIndex is index of the content. + */ + virtual void DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC8& aBuf, + TInt aIndex ); + + /** + * Renderer must implement this method if it needs to support file publishing. + * + * Default implementation leaves with KErrNotFound. + * + * @since S60 3.2 + * @param aPlugin is publishing plugin. + * @param aContent is id of the content. + * @param aFile is reference to file client. + * @param aIndex is index of the content. + */ + virtual void DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + RFile& aFile, + TInt aIndex ); + + /** + * Renderer must implement this method if it needs to support content cleaning. + * + * Default implementation leaves with KErrNotFound. + * + * @since S60 3.2 + * @param aPlugin is publishing plugin. + * @param aContent is id of the content. + */ + virtual void DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent ); + + /** + * Called when UI switches to foreground. + */ + virtual void FocusObtainedL() { }; + + /** + * Called when UI switches to background. + */ + virtual void FocusLostL() { }; + + /** + * Called when transaction is committed. + */ + virtual void TransactionCommittedL() { }; + + /** + * Called when keylock state is enabled. + */ + virtual void KeylockEnabledL() { }; + + /** + * Called when keylock state is disabled. + */ + virtual void KeylockDisabledL() { }; + + /** + * LoadUIDefinitionL + */ + virtual void LoadUIDefinitionL() { }; + +protected: + + /** + * Get integer content id using textual id. + * + * @since S60 3.2 + * @param aCid is textual content id. + * @return content id. + */ + TInt GetIntContentId( const TDesC& aCid ) const; + + /** + * Does mime type check. + * + * @since S60 3.2 + * @param aContentId is content id. + * @param aMimeType is mime type. + * @return ETrue if match is successful. + */ + TBool MatchMimeType( MAiPropertyExtension& aPlugin, TInt aContentId, const TDesC8& aMimeType ) const; + + + /** + * Does mime type check. + * + * @since S60 3.2 + * @param aPlugin is publishing plugin. + * @param aContentId is id of the content. + */ + void DoMimeTypeCheckL( MAiPropertyExtension& aPlugin, TInt aContentId ); + + }; + +} // namespace AiNativeUiController + +#endif // M_AINATIVERENDERER_H diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/ainativeui.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/ainativeui.hrh Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,57 @@ +/* +* 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: This file contains declarations for resources of Native UI Controller. +* The file can be included in C++ or resource file. +* +*/ + + +#ifndef AINATIVEUI_HRH +#define AINATIVEUI_HRH + +// CONSTANTS +#define KNativeUiCmdBase 1000 + +#define KNativeUiKeyIdLSK 0x01000100 + +#define KNativeUiKeyIdRSK 0x01000101 + +#define KNativeUiKeyIdLockedLSK 0x41000100 + +#define KNativeUiKeyIdLockedRSK 0x41000101 + +// DATA TYPES + +// Enumerates commands +enum + { + ENativeUiCmdDoNothing = 100 + KNativeUiCmdBase, //1100 + ENativeUiCmdBack, + + ENativeUiSoftkeyLeft, + ENativeUiSoftkeyRight, + + ENativeUiSelectionKey, + ENativeUiScrollkeyLeft, + ENativeUiScrollkeyUp, + ENativeUiScrollkeyRight, + ENativeUiScrollkeyDown, + + // Name dialing + ENativeUiCmdNameDialer + }; + +#endif // AINATIVEUI_HRH + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/ainativeuimodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/ainativeuimodel.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,103 @@ +/* +* 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: Common NativeUi definitions and utilities +* +*/ + + +#ifndef AINATIVEUIMODEL_H +#define AINATIVEUIMODEL_H + + +#include + +namespace AiNativeUiController +{ + +/** + * Common NativeUi definitions and utilities + * + * @since S60 3.2 + */ + +namespace AiNativeUiModel +{ + /// Internal identifier for navi pane + _LIT8( KNaviPaneId, "navipane" ); + + /// Constant for unassigned rendering priority value + const TInt KNoPriority = KErrNotFound; + + struct TRenderingPriorityItem; + +/** + * UI Control rendering priorities object. + */ +class TRenderingPriorities + { +public: + + /** + * Constructor for publishable items that need to be priorized. + * @param aRenderingPriorities Array of priorized items + * @aCount Number of items in the array + */ + TRenderingPriorities(const TRenderingPriorityItem* aRenderingPriorities, TInt aCount); + + /** + * Returns rendering priority for given ContentId. + */ + TInt RenderingPriority( TInt aContentId ); + + /** + * Gets next content id with priority < aNextPriority. + * + * @param[in,out] aContentId Next content id with priority < aNextPriority. + * @param[in,out] aNextPriority On entry the priority is used to search the + * item content with next lowest priority. On exit + * the parameter's value is the rendering priority + * of aContentId. + * @return true if next content item was found, false if out of + * content items with lower priority than aNextPriority. + * Out parameters are updated only if this function returns true. + */ + TBool GetNextContentId( TInt& aContentId, TInt& aNextPriority ); + +private: // Data + + /** + * An array that holds rendering priority related items. + */ + const TRenderingPriorityItem* iRenderingPriorities; + + /** + * Number of items in the array. + */ + TInt iCount; + + }; + +/** + * Returns rendering priorities for ui control. + * + * @param aUiElementId UI control identifier. + * @return UI control priorities object. + */ +TRenderingPriorities RenderingPriorities( const TDesC8& aUiElementId ); + +} // namespace AiNativeUiModel + +} // namespace AiNativeUiController + +#endif // AINATIVEUIMODEL_H diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/ainativeuistrings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/ainativeuistrings.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,34 @@ +/* +* 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: Native Ui's content publisher plug-ins. +* +*/ + + +#ifndef AINATIVEUISTRINGS_H +#define AINATIVEUISTRINGS_H + +_LIT( KAiLskLaunchByIndex, "Shortcut/LaunchByIndex(0x01000100)"); +_LIT( KAiRskLaunchByIndex, "Shortcut/LaunchByIndex(0x01000101)"); +_LIT( KAiLskLaunchByIndexLocked, "Shortcut/LaunchByIndex(0x41000100)"); +_LIT( KAiRskLaunchByIndexLocked, "Shortcut/LaunchByIndex(0x41000101)"); + +_LIT( KAiRskLaunchVoiceDial, "Shortcut/LaunchByValue(localapp:0x101F8543)"); + +_LIT( KAiLocalApp, "localapp:0x" ); + +_LIT( KAiLocalAppAppShell, "localapp:0x101F4CD2" ); +_LIT( KAiLocalAppContacts, "localapp:0x101F4CCE" ); + +#endif // AINATIVEUIPLUGINS_H diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/ainativeuiview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/ainativeuiview.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,104 @@ +/* +* 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: Native ui controller main view +* +*/ + + +#ifndef CAINATIVEUIVIEW_H +#define CAINATIVEUIVIEW_H + +#include +#include +namespace AiNativeUiController +{ + +/** +* It is the main view of the Idle. It consists of a single component +* control. +* +* @sinces S60 3.2 +*/ +class CAiNativeUiView + : public CCoeControl, + public MCoeView + { + +public: // Constructors and destructor + + static CAiNativeUiView* NewL( + const TRect& aRect, + CAppUi* aAppUi ); + + ~CAiNativeUiView(); + +// From base class + + void SizeChanged(); + + TInt CountComponentControls() const; + + CCoeControl* ComponentControl( TInt aIndex ) const; + + TKeyResponse OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ); + + void SetControl( CCoeControl* aControl ); + +protected: + +// from base classes + + void Draw( const TRect& aRect ) const; + +// from MCoeView + + TVwsViewId ViewId() const; + + void ViewActivatedL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + void ViewDeactivated(); + +private: + + +// Construction + + CAiNativeUiView( CAppUi* aAppUi ); + + void ConstructL( const TRect& aRect ); + +private: // Data + + /** + * Pointer to our app ui. + * Not owned. + */ + CAppUi* iAppUi; + + /** + * View control. Not own. + */ + CCoeControl* iControl; + + }; + +} // AiNativeUiController + +#endif // CAINATIVEUIVIEW_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/ainavipaneanimator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/ainavipaneanimator.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Navi pane animator. +* +*/ + + +#ifndef C_AINAVIPANEANIMATOR_H +#define C_AINAVIPANEANIMATOR_H + +#include +#include "ainativeuimodel.h" + +namespace AiNativeUiController +{ + +class CAiStatusPanel; +class MAiNaviPaneAnimatorCallback; + +/** + * Navi pane animator. + * + * This class handles the navi pane animation when XML Idle gets the focus. + * It owns an array that is used for storing all data that is shown in form of + * soft indicators. It animates all items in the array in one second intervals. + * + * @since S60 3.2 + */ +class CAiNaviPaneAnimator : public CBase + { + +public: + + static CAiNaviPaneAnimator* NewL( CAiStatusPanel& aStatusPane, + AiNativeUiModel::TRenderingPriorities& aPriorities, + MAiNaviPaneAnimatorCallback& aCallback ); + + virtual ~CAiNaviPaneAnimator(); + + /** + * Adds content item to the animator array. + * @param aContentId Content item which value needs to be updated. + If item with same aContentId already exists in + the array, it's value is updated. If not, new + item is created. + * @param aText New value for aContentId. + */ + void AddItemL( TInt aContentId, const TDesC16& aText ); + + /** + * Removes content item with given content id. + * @param aContentId Content item which needs to be removed. + */ + void RemoveItem( TInt aContentId ); + + /** + * Animates the content of the array. + */ + void AnimateL(); + + /** + * Cancels ongoing animation (if there is one). + */ + void CancelAnimationL(); + + /** + * Called by CPeriodic when timer expires. + */ + static TInt CAiNaviPaneAnimator::AnimCallback( TAny* aPtr ); + + /** + * Draws the text to navi pane. + * This method is called by timer. It checks if there still are items left + * in the animation array. If yes, it draws the current item's value. + * If not,it cancels the timer. + */ + TBool DrawTextL(); + + /** + * Sorts iAnimArray in priority order defined by TRenderingPriorities. + */ + void SortAnimArrayL(); + + /** + * Is ongoing animation + */ + TBool IsActive(); + + +private: + + CAiNaviPaneAnimator( CAiStatusPanel& aStatusPane, + AiNativeUiModel::TRenderingPriorities& aPriorities, + MAiNaviPaneAnimatorCallback& aCallback ); + + void ConstructL(); + + /** + * Helper class for animation array items. + * Can be defined as an inner class since not used outside parent class. + */ + class CAiNameValuePair : public CBase + { + public: + + static CAiNameValuePair* NewLC( const TInt aName, + const TDesC& aValue ); + + ~CAiNameValuePair(); + + TInt Name() const; + + const TDesC16& Value() const; + + void SetValueL( const TDesC& aValue ); + + private: + + void ConstructL( const TInt aName, const TDesC& aValue ); + + private: // data + + /// Name of the item in name/value pair + TInt iName; + + /// Value or the item in name/value pair + HBufC* iValue; + }; + + +private: // data + + /** + * Used for doing the animation. + * Own. + */ + CPeriodic* iPeriodic; + + /// Status pane handler. + CAiStatusPanel& iStatusPane; + + /// Navi pane rendering priorities + AiNativeUiModel::TRenderingPriorities& iPriorities; + + /// Reference for informing about completed animation. + MAiNaviPaneAnimatorCallback& iCallback; + + /// Array for holding data to be animated. + RPointerArray iAnimArray; + + /// Currently ongoing iteration of the animator array. + TInt iCurrentItem; + + }; + +} // namespace AiNativeUiController + +#endif // C_AINAVIPANEANIMATOR_H diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/ainavipaneanimatorcallback.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/ainavipaneanimatorcallback.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for navi pane animator callback. +* +*/ + + +#ifndef M_AINAVIPANEANIMATORCALLBACK_H +#define M_AINAVIPANEANIMATORCALLBACK_H + +#include + +namespace AiNativeUiController +{ + + +/** + * Base class for navi pane animator callback. + * + * @since S60 3.2 + */ +class MAiNaviPaneAnimatorCallback + { + + public: + + /** + * Animation completed. + * This method is called when navi pane animation is complete. + * + * @since S60 3.2 + */ + virtual void AnimationCompleteL() = 0; + + + protected: + + /** + * Protected destructor prevents deletion through this interface. + */ + MAiNaviPaneAnimatorCallback() {}; + + }; + +} // namespace AiNativeUiController + +#endif // M_AINAVIPANEANIMATORCALLBACK_H diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/ainavipanerenderer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/ainavipanerenderer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,133 @@ +/* +* 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: Navipane renderer. +* +*/ + + +#ifndef C_AINAVIPANERENDERER_H +#define C_AINAVIPANERENDERER_H + + +#include +#include "ainativerenderer.h" +#include "ainavipaneanimatorcallback.h" +#include "ainativeuimodel.h" + +namespace AiNativeUiController +{ + +class CAiStatusPanel; +class CAiNaviPaneAnimator; + + +/** + * Navipane renderer. + * + * Used to render text on navipane. + * + * @since S60 3.2 + */ +// inheritance order must be this, despite codescanner warnings +class CAiNaviPaneRenderer : public MAiNaviPaneAnimatorCallback, + public CAiNativeRenderer + + { +public: + + static CAiNaviPaneRenderer* NewLC( CAiStatusPanel& aStatusPanel ); + + virtual ~CAiNaviPaneRenderer(); + +// from base class CAiNativeRenderer + + void DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC16& aText, + TInt aIndex ); + + void DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent ); + + void FocusObtainedL(); + + void FocusLostL(); + + void KeylockDisabledL(); + + void KeylockEnabledL(); + + void TransactionCommittedL(); + +// from base class MAiNaviPaneAnimatorCallback + + void AnimationCompleteL(); + +private: + + CAiNaviPaneRenderer( CAiStatusPanel& aStatusPanel ); + + void ConstructL(); + + HBufC* ConstructProfileTextLC(); + + +private: // data + + /// Status pane handler. + CAiStatusPanel& iStatusPanel; + + /// Navi pane animator. Own. + CAiNaviPaneAnimator* iAnimator; + + /// Navi pane rendering priorities + AiNativeUiModel::TRenderingPriorities iRenderingPriorities; + + /// Profile name or date. + HBufC* iProfileText; + + /// Silent Indicator + HBufC* iSilentIndicator; + + /// Timed profile indicator + HBufC* iTimedProfileIndicator; + + /// Id of current content in this UI control. + TInt iCurrentContent; + + /// Rendering priority of current content in this UI control. + TInt iCurrentPriority; + + /// ETrue if we got the focus. + TBool iFocusObtained; + + /// ETrue is transaction was committed. + TBool iCommitted; + + /// ETrue is new content was published. + TBool iIsChanged; + + /// ETrue is last content was changed. + TBool iIsOldTextChanged; + + /// ETrue is new content was silent. + TBool iIsSilent; + + /// ETtrue if new content was timed profile + TBool iIsTimed; + + }; + +} // namespace AiNativeUiController + +#endif // C_AINAVIPANERENDERER_H diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/ainotifierrenderer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/ainotifierrenderer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,88 @@ +/* +* 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: Soft notifier renderer. +* +*/ + + +#ifndef C_AISOFTNOTIFERRENDERER_H +#define C_AISOFTNOTIFERRENDERER_H + + +#include +#include "ainativerenderer.h" +#include + +class CAknSoftNotifier; + +namespace AiNativeUiController +{ + +/** + * Dialog renderer. + * + * Used to show CAknSoftNotifier on screen. + * + * @since S60 3.2 + */ +class CAiNotifierRenderer : public CAiNativeRenderer + { +public: + + static CAiNotifierRenderer* NewLC(); + + virtual ~CAiNotifierRenderer(); + +// from base class CAiNativeRenderer + + void DoPublishL( MAiPropertyExtension& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); + + void DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent ); + +private: + + /** + * Add a notification + */ + void AddNotification( TAknSoftNotificationType aType ); + + /** + * Remove a notification + */ + void RemoveNotification( TAknSoftNotificationType aType ); + + void ConstructL(); + + static TInt NWLostDelayCallBack(TAny* aParam); + + CAiNotifierRenderer(); + +private: // data + + /** + * Notifier service + * Own + */ + CAknSoftNotifier* iSoftNotifier; + + /** + * Timer to delay the showing of the notification if needed + * Own + */ + CPeriodic *iTimer; + }; + +} // namespace AiNativeUiController + +#endif // C_AISOFTNOTIFERRENDERER_H diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/aisecondarydisplayapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/aisecondarydisplayapi.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains note definitions for Cover UI sync +* +*/ + + +#ifndef AISECONDARYDISPLAYAPI_HRH +#define AISECONDARYDISPLAYAPI_HRH + +// CONSTANTS +const TUid KAICategory = { 0x102750F3 }; + +// DATA TYPES + +// Enumerates dialogs +enum TAiDialogIndex + { + EAiNoNote = 0, + EAiSimRegistrationFailed + }; + +#endif // AISECONDARYDISPLAYAPI_HRH + +// End of File + diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/aisoftkeyrenderer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/aisoftkeyrenderer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,99 @@ +/* +* 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: Handles publishing to title pane. +* +*/ + + +#ifndef C_AISOFTKEYRENDERER_H +#define C_AISOFTKEYRENDERER_H + + +#include +#include //ECoeStackPriorityDefault +#include "ainativerenderer.h" +#include "ainativeuimodel.h" + + +namespace AiNativeUiController +{ +// CONSTANTS +// VIEW IDENTIFIERS; VALUES MUST BE UNIQUE! + +// PRIORITIES FOR SOFTKEYS + +// Offset +const TInt KNativeUiCbaPriorityOffset = 5; + +// Real priority. +const TInt KNativeUiCbaPriority = ECoeStackPriorityDefault + + KNativeUiCbaPriorityOffset; + +/** + * Soft Key renderer. + * + * This class is used to handle publishing to Soft Key labels. + * Published data can be either text or resource. + * + * @since S60 3.2 + */ +class CAiSoftKeyRenderer : public CAiNativeRenderer + { +public: + + static CAiSoftKeyRenderer* NewLC(); + + virtual ~CAiSoftKeyRenderer(); + +// from base class CAiNativeRenderer + + void DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC16& aText, + TInt aIndex ); + void DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aResource, + TInt aIndex ); + void DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC8& aBuf, + TInt aIndex ); + +private: + + CAiSoftKeyRenderer(); + + void ConstructL(); + + void CreateDefaultSoftKeysL(); + + void UpdateSoftKeyL( TInt aKey, CGulIcon* aIcon ); + +private: // data + + // Softkeys. + CEikButtonGroupContainer* iCba; + + // Pointer to App UI. + CAknAppUi* iAppUi; + + // Soft Key label. Own. + HBufC* iText; + + }; + +} // namespace AiNativeUiController + +#endif // C_AISOFTKEYRENDERER_H diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/aistatuspanel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/aistatuspanel.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,212 @@ +/* +* 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: Handles of drawing text on navi and title panes. +* +*/ + + +#ifndef C_AISTATUSPANEL_H +#define C_AISTATUSPANEL_H + + +#include +#include + +class CEikStatusPane; +class CAknTitlePane; +class CAknNavigationControlContainer; +class CAknNavigationDecorator; +class MAknNaviDecoratorObserver; +class MAknTitlePaneObserver; + +namespace AiNativeUiController +{ + +/** + * This class is used to draw text on navi and title pane. + * And to draw bitmap on title pane. + * + * @since S60 3.2 + */ +class CAiStatusPanel : public CBase + { +public: + + static CAiStatusPanel* NewL(); + + virtual ~CAiStatusPanel(); + + /** + * Get size for oplogo based on titlepane layout + * @param aSize Operator logo size. + * @return Error code. + */ + TInt GetTitlePaneSize( TSize& aSize ); + + /** + * Updates operator indicator of phone application. + * @param aDisplayInfo display info of operator indicator. + */ + void UpdatePhoneDisplayInfo( const TTelTitleDisplay& aDisplayInfo ); + + /** + * Store text for navi pane. + * Navi pane is not rendered until RenderNaviPaneL is called. + * + * @param aText Text for navi pane. + */ + void SetNaviPaneTextL( const TDesC& aText ); + + /** + * Store text for title pane. + * Title pane is not rendered until RenderTitlePaneL is called. + * + * @param aText Text for title pane. + */ + void SetTitlePaneTextL( const TDesC& aText ); + + /** + * Store bitmap that is later set to title pane. + * Title pane is not rendered until RenderTitlePaneL is called. + * + * @param aBitmapHandle Handle for bitmap. + * @param aMaskHandle Handle for mask. + */ + void SetTitlePaneBitmapL( TInt aBitmapHandle, TInt aMaskHandle ); + + /** + * Draw stored data to navi pane. + */ + void RenderNaviPaneL(); + + /** + * Draw stored data to title pane. + */ + void RenderTitlePaneL(); + + /** + * Stop titlepane text scrolling. + */ + void StopTitlePaneScrollingL(); + + /** + * Resume titlepane text scrolling + */ + void ScrollTitlePaneTextL(); + + /** + * Set navi decorator observer + * @param aObserver navi decorator observer + */ + void SetNaviDecoratorObserver( MAknNaviDecoratorObserver* aObserver ); + + /** + * Set title pane observer + * @param aObserver title pane observer + */ + void SetTitlePaneObserver( MAknTitlePaneObserver* aObserver ); + + /** + * Check keylock status + */ + TBool IsKeyLockEnabled(); + + +private: + + CAiStatusPanel(); + + void ConstructL(); + + /** + * Triggers text rendering on Navi pane + */ + void RenderTextOnNaviPaneL(); + + /** + * Triggers text rendering on Title pane + */ + void RenderTextOnTitlePaneL(); + + /** + * Triggers image rendering on Title pane + */ + void RenderBitmapOnTitlePaneL(); + + + +private: // data + + /** + * Pointer to status pane. + * Not own. + */ + CEikStatusPane* iStatusPane; + + /** + * Pointer to title pane. + * Not own. + */ + CAknTitlePane* iTitlePane; + + /** + * Pointer to navi pane. + * Not own. + */ + CAknNavigationControlContainer* iNaviPane; + + /** + * Pointer to navi decorator. + * Own. + */ + CAknNavigationDecorator* iNaviDecorator; + + /** + * Telephony display information. + * Not own. + */ + TTelTitleDisplay iDisplayInfo; + + /** + * Text that is written to navi pane. + * Own. + */ + HBufC* iNaviPaneText; + + /** + * Text that is written to title pane. + * Own if text is not rendered. See iTitlePaneTextTransferred member. + */ + HBufC* iTitlePaneText; + + /** + * Bitmap handle for setting image to title pane. + */ + TInt iBitmapHandle; + + /** + * Mask handle for setting image to title pane. + */ + TInt iMaskHandle; + + /** + * + */ + MAknNaviDecoratorObserver* iNaviDecoratorObserver; + + }; + +} // namespace AiNativeUiController + +#endif // C_AISTATUSPANEL_H diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/aistatuspanetouchui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/aistatuspanetouchui.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,114 @@ +/* +* 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: Status pane touch ui +* +*/ + + +#ifndef C_AISTATUSPANETOUCHUI_H +#define C_AISTATUSPANETOUCHUI_H + +#include +#include +#include +#include +#include + +#include "ainativerenderer.h" + +class MAiFwEventHandler; + +class CAknStylusPopUpMenu; + +namespace AiNativeUiController +{ + +// Stylus activated popup command ids +enum TLinkCommandID + { + EAIGotoCalendarCmdLink = 1, + EAIShowAllProfileCmdLink, + EAIProfileCmdLink + }; + + +class CAiStatusPanel; + +class CAiStatusPaneTouchUi : public CAiNativeRenderer, + public MAknNaviDecoratorObserver, + public MEikMenuObserver + { + +public: + +// Construction and destructor + + static CAiStatusPaneTouchUi* NewL( CAiStatusPanel& aStatusPanel, + MAiFwEventHandler& aEventHandler); + + static CAiStatusPaneTouchUi* NewLC( CAiStatusPanel& aStatusPanel, + MAiFwEventHandler& aEventHandler ); + + ~CAiStatusPaneTouchUi(); + +// from MAknTitlePaneObserver + + void HandleTitlePaneEventL( TInt aEventID ); + +// from MAknNaviDecoratorObserver + + void HandleNaviDecoratorEventL( TInt aEventID ); + +// from base class CAiNativeRenderer + + void DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC16& aText, + TInt aIndex ); + + void LoadUIDefinitionL(); + +// from MEikCommandObserver + + void ProcessCommandL( TInt aCommandId ); + + void SetEmphasis( CCoeControl* aMenuControl, TBool aEmphasis ); + +private: + // Construction + + CAiStatusPaneTouchUi( CAiStatusPanel& aStatusPanel, MAiFwEventHandler& aEventHandler ); + void ConstructL(); + +private: //data + + /// Status pane handler. + CAiStatusPanel& iStatusPane; + + /// Profile name pointer array + RPointerArray iProfileNamePointerArray; + + /// AIFW event handler + MAiFwEventHandler& iEventHandler; + + ///Event buffer. + HBufC* iEventBuffer; + + ///Stulys popup menu + CAknStylusPopUpMenu* iMenu; + }; + +} // namespace AiNativeUiController + +#endif //C_AISTATUSPANETOUCHUI_H \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/aistyluspopupmenu.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/aistyluspopupmenu.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,198 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface for controlling stylus specific popup menu. +* +*/ + + +#ifndef CAKNSTYLUSPOPUPMENU_H +#define CAKNSTYLUSPOPUPMENU_H + + +#include +#include + +class CAknPreviewPopUpController; +class CAiStylusPopUpMenuContent; +class MEikMenuObserver; + +/** + * Stylus specific popup menu + * + * A floating popup menu which is meant for stylus usage only. + * The menu appears near to the tapping position. When an item is + * tapped the menu calls its observer's (iMenuObserver) HandleCommandL. + * Typically the observer is application's AppUi. It is then the + * observer's responsibility to handle the command appropriately. + * + * @lib eikcoctl.lib + * @since S60 v4.0 + */ +NONSHARABLE_CLASS( CAiStylusPopUpMenu ) : public CBase, + public MCoeControlObserver + { +public: + + /** + * Two-phased constructor + * + * @param aObserver Menu observer (not owned) that handles + * stylus popup events. + * @param aPoint The position where stylus was tapped + * @param aPopup Preview popup from which stylus popup + * menu was launched, can be NULL. + */ + static CAiStylusPopUpMenu* NewL( MEikMenuObserver* aObserver, + const TPoint& aPoint, + CAknPreviewPopUpController* aPopup ); + + /** + * Two-phased constructor + * + * @param aObserver Menu observer (not owned) that handles + * stylus popup events. + * @param aPoint The position where stylus was tapped + */ + static CAiStylusPopUpMenu* NewL( MEikMenuObserver* aObserver, + const TPoint& aPoint ); + + /** + * Two-phased constructor + * + * @param aObserver Menu observer (not owned) that handles + * stylus popup events. + * @param aPoint The position where stylus was tapped + * @param aPopup Preview popup from which stylus popup + * menu was launched, can be NULL. + */ + static CAiStylusPopUpMenu* NewLC( MEikMenuObserver* aObserver, + const TPoint& aPoint, + CAknPreviewPopUpController* aPopup ); + + ~CAiStylusPopUpMenu(); + + /** + * Adds a menu item. If the menu contains maximum amount of + * items, the function will do nothing. Inserted item will be + * placed last. + * + * @param aItem The menu item to be added. + * @param aCommandId Item's command id. + */ + void AddMenuItemL( const TDesC& aItem, const TInt aCommandId ); + + /** + * Removes a menu item. + * + * @param aCommandId Command id of the item to be removed. + */ + void RemoveMenuItem( const TInt aCommandId ); + + /** + * Hides / shows a menu item. + * + * @param aCommandId Command id of the item to be hidden / shown. + * @param aDimmed ETrue to hide item and EFalse to show item + */ + void SetItemDimmed( const TInt aCommandId, const TBool aDimmed ); + + /** + * Shows the stylus popup menu. If it's already visible, + * nothing happens. + */ + void ShowMenu(); + + /** + * Sets the position of the stylus popup menu. + * Position will be adjusted if the menu doesn't fit on the screen + * properly. + * + * @param aPoint Position of the stylus popup menu's top-left corner. + */ + void SetPosition( const TPoint& aPoint ); + +// from base class CCoeControl + + /** + * Constructs the menu from resource. + * + * @param aReader Resource reader. + */ + void ConstructFromResourceL( TResourceReader& aReader ); + +// from base class MCoeControlObserver + + /** + * Method to handle events that occur when user selects a menu item. + * + * @param aControl The control that sent the event. + * @param aEventType The event type. + */ + void HandleControlEventL( CCoeControl* aControl, + TCoeEvent aEventType ); + +private: + + /** + * Default constructor + * + * @param aObserver Menu observer (not owned) that handles + * stylus popup events. + * @param aPoint The position where stylus was tapped + * @param aPopup Preview popup from which stylus popup + * menu was launched, can be NULL. + */ + CAiStylusPopUpMenu( MEikMenuObserver* aObserver, const TPoint& aPoint, + CAknPreviewPopUpController* aPopup ); + + void ConstructL(); + +private: // data + + /** + * Screen relative position where stylus was tapped. + */ + TPoint iPosition; + + /** + * Controller for the actual popup. + * Own. + */ + CAknPreviewPopUpController* iController; + + /** + * Popup's content. + * Own. + */ + CAiStylusPopUpMenuContent* iContent; + + /** + * Observer which will be used to forward selected menu command id. + * Not own. + */ + MEikMenuObserver* iMenuObserver; + + /** + * Preview popup which launches stylus popup menu. + * If NULL, menu wasn't launched from a preview popup. + * If not NULL, stylus popup menu will close also the preview popup + * when an option is selected in the stylus popup menu. + * Not own. + */ + CAknPreviewPopUpController* iPreviewPopup; + + }; + + +#endif // CAKNSTYLUSPOPUPMENU_H diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/aistyluspopupmenucontent.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/aistyluspopupmenucontent.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Content that is shown inside a stylus popup menu. +* +*/ + + +#ifndef CAKNSTYLUSPOPUPMENUCONTENT_H +#define CAKNSTYLUSPOPUPMENUCONTENT_H + +#include + +class CAknButton; + +const TInt KAiStylusMenuMaxItems = 10; + +/** + * Class providing content for the stylus popup menu. + * + * @lib eikcoctl.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CAiStylusPopUpMenuContent ) : public CCoeControl + { +public: + + static CAiStylusPopUpMenuContent* NewL(); + + static CAiStylusPopUpMenuContent* NewLC(); + + ~CAiStylusPopUpMenuContent(); + + /** + * Adds a new menu item. + * + * @param aItem Menu item to be added. + * @param aCommandId Command ID of the menu item. + * @param aObserver Item's observer. + */ + void AddMenuItemL( const TDesC& aItem, const TInt aCommandId, + MCoeControlObserver& aObserver ); + + /** + * Removes a menu item. + * + * @param aIndex Index of the menu item. + */ + void RemoveMenuItem( const TInt aIndex ); + + /** + * Hides / shows a menu item. + * + * @param aIndex Index of the menu item. + * @param aDimmed ETrue to hide and EFalse to show + */ + void SetItemDimmed( const TInt aIndex, const TBool aDimmed ); + + /** + * Method to get a command id of the specified menu item. + * + * @param aControl The menu item. + * @return Command id. + */ + TInt CommandId( CCoeControl* aControl ) const; + +// from base class CCoeControl + + /** + * Returns the minimum size of the control. + * + * @return Minimum size. + */ + TSize MinimumSize(); + + /** + * Returns the number of component controls. + * + * @return Number of component controls. + */ + TInt CountComponentControls() const; + + /** + * Returns the specified component control. + * + * @return The specified control. + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * Handles changes to the control's resources. + * + * @aParam aType Type of resource change. + */ + void HandleResourceChange( TInt aType ); + +private: + + CAiStylusPopUpMenuContent(); + + void ConstructL(); + +// from base class CCoeControl + + void SizeChanged(); + +private: // data + + /** + * Array which holds pointers to menu items. Menu item's command id + * is stored in iCommands array with the same index value . + */ + RPointerArray iItems; + + /** + * Array which holds menu items' command IDs. + */ + RArray iCommands; + + /** + * Array which holds menu items' visibility + */ + TInt iVisibility[KAiStylusMenuMaxItems]; + + }; + +#endif // CAKNSTYLUSPOPUPMENUCONTENT_H diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/aititlepanerenderer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/aititlepanerenderer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,97 @@ +/* +* 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: Handles publishing to title pane. +* +*/ + + +#ifndef C_AITITLEPANERENDERER_H +#define C_AITITLEPANERENDERER_H + + +#include +#include "ainativerenderer.h" +#include "ainativeuimodel.h" + +namespace AiUtility + { + class CContentPriorityMap; + } + +namespace AiNativeUiController +{ + +class CAiStatusPanel; + + +/** + * Title pane renderer. + * + * This class is used to handle publishing to title pane. + * Published data can be either logo or text. + * + * @since S60 3.2 + */ +class CAiTitlePaneRenderer : public CAiNativeRenderer + { +public: + + static CAiTitlePaneRenderer* NewLC( CAiStatusPanel& aStatusPanel ); + + virtual ~CAiTitlePaneRenderer(); + +// from base class CAiNativeRenderer + + void DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC16& aText, + TInt aIndex ); + + void DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC8& aBuf, + TInt aIndex ); + + void DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aResource, + TInt aIndex ); + + void DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent ); + + void TransactionCommittedL(); + + void FocusObtainedL(); + + void FocusLostL(); + + void KeylockEnabledL(); + +private: + + CAiTitlePaneRenderer( CAiStatusPanel& aStatusPanel ); + + void ConstructL(); + + + +private: // data + + /// Status pane handler. + CAiStatusPanel& iStatusPanel; + }; + +} // namespace AiNativeUiController + +#endif // C_AITITLEPANERENDERER_H diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/aitoolbarbutton.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/aitoolbarbutton.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,123 @@ +/* +* 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: Touch Toolbar button +* +*/ + + +#ifndef C_AITOOLBARBUTTON_H +#define C_AITOOLBARBUTTON_H + +#include +class CGulIcon; +class CAknButton; + +namespace AiNativeUiController +{ + +class CAiToolbarButton : public CBase + { + public: // constructors + + virtual ~CAiToolbarButton(); + + static CAiToolbarButton* NewL(); + + /** + * Returns a button constructed using + * the information available to button + * Ownership transferred + */ + CAknButton* ButtonL(); + + /** + * Returns the shortcut id + */ + TInt ShortcutId(); + + /** + * Set the shortcut id + */ + void SetShortcutId( TInt aId ); + + + /** + * Return the tooltip + */ + TDesC& Tooltip(); + + CGulIcon* Icon( TBool aTransferOwnership = EFalse ); + + /** + * Sets tooltip. Creates own copy of the descriptor + */ + void SetTooltipL(const TDesC& aTooltip); + + /** + * Sets icon. Ownership moved if aTransferOwnership is set + * + * @param aIcon The actual icon + * @param aTransferOwnership ETrue in case we take ownership, EFalse + * if caller wants to keep the ownership + */ + void SetIcon( CGulIcon *aIcon, TBool aTransferOwnership = EFalse ); + + /** + * Sets the icon ownership to us or to the caller + * + * @param aValue ETrue if ownership moved to us. + * EFalse if caller wishes to keep it + */ + void SetIconExternallyOwned( TBool aValue ); + + + private: + + + CAiToolbarButton(); + + void ConstructL(); + + private: + //Data + + /** + * Own shortcut id + */ + TInt iShortcutId; + /** + * Is icon externally ow internally owned + */ + TBool iIconNotOwned; + + /** + * The icon. Depending on the flag above, owned or not + */ + CGulIcon *iIcon; + + /** + * Owned + */ + HBufC *iTooltip; + + + + + }; + +} // namespace AiNativeUiController + +#endif //C_AITOOLBARBUTTON_H + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/aitoolbarrenderer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/aitoolbarrenderer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,123 @@ +/* +* 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: Touch Toolbar +* +*/ + + +#ifndef C_AITOOLBARRENDERER_H +#define C_AITOOLBARRENDERER_H + +#include +#include +#include "ainativerenderer.h" +#include "ainativeuimodel.h" +#include "aitoolbarbutton.h" + +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 + { + + +public: // Constructors and destructor + + static CAiToolbarRenderer* NewLC( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar); + + static CAiToolbarRenderer* NewL( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar ); + + ~CAiToolbarRenderer(); + +public: // from CAiNativeRenderer + + void DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC16& aText, + TInt aIndex ); + + void DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC8& aBuf, + TInt aIndex ); + + void TransactionCommittedL(); + + +private: // from MAknToolbarObserver + + void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar ); + + void OfferToolbarEventL( TInt aCommand ); + +private: + + CAiToolbarRenderer( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar ); + + void ConstructL(); + + + /** + * Get a button with id. If no button exists at the given + * id a new button will be created and returned. + * + * Ownership NOT transferred. + */ + CAiToolbarButton* ButtonL( TInt aShortcutId ); + + +private: // Data + + /** + * The actual toolbar + */ + CAknToolbar& iToolbar; + + /** + * Handler to send the toolbar events + */ + MAiFwEventHandler& iAiFwEventHandler; + + /** + * Array of buttons. Buttons are owned. + */ + RPointerArray iButtons; + + /** + * Have we already committed + */ + TBool iCommitted; + + /** + * Is the toolbar enabled in the cenrep + */ + TBool iToolbarEnabled; + }; + +} // namespace AiNativeUiController + +#endif // C_AITOOLBARRENDERER_H + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/application.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/application.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,71 @@ +/* +* 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: +* +*/ + + +#ifndef C_APPLICATION_H +#define C_APPLICATION_H + +#include + +namespace AiNativeUiController +{ + +class CNativeUiController; + +/** + * Application class of Native UI Controller application + * + * @lib ainatiui + * @since S60 3.2 + */ +class CApplication : public CAknApplication + { +public: + +// Constructors and destructor + + static CApplication* New(CNativeUiController* aUiCtl); + + virtual ~CApplication(); + + +// Functions from base classes + + CApaDocument* CreateDocumentL(); + + virtual TUid AppDllUid() const; + + virtual TFileName ResourceFileName() const; + +private: + + CApplication(CNativeUiController* aUiCtl); + +private: // Data + + /** + * UI Controller. Not own + */ + CNativeUiController* iUiCtl; + + }; + +} // namespace AiNativeUiController + +#endif // C_APPLICATION_H + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/appui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/appui.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,193 @@ +/* +* 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: +* +*/ + + +#ifndef C_APPUI_H +#define C_APPUI_H + +#include +#include + +class CAiUiIdleIntegration; +class MAiUiFrameworkObserver; +class MAiFwEventHandler; +class CExtrStandbyContainerIF; +class CCenRepNotifyHandler; +class CRepository; +class RConeResourceLoader; +class MAiPSPropertyObserver; + +namespace AiNativeUiController +{ + +class CNativeUiController; +class CAiNativeUiView; + +/** + * @ingroup group_nativeuicontroller + * + * AppUI class of Native UI Controller application + * + * @lib ainatiui + * @since S60 3.2 + */ +class CAppUi : public CAknAppUi, + public MCenRepNotifyHandlerCallback + { +public: // Constructors and destructor + + static CAppUi* NewL(CNativeUiController* aUiCtl); + + ~CAppUi(); + +// new functions + + CCoeEnv* CoeEnv() { return iCoeEnv; } + + void StartL(); + +// from CCoeAppUi + + TKeyResponse HandleKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ); + +// From MCenRepNotifyHandlerCallback + + void HandleNotifyInt( TUint32 aId, TInt aNewValue ); + + void ExtHSThemeChanged(); + +private: + +// Functions from CAknAppUi + + void HandleForegroundEventL(TBool aForeground); + + void HandleCommandL(TInt aCommand); + + void HandleResourceChangeL(TInt aType); + + void HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination); + + void HandleScreenDeviceChangedL(); + + void PrepareToExit(); + + void SkipVoiceDial(); + + static TInt TimerDone(TAny* aSelf); + + /** + * Handles powerkey events. + * + * @since S60 v3.2 + */ + static TInt HandlePowerkeyEvent( TAny* aPtr ); + +// Construction + + CAppUi(CNativeUiController* aUiCtl); + + void ConstructL(); + + void HandlePointerEvent( TPointerEvent &aEvent ); + +private: // Data + + + /** + * Framework event handler. + */ + MAiFwEventHandler* iFwEventHandler; + + /** + * UI Controller implementation. Not own. + */ + CNativeUiController* iUiCtl; + + /** + * Ui framework event observer. Not own. + */ + MAiUiFrameworkObserver* iUiFwObserver; + + /** + * Idle Integration helper object. Own. + */ + CAiUiIdleIntegration* iIdleIntegration; + + /** + * Main view. + * Own. + */ + CAiNativeUiView* iAppView; + + /** + * Homescreen IF. Own. + */ + CExtrStandbyContainerIF* iStanbyContainerIF; + + /** + * Notify handler for cenrep. + * Own. + */ + CCenRepNotifyHandler* iNotifyHandler; + + /** + * Repository for notify handler. + * Own. + */ + CRepository* iAIRepository; + + /** + * Last set status pane layout. + */ + TInt iCurrentStatusPaneLayout; + + /** + * Timer to handle long key press. + */ + CPeriodic* iTimer; + + /** + * Voice dial key down indicator. + */ + TBool iSINDKeyDown; + + /** + * Resource file loader for ainativeui resource. + */ + RConeResourceLoader* iResourceLoader; + + /** + * Flag to indicate that device has no power key. + */ + TBool iFeatureNoPowerKey; + + /** + * Power key PS observer. Only used if no power key exists. + * Own. + */ + MAiPSPropertyObserver* iPowerkeyStatusObserver; + + }; + +} // namespace AiNativeUiController + +#endif // C_APPUI_H + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/document.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/document.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,65 @@ +/* +* 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: +* +*/ + + +#ifndef C_DOCUMENT_H +#define C_DOCUMENT_H + +#include +#include +#include + +namespace AiNativeUiController +{ + +class CNativeUiController; + +/** + * Document class of Native UI Controller application. + * + * @lib ainatiui.lib + * @since S60 3.2 + */ +class CDocument : public CAknDocument + { +public: + +// Constructors and destructor + + static CDocument* NewL(CAknApplication &aApp, CNativeUiController* aUiCtl); + + virtual ~CDocument(); + +// Functions from CAknDocument + + CAknAppUi* CreateAppUiL(); + +private: + + CDocument(CEikApplication &aApp, CNativeUiController* aUiCtl); + +private: // Data + + CNativeUiController* iUiCtl; + + }; + +} // namespace AiNativeUiController + +#endif // C_DOCUMENT_H + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/nativeuicontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/nativeuicontroller.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,327 @@ +/* +* 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: Native UI controller. +* +*/ + + +#ifndef C_NATIVEUICONTROLLER_H +#define C_NATIVEUICONTROLLER_H + + +#include +#include "aiuicontroller.h" +#include "aiuiframeworkobserver.h" +#include "aicontentobserver.h" + +#include + +class MAiPropertyExtension; +class MAiPSPropertyObserver; + +namespace AiNativeUiController +{ + +class CAiNativeRenderer; +class CAiStatusPanel; +class CAppUi; +class CAiToolbarRenderer; + +const TInt KImplementationUidNativeUiController = AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE; + +const TUid KUidNativeUiController = { KImplementationUidNativeUiController }; + +/** +* Native UI controller. +* This class works as a secondary UI controller. It implements +* the MAiContentObserver interface thus handling and forwarding the data coming +* from the publishers. +* +* @since Series 60 3.2 +*/ +class CNativeUiController : public CAiUiController, + public MAiSecondaryUiController, + public MAiMainUiController, + public MAiUiFrameworkObserver, + public MAiContentObserver + { +public: + + static CNativeUiController* NewL(); + + virtual ~CNativeUiController(); + +// from base class CAiUiController + + void PrepareToExit(); + + void LoadUIDefinitionL(); + + void GetPluginsL(RAiPublisherInfoArray& aPlugins); + + void GetSettingsL(const TAiPublisherInfo& aPubInfo, + RAiSettingsItemArray& aSettings); + + void ActivateUI(); + + MAiContentObserver& GetContentObserver(); + + void SetEventHandler(MAiFwEventHandler& aEventHandler); + + MAiFwEventHandler* FwEventHandler(); + + void RemovePluginFromUI( MAiPropertyExtension& aPlugin ); + + MAiMainUiController* MainInterface(); + + MAiSecondaryUiController* SecondaryInterface(); + + void HandleLoadedPlugins(const RAiPublisherInfoArray& /*aRequiredPlugins*/ ) {}; + +// from base class MAiMainUiController + + void RunApplicationL(); + + CCoeEnv& CoeEnv(); + + void SetUiFrameworkObserver( MAiUiFrameworkObserver& aObserver ); + + TBool IsMenuOpen(); + +// from base class CAiSecordaryUiController + + void SetCoeEnv( CCoeEnv& aCoeEnv ); + + MAiUiFrameworkObserver* UiFrameworkObserver(); + +// from base class MAiUiFrameworkObserver + + void HandleResourceChange( TInt aType ); + + void HandleForegroundEvent( TBool aForeground ); + +// from base class MAiContentObserver + + TInt StartTransaction(TInt aTxId); + + TInt Commit(TInt aTxId); + + TInt CancelTransaction(TInt aTxId); + + TBool CanPublish(MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex); + + TInt Publish(MAiPropertyExtension& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); + + TInt Publish(MAiPropertyExtension& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); + + TInt Publish(MAiPropertyExtension& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); + + TInt Publish(MAiPropertyExtension& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ); + + TInt Clean(MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); + + TAny* Extension(TUid aUid); + + TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const; + +// new methods + + /** + * 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 VariateToMainUiController(); + + void Exit(); + +private: + + CNativeUiController(); + + static CApaApplication* NewApplication(); + + /** + * Add renderer. + * + * Ownership transferred. + * + * @since S60 3.2 + * @param aRenderer is pointer to renderer. + */ + void AddRendererL( CAiNativeRenderer* aRenderer ); + + /** + * Remove a renderer. Renderer is only + * removed from the array and is deleted ONLY + * when aDelete = ETrue + * + * @since S60 5.0 + * @param aRenderer is pointer to the renderer to be removed + * @param aDelete is ETrue when the renderer will be deleted + * @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. + * + * @since S60 3.2 + * @param aPlugin is publishing plugin. + * @param aContent is content id + * @param aData is published data + * @param aIndex is index in the control, not used by Native UI Controller. + * @return KErrNone if publishing was successful. + */ + template + TInt DoPublish( MAiPropertyExtension& aPlugin, TInt aContent, T& aData, TInt aIndex ); + + /** + * Handles idle state changes. + * + * @since S60 v3.2 + */ + static TInt HandleIdleStateEvent( TAny* aPtr ); + + /** + * Handles keylock state changes. + * + * @since S60 v3.2 + */ + static TInt HandleKeylockStateEvent( TAny* aPtr ); + + static TInt HandlePluginConfChange( TAny* aPtr ); + + static TInt ExitTimerCallBack( TAny* aSelf ); + void GetSettingsFromCRL( const TAiPublisherInfo& aPubInfo, + RAiSettingsItemArray &aPluginSettings ); + +private: // Data + + /** + * Array of renderers. + * Own. + */ + RPointerArray iRenderers; + + /** + * Offset of resource file. + */ + TInt iResourceOffset; + + /** + * Status panel + * Own. + */ + CAiStatusPanel* iStatusPanel; + + /** + * Reference to available CONE environment object. Not own. + */ + CCoeEnv* iCoeEnv; + + /** + * Idle state PS observer. + * Own. + */ + MAiPSPropertyObserver* iIdleStatusObserver; + + /** + * Keylock state PS observer. + * Own. + */ + MAiPSPropertyObserver* iKeylockStatusObserver; + + + /** + * ExtHS plugin configuration PS observer. + * Own. + */ + MAiPSPropertyObserver* iExtHsPluginConfChange; + + /** + * Native UI controller plug-ins + */ + RAiPublisherInfoArray iPlugins; + + /** + * Plug-in event handler. + * Doesn't own. + */ + MAiFwEventHandler* iFwEventHandler; + + /** + * Pointer to this, when role is main ui controller. + */ + MAiMainUiController* iMain; + + /** + * Ui framework observer. Not own. + */ + MAiUiFrameworkObserver* iUiFrameworkObserver; + + /** + * Pointer to app ui. + * Not own. + */ + CAppUi* iAppUi; + + /** + * Indicates if Native UI Controller takes responsibilities of + * Main UI Controller. + */ + TBool iRunningAsMain; + + /** + * Timer to call AppUi's exit + **/ + CPeriodic *iExitTimer; + + /** + * 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" + +} // namespace AiNativeUiController + +#endif + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/inc/nativeuicontroller.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/inc/nativeuicontroller.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,17 @@ +/* +* 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: +* +*/ + diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/loc/ainativeui.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/loc/ainativeui.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for project Active Idle +* +*/ + + +// d: It is text shown in note when SIM registration has failed. +// l: popup_note_window +// w: +// r: 3.2 +// +#define text_imsi_unknown_in_hlr "SIM registration failed" diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/rom/nativeuicontroller.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/rom/nativeuicontroller.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image description file for project ActiveIdle3 +* +*/ + + +#ifndef NATIVEUICONTROLLER_IBY +#define NATIVEUICONTROLLER_IBY + + +#include + + +// UI Controller plug-ins +ECOM_PLUGIN( ai3natiui.dll, ai3natiui.rsc ) + + + +#endif // NATIVEUICONTROLLER_IBY diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/rom/nativeuicontroller_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/rom/nativeuicontroller_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image description file for project ActiveIdle3 +* +*/ + +#ifndef NATIVEUICONTROLLERRESOURCES_IBY +#define NATIVEUICONTROLLERRESOURCES_IBY + + +#include + +data=\epoc32\data\z\resource\apps\ainativeui.rsc APP_RESOURCE_DIR\ainativeui.rsc + +#endif // NATIVEUICONTROLLERRESOURCES_IBY diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/ai3natiui.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/ai3natiui.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,62 @@ +/* +* 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: Resource file for Native UI Controller +* +*/ + + +// ========== INCLUDE FILES =================================================== + +#include +#include +#include + +// ========== RESOURCE DEFINITIONS ============================================ + +// ---------------------------------------------------------------------------- +// +// +// ---------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO registry_info +{ + resource_format_version = RESOURCE_FORMAT_VERSION_2; + // UID for the DLL + dll_uid = AI_UID_ECOM_DLL_UICONTROLLER_NATIVE; + + // Interface info array + interfaces = + { + INTERFACE_INFO + { + // UID of the implemented interface + interface_uid = AI_UID_ECOM_INTERFACE_UICONTROLLER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE; + version_no = 1; + display_name = "Native AI UI"; + default_data = " "; + opaque_data = " "; + rom_only = 1; + } + }; + } + }; +} + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/ai3nativeui.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/ai3nativeui.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,249 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for project Native Ui Controller +* +*/ + + + +NAME AINU + +#include +#include +#include +#include +#include +#include +#include +#include +// for qtn_apps_mode_list +#include +#include "ainativeui.hrh" + + +RESOURCE RSS_SIGNATURE { } + +RESOURCE TBUF { buf="AiNativeUi"; } + +RESOURCE EIK_APP_INFO +{ + menubar = r_nativeui_main_menubar; + cba = r_nativeui_softkeys_default; + status_pane = r_nativeui_status_pane; +} + +// --------------------------------------------------------------------------- +// ?resource_name +// ?description +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_activeidle_sim_registration_failed + { + buf = text_imsi_unknown_in_hlr; + } + +RESOURCE TBUF r_activeidle_title_tapped_header + { + buf = qtn_idle_title_tapped_header; + } + +RESOURCE TBUF r_activeidle_title_tapped_link1 + { + buf = qtn_idle_title_tapped_link1; + } + +RESOURCE TBUF r_activeidle_title_tapped_link2 + { + buf = qtn_idle_title_tapped_link2; + } + +RESOURCE TBUF r_idle_navi_tapped_cale + { + buf = qtn_idle_navi_tapped_cale; + } + +RESOURCE TBUF r_idle_navi_tapped_all_prof + { + buf = qtn_idle_navi_tapped_all_prof; + } + +RESOURCE TBUF r_nativeui_sk_back + { + buf = text_softkey_back; + } + +RESOURCE TBUF r_nativeui_sk_newmsg + { + buf = qtn_idle_skey_new_msg; + } + +RESOURCE TBUF r_nativeui_sk_email + { + buf = qtn_apps_email_skey; + } + +RESOURCE TBUF r_nativeui_sk_syncmlmail + { + buf = qtn_apps_syncml_mail_skey; + } + +RESOURCE TBUF r_nativeui_sk_mmspostcard + { + buf = qtn_apps_mmspostcard_skey; + } + +RESOURCE TBUF r_nativeui_sk_audiomsg + { + buf = qtn_apps_audio_msg_skey; + } + +RESOURCE TBUF r_nativeui_sk_msgtype + { + buf = qtn_set_idle_skey_select_msg_type; + } + +RESOURCE TBUF r_nativeui_sk_changetheme + { + buf = qtn_apps_idle_skin_skey; + } + +// ----------------------------------------------------------------------------- +// +// r_idle_title_pane +// It defines idle's status pane. Title pane is empty. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TITLE_PANE r_nativeui_title_pane + { + txt = " "; + } + +// ----------------------------------------------------------------------------- +// +// r_idle_status_pane +// It defines idle's status pane. +// +// ----------------------------------------------------------------------------- +// +RESOURCE STATUS_PANE_APP_MODEL r_nativeui_status_pane + { + layout = R_AVKON_STATUS_PANE_LAYOUT_IDLE; + panes = + { + SPANE_PANE + { + id = EEikStatusPaneUidTitle; + type = EAknCtTitlePane; + resource = r_nativeui_title_pane; + } + }; + } + + +RESOURCE MENU_BAR r_nativeui_main_menubar +{ + titles = + { + MENU_TITLE { menu_pane = r_nativeui_main_menupane; } + }; +} + +RESOURCE MENU_PANE r_nativeui_main_menupane +{ + items = + { + MENU_ITEM { command = EAknCmdExit; txt = text_softkey_exit; } + }; +} + +RESOURCE CBA r_nativeui_softkeys_default + { + buttons = + { + CBA_BUTTON + { + id = ENativeUiSoftkeyLeft; + txt = " "; + }, + CBA_BUTTON + { + id = ENativeUiSoftkeyRight; + txt = " "; + }, + CBA_BUTTON + { + id = ENativeUiSelectionKey; + txt = " "; + } + }; + } + + +RESOURCE AVKON_SKEY_LIST r_nativeui_default_skey_list + { + list = + { + AVKON_SKEY_INFO {key='0'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='0'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='0'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='1'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='1'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='1'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='2'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='2'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='2'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='3'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='3'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='3'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='4'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='4'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='4'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='5'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='5'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='5'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='6'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='6'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='6'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='7'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='7'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='7'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='8'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='8'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='8'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='9'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='9'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='9'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='*'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='*'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='*'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key=EStdKeyHash; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key=EStdKeyHash; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key=EStdKeyHash; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;} +#ifdef __QWERTY_INPUT + , + AVKON_SKEY_INFO {key='+'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='+'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='+'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;} +#endif // __QWERTY_INPUT + }; + } +// Common toolbar resource +RESOURCE AVKON_TOOLBAR r_common_toolbar + { + flags = KAknToolbarFixed | KAknToolbarWithoutCba; + items = + { + }; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/aidialogrenderer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/aidialogrenderer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,163 @@ +/* +* 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: Dialog renderer. +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include "aidialogrenderer.h" +#include "ainativeuiplugins.h" +#ifdef __COVER_DISPLAY +#include "aisecondarydisplayapi.h" +#endif + +using namespace AiNativeUiController; + +// ======== MEMBER FUNCTIONS ======== + +CAiDialogRenderer* CAiDialogRenderer::NewLC() + { + CAiDialogRenderer* self = new( ELeave ) CAiDialogRenderer; + CleanupStack::PushL( self ); + return self; + } + + +CAiDialogRenderer::~CAiDialogRenderer() + { + delete iDialog; + delete iText; + } + + +CAiDialogRenderer::CAiDialogRenderer() + { + } + + +void CAiDialogRenderer::DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aResource, + TInt /*aIndex*/ ) + { + if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + { + switch( aContent ) + { + case EAiDeviceStatusContentSIMRegStatus: + { + TInt idleState; + if ( RProperty::Get( + KPSUidAiInformation, + KActiveIdleState, + idleState ) != KErrNone ) + { + idleState = EPSAiBackground; + } + if( aResource == EAiDeviceStatusResourceSIMRegFail ) + { + if( iShowDialog ) + { + break; + } + HBufC* temp = StringLoader::LoadL( + R_ACTIVEIDLE_SIM_REGISTRATION_FAILED ); + delete iText; + iText = temp; +#ifdef __COVER_DISPLAY + iDialogId = EAiSimRegistrationFailed; +#endif + iShowDialog = ETrue; + } + if ( idleState == EPSAiForeground ) + { + ShowDialogL(); + } + + break; + } + default: + { + User::Leave( KErrNotFound ); + break; + } + }; + } + else + { + User::Leave( KErrNotFound ); + } + } + +void CAiDialogRenderer::DoCleanL( MAiPropertyExtension& /*aPlugin*/, + TInt aContent ) + { + switch( aContent ) + { + case EAiDeviceStatusContentSIMRegStatus: + { + delete iDialog; + iDialog = NULL; + iShowDialog = EFalse; + break; + } + default: + { + User::Leave( KErrNotFound ); + break; + } + }; + + } + + +void CAiDialogRenderer::ShowDialogL() + { + if ( iDialog ) + { + return; + } + + iDialog = + new (ELeave) CAknNoteDialog( + reinterpret_cast< CEikDialog** >( &iDialog ), + CAknNoteDialog::EConfirmationTone, + CAknNoteDialog::ENoTimeout ); + +#ifdef __COVER_DISPLAY + iDialog->PublishDialogL( iDialogId, KAICategory ); +#endif + + iDialog->PrepareLC( R_AKN_INFORMATION_NOTE_DIALOG ); + + iDialog->ButtonGroupContainer().SetCommandSetL( R_AVKON_SOFTKEYS_OK_EMPTY ); + iDialog->SetTextL( *iText ); + iDialog->RunLD(); + } + + +void CAiDialogRenderer::FocusObtainedL() + { + if( iShowDialog ) + { + ShowDialogL(); + } + } diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/ainativerenderer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/ainativerenderer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,251 @@ +/* +* 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: +* +*/ + + +#include +#include "ainativerenderer.h" +#include "ainativeuiplugins.h" + +using namespace AiNativeUiController; + + +CAiNativeRenderer::~CAiNativeRenderer() + { + } + + +TInt CAiNativeRenderer::Publish( MAiPropertyExtension& aPlugin, TInt aContent, + TInt aResource, TInt aIndex ) + { + TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); + + if( err != KErrNone ) + { + return err; + } + + TRAP( err, DoPublishL( aPlugin, aContent, aResource, aIndex ) ); + return err; + } + + +TInt CAiNativeRenderer::Publish( MAiPropertyExtension& aPlugin, TInt aContent, + const TDesC16& aText, TInt aIndex ) + { + TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); + + if( err != KErrNone ) + { + return err; + } + + TRAP( err, DoPublishL( aPlugin, aContent, aText, aIndex ) ); + return err; + } + + +TInt CAiNativeRenderer::Publish( MAiPropertyExtension& aPlugin, TInt aContent, + const TDesC8& aBuf, TInt aIndex ) + { + TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); + + if( err != KErrNone ) + { + return err; + } + + TRAP( err, DoPublishL( aPlugin, aContent, aBuf, aIndex ) ); + return err; + } + + +TInt CAiNativeRenderer::Publish( MAiPropertyExtension& aPlugin, TInt aContent, + RFile& aFile, TInt aIndex ) + { + TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); + + if( err != KErrNone ) + { + return err; + } + + TRAP( err, DoPublishL( aPlugin, aContent, aFile, aIndex ) ); + return err; + } + + +TInt CAiNativeRenderer::Clean( MAiPropertyExtension& aPlugin, TInt aContent ) + { + TRAPD( err, DoMimeTypeCheckL( aPlugin, aContent ) ); + + if( err != KErrNone ) + { + return err; + } + + TRAP( err, DoCleanL( aPlugin, aContent ) ); + return err; + } + + +void CAiNativeRenderer::DoPublishL + ( MAiPropertyExtension& /*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*/ ) + { + // Default implementation, overridden in subclass if needed. + User::Leave( KErrNotFound ); + } + + +void CAiNativeRenderer::DoPublishL + ( MAiPropertyExtension& /*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*/ ) + { + // Default implementation, overridden in subclass if needed. + User::Leave( KErrNotFound ); + } + + +void CAiNativeRenderer::DoCleanL + ( MAiPropertyExtension& /*aPlugin*/, TInt /*aContent*/ ) + { + // Default implementation, overridden in subclass if needed. + User::Leave( KErrNotFound ); + } + + +TInt CAiNativeRenderer::GetIntContentId( const TDesC& aCid ) const + { + for( TInt i( 0 ); i < KAiDeviceStatusContentCount; i++ ) + { + const TAiContentItem& item = KAiDeviceStatusContent[i]; + if( ContentCid(item) == aCid ) + { + //match + return item.id; + } + } + + 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 + { + TUid pluginUid; + TRAPD( err, pluginUid = aPlugin.PublisherInfoL()->iUid ); + if ( err != KErrNone ) + { + return EFalse; + } + // loop through Device Status content items + if ( pluginUid == KDeviceStatusPluginUid ) + { + for( TInt i( 0 ); i < KAiDeviceStatusContentCount; i++ ) + { + const TAiContentItem& item = KAiDeviceStatusContent[i]; + + if( item.id != aContentId ) + { + continue; + } + + TBuf8 mimeType((TText8*) item.type); + + 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 + for( TInt i( 0 ); i < KAiProfileContentCount; i++ ) + { + const TAiContentItem& item = KAiProfileContent[i]; + + if( item.id != aContentId ) + { + continue; + } + + TBuf8 mimeType((TText8*) item.type); + + return ( mimeType.Match( aMimeType ) != KErrNotFound ); + } + } + + return EFalse; + } + + +void CAiNativeRenderer::DoMimeTypeCheckL( MAiPropertyExtension& aPlugin, TInt aContentId ) + { + MAiContentItemIterator* iter = + (MAiContentItemIterator*)aPlugin.GetPropertyL( EAiPublisherContent ); + const TAiContentItem& item = iter->ItemL( aContentId ); + + aContentId = GetIntContentId( ContentCid(item) ); + + if( !MatchMimeType( aPlugin, aContentId, ContentType(item) ) ) + { + User::Leave( KErrNotSupported ); + } + + } + diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/ainativeuimodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/ainativeuimodel.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,116 @@ +/* +* 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: Common NativeUi definitions and utilities +* +*/ + + +#include "ainativeuimodel.h" +#include "aidevicestatuscontentmodel.h" + +namespace AiNativeUiController + { + +namespace AiNativeUiModel + { + +struct TRenderingPriorityItem + { + TInt iContentId; + TInt iRenderingPriority; + }; + +const TInt KHighestRenderingPriority = 20; + +const TInt KPriorityOffset1 = 1; +const TInt KPriorityOffset2 = 2; +const TInt KPriorityOffset3 = 3; +const TInt KPriorityOffset4 = 4; +const TInt KPriorityOffset5 = 5; +const TInt KPriorityOffset6 = 6; + + +const TRenderingPriorityItem KNaviPaneRenderingPriorities[] = + { + { EAiDeviceStatusContentProfileName, KHighestRenderingPriority }, + { EAiDeviceStatusContentSilentIndicator, KHighestRenderingPriority }, + { EAiDeviceStatusContentTimedProfileIndicator, KHighestRenderingPriority }, + { EAiDeviceStatusContentDate, KHighestRenderingPriority - KPriorityOffset1 }, + { EAiDeviceStatusContentGeneralProfileName, KHighestRenderingPriority - KPriorityOffset2 }, + { EAiDeviceStatusContentVHZIndicator, KHighestRenderingPriority - KPriorityOffset3 }, + { EAiDeviceStatusContentCUGIndicator, KHighestRenderingPriority - KPriorityOffset4 }, + { EAiDeviceStatusContentMCNIndicator, KHighestRenderingPriority - KPriorityOffset5 }, + { EAiDeviceStatusContentGeneralIndicator, KHighestRenderingPriority - KPriorityOffset6 } + }; + + +TRenderingPriorities RenderingPriorities( const TDesC8& aUiElementId ) + { + if( aUiElementId == KNaviPaneId ) + { + return TRenderingPriorities( KNaviPaneRenderingPriorities, + sizeof(KNaviPaneRenderingPriorities) / sizeof(KNaviPaneRenderingPriorities[0]) ); + } + else + { + return TRenderingPriorities( NULL, 0 ); + } + } + + +TRenderingPriorities::TRenderingPriorities + (const TRenderingPriorityItem* aRenderingPriorities, TInt aCount) + : iRenderingPriorities(aRenderingPriorities), iCount(aCount) + { + } + + +TInt TRenderingPriorities::RenderingPriority( TInt aContentId ) + { + if( !iRenderingPriorities ) + { + return KErrNotFound; + } + for( TInt i = 0; i < iCount; ++i ) + { + if( iRenderingPriorities[i].iContentId == aContentId ) + { + return iRenderingPriorities[i].iRenderingPriority; + } + } + return KErrNotFound; + } + + +TBool TRenderingPriorities::GetNextContentId( TInt& aContentId, TInt& aNextPriority ) + { + if( !iRenderingPriorities ) + { + return EFalse; + } + for( TInt i = 0; i < iCount; ++i ) + { + if( iRenderingPriorities[i].iRenderingPriority < aNextPriority ) + { + aContentId = iRenderingPriorities[i].iContentId; + aNextPriority = iRenderingPriorities[i].iRenderingPriority; + return ETrue; + } + } + return EFalse; + } + + } // namespace AiNativeUi + + } diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/ainativeuiview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/ainativeuiview.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,130 @@ +/* +* 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: Native ui controller view. +* +*/ + + +#include +#include +#include +#include "appui.h" +#include "ainativeuiview.h" + +using namespace AiNativeUiController; + +CAiNativeUiView::CAiNativeUiView( CAppUi* aAppUi ) + : iAppUi( aAppUi ) + { + } + +void CAiNativeUiView::ConstructL( const TRect& aRect ) + { + CreateWindowL(); + SetRect( aRect ); + ActivateL(); + } + +CAiNativeUiView* CAiNativeUiView::NewL( + const TRect& aRect, + CAppUi* aAppUi ) + { + CAiNativeUiView* self = + new (ELeave) CAiNativeUiView( aAppUi ); + CleanupStack::PushL( self ); + self->ConstructL( aRect ); + CleanupStack::Pop(self); + return self; + } + +CAiNativeUiView::~CAiNativeUiView() + { + } + +void CAiNativeUiView::SizeChanged() + { + if( iControl ) + { + iControl->SetRect( Rect() ); + } + } + +TInt CAiNativeUiView::CountComponentControls() const + { + if( iControl ) + { + return 1; + } + else + { + return 0; + } + } + +CCoeControl* CAiNativeUiView::ComponentControl( TInt /*aIndex*/ ) const + { + return iControl; + } + +TKeyResponse CAiNativeUiView::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + if( iControl ) + { + return iControl->OfferKeyEventL( aKeyEvent, aType ); + } + return EKeyWasNotConsumed; + } + +void CAiNativeUiView::Draw( const TRect& aRect ) const + { + TRect rect = Rect(); + if ( !rect.iTl.iY ) + { + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + CWindowGc& gc = SystemGc(); + + if ( !AknsDrawUtils::Background( skin, cc, this, gc, aRect ) ) + { + gc.SetPenStyle( CGraphicsContext::ENullPen ); + gc.SetBrushColor( AKN_LAF_COLOR( 0 ) ); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.DrawRect( aRect ); + } + } + } + +TVwsViewId CAiNativeUiView::ViewId() const + { + return TVwsViewId( TUid::Uid( 0x102750F0 ), TUid::Uid( 0x102750F0 ) ); + } + +void CAiNativeUiView::ViewActivatedL( const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + } + +void CAiNativeUiView::ViewDeactivated() + { + } + +void CAiNativeUiView::SetControl( CCoeControl* aControl ) + { + iControl = aControl; + } + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/ainavipaneanimator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/ainavipaneanimator.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,228 @@ +/* +* 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: Navipane animator. +* +*/ + + +#include "ainavipaneanimator.h" +#include "aistatuspanel.h" +#include "ainavipaneanimatorcallback.h" + +using namespace AiNativeUiController; + +const TInt KAnimDelay = 2000000; + + +CAiNaviPaneAnimator::CAiNaviPaneAnimator( CAiStatusPanel& aStatusPane, + AiNativeUiModel::TRenderingPriorities& aPriorities, + MAiNaviPaneAnimatorCallback& aCallback ) + : iStatusPane( aStatusPane ), + iPriorities( aPriorities ), + iCallback( aCallback ) + { + } + + +void CAiNaviPaneAnimator::ConstructL() + { + iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + } + + +CAiNaviPaneAnimator* CAiNaviPaneAnimator::NewL( CAiStatusPanel& aStatusPane, + AiNativeUiModel::TRenderingPriorities& aPriorities, + MAiNaviPaneAnimatorCallback& aCallback ) + { + CAiNaviPaneAnimator* self = new( ELeave )CAiNaviPaneAnimator( aStatusPane, + aPriorities, + aCallback ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +CAiNaviPaneAnimator::~CAiNaviPaneAnimator() + { + iAnimArray.ResetAndDestroy(); + if( iPeriodic ) + { + iPeriodic->Cancel(); + delete iPeriodic; + } + } + + +void CAiNaviPaneAnimator::AddItemL( TInt aContentId, const TDesC16& aText ) + { + const TInt count = iAnimArray.Count(); + for( TInt i = 0; i < count; i++ ) + { + if( iAnimArray[i]->Name() == aContentId ) + { + iAnimArray[i]->SetValueL( aText ); + return; + } + } + + CAiNameValuePair* newItem = CAiNameValuePair::NewLC( + aContentId, + aText ); + User::LeaveIfError( iAnimArray.Append( newItem ) ); + CleanupStack::Pop( newItem ); + } + + +void CAiNaviPaneAnimator::RemoveItem( TInt aContentId ) + { + const TInt count = iAnimArray.Count(); + for( TInt i = 0; i < count; i++ ) + { + if( iAnimArray[i]->Name() == aContentId ) + { + delete iAnimArray[i]; + iAnimArray[i] = NULL; + iAnimArray.Remove( i ); + return; + } + } + } + + +void CAiNaviPaneAnimator::CancelAnimationL() + { + if( iPeriodic->IsActive() ) + { + iPeriodic->Cancel(); + iCurrentItem = 0; + iCallback.AnimationCompleteL(); + } + } + +TBool CAiNaviPaneAnimator::IsActive() + { + return iPeriodic->IsActive(); + } + +void CAiNaviPaneAnimator::AnimateL() + { + if( !iPeriodic->IsActive() ) + { + SortAnimArrayL(); + //draw first item immediately + if( DrawTextL() ) + { + iPeriodic->Start( KAnimDelay, KAnimDelay, TCallBack( AnimCallback, this ) ); + } + } + } + + +TInt CAiNaviPaneAnimator::AnimCallback( TAny* aPtr ) + { + CAiNaviPaneAnimator* self = static_cast( aPtr ); + + if( self ) + { + TRAP_IGNORE( self->DrawTextL() ); + } + + return KErrNone; + } + + +TBool CAiNaviPaneAnimator::DrawTextL() + { + if( iCurrentItem < iAnimArray.Count() ) + { + iStatusPane.SetNaviPaneTextL( iAnimArray[iCurrentItem]->Value() ); + iStatusPane.RenderNaviPaneL(); + ++iCurrentItem; + return ETrue; + } + else + { + iPeriodic->Cancel(); + iCurrentItem = 0; + iCallback.AnimationCompleteL(); + return EFalse; + } + } + +void CAiNaviPaneAnimator::SortAnimArrayL() + { + const TInt count = iAnimArray.Count(); + + // loop through the animator array and sort items in priority order + for( TInt i = 0; i < count - 1; i++ ) + { + for( TInt k = i + 1; k < count; k++) + { + if( iPriorities.RenderingPriority( iAnimArray[i]->Name() ) < + iPriorities.RenderingPriority( iAnimArray[k]->Name() ) ) + { + CAiNameValuePair* temp = iAnimArray[k]; + iAnimArray[k] = iAnimArray[i]; + iAnimArray[i] = temp; + } + } + } + } + + +CAiNaviPaneAnimator::CAiNameValuePair* +CAiNaviPaneAnimator::CAiNameValuePair::NewLC( const TInt aName, + const TDesC& aValue ) + { + CAiNameValuePair* self = new( ELeave ) CAiNameValuePair(); + CleanupStack::PushL( self ); + self->ConstructL( aName, aValue ); + return self; + } + + +void CAiNaviPaneAnimator::CAiNameValuePair::ConstructL( const TInt aName, + const TDesC& aValue ) + { + iName = aName; + iValue = aValue.AllocL(); + } + + +CAiNaviPaneAnimator::CAiNameValuePair::~CAiNameValuePair() + { + delete iValue; + } + + +TInt CAiNaviPaneAnimator::CAiNameValuePair::Name() const + { + return iName; + } + + +const TDesC16& CAiNaviPaneAnimator::CAiNameValuePair::Value() const + { + return *iValue; + } + + +void CAiNaviPaneAnimator::CAiNameValuePair::SetValueL( const TDesC& aValue ) + { + HBufC* temp = aValue.AllocL(); + delete iValue; + iValue = temp; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/ainavipanerenderer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/ainavipanerenderer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,416 @@ +/* +* 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: Navipane renderer. +* +*/ + + +#include +#include +#include + +#include "ainavipanerenderer.h" +#include "ainavipaneanimator.h" +#include "aistatuspanel.h" +#include "ainativeuimodel.h" +#include "ainativeuiplugins.h" +#include "contentprioritymap.h" +#include +#include "debug.h" + +using namespace AiNativeUiController; + + +void CAiNaviPaneRenderer::ConstructL() + { + iAnimator = CAiNaviPaneAnimator::NewL( iStatusPanel, + iRenderingPriorities, + *this ); + iProfileText = HBufC::NewL(0); + iSilentIndicator = HBufC::NewL(0); + } + + +CAiNaviPaneRenderer* CAiNaviPaneRenderer::NewLC( + CAiStatusPanel& aStatusPanel ) + { + CAiNaviPaneRenderer* self = new( ELeave ) CAiNaviPaneRenderer( aStatusPanel ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +CAiNaviPaneRenderer::~CAiNaviPaneRenderer() + { + delete iAnimator; + delete iProfileText; + delete iSilentIndicator; + delete iTimedProfileIndicator; + } + + +CAiNaviPaneRenderer::CAiNaviPaneRenderer( CAiStatusPanel& aStatusPanel ) + : iStatusPanel( aStatusPanel ), + iRenderingPriorities( AiNativeUiModel::RenderingPriorities( AiNativeUiModel::KNaviPaneId ) ), + iCurrentContent(KAiNullContentId), + iCurrentPriority(AiNativeUiModel::KNoPriority) + { + } + + +void CAiNaviPaneRenderer::DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC16& aText, + TInt /*aIndex*/ ) + { + if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + { + switch( aContent ) + { + // FALLTHROUGH + case EAiDeviceStatusContentDate: + case EAiDeviceStatusContentProfileName: + case EAiDeviceStatusContentGeneralProfileName: + { + __PRINT(__DBG_FORMAT("XAI: Render navi pane - %d, %S"), aContent, &aText ); + + const TInt priority = iRenderingPriorities.RenderingPriority( aContent ); + + // Get active profile ID + CRepository* profileApi; + TInt profileId; + profileApi = CRepository::NewL( KCRUidProfileEngine ); + TInt err = profileApi->Get( KProEngActiveProfile, profileId ); + delete profileApi; + + if ( aContent == EAiDeviceStatusContentGeneralProfileName ) + { + const TInt KGeneralProfileId( 0 ); + if (profileId == KGeneralProfileId) + { + iAnimator->AddItemL( EAiDeviceStatusContentGeneralIndicator, aText ); + } +// iAnimator->AddItemL( EAiDeviceStatusContentGeneralIndicator, aText ); +// iAnimator->AddItemL( EAiDeviceStatusContentGeneralProfileName, aText ); + + iAnimator->AnimateL(); + } + + + if( (priority >= iCurrentPriority) || !iIsSilent || !iIsTimed ) + { + if( priority >= iCurrentPriority ) + { + delete iProfileText; + iProfileText = NULL; + iProfileText = aText.AllocL(); + iIsOldTextChanged = ETrue; + + iCurrentPriority = priority; + iCurrentContent = aContent; + } + + HBufC* newText = ConstructProfileTextLC(); + + if( !iAnimator->IsActive() ) + { + iStatusPanel.SetNaviPaneTextL( *newText ); + iStatusPanel.RenderNaviPaneL(); + } + + CleanupStack::PopAndDestroy( newText ); + } + + __PRINTS( "XAI: Render navi pane - priority check failed"); + break; + } + + case EAiDeviceStatusContentSilentIndicator: + { + __PRINT(__DBG_FORMAT("XAI: Render navi pane - %d, %S"), aContent, &aText ); + + const TInt priority = iRenderingPriorities.RenderingPriority( aContent ); + + if( priority >= iCurrentPriority && iIsOldTextChanged ) + { + delete iSilentIndicator; + iSilentIndicator = NULL; + iSilentIndicator = aText.AllocL(); + iIsSilent = ETrue; + if( !iAnimator->IsActive() ) + { + HBufC* newText = ConstructProfileTextLC(); + iStatusPanel.SetNaviPaneTextL( *newText ); + iStatusPanel.RenderNaviPaneL(); + CleanupStack::PopAndDestroy( newText ); + } + + + + + // iCurrentContent is not assigned because silent indicator is + // rendered within the navi pane text + + __PRINTS( "XAI: Render navi pane - done"); + } + __PRINTS( "XAI: Render navi pane - priority check failed"); + break; + } + case EAiDeviceStatusContentTimedProfileIndicator: + { + __PRINT(__DBG_FORMAT("XAI: Render navi pane - %d, %S"), aContent, &aText ); + + const TInt priority = iRenderingPriorities.RenderingPriority( aContent ); + + if( priority >= iCurrentPriority && iIsOldTextChanged ) + { + delete iTimedProfileIndicator; + iTimedProfileIndicator = NULL; + iTimedProfileIndicator = aText.AllocL(); + iIsTimed = ETrue; + + if( !iAnimator->IsActive() ) + { + HBufC* newText = ConstructProfileTextLC(); + iStatusPanel.SetNaviPaneTextL( *newText ); + iStatusPanel.RenderNaviPaneL(); + CleanupStack::PopAndDestroy( newText ); + } + + + // iCurrentContent is not assigned because silent indicator is + // rendered within the navi pane text + + __PRINTS( "XAI: Render navi pane - done"); + } + __PRINTS( "XAI: Render navi pane - priority check failed"); + break; + } + + // FALLTHROUGH + case EAiDeviceStatusContentMCNIndicator: + case EAiDeviceStatusContentVHZIndicator: + case EAiDeviceStatusContentCUGIndicator: + { + iAnimator->AddItemL( aContent, aText ); + if( !iAnimator->IsActive() ) + { + iAnimator->AnimateL(); + } + iIsChanged = ETrue; + break; + } + + default: + { + User::Leave( KErrNotFound ); + break; + } + }; + } + else + { + User::Leave( KErrNotFound ); + } + } + +HBufC* CAiNaviPaneRenderer::ConstructProfileTextLC() + { + TInt bufLen = iProfileText->Length(); + if ( iIsSilent ) + { + bufLen += iSilentIndicator->Length(); + } + if ( iIsTimed ) + { + bufLen += iTimedProfileIndicator->Length(); + } + + HBufC *temp = HBufC::NewLC( bufLen ); + + if ( iIsSilent ) + { + temp->Des().Append( *iSilentIndicator ); + } + if ( iIsTimed ) + { + temp->Des().Append( *iTimedProfileIndicator ); + } + + temp->Des().Append( *iProfileText ); + return temp; + } + +void CAiNaviPaneRenderer::DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent ) + { + if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + { + + switch( aContent ) + { + case EAiDeviceStatusContentNetworkIdentity: + { + iAnimator->RemoveItem( EAiDeviceStatusContentGeneralIndicator ); + break; + } + + // FALLTHROUGH + case EAiDeviceStatusContentDate: + case EAiDeviceStatusContentProfileName: + case EAiDeviceStatusContentGeneralProfileName: + case EAiDeviceStatusContentSilentIndicator: + case EAiDeviceStatusContentTimedProfileIndicator: + { + __PRINT(__DBG_FORMAT("XAI: Cleaning navi pane - %d"), aContent ); + + if ( aContent == EAiDeviceStatusContentSilentIndicator ) + { + iIsSilent = EFalse; + } + if ( aContent == EAiDeviceStatusContentTimedProfileIndicator ) + { + iIsTimed = EFalse; + } + if ( aContent == EAiDeviceStatusContentGeneralProfileName ) + { + iAnimator->RemoveItem( EAiDeviceStatusContentGeneralIndicator ); +// iAnimator->RemoveItem( EAiDeviceStatusContentGeneralProfileName ); + } + if ( aContent == EAiDeviceStatusContentProfileName ) + { + iAnimator->RemoveItem( EAiDeviceStatusContentProfileName ); + } + + TInt currentPriority = iCurrentPriority; + + if( iCurrentContent == aContent ) + { + iCurrentContent = KAiNullContentId; + iCurrentPriority = AiNativeUiModel::KNoPriority; + + // Publish empty text + iStatusPanel.SetNaviPaneTextL( KNullDesC ); + iStatusPanel.RenderNaviPaneL(); + + MAiContentRequest* contentReq = static_cast( + aPlugin.GetPropertyL( EAiContentRequest ) ); + + if ( contentReq ) + { + TInt nextContentId; + while ( iRenderingPriorities.GetNextContentId( + nextContentId, + currentPriority ) ) + { + const TBool refreshed = contentReq->RefreshContent( nextContentId ); + if ( refreshed ) + { + break; + } + } + } + + } + __PRINTS( "XAI: Cleaning navi pane - done"); + break; + } + + case EAiDeviceStatusContentMCNIndicator: + case EAiDeviceStatusContentVHZIndicator: + case EAiDeviceStatusContentCUGIndicator: + { + iAnimator->RemoveItem( aContent ); + break; + } + + default: + { + User::Leave( KErrNotFound ); + break; + } + }; + } + else + { + User::Leave( KErrNotFound ); + } + + } + + +void CAiNaviPaneRenderer::FocusObtainedL() + { + if( !iStatusPanel.IsKeyLockEnabled() ) + { + iAnimator->AnimateL(); + } + iFocusObtained = ETrue; + } + + +void CAiNaviPaneRenderer::FocusLostL() + { + iAnimator->CancelAnimationL(); + iFocusObtained = EFalse; + iCommitted = EFalse; + } + + +void CAiNaviPaneRenderer::KeylockDisabledL() + { + iAnimator->AnimateL(); + } + + +void CAiNaviPaneRenderer::KeylockEnabledL() + { + iAnimator->CancelAnimationL(); + } + + +void CAiNaviPaneRenderer::TransactionCommittedL() + { + if( iIsChanged ) + { + if( iFocusObtained && !iCommitted && !iStatusPanel.IsKeyLockEnabled() ) + { + iAnimator->AnimateL(); + iCommitted = ETrue; + } + iIsChanged = EFalse; + } + } + + +void CAiNaviPaneRenderer::AnimationCompleteL() + { + // Navi pane animation is now completed -> show original text + HBufC* newText = NULL; + + if ( iProfileText->Length() > 0 ) + { + newText = ConstructProfileTextLC(); + } + else + { + return; + } + + iStatusPanel.SetNaviPaneTextL( *newText ); + iStatusPanel.RenderNaviPaneL(); + + CleanupStack::PopAndDestroy( newText ); + } + diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/ainotifierrenderer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/ainotifierrenderer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,143 @@ +/* +* 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: Dialog renderer. +* +*/ + + +#include +#include +#include + +#include + +#include "ainotifierrenderer.h" +#include "ainativeuiplugins.h" + +using namespace AiNativeUiController; + +// 1-minute timeout before showing soft notification +const TInt KNetworkLostTimeout = 60*1000000; + +// ======== MEMBER FUNCTIONS ======== + +CAiNotifierRenderer* CAiNotifierRenderer::NewLC() + { + CAiNotifierRenderer* self = new( ELeave ) CAiNotifierRenderer; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +CAiNotifierRenderer::~CAiNotifierRenderer() + { + delete iSoftNotifier; + delete iTimer; + } + + +CAiNotifierRenderer::CAiNotifierRenderer() + { + } + +void CAiNotifierRenderer::ConstructL() + { + iSoftNotifier = CAknSoftNotifier::NewL(); + iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + } + +void CAiNotifierRenderer::DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aResource, + TInt /*aIndex*/ ) + { + if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + { + switch( aContent ) + { + case EAiDeviceStatusContentNWStatus: + { + if ( aResource == EAiDeviceStatusResourceNWLost ) + { + // Start 60 second timer and when expired show the + // notifier + iTimer->Cancel(); + iTimer->Start( KNetworkLostTimeout, + KNetworkLostTimeout, + TCallBack( NWLostDelayCallBack, this )); + } + else if ( aResource == EAiDeviceStatusResourceNWOk ) + { + iTimer->Cancel(); + RemoveNotification( ESelectNetworkNotification ); + } + break; + } + default: + { + User::Leave( KErrNotFound ); + break; + } + }; + } + else + { + User::Leave( KErrNotFound ); + } + } + +void CAiNotifierRenderer::DoCleanL( MAiPropertyExtension& /*aPlugin*/, + TInt aContent ) + { + switch( aContent ) + { + case EAiDeviceStatusContentNWStatus: + { + iTimer->Cancel(); + RemoveNotification( ESelectNetworkNotification ); + break; + } + default: + { + User::Leave( KErrNotFound ); + break; + } + }; + + } + + +void CAiNotifierRenderer::AddNotification( TAknSoftNotificationType aType ) + { + TRAP_IGNORE( iSoftNotifier->AddNotificationL( aType, 1 ); ); + } + +void CAiNotifierRenderer::RemoveNotification( TAknSoftNotificationType aType) + { + TRAP_IGNORE( iSoftNotifier->CancelSoftNotificationL( aType ); ); + } + +TInt CAiNotifierRenderer::NWLostDelayCallBack(TAny* aParam) + { + CAiNotifierRenderer* self = reinterpret_cast (aParam); + if ( self ) + { + self->iTimer->Cancel(); + self->AddNotification( ESelectNetworkNotification ); + } + return KErrNone; + } + + diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/aisoftkeyrenderer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/aisoftkeyrenderer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,676 @@ +/* +* 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: Handles publishing to title pane. +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ainativeui.hrh" +#include "aisoftkeyrenderer.h" +#include "ainativeuiplugins.h" +#include "aiscutdefs.h" + + +using namespace AiNativeUiController; + +// Index for left softkey; defined in avkon +const TInt KNativeUiLeftSoftkeyId = 0; + +// Index for right softkey; defined in avkon +const TInt KNativeUiRightSoftkeyId = 2; + +const TInt KControlArrayCBAButton1Posn =0; +const TInt KControlArrayCBAButton2Posn =2; +const TInt KControlArrayCBAButtonMiddlePosn =3; + +const TInt KWideScreenWidth = 640; + + +inline TAknWindowComponentLayout DoCompose( TAknWindowComponentLayout aLine1, + TAknWindowComponentLayout aLine2 ) + { + return TAknWindowComponentLayout::Compose( aLine1, aLine2 ); + } + +inline TAknTextComponentLayout DoComposeText( TAknWindowComponentLayout aLine1, + TAknTextComponentLayout aLine2 ) + { + return TAknWindowComponentLayout::ComposeText( aLine1, aLine2 ); + } + + +// ----------------------------------------------------------------------------- +// +// Calculate (whole) softkey area for Bottom button (landscape) +// ----------------------------------------------------------------------------- +static TBool HDLayoutActive() + { + TInt resourceId = 0; + CEikStatusPaneBase* statusPane = CEikStatusPaneBase::Current(); + + if ( statusPane ) // Return the resource ID of app statuspane if it exists. + { + resourceId = statusPane->CurrentLayoutResId(); + } + else // If this app does not have statuspane, then we ask the layout from AknCapServer. + { + resourceId = CAknSgcClient::CurrentStatuspaneResource(); + } + + TBool retVal = EFalse; + + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + // Can be widescreen only in landscape orientation. + retVal = ( resourceId == R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL || + resourceId == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE || + resourceId == R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT || + resourceId == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT ); + } + + return retVal; + } + + +// ----------------------------------------------------------------------------- +// +// Calculate softkey image graphics area for Bottom button (landscape) +// ----------------------------------------------------------------------------- +static TRect SoftkeyRectBottomGraphics() + { + TRect screen; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + + TAknWindowComponentLayout rightAreaLayout( + AknLayoutScalable_Avkon::area_side_right_pane( 0 ) ); + + TAknWindowComponentLayout bottomSKLayout( + DoCompose( rightAreaLayout, + AknLayoutScalable_Avkon::sctrl_sk_bottom_pane() ) ); + + // Calculate softkey rects. + // Left (bottom in landscape) softkey layout. + TAknLayoutRect leftSoftkeyLayoutRect; + leftSoftkeyLayoutRect.LayoutRect( screen, + bottomSKLayout.LayoutLine() ); + TRect leftSoftKeyButtonRect( leftSoftkeyLayoutRect.Rect() ); + + // Calculate softkey image layout. + // Left (bottom in landscape) softkey layout. + TAknWindowLineLayout leftSoftkeyImageLayout( + DoCompose( + bottomSKLayout, + AknLayoutScalable_Avkon::sctrl_sk_bottom_pane_g1() ).LayoutLine() ); + + + TAknLayoutRect qgn_graf_sk_left; + qgn_graf_sk_left.LayoutRect( screen, leftSoftkeyImageLayout ); + + return qgn_graf_sk_left.Rect(); + } + + +// ----------------------------------------------------------------------------- +// +// Calculate softkey image graphics area for Top button (landscape) +// ----------------------------------------------------------------------------- +static TRect SoftkeyRectTopGraphics() + { + TRect screen; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + + TAknWindowComponentLayout rightAreaLayout( + AknLayoutScalable_Avkon::area_side_right_pane( 0 ) ); + + TAknWindowComponentLayout topSKLayout( + DoCompose( rightAreaLayout, + AknLayoutScalable_Avkon::sctrl_sk_top_pane() ) ); + + // Calculate softkey rects. + // Right (top in landscape) softkey layout. + TAknLayoutRect rightSoftkeyLayoutRect; + rightSoftkeyLayoutRect.LayoutRect( screen, + topSKLayout.LayoutLine() ); + TRect rightSoftKeyButtonRect( rightSoftkeyLayoutRect.Rect() ); + + // Left (bottom in landscape) softkey layout. + // Right (top in landscape) softkey layout. + TAknWindowLineLayout rightSoftkeyImageLayout( + DoCompose( + topSKLayout, + AknLayoutScalable_Avkon::sctrl_sk_top_pane_g1() ).LayoutLine() ); + + TAknLayoutRect qgn_graf_sk_right; + qgn_graf_sk_right.LayoutRect( screen, rightSoftkeyImageLayout ); + return qgn_graf_sk_right.Rect(); + } + + +// ----------------------------------------------------------------------------- +// SoftkeyRectL +// Calculate soft key rect +// ----------------------------------------------------------------------------- +static TRect SoftkeyRectL( CEikButtonGroupContainer& aContainer, TInt aPos, TBool aImageOn ) + { + TRect rect; + + if( AknStatuspaneUtils::StaconPaneActive() ) + { + TInt variety( 0 ); + + if( AknStatuspaneUtils::StaconSoftKeysLeft() ) + { + variety = 1; + } + + TRect parentRect( iAvkonAppUi->ApplicationRect() ); + + switch( aPos ) + { + case KControlArrayCBAButton1Posn: + { + TAknWindowComponentLayout layout0( AknLayoutScalable_Avkon::area_bottom_pane( 2 ) ); + TAknWindowComponentLayout layout1( AknLayoutScalable_Avkon::stacon_bottom_pane() ); + + // If clock is shown in stacon, cba area is smaller. + TInt bottomCbaVariety( variety ); + + if( AknStatuspaneUtils::ExtendedStaconPaneActive() ) + { + bottomCbaVariety += 2; + } + + TAknWindowComponentLayout layout2( AknLayoutScalable_Avkon::control_bottom_pane_stacon( bottomCbaVariety ) ); + + if( aImageOn ) + { + // Icon layout + TAknWindowComponentLayout iconLayout( AknLayoutScalable_Avkon::control_bottom_pane_stacon_g1() ); + + TAknWindowComponentLayout lskIconLayout( DoCompose( layout0, + DoCompose( layout1, DoCompose( layout2, iconLayout ) ) ) ); + + TAknWindowLineLayout lskIcon( lskIconLayout.LayoutLine() ); + + TAknLayoutRect qgn_icon_lsk; + + qgn_icon_lsk.LayoutRect( parentRect, lskIcon ); + + rect = qgn_icon_lsk.Rect(); + } + else + { + // Text layout + TAknTextComponentLayout textLayout( AknLayoutScalable_Avkon::control_bottom_pane_stacon_t1( variety ) ); + + TAknTextComponentLayout lskTextLayout( DoComposeText( layout0, + DoComposeText( layout1, DoComposeText( layout2, textLayout ) ) ) ); + + TAknTextLineLayout lskText( lskTextLayout.LayoutLine() ); + + TAknLayoutText qgn_text_lsk; + + qgn_text_lsk.LayoutText( parentRect, lskText ); + + rect = qgn_text_lsk.TextRect(); + } + } + break; + case KControlArrayCBAButton2Posn: + { + TAknWindowComponentLayout layout0( AknLayoutScalable_Avkon::area_top_pane( 2 ) ); + TAknWindowComponentLayout layout1( AknLayoutScalable_Avkon::stacon_top_pane() ); + + TInt topCbaVariety( variety ); + + if( AknStatuspaneUtils::ExtendedStaconPaneActive() ) + { + topCbaVariety += 4; + } + + TAknWindowComponentLayout layout2( AknLayoutScalable_Avkon::control_top_pane_stacon( topCbaVariety ) ); + + if( aImageOn ) + { + // Icon layout + TAknWindowComponentLayout iconLayout( AknLayoutScalable_Avkon::control_top_pane_stacon_g1() ); + + TAknWindowComponentLayout rskIconLayout( DoCompose( layout0, + DoCompose( layout1, DoCompose( layout2, iconLayout ) ) ) ); + + TAknWindowLineLayout rskIcon( rskIconLayout.LayoutLine() ); + + TAknLayoutRect qgn_icon_rsk; + + qgn_icon_rsk.LayoutRect( parentRect, rskIcon ); + + rect = qgn_icon_rsk.Rect(); + } + else + { + // Text layout + TAknTextComponentLayout textLayout( AknLayoutScalable_Avkon::control_top_pane_stacon_t1( variety ) ); + + TAknTextComponentLayout rskTextLayout( DoComposeText( layout0, + DoComposeText( layout1, DoComposeText( layout2, textLayout ) ) ) ); + + TAknTextLineLayout rskText( rskTextLayout.LayoutLine() ); + + TAknLayoutText qgn_text_rsk; + + qgn_text_rsk.LayoutText( parentRect, rskText ); + + rect = qgn_text_rsk.TextRect(); + } + } + break; + default: + User::Leave( KErrNotSupported ); + break; + + } + } + else + { + TInt textVariety( 0 ); + TInt graphVariety( 0 ); + + TBool mskEnabled( AknLayoutUtils::MSKEnabled() && Layout_Meta_Data::IsMSKEnabled() ); + + if ( mskEnabled ) + { + textVariety = Layout_Meta_Data::IsLandscapeOrientation() ? 2 : 3; + graphVariety = Layout_Meta_Data::IsLandscapeOrientation() ? 2 : 4; + } + else + { + textVariety = Layout_Meta_Data::IsLandscapeOrientation() ? 2 : 0; + graphVariety = Layout_Meta_Data::IsLandscapeOrientation() ? 2 : 4; + } + + CEikCba* cba( static_cast< CEikCba* >( aContainer.ButtonGroup() ) ); + + TRect parentRect( cba->Rect() ); + + switch( aPos ) + { + case KControlArrayCBAButton1Posn: + { + if( aImageOn ) + { + if ( HDLayoutActive() && + AKN_LAYOUT_WINDOW_screen.iW == KWideScreenWidth ) + { + rect = SoftkeyRectBottomGraphics(); + } + else + { + + TAknLayoutRect qgn_icon_lsk; + + qgn_icon_lsk.LayoutRect( parentRect, + AknLayoutScalable_Avkon::control_pane_g1( graphVariety ).LayoutLine() ); + + rect = qgn_icon_lsk.Rect(); + } + } + else + { + TAknLayoutText qgn_text_lsk; + + qgn_text_lsk.LayoutText( parentRect, + AknLayoutScalable_Avkon::control_pane_t1( textVariety ).LayoutLine() ); + + rect = qgn_text_lsk.TextRect(); + } + } + break; + case KControlArrayCBAButton2Posn: + { + if( aImageOn ) + { + if ( HDLayoutActive() && + AKN_LAYOUT_WINDOW_screen.iW == KWideScreenWidth ) + { + rect = SoftkeyRectTopGraphics(); + } + else + { + TAknLayoutRect qgn_icon_rsk; + + qgn_icon_rsk.LayoutRect( parentRect, + AknLayoutScalable_Avkon::control_pane_g2( graphVariety ).LayoutLine() ); + + rect = qgn_icon_rsk.Rect(); + } + } + else + { + TAknLayoutText qgn_text_rsk; + + qgn_text_rsk.LayoutText( parentRect, + AknLayoutScalable_Avkon::control_pane_t2( textVariety ).LayoutLine() ); + + rect = qgn_text_rsk.TextRect(); + } + } + break; + case KControlArrayCBAButtonMiddlePosn: + { + if( !mskEnabled || aImageOn ) + { + // No msk, or asking image size for msk + User::Leave( KErrNotSupported ); + } + else + { + TAknLayoutText qgn_text_msk; + + qgn_text_msk.LayoutText( parentRect, + AknLayoutScalable_Avkon::control_pane_t3( textVariety ).LayoutLine() ); + + rect = qgn_text_msk.TextRect(); + } + } + break; + default: + User::Leave( KErrNotFound ); + break; + } + } + + return rect; + } + + +// ----------------------------------------------------------------------------- +// SoftkeySizeL +// Calculate soft key size +// ----------------------------------------------------------------------------- +static TSize SoftkeySizeL( CEikButtonGroupContainer& aContainer, TInt aPos, TBool aImageOn ) + { + TSize size( SoftkeyRectL( aContainer, aPos, aImageOn ).Size() ); + + return size; + } + + +void CAiSoftKeyRenderer::ConstructL() + { + // load default soft key labels from resource + CreateDefaultSoftKeysL(); + } + + +CAiSoftKeyRenderer* CAiSoftKeyRenderer::NewLC() + { + CAiSoftKeyRenderer* self = new( ELeave ) CAiSoftKeyRenderer(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +CAiSoftKeyRenderer::~CAiSoftKeyRenderer() + { + delete iText; + + if ( iCba ) + { + CEikCba* cba = + static_cast< CEikCba* >( iCba->ButtonGroup() ); + iAppUi->RemoveFromStack( cba ); + } + delete iCba; + } + + +CAiSoftKeyRenderer::CAiSoftKeyRenderer() + { + iAppUi = iAvkonAppUi; + } + + + + +void CAiSoftKeyRenderer::DoPublishL( MAiPropertyExtension& 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 ); + } + } + + +void CAiSoftKeyRenderer::DoPublishL( MAiPropertyExtension& 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 ); + } + } + + +void CAiSoftKeyRenderer::DoPublishL( MAiPropertyExtension& 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 ); + } + } + + +void CAiSoftKeyRenderer::CreateDefaultSoftKeysL() + { + // If we already have cba, then do nothing. + if ( iCba ) + { + return; + } + + // Otherwise create brand new cba. + iCba = CEikButtonGroupContainer::NewL( + CEikButtonGroupContainer::ECba, + CEikButtonGroupContainer::EHorizontal, + iAppUi, + R_NATIVEUI_SOFTKEYS_DEFAULT, + 0 ); // Does not add to stack + + iCba->SetBoundingRect( iAppUi->ApplicationRect() ); + + CCoeControl* cba = iCba->ButtonGroup()->AsControl(); + + static_cast(cba)->SetSkinBackgroundId( + KAknsIIDQsnBgAreaControlIdle ); + + cba->MakeVisible( ETrue ); + + iAppUi->RemoveFromStack( cba ); // Well, it is not in stack + iAppUi->AddToStackL( cba, + KNativeUiCbaPriority, + ECoeStackFlagRefusesFocus | ECoeStackFlagRefusesAllKeys ); + } + + +void CAiSoftKeyRenderer::UpdateSoftKeyL( TInt aKey, CGulIcon* aIcon ) + { + if( !iCba ) + { + iCba = iAppUi->Cba(); + } + + // remove the locked flag if any + aKey &= KScutBitMaskLocked; + + TInt buttonPosImage; + TInt buttonPosText; + TInt buttonCmd; + + if( aKey == KLeftSoftkeyId ) + { + buttonPosImage = KControlArrayCBAButton1Posn; + buttonPosText = KNativeUiLeftSoftkeyId; + buttonCmd = ENativeUiSoftkeyLeft; + } + else if(aKey == KRightSoftkeyId) + { + buttonPosImage = KControlArrayCBAButton2Posn; + buttonPosText = KNativeUiRightSoftkeyId; + buttonCmd = ENativeUiSoftkeyRight; + } + else + { + delete aIcon; + return; + } + + if( aIcon ) + { + CleanupStack::PushL( aIcon ); + + TSize size( SoftkeySizeL( *iCba, buttonPosImage, ETrue ) ); + + AknIconUtils::SetSize( aIcon->Bitmap(), size, EAspectRatioPreserved ); + AknIconUtils::SetSize( aIcon->Mask(), size, EAspectRatioPreserved ); + + CEikImage* image = new ( ELeave ) CEikImage; + image->SetPictureOwnedExternally( EFalse ); + // Bitmap and mask ownerships are transferred + image->SetPicture( aIcon->Bitmap(), aIcon->Mask() ); + aIcon->SetBitmapsOwnedExternally( ETrue ); + + // Image ownership is transferred + EikSoftkeyImage::SetImage( iCba, *image, aKey == KLeftSoftkeyId ); + + CleanupStack::PopAndDestroy( aIcon ); + } + else + { + EikSoftkeyImage::SetLabel( iCba, aKey == KLeftSoftkeyId ); + iCba->SetCommandL( buttonPosText, + buttonCmd, + *iText ); + } + + iCba->DrawDeferred(); + } diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/aistatuspanel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/aistatuspanel.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,430 @@ +/* +* 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: Handles of drawing text on navi and title panes. +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "aistatuspanel.h" +#include "debug.h" + +using namespace AiNativeUiController; + +// Read capability: ReadDeviceData. +_LIT_SECURITY_POLICY_C1( KReadPolicy, ECapabilityReadDeviceData ); +// Write capability: WriteDeviceData. +_LIT_SECURITY_POLICY_C1( KWritePolicy, ECapabilityWriteDeviceData ); + + +void CAiStatusPanel::ConstructL() + { + // Display info + RProperty::Define( + KPSUidTelInformation, + KTelDisplayInfo, + RProperty::EByteArray, + KReadPolicy, + KWritePolicy ); + + // RenderTitlePaneL() can be called without the bitmap set to valid handle + iBitmapHandle = KErrNotFound; + // Get pointer to status pane + iStatusPane = static_cast( CEikonEnv::Static()-> + EikAppUi() )->StatusPane(); + + // If status pane can't be initialized, let framework handle the problem + if( !iStatusPane ) + { + User::Leave( KErrNotFound ); + } + + //Get pointer to title pane + iTitlePane = ( CAknTitlePane* )iStatusPane->ControlL( + TUid::Uid( EEikStatusPaneUidTitle ) ); + + // If title pane can't be initialized, let framework handle the problem + if( !iTitlePane ) + { + User::Leave( KErrNotFound ); + } + + //Get pointer to navi pane + iNaviPane = (CAknNavigationControlContainer *)iStatusPane-> + ControlL(TUid::Uid(EEikStatusPaneUidNavi)); + + // If navi pane can't be initialized, let framework handle the problem + if( !iNaviPane ) + { + User::Leave( KErrNotFound ); + } + + // Construct navi pane + //iNaviDecorator = iNaviPane->CreateNavigationLabelL( KNullDesC() ); + //iNaviPane->PushL( *iNaviDecorator ); + +#ifdef _DEBUG + _LIT(titlepanetext, "Operator"); + SetTitlePaneTextL(titlepanetext); +#endif + } + + +CAiStatusPanel* CAiStatusPanel::NewL() + { + CAiStatusPanel* self = new( ELeave ) CAiStatusPanel; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + + +CAiStatusPanel::~CAiStatusPanel() + { + delete iTitlePaneText; + delete iNaviPaneText; + delete iNaviDecorator; + } + + +CAiStatusPanel::CAiStatusPanel() + { + } + + +void CAiStatusPanel::RenderTextOnNaviPaneL() + { + if( iNaviPaneText ) + { + if (!iNaviDecorator) + { + iNaviDecorator = iNaviPane->CreateNavigationLabelL( KNullDesC() ); + + iNaviDecorator->SetNaviDecoratorObserver( iNaviDecoratorObserver ); + + iNaviPane->PushL( *iNaviDecorator ); + } + CAknNaviLabel* naviLabel = + static_cast< CAknNaviLabel* >( iNaviDecorator->DecoratedControl() ); + if( naviLabel ) + { + naviLabel->SetTextL( *iNaviPaneText ); + iNaviDecorator->DrawDeferred(); + } + else + { + User::Leave( KErrNotFound ); + } + } + else + { + iNaviPane->Pop( iNaviDecorator ); + delete iNaviDecorator; + iNaviDecorator = NULL; + } + } + +void CAiStatusPanel::RenderTextOnTitlePaneL() + { + __PRINTS("XAI: Rendering text to title pane"); + if( !iTitlePaneText ) + { + __PRINTS("XAI: Rendering text to title pane - invalid text, aborting"); + return; + } + + TTelTitleDisplay displayText; + displayText.iLogoHandle = 0; + displayText.iLogoMaskHandle = 0; + TBool scroll = !IsKeyLockEnabled(); + iTitlePane->SetText( iTitlePaneText, scroll ); + displayText.iDisplayTag.Copy( + iTitlePaneText->Left(displayText.iDisplayTag.MaxLength()) ); + + // SetText took ownership + iTitlePaneText = NULL; + + UpdatePhoneDisplayInfo( displayText ); + __PRINTS("XAI: Rendering text to title pane - done"); + } + + +void CAiStatusPanel::RenderBitmapOnTitlePaneL() + { + __PRINTS("XAI: Rendering bitmap to title pane"); + if( iBitmapHandle == KErrNotFound ) + { + __PRINTS("XAI: Rendering bitmap to title pane - invalid bitmap handle, aborting"); + return; + } + + TSize size; + TRect rect; + TBool hasTitlePane = AknLayoutUtils::LayoutMetricsRect( + AknLayoutUtils::ETitlePane, rect ); + if ( !hasTitlePane ) + { + // no title pane, size is unknown. + User::Leave( KErrNotReady ); + } + User::LeaveIfError( GetTitlePaneSize( size ) ); + + // CAknIcon takes ownership of bitmaps. + CFbsBitmap* dupMain = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( dupMain ); + User::LeaveIfError( + dupMain->Duplicate( iBitmapHandle ) ); + + CFbsBitmap* dupMask = NULL; + if ( iMaskHandle != KErrNotFound ) + { + dupMask = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( dupMask ); + User::LeaveIfError( + dupMask->Duplicate( iMaskHandle ) ); + } + + //bitmapIcon is not pushed to cleanupstack, ownership + //is transferred later + CAknIcon* bitmapIcon = CAknIcon::NewL(); + bitmapIcon->SetMask( dupMask ); // ownership transferred + if ( iMaskHandle != KErrNotFound ) + { + CleanupStack::Pop( dupMask ); + } + + bitmapIcon->SetBitmap( dupMain ); // ownership transferred + CleanupStack::Pop( dupMain ); + + //ownership of bitmapIcon is transferred + CAknIcon* scalableIcon = AknIconUtils::CreateIconL( bitmapIcon ); + CleanupStack::PushL( scalableIcon ); + + AknIconUtils::SetSize( scalableIcon->Bitmap(), size, + EAspectRatioPreservedAndUnusedSpaceRemoved ); + AknIconUtils::SetSize( scalableIcon->Mask(), size, + EAspectRatioPreservedAndUnusedSpaceRemoved ); + + // Title pane takes ownership of icons. + CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( bitmap ); + User::LeaveIfError( bitmap->Duplicate( scalableIcon->Bitmap()->Handle() ) ); + + // Check if icon has mask + CFbsBitmap* bitmapMask = NULL; + if ( scalableIcon->Mask() ) + { + bitmapMask = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( bitmapMask ); + User::LeaveIfError( + bitmapMask->Duplicate( scalableIcon->Mask()->Handle() ) ); + } + + // Set the icon in title pane... + iTitlePane->SetPicture( bitmap, bitmapMask ); + + const TInt bitmapHandle = bitmap ? bitmap->Handle() : 0; + const TInt bitmapMaskHandle = bitmapMask ? bitmapMask->Handle() : 0; + + // ... and inform TSY to use it + TTelTitleDisplay displayText; + displayText.iDisplayTag.Zero(); + displayText.iLogoHandle = bitmapHandle; + displayText.iLogoMaskHandle = bitmapMaskHandle; + + UpdatePhoneDisplayInfo( displayText ); + + if ( bitmapMask ) + { + CleanupStack::Pop( bitmapMask ); + } + CleanupStack::Pop( bitmap ); + CleanupStack::PopAndDestroy( scalableIcon ); + + + // Assume invalid bitmaps. Client needs to set the handles again + // Otherwise invalid handles could be hold here and when drawing + // undetermined stuff could occurr + iBitmapHandle = KErrNotFound; + iMaskHandle = KErrNotFound; + __PRINTS("XAI: Rendering bitmap to title pane - done"); + } + +TInt CAiStatusPanel::GetTitlePaneSize( TSize& aSize ) + { + TRect titlePaneRect; + TBool hasTitlePane = AknLayoutUtils::LayoutMetricsRect( + AknLayoutUtils::ETitlePane, titlePaneRect ); + + if ( !hasTitlePane ) + { + return KErrNotFound; + } + + TAknLayoutRect oplogoLayout; + + if ( AknStatuspaneUtils::StaconPaneActive() ) + { + // stacon + oplogoLayout.LayoutRect( titlePaneRect, + AknLayoutScalable_Avkon::title_pane_stacon_g2(0).LayoutLine() ); + } + else if ( AknStatuspaneUtils::FlatLayoutActive() ) + { + // flat + oplogoLayout.LayoutRect( titlePaneRect, + AknLayoutScalable_Avkon::title_pane_stacon_g2(0).LayoutLine() ); + } + else + { + // usual idle + oplogoLayout.LayoutRect( titlePaneRect, + AknLayout::Title_pane_elements_Line_1() ); + } + + aSize = oplogoLayout.Rect().Size(); + + return KErrNone; + } + + +void CAiStatusPanel::UpdatePhoneDisplayInfo( const TTelTitleDisplay& aDisplayInfo ) + { + TBool changed = EFalse; + TBool indicatorChanged = + aDisplayInfo.iDisplayTag != iDisplayInfo.iDisplayTag || + aDisplayInfo.iLogoHandle != iDisplayInfo.iLogoHandle || + aDisplayInfo.iLogoMaskHandle != iDisplayInfo.iLogoMaskHandle; + + if ( indicatorChanged ) + { + changed = ETrue; + iDisplayInfo.iDisplayTag = aDisplayInfo.iDisplayTag; + iDisplayInfo.iLogoHandle = aDisplayInfo.iLogoHandle; + iDisplayInfo.iLogoMaskHandle = aDisplayInfo.iLogoMaskHandle; + } + + if ( changed ) + { + TTelTitleDisplay::TDisplayInfoPckg pckg( iDisplayInfo ); + RProperty::Set( + KPSUidTelInformation, + KTelDisplayInfo, + pckg ); + } + } + + +void CAiStatusPanel::SetNaviPaneTextL( const TDesC& aText ) + { + delete iNaviPaneText; + iNaviPaneText = NULL; + if ( !AknStatuspaneUtils::FlatLayoutActive() ) + { + HBufC* temp = aText.AllocL(); + iNaviPaneText = temp; + } + } + + + +void CAiStatusPanel::SetTitlePaneTextL( const TDesC& aText ) + { + HBufC* temp = aText.AllocL(); + delete iTitlePaneText; + iTitlePaneText = temp; + } + + +void CAiStatusPanel::SetTitlePaneBitmapL( TInt aBitmapHandle, TInt aMaskHandle ) + { + iBitmapHandle = aBitmapHandle; + iMaskHandle = aMaskHandle; + } + + +void CAiStatusPanel::RenderTitlePaneL() + { + RenderTextOnTitlePaneL(); + RenderBitmapOnTitlePaneL(); + } + + +void CAiStatusPanel::RenderNaviPaneL() + { + RenderTextOnNaviPaneL(); + } + +void CAiStatusPanel::StopTitlePaneScrollingL() + { + //stop scrolling + if( iTitlePane->Text() ) + { + iTitlePane->SetTextL( *iTitlePane->Text(), EFalse ); + } + } + +void CAiStatusPanel::ScrollTitlePaneTextL() + { +// start scrolling + if( iTitlePane->Text() ) + { + iTitlePane->SetTextL( *iTitlePane->Text(), ETrue ); + } + } + +void CAiStatusPanel::SetNaviDecoratorObserver( MAknNaviDecoratorObserver* aObserver ) + { + iNaviDecoratorObserver = aObserver; + } + +void CAiStatusPanel::SetTitlePaneObserver( MAknTitlePaneObserver* aObserver ) + { + iTitlePane->SetTitlePaneObserver( aObserver ); + } + +TBool CAiStatusPanel::IsKeyLockEnabled() + { + TInt value; + TInt err = RProperty::Get(KPSUidAvkonDomain, KAknKeyguardStatus, value); + if ( err != KErrNone ) + return EFalse; + switch( value ) + { + case EKeyguardLocked: + case EKeyguardAutolockEmulation: + return ETrue; + case EKeyguardNotActive: + default: + return EFalse; + } + } + diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/aistatuspanetouchui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/aistatuspanetouchui.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,310 @@ +/* +* 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: Choice list. +* +*/ + + +#include +#include + +#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; + +_LIT( KProfileSwitchByIndexEvent, "Profile/SwitchProfileByIndex" ); +const TInt KProfileSwitchByIndexEventLength = 28; +const TInt KRadix = 10; +const TText16 KEventParameterTerminator = ')'; +const TInt KExtraItems = 2; +const TInt KStylusMenuMaxItemsDefault = 0; + +_LIT( KOpenAppProfiles, "Shortcut/LaunchByValue(localapp:0x100058F8)" ); +_LIT( KOpenAppCalendar, "Shortcut/LaunchByValue(localapp:0x10005901)" ); + +static TInt IndexLength( TInt aIndex ) + { + TInt length = 0; + + if ( aIndex < 0 ) + { + ++length; + } + + do + { + aIndex /= KRadix; + ++length; + } + while ( aIndex != 0 ); + return length; + } + +// ======== MEMBER FUNCTIONS ======== + + +CAiStatusPaneTouchUi* CAiStatusPaneTouchUi::NewL( CAiStatusPanel& aStatusPanel, + MAiFwEventHandler& aEventHandler ) + { + CAiStatusPaneTouchUi* self = CAiStatusPaneTouchUi::NewLC( aStatusPanel, aEventHandler ); + CleanupStack::Pop( self ); + + return self; + } + +CAiStatusPaneTouchUi* CAiStatusPaneTouchUi::NewLC( CAiStatusPanel& aStatusPanel, + MAiFwEventHandler& aEventHandler ) + { + CAiStatusPaneTouchUi* self = new (ELeave) CAiStatusPaneTouchUi( aStatusPanel, aEventHandler ); + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +CAiStatusPaneTouchUi::CAiStatusPaneTouchUi( CAiStatusPanel& aStatusPanel, + MAiFwEventHandler& aEventHandler ) + : + iStatusPane( aStatusPanel ), + iEventHandler( aEventHandler ) + { + // no implementation required + } + +CAiStatusPaneTouchUi::~CAiStatusPaneTouchUi() + { + delete iEventBuffer; + delete iMenu; + iProfileNamePointerArray.ResetAndDestroy(); + } + +void CAiStatusPaneTouchUi::ConstructL() + { + if( AknLayoutUtils::PenEnabled() ) + { + iStatusPane.SetNaviDecoratorObserver( this ); + } + } + +void CAiStatusPaneTouchUi::LoadUIDefinitionL() + { + // If profile popup exists, for example, when screendevicechange occurs, + // the popup is closed + if( iMenu ) + { + delete iMenu; + iMenu = NULL; + } + } + +void CAiStatusPaneTouchUi::ProcessCommandL( TInt aCommandId ) + { + if( aCommandId == EAIGotoCalendarCmdLink ) + { + //Open calendar application + iEventHandler.HandlePluginEvent( KOpenAppCalendar ); + } + else if( aCommandId == EAIShowAllProfileCmdLink ) + { + //Open profile application + iEventHandler.HandlePluginEvent( KOpenAppProfiles ); + } + else + { + + // Calculate event buffer length + TInt length = KProfileSwitchByIndexEventLength + + KPluginEventSeparatorLength + + IndexLength( aCommandId - EAIProfileCmdLink ) + + KEventParameterSeparatorLength; + + // Allocate event buffer + TPtr event = AiUtility::EnsureBufMaxLengthL( iEventBuffer, length ); + + // Create event string + event.Zero(); + event.Append( KProfileSwitchByIndexEvent ); + event.Append( KEventParameterSeparator ); + event.AppendNum( aCommandId - EAIProfileCmdLink ); + event.Append( KEventParameterTerminator ); + + iEventHandler.HandlePluginEvent( event ); + } + } + + + +void CAiStatusPaneTouchUi::HandleNaviDecoratorEventL( TInt aEventID ) + { + if( aEventID == EAknNaviDecoratorEventNaviLabel ) + { +#ifdef RD_TACTILE_FEEDBACK + MTouchFeedback* feedback = MTouchFeedback::Instance(); + if ( feedback ) + { + feedback->InstantFeedback( ETouchFeedbackBasic ); + } +#endif + + TBool isShowAllProfilesItem = EFalse; + TInt count = iProfileNamePointerArray.Count(); + + if ( !count ) + { + //profile plugin is not ready! + return; + } + + TInt aiStylusMenuMaxItems = KStylusMenuMaxItemsDefault; + TPoint tapPoint(0,0); + TRect clientRect; + TRect naviRect; + + // Check screen sizes + TInt isMainPane = AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, clientRect ); + TInt isNaviPane = AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::ENaviPane, naviRect ); + + // Calculating how many items fits into menu, using font height + TAknLayoutText layoutText; + layoutText.LayoutText( naviRect, + AknLayoutScalable_Avkon::list_single_touch_menu_pane_t1().LayoutLine()); + + TInt txtHeight = layoutText.Font()->HeightInPixels(); + // More additional space for marginals + txtHeight += txtHeight + txtHeight/2; + + if( isNaviPane ) + { + if ( AknLayoutUtils::LayoutMirrored() ) + { + tapPoint.SetXY( naviRect.iBr.iX, naviRect.iBr.iY ); + } + else + { + tapPoint.SetXY( naviRect.iTl.iX, naviRect.iBr.iY ); + } + } + + if ( iMenu ) + { + delete iMenu; + iMenu = NULL; + } + + iMenu = CAknStylusPopUpMenu::NewL( this, tapPoint ); + + if( isMainPane ) + { + // Count how many menu items would fit into screen + aiStylusMenuMaxItems = clientRect.Height() / txtHeight; + } + + HBufC* caleText = StringLoader::LoadLC( R_IDLE_NAVI_TAPPED_CALE ); + iMenu->AddMenuItemL( *caleText, EAIGotoCalendarCmdLink ); + CleanupStack::PopAndDestroy( caleText ); + count++; + + // Space for 2 extra items GotoCalendar and ShowAllProfiles + if( count > aiStylusMenuMaxItems ) + { + count = aiStylusMenuMaxItems - KExtraItems; + isShowAllProfilesItem = ETrue; + } + else + { + count -= 1; + } + + for( TInt i = 0; i < count; i++ ) + { + iMenu->AddMenuItemL( iProfileNamePointerArray[i]->Des(), i + EAIProfileCmdLink ); + } + + if( isShowAllProfilesItem ) + { + HBufC* allProfilesText = StringLoader::LoadLC( R_IDLE_NAVI_TAPPED_ALL_PROF ); + iMenu->AddMenuItemL( *allProfilesText, EAIShowAllProfileCmdLink ); + CleanupStack::PopAndDestroy( allProfilesText ); + } + + iMenu->ShowMenu(); + } + } + + +void CAiStatusPaneTouchUi::DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC16& aText, + TInt aIndex ) + { + if( aPlugin.PublisherInfoL()->iUid == KProfilePluginUid ) + { + switch( aContent ) + { + case EAiProfileContentProfileName: + { + if( aIndex - 1 == 0 ) + { + iProfileNamePointerArray.ResetAndDestroy(); + } + + TInt count = iProfileNamePointerArray.Count(); + + if( count >= aIndex ) + { + delete iProfileNamePointerArray[ aIndex - 1 ]; + iProfileNamePointerArray.Remove( aIndex - 1); + } + + HBufC* name = aText.AllocL(); + iProfileNamePointerArray.Insert( name, aIndex - 1 ); + break; + } + default: + { + break; + } + }; + } + + else + { + User::Leave( KErrNotFound ); + } + } + +void CAiStatusPaneTouchUi::SetEmphasis( CCoeControl* /*aMenuControl*/, TBool /*aEmphasis*/ ) + { + } + + diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/aistyluspopupmenu.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/aistyluspopupmenu.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,250 @@ +/* +* Copyright (c) 2005-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface for controlling stylus popup menu. +* +*/ + + +#include +#include +#include +#include + +#include "aistyluspopupmenu.h" +#include "aistyluspopupmenucontent.h" + +const TInt KDefaultPopUpShowDelay = 0; +const TInt KDefaultPopUpHideDelay = 10000000; // 10 seconds + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Default constructor +// --------------------------------------------------------------------------- +// +CAiStylusPopUpMenu::CAiStylusPopUpMenu( MEikMenuObserver* aObserver, + const TPoint& aPoint, + CAknPreviewPopUpController* aPopup ) + : iPosition ( aPoint ), + iMenuObserver( aObserver ), + iPreviewPopup( aPopup ) + { + } + +// --------------------------------------------------------------------------- +// CAiStylusPopUpMenu::ConstructL +// --------------------------------------------------------------------------- +// +void CAiStylusPopUpMenu::ConstructL() + { + iContent = CAiStylusPopUpMenuContent::NewL(); + + iController = CAknPreviewPopUpController::NewL( *iContent, + CAknPreviewPopUpController::ELayoutSubMenu ); + iController->SetPopUpShowDelay( KDefaultPopUpShowDelay ); + iController->SetPopUpHideDelay( KDefaultPopUpHideDelay ); + iController->SetPosition( iPosition ); + } + +// --------------------------------------------------------------------------- +// CAiStylusPopUpMenu::NewL +// --------------------------------------------------------------------------- +// +CAiStylusPopUpMenu* CAiStylusPopUpMenu::NewL( + MEikMenuObserver* aObserver, const TPoint& aPoint, + CAknPreviewPopUpController* aPopup ) + { + if( !AknLayoutUtils::PenEnabled() ) + { + return NULL; + } + + CAiStylusPopUpMenu* self = CAiStylusPopUpMenu::NewLC( aObserver, + aPoint, + aPopup ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CAiStylusPopUpMenu::NewL +// --------------------------------------------------------------------------- +// +CAiStylusPopUpMenu* CAiStylusPopUpMenu::NewL( + MEikMenuObserver* aObserver, const TPoint& aPoint ) + { + if( !AknLayoutUtils::PenEnabled() ) + { + return NULL; + } + + CAiStylusPopUpMenu* self = CAiStylusPopUpMenu::NewLC( aObserver, + aPoint, NULL ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CAiStylusPopUpMenu::NewLC +// --------------------------------------------------------------------------- +// +CAiStylusPopUpMenu* CAiStylusPopUpMenu::NewLC( + MEikMenuObserver* aObserver, const TPoint& aPoint, + CAknPreviewPopUpController* aPopup ) + { + if( !AknLayoutUtils::PenEnabled() ) + { + return NULL; + } + + CAiStylusPopUpMenu* self = new ( ELeave ) CAiStylusPopUpMenu( aObserver, + aPoint, + aPopup ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CAiStylusPopUpMenu::~CAiStylusPopUpMenu() + { + if ( AknLayoutUtils::PenEnabled() ) + { + delete iController; + delete iContent; + } + } + + +// --------------------------------------------------------------------------- +// CAiStylusPopUpMenu::AddMenuItemL +// --------------------------------------------------------------------------- +// +void CAiStylusPopUpMenu::AddMenuItemL( const TDesC& aItem, + const TInt aCommandId ) + { + if(AknLayoutUtils::PenEnabled()) + { + iContent->AddMenuItemL( aItem, aCommandId, *this ); + } + } + + + +// --------------------------------------------------------------------------- +// CAiStylusPopUpMenu::RemoveMenuItem +// --------------------------------------------------------------------------- +// +void CAiStylusPopUpMenu::RemoveMenuItem( const TInt aCommandId ) + { + if(AknLayoutUtils::PenEnabled()) + { + iContent->RemoveMenuItem( aCommandId ); + } + } + +// --------------------------------------------------------------------------- +// CAiStylusPopUpMenu::SetItemDimmed +// --------------------------------------------------------------------------- +// +void CAiStylusPopUpMenu::SetItemDimmed( const TInt aCommandId, const TBool aDimmed ) + { + if(AknLayoutUtils::PenEnabled()) + { + iContent->SetItemDimmed( aCommandId, aDimmed ); + } + } + +// --------------------------------------------------------------------------- +// CAiStylusPopUpMenu::ShowMenu +// --------------------------------------------------------------------------- +// +void CAiStylusPopUpMenu::ShowMenu() + { + if(AknLayoutUtils::PenEnabled()) + { + iController->ShowPopUp(); + } + } + + +// --------------------------------------------------------------------------- +// CAiStylusPopUpMenu::SetPosition +// --------------------------------------------------------------------------- +// +void CAiStylusPopUpMenu::SetPosition( const TPoint& aPoint ) + { + if(AknLayoutUtils::PenEnabled()) + { + iController->SetPosition( aPoint ); + } + } + +// --------------------------------------------------------------------------- +// CAiStylusPopUpMenu::ConstructFromResourceL +// --------------------------------------------------------------------------- +// +void CAiStylusPopUpMenu::ConstructFromResourceL( TResourceReader& + aReader ) + { + if(!AknLayoutUtils::PenEnabled()) + { + return; + } + + TInt count = aReader.ReadInt16(); + if ( count > KAiStylusMenuMaxItems ) + { + // Only allowed number of items read from resources. + count = KAiStylusMenuMaxItems; + } + TInt commandId; + for ( TInt i = 0; i < count; i++ ) + { + TPtrC text = aReader.ReadTPtrC(); + commandId = aReader.ReadInt32(); + iContent->AddMenuItemL( text, commandId, *this ); + aReader.ReadInt32(); // extension link + iController->UpdateContentSize(); + } + } + +// --------------------------------------------------------------------------- +// From class MCoeControlObserver. +// Handles stylus tap events by forwarding the event to the observer. +// --------------------------------------------------------------------------- +// +void CAiStylusPopUpMenu::HandleControlEventL( CCoeControl* aControl, + TCoeEvent aEventType ) + { + if(!AknLayoutUtils::PenEnabled()) + { + return; + } + + if ( aControl && aEventType == EEventStateChanged ) + { + if ( iPreviewPopup ) + { + iPreviewPopup->HidePopUp(); + } + iController->HidePopUp(); + iMenuObserver->ProcessCommandL( iContent->CommandId( aControl ) ); + } + } + diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/aistyluspopupmenucontent.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/aistyluspopupmenucontent.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,310 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Content that is shown inside a stylus popup menu. +* +*/ + + +#include +#include +#include + +#include "aistyluspopupmenucontent.h" + +const TInt KItemArrayGranularity = 10; + +// Item shown or dimmed +const TInt KShown = 0; +const TInt KHidden = 0x02; + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CAiStylusPopUpMenuContent::CAiStylusPopUpMenuContent() : + iItems( KItemArrayGranularity ), + iCommands( KItemArrayGranularity ) + { + + } + + +// --------------------------------------------------------------------------- +// CAiStylusPopUpMenuContent::ConstructL +// --------------------------------------------------------------------------- +// +void CAiStylusPopUpMenuContent::ConstructL() + { + for ( TInt i=0; iConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CAiStylusPopUpMenuContent::~CAiStylusPopUpMenuContent() + { + iItems.ResetAndDestroy(); + iCommands.Reset(); + } + + +// --------------------------------------------------------------------------- +// Adds a new menu item to the array of items. +// --------------------------------------------------------------------------- +// +void CAiStylusPopUpMenuContent::AddMenuItemL( const TDesC& aItem, + const TInt aCommandId, MCoeControlObserver& aObserver ) + { + if ( iItems.Count() >= KAiStylusMenuMaxItems ) + { + return; + } + TInt flags = 0; + flags = KAknButtonTextLeft | KAknButtonSizeFitText | KAknButtonNoFrame; + CAknButton* item = CAknButton::NewL( NULL, NULL, NULL, NULL, aItem, + KNullDesC, flags, 0 ); + + item->SetTextFont( AknLayoutUtils::FontFromId( + AknLayoutScalable_Avkon:: + list_single_popup_submenu_pane_t1( 0 ).LayoutLine().FontId() ) ); + item->SetBackground( Background() ); + item->SetObserver( &aObserver ); + iItems.Append( item ); + iCommands.Append( aCommandId ); + SizeChanged(); + } + + +// --------------------------------------------------------------------------- +// Removes the menu item based on the given command id and frees the +// memory occupied by it. +// --------------------------------------------------------------------------- +// +void CAiStylusPopUpMenuContent::RemoveMenuItem( const TInt aCommandId ) + { + TInt itemIndex; + for ( itemIndex = 0; itemIndex < iItems.Count(); itemIndex++ ) + { + if ( iCommands[itemIndex] == aCommandId ) + { + delete iItems[itemIndex]; + iItems.Remove( itemIndex ); + iCommands.Remove( itemIndex ); + iVisibility[itemIndex] = KShown; + break; + } + } + } + +// --------------------------------------------------------------------------- +// Hides / unhides the menu item based on the given command id +// --------------------------------------------------------------------------- +// +void CAiStylusPopUpMenuContent::SetItemDimmed( const TInt aCommandId, const TBool aDimmed ) + { + TInt itemIndex; + for ( itemIndex = 0; itemIndex < iItems.Count(); itemIndex++ ) + { + if ( iCommands[itemIndex] == aCommandId ) + { + if ( aDimmed ) + { + iVisibility[itemIndex] = KHidden; + } + else + { + iVisibility[itemIndex] = KShown; + } + SizeChanged(); + } + } + } + +// --------------------------------------------------------------------------- +// Returns the command id of the specified menu item. +// --------------------------------------------------------------------------- +// +TInt CAiStylusPopUpMenuContent::CommandId( CCoeControl* aControl ) const + { + TInt retVal = 0; + for ( TInt i = 0; i < iItems.Count(); i++ ) + { + if ( iItems[i] == aControl ) + { + retVal = iCommands[i]; + } + } + return retVal; + } + + +// --------------------------------------------------------------------------- +// From class CCoeControl +// Calculates the total size needed to display the items. +// --------------------------------------------------------------------------- +// +TSize CAiStylusPopUpMenuContent::MinimumSize() + { + TInt totalHeight = 0; // height of all menu items combined. + TInt width = 0; // Width of the widest menu item. + TSize itemSize; + + for ( TInt i = 0; i < iItems.Count(); i++ ) + { + if ( iVisibility[i] == KShown ) + { + itemSize = iItems[i]->MinimumSize(); + if ( itemSize.iWidth > width ) + { + width = itemSize.iWidth; + } + totalHeight += itemSize.iHeight; + } + } + return TSize( width, totalHeight ); + } + + +// --------------------------------------------------------------------------- +// From class CCoeControl +// CAiStylusPopUpMenuContent::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CAiStylusPopUpMenuContent::CountComponentControls() const + { + TInt count ( 0 ); + + for ( TInt i = 0; i < iItems.Count(); i++ ) + { + if ( iVisibility[i] == KShown ) + { + count++; + } + } + return count; + } + + +// --------------------------------------------------------------------------- +// From class CCoeControl +// CAiStylusPopUpMenuContent::ComponentControl +// --------------------------------------------------------------------------- +// +CCoeControl* CAiStylusPopUpMenuContent::ComponentControl( + TInt aIndex ) const + { + TInt count ( 0 ); + + for ( TInt i = 0; i< iItems.Count(); i++ ) + { + // Skip dimmed item(s) + if ( iVisibility[i] == KShown ) + { + if ( count == aIndex ) + { + return iItems[i]; + } + count++; + } + } + + // Should never come here + return NULL; + } + + +// --------------------------------------------------------------------------- +// From class CCoeControl +// CAiStylusPopUpMenuContent::HandleResourceChange +// --------------------------------------------------------------------------- +// +void CAiStylusPopUpMenuContent::HandleResourceChange( TInt aType ) + { + CCoeControl::HandleResourceChange( aType ); + + if ( aType == KAknsMessageSkinChange ) + { + // Implementation when graphics are ready. + } + else if ( aType == KEikDynamicLayoutVariantSwitch ) + { + SizeChanged(); + } + } + + +// --------------------------------------------------------------------------- +// From class CCoeControl +// CAiStylusPopUpMenuContent::SizeChanged +// --------------------------------------------------------------------------- +// +void CAiStylusPopUpMenuContent::SizeChanged() + { + if ( iItems.Count() == 0 ) + { + return; + } + // Note: LAF data missing at the moment + TRect rect = Rect(); + TInt itemHeight = iItems[0]->Size().iHeight; + TPoint topLeft = rect.iTl; + TSize itemSize( 0, 0 ); + + // Position items starting from the topmost item + for ( TInt i = 0; i < iItems.Count(); i++ ) + { + // Skip hidden item(s) + if ( iVisibility[i] == KShown ) + { + // CAknButton::MinimumSize returns the size needed by the item text. + itemSize = iItems[i]->MinimumSize(); + iItems[i]->SetRect( TRect( topLeft, itemSize ) ); + topLeft.iY += itemHeight; // Move next item down. + } + } + } diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/aititlepanerenderer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/aititlepanerenderer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,222 @@ +/* +* 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: Handles publishing to title pane. +* +*/ + + +#include +#include +#include +#include "aititlepanerenderer.h" +#include "aistatuspanel.h" +#include "aipropertyextension.h" +#include +#include "ainativeuiplugins.h" +#include "debug.h" + +using namespace AiNativeUiController; + + +void CAiTitlePaneRenderer::ConstructL() + { + } + + +CAiTitlePaneRenderer* CAiTitlePaneRenderer::NewLC( CAiStatusPanel& aStatusPanel ) + { + CAiTitlePaneRenderer* self = new( ELeave ) CAiTitlePaneRenderer( aStatusPanel ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +CAiTitlePaneRenderer::~CAiTitlePaneRenderer() + { + } + + +CAiTitlePaneRenderer::CAiTitlePaneRenderer( CAiStatusPanel& aStatusPanel ) + : iStatusPanel( aStatusPanel ) + { + } + + + + +void CAiTitlePaneRenderer::DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC16& aText, + TInt /*aIndex*/ ) + { + if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + { + switch( aContent ) + { + case EAiDeviceStatusContentNetworkIdentity: + { + __PRINT(__DBG_FORMAT("XAI: Render title pane - %d, %S"), aContent, &aText ); + iStatusPanel.SetTitlePaneTextL( aText ); + // we're publishing text -> set bitmap as invalid + iStatusPanel.SetTitlePaneBitmapL( KErrNotFound, KErrNotFound ); + iStatusPanel.RenderTitlePaneL(); + __PRINTS( "XAI: Render title pane - done"); + + break; + } + default: + { + User::Leave( KErrNotFound ); + break; + } + }; + } + else + { + User::Leave( KErrNotFound ); + } + } + +void CAiTitlePaneRenderer::DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC8& aBuf, + TInt /*aIndex*/ ) + { + if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + { + switch( aContent ) + { + case EAiDeviceStatusContentNetworkIdentity: + { + __PRINTS( "XAI: Render title pane - oper logo"); + + CGulIcon* icon = NULL; + TPckg( icon ).Copy( aBuf ); + + if( icon ) + { + TInt bitmapHandle = icon->Bitmap() ? + icon->Bitmap()->Handle() : KErrNotFound; + TInt maskHandle = icon->Mask() ? + icon->Mask()->Handle() : KErrNotFound; + + // SetTitlePaneBitmapL checks if handle was valid, so no + // problem passing KErrNotFound + iStatusPanel.SetTitlePaneBitmapL( bitmapHandle, maskHandle ); + // We're publishing bitmap -> set text as invalid + iStatusPanel.SetTitlePaneTextL( KNullDesC ); + iStatusPanel.RenderTitlePaneL(); + __PRINTS("XAI: Rendering title pane - done"); + } + break; + } + default: + { + User::Leave( KErrNotFound ); + break; + } + }; + } + else + { + User::Leave( KErrNotFound ); + } + } + +void CAiTitlePaneRenderer::DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aResource, + TInt /*aIndex*/ ) + { + if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + { + switch( aContent ) + { + case EAiDeviceStatusContentNetworkIdentity: + { + HBufC* text = StringLoader::LoadLC( aResource ); + iStatusPanel.SetTitlePaneTextL( *text ); + // We're publishing text -> set bitmap as invalid + iStatusPanel.SetTitlePaneBitmapL( KErrNotFound, KErrNotFound ); + iStatusPanel.RenderTitlePaneL(); + + CleanupStack::PopAndDestroy(text); //text + break; + } + default: + { + User::Leave( KErrNotFound ); + break; + } + }; + } + else + { + User::Leave( KErrNotFound ); + } + } + + +void CAiTitlePaneRenderer::DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent ) + { + __PRINT(__DBG_FORMAT("XAI: Clean title pane - %d"), aContent ); + if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) + { + switch( aContent ) + { + case EAiDeviceStatusContentNetworkIdentity: + { + // Publish empty text + iStatusPanel.SetTitlePaneTextL( KNullDesC ); + iStatusPanel.SetTitlePaneBitmapL( KErrNotFound, KErrNotFound ); + iStatusPanel.RenderTitlePaneL(); + __PRINTS( "XAI: Clean title pane - done"); + break; + } + + default: + { + User::Leave( KErrNotFound ); + break; + } + }; + } + else + { + User::Leave( KErrNotFound ); + } + } + +void CAiTitlePaneRenderer::TransactionCommittedL() + { + } + +void CAiTitlePaneRenderer::KeylockEnabledL() + { + iStatusPanel.StopTitlePaneScrollingL(); + } + +void CAiTitlePaneRenderer::FocusObtainedL() + { + // This scrolls the title pane text only if it has been changed + iStatusPanel.RenderTitlePaneL(); + // Force the scroll just to be safe + iStatusPanel.ScrollTitlePaneTextL(); + } + +void CAiTitlePaneRenderer::FocusLostL() + { + iStatusPanel.StopTitlePaneScrollingL(); + } diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/aitoolbarbutton.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/aitoolbarbutton.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,121 @@ +/* +* 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: Touch Toolbar button +* +*/ + + +#include +#include + +#include "aitoolbarbutton.h" + +using namespace AiNativeUiController; + +CAiToolbarButton* CAiToolbarButton::NewL() + { + CAiToolbarButton* self = new (ELeave) CAiToolbarButton; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +void CAiToolbarButton::ConstructL() + { + iIconNotOwned = EFalse; + iTooltip = KNullDesC().AllocL(); + } + +CAiToolbarButton::~CAiToolbarButton() + { + + if ( !iIconNotOwned ) + { + delete iIcon; + iIcon = NULL; + } + delete iTooltip; + iTooltip = NULL; + } + +CAiToolbarButton::CAiToolbarButton() + { + // no implementation + } + +void CAiToolbarButton::SetShortcutId( TInt aId ) + { + iShortcutId = aId; + } + +TInt CAiToolbarButton::ShortcutId() + { + return iShortcutId; + } + +TDesC& CAiToolbarButton::Tooltip() + { + return *iTooltip; + } + + +CGulIcon* CAiToolbarButton::Icon( TBool aTransferOwnership ) + { + iIconNotOwned = aTransferOwnership; + CGulIcon* icon = iIcon; + if(iIconNotOwned) + { + iIcon = NULL; + } + + return icon; + } + +void CAiToolbarButton::SetTooltipL( const TDesC& aTooltip ) + { + HBufC *temp = aTooltip.AllocL(); + delete iTooltip; + iTooltip = temp; + } + +void CAiToolbarButton::SetIcon( CGulIcon *aIcon, TBool aTransferOwnership ) + { + if ( !iIconNotOwned ) + { + delete iIcon; + iIcon = NULL; + } + iIconNotOwned = aTransferOwnership; + iIcon = aIcon; + } + +void CAiToolbarButton::SetIconExternallyOwned( TBool aValue ) + { + iIconNotOwned = aValue; + } + +CAknButton* CAiToolbarButton::ButtonL() + { + // Icon ownership transferred to CAknButton + return CAknButton::NewL( Icon( ETrue ), + NULL, + NULL, + NULL, + KNullDesC, + Tooltip(), + KAknButtonSizeFitText | KAknButtonReportOnLongPress, + 0 ); + } + diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/aitoolbarrenderer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/aitoolbarrenderer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,304 @@ +/* +* 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: Touch Toolbar +* +*/ + + +#include "aitoolbarrenderer.h" +#include "aifweventhandler.h" +#include "aicontentobserver.h" +#include "activeidle2domaincrkeys.h" +#include "activeidle2domainpskeys.h" +#include "aiscutplugindomaincrkeys.h" +#include +#include "ainativeuiplugins.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "centralrepository.h" + + +#include "debug.h" + +using namespace AiNativeUiController; + +// Action to send to framework +_LIT( KOpenAppByIndex, "Shortcut/LaunchByIndex(%d)" ); +_LIT( KOpenAppByIndexAlternate, "Shortcut/LaunchByIndexAlternate(%d)"); + +const TInt KOpenAppByIndexParameterLength = 2; + +const TInt KFirstButton = 0; +const TInt KSecondButton = 1; +const TInt KThirdButton = 2; + +const TInt KRadix = 10; + +static TInt IndexLength( TInt aIndex ) + { + TInt length = 0; + + if ( aIndex < 0 ) + { + ++length; + } + + do + { + aIndex /= KRadix; + ++length; + } + while ( aIndex != 0 ); + + return length; + } + +static HBufC* CreateEventStringL( const TDesC& aFrom, TInt aEventIndex ) + { + HBufC* buffer = NULL; + + TInt bufferLength = aFrom.Length() - + KOpenAppByIndexParameterLength + + IndexLength( aEventIndex ); + + buffer = HBufC::NewL(bufferLength); + + TPtr bufferPtr = buffer->Des(); + bufferPtr.Format( aFrom, aEventIndex ); + + return buffer; + } + +// ========== MEMBER FUNCTIONS ================================================ + +CAiToolbarRenderer::CAiToolbarRenderer( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar ) + : iToolbar( aToolbar ), + iAiFwEventHandler( aAiFwEventHandler ) + + { + // no implementation required + } + +void CAiToolbarRenderer::ConstructL( ) + { + iToolbarEnabled = EFalse; + + TInt err = KErrNone; + + CRepository *cr = CRepository::NewLC( TUid::Uid( KCRUidActiveIdleLV ) ); + err = cr->Get( KAITouchToolbarVisible, iToolbarEnabled ); + CleanupStack::PopAndDestroy( cr ); + __PRINT (__DBG_FORMAT("XAI: Toolbar value in cenrep %d err = %d"), iToolbarEnabled , err); + + // Hide the toolbar because it is disabled via cenrep + if ( err != KErrNone || !iToolbarEnabled ) + { + iToolbar.SetToolbarObserver( NULL ); + iToolbar.SetToolbarVisibility( EFalse, EFalse ); + } + else + { + iToolbar.SetToolbarObserver( this ); + iToolbar.SetToolbarVisibility( ETrue, EFalse ); + } + + } + +CAiToolbarRenderer* CAiToolbarRenderer::NewLC( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar ) + { + CAiToolbarRenderer* self = new (ELeave) CAiToolbarRenderer( aAiFwEventHandler, aToolbar ); + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +CAiToolbarRenderer* CAiToolbarRenderer::NewL( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar ) + { + CAiToolbarRenderer* self = CAiToolbarRenderer::NewLC( aAiFwEventHandler, aToolbar ); + CleanupStack::Pop(); // self + return self; + } + +CAiToolbarRenderer::~CAiToolbarRenderer() + { + // We don't want anymore events from toolbar + iToolbar.SetToolbarObserver( NULL ); + iButtons.ResetAndDestroy(); + } + +void CAiToolbarRenderer::DynInitToolbarL( TInt /*aResourceId*/, CAknToolbar* /*aToolbar*/ ) + { + // do nothing + } + +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() ); + CleanupStack::PushL( event ); + } + else + { + 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 ) + { + // Only interested on certain publish events + if ( aPlugin.PublisherInfoL()->iUid == KShortcutPluginUid && + aContent == EAiScutContentShortcutToolbarCaption && + ( aIndex == EAiScutToolbarFirst || + aIndex == EAiScutToolbarSecond || + aIndex == EAiScutToolbarThird ) + ) + { + CAiToolbarButton* button = ButtonL( aIndex ); + if ( button ) + { + button->SetTooltipL(aText); + iCommitted = EFalse; + } + } + } + +void CAiToolbarRenderer::DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC8& aBuf, + TInt aIndex ) + { + // Only interested on certain publish events + if ( aPlugin.PublisherInfoL()->iUid == KShortcutPluginUid && + aContent == EAiScutContentShortcutToolbarIcon && + ( aIndex == EAiScutToolbarFirst || + aIndex == EAiScutToolbarSecond || + aIndex == EAiScutToolbarThird ) + ) + { + CGulIcon* icon = MAiContentObserver::UnpackPtr( aBuf ); + CAiToolbarButton* button = NULL; + if ( !icon ) + { + User::Leave(KErrArgument); + } + // Replace the old button with a new button + button = ButtonL( aIndex ); + if ( button ) + { + button->SetIcon(icon); + iCommitted = EFalse; + } + // icons ownership is transferred to us + // so we need to delete the icon in error situations + else + { + delete icon; + } + } + else + { + // We have received stuff we cannot publish. + User::Leave(KErrNotFound); + } + } + +CAiToolbarButton* CAiToolbarRenderer::ButtonL( TInt aShortcutId ) + { + TInt index = KErrNotFound; + CAiToolbarButton *button = NULL; + switch ( aShortcutId ) + { + case EAiScutToolbarFirst: + index = KFirstButton; + break; + case EAiScutToolbarSecond: + index = KSecondButton; + break; + case EAiScutToolbarThird: + index = KThirdButton; + break; + default: + break; + } + + if ( index == KErrNotFound ) + { + User::Leave(KErrNotFound); + } + // No button yet => Create new + if ( index >= iButtons.Count() ) + { + button = CAiToolbarButton::NewL(); + button->SetShortcutId( aShortcutId ); + iButtons.Append( button ); + } + + // Use the old button + else if( index >= KFirstButton && index < iButtons.Count() ) + { + button = iButtons[index]; + button->SetShortcutId( aShortcutId ); + } + return button; + } + + +void CAiToolbarRenderer::TransactionCommittedL() + { + if ( !iCommitted ) + { + for(TInt i = 0; i < iButtons.Count(); i++) + { + CAiToolbarButton *button = iButtons[i]; + if ( button && button->Icon()) + { + // remove the old button + iToolbar.RemoveItem(i); + // and add new one + // transfers ownership of button->ButtonL() to toolbar + iToolbar.AddItemL( button->ButtonL(), EAknCtButton, i, 0, i ); + } + } + iCommitted = ETrue; + } + } + + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/application.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/application.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,69 @@ +/* +* 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: +* +*/ + + +#include +#include +#include "application.h" +#include "document.h" +#include + +using namespace AiNativeUiController; + +_LIT( KResourceDrive, "z:" ); +_LIT( KAiNativeUiResourceFile, "AiNativeUi.rsc" ); + +CApplication::CApplication(CNativeUiController* aUiCtl) + : iUiCtl(aUiCtl) + { + } + +CApplication* CApplication::New(CNativeUiController* aUiCtl) + { + CApplication* self = NULL; + + self = new CApplication(aUiCtl); + + return self; + } + +CApplication::~CApplication() + { + } + +CApaDocument* CApplication::CreateDocumentL() + { + return CDocument::NewL(*this, iUiCtl); + } + +TUid CApplication::AppDllUid() const + { + return TUid::Uid(AI_UID3_AIFW_EXE); + } + +TFileName CApplication::ResourceFileName() const + { + TFileName resFile; + resFile.Append( KResourceDrive ); + resFile.Append( KDC_APP_RESOURCE_DIR ); + resFile.Append( KAiNativeUiResourceFile ); + BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resFile ); + + return resFile; + } + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/appui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/appui.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,706 @@ +/* +* 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: +* +*/ + + +#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" + +#include +#include +#include +#include +#include +#include // for status pane layout resource ids +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace + { + _LIT( KResourceDrive, "Z:" ); + _LIT( KResourceFile, "ainativeui.rsc" ); + #define KResourcePath KDC_APP_RESOURCE_DIR + + const TInt KDefaultStatusPaneLayout = R_AVKON_STATUS_PANE_LAYOUT_IDLE; + + // + // Get status pane configuration from cenrep + // + TInt GetLayoutCenrep() + { + TInt value = EAiStatusPaneLayoutIdleNormal; + TUid uid = { KCRUidActiveIdleLV }; + CRepository* cenRep = CRepository::NewLC( uid ); + cenRep->Get( KAiStatusPaneLayout, value ); + CleanupStack::PopAndDestroy( cenRep ); + return value; + } + + // + // Resolves status pane layout for CXnAppUiAdapter::ConstructL() + // + TInt StatusPaneLayoutResourceIdL( TInt aLayoutId ) + { + TInt layout = aLayoutId; + switch( aLayoutId ) + { + case EAiStatusPaneLayoutIdleNormal: + { + layout = R_AVKON_STATUS_PANE_LAYOUT_IDLE; + break; + } + case EAiStatusPaneLayoutIdleFlat: + { + layout = R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT; + break; + } + case EAiStatusPaneLayoutIdleHidden: + { + layout = KDefaultStatusPaneLayout; + break; + } + default: + { + break; + } + } + return layout; + } + + // ----------------------------------------------------------------------------- + // + // Calculate touch sensitive softkey area for Top button (landscape) + // ----------------------------------------------------------------------------- + TRect SoftkeyRectTopTouch() + { + TRect screen; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + + TAknLayoutRect layoutRect; + + TAknWindowComponentLayout rightAreaLayout( + AknLayoutScalable_Avkon::area_side_right_pane( 0 ) ); + + + layoutRect.LayoutRect( screen, TAknWindowComponentLayout::Compose( rightAreaLayout, + AknLayoutScalable_Avkon::sctrl_sk_top_pane() ).LayoutLine() ); + TRect topSKRect( layoutRect.Rect() ); + + layoutRect.LayoutRect( topSKRect, + AknLayoutScalable_Avkon::aid_touch_sctrl_top().LayoutLine() ); + return layoutRect.Rect(); + } + + // ----------------------------------------------------------------------------- + // + // Calculate touch sensitive softkey area for right button (portrait) + // ----------------------------------------------------------------------------- + TRect SoftkeyRectRightTouch() + { + TRect screen; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + + TAknLayoutRect layoutRect; + + TAknWindowComponentLayout bottomAreaLayout( + AknLayoutScalable_Avkon::area_bottom_pane( 0 ) ); + + + layoutRect.LayoutRect( screen, TAknWindowComponentLayout::Compose( bottomAreaLayout, + AknLayoutScalable_Avkon::control_bg_pane() ).LayoutLine() ); + TRect rightSKRect( layoutRect.Rect() ); + layoutRect.LayoutRect( + rightSKRect, + AknLayoutScalable_Avkon::aid_touch_ctrl_right().LayoutLine() ); + return layoutRect.Rect(); + } + + + } + +using namespace AiNativeUiController; + +// ========== MEMBER FUNCTIONS ================================================ + +CAppUi::CAppUi(CNativeUiController* aUiCtl) + : iUiCtl(aUiCtl) + { + } + +void CAppUi::ConstructL() + { + BaseConstructL(EAknEnableSkin|EAknEnableMSK/*|ENoAppResourceFile*/); + + // Disable CCoeEnv exit checks. + // Active Idle Framework will perform the checks. + iCoeEnv->DisableExitChecks(ETrue); + + if( !iResourceLoader ) + { + iResourceLoader = new(ELeave) RConeResourceLoader( *iCoeEnv ); + + // 1) Load resources file for resource publishing + TFullName resourceFile( KResourceDrive ); + resourceFile.Append( KResourcePath ); + resourceFile.Append( KResourceFile ); + BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), resourceFile ); + + iResourceLoader->OpenL( resourceFile ); + } + + iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + + if( !iUiCtl ) + { + User::Leave(KErrNotFound); + return; // for lint + } + + 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(); + if( statusPane ) + { + // Update status pane layout ot the correct one. + TInt statusPaneLayout = GetLayoutCenrep(); + iCurrentStatusPaneLayout = StatusPaneLayoutResourceIdL( statusPaneLayout ); + + TInt id = statusPane->CurrentLayoutResId(); + if( id != iCurrentStatusPaneLayout && + id != R_AVKON_STACON_PANE_LAYOUT_IDLE_SOFTKEYS_RIGHT ) + { + statusPane->SwitchLayoutL( iCurrentStatusPaneLayout ); + } + else + { + iCurrentStatusPaneLayout = id; + } + + if( statusPaneLayout == EAiStatusPaneLayoutIdleHidden && + iCurrentStatusPaneLayout != R_AVKON_STACON_PANE_LAYOUT_IDLE_SOFTKEYS_RIGHT ) + { + statusPane->MakeVisible( EFalse ); + isFullScreen = ETrue; + } + else + { + statusPane->MakeVisible( ETrue ); + } + statusPane->ApplyCurrentSettingsL(); + statusPane->DrawNow(); + } + + iAppView = CAiNativeUiView::NewL( ClientRect(), this ); + iAppView->SetMopParent(this); + RegisterViewL( *iAppView ); + AddToStackL( iAppView ); + + // Reset softkey locked indications. Error may be ignored - not defined would be typical. + RProperty::Define( KPSUidAiInformation, KActiveIdleExtHS_LSKLocked, RProperty::EText ); + RProperty::Set( KPSUidAiInformation, KActiveIdleExtHS_LSKLocked, KNullDesC ); + RProperty::Define( KPSUidAiInformation, KActiveIdleExtHS_RSKLocked, RProperty::EText ); + RProperty::Set( KPSUidAiInformation, KActiveIdleExtHS_RSKLocked, KNullDesC ); + RProperty::Define( KPSUidAiInformation, KActiveIdleExtHS_PluginConfChange, RProperty::EInt ); + RProperty::Set( KPSUidAiInformation, KActiveIdleExtHS_PluginConfChange, 0 ); + + const TUid KCAIPluginContainerImplementationUid = { 0x101FD658 }; + + iStanbyContainerIF = CExtrStandbyContainerIF::NewL( KCAIPluginContainerImplementationUid, + iAppView ); + iStanbyContainerIF->SetRect( ClientRect() ); + iStanbyContainerIF->SetFullScreenMode( isFullScreen ); + iAppView->SetControl( iStanbyContainerIF ); + + iAIRepository = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); + // CenRep notifier to listen statuspane key changes in cenrep. + iNotifyHandler = CCenRepNotifyHandler::NewL( *this, + *iAIRepository, + CCenRepNotifyHandler::EIntKey, + KAiStatusPaneLayout ); + iNotifyHandler->StartListeningL(); + + if( iFwEventHandler ) + { + iFwEventHandler->HandleUiReadyEventL(*iUiCtl); + } + + // Check powerkey availability + FeatureManager::InitializeLibL(); + iFeatureNoPowerKey = + FeatureManager::FeatureSupported( KFeatureIdNoPowerkey ); + FeatureManager::UnInitializeLib(); + + if(iFeatureNoPowerKey) + { + iPowerkeyStatusObserver = AiUtility::CreatePSPropertyObserverL( + TCallBack( HandlePowerkeyEvent, this ), + KPSUidAvkonDomain, + KAknEndKeyEvent ); + } + + CAknAppUiBase::SetKeyEventFlags( CAknAppUiBase::EDisableSendKeyShort | + CAknAppUiBase::EDisableSendKeyLong ); + } + +CAppUi* CAppUi::NewL(CNativeUiController* aUiCtl) + { + CAppUi* self = new (ELeave) CAppUi(aUiCtl ); + + // ConstructL is called by the UI framework + + return self; + } + +CAppUi::~CAppUi() + { + Release( iPowerkeyStatusObserver ); + delete iTimer; + delete iNotifyHandler; + delete iAIRepository; + delete iStanbyContainerIF; + delete iIdleIntegration; + TRAP_IGNORE( DeactivateActiveViewL() ); + if( iAppView ) + { + DeregisterView( *iAppView ); + RemoveFromStack( iAppView ); + delete iAppView; + } + if( iResourceLoader ) + { + iResourceLoader->Close(); + delete iResourceLoader; + } + } + +void CAppUi::HandleForegroundEventL(TBool aForeground) + { + CAknAppUi::HandleForegroundEventL( aForeground ); + + if ( iUiFwObserver ) + { + iUiFwObserver->HandleForegroundEvent( aForeground ); + } + } + +void CAppUi::HandleCommandL(TInt aCommand) + { + switch (aCommand) + { + case EEikCmdExit: + { + TInt value; + TInt err = RProperty::Get( KPSUidStartup, KPSGlobalSystemState, value ); + if( err == KErrNone ) + { + if ( value == ESwStateShuttingDown ) + { + // If all is ok we filter our exits + Exit(); + } + } + else + { + // If all is not ok we still exit + Exit(); + } + break; + } + case EAknSoftkeyExit: + case EAknCmdExit: // fallthrough + { + +#ifdef _DEBUG + + Exit(); + if( iFwEventHandler && iUiCtl ) + { + iFwEventHandler->HandleUiShutdown( *iUiCtl ); + } + break; + +#endif // _DEBUG + + } + + case ENativeUiSoftkeyLeft: + { + if( iFwEventHandler ) // LSK + { + HBufC* appBuf; + appBuf = HBufC::NewLC( RProperty::KMaxPropertySize ); + TPtr appPtr = appBuf->Des(); + RProperty::Get( KPSUidAiInformation, KActiveIdleExtHS_LSKLocked, appPtr ); + if( appPtr.Length() > 0 ) + { + iFwEventHandler->HandlePluginEvent(KAiLskLaunchByIndexLocked); + } + else + { + iFwEventHandler->HandlePluginEvent(KAiLskLaunchByIndex); + } + CleanupStack::PopAndDestroy( appBuf ); + } + break; + } + + case ENativeUiSoftkeyRight: + { + break; + } + + case ENativeUiSelectionKey: + { + if( iAppView ) + { + TKeyEvent keyEvent; + keyEvent.iCode = EKeyOK; + keyEvent.iRepeats = 0; + TEventCode type(EEventKey); + iAppView->OfferKeyEventL(keyEvent, type); + } + break; + } + + default: + { + break; + } + + } + + } + +void CAppUi::HandleResourceChangeL(TInt aType) + { + CAknAppUi::HandleResourceChangeL(aType); + + if( aType == KEikDynamicLayoutVariantSwitch ) + { + // Screen layout changed, update and draw status pane. + //Get pointer to status pane + CEikStatusPane* statusPane = static_cast( iEikonEnv->EikAppUi() )->StatusPane(); + if( statusPane ) + { + // Update status pane layout ot the correct one. + TInt statusPaneLayout = GetLayoutCenrep(); + TInt id = statusPane->CurrentLayoutResId(); + if( id != iCurrentStatusPaneLayout ) + { + statusPane->SwitchLayoutL( id ); + iCurrentStatusPaneLayout = id; + } + if( statusPaneLayout == EAiStatusPaneLayoutIdleHidden && + id != R_AVKON_STACON_PANE_LAYOUT_IDLE_SOFTKEYS_RIGHT ) + { + statusPane->MakeVisible( EFalse ); + iStanbyContainerIF->SetFullScreenMode( ETrue ); + } + else + { + statusPane->MakeVisible( ETrue ); + iStanbyContainerIF->SetFullScreenMode( EFalse ); + } + statusPane->ApplyCurrentSettingsL(); + statusPane->DrawNow(); + } + if( iAppView ) + { + iAppView->SetRect( ClientRect() ); + iAppView->DrawNow(); + } + + } + + if ( iUiFwObserver ) + { + iUiFwObserver->HandleResourceChange(aType); + } + } + +void CAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination) + { + // Pointer event handling for RSK and SIND launching + // LSK handled via HandleCommand + if ( AknLayoutUtils::PenEnabled() && aEvent.Type() == EEventPointer ) + { + TPointerEvent *event = aEvent.Pointer(); + HandlePointerEvent( *event ); + } + + if( iIdleIntegration ) + { + // Forward window server events first to idle integration library + iIdleIntegration->HandleWsEventL(aEvent, aDestination); + } + + // Call base class to let the UI framework handle the event + CAknAppUi::HandleWsEventL( aEvent, aDestination); + } + +void CAppUi::HandlePointerEvent( TPointerEvent &aEvent ) + { + if ( !Cba()->IsVisible() ) + { + return; + } + + TRect rskRect; + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + rskRect = ::SoftkeyRectTopTouch(); + } + else + { + rskRect = ::SoftkeyRectRightTouch(); + } + // pointer event done in RSK => activate sind timer. + if ( aEvent.iType == TPointerEvent::EButton1Down && + rskRect.Contains( aEvent.iParentPosition )) + { + iSINDKeyDown = ETrue; + const TTimeIntervalMicroSeconds32 KLongKeyPress(600000); + iTimer->Cancel(); + iTimer->Start( KLongKeyPress, 0, TCallBack( TimerDone, this ) ); + } + // It doesn't matter where the button up is done + // the voice dial is still skipped + else if ( iSINDKeyDown && + aEvent.iType == TPointerEvent::EButton1Up ) + { + SkipVoiceDial(); + } + // Dragging outside RSK cancels opening of shortcut + // and voice dial + else if ( iSINDKeyDown && + aEvent.iType == TPointerEvent::EDrag && + !rskRect.Contains( aEvent.iParentPosition )) + { + iTimer->Cancel(); + iSINDKeyDown = EFalse; + } + } + +void CAppUi::HandleScreenDeviceChangedL() + { + CAknAppUi::HandleScreenDeviceChangedL(); + + if ( iFwEventHandler && iUiCtl ) + { + //iFwEventHandler->HandleUiLayoutChangeL(*iUiCtl); + } + } + +void CAppUi::PrepareToExit() + { + if ( iFwEventHandler && iUiCtl ) + { + iUiCtl->PrepareToExit(); + iFwEventHandler->HandleUiShutdown(*iUiCtl); + } + } + +TKeyResponse CAppUi::HandleKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + if( aKeyEvent.iScanCode == EStdKeyDevice1 ) + { + if( aType == EEventKeyDown ) + { + iSINDKeyDown = ETrue; + const TTimeIntervalMicroSeconds32 KLongKeyPress(600000); + iTimer->Cancel(); + iTimer->Start( KLongKeyPress, 0, TCallBack( TimerDone, this ) ); + } + else if( aType == EEventKeyUp ) + { + if( iSINDKeyDown ) + { + SkipVoiceDial(); + } + } + return EKeyWasConsumed; + } + else + { + if( aType == EEventKeyDown && iSINDKeyDown ) + { + iSINDKeyDown = EFalse; + SkipVoiceDial(); + } + if( iAppView ) + { + return iAppView->OfferKeyEventL(aKeyEvent, aType); + } + } + + return EKeyWasNotConsumed; + } + +void CAppUi::SkipVoiceDial() + { + iTimer->Cancel(); + // Handle skip scenario only if voice dial ui hasn't been launched + if ( iFwEventHandler ) + { + HBufC* app2Buf; + app2Buf = HBufC::New( RProperty::KMaxPropertySize ); + if ( app2Buf ) + { + TPtr app2Ptr = app2Buf->Des(); + RProperty::Get( KPSUidAiInformation, KActiveIdleExtHS_RSKLocked, app2Ptr ); + if( app2Ptr.Length() > 0 ) + { + iFwEventHandler->HandlePluginEvent(KAiRskLaunchByIndexLocked); + } + else + { + iFwEventHandler->HandlePluginEvent(KAiRskLaunchByIndex); + } + delete app2Buf; + } + } + iSINDKeyDown = EFalse; + } + +TInt CAppUi::TimerDone(TAny* aSelf) + { + CAppUi* self = static_cast( aSelf ); + if ( self ) + { + self->iTimer->Cancel(); + self->iSINDKeyDown = EFalse; + self->iFwEventHandler->HandlePluginEvent(KAiRskLaunchVoiceDial); + } + return KErrNone; + } + +void CAppUi::StartL() + { + if( iStanbyContainerIF ) + { + iStanbyContainerIF->StartL(); + } + } + +void CAppUi::HandleNotifyInt( TUint32 aId, TInt aNewValue ) + { + // Set status pane on the fly. + if( aId == KAiStatusPaneLayout ) + { + if( aNewValue == EAiStatusPaneLayoutIdleNormal || + aNewValue == EAiStatusPaneLayoutIdleFlat || + aNewValue == EAiStatusPaneLayoutIdleHidden ) + { + //Get pointer to status pane + CEikStatusPane* statusPane = static_cast( iEikonEnv->EikAppUi() )->StatusPane(); + if( statusPane ) + { + // Update status pane layout ot the correct one. + if( aNewValue == EAiStatusPaneLayoutIdleHidden && + iCurrentStatusPaneLayout != R_AVKON_STACON_PANE_LAYOUT_IDLE_SOFTKEYS_RIGHT ) + { + statusPane->MakeVisible( EFalse ); + if ( iStanbyContainerIF ) + { + iStanbyContainerIF->SetFullScreenMode( ETrue ); + } + + } + else + { + statusPane->MakeVisible( ETrue ); + if ( iStanbyContainerIF ) + { + iStanbyContainerIF->SetFullScreenMode( EFalse ); + } + } + statusPane->DrawNow(); + if( iStanbyContainerIF ) + { + iStanbyContainerIF->SetRect( ClientRect() ); + } + if ( iAppView ) + { + iAppView->DrawNow(); + } + + } + } + } + } + +void CAppUi::ExtHSThemeChanged() + { + //TRAP_IGNORE( iFwEventHandler->HandleUiThemeChangeStartL( *iUiCtl ) ); + TRAP_IGNORE( iFwEventHandler->HandleUiReadyEventL( *iUiCtl ) ); + } + +TInt CAppUi::HandlePowerkeyEvent( TAny* aPtr ) + { + CAppUi* self = static_cast(aPtr); + if( self && self->iStanbyContainerIF ) + { + TKeyEvent keyEvent; + keyEvent.iCode = EKeyPhoneEnd; + TEventCode eventType; + eventType = EEventKey; + TRAP_IGNORE( self->iStanbyContainerIF->OfferKeyEventL( keyEvent, eventType ) ); + } + return KErrNone; + } + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/document.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/document.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,48 @@ +/* +* 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: +* +*/ + + +#include "document.h" +#include "application.h" +#include "appui.h" + +using namespace AiNativeUiController; + +CDocument::CDocument(CEikApplication &aApp, CNativeUiController* aUiCtl) + : CAknDocument(aApp), + iUiCtl(aUiCtl) + { + } +CDocument* CDocument::NewL(CAknApplication &aApp, CNativeUiController* aUiCtl) + { + CDocument* self = NULL; + + self = new (ELeave) CDocument(aApp, aUiCtl); + + return self; + } + +CDocument::~CDocument() + { + } + +CAknAppUi* CDocument::CreateAppUiL() + { + return CAppUi::NewL(iUiCtl); + } + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/nativeuicontroller/src/nativeuicontroller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/nativeuicontroller/src/nativeuicontroller.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1070 @@ +/* +* 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: Native UI controller. +* +*/ + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// User includes +#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" +#include "ainavipanerenderer.h" +#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; + +// Constants +_LIT( KResourceDrive, "Z:" ); +_LIT( KResourceFile, "ainativeui.rsc" ); +_LIT( KSettingsDummyData, "" ); +_LIT( KSettingsIdSeparator, "/" ); +_LIT( KSettings, "Settings" ); + +const TInt KOneSecondInMicroS = 1000*1000; +const TInt KAI2CrKeyIncrementBy2 = 2; + +#define KResourcePath KDC_APP_RESOURCE_DIR + +const TImplementationProxy KImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(KImplementationUidNativeUiController, CNativeUiController::NewL) + }; + + +// ---------------------------------------------------------------------------- +// CNativeUiController::NewL() +// ---------------------------------------------------------------------------- +// +CNativeUiController* CNativeUiController::NewL() + { + CNativeUiController* self = new (ELeave) CNativeUiController; + + CleanupStack::PushL( self ); + + // Set Native UI Controller object to TLS for access in static + // CNativeUiController::NewApplication + User::LeaveIfError( Dll::SetTls( self ) ); + CleanupStack::Pop( self ); + + return self; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::Exit() +// ---------------------------------------------------------------------------- +// +void CNativeUiController::Exit() + { + if ( iExitTimer ) + { + iExitTimer->Cancel(); + + iExitTimer->Start( 0, KOneSecondInMicroS, + TCallBack( ExitTimerCallBack, this ) ); + } + + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::ExitTimerCallBack() +// ---------------------------------------------------------------------------- +// +TInt CNativeUiController::ExitTimerCallBack( TAny *aSelf ) + { + CNativeUiController* self = + static_cast( aSelf ); + + if ( self ) + { + self->iExitTimer->Cancel(); + self->PrepareToExit(); + self->iAppUi->Exit(); + } + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::~CNativeUiController() +// ---------------------------------------------------------------------------- +// +CNativeUiController::~CNativeUiController() + { + iPlugins.Close(); + + delete iExitTimer; + + PrepareToExit(); + + // Reset TLS pointer to this set in NewL + Dll::SetTls( NULL ); + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::PrepareToExit() +// ---------------------------------------------------------------------------- +// +void CNativeUiController::PrepareToExit() + { + iRenderers.ResetAndDestroy(); + + delete iStatusPanel; + iStatusPanel = NULL; + + Release( iIdleStatusObserver ); + iIdleStatusObserver = NULL; + + Release( iKeylockStatusObserver ); + iKeylockStatusObserver = NULL; + + Release( iExtHsPluginConfChange ); + iExtHsPluginConfChange = NULL; + + //If we are not the + if( !iRunningAsMain && iResourceOffset > 0 ) + { + iCoeEnv->DeleteResourceFile( iResourceOffset ); + iResourceOffset = KErrNotFound; + } + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::CNativeUiController() +// ---------------------------------------------------------------------------- +// +CNativeUiController::CNativeUiController() + : iResourceOffset( KErrNotFound ) + { + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::AddRendererL() +// ---------------------------------------------------------------------------- +// +void CNativeUiController::AddRendererL( CAiNativeRenderer* aRenderer ) + { + User::LeaveIfError( iRenderers.Append( aRenderer ) ); + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::RemoveRenderer() +// ---------------------------------------------------------------------------- +// +TBool CNativeUiController::RemoveRenderer( CAiNativeRenderer *aRenderer, + TBool aDelete ) + { + for ( TInt i = 0; i < iRenderers.Count(); i++ ) + { + if ( aRenderer == iRenderers[i] ) + { + if ( aDelete ) + { + delete aRenderer; + } + iRenderers.Remove(i); + + return ETrue; + } + } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::ExitTimerCallBack() +// ---------------------------------------------------------------------------- +// +void CNativeUiController::DeleteToolbarRenderer() + { + if ( iToolbarRenderer ) + { + RemoveRenderer( iToolbarRenderer ); + delete iToolbarRenderer; + iToolbarRenderer = NULL; + } + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::RecreateToolbarRendererL() +// ---------------------------------------------------------------------------- +// +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 aContent, T& aData, TInt aIndex ) + { + const TAiPublisherInfo* info( NULL ); + + TRAP_IGNORE( info = aPlugin.PublisherInfoL() ); + + if ( !info || info->iNamespace != KNativeUiNamespace ) + { + return KErrNotSupported; + } + + const TInt count( iRenderers.Count() ); + TInt err( KErrNone ); + + for( TInt i( 0 ); i < count; i++ ) + { + err = iRenderers[i]->Publish( aPlugin, aContent, aData, aIndex ); + + if( err == KErrNone ) + { + //data published + return KErrNone; + } + + if( err != KErrNotFound ) + { + return err; + } + } + + return err; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::HandleIdleStateEvent() +// ---------------------------------------------------------------------------- +// +TInt CNativeUiController::HandleIdleStateEvent( TAny* aPtr ) + { + CNativeUiController* self = + reinterpret_cast< CNativeUiController* >( aPtr ); + + if( self ) + { + TInt idleState = EPSAiBackground; + self->iIdleStatusObserver->Get( idleState ); + + const TInt count = self->iRenderers.Count(); + + if( idleState == EPSAiForeground ) + { + for( TInt i( 0 ); i < count; i++ ) + { + TRAP_IGNORE( self->iRenderers[i]->FocusObtainedL() ); + } + } + else + { + for( TInt j( 0 ); j < count; j++ ) + { + TRAP_IGNORE( self->iRenderers[j]->FocusLostL() ); + } + } + } + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::HandleKeylockStateEvent() +// ---------------------------------------------------------------------------- +// +TInt CNativeUiController::HandleKeylockStateEvent( TAny* aPtr ) + { + CNativeUiController* self = + reinterpret_cast< CNativeUiController* >( aPtr ); + + if( self ) + { + TInt keylockState = EKeyguardNotActive; + self->iKeylockStatusObserver->Get( keylockState ); + + const TInt count = self->iRenderers.Count(); + + if( keylockState != EKeyguardNotActive ) + { + TRAP_IGNORE( + // Run dialog shutter to shut any open dialogs + AknDialogShutter::ShutDialogsL( + *static_cast< CEikonEnv* >( CCoeEnv::Static() ) ); + + TKeyEvent key; + key.iCode = 0; + key.iModifiers = 0; + key.iScanCode = EStdKeyNo; + CCoeEnv::Static()->SimulateKeyEventL( key, EEventKey ); + ); + + for( TInt i( 0 ); i < count; i++ ) + { + TRAP_IGNORE( self->iRenderers[i]->KeylockEnabledL() ); + } + } + else + { + for( TInt i( 0 ); i < count; i++ ) + { + TRAP_IGNORE( self->iRenderers[i]->KeylockDisabledL() ); + } + } + } + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::HandlePluginConfChange() +// ---------------------------------------------------------------------------- +// +TInt CNativeUiController::HandlePluginConfChange( TAny* aPtr ) + { + CNativeUiController* self = + reinterpret_cast< CNativeUiController* >( aPtr ); + + TInt value( 0 ); + + RProperty::Get( KPSUidAiInformation, + KActiveIdleExtHS_PluginConfChange, value ); + + if( self && value ) + { + self->iAppUi->ExtHSThemeChanged(); + } + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::LoadUIDefinitionL() +// ---------------------------------------------------------------------------- +// +void CNativeUiController::LoadUIDefinitionL() + { + if ( iUiLoaded ) + { + TInt count( iRenderers.Count() ); + + for( TInt i( 0 ); i < count; i++ ) + { + iRenderers[i]->LoadUIDefinitionL(); + } + return; + } + + if ( !iExitTimer ) + { + iExitTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + } + + // This method is called upon startup. We'll need to: + iRenderers.ResetAndDestroy(); + + if( !iStatusPanel ) + { + // 2) Initialize status pane for publishing in general + iStatusPanel = CAiStatusPanel::NewL(); + } + + // 3) Create renderers that handle publishing to title pane... + AddRendererL( CAiTitlePaneRenderer::NewLC( *iStatusPanel ) ); + CleanupStack::Pop();//CAiTitlePaneRenderer + + // ...navi pane... + AddRendererL( CAiNaviPaneRenderer::NewLC( *iStatusPanel ) ); + CleanupStack::Pop();//CAiNaviPaneRenderer + + // ...dialogs and. + AddRendererL( CAiDialogRenderer::NewLC() ); + CleanupStack::Pop();//CAiDialogRenderer + + AddRendererL( CAiNotifierRenderer::NewLC() ); + CleanupStack::Pop();//CAiNotifierRenderer + + // ...touch ui. + AddRendererL( CAiStatusPaneTouchUi::NewLC( *iStatusPanel, *iFwEventHandler ) ); + CleanupStack::Pop();//CAiStatusPaneTouchUi + + if( iRunningAsMain ) + { + AddRendererL( CAiSoftKeyRenderer::NewLC() ); + CleanupStack::Pop();//CAiSoftKeyRenderer + + // Toolbar shown only when we are not the main ui controller + DeleteToolbarRenderer(); + + TRAP_IGNORE( + iAppUi->StartL(); ) + } + + // We need to load the resource file here if we are not main controller. + // If we are the main controller the loading is done in appui + // Also the toolbar renderer is loaded here. + else + { + //Load resources file for resource publishing + TFullName resourceFile( KResourceDrive ); + resourceFile.Append( KResourcePath ); + resourceFile.Append( KResourceFile ); + BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resourceFile ); + if( iCoeEnv && iResourceOffset == KErrNotFound ) + { + iResourceOffset = iCoeEnv->AddResourceFileL( resourceFile ); + } + // Create the toolbar renderer + RecreateToolbarRendererL(); + } + + // 4) Add an observer that informs us about the focus transition changes + if( !iIdleStatusObserver ) + { + iIdleStatusObserver = AiUtility::CreatePSPropertyObserverL( + TCallBack( HandleIdleStateEvent, this ), + KPSUidAiInformation, + KActiveIdleState ); + } + if( !iKeylockStatusObserver ) + { + iKeylockStatusObserver = AiUtility::CreatePSPropertyObserverL( + TCallBack( HandleKeylockStateEvent, this ), + KPSUidAvkonDomain, + KAknKeyguardStatus ); + } + if( !iExtHsPluginConfChange ) + { + iExtHsPluginConfChange = AiUtility::CreatePSPropertyObserverL( + TCallBack( HandlePluginConfChange, this ), + KPSUidAiInformation, + KActiveIdleExtHS_PluginConfChange ); + } + + iUiLoaded = ETrue; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::GetPluginsL() +// ---------------------------------------------------------------------------- +// +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, + RAiSettingsItemArray& aSettings ) + { + if ( aPubInfo.iNamespace != KNativeUiNamespace ) + { + return; + } + + if( iRunningAsMain && aPubInfo.iUid == KShortcutPluginUid ) + { + RProperty::Set( KPSUidAiInformation, KActiveIdleExtHS_PluginConfChange, 0 ); + + MAiPluginSettings* settings = AiUtility::CreatePluginSettingsL(); + CleanupDeletePushL( settings ); + + MAiPluginSettingsItem& item = settings->AiPluginSettingsItem(); + item.SetPublisherId( aPubInfo.iUid ); + + HBufC* appBuf; + appBuf = HBufC::NewLC( RProperty::KMaxPropertySize ); + TPtr appPtr = appBuf->Des(); + RProperty::Get( KPSUidAiInformation, KActiveIdleExtHS_LSKLocked, appPtr ); + if( appPtr.Length() > 0 ) + { + item.SetKey( KNativeUiKeyIdLockedLSK ); + item.SetValueL( appPtr, EFalse ); + } + else + { + item.SetKey( KNativeUiKeyIdLSK ); + item.SetValueL( KAiLocalAppAppShell, EFalse ); + } + + // Append settings into array. + // This can not fail because space has been reserved. + aSettings.Append( settings ); + + CleanupStack::PopAndDestroy( appBuf ); + appBuf = NULL; + + CleanupStack::Pop( settings ); + + settings = AiUtility::CreatePluginSettingsL(); + CleanupDeletePushL( settings ); + + MAiPluginSettingsItem& item2 = settings->AiPluginSettingsItem(); + item2.SetPublisherId( aPubInfo.iUid ); + + HBufC* app2Buf; + app2Buf = HBufC::NewLC( RProperty::KMaxPropertySize ); + TPtr app2Ptr = app2Buf->Des(); + RProperty::Get( KPSUidAiInformation, KActiveIdleExtHS_RSKLocked, app2Ptr ); + if( app2Ptr.Length() > 0 ) + { + item2.SetKey( KNativeUiKeyIdLockedRSK ); + item2.SetValueL( app2Ptr, EFalse ); + } + else + { + item2.SetKey( KNativeUiKeyIdRSK ); + item2.SetValueL( KAiLocalAppContacts, EFalse ); + } + + // Append settings into array. + // This can not fail because space has been reserved. + aSettings.Append( settings ); + + CleanupStack::PopAndDestroy( app2Buf ); + app2Buf = NULL; + + // In case there are settings in the cenrep the settings + // here are overwritten by them + GetSettingsFromCRL( aPubInfo, aSettings ); + CleanupStack::Pop( settings ); + } + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::GetSettingsFromCRL() +// ---------------------------------------------------------------------------- +// +void CNativeUiController::GetSettingsFromCRL( const TAiPublisherInfo& aPubInfo, + RAiSettingsItemArray &aPluginSettings ) + { + if ( aPubInfo.iNamespace != KNativeUiNamespace ) + { + 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. + */ + + 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; + + CRepository *settingsRepository = CRepository::NewLC( TUid::Uid( KCRUidActiveIdleLV ) ); + + while ( moreSettings ) + { + settingFound = EFalse; + + pluginIdPtr.Zero(); + settingValuePtr.Zero(); + settingKeyPtr.Zero(); + //Get the name of plugin with the Settings/ prefix + err = settingsRepository->Get(crKey++, pluginIdPtr); + + // remove the Settings/ prefix if it is located at the start of the string + if ( pluginIdPtr.FindC(KSettings) == 0 ) + { + + pluginIdPtr.Delete(0, + KSettingsIdSeparator().Length() + + KSettings().Length()); + } + + // does the setting belong to this plugin + if ( err == KErrNone && pluginIdPtr == aPubInfo.iName ) + { + // Get the settings id + err = settingsRepository->Get(crKey++, settingKeyPtr); + if ( err == KErrNone ) + { + err = AiUtility::ParseInt(settingId,settingKeyPtr); + } + if ( err == KErrNone ) + { + // Get the actual value of the setting + err = settingsRepository->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 + if ( !settingFound && ( 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 ); + } + } + } + } + // name of the plugin not found => no more settings + else if (err != KErrNone ) + { + moreSettings = EFalse; + + } + // not the correct setting for this plugin + else + { + crKey += KAI2CrKeyIncrementBy2; + } + } + + CleanupStack::PopAndDestroy(settingsRepository); + CleanupStack::PopAndDestroy(settingKey); + CleanupStack::PopAndDestroy(settingValue); + CleanupStack::PopAndDestroy(pluginId); + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::ActivateUI() +// ---------------------------------------------------------------------------- +// +void CNativeUiController::ActivateUI() + { + if( iAppUi ) + { + TRAP_IGNORE( iAppUi->StartL() ); + } + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::GetContentObserver() +// ---------------------------------------------------------------------------- +// +MAiContentObserver& CNativeUiController::GetContentObserver() + { + return *this; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::SetEventHandler() +// ---------------------------------------------------------------------------- +// +void CNativeUiController::SetEventHandler( MAiFwEventHandler& aEventHandler ) + { + iFwEventHandler = &aEventHandler; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::FwEventHandler() +// ---------------------------------------------------------------------------- +// +MAiFwEventHandler* CNativeUiController::FwEventHandler() + { + return iFwEventHandler; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::RemovePluginFromUI() +// ---------------------------------------------------------------------------- +// +void CNativeUiController::RemovePluginFromUI( + MAiPropertyExtension& /*aPlugin*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::MainInterface() +// ---------------------------------------------------------------------------- +// +MAiMainUiController* CNativeUiController::MainInterface() + { + return this; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::SecondaryInterface() +// ---------------------------------------------------------------------------- +// +MAiSecondaryUiController* CNativeUiController::SecondaryInterface() + { + return this; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::RunApplicationL() +// ---------------------------------------------------------------------------- +// +void CNativeUiController::RunApplicationL() + { + VariateToMainUiController(); + + User::LeaveIfError( + EikStart::RunApplication( &CNativeUiController::NewApplication ) ); + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::CoeEnv() +// ---------------------------------------------------------------------------- +// +CCoeEnv& CNativeUiController::CoeEnv() + { + return *CCoeEnv::Static(); + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::SetUiFrameworkObserver() +// ---------------------------------------------------------------------------- +// +void CNativeUiController::SetUiFrameworkObserver( + MAiUiFrameworkObserver& aObserver ) + { + iUiFrameworkObserver = &aObserver; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::IsMenuOpen() +// ---------------------------------------------------------------------------- +// +TBool CNativeUiController::IsMenuOpen() + { + return CoeEnv().AppUi()->IsDisplayingMenuOrDialog(); + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::SetCoeEnv() +// ---------------------------------------------------------------------------- +// +void CNativeUiController::SetCoeEnv( CCoeEnv& aCoeEnv ) + { + iCoeEnv = &aCoeEnv; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::UiFrameworkObserver() +// ---------------------------------------------------------------------------- +// +MAiUiFrameworkObserver* CNativeUiController::UiFrameworkObserver() + { + return iUiFrameworkObserver; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::HandleResourceChange() +// ---------------------------------------------------------------------------- +// +void CNativeUiController::HandleResourceChange( TInt /*aType*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::HandleForegroundEvent() +// ---------------------------------------------------------------------------- +// +void CNativeUiController::HandleForegroundEvent( TBool /*aForeground*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::StartTransaction() +// ---------------------------------------------------------------------------- +// +TInt CNativeUiController::StartTransaction( TInt /*aTxId*/ ) + { + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::Commit() +// ---------------------------------------------------------------------------- +// +TInt CNativeUiController::Commit( TInt /*aTxId*/ ) + { + TInt result( KErrNone ); + const TInt count( iRenderers.Count() ); + + for( TInt i( 0 ); i < count; i++ ) + { + TRAP( result, iRenderers[i]->TransactionCommittedL() ); + } + + return result; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::CancelTransaction() +// ---------------------------------------------------------------------------- +// +TInt CNativeUiController::CancelTransaction( TInt /*aTxId*/ ) + { + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::CanPublish() +// ---------------------------------------------------------------------------- +// +TBool CNativeUiController::CanPublish( MAiPropertyExtension& aPlugin, + TInt /*aContent*/, TInt /*aIndex*/ ) + { + const TAiPublisherInfo* info( NULL ); + + TRAP_IGNORE( info = aPlugin.PublisherInfoL() ); + + if ( !info || info->iNamespace != KNativeUiNamespace ) + { + return EFalse; + } + + for( TInt i = 0; i < iPlugins.Count(); i++ ) + { + if ( iPlugins[i] == *info ) + { + return ETrue; + } + } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::Publish() +// ---------------------------------------------------------------------------- +// +TInt CNativeUiController::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, TInt aResource, TInt aIndex ) + { + TInt err = DoPublish( aPlugin, aContent, aResource, aIndex ); + return err; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::Publish() +// ---------------------------------------------------------------------------- +// +TInt CNativeUiController::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, const TDesC16& aText, TInt aIndex ) + { + TInt err = DoPublish( aPlugin, aContent, aText, aIndex ); + return err; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::Publish() +// ---------------------------------------------------------------------------- +// +TInt CNativeUiController::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, const TDesC8& aBuf, TInt aIndex ) + { + TInt err = DoPublish( aPlugin, aContent, aBuf, aIndex ); + return err; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::Publish() +// ---------------------------------------------------------------------------- +// +TInt CNativeUiController::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, RFile& aFile, TInt aIndex ) + { + TInt err = DoPublish( aPlugin, aContent, aFile, aIndex ); + return err; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::Clean() +// ---------------------------------------------------------------------------- +// +TInt CNativeUiController::Clean( MAiPropertyExtension& aPlugin, + TInt aContent, TInt /*aIndex*/ ) + { + const TInt count( iRenderers.Count() ); + + for( TInt i( 0 ); i < count; i++ ) + { + iRenderers[i]->Clean( aPlugin, aContent ); + } + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::Extension() +// ---------------------------------------------------------------------------- +// +TAny* CNativeUiController::Extension( TUid /*aUid*/ ) + { + return NULL; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::RequiresSubscription() +// ---------------------------------------------------------------------------- +// +TBool CNativeUiController::RequiresSubscription( + const TAiPublisherInfo& aPublisherInfo ) const + { + if ( aPublisherInfo.iNamespace == KNativeUiNamespace ) + { + // Targeted to this content renderer + return ETrue; + } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::NewApplication() +// ---------------------------------------------------------------------------- +// +CApaApplication* CNativeUiController::NewApplication() + { + CNativeUiController* self = + static_cast< CNativeUiController* >( Dll::Tls() ); + + return CApplication::New( self ); + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::VariateToMainUiController() +// ---------------------------------------------------------------------------- +// +void CNativeUiController::VariateToMainUiController() + { + iRunningAsMain = ETrue; + } + +// ======== GLOBAL FUNCTIONS ======== +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( KImplementationTable ) / sizeof( TImplementationProxy ); + return KImplementationTable; + } + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/cpswrapper/bwins/cpswrapper.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/cpswrapper/bwins/cpswrapper.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +EXPORTS + ?GetTemplatedPublishersL@CCpsWrapper@cpswrapper@@QAEPAVCPublisherMap@2@XZ @ 1 NONAME ; class cpswrapper::CPublisherMap * cpswrapper::CCpsWrapper::GetTemplatedPublishersL(void) + ?ContentType@CPublisherInfo@cpswrapper@@QBEABVTDesC16@@XZ @ 2 NONAME ; class TDesC16 const & cpswrapper::CPublisherInfo::ContentType(void) const + ?PublisherId@CPublisherInfo@cpswrapper@@QBEABVTDesC16@@XZ @ 3 NONAME ; class TDesC16 const & cpswrapper::CPublisherInfo::PublisherId(void) const + ?AddPublisherInfoL@CPublisherMap@cpswrapper@@QAEXPAVCPublisherInfo@2@@Z @ 4 NONAME ; void cpswrapper::CPublisherMap::AddPublisherInfoL(class cpswrapper::CPublisherInfo *) + ?SetWidgetNameL@CPublisherInfo@cpswrapper@@QAEXABVTDesC16@@@Z @ 5 NONAME ; void cpswrapper::CPublisherInfo::SetWidgetNameL(class TDesC16 const &) + ?MaxWidgets@CPublisherInfo@cpswrapper@@QBEABJXZ @ 6 NONAME ; long const & cpswrapper::CPublisherInfo::MaxWidgets(void) const + ?NewL@CPublisherInfo@cpswrapper@@SAPAV12@XZ @ 7 NONAME ; class cpswrapper::CPublisherInfo * cpswrapper::CPublisherInfo::NewL(void) + ?SetTemplateTypeL@CPublisherInfo@cpswrapper@@QAEXABVTDesC16@@@Z @ 8 NONAME ; void cpswrapper::CPublisherInfo::SetTemplateTypeL(class TDesC16 const &) + ?SetPublisherIdL@CPublisherInfo@cpswrapper@@QAEXABVTDesC16@@@Z @ 9 NONAME ; void cpswrapper::CPublisherInfo::SetPublisherIdL(class TDesC16 const &) + ?Description@CPublisherInfo@cpswrapper@@QBEABVTDesC16@@XZ @ 10 NONAME ; class TDesC16 const & cpswrapper::CPublisherInfo::Description(void) const + ?SetMaxWidgets@CPublisherInfo@cpswrapper@@QAEXABJ@Z @ 11 NONAME ; void cpswrapper::CPublisherInfo::SetMaxWidgets(long const &) + ?SetContentTypeL@CPublisherInfo@cpswrapper@@QAEXABVTDesC16@@@Z @ 12 NONAME ; void cpswrapper::CPublisherInfo::SetContentTypeL(class TDesC16 const &) + ?NewL@CPublisherMap@cpswrapper@@SAPAV12@XZ @ 13 NONAME ; class cpswrapper::CPublisherMap * cpswrapper::CPublisherMap::NewL(void) + ?ContentId@CPublisherInfo@cpswrapper@@QBEABVTDesC16@@XZ @ 14 NONAME ; class TDesC16 const & cpswrapper::CPublisherInfo::ContentId(void) const + ?NewLC@CCpsWrapper@cpswrapper@@SAPAV12@AAVMCpsWrapperObserver@2@@Z @ 15 NONAME ; class cpswrapper::CCpsWrapper * cpswrapper::CCpsWrapper::NewLC(class cpswrapper::MCpsWrapperObserver &) + ?PublisherInfo@CPublisherMap@cpswrapper@@QBEAAV?$RPointerArray@VCPublisherInfo@cpswrapper@@@@XZ @ 16 NONAME ; class RPointerArray & cpswrapper::CPublisherMap::PublisherInfo(void) const + ??1CCpsWrapper@cpswrapper@@UAE@XZ @ 17 NONAME ; cpswrapper::CCpsWrapper::~CCpsWrapper(void) + ??1CPublisherInfo@cpswrapper@@UAE@XZ @ 18 NONAME ; cpswrapper::CPublisherInfo::~CPublisherInfo(void) + ??1CPublisherMap@cpswrapper@@UAE@XZ @ 19 NONAME ; cpswrapper::CPublisherMap::~CPublisherMap(void) + ?TemplateType@CPublisherInfo@cpswrapper@@QBEABVTDesC16@@XZ @ 20 NONAME ; class TDesC16 const & cpswrapper::CPublisherInfo::TemplateType(void) const + ?SetContentIdL@CPublisherInfo@cpswrapper@@QAEXABVTDesC16@@@Z @ 21 NONAME ; void cpswrapper::CPublisherInfo::SetContentIdL(class TDesC16 const &) + ?NewLC@CPublisherInfo@cpswrapper@@SAPAV12@XZ @ 22 NONAME ; class cpswrapper::CPublisherInfo * cpswrapper::CPublisherInfo::NewLC(void) + ?NewLC@CPublisherMap@cpswrapper@@SAPAV12@XZ @ 23 NONAME ; class cpswrapper::CPublisherMap * cpswrapper::CPublisherMap::NewLC(void) + ?SetLogoIconL@CPublisherInfo@cpswrapper@@QAEXABVTDesC16@@@Z @ 24 NONAME ; void cpswrapper::CPublisherInfo::SetLogoIconL(class TDesC16 const &) + ?LogoIcon@CPublisherInfo@cpswrapper@@QBEABVTDesC16@@XZ @ 25 NONAME ; class TDesC16 const & cpswrapper::CPublisherInfo::LogoIcon(void) const + ?WidgetName@CPublisherInfo@cpswrapper@@QBEABVTDesC16@@XZ @ 26 NONAME ; class TDesC16 const & cpswrapper::CPublisherInfo::WidgetName(void) const + ?NewL@CCpsWrapper@cpswrapper@@SAPAV12@AAVMCpsWrapperObserver@2@@Z @ 27 NONAME ; class cpswrapper::CCpsWrapper * cpswrapper::CCpsWrapper::NewL(class cpswrapper::MCpsWrapperObserver &) + ?SetDescriptionL@CPublisherInfo@cpswrapper@@QAEXABVTDesC16@@@Z @ 28 NONAME ; void cpswrapper::CPublisherInfo::SetDescriptionL(class TDesC16 const &) + diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/cpswrapper/eabi/cpswrapper.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/cpswrapper/eabi/cpswrapper.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ +EXPORTS + _ZN10cpswrapper11CCpsWrapper23GetTemplatedPublishersLEv @ 1 NONAME + _ZN10cpswrapper11CCpsWrapper4NewLERNS_19MCpsWrapperObserverE @ 2 NONAME + _ZN10cpswrapper11CCpsWrapper5NewLCERNS_19MCpsWrapperObserverE @ 3 NONAME + _ZN10cpswrapper11CCpsWrapperD0Ev @ 4 NONAME + _ZN10cpswrapper11CCpsWrapperD1Ev @ 5 NONAME + _ZN10cpswrapper11CCpsWrapperD2Ev @ 6 NONAME + _ZN10cpswrapper13CPublisherMap17AddPublisherInfoLEPNS_14CPublisherInfoE @ 7 NONAME + _ZN10cpswrapper13CPublisherMap4NewLEv @ 8 NONAME + _ZN10cpswrapper13CPublisherMap5NewLCEv @ 9 NONAME + _ZN10cpswrapper13CPublisherMapD0Ev @ 10 NONAME + _ZN10cpswrapper13CPublisherMapD1Ev @ 11 NONAME + _ZN10cpswrapper13CPublisherMapD2Ev @ 12 NONAME + _ZN10cpswrapper14CPublisherInfo12SetLogoIconLERK7TDesC16 @ 13 NONAME + _ZN10cpswrapper14CPublisherInfo13SetContentIdLERK7TDesC16 @ 14 NONAME + _ZN10cpswrapper14CPublisherInfo13SetMaxWidgetsERKl @ 15 NONAME + _ZN10cpswrapper14CPublisherInfo14SetWidgetNameLERK7TDesC16 @ 16 NONAME + _ZN10cpswrapper14CPublisherInfo15SetContentTypeLERK7TDesC16 @ 17 NONAME + _ZN10cpswrapper14CPublisherInfo15SetDescriptionLERK7TDesC16 @ 18 NONAME + _ZN10cpswrapper14CPublisherInfo15SetPublisherIdLERK7TDesC16 @ 19 NONAME + _ZN10cpswrapper14CPublisherInfo16SetTemplateTypeLERK7TDesC16 @ 20 NONAME + _ZN10cpswrapper14CPublisherInfo4NewLEv @ 21 NONAME + _ZN10cpswrapper14CPublisherInfo5NewLCEv @ 22 NONAME + _ZN10cpswrapper14CPublisherInfoD0Ev @ 23 NONAME + _ZN10cpswrapper14CPublisherInfoD1Ev @ 24 NONAME + _ZN10cpswrapper14CPublisherInfoD2Ev @ 25 NONAME + _ZNK10cpswrapper13CPublisherMap13PublisherInfoEv @ 26 NONAME + _ZNK10cpswrapper14CPublisherInfo10MaxWidgetsEv @ 27 NONAME + _ZNK10cpswrapper14CPublisherInfo10WidgetNameEv @ 28 NONAME + _ZNK10cpswrapper14CPublisherInfo11ContentTypeEv @ 29 NONAME + _ZNK10cpswrapper14CPublisherInfo11DescriptionEv @ 30 NONAME + _ZNK10cpswrapper14CPublisherInfo11PublisherIdEv @ 31 NONAME + _ZNK10cpswrapper14CPublisherInfo12TemplateTypeEv @ 32 NONAME + _ZNK10cpswrapper14CPublisherInfo8LogoIconEv @ 33 NONAME + _ZNK10cpswrapper14CPublisherInfo9ContentIdEv @ 34 NONAME + diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/cpswrapper/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/cpswrapper/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,26 @@ +/* +* 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: Item id, name and properties +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +PRJ_MMPFILES +cpswrapper.mmp diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/cpswrapper/group/cpswrapper.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/cpswrapper/group/cpswrapper.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,66 @@ +/* +* 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: project file +* +*/ + +#include + +TARGET cpswrapper.dll +TARGETTYPE dll +UID 0x1000008d + +CAPABILITY ALL -TCB +VENDORID VID_DEFAULT + +USERINCLUDE ../inc + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src + +SOURCE cpswrapper.cpp +SOURCE publisherinfo.cpp +SOURCE publishermap.cpp +SOURCE cpswrapperdllmain.cpp +SOURCE cpsobserver.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), +//the GCC ARM def file in a BMARM directory, and the ARMV5 def file in a EABI directory. +//If def files are stored in these locations, the project files does not need to specify +//the location of the def files explicitly. If you want to store the def files in some other +//location, you will need to specify in the project file where the .def files are using +//the deffile keyword. + +//The following commented out code shows how the build system uses the implicit +// location for defiles. To create the DEF files Choose Project > Freeze Exports from Carbide +// or run 'abld freeze' from the command-line +//#if defined (WINS) +// DEFFILE ../bwins/cpswrapper.def +//#elif defined (GCC32) +// DEFFILE ../bmarm/cpswrapper.def +//#else +// DEFFILE ../eabi/cpswrapper.def +//#endif + +nostrictdef + +LIBRARY euser.lib +LIBRARY liwServiceHandler.lib + +#ifdef ENABLE_ABIV2_MODE +DEBUGGABLE +#endif + diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/cpswrapper/inc/cpsconst.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/cpswrapper/inc/cpsconst.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Defines the CPS constants + * + */ + +#ifndef CPSCONST_H +#define CPSCONST_H + +namespace cpswrapper + { + + // Local constants + _LIT8( KCPSConfigurationIf, "IContentPublishing" ); + _LIT8( KCPS, "Service.ContentPublishing" ); + // CPS constants + _LIT( KHSTemplate, "hstemplate" ); + _LIT( KPublisher16, "publisher" ); + _LIT8( KPublisher, "publisher" ); + _LIT8( KContentType, "content_type" ); + _LIT8( KContentId, "content_id" ); + _LIT8( KFilter, "filter" ); + _LIT( KAll, "all"); + _LIT8( KOperation, "operation" ); + _LIT8( KChangeInfo, "change_info" ); + _LIT8( KDelete, "delete" ); + _LIT( KDelete16, "delete" ); + _LIT8( KAdd, "add" ); + _LIT( KAdd16, "add" ); + _LIT8( KRequestNotification, "RequestNotification" ); + _LIT8( KType, "type" ); + _LIT8( KGetList, "GetList" ); + _LIT8( KResults, "results" ); + _LIT8( KTemplateType, "template_type"); + _LIT8( KWidgetName, "widget_name"); + _LIT8( KDataMap, "data_map" ); + _LIT8( KMaxWidgets, "widget_inst"); + _LIT8( KWidgetDesc, "widget_desc"); + _LIT8( KWidgetIcon, "widget_icon"); + + _LIT( KWRTTemplate, "ai3templatedwidget"); + _LIT( KWRTPublisher, "wrt_publisher"); + _LIT8( KWidgetInfo, "widget_info"); + + } +#endif /* CPSCONST_H */ diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/cpswrapper/inc/cpsobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/cpswrapper/inc/cpsobserver.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,135 @@ +/* +* 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: Defines an observer to CPS +* +*/ + +#ifndef CPSOBSERVER_H +#define CPSOBSERVER_H + + // Forward declarations +class CLiwServiceHandler; +class CLiwCriteriaItem; +class MLiwInterface; + +namespace cpswrapper + { + /** + * Content publishing service wrapper namespace + */ + + // Forward declarations + class CCpsWrapper; + + /** + * Observer class for cps registry + * + * @code + * + * @endcode + * + * @lib cpswrapper.lib + * @since S60 v5.0 + */ + NONSHARABLE_CLASS( CCpsObserver ) : public CBase, public MLiwNotifyCallback + { + public: // Constructors and destructor + /** + * Two-phased constructor. + */ + static CCpsObserver* NewLC( CCpsWrapper* aCpsWrapper); + + /** + * Destructor. + */ + ~CCpsObserver(); + + public: //from MLiwNotifyCallback + + /** + * Handles notifications caused by an asynchronous Execute*CmdL call + * or an event. + * + * @param aCmdId The service command associated to the event. + * @param aEventId Occured event, see LiwCommon.hrh. + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL. + * @return Error code for the callback. + */ + TInt HandleNotifyL( + TInt aCmdId, + TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& aInParamList); + + public: + + /** + * Registers to CPS for add, delete , update and execute notifications + * + * @param aFilter - filter for input parameter list + * @param aRegistry - registry to register observer + */ + void RegisterL( CLiwDefaultMap* aFilter, const TDesC& aRegistry ); + + /** + * Cancel all the registered notifications. + */ + void ReleaseL(); + + private: + + /** + * Perform the second phase construction + */ + void ConstructL( ); + + /** + * Constructor. + * + * @param aCpsWrapper cps wrapper + */ + CCpsObserver( CCpsWrapper* aCpsWrapper ); + + /** + * Initialise Liw connection to Content publishing service. + */ + void InitLiwL(); + + /** + * Closes Liw connection to Content publishing service. + */ + void ReleaseLiw(); + + private: // data + + // Reference of MLiwInterface + // Owned + MLiwInterface* iInterface; + + // Reference of CLiwServiceHandler + // Owned + CLiwServiceHandler* iLiwHandler; + + // Reference of the CCpsWrapper + // Not owned + CCpsWrapper* iCpsWrapper; + + // Call back error code + TInt iError; + }; + } +#endif /* CPSOBSERVER_H_ */ diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/cpswrapper/inc/cpssapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/cpswrapper/inc/cpssapi.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Encapsulates cps sapi. Collects needed headers +* +*/ + +#ifndef CPSSAPI_H +#define CPSSAPI_H + +#include "cpswrapper.h" +#include "publisherinfo.h" +#include "publishermap.h" + +#endif // CPSSAPI_H + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/cpswrapper/inc/cpswrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/cpswrapper/inc/cpswrapper.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,192 @@ +/* + * 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: Encapsulates hsps liw service + * + */ + +#ifndef CPSWRAPPER_H +#define CPSWRAPPER_H + +// System includes +#include +#include // for MLiwNotifyCallback + +// Forward declarations +class CLiwServiceHandler; +class CLiwCriteriaItem; +class MLiwInterface; + +namespace cpswrapper + { + /** + * Content publishing service wrapper namespace + */ + + // Forward declarations + class CPublisherMap; + class CCpsObserver; + + /** + * Observer class for cpswrapper + * + * @code + * + * @endcode + * + * @lib cpswrapper.lib + * @since S60 v5.0 + */ + class MCpsWrapperObserver + { + public: + /** + * Callback methot for unregistered widget notify. + * + * @param aPublisher a Publisher + */ + virtual void NotifyWidgetUnregisteredL(const TDesC& aPublisher) = 0; + + /** + * Callback methot for registered widget notify. + */ + virtual void NotifyWidgetRegisteredL() = 0; + }; + + /** + * Wrapper for cps liw service + * + * + * @code + * + * @endcode + * + * @lib cpswrapper.lib + * @since S60 v5.0 + */ + NONSHARABLE_CLASS( CCpsWrapper ) : public CBase + { + public: + /** + * Two-phased constructor. + * @param aObserver Observer + */ + IMPORT_C static CCpsWrapper* NewL( MCpsWrapperObserver& aObserver ); + + /** + * Two-phased constructor. + * @param aObserver Observer + */ + IMPORT_C static CCpsWrapper* NewLC( MCpsWrapperObserver& aObserver ); + + /** + * Destructor. + */ + IMPORT_C ~CCpsWrapper(); + + protected: + /** + * Constructor + * @param aObserver Observer + */ + CCpsWrapper( MCpsWrapperObserver& aObserver ); + + /** + * Second phase constructor + */ + void ConstructL(); + + public: + /** + * Gets templated publishers + * + * @return map of publisher infos. Ownership is transfered. + */ + IMPORT_C CPublisherMap* GetTemplatedPublishersL(); + + /** + * Handles changed publisher. Deleted or added. + * + * @param aPublisher publisher + * @return + */ + void HandleChangedPublisherL(const TDesC& aPublisher, + const TDesC& aOperation); + + private: + // new functions + + /** + * Register for notification from publisher registry + */ + void StartListeningPublisherRegistryL(); + + /** + * Get maps of WRT widget publishers info. + * + * @param aPublisherMap a map of publishers info. + */ + void GetWRTWidgetsL(CPublisherMap& aPublisherMap); + + /** + * Register an observer for request notification + * + * @param aPublisher publisher name + * @param aContentType content type + * @param aContentId content id + * @param aOperation operation (add,delete,update,execute) + * @param aRegistry registry type (publisher/cp_data) + */ + void RequestForNotificationL( + const TDesC& aPublisher, + const TDesC& aContentType, + const TDesC& aContentId, + const TDesC8& aOperation, + const TDesC& aRegistry); + + private: // Data + /** + * Wrapper observer. + * Not owned + */ + MCpsWrapperObserver& iObserver; + + /** + * SAPI service handler. + * Owned. + */ + CLiwServiceHandler* iServiceHandler; + + /** + * CPS SAPI service. + * Owned. + */ + CLiwCriteriaItem* iCpsService; + + /** + * Provides hsps services. + * Owned. + */ + MLiwInterface* iCpsInterface; + + /** + * Registered cps observers. + * Owned. + */ + RPointerArray iObservers; + }; + + } + +#endif // CPSWRAPPER_H +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/cpswrapper/inc/publisherinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/cpswrapper/inc/publisherinfo.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,197 @@ +/* + * 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: Presents publisher info + * + */ + +#ifndef PUBLISHERINFO_H +#define PUBLISHERINFO_H + +#include + +namespace cpswrapper + { + /** + * Content publishing service wrapper namespace + */ + + /** + * Presents publisher info + * + * + * @code + * + * @endcode + * + * @lib cpswrapper.lib + * @since S60 v5.0 + */ + NONSHARABLE_CLASS( CPublisherInfo ) : public CBase + { + public: + /** + * Two-phased constructor. + */ + IMPORT_C static CPublisherInfo* NewL(); + IMPORT_C static CPublisherInfo* NewLC(); + + /** + * Destructor. + */ + IMPORT_C ~CPublisherInfo(); + + protected: + // constructors + CPublisherInfo(); + + void ConstructL(); + + public: + // new functions + + /** + * Set content id + * + * @param aContentId content id + */ + IMPORT_C void SetContentIdL( const TDesC& aContentId ); + + /** + * Get content id + * + * @return content id or KNullDesC8 + */ + IMPORT_C const TDesC& ContentId() const; + + /** + * Set publisher id + * + * @param aPublisherId publisher id + */ + IMPORT_C void SetPublisherIdL( const TDesC& aPublisherId ); + + /** + * Get Publisher id + * + * @return Publisher id or KNullDesC8 + */ + IMPORT_C const TDesC& PublisherId() const; + + /** + * Set Widget name + * + * @param aWidgetName widget name + */ + IMPORT_C void SetWidgetNameL( const TDesC& aWidgetName ); + + /** + * Get Widget name + * + * @return widget name or KNullDesC8 + */ + IMPORT_C const TDesC& WidgetName() const; + + /** + * Set content type + * + * @param aContentType content type + */ + IMPORT_C void SetContentTypeL( const TDesC& aContentType ); + + /** + * Get Content type + * + * @return Content type or KNullDesC8 + */ + IMPORT_C const TDesC& ContentType() const; + + /** + * Set Template type + * + * @param aTemplateType template type + */ + IMPORT_C void SetTemplateTypeL( const TDesC& aTemplateType ); + + /** + * Get Template type + * + * @return Template type or KNullDesC + */ + IMPORT_C const TDesC& TemplateType() const; + + /** + * Set Logo icon + * + * @param aLogoIcon logo icon + */ + IMPORT_C void SetLogoIconL( const TDesC& aLogoIcon ); + + /** + * Get Logo icon + * + * @return LogoIcon logo icon or KNullDesC + */ + IMPORT_C const TDesC& LogoIcon() const; + + /** + * Set widget description + * + * @param aDescription widget description + */ + IMPORT_C void SetDescriptionL( const TDesC& aDescription ); + + /** + * Get widget description + * + * @return Description widget description or KNullDesC + */ + IMPORT_C const TDesC& Description() const; + + /** + * Set Maximum number of widgets + * + * @param aMaxWidget maximum number of widgets + */ + IMPORT_C void SetMaxWidgets( const TInt32& aMaxWidget ); + + /** + * Get Maximum number of widgets + * + * @return number of widgets or defaule value 1 + */ + IMPORT_C const TInt32& MaxWidgets() const; + + private: + // data + // Content id, owned + HBufC* iContentId; + // Publisher id, owned + HBufC* iPublisherId; + // Publisher name, owned + HBufC* iWidgetName; + // Content type, owned + HBufC* iContentType; + // Template type, owned + HBufC* iTemplateType; + // Logo icon, owned + HBufC* iLogoIcon; + // Widget description, owned + HBufC* iDescription; + // Maximum instances + TInt32 iMaxInst; + }; + } + +#endif // PUBLISHERINFO_H +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/cpswrapper/inc/publishermap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/cpswrapper/inc/publishermap.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,85 @@ +/* + * 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: Presents publisher info map + * + */ + +#ifndef PUBLISHERMAP_H +#define PUBLISHERMAP_H + +#include + + +namespace cpswrapper + { + // Forward declarations + class CPublisherInfo; + + /** + * Presents publisher info map + * + * + * @code + * + * @endcode + * + * @lib cpswrapper.lib + * @since S60 v5.0 + */ + NONSHARABLE_CLASS( CPublisherMap ) : public CBase + { + public: + /** + * Two-phased constructor. + */ + IMPORT_C static CPublisherMap* NewL(); + IMPORT_C static CPublisherMap* NewLC(); + + /** + * Destructor. + */ + IMPORT_C ~CPublisherMap(); + + protected: + // constructors + CPublisherMap(); + + void ConstructL(); + + public: + // new functions + + /** + * Adds publisher info + * + * @param aPublisherInfo publisher info + */ + IMPORT_C void AddPublisherInfoL(CPublisherInfo* aPublisherInfo); + + /** + * Gets publisher infos + * + * @return Array of publisher infos + */ + IMPORT_C RPointerArray& PublisherInfo() const; + + private: + // data + // Publisher info array, owned + mutable RPointerArray iPublisherInfo; + }; + } + +#endif // PUBLISHERMAP_H +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/cpswrapper/src/cpsobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/cpswrapper/src/cpsobserver.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,287 @@ +/* +* 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: Implements an observer to CPS +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include + +#include "cpsobserver.h" +#include "cpswrapper.h" +#include "cpsconst.h" + +namespace cpswrapper + { + + // ============================================================================= + // -------------------------------------------------------------------------- + // Cleanup utility for RPointerArray + // -------------------------------------------------------------------------- + // + static void DoCleanup( TAny* aPtr ) + { + __ASSERT_DEBUG( aPtr, User::Invariant() ); + static_cast< RCriteriaArray* >( aPtr )->ResetAndDestroy(); + } + + // ============================ MEMBER FUNCTIONS ============================== + + // ---------------------------------------------------------------------------- + // Constructor + // ---------------------------------------------------------------------------- + // + CCpsObserver::CCpsObserver( CCpsWrapper* aCpsWrapper ) + : iCpsWrapper( aCpsWrapper ) + { + } + + // ---------------------------------------------------------------------------- + // Two-phased constructor. + // ---------------------------------------------------------------------------- + // + CCpsObserver* CCpsObserver::NewLC( CCpsWrapper* aCpsWrapper ) + { + CCpsObserver* self( + new( ELeave ) CCpsObserver( aCpsWrapper ) ); + + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + // --------------------------------------------------------------------------- + // Destructor + // --------------------------------------------------------------------------- + // + CCpsObserver::~CCpsObserver() + { + ReleaseL(); + ReleaseLiw(); + } + + // ---------------------------------------------------------------------------- + // Symbian 2nd phase constructor can leave. + // ---------------------------------------------------------------------------- + // + void CCpsObserver::ConstructL() + { + InitLiwL(); + } + + // --------------------------------------------------------------------------- + // CCpsObserver::HandleNotifyL + // + // Handles Published content notification + // --------------------------------------------------------------------------- + // + TInt CCpsObserver::HandleNotifyL( + TInt /*aErrorCode */, + 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() ); + + // Iter through list content + for ( TInt i = 0; i < changeMapsList->Count(); ++i ) + { + TLiwVariant changeMap; + changeMap.PushL(); + if ( changeMapsList->AtL( i, changeMap ) ) + { + const CLiwMap* map = changeMap.AsMap(); + + if ( map->FindL( KContentType, changeMap ) ) + { + HBufC* publisher = NULL; + HBufC* contentType = NULL; + + contentType = changeMap.AsDes().AllocLC(); + if ( KHSTemplate() == contentType && + map->FindL( KPublisher, changeMap ) ) + { + publisher = changeMap.AsDes().AllocLC(); + + if ( map->FindL( KOperation, changeMap ) ) + { + HBufC* operation = changeMap.AsDes().AllocLC(); + + // unregitered publisher's widget + // from home screen if exist or add + // new widget to widgetmanager + iCpsWrapper->HandleChangedPublisherL( *publisher, + *operation ); + CleanupStack::PopAndDestroy( operation ); + } + CleanupStack::PopAndDestroy( publisher ); + } + else if( KWRTTemplate() == contentType && + map->FindL( KContentId, changeMap ) ) + { + publisher = changeMap.AsDes().AllocLC(); + if ( map->FindL( KOperation, changeMap ) ) + { + HBufC* operation = changeMap.AsDes().AllocLC(); + + // unregitered publisher's widget + // from home screen if exist or add + // new widget to widgetmanager + iCpsWrapper->HandleChangedPublisherL( *publisher, + *operation ); + CleanupStack::PopAndDestroy( operation ); + } + CleanupStack::PopAndDestroy( publisher ); + } + CleanupStack::PopAndDestroy( contentType ); + } + } + CleanupStack::PopAndDestroy( &changeMap ); + } + + CleanupStack::PopAndDestroy( &variant ); + } + return KErrNone; + } + + // --------------------------------------------------------------------------- + // CCpsObserver::RegisterL + // + // Register for notifications + // --------------------------------------------------------------------------- + // + void CCpsObserver::RegisterL( CLiwDefaultMap* aFilter, const TDesC& aRegistry ) + { + CLiwGenericParamList* inParamList( CLiwGenericParamList::NewLC() ); + CLiwGenericParamList* outParamList( CLiwGenericParamList::NewLC() ); + + // Fill in input list for RequestNotification command + inParamList->AppendL(TLiwGenericParam(KType,TLiwVariant( aRegistry ))); + inParamList->AppendL(TLiwGenericParam(KFilter ,TLiwVariant( aFilter ))); + + iInterface->ExecuteCmdL( KRequestNotification, *inParamList, + *outParamList, 0, this ); + + CleanupStack::PopAndDestroy( outParamList ); + CleanupStack::PopAndDestroy( inParamList ); + } + + // --------------------------------------------------------------------------- + // CCpsObserver::ReleaseL + // + // Sing off to notification + // --------------------------------------------------------------------------- + // + void CCpsObserver::ReleaseL() + { + if( iInterface ) + { + CLiwGenericParamList* inParamList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( inParamList ); + CLiwGenericParamList* outParamList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( outParamList ); + + iInterface->ExecuteCmdL( KRequestNotification, *inParamList, *outParamList, + KLiwOptCancel, this ); + + CleanupStack::PopAndDestroy( outParamList ); + CleanupStack::PopAndDestroy( inParamList ); + } + } + + + // ------------------------------------------------------------------------ + // CCpsObserver::InitLiwL + // + // Init LIW interface. + // ------------------------------------------------------------------------ + void CCpsObserver::InitLiwL() + { + if ( !iLiwHandler ) + { + TInt error( KErrNone ); + CLiwGenericParamList* in( NULL ); + CLiwGenericParamList* out( NULL ); + CLiwCriteriaItem* criterion( NULL ); + + RCriteriaArray array( 1 ); + TCleanupItem cleanup( DoCleanup, &array ); + CleanupStack::PushL( cleanup ); + + // Do the basic initialization. + iLiwHandler = CLiwServiceHandler::NewL(); + + // Get iCPSIface. + in = CLiwGenericParamList::NewLC(); + out = CLiwGenericParamList::NewLC(); + + criterion = CLiwCriteriaItem::NewL( + KLiwCmdAsStr, + KCPSConfigurationIf, + KCPS ); + + error = array.Append( criterion ); + if ( error ) + { + delete criterion; + criterion = NULL; + User::Leave( error ); + } + + criterion->SetServiceClass( TUid::Uid( KLiwClassBase ) ); + + iLiwHandler->AttachL( array ); + iLiwHandler->ExecuteServiceCmdL( *criterion, *in, *out ); + + out->FindFirst( error, KCPSConfigurationIf ); + User::LeaveIfError( error ); + + iInterface = (*out)[ error ].Value().AsInterface(); + + CleanupStack::PopAndDestroy( 3 ); + } + } + + // --------------------------------------------------------------------------- + // CCpsObserver::ReleaseLiw + // --------------------------------------------------------------------------- + // + void CCpsObserver::ReleaseLiw() + { + if ( iInterface ) + { + iInterface->Close(); + iInterface = NULL; + } + + delete iLiwHandler; + iLiwHandler = NULL; + } +} + // End of File + diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/cpswrapper/src/cpswrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/cpswrapper/src/cpswrapper.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,420 @@ +/* + * 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: Encapsulates cps liw service + * + */ + +// System include files +#include +#include +#include +#include + +// User include files +#include "publisherinfo.h" +#include "publishermap.h" +#include "cpswrapper.h" +#include "cpsconst.h" +#include "cpsobserver.h" + +namespace cpswrapper + { + + // ======== MEMBER FUNCTIONS ======== + + // ----------------------------------------------------------------------- + // CCpsWrapper::NewL() + // ----------------------------------------------------------------------- + // + EXPORT_C CCpsWrapper* CCpsWrapper::NewL( MCpsWrapperObserver& aObserver ) + { + CCpsWrapper* self = CCpsWrapper::NewLC( aObserver ); + CleanupStack::Pop( self ); + return self; + } + + // ----------------------------------------------------------------------- + // CCpsWrapper::NewLC() + // ----------------------------------------------------------------------- + // + EXPORT_C CCpsWrapper* CCpsWrapper::NewLC(MCpsWrapperObserver& aObserver) + { + CCpsWrapper* self = new ( ELeave ) CCpsWrapper( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + // ----------------------------------------------------------------------- + // CCpsWrapper::ConstructL() + // ----------------------------------------------------------------------- + // + void CCpsWrapper::ConstructL() + { + iServiceHandler = CLiwServiceHandler::NewL(); + + RCriteriaArray interestList; + + // Attach to CPS: + iCpsService = CLiwCriteriaItem::NewL( 1, KCPSConfigurationIf, KCPS ); + iCpsService->SetServiceClass( TUid::Uid( KLiwClassBase ) ); + + interestList.AppendL( iCpsService ); + iServiceHandler->AttachL( interestList ); + interestList.Reset(); + + CLiwGenericParamList& inParamList( iServiceHandler->InParamListL() ); + CLiwGenericParamList& outParamList( iServiceHandler->OutParamListL() ); + + iServiceHandler->ExecuteServiceCmdL( + *iCpsService, + inParamList, + outParamList ); + + TInt pos( 0 ); + + outParamList.FindFirst( pos, KCPSConfigurationIf ); + + if ( pos != KErrNotFound ) + { + iCpsInterface = (outParamList)[pos].Value().AsInterface(); + inParamList.Reset(); + outParamList.Reset(); + } + else + { + inParamList.Reset(); + outParamList.Reset(); + User::Leave( KErrNotFound ); + } + + StartListeningPublisherRegistryL(); + } + + // ----------------------------------------------------------------------- + // CCpsWrapper::CCpsWrapper() + // ----------------------------------------------------------------------- + // + CCpsWrapper::CCpsWrapper( MCpsWrapperObserver& aObserver ) + : iObserver( aObserver ), + iCpsInterface( NULL ) + { + } + + // ----------------------------------------------------------------------- + // CCpsWrapper::~CCpsWrapper() + // ----------------------------------------------------------------------- + // + EXPORT_C CCpsWrapper::~CCpsWrapper() + { + iObservers.ResetAndDestroy(); + if ( iCpsInterface ) + { + // Close interface + iCpsInterface->Close(); + } + + if ( iServiceHandler && iCpsService ) + { + // Detach services from the handler + RCriteriaArray interestList; + + TRAP_IGNORE( interestList.AppendL( iCpsService ); + iServiceHandler->DetachL( interestList ); ); + + interestList.Reset(); + } + + delete iCpsService; + delete iServiceHandler; + } + + // ----------------------------------------------------------------------- + // CCpsWrapper::GetTemplatedPublishersL() + // ----------------------------------------------------------------------- + // + EXPORT_C CPublisherMap* CCpsWrapper::GetTemplatedPublishersL() + { + CLiwGenericParamList& inParamList( iServiceHandler->InParamListL() ); + CLiwGenericParamList& outParamList( iServiceHandler->OutParamListL() ); + + TLiwGenericParam type( KType, TLiwVariant( KPublisher16 ) ); + inParamList.AppendL( type ); + + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + + filter->InsertL( KContentType, TLiwVariant( KHSTemplate ) ); + + //append filter to input param + TLiwGenericParam item( KFilter, TLiwVariant( filter )); + inParamList.AppendL( item ); + + // Get all the publiser from CPS with publiser id ai3templatewidget + iCpsInterface->ExecuteCmdL( KGetList, inParamList, outParamList ); + + inParamList.Reset(); + + CleanupStack::PopAndDestroy(filter); + + TInt pos(0); + + outParamList.FindFirst( pos, KResults ); + + CPublisherMap* publishers = CPublisherMap::NewL(); + CleanupStack::PushL( publishers ); + + if ( pos != KErrNotFound ) + { + //extract iterator on results list + TLiwVariant variant( outParamList[pos].Value() ); + CLiwIterable* iterable( variant.AsIterable() ); + iterable->Reset(); + + //get all the templated widget publishers + while ( iterable->NextL( variant ) ) + { + //extract content map + CLiwDefaultMap *publisherMap = CLiwDefaultMap::NewLC(); + variant.Get( *publisherMap ); + variant.Reset(); + CPublisherInfo* publisherInfo = CPublisherInfo::NewLC(); + if ( publisherMap->FindL( KPublisher, variant ) ) + { + publisherInfo->SetPublisherIdL( variant.AsDes() ); + variant.Reset(); + } + + if ( publisherMap->FindL( KDataMap, variant) ) + { + CLiwDefaultMap* dataMap = CLiwDefaultMap::NewLC(); + variant.Get( *dataMap ); + variant.Reset(); + if ( dataMap->FindL( KTemplateType, variant) ) + { + publisherInfo->SetTemplateTypeL( variant.AsDes() ); + variant.Reset(); + } + + if ( dataMap->FindL( KWidgetName, variant ) ) + { + publisherInfo->SetWidgetNameL( variant.AsDes() ); + variant.Reset(); + } + + if ( dataMap->FindL( KMaxWidgets, variant ) ) + { + publisherInfo->SetMaxWidgets( + variant.AsTInt32() ); + variant.Reset(); + } + else + { + // Use default value 1 + publisherInfo->SetMaxWidgets( 1 ); + } + + if ( dataMap->FindL( KWidgetDesc, variant ) ) + { + publisherInfo->SetDescriptionL( variant.AsDes() ); + variant.Reset(); + } + + if ( dataMap->FindL( KWidgetIcon, variant ) ) + { + publisherInfo->SetLogoIconL( variant.AsDes() ); + variant.Reset(); + } + + CleanupStack::PopAndDestroy( dataMap ); + } + publisherInfo->SetContentTypeL( KHSTemplate() ); + publishers->AddPublisherInfoL( publisherInfo ); + CleanupStack::Pop( publisherInfo ); + + variant.Reset(); + CleanupStack::PopAndDestroy( publisherMap ); + } + } + GetWRTWidgetsL( *publishers ); + + CleanupStack::Pop( publishers ); + + outParamList.Reset(); + + return publishers; + } + + // ----------------------------------------------------------------------- + // CCpsWrapper::GetWRTWidgetsL() + // ----------------------------------------------------------------------- + // + void CCpsWrapper::GetWRTWidgetsL(CPublisherMap& aPublisherMap) + { + CLiwGenericParamList& inParamList( iServiceHandler->InParamListL() ); + CLiwGenericParamList& outParamList( iServiceHandler->OutParamListL() ); + + TLiwGenericParam type( KType, TLiwVariant( KPublisher16 ) ); + inParamList.AppendL( type ); + + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + + filter->InsertL( KPublisher, TLiwVariant( KWRTPublisher )); + filter->InsertL( KContentType, TLiwVariant( KWRTTemplate ) ); + + //append filter to input param + TLiwGenericParam item( KFilter, TLiwVariant( filter )); + inParamList.AppendL( item ); + + // Get all the publiser from CPS with publiser id ai3templatewidget + iCpsInterface->ExecuteCmdL( KGetList, inParamList, outParamList ); + + inParamList.Reset(); + + CleanupStack::PopAndDestroy(filter); + + TInt pos(0); + + outParamList.FindFirst( pos, KResults ); + + if ( pos != KErrNotFound ) + { + //extract iterator on results list + TLiwVariant variant( outParamList[pos].Value() ); + CLiwIterable* iterable( variant.AsIterable() ); + iterable->Reset(); + + //get all the templated widget publishers + while ( iterable->NextL( variant ) ) + { + //extract content map + CLiwDefaultMap *publisherMap = CLiwDefaultMap::NewLC(); + variant.Get( *publisherMap ); + variant.Reset(); + CPublisherInfo* publisherInfo = CPublisherInfo::NewLC(); + if ( publisherMap->FindL( KContentId, variant ) ) + { + publisherInfo->SetPublisherIdL( variant.AsDes() ); + variant.Reset(); + } + + if ( publisherMap->FindL( KDataMap, variant) ) + { + CLiwDefaultMap* dataMap = CLiwDefaultMap::NewLC(); + variant.Get( *dataMap ); + variant.Reset(); + if ( dataMap->FindL( KWidgetInfo, variant ) ) + { + CLiwDefaultMap* widgetInfoMap = CLiwDefaultMap::NewLC(); + variant.Get( *widgetInfoMap ); + if ( widgetInfoMap->FindL( KTemplateType, variant) ) + { + publisherInfo->SetTemplateTypeL( variant.AsDes() ); + variant.Reset(); + } + if ( widgetInfoMap->FindL( KWidgetName, variant ) ) + { + publisherInfo->SetWidgetNameL( variant.AsDes() ); + variant.Reset(); + } + if ( widgetInfoMap->FindL( KWidgetDesc, variant ) ) + { + publisherInfo->SetDescriptionL( variant.AsDes() ); + variant.Reset(); + } + if ( widgetInfoMap->FindL( KWidgetIcon, variant ) ) + { + publisherInfo->SetLogoIconL( variant.AsDes() ); + variant.Reset(); + } + + CleanupStack::PopAndDestroy( widgetInfoMap ); + } + CleanupStack::PopAndDestroy( dataMap ); + } + publisherInfo->SetContentTypeL( KWRTTemplate() ); + publisherInfo->SetMaxWidgets(1); + aPublisherMap.AddPublisherInfoL( publisherInfo ); + CleanupStack::Pop( publisherInfo ); + + variant.Reset(); + CleanupStack::PopAndDestroy( publisherMap ); + } + } + outParamList.Reset(); + + } + // ----------------------------------------------------------------------- + // CCpsWrapper::RequestForNotificationL() + // ----------------------------------------------------------------------- + // + void CCpsWrapper::RequestForNotificationL( + const TDesC& aPublisher, + const TDesC& aContentType, + const TDesC& aContentId, + const TDesC8& aOperation, + const TDesC& aRegistry) + { + CCpsObserver* observer = CCpsObserver::NewLC( this ); + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + + filter->InsertL( KPublisher, TLiwVariant( aPublisher ) ); + filter->InsertL( KContentType, TLiwVariant( aContentType ) ); + filter->InsertL( KContentId, TLiwVariant( aContentId ) ); + filter->InsertL( KOperation, TLiwVariant( aOperation )); + + observer->RegisterL( filter, aRegistry ); + iObservers.AppendL( observer ); + + CleanupStack::PopAndDestroy(filter); + CleanupStack::Pop( observer ); + } + + // ----------------------------------------------------------------------- + // CCpsWrapper::StartListeningPublisherRegistryL() + // ----------------------------------------------------------------------- + // + void CCpsWrapper::StartListeningPublisherRegistryL() + { + // Start Listening all the HS template using widgets unregistration + RequestForNotificationL( KAll, KHSTemplate, KAll, KDelete, KPublisher16 ); + + // Start Listening all the WRT widgets unregistration + RequestForNotificationL( KAll, KWRTTemplate, KAll, KDelete, KPublisher16 ); + + // Start Listening all the WRT widgets registrations + RequestForNotificationL( KAll, KWRTTemplate, KAll, KAdd, KPublisher16 ); + + // Start Listening all the HS template widgets registrations + RequestForNotificationL( KAll, KHSTemplate, KAll, KAdd, KPublisher16 ); + } + + // ----------------------------------------------------------------------- + // CCpsWrapper::HandleChangedPublisherL() + // ----------------------------------------------------------------------- + // + void CCpsWrapper::HandleChangedPublisherL(const TDesC& aPublisher, + const TDesC& aOperation) + { + if ( aOperation == KDelete16 ) + { + iObserver.NotifyWidgetUnregisteredL( aPublisher ); + } + else if ( aOperation == KAdd16 ) + { + iObserver.NotifyWidgetRegisteredL(); + } + } + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/cpswrapper/src/cpswrapperdllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/cpswrapper/src/cpswrapperdllmain.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Item id, name and properties + * + */ + +// Include Files +#include + +// Global Functions + +// Exported Functions + +#ifndef EKA2 // for EKA1 only +/** + * Called when the DLL is loaded and unloaded. Note: have to define + * epoccalldllentrypoints in MMP file to get this called in THUMB. + * @param aReason not used + */ +EXPORT_C TInt E32Dll(TDllReason /*aReason*/) + { + return KErrNone; + } +#endif + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/cpswrapper/src/publisherinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/cpswrapper/src/publisherinfo.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,246 @@ +/* + * 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: Presents publisher info + * + */ + +// User includes +#include "publisherinfo.h" + +namespace cpswrapper + { + // ======== MEMBER FUNCTIONS ======== + + // ----------------------------------------------------------------------- + // CPublisherInfo::CPublisherInfo() + // ----------------------------------------------------------------------- + // + CPublisherInfo::CPublisherInfo() + { + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::ConstructL() + // ----------------------------------------------------------------------- + // + void CPublisherInfo::ConstructL() + { + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::NewL() + // ----------------------------------------------------------------------- + // + EXPORT_C CPublisherInfo* CPublisherInfo::NewL() + { + CPublisherInfo* self = CPublisherInfo::NewLC(); + CleanupStack::Pop(self); + return self; + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::NewLC() + // ----------------------------------------------------------------------- + // + EXPORT_C CPublisherInfo* CPublisherInfo::NewLC() + { + CPublisherInfo* self = new ( ELeave ) CPublisherInfo; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::~CPublisherInfo() + // ----------------------------------------------------------------------- + // + EXPORT_C CPublisherInfo::~CPublisherInfo() + { + delete iContentId; + delete iPublisherId; + delete iWidgetName; + delete iContentType; + delete iTemplateType; + delete iLogoIcon; + delete iDescription; + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::SetContentIdL() + // ----------------------------------------------------------------------- + // + EXPORT_C void CPublisherInfo::SetContentIdL( const TDesC& aContentId ) + { + delete iContentId; + iContentId = NULL; + + iContentId = aContentId.AllocL(); + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::ContentId() + // ----------------------------------------------------------------------- + // + EXPORT_C const TDesC& CPublisherInfo::ContentId() const + { + return iContentId ? *iContentId : KNullDesC(); + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::SetPublisherIdL() + // ----------------------------------------------------------------------- + // + EXPORT_C void CPublisherInfo::SetPublisherIdL( const TDesC& aPublisherId ) + { + delete iPublisherId; + iPublisherId = NULL; + + iPublisherId = aPublisherId.AllocL(); + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::PublisherId() + // ----------------------------------------------------------------------- + // + EXPORT_C const TDesC& CPublisherInfo::PublisherId() const + { + return iPublisherId ? *iPublisherId : KNullDesC(); + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::SetPublisherNameL() + // ----------------------------------------------------------------------- + // + EXPORT_C void CPublisherInfo::SetWidgetNameL( const TDesC& aPublisherName ) + { + delete iWidgetName; + iWidgetName = NULL; + + iWidgetName = aPublisherName.AllocL(); + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::PublisherName() + // ----------------------------------------------------------------------- + // + EXPORT_C const TDesC& CPublisherInfo::WidgetName() const + { + return iWidgetName ? *iWidgetName : KNullDesC(); + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::SetContentTypeL() + // ----------------------------------------------------------------------- + // + EXPORT_C void CPublisherInfo::SetContentTypeL( const TDesC& aContentType ) + { + delete iContentType; + iContentType = NULL; + + iContentType = aContentType.AllocL(); + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::ContentType() + // ----------------------------------------------------------------------- + // + EXPORT_C const TDesC& CPublisherInfo::ContentType() const + { + return iContentType ? *iContentType : KNullDesC(); + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::SetTemplateTypeL() + // ----------------------------------------------------------------------- + // + EXPORT_C void CPublisherInfo::SetTemplateTypeL( const TDesC& aTemplateType ) + { + delete iTemplateType; + iTemplateType = NULL; + + iTemplateType = aTemplateType.AllocL(); + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::TemplateType() + // ----------------------------------------------------------------------- + // + EXPORT_C const TDesC& CPublisherInfo::TemplateType() const + { + return iTemplateType ? *iTemplateType : KNullDesC(); + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::SetLogoIconL() + // ----------------------------------------------------------------------- + // + EXPORT_C void CPublisherInfo::SetLogoIconL( const TDesC& aLogoIcon ) + { + delete iLogoIcon; + iLogoIcon = NULL; + + iLogoIcon = aLogoIcon.AllocL(); + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::LogoIcon() + // ----------------------------------------------------------------------- + // + EXPORT_C const TDesC& CPublisherInfo::LogoIcon() const + { + return iLogoIcon ? *iLogoIcon : KNullDesC(); + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::SetDescriptionL() + // ----------------------------------------------------------------------- + // + EXPORT_C void CPublisherInfo::SetDescriptionL( const TDesC& aDescription ) + { + delete iDescription; + iDescription = NULL; + + iDescription = aDescription.AllocL(); + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::Description() + // ----------------------------------------------------------------------- + // + EXPORT_C const TDesC& CPublisherInfo::Description() const + { + return iDescription ? *iDescription : KNullDesC(); + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::SetMaxWidgets() + // ----------------------------------------------------------------------- + // + EXPORT_C void CPublisherInfo::SetMaxWidgets( const TInt32& aMaxWidget ) + { + iMaxInst = aMaxWidget; + } + + // ----------------------------------------------------------------------- + // CPublisherInfo::MaxWidgets() + // ----------------------------------------------------------------------- + // + EXPORT_C const TInt32& CPublisherInfo::MaxWidgets() const + { + return iMaxInst; + } + } + +// End of file + diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/cpswrapper/src/publishermap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/cpswrapper/src/publishermap.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,95 @@ +/* + * 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: Presents publisher info map + * + */ + +// User includes +#include "publisherinfo.h" +#include "publishermap.h" + +namespace cpswrapper + { + // ======== MEMBER FUNCTIONS ======== + + // ----------------------------------------------------------------------- + // CPublisherMap::CPublisherMap() + // ----------------------------------------------------------------------- + // + CPublisherMap::CPublisherMap() + { + } + + // ----------------------------------------------------------------------- + // CPublisherMap::ConstructL() + // ----------------------------------------------------------------------- + // + void CPublisherMap::ConstructL() + { + } + + // ----------------------------------------------------------------------- + // CPublisherMap::NewL() + // ----------------------------------------------------------------------- + // + EXPORT_C CPublisherMap* CPublisherMap::NewL() + { + CPublisherMap* self = CPublisherMap::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + // ----------------------------------------------------------------------- + // CPublisherMap::NewLC() + // ----------------------------------------------------------------------- + // + EXPORT_C CPublisherMap* CPublisherMap::NewLC() + { + CPublisherMap* self = new ( ELeave ) CPublisherMap; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + // ----------------------------------------------------------------------- + // CPublisherMap::~CPublisherMap() + // ----------------------------------------------------------------------- + // + EXPORT_C CPublisherMap::~CPublisherMap() + { + iPublisherInfo.ResetAndDestroy(); + } + + // ----------------------------------------------------------------------- + // CPublisherMap::AddPublisherInfoL() + // ----------------------------------------------------------------------- + // + EXPORT_C void CPublisherMap::AddPublisherInfoL( + CPublisherInfo* aPublisherInfo ) + { + User::LeaveIfError( + iPublisherInfo.InsertInAddressOrder( aPublisherInfo )); + } + + // ----------------------------------------------------------------------- + // CPublisherMap::PublisherInfo() + // ----------------------------------------------------------------------- + // + EXPORT_C RPointerArray& CPublisherMap::PublisherInfo() const + { + return iPublisherInfo; + } + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/bwins/hspswrapper.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/bwins/hspswrapper.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,100 @@ +EXPORTS + ?LogoIcon@CPluginInfo@hspswrapper@@QBEABVTDesC16@@XZ @ 1 NONAME ; class TDesC16 const & hspswrapper::CPluginInfo::LogoIcon(void) const + ?NewL@CObjectMap@hspswrapper@@SAPAV12@XZ @ 2 NONAME ; class hspswrapper::CObjectMap * hspswrapper::CObjectMap::NewL(void) + ?NewL@CHspsWrapper@hspswrapper@@SAPAV12@ABVTDesC8@@PAVMHspsWrapperObserver@2@@Z @ 3 NONAME ; class hspswrapper::CHspsWrapper * hspswrapper::CHspsWrapper::NewL(class TDesC8 const &, class hspswrapper::MHspsWrapperObserver *) + ?HspsService@CHspsWrapper@hspswrapper@@QBEPAVCLiwCriteriaItem@@XZ @ 4 NONAME ; class CLiwCriteriaItem * hspswrapper::CHspsWrapper::HspsService(void) const + ?Settings@CHspsConfiguration@hspswrapper@@QAEAAV?$RPointerArray@VCItemMap@hspswrapper@@@@XZ @ 5 NONAME ; class RPointerArray & hspswrapper::CHspsConfiguration::Settings(void) + ?PluginUid@CPluginMap@hspswrapper@@QBEABVTDesC8@@XZ @ 6 NONAME ; class TDesC8 const & hspswrapper::CPluginMap::PluginUid(void) const + ?ItemName@CItemMap@hspswrapper@@QBEABVTDesC8@@XZ @ 7 NONAME ; class TDesC8 const & hspswrapper::CItemMap::ItemName(void) const + ??1CPluginMap@hspswrapper@@UAE@XZ @ 8 NONAME ; hspswrapper::CPluginMap::~CPluginMap(void) + ?ActivationState@CPluginMap@hspswrapper@@QBEHXZ @ 9 NONAME ; int hspswrapper::CPluginMap::ActivationState(void) const + ?SetAppConfigurationL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@@Z @ 10 NONAME ; int hspswrapper::CHspsWrapper::SetAppConfigurationL(class TDesC8 const &) + ?Uid@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 11 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::Uid(void) const + ?ConfigurationState@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 12 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::ConfigurationState(void) const + ?NameL@CObjectMap@hspswrapper@@QBEABVTDesC8@@XZ @ 13 NONAME ; class TDesC8 const & hspswrapper::CObjectMap::NameL(void) const + ?Value@CPropertyMap@hspswrapper@@QBEABVTDesC8@@XZ @ 14 NONAME ; class TDesC8 const & hspswrapper::CPropertyMap::Value(void) const + ?NewL@CPropertyMap@hspswrapper@@SAPAV12@XZ @ 15 NONAME ; class hspswrapper::CPropertyMap * hspswrapper::CPropertyMap::NewL(void) + ??1CPluginInfo@hspswrapper@@UAE@XZ @ 16 NONAME ; hspswrapper::CPluginInfo::~CPluginInfo(void) + ?AddObjectMapL@CHspsConfiguration@hspswrapper@@QAEAAV12@PAVCObjectMap@2@@Z @ 17 NONAME ; class hspswrapper::CHspsConfiguration & hspswrapper::CHspsConfiguration::AddObjectMapL(class hspswrapper::CObjectMap *) + ?PluginId@CPluginMap@hspswrapper@@QBEABVTDesC8@@XZ @ 18 NONAME ; class TDesC8 const & hspswrapper::CPluginMap::PluginId(void) const + ?PluginMaps@CHspsConfiguration@hspswrapper@@QAEAAV?$RPointerArray@VCPluginMap@hspswrapper@@@@XZ @ 19 NONAME ; class RPointerArray & hspswrapper::CHspsConfiguration::PluginMaps(void) + ?NewL@CPluginMap@hspswrapper@@SAPAV12@XZ @ 20 NONAME ; class hspswrapper::CPluginMap * hspswrapper::CPluginMap::NewL(void) + ??1CPropertyMap@hspswrapper@@UAE@XZ @ 21 NONAME ; hspswrapper::CPropertyMap::~CPropertyMap(void) + ?SetNameL@CObjectMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 22 NONAME ; class hspswrapper::CObjectMap & hspswrapper::CObjectMap::SetNameL(class TDesC8 const &) + ?SetPluginIdL@CPluginMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 23 NONAME ; class hspswrapper::CPluginMap & hspswrapper::CPluginMap::SetPluginIdL(class TDesC8 const &) + ?SetConfigurationStateL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 24 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetConfigurationStateL(class TDesC8 const &) + ??1CHspsConfiguration@hspswrapper@@UAE@XZ @ 25 NONAME ; hspswrapper::CHspsConfiguration::~CHspsConfiguration(void) + ?Status@CAddPluginResult@hspswrapper@@QBEHXZ @ 26 NONAME ; int hspswrapper::CAddPluginResult::Status(void) const + ?NewLC@CHspsConfiguration@hspswrapper@@SAPAV12@XZ @ 27 NONAME ; class hspswrapper::CHspsConfiguration * hspswrapper::CHspsConfiguration::NewLC(void) + ?Name@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 28 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::Name(void) const + ??1CHspsWrapper@hspswrapper@@UAE@XZ @ 29 NONAME ; hspswrapper::CHspsWrapper::~CHspsWrapper(void) + ?SetMultiInstanceL@CPluginInfo@hspswrapper@@QAEAAV12@J@Z @ 30 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetMultiInstanceL(long) + ?MultiInstance@CPluginInfo@hspswrapper@@QBEABJXZ @ 31 NONAME ; long const & hspswrapper::CPluginInfo::MultiInstance(void) const + ?SetStatus@CAddPluginResult@hspswrapper@@QAEXH@Z @ 32 NONAME ; void hspswrapper::CAddPluginResult::SetStatus(int) + ?AddItemMapL@CHspsConfiguration@hspswrapper@@QAEAAV12@PAVCItemMap@2@@Z @ 33 NONAME ; class hspswrapper::CHspsConfiguration & hspswrapper::CHspsConfiguration::AddItemMapL(class hspswrapper::CItemMap *) + ?MovePluginsL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@ABVMDesC8Array@@@Z @ 34 NONAME ; int hspswrapper::CHspsWrapper::MovePluginsL(class TDesC8 const &, class MDesC8Array const &) + ?HspsInterface@CHspsWrapper@hspswrapper@@QBEPAVMLiwInterface@@XZ @ 35 NONAME ; class MLiwInterface * hspswrapper::CHspsWrapper::HspsInterface(void) const + ?PluginInfo@CHspsConfiguration@hspswrapper@@QAEAAVCPluginInfo@2@XZ @ 36 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CHspsConfiguration::PluginInfo(void) + ?NewL@CAddPluginResult@hspswrapper@@SAPAV12@XZ @ 37 NONAME ; class hspswrapper::CAddPluginResult * hspswrapper::CAddPluginResult::NewL(void) + ?GetPluginConfigurationL@CHspsWrapper@hspswrapper@@QAEPAVCHspsConfiguration@2@ABVTDesC8@@@Z @ 38 NONAME ; class hspswrapper::CHspsConfiguration * hspswrapper::CHspsWrapper::GetPluginConfigurationL(class TDesC8 const &) + ?Properties@CItemMap@hspswrapper@@QBEAAV?$RPointerArray@VCPropertyMap@hspswrapper@@@@XZ @ 39 NONAME ; class RPointerArray & hspswrapper::CItemMap::Properties(void) const + ?Path@CObjectMap@hspswrapper@@QBEABVTDesC8@@XZ @ 40 NONAME ; class TDesC8 const & hspswrapper::CObjectMap::Path(void) const + ?NewLC@CHspsWrapper@hspswrapper@@SAPAV12@ABVTDesC8@@PAVMHspsWrapperObserver@2@@Z @ 41 NONAME ; class hspswrapper::CHspsWrapper * hspswrapper::CHspsWrapper::NewLC(class TDesC8 const &, class hspswrapper::MHspsWrapperObserver *) + ?SetNameL@CPropertyMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 42 NONAME ; class hspswrapper::CPropertyMap & hspswrapper::CPropertyMap::SetNameL(class TDesC8 const &) + ?SetConfStateL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@0H@Z @ 43 NONAME ; int hspswrapper::CHspsWrapper::SetConfStateL(class TDesC8 const &, class TDesC8 const &, int) + ?MediaType@CObjectMap@hspswrapper@@QBEABVTDesC8@@XZ @ 44 NONAME ; class TDesC8 const & hspswrapper::CObjectMap::MediaType(void) const + ?SetTypeL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 45 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetTypeL(class TDesC8 const &) + ?AddPropertyMapL@CItemMap@hspswrapper@@QAEAAV12@PAVCPropertyMap@2@@Z @ 46 NONAME ; class hspswrapper::CItemMap & hspswrapper::CItemMap::AddPropertyMapL(class hspswrapper::CPropertyMap *) + ?NewLC@CObjectMap@hspswrapper@@SAPAV12@XZ @ 47 NONAME ; class hspswrapper::CObjectMap * hspswrapper::CObjectMap::NewLC(void) + ?GetAppConfigurationsL@CHspsWrapper@hspswrapper@@QAEXAAV?$RPointerArray@VCPluginInfo@hspswrapper@@@@@Z @ 48 NONAME ; void hspswrapper::CHspsWrapper::GetAppConfigurationsL(class RPointerArray &) + ?NewL@CPluginInfo@hspswrapper@@SAPAV12@XZ @ 49 NONAME ; class hspswrapper::CPluginInfo * hspswrapper::CPluginInfo::NewL(void) + ?SetItemNameL@CItemMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 50 NONAME ; class hspswrapper::CItemMap & hspswrapper::CItemMap::SetItemNameL(class TDesC8 const &) + ?AddPluginL@CHspsWrapper@hspswrapper@@QAEPAVCAddPluginResult@2@ABVTDesC8@@0@Z @ 51 NONAME ; class hspswrapper::CAddPluginResult * hspswrapper::CHspsWrapper::AddPluginL(class TDesC8 const &, class TDesC8 const &) + ?NewL@CHspsConfiguration@hspswrapper@@SAPAV12@XZ @ 52 NONAME ; class hspswrapper::CHspsConfiguration * hspswrapper::CHspsConfiguration::NewL(void) + ?SetLogoIconL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 53 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetLogoIconL(class TDesC8 const &) + ?SetPluginUidL@CPluginMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 54 NONAME ; class hspswrapper::CPluginMap & hspswrapper::CPluginMap::SetPluginUidL(class TDesC8 const &) + ?SetValueL@CPropertyMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 55 NONAME ; class hspswrapper::CPropertyMap & hspswrapper::CPropertyMap::SetValueL(class TDesC8 const &) + ??1CObjectMap@hspswrapper@@UAE@XZ @ 56 NONAME ; hspswrapper::CObjectMap::~CObjectMap(void) + ??1CItemMap@hspswrapper@@UAE@XZ @ 57 NONAME ; hspswrapper::CItemMap::~CItemMap(void) + ?Name@CPropertyMap@hspswrapper@@QBEABVTDesC8@@XZ @ 58 NONAME ; class TDesC8 const & hspswrapper::CPropertyMap::Name(void) const + ?SetPluginSettingsL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@ABV?$RPointerArray@VCItemMap@hspswrapper@@@@@Z @ 59 NONAME ; int hspswrapper::CHspsWrapper::SetPluginSettingsL(class TDesC8 const &, class RPointerArray const &) + ?ConfId@CHspsConfiguration@hspswrapper@@QBEABVTDesC8@@XZ @ 60 NONAME ; class TDesC8 const & hspswrapper::CHspsConfiguration::ConfId(void) const + ?GetPluginsL@CHspsWrapper@hspswrapper@@QAEXAAV?$RPointerArray@VCPluginInfo@hspswrapper@@@@ABVTDesC8@@1@Z @ 61 NONAME ; void hspswrapper::CHspsWrapper::GetPluginsL(class RPointerArray &, class TDesC8 const &, class TDesC8 const &) + ?ItemId@CItemMap@hspswrapper@@QBEABVTDesC8@@XZ @ 62 NONAME ; class TDesC8 const & hspswrapper::CItemMap::ItemId(void) const + ?GetAppConfigurationL@CHspsWrapper@hspswrapper@@QAEPAVCHspsConfiguration@2@XZ @ 63 NONAME ; class hspswrapper::CHspsConfiguration * hspswrapper::CHspsWrapper::GetAppConfigurationL(void) + ?NewL@CItemMap@hspswrapper@@SAPAV12@XZ @ 64 NONAME ; class hspswrapper::CItemMap * hspswrapper::CItemMap::NewL(void) + ?SetPathL@CObjectMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 65 NONAME ; class hspswrapper::CObjectMap & hspswrapper::CObjectMap::SetPathL(class TDesC8 const &) + ?PluginId@CAddPluginResult@hspswrapper@@QBEABVTDesC8@@XZ @ 66 NONAME ; class TDesC8 const & hspswrapper::CAddPluginResult::PluginId(void) const + ??1CAddPluginResult@hspswrapper@@UAE@XZ @ 67 NONAME ; hspswrapper::CAddPluginResult::~CAddPluginResult(void) + ?Description@CPluginInfo@hspswrapper@@QBEABVTDesC16@@XZ @ 68 NONAME ; class TDesC16 const & hspswrapper::CPluginInfo::Description(void) const + ?NewLC@CPluginMap@hspswrapper@@SAPAV12@XZ @ 69 NONAME ; class hspswrapper::CPluginMap * hspswrapper::CPluginMap::NewLC(void) + ?ReplacePluginL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@0@Z @ 70 NONAME ; int hspswrapper::CHspsWrapper::ReplacePluginL(class TDesC8 const &, class TDesC8 const &) + ?Resources@CHspsConfiguration@hspswrapper@@QAEAAV?$RPointerArray@VCObjectMap@hspswrapper@@@@XZ @ 71 NONAME ; class RPointerArray & hspswrapper::CHspsConfiguration::Resources(void) + ?ServiceHandler@CHspsWrapper@hspswrapper@@QBEPAVCLiwServiceHandler@@XZ @ 72 NONAME ; class CLiwServiceHandler * hspswrapper::CHspsWrapper::ServiceHandler(void) const + ?Interface@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 73 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::Interface(void) const + ?SetActivePluginL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@@Z @ 74 NONAME ; int hspswrapper::CHspsWrapper::SetActivePluginL(class TDesC8 const &) + ?SetDescriptionL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 75 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetDescriptionL(class TDesC8 const &) + ?AddPluginL@CHspsWrapper@hspswrapper@@QAEPAVCAddPluginResult@2@ABVTDesC8@@0H@Z @ 76 NONAME ; class hspswrapper::CAddPluginResult * hspswrapper::CHspsWrapper::AddPluginL(class TDesC8 const &, class TDesC8 const &, int) + ?SetPluginIdL@CAddPluginResult@hspswrapper@@QAEXABVTDesC8@@@Z @ 77 NONAME ; void hspswrapper::CAddPluginResult::SetPluginIdL(class TDesC8 const &) + ?SetUidL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 78 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetUidL(class TDesC8 const &) + ?SetTagL@CObjectMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 79 NONAME ; class hspswrapper::CObjectMap & hspswrapper::CObjectMap::SetTagL(class TDesC8 const &) + ?NewLC@CPluginInfo@hspswrapper@@SAPAV12@XZ @ 80 NONAME ; class hspswrapper::CPluginInfo * hspswrapper::CPluginInfo::NewLC(void) + ?SetNameL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 81 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetNameL(class TDesC8 const &) + ?SetMediaTypeL@CObjectMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 82 NONAME ; class hspswrapper::CObjectMap & hspswrapper::CObjectMap::SetMediaTypeL(class TDesC8 const &) + ?Tag@CObjectMap@hspswrapper@@QBEABVTDesC8@@XZ @ 83 NONAME ; class TDesC8 const & hspswrapper::CObjectMap::Tag(void) const + ?SetItemIdL@CItemMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 84 NONAME ; class hspswrapper::CItemMap & hspswrapper::CItemMap::SetItemIdL(class TDesC8 const &) + ?NewLC@CItemMap@hspswrapper@@SAPAV12@XZ @ 85 NONAME ; class hspswrapper::CItemMap * hspswrapper::CItemMap::NewLC(void) + ?SetLogoIconL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC16@@@Z @ 86 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetLogoIconL(class TDesC16 const &) + ?SetInterfaceL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 87 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetInterfaceL(class TDesC8 const &) + ?AddPluginMapL@CHspsConfiguration@hspswrapper@@QAEAAV12@PAVCPluginMap@2@@Z @ 88 NONAME ; class hspswrapper::CHspsConfiguration & hspswrapper::CHspsConfiguration::AddPluginMapL(class hspswrapper::CPluginMap *) + ?RemovePluginL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@@Z @ 89 NONAME ; int hspswrapper::CHspsWrapper::RemovePluginL(class TDesC8 const &) + ?SetActivationStateL@CPluginMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 90 NONAME ; class hspswrapper::CPluginMap & hspswrapper::CPluginMap::SetActivationStateL(class TDesC8 const &) + ?Type@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 91 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::Type(void) const + ?SetConfIdL@CHspsConfiguration@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 92 NONAME ; class hspswrapper::CHspsConfiguration & hspswrapper::CHspsConfiguration::SetConfIdL(class TDesC8 const &) + ?SetDescriptionL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC16@@@Z @ 93 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetDescriptionL(class TDesC16 const &) + ?NewLC@CPropertyMap@hspswrapper@@SAPAV12@XZ @ 94 NONAME ; class hspswrapper::CPropertyMap * hspswrapper::CPropertyMap::NewLC(void) + ??0CAddPluginResult@hspswrapper@@AAE@XZ @ 95 NONAME ; hspswrapper::CAddPluginResult::CAddPluginResult(void) + ?SetMaxChild@CPluginInfo@hspswrapper@@QAEAAV12@J@Z @ 96 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetMaxChild(long) + ?MaxChild@CPluginInfo@hspswrapper@@QBEABJXZ @ 97 NONAME ; long const & hspswrapper::CPluginInfo::MaxChild(void) const + ?SetLockingStatusL@CPluginMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 98 NONAME ; class hspswrapper::CPluginMap & hspswrapper::CPluginMap::SetLockingStatusL(class TDesC8 const &) + ?LockingStatus@CPluginMap@hspswrapper@@QBEABVTDesC8@@XZ @ 99 NONAME ; class TDesC8 const & hspswrapper::CPluginMap::LockingStatus(void) const diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/eabi/hspswrapper.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/eabi/hspswrapper.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,134 @@ +EXPORTS + _ZN11hspswrapper10CObjectMap13SetMediaTypeLERK6TDesC8 @ 1 NONAME + _ZN11hspswrapper10CObjectMap4NewLEv @ 2 NONAME + _ZN11hspswrapper10CObjectMap5NewLCEv @ 3 NONAME + _ZN11hspswrapper10CObjectMap7SetTagLERK6TDesC8 @ 4 NONAME + _ZN11hspswrapper10CObjectMap8SetNameLERK6TDesC8 @ 5 NONAME + _ZN11hspswrapper10CObjectMap8SetPathLERK6TDesC8 @ 6 NONAME + _ZN11hspswrapper10CObjectMapD0Ev @ 7 NONAME + _ZN11hspswrapper10CObjectMapD1Ev @ 8 NONAME + _ZN11hspswrapper10CObjectMapD2Ev @ 9 NONAME + _ZN11hspswrapper10CPluginMap12SetPluginIdLERK6TDesC8 @ 10 NONAME + _ZN11hspswrapper10CPluginMap13SetPluginUidLERK6TDesC8 @ 11 NONAME + _ZN11hspswrapper10CPluginMap19SetActivationStateLERK6TDesC8 @ 12 NONAME + _ZN11hspswrapper10CPluginMap4NewLEv @ 13 NONAME + _ZN11hspswrapper10CPluginMap5NewLCEv @ 14 NONAME + _ZN11hspswrapper10CPluginMapD0Ev @ 15 NONAME + _ZN11hspswrapper10CPluginMapD1Ev @ 16 NONAME + _ZN11hspswrapper10CPluginMapD2Ev @ 17 NONAME + _ZN11hspswrapper11CPluginInfo12SetLogoIconLERK6TDesC8 @ 18 NONAME + _ZN11hspswrapper11CPluginInfo12SetLogoIconLERK7TDesC16 @ 19 NONAME + _ZN11hspswrapper11CPluginInfo13SetInterfaceLERK6TDesC8 @ 20 NONAME + _ZN11hspswrapper11CPluginInfo15SetDescriptionLERK6TDesC8 @ 21 NONAME + _ZN11hspswrapper11CPluginInfo15SetDescriptionLERK7TDesC16 @ 22 NONAME + _ZN11hspswrapper11CPluginInfo17SetMultiInstanceLEl @ 23 NONAME + _ZN11hspswrapper11CPluginInfo22SetConfigurationStateLERK6TDesC8 @ 24 NONAME + _ZN11hspswrapper11CPluginInfo4NewLEv @ 25 NONAME + _ZN11hspswrapper11CPluginInfo5NewLCEv @ 26 NONAME + _ZN11hspswrapper11CPluginInfo7SetUidLERK6TDesC8 @ 27 NONAME + _ZN11hspswrapper11CPluginInfo8SetNameLERK6TDesC8 @ 28 NONAME + _ZN11hspswrapper11CPluginInfo8SetTypeLERK6TDesC8 @ 29 NONAME + _ZN11hspswrapper11CPluginInfoD0Ev @ 30 NONAME + _ZN11hspswrapper11CPluginInfoD1Ev @ 31 NONAME + _ZN11hspswrapper11CPluginInfoD2Ev @ 32 NONAME + _ZN11hspswrapper12CHspsWrapper10AddPluginLERK6TDesC8S3_ @ 33 NONAME + _ZN11hspswrapper12CHspsWrapper10AddPluginLERK6TDesC8S3_i @ 34 NONAME + _ZN11hspswrapper12CHspsWrapper11GetPluginsLER13RPointerArrayINS_11CPluginInfoEERK6TDesC8S7_ @ 35 NONAME + _ZN11hspswrapper12CHspsWrapper12MovePluginsLERK6TDesC8RK11MDesC8Array @ 36 NONAME + _ZN11hspswrapper12CHspsWrapper13RemovePluginLERK6TDesC8 @ 37 NONAME + _ZN11hspswrapper12CHspsWrapper13SetConfStateLERK6TDesC8S3_i @ 38 NONAME + _ZN11hspswrapper12CHspsWrapper14ReplacePluginLERK6TDesC8S3_ @ 39 NONAME + _ZN11hspswrapper12CHspsWrapper16SetActivePluginLERK6TDesC8 @ 40 NONAME + _ZN11hspswrapper12CHspsWrapper18SetPluginSettingsLERK6TDesC8RK13RPointerArrayINS_8CItemMapEE @ 41 NONAME + _ZN11hspswrapper12CHspsWrapper20GetAppConfigurationLEv @ 42 NONAME + _ZN11hspswrapper12CHspsWrapper20SetAppConfigurationLERK6TDesC8 @ 43 NONAME + _ZN11hspswrapper12CHspsWrapper21GetAppConfigurationsLER13RPointerArrayINS_11CPluginInfoEE @ 44 NONAME + _ZN11hspswrapper12CHspsWrapper23GetPluginConfigurationLERK6TDesC8 @ 45 NONAME + _ZN11hspswrapper12CHspsWrapper4NewLERK6TDesC8PNS_20MHspsWrapperObserverE @ 46 NONAME + _ZN11hspswrapper12CHspsWrapper5NewLCERK6TDesC8PNS_20MHspsWrapperObserverE @ 47 NONAME + _ZN11hspswrapper12CHspsWrapperD0Ev @ 48 NONAME + _ZN11hspswrapper12CHspsWrapperD1Ev @ 49 NONAME + _ZN11hspswrapper12CHspsWrapperD2Ev @ 50 NONAME + _ZN11hspswrapper12CPropertyMap4NewLEv @ 51 NONAME + _ZN11hspswrapper12CPropertyMap5NewLCEv @ 52 NONAME + _ZN11hspswrapper12CPropertyMap8SetNameLERK6TDesC8 @ 53 NONAME + _ZN11hspswrapper12CPropertyMap9SetValueLERK6TDesC8 @ 54 NONAME + _ZN11hspswrapper12CPropertyMapD0Ev @ 55 NONAME + _ZN11hspswrapper12CPropertyMapD1Ev @ 56 NONAME + _ZN11hspswrapper12CPropertyMapD2Ev @ 57 NONAME + _ZN11hspswrapper16CAddPluginResult12SetPluginIdLERK6TDesC8 @ 58 NONAME + _ZN11hspswrapper16CAddPluginResult4NewLEv @ 59 NONAME + _ZN11hspswrapper16CAddPluginResult9SetStatusEi @ 60 NONAME + _ZN11hspswrapper16CAddPluginResultC1Ev @ 61 NONAME + _ZN11hspswrapper16CAddPluginResultC2Ev @ 62 NONAME + _ZN11hspswrapper16CAddPluginResultD0Ev @ 63 NONAME + _ZN11hspswrapper16CAddPluginResultD1Ev @ 64 NONAME + _ZN11hspswrapper16CAddPluginResultD2Ev @ 65 NONAME + _ZN11hspswrapper18CHspsConfiguration10PluginInfoEv @ 66 NONAME + _ZN11hspswrapper18CHspsConfiguration10PluginMapsEv @ 67 NONAME + _ZN11hspswrapper18CHspsConfiguration10SetConfIdLERK6TDesC8 @ 68 NONAME + _ZN11hspswrapper18CHspsConfiguration11AddItemMapLEPNS_8CItemMapE @ 69 NONAME + _ZN11hspswrapper18CHspsConfiguration13AddObjectMapLEPNS_10CObjectMapE @ 70 NONAME + _ZN11hspswrapper18CHspsConfiguration13AddPluginMapLEPNS_10CPluginMapE @ 71 NONAME + _ZN11hspswrapper18CHspsConfiguration4NewLEv @ 72 NONAME + _ZN11hspswrapper18CHspsConfiguration5NewLCEv @ 73 NONAME + _ZN11hspswrapper18CHspsConfiguration8SettingsEv @ 74 NONAME + _ZN11hspswrapper18CHspsConfiguration9ResourcesEv @ 75 NONAME + _ZN11hspswrapper18CHspsConfigurationD0Ev @ 76 NONAME + _ZN11hspswrapper18CHspsConfigurationD1Ev @ 77 NONAME + _ZN11hspswrapper18CHspsConfigurationD2Ev @ 78 NONAME + _ZN11hspswrapper8CItemMap10SetItemIdLERK6TDesC8 @ 79 NONAME + _ZN11hspswrapper8CItemMap12SetItemNameLERK6TDesC8 @ 80 NONAME + _ZN11hspswrapper8CItemMap15AddPropertyMapLEPNS_12CPropertyMapE @ 81 NONAME + _ZN11hspswrapper8CItemMap4NewLEv @ 82 NONAME + _ZN11hspswrapper8CItemMap5NewLCEv @ 83 NONAME + _ZN11hspswrapper8CItemMapD0Ev @ 84 NONAME + _ZN11hspswrapper8CItemMapD1Ev @ 85 NONAME + _ZN11hspswrapper8CItemMapD2Ev @ 86 NONAME + _ZNK11hspswrapper10CObjectMap3TagEv @ 87 NONAME + _ZNK11hspswrapper10CObjectMap4PathEv @ 88 NONAME + _ZNK11hspswrapper10CObjectMap5NameLEv @ 89 NONAME + _ZNK11hspswrapper10CObjectMap9MediaTypeEv @ 90 NONAME + _ZNK11hspswrapper10CPluginMap15ActivationStateEv @ 91 NONAME + _ZNK11hspswrapper10CPluginMap8PluginIdEv @ 92 NONAME + _ZNK11hspswrapper10CPluginMap9PluginUidEv @ 93 NONAME + _ZNK11hspswrapper11CPluginInfo11DescriptionEv @ 94 NONAME + _ZNK11hspswrapper11CPluginInfo13MultiInstanceEv @ 95 NONAME + _ZNK11hspswrapper11CPluginInfo18ConfigurationStateEv @ 96 NONAME + _ZNK11hspswrapper11CPluginInfo3UidEv @ 97 NONAME + _ZNK11hspswrapper11CPluginInfo4NameEv @ 98 NONAME + _ZNK11hspswrapper11CPluginInfo4TypeEv @ 99 NONAME + _ZNK11hspswrapper11CPluginInfo8LogoIconEv @ 100 NONAME + _ZNK11hspswrapper11CPluginInfo9InterfaceEv @ 101 NONAME + _ZNK11hspswrapper12CHspsWrapper11HspsServiceEv @ 102 NONAME + _ZNK11hspswrapper12CHspsWrapper13HspsInterfaceEv @ 103 NONAME + _ZNK11hspswrapper12CHspsWrapper14ServiceHandlerEv @ 104 NONAME + _ZNK11hspswrapper12CPropertyMap4NameEv @ 105 NONAME + _ZNK11hspswrapper12CPropertyMap5ValueEv @ 106 NONAME + _ZNK11hspswrapper16CAddPluginResult6StatusEv @ 107 NONAME + _ZNK11hspswrapper16CAddPluginResult8PluginIdEv @ 108 NONAME + _ZNK11hspswrapper18CHspsConfiguration6ConfIdEv @ 109 NONAME + _ZNK11hspswrapper8CItemMap10PropertiesEv @ 110 NONAME + _ZNK11hspswrapper8CItemMap6ItemIdEv @ 111 NONAME + _ZNK11hspswrapper8CItemMap8ItemNameEv @ 112 NONAME + _ZTIN11hspswrapper10CObjectMapE @ 113 NONAME + _ZTIN11hspswrapper10CPluginMapE @ 114 NONAME + _ZTIN11hspswrapper11CPluginInfoE @ 115 NONAME + _ZTIN11hspswrapper12CHspsWrapperE @ 116 NONAME + _ZTIN11hspswrapper12CPropertyMapE @ 117 NONAME + _ZTIN11hspswrapper16CAddPluginResultE @ 118 NONAME + _ZTIN11hspswrapper18CHspsConfigurationE @ 119 NONAME + _ZTIN11hspswrapper8CItemMapE @ 120 NONAME + _ZTVN11hspswrapper10CObjectMapE @ 121 NONAME + _ZTVN11hspswrapper10CPluginMapE @ 122 NONAME + _ZTVN11hspswrapper11CPluginInfoE @ 123 NONAME + _ZTVN11hspswrapper12CHspsWrapperE @ 124 NONAME + _ZTVN11hspswrapper12CPropertyMapE @ 125 NONAME + _ZTVN11hspswrapper16CAddPluginResultE @ 126 NONAME + _ZTVN11hspswrapper18CHspsConfigurationE @ 127 NONAME + _ZTVN11hspswrapper8CItemMapE @ 128 NONAME + _ZN11hspswrapper11CPluginInfo11SetMaxChildEl @ 129 NONAME + _ZNK11hspswrapper11CPluginInfo8MaxChildEv @ 130 NONAME + _ZN11hspswrapper10CPluginMap17SetLockingStatusLERK6TDesC8 @ 131 NONAME + _ZNK11hspswrapper10CPluginMap13LockingStatusEv @ 132 NONAME + diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,26 @@ +/* +* 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: Item id, name and properties +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +PRJ_MMPFILES +hspswrapper.mmp diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/group/hspswrapper.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/group/hspswrapper.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: project file +* +*/ + +#include + +TARGET hspswrapper.dll +TARGETTYPE dll +UID 0x1000008d + +CAPABILITY ALL -TCB +VENDORID VID_DEFAULT + +USERINCLUDE ../inc + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src + +SOURCE hspswrapper.cpp +SOURCE hspswrapperdllmain.cpp +SOURCE hspsconfiguration.cpp +SOURCE itemmap.cpp +SOURCE objectmap.cpp +SOURCE plugininfo.cpp +SOURCE pluginmap.cpp +SOURCE propertymap.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), +//the GCC ARM def file in a BMARM directory, and the ARMV5 def file in a EABI directory. +//If def files are stored in these locations, the project files does not need to specify +//the location of the def files explicitly. If you want to store the def files in some other +//location, you will need to specify in the project file where the .def files are using +//the deffile keyword. + +//The following commented out code shows how the build system uses the implicit +// location for defiles. To create the DEF files Choose Project > Freeze Exports from Carbide +// or run 'abld freeze' from the command-line +//#if defined (WINS) +// DEFFILE ../bwins/hspswrapper.def +//#elif defined (GCC32) +// DEFFILE ../bmarm/hspswrapper.def +//#else +// DEFFILE ../eabi/hspswrapper.def +//#endif + +nostrictdef + +LIBRARY euser.lib +LIBRARY liwServiceHandler.lib +#ifdef ENABLE_ABIV2_MODE +DEBUGGABLE +#endif + diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/inc/hspsconfiguration.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/inc/hspsconfiguration.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,155 @@ +/* +* 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: Hsps configuration message +* +*/ + + +#ifndef C_CHSPSCONFIGURATION_H +#define C_CHSPSCONFIGURATION_H + + + +#include + + +namespace hspswrapper{ + + +class CPluginMap; +class CItemMap; +class CObjectMap; +class CPluginInfo; + +/** + * Hsps configuration message + * + * + * @code + * + * @endcode + * + * @lib xnlayoutengine + * @since S60 v5.0 + */ +class CHspsConfiguration : public CBase + { + +public: + + /** + * Two-phased constructor. + */ + IMPORT_C static CHspsConfiguration* NewL(); + IMPORT_C static CHspsConfiguration* NewLC(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CHspsConfiguration(); + + /** + * Set configuration id + * + * @param aId configuration id + */ + IMPORT_C CHspsConfiguration& SetConfIdL(const TDesC8& aId); + + /** + * Get configuration id + * + * @return Configuration id or KNullDesC8 + */ + IMPORT_C const TDesC8& ConfId()const; + + /** + * Get plugin info + * + * @return Reference to plugin info + */ + IMPORT_C CPluginInfo& PluginInfo(); + + /** + * Append plugin map into plugin map array + * + * @param aPluginMap Plugin map. Takes ownership + */ + IMPORT_C CHspsConfiguration& AddPluginMapL(CPluginMap* aPluginMap); + + /** + * Get plugin maps in a array + * + * @return Reference to plugin map array + */ + IMPORT_C RPointerArray& PluginMaps(); + + /** + * Append item map into settings array map + * + * @param aItemMap Item map. Takes ownership + */ + IMPORT_C CHspsConfiguration& AddItemMapL(CItemMap* aItemMap); + + /** + * Get settings array. Contains item maps + * + * @return Reference to settings array + */ + IMPORT_C RPointerArray& Settings(); + + /** + * Append object map into resources array map + * + * @param aObjectMap Object map. Takes ownership + */ + IMPORT_C CHspsConfiguration& AddObjectMapL(CObjectMap* aObjectMap); + + /** + * Get resource array. Contains object maps + * + * @return Reference to resource array + */ + IMPORT_C RPointerArray& Resources(); +private: + + CHspsConfiguration(); + + void ConstructL(); +private: // data + + /** + * Own. Configuration id + */ + HBufC8* iId; + /** + * Own. Plugin info + */ + CPluginInfo* iPluginInfo; + /** + * Own. Plugins + */ + RPointerArray iPlugins; + /** + * Own. Settings + */ + RPointerArray iSettings; + /** + * Own. Resources + */ + RPointerArray iResources; + }; + +} + +#endif // C_CHSPSCONFIGURATION_H diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/inc/hspssapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/inc/hspssapi.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Encapsulates hsps sapi. Collects needed headers +* +*/ + + + +#ifndef HSPS_SAPI_H +#define HSPS_SAPI_H + + +#include "hspsconfiguration.h" +#include "hspswrapper.h" +#include "itemmap.h" +#include "objectmap.h" +#include "plugininfo.h" +#include "pluginmap.h" +#include "propertymap.h" + + + + +#endif // HSPS_SAPI_H diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/inc/hspswrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/inc/hspswrapper.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,355 @@ +/* +* 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: Encapsulates hsps liw service +* +*/ + + + +#ifndef C_CHSPSWRAPPER_H +#define C_CHSPSWRAPPER_H + +#include +#include // for MLiwNotifyCallback + +class CLiwServiceHandler; +class MLiwInterface; +class CLiwCriteriaItem; +class CLiwMap; +class CLiwList; +class MDesC8Array; +class CLiwDefaultMap; +class CLiwDefaultList; +class MLiwNotifyCallback; +class CLiwGenericParamList; + +namespace hspswrapper{ + + +class CHspsConfiguration; +class CItemMap; +class CPluginInfo; +class CAddPluginResult; +class CPropertyMap; + +/** + * Observer class for hspswrapper + * + * @code + * + * @endcode + * + * @lib hspswrapper.lib + * @since S60 v5.0 + */ +class MHspsWrapperObserver + { +public: + /** + * Handle HSPS wrappper notifications + * + * @param aEvent Event + * @param aAppConfUid App configuration uid + * @param aPluginName Plugin name + * @param aOrigUid Originator uid + * @param aPluginUid Plugin uid + * @param aPluginId Plugin id + */ + virtual TInt HandleNotifyL( const TDesC8& aEvent, + const TDesC8& aAppConfUid, + const TDesC8& aPluginName, + const TDesC8& aOrigUid, + const TDesC8& aPluginUid, + const TDesC8& aPluginId ) = 0; +protected: + /** + * Destructor. Protected to prevent deletion through this interface. + */ + ~MHspsWrapperObserver() { } + }; + +/** + * Return value from add plugin + * + * @code + * + * @endcode + * + * @lib hspswrapper.lib + * @since S60 v5.0 + */ +class CAddPluginResult: public CBase + { +public: + IMPORT_C static CAddPluginResult* NewL(); + IMPORT_C ~CAddPluginResult(); + /** + * Set plugin id + * + * @param aPluginId Plugin id + */ + IMPORT_C void SetPluginIdL(const TDesC8& aPluginId); + /** + * Get plugin id + * + * @return Plugin id or KNullDesC8 + */ + IMPORT_C const TDesC8& PluginId()const; + + /** + * Set operation status + * + * @param aStatus Operation status + */ + IMPORT_C void SetStatus(TInt aStatus); + /** + * Get operation status + * + * @return KErrNotFound, if operation fails + */ + IMPORT_C TInt Status()const; +private: + CAddPluginResult(); +private: + /** + * Status of operation. KErrNotFound, if operation fails + */ + TInt iStatus; + /** + * Own. Id of the added plugin in the configuration + */ + HBufC8* iPluginId; + }; + + +/** + * Wrapper for hsps liw service + * + * + * @code + * + * @endcode + * + * @lib hspswrapper.lib + * @since S60 v5.0 + */ +class CHspsWrapper : public CBase, public MLiwNotifyCallback + { +public: + /** + * Two-phased constructor. + * @param aAppUid Application uid in integer format + * @param aObserver Observer + */ + IMPORT_C static CHspsWrapper* NewL(const TDesC8& aAppUid, + MHspsWrapperObserver* aObserver = NULL); + /** + * Two-phased constructor. + * @param aAppUid Application uid in integer format + * @param aObserver Observer + */ + IMPORT_C static CHspsWrapper* NewLC(const TDesC8& aAppUid, + MHspsWrapperObserver* aObserver = NULL); + /** + * Destructor. + */ + IMPORT_C virtual ~CHspsWrapper(); + + /** + * Fetch active application configuration from hsps and + * creates CHspsConfiguration out of liw message + * + * @return Configuration. Caller has ownership. + */ + IMPORT_C CHspsConfiguration* GetAppConfigurationL(); + + /** + * Fetch root configurations from hsps. On return aConfs holds + * configuration info instancies. Caller takes ownership of + * configuration info instancies. + * + * @param aPlugins Array to hold configuration info instancies + */ + IMPORT_C void GetAppConfigurationsL( RPointerArray& aPlugins ); + + /** + * Sets root configuration to active. + * + * @param aConfigurationUid Configuration uid to be activated + * @return Operation status. KErrNone (success), KErrNotFound + */ + IMPORT_C TInt SetAppConfigurationL(const TDesC8& aConfigurationUid ); + + /** + * Fetch plugin configuration from hsps and + * creates CHspsConfiguration out of liw message + * + * @param aPluginId Id of plugin configuration + * @return Configuration. Caller has ownership. + */ + IMPORT_C CHspsConfiguration* GetPluginConfigurationL(const TDesC8& aPluginId); + /** + * Fetch plugins from hsps. On return aPlugins holds plugin info + * instancies. Caller takes ownership of plugin info instancies. + * + * @param aPlugins Array to hold plugin info instancies + * @param aPluginInterface Plugin interface id + * @param aPluginType view, widget or template + */ + IMPORT_C void GetPluginsL( RPointerArray& aPlugins, + const TDesC8& aPluginInterface, + const TDesC8& aPluginType); + + /** + * Add plugin to hsps. + * + * @param aTargetConfiguration Id of configuration where the new plugin is attached + * @param aPluginUid Plugin uid which is added + * @param aPos Position in configuration's plugin list + */ + IMPORT_C CAddPluginResult* AddPluginL(const TDesC8& aTargetConfiguration, const TDesC8& aPluginUid); + + /** + * Remove plugin from the active configuration. + * + * @param aPluginId Plugin id to be removed + * @return Operation status. KErrNone (success), KErrNotFound + */ + IMPORT_C TInt RemovePluginL(const TDesC8& aPluginId); + + /** + * Sets plugin active into active configuration. + * + * @param aPluginId Plugin id to be activated + * @return Operation status. KErrNone (success), KErrNotFound + */ + IMPORT_C TInt SetActivePluginL(const TDesC8& aPluginId); + + /** + * Replace plugin in the active configuration. + * + * @param aPluginId Plugin id to be replaced + * @param aConfUid Configuration uid of the new plugin + * @return Operation status. KErrNone (success), KErrNotFound + */ + IMPORT_C TInt ReplacePluginL( + const TDesC8& aPluginId, + const TDesC8& aConfUid ); + + /** + * Move plugin inside configuration. + * + * @param aConfId Configuration + * @param aPluginIds List of plugins included in the configuration in new order + * @return Operation status. KErrNone (success), KErrArgument, KErrNotFound + */ + IMPORT_C TInt MovePluginsL(const TDesC8& aConfId, const MDesC8Array& aPluginIds); + + /** + * Stores defined plugins settings. + * Plugin is identified with unique plugin ID used in applications configuration + * + * @param aPluginId Plugings ID which settings are stored + * @param aSettings List of item maps + * @return Operation status. KErrNone (success), KErrNotFound + */ + IMPORT_C TInt SetPluginSettingsL(const TDesC8& aPluginId, const RPointerArray& aSettings); + + /** + * Add plugin to hsps. + * + * @param aTargetConfiguration Id of configuration where the new plugin is attached + * @param aPluginUid Plugin uid which is added + * @param aIndex Position to which plugin is added + */ + IMPORT_C CAddPluginResult* AddPluginL(const TDesC8& aTargetConfiguration, const TDesC8& aPluginUid, const TInt aIndex); + + /** + * Set plugin configure state to hsps. + * + * @param aConfId Configuration id of a plugin that should be confirmed. + * @param aState State of the plugin + * @param aIncludePlugins ETrue if aState is set to child plugins, EFalse default. + * @return Operation status. KErrNone (success), KErrNotFound + */ + IMPORT_C TInt SetConfStateL( const TDesC8& aConfId, const TDesC8& aState, TBool aIncludePlugins = EFalse ); + + /** + * Returns SAPI service handler. + */ + IMPORT_C CLiwServiceHandler* ServiceHandler() const; + + /** + * Returns HSPS SAPI service + */ + IMPORT_C CLiwCriteriaItem* HspsService() const; + + /** + * 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 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 ); + +protected: // from MLiwNotifyCallback + + /** + * Handle HSPS notifications + * + * @param aCmdId Command id + * @param aEventId Event id + * @param aEventParamList Event parameters + * @param aInParamList In parameters + */ + TInt HandleNotifyL(TInt aCmdId, TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& aInParamList); + +private: // data + + /** + * Owned. SAPI service handler. + */ + CLiwServiceHandler* iServiceHandler; + /** + * Owned. HSPS SAPI service. + */ + CLiwCriteriaItem* iHspsService; + /** + * Owned. Provides hsps services. + */ + MLiwInterface* iHspsInterface; + /** + * Not owned. Wrapper observer + */ + MHspsWrapperObserver* iObserver; + /* + * Asynchronous service request tarnsaction id + */ + TInt iTransactionId; + }; +} + +#endif // C_CHSPSWRAPPER_H diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/inc/hspswrapper.pan --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/inc/hspswrapper.pan Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Item id, name and properties + * +*/ + + + +#ifndef __HSPSWRAPPER_PAN__ +#define __HSPSWRAPPER_PAN__ + +// Data Types + +enum ThspswrapperPanic + { + EhspswrapperNullPointer + }; + +// Function Prototypes + +GLREF_C void Panic(ThspswrapperPanic aPanic); + +#endif // __HSPSWRAPPER_PAN__ + diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/inc/itemmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/inc/itemmap.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,132 @@ +/* +* 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: Item id, name and properties +* +*/ + + + +#ifndef C_CITEMMAP_H +#define C_CITEMMAP_H + + + +#include + + +namespace hspswrapper{ + +class CPropertyMap; + +/** + * Item id, name and properties + * + * + * @code + * + * @endcode + * + * @lib xnlayoutengine.lib + * @since S60 v5.0 + */ +class CItemMap : public CBase + { + +public: + + /** + * Two-phased constructor. + */ + IMPORT_C static CItemMap* NewL(); + IMPORT_C static CItemMap* NewLC(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CItemMap(); + + /** + * Set item id + * + * @param aItemId Item id + * @return Reference to this object + */ + IMPORT_C CItemMap& SetItemIdL(const TDesC8& aItemId ); + + /** + * Get item id + * + * @return Reference to item id or KNullDesC8 + */ + IMPORT_C const TDesC8& ItemId()const; + + /** + * Set item name + * + * @param aItemName Item name + * @return Reference to this object + */ + IMPORT_C CItemMap& SetItemNameL(const TDesC8& aItemName ); + + /** + * Get item name + * + * @return Reference to item name or KNullDesC8 + */ + IMPORT_C const TDesC8& ItemName()const; + + /** + * Add item property map into properties array + * + * @param aPropertyMap Property map. Takes ownership + * @return Reference to this object + */ + IMPORT_C CItemMap& AddPropertyMapL(CPropertyMap* aPropertyMap ); + + /** + * Get property map array. + * + * @return Reference to proprty map array + */ + IMPORT_C RPointerArray& Properties()const; + +private: + + CItemMap(); + + void ConstructL(); + + +private: // data + + /** + * Own. Item id + */ + HBufC8* iItemId; + + /** + * Own. Item name + */ + HBufC8* iItemName; + + /** + * Own. Array of property maps + */ + mutable RPointerArray iProperties; + }; + +} + + +#endif // C_CITEMMAP_H diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/inc/objectmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/inc/objectmap.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,143 @@ +/* +* 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: Presents object map as name, path and mediatype data +* +*/ + + + +#ifndef C_COBJECTMAP_H +#define C_COBJECTMAP_H + + +#include + +namespace hspswrapper{ + + +/** + * Presents object map as name, path and mediatype data + * + * + * @code + * @endcode + * + * @lib xnlayoutengine.lib + * @since S60 v5.0 + */ +class CObjectMap : public CBase + { +public: + /** + * Two-phased constructor. + */ + IMPORT_C static CObjectMap* NewL(); + IMPORT_C static CObjectMap* NewLC(); + + + /** + * Destructor. + */ + IMPORT_C virtual ~CObjectMap(); + + /** + * Set object name + * + * @param aName object name + * @return Reference to this object + */ + IMPORT_C CObjectMap& SetNameL( const TDesC8& aName ); + + /** + * Get object name + * + * @return Reference to name or KNullDesC8 + */ + IMPORT_C const TDesC8& NameL()const; + + /** + * Set object path + * + * @param aPath object path + * @return Reference to this object + */ + IMPORT_C CObjectMap& SetPathL( const TDesC8& aPath ); + + /** + * Get object path + * + * @return Reference to path or KNullDesC8 + */ + IMPORT_C const TDesC8& Path()const; + + /** + * Set object media type + * + * @param aMediaType object media type + * @return Reference to this object + */ + IMPORT_C CObjectMap& SetMediaTypeL( const TDesC8& aMediaType ); + + /** + * Get object media type + * + * @return Reference to media type or KNullDesC8 + */ + IMPORT_C const TDesC8& MediaType()const; + + /** + * Set object tag + * + * @param aTag object tag + * @return Reference to this object + */ + IMPORT_C CObjectMap& SetTagL( const TDesC8& aTag ); + + /** + * Get object tag + * + * @return Reference to tag or KNullDesC8 + */ + IMPORT_C const TDesC8& Tag()const; + +private: + CObjectMap(); + + void ConstructL(); + +private: // data + + /** + * Own. Object name + */ + HBufC8* iName; + + /** + * Own. Object path + */ + HBufC8* iPath; + + /** + * Own. Object mediatype + */ + HBufC8* iMediaType; + + /** + * Own. Object tag + */ + HBufC8* iTag; + }; + +} +#endif // C_COBJECTMAP_H diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/inc/plugininfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/inc/plugininfo.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,249 @@ +/* +* 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: Presents plugin info using states uid, interface, type and name +* +*/ + + + +#ifndef C_CPLUGININFO_H +#define C_CPLUGININFO_H + +#include + +namespace hspswrapper{ + +/** + * Presents plugin info using states uid, interface, type and name + * + * @code + * @endcode + * + * @lib xnlayoutengine.lib + * @since S60 v5.0 + */ +class CPluginInfo : public CBase + { +public: + /** + * Two-phased constructor. + */ + IMPORT_C static CPluginInfo* NewL(); + IMPORT_C static CPluginInfo* NewLC(); + + + /** + * Destructor. + */ + IMPORT_C virtual ~CPluginInfo(); + + /** + * Set configuration uid + * + * @param aUid configuration uid + */ + IMPORT_C CPluginInfo& SetUidL(const TDesC8& aUid); + + /** + * Get configuration uid + * + * @return configuration uid or KNullDesC8 + */ + IMPORT_C const TDesC8& Uid()const; + + /** + * Set configuration type + * + * @param aType configuration type + */ + IMPORT_C CPluginInfo& SetTypeL(const TDesC8& aType); + + /** + * Get configuration type + * + * @return configuration type or KNullDesC8 + */ + IMPORT_C const TDesC8& Type()const; + + /** + * Set configuration interface + * + * @param aInterface configuration interface + */ + IMPORT_C CPluginInfo& SetInterfaceL(const TDesC8& aInterface); + + /** + * Get configuration interface + * + * @return configuration interface or KNullDesC8 + */ + IMPORT_C const TDesC8& Interface()const; + + /** + * Set configuration name + * + * @param aName configuration name + */ + IMPORT_C CPluginInfo& SetNameL(const TDesC8& aName); + + /** + * Get configuration name + * + * @return configuration name or KNullDesC8 + */ + IMPORT_C const TDesC8& Name()const; + + /** + * Set configuration state + * + * @param aConfigurationState configuration state + */ + IMPORT_C CPluginInfo& SetConfigurationStateL( + const TDesC8& aConfigurationState); + + /** + * Get configuration state + * + * @return configuration state or KNullDesC8 + */ + IMPORT_C const TDesC8& ConfigurationState()const; + + /** + * Set widget multiinstance + * + * @param aMultiInstance widget multiinstance + */ + IMPORT_C CPluginInfo& SetMultiInstanceL( const TInt32 aMultiInstance ); + + /** + * Get widget multiinstance + * + * @return widget multiinstance or KNullDesC8 + */ + IMPORT_C const TInt32& MultiInstance()const; + + + /** + * Get max children for the plugin + * + * @return max children + */ + IMPORT_C const TInt32& MaxChild() const; + + /** + * Set maximum of children allowed + * + * @param aMaxChild max. number of children + */ + IMPORT_C CPluginInfo& SetMaxChild( const TInt32 aMaxChild ); + + /** + * Set widget description + * + * @param aDescription widget description + */ + IMPORT_C CPluginInfo& SetDescriptionL( const TDesC& aDescription ); + + /** + * Set widget description (TDesC8) + * + * @param aDescription widget description + */ + IMPORT_C CPluginInfo& SetDescriptionL( const TDesC8& aDescription ); + + /** + * Get widget description + * + * @return Description widget description or KNullDesC + */ + IMPORT_C const TDesC& Description() const; + + /** + * Set Logo icon + * + * @param aLogoIcon logo icon + */ + IMPORT_C CPluginInfo& SetLogoIconL( const TDesC& aLogoIcon ); + + /** + * Set Logo icon (TDesC8) + * + * @param aLogoIcon logo icon + */ + IMPORT_C CPluginInfo& SetLogoIconL( const TDesC8& aLogoIcon ); + + /** + * Get Logo icon + * + * @return LogoIcon logo icon or KNullDesC + */ + IMPORT_C const TDesC& LogoIcon() const; + +private: + + CPluginInfo(); + + void ConstructL(); + + +private: // data + + /** + * Own. Plugin uid + */ + HBufC8* iUid; + + /** + * Own. Plugin interface + */ + HBufC8* iInterface; + + /** + * Own. Plugin type + */ + HBufC8* iType; + + /** + * Own. Plugin name + */ + HBufC8* iName; + + /** + * Own. Plugin configuration state + */ + HBufC8* iConfigurationState; + + /** + * Number of children allowed + */ + TInt32 iMaxChilds; + + /** + * Own. Plugin description + */ + HBufC* iDescription; + + /** + * Own. Plugin logo icon + */ + HBufC* iLogoIcon; + + /** + * Own. Plugin instances + */ + TInt32 iMultiInstance; + }; +} + +#endif // C_CPLUGININFO_H diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/inc/pluginmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/inc/pluginmap.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: contains id and uid +* +*/ + + + +#ifndef C_CPLUGINMAP_H +#define C_CPLUGINMAP_H + + +#include + + +namespace hspswrapper{ + +/** + * Presents plugin map i.e id and uid + * + * + * @code + * + * @endcode + * + * @lib xnlayoutengine.lib + * @since S60 v5.0 + */ +class CPluginMap : public CBase + { + +public: + + /** + * Two-phased constructor. + */ + IMPORT_C static CPluginMap* NewL(); + IMPORT_C static CPluginMap* NewLC(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CPluginMap(); + + /** + * Set plugin id + * + * @param aPluginId plugin id + * @return Reference to this object + */ + IMPORT_C CPluginMap& SetPluginIdL(const TDesC8& aPluginId); + + /** + * Get plugin id + * + * @return Reference to plugin id or KNullDesC8 + */ + IMPORT_C const TDesC8& PluginId()const; + + /** + * Set plugin uid + * + * @param aPluginId plugin uid + * @return Reference to this object + */ + IMPORT_C CPluginMap& SetPluginUidL(const TDesC8& aPluginUid); + + /** + * Get plugin uid + * + * @return Reference to plugin uid or KNullDesC8 + */ + IMPORT_C const TDesC8& PluginUid()const; + + /** + * Set plugin activation state + * + * @param aState plugin activation state + * @return Reference to this object + */ + IMPORT_C CPluginMap& SetActivationStateL(const TDesC8& aState); + + /** + * Get plugin activation state + * + * @return ETrue if plugin is active, EFalse otherwise + */ + IMPORT_C TBool ActivationState()const; + + /** + * Set locking status for the plugin + * + * @param bStatusFlag - plugin is locked or not + */ + IMPORT_C CPluginMap& SetLockingStatusL( const TDesC8& aLockingStatus ); + + /** + * Get locking status for the plugin + * + * @return locking status ( ETrue - locked, EFalse - not locked ) + */ + IMPORT_C const TDesC8& LockingStatus() const; +private: + + CPluginMap(); + + void ConstructL(); + + +private: // data + + /** + * Own. Plugin id. + */ + HBufC8* iPluginId; + + /** + * Own. Plugin uid. + */ + HBufC8* iPluginUid; + + /** + * Own. Plugin activation state. + */ + HBufC8* iActivationState; + + /** + * Own. Plugin locking status + */ + HBufC8* iLockingStatus; + + }; + +} + +#endif // C_CPLUGINMAP_H diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/inc/propertymap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/inc/propertymap.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,104 @@ +/* +* 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: Encapsulates name and value +* +*/ + + +#ifndef C_CPROPERTYMAP_H +#define C_CPROPERTYMAP_H + + +#include + + +namespace hspswrapper{ + + + +/** + * Presents property as name and value pair + * + * @code + * @endcode + * + * @lib xnlayoutengine.lib + * @since S60 v5.0 + */ +class CPropertyMap : public CBase + { +public: + /** + * Two-phased constructor. + */ + IMPORT_C static CPropertyMap* NewL(); + IMPORT_C static CPropertyMap* NewLC(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CPropertyMap(); + + /** + * Set property name + * + * @param aName Property nane + * @return Reference to this object + */ + IMPORT_C CPropertyMap& SetNameL( const TDesC8& aName ); + + /** + * Get property name + * + * @return Reference to name or KNullDesC8 + */ + IMPORT_C const TDesC8& Name()const; + + /** + * Set property value + * + * @param aValue Property value + * @return Reference to this object + */ + IMPORT_C CPropertyMap& SetValueL( const TDesC8& aValue ); + + /** + * Get property value + * + * @return Reference to value or KNullDesC8 + */ + IMPORT_C const TDesC8& Value()const; + +private: + + CPropertyMap(); + + void ConstructL(); + + +private: // data + + /** + * Own. Property name + */ + HBufC8* iName; + /** + * Own. Property value + */ + HBufC8* iValue; + }; + +} + +#endif // C_CPROPERTYMAP_H diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/sis/hspswrapper_eka2.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/sis/hspswrapper_eka2.pkg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ +; +; 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: +; +; Installation file for hspswrapper dll +; +; This is an auto-generated PKG file by Carbide. +; This file uses variables specific to Carbide builds that will not work +; on command-line builds. If you want to use this generated PKG file from the +; command-line tools you will need to modify the variables with the appropriate +; values: $(EPOCROOT), $(PLATFORM), $(TARGET) + +; +; UID is the dll's UID +; +#{"hspswrapper DLL"},(0x0ADEE135),1,0,0 + + +;Localised Vendor name +%{"Vendor-EN"} + +;Unique Vendor name +:"Vendor" + +"$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\hspswrapper.dll" -"!:\sys\bin\hspswrapper.dll" diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/src/hspsconfiguration.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/src/hspsconfiguration.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,166 @@ +/* +* 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: Hsps configuration message +* +*/ + + +#include "hspsconfiguration.h" +#include "pluginmap.h" +#include "objectmap.h" +#include "itemmap.h" +#include "plugininfo.h" + +namespace hspswrapper{ + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CHspsConfiguration::CHspsConfiguration() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHspsConfiguration::ConstructL() + { + iPluginInfo = CPluginInfo::NewL(); + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration* CHspsConfiguration::NewL() + { + CHspsConfiguration* self = CHspsConfiguration::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration* CHspsConfiguration::NewLC() + { + CHspsConfiguration* self = new( ELeave ) CHspsConfiguration; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration::~CHspsConfiguration() + { + delete iId; + delete iPluginInfo; + iPlugins.ResetAndDestroy(); + iSettings.ResetAndDestroy(); + iResources.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration& CHspsConfiguration::SetConfIdL(const TDesC8& aId) + { + delete iId; + iId = NULL; + iId = aId.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CHspsConfiguration::ConfId()const + { + if(iId) + { + return *iId; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CHspsConfiguration::PluginInfo() + { + return *iPluginInfo; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration& CHspsConfiguration::AddPluginMapL(CPluginMap* aPluginMap) + { + iPlugins.AppendL(aPluginMap); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C RPointerArray& CHspsConfiguration::PluginMaps() + { + return iPlugins; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration& CHspsConfiguration::AddItemMapL(CItemMap* aItemMap) + { + iSettings.AppendL(aItemMap); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C RPointerArray& CHspsConfiguration::Settings() + { + return iSettings; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration& CHspsConfiguration::AddObjectMapL(CObjectMap* aObjectMap) + { + iResources.AppendL(aObjectMap); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C RPointerArray& CHspsConfiguration::Resources() + { + return iResources; + } + +} // namespace end + diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/src/hspswrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/src/hspswrapper.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1494 @@ +/* +* 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: Encapsulates hsps liw service +* +*/ + + +#include +#include +#include + +#include "hspswrapper.h" +#include "hspsconfiguration.h" +#include "pluginmap.h" +#include "itemmap.h" +#include "propertymap.h" +#include "objectmap.h" +#include "plugininfo.h" + + +_LIT8( KHSPS, "Service.HSPS" ); +_LIT8( KHSPSConfigurationIf, "IConfiguration" ); + +_LIT8( KHSPSCommandGetActiveAppConf, "GetActiveAppConf" ); +_LIT8( KHSPSCommandGetPluginConf, "GetPluginConf" ); +_LIT8( KHSPSCommandGetPlugins, "GetPlugins" ); +_LIT8( KHSPSCommandAddPlugin, "AddPlugin" ); +_LIT8( KHSPSCommandRemovePlugin, "RemovePlugin" ); +_LIT8( KHSPSCommandReplacePlugin, "ReplacePlugin" ); +_LIT8( KHSPSCommandSetActivePlugin, "SetActivePlugin" ); +_LIT8( KHSPSCommandSetConfState, "SetConfState" ); +_LIT8( KHSPSCommandGetAppConfs, "GetAppConfs" ); +_LIT8( KHSPSCommandSetAppConf, "SetActiveAppConf" ); +_LIT8( KHSPSMovePlugins, "MovePlugins"); +_LIT8( KHSPSSetPluginSettings, "SetPluginSettings" ); +_LIT8( KAppConfKey, "appConf" ); +_LIT8( KAppConfsKey, "appConfs" ); +_LIT8( KPluginConfKey, "pluginConf" ); +_LIT8( KPluginsKey, "plugins" ); +_LIT8( KConfId, "confId" ); +_LIT8( KPluginUid, "pluginUid" ); +_LIT8( KOutKeyStatus ,"status"); +_LIT8( KHspsAppUid, "appUid" ); +_LIT8( KKeyPluginId, "pluginId" ); +_LIT8( KKeyConfUid, "confUid" ); +_LIT8( KInterface, "interface" ); +_LIT8( KType, "type" ); +_LIT8( KKeyPlugins, "plugins" ); +_LIT8( KKeyItemId, "itemId" ); +_LIT8( KKeyName, "name" ); +_LIT8( KKeyValue, "value" ); +_LIT8( KKeyProperties, "properties" ); +_LIT8( KKeySettings, "settings" ); +_LIT8( KIndex, "position" ); +_LIT8( KConfState, "state" ); +_LIT8( KRequestNotification, "RequestNotification" ); + +namespace hspswrapper{ + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CAddPluginResult::CAddPluginResult():iStatus(KErrNotFound) + {} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CAddPluginResult::~CAddPluginResult() + { + delete iPluginId; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CAddPluginResult* CAddPluginResult::NewL() + { + CAddPluginResult* self = new( ELeave ) CAddPluginResult; + return self; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C void CAddPluginResult::SetPluginIdL( + const TDesC8& aPluginId ) + { + delete iPluginId; + iPluginId = NULL; + iPluginId = aPluginId.AllocL(); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CAddPluginResult::PluginId()const + { + if(iPluginId) + { + return *iPluginId; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C void CAddPluginResult::SetStatus(TInt aStatus ) + { + iStatus = aStatus; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CAddPluginResult::Status()const + { + return iStatus; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CHspsWrapper::CHspsWrapper(MHspsWrapperObserver* aObserver) + : iObserver( aObserver ) + { + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHspsWrapper::ConstructL(const TDesC8& aAppUid) + { + // Attach to HSPS: + iServiceHandler = CLiwServiceHandler::NewL(); + + iHspsService = CLiwCriteriaItem::NewL( 1, KHSPSConfigurationIf, KHSPS ); + iHspsService->SetServiceClass( TUid::Uid( KLiwClassBase ) ); + + RCriteriaArray interestList; + interestList.AppendL( iHspsService ); + iServiceHandler->AttachL( interestList ); + interestList.Reset(); + + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + TLiwGenericParam appUid; + TLiwVariant uidVar; + uidVar.Set( aAppUid ); + appUid.SetNameAndValueL( KHspsAppUid, uidVar ); + appUid.PushL(); + inParamList.AppendL( appUid ); + CleanupStack::Pop(); + appUid.Reset(); + + iServiceHandler->ExecuteServiceCmdL( *iHspsService,inParamList,outParamList ); + inParamList.Reset(); + TInt pos = 0; + outParamList.FindFirst( pos, KHSPSConfigurationIf ); + if( pos != KErrNotFound ) + { + iHspsInterface = outParamList[ pos ].Value().AsInterface(); + outParamList.Reset(); + } + else + { + outParamList.Reset(); + User::Leave( KErrNotFound ); + } + + inParamList.Reset(); + outParamList.Reset(); + + if( iObserver ) + { + iTransactionId = -1; + iHspsInterface->ExecuteCmdL( KRequestNotification, + inParamList, + outParamList, + KLiwOptASyncronous, + this ); + const TLiwGenericParam* outParam( NULL ); + + TInt pos( 0 ); + outParam = outParamList.FindFirst( pos, _L8("status") ); + + if ( outParam ) + { + TInt retval; + retval = outParam->Value().AsTInt32(); + if(retval == KErrNone ) + { + pos = 0; + outParam = outParamList.FindFirst( pos, _L8("TransactionID") ); + if( outParam ) + { + retval = outParam->Value().AsTInt32(); + iTransactionId = retval; + } + } + + } + + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsWrapper* CHspsWrapper::NewL(const TDesC8& aAppUid, + MHspsWrapperObserver* aObserver) + { + CHspsWrapper* self = CHspsWrapper::NewLC(aAppUid, aObserver); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsWrapper* CHspsWrapper::NewLC(const TDesC8& aAppUid, + MHspsWrapperObserver* aObserver) + { + CHspsWrapper* self = new( ELeave ) CHspsWrapper( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(aAppUid); + return self; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsWrapper::~CHspsWrapper() + { + if( iHspsInterface ) + { + // Close interface + iHspsInterface->Close(); + } + + if( iServiceHandler && iHspsService ) + { + // Detach services from the handler + RCriteriaArray interestList; + TRAP_IGNORE( interestList.AppendL( iHspsService ) ); + TRAP_IGNORE( iServiceHandler->DetachL( interestList ) ); + interestList.Reset(); + } + + delete iHspsService; + delete iServiceHandler; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration* CHspsWrapper::GetAppConfigurationL() + { + CHspsConfiguration* configuration = CHspsConfiguration::NewLC(); + + // Fetch from liw service + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + iHspsInterface->ExecuteCmdL( KHSPSCommandGetActiveAppConf, + inParamList, + outParamList ); + + inParamList.Reset(); + + // 1: get appConf map + TInt index(0); + const TLiwGenericParam* conf = outParamList.FindFirst(index,KAppConfKey); + if(conf) + { + const CLiwMap* confMap = conf->Value().AsMap(); + // 2: Process Configuration map + if(confMap) + { + ProcessConfigurationMapL(*confMap,*configuration); + } + } + outParamList.Reset(); + + CleanupStack::Pop(configuration); + return configuration; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C void CHspsWrapper::GetAppConfigurationsL( + RPointerArray& aPlugins ) + { + // Fetch from liw service + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + iHspsInterface->ExecuteCmdL( KHSPSCommandGetAppConfs, + inParamList, + outParamList ); + + inParamList.Reset(); + + TInt index(0); + const TLiwGenericParam* confs = outParamList.FindFirst(index,KAppConfsKey); + if(confs) + { + const CLiwList* list = confs->Value().AsList(); + if(list) + { + TInt listCount = list->Count(); + TLiwVariant mapVar; + mapVar.PushL(); + + for ( TInt index(0); list->AtL( index, mapVar ); ++index ) + { + const CLiwMap* confMap = mapVar.AsMap(); + + if ( confMap ) + { + CPluginInfo* plugin = CPluginInfo::NewLC(); + + TLiwVariant confVar; + confVar.PushL(); + + if( confMap->FindL( _L8("uid"), confVar ) ) + { + plugin->SetUidL( confVar.AsData() ); + } + + confVar.Reset(); + + if( confMap->FindL(_L8("name"), confVar ) ) + { + plugin->SetNameL( confVar.AsData() ); + } + + CleanupStack::Pop(&confVar); + confVar.Reset(); + + aPlugins.AppendL( plugin ); + CleanupStack::Pop( plugin ); + } + } + CleanupStack::Pop(&mapVar); + mapVar.Reset(); + } + } + outParamList.Reset(); + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHspsWrapper::SetAppConfigurationL( + const TDesC8& aConfigurationUid ) + { +#ifdef _XN_PERFORMANCE_TEST_ + RDebug::Print( _L( "CHspsWrapper::SetAppConfigurationL() - start" ) ); +#endif //_XN_PERFORMANCE_TEST_ + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + // Compose Liw message + TLiwGenericParam confIdParam; + confIdParam.SetNameAndValueL( KKeyConfUid, TLiwVariant(aConfigurationUid) ); + confIdParam.PushL(); + inParamList.AppendL( confIdParam ); + CleanupStack::Pop(&confIdParam); + confIdParam.Reset(); + + iHspsInterface->ExecuteCmdL( KHSPSCommandSetAppConf, + 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(); +#ifdef _XN_PERFORMANCE_TEST_ + RDebug::Print( _L( "CHspsWrapper::SetAppConfigurationL() - end" ) ); +#endif //_XN_PERFORMANCE_TEST_ + return status; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration* CHspsWrapper::GetPluginConfigurationL( + const TDesC8& aPluginId) + { + CHspsConfiguration* configuration = CHspsConfiguration::NewLC(); + + // Fetch from liw service + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + // Form input message + + TLiwGenericParam pluginIdParam; + TLiwVariant pluginIdVar; + pluginIdVar.Set( aPluginId ); + pluginIdParam.SetNameAndValueL( KKeyPluginId, pluginIdVar ); + pluginIdParam.PushL(); + inParamList.AppendL( pluginIdParam ); + CleanupStack::Pop(&pluginIdParam); + pluginIdParam.Reset(); + + + iHspsInterface->ExecuteCmdL( KHSPSCommandGetPluginConf, + inParamList, + outParamList ); + inParamList.Reset(); + + // 1: get pluginConf map + TInt index(0); + const TLiwGenericParam* conf = outParamList.FindFirst(index,KPluginConfKey); + if(conf) + { + const CLiwMap* confMap = conf->Value().AsMap(); + // 2: Process Configuration map + if(confMap) + { + ProcessConfigurationMapL(*confMap,*configuration); + } + } + + outParamList.Reset(); + CleanupStack::Pop(configuration); + + return configuration; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C void CHspsWrapper::GetPluginsL( + RPointerArray& aPlugins, + const TDesC8& aPluginInterface, + const TDesC8& aPluginType) + { + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + // plugin interface + TLiwGenericParam interfaceParam( KInterface, TLiwVariant( aPluginInterface ) ); + interfaceParam.PushL(); + inParamList.AppendL( interfaceParam ); + CleanupStack::Pop(&interfaceParam); + interfaceParam.Reset(); + + // plugin type + TLiwGenericParam typeParam; + typeParam.SetNameAndValueL( KType, TLiwVariant(aPluginType ) ); + typeParam.PushL(); + inParamList.AppendL( typeParam ); + CleanupStack::Pop(&typeParam); + typeParam.Reset(); + + iHspsInterface->ExecuteCmdL( KHSPSCommandGetPlugins, inParamList, outParamList ); + inParamList.Reset(); + + TInt index(0); + const TLiwGenericParam* plugins = outParamList.FindFirst(index,KPluginsKey); + if(plugins) + { + const CLiwList* list = plugins->Value().AsList(); + if(list) + { + ProcessPluginsL(*list,aPlugins); + } + } + outParamList.Reset(); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CAddPluginResult* CHspsWrapper::AddPluginL( + const TDesC8& aTargetConfiguration, + const TDesC8& aPluginUid) + { + // Compose AddPlugin hsps LIW message to Service.HomeScreenPluginConfiguration + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + TLiwGenericParam confIdParam; + confIdParam.SetNameAndValueL( KConfId, TLiwVariant(aTargetConfiguration) ); + confIdParam.PushL(); + inParamList.AppendL( confIdParam ); + CleanupStack::Pop(&confIdParam); + confIdParam.Reset(); + + TLiwGenericParam pluginUidParam; + pluginUidParam.SetNameAndValueL( KPluginUid, TLiwVariant(aPluginUid) ); + pluginUidParam.PushL(); + inParamList.AppendL( pluginUidParam ); + CleanupStack::Pop(&pluginUidParam); + pluginUidParam.Reset(); + + // add widget to configuration + iHspsInterface->ExecuteCmdL( KHSPSCommandAddPlugin, + inParamList, + outParamList ); + inParamList.Reset(); + + CAddPluginResult* result = CAddPluginResult::NewL(); + CleanupStack::PushL(result); + // test success + const TLiwGenericParam* outParam = NULL; + TInt pos(0); + outParam = outParamList.FindFirst( pos, _L8("status") ); + if ( outParam ) + { + result->SetStatus(outParam->Value().AsTInt32()); + } + else + { + result->SetStatus(KErrNone); + pos = 0; + outParam = outParamList.FindFirst( pos, _L8("pluginId") ); + if ( outParam ) + { + result->SetPluginIdL(outParam->Value().AsData()); + } + else + { + // should never happen, but change status back to KErrNotFound + result->SetStatus(KErrNotFound); + } + } + + CleanupStack::Pop(result); + return result; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CAddPluginResult* CHspsWrapper::AddPluginL( + const TDesC8& aTargetConfiguration, + const TDesC8& aPluginUid, + const TInt aIndex ) + { + // Compose AddPlugin hsps LIW message to Service.HomeScreenPluginConfiguration + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + TLiwGenericParam confIdParam; + confIdParam.SetNameAndValueL( KConfId, TLiwVariant(aTargetConfiguration) ); + confIdParam.PushL(); + inParamList.AppendL( confIdParam ); + CleanupStack::Pop(&confIdParam); + confIdParam.Reset(); + + TLiwGenericParam pluginUidParam; + pluginUidParam.SetNameAndValueL( KPluginUid, TLiwVariant(aPluginUid) ); + pluginUidParam.PushL(); + inParamList.AppendL( pluginUidParam ); + CleanupStack::Pop(&pluginUidParam); + pluginUidParam.Reset(); + + if(aIndex >= 0) + { + TBuf8<32> buf; + buf.Num( aIndex ); + TLiwGenericParam indexParam; + indexParam.SetNameAndValueL( KIndex, TLiwVariant( buf ) ); + indexParam.PushL(); + inParamList.AppendL( indexParam ); + CleanupStack::Pop(&indexParam); + indexParam.Reset(); + } + + // add widget to configuration + iHspsInterface->ExecuteCmdL( KHSPSCommandAddPlugin, + inParamList, + outParamList ); + inParamList.Reset(); + + CAddPluginResult* result = CAddPluginResult::NewL(); + CleanupStack::PushL(result); + // test success + const TLiwGenericParam* outParam = NULL; + TInt pos(0); + outParam = outParamList.FindFirst( pos, _L8("status") ); + if ( outParam ) + { + result->SetStatus(outParam->Value().AsTInt32()); + } + else + { + result->SetStatus(KErrNone); + pos = 0; + outParam = outParamList.FindFirst( pos, _L8("pluginId") ); + if ( outParam ) + { + result->SetPluginIdL(outParam->Value().AsData()); + } + else + { + // should never happen, but change status back to KErrNotFound + result->SetStatus(KErrNotFound); + } + } + + CleanupStack::Pop(result); + return result; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHspsWrapper::RemovePluginL(const TDesC8& aPluginId) + { + // Compose AddPlugin hsps LIW message to Service.HomeScreenPluginConfiguration + 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(); + + iHspsInterface->ExecuteCmdL( KHSPSCommandRemovePlugin, + 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; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHspsWrapper::ReplacePluginL( + const TDesC8& aPluginId, + const TDesC8& aConfUid ) + { + // Compose ReplacePlugin hsps LIW message to Service.HomeScreenPluginConfiguration + 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 confUidParam; + confUidParam.SetNameAndValueL( KKeyConfUid, TLiwVariant( aConfUid ) ); + confUidParam.PushL(); + inParamList.AppendL( confUidParam ); + CleanupStack::Pop( &confUidParam ); + confUidParam.Reset(); + + // Execute command + iHspsInterface->ExecuteCmdL( KHSPSCommandReplacePlugin, + 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; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHspsWrapper::SetActivePluginL(const TDesC8& aPluginId) + { + // Compose AddPlugin hsps LIW message to Service.HomeScreenPluginConfiguration + 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(); + + iHspsInterface->ExecuteCmdL( KHSPSCommandSetActivePlugin, + 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; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHspsWrapper::MovePluginsL( + const TDesC8& aConfId, + const MDesC8Array& aPluginIds) + { + // Compose AddPlugin hsps LIW message to Service.HomeScreenPluginConfiguration + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + TLiwGenericParam confIdParam; + confIdParam.SetNameAndValueL( KConfId, TLiwVariant(aConfId) ); + confIdParam.PushL(); + inParamList.AppendL( confIdParam ); + CleanupStack::Pop( &confIdParam ); + confIdParam.Reset(); + + // add "plugins" parameter to the inParamList + CLiwDefaultList* inPluginList = CLiwDefaultList::NewLC(); + for( int i = 0; i < aPluginIds.MdcaCount(); i++ ) + { + const TDesC8& id = aPluginIds.MdcaPoint(i); + inPluginList->AppendL( TLiwVariant(id) ); + } + + TLiwGenericParam pluginsParam; + pluginsParam.SetNameAndValueL( KKeyPlugins, TLiwVariant(inPluginList) ); + pluginsParam.PushL(); + inParamList.AppendL( pluginsParam ); + CleanupStack::Pop( &pluginsParam ); + pluginsParam.Reset(); + + iHspsInterface->ExecuteCmdL( KHSPSMovePlugins, + inParamList, + outParamList ); + + CleanupStack::PopAndDestroy( inPluginList ); + 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; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHspsWrapper::SetPluginSettingsL( + const TDesC8& aPluginId, + const RPointerArray& aSettings) + { + // Compose AddPlugin hsps LIW message to Service.HomeScreenPluginConfiguration + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + TLiwGenericParam pluginIdParam; + pluginIdParam.SetNameAndValueL( KKeyPluginId, TLiwVariant(aPluginId) ); + pluginIdParam.PushL(); + inParamList.AppendL( pluginIdParam ); + CleanupStack::Pop( &pluginIdParam ); + pluginIdParam.Reset(); + + CLiwDefaultList* itemMapList = CLiwDefaultList::NewLC(); + for( int i = 0; i < aSettings.Count(); i++ ) + { + CItemMap* itemMap = aSettings[i]; + + CLiwDefaultMap* inItemMap = CLiwDefaultMap::NewLC(); + FillMapFromItemL(*inItemMap,*itemMap); + itemMapList->AppendL( TLiwVariant(inItemMap) ); + CleanupStack::PopAndDestroy(inItemMap); + } + + TLiwGenericParam settingsParam; + settingsParam.SetNameAndValueL( KKeySettings, TLiwVariant(itemMapList) ); + settingsParam.PushL(); + inParamList.AppendL( settingsParam ); + CleanupStack::Pop( &settingsParam ); + settingsParam.Reset(); + + iHspsInterface->ExecuteCmdL( KHSPSSetPluginSettings, + inParamList, + outParamList ); + + CleanupStack::PopAndDestroy( itemMapList ); + 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; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHspsWrapper::SetConfStateL( const TDesC8& aConfId, + const TDesC8& aState, TBool aIncludePlugins ) + { + // Compose AddPlugin hsps LIW message to Service.HomeScreenPluginConfiguration + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + // Compose Liw message + TLiwGenericParam confIdParam; + confIdParam.SetNameAndValueL( KConfId, TLiwVariant( aConfId ) ); + confIdParam.PushL(); + inParamList.AppendL( confIdParam ); + CleanupStack::Pop(&confIdParam); + confIdParam.Reset(); + + TLiwGenericParam pluginStateParam; + pluginStateParam.SetNameAndValueL( KConfState, TLiwVariant( aState ) ); + pluginStateParam.PushL(); + inParamList.AppendL( pluginStateParam ); + CleanupStack::Pop(&pluginStateParam); + pluginStateParam.Reset(); + + iHspsInterface->ExecuteCmdL( KHSPSCommandSetConfState, + inParamList, + outParamList ); + + const TLiwGenericParam* outParam = NULL; + TInt pos(0); + outParam = outParamList.FindFirst( pos, KOutKeyStatus ); + TInt status(KErrGeneral); + + if ( outParam ) + { + status = outParam->Value().AsTInt32(); + } + + outParamList.Reset(); + + if( !status && aIncludePlugins ) + { + _LIT8( KFilter, "filter" ); + _LIT8( KFilterPlugins, "Plugins" ); + + TLiwGenericParam filterParam; + filterParam.PushL(); + filterParam.SetNameAndValueL( KFilter, TLiwVariant( KFilterPlugins ) ); + inParamList.AppendL( filterParam ); + CleanupStack::Pop(&filterParam); + filterParam.Reset(); + + iHspsInterface->ExecuteCmdL( KHSPSCommandSetConfState, + inParamList, + outParamList ); + + // check success + pos = 0; + outParam = outParamList.FindFirst( pos, KOutKeyStatus ); + status = KErrGeneral; + + if ( outParam ) + { + status = outParam->Value().AsTInt32(); + } + + outParamList.Reset(); + } + + inParamList.Reset(); + + return status; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CLiwServiceHandler* CHspsWrapper::ServiceHandler() const + { + return iServiceHandler; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CLiwCriteriaItem* CHspsWrapper::HspsService() const + { + return iHspsService; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C MLiwInterface* CHspsWrapper::HspsInterface() const + { + return iHspsInterface; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHspsWrapper::ProcessConfigurationMapL( + const CLiwMap& aSource, + CHspsConfiguration& aTarget) + { + TLiwVariant tempVariant; + tempVariant.PushL(); + + if ( aSource.FindL( _L8("id"), tempVariant ) ) + { + aTarget.SetConfIdL(tempVariant.AsData()); + } + if ( aSource.FindL( _L8("uid"), tempVariant ) ) + { + aTarget.PluginInfo().SetUidL(tempVariant.AsData()); + } + if ( aSource.FindL( _L8("type"), tempVariant ) ) + { + aTarget.PluginInfo().SetTypeL(tempVariant.AsData()); + } + if ( aSource.FindL( _L8("interface"), tempVariant ) ) + { + aTarget.PluginInfo().SetInterfaceL(tempVariant.AsData()); + } + if ( aSource.FindL( _L8("name"), tempVariant ) ) + { + aTarget.PluginInfo().SetNameL(tempVariant.AsData()); + } + if ( aSource.FindL( _L8("state"), tempVariant ) ) + { + aTarget.PluginInfo().SetConfigurationStateL(tempVariant.AsData()); + } + if ( aSource.FindL( _L8("multiinstance"), tempVariant ) ) + { + aTarget.PluginInfo().SetMultiInstanceL( tempVariant.AsTInt32() ); + } + if ( aSource.FindL( _L8( "max_child" ), tempVariant ) ) + { + aTarget.PluginInfo().SetMaxChild( tempVariant.AsTInt32() ); + } + if( aSource.FindL( _L8("plugins"), tempVariant ) ) + { + const CLiwList* plugins( tempVariant.AsList() ); + if( plugins ) + { + ProcessConfigurationPluginsL(*plugins,aTarget); + } + } + if( aSource.FindL( _L8("settings"), tempVariant ) ) + { + const CLiwList* settings( tempVariant.AsList() ); + if( settings ) + { + ProcessConfigurationSettingsL(*settings,aTarget); + } + } + if( aSource.FindL( _L8("resources"), tempVariant ) ) + { + const CLiwList* resources( tempVariant.AsList() ); + if( resources ) + { + ProcessConfigurationResourcesL(*resources,aTarget); + } + } + CleanupStack::Pop(&tempVariant); + tempVariant.Reset(); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHspsWrapper::ProcessConfigurationPluginsL( + const CLiwList& aPluginsList, + CHspsConfiguration& aTarget) + { + TLiwVariant pluginMapVariant; + pluginMapVariant.PushL(); + for( int i=0;iFindL( _L8("id"),pluginVariant) ) + { + plugin->SetPluginIdL( pluginVariant.AsData() ); + } + if( pluginMap->FindL( _L8("uid"),pluginVariant) ) + { + plugin->SetPluginUidL( pluginVariant.AsData() ); + } + if( pluginMap->FindL( _L8("activationstate"),pluginVariant ) ) + { + plugin->SetActivationStateL( pluginVariant.AsData() ); + } + if ( pluginMap->FindL( _L8( "locking_status" ), pluginVariant ) ) + { + plugin->SetLockingStatusL( pluginVariant.AsData() ); + } + aTarget.AddPluginMapL(plugin); + CleanupStack::Pop(plugin); + } + CleanupStack::Pop(&pluginVariant); + pluginVariant.Reset(); + } + + } + CleanupStack::Pop(&pluginMapVariant); + pluginMapVariant.Reset(); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHspsWrapper::ProcessConfigurationSettingsL( + const CLiwList& aItemList, + CHspsConfiguration& aTarget) + { + TLiwVariant itemMapVariant; + itemMapVariant.PushL(); + for( int i=0;iFindL( _L8("itemId"),itemVariant) ) + { + item->SetItemIdL( itemVariant.AsData() ); + } + if( itemMap->FindL( _L8("name"),itemVariant) ) + { + item->SetItemNameL( itemVariant.AsData() ); + } + if( itemMap->FindL( _L8("properties"),itemVariant) ) + { + const CLiwList* properties( itemVariant.AsList() ); + if(properties) + { + ProcessConfItemPropertiesL(*properties,*item); + } + } + + aTarget.AddItemMapL(item); + CleanupStack::Pop(item); + } + CleanupStack::Pop(&itemVariant); + itemVariant.Reset(); + } + + } + CleanupStack::Pop(&itemMapVariant); + itemMapVariant.Reset(); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHspsWrapper::ProcessConfigurationResourcesL( + const CLiwList& aObjectList, + CHspsConfiguration& aTarget) + { + TLiwVariant objectMapVariant; + objectMapVariant.PushL(); + for( int i=0;iFindL( _L8("name"),objectVariant) ) + { + object->SetNameL( objectVariant.AsData() ); + } + if( objectMap->FindL( _L8("path"),objectVariant) ) + { + object->SetPathL( objectVariant.AsData() ); + } + if( objectMap->FindL( _L8("mediatype"),objectVariant) ) + { + object->SetMediaTypeL( objectVariant.AsData() ); + } + if( objectMap->FindL( _L8("tag"),objectVariant) ) + { + object->SetTagL( objectVariant.AsData() ); + } + aTarget.AddObjectMapL(object); + CleanupStack::Pop(object); + } + CleanupStack::Pop(&objectVariant); + objectVariant.Reset(); + } + } + CleanupStack::Pop(&objectMapVariant); + objectMapVariant.Reset(); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHspsWrapper::ProcessConfItemPropertiesL( + const CLiwList& aPropertyMapList, + CItemMap& aItemMap) + { + TLiwVariant propertyMapVariant; + propertyMapVariant.PushL(); + for( int i=0;iFindL( _L8("name"),propertyVariant ) ) + { + property->SetNameL( propertyVariant.AsData() ); + } + if( propertyMap->FindL( _L8("value"),propertyVariant ) ) + { + property->SetValueL( propertyVariant.AsData() ); + } + aItemMap.AddPropertyMapL(property); + CleanupStack::Pop(property); + } + CleanupStack::Pop(&propertyVariant); + propertyVariant.Reset(); + } + + } + CleanupStack::Pop(&propertyMapVariant); + propertyMapVariant.Reset(); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHspsWrapper::ProcessPluginsL( + const CLiwList& aPluginInfoMapList, + RPointerArray& aPlugins) + { + // create widget array and populate it from HSPS list + TLiwVariant mapVar; + mapVar.PushL(); + + for ( int index(0); aPluginInfoMapList.AtL( index, mapVar ); ++index ) + { + const CLiwMap* pluginInfoMap = mapVar.AsMap(); + if ( pluginInfoMap ) + { + TLiwVariant pluginVar; + pluginVar.PushL(); + CPluginInfo* pluginInfo = CPluginInfo::NewLC(); + + if( pluginInfoMap->FindL( _L8("uid"), pluginVar) ) + { + pluginInfo->SetUidL( pluginVar.AsData() ); + } + if( pluginInfoMap->FindL( _L8("interface"), pluginVar ) ) + { + pluginInfo->SetInterfaceL( pluginVar.AsData() ); + } + if( pluginInfoMap->FindL( _L8("type"), pluginVar ) ) + { + pluginInfo->SetTypeL( pluginVar.AsData() ); + } + if( pluginInfoMap->FindL( _L8("name"), pluginVar ) ) + { + pluginInfo->SetNameL( pluginVar.AsData() ); + } + if ( pluginInfoMap->FindL( _L8("multiinstance"), pluginVar ) ) + { + pluginInfo->SetMultiInstanceL( pluginVar.AsTInt32() ); + } + if ( pluginInfoMap->FindL( _L8( "max_child" ), pluginVar ) ) + { + pluginInfo->SetMaxChild( pluginVar.AsTInt32() ); + } + if ( pluginInfoMap->FindL( _L8("desc"), pluginVar ) ) + { + pluginInfo->SetDescriptionL( pluginVar.AsData() ); + } + if ( pluginInfoMap->FindL( _L8("logo"), pluginVar ) ) + { + pluginInfo->SetLogoIconL( pluginVar.AsData() ); + } + + aPlugins.AppendL(pluginInfo); + CleanupStack::Pop(pluginInfo); + CleanupStack::Pop(&pluginVar); + pluginVar.Reset(); + } + } + CleanupStack::Pop(&mapVar); + mapVar.Reset(); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHspsWrapper::FillMapFromItemL( CLiwDefaultMap& aMap, const CItemMap& aItemMap ) + { + aMap.InsertL( KKeyItemId, TLiwVariant(aItemMap.ItemId()) ); + aMap.InsertL( KKeyName, TLiwVariant(aItemMap.ItemName()) ); + + CLiwDefaultList* inPropertyMapList = CLiwDefaultList::NewLC(); + FillMapFromPropertiesL(*inPropertyMapList,aItemMap.Properties()); + aMap.InsertL( KKeyProperties, TLiwVariant(inPropertyMapList) ); + CleanupStack::PopAndDestroy(inPropertyMapList); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHspsWrapper::FillMapFromPropertiesL( + CLiwDefaultList& aInPropertyMapList, + const RPointerArray& aProperties ) + { + + for(int i=0; iInsertL( KKeyName, TLiwVariant(aProperties[i]->Name()) ); + inPropertyMap->InsertL( KKeyValue, TLiwVariant(aProperties[i]->Value()) ); + aInPropertyMapList.AppendL(inPropertyMap); + CleanupStack::PopAndDestroy(inPropertyMap); + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +TInt CHspsWrapper::HandleNotifyL( TInt aCmdId, TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/ ) + { + TInt retval( KErrNone ); + + if( iObserver && iTransactionId == aCmdId ) + { + const TLiwGenericParam* outParam( NULL ); + + TInt pos( 0 ); + outParam = aEventParamList.FindFirst( pos, _L8("status") ); + + if ( outParam ) + { + retval = outParam->Value().AsTInt32(); + } + else + { + pos = 0; + + retval = KErrNotFound; + + outParam = aEventParamList.FindFirst( pos, _L8("notification") ); + + if( !outParam ) + { + // should never happen, but change status back to KErrNotFound + return retval; + } + + HBufC8* event( NULL ); + HBufC8* appConfUid( NULL ); + HBufC8* pluginUid( NULL ); + HBufC8* pluginName( NULL ); + HBufC8* origUid( NULL ); + TInt pushCount( 0 ); + + TLiwVariant variant; + variant.PushL(); + pushCount++; + + variant = outParam->Value(); + + const CLiwMap* notifMap( variant.AsMap() ); + + if ( notifMap->FindL( _L8("event"), variant ) ) + { + event = variant.AsData().AllocLC(); + pushCount++; + } + + variant.Reset(); + + if( notifMap->FindL( _L8("appConfUid"), variant ) ) + { + appConfUid = variant.AsData().AllocLC(); + pushCount++; + } + + variant.Reset(); + + if( notifMap->FindL( _L8("name"), variant ) ) + { + pluginName = variant.AsData().AllocLC(); + pushCount++; + } + + variant.Reset(); + + if( notifMap->FindL( _L8("origUid"), variant ) ) + { + origUid = variant.AsData().AllocLC(); + pushCount++; + } + + variant.Reset(); + + if( notifMap->FindL( _L8("pluginUid"), variant ) ) + { + pluginUid = variant.AsData().AllocLC(); + pushCount++; + } + + variant.Reset(); + + if( notifMap->FindL( _L8("pluginIds"), variant ) ) + { + const CLiwList* pluginIdList( variant.AsList() ); + + variant.Reset(); + + TInt count( pluginIdList->Count() ); + + retval = KErrNone; + + for( TInt i = 0; i < count && retval == KErrNone; i++ ) + { + pluginIdList->AtL( i, variant ); + + HBufC8* pluginId( NULL ); + + pluginId = variant.AsData().AllocLC(); + + retval = iObserver->HandleNotifyL( + ( event ) ? *event : KNullDesC8(), + ( appConfUid ) ? *appConfUid : KNullDesC8(), + ( pluginName ) ? *pluginName : KNullDesC8(), + ( origUid ) ? *origUid : KNullDesC8(), + ( pluginUid ) ? *pluginUid : KNullDesC8(), + ( pluginId ) ? * pluginId : KNullDesC8() ); + + CleanupStack::PopAndDestroy( pluginId ); + + variant.Reset(); + } + } + + CleanupStack::PopAndDestroy( pushCount ); + } + } + + if( retval != KErrNone && aEventId != KLiwEventInProgress) + { + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + inParamList.Reset(); + outParamList.Reset(); + //cancel old notification request + iHspsInterface->ExecuteCmdL( KRequestNotification, + inParamList, + outParamList, + KLiwOptCancel, + this ); + + inParamList.Reset(); + outParamList.Reset(); + //request notification again + iTransactionId = -1; + iHspsInterface->ExecuteCmdL( KRequestNotification, + inParamList, + outParamList, + KLiwOptASyncronous, + this ); + + const TLiwGenericParam* outParam( NULL ); + + TInt pos( 0 ); + outParam = outParamList.FindFirst( pos, _L8("status") ); + + if ( outParam ) + { + TInt retval; + retval = outParam->Value().AsTInt32(); + + if(retval == KErrNone ) + { + pos = 0; + outParam = outParamList.FindFirst( pos, _L8("TransactionID") ); + + if( outParam ) + { + retval = outParam->Value().AsTInt32(); + iTransactionId = retval; + } + } + } + + } + + + return retval; + } +} + +//End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/src/hspswrapperdllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/src/hspswrapperdllmain.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Item id, name and properties + * +*/ + + + +// Include Files + +#include // GLDEF_C +#include "hspswrapper.pan" // panic codes + +// Global Functions + +GLDEF_C void Panic(ThspswrapperPanic aPanic) +// Panics the thread with given panic code + + { + User::Panic(_L("hspswrapper"), aPanic); + } + +// Exported Functions + +#ifndef EKA2 // for EKA1 only +EXPORT_C TInt E32Dll(TDllReason /*aReason*/) +// Called when the DLL is loaded and unloaded. Note: have to define +// epoccalldllentrypoints in MMP file to get this called in THUMB. + + { + return KErrNone; + } +#endif + diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/src/itemmap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/src/itemmap.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Item id, name and properties +* +*/ + + + +#include "itemmap.h" +#include "propertymap.h" + +namespace hspswrapper{ + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CItemMap::CItemMap() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CItemMap::ConstructL() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CItemMap* CItemMap::NewL() + { + CItemMap* self = CItemMap::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CItemMap* CItemMap::NewLC() + { + CItemMap* self = new( ELeave ) CItemMap; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CItemMap::~CItemMap() + { + delete iItemId; + delete iItemName; + iProperties.ResetAndDestroy(); + } + + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CItemMap& CItemMap::SetItemIdL(const TDesC8& aItemId ) + { + delete iItemId; + iItemId = NULL; + iItemId = aItemId.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CItemMap::ItemId()const + { + if(iItemId) + { + return *iItemId; + } + else + { + return KNullDesC8; + } + + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CItemMap& CItemMap::SetItemNameL(const TDesC8& aItemName ) + { + delete iItemName; + iItemName = NULL; + iItemName = aItemName.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CItemMap::ItemName()const + { + if(iItemName) + { + return *iItemName; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CItemMap& CItemMap::AddPropertyMapL(CPropertyMap* aPropertyMap ) + { + iProperties.AppendL(aPropertyMap); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C RPointerArray& CItemMap::Properties()const + { + return iProperties; + } +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/src/objectmap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/src/objectmap.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,180 @@ +/* +* 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: Presents object map as name, path and mediatype data +* +*/ + + + +#include "objectmap.h" + +namespace hspswrapper{ + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CObjectMap::CObjectMap() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CObjectMap::ConstructL() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CObjectMap* CObjectMap::NewL() + { + CObjectMap* self = CObjectMap::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CObjectMap* CObjectMap::NewLC() + { + CObjectMap* self = new( ELeave ) CObjectMap; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CObjectMap::~CObjectMap() + { + delete iName; + delete iPath; + delete iMediaType; + delete iTag; + } +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CObjectMap& CObjectMap::SetNameL( const TDesC8& aName ) + { + delete iName; + iName = NULL; + iName = aName.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CObjectMap::NameL()const + { + if(iName) + { + return *iName; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CObjectMap& CObjectMap::SetPathL( const TDesC8& aPath ) + { + delete iPath; + iPath = NULL; + iPath = aPath.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CObjectMap::Path()const + { + if(iPath) + { + return *iPath; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CObjectMap& CObjectMap::SetMediaTypeL( const TDesC8& aMediaType ) + { + delete iMediaType; + iMediaType = NULL; + iMediaType = aMediaType.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CObjectMap::MediaType()const + { + if(iMediaType) + { + return *iMediaType; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CObjectMap& CObjectMap::SetTagL( const TDesC8& aTag ) + { + delete iTag; + iTag = NULL; + iTag = aTag.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CObjectMap::Tag()const + { + if(iTag) + { + return *iTag; + } + else + { + return KNullDesC8; + } + } + +} + + diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/src/plugininfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/src/plugininfo.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,313 @@ +/* +* 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: Presents plugin info using states uid, interface, type and name +* +*/ + + +#include "plugininfo.h" + +const TInt32 KMultiInstanceDefaultValue = 1; +const TInt32 KMaxChildsDefaultValue = 6; + +namespace hspswrapper{ + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CPluginInfo::CPluginInfo() + : iMultiInstance( KMultiInstanceDefaultValue ) + { + iMaxChilds = KMaxChildsDefaultValue; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CPluginInfo::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo* CPluginInfo::NewL() + { + CPluginInfo* self = CPluginInfo::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo* CPluginInfo::NewLC() + { + CPluginInfo* self = new( ELeave ) CPluginInfo; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo::~CPluginInfo() + { + delete iUid; + delete iType; + delete iInterface; + delete iName; + delete iConfigurationState; + delete iDescription; + delete iLogoIcon; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetUidL(const TDesC8& aUid) + { + delete iUid; + iUid = NULL; + iUid = aUid.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPluginInfo::Uid()const + { + if(iUid) + { + return *iUid; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetTypeL(const TDesC8& aType) + { + delete iType; + iType = NULL; + iType = aType.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPluginInfo::Type()const + { + if(iType) + { + return *iType; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetInterfaceL( + const TDesC8& aInterface) + { + delete iInterface; + iInterface = NULL; + iInterface = aInterface.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPluginInfo::Interface()const + { + if(iInterface) + { + return *iInterface; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetNameL(const TDesC8& aName) + { + delete iName; + iName = NULL; + iName = aName.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPluginInfo::Name()const + { + if(iName) + { + return *iName; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetConfigurationStateL( + const TDesC8& aConfigurationState) + { + delete iConfigurationState; + iConfigurationState = NULL; + + iConfigurationState = aConfigurationState.AllocL(); + + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPluginInfo::ConfigurationState()const + { + if(iConfigurationState) + { + return *iConfigurationState; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetMultiInstanceL( + const TInt32 aMultiInstance ) + { + iMultiInstance = aMultiInstance; + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TInt32& CPluginInfo::MultiInstance()const + { + return iMultiInstance; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TInt32& CPluginInfo::MaxChild()const + { + return iMaxChilds; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetMaxChild( + const TInt32 aMaxChild ) + { + iMaxChilds = aMaxChild; + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetDescriptionL( const TDesC& aDescription ) + { + delete iDescription; + iDescription = NULL; + + iDescription = aDescription.AllocL(); + return *this; + } + + // --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetDescriptionL( const TDesC8& aDescription ) + { + delete iDescription; + iDescription = NULL; + + iDescription = HBufC::NewL( aDescription.Length() ); + iDescription->Des().Copy( aDescription ); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CPluginInfo::Description() const + { + return iDescription ? *iDescription : KNullDesC(); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetLogoIconL( const TDesC& aLogoIcon ) + { + delete iLogoIcon; + iLogoIcon = NULL; + + iLogoIcon = aLogoIcon.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetLogoIconL( const TDesC8& aLogoIcon ) + { + delete iLogoIcon; + iLogoIcon = NULL; + + iLogoIcon = HBufC::NewL( aLogoIcon.Length() ); + iLogoIcon->Des().Copy( aLogoIcon ); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CPluginInfo::LogoIcon() const + { + return iLogoIcon ? *iLogoIcon : KNullDesC(); + } + +} // namespace diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/src/pluginmap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/src/pluginmap.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,174 @@ +/* +* 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: contains id and uid +* +*/ + + +#include "pluginmap.h" + +namespace hspswrapper{ + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CPluginMap::CPluginMap() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CPluginMap::ConstructL() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginMap* CPluginMap::NewL() + { + CPluginMap* self = CPluginMap::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginMap* CPluginMap::NewLC() + { + CPluginMap* self = new( ELeave ) CPluginMap; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginMap::~CPluginMap() + { + delete iPluginId; + delete iPluginUid; + delete iActivationState; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginMap& CPluginMap::SetPluginIdL(const TDesC8& aPluginId) + { + delete iPluginId; + iPluginId = NULL; + iPluginId = aPluginId.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPluginMap::PluginId()const + { + if(iPluginId) + { + return *iPluginId; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginMap& CPluginMap::SetPluginUidL(const TDesC8& aPluginUid) + { + delete iPluginUid; + iPluginUid = NULL; + iPluginUid = aPluginUid.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPluginMap::PluginUid()const + { + if(iPluginUid) + { + return *iPluginUid; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginMap& CPluginMap::SetActivationStateL(const TDesC8& aState) + { + delete iActivationState; + iActivationState = NULL; + iActivationState = aState.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CPluginMap::ActivationState()const + { + if( iActivationState ) + { + return ( *iActivationState == _L8("1") ) ? ETrue : EFalse; + } + + return EFalse; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginMap& CPluginMap::SetLockingStatusL( const TDesC8& aLockingStatus ) + { + delete iLockingStatus; + iLockingStatus = NULL; + iLockingStatus = aLockingStatus.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPluginMap::LockingStatus() const + { + if ( iLockingStatus ) + { + return *iLockingStatus; + } + else + { + return KNullDesC8; + } + } + +} diff -r 000000000000 -r f72a12da539e idlehomescreen/sapiwrapper/hspswrapper/src/propertymap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/sapiwrapper/hspswrapper/src/propertymap.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Encapsulates name and value +* +*/ + + + +#include "propertymap.h" + +namespace hspswrapper{ + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CPropertyMap::CPropertyMap() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CPropertyMap::ConstructL() + { + + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPropertyMap* CPropertyMap::NewL() + { + CPropertyMap* self = CPropertyMap::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPropertyMap* CPropertyMap::NewLC() + { + CPropertyMap* self = new( ELeave ) CPropertyMap; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPropertyMap::~CPropertyMap() + { + delete iName; + delete iValue; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPropertyMap& CPropertyMap::SetNameL( const TDesC8& aName ) + { + delete iName; + iName = NULL; + iName = aName.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPropertyMap::Name()const + { + if(iName) + { + return *iName; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPropertyMap& CPropertyMap::SetValueL( const TDesC8& aValue ) + { + delete iValue; + iValue = NULL; + iValue = aValue.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPropertyMap::Value()const + { + if(iValue) + { + return *iValue; + } + else + { + return KNullDesC8; + } + } + +} diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/conf/activeidle2.confml Binary file idlehomescreen/xmluicontroller/conf/activeidle2.confml has changed diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/conf/activeidle2_10275102.crml Binary file idlehomescreen/xmluicontroller/conf/activeidle2_10275102.crml has changed diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/group/aixmluimain.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/group/aixmluimain.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 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: +* +*/ + +#include + +#include +#include + +TARGET ai3xmluimain.dll +TARGETTYPE PLUGIN +UID 0x10009D8D AI3_UID_ECOM_DLL_UICONTROLLER_XML +VENDORID VID_DEFAULT +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../src +SOURCE xmluicontroller.cpp +SOURCE application.cpp +SOURCE document.cpp +SOURCE appui.cpp +SOURCE aixuikoneventhandler.cpp +SOURCE aieventhandler.cpp +SOURCE contentrenderer.cpp +SOURCE activetransactionstack.cpp +SOURCE transactionfactoryimpl.cpp +SOURCE transaction.cpp +SOURCE transactionelement.cpp +SOURCE texttransactionelement.cpp +SOURCE newstickertransactionelement.cpp +SOURCE imagetransactionelement.cpp +SOURCE emptycontenttransactionelement.cpp +SOURCE xmlnodeidgenerator.cpp +SOURCE aixmluiutils.cpp +SOURCE xmluicontrollerpanic.cpp +SOURCE databuffertransactionelement.cpp +SOURCE newstickercallbackhandler.cpp +SOURCE csspropertymap.cpp +SOURCE aipolicyelement.cpp +SOURCE policyevaluator.cpp +SOURCE psobserver.cpp +SOURCE pmodtiterator.cpp +SOURCE contentpublisher.cpp +SOURCE globalqueryhandler.cpp +SOURCE onlineofflinehelper.cpp + + +START RESOURCE ai3xmluimain.rss +TARGET ai3xmluimain.rsc + +END +START RESOURCE ai3xmlui.rss +HEADER +TARGETPATH APP_RESOURCE_DIR +LANGUAGE_IDS + +END + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../help/inc + +USERINCLUDE ../../xmluirendering/uiengine/inc +USERINCLUDE ../../sapiwrapper/hspswrapper/inc // hspswrapper + +SYSTEMINCLUDE . +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib efsrv.lib +LIBRARY ecom.lib centralrepository.lib +LIBRARY fbscli.lib apparc.lib cone.lib +LIBRARY eikcore.lib eikcoctl.lib egul.lib avkon.lib aknskins.lib +LIBRARY xn3layoutengine.lib xn3utils.lib xn3domdocument.lib +LIBRARY aiidleint.lib aiutils.lib +LIBRARY imageconversion.lib +LIBRARY apgrfx.lib +LIBRARY bafl.lib +LIBRARY flogger.lib +LIBRARY aknicon.lib +LIBRARY cdlengine.lib liwservicehandler.lib +LIBRARY hlplch.lib commonengine.lib +LIBRARY charconv.lib +LIBRARY aknnotify.lib +LIBRARY networkhandling.lib +LIBRARY profileeng.lib + + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/group/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/group/backup_registration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,5 @@ + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifdef RD_CUSTOMIZABLE_AI + +#include + +PRJ_PLATFORMS +DEFAULT + + +PRJ_EXPORTS +//backup_registration.xml /epoc32/data/z/private/10275102/backup_registration.xml +//backup_registration.xml /epoc32/release/winscw/udeb/z/private/10275102/backup_registration.xml +//backup_registration.xml /epoc32/release/winscw/urel/z/private/10275102/backup_registration.xml + +//../rom/activeidle2.iby CORE_APP_LAYER_IBY_EXPORT_PATH(activeidle2.iby) +//../rom/activeidle2_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(activeidle2_resources.iby) +../rom/ai3xmluicontroller.iby CORE_APP_LAYER_IBY_EXPORT_PATH(ai3xmluicontroller.iby) +../rom/ai3xmluicontroller_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(ai3xmluicontroller_resources.iby) + +// Generic configuration interface for component cenrep settings +//../conf/activeidle2.confml APP_LAYER_CONFML(activeidle2.confml) +//../conf/activeidle2_10275102.crml APP_LAYER_CRML(activeidle2_10275102.crml) + +PRJ_EXTENSIONS + +START EXTENSION s60/mifconv +OPTION TARGETFILE activeidle2.mif +OPTION HEADERFILE activeidle2.mbg +OPTION SOURCES -c8,8 qgn_indi_tb_appsgrid \ + -c8,8 qgn_indi_tb_dialler \ + -c8,8 qgn_indi_tb_profiles +END + +START EXTENSION s60/mifconv +OPTION TARGETFILE ailaunch_aif.mif +OPTION SOURCES -c8,8 qgn_menu_idlestate +END + + +PRJ_MMPFILES + +#ifdef __SCALABLE_ICONS +// gnumakefile icons.mk +// gnumakefile icons_aif_scalable.mk +#else + gnumakefile icons_aif_bitmaps.mk +#endif + +aixmluimain.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + +#endif // RD_CUSTOMIZABLE_AI + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/group/icons.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/group/icons.mk Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,66 @@ +# +# Copyright (c) 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: +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z +else +ZDIR=\epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\resource\apps +HEADERDIR=\epoc32\include +ICONTARGETFILENAME=$(TARGETDIR)\activeidle2.mif +HEADERFILENAME=$(HEADERDIR)\activeidle2.mbg + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + +LIB : do_nothing + +CLEANLIB : do_nothing + +# ---------------------------------------------------------------------------- +# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by +# MifConv if the mask detph is defined. +# +# NOTE 2: Usually, source paths should not be included in the bitmap +# definitions. MifConv searches for the icons in all icon directories in a +# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps. +# The directory \s60\icons is included in the search only if the feature flag +# __SCALABLE_ICONS is defined. +# ---------------------------------------------------------------------------- + +RESOURCE : + mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \ + /c8,8 qgn_indi_tb_appsgrid.svg \ + /c8,8 qgn_indi_tb_dialler.svg \ + /c8,8 qgn_indi_tb_profiles.svg + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(HEADERFILENAME)&& \ + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/group/icons_aif_bitmaps.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/group/icons_aif_bitmaps.mk Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,49 @@ +# +# Copyright (c) 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: scalable icons makefile for project ?myapp +# + +ifeq (WINS,$(findstring WINS,$(PLATFORM))) +ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\z +else +ZDIR=$(EPOCROOT)epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\resource\apps +HEADERDIR=$(EPOCROOT)epoc32\include +ICONTARGETFILENAME=$(TARGETDIR)\ailaunch_aif.mbm + +MAKMAKE : + mifconv $(ICONTARGETFILENAME) \ + /c8,8 qgn_menu_idlestate_lst.bmp \ + /c8,8 qgn_menu_idlestate_cxt.bmp + +BLD : ; + +CLEAN : ; + +LIB : ; + +CLEANLIB : ; + +RESOURCE : ; + +FREEZE : ; + +SAVESPACE : ; + +RELEASABLES : + @echo $(ICONTARGETFILENAME) + +FINAL : ; diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/group/icons_aif_scalable.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/group/icons_aif_scalable.mk Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,48 @@ +# +# Copyright (c) 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: scalable icons makefile for project ailaunch +# + +ifeq (WINS,$(findstring WINS,$(PLATFORM))) +ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\z +else +ZDIR=$(EPOCROOT)epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\resource\apps +HEADERDIR=$(EPOCROOT)epoc32\include +ICONTARGETFILENAME=$(TARGETDIR)\ailaunch_aif.mif + +MAKMAKE : ; + +BLD : ; + +CLEAN : ; + +LIB : ; + +CLEANLIB : ; + +RESOURCE : + mifconv $(ICONTARGETFILENAME) \ + /c8,8 qgn_menu_idlestate.svg + +FREEZE : ; + +SAVESPACE : ; + +RELEASABLES : + @echo $(ICONTARGETFILENAME) + +FINAL : ; diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/activetransactionstack.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/activetransactionstack.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,110 @@ +/* +* 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: Active transaction stack +* +*/ + + +#ifndef C_ACTIVETRANSACTIONSTACK_H +#define C_ACTIVETRANSACTIONSTACK_H + +#include + + +namespace AiXmlUiController + { + class MTransaction; + class CTransaction; + } + + +namespace AiXmlUiController +{ + +/** +* @ingroup group_xmluicontroller +* +* CActiveTransactionStack is a stack for CTransactions +* +* @lib AiXmlUiMain +*/ +class CActiveTransactionStack : public CBase + { +public: // Constructors and destructor + + static CActiveTransactionStack* NewL(); + + virtual ~CActiveTransactionStack(); + + // New functions + + /** + * Checks if stack is empty. + * @return ETrue if stack is empty + */ + TBool IsEmpty() const; + + /** + * Pushes a transaction into the stack. + * @param aTransaction the transaction + */ + void Push( MTransaction* aTransaction ); + + /** + * Pops the topmost transaction from the stack. + * @return the topmost transaction from the stack + */ + MTransaction* Pop(); + + /** + * Returns the topmost transaction from the stack. + * @return the topmost transaction from the stack + */ + MTransaction* Top() const; + + /** + * Lookups a transaction from the stack. + * @param aTxId the transaction id of the transaction + * @return the transaction with aTxId from the stack + */ + MTransaction* Lookup( TInt aTxId ) const; + + /** + * Removes a transaction from the stack. + * @param aTxId the transaction id of the transaction + * @return the transaction with aTxId from the stack + */ + MTransaction* Remove( TInt aTxId ); + +private: + + CActiveTransactionStack(); + + CTransaction* DoTop() const; + + CTransaction* DoLookup( TInt aTxId ) const; + +private: // Data + + /** + * Doubly linked list of transactions + */ + TDblQue< CTransaction > iTransactions; + }; + +} // namespace AiXmlUiController + +#endif // C_ACTIVETRANSACTIONSTACK_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/aiapplicationeventhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/aiapplicationeventhandler.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,64 @@ +/* +* 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: Interface for handling application events. +* +*/ + + +#ifndef M_AIAPPLICATIONEVENTHANDLER_H +#define M_AIAPPLICATIONEVENTHANDLER_H + +namespace AiXmlUiController +{ + +/** + * Extension of the CAiContentPublisher interface, which allows Active Idle + * Framework to notify their plug-ins that they must to handle event. + * Plug-ins must provide implementation of interface only if they are + * supporting event model (e.g. provides possibility to manipulate with + * engine properties via UI). + * + * @lib AiXmlUiMain + */ +class MAiApplicationEventHandler + { + +protected: + + /** + * Protected destructor prevents deletion through this interface. + */ + ~MAiApplicationEventHandler() { } + +public: // New functions + /** + * Invoked by the framework when plug-in must handle an event. + * + * @param aEvent - unique identifier of event. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where is mapped by the framework to unique + * identifier suppied in aEvent, are provided to + * plug-in as-is in the descriptor. + * @return ETrue if event was handled by this handler. + */ + virtual TBool HandleApplicationEvent(TInt aEvent, const TDesC8& aParam) = 0; + + }; + +} // namespace AiXmlUiController + +#endif // M_AIAPPLICATIONEVENTHANDLER_H + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/aieventhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/aieventhandler.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,87 @@ +/* +* 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: Used for handling system events (events with EventHandler-prefix). +* +*/ + + +#ifndef C_AIEVENTHANDLER_H +#define C_AIEVENTHANDLER_H + +#include + +class CXnDomNode; +class CLiwServiceHandler; +class MLiwInterface; +class CLiwDefaultMap; + +namespace AiXmlUiController +{ +class CXmlUiController; + +/** + * + * This class is used for handling and passing events. + * + * Class handles some of the events itself and uses Action Handler Service for the rest. + * + * @lib AiXmlUiMain + */ +class CAIEventHandler : public CBase + { +public: + // Constructor + static CAIEventHandler* NewL( CXmlUiController& aUiController ); + + // Destructor + ~CAIEventHandler(); + + /** + * Handles the restricted ( can be triggered only from view) events and forwards the rest + * into appropriate functions. + * + * @param aEventText Full event name (prefix/event) + * @param aEvent Includes rest of the parameters. + */ + void HandleEventL( const TDesC8& aEventText, CXnDomNode& aEvent ); + +private: + + CAIEventHandler( CXmlUiController& aUiController ); + + void ConstructL(); + + void LaunchAppL( CXnDomNode& aEventNode ); + + void ActivateViewL( CXnDomNode& aEventNode ); + + void ExecuteAppLauncherL( CLiwDefaultMap& map ); + + MLiwInterface* ActionHandlerInterfaceL( ); + +private: // data + /** + * Reference to XML ui controller. + */ + CXmlUiController& iUiController; + + /** + * Action Handler service handler. + * Own. + */ + CLiwServiceHandler* iServiceHandler; + }; +} + +#endif // C_AIEVENTHANDLER_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/aipolicyelement.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/aipolicyelement.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,74 @@ +/* +* 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: Policy element +* +*/ + + +#ifndef T_AIPOLICYELEMENT_H +#define T_AIPOLICYELEMENT_H + + +#include + +class CXnNodeAppIf; + +namespace AiXmlUiController +{ + + +/** + * @ingroup group_xmluicontroller + * + * Active Idle publishing policy element + * + * @lib AiXmlUiMain + */ +class TAiPolicyElement + { + +public: + + TAiPolicyElement(); + + TAiPolicyElement( CXnNodeAppIf& aTarget, const TDesC8& aPolicy ); + + CXnNodeAppIf& Target() const; + + TPtrC8 Name() const; + + TPtrC8 Value() const; + + TPtrC8 Policy() const; + +private: // data + + /** + * Target element for policy. Not own. + */ + CXnNodeAppIf* iTarget; + + /** + * Policy string + */ + TPtrC8 iPolicy; + + TInt iSeparator; + }; + +typedef RArray< TAiPolicyElement > RAiPolicyElementArray; + +} // namespace AiXmlUiController + +#endif // T_AIPOLICYELEMENT_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/aiuieventhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/aiuieventhandler.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,65 @@ +/* +* 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: Interface for handling UI events. +* +*/ + + +#ifndef M_AIUIEVENTHANDLER_H +#define M_AIUIEVENTHANDLER_H + + +namespace AiXmlUiController +{ + +/** + * Extension of the CAiContentPublisher interface, which allows Active Idle + * Framework to notify their plug-ins that they must to handle event. + * Plug-ins must provide implementation of interface only if they are + * supporting event model (e.g. provides possibility to manipulate with + * engine properties via UI). + * + * @lib AiXmlUiMain + */ +class MAiUiEventHandler + { +protected: + + /** + * Protected destructor prevents deletion through this interface. + */ + ~MAiUiEventHandler() { } + +public: // New functions + + /** + * Invoked by the framework when plug-in must handle an event. + * + * @param aEvent - event. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where is mapped by the framework to unique + * identifier suppied in aEvent, are provided to + * plug-in as-is in the descriptor. + * @return ETrue if event was handled by this handler. + */ + virtual TBool HandleUiEvent(TAny* aEvent, const TDesC8& aParam) = 0; + + }; + +} // namespace AiXmlUiController + +#endif // M_AIUIEVENTHANDLER_H + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/aixmluiconstants.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/aixmluiconstants.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,133 @@ +/* +* 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: XML UI specific UI definitions and constants +* +*/ + + +#ifndef AIXMLUICONSTANTS_H +#define AIXMLUICONSTANTS_H + +#include +#include + +namespace AiUiDef + { + namespace xml + { + namespace id + { + _LIT( KContentIdSeparator, "/" ); + _LIT( KSettingsIdSeparator, "/" ); + } + + namespace property + { + _LIT8( KClass, "class" ); + _LIT8( KType, "type" ); + _LIT8( KName, "name" ); + _LIT8( KValue, "value" ); + _LIT8( KLoadOrdinal, "load_ordinal" ); + _LIT8( KId, "id" ); + _LIT8( KUid, "uid" ); + _LIT8( KViewId, "viewid" ); + _LIT8( KMessageId, "messageid" ); + _LIT8( KMessage, "message" ); + } + + namespace propertyClass + { + _LIT8( KContentSource, "ContentSource" ); + _LIT( KSettings, "Settings" ); + } + namespace general + { + _LIT ( KGeneral, "General" ); + _LIT ( KDontOpenLogsOnSendKey, "DontOpenLogsOnSendKey" ); + } + namespace policy + { + _LIT8( KContent, "policy/Content" ); + _LIT8( KEmptyContent, "policy/emptyContent" ); + _LIT8( KResource, "policy/Resource" ); + _LIT8( KVisibilityPolicy, "policy/Visibility" ); + _LIT8( KContentChanged, "policy/ContentChanged" ); + _LIT8( KCondition, "if" ); + } // End of namespace policy + + namespace name + { + _LIT8( KOrdinal, "ordinal" ); + _LIT8( KPriority, "priority" ); + _LIT8( KTarget, "target" ); + + } // End of namespace name + + namespace value + { + _LIT8( KShowTooltips, "ShowTooltips" ); + } + + namespace event + { + _LIT8( KUiEventPrefix, "ui/" ); + _LIT8( KEventHandlerPrefix, "EventHandler/" ); + _LIT8( KFocusGained, "focusgained" ); + _LIT8( KSetElementSizeToCPS, "setelementsizetocps" ); + _LIT( KNewstickerTitleScrolled, "TitleScrolled" ); + _LIT( KNewstickerTitleToScroll, "TitleToScroll" ); + _LIT8( KEventShowHelp, "ShowHelp" ); + _LIT8( KEventSetOnline, "SetOnline" ); + _LIT8( KEventSetOffline, "SetOffline" ); + _LIT8( KEventLaunchApp, "LaunchApp"); + _LIT8( KEventActivateView, "ActivateView"); + _LIT8( KEventActivatePhoneView, "ActivatePhoneView"); + } + + namespace css + { + _LIT8( KSeparator, ":" ); + _LIT8( KValueTerminator, ";" ); + _LIT8( KPercentage, "%" ); + _LIT8( KPixel, "px" ); + _LIT8( KUnitValue, "u" ); + } + namespace element + { + _LIT8( KPlugin, "plugin" ); + _LIT( K16Plugin, "plugin" ); + _LIT8( KImage, "image" ); + _LIT8( KText, "text" ); + _LIT8( KConfiguration, "configuration" ); + _LIT8( KNewsTicker, "newsticker" ); + } + + } // End of namespace xml + + } // End of namespace AiUiDef + +#define KContentTypeText TPtrC8( reinterpret_cast< const TText8* >( KAiContentTypeText ) ) +#define KContentTypeBitmap TPtrC8( reinterpret_cast< const TText8* >( KAiContentTypeBitmap ) ) +_LIT8( KContentTypeImage, "image/" ); +_LIT8( KContentTypeImageSvg, "image/svg+xml" ); +_LIT( KTargetSliderVolumeValue, "slider::volume" ); +const TText KComma = ','; +const TText KLeftParenthesis = '('; +const TText KRightParenthesis = ')'; +const TText KNotOperator = '!'; +const TText KAndOperator = '+'; +const TText KWhiteSpace = ' '; + + +#endif // AIXMLUICONSTANTS_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/aixmluiutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/aixmluiutils.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,151 @@ +/* +* 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: Collection of common utility functions +* +*/ + + +#ifndef AIXMLUIUTILS_H +#define AIXMLUIUTILS_H + +#include + +class CXnNodeAppIf; +class CGulIcon; +class TAiPolicyElement; +class RPropertyHashMap; + +namespace AiXmlUiController + { + class CCssPropertyMap; + + +/** + * Finds a property element identified by the specified class. + * + * @param aUiElement the UI element associated with the property. + * @param aPropertyClass the class of the property. + * @return pointer array to the property elements. Ownership of the array + * is transferred. Ownership of the elements is not transferred. + */ +RPointerArray< CXnNodeAppIf > FindPropertyElementL( CXnNodeAppIf& aUiElement, + const TDesC8& aPropertyClass ); + +/** + * Finds a property element identified by the specified class. + * + * @param aArray The Array where to append the nodes. + * @param aUiElement the UI element associated with the property. + * @param aPropertyClass the class of the property. + * @return pointer array to the property elements. Ownership of the array + * is transferred. Ownership of the elements is not transferred. + */ +void FindPropertyElementL( RPointerArray< CXnNodeAppIf >& aArray, CXnNodeAppIf& aUiElement, const TDesC8& aPropertyClass ); + +/** + * Gets a property value from an UI element. The ownership of value is + * transferred to caller. + * + * @param aUiElement the UI element to fecth the value from + * @param aPropertyName the name of the property to fetch. + * @return the value or NULL. + */ +HBufC* PropertyValueL( const CXnNodeAppIf& aUiElement, + const TDesC8& aPropertyName ); + +/** + * Gets a property value from an UI element. + * + * @param aUiElement the UI element to fecth the value from + * @param aPropertyName the name of the property to fetch. + * @return the value or NULL. + */ +const TDesC8* PropertyValue( const CXnNodeAppIf& aUiElement, + const TDesC8& aPropertyName ); + +/** + * Sets a property value into an UI element + * + * @param aUiElement the UI element to set the value into. + * @param aPropertyName the name of the property to set. + * @param aPropertyValue the new value. + * @param aPropertyMap map of the original property values + */ +void SetPropertyL( CXnNodeAppIf& aUiElement, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + CCssPropertyMap& aPropertyMap ); + +/** + * Sets a property values into hash map + * + * @param aArray the element array. + * @param aPropertyMap map of the original property values + * @param aPropertyHashMap hash map of the new property value arrays + */ +void SetPropertiesToHashMapL( RArray& aArray, + CCssPropertyMap& aPropertyMap, + RPropertyHashMap& aPropertyHashMap ); + +/** + * Sets all property values into an UI element(s) + * + * @param aPropertyMap map of the property arrays + */ +void SetPropertyArraysL( RPropertyHashMap& aPropertyHashMap ); + +/** + * Sets a property value directly into an UI element + * + * @param aUiElement the UI element to set the value into. + * @param aPropertyName the name of the property to set. + * @param aPropertyValue the new value. + */ +void SetPropertyToNodeL( + CXnNodeAppIf& aNode, + const TDesC8& aPropertyName, + const TDesC8& aNewValueString ); + +/** + * Leaves with specific error if given pointer is null. + * + * @param aPtr pointer to test. + * @param aError error for leave. + * @return aPtr if it is not NULL. + */ +template< class PtrT > inline +PtrT* LeaveIfNull( PtrT* aPtr, TInt aError ); + +/** + * Loads a resource icon from the skin or from a mif-file + * and puts it into cleanup stack. + * + * Leavecodes: + * - KErrNotSupported: Filetype is not supported + * - KErrNotFound: Syntax is incorrect or icon not found + * + * Syntaxes: + * - Skin: SKIN( ) + * - Mif: file_name.mif# + * + * @param aResource resource node. + * @return icon. + */ +CGulIcon* LoadIconLC( CXnNodeAppIf& aResource ); + + } + +#include "aixmluiutils.inl" + +#endif // AIXMLUIUTILS_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/aixmluiutils.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/aixmluiutils.inl Thu Dec 17 08:40:49 2009 +0200 @@ -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: Inline utilities +* +*/ + + +// This is an utility which absolutely should be in euser lib / e32std.h! +template< class PtrT > inline +PtrT* AiXmlUiController::LeaveIfNull( PtrT* aPtr, TInt aError ) + { + if ( !aPtr ) + { + User::Leave( aError ); + } + + return aPtr; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/aixuikoneventhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/aixuikoneventhandler.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,176 @@ +/* +* 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: Used for handling XUIKON events +* +*/ + + +#ifndef C_EVENTHANDLER_H +#define C_EVENTHANDLER_H + +#include + +#include "xnvolumecontrolobserver.h" +#include "xnvolumecontrol.h" + +class CXnNodeAppIf; +class CXnProperty; +class MAiFwEventHandler; +class MAiStrParser; +class TXnUiEngineAppIf; +class CXnDomNode; + +namespace AiXmlUiController +{ + +class CXmlUiController; +class CContentRenderer; +class MAiUiEventHandler; +class MAiApplicationEventHandler; + +/** + * @ingroup group_xmluicontroller + * + * This class is used for handling XUIKON events. + * + * Events described in Content Model are handled in here. This class parses + * the events and decides what to do with them. Events are either consumed in + * UI or in case of a plug-in event forwarded to XML AI Framework for further + * processing. + * + * @lib AiXmlUiMain + */ +class CAIXuikonEventHandler : public CBase, + public MXnVolumeControlObserver + { +public: + + static CAIXuikonEventHandler* NewL(CXmlUiController& aXmlUiController, + CContentRenderer& aRenderer); + ~CAIXuikonEventHandler(); + + /** + * Handle interaction notification from XUIKON UI engine. + * + * @see CXnAppUiAdapter::HandleXuikonEventL + */ + void HandleXuikonEventL( CXnNodeAppIf& aOrigin, + CXnNodeAppIf& aTrigger, + CXnDomNode& aTriggerDefinition, + CXnDomNode& aEvent ); + + /** + * Set handler for plug-in events + * @param aPluginEventHandler Pointer to event handler + */ + void SetFwEventHandler( MAiFwEventHandler* aPluginEventHandler ); + + /** + * Set handler for UI events + * @param aUiEventHandler Pointer to event handler + */ + void SetUiEventHandler( MAiUiEventHandler* aUiEventHandler ); + + /** + * Set handler for application events + * @param aApplicationEventHandler Pointer to event handler + */ + void SetApplicationEventHandler( MAiApplicationEventHandler* + aApplicationEventHandler ); + +// from MXnVolumeControlObserver + + /** + * Called when volume value is changed. + */ + void VolumeChanged( TInt aValue ); + +private: + CAIXuikonEventHandler(CXmlUiController& aUiController, + CContentRenderer& aRenderer); + + void ConstructL(); + + TBool HandleSystemEventL( const TDesC8& aEventText, CXnDomNode& aEvent ); + + TBool HandleUiEventL( const TDesC8& aEventText, CXnNodeAppIf& aOrigin ); + + TBool HandleApplicationEventL( const TDesC8& aEventText ); + + void DispatchEventL( CXnDomNode& aEvent, + CXnNodeAppIf& aOrigin, + CXnDomNode& aTriggerDefinition ); + + void HandlePluginEventL( CXnDomNode& aEvent ); + + void ParseParameterStringL(const TDesC8& aSourcePtr, TPtrC8& aTargetPtr); + +private: // data + + class CNullEventHandler; + + /** + * String parser utility. Own. + */ + MAiStrParser* iStrParser; + + /** + * Reference to XML ui controller. + */ + CXmlUiController& iUiController; + + /** + * Reference to content renderer. + */ + CContentRenderer& iContentRenderer; + + /** + * Null event handler. + */ + CNullEventHandler* iNullEventHandler; + + /** + * Plug-in event handler. + * Doesn't own. + */ + MAiFwEventHandler* iFwEventHandler; + + /** + * UI event handler. + * Doesn't own. + */ + MAiUiEventHandler* iUiEventHandler; + + /** + * Application event handler. + * Doesn't own. + */ + MAiApplicationEventHandler* iApplicationEventHandler; + + /** + * Volume control event. + * Owned. + */ + HBufC* iVolumeEvent; + + /** + * Volume control interface. + * Not owned. + */ + XnVolumeControlInterface::MXnVolumeControlInterface* iVolumeControl; + }; + +} // namespace AiXmlUiController + +#endif // C_EVENTHANDLER_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/aixuikonmenueventhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/aixuikonmenueventhandler.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,223 @@ +/* +* 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 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/application.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/application.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,80 @@ +/* +* 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: Application +* +*/ + + +#ifndef C_APPLICATION_H +#define C_APPLICATION_H + +#include +#include "xnapplication.h" +#include "ai3.hrh" + +#ifdef FF_HOMESCREEN_COMMON_IDLEFW +const TUid KUidXmlUiApp = { AI_UID3_AIFW_EXE }; +#else +const TUid KUidXmlUiApp = { AI3_UID_EXE_TEST_APPLICATION }; +#endif // FF_HOMESCREEN_COMMON_IDLEFW + + +namespace AiXmlUiController +{ + +class CXmlUiController; + + +/** + * @ingroup group_xmluicontroller + * + * Application class of XML UI Controller application + * + * @lib AiXmlUiMain + */ +class CApplication : public CXnApplication + { + +public: // Constructors and destructor + + static CApplication* New(CXmlUiController& aUiCtl); + + virtual ~CApplication(); + +public: // Functions from base classes + + CApaDocument* CreateDocumentL(); + + virtual TUid AppDllUid() const; + + virtual TFileName ResourceFileName() const; + +private: + + CApplication(TUid aAppUid, CXmlUiController& aUiCtl); + +private: // Data + + /** + * UI Controller. Not own + */ + CXmlUiController& iUiCtl; + + }; + +} // namespace AiXmlUiController + +#endif // C_APPLICATION_H + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/appui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/appui.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,174 @@ +/* +* 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: App UI +* +*/ + + +#ifndef C_APPUI_H +#define C_APPUI_H + +#include +#include "xnappuiadapter.h" + + +class CAiUiIdleIntegration; +class MAiUiFrameworkObserver; + +namespace AiXmlUiController +{ +class CContentRenderer; +class CXmlUiController; +class CAIXuikonEventHandler; +class COnlineOfflineHelper; + +/** + * @ingroup group_xmluicontroller + * + * AppUI class of XML UI Controller application + * + * @lib AiXmlUiMain + */ +NONSHARABLE_CLASS( CAppUi ) : public CXnAppUiAdapter, + public MCoeViewActivationObserver + { +public: // Constructors and destructor + + static CAppUi* NewL( CXmlUiController& aUiCtl ); + + ~CAppUi(); + +public: + // new functions + CCoeEnv* CoeEnv() { return iCoeEnv; } + +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 ); + + void HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* aDestination ); + + void LoadDataPluginsL( RPointerArray< CXnNodeAppIf >& aList ); + + void DestroyDataPluginsL( RPointerArray< CXnNodeAppIf >& aList ); + + void SetOnlineStateL( RPointerArray< CXnNodeAppIf >& aList ); + + TBool DynInitMenuItemL( const TDesC& aItemType, + RPointerArray< CXnNodeAppIf >* aList = NULL ); + + void HandlePageSwitch(); + + void HandleEnterEditModeL( TBool aEnter ); + +private: + // new functions + void LoadNativeDataPluginsL(); + void DestroyNativeDataPluginsL(); + +private: + // from MCoeViewActivationObserver + + /** + * @see MCoeViewActivationObserver + */ + void HandleViewActivation( const TVwsViewId& aNewlyActivatedViewId, + const TVwsViewId& aViewIdToBeDeactivated ); + +public: + // new functions + + /** + * Sets plugins online state + * + * @since S60 5.0 + * @param aOnline ETrue to enter online, EFalse to offline + * + */ + void SetOnlineStateL( TBool aOnline ); + + /** + * Gets Ui controller + * + * @since S60 5.0 + * @return Ui Controller + */ + CXmlUiController& UiController() const; + +private: + // Constructors + + CAppUi( CXmlUiController& aUiCtl, TUid aAppUid ); + + void ConstructL(); + +private: + // data + + /** + * UI Controller implementation. Not own. + */ + 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. + */ + 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; + }; + +} // namespace AiXmlUiController + +#endif // C_APPUI_H + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/contentpublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/contentpublisher.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,144 @@ +/* +* 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: +* +*/ +/* +* ============================================================================== +* Name : contentpublisher.h +* Part of : +* Interface : Implemetation of CContentPublisher +* Description : +* Version : + +*/ + +#ifndef CONTENTPUBLISHER_H +#define CONTENTPUBLISHER_H + +#include +#include + +// FORWARD DECLARATIONS +class CLiwGenericParamList; +class CLiwServiceHandler; +class MLiwInterface; +class CAknGlobalConfirmationQuery; + +namespace AiXmlUiController +{ +class CXmlUiController; +class CGlobalQueryHandler; + + +/** + * @ingroup group_xmluicontroller + * + * Interface to publish data to Content Publishing Service + * + * @since S60 5.1 + */ +class CContentPublisher : public CBase, public MLiwNotifyCallback + { + public: + /** + * Two-phased constructor. + */ + static CContentPublisher* NewL(CXmlUiController& aUiController); + + /** + * Destructor. + */ + virtual ~CContentPublisher(); + + private: + CContentPublisher(CXmlUiController& aUiController); + void ConstructL(); + + public: //from MLiwNotifyCallbackc + + /** + * Handles notifications caused by an asynchronous Execute*CmdL call + * or an event. + * + * @param aCmdId The service command associated to the event. + * @param aEventId occurred event, see LiwCommon.hrh. + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL. + * @return Error code for the call back. + */ + virtual TInt HandleNotifyL( + TInt aCmdId, + TInt /*aEventId*/, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/); + + public: // New functions + + /** + * Sets given values to Content Publisher Service. + * @since Series 60 5.1 + * @param aElementName The name of the element, which values are set. + * @param aWidth Width of the element + * @param aHeight Height of the element + */ + void PublishSizeL( const TDesC& aElementName, + TInt aWidth, TInt aHeight ); + + private: + + void InitCpsInterfaceL(); + void AddDataL( const TDesC& aPublisherId, + const TDesC& aContentType, const TDesC& aContentId, + const TInt aData1, const TDesC8& aDataKey1, + const TInt aData2, const TDesC8& aDataKey2 ); + + void GetDataL( const TDesC& aPublisherId, const TDesC& aContentType, + const TDesC& aContentId, CLiwDefaultMap* aOutDataMap); + + void HandlePublisherInfoL( const TDesC& aPubInfo); + 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; + + /** + * Reference to XML ui controller. + */ + CXmlUiController& iUiController; + + CGlobalQueryHandler* iGlobalQueryHandler; + CAknGlobalConfirmationQuery* iGlobalConfirmationQuery; + + }; + +}// namespace AiXmlUiController +#endif //CONTENTPUBLISHER_H + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/contentrenderer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/contentrenderer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,297 @@ +/* +* 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: MAiContentObserver implementation for XML UI controller +* +*/ + + +#ifndef C_CONTENTRENDERER_H +#define C_CONTENTRENDERER_H + +#include +#include +#include "xnnewsticker.h" +#include "aicontentobserver.h" + +class TXnUiEngineAppIf; +class CXnNodeAppIf; +class CGulIcon; +class MAiFwEventHandler; +struct TAiPublisherInfo; + +namespace AiUtility + { + class CContentPriorityMap; + } + +namespace AiXmlUiController + { + class CActiveTransactionStack; + class CTransactionFactoryImpl; + class MTransactionElement; + class MTransaction; + class CAppUi; + class CXmlNodeIdGenerator; + class CNewstickerCallbackHandler; + class CCssPropertyMap; + class CPolicyEvaluator; + class TAiPolicyElement; + } + + +namespace AiXmlUiController +{ + +/** +* @ingroup group_xmluicontroller +* +* CContentRenderer renders the content of the content publisher plug-ins +* +* @lib AiXmlUiMain +*/ +class CContentRenderer : public CBase, + public MAiContentObserver, + public XnNewstickerInterface::MXnNewstickerCallbackInterface + { +public: // Constructors and destructor + + static CContentRenderer* NewL( CAppUi& aAppUi ); + + virtual ~CContentRenderer(); + + /** + * Sets event handler. + * + * @param aFwEventHandler the event handler to use. + */ + void SetEventHandler( MAiFwEventHandler& aFwEventHandler ); + + /** + * Resets content renderer for new theme. + */ + void Reset(); + + /** + * Cleans all content items published by aPlugin. + */ + void CleanPluginFromUi( MAiPropertyExtension& aPlugin ); + +// Functions from MAiContentObserver + + TInt StartTransaction( TInt aTxId ); + + TInt Commit( TInt aTxId ); + + TInt CancelTransaction( TInt aTxId ); + + TBool CanPublish( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aIndex ); + + TInt Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aResource, + TInt aIndex ); + + TInt Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC16& aText, + TInt aIndex ); + + TInt Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC8& aBuf, + TInt aIndex ); + + TInt Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + RFile& aFile, + TInt aIndex ); + + TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); + + TAny* Extension( TUid aUid ); + + TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const; + +private: + + CContentRenderer( CAppUi& aAppUi ); + + void ConstructL(); + + void DoStartTransactionL( TInt aTxId ); + + TInt CanPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aIndex ); + + TInt DoPublishL( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aResource, + TInt aIndex); + + TInt DoPublishL( MAiPropertyExtension& 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 ); + + void SetImmediateMode( TBool aImmediateMode ); + + TBool IsImmediateMode() const; + + void ProcessTransactionElementL( MTransactionElement* aElement ); + + CXnNodeAppIf* FindNodeByClassL( const TDesC& aCid, + TInt aIndex, + const TDesC8& aNs ); + + CXnNodeAppIf* FindNodeByIdL( const TDesC& aCid, const TDesC& aNs = KNullDesC ); + + CXnNodeAppIf* FindNodeByIdL( const TDesC8& aCid, const TDesC8& aNs = KNullDesC8 ); + + TInt PublishIconL( MAiPropertyExtension& 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 ); + + TBool AllowPublishByPriority( CXnNodeAppIf& aUiElement, + TInt aNewPriority ) const; + + void StartContentRefresh(); + + TInt RefreshContentL( HBufC* aUiElementId, + TInt aOldPriority ); + + static TInt RefreshContentCallback( TAny* aContentRenderer ); + + void SendRefreshContentEventL(); + + TBool IsParentNewsticker( CXnNodeAppIf& aTarget ); + + void RegisterNewstickerCallbackInterfaceL( CXnNodeAppIf& aTarget ); + +// 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; + + /** + * 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. + */ + 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. + */ + CPolicyEvaluator* iPolicyEvaluator; + + }; + +} // namespace AiXmlUiController + +#endif // C_CONTENTRENDERER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/csspropertymap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/csspropertymap.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,87 @@ +/* +* 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: Utility for caching CSS property values +* +*/ + + +#ifndef C_CSSPROPERTYMAP_H +#define C_CSSPROPERTYMAP_H + + +#include +#include + +class CXnProperty; +class CXnDomPropertyValue; + +namespace AiXmlUiController +{ + +typedef RPtrHashMap< TDesC8, CXnDomPropertyValue > RDomPropertyValueMap; +typedef RPtrHashMap< TDesC8, RDomPropertyValueMap > RElementMap; + + +/* + * @ingroup group_xmluicontroller + * + * Utility for storing CSS property values. + * + * @lib AiXmlUiMain + */ +class CCssPropertyMap : public CBase + { + +public: + + static CCssPropertyMap* NewL(); + + virtual ~CCssPropertyMap(); + + /** + * Stores property value. + * + * @param aElementId Ui element id to associate property value with + * @param aProperty property to store + */ + + void StorePropertyValueL( const TDesC8& aElementId, CXnProperty& aProperty ); + + /** + * Finds property value. + * + * @param aElementId Ui element Id to associate property value + * @param aName property name for lookup + * @return property value or NULL. + */ + CXnDomPropertyValue* FindPropertyValue( const TDesC8& aElementId, const TDesC8& aName ); + + void Reset(); + +private: + + CCssPropertyMap(); + +private: // data + + /** + * Hashmap of element specific property value maps. Own. + */ + RElementMap iElementMap; + + }; + +} // namespace AiXmlUiController + +#endif // C_CSSPROPERTYMAP_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/databuffertransactionelement.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/databuffertransactionelement.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,99 @@ +/* +* 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: Data buffer transaction +* +*/ + + +#ifndef C_DATABUFFERTRANSACTIONELEMENT_H +#define C_DATABUFFERTRANSACTIONELEMENT_H + +#include "transactionelement.h" + +namespace AiUtility + { + class CContentPriorityMap; + } + +class CXnNodeAppIf; + +namespace AiXmlUiController +{ + +/** + * @ingroup group_xmluicontroller + * + * CDataBufferTransactionElement corresponds one text content publishing operation. + * + * @lib AiXmlUiMain + */ +class CDataBufferTransactionElement : public CTransactionElement + { +public: // Constructors and destructor + + static CDataBufferTransactionElement* + NewL( AiUtility::CContentPriorityMap& aContentPriorityMap ); + + virtual ~CDataBufferTransactionElement(); + +// New functions + + /** + * Initializes this transaction element to publish content aData + * to node aTarget. + * + * @param aTarget - the target of publishing. + * @param aData - the content. + */ + void InitializeL(CXnNodeAppIf& aTarget, const TDesC8& aData); + + /** + * Checks if given content type is supported by target ui element. + * + * @param aTarget target ui element. + * @param aContentType content type + * @return ETrue if content type is supported + */ + static TBool IsSupported( CXnNodeAppIf& aTarget, + const TDesC8& aContentType ); + +// Functions from CTransactionElement + + void Reset(); + + void UpdateDataL(); + +private: + + CDataBufferTransactionElement( + AiUtility::CContentPriorityMap& aContentPriorityMap ); + + void CheckTypeL( CXnNodeAppIf& aTarget ); + + void SetDataL(); + +private: // Data + + /** + * New content. + */ + TPtrC8 iNewData; + + }; + +} // namespace AiXmlUiController + +#endif // C_TEXTTRANSACTIONELEMENT_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/document.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/document.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,63 @@ +/* +* 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: Document +* +*/ + + +#ifndef C_DOCUMENT_H +#define C_DOCUMENT_H + +#include "xndocument.h" + +namespace AiXmlUiController +{ + +class CXmlUiController; + +/** + * @ingroup group_xmluicontroller + * + * Document class of XML UI Controller application. + * + * @lib AiXmlUiMain + */ +class CDocument : public CXnDocument + { + +public: // Constructors and destructor + + static CDocument* NewL(CEikApplication &aApp, CXmlUiController& aUiCtl); + + virtual ~CDocument(); + +public: // Functions from CXnDocument + + CEikAppUi* CreateAppUiL(); + +private: + + CDocument(CEikApplication &aApp, CXmlUiController& aUiCtl); + +private: // Data + + CXmlUiController& iUiCtl; + + }; + +} // namespace AiXmlUiController + +#endif // C_DOCUMENT_H + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/dynamicthememodifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/dynamicthememodifier.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 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: This file contains the header file of the CDynamicThemeModifier class. +* +*/ + + +#ifndef __DYNAMICTHEMEMODIFIER_H__ +#define __DYNAMICTHEMEMODIFIER_H__ + +// INCLUDES +#include +#include +#include +//#include +//#include +//#include +//#include + + +//class MAiPSPropertyObserver; + +namespace AiXmlUiController +{ + +// CLASS DECLARATION + +/** +* This class updates the theme dynamically as it is being somehow modified. +* +* It connects to XUIKON Content Access API and modifies e.g. NT visibility +* in theme level as user changes appropriate setting in GS. Appropriate CenRep +* keys are being observed and theme modifications are launched based on changes +* in those keys. +* +* @since S60 3.2 +*/ +class CDynamicThemeModifier : public CBase, + public MCenRepNotifyHandlerCallback, + public MXnThemeManagementServiceObserver, + public MXnContentAccessServiceObserver, + public MXnClientRequestServiceObserver + + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CDynamicThemeModifier* NewL(); + + /** + * Destructor. + */ + ~CDynamicThemeModifier(); + + + private: + + /** + * C++ default constructor. + */ + CDynamicThemeModifier(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + + private: // New methods + + /** + * Load AI2 themes. + */ + void LoadThemesL(); + + /** + * Load settings from active theme. + */ + void LoadSettingsFromThemeL(); + + /** + * Handle NT visibility in theme. + * @param ETrue for showing NewsTicker, EFalse for hiding it. + */ + void EnableNewsTickerL( TBool aEnabled ); + + + private: // From base classes + + void HandleXnClientMessage( TXnServiceCompletedMessage aMessage ); + void HandleXnRequestClientMessage( TXnServiceCompletedMessage /*aMessage*/ ) {}; + void XnSettingsUpdated() {}; + void HandleNotifyInt( TUint32 aId, TInt aNewValue ); + + + + private: // Data + + CArrayPtrFlat* iThemeArray; + CXnClient* iXnClient; + CXnContentAccessClient* iXnContentAccessClient; + CXnRequestClient* iXnRequestClient; + CXnResult* iXnResult; + CXnDomDocument* iDomDocument; + CXnODT* iOdt; + CRepository* iNTCenRep; + CRepository* iAiCenRep; + CCenRepNotifyHandler* iNTCenRepObserver; + TInt iNumberOfHeaders; + TInt iEnabledInCenRep; + + }; + +} // namespace + +#endif // __DYNAMICTHEMEMODIFIER_H__ + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/emptycontenttransactionelement.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/emptycontenttransactionelement.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,77 @@ +/* +* 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: Transaction element for publishing empty content +* +*/ + + +#ifndef C_EMPTYCONTENTTRANSACTIONELEMENT_H +#define C_EMPTYCONTENTTRANSACTIONELEMENT_H + +#include "transactionelement.h" + +namespace AiUtility + { + class CContentPriorityMap; + } + +namespace AiXmlUiController +{ + +/** + * @ingroup group_xmluicontroller + * + * Transaction element for publishing empty content to UI element. + * Empty content is published by applying empty content policy + * + * @lib AiXmlUiMain + */ +class CEmptyContentTransactionElement : public CTransactionElement + { + +public: + + static CEmptyContentTransactionElement* + NewL( AiUtility::CContentPriorityMap& aContentPriorityMap ); + + virtual ~CEmptyContentTransactionElement(); + + /** + * Initializes this element to publish into the given UI element. + * + * @param aTarget target UI element. + * @param aIndex Newsticker title index to clean + */ + void InitializeL( CXnNodeAppIf& aTarget, + TInt aIndex ); + +protected: // from base class CTransactionElement + + void Reset(); + + void UpdateDataL(); + +private: + + CEmptyContentTransactionElement( + AiUtility::CContentPriorityMap& aContentPriorityMap ); + + // Index for newsticker title to clean. + TInt iIndex; + + }; + +} // namespace AiXmlUiController + +#endif // C_EMPTYCONTENTTRANSACTIONELEMENT_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/globalqueryhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/globalqueryhandler.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,93 @@ +/* +* 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: Global query active object +* +*/ + +#ifndef GLOBALQUERYHANDLER_H +#define GLOBALQUERYHANDLER_H + +#include + +// FORWARD DECLARATIONS +namespace AiXmlUiController +{ +class CXmlUiController; + +/** + * Active object class to handle global query presses. + */ +class CGlobalQueryHandler : public CActive + { + +public: + /** + * @param Reference to CXmlUiController which SetPluginsOnline function is called when user accepts query + */ + static CGlobalQueryHandler* NewL(CXmlUiController& aUiController); + + /** + * + */ + ~CGlobalQueryHandler(); + + /** + * Value of the SetPluginsOnline when user accepts query. + * Activates this active object + * @param aOnline value of the function call, ETrue/EFalse. + */ + void SetOnlineParamAndActivate(TBool aOnline); + +private: + /** + * @param Reference to CXmlUiController which SetPluginsOnline function is called when user accepts query + */ + CGlobalQueryHandler(CXmlUiController& aUiController); + + /** + * + */ + void ConstructL(); + +private: // from CActive + /** + * From CActive + */ + void RunL(); + + /** + * From CActive + */ + void DoCancel(); + +private: // data + /** + * Controller, which is used when query is accepted + */ + CXmlUiController& iUiController; + + /** + * Value of the CXmlUiController::SetPluginsOnline function call when user accepts query + */ + TBool iSetOnline; + }; + + +}// namespace AiXmlUiController +#endif //CONTENTPUBLISHER_H + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/imagetransactionelement.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/imagetransactionelement.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,103 @@ +/* +* 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: Image transaction element +* +*/ + + +#ifndef C_IMAGETRANSACTIONELEMENT_H +#define C_IMAGETRANSACTIONELEMENT_H + +#include "transactionelement.h" + +class CGulIcon; +class CXnNodeAppIf; +class RFile; + +namespace AiUtility + { + class CContentPriorityMap; + } + +namespace AiXmlUiController +{ +class CKamikazeImageDecoder; + +/** + * @ingroup group_xmluicontroller + * + * CImageTransactionElement is a transaction element for publishing images. + * + * @lib AiXmlUiMain + */ +class CImageTransactionElement : public CTransactionElement + { + +public: + + static CImageTransactionElement* + NewL( AiUtility::CContentPriorityMap& aContentPriorityMap ); + + virtual ~CImageTransactionElement(); + + /** + * Initializes this transaction element. + * + * @param aTarget the node to publish bitmap and mask. + * @param aIcon the icon to publish. Ownership is transferred. + */ + void InitializeL(CXnNodeAppIf& aTarget, CGulIcon* aIcon ); + + /** + * Initializes this transaction element from file. + * + * @param aTarget the node to publish bitmap. + * @param aFile the open file handle to read bitmap data. + */ + void InitializeL(CXnNodeAppIf& aTarget, + RFile& aFile); + + static TBool IsSupported( CXnNodeAppIf& aTarget ); + + void Reset(); + + void UpdateDataL(); + + +private: + + CImageTransactionElement( AiUtility::CContentPriorityMap& aContentPriorityMap ); + + void CheckTypeL( CXnNodeAppIf& aTarget ); + +private: // data + + + /** + * Icon to be published. + * Own. + */ + CGulIcon* iNewIcon; + + /** + * Asynchronous image decoder. Executed and + * self destroyed when decoding is ready. Not own. + */ + CKamikazeImageDecoder* iImageDecoder; + + }; + +} // namespace AiXmlUiController + +#endif // C_IMAGETRANSACTIONELEMENT_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/mpscallback.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/mpscallback.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2005-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: Callback for Publish & Subscribe observation +* +*/ + + +#ifndef M_PSCALLBACK_H +#define M_PSCALLBACK_H + +#include + +namespace AiXmlUiController +{ + +class MPSCallback + { + public: + + /** + * Callback method for P&S observer. + * Called when appropriate value has been updated. + * @param aKey Key that has been observed. + * @param aValue New Value + */ + virtual void ValueUpdatedL( TInt aKey, TInt aValue ) = 0; + + protected: + + /** + * Protected destructor prevents deletion through this interface. + */ + MPSCallback() {}; + }; + +} // namespace AiXmlUiController + +#endif // M_PSCALLBACK_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/mtransaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/mtransaction.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,108 @@ +/* +* 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: Transaction base class +* +*/ + + +#ifndef M_TRANSACTION_H +#define M_TRANSACTION_H + +#include + + +inline TUint32 NodeHash(const TAny* aPtr) + { + return (TUint32)aPtr; + }; + +inline TBool NodeRelation(const TAny* aPtr1, const TAny* aPtr2) + { + return aPtr1 == aPtr2; + }; + +// Default functions for xnnode type + +TEMPLATE_SPECIALIZATION class RHashTableBase::Defaults< + CXnNodeAppIf, + RHashTableBase::EDefaultSpecifier_Normal> + { +public: + inline static TGeneralHashFunction32 Hash(); + inline static TGeneralIdentityRelation Id(); + }; + +inline TGeneralHashFunction32 RHashTableBase::Defaults< + CXnNodeAppIf, + RHashTableBase::EDefaultSpecifier_Normal>::Hash() + {return (TGeneralHashFunction32)&NodeHash;} + +inline TGeneralIdentityRelation RHashTableBase::Defaults< + CXnNodeAppIf, + RHashTableBase::EDefaultSpecifier_Normal>::Id() + {return (TGeneralIdentityRelation)&NodeRelation;} + + +namespace AiXmlUiController +{ + +class CTransactionElement; +class MTransactionElement; +class MTransactionFactory; + +typedef RPointerArray RPropertyArray; + +typedef RPtrHashMap RPropertyHashMap; + +/** + * MTransaction represents a transaction of publish operations. + * + * @lib AiXmlUiMain + */ +class MTransaction + { + +public: + + /** + * Appends a transaction element in this transaction. + * + * @param aElement the transaction element + */ + virtual void Append(MTransactionElement& aElement) = 0; + + /** + * Commits this transaction by committing all transaction elements. + * + * @param [out] aLayoutChanged true if UI layout changes + */ + virtual void CommitL( TBool& aLayoutChanged, RPropertyHashMap& aPropertyHashMap ) = 0; + + /** + * Resets this transaction for reuse. + * + * @param aFactory the factory which created this transaction + */ + virtual void Reset(MTransactionFactory& aFactory) = 0; + + virtual TDblQueIter ElementIter() = 0; +protected: + + ~MTransaction() {}; + + }; + +} // namespace AiXmlUiController + +#endif // M_UPDATETRANSACTION_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/mtransactionelement.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/mtransactionelement.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,95 @@ +/* +* 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: Transaction element base class +* +*/ + + +#ifndef M_TRANSACTIONELEMENT_H +#define M_TRANSACTIONELEMENT_H + +#include +#include "aipolicyelement.h" +#include "transaction.h" + + +namespace AiXmlUiController +{ + +/** + * MTransactionElement declatres the public interface for transaction elements. + * MTransactionElement corresponds one publish operation within a + * transaction scope. + * + * @lib AiXmlUiMain + */ +class MTransactionElement + { +public: // New functions + + /** + * Commits the publish operation and actually updates the UI control/element. + * + * @param [out] aLayoutChanged true if UI layout changes + * @see UpdateDataL() + * @see ApplyPublishingPolicy() + */ + void CommitL( TBool& aLayoutChanged, RPropertyHashMap& aPropertyHashMap ); + + /** + * Resets the transaction element and clears the references to content + * and UI control/element. + * + */ + virtual void Reset() = 0; + + /** + * Returns the array of associated content policy elements. + * + */ + virtual RAiPolicyElementArray& PolicyArray() = 0; + + /** + * Return the target UI element for this transaction element + */ + virtual CXnNodeAppIf& Target() const = 0 ; + +protected: // New functions + + /** + * Updates UI control / element data. + * + * @since S60 3.2 + */ + virtual void UpdateDataL() = 0; + + /** + * Applies current publishing policy to UI control / element. + * + * @param [out] aLayoutChanged true if UI layout changes + */ + virtual void ApplyPublishingPolicy( TBool& aLayoutChanged, + RPropertyHashMap& aPropertyHashMap ) = 0; + +protected: // Constructors and destructor + + ~MTransactionElement() {}; + + }; + +} // namespace AiXmlUiController + +#endif // M_TRANSACTIONELEMENT_H + +// End of File \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/newstickercallbackhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/newstickercallbackhandler.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,94 @@ +/* +* 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: Callback handler of newsticker component callbacks +* +*/ + + +#ifndef C_NEWSTICKERCALLBACKHANDLER_H +#define C_NEWSTICKERCALLBACKHANDLER_H + + +#include + +class MAiFwEventHandler; + +namespace AiXmlUiController +{ + +/** + * @ingroup group_xmluicontroller + * + * Helper class to handle newsticker component callbacks. + * + * @lib AiXmlUiMain + */ +class CNewstickerCallbackHandler : public CBase + { + +public: + + static CNewstickerCallbackHandler* NewLC( MAiFwEventHandler& aFwEventHandler ); + + virtual ~CNewstickerCallbackHandler(); + + /** + * Sends TitleScrolled event to newsticker plugin + * + * @param aPublisherName Plugin name + * @param aPublishingClass content selector + * @param aIndex Index of the scrolled title + */ + void TitleScrolledL( const TDesC& aPublisherName, + const TDesC& aPublishingClass, + TInt aIndex ); + + /** + * Sends TitleToScroll event to newsticker plugin + * + * @param aPublisherName Plugin name + * @param aPublishingClass content selector + * @param aIndex Index of the scrolled title + */ + void TitleToScrollL( const TDesC& aPublisherName, + const TDesC& aPublishingClass, + TInt aIndex ); + +private: + + CNewstickerCallbackHandler( MAiFwEventHandler& aFwEventHandler ); + + void SendEventToNewstickerPluginL( const TDesC& aEvent, + const TDesC& aPublisherName, + const TDesC& aPublishingClass, + TInt aIndex); + +private: // data + + /** + * Event handler for events + */ + MAiFwEventHandler& iFwEventHandler; + + /** + * Event buffer. + * Own. + */ + HBufC* iEventBuffer; + + }; + +} // namespace AiXmlUiController + +#endif // C_NEWSTICKERCALLBACKHANDLER_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/newstickertransactionelement.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/newstickertransactionelement.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,112 @@ +/* +* 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: News ticker transaction element +* +*/ + + +#ifndef C_NEWSTICKERTRANSACTIONELEMENT_H +#define C_NEWSTICKERTRANSACTIONELEMENT_H + +#include "transactionelement.h" + + +namespace AiUtility + { + class CContentPriorityMap; + } + +class CXnNodeAppIf; + +namespace AiXmlUiController +{ + +/** + * @ingroup group_xmluicontroller + * + * CNewTickerTransactionElement corresponds news ticker content publishing operation. + * + * @lib AiXmlUiMain + */ +class CNewsTickerTransactionElement : public CTransactionElement + { +public: // Constructors and destructor + + static CNewsTickerTransactionElement* + NewL( AiUtility::CContentPriorityMap& aContentPriorityMap ); + + virtual ~CNewsTickerTransactionElement(); + +// New functions + + /** + * Initializes this transaction element to publish text content aText + * to text interface of node aTarget. + * + * @param aTarget - the target of publishing. + * @param aText - the text content. + * @param aIndex - index of the news ticker element to be updated + */ + void InitializeL(CXnNodeAppIf& aTarget, const TDesC& aText, TInt aIndex); + + /** + * @return ETrue if aTarget node is supported + */ + static TBool IsSupported( CXnNodeAppIf& aTarget ); + + /** + * from CTransactionElement + */ + void Reset(); + + /** + * from CTransactionElement + */ + void UpdateDataL(); + +private: // New methods + + /** + * constructor + */ + CNewsTickerTransactionElement( AiUtility::CContentPriorityMap& aContentPriorityMap ); + + /** + * + */ + void CheckTypeL( CXnNodeAppIf& aTarget ); + /** + * + */ + void SetTextL(); + +private: // Data + + /** + * New text content. + */ + TPtrC iNewText; + + /** + * Index of the news ticker element to be updated + */ + TInt iIndex; + + }; + +} // namespace AiXmlUiController + +#endif // C_NEWSTICKERTRANSACTIONELEMENT_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/onlineofflinehelper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/onlineofflinehelper.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,233 @@ +/* +* 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: Helper for online/offline state handling +* +*/ + +#ifndef ONLINEOFFLINEHELPER_H +#define ONLINEOFFLINEHELPER_H + +#include +#include +#include +#include + +// Forward declrations +class CNWSession; +class CProfileChangeNotifyHandler; +class CXnNodeAppIf; + +namespace AiXmlUiController +{ +// Forward declrations +class CXmlUiController; + +// Classe declaration + + +/** + * Online/offline state helper + * + * @ingroup group_aixmluimain + * @lib ai3xmluimain.lib + * @since S60 5.0 + */ + +class COnlineOfflineHelper : public CBase, + public MNWMessageObserver, public MProfileChangeObserver + { +public: + // Constructors + + /** + * Two-phased constructor. + */ + static COnlineOfflineHelper* NewL( CXmlUiController& aUiCtl ); + +public: + // Destructor + + ~COnlineOfflineHelper(); + +private: + /* + * C++ default constructor + */ + COnlineOfflineHelper( CXmlUiController& aUiCtl ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + +public: + // New functions + + /* + * Determines if online menuitem can be shown + * + * @since S60 5.0 + * @return ETrue if item can be shown, EFalse otherwise + */ + TBool ShowOnlineItem() const; + + /* + * Determines if offline menuitem can be shown + * + * @since S60 5.0 + * @return ETrue if item can be shown, EFalse otherwise + */ + 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 + * @param aOnline ETrue to set online, EFalse to offline + */ + void ProcessOnlineStateL( TBool aOnline ); + +private: + // from MNWMessageObserver + + /** + * From MNWMessageObserver. + * Called by network handling engine when network info changes. + * + * @since S60 5.0 + * @param aMessage is type of the change. + */ + void HandleNetworkMessage( const TNWMessages aMessage ); + + /** + * From MNWMessageObserver. + * Called if network handling engine fails. + * + * @since S60 5.0 + * @param aOperation is failed operation. + * @param aErrorCode is fail reason. + */ + void HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode ); + +private: + // from MProfileChangeObserver + + /** + * Called when active profile changes. + * + * @since S60 5.0 + * @param aProfileEvent Profile event. + * @param aProfileId New profile id. + */ + void HandleActiveProfileEventL( TProfileEvent aProfileEvent, TInt aProfileId ); + +private: + // New functions + + TBool HasNetworkInfoChanged( const TNWMessages aMsg ); + void InterpretNWMessageL( const TNWMessages aMessage, const TNWInfo ); + + void SetOnlineL( TBool aOnline ); +private: + // Data types + + /** + * Network related message flags + */ + enum TNetInfoFlags + { + ENetworkProviderNameReceived = 0x00000001, + ENetworkProviderNameOk = 0x00000002, + EServiceProviderNameReceived = 0x00000004, + EServiceProviderNameOk = 0x00000008, + ERegistrationStatusReceived = 0x00000010, + ENetworkInfoChangeReceived = 0x00000020, + EProgrammableOperatorInfoReceived = 0x00000040, + EProgrammableOperatorInfoReceivedOk = 0x00000080 + }; + + enum + { + EOnline, + EUtilizeOnline, + ERoamingShown, + EOfflineProfile + }; +private: + // data + + /** + * UI controller + * Not own + */ + CXmlUiController& iUiCtl; + + /** + * Session to network handling engine. + * Own. + */ + CNWSession* iSession; + + /** + * Profile change handler. + * Own. + */ + CProfileChangeNotifyHandler* iHandler; + + /** + * Cached network info structure. + */ + TNWInfo iInfo; + + /** + * Previous network information. + */ + TNWInfo iOldInfo; + + /** + * Subset of sum of TNetInfoFlags. + */ + TUint iReceivedMessageFlags; + + /** + * Subset of sum of old TNetInfoFlags. + */ + TUint iOldReceivedMessageFlags; + + /** + * current state of network + */ + TNWRegistrationStatus iCurrentNwStatus; + + /** + * Flags + */ + TBitFlags32 iFlags; + }; + +}// namespace AiXmlUiController +#endif //ONLINEOFFLINEHELPER_H + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/pmodtiterator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/pmodtiterator.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ODT iterator. +* +*/ + + + +#ifndef C_PMODTITERATOR_H +#define C_PMODTITERATOR_H + +// INCLUDES +#include + + +// FORWARD DECLARATIONS +class CXnNodeAppIf; + + +// CLASS DECLARATION + +/** +* @ingroup group_xmluicontroller +* +* Depth iterator walks through the dom tree using the depth first +* principle. +* +* @lib presentationmanager.lib +* @since S60 v5.0 +*/ +class CPmODTIterator: public CBase + { + public: + static CPmODTIterator* NewL( CXnNodeAppIf& aRootNode ); + + virtual ~CPmODTIterator(); + + public: + + /** + * Returns the first node of the dom tree. + * + * @since S60 v5.0 + * @return First node. + */ + CXnNodeAppIf* First(); + + /** + * Returns the next node according to depth first principle. + * + * @since S60 v5.0 + * @return Next node. + */ + CXnNodeAppIf* NextL(); + + /** + * Skips the current node branch and returns next sibling + * or parent's sibling. Returns NULL if no nodes left. + * + * @since S60 v5.0 + * @return Sibling node. + */ + CXnNodeAppIf* SkipBranchL(); + + private: + + CPmODTIterator( CXnNodeAppIf& aRootNode ); + + void ConstructL(); + + /** + * Push node to stack. + * @param aNode Node to push + */ + void PushL( CXnNodeAppIf& aNode ); + + /** + * Pop node from the stack. + * @return Pointer to node + */ + CXnNodeAppIf* Pop(); + + private: + /** + * Follow tree hierarchy with stack + * Own. + */ + RPointerArray iDepthLevel; + + /** + * First node + * Own. + */ + CXnNodeAppIf* iFirst; + + /** + * Current node. + * Own. + */ + CXnNodeAppIf* iCurrent; + + }; + +#endif // C_PMODTITERATOR_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/policyevaluator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/policyevaluator.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,122 @@ +/* +* 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: Policy evaluator +* +*/ + + +#ifndef C_POLICYEVALUATOR_H +#define C_POLICYEVALUATOR_H + + +#include +#include "aipolicyelement.h" + +class CXnNodeAppIf; + +namespace AiXmlUiController +{ + + +/** + * @ingroup group_xmluicontroller + * + * Policy evaluator class + * + * @lib AiXmlUiMain + */ +class CPolicyEvaluator : public CBase + { + +public: + + static CPolicyEvaluator* NewL(); + + virtual ~CPolicyEvaluator(); + + /** + * Evaluates content policy for ui element. + * + * @param aTarget target ui element + * @param aPolicyArray array of found policies to fill + * @leave + */ + void EvaluateContentPolicyL( CXnNodeAppIf& aTarget, + RAiPolicyElementArray& aPolicyArray ); + + /** + * Evaluates empty content policy for ui element. + * + * @param aTarget target ui element + * @param aPolicyArray array of found policies to fill + * @leave + */ + void EvaluateEmptyContentPolicyL( CXnNodeAppIf& aTarget, + RAiPolicyElementArray& aPolicyArray ); + + /** + * Evaluates Visiblity policy for ui element. + * + * @param aTarget target ui element + * @param aResource resource element to publish + * @param aPolicyArray array of found policies to fill + * @leave + */ + void EvaluateVisibilityPolicyL( CXnNodeAppIf& aTarget, + RAiPolicyElementArray& aPolicyArray ); + + /** + * Evaluates ContentChanged policy for ui element. + * + * @param aTarget target ui element + * @param aResource resource element to publish + * @param aPolicyArray array of found policies to fill + * @leave + */ + void EvaluateContentChangedPolicyL( CXnNodeAppIf& aTarget, + RAiPolicyElementArray& aPolicyArray ); + + /** + * Evaluates resource policy for ui element. + * + * @param aTarget target ui element + * @param aResource resource element to publish + * @param aPolicyArray array of found policies to fill + * @leave + */ + void EvaluateResourcePolicyL( CXnNodeAppIf& aTarget, + CXnNodeAppIf& aResource, + RAiPolicyElementArray& aPolicyArray ); +private: + + CPolicyEvaluator(); + + void ConstructL(); + + void EvaluatePolicyL( CXnNodeAppIf& aTarget, + RAiPolicyElementArray& aPolicyArray, + const TDesC8& aPolicyClass ); + + TBool MatchCondition( const TDesC8& aId, + const TDesC8& aCondition ); + + TBool MatchVisibilityConditionL( const TDesC8& aCondition, + CXnNodeAppIf& aProperty, + RAiPolicyElementArray& aPolicyArray ); + + }; + +} // namespace AiXmlUiController + +#endif // C_POLICYEVALUATOR_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/psobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/psobserver.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Observer for changes in Publish & Subscribe keys +* +*/ + + +#ifndef C_PSOBSERVER_H +#define C_PSOBSERVER_H + +#include +#include + + +namespace AiXmlUiController +{ + +class MPSCallback; + +/** +* @ingroup group_xmluicontroller +* +* Observer for changes in Publish & Subcribe keys +* +* @lib AiXmlUiMain +*/ +class CPSObserver : public CActive + { + public: // Constructors and destructor + + static CPSObserver* NewL( MPSCallback& aCallback, TUid aCategory, TInt aKey ); + + virtual ~CPSObserver(); + + /** + * Returns the current value of the monitored + * P&S key. + * + * @param aValue Value is placed here + * + * @return KErrNone if succesfull + */ + TInt GetValue( TInt &aValue ) const; + + private: + + CPSObserver( MPSCallback& aCallback, TUid aCategory, TInt aKey ); + void ConstructL(); + + + private: // from CActive + + void RunL(); + void DoCancel(); + TInt RunError(); + + + private: // Data + + RProperty iProperty; + MPSCallback& iCallback; + TUid iCategory; + TInt iKey; + + }; + +} // namespace AiXmlUiController + +#endif // C_PSOBSERVER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/texttransactionelement.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/texttransactionelement.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,92 @@ +/* +* 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: Text transaction element +* +*/ + + +#ifndef C_TEXTTRANSACTIONELEMENT_H +#define C_TEXTTRANSACTIONELEMENT_H + +#include "transactionelement.h" + + +namespace AiUtility + { + class CContentPriorityMap; + } + +class CXnNodeAppIf; + +namespace AiXmlUiController +{ + +/** + * @ingroup group_xmluicontroller + * + * CTextTransactionElement corresponds one text content publishing operation. + * + * @lib AiXmlUiMain + */ +class CTextTransactionElement : public CTransactionElement + { +public: // Constructors and destructor + + static CTextTransactionElement* + NewL( AiUtility::CContentPriorityMap& aContentPriorityMap ); + + virtual ~CTextTransactionElement(); + +// New functions + + /** + * Initializes this transaction element to publish text content aText + * to text interface of node aTarget. + * + * @param aTarget - the target of publishing. + * @param aText - the text content. + */ + void InitializeL(CXnNodeAppIf& aTarget, const TDesC& aText); + + static TBool IsSupported( CXnNodeAppIf& aTarget ); + +// Functions from CTransactionElement + + void Reset(); + + void UpdateDataL(); + +private: // New methods + + CTextTransactionElement( AiUtility::CContentPriorityMap& aContentPriorityMap ); + + void CheckTypeL( CXnNodeAppIf& aTarget ); + + void SetTextL(); + +private: // Data + + /** + * New text content. + */ + + HBufC* iNewText; + + }; + +} // namespace AiXmlUiController + +#endif // C_TEXTTRANSACTIONELEMENT_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/transaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/transaction.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,139 @@ +/* +* 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: Transaction +* +*/ + + +#ifndef C_TRANSACTION_H +#define C_TRANSACTION_H + +#include +#include +#include +#include "xnproperty.h" +#include "xnnodeappif.h" +#include "mtransaction.h" + + +namespace AiXmlUiController + { + class MTransactionElement; + class CTransactionElement; + class MTransactionFactory; + } + + +namespace AiXmlUiController +{ + +/** +* @ingroup group_xmluicontroller +* +* CTransaction collects the transaction elements of one transaction +* +* @lib AiXmlUiMain +*/ +class CTransaction : public CBase, public MTransaction + { +public: // Constructors and destructor + + static CTransaction* NewL(); + + virtual ~CTransaction(); + +// From MTransaction + + void Append(MTransactionElement& aElement); + + void CommitL(TBool& aLayoutChanged, RPropertyHashMap& aPropertyHashMap); + + void Reset(MTransactionFactory& aFactory); + + TDblQueIter ElementIter(); + + +// New functions + + /** + * Returns the transaction id of this transaction + */ + TInt Id() const; + + /** + * Initializes transaction. + * @param aTxId transaction id. + */ + void Initialize(TInt aTxId); + + /** + * Returns the doubly linked list link offset. + */ + inline static TInt LinkOffset(); + + /** + * Returns the singly linked list link offset + */ + inline static TInt FactoryLinkOffset(); + + /** + * Deques this transaction from a doubly linked list + */ + void Deque(); + +private: + + CTransaction(); + +private: // Data + + /** + * Transaction identifier. + */ + TInt iTxId; + + /** + * Doubly linked list of transaction elements. + */ + TDblQue iTransactionElements; + + /** + * Doubly linked list link item. + */ + TDblQueLink iLink; + + /** + * Singly linked list link item. + */ + TSglQueLink iFactoryLink; + + }; + +// Inline implementations + +TInt CTransaction::LinkOffset() + { + return _FOFF(CTransaction, iLink); + } + +TInt CTransaction::FactoryLinkOffset() + { + return _FOFF(CTransaction, iFactoryLink); + } + +} // namespace AiXmlUiController + +#endif // C_TRANSACTION_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/transactionelement.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/transactionelement.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,180 @@ +/* +* 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: Transaction element +* +*/ + + +#ifndef C_TRANSACTIONELEMENT_H +#define C_TRANSACTIONELEMENT_H + +#include +#include "mtransactionelement.h" + +class CXnNodeAppIf; +class MXnComponentInterface; + +namespace AiUtility + { + class CContentPriorityMap; + } + +namespace AiXmlUiController + { + class CCssPropertyMap; + } + +// CLASS DECLARATION + +namespace AiXmlUiController + { + + /** + * @ingroup group_xmluicontroller + * + * CTransactionElement is abstract base class for transaction elements. + * CTransactionElement corresponds one publish operation within a + * transaction scope. + * + * @lib AiXmlUiMain + */ + class CTransactionElement : public CBase, public MTransactionElement + { + public: // Constructors and destructor + + virtual ~CTransactionElement(); + + public: // New functions + + void Reset(); + + RAiPolicyElementArray& PolicyArray(); + + /** + * Sets current content priority value. + * + * @param aPriority priority of current content + * @post iContentPriority == aPriority + */ + void SetContentPriority( TInt aPriority ); + + /** + * Sets CSS property map to use. + * + * @param aPropertyMap CSS property map + */ + void SetCssPropertyMap( CCssPropertyMap* aPropertyMap ); + + /** + * Returns the target node. + */ + CXnNodeAppIf& Target() const; + + /** + * Returns offset to iElementLink. + */ + inline static TInt LinkOffset(); + + /** + * Returns offset to iFactoryLink. + */ + inline static TInt FactoryLinkOffset(); + + protected: // New functions + + CTransactionElement( AiUtility::CContentPriorityMap& aContentPriorityMap ); + + /** + * Sets the target node. + */ + void SetTarget(CXnNodeAppIf& aTarget); + + + /** + * Applies publishing policy to target UI element. + * The policy is applied by modifying CSS property defined + * by non-empty content. + */ + void ApplyPublishingPolicy( TBool& aLayoutChanged, + RPropertyHashMap& aPropertyHashMap ); + + void DoApplyPublishingPolicyL( TBool& aLayoutChanged, + RPropertyHashMap& aPropertyHashMap ); + + /** + * Updates current content priority into content priority map. + */ + void UpdateContentPriorityL(); + + /** + * Clears current content priorty in the content priority map. + */ + void ClearContentPriorityL(); + + MXnComponentInterface& ComponentInterfaceL() const; + + private: + + /** + * Array of policy elements + */ + RAiPolicyElementArray iPolicyArray; + + /** + * Content priority map + */ + AiUtility::CContentPriorityMap& iContentPriorityMap; + + /** + * CSS property map. Not own. + */ + CCssPropertyMap* iPropertyMap; + + /** + * Target node. Not own. + */ + CXnNodeAppIf* iTarget; + + /** + * Content priority. + */ + TInt iContentPriority; + + /** + * Link in a doubly linked list of a transaction. + */ + TDblQueLink iElementLink; + + /** + * Link in a singly linked list of a factory. + */ + TSglQueLink iFactoryLink; + + }; + + TInt CTransactionElement::LinkOffset() + { + return _FOFF(CTransactionElement, iElementLink); + } + + TInt CTransactionElement::FactoryLinkOffset() + { + return _FOFF(CTransactionElement, iFactoryLink); + } + + } // namespace AiXmlUiController + +#endif // C_TRANSACTIONELEMENT_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/transactionfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/transactionfactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,144 @@ +/* +* 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: Transaction factory +* +*/ + + +#ifndef M_TRANSACTIONFACTORY_H +#define M_TRANSACTIONFACTORY_H + +namespace AiXmlUiController + { + class MTransaction; + class MTransactionElement; + } + +class CXnNodeAppIf; +class CGulIcon; +class RFile; + + +namespace AiXmlUiController +{ + +/** +* MTransactionFactory provides life-cycle management of transactions and +* transaction elements. +* +* @lib AiXmlUiMain +*/ +class MTransactionFactory + { +public: + + // New functions + + /** + * Creates a new transaction. + * + * @param aTxId the transaction identifier + */ + virtual MTransaction* CreateTransactionL( TInt aTxId ) = 0; + + /** + * Releases a transaction element. + * + * @param aTransaction the transaction to release + */ + virtual void ReleaseTransaction( MTransaction* aTransaction ) = 0; + + /** + * Creates a new text transaction element. + * + * @param aTarget the target node of the transaction element + * @param aText the text to update + */ + virtual MTransactionElement* + CreateTextTransactionElementL( CXnNodeAppIf& aTarget, + const TDesC& aText, + TInt aPriority ) = 0; + + /** + * Creates a new data buffer transaction element. + * + * @param aTarget the traget node of the transaction element + * @param aData the data to update + */ + virtual MTransactionElement* + CreateDataBufferTransactionElementL( CXnNodeAppIf& aTarget, + const TDesC8& aData, + TInt aPriority ) = 0; + + /** + * Creates a new empty content transaction element. + * + * @param aTarget the target node of the transaction element + * @param aText the text to update + */ + virtual MTransactionElement* + CreateEmptyContentTransactionElementL( CXnNodeAppIf& aTarget, + TInt aIndex ) = 0; + + /** + * Creates a new image transaction element. + * + * @param aTarget the target node of the transaction element + * @param aIcon the icon to update. Ownership transferred. + */ + virtual MTransactionElement* + CreateImageTransactionElementL( CXnNodeAppIf& aTarget, + CGulIcon* aIcon, + TInt aPriority ) = 0; + + /** + * Creates a new image transaction element. + * + * @param aTarget the target node of the transaction element + * @param aFile the file to read image data from. + */ + virtual MTransactionElement* + CreateImageTransactionElementL( CXnNodeAppIf& aTarget, + RFile& aFile, + TInt aPriority ) = 0; + + /** + * Releases a transaction element. + * + * @param aElement the element to release. + */ + virtual void ReleaseTransactionElement( + MTransactionElement* aElement ) = 0; + + /** + * Checks if given content type is supported by target element. + * + * @param aTarget the target UI element. + * @param aContentType the content type + * @return ETrue if content type is supported, otherwise EFalse. + */ + virtual TBool IsSupported( CXnNodeAppIf& aTarget, + const TDesC8& aContentType ) = 0; + +protected: + + ~MTransactionFactory(){}; + + }; + +} // namespace AiXmlUiController + +#endif // M_TRANSACTIONFACTORY_H + +// End of File \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/transactionfactoryimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/transactionfactoryimpl.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,151 @@ +/* +* 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: Transaction factory implementation +* +*/ + + +#ifndef C_TRANSACTIONFACTORYIMPL_H +#define C_TRANSACTIONFACTORYIMPL_H + + +#include +#include "transactionfactory.h" + +namespace AiUtility + { + class CContentPriorityMap; + } + +namespace AiXmlUiController +{ + +class CTransaction; +class CTransactionElement; +class CCssPropertyMap; + + +/** +* @ingroup group_xmluicontroller +* +* CTransactionFactoryImpl implements MTransactionFactory. +* It provides a recycling pool of transaction objects. +* +* @lib AiXmlUiMain +*/ +class CTransactionFactoryImpl: public CBase, public MTransactionFactory + { +public: // Constructors and destructor + + static CTransactionFactoryImpl* + NewL( AiUtility::CContentPriorityMap& aContentPriorityMap, + CCssPropertyMap& aPropertyMap ); + + virtual ~CTransactionFactoryImpl(); + +// Functions from MTransactionFactory + + MTransaction* CreateTransactionL( TInt aTxId ); + + void ReleaseTransaction( MTransaction* aTransaction ); + + MTransactionElement* CreateTextTransactionElementL( CXnNodeAppIf& aTarget, + const TDesC& aText, + TInt aPriority ); + + MTransactionElement* CreateDataBufferTransactionElementL( + CXnNodeAppIf& aTarget, + const TDesC8& aData, + TInt aPriority ); + + MTransactionElement* CreateEmptyContentTransactionElementL( CXnNodeAppIf& aTarget, + TInt aIndex ); + + MTransactionElement* CreateImageTransactionElementL( CXnNodeAppIf& aTarget, + CGulIcon* aIcon, + TInt aPriority ); + + MTransactionElement* CreateImageTransactionElementL( CXnNodeAppIf& aTarget, + RFile& aFile, + TInt aPriority ); + + /** + * @param aTarget + * @param aText new text + * @param aPriority + * @param aIndex Index of the news ticker element updated + */ + MTransactionElement* CreateNewsTickerTransactionElementL( CXnNodeAppIf& aTarget, + const TDesC& aText, + TInt aPriority, + TInt aIndex ); + + void ReleaseTransactionElement( MTransactionElement* aElement ); + + TBool IsSupported( CXnNodeAppIf& aTarget, const TDesC8& aContentType ); + +private: // Construction + + CTransactionFactoryImpl( + AiUtility::CContentPriorityMap& aContentPriorityMap, + CCssPropertyMap& aPropertyMap ); + + void ConstructL(); + + template T* NewInstanceL(); + +// New methods + + void DeleteTransactionList( TSglQue< CTransaction >& aList ); + + void DeleteElementList( TSglQue< CTransactionElement >& aList ); + +private: // Data + + /** + * List of available transactions. + */ + TSglQue< CTransaction > iAvailableTransactions; + + /** + * List of reserved transactions. + */ + TSglQue< CTransaction > iReservedTransactions; + + /** + * List of available transaction elements. + */ + TSglQue< CTransactionElement > iAvailableElements; + + /** + * List of reserved transaction elements. + */ + TSglQue< CTransactionElement > iReservedElements; + + /** + * Reference to UI controller's content priority map + */ + AiUtility::CContentPriorityMap& iContentPriorityMap; + + /** + * UI controller's CSS property map. Not own. + */ + CCssPropertyMap& iPropertyMap; + }; + +} // namespace AiXmlUiController + +#endif // C_TRANSACTIONFACTORYIMPL_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/xmlnodeidgenerator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/xmlnodeidgenerator.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,121 @@ +/* +* 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: Builder class for XML UI node identifiers. +* +*/ + + +#ifndef C_XMLNODEIDGENERATOR_H +#define C_XMLNODEIDGENERATOR_H + +#include + +class MAiPropertyExtension; +struct TAiPublisherInfo; +struct TAiContentItem; + +namespace AiXmlUiController +{ + +/** +* @ingroup group_xmluicontroller +* +* Xml node id generator.Generates an identifier that is used to look up +* settings node from XML UI model. +* +* @lib AiXmlUiMain +*/ +class CXmlNodeIdGenerator : public CBase + { +public: // Construction + + static CXmlNodeIdGenerator* NewL(); + + ~CXmlNodeIdGenerator(); + +// New methods + + /** + * 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. + * @return content node identifier. + */ + TPtrC SettingsNodeIdL( const TAiPublisherInfo& aPubInfo); + + /** + * Generates an identifier that is used to look up content node from + * XML UI model. + * + * @param aPlugin Active Idle publisher to use in the identifier + * generation. + * @param aContentItem Active Idle content item to use in the + * identifier generation. + * @return content node identifier. + */ + TPtrC ContentNodeIdL(MAiPropertyExtension& 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. + * @return content node identifier. + */ + TPtrC ContentNodeIdL(const TAiPublisherInfo& aPubInfo, const TAiContentItem& aContentItem); + + /** + * Generates an identifier that is used to look up resource node from + * XML UI model. + * + * @param aPlugin Active Idle publisher to use in the identifier + * generation. + * @param aContentItem Active Idle content item to use in the + * identifier generation. + * @return resource node identifier. + */ + TPtrC ResourceNodeIdL(MAiPropertyExtension& 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. + * @return resource node identifier. + */ + TPtrC ResourceNodeIdL(const TAiPublisherInfo& aPubInfo, const TAiContentItem& aContentItem); + +private: // Construction + + CXmlNodeIdGenerator(); + + void ConstructL(); + +private: // Data + + HBufC* iContentNodeIdBuf; + + }; + +} // namespace AiXmlUiController + +#endif // C_XMLNODEIDGENERATOR_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/xmluicontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/xmluicontroller.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,270 @@ +/* +* 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: XML UI Controller main class +* +*/ + + +#ifndef C_XMLUICONTROLLER_H +#define C_XMLUICONTROLLER_H + +#include +#include "aiuicontroller.h" +#include "aiuieventhandler.h" + + +const TInt KImplementationUidXmlUiController = AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML; +const TUid KUidXmlUiController = { KImplementationUidXmlUiController }; + + +class CApaApplication; +class TXnUiEngineAppIf; +class CXnNodeAppIf; +class CRepository; + +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 + { +public: + // Constructors and destructor + + static CXmlUiController* NewL(); + + ~CXmlUiController(); + +public: + // New functions + + /** + * Sets content observer. + * + * @since S60 5.0 + * @param aObserver Conten observer + */ + void SetObserver( MAiContentObserver& aObserver ); + + /** + * Set the app ui when created. + * + * @since S60 5.0 + * @param aAppUi AppUi + */ + void SetAppUi( CAppUi& aAppUi ); + + /** + * Get app ui. + * + * @since S60 5.0 + * @return AppUi + */ + CAppUi* AppUi() const; + + /** + * Creates and returns Xuikon event handler. + * + * @since S60 5.0 + * @param aContentRender Content renderer + * @return Xuikon event handler + */ + CAIXuikonEventHandler* CreateXuikonEventHandlerL( + CContentRenderer& aRenderer ); + + /** + * Call from App Ui ConstructL to notify AI FW that the App env is ready. + * + * @since S60 5.0 + */ + 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 UiEngine. + * + * @since S60 5.0 + * @return UiEngine + */ + TXnUiEngineAppIf* UiEngineL() const; + + /** + * Get settings repository. + * + * @since S60 5.0 + * @return Settings repository + */ + 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 + * @param aSource Xml node which defineds the publisher + * @param aInfo Publisher info filled based aSource information + */ + void PublisherInfoL( CXnNodeAppIf& aSource, + TAiPublisherInfo& aInfo ); + +public: + // from CAiUiController + + void LoadUIDefinitionL(); + + void GetPluginsL( RAiPublisherInfoArray& aPlugins ); + + void GetSettingsL( const TAiPublisherInfo& aPubInfo, + RAiSettingsItemArray& aSettings ); + + void ActivateUI(); + + MAiContentObserver& GetContentObserver(); + + void SetEventHandler( MAiFwEventHandler& aFwEventHandler ); + + void RemovePluginFromUI( MAiPropertyExtension& aPlugin ); + + MAiMainUiController* MainInterface(); + + MAiSecondaryUiController* SecondaryInterface(); + +private: + // from MAiMainUiController + + void RunApplicationL(); + + CCoeEnv& CoeEnv(); + + void SetUiFrameworkObserver( MAiUiFrameworkObserver& aObserver ); + + void Exit(); + + TBool IsMenuOpen(); + +private: + // from MAiUiEventHandler + + TBool HandleUiEvent(TAny* aEvent, const TDesC8& aParam); + +private: + // Constructors + + CXmlUiController(); + + void ConstructL(); + +private: + // New methods + static CApaApplication* NewApplication(); + + void HandleFocusGainedL( const TDesC8& aUiElement1, const TDesC8& aUiElement2, CXnNodeAppIf& aOrigin ); + + void HandleSetElementSizeL( const TDesC8& aElementName, CXnNodeAppIf& aOrigin ); + + static TInt ExitTimerCallBack(TAny *aSelf); + + void GetSettingsFromCRL( const TAiPublisherInfo& aPubInfo, RAiSettingsItemArray &aPluginSettings ); + + void GetContentItemL( CXnNodeAppIf& aNode, RAiSettingsItemArray& aSettings, HBufC*& aItemName ); + + void GetConfigurationsL( CXnNodeAppIf& aNode, RAiSettingsItemArray& aSettings, const TDesC& aConfOwner ); + + void GetContentModelL(const TAiPublisherInfo& aPubInfo, RAiSettingsItemArray& aSettings); + +private: // data + + /** + * Ai content observer. Not own. + */ + MAiContentObserver* iObserver; + + /** + * Ui framework observer. Not own. + */ + MAiUiFrameworkObserver* iUiFrameworkObserver; + + /** + * Event handler. Not own. + */ + MAiFwEventHandler* iFwEventHandler; + + /** + * Node id generator. Own. + */ + CXmlNodeIdGenerator* iNodeIdGenerator; + + /** + * App UI. Not own. + */ + CAppUi* iAppUi; + + /** + * Timer to call AppUi's exit. Own. + **/ + CPeriodic *iExitTimer; + + /** + * Cenrep. Own. + */ + CRepository *iAISettingsRepository; + + /** + * CPS publisher. Own. + */ + CContentPublisher* iCPSpublisher; + + /** + * Flag to indicate whether running as main UI controller + */ + TBool iRunningAsMain; + }; +} // namespace AiXmlUiController + +#endif // C_XMLUICONTROLLER_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/xmluicontroller.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/xmluicontroller.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,26 @@ +/* +* 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: +* +*/ + + +#include "appui.h" + +using namespace AiXmlUiController; + +inline TXnUiEngineAppIf* CXmlUiController::UiEngineL() const + { + return iAppUi ? iAppUi->UiEngineL() : NULL; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/inc/xmluicontrollerpanic.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/inc/xmluicontrollerpanic.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,40 @@ +/* +* 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: Module specific panic definitions +* +*/ + + +#ifndef XMLUICONTROLLERPANIC_H +#define XMLUICONTROLLERPANIC_H + +namespace AiXmlUiController +{ + + enum TAiXmlUiControllerPanic + { + ETransactionStackEmpty, + ETransactionStackNotEmpty, + ETransactionElementListNotEmpty, + ETargetNodeNull, + ETargetNodeNotNull, + EBitmapNull, + ECriticalPointerNull + }; + + void Panic( TAiXmlUiControllerPanic aPanic ); + +} // namespace AiXmlUiController + +#endif // XMLUICONTROLLERPANIC_H \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/rom/ai3xmluicontroller.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/rom/ai3xmluicontroller.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image description file for project ActiveIdle3 +* +*/ + + +#ifndef XMLUICONTROLLER_IBY +#define XMLUICONTROLLER_IBY + + +#include + +ECOM_PLUGIN( ai3xmluimain.dll, ai3xmluimain.rsc ) +data=\epoc32\data\Z\resource\apps\ai3xmlui.rsc APP_RESOURCE_DIR\ai3xmlui.rsc + +// Reference UI theme +//data=CPRIVATE\10207254\themes\3772834016\270513751\285221529\1.0\TMP04f65.o0000 PRIVATE\10207254\themes\271012080\270513751\271063147\1.0\TMP04f65.o0000 + + +// NOTE!! FILES BELOW ARE INCLUDED TO IMAGE BY OLD XUIKON AND ACTIVEIDLE2. UNCOMMENT WHEN AI2 AND XUIKON +// ARE REMOVED FROM RELEASE. + +// Theme skeletons +//data=ZPRIVATE\10207254\themes\271012080\270513751\271063149\1.0\AI.o0000 PRIVATE\10207254\themes\271012080\270513751\271063149\1.0\AI.o0000 +//data=ZPRIVATE\10207254\themes\271012080\270513751\271063148\1.0\BI.o0000 PRIVATE\10207254\themes\271012080\270513751\271063148\1.0\BI.o0000 +//data=ZPRIVATE\10207254\themes\271012080\270513751\271063147\1.0\CI.o0000 PRIVATE\10207254\themes\271012080\270513751\271063147\1.0\CI.o0000 +//data=ZPRIVATE\10207254\themes\271012080\270513751\271068379\1.0\FT.o0000 PRIVATE\10207254\themes\271012080\270513751\271068379\1.0\FT.o0000 + +// Semitransparencymask for Navibar (AI) theme +//data=ZPRIVATE\10207254\themes\271012080\270513751\271063149\1.0\sources\qsn_fr_popup_sub_mask_icon.svg PRIVATE\10207254\themes\271012080\270513751\271063149\1.0\sources\qsn_fr_popup_sub_mask_icon.svg +//data=ZPRIVATE\10207254\themes\271012080\270513751\271063148\1.0\sources\idle_toolbaricons.mif PRIVATE\10207254\themes\271012080\270513751\271063148\1.0\sources\idle_toolbaricons.mif +//data=ZPRIVATE\10207254\themes\271012080\270513751\271068379\1.0\sources\idle_toolbaricons.mif PRIVATE\10207254\themes\271012080\270513751\271068379\1.0\sources\idle_toolbaricons.mif + +//data=ZPRIVATE\10207254\themes\271012080\270513751\271068379\1.0\sources\fmradioclassicidle.mif PRIVATE\10207254\themes\271012080\270513751\271068379\1.0\sources\fmradioclassicidle.mif + +//data=ZPRIVATE\10275102\backup_registration.xml private\10275102\backup_registration.xml + + +#endif // XMLUICONTROLLER_IBY diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/rom/ai3xmluicontroller_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/rom/ai3xmluicontroller_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image description file for project ActiveIdle3 +* +*/ + +#ifndef XMLUICONTROLLERRESOURCES_IBY +#define XMLUICONTROLLERRESOURCES_IBY + + +#include + +data=\epoc32\data\Z\resource\apps\ai3xmlui.rsc APP_RESOURCE_DIR\ai3xmlui.rsc + +#endif // XMLUICONTROLLERRESOURCES_IBY diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/activetransactionstack.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/activetransactionstack.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,123 @@ +/* +* 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: Active transaction stack +* +*/ + + +#include "activetransactionstack.h" +#include "transaction.h" +#include "xmluicontrollerpanic.h" + + + +using namespace AiXmlUiController; + +// ========================== MEMBER FUNCTIONS =============================== + +CActiveTransactionStack::CActiveTransactionStack() + : iTransactions( CTransaction::LinkOffset() ) + { + } + +CActiveTransactionStack* CActiveTransactionStack::NewL() + { + CActiveTransactionStack* self = new( ELeave ) CActiveTransactionStack; + + return self; + } + +CActiveTransactionStack::~CActiveTransactionStack() + { + __ASSERT_DEBUG( IsEmpty(), Panic( ETransactionStackNotEmpty ) ); + } + +TBool CActiveTransactionStack::IsEmpty() const + { + return iTransactions.IsEmpty(); + } + +void CActiveTransactionStack::Push( MTransaction* aTransaction ) + { + CTransaction* tr = dynamic_cast< CTransaction* >( aTransaction ); + + if ( tr ) + { + iTransactions.AddFirst( *tr ); + } + } + +MTransaction* CActiveTransactionStack::Pop() + { + CTransaction* tr = DoTop(); + if ( tr ) + { + tr->Deque(); + } + + return tr; + } + +MTransaction* CActiveTransactionStack::Top() const + { + return DoTop(); + } + +MTransaction* CActiveTransactionStack::Lookup( TInt aTxId ) const + { + return DoLookup( aTxId ); + } + +MTransaction* CActiveTransactionStack::Remove( TInt aTxId ) + { + CTransaction* tr = DoLookup( aTxId ); + + if ( tr ) + { + tr->Deque(); + } + + return tr; + } + +CTransaction* CActiveTransactionStack::DoTop() const + { + __ASSERT_ALWAYS( !iTransactions.IsEmpty(), Panic( ETransactionStackEmpty ) ); + + CTransaction* tr = iTransactions.First(); + return tr; + } + +CTransaction* CActiveTransactionStack::DoLookup( TInt aTxId ) const + { + // Iterate over transactions and search transaction with aTxId + TDblQueIter< CTransaction > + iter( const_cast< TDblQue< CTransaction >& >( iTransactions ) ); + iter.SetToFirst(); + + while ( iter ) + { + CTransaction* tr = iter++; + + if ( tr->Id() == aTxId ) + { + // Match. Return transaction + return tr; + } + } + + return NULL; + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/ai3xmlui.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/ai3xmlui.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,184 @@ +/* +* 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: +* +*/ + + +// ========== RESOURCE IDENTIFIER ============================================= + +NAME AI3X + +// ========== INCLUDE FILES =================================================== + +#include +#include +#include +#include +#include +#include +#include +// ========== RESOURCE DEFINITIONS ============================================ + +RESOURCE RSS_SIGNATURE { } +RESOURCE TBUF { buf = ""; } + +RESOURCE EIK_APP_INFO +{ + cba = R_AVKON_SOFTKEYS_EMPTY; + status_pane = r_xui_status_pane; +} + +// ----------------------------------------------------------------------------- +// +// r_idle_title_pane +// It defines idle's status pane. Title pane is empty. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TITLE_PANE r_xui_title_pane + { + txt = " "; + } + +// ----------------------------------------------------------------------------- +// +// r_idle_status_pane +// It defines idle's status pane. +// +// ----------------------------------------------------------------------------- +// +RESOURCE STATUS_PANE_APP_MODEL r_xui_status_pane + { + layout = R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT_NO_SOFTKEYS; + panes = + { + SPANE_PANE + { + id = EEikStatusPaneUidTitle; + type = EAknCtTitlePane; + resource = r_xui_title_pane; + } + }; + } + +RESOURCE AVKON_SKEY_LIST r_xui_default_skey_list + { + list = + { + AVKON_SKEY_INFO {key='0'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='0'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='0'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='1'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='1'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='1'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='2'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='2'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='2'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='3'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='3'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='3'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='4'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='4'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='4'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='5'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='5'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='5'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='6'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='6'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='6'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='7'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='7'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='7'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='8'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='8'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='8'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='9'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='9'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='9'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key='*'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='*'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='*'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;}, + AVKON_SKEY_INFO {key=EStdKeyHash; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key=EStdKeyHash; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key=EStdKeyHash; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;} +#ifdef __QWERTY_INPUT + , + AVKON_SKEY_INFO {key='+'; sid=EAvkonSIDNoSound;}, + AVKON_SKEY_INFO {key='+'; sid=EAvkonSIDNoSound; type = ESKeyTypeLong;}, + AVKON_SKEY_INFO {key='+'; sid=EAvkonSIDNoSound; type = ESKeyTypeRepeat;} +#endif // __QWERTY_INPUT + }; + } + +RESOURCE TBUF r_qtn_hs_switch_online + { + buf = qtn_hs_switch_online; + } + +RESOURCE TBUF r_qtn_hs_disable_network + { + buf = qtn_hs_disable_network; + } + +RESOURCE TBUF r_qtn_hs_automatic_offline + { + buf = qtn_hs_automatic_offline; + } + +RESOURCE TBUF r_qtn_hs_operation_failed_no_disk + { + buf = qtn_hs_operation_failed_no_disk; + } + +// home screen online dialog +RESOURCE DIALOG r_yes_no_hs_online + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = qtn_hs_switch_online; + }; + } + }; + } + + +// disable home screen network dialog +RESOURCE DIALOG r_disable_hs_network + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = qtn_hs_disable_network; + }; + } + }; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/ai3xmluimain.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/ai3xmluimain.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,55 @@ +/* +* 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: +* +*/ + + +#include +#include +#include + +// ========== RESOURCE DEFINITIONS ============================================ + +RESOURCE REGISTRY_INFO registry_info +{ + resource_format_version = RESOURCE_FORMAT_VERSION_2; + // UID for the DLL + dll_uid = AI3_UID_ECOM_DLL_UICONTROLLER_XML; + + // Interface info array + interfaces = + { + INTERFACE_INFO + { + // UID of the implemented interface + interface_uid = AI_UID_ECOM_INTERFACE_UICONTROLLER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML; + version_no = 1; + display_name = "AI3 User Interface"; + default_data = " "; + opaque_data = " "; + rom_only = 1; + } + }; + } + }; +} + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/aieventhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/aieventhandler.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,322 @@ +/* +* 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: Used for handling system events (events with EventHandler-prefix). +* +*/ + +#include +#include +#include +#include +#include + +#include "aieventhandler.h" +#include "aixmluiconstants.h" +#include "xmluicontroller.h" +#include "appui.h" +#include "xndomnode.h" +#include "xnuiengineappif.h" +#include "xnnodeappif.h" +#include "aistrcnv.h" + +#include +#include + +using namespace AiXmlUiController; + +// Action Handler LIW commands +_LIT8( KAHInterface, "IDataAction"); +_LIT8( KAHService, "Service.ActionHandler"); + +_LIT( KLaunchApplication, "launch_application" ); +_LIT( KViewActivation, "view_activation" ); +_LIT( KCmdLine, "cmd_line"); + +_LIT8( KType, "type" ); +_LIT8( KLaunchMethod, "launch_method" ); +_LIT8( KApplicationUid, "application_uid" ); +_LIT8( KViewId, "view_id" ); +_LIT8( KViewAppUid, "view_app_uid" ); +_LIT8( KMessageUid, "message_uid" ); +_LIT8( KAdditionalData, "additional_data" ); +_LIT8( KPluginId, "plugin_id" ); +_LIT8( KData, "data"); +_LIT8( KExecute, "Execute" ); + +const TInt32 KCASpaAppLauncherPlugin = {0x10282E5F}; +const TUid KVoiceCallUidViewId = { 0x10282D81 }; +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 +// --------------------------------------------------------------------------- +// +static void ActivatePhoneViewL( CXmlUiController& aUiController ) + { + TInt topMostAppId = 0; + RProperty::Get( KPSUidUikon, KUikVideoCallTopApp, topMostAppId ); + TUid appId(TUid::Uid(topMostAppId)); + if( appId == KVideoCallUid) + { + const TVwsViewId viewId(appId, appId); + aUiController.AppUi()->ActivateViewL( viewId, KNullUid, KNullDesC8()); + } + else + { + const TVwsViewId viewId(appId, KVoiceCallUidViewId); + aUiController.AppUi()->ActivateViewL( viewId, KVoiceCallUidViewId, KNullDesC8()); + } + } +// ======== MEMBER FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::CAIXuikonEventHandler() +// ---------------------------------------------------------------------------- +// +CAIEventHandler::CAIEventHandler( CXmlUiController& aUiController ) + : iUiController( aUiController ) + { + } + +// ---------------------------------------------------------------------------- +// CAISystemEventHandler::ConstructL() +// ---------------------------------------------------------------------------- +// +void CAIEventHandler::ConstructL() + { + } + +// ---------------------------------------------------------------------------- +// CAISystemEventHandler::NewL() +// ---------------------------------------------------------------------------- +// +CAIEventHandler* CAIEventHandler::NewL( CXmlUiController& aUiController ) + { + CAIEventHandler* self = + new ( ELeave ) CAIEventHandler( aUiController ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CAISystemEventHandler::~CAISystemEventHandler() +// ---------------------------------------------------------------------------- +// +CAIEventHandler::~CAIEventHandler() + { + if( iServiceHandler ) + { + iServiceHandler->Reset(); + } + delete iServiceHandler; + } + +// ---------------------------------------------------------------------------- +// Handles the restricted ( can be triggered only from view) events and forwards +// the rest into appropriate functions. +// ---------------------------------------------------------------------------- +// +void CAIEventHandler::HandleEventL( const TDesC8& aEventText, CXnDomNode& aEvent ) + { + const TDesC8& prefix( AiUiDef::xml::event::KEventHandlerPrefix ); + const TDesC8& event( aEventText.Mid( prefix.Length() ) ); + const TDesC8& ns( iUiController.UiEngineL()->ActiveView()->Namespace() ); + // These events can be excuted from view only + if( aEvent.Namespace() == ns) + { + if ( event == AiUiDef::xml::event::KEventSetOnline ) + { + iUiController.AppUi()->SetOnlineStateL( ETrue ); + } + else if ( event == AiUiDef::xml::event::KEventSetOffline ) + { + iUiController.AppUi()->SetOnlineStateL( EFalse ); + } + else if ( event == AiUiDef::xml::event::KEventShowHelp ) + { + if( iUiController.UiEngineL()->IsEditMode() ) + { + ShowHelpL( KSET_HLP_HOME_SCREEN_EDIT ); + } + else + { + ShowHelpL( KSET_HLP_HOME_SCREEN ); + } + } + else if ( event == AiUiDef::xml::event::KEventActivatePhoneView ) + { + ActivatePhoneViewL( iUiController ); + } + } + + if( event == AiUiDef::xml::event::KEventLaunchApp ) + { + LaunchAppL( aEvent ); + } + else if( event == AiUiDef::xml::event::KEventActivateView ) + { + ActivateViewL( aEvent ); + } + } + +// ---------------------------------------------------------------------------- +// Launches app using Action Handler +// ---------------------------------------------------------------------------- +// +void CAIEventHandler::LaunchAppL( CXnDomNode& aEventNode ) + { + const TDesC8& uidStr( aEventNode.AttributeValue( AiUiDef::xml::property::KUid )); + TInt32 uid( 0 ); + User::LeaveIfError( AiUtility::ParseInt( uid, uidStr ) ); + + CLiwDefaultMap* map = CLiwDefaultMap::NewL(); + map->PushL(); + map->InsertL( KType, TLiwVariant( KLaunchApplication )); + map->InsertL( KLaunchMethod, TLiwVariant( KCmdLine )); + map->InsertL( KApplicationUid, TLiwVariant( uid )); + + ExecuteAppLauncherL( *map ); + + CleanupStack::PopAndDestroy( map ); + } + +// ---------------------------------------------------------------------------- +// Activates view using Action Handler +// ---------------------------------------------------------------------------- +// +void CAIEventHandler::ActivateViewL( CXnDomNode& aEventNode ) + { + const TDesC8& uidStr( aEventNode.AttributeValue( AiUiDef::xml::property::KUid )); + const TDesC8& viewIdStr( aEventNode.AttributeValue( AiUiDef::xml::property::KViewId )); + const TDesC8& messageIdStr( aEventNode.AttributeValue( AiUiDef::xml::property::KMessageId )); + const TDesC8& messageStr( aEventNode.AttributeValue( AiUiDef::xml::property::KMessage )); + + CLiwDefaultMap* map = CLiwDefaultMap :: NewL(); + map->PushL(); + map->InsertL( KType, TLiwVariant( KViewActivation )); + TInt32 uid( 0 ); + User::LeaveIfError( AiUtility::ParseInt( uid, uidStr ) ); + map->InsertL( KViewAppUid, TLiwVariant( uid )); + + TInt32 viewId( 0 ); + User::LeaveIfError( AiUtility::ParseInt( viewId, viewIdStr ) ); + map->InsertL( KViewId, TLiwVariant( viewId )); + + if( messageIdStr.Length() != 0 ) + { + TInt32 messageId( 0 ); + User::LeaveIfError( AiUtility::ParseInt( messageId, messageIdStr ) ); + map->InsertL( KMessageUid, TLiwVariant( messageId )); + + map->InsertL( KAdditionalData, TLiwVariant( messageStr )); + } + + ExecuteAppLauncherL( *map ); + + CleanupStack::PopAndDestroy( map ); + } + +// ---------------------------------------------------------------------------- +// Calls the actual LIW interface +// ---------------------------------------------------------------------------- +// +void CAIEventHandler::ExecuteAppLauncherL( CLiwDefaultMap& aMap ) + { + MLiwInterface* msgInterface = ActionHandlerInterfaceL( ); + if( msgInterface && iServiceHandler ) + { + CLiwGenericParamList& inparam = iServiceHandler->InParamListL(); + CLiwGenericParamList& outparam = iServiceHandler->OutParamListL(); + + TLiwGenericParam pluginUid( KPluginId, TLiwVariant( TUid::Uid( KCASpaAppLauncherPlugin ))); + inparam.AppendL( pluginUid ); + + TLiwGenericParam data( KData, TLiwVariant( &aMap )); + inparam.AppendL( data ); + + TRAPD(err, msgInterface ->ExecuteCmdL(KExecute, inparam, outparam)); + msgInterface->Close(); + + outparam.Reset(); + inparam.Reset(); + } + } + +// ---------------------------------------------------------------------------- +// Gets the Action Handler interface +// ---------------------------------------------------------------------------- +// +MLiwInterface* CAIEventHandler::ActionHandlerInterfaceL( ) + { + if( !iServiceHandler ) + { + iServiceHandler = CLiwServiceHandler::NewL(); + } + CLiwGenericParamList& inParam = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParam = iServiceHandler->OutParamListL(); + + CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL( KLiwCmdAsStr, KAHInterface, KAHService); + + CleanupStack::PushL( crit ); + crit->SetServiceClass( TUid::Uid( KLiwClassBase )); + + RCriteriaArray a; + a.AppendL(crit); + + iServiceHandler->AttachL(a); + iServiceHandler->ExecuteServiceCmdL( *crit, inParam, outParam ); + + CleanupStack::PopAndDestroy( crit ); + a.Reset(); + + // find service interface + TInt pos = 0; + MLiwInterface* msgInterface = NULL; + outParam.FindFirst( pos, KAHInterface ); + if ( pos != KErrNotFound ) + { + msgInterface = (outParam)[pos].Value().AsInterface(); + } + + outParam.Reset(); + inParam.Reset(); + + return msgInterface; + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/aipolicyelement.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/aipolicyelement.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,85 @@ +/* +* 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: Policy element +* +*/ + + +#include "aipolicyelement.h" +#include "aixmluiconstants.h" +#include "xmluicontrollerpanic.h" + +using namespace AiXmlUiController; + +// ======== MEMBER FUNCTIONS ======== + +TAiPolicyElement::TAiPolicyElement() + : iTarget( NULL ), + iPolicy( KNullDesC8 ), + iSeparator( KErrNotFound ) + { + } + +TAiPolicyElement::TAiPolicyElement( CXnNodeAppIf& aTarget, const TDesC8& aPolicy ) + : iTarget( &aTarget ), + iPolicy( aPolicy ) + { + iSeparator = iPolicy.Find( AiUiDef::xml::css::KSeparator ); + } + +CXnNodeAppIf& TAiPolicyElement::Target() const + { + if ( !iTarget ) + { + AiXmlUiController::Panic( ETargetNodeNull ); + } + + return *iTarget; + } + +TPtrC8 TAiPolicyElement::Name() const + { + if ( iSeparator < 0 ) + { + return TPtrC8( KNullDesC8 ); + } + + return TLex8( iPolicy.Left( iSeparator ) ).NextToken(); + } + +TPtrC8 TAiPolicyElement::Policy() const + { + return iPolicy; + } + +TPtrC8 TAiPolicyElement::Value() const + { + if ( iSeparator < 0 ) + { + return TPtrC8( KNullDesC8 ); + } + + TPtrC8 value( TLex8( iPolicy.Mid( iSeparator + 1 ) ).NextToken() ); + + TInt terminatorPos = value.Find( AiUiDef::xml::css::KValueTerminator ); + + if ( terminatorPos > KErrNotFound ) + { + return value.Left( terminatorPos ); + } + else + { + return value; + } + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/aixmluiutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/aixmluiutils.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1079 @@ +/* +* 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: Common utility functions +* +*/ + + +#include "xnchilditeratorbuilder.h" +#include "xnnodeappif.h" +#include "xnproperty.h" +#include "xndomlist.h" +#include "mxndomlistitem.h" +#include "xndomproperty.h" +#include "xndompropertyvalue.h" +#include "xnuiengineappif.h" + +#include +#include +#include +#include +#include +#include +#include +#include "xnnode.h" + +#include "aixmluiutils.h" +#include "aixmluiconstants.h" +#include "csspropertymap.h" +#include "aipolicyelement.h" +#include "transaction.h" +#include "debug.h" + +#include "xnbreadthfirsttreeiterator.h" +namespace + { + + /** + * CSS Property value update types. + */ + enum TPropertyUpdateType + { + EAbsoluteValue = 0, + EAddition, + ESubtraction, + EIncrementalAddition, + EIncrementalSubtraction + }; + + /** + * + */ + _LIT8( KAdditionOperator, "+" ); + + _LIT8( KIncrementalAdditionOperator, "++" ); + + _LIT8( KSubtractionOperator, "-" ); + + _LIT8( KIncrementalSubtractionOperator, "--" ); + + const TInt KLenAddSubOperator = 1; + + const TInt KLenIncrementalOperator = 2; + + _LIT( KMIFExtension, ".mif" ); + + // _LIT( KSVGExtension, ".svg" ); + + _LIT( KHashmark, "#" ); + + const TUint8 KDoubleQuote = '"'; + + const TUint8 KSingleQuote = '\''; + + const TInt KLenDoubleQuotes = 2; + const TInt KDepthT = 1; + + class TIconProvider : public MAknIconFileProvider + { + public: + /** + * Constructor + * @param aFile File handle to use + */ + TIconProvider(RFile& aFile) : iFile(aFile) + { + } + public: + + /** + * Destructor. + */ + virtual ~TIconProvider() + { + iFile.Close(); + } + // Functions from base classes + /** + * From MAknIconFileProvider Returns an open file handle to the icon file. + * This method should leave if an icon file with specified type does + * not exist. That may be the case e.g. with MBM file, + * if there are no bitmap icons. + * + * Note! RFs::ShareProtected must be called to the RFs instance used + * for opening the file. + * + * @param aFile Icon file should be opened in this file handle, which + * is an empty file handle, when the AknIcon framework calls this method. + * The AknIcon framework takes care of closing the file handle after + * having used it. + * @param aType Icon file type. + */ + virtual void RetrieveIconFileHandleL( + RFile& aFile, const TIconFileType /*aType*/ ) + { + aFile.Duplicate(iFile); + } + + /** + * From MAknIconFileProvider With this method, AknIcon framework informs that it does not use + * this MAknIconFileProvider instance any more. After this call, + * it is ok to delete the object. This can be implemented simply + * e.g. by deleting self in this callback. + * Normally, this callback is invoked when the icon in question + * is deleted. + * Note, however, that if the same MAknIconFileProvider instance is + * supplied in multiple CreateIcon calls, then it must be accessible + * by AknIcon framework until it has signalled a matching amount + * of these callbacks. + */ + virtual void Finished() + { + iFile.Close(); + delete this; + } + private: + // file to use + RFile iFile; + }; + + /** + * Tests if string ends with given pattern + * + * @param aString input string + * @param aPattern test pattern + * @return ETrue if string ends with given pattern. + */ + TBool EndsWith( const TDesC8& aString, const TDesC8& aPattern ) + { + return ( aString.Right( aPattern.Length() ) == aPattern ); + } + + /** + * Tests if string ends with given pattern + * + * @param aString input string + * @param aPattern test pattern + * @return ETrue if string ends with given pattern. + */ + TBool EndsWith( const TDesC& aString, const TDesC& aPattern ) + { + return ( aString.Right( aPattern.Length() ) == aPattern ); + } + /** + * Removes pattern from the end of string. Function does not validate + * that the pattern is in the end of string. It just cuts out the number + * of aPattern length characters from the string. + * + * @param aString input string + * @param aPattern pattern + * @return string without pattern. + */ + TPtrC8 Strip( const TDesC8& aString, const TDesC8& aPattern ) + { + return aString.Left( aString.Length() - aPattern.Length() ); + } + + /** + * Selects a proper string data value type + */ + CXnDomPropertyValue::TPrimitiveValueType SelectStringDataType( + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue ) + { + if ( aPropertyName == XnPropertyNames::style::common::KDisplay + && ( aPropertyValue == XnPropertyNames::style::common::display::KBlock + || aPropertyValue == XnPropertyNames::style::common::display::KNone ) ) + { + return CXnDomPropertyValue::EString; + } + + if ( aPropertyName == XnPropertyNames::style::common::KVisibility + && ( aPropertyValue == XnPropertyNames::style::common::visibility::KVisible + || aPropertyValue == XnPropertyNames::style::common::visibility::KHidden ) ) + { + return CXnDomPropertyValue::EString; + } + if ( aPropertyName == XnPropertyNames::style::common::KNavIndex ) + { + return CXnDomPropertyValue::EIdent; + } + + return CXnDomPropertyValue::EUnknown; + } + + /** + * Validates string + */ + TBool IsValidCssString( const TDesC8& aString ) + { + // Null string or unquoted string is not a CSS string + if ( aString.Length() < KLenDoubleQuotes ) + { + return EFalse; + } + + const TUint8 quotationMark( aString[0] ); + if ( ( quotationMark == KDoubleQuote || quotationMark == KSingleQuote ) + && aString[ aString.Length() - 1 ] == quotationMark ) + { + return ETrue; + } + + return EFalse; + } + + /** + * Removes extra quotes from strings. Assumes that the string is quoted. + */ + TPtrC8 RemoveQuotes( const TDesC8& aString ) + { + return aString.Mid( 1, aString.Length() - KLenDoubleQuotes ); + } + + /** + * Parses a primitive data type of a string. + * + * @param aInputValue[in] input value with primitive type information. + * @param aStringValue[out] value without type information. + * @param aFloatValue value as float if type is a numerical type. + * @param aPrimitiveType[out] primitive type. + * @param aUpdateType[out] update type + */ + void ParseCSSValue( const TDesC8& aInputValue, + TPtrC8& aStringValue, + TReal& aFloatValue, + CXnDomPropertyValue::TPrimitiveValueType& aPrimitiveType, + TPropertyUpdateType& aUpdateType ) + { + aPrimitiveType = CXnDomPropertyValue::EUnknown; + aUpdateType = EAbsoluteValue; + + TPtrC8 unit; + + // Recognise type + + if ( EndsWith( aInputValue, AiUiDef::xml::css::KPercentage ) ) + { + unit.Set( AiUiDef::xml::css::KPercentage ); + aPrimitiveType = CXnDomPropertyValue::EPercentage; + } + else if ( EndsWith( aInputValue, AiUiDef::xml::css::KPixel ) ) + { + unit.Set( AiUiDef::xml::css::KPixel ); + aPrimitiveType = CXnDomPropertyValue::EPx; + } + else if ( EndsWith( aInputValue, AiUiDef::xml::css::KUnitValue ) ) + { + unit.Set( AiUiDef::xml::css::KUnitValue ); + aPrimitiveType = CXnDomPropertyValue::EUnitValue; + } + else if ( IsValidCssString( aInputValue ) ) + { + aPrimitiveType = CXnDomPropertyValue::EString; + aStringValue.Set( RemoveQuotes( aInputValue ) ); + return; + } + + // Validate type + switch ( aPrimitiveType ) + { + // Supported float types + case CXnDomPropertyValue::EPercentage: + case CXnDomPropertyValue::EPx: + case CXnDomPropertyValue::EUnitValue: // fallthrough + { + // Remove unit + aStringValue.Set( Strip( aInputValue, unit ) ); + + // Determine update type + if ( aStringValue.Find( KIncrementalAdditionOperator ) == 0 ) + { + aUpdateType = EIncrementalAddition; + + // Remove sign + aStringValue.Set( aStringValue.Mid( KLenIncrementalOperator ) ); + } + else if ( aStringValue.Find( KAdditionOperator ) == 0 ) + { + aUpdateType = EAddition; + + // Remove sign + aStringValue.Set( aStringValue.Mid( KLenAddSubOperator ) ); + } + else if ( aStringValue.Find( KIncrementalSubtractionOperator ) == 0 ) + { + // Use addition, so only one sign has to be removed + aUpdateType = EAddition; + + aStringValue.Set( aStringValue.Mid( KLenAddSubOperator ) ); + } + else if ( aStringValue.Find( KSubtractionOperator ) == 0 ) + { + // Use addition, so sign does not have to be removed + aUpdateType = EAddition; + } + + if ( TLex8( aStringValue ).Val( aFloatValue ) != KErrNone ) + { + // Not a numerical value. Restore value + aPrimitiveType = CXnDomPropertyValue::EUnknown; + aUpdateType = EAbsoluteValue; + aStringValue.Set( aInputValue ); + } + + break; + } + + // string types + default: + { + aStringValue.Set( aInputValue ); + break; + } + + } + } + + /** + * Updates property value + * + * @param aValue property value to update. + * @param aStringValue new value as string + * @param aFloatValue new value as float (for number types) + * @param aPrimitiveType type of value + * @param aUpdateType type to update the value. + */ + void UpdatePropertyValueL( CXnDomPropertyValue& aValue, + const TDesC8& aStringValue, + const TReal& aFloatValue, + CXnDomPropertyValue::TPrimitiveValueType aPrimitiveType, + TPropertyUpdateType aUpdateType ) + { + switch ( aPrimitiveType ) + { + // Supported float types + case CXnDomPropertyValue::EPercentage: + case CXnDomPropertyValue::EPx: + case CXnDomPropertyValue::EUnitValue: // fallthrough + { + TReal floatValue( aFloatValue ); + // Select update type + switch ( aUpdateType ) + { + case EAddition: // fallthrough + case EIncrementalAddition: + { + floatValue += aValue.FloatValueL(); + break; + } + + case ESubtraction: // fallthrough + case EIncrementalSubtraction: + { + floatValue = aValue.FloatValueL() - aFloatValue; + break; + } + + case EAbsoluteValue: + default: + { + break; + } + } + + // Set new value as float + aValue.SetFloatValueL( aPrimitiveType, floatValue ); + + break; + } + + // string types + case CXnDomPropertyValue::EUnknown: + { + // Use current type + aPrimitiveType = Max( aValue.PrimitiveValueType(), CXnDomPropertyValue::EUnknown ); + + // Fall through to update... + } + + default: // fallthrough + { + if( aPrimitiveType == CXnDomPropertyValue::ENumber ) + { + TReal floatValue; + TLex8( aStringValue ).Val( floatValue ); + aValue.SetFloatValueL( aPrimitiveType, floatValue ); + } + else + { + // Set new value as string + aValue.SetStringValueL( aPrimitiveType, aStringValue ); + } + break; + } + } + } + + /** + * Creates a new property. + * + * @param aUiElement ui element to hold the property. + * @param aPropertyName name of the property. + * @param aPropertyValue value of the property. + */ + void CreatePropertyL( CXnNodeAppIf& aUiElement, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue ) + { + // Create new property value and property + CXnDomPropertyValue* value = CXnDomPropertyValue::NewL( + aUiElement.UiEngineL()->StringPool() ); + CleanupStack::PushL( value ); + + CXnProperty* property = CXnProperty::NewL( + aPropertyName, + value, + aUiElement.UiEngineL()->StringPool() ); + CleanupStack::Pop( value ); + CleanupStack::PushL( property ); + + // Parse CSS value + TPtrC8 stringValue; + TReal floatValue( 0 ); + CXnDomPropertyValue::TPrimitiveValueType primitiveType( + CXnDomPropertyValue::EUnknown ); + TPropertyUpdateType updateType( EAbsoluteValue ); + + ParseCSSValue( aPropertyValue, + stringValue, + floatValue, + primitiveType, + updateType ); + + if ( primitiveType == CXnDomPropertyValue::EUnknown ) + { + primitiveType = SelectStringDataType( aPropertyName, aPropertyValue ); + } + + // Update CSS value + UpdatePropertyValueL( *value, + stringValue, + floatValue, + primitiveType, + updateType ); + + // Add property to UI element + aUiElement.SetPropertyL( property ); + + CleanupStack::Pop( property ); + } + + + // Icon utilities + + _LIT( KSkin, "skin" ); + const TUint KLeftParenthesis = '('; + + /** + * Resolves skin item id from pattern SKIN( () ). + * The colourGroupId in the syntax is optional, and if no value found then + * aColourValue will be -1 + * + * @param aItemId skin item id to fill + * @param aColourValue colour value to fill. + * @param aPath skin item id string + * + * @return ETrue if id was succesfully parsed. + */ + TBool ResolveSkinItemId( TAknsItemID& aItemId, TInt& aColourValue, const TDesC& aPath ) + { + // Syntax: skin( ) + TInt pos = aPath.FindF( KSkin ); + aColourValue = -1; + if( pos != KErrNotFound ) + { + // Skip skin token + pos += KSkin().Length(); + + // Initialize lexer + TLex lex( aPath.Mid( pos ) ); + lex.SkipSpace(); + + // Check left parenthesis + if (lex.Get() != KLeftParenthesis ) + { + return EFalse; + } + + lex.SkipSpace(); + + TInt majorId( 0 ); + TInt minorId( 0 ); + + // Resolve major id + TInt error = lex.Val( majorId ); + + // Resolve minor id + lex.SkipSpace(); + error |= lex.Val( minorId ); + + // initilize skin item id object + aItemId.Set( majorId, minorId ); + + lex.SkipSpace(); + TInt colorError = lex.Val( aColourValue ); + if ( colorError != KErrNone || aColourValue < 0) + { + aColourValue = -1; + } + + // Check error + return ( error == KErrNone ); + } + + return EFalse; + } + + /** + * Resolves MIF files filename and id from syntax + * mif_filename.mif#id. If the syntax is incorrect + * aId is -1 and filename zeroed and EFalse is returned + * + * @param aPath The path to extract the data from + * @param aId Id to fill + * @param aFilename Filename to fill + * @return ETrue if id was succesfully parsed. + */ + TBool ResolveMifIdAndPathL( const TDesC& aPath, TInt& aId, TDes& aFilename ) + { + // Syntax: mif_filename.mif#index + TInt pos = aPath.FindF( KHashmark ); + aFilename.Zero(); + if( pos != KErrNotFound ) + { + aFilename = (aPath.Left(pos)); + if ( ! EndsWith( aFilename, KMIFExtension ) ) + { + aFilename.Zero(); + return EFalse; + } + + TLex lex(aPath.Mid(pos+1)); + TInt error = lex.Val(aId); + if ( error != KErrNone ) + { + aId = -1; + return EFalse; + } + return ETrue; + } + return EFalse; + + + + } + + /** + * Loads a bitmap icon from a MIF-file loaded to Xuikon by using + * tag + * + * @param aNode Resource node + * @param aFilename The filename to load + * @param aBitmap The bitmap to fill + * @param aBitmapMask The mask to fill + * @param aMifId The id of the icon in the MIF-file + * + * @return KErrNone if loading was successful KErrNotFound if not + */ + TInt LoadMIFBitmapL( CXnNodeAppIf &aNode, + const TDesC &aPath, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aBitmapMask, + TInt aMifId ) + { + RFile tempFile; + + if ( aMifId < 0 ) + { + return KErrNotFound; + } + + TInt err = aNode.UiEngineL()->GetThemeResource( aPath, tempFile ); + + if ( err != KErrNone ) + { + tempFile.Close(); + return err; + } + + //Requires an open RFile handle + TIconProvider *iconProvider = + new (ELeave) TIconProvider(tempFile); + + CleanupStack::PushL( iconProvider ); + // Mask is next after bitmap + AknIconUtils::CreateIconL(aBitmap,aBitmapMask, *iconProvider, + aMifId+KMifIdFirst,aMifId+KMifIdFirst+1); + + CleanupStack::Pop(iconProvider); // iconProvider + + return KErrNone; + } + } + +namespace AiXmlUiController +{ + +RPointerArray< CXnNodeAppIf > + FindPropertyElementL( CXnNodeAppIf& aUiElement, const TDesC8& aPropertyClass ) + { + CXnBreadthFirstTreeIterator< CXnNodeAppIf >* iterator = + CXnBreadthFirstTreeIterator< CXnNodeAppIf >::NewL( aUiElement, + KDepthT ); + CleanupDeletePushL( iterator ); + + RPointerArray< CXnNodeAppIf > nodes; + + CleanupClosePushL( nodes ); + + CXnNodeAppIf* child = iterator->Value() ; + + while ( child ) + { + CXnProperty* classProperty = child->GetPropertyL( + XnPropertyNames::common::KClass ); + + if ( classProperty && ( classProperty->StringValue() == aPropertyClass ) ) + { + User::LeaveIfError( nodes.Append( child ) ); + } + + child = iterator->NextL(); + } + + CleanupStack::Pop( &nodes ); + + CleanupStack::PopAndDestroy( iterator ); + + return nodes; + } + +void FindPropertyElementL( RPointerArray< CXnNodeAppIf >& aArray, CXnNodeAppIf& aUiElement, const TDesC8& aPropertyClass ) + { + CXnBreadthFirstTreeIterator< CXnNodeAppIf >* iterator = + CXnBreadthFirstTreeIterator< CXnNodeAppIf >::NewL( aUiElement, + KDepthT ); + CleanupDeletePushL( iterator ); + + CXnNodeAppIf* child = iterator->Value(); + + while ( child ) + { + CXnProperty* classProperty = child->GetPropertyL( + XnPropertyNames::common::KClass ); + + if ( classProperty && ( classProperty->StringValue() == aPropertyClass ) ) + { + User::LeaveIfError( aArray.Append( child ) ); + } + + child = iterator->NextL(); + } + + CleanupStack::PopAndDestroy( iterator ); + } + +HBufC* PropertyValueL( const CXnNodeAppIf& aUiElement, + const TDesC8& aPropertyName ) + { + CXnProperty* property = aUiElement.GetPropertyL( aPropertyName ); + + if ( property ) + { + return property->StringValueL(); + } + + return NULL; + } + +const TDesC8* PropertyValue( const CXnNodeAppIf& aUiElement, + const TDesC8& aPropertyName ) + { + CXnProperty* property = NULL; + TRAP_IGNORE( property = aUiElement.GetPropertyL( aPropertyName ) ); + + if ( property ) + { + return &property->StringValue(); + } + + return NULL; + } + +void SetPropertyL( CXnNodeAppIf& aUiElement, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + CCssPropertyMap& aPropertyMap ) + { + CXnProperty* property = aUiElement.GetPropertyL( aPropertyName ); + + if ( !property ) + { + // Create new property + CreatePropertyL( aUiElement, aPropertyName, aPropertyValue ); + return; + } + + // Clone property for update + property = property->CloneL(); + CleanupStack::PushL( property ); + + CXnDomProperty* domProperty = property->Property(); + MXnDomListItem* item = domProperty->PropertyValueList().First(); + + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( item ); + + if ( value ) + { + TPtrC8 stringValue; + TReal floatValue(0); + + CXnDomPropertyValue::TPrimitiveValueType primitiveType( + CXnDomPropertyValue::EUnknown ); + TPropertyUpdateType updateType( EAbsoluteValue ); + + ParseCSSValue( aPropertyValue, + stringValue, + floatValue, + primitiveType, + updateType ); + + if ( primitiveType == CXnDomPropertyValue::EUnknown ) + { + primitiveType = SelectStringDataType( aPropertyName, aPropertyValue ); + } + + if ( updateType != EAbsoluteValue && + updateType != EIncrementalAddition && + updateType != EIncrementalSubtraction ) + { + // Use original value from property map + const TDesC8* elementId = PropertyValue( aUiElement, + XnPropertyNames::common::KId ); + CXnDomPropertyValue* original = NULL; + if( elementId ) + { + original = aPropertyMap.FindPropertyValue( + *elementId, + aPropertyName ); + } + else + { + User::Leave( KErrNotSupported ); + } + + if ( original ) + { + // Clone original value + value = original->CloneL(); + CleanupStack::PopAndDestroy( property ); // Old clone + CleanupStack::PushL( value ); + property = CXnProperty::NewL( aPropertyName, + value, + aUiElement.UiEngineL()->StringPool() ); + CleanupStack::Pop( value ); + CleanupStack::PushL( property ); + } + else + { + // store original value + aPropertyMap.StorePropertyValueL( *elementId, *property ); + } + } + + UpdatePropertyValueL( *value, + stringValue, + floatValue, + primitiveType, + updateType ); + + aUiElement.SetPropertyL( property ); + CleanupStack::Pop( property ); + } + else + { + User::Leave( KErrNotSupported ); + } + } + +void SetPropertiesToHashMapL( RArray& aArray, + CCssPropertyMap& aPropertyMap, + RPropertyHashMap& aPropertyHashMap ) + { + TBool propertyAdded = EFalse; + if( !aArray.Count() ) + { + return; + } + + CXnNodeAppIf& uiElement = aArray[0].Target(); + RPointerArray* propertyArray = NULL; + + propertyArray = aPropertyHashMap.Find( uiElement ); + + if( !propertyArray ) + { + // Create new one. + propertyArray = new(ELeave) RPropertyArray; + CleanupStack::PushL( propertyArray ); + aPropertyHashMap.InsertL( &uiElement, propertyArray ); + CleanupStack::Pop( propertyArray ); + } + + for( TInt i = 0; i < aArray.Count(); ++i ) + { + const TDesC8& propertyName = aArray[i].Name(); + const TDesC8& propertyValue = aArray[i].Value(); + + CXnProperty* property = uiElement.GetPropertyL( propertyName ); + + if ( !property ) + { + // Create new property + CreatePropertyL( uiElement, propertyName, propertyValue ); + propertyAdded = ETrue; + continue; + } + + // Clone property for update + property = property->CloneL(); + CleanupStack::PushL( property ); + + CXnDomProperty* domProperty = property->Property(); + MXnDomListItem* item = domProperty->PropertyValueList().First(); + + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( item ); + + if ( value ) + { + TPtrC8 stringValue; + TReal floatValue(0); + + CXnDomPropertyValue::TPrimitiveValueType primitiveType( + CXnDomPropertyValue::EUnknown ); + TPropertyUpdateType updateType( EAbsoluteValue ); + + ParseCSSValue( propertyValue, + stringValue, + floatValue, + primitiveType, + updateType ); + + if ( primitiveType == CXnDomPropertyValue::EUnknown ) + { + primitiveType = SelectStringDataType( propertyName, propertyValue ); + } + + if ( updateType != EAbsoluteValue ) + { + // Use original value from property map + const TDesC8* elementId = PropertyValue( uiElement, + XnPropertyNames::common::KId ); + CXnDomPropertyValue* original = NULL; + if( elementId ) + { + original = aPropertyMap.FindPropertyValue( + *elementId, + propertyName ); + } + else + { + User::Leave( KErrNotSupported ); + } + + if ( original ) + { + // Clone original value + value = original->CloneL(); + CleanupStack::PopAndDestroy( property ); // Old clone + CleanupStack::PushL( value ); + property = CXnProperty::NewL( propertyName, + value, + uiElement.UiEngineL()->StringPool() ); + CleanupStack::Pop( value ); + CleanupStack::PushL( property ); + } + else + { + // store original value + aPropertyMap.StorePropertyValueL( *elementId, *property ); + } + } + + UpdatePropertyValueL( *value, + stringValue, + floatValue, + primitiveType, + updateType ); + propertyArray->AppendL( property ); + CleanupStack::Pop( property ); + } + } + + if( !propertyAdded && !propertyArray->Count() ) + { + User::Leave( KErrNotSupported ); + } + } + +void SetPropertyArraysL( RPropertyHashMap& aPropertyHashMap ) + { + TPtrHashMapIter iter( aPropertyHashMap ); + iter.Reset(); + + const CXnNodeAppIf* targetNode = (const CXnNodeAppIf*)iter.NextKey(); + + while( targetNode ) + { + CXnNodeAppIf* targetNonConst = const_cast(targetNode); + RPointerArray* propertyArray = aPropertyHashMap.Find(*targetNode); + if( propertyArray ) + { + targetNonConst->SetPropertyArrayL( propertyArray ); // Assumes ownership + // of CXnProperty's in the array + // but not the array itself. + propertyArray->Close(); // Close and delete the array to free all memory. + delete propertyArray; + aPropertyHashMap.Remove( targetNode ); // Remove the key from hash map + // as the array is now destroyed. + iter.Reset(); // Reset the iterator to avoid panic. + } + targetNode = (CXnNodeAppIf*)iter.NextKey(); + } + + } + +CGulIcon* LoadIconLC( CXnNodeAppIf& aResource ) + { + // Resolve icon path + HBufC* pathBuffer = PropertyValueL( aResource, XnPropertyNames::image::KPath ); + CleanupStack::PushL( pathBuffer ); + + LeaveIfNull( pathBuffer, KErrNotFound ); + + CFbsBitmap *bitmap = NULL; + CFbsBitmap *mask = NULL; + CGulIcon* icon = NULL; + + TFileName fileName; + TInt mifId(0); + + //Assume that the filetype is not supported + TInt err = KErrNotSupported; + + // Resolve icon id + TAknsItemID iconId; + + // Possible color index + TInt colorValue(-1); + + TBool inSkin = ResolveSkinItemId( iconId, colorValue, *pathBuffer ); + + // SKIN( ()) + if ( inSkin ) + { + // Load from skin + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + err = KErrNone; + // Load the icon with colour group support but only if it is valid + // see AknsConstants.h for these + if ( colorValue >= EAknsCIQsnTextColorsCG1 && + colorValue <= EAknsCIQsnTextColorsCG62 ) + { + CFbsBitmap* bitmap = NULL; + CFbsBitmap* mask = NULL; + AknsUtils::CreateColorIconLC( + skin, + iconId, + KAknsIIDQsnTextColors, + colorValue, + bitmap, + mask, + KNullDesC, /* no backup */ + 0, /* no backup */ + 0, /* no backup */ + KRgbBlack ); + + if ( bitmap ) + { + icon = CGulIcon::NewL( bitmap, mask ); + } + else + { + err = KErrNotFound; + } + CleanupStack::Pop( 2 ); // bitmap, mask + } + // No colour group support + else + { + icon = AknsUtils::CreateGulIconL( skin, iconId, KNullDesC, 0, 0 ); + } + + if ( !icon ) // Syntax correct but icon not found + { + err = KErrNotFound; + } + } + + // MIF-file # + else if ( ResolveMifIdAndPathL( *pathBuffer, mifId, fileName ) ) + { + err = LoadMIFBitmapL( aResource, fileName, bitmap, mask, mifId ); + + if ( err == KErrNone && bitmap ) + { + // Ownership of bitmap and mask transferred to CGulIcon + icon = CGulIcon::NewL( bitmap, mask ); + } + else // Syntax correct but the icon was not found + { + err = KErrNotFound; + } + } + CleanupStack::PopAndDestroy( pathBuffer ); + CleanupStack::PushL( icon ); + + User::LeaveIfError( err ); + return icon; + } + +void SetPropertyToNodeL( + CXnNodeAppIf& aNode, + const TDesC8& aPropertyName, + const TDesC8& aNewValueString ) + { + // Set defined property to defined node. + CXnDomPropertyValue* newValue = CXnDomPropertyValue::NewL(aNode.UiEngineL()->StringPool()); + CleanupStack::PushL(newValue); + newValue->SetStringValueL(CXnDomPropertyValue::EString, aNewValueString); + CXnProperty* prop = CXnProperty::NewL(aPropertyName, newValue, aNode.UiEngineL()->StringPool()); + CleanupStack::PushL(prop); + aNode.SetPropertyL(prop); + CleanupStack::Pop(prop); + CleanupStack::Pop(newValue); + } + +} // namespace AiXmlUiController diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/aixmluiutils.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/aixmluiutils.inl Thu Dec 17 08:40:49 2009 +0200 @@ -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: Inline utilities +* +*/ + + +// This is an utility which absolutely should be in euser lib / e32std.h! +template< class PtrT > inline +PtrT* AiXmlUiController::LeaveIfNull( PtrT* aPtr, TInt aError ) + { + if ( !aPtr ) + { + User::Leave( aError ); + } + + return aPtr; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/aixuikoneventhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/aixuikoneventhandler.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,552 @@ +/* +* 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: Used for handling XUIKON events +* +*/ + + +#include "aixuikoneventhandler.h" +#include "aifweventhandler.h" +#include "aiuieventhandler.h" +#include "aiapplicationeventhandler.h" +#include "aiconsts.h" +#include "xmluicontroller.h" +#include "aixmluiconstants.h" +#include "aixmluiutils.h" +#include "contentrenderer.h" +#include +#include +#include +#include + +#include "xnnodeappif.h" +#include "xnuiengineappif.h" +#include "xnproperty.h" +#include "xndomnode.h" +#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" +#include "xndomproperty.h" +#include "xnplugindefs.h" +#include "aieventhandler.h" + +const TInt KAiMaxNumberCharacters = 5; + +namespace AiXmlUiController + { + class CAIXuikonEventHandler::CNullEventHandler : + public CBase, + public MAiFwEventHandler, + public MAiUiEventHandler, + public MAiApplicationEventHandler + { + + private: // from MAiFwEventHandler + 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 HandlePluginEvent( const TDesC& aParam ); + void HandlePluginEventL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aParam ); + TBool HasMenuItemL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ); + TBool RefreshContent( const TDesC& aContentCid ); + TBool QueryIsMenuOpen(); + void ProcessStateChange( TAifwStates aSate ); + + private: // from MAiUiEventHandler + TBool HandleUiEvent( TAny* aEvent, const TDesC8& aParam ); + + private: // from MAiApplicationEventHandler + TBool HandleApplicationEvent( TInt aEvent, const TDesC8& aParam ); + }; + } + +using namespace AiXmlUiController; +using namespace AiUiDef::xml::event; + +// ======== MEMBER FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::CAIXuikonEventHandler() +// ---------------------------------------------------------------------------- +// +CAIXuikonEventHandler::CAIXuikonEventHandler( CXmlUiController& aUiController, + CContentRenderer& aRenderer ) + : iUiController(aUiController), + iContentRenderer(aRenderer) + { + } + +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::ConstructL() +// ---------------------------------------------------------------------------- +// +void CAIXuikonEventHandler::ConstructL() + { + iStrParser = AiUtility::CreateStrParserL(); + iNullEventHandler = new ( ELeave ) CNullEventHandler; + iFwEventHandler = iNullEventHandler; + iUiEventHandler = iNullEventHandler; + iApplicationEventHandler = iNullEventHandler; + } + +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::NewL() +// ---------------------------------------------------------------------------- +// +CAIXuikonEventHandler* CAIXuikonEventHandler::NewL( + CXmlUiController& aUiController, + CContentRenderer& aRenderer ) + { + CAIXuikonEventHandler* self = + new ( ELeave ) CAIXuikonEventHandler( aUiController, aRenderer ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::~CAIXuikonEventHandler() +// ---------------------------------------------------------------------------- +// +CAIXuikonEventHandler::~CAIXuikonEventHandler() + { + delete iNullEventHandler; + delete iVolumeEvent; + + Release( iStrParser ); + } + +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::SetFwEventHandler() +// ---------------------------------------------------------------------------- +// +void CAIXuikonEventHandler::SetFwEventHandler( + MAiFwEventHandler* aFwEventHandler ) + { + if ( aFwEventHandler ) + { + iFwEventHandler = aFwEventHandler; + } + else + { + iFwEventHandler = iNullEventHandler; + } + } + +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::SetUiEventHandler() +// ---------------------------------------------------------------------------- +// +void CAIXuikonEventHandler::SetUiEventHandler( + MAiUiEventHandler* aUiEventHandler ) + { + if ( aUiEventHandler ) + { + iUiEventHandler = aUiEventHandler; + } + else + { + iUiEventHandler = iNullEventHandler; + } + } + +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::SetApplicationEventHandler() +// ---------------------------------------------------------------------------- +// +void CAIXuikonEventHandler::SetApplicationEventHandler( + MAiApplicationEventHandler* aApplicationEventHandler ) + { + if ( aApplicationEventHandler ) + { + iApplicationEventHandler = aApplicationEventHandler; + } + else + { + iApplicationEventHandler = iNullEventHandler; + } + } + +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::HandleXuikonEventL() +// ---------------------------------------------------------------------------- +// +void CAIXuikonEventHandler::HandleXuikonEventL( CXnNodeAppIf& aOrigin, + CXnNodeAppIf& /*aTrigger*/, CXnDomNode& aTriggerDefinition, + CXnDomNode& aEvent ) + { + DispatchEventL( aEvent, aOrigin, aTriggerDefinition ); + } + +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::HandleXuikonActionL() +// ---------------------------------------------------------------------------- +// +inline TBool CAIXuikonEventHandler::HandleSystemEventL( + const TDesC8& aEventText, CXnDomNode& aEvent ) + { + const TDesC8& prefix( AiUiDef::xml::event::KEventHandlerPrefix ); + TInt pos( aEventText.Find( prefix ) ); + if ( pos != 0 ) + { + // Event is not targeted here + return EFalse; + } + CAIEventHandler* handler = CAIEventHandler::NewL( iUiController ); + CleanupStack::PushL( handler ); + handler->HandleEventL( aEventText, aEvent ); + CleanupStack::PopAndDestroy( handler ); + return ETrue; + } + + +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::ParseParameterStringL() +// ---------------------------------------------------------------------------- +// +void CAIXuikonEventHandler::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 ); + } + +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::HandleUiEventL() +// ---------------------------------------------------------------------------- +// +inline TBool CAIXuikonEventHandler::HandleUiEventL( const TDesC8& aEventText, + CXnNodeAppIf& aOrigin ) + { + if ( aEventText.Left( KUiEventPrefix().Length() ) == KUiEventPrefix ) + { + iUiEventHandler->HandleUiEvent( (TAny*)&aOrigin, aEventText ); + + return ETrue; + } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::HandleApplicationEventL() +// ---------------------------------------------------------------------------- +// +inline TBool CAIXuikonEventHandler::HandleApplicationEventL( + const TDesC8& aEventText ) + { + return iApplicationEventHandler->HandleApplicationEvent( 0, aEventText ); + } + +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::VolumeChanged() +// ---------------------------------------------------------------------------- +// +void CAIXuikonEventHandler::VolumeChanged( TInt aValue ) + { + TRAP_IGNORE( + // Ignore errors, missing one event is not fatal enough to panic + HBufC* volumeString( HBufC::NewLC( KAiMaxNumberCharacters ) ); + + volumeString->Des().Num( aValue ); + + HBufC* eventString( iVolumeEvent->AllocLC() ); + + TInt foundAt( eventString->Des().Find( KTargetSliderVolumeValue ) ); + + if( foundAt >= 0 ) + { + eventString->Des().Replace( foundAt, + KTargetSliderVolumeValue().Length(), *volumeString ); + } + + // TODO: implement namespace properly + iFwEventHandler->HandlePluginEvent( *eventString ); + + CleanupStack::PopAndDestroy( 2, volumeString ); + ); // TRAP_IGNORE + } + +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::HandlePluginEventL() +// ---------------------------------------------------------------------------- +// +inline +void CAIXuikonEventHandler::HandlePluginEventL( CXnDomNode& aEvent ) + { + const TDesC8& event8( + aEvent.AttributeValue( XnPropertyNames::action::event::KName ) ); + + HBufC16* event( NULL ); + + event = iStrParser->CopyToBufferL( event, event8 ); + + if ( !event || *event == KNullDesC ) + { + // No event defined + return; + } + + CleanupStack::PushL( event ); + + TXnUiEngineAppIf* engine( iUiController.UiEngineL() ); + + const TDesC8& broadcast( + aEvent.AttributeValue( XnPropertyNames::action::event::KBroadcast ) ); + + if ( broadcast == XnPropertyNames::KTrue ) + { + // Broadcast events are allowed only from view's namespace + if ( engine->ActiveView()->Namespace() == aEvent.Namespace() ) + { + _LIT8( KGlobal, "global" ); + + // Get all plugins + RPointerArray< CXnNodeAppIf > + list( engine->FindContentSourceNodesL( KGlobal ) ); + + CleanupClosePushL( list ); + + // Broadcast event to all plugins + for ( TInt i = 0; i < list.Count(); i++ ) + { + TAiPublisherInfo info; + + iUiController.PublisherInfoL( *list[i], info ); + + // Forward event to AiFw + iFwEventHandler->HandlePluginEventL( info, *event ); + } + + CleanupStack::PopAndDestroy( &list ); + } + } + else + { + const TDesC8& ns( aEvent.Namespace() ); + + // Get plugins from the event's namespace + RPointerArray< CXnNodeAppIf > + list( engine->FindContentSourceNodesL( ns ) ); + + CleanupClosePushL( list ); + + if ( list.Count() == 1 ) + { + // Only one data plugin in this namespace, + // it must handle this event. + TAiPublisherInfo info; + + iUiController.PublisherInfoL( *list[0], info ); + + // Forward event to AiFw + iFwEventHandler->HandlePluginEventL( info, *event ); + } + else if ( list.Count() > 1 ) + { + const TDesC8& destination( + aEvent.AttributeValue( + XnPropertyNames::action::event::KDestination ) ); + + // Multiple data plugins in this namespace, + // resolve destination + CXnNodeAppIf* eventHandler( + engine->FindNodeByIdL( destination, ns ) ); + + if ( eventHandler ) + { + TAiPublisherInfo info; + + iUiController.PublisherInfoL( *eventHandler, info ); + + // Forward event to AiFw + iFwEventHandler->HandlePluginEventL( info, *event ); + } + else + { + // No exact destination defined, + // try to find a correct plugin based on event + const TInt pos( event->Locate( KPluginEventSeparator ) ); + + if ( pos != KErrNotFound ) + { + // Extract plugin name + TPtrC pluginName( event->Left( pos ) ); + + for ( TInt i = 0; i < list.Count(); i++ ) + { + TAiPublisherInfo info; + + iUiController.PublisherInfoL( *list[i], info ); + + if( info.iName == pluginName ) + { + // Forward Plug-in events to AI FW for further + // dispatching to the target Plug-in + iFwEventHandler->HandlePluginEventL( info,*event ); + break; + } + } + } + } + } + + CleanupStack::PopAndDestroy( &list ); + } + + CleanupStack::PopAndDestroy( event ); + } + +// ---------------------------------------------------------------------------- +// CAIXuikonEventHandler::DispatchEventL() +// ---------------------------------------------------------------------------- +// +void CAIXuikonEventHandler::DispatchEventL( CXnDomNode& aEvent, + CXnNodeAppIf& aOrigin, CXnDomNode& /*aTriggerDefinition*/ ) + { + const TDesC8& aEventString8( + aEvent.AttributeValue( XnPropertyNames::action::event::KName ) ); + + // First check if the event is a XUIKON-specific event + if( !HandleSystemEventL( aEventString8, aEvent ) ) + { + // Next check if it is a UI event + if( !HandleUiEventL( aEventString8, aOrigin ) ) + { + // Next check if it is an application event + if( !HandleApplicationEventL( aEventString8 ) ) + { + // Assume that it is a Plug-in event + HandlePluginEventL( aEvent ); + } + } + } + } + +// CAIXuikonEventHandler::CNullEventHandler +void CAIXuikonEventHandler::CNullEventHandler::AppEnvReadyL() + { + } + +void CAIXuikonEventHandler::CNullEventHandler::HandleUiReadyEventL + ( CAiUiController& /*aUiController*/ ) + { + } + +void CAIXuikonEventHandler::CNullEventHandler::HandleActivateUI() + { + } + +void CAIXuikonEventHandler::CNullEventHandler::HandlePluginEvent + ( const TDesC& /*aParam*/ ) + { + } + +void CAIXuikonEventHandler::CNullEventHandler::HandlePluginEventL + (const TAiPublisherInfo& /*aPublisherInfo*/, const TDesC& /*aParam*/ ) + { + } + +TBool CAIXuikonEventHandler::CNullEventHandler::HasMenuItemL( + const TAiPublisherInfo& /*aPublisherInfo*/, const TDesC& /*aMenuItem*/ ) + { + return EFalse; + } + +void CAIXuikonEventHandler::CNullEventHandler::HandleUiShutdown + ( CAiUiController& /*aUiController*/ ) + { + } + +TBool CAIXuikonEventHandler::CNullEventHandler::RefreshContent( + const TDesC& /*aContentCid*/ ) + { + return EFalse; + } + +void CAIXuikonEventHandler::CNullEventHandler::CriticalStartupPhaseOver( + TInt /*aStageInteger*/ ) + { + } + +TBool CAIXuikonEventHandler::CNullEventHandler::QueryIsMenuOpen() + { + 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*/) + { + return EFalse; + } + +TBool CAIXuikonEventHandler::CNullEventHandler::HandleApplicationEvent + (TInt /*aEvent*/, const TDesC8& /*aParam*/) + { + return EFalse; + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/aixuikonmenueventhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/aixuikonmenueventhandler.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1742 @@ +/* +* 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 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/application.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/application.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,80 @@ +/* +* 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: Application class +* +*/ + + +#include +#include +#include "application.h" +#include "document.h" +#include +#include +#include "debug.h" + +namespace AiXmlUiController { + + +_LIT( KAiXmlUiResourceDrive, "z:" ); +_LIT( KAiXmlUiResourceFile, "Ai3XmlUi.rsc" ); + + +// ========== MEMBER FUNCTIONS ================================================ + +CApplication::CApplication(TUid aAppUid, CXmlUiController& aUiCtl) + : CXnApplication(aAppUid), + iUiCtl(aUiCtl) + { + } + +CApplication* CApplication::New(CXmlUiController& aUiCtl) + { + CApplication* self = NULL; + + __TIME("XML UI: Create Application", + self = new CApplication(KUidXmlUiApp, aUiCtl); + ) + __HEAP("XML UI: Create Application"); + + return self; + } + +CApplication::~CApplication() + { + } + +CApaDocument* CApplication::CreateDocumentL() + { + return CDocument::NewL(*this, iUiCtl); + } + +TUid CApplication::AppDllUid() const + { + return KUidXmlUiApp; + } + +TFileName CApplication::ResourceFileName() const + { + + TFileName resFile; + resFile.Append( KAiXmlUiResourceDrive ); + resFile.Append( KDC_APP_RESOURCE_DIR ); + resFile.Append( KAiXmlUiResourceFile ); + BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resFile ); + + return resFile; + } + +} // namespace AiXmlUiController diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/appui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/appui.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,490 @@ +/* +* 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: App ui +* +*/ + +// System includes +#include +#include // For status pane layout resource ids +#include +#include // For RProperty +#include +#include // Avkon dialog shutter. +#include + +// User includes +#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" + +using namespace AiXmlUiController; + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CAppUi::CAppUi +// ---------------------------------------------------------------------------- +// +CAppUi::CAppUi( CXmlUiController& aUiCtl, TUid aAppUid ) + : CXnAppUiAdapter( aAppUid ), iUiCtl( aUiCtl ) + { + } + +// ---------------------------------------------------------------------------- +// CAppUi::ConstructL() +// ---------------------------------------------------------------------------- +// +void CAppUi::ConstructL() + { + AI3_PERF_START(perfdata, "xmluicontroller: CAppUi::ConstructL") + + // Always reset the phoneforward P&S key on startup just in case + RProperty::Set(KPSUidAiInformation, + KActiveIdleForwardNumericKeysToPhone, + EPSAiForwardNumericKeysToPhone); + + // 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(); + ) + + // Register for XML UI view activation & deactivation + AddViewActivationObserverL( this ); + + // Disable CCoeEnv exit checks. + // Active Idle Framework will perform the checks. + iCoeEnv->DisableExitChecks(ETrue); + + __TIME("XML UI: Construct Content Renderer", + iContentRenderer = CContentRenderer::NewL( *this ); + ) + __HEAP("XML UI: Construct Content Renderer"); + + TXnUiEngineAppIf* uiEngine = UiEngineL(); + __ASSERT_ALWAYS( uiEngine, Panic(ECriticalPointerNull) ); + + iUiCtl.SetObserver( *iContentRenderer ); + + iContentRenderer->SetEventHandler( *iUiCtl.FwEventHandler() ); + + 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 ); + + iIsEditModeActive = EFalse; + + + __HEAP("XML UI: Done - Construct App UI"); + AI3_PERF_STOP(perfdata, "xmluicontroller: CAppUi::ConstructL") + } + +// ---------------------------------------------------------------------------- +// CAppUi::NewL() +// ---------------------------------------------------------------------------- +// +CAppUi* CAppUi::NewL( CXmlUiController& aUiCtl ) + { + CAppUi* self = new ( ELeave ) CAppUi( aUiCtl, KUidXmlUiApp ); + + // ConstructL is called by the UI framework + + return self; + } + +// ---------------------------------------------------------------------------- +// CAppUi::~CAppUi() +// ---------------------------------------------------------------------------- +// +CAppUi::~CAppUi() + { + delete iHelper; + delete iEventHandler; + delete iContentRenderer; + delete iIdleIntegration; + } + +// ---------------------------------------------------------------------------- +// CAppUi::PrepareToExit() +// ---------------------------------------------------------------------------- +// +void CAppUi::PrepareToExit() + { + iUiCtl.FwEventHandler()->HandleUiShutdown( iUiCtl ); + + CXnAppUiAdapter::PrepareToExit(); + } + +// ---------------------------------------------------------------------------- +// CAppUi::HandleForegroundEventL() +// ---------------------------------------------------------------------------- +// +void CAppUi::HandleForegroundEventL( TBool aForeground ) + { + CXnAppUiAdapter::HandleForegroundEventL( aForeground ); + + if( iUiFwObserver ) + { + iUiFwObserver->HandleForegroundEvent( aForeground ); + } + } + +// ---------------------------------------------------------------------------- +// CAppUi::HandleCommandL() +// ---------------------------------------------------------------------------- +// +void CAppUi::HandleCommandL(TInt aCommand) + { + switch( aCommand ) + { + case EEikCmdExit: + { + Exit(); + break; + } + case EAknSoftkeyExit: + case EAknCmdExit: + { +#ifdef _DEBUG + + Exit(); + break; +#endif // _DEBUG + } + default: + { + break; + } + } + } + +// ---------------------------------------------------------------------------- +// CAppUi::HandleResourceChangeL() +// ---------------------------------------------------------------------------- +// +void CAppUi::HandleResourceChangeL( TInt aType ) + { + CXnAppUiAdapter::HandleResourceChangeL( aType ); + + if( iUiFwObserver ) + { + iUiFwObserver->HandleResourceChange( aType ); + } + } + +// ---------------------------------------------------------------------------- +// CAppUi::HandleWsEventL() +// ---------------------------------------------------------------------------- +// +void CAppUi::HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* aDestination ) + { + if( aEvent.Type() == KAknUidValueEndKeyCloseEvent ) + { + // End key close event, run dialog shutter + // to dismiss open dialogs + if ( IsDisplayingMenuOrDialog() ) + { + AknDialogShutter::ShutDialogsL( + *static_cast< CEikonEnv* >( CCoeEnv::Static() ) ); + } + else + { + TKeyEvent key; + + key.iScanCode = EStdKeyNo; + key.iCode = EStdKeyNull; + key.iModifiers = 0; + key.iRepeats = 0; + + iCoeEnv->SimulateKeyEventL( key, EEventKey ); + } + } + + if( iIdleIntegration ) + { + // Forward window server events first to idle integration library + iIdleIntegration->HandleWsEventL( aEvent, aDestination ); + } + + // Call base class to let the UI framework handle the event + // Don't trap here, because there could be leaves which need to + // handled by base classes/UI framework like KLeaveExit, KErrNoMemory etc. + CXnAppUiAdapter::HandleWsEventL( aEvent, aDestination ); + } + +// ---------------------------------------------------------------------------- +// CAppUi::HandleXuikonEventL() +// ---------------------------------------------------------------------------- +// +void CAppUi::HandleXuikonEventL( CXnNodeAppIf& aOrigin, + CXnNodeAppIf& aTrigger, + CXnDomNode& aTriggerDefinition, + CXnDomNode& aEvent ) + { + __PRINTS("*** UC: Init - Event Management ***"); + + if( iEventHandler ) + { + __TIME("UC: Event Management", + iEventHandler->HandleXuikonEventL( aOrigin, + aTrigger, + aTriggerDefinition, + aEvent ); + ); + } + __PRINTS("*** UI: Done - Event Management"); + } + +// ---------------------------------------------------------------------------- +// CAppUi::LoadDataPluginsL() +// ---------------------------------------------------------------------------- +// +void CAppUi::LoadDataPluginsL( RPointerArray< CXnNodeAppIf >& aList ) + { + for( TInt i = 0; i < aList.Count(); i++ ) + { + TAiPublisherInfo info; + + iUiCtl.PublisherInfoL( *aList[i], info ); + + iUiCtl.FwEventHandler()->HandleLoadPluginL( info ); + } + } + +// ---------------------------------------------------------------------------- +// CAppUi::LoadNativeDataPluginsL() +// ---------------------------------------------------------------------------- +// +void CAppUi::LoadNativeDataPluginsL() + { + if ( !iNativePluginsLoaded ) + { + 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; + } + } + +// ---------------------------------------------------------------------------- +// 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() +// ---------------------------------------------------------------------------- +// +void CAppUi::DestroyNativeDataPluginsL() + { + 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; + } + } + +// ---------------------------------------------------------------------------- +// CAppUi::DynInitMenuItemL() +// ---------------------------------------------------------------------------- +// +TBool CAppUi::DynInitMenuItemL( const TDesC& aItemType, + RPointerArray< CXnNodeAppIf >* aList ) + { + _LIT( KOnline, "hs_online" ); + _LIT( KOffline, "hs_offline" ); + + TBool retval( EFalse ); + + if( aItemType == KOnline ) + { + return iHelper->ShowOnlineItem(); + } + else if( aItemType == KOffline ) + { + return iHelper->ShowOfflineItem(); + } + else if( aList ) + { + RPointerArray< CXnNodeAppIf >& list( *aList ); + + for( TInt i = 0; !retval && i < list.Count(); i++ ) + { + TAiPublisherInfo info; + + iUiCtl.PublisherInfoL( *list[i], info ); + + retval = iUiCtl.FwEventHandler()->HasMenuItemL( info, aItemType ); + } + } + + return retval; + } + +// ---------------------------------------------------------------------------- +// 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() ); + } + } + +// ---------------------------------------------------------------------------- +// CAppUi::UiController() +// ---------------------------------------------------------------------------- +// +CXmlUiController& CAppUi::UiController() const + { + return iUiCtl; + } + +// ---------------------------------------------------------------------------- +// CAppUi::HandlePageSwitch() +// ---------------------------------------------------------------------------- +// +void CAppUi::HandlePageSwitch() + { + iUiCtl.FwEventHandler()->ProcessStateChange( EAifwPageSwitch ); + } + +// ---------------------------------------------------------------------------- +// CAppUi::HandleEnterEditModeL() +// ---------------------------------------------------------------------------- +// +void CAppUi::HandleEnterEditModeL( TBool aEnter ) + { + if ( aEnter ) + { + DestroyNativeDataPluginsL(); + iIsEditModeActive = ETrue; + } + else + { + LoadNativeDataPluginsL(); + iIsEditModeActive = EFalse; + } + } + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/contentpublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/contentpublisher.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,430 @@ +/* +* 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: Content Publishing Service interface. +* +*/ + +#include "contentpublisher.h" +#include "globalqueryhandler.h" + +#include +#include +#include +#include +#include +#include "xmluicontroller.h" +#include +#include // StringLoader + +using namespace AiXmlUiController; + +_LIT8( KCPService, "Service.ContentPublishing" ); +_LIT8( KCPInterface, "IDataSource" ); + +_LIT8( KType, "type" ); +_LIT( KCpData, "cp_data" ); + +_LIT8( KPublisherId, "publisher" ); +_LIT8( KContentTypeId, "content_type" ); +_LIT8( KContentId, "content_id" ); +_LIT8( KResults, "results" ); + +_LIT(KAI3HSPublisher,"ai3homescreen"); +_LIT(KContentType,"wideimage"); + +_LIT8( KAPStatus, "apstatus"); +_LIT(KNetwork, "network"); + +_LIT( KDisConnected, "disconnected"); +_LIT( KConnected, "connected"); + +_LIT(KPublisher16, "publisher"); + + +_LIT8( KRequestNotification, "RequestNotification" ); +_LIT8( KDataMap, "data_map" ); + +_LIT8( KItem, "item" ); +_LIT8( KAdd, "Add" ); +_LIT8( KGetList, "GetList" ); +_LIT8( KFilter, "filter" ); +_LIT8( KWidth, "width"); +_LIT8( KHeight, "height"); +_LIT8( KChangeInfo, "change_info" ); +// ============================ LOCAL FUNCTIONS =============================== + + +static void DoResetAndDestroy( TAny* aPtr ) + { + __ASSERT_DEBUG( aPtr, User::Invariant() ); + reinterpret_cast< RCriteriaArray* >( aPtr )->ResetAndDestroy(); + } + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// Two-phased constructor. Can leave. +// ----------------------------------------------------------------------------- +// +CContentPublisher* CContentPublisher::NewL(CXmlUiController& aUiController) + { + CContentPublisher* self = new (ELeave) CContentPublisher(aUiController); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +CContentPublisher::~CContentPublisher() + { + TRAP_IGNORE(UnRegisterListenerL()); + if( iCpsInterface ) + { + iCpsInterface->Close(); + iCpsInterface = NULL; + } + if( iServiceHandler ) + { + iServiceHandler->Reset(); + delete iServiceHandler; + iServiceHandler = NULL; + } + delete iGlobalQueryHandler; + delete iGlobalConfirmationQuery; + } + +// ----------------------------------------------------------------------------- +// C++ default constructor. Must not leave. +// ----------------------------------------------------------------------------- +// +CContentPublisher::CContentPublisher(CXmlUiController& aUiController): iUiController( aUiController ) + { + } + +// ----------------------------------------------------------------------------- +// 2nd phase constructor. Can leave. +// ----------------------------------------------------------------------------- +// +void CContentPublisher::ConstructL() + { + InitCpsInterfaceL(); + RegisterListenerL(); + iGlobalQueryHandler = CGlobalQueryHandler::NewL(iUiController); + iGlobalConfirmationQuery = CAknGlobalConfirmationQuery::NewL(); + + } + +// ----------------------------------------------------------------------------- +// Publishes a given width and height to Content Publishing Service +// ----------------------------------------------------------------------------- +// +void CContentPublisher::PublishSizeL( const TDesC& aElementName, + TInt aWidth, TInt aHeight ) + { + AddDataL( KAI3HSPublisher() ,KContentType(), aElementName, + aWidth, KWidth, aHeight, KHeight ); + } + +// ----------------------------------------------------------------------------- +// Uses the CPS interface to add given data +// ----------------------------------------------------------------------------- +// +void CContentPublisher::AddDataL( + const TDesC& aPublisherId, const TDesC& aContentType, const TDesC& aContentId, + const TInt aData1, const TDesC8& aDataKey1, + const TInt aData2, const TDesC8& aDataKey2 ) + { + CLiwGenericParamList& inparam = iServiceHandler->InParamListL(); + CLiwGenericParamList& outparam = iServiceHandler->OutParamListL(); + + TLiwGenericParam cptype( KType, TLiwVariant( KCpData )); + cptype.PushL(); + + inparam.AppendL( cptype ); + + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); + CLiwDefaultMap* map = CLiwDefaultMap::NewLC(); + + // Add data to data map + map->InsertL( aDataKey1, TLiwVariant( aData1 )); + map->InsertL( aDataKey2, TLiwVariant( aData2 )); + + // Create content data map + cpdatamap->InsertL( KPublisherId, TLiwVariant( aPublisherId )); + cpdatamap->InsertL( KContentTypeId, TLiwVariant( aContentType )); + cpdatamap->InsertL( KContentId, TLiwVariant( aContentId )); + cpdatamap->InsertL( KDataMap, TLiwVariant(map) ); + + TLiwGenericParam item( KItem, TLiwVariant( cpdatamap )); + item.PushL(); + + inparam.AppendL( item ); + + iCpsInterface->ExecuteCmdL( KAdd , inparam, outparam); + + CleanupStack::PopAndDestroy( &item ); + CleanupStack::PopAndDestroy( map ); + CleanupStack::PopAndDestroy( cpdatamap ); + CleanupStack::PopAndDestroy( &cptype ); + + outparam.Reset(); + inparam.Reset(); + } + +// ----------------------------------------------------------------------------- +// Uses the CPS interface to get data +// ----------------------------------------------------------------------------- +// +void CContentPublisher::GetDataL( + const TDesC& aPublisherId, const TDesC& aContentType, const TDesC& aContentId, + CLiwDefaultMap* aOutDataMap) + { + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + TLiwGenericParam type( KType, TLiwVariant( KCpData ) ); + inParamList.AppendL( type ); + + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); + + // Create content data map + cpdatamap->InsertL( KPublisherId, TLiwVariant( aPublisherId )); + cpdatamap->InsertL( KContentTypeId, TLiwVariant( aContentType )); + cpdatamap->InsertL( KContentId, TLiwVariant( aContentId )); + + //append filter to input param + TLiwGenericParam item( KFilter, TLiwVariant( cpdatamap )); + inParamList.AppendL( item ); + CleanupStack::PopAndDestroy( cpdatamap ); + + 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(); + variant.PushL(); + 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->FindL( KDataMap, variant) ) + { + variant.Get( *aOutDataMap ); + } + CleanupStack::PopAndDestroy( map ); + } + iterable->Reset(); + CleanupStack::PopAndDestroy( &variant ); + variant.Reset(); + } + outParamList.Reset(); + + } + +// ----------------------------------------------------------------------------- +// Gets the CPS messaging interface +// ----------------------------------------------------------------------------- +// +void CContentPublisher::InitCpsInterfaceL() + { + if( !iServiceHandler ) + { + iServiceHandler = CLiwServiceHandler::NewL(); + } + + CLiwGenericParamList& inParam = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParam = iServiceHandler->OutParamListL(); + + RCriteriaArray a; + TCleanupItem item( DoResetAndDestroy, &a ); + CleanupStack::PushL( item ); + + CLiwCriteriaItem* crit = CLiwCriteriaItem::NewLC( KLiwCmdAsStr, KCPInterface, + KCPService ); + crit->SetServiceClass( TUid::Uid(KLiwClassBase) ); + + a.AppendL(crit); + + CleanupStack::Pop( crit ); + + iServiceHandler->AttachL(a); + iServiceHandler->ExecuteServiceCmdL( *crit, inParam, outParam ); + + CleanupStack::PopAndDestroy(); // item; + + // 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; + } + +void CContentPublisher::RegisterListenerL() + { + CLiwGenericParamList& inparam = iServiceHandler->InParamListL(); + CLiwGenericParamList& outparam = iServiceHandler->OutParamListL(); + CLiwDefaultMap* reqFilter = CLiwDefaultMap::NewLC(); + + // Listen all the information(contentId) from publisher + reqFilter->InsertL( KPublisherId, TLiwVariant( KAI3HSPublisher )); + reqFilter->InsertL( KContentTypeId, TLiwVariant(KPublisher16 )); + + // Type of the registry (content registry) + inparam.AppendL(TLiwGenericParam(KType, TLiwVariant(KCpData))); + // fill in input list for RequestNotification command + inparam.AppendL(TLiwGenericParam(KFilter, TLiwVariant(reqFilter))); + + TRAP_IGNORE( iCpsInterface->ExecuteCmdL( + KRequestNotification, + inparam, + outparam, + 0, + this ) ); + + outparam.Reset(); + inparam.Reset(); + CleanupStack::PopAndDestroy(reqFilter ); + } + +void CContentPublisher::UnRegisterListenerL() + { + CLiwGenericParamList& inparam = iServiceHandler->InParamListL(); + CLiwGenericParamList& outparam = iServiceHandler->OutParamListL(); + + // Unregister the reuqest notification + TRAP_IGNORE( iCpsInterface->ExecuteCmdL( + KRequestNotification, + inparam, + outparam, + KLiwOptCancel, + this ) ); + + outparam.Reset(); + inparam.Reset(); + } + +TInt CContentPublisher::HandleNotifyL( + TInt aErrorCode, + 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(); + // Iter through list content + for (TInt i = 0; i < changeMapsList->Count() ; ++i) + { + if ( changeMapsList->AtL(i, variant) ) + { + const CLiwMap* map = variant.AsMap(); + if( map->FindL( KPublisherId, variant) ) + { + HBufC* publisher = variant.AsDes().AllocLC(); + if ( publisher && ( publisher->Des() == KAI3HSPublisher ) + && map->FindL( KContentTypeId, variant) ) + { + HBufC* contentType = variant.AsDes().AllocLC(); + if ( contentType && ( contentType->Des() == KPublisher16 ) + && map->FindL( KContentId, variant ) ) + { + HBufC* contentId = variant.AsDes().AllocLC(); + if ( contentId ) + { + HandlePublisherInfoL( *contentId ); + } + CleanupStack::PopAndDestroy( contentId ); + } + CleanupStack::PopAndDestroy( contentType ); + } + CleanupStack::PopAndDestroy( publisher ); + } + } + } + CleanupStack::PopAndDestroy(&variant); + } + return aErrorCode; + } + +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() ) + { + 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 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/contentrenderer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/contentrenderer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1688 @@ +/* +* 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: Content renderer implementation +* +*/ + +// System includes +#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" + +using namespace AiXmlUiController; +using namespace AiUiDef::xml; +using namespace XnTextInterface; +using namespace XnImageInterface; + +namespace + { + 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; + } + + /** + * 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) + */ + 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; + } + } + } + } + + /** + * 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; + } + + 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; + + }; + + /** + * 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( TPtrHashMapIter< TDesC, TInt >& aIterator ) + : iIterator( aIterator ) + { + } + +void TMapCleanupItem::Release() + { + // Delete current key and value + const TDesC* key = iIterator.CurrentKey(); + const TInt* value = iIterator.CurrentValue(); + + delete key; + delete value; + + // Remove mapping from the map. + iIterator.RemoveCurrent(); + } + + + +// ============================ MEMBER FUNCTIONS =============================== + +CContentRenderer::CContentRenderer( CAppUi& aAppUi ) + : iAppUi( aAppUi ) + { + } + +void CContentRenderer::ConstructL() + { + iContentPriorityMap = AiUtility::CContentPriorityMap::NewL(); + iPropertyMap = CCssPropertyMap::NewL(); + iFactory = CTransactionFactoryImpl::NewL(*iContentPriorityMap, + *iPropertyMap); + iStack = CActiveTransactionStack::NewL(); + iNodeIdGenerator = CXmlNodeIdGenerator::NewL(); + iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + iPolicyEvaluator = CPolicyEvaluator::NewL(); + } + +CContentRenderer* CContentRenderer::NewL( CAppUi& aAppUi ) + { + CContentRenderer* self = new( ELeave ) CContentRenderer( aAppUi ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +CContentRenderer::~CContentRenderer() + { + delete iPolicyEvaluator; + + if ( iTimer ) + { + iTimer->Cancel(); + delete iTimer; + } + + delete iNodeIdGenerator; + + if ( iStack ) + { + while ( !iStack->IsEmpty() ) + { + MTransaction* tr = iStack->Pop(); + iFactory->ReleaseTransaction( tr ); + } + + delete iStack; + } + + delete iFactory; + + iRefreshableUiElements.ResetAndDestroy(); + + delete iNTClass; + + delete iPropertyMap; + + delete iContentPriorityMap; + delete iCallbackHandler; + } + +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 ); + } + } + } + +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 ) + { + SetImmediateMode( ETrue ); + } + + return error; + } + +TInt CContentRenderer::Commit( TInt aTxId ) + { + // Remove transaction with aTxId from stack + MTransaction* tr = iStack->Remove( aTxId ); + + if ( tr ) + { + // Commit transaction + RPropertyHashMap propertyHashMap; + + TBool layoutChanged( EFalse ); + + TRAPD( error, tr->CommitL( layoutChanged, propertyHashMap ) ); + if( error == KErrNone ) + { + TRAP_IGNORE( SetPropertyArraysL( propertyHashMap ) ); + } + propertyHashMap.Close(); + + __TICK("XML UI: Commit transaction"); + __HEAP("XML UI: Commit transaction"); + __PRINT(__DBG_FORMAT("\t[I]\tXML UI: Commit transaction id=%d"), aTxId); + + StartContentRefresh(); + + TRAP_IGNORE + ( + iAppUi.UiEngineL()->RenderUIL(); //jtm+++ + ProcessContentChangesL( *tr ); + ); + + + iFactory->ReleaseTransaction( tr ); + + return error; + } + + return KErrNotSupported; + } + +void CContentRenderer::ProcessContentChangesL( MTransaction& aTr ) + { + TDblQueIter iter = aTr.ElementIter(); + RAiPolicyElementArray contentChangedArray; + CleanupClosePushL( contentChangedArray ); + + while ( iter ) + { + CTransactionElement* element = iter++; + CXnNodeAppIf& target = element->Target(); + + // Find own and parents policy/ContentChanged nodes + iPolicyEvaluator->EvaluateContentChangedPolicyL( target, + contentChangedArray); + + iPolicyEvaluator->EvaluateContentChangedPolicyL( *(target.ParentL()), + contentChangedArray); + } + + ::RemoveDuplicateContentChangesL( contentChangedArray ); + + for ( TInt i = 0; i < contentChangedArray.Count(); ++i ) + { + ProcessContentChangeL( contentChangedArray[i] ); + } + CleanupStack::PopAndDestroy(); + } + +void CContentRenderer::ProcessContentChangeL( TAiPolicyElement& aElement ) + { + const TDesC8* id = PropertyValue( aElement.Target(), + AiUiDef::xml::property::KId ); + if ( id ) + { + CXnNodeAppIf* targetNode = FindNodeByIdL( *id, aElement.Target().Namespace() ); + if ( targetNode ) + { + if ( aElement.Policy() == AiUiDef::xml::value::KShowTooltips ) + { + targetNode->ShowTooltipsL(); + } + } + } + } + +TInt CContentRenderer::CancelTransaction( TInt aTxId ) + { + // Remove transaction with aTxId from stack + MTransaction* tr = iStack->Remove( aTxId ); + + if ( tr ) + { + // Release transaction to factory + __TICK("XML UI: Cancel transaction"); + __HEAP("XML UI: Cancel transaction"); + __PRINT(__DBG_FORMAT("\t[I]\tXML UI: Cancel transaction id=%d"), aTxId); + + iFactory->ReleaseTransaction( tr ); + + return KErrNone; + } + + return KErrNotSupported; + } + +TBool CContentRenderer::CanPublish( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aIndex ) + { + TInt error( KErrNone ); + TInt retval( KErrNone ); + __PRINTS("*** UC: Init - Content Validation ***"); + __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 ); + } + +TInt CContentRenderer::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aResource, + TInt aIndex ) + { + TInt error( KErrNone ); + TInt retval( KErrNone ); + __PRINTS("*** UC: Init - Content Publishing (Resource) ***"); + __TIME("UC: Content Publishing (Resource)", + TRAP( error, retval = DoPublishL( aPlugin, aContent, aResource, aIndex ) ); + ); + __HEAP("UC: Content Publishing (Resource)"); + __PRINTS("*** UC: Done - Content Publishing (Resource) ***"); + + if( !error && retval ) + { + error = retval; + } + + return error; + } + +TInt CContentRenderer::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC16& aText, + TInt aIndex ) + { + TInt error( KErrNone ); + TInt retval( KErrNone ); + + __PRINTS("*** UC: Init - Content Publishing (Value-Text) ***"); + __TIME("UC: Content Publishing (Value-Text)", + 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; + } + + return error; + } + +TInt CContentRenderer::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC8& aBuf, + TInt aIndex ) + { + TInt error( KErrNone ); + TInt retval( KErrNone ); + + __PRINTS("*** UC: Init - Content Publishing (Value-Buf) ***"); + __TIME("UC: Content Publishing (Value-Buf)", + 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; + } + + return error; + } + +TInt CContentRenderer::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + RFile& aFile, + TInt aIndex ) + { + TInt error( KErrNone ); + TInt retval( KErrNone ); + + __PRINTS("*** UC: Init - Content Publishing (Value-RFile) ***"); + __TIME("UC: Content Publishing (Value-RFile)", + 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; + } + + return error; + } + +TInt CContentRenderer::Clean( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ) + { + TInt error( KErrNone ); + TInt retval( KErrNone ); + + __PRINTS("*** UC: Init - Content Publishing (Clean) ***"); + __TIME("UC: Content Publishing (Clean)", + TRAP( error, retval = DoCleanL( aPlugin, aContent, aIndex ) ); + ); + __HEAP("UC: Content Publishing (Clean)"); + __PRINTS("*** UC: Done - Content Publishing (Clean) ***"); + + if( !error && retval ) + { + error = retval; + } + + return error; + } + +TAny* CContentRenderer::Extension( TUid /*aUid*/ ) + { + // No extensions supported + return NULL; + } + +TBool CContentRenderer::RequiresSubscription( + const TAiPublisherInfo& aPublisherInfo ) const + { + if ( aPublisherInfo.iNamespace == KNativeUiNamespace ) + { + // Not targeted to this content renderer + return EFalse; + } + + return ETrue; + } + +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; + } + +TBool CContentRenderer::AllowPublishByPriority( CXnNodeAppIf& aUiElement, + TInt aPriority ) const + { + // Get ui element id + 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 + } + +void CContentRenderer::StartContentRefresh() + { + // Cancel ongoing refresh + iTimer->Cancel(); + + if ( iRefreshableUiElements.Count() > 0 ) + { + // Refreshable elements exist. Start timer to make refresh asynchronous + iTimer->Start( TTimeIntervalMicroSeconds32( 0 ), + TTimeIntervalMicroSeconds32( 0 ), + TCallBack( RefreshContentCallback, this ) ); + } + } + +/** + * Adds ui element to list of refreshable elements + * + * @param aUiElementId ui element id + * @param aOldPriority old priority value + */ +TInt CContentRenderer::RefreshContentL( HBufC* aUiElementId, + TInt aOldPriority ) + { + if( !aUiElementId ) + { + return KErrArgument; + } + + // Take ownership of aUiElementId + CleanupStack::PushL( aUiElementId ); + + if ( !iFwEventHandler ) + { + // Content refresh event cannot be sent + CleanupStack::PopAndDestroy( aUiElementId ); + return KErrNotReady; + } + + // Find current mapping + TInt* oldPriority = iRefreshableUiElements.Find( *aUiElementId ); + + if ( oldPriority ) + { + // Update mapping + *oldPriority = aOldPriority; + CleanupStack::PopAndDestroy( aUiElementId ); + } + else + { + // Create new mapping + oldPriority = new( ELeave ) TInt( aOldPriority ); + CleanupStack::PushL( oldPriority ); + + User::LeaveIfError( iRefreshableUiElements.Insert( aUiElementId, + oldPriority ) ); + + CleanupStack::Pop( 2, aUiElementId ); + } + + return KErrNone; + } + +/** + * Callback function to make content refreshing asynchronous + */ +TInt CContentRenderer::RefreshContentCallback( TAny* aContentRenderer ) + { + if ( !aContentRenderer ) + { + return KErrArgument; + } + + CContentRenderer* renderer = static_cast< CContentRenderer* >( aContentRenderer ); + TRAP_IGNORE( renderer->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. + */ +void CContentRenderer::SendRefreshContentEventL() + { + // Cancel periodic timer. + iTimer->Cancel(); + + // Get ui element id and old content priority + TPtrHashMapIter< TDesC, TInt> iter( iRefreshableUiElements ); + iter.Reset(); + + 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 ); + + // 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(); + + // Remove higher priority content elements + RemoveNonPriorityElements( children, priority ); + + // Sort array to descending order + children.Sort( TLinearOrder< CXnNodeAppIf >( DescendingPriorityOrder ) ); + + // Send event for content selectors in descending priority order. + // Continue until first content gets published or array exhausts. + for ( TInt i = 0; i < children.Count(); ++i ) + { + CXnNodeAppIf* current = children[ i ]; + + // Get content selector + const HBufC* contentSelector = PropertyValueL( *current, + XnPropertyNames::common::KClass ); + + if ( contentSelector && iFwEventHandler->RefreshContent( *contentSelector )) + { + break; + } + } + + // Free content selector array + children.Reset(); + + // Continue content refresh for next ui element. + StartContentRefresh(); + } + +void CContentRenderer::TitleScrolled( TInt aTitleIndex ) + { + if ( iCallbackHandler ) + { + TRAP_IGNORE( iCallbackHandler->TitleScrolledL( iNTPublisher, + *iNTClass, + aTitleIndex ) ); + } + } + +void CContentRenderer::TitleToScroll( TInt aTitleIndex ) + { + if ( iCallbackHandler ) + { + TRAP_IGNORE( iCallbackHandler->TitleToScrollL( iNTPublisher, + *iNTClass, + aTitleIndex ) ); + } + } + +TBool CContentRenderer::IsParentNewsticker( CXnNodeAppIf& aTarget ) + { + 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()); + } + +void CContentRenderer::RegisterNewstickerCallbackInterfaceL( CXnNodeAppIf& aTarget ) + { + if ( !iCallbackHandler ) + { + // Instantiate callback handler + 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(); + + // 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 ); + } + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/csspropertymap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/csspropertymap.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,114 @@ +/* +* 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: DOM property map +* +*/ + + +#include "xnproperty.h" +#include "xndomproperty.h" +#include "xndompropertyvalue.h" +#include "xndomlist.h" + +#include "csspropertymap.h" +#include "aixmluiutils.h" + +using namespace AiXmlUiController; + +// ======== MEMBER FUNCTIONS ======== + +CCssPropertyMap::CCssPropertyMap() + { + } + +CCssPropertyMap* CCssPropertyMap::NewL() + { + CCssPropertyMap* self = new( ELeave ) CCssPropertyMap; + return self; + } + +CCssPropertyMap::~CCssPropertyMap() + { + Reset(); + iElementMap.Close(); + } + + +void CCssPropertyMap::StorePropertyValueL( const TDesC8& aElementId, + CXnProperty& aProperty ) + { + RDomPropertyValueMap* propertyMap = iElementMap.Find( aElementId ); + + if ( !propertyMap ) + { + // Create new entry + propertyMap = new( ELeave ) RDomPropertyValueMap; + + CleanupStack::PushL( propertyMap ); + + iElementMap.InsertL( aElementId.AllocLC(), propertyMap ); + + CleanupStack::Pop( 2, propertyMap ); + } + + // Clone property value + CXnDomProperty* property = aProperty.Property(); + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( + property->PropertyValueList().First() ); + LeaveIfNull( value, KErrArgument ); + + value = value->CloneL(); + CleanupStack::PushL( value ); + + // Store value + propertyMap->InsertL( property->Name().AllocLC(), value ); + + CleanupStack::Pop( 2, value ); + + } + +CXnDomPropertyValue* CCssPropertyMap::FindPropertyValue( const TDesC8& aElementId, + const TDesC8& aName ) + { + RDomPropertyValueMap* propertyMap = iElementMap.Find( aElementId ); + + if ( !propertyMap ) + { + return NULL; + } + + return propertyMap->Find( aName ); + } + +void CCssPropertyMap::Reset() + { + TPtrHashMapIter< TDesC8, RDomPropertyValueMap > mapIter( iElementMap ); + mapIter.Reset(); + + while ( mapIter.NextKey() ) + { + // Reset map for current key + RDomPropertyValueMap* map = const_cast< RDomPropertyValueMap* >( + mapIter.CurrentValue() ); + map->ResetAndDestroy(); + + // Delete current key and map + delete mapIter.CurrentKey(); + delete map; + + // Remove map (pointer) for current key + mapIter.RemoveCurrent(); + } + + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/databuffertransactionelement.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/databuffertransactionelement.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,197 @@ +/* +* 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: Data buffer transaction element +* +*/ + + +#include "databuffertransactionelement.h" +#include "aixmluiutils.h" + +#include "xntype.h" +#include "xntext.h" +#include "xnnewsticker.h" +#include "xnmenuadapter.h" +#include "mxncomponentinterface.h" +#include "xnvolumecontrol.h" +#include "xnnodeappif.h" +#include "xnuiengineappif.h" +#include "xnproperty.h" +#include "xndompropertyvalue.h" +#include "aistrcnv.h" +#include "aixmluiconstants.h" + +// ============================ MEMBER FUNCTIONS =============================== + +using namespace AiXmlUiController; +using namespace XnTextInterface; + +CDataBufferTransactionElement::CDataBufferTransactionElement(AiUtility::CContentPriorityMap& aContentPriorityMap) + : CTransactionElement(aContentPriorityMap) + { + } + +CDataBufferTransactionElement* CDataBufferTransactionElement::NewL(AiUtility::CContentPriorityMap& aContentPriorityMap) + { + CDataBufferTransactionElement* self = new( ELeave ) CDataBufferTransactionElement(aContentPriorityMap); + + return self; + } + +CDataBufferTransactionElement::~CDataBufferTransactionElement() + { + } + +void CDataBufferTransactionElement::InitializeL( CXnNodeAppIf& aTarget, const TDesC8& aData ) + { + CheckTypeL( aTarget ); + SetTarget( aTarget ); + iNewData.Set( aData ); + } + +void CDataBufferTransactionElement::UpdateDataL() + { + // Set new text + SetDataL(); + + // Update content priority + UpdateContentPriorityL(); + } + +void CDataBufferTransactionElement::Reset() + { + CTransactionElement::Reset(); + + iNewData.Set( KNullDesC8); + } + +TBool CDataBufferTransactionElement::IsSupported( CXnNodeAppIf& aTarget, + const TDesC8& aContentType ) + { + // Get target type info + CXnType* typeInfo = aTarget.Type(); + + if ( !typeInfo ) + { + return EFalse; + } + + const TDesC8& type = typeInfo->Type(); + + if ( aContentType == KContentTypeText ) // Text + { + // Text element and menu item supports + return ( type == XnTextInterface::MXnTextInterface::Type() || + type == KXnMenuItem || + type == KXnMenu || + type == XnPropertyNames::softkey::KNodeName || + type == XnPropertyNames::volumecontrol::KSlider ); + } + else if ( aContentType == KContentTypeImageSvg ) // SVG image + { + // Newsticker support + return ( type == XnNewstickerInterface::MXnNewstickerInterface::Type() ); + } + + return EFalse; + } + +void CDataBufferTransactionElement::CheckTypeL( CXnNodeAppIf& aTarget ) + { + // Get type info + const TDesC8& type = LeaveIfNull( aTarget.Type(), KErrNotSupported )->Type(); + + // Text element, menu item, and newsticker supported + if ( type != XnTextInterface::MXnTextInterface::Type() && + type != KXnMenuItem && + type != KXnMenu && + type != XnPropertyNames::softkey::KNodeName && + type != XnPropertyNames::volumecontrol::KSlider && + type != XnNewstickerInterface::MXnNewstickerInterface::Type() ) + { + User::Leave( KErrNotSupported ); + } + } + +void CDataBufferTransactionElement::SetDataL() + { + // Get type info + const TDesC8& type = LeaveIfNull( Target().Type(), KErrNotSupported )->Type(); + + if ( type == XnTextInterface::MXnTextInterface::Type() ) // Text element + { + // Set character data directly to target + Target().SetPCDataL( iNewData ); + } + else if ( type == XnPropertyNames::softkey::KNodeName || + type == KXnMenuItem || + type == KXnMenu ) // menu item + { + // Update label attribute value. + + // + CXnNodeAppIf& target = Target(); + + // Create new new label attribute value + CXnDomPropertyValue* propertyValue = + CXnDomPropertyValue::NewL( target.UiEngineL()->StringPool() ); + + CleanupStack::PushL( propertyValue ); + + propertyValue->SetStringValueL( CXnDomPropertyValue::EString, + iNewData ); + + CXnProperty* newProperty = CXnProperty::NewL( XnPropertyNames::menu::KLabel, + propertyValue, + target.UiEngineL()->StringPool() ); + CleanupStack::Pop( propertyValue ); + + CleanupStack::PushL( newProperty ); + + // Set label attribute + target.SetPropertyL( newProperty ); + + CleanupStack::Pop( newProperty ); + + // Refresh menu + target.UiEngineL()->RefreshMenuL(); + } + else if ( type == XnPropertyNames::volumecontrol::KSlider ) // slider + { + // Get volume control interface + XnVolumeControlInterface::MXnVolumeControlInterface* volumeControl = NULL; + XnComponentInterface::MakeInterfaceL( volumeControl, Target() ); + LeaveIfNull( volumeControl, KErrNotSupported ); + + TInt32 volume = 0; + User::LeaveIfError( AiUtility::ParseInt( volume, iNewData ) ); + volumeControl->SetValue( volume ); + } + else if ( type == XnNewstickerInterface::MXnNewstickerInterface::Type() ) + { + // Get newsticker interface + XnNewstickerInterface::MXnNewstickerInterface* newsTicker = NULL; + XnComponentInterface::MakeInterfaceL( newsTicker, Target() ); + LeaveIfNull( newsTicker, KErrNotSupported ); + + // Append new SVG title + newsTicker->AppendSvgTitleL( iNewData ); + } + else + { + User::Leave( KErrNotSupported ); + } + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/document.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/document.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,54 @@ +/* +* 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: Document class +* +*/ + + +#include "document.h" +#include "application.h" +#include "appui.h" +#include "debug.h" + +using namespace AiXmlUiController; + +// ========== MEMBER FUNCTIONS ================================================ + +CDocument::CDocument(CEikApplication &aApp, CXmlUiController& aUiCtl) + : CXnDocument(aApp, KUidXmlUiApp), + iUiCtl(aUiCtl) + { + } +CDocument* CDocument::NewL(CEikApplication &aApp, CXmlUiController& aUiCtl) + { + CDocument* self = NULL; + + __TIME("XML UI: Create Document", + self = new (ELeave) CDocument(aApp, aUiCtl); + ); + __HEAP("XML UI: Create Document"); + + return self; + } + +CDocument::~CDocument() + { + } + +CEikAppUi* CDocument::CreateAppUiL() + { + return CAppUi::NewL(iUiCtl); + } + +// End of File. diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/dynamicthememodifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/dynamicthememodifier.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,331 @@ +/* +* Copyright (c) 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: This module contains the implementation of +* CDynamicThemeModifier class member functions. +* +*/ + + + +// INCLUDE FILES + +#include "dynamicthememodifier.h" +#include +#include "xnodt.h" +#include "xndomdocument.h" +#include "xndomattribute.h" +#include "xndomnode.h" +#include "xndomlist.h" +#include "xndomdepthiterator.h" +#include + +// CONSTANTS +#define NEWS_TICKER_GENERAL_SETTINGS_UID 0x10207196 +const TUid KCRUidNewsTicker = {NEWS_TICKER_GENERAL_SETTINGS_UID}; + +/** + * KGSNewsTickerStatus + * CenRep key for "NewsTicker activated" + * Off = 0 + * On = 1 + */ +const TUint32 KGSNewsTickerStatus = 0x00000004; + +/** + * KAINTInTheme + * CenRep key for "NewsTicker implemented in AI2 theme" + * No = 0 + * Yes = 1 + */ +const TUint32 KAiNTInTheme = 0x00000800; +const TInt KThemeArrayGranularity = 4; + +_LIT8( KProperty, "property" ); +_LIT8( KControl, "control" ); +_LIT8( KName, "name" ); +_LIT8( KValue, "value" ); +_LIT8( KBlock, "block" ); +_LIT8( KNone, "none" ); + +using namespace AiXmlUiController; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CDynamicThemeModifier::CDynamicThemeModifier +// ----------------------------------------------------------------------------- +// +CDynamicThemeModifier::CDynamicThemeModifier() + { + } + +// ----------------------------------------------------------------------------- +// CDynamicThemeModifier::ConstructL +// ----------------------------------------------------------------------------- +// +void CDynamicThemeModifier::ConstructL() + { + // NT is not shown in theme by default. + // This is overridden later if it really is implemented (some other theme + // Basic activated) + iAiCenRep = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); + User::LeaveIfError( iAiCenRep->Set( KAiNTInTheme, 0 ) ); + + // Check if NT settings are visible in GS + iNTCenRep = CRepository::NewL( KCRUidNewsTicker ); + User::LeaveIfError( iNTCenRep->Get( KGSNewsTickerStatus, iEnabledInCenRep ) ); + + iNTCenRepObserver = CCenRepNotifyHandler::NewL( *this, + *iNTCenRep, + CCenRepNotifyHandler::EIntKey, + KGSNewsTickerStatus ); + iNTCenRepObserver->StartListeningL(); + + LoadThemesL(); + } + +// ----------------------------------------------------------------------------- +// CDynamicThemeModifier::NewL +// ----------------------------------------------------------------------------- +// +CDynamicThemeModifier* CDynamicThemeModifier::NewL() + { + CDynamicThemeModifier* self = new( ELeave ) CDynamicThemeModifier; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// Destructor +CDynamicThemeModifier::~CDynamicThemeModifier() + { + if( iThemeArray ) + { + iThemeArray->ResetAndDestroy(); + delete iThemeArray; + } + delete iOdt; + delete iDomDocument; + delete iXnResult; + delete iXnRequestClient; + delete iXnContentAccessClient; + delete iXnClient; + if( iNTCenRepObserver ) + { + iNTCenRepObserver->StopListening(); + delete iNTCenRepObserver; + } + delete iNTCenRep; + delete iAiCenRep; + } + +// --------------------------------------------------------------------------- +// CDynamicThemeModifier::LoadThemesL +// --------------------------------------------------------------------------- +// +void CDynamicThemeModifier::LoadThemesL() + { + const TUid KUidAI2 = TUid::Uid( AI_UID3_AIFW_EXE ); + + iXnClient = CXnClient::NewL( *this ); + // we're only interested in AI2 themes + iXnContentAccessClient = CXnContentAccessClient::NewL( *this, + KUidAI2.iUid ); + iXnRequestClient = CXnRequestClient::NewL( *this, KUidAI2.iUid ); + iXnResult = CXnResult::NewL(); + + CXnODT* odt = CXnODT::NewL(); + CleanupStack::PushL( odt ); + + odt->SetAppUid( KUidAI2.iUid ); + + iThemeArray = new( ELeave ) CArrayPtrFlat( KThemeArrayGranularity ); + + // theme array gets filled up by XnClient after this + // HandleXnClientMessage() is a callback method that we're interested in + TXnServiceCompletedMessage ret = + iXnClient->XnGetListHeaders( *odt, *iThemeArray ); + + if( ret == EXnGetListHeadersSuccess || ret == EXnGetListHeadersEmpty ) + { + iXnClient->GetXnResult( *iXnResult ); + iNumberOfHeaders = iXnResult->iIntValue1; + iXnClient->XnGetNextHeader(); + } + + CleanupStack::PopAndDestroy( odt ); + } + + + +// ----------------------------------------------------------------------------- +// CDynamicThemeModifier::HandleXnClientMessage +// ----------------------------------------------------------------------------- +// +void CDynamicThemeModifier::HandleXnClientMessage( + TXnServiceCompletedMessage aMessage ) + { + // wait until all themes are fetched before loading settings + if( ( aMessage == EXnGetListHeadersUpdate ) && + ( iThemeArray->Count() == iNumberOfHeaders ) ) + { + TRAP_IGNORE( LoadSettingsFromThemeL() ); + } + + else if( aMessage == EXnGetListHeadersFailed ) + { + if (iXnClient) + { + iXnClient->XnCancelGetListHeaders(); + } + + if ( iThemeArray ) + { + iThemeArray->ResetAndDestroy(); + delete iThemeArray; + iThemeArray = NULL; + } + } + + } + + +// ----------------------------------------------------------------------------- +// CDynamicThemeModifier::LoadSettingsFromThemeL +// ----------------------------------------------------------------------------- +// +void CDynamicThemeModifier::LoadSettingsFromThemeL() + { + for( TInt i = 0; i < iThemeArray->Count(); i++ ) + { + CXnODT* odt = iThemeArray->At( i ); + + // activated theme found -> load settings + if( odt->Flags() & EXnThemeStatusActive ) + { + delete iDomDocument; + iDomDocument = NULL; + iDomDocument = CXnDomDocument::NewL(); + + TXnServiceCompletedMessage ret = + iXnContentAccessClient->XnLoadSettings( *odt, *iDomDocument ); + if( ret == EXnSettingsLoaded ) + { + delete iOdt; + iOdt = NULL; + iOdt = odt->CloneL(); + odt = NULL; + // update theme to match CenRep value + EnableNewsTickerL( TBool( iEnabledInCenRep ) ); + break; + } + } + } + } + + +// ----------------------------------------------------------------------------- +// CDynamicThemeModifier::EnableNewsTickerL +// ----------------------------------------------------------------------------- +// +void CDynamicThemeModifier::EnableNewsTickerL( TBool aEnabled ) + { + TInt found = 0; + CXnDomDepthIterator* iterator = + CXnDomDepthIterator::NewL( *iDomDocument->RootNode() ); + CleanupStack::PushL( iterator ); + + CXnDomNode* node = iterator->First(); + + if( !node ) + { + CleanupStack::PopAndDestroy( iterator ); + return; + } + + // find tag + while( node ) + { + if( !node->Name().Compare( KControl ) ) + { + break; + } + node = iterator->NextL(); + } + + if( !node->Name().Compare( KControl ) ) + { + node = iterator->NextL(); + + while( node ) + { + // look for tag... + if( !node->Name().Compare( KProperty ) ) + { + // ...with attribute "value"... + if( !node->AttributeValue( KName ).Compare( KValue ) ) + { + found = 1; + CXnDomAttribute* attr = static_cast + ( node->AttributeList().FindByName( KValue) ); + + // ...update it accordingly... + if( aEnabled ) + { + attr->SetValueL( KBlock ); + } + else + { + attr->SetValueL( KNone ); + } + } + } + node = iterator->NextL(); + } + + // ...and communicate the changes via Content Access API. + for( TInt i = 0; i < iThemeArray->Count(); i++ ) + { + CXnODT* odt = iThemeArray->At( i ); + + // This might return an error if settings were not found from theme. + // However, we don't need to take any actions since appropriate + // theme is left untouched in that case anyway + iXnContentAccessClient->XnUpdateSettings( *odt, *iDomDocument ); + } + + // if found == 1, then NT is implemented in theme + // -> NT settings can be shown in GS + User::LeaveIfError( iAiCenRep->Set( KAiNTInTheme, found ) ); + CleanupStack::PopAndDestroy( iterator ); + } + } + +// ----------------------------------------------------------------------------- +// CDynamicThemeModifier::HandleNotifyInt +// Callback method for observing CenRep changes +// ----------------------------------------------------------------------------- +// +void CDynamicThemeModifier::HandleNotifyInt( TUint32 /*aId*/, TInt aNewValue ) + { + iEnabledInCenRep = TBool( aNewValue ); + TRAP_IGNORE( EnableNewsTickerL( iEnabledInCenRep ) ); + ; + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/emptycontenttransactionelement.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/emptycontenttransactionelement.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,119 @@ +/* +* 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: Transaction element for publishing empty content +* +*/ + + +#include "xntype.h" +#include "xnnewsticker.h" +#include "xnbitmap.h" +#include "xntext.h" +#include "emptycontenttransactionelement.h" +#include "aixmluiconstants.h" +#include "aixmluiutils.h" + +using namespace AiXmlUiController; +using namespace XnImageInterface; +using namespace XnTextInterface; +using namespace AiUiDef::xml; + +const TInt KControlIndexOffset = 1; + +// ======== MEMBER FUNCTIONS ======== + +CEmptyContentTransactionElement::CEmptyContentTransactionElement( + AiUtility::CContentPriorityMap& aContentPriorityMap) + : CTransactionElement( aContentPriorityMap ), + iIndex( KErrNotFound ) + { + } + +CEmptyContentTransactionElement* CEmptyContentTransactionElement::NewL( + AiUtility::CContentPriorityMap& aContentPriorityMap) + { + CEmptyContentTransactionElement* self = + new( ELeave ) CEmptyContentTransactionElement( aContentPriorityMap ); + return self; + } + +CEmptyContentTransactionElement::~CEmptyContentTransactionElement() + { + } + +void CEmptyContentTransactionElement::InitializeL( CXnNodeAppIf& aTarget, TInt aIndex ) + { + SetTarget( aTarget ); + + // Indexes in XML theme run 1...n, but in control interface 0...n-1 + iIndex = aIndex - KControlIndexOffset; + } + +void CEmptyContentTransactionElement::Reset() + { + CTransactionElement::Reset(); + iIndex = KErrNotFound; + } + +void CEmptyContentTransactionElement::UpdateDataL() + { + CXnType* type = Target().Type(); + + if ( type->Type() == XnImageInterface::MXnImageInterface::Type() ) + { + MXnImageInterface* imageIntr = NULL; + if ( !XnComponentInterface::MakeInterfaceL( imageIntr, Target() ) ) + { + User::Leave( KErrNotSupported ); + } + // Clears the bitmaps from component + 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 ); + } + else + { + CXnNodeAppIf* parent = Target().ParentL(); + LeaveIfNull( parent, KErrNotSupported ); + const TDesC8& type = LeaveIfNull( parent->Type(), KErrNotSupported )->Type(); + + if ( type == XnNewstickerInterface::MXnNewstickerInterface::Type() ) + { + XnNewstickerInterface::MXnNewstickerInterface* newsticker = NULL; + XnComponentInterface::MakeInterfaceL( newsticker, *parent ); + LeaveIfNull( newsticker, KErrGeneral ); + TInt titleIndexVal = -1; + CXnProperty* titleIndex = Target().GetPropertyL( XnPropertyNames::title::KTitleIndex ); + if ( titleIndex ) + { + TLex8 lex( titleIndex->StringValue() ); + TInt err = lex.Val( titleIndexVal ); + if ( err == KErrNone && titleIndexVal > -1 ) + { + newsticker->DeleteTitle( titleIndexVal ); + } + } + } + } + // Clear current content priority + ClearContentPriorityL(); + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/globalqueryhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/globalqueryhandler.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2005-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: Global query active object +* +*/ + +#include "globalqueryhandler.h" +#include "xmluicontroller.h" +#include "appui.h" + +#include //EAknSoftkeyOk, EAknSoftkeyCancel, EAknSoftkeyDone + +using namespace AiXmlUiController; + +// ============================ LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS ============================== +// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +CGlobalQueryHandler* CGlobalQueryHandler::NewL( + CXmlUiController& aUiController ) + { + CGlobalQueryHandler* self = + new ( ELeave )CGlobalQueryHandler( aUiController ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +CGlobalQueryHandler::CGlobalQueryHandler( CXmlUiController& aUiController ) + : CActive( EPriorityStandard ), iUiController( aUiController ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CGlobalQueryHandler::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +CGlobalQueryHandler::~CGlobalQueryHandler() + { + Cancel(); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CGlobalQueryHandler::DoCancel() + { + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CGlobalQueryHandler::RunL() + { + if( iStatus == EAknSoftkeyOk || iStatus == EAknSoftkeyYes ) + { + iUiController.AppUi()->SetOnlineStateL( iSetOnline ); + } + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CGlobalQueryHandler::SetOnlineParamAndActivate( TBool aOnline ) + { + iSetOnline = aOnline; + + SetActive(); + } + +// END OF FILE + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/imagetransactionelement.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/imagetransactionelement.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,496 @@ +/* +* 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: Image transaction element +* +*/ + + +#include "xnbitmap.h" +#include "xnnewsticker.h" +#include "xntype.h" +#include "xnmenu.h" +#include "xnmenuadapter.h" +#include "xnuiengineappif.h" + +#include +#include + +#include "imagetransactionelement.h" +#include "xmluicontrollerpanic.h" +#include "aixmluiutils.h" +#include "xnuiengineappif.h" + +using namespace AiXmlUiController; +using namespace XnImageInterface; +using namespace ContentAccess; + +namespace AiXmlUiController + { + +TBool IsNodeVisible( CXnNodeAppIf& aNode ) + { + CXnProperty* propVisibility = aNode.GetPropertyL( XnPropertyNames::style::common::KVisibility );; + + if( propVisibility ) + { + const TDesC8& visibility = propVisibility->StringValue(); + + if( visibility == XnPropertyNames::style::common::visibility::KHidden ) + { + return EFalse; + } + } + + CXnProperty* propDisplay = aNode.GetPropertyL( XnPropertyNames::style::common::KDisplay ); + + if( propDisplay ) + { + const TDesC8& display = propDisplay->StringValue(); + + if( display == XnPropertyNames::style::common::display::KNone ) + { + return EFalse; + } + } + + CXnProperty* propDisabled = aNode.GetPropertyL( XnPropertyNames::common::KDisabled ); + + if( propDisabled ) + { + const TDesC8& disabled = propDisabled->StringValue(); + + if( disabled == XnPropertyNames::KTrue ) + { + return EFalse; + } + } + return ETrue; + } +/** + * Uses CImageDecoder to decode images asynchronously. + * When decoding is done, it tries to find target and set + * image into element. Destroys itself at end of RunL method. + */ +class CKamikazeImageDecoder: public CActive + { +public: + static CKamikazeImageDecoder* NewL( + RFile& aFile, const TDesC8& aNodeId, + const TDesC8& aNodeNs, TXnUiEngineAppIf& aUiEngine); + ~CKamikazeImageDecoder(); +public: + /** + * Start decoding and forget instance. + * Destroyes itself. + */ + void DecodeLD(); +private: + // from CActive + void DoCancel(); + void RunL(); +private: + void ConstructL(RFile& aFile, const TDesC8& aNodeId,const TDesC8& aNodeNs); + CKamikazeImageDecoder(TXnUiEngineAppIf& aUiEngine); + void SetImageL(); +private: + /** + * Image decoder. Own. + */ + CImageDecoder* iDecoder; + /** + * Target node id + */ + HBufC8* iNodeId; + /** + * Target node namespace + */ + HBufC8* iNodeNs; + /** + * Provides services to find target + */ + TXnUiEngineAppIf& iUiEngine; + /** + * Icon. Own. + */ + CGulIcon* iIcon; + }; + +CKamikazeImageDecoder* CKamikazeImageDecoder::NewL( + RFile& aFile, + const TDesC8& aNodeId, + const TDesC8& aNodeNs, + TXnUiEngineAppIf& aUiEngine) + { + CKamikazeImageDecoder* p = new (ELeave)CKamikazeImageDecoder(aUiEngine); + CleanupStack::PushL(p); + p->ConstructL(aFile,aNodeId,aNodeNs); + CleanupStack::Pop(p); + return p; + } + +CKamikazeImageDecoder::CKamikazeImageDecoder(TXnUiEngineAppIf& aUiEngine): + CActive(CActive::EPriorityStandard ), iUiEngine(aUiEngine) + { + CActiveScheduler::Add( this ); + } + +CKamikazeImageDecoder::~CKamikazeImageDecoder() + { + Cancel(); + delete iDecoder; + delete iNodeId; + delete iNodeNs; + delete iIcon; + } + +void CKamikazeImageDecoder::ConstructL( + RFile& aFile, + const TDesC8& aNodeId, + const TDesC8& aNodeNs) + { + // Create new decoder for file + iDecoder = CImageDecoder::FileNewL( aFile, EView ); + iNodeId = aNodeId.AllocL(); + iNodeNs = aNodeNs.AllocL(); + iIcon = CGulIcon::NewL(); + } + +void CKamikazeImageDecoder::DecodeLD() + { + TFrameInfo frameInfo = iDecoder->FrameInfo(0); + CFbsBitmap* bitmap = new( ELeave ) CFbsBitmap; + iIcon->SetBitmap( bitmap ); + + User::LeaveIfError( bitmap->Create( frameInfo.iOverallSizeInPixels, + frameInfo.iFrameDisplayMode ) ); + + CFbsBitmap* mask(0); + if ( frameInfo.iFlags & TFrameInfo::ETransparencyPossible ) + { + mask = new( ELeave ) CFbsBitmap; + iIcon->SetMask( mask ); + User::LeaveIfError( mask->Create( frameInfo.iOverallSizeInPixels, + ( ( frameInfo.iFlags & TFrameInfo::EAlphaChannel ) + ? EGray256 : EGray2 ) ) ); + } + + if(iIcon->Mask()) + { + iDecoder->Convert( &iStatus, *bitmap, *mask ); + } + else + { + iDecoder->Convert( &iStatus, *bitmap ); + } + SetActive(); + } + +void CKamikazeImageDecoder::DoCancel() + { + iDecoder->Cancel(); + } + +void CKamikazeImageDecoder::SetImageL() + { + + // Find target + CXnNodeAppIf* node = iUiEngine.FindNodeByIdL(*iNodeId,*iNodeNs); + if(!node) + { + return; + } + + const TDesC8& type = node->Type()->Type(); + + if ( type == XnImageInterface::MXnImageInterface::Type() ) + { + MXnImageInterface* imageIntr = NULL; + if ( !XnComponentInterface::MakeInterfaceL( imageIntr, *node ) ) + { + return; + } + // Set new bitmaps. Ownership is transferred to MXnImageInterface + iIcon->SetBitmapsOwnedExternally( ETrue ); + imageIntr->SetContentBitmaps( iIcon->Bitmap(), iIcon->Mask() ); + + } + else if ( type == XnNewstickerInterface::MXnNewstickerInterface::Type() ) + { + XnNewstickerInterface::MXnNewstickerInterface* newsTicker = NULL; + XnComponentInterface::MakeInterfaceL( newsTicker, *node ); + LeaveIfNull( newsTicker, KErrNotSupported ); + + User::LeaveIfError( newsTicker->SetSeparatorImageL( iIcon ) ); + // Ownership of icon transferred to newsticker + iIcon = NULL; + } + // Menu softkey icons + else if ( ( ( type == KXnMenuItem || type == KXnMenu ) && + IsNodeVisible( *node ) ) || + type == XnPropertyNames::softkey::KNodeName ) + { + CXnNodeAppIf* menuBar = node->ParentL(); + + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition softkeyPosition = + XnMenuInterface::MXnMenuInterface::ELeft; + + CXnProperty* property = + node->GetPropertyL( XnPropertyNames::softkey::KTypeAttribute ); + if ( property && property->StringValue() == XnPropertyNames::softkey::type::KRight ) + { + softkeyPosition = XnMenuInterface::MXnMenuInterface::ERight; + } + else if ( property && property->StringValue() == XnPropertyNames::softkey::type::KLeft ) + { + softkeyPosition = XnMenuInterface::MXnMenuInterface::ELeft; + } + else // Image can be published only to RSK or LSK + { + return; + } + + XnMenuInterface::MXnMenuInterface* menuIf = NULL; + + XnComponentInterface::MakeInterfaceL( menuIf, *menuBar ); + if ( menuIf ) + { + // Use black mask and preserver aspect ratio + + menuIf->SetSoftKeyImageL( iIcon->Bitmap(), + iIcon->Mask(), + softkeyPosition, + node, + ETrue, + ETrue ); + iIcon->SetBitmapsOwnedExternally( ETrue ); + } + if( menuBar ) + { + iUiEngine.RefreshMenuL(); + } + } + + } + +void CKamikazeImageDecoder::RunL() + { + CleanupStack::PushL(this); + if(iStatus == KErrNone) + { + SetImageL(); + iUiEngine.RenderUIL(); + } + CleanupStack::PopAndDestroy(this); + } + +// ======== MEMBER FUNCTIONS ======== + +CImageTransactionElement::CImageTransactionElement( + AiUtility::CContentPriorityMap& aContentPriorityMap) + : CTransactionElement(aContentPriorityMap) + { + } + +CImageTransactionElement* CImageTransactionElement::NewL( + AiUtility::CContentPriorityMap& aContentPriorityMap) + { + CImageTransactionElement* self = new( ELeave ) CImageTransactionElement( + aContentPriorityMap ); + return self; + } + +CImageTransactionElement::~CImageTransactionElement() + { + delete iNewIcon; + delete iImageDecoder; + } + +void CImageTransactionElement::InitializeL( CXnNodeAppIf& aTarget, + CGulIcon* aIcon ) + { + CheckTypeL( aTarget ); + + LeaveIfNull( aIcon, KErrArgument ); + + SetTarget( aTarget ); + iNewIcon = aIcon; + } + +void CImageTransactionElement::InitializeL( CXnNodeAppIf& aTarget, + RFile& aFile ) + { + CheckTypeL( aTarget ); + + const TDesC8* nodeId = &KNullDesC8; + + CXnProperty* property = aTarget.GetPropertyL(XnPropertyNames::common::KId); + if(property) + { + nodeId = &property->StringValue(); + } + if ( iImageDecoder ) + { + delete iImageDecoder; + iImageDecoder = NULL; + } + iImageDecoder = CKamikazeImageDecoder::NewL( + aFile,*nodeId,aTarget.Namespace(),*aTarget.UiEngineL()); + + SetTarget( aTarget ); + } + + +void CImageTransactionElement::UpdateDataL() + { + if ( iImageDecoder ) + { + iImageDecoder->DecodeLD(); + iImageDecoder = NULL; // self destroy + } + else + { + __ASSERT_DEBUG( iNewIcon, Panic( EBitmapNull ) ); + + const TDesC8& type = LeaveIfNull( Target().Type(), KErrNotSupported )->Type(); + + if ( type == XnImageInterface::MXnImageInterface::Type() ) + { + MXnImageInterface* imageIntr = NULL; + if ( !XnComponentInterface::MakeInterfaceL( imageIntr, Target() ) ) + { + User::Leave( KErrNotSupported ); + } + // Set new bitmaps. Ownership is transferred to MXnImageInterface + iNewIcon->SetBitmapsOwnedExternally( ETrue ); + imageIntr->SetContentBitmaps( iNewIcon->Bitmap(), iNewIcon->Mask() ); + } + else if ( type == XnNewstickerInterface::MXnNewstickerInterface::Type() ) + { + XnNewstickerInterface::MXnNewstickerInterface* newsTicker = NULL; + XnComponentInterface::MakeInterfaceL( newsTicker, Target() ); + LeaveIfNull( newsTicker, KErrNotSupported ); + + User::LeaveIfError( newsTicker->SetSeparatorImageL( iNewIcon ) ); + + // Ownership of icon transferred to newsticker + + iNewIcon = NULL; + } + // Menu softkey icons + else if ( ( ( type == KXnMenuItem || type == KXnMenu ) && + IsNodeVisible( Target() ) ) || + type == XnPropertyNames::softkey::KNodeName ) + { + CXnNodeAppIf* menuBar = Target().ParentL(); + + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition softkeyPosition = + XnMenuInterface::MXnMenuInterface::ELeft; + + CXnProperty* property = + Target().GetPropertyL( XnPropertyNames::softkey::KTypeAttribute ); + if ( property && property->StringValue() == XnPropertyNames::softkey::type::KRight ) + { + softkeyPosition = XnMenuInterface::MXnMenuInterface::ERight; + } + else if ( property && property->StringValue() == XnPropertyNames::softkey::type::KLeft ) + { + softkeyPosition = XnMenuInterface::MXnMenuInterface::ELeft; + } + else // Image can be published only to RSK or LSK + { + delete iNewIcon; + iNewIcon = NULL; + User::Leave( KErrNotSupported ); + } + + XnMenuInterface::MXnMenuInterface* menuIf = NULL; + + XnComponentInterface::MakeInterfaceL( menuIf, *menuBar ); + if ( menuIf ) + { + // Use black mask and preserver aspect ratio + TRAPD(err, + menuIf->SetSoftKeyImageL( iNewIcon->Bitmap(), + iNewIcon->Mask(), + softkeyPosition, + &Target(), + ETrue, + ETrue ) + ); + // Menuinterface takes ownership + if ( err == KErrNone ) + { + iNewIcon->SetBitmapsOwnedExternally( ETrue ); + } + if( menuBar ) + { + menuBar->UiEngineL()->RefreshMenuL(); + } + } + } + else + { + User::Leave( KErrNotSupported ); + } + } + + delete iNewIcon; + iNewIcon = NULL; + + UpdateContentPriorityL(); + } + +void CImageTransactionElement::Reset() + { + if ( iImageDecoder ) + { + delete iImageDecoder; + iImageDecoder = NULL; + } + + CTransactionElement::Reset(); + + delete iNewIcon; + iNewIcon = NULL; + } + +TBool CImageTransactionElement::IsSupported( CXnNodeAppIf& aTarget ) + { + // Get type info + CXnType* typeInfo = aTarget.Type(); + + if ( !typeInfo ) + { + return EFalse; + } + + const TDesC8& type = typeInfo->Type(); + + // image element and newsticker supported + return ( type == XnImageInterface::MXnImageInterface::Type() || + type == XnNewstickerInterface::MXnNewstickerInterface::Type() || + type == XnMenuInterface::MXnMenuInterface::Type() || + type == KXnMenuItem || + type == KXnMenu || + type == XnPropertyNames::softkey::KNodeName ); + } + +void CImageTransactionElement::CheckTypeL( CXnNodeAppIf& aTarget ) + { + if ( !IsSupported( aTarget ) ) + { + User::Leave( KErrNotSupported ); + } + } +} // ns diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/newstickercallbackhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/newstickercallbackhandler.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,124 @@ +/* +* 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: Callback handler for newsticker component callbacks +* +*/ + + +#include "newstickercallbackhandler.h" +#include "aifweventhandler.h" +#include "aiconsts.h" +#include "aixmluiconstants.h" +#include "aistrcnv.h" + +using namespace AiXmlUiController; + +const TInt KRadix = 10; +const TText16 KPluginEventParameterSeparator = ','; +const TText16 KEventParameterTerminator = ')'; + +static TInt IndexLength( TInt aIndex ) + { + TInt length = 0; + + if ( aIndex < 0 ) + { + ++length; + } + + do + { + aIndex /= KRadix; + ++length; + } + while ( aIndex != 0 ); + + return length; + } + +// ======== MEMBER FUNCTIONS ======== + +CNewstickerCallbackHandler::CNewstickerCallbackHandler( MAiFwEventHandler& aFwEventHandler ) + : iFwEventHandler( aFwEventHandler ) + { + } + +CNewstickerCallbackHandler* CNewstickerCallbackHandler::NewLC( MAiFwEventHandler& aFwEventHandler ) + { + CNewstickerCallbackHandler* self = new( ELeave ) CNewstickerCallbackHandler( aFwEventHandler ); + CleanupStack::PushL( self ); + return self; + } + + +CNewstickerCallbackHandler::~CNewstickerCallbackHandler() + { + delete iEventBuffer; + } + + +void CNewstickerCallbackHandler::TitleScrolledL( const TDesC& aPublisherName, + const TDesC& aPublishingClass, + TInt aIndex ) + { + SendEventToNewstickerPluginL( AiUiDef::xml::event::KNewstickerTitleScrolled, + aPublisherName, + aPublishingClass, + aIndex); + } + +void CNewstickerCallbackHandler::TitleToScrollL( const TDesC& aPublisherName, + const TDesC& aPublishingClass, + TInt aIndex ) + { + SendEventToNewstickerPluginL( AiUiDef::xml::event::KNewstickerTitleToScroll, + aPublisherName, + aPublishingClass, + aIndex); + } + + +void CNewstickerCallbackHandler::SendEventToNewstickerPluginL( const TDesC& aEvent, + const TDesC& aPublisherName, + const TDesC& aPublishingClass, + TInt aIndex) + { + // Calculate event buffer length + TInt length = aPublisherName.Length() + + KPluginEventSeparatorLength + + aEvent.Length() + + KEventParameterSeparatorLength + + aPublishingClass.Length() + + KEventParameterSeparatorLength + + IndexLength( aIndex ) + + KEventParameterSeparatorLength; + + // Allocate event buffer + TPtr event = AiUtility::EnsureBufMaxLengthL( iEventBuffer, length ); + + // Create event string + event.Zero(); + event.Append( aPublisherName ); + event.Append( KPluginEventSeparator ); + event.Append( aEvent ); + event.Append( KEventParameterSeparator ); + event.Append( aPublishingClass ); + event.Append( KPluginEventParameterSeparator ); + event.AppendNum( aIndex ); + event.Append( KEventParameterTerminator ); + + // Send event to plugin + // TODO: fix namespace + iFwEventHandler.HandlePluginEvent( event ); + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/newstickertransactionelement.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/newstickertransactionelement.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,174 @@ +/* +* 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: News ticker transaction element +* +*/ + + +#include "newstickertransactionelement.h" +#include "aixmluiutils.h" + +#include "xntype.h" +#include "xnproperty.h" +#include "xntext.h" +#include "xnmenuadapter.h" +#include "xnnewsticker.h" +//#include +#include "mxncomponentinterface.h" +#include "xnnodeappif.h" +#include "xnuiengineappif.h" +#include "xnproperty.h" +#include "xndompropertyvalue.h" +#include "xnvolumecontrol.h" +#include "aistrcnv.h" + +// ============================ MEMBER FUNCTIONS =============================== + +using namespace AiXmlUiController; +using namespace XnTextInterface; + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +CNewsTickerTransactionElement::CNewsTickerTransactionElement(AiUtility::CContentPriorityMap& aContentPriorityMap) + : CTransactionElement(aContentPriorityMap) + { + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +CNewsTickerTransactionElement* CNewsTickerTransactionElement::NewL(AiUtility::CContentPriorityMap& aContentPriorityMap) + { + CNewsTickerTransactionElement* self = new( ELeave ) CNewsTickerTransactionElement(aContentPriorityMap); + + return self; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +CNewsTickerTransactionElement::~CNewsTickerTransactionElement() + { + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CNewsTickerTransactionElement::InitializeL( CXnNodeAppIf& aTarget, const TDesC& aText, TInt aIndex ) + { + CheckTypeL( aTarget ); + SetTarget( aTarget ); + iNewText.Set( aText ); + iIndex = aIndex; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CNewsTickerTransactionElement::UpdateDataL() + { + // Set new text + SetTextL(); + + // Update content priority + UpdateContentPriorityL(); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CNewsTickerTransactionElement::Reset() + { + CTransactionElement::Reset(); + + iNewText.Set( KNullDesC ); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +TBool CNewsTickerTransactionElement::IsSupported( CXnNodeAppIf& aTarget ) + { + // Is supported only if parent is + CXnNodeAppIf* ntNode = NULL; + + TRAP_IGNORE( ntNode = aTarget.ParentL() ); + + if ( !ntNode ) + { + return EFalse; + } + + CXnType* typeInfo = ntNode->Type(); + + if ( !typeInfo ) + { + return EFalse; + } + + const TDesC8& type = typeInfo->Type(); + + // Text element, menu item, newsticker, and marquee supported + return ( type == XnNewstickerInterface::MXnNewstickerInterface::Type() ); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CNewsTickerTransactionElement::CheckTypeL( CXnNodeAppIf& aTarget ) + { + if ( !IsSupported( aTarget ) ) + { + User::Leave( KErrNotSupported ); + } + } +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CNewsTickerTransactionElement::SetTextL() + { + // Titles are published to children elements + CXnNodeAppIf* ntNode = Target().ParentL(); + LeaveIfNull( ntNode, KErrNotSupported ); + + // Get type info + const TDesC8& type = LeaveIfNull( ntNode->Type(), KErrNotSupported )->Type(); + if ( type == XnNewstickerInterface::MXnNewstickerInterface::Type() ) + { + // Get Newsticker control interface + XnNewstickerInterface::MXnNewstickerInterface* newsTicker = NULL; + + XnComponentInterface::MakeInterfaceL( newsTicker, *ntNode ); + LeaveIfNull( newsTicker, KErrNotSupported ); + + TInt titleIndexVal = -1; + CXnProperty* titleIndex = Target().GetPropertyL( XnPropertyNames::title::KTitleIndex ); + if ( titleIndex ) + { + TLex8 lex( titleIndex->StringValue() ); + TInt err = lex.Val( titleIndexVal ); + if ( err == KErrNone && titleIndexVal > -1 ) + { + newsTicker->UpdateTitleL( iNewText, titleIndexVal ); + } + } + } + else + { + User::Leave( KErrNotSupported ); + } + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/onlineofflinehelper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/onlineofflinehelper.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,392 @@ +/* +* Copyright (c) 2005-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: Helper for online/offline state handling +* +*/ + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// User includes +#include +#include "onlineofflinehelper.h" +#include "xmluicontroller.h" +#include "appui.h" + +// Constants +const TInt KOfflineProfileId( 5 ); + +using namespace AiXmlUiController; + +// ============================ LOCAL FUNCTIONS ============================== + +// ============================ MEMBER FUNCTIONS ============================= +// --------------------------------------------------------------------------- +// COnlineOfflineHelper::NewL +// --------------------------------------------------------------------------- +// +COnlineOfflineHelper* COnlineOfflineHelper::NewL( CXmlUiController& aUiCtl ) + { + COnlineOfflineHelper* self = new ( ELeave )COnlineOfflineHelper( aUiCtl ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// COnlineOfflineHelper::COnlineOfflineHelper +// ---------------------------------------------------------------------------- +// +COnlineOfflineHelper::COnlineOfflineHelper( CXmlUiController& aUiCtl ) + : iUiCtl( aUiCtl ) + { + } + +// ---------------------------------------------------------------------------- +// COnlineOfflineHelper::ConstructL +// ---------------------------------------------------------------------------- +// +void COnlineOfflineHelper::ConstructL() + { + //Create network handling engine session. + iSession = CreateL( *this, iInfo ); + + iHandler = CProfileChangeNotifyHandler::NewL( this ); + + MProfileEngine* engine( CreateProfileEngineL() ); + + if( engine->ActiveProfileId() == KOfflineProfileId ) + { + iFlags.Set( EOfflineProfile ); + } + + engine->Release(); + + TInt value( 0 ); + + if ( iUiCtl.SettingsRepository().Get( KAIWebStatus, value ) == KErrNone ) + { + if( value && iFlags.IsClear( EOfflineProfile ) ) + { + iFlags.Set( EOnline ); + } + } + + // Update repository + iUiCtl.SettingsRepository().Set( KAIWebStatus, iFlags.IsSet( EOnline ) ); + + iCurrentNwStatus = ENWRegistrationUnknown; + } + +// ---------------------------------------------------------------------------- +// COnlineOfflineHelper::~COnlineOfflineHelper +// ---------------------------------------------------------------------------- +// +COnlineOfflineHelper::~COnlineOfflineHelper() + { + delete iHandler; + delete iSession; + // Whether the user choice EOnline should be stored in cenrep ? + } + +// ---------------------------------------------------------------------------- +// COnlineOfflineHelper::ShowOnlineItem +// ---------------------------------------------------------------------------- +// +TBool COnlineOfflineHelper::ShowOnlineItem() const + { + if ( iFlags.IsSet( EUtilizeOnline ) ) + { + TInt value ( KErrNotFound ); + if ( iUiCtl.SettingsRepository().Get( KAIWebStatus, value ) == KErrNone ) + { + return ( !value ); + } + } + return EFalse; + } + +// ---------------------------------------------------------------------------- +// COnlineOfflineHelper::ShowOfflineItem +// ---------------------------------------------------------------------------- +// +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++ ) + { + 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 ); + } + } + } + +// ---------------------------------------------------------------------------- +// COnlineOfflineHelper::ProcessOnlineStateL +// ---------------------------------------------------------------------------- +// +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 ); + } + } + } + +// ---------------------------------------------------------------------------- +// COnlineOfflineHelper::SetOnline +// ---------------------------------------------------------------------------- +// +void COnlineOfflineHelper::SetOnlineL( 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 ); + } + } + +// ---------------------------------------------------------------------------- +// COnlineOfflineHelper::HandleNetworkMessage +// ---------------------------------------------------------------------------- +// +void COnlineOfflineHelper::HandleNetworkMessage( const TNWMessages aMessage ) + { + if ( HasNetworkInfoChanged( aMessage ) ) + { + // Interpret new nw state + TRAP_IGNORE( InterpretNWMessageL( aMessage, iInfo ) ); + } + } + +// ---------------------------------------------------------------------------- +// COnlineOfflineHelper::InterpretNWMessage +// ---------------------------------------------------------------------------- +// +void COnlineOfflineHelper::InterpretNWMessageL( const TNWMessages aMessage, + const TNWInfo aNWInfo ) + { + switch ( aMessage ) + { + case MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange: + case MNWMessageObserver::ENWMessageCurrentHomeZoneMessage: + { + switch ( aNWInfo.iRegistrationStatus ) + { + case ENWRegisteredRoaming: + if( iFlags.IsSet( EOnline ) ) + { + // Process to offline state. + // Don't change the user selection. + SetOnlineL ( EFalse ); + // Show roaming notification + CAknGlobalNote* note = CAknGlobalNote::NewLC(); + HBufC* msg( StringLoader::LoadLC( R_QTN_HS_AUTOMATIC_OFFLINE ) ); + + note->ShowNoteL( EAknGlobalInformationNote, *msg ); + CleanupStack::PopAndDestroy( 2, note ); // msg + } + + iCurrentNwStatus = aNWInfo.iRegistrationStatus; + break; + case ENWRegisteredOnHomeNetwork: + // Reset to user selection + SetOnlineL(iFlags.IsSet( EOnline ) ); + + iCurrentNwStatus = aNWInfo.iRegistrationStatus; + break; + default: + // unknown state + iCurrentNwStatus = ENWRegistrationUnknown; + break; + } + } + } + } + +// ---------------------------------------------------------------------------- +// COnlineOfflineHelper::HandleNetworkError +// ---------------------------------------------------------------------------- +// +void COnlineOfflineHelper::HandleNetworkError( const TNWOperation aOperation, + TInt /*aErrorCode*/ ) + { + switch ( aOperation ) + { + case MNWMessageObserver::ENWGetNetworkProviderName: + iReceivedMessageFlags |= ENetworkProviderNameReceived; + iReceivedMessageFlags &= ~ENetworkProviderNameOk; + iInfo.iNPName.Zero(); + break; + case MNWMessageObserver::ENWGetProgrammableOperatorName: + iReceivedMessageFlags |= EProgrammableOperatorInfoReceived; + iReceivedMessageFlags &= ~EProgrammableOperatorInfoReceivedOk; + iInfo.iOperatorNameInfo.iName.Zero(); + break; + case MNWMessageObserver::ENWGetServiceProviderName: + iReceivedMessageFlags |= EServiceProviderNameReceived; + iReceivedMessageFlags &= ~EServiceProviderNameOk; + iInfo.iServiceProviderNameDisplayReq = RMobilePhone::KDisplaySPNNotRequired; + iInfo.iSPName.Zero(); + iInfo.iPLMNField.Zero(); + break; + default: + break; + } + + HandleNetworkMessage( TNWMessages( KErrGeneral ) ); + } + +// ---------------------------------------------------------------------------- +// COnlineOfflineHelper::HasNetworkInfoChanged +// ---------------------------------------------------------------------------- +// +TBool COnlineOfflineHelper::HasNetworkInfoChanged( const TNWMessages aMsg ) + { + TBool result( ETrue ); + + // pass through + if ( aMsg == MNWMessageObserver::ENWMessageCurrentHomeZoneMessage || + aMsg == MNWMessageObserver::ENWMessageNetworkConnectionFailure || + aMsg == MNWMessageObserver::ENWMessageCurrentCellInfoMessage || + aMsg == MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange ) + { + return result; + } + + result = ( iReceivedMessageFlags != iOldReceivedMessageFlags ); + + if ( !result ) + { + result = iInfo.iRegistrationStatus != iOldInfo.iRegistrationStatus; + } + + iOldReceivedMessageFlags = iReceivedMessageFlags; + iOldInfo = iInfo; + + return result; + } + +// --------------------------------------------------------------------------- +// COnlineOfflineHelper::HandleActiveProfileEventL +// --------------------------------------------------------------------------- +// +void COnlineOfflineHelper::HandleActiveProfileEventL( + TProfileEvent aProfileEvent, TInt aProfileId ) + { + //Profile activated or modified. + if ( aProfileEvent == EProfileNewActiveProfile ) + { + if( aProfileId == KOfflineProfileId ) + { + iFlags.Set( EOfflineProfile ); + // Don't change the user selection. + SetOnlineL( EFalse ); + } + else + { + iFlags.Clear( EOfflineProfile ); + // Reset to user selection + SetOnlineL(iFlags.IsSet( EOnline ) ); + } + } + + delete iHandler; + iHandler = NULL; + + iHandler = CProfileChangeNotifyHandler::NewL( this ); + } + + // End of file + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/pmodtiterator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/pmodtiterator.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,205 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: DT iterator. +* +*/ + + + +// INCLUDE FILES +//#include "xndomlist.h" +#include "xnnodeappif.h" + +#include "pmodtiterator.h" + +// ============================ LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// Finds next sibling. +// Returns NULL if there is no siblings left or there is no parent i.e this is a +// root node +// Returns: CXnDomNode* Pointer to the node or NULL +// +// ----------------------------------------------------------------------------- +// + +static CXnNodeAppIf* NextSiblingL( CXnNodeAppIf& aNode ) + { + CXnNodeAppIf* left( NULL ); + CXnNodeAppIf* parent( NULL ); + TRAP_IGNORE( parent = aNode.ParentL() ); + if ( parent ) + { + RPointerArray nodeList; + TRAP_IGNORE( nodeList = parent->ChildrenL() ); + CleanupClosePushL( nodeList ); + TInt currentIndex( nodeList.Find( &aNode ) ); + TInt nextIndex( ++currentIndex ); + TInt length( nodeList.Count() ); + if ( nextIndex < length ) + { + left = nodeList[ nextIndex ]; + } + CleanupStack::PopAndDestroy( &nodeList ); + } + return left; + } + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CPmODTIterator::CPmODTIterator( CXnNodeAppIf& aRootNode ): + iFirst(&aRootNode), iCurrent(&aRootNode) + { + } + +// ----------------------------------------------------------------------------- +// ConstructL +// ----------------------------------------------------------------------------- +// +void CPmODTIterator::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// NewL +// ----------------------------------------------------------------------------- +// +CPmODTIterator* CPmODTIterator::NewL( CXnNodeAppIf& aRootNode ) + { + CPmODTIterator* self = new( ELeave ) CPmODTIterator( aRootNode ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +CPmODTIterator::~CPmODTIterator() + { + iDepthLevel.Close(); + } + +// ----------------------------------------------------------------------------- +// First node +// ----------------------------------------------------------------------------- +// +CXnNodeAppIf* CPmODTIterator::First() + { + return iFirst; + } + +// ----------------------------------------------------------------------------- +// Next node +// ----------------------------------------------------------------------------- +// +CXnNodeAppIf* CPmODTIterator::NextL() + { + CXnNodeAppIf* firstChild( NULL ); + + //Initialise iCurrent if the whole tree has been walked through + if (!iCurrent) + { + iCurrent = iFirst; + } + RPointerArray children = iCurrent->ChildrenL(); + if( children.Count() > 0 ) + { + firstChild = children[0]; + } + children.Close(); + + // Current node has childs left + if (firstChild) + { + //Keep count of depth level + PushL( *iCurrent ); + iCurrent = firstChild; + } + else //If current node has siblings left + { + SkipBranchL(); + } + return iCurrent; + } + +// ----------------------------------------------------------------------------- +// SkipBranch +// ----------------------------------------------------------------------------- +// +CXnNodeAppIf* CPmODTIterator::SkipBranchL() + { + CXnNodeAppIf* sibling = NextSiblingL(*iCurrent); + if(sibling) + { + iCurrent = sibling; + } + else //Current node don't have any childs or siblings left + { + // Reverse the tree by moving up in hierarchy + // Move up one level in hierarchy and check if siblings exists or we are in a + // root level + TBool stop( EFalse ); + while( !stop && iDepthLevel.Count() ) + { + iCurrent = Pop(); //Reach the previous level + sibling = NextSiblingL( *iCurrent ); //Check if siblings exist + if ( sibling && iDepthLevel.Count() ) + { + iCurrent = sibling; + stop = ETrue; + } + else //We didn't find any siblings + { + iCurrent = NULL; + } + } + } + return iCurrent; + } + +// ----------------------------------------------------------------------------- +// Push node into stack. +// ----------------------------------------------------------------------------- +// +void CPmODTIterator::PushL( CXnNodeAppIf& aNode ) + { + iDepthLevel.AppendL( &aNode ); + } + +// ----------------------------------------------------------------------------- +// Pop node from stack. +// ----------------------------------------------------------------------------- +// +CXnNodeAppIf* CPmODTIterator::Pop() + { + CXnNodeAppIf* pop = NULL; + TInt count( iDepthLevel.Count() ); + if ( count ) + { + pop = iDepthLevel[ count-1 ]; + iDepthLevel.Remove( count-1 ); + } + return pop; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/policyevaluator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/policyevaluator.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,514 @@ +/* +* 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: Policy evaluator +* +*/ + + +#include "xnnodeappif.h" +#include "xnproperty.h" +#include "xnuiengineappif.h" +#include "policyevaluator.h" +#include "aipolicyelement.h" +#include "aixmluiutils.h" +#include "aistrcnv.h" +#include "aixmluiconstants.h" + +namespace + { + + void ReplaceCharacters( TDes8& aDes, + TChar aOriginal, + TChar aNew ) + { + if ( aDes.Length() == 0 ) + { + return; + } + + TPtr8 des = aDes.MidTPtr(0); + TInt pos = des.Locate( aOriginal ); + + while ( pos != KErrNotFound ) + { + des[ pos++ ] = aNew; + + if ( pos == des.Length() ) + { + break; + } + + des.Set( des.MidTPtr( pos ) ); + pos = des.Locate( aOriginal ); + } + } + + } + +using namespace AiXmlUiController; + +enum EAI2Policies + { + KAI2PolUnset = 0, + KAI2PolShow, + KAI2PolHide, + }; + +// ======== MEMBER FUNCTIONS ======== + +CPolicyEvaluator::CPolicyEvaluator() + { + } + + +void CPolicyEvaluator::ConstructL() + { + } + + +CPolicyEvaluator* CPolicyEvaluator::NewL() + { + CPolicyEvaluator* self = new( ELeave ) CPolicyEvaluator; + return self; + } + + +CPolicyEvaluator::~CPolicyEvaluator() + { + } + +void CPolicyEvaluator::EvaluateContentPolicyL( CXnNodeAppIf& aTarget, + RAiPolicyElementArray& aPolicyArray ) + { + EvaluatePolicyL( aTarget, + aPolicyArray, + AiUiDef::xml::policy::KContent ); + } + +void CPolicyEvaluator::EvaluateEmptyContentPolicyL( CXnNodeAppIf& aTarget, + RAiPolicyElementArray& aPolicyArray ) + { + EvaluatePolicyL( aTarget, + aPolicyArray, + AiUiDef::xml::policy::KEmptyContent ); + } + +void CPolicyEvaluator::EvaluateVisibilityPolicyL( CXnNodeAppIf& aTarget, + RAiPolicyElementArray& aPolicyArray ) + { + EvaluatePolicyL( aTarget, + aPolicyArray, + AiUiDef::xml::policy::KVisibilityPolicy ); + } + +void CPolicyEvaluator::EvaluateContentChangedPolicyL( CXnNodeAppIf& aTarget, + RAiPolicyElementArray& aPolicyArray ) + { + EvaluatePolicyL( aTarget, + aPolicyArray, + AiUiDef::xml::policy::KContentChanged ); + } + +void CPolicyEvaluator::EvaluateResourcePolicyL( CXnNodeAppIf& aTarget, + CXnNodeAppIf& aResource, + RAiPolicyElementArray& aPolicyArray ) + { + RPointerArray< CXnNodeAppIf > policyArray = + FindPropertyElementL( aTarget, + AiUiDef::xml::policy::KResource ); + + CleanupClosePushL( policyArray ); + + aPolicyArray.ReserveL( aPolicyArray.Count() + policyArray.Count() ); + + for ( TInt i = 0; i < policyArray.Count(); ++i ) + { + CXnNodeAppIf* property = policyArray[ i ]; + + // Get name property to lookup target ui element + const TDesC8* name = PropertyValue( *property, + AiUiDef::xml::property::KName ); + + CXnNodeAppIf* target = NULL; + if( name ) + { + // Lookup target ui element + target = property->UiEngineL()->FindNodeByIdL( *name, property->Namespace() ); + } + + if ( !target ) + { + // No target found. Continue with next property + continue; + } + + const TDesC8* value = PropertyValue( *property, + AiUiDef::xml::property::KValue ); + + if ( !value ) + { + // No value found. Continue with next property + continue; + } + + // Check if resource matches condition + const TDesC8* id = PropertyValue( aResource, + XnPropertyNames::common::KId ); + + if ( !id ) + { + continue; + } + + TInt conditionEnd = value->Locate( KRightParenthesis ); + + if ( conditionEnd++ < 0 ) + { + continue; + } + + TPtrC8 condition( value->Left( conditionEnd ) ); + TPtrC8 cssValue( value->Mid( conditionEnd ) ); + + HBufC8* condBuffer = condition.AllocL(); + TPtr8 condPtr = condBuffer->Des(); + ReplaceCharacters( condPtr, KLeftParenthesis, KWhiteSpace ); + ReplaceCharacters( condPtr, KComma, KWhiteSpace ); + ReplaceCharacters( condPtr, KRightParenthesis, KWhiteSpace ); + + if ( MatchCondition( *id, condPtr ) ) + { + // Append target and value. + // This cannot fail because space has been reserved. + aPolicyArray.Append( TAiPolicyElement( *target, cssValue ) ); + } + + delete condBuffer; + } + + CleanupStack::PopAndDestroy( &policyArray ); + } + +void CPolicyEvaluator::EvaluatePolicyL( CXnNodeAppIf& aTarget, + RAiPolicyElementArray& aPolicyArray, + const TDesC8& aPolicyClass ) + { + RPointerArray< CXnNodeAppIf > policyArray = + FindPropertyElementL( aTarget, + aPolicyClass ); + + CleanupClosePushL( policyArray ); + + aPolicyArray.ReserveL( aPolicyArray.Count() + policyArray.Count() ); + + for ( TInt i = 0; i < policyArray.Count(); ++i ) + { + CXnNodeAppIf* property = policyArray[ i ]; + + // Get name property to lookup target ui element + const TDesC8* name = PropertyValue( *property, + AiUiDef::xml::property::KName ); + + CXnNodeAppIf* target = NULL; + if( name ) + { + // Lookup target ui element + target = property->UiEngineL()->FindNodeByIdL( *name, property->Namespace() ); + } + + if ( !target ) + { + // No target found. Continue with next property + continue; + } + + const TDesC8* value = PropertyValue( *property, + AiUiDef::xml::property::KValue ); + + if ( !value ) + { + // No value found. Continue with next property + continue; + } + + if( aPolicyClass == AiUiDef::xml::policy::KVisibilityPolicy ) + { + TInt conditionEnd = value->Locate( KRightParenthesis ); + + if ( conditionEnd++ < 0 ) + { + continue; + } + + TPtrC8 condition( value->Left( conditionEnd ) ); + TPtrC8 cssValue( value->Mid( conditionEnd ) ); + + HBufC8* condBuffer = condition.AllocLC(); + TPtr8 condPtr = condBuffer->Des(); + ReplaceCharacters( condPtr, KLeftParenthesis, KWhiteSpace ); + ReplaceCharacters( condPtr, KComma, KWhiteSpace ); + ReplaceCharacters( condPtr, KRightParenthesis, KWhiteSpace ); + + if ( MatchVisibilityConditionL( condPtr, *property, aPolicyArray ) ) + { + // Append target and value. + // This cannot fail because space has been reserved. + aPolicyArray.Append( TAiPolicyElement( *target, cssValue ) ); + } + + CleanupStack::PopAndDestroy( condBuffer ); + } + else + { + // Append target and value. + // This cannot fail because space has been reserved. + aPolicyArray.Append( TAiPolicyElement( *target, *value ) ); + } + } + + CleanupStack::PopAndDestroy( &policyArray ); + } + +TBool CPolicyEvaluator::MatchCondition( const TDesC8& aId, + const TDesC8& aCondition ) + { + TBool negation = EFalse; + + TLex8 parser( aCondition ); + + if ( parser.NextToken() == AiUiDef::xml::policy::KCondition ) + { + // Condition found + parser.SkipSpace(); + + // check negation + if ( parser.Get() == KNotOperator ) + { + negation = ETrue; + } + else + { + parser.UnGet(); + } + + parser.SkipSpace(); + + TBool found = EFalse; + + // Find id from the list. Stop when found or in the end of string. + while ( !parser.Eos() ) + { + if ( parser.NextToken() == aId ) + { + found = ETrue; + break; + } + } + + // Test if id matches the given condition + return ( ( found && !negation ) || ( !found && negation ) ); // found XOR negation + } + else + { + return EFalse; + } + + } + +TBool CPolicyEvaluator::MatchVisibilityConditionL( const TDesC8& aCondition, + CXnNodeAppIf& aProperty, + RAiPolicyElementArray& aPolicyArray ) + { + TBool negation = EFalse; + TBool andOperation = EFalse; + TInt nodesVisible = 0; // for managing the end of 'or' op. + + TLex8 parser( aCondition ); + + if ( parser.NextToken() == AiUiDef::xml::policy::KCondition ) + { + // Condition found + parser.SkipSpace(); + + // check negation + if ( parser.Get() == KNotOperator ) + { + negation = ETrue; + } + else + { + parser.UnGet(); + } + + if ( parser.Get() == KAndOperator ) + { + andOperation = ETrue; + } + else + { + parser.UnGet(); + } + + parser.SkipSpace(); + + // Determine aCondition lists visibilities. Stop when: + // - Eos reached + // - First 'false' in 'and' op + // - First 'true' in 'or' op + while ( !parser.Eos() ) + { + TPtrC8 id( parser.NextToken() ); + CXnNodeAppIf* target = NULL; + TBool nodeVisible = EFalse; + + TBool displayBlockSet = KAI2PolUnset; + TBool visibilityVisibleSet = KAI2PolUnset; + + // Lookup target ui element + target = aProperty.UiEngineL()->FindNodeByIdL( id, aProperty.Namespace() ); + + if( target ) + { + // first try to first the display or visibility property updates from policy array + for( TInt i = 0; i < aPolicyArray.Count(); ++i ) + { + if( &(aPolicyArray[i].Target()) == target ) + { + if( aPolicyArray[i].Name() == XnPropertyNames::style::common::KDisplay ) + { + if( aPolicyArray[i].Value() == + XnPropertyNames::style::common::display::KBlock ) + { + displayBlockSet = KAI2PolShow; + } + else if( aPolicyArray[i].Value() == + XnPropertyNames::style::common::display::KNone ) + { + displayBlockSet = KAI2PolHide; + } + } + if( aPolicyArray[i].Name() == XnPropertyNames::style::common::KVisibility ) + { + if( aPolicyArray[i].Value() == + XnPropertyNames::style::common::visibility::KVisible ) + { + visibilityVisibleSet = KAI2PolShow; + } + else if( aPolicyArray[i].Value() == + XnPropertyNames::style::common::visibility::KHidden ) + { + visibilityVisibleSet = KAI2PolHide; + } + } + } + } + + HBufC* displayPropertyValue = NULL; + if( !displayBlockSet ) + { + // Only check CSS if policy array did not set the value + displayPropertyValue = PropertyValueL( + *target, + XnPropertyNames::style::common::KDisplay ); + CleanupStack::PushL( displayPropertyValue ); + + if( displayPropertyValue ) + { + HBufC8* buf8 = NULL; + buf8 = AiUtility::CopyToBufferL( buf8, *displayPropertyValue ); + if( buf8 ) + { + if( *buf8 == XnPropertyNames::style::common::display::KBlock ) + { + displayBlockSet = KAI2PolShow; + } + else + { + displayBlockSet = KAI2PolHide; + } + delete buf8; + } + } + CleanupStack::PopAndDestroy( displayPropertyValue ); + } + + if( !visibilityVisibleSet ) + { + displayPropertyValue = PropertyValueL( + *target, + XnPropertyNames::style::common::KVisibility ); + CleanupStack::PushL( displayPropertyValue ); + + if( displayPropertyValue ) + { + // only if visiblity property is set we affect nodeVisible variable + HBufC8* buf8 = NULL; + buf8 = AiUtility::CopyToBufferL( buf8, *displayPropertyValue ); + if( buf8 ) + { + if( *buf8 == XnPropertyNames::style::common::visibility::KVisible ) + { + visibilityVisibleSet = KAI2PolShow; + } + else + { + visibilityVisibleSet = KAI2PolHide; + } + delete buf8; + } + } + CleanupStack::PopAndDestroy( displayPropertyValue ); + } + } + + // At least one value has to be 'not unset' + // and neither can be 'hide' + if( ( displayBlockSet || visibilityVisibleSet ) && + ( ( displayBlockSet != KAI2PolHide ) && + ( visibilityVisibleSet != KAI2PolHide ) ) ) + { + nodeVisible = ETrue; + } + + if( nodeVisible ) + { + ++nodesVisible; + if( !andOperation && !negation ) + { + // 'Or' ends to first true + // 'Not and' ends to first true + return ETrue; + } + } + else if( !nodeVisible && andOperation && !negation ) + { + // 'And' ends to first false + return EFalse; + } + + parser.SkipSpace(); + } + if( nodesVisible > 0 && !negation ) + { + return ETrue; + } + if( nodesVisible == 0 && negation ) + { + return ETrue; + } + } + return EFalse; + } + +// End of file. diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/psobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/psobserver.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Observer for changes in Publish & Subscribe keys +* +*/ + + +#include "psobserver.h" +#include "mpscallback.h" + +// ============================ MEMBER FUNCTIONS =============================== + +using namespace AiXmlUiController; + +CPSObserver::CPSObserver( MPSCallback& aCallback, TUid aCategory, TInt aKey ) : + CActive( CActive::EPriorityStandard ), + iCallback( aCallback ), + iCategory( aCategory ), + iKey( aKey ) + { + CActiveScheduler::Add( this ); + } + +CPSObserver* CPSObserver::NewL( MPSCallback& aCallback, TUid aCategory, TInt aKey ) + { + CPSObserver* self = new( ELeave ) CPSObserver( aCallback, aCategory, aKey ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +CPSObserver::~CPSObserver() + { + Cancel(); + } + +void CPSObserver::ConstructL() + { + // subscribe for changes + User::LeaveIfError( iProperty.Attach( iCategory, iKey ) ); + iProperty.Subscribe( iStatus ); + SetActive(); + } + +void CPSObserver::RunL() + { + iProperty.Subscribe( iStatus ); + SetActive(); + + TInt value; + if( iProperty.Get( iCategory, iKey, value ) != KErrNotFound ) + { + iCallback.ValueUpdatedL( iKey, value ); + } + } + +TInt CPSObserver::RunError() + { + Cancel(); + return KErrNone; + } + +void CPSObserver::DoCancel() + { + iProperty.Close(); + } + +TInt CPSObserver::GetValue( TInt &aValue ) const + { + return iProperty.Get( iCategory, iKey, aValue ); + } + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/texttransactionelement.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/texttransactionelement.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,216 @@ +/* +* 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: Text transaction element +* +*/ + + +#include "texttransactionelement.h" +#include "aixmluiutils.h" + +#include "xntype.h" +#include "xnproperty.h" +#include "xntext.h" +#include "xnmenuadapter.h" +#include "xnnewsticker.h" +//#include +#include "mxncomponentinterface.h" +#include "xnnodeappif.h" +#include "xnuiengineappif.h" +#include "xnproperty.h" +#include "xndompropertyvalue.h" +#include "xnvolumecontrol.h" +#include "aistrcnv.h" + +// ============================ MEMBER FUNCTIONS =============================== + +using namespace AiXmlUiController; +using namespace XnTextInterface; + +CTextTransactionElement::CTextTransactionElement(AiUtility::CContentPriorityMap& aContentPriorityMap) + : CTransactionElement(aContentPriorityMap) + { + } + +CTextTransactionElement* CTextTransactionElement::NewL(AiUtility::CContentPriorityMap& aContentPriorityMap) + { + CTextTransactionElement* self = new( ELeave ) CTextTransactionElement(aContentPriorityMap); + + return self; + } + +CTextTransactionElement::~CTextTransactionElement() + { + if (iNewText) + { + delete iNewText; + iNewText = NULL; + } + } + +void CTextTransactionElement::InitializeL( CXnNodeAppIf& aTarget, const TDesC& aText ) + { + CheckTypeL( aTarget ); + SetTarget( aTarget ); + + if (iNewText) + { + delete iNewText; + iNewText = NULL; + } + iNewText = aText.AllocL(); + } + +void CTextTransactionElement::UpdateDataL() + { + // Set new text + SetTextL(); + + // Update content priority + UpdateContentPriorityL(); + } + +void CTextTransactionElement::Reset() + { + CTransactionElement::Reset(); + + + if (iNewText) + { + delete iNewText; + iNewText = NULL; + } + } + +TBool CTextTransactionElement::IsSupported( CXnNodeAppIf& aTarget ) + { + CXnType* typeInfo = aTarget.Type(); + + if ( !typeInfo ) + { + return EFalse; + } + + const TDesC8& type = typeInfo->Type(); + + // Text element, menu item, newsticker, and marquee supported + return ( type == XnTextInterface::MXnTextInterface::Type() || + type == KXnMenuItem || + type == KXnMenu || + type == XnPropertyNames::softkey::KNodeName || + type == XnPropertyNames::volumecontrol::KSlider /*|| + type == XnNewstickerInterface::MXnNewstickerInterface::Type() || + type == XnMarqueeInterface::MXnMarqueeInterface::Type() */); + } + +void CTextTransactionElement::CheckTypeL( CXnNodeAppIf& aTarget ) + { + if ( !IsSupported( aTarget ) ) + { + User::Leave( KErrNotSupported ); + } + } + +void CTextTransactionElement::SetTextL() + { + // Get type info + const TDesC8& type = LeaveIfNull( Target().Type(), KErrNotSupported )->Type(); + + if ( type == XnTextInterface::MXnTextInterface::Type() ) // text element + { + // Get control interface + XnTextInterface::MXnTextInterface* textControl = NULL; + XnComponentInterface::MakeInterfaceL( textControl, Target() ); + LeaveIfNull( textControl, KErrNotSupported ); + + // Set text + + textControl->SetTextL( *iNewText ); + } + + // Menu softkey texts + else if ( type == XnPropertyNames::softkey::KNodeName) + { + CXnNodeAppIf& target = Target(); + // Set the label of the softkey + CXnDomPropertyValue* propertyValue = + CXnDomPropertyValue::NewL( target.UiEngineL()->StringPool() ); + + CleanupStack::PushL( propertyValue ); + + // Convert unicode to UTF-8 + HBufC8* textBuf = NULL; + + textBuf = AiUtility::CopyToBufferL( textBuf, *iNewText ); + CleanupStack::PushL( textBuf ); + + propertyValue->SetStringValueL( CXnDomPropertyValue::EString, + *textBuf ); + + CleanupStack::PopAndDestroy( textBuf ); + + CXnProperty* newProperty = CXnProperty::NewL( XnPropertyNames::menu::KLabel, + propertyValue, + target.UiEngineL()->StringPool() ); + CleanupStack::Pop( propertyValue ); + + CleanupStack::PushL( newProperty ); + + target.SetPropertyL( newProperty ); + + CleanupStack::Pop( newProperty ); + target.UiEngineL()->RefreshMenuL(); + + } + + else if ( type == XnPropertyNames::volumecontrol::KSlider ) // slider + { + // Get volume control interface + XnVolumeControlInterface::MXnVolumeControlInterface* volumeControl = NULL; + XnComponentInterface::MakeInterfaceL( volumeControl, Target() ); + LeaveIfNull( volumeControl, KErrNotSupported ); + + TInt32 volume = 0; + + User::LeaveIfError( AiUtility::ParseInt( volume, *iNewText ) ); + volumeControl->SetValue( volume ); + } +/* else if ( type == XnNewstickerInterface::MXnNewstickerInterface::Type() ) + { + // Get Newsticker control interface + XnNewstickerInterface::MXnNewstickerInterface* newsTicker = NULL; + XnComponentInterface::MakeInterfaceL( newsTicker, Target() ); + LeaveIfNull( newsTicker, KErrNotSupported ); + + // Append new title + newsTicker->ClearTitles(); + newsTicker->AppendTitleL( iNewText ); + } + else if ( type == XnMarqueeInterface::MXnMarqueeInterface::Type() ) + { + // Get marquee interface + XnMarqueeInterface::MXnMarqueeInterface* marquee = NULL; + XnComponentInterface::MakeInterfaceL( marquee, Target() ); + LeaveIfNull( marquee, KErrNotSupported ); + + // Set new text + marquee->SetTextL( iNewText ); + }*/ + else + { + User::Leave( KErrNotSupported ); + } + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/transaction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/transaction.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,111 @@ +/* +* 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: Transaction base class +* +*/ + + +#include "transaction.h" +#include "transactionelement.h" +#include "transactionfactory.h" +#include "xmluicontrollerpanic.h" + +// ============================ MEMBER FUNCTIONS =============================== + +using namespace AiXmlUiController; + +CTransaction::CTransaction() + : iTransactionElements(CTransactionElement::LinkOffset()) + { + } + +CTransaction* CTransaction::NewL() + { + CTransaction* self = new( ELeave ) CTransaction; + + return self; + } + +CTransaction::~CTransaction() + { + __ASSERT_DEBUG( iTransactionElements.IsEmpty(), Panic( ETransactionElementListNotEmpty ) ); + } + +TInt CTransaction::Id() const + { + return iTxId; + } + +void CTransaction::Initialize(TInt aTxId) + { + iTxId = aTxId; + } + +void CTransaction::Append(MTransactionElement& aElement ) + { + iTransactionElements.AddLast(dynamic_cast(aElement)); + } + +void CTransaction::CommitL( TBool& aLayoutChanged, RPropertyHashMap& aPropertyHashMap ) + { + aLayoutChanged = EFalse; + + if ( iTransactionElements.IsEmpty() ) + { + // Nothing to do + return; + } + + // Initialize iterator + TDblQueIter iter( iTransactionElements ); + iter.SetToFirst(); + + // Commit transaction elements + while ( iter ) + { + // Commit element and advance iterator + (iter++)->CommitL( aLayoutChanged, aPropertyHashMap ); + } + } + +void CTransaction::Reset(MTransactionFactory& aFactory) + { + Deque(); + iTxId = 0; + + TDblQueIter iter( iTransactionElements ); + iter.SetToFirst(); + + while ( iter ) + { + CTransactionElement* element = iter++; + aFactory.ReleaseTransactionElement( element ); + } + + __ASSERT_DEBUG( iTransactionElements.IsEmpty(), Panic( ETransactionElementListNotEmpty ) ); + } + +TDblQueIter CTransaction::ElementIter() + { + TDblQueIter iter( iTransactionElements ); + iter.SetToFirst(); + return iter; + } + +void CTransaction::Deque() + { + iLink.Deque(); + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/transactionelement.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/transactionelement.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,187 @@ +/* +* 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: ?Description +* +*/ + + +#include "xnnodeappif.h" +#include "xnuiengineappif.h" +#include "xnproperty.h" + +#include "transactionelement.h" +#include "xmluicontrollerpanic.h" +#include "aixmluiutils.h" +#include "aixmluiconstants.h" + +#include "contentprioritymap.h" + +// ============================ MEMBER FUNCTIONS =============================== + +using namespace AiXmlUiController; +using namespace AiUiDef::xml; + +/** + * Template method implementation + */ +void MTransactionElement::CommitL( TBool& aLayoutChanged, RPropertyHashMap& aPropertyHashMap ) + { + // Update UI element data + UpdateDataL(); + + // Update CSS properties + ApplyPublishingPolicy( aLayoutChanged, aPropertyHashMap ); + } + +CTransactionElement::CTransactionElement( AiUtility::CContentPriorityMap& aContentPriorityMap ) + : iContentPriorityMap( aContentPriorityMap ), + iContentPriority( KErrNotFound ) + { + } + +CTransactionElement::~CTransactionElement() + { + } + +void CTransactionElement::Reset() + { + iTarget = NULL; + + iContentPriority = KErrNotFound; + + iElementLink.Deque(); + + iPolicyArray.Reset(); + } + +RAiPolicyElementArray& CTransactionElement::PolicyArray() + { + return iPolicyArray; + } + +void CTransactionElement::SetContentPriority( TInt aPriority ) + { + iContentPriority = aPriority; + } + +void CTransactionElement::SetCssPropertyMap( CCssPropertyMap* aPropertyMap ) + { + iPropertyMap = aPropertyMap; + } + +void CTransactionElement::SetTarget(CXnNodeAppIf& aTarget) + { + __ASSERT_DEBUG( !iTarget, Panic( ETargetNodeNotNull ) ); + iTarget = &aTarget; + } + +void CTransactionElement::ApplyPublishingPolicy( TBool& aLayoutChanged, RPropertyHashMap& aPropertyHashMap ) + { + // Ignore errors if CSS property could not be modified + TRAP_IGNORE( DoApplyPublishingPolicyL( aLayoutChanged, aPropertyHashMap ) ); + } + +void CTransactionElement::DoApplyPublishingPolicyL( TBool& aLayoutChanged, RPropertyHashMap& aPropertyHashMap ) + { + RArray targetArray; + CleanupClosePushL( targetArray ); + + for ( TInt i = 0; i < iPolicyArray.Count() && iPropertyMap; ++i ) + { + TAiPolicyElement& element = iPolicyArray[ i ]; + + RArray elementArray; + CleanupClosePushL( elementArray ); + + TBool found = EFalse; + for( TInt i2 = 0; i2 < targetArray.Count(); ++i2 ) + { + // find from target array + if( targetArray[i2] == &(element.Target()) ) + { + found = ETrue; + break; + } + } + + if( !found ) + { + // Mark this target to be processed + targetArray.Append( &(element.Target()) ); + + for( TInt i3 = 0; i3 < iPolicyArray.Count(); ++i3 ) + { + TAiPolicyElement& element2 = iPolicyArray[ i3 ]; + // find form target array + if( &(element.Target()) == &(element2.Target()) ) + { + elementArray.Append( element2 ); + } + } + + SetPropertiesToHashMapL( elementArray, *iPropertyMap, aPropertyHashMap ); + + } + + CleanupStack::PopAndDestroy(); // elementArray + + /*SetPropertyL( element.Target(), + element.Name(), + element.Value(), + *iPropertyMap );*/ + } + + CleanupStack::PopAndDestroy(); // targetArray + + if ( iPolicyArray.Count() > 0 ) + { + aLayoutChanged |= ETrue; + } + } + +CXnNodeAppIf& CTransactionElement::Target() const + { + __ASSERT_DEBUG( iTarget, Panic( ETargetNodeNull ) ); + return *iTarget; + } + +void CTransactionElement::UpdateContentPriorityL() + { + if ( iTarget && iContentPriority > KErrNotFound ) // Clear must be done with ClearContentPriority + { + const TDesC8* uiElementId = LeaveIfNull( PropertyValue( + *iTarget, + XnPropertyNames::common::KId ), + KErrGeneral ); + + User::LeaveIfError( iContentPriorityMap.SetCurrentPriority( + *uiElementId, + iContentPriority ) ); + } + } + +void CTransactionElement::ClearContentPriorityL() + { + if( iTarget ) + { + const TDesC8* uiElementId = LeaveIfNull( PropertyValue( + *iTarget, + XnPropertyNames::common::KId ), + KErrGeneral ); + + iContentPriorityMap.ClearPriority( *uiElementId ); + } + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/transactionfactoryimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/transactionfactoryimpl.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,337 @@ +/* +* 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: Transaction factory implementation +* +*/ + + +#include "transactionfactoryimpl.h" + +#include "transaction.h" +#include "texttransactionelement.h" +#include "databuffertransactionelement.h" +#include "imagetransactionelement.h" +#include "emptycontenttransactionelement.h" +#include "newstickertransactionelement.h" +#include "aixmluiconstants.h" + +using namespace AiXmlUiController; + +// ============================ MEMBER FUNCTIONS =============================== + +CTransactionFactoryImpl::CTransactionFactoryImpl( + AiUtility::CContentPriorityMap& aContentPriorityMap, + CCssPropertyMap& aPropertyMap ) + : iAvailableTransactions( CTransaction::FactoryLinkOffset() ), + iReservedTransactions( CTransaction::FactoryLinkOffset() ), + iAvailableElements( CTransactionElement::FactoryLinkOffset() ), + iReservedElements( CTransactionElement::FactoryLinkOffset() ), + iContentPriorityMap( aContentPriorityMap ), + iPropertyMap( aPropertyMap ) + { + } + +CTransactionFactoryImpl* CTransactionFactoryImpl::NewL( + AiUtility::CContentPriorityMap& aContentPriorityMap, + CCssPropertyMap& aPropertyMap ) + { + CTransactionFactoryImpl* self = + new( ELeave ) CTransactionFactoryImpl( aContentPriorityMap, + aPropertyMap ); + + return self; + } + +CTransactionFactoryImpl::~CTransactionFactoryImpl() + { + // Delete transaction objects + DeleteTransactionList( iAvailableTransactions ); + DeleteTransactionList( iReservedTransactions ); + + // Delete transaction elements + DeleteElementList( iAvailableElements ); + DeleteElementList( iReservedElements ); + } + +MTransaction* CTransactionFactoryImpl::CreateTransactionL( TInt aTxId ) + { + CTransaction* tr = NULL; + + if ( iAvailableTransactions.IsEmpty() ) // No free transactions + { + tr = CTransaction::NewL(); + } + else + { + // Take first available transaction and remove from queue + tr = iAvailableTransactions.First(); + iAvailableTransactions.Remove( *tr ); + } + + // Initialize with id + tr->Initialize(aTxId); + + // Reserve + iReservedTransactions.AddFirst( *tr ); + + return tr; + } + +void CTransactionFactoryImpl::ReleaseTransaction( MTransaction* aTransaction ) + { + CTransaction* tr = dynamic_cast< CTransaction* >( aTransaction ); + if ( tr ) + { + // Reset transaction for reuse + tr->Reset( *this ); + + // Deque from reserved list + iReservedTransactions.Remove( *tr ); + + // Enque to available list + iAvailableTransactions.AddFirst( *tr ); + } + } + +MTransactionElement* CTransactionFactoryImpl::CreateTextTransactionElementL( + CXnNodeAppIf& aTarget, + const TDesC& aText, + TInt aPriority ) + { + // Instantiate new element + CTextTransactionElement* element = NewInstanceL< CTextTransactionElement >(); + + CleanupStack::PushL( element ); + + // Initialize element + element->InitializeL( aTarget, aText ); + + CleanupStack::Pop( element ); + + // Reserve + iReservedElements.AddLast( *element ); + + // Set content priority + element->SetContentPriority( aPriority ); + + return element; + } + +MTransactionElement* + CTransactionFactoryImpl::CreateDataBufferTransactionElementL( + CXnNodeAppIf& aTarget, + const TDesC8& aData, + TInt aPriority ) + { + // Instantiate element + CDataBufferTransactionElement* element = NewInstanceL< CDataBufferTransactionElement >(); + CleanupStack::PushL( element ); + + // Initialize + element->InitializeL( aTarget, aData ); + CleanupStack::Pop( element ); + + // Reserve + iReservedElements.AddLast( *element ); + + // Set content priority + element->SetContentPriority( aPriority ); + + return element; + } + +MTransactionElement* + CTransactionFactoryImpl::CreateEmptyContentTransactionElementL( + CXnNodeAppIf& aTarget, + TInt aIndex) + { + // Instantiate + CEmptyContentTransactionElement* element = NewInstanceL< CEmptyContentTransactionElement >(); + + CleanupStack::PushL( element ); + + // Initialize + element->InitializeL( aTarget, aIndex ); + + CleanupStack::Pop( element ); + + // Reserve + iReservedElements.AddLast( *element ); + + return element; + } + +MTransactionElement* CTransactionFactoryImpl::CreateImageTransactionElementL( CXnNodeAppIf& aTarget, + CGulIcon* aIcon, + TInt aPriority ) + { + // Instantiate + CImageTransactionElement* element = NewInstanceL< CImageTransactionElement >(); + + CleanupStack::PushL( element ); + + // Initialize + element->InitializeL( aTarget, aIcon ); + + CleanupStack::Pop( element ); + + // Reserve + iReservedElements.AddLast( *element ); + + // Set priority + element->SetContentPriority( aPriority ); + + return element; + } + +MTransactionElement* CTransactionFactoryImpl::CreateImageTransactionElementL( + CXnNodeAppIf& aTarget, + RFile& aFile, + TInt aPriority ) + { + // Instantiate + CImageTransactionElement* element = NewInstanceL< CImageTransactionElement >(); + + CleanupStack::PushL( element ); + + // Initialize + element->InitializeL( aTarget, aFile ); + + CleanupStack::Pop( element ); + + // Reserve + iReservedElements.AddLast( *element ); + + // Set priority + element->SetContentPriority( aPriority ); + + return element; + } + +MTransactionElement* CTransactionFactoryImpl::CreateNewsTickerTransactionElementL( + CXnNodeAppIf& aTarget, + const TDesC& aText, + TInt aPriority, + TInt aIndex ) + { + // Instantiate new element + CNewsTickerTransactionElement* element = NewInstanceL< CNewsTickerTransactionElement >(); + + CleanupStack::PushL( element ); + + // Initialize element + element->InitializeL( aTarget, aText, aIndex ); + + CleanupStack::Pop( element ); + + // Reserve + iReservedElements.AddLast( *element ); + + // Set content priority + element->SetContentPriority( aPriority ); + + return element; + } + +void CTransactionFactoryImpl::ReleaseTransactionElement( MTransactionElement* aElement) + { + CTransactionElement* element = dynamic_cast< CTransactionElement* >( aElement ); + + if ( element ) + { + // Reset element + element->Reset(); + + // Move element from reserved list to available + iReservedElements.Remove( *element ); + iAvailableElements.AddFirst( *element ); + } + } + +TBool CTransactionFactoryImpl::IsSupported( CXnNodeAppIf& aTarget, const TDesC8& aContentType ) + { + // Check if target node and content type is supported + if ( aContentType == KContentTypeText ) + { + return CTextTransactionElement::IsSupported( aTarget ) || CNewsTickerTransactionElement::IsSupported( aTarget ); + } + else if ( aContentType == KContentTypeBitmap ) + { + return CImageTransactionElement::IsSupported( aTarget ); + } + else + { + return CDataBufferTransactionElement::IsSupported( aTarget, aContentType ); + } + } + +template< class T > T* CTransactionFactoryImpl::NewInstanceL() + { + T* instance = NULL; + + // Iterate list of transaction elements + TSglQueIter< CTransactionElement > iter( iAvailableElements ); + iter.SetToFirst(); + + while ( iter ) + { + instance = dynamic_cast< T* >( iter++ ); // NULL if not T* + + if ( instance ) + { + // Deque first instance of class T and quit + iAvailableElements.Remove( *instance ); + return instance; + } + } + + // Not found from list. Instantiate + instance = T::NewL(iContentPriorityMap); + instance->SetCssPropertyMap( &iPropertyMap ); + + return instance; + } + +void CTransactionFactoryImpl::DeleteTransactionList( TSglQue< CTransaction >& aList ) + { + TSglQueIter< CTransaction > trIter( aList ); + trIter.SetToFirst(); + + while (trIter) + { + // Get first transaction and remove it from the list + CTransaction* first = trIter++; + aList.Remove( *first ); + + // Delete + first->Reset( *this ); + delete first; + } + } + +void CTransactionFactoryImpl::DeleteElementList( TSglQue< CTransactionElement >& aList ) + { + TSglQueIter< CTransactionElement > iter( aList ); + iter.SetToFirst(); + + while ( iter ) + { + CTransactionElement* element = iter++; + aList.Remove( *element ); + + delete element; + } + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/xmlnodeidgenerator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/xmlnodeidgenerator.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,103 @@ +/* +* 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: Builder class for XML UI node identifiers. +* +*/ + + +#include "xmlnodeidgenerator.h" +#include "aipropertyextension.h" +#include "aicontentmodel.h" +#include "aixmluiutils.h" +#include "aixmluiconstants.h" +#include "aistrcnv.h" + +using namespace AiXmlUiController; + +CXmlNodeIdGenerator::CXmlNodeIdGenerator() + { + } + +CXmlNodeIdGenerator* CXmlNodeIdGenerator::NewL() + { + return new(ELeave) CXmlNodeIdGenerator; + } + +CXmlNodeIdGenerator::~CXmlNodeIdGenerator() + { + delete iContentNodeIdBuf; + } + +TPtrC CXmlNodeIdGenerator::SettingsNodeIdL( const TAiPublisherInfo& aPubInfo ) + { + const TInt idLength = aPubInfo.iName.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 ); + + return bufPtr; + } + +TPtrC CXmlNodeIdGenerator::ContentNodeIdL(MAiPropertyExtension& aPlugin, const TAiContentItem& aContentItem) + { + TAiPublisherInfo* info = static_cast( aPlugin.GetPropertyL( EAiPublisherInfo ) ); + + LeaveIfNull( info, KErrNotFound ); + + return ContentNodeIdL(*info, aContentItem); + } + +TPtrC CXmlNodeIdGenerator::ContentNodeIdL + ( const TAiPublisherInfo& aPubInfo, const TAiContentItem& 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 ) ); + + // Copy publisher info name to the buffer + bufPtr.Copy( aPubInfo.iName ); + + // Append separator + bufPtr.Append( AiUiDef::xml::id::KContentIdSeparator ); + + // Append content item id + bufPtr.Append( contentCid ); + + return bufPtr; + } + +TPtrC CXmlNodeIdGenerator::ResourceNodeIdL + ( MAiPropertyExtension& aPlugin, const TAiContentItem& aContentItem ) + { + TAiPublisherInfo* info = static_cast( aPlugin.GetPropertyL( EAiPublisherInfo ) ); + + LeaveIfNull( info, KErrNotFound ); + + return ResourceNodeIdL(*info, aContentItem); + } + +TPtrC CXmlNodeIdGenerator::ResourceNodeIdL + ( const TAiPublisherInfo& aPubInfo, const TAiContentItem& aContentItem ) + { + // Resources node id is similar to content node id + return ContentNodeIdL( aPubInfo, aContentItem ); + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/xmluicontroller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/xmluicontroller.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1023 @@ +/* +* Copyright (c) 2005-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: XML UI Controller main class +* +*/ + +// System includes +#include +#include +#include +#include +#include +#include + +// User includes +#include +#include +#include +#include +#include + +#include "xmluicontroller.h" + +#include "xnuiengineappif.h" +#include "xnnodeappif.h" +#include "xnproperty.h" +#include "xntype.h" +#include "aistrcnv.h" + +#include "application.h" +#include "appui.h" +#include "xmlnodeidgenerator.h" +#include "aixuikoneventhandler.h" +#include "aixmluiutils.h" +#include "aiutility.h" +#include "aipluginsettings.h" +#include "aixmluiconstants.h" +#include "aifweventhandler.h" +#include "debug.h" +#include "aiconsts.h" +#include "contentrenderer.h" +#include "xmluicontrollerpanic.h" +#include "pmodtiterator.h" +#include "contentpublisher.h" +#include "xnplugindefs.h" +#include "ainativeuiplugins.h" + + +using namespace AiXmlUiController; + +const TInt KOneSecondInMicroS = 1000*1000; +const TInt KAI2CrKeyIncrementBy2 = 2; + +typedef TBuf<32> TNamespace; + +_LIT( KSettingsDummyData, "" ); + +// ======== LOCAL FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// ResolveEventParameters() +// ---------------------------------------------------------------------------- +// +static void ResolveEventParameters( const TDesC8& aEventString, + TPtrC8& aParam1, TPtrC8& aParam2 ) + { + TInt paramPos( aEventString.Locate( KEventParameterSeparator ) ); + + TLex8 lex( aEventString.Mid( ++paramPos ) ); + + aParam1.Set( lex.NextToken() ); // first ui element id + + TInt commaPos( aParam1.LocateReverse( KComma ) ); + + if( commaPos != KErrNotFound ) + { + // Strip comma + aParam1.Set( aParam1.Left( commaPos ) ); + + aParam2.Set( lex.NextToken() ); // second ui element id + + TInt rightParenthesis( aParam2.LocateReverse( KRightParenthesis ) ); + + if( rightParenthesis != KErrNotFound ) + { + aParam2.Set( aParam2.Left( rightParenthesis ) ); + } + } + else + { + // Strip right parenthesis + aParam1.Set( aParam1.Left( aParam1.Length() -1 ) ); + } + } + +// ======== MEMBER FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// CXmlUiController::CXmlUiController() +// ---------------------------------------------------------------------------- +// +CXmlUiController::CXmlUiController() + { + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::ConstructL() +// ---------------------------------------------------------------------------- +// +void CXmlUiController::ConstructL() + { + iNodeIdGenerator = CXmlNodeIdGenerator::NewL(); + + iAISettingsRepository = + CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); + + // Indicate to wserv plugin if it launches logs on send key or not + RProperty::Set( KPSUidAiInformation, KActiveIdleActOnSendKey, ETrue ); + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::NewL() +// ---------------------------------------------------------------------------- +// +CXmlUiController* CXmlUiController::NewL() + { + CXmlUiController* self = new ( ELeave ) CXmlUiController; + + CleanupStack::PushL( self ); + self->ConstructL(); + + // Set XML UI Controller object to TLS for access in static + // CXmlUiController::NewApplication + User::LeaveIfError( Dll::SetTls( self ) ); + + CleanupStack::Pop( self ); + + return self; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::~CXmlUiController() +// ---------------------------------------------------------------------------- +// +CXmlUiController::~CXmlUiController() + { + delete iNodeIdGenerator; + delete iExitTimer; + delete iAISettingsRepository; + delete iCPSpublisher; + + // Reset TLS pointer to this set in NewL + Dll::SetTls( NULL ); + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::Exit() +// ---------------------------------------------------------------------------- +// +void CXmlUiController::Exit() + { + if( iExitTimer ) + { + iExitTimer->Cancel(); + + iExitTimer->Start( 0, KOneSecondInMicroS, + TCallBack( ExitTimerCallBack, this ) ); + } + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::ExitTimerCallBack() +// ---------------------------------------------------------------------------- +// +TInt CXmlUiController::ExitTimerCallBack(TAny *aSelf) + { + CXmlUiController* self = + static_cast< CXmlUiController* >( aSelf ); + + if( self ) + { + self->iExitTimer->Cancel(); + + self->iAppUi->Exit(); + } + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::SetObserver() +// ---------------------------------------------------------------------------- +// +void CXmlUiController::SetObserver( MAiContentObserver& aObserver ) + { + iObserver = &aObserver; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::SetAppUi() +// ---------------------------------------------------------------------------- +// +void CXmlUiController::SetAppUi( CAppUi& aAppUi ) + { + iAppUi = &aAppUi; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::AppUi() +// ---------------------------------------------------------------------------- +// +CAppUi* CXmlUiController::AppUi() const + { + return iAppUi; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::UiEngineL() +// ---------------------------------------------------------------------------- +// +TXnUiEngineAppIf* CXmlUiController::UiEngineL() const + { + return iAppUi ? iAppUi->UiEngineL() : NULL; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::SettingsRepository() +// ---------------------------------------------------------------------------- +// +CRepository& CXmlUiController::SettingsRepository() const + { + return *iAISettingsRepository; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::CreateXuikonEventHandlerL() +// ---------------------------------------------------------------------------- +// +CAIXuikonEventHandler* CXmlUiController::CreateXuikonEventHandlerL( + CContentRenderer& aRenderer ) + { + CAIXuikonEventHandler* eventHandler = + CAIXuikonEventHandler::NewL( *this, aRenderer ); + + eventHandler->SetFwEventHandler( iFwEventHandler ); + eventHandler->SetUiEventHandler( this ); + + return eventHandler; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::NotifyAppEnvReadyL() +// ---------------------------------------------------------------------------- +// +void CXmlUiController::NotifyAppEnvReadyL() + { + if( iFwEventHandler ) + { + iFwEventHandler->AppEnvReadyL(); + iFwEventHandler->HandleUiReadyEventL( *this ); + } + + if( !iCPSpublisher ) + { + iCPSpublisher = CContentPublisher::NewL( *this ); + } + + if( !iExitTimer ) + { + iExitTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + } + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::LoadUIDefinition() +// ---------------------------------------------------------------------------- +// +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 ); + } + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::PublisherInfoL() +// ---------------------------------------------------------------------------- +// +void CXmlUiController::PublisherInfoL( CXnNodeAppIf& aSource, + TAiPublisherInfo& aInfo ) + { + // Fetch uid from XML and convert it to TUid + const TDesC8* uid( PropertyValue( aSource, + AiUiDef::xml::property::KValue ) ); + + if ( !uid ) + { + return; + } + + _LIT8( KPrefix, "0x" ); + + const TInt pos( uid->FindF( KPrefix ) ); + + 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 ); + + if ( parseResult == KErrNone ) + { + TInt32 value32( value ); + + aInfo.iUid = TUid::Uid( value32 ); + } + } + + // Fetch plug-in name from XML + HBufC* pluginName( PropertyValueL( aSource, + AiUiDef::xml::property::KName ) ); + + CleanupStack::PushL( pluginName ); + + if ( pluginName ) + { + aInfo.iName.Copy( *pluginName ); + } + + CleanupStack::PopAndDestroy( pluginName ); + + aInfo.iNamespace.Copy( aSource.Namespace() ); + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::GetSettingsL() +// ---------------------------------------------------------------------------- +// +void CXmlUiController::GetSettingsL( const TAiPublisherInfo& aPubInfo, + RAiSettingsItemArray& aSettings ) + { + if ( aPubInfo.iNamespace == KNativeUiNamespace ) + { + // This controller doesn't provide settings for native ui namespace + return; + } + + const TDesC& classId( iNodeIdGenerator->SettingsNodeIdL( aPubInfo ) ); + + TNamespace ns; + + ns.Copy( aPubInfo.iNamespace ); + + // Find settings nodes + RPointerArray< CXnNodeAppIf > nodes( + UiEngineL()->FindNodeByClassL( classId, ns ) ); + + CleanupClosePushL( nodes ); + + // Reserve space for settings + aSettings.ReserveL( aSettings.Count() + nodes.Count() ); + + // Collect settings + TInt count( nodes.Count() ); + + for( TInt i = 0; i < count; ++i ) + { + CXnNodeAppIf* node( nodes[i] ); + + const TDesC8* name( + PropertyValue( *node, AiUiDef::xml::property::KName ) ); + + HBufC* value( + PropertyValueL( *node, AiUiDef::xml::property::KValue ) ); + + CleanupStack::PushL( value ); + + if( name && value ) + { + MAiPluginSettings* settings( AiUtility::CreatePluginSettingsL() ); + CleanupDeletePushL( settings ); + + MAiPluginSettingsItem& item( settings->AiPluginSettingsItem() ); + item.SetPublisherId( aPubInfo.iUid ); + + TInt32 key( 0 ); + + User::LeaveIfError( AiUtility::ParseInt( key, *name ) ); + + item.SetKey( key ); + item.SetValueL( *value, EFalse ); + + // Append settings into array. + // This can not fail because space has been reserved. + aSettings.Append( settings ); + CleanupStack::Pop( settings ); + } + + CleanupStack::PopAndDestroy( value ); + } + + 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 + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::GetContentModelL() +// ---------------------------------------------------------------------------- +// +// ContentModelL() +void CXmlUiController::GetContentModelL( const TAiPublisherInfo& aPubInfo, + RAiSettingsItemArray& aSettings ) + { + if ( aPubInfo.iNamespace == KNativeUiNamespace ) + { + // This controller doesn't provide content model for native ui namespace + return; + } + + // Find the node for the publisher + // TODO Does not work if widget is in view + RPointerArray list( + UiEngineL()->FindContentSourceNodesL( aPubInfo.iNamespace ) ); + CleanupClosePushL( list ); + + CXnNodeAppIf* publisherNode( NULL ); + + if ( list.Count() > 0 ) + { + publisherNode = list[0]; + } + + CleanupStack::PopAndDestroy( &list ); + + if( !publisherNode ) + { + return; + } + + // Find ui plugin node for the data plugin + CXnNodeAppIf* parentNode( publisherNode->ParentL() ); + + // parent must be correct type + if( parentNode->InternalDomNodeType() == _L8("widget") ) + { + // Get plugin configurations + GetConfigurationsL( *parentNode, aSettings, AiUiDef::xml::element::K16Plugin()); + CPmODTIterator* iter = CPmODTIterator::NewL( *parentNode ); + CleanupStack::PushL( iter ); + CXnNodeAppIf* node = iter->First(); + while( node ) + { + const TDesC8& nodeType = node->Type()->Type(); + if( nodeType == XnPropertyNames::action::KActions) + { + node = iter->SkipBranchL(); + } + // Get the content model and configuration for the supported elements + else if( nodeType == AiUiDef::xml::element::KImage || + nodeType == AiUiDef::xml::element::KText || + nodeType == AiUiDef::xml::element::KNewsTicker ) + { + // Is created in GetContenItem and used in GetConfigurationsL + HBufC* confOwner( NULL ); + // get content item for the element, confOwner is filled + GetContentItemL( *node, aSettings, confOwner ); + if( confOwner ) + { + CleanupStack::PushL( confOwner ); + // get configurations for the element + GetConfigurationsL( *node, aSettings, *confOwner ); + CleanupStack::PopAndDestroy( confOwner ); + } + node = iter->SkipBranchL(); + } + else + { + node = iter->NextL(); + } + } + CleanupStack::PopAndDestroy( iter ); + } + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::GetContentItemL() +// ---------------------------------------------------------------------------- +// +// ContentItemL() +void CXmlUiController::GetContentItemL( CXnNodeAppIf& aNode, + RAiSettingsItemArray& aSettings, HBufC*& aItemName ) + { + // Find property node + RPointerArray childNodes( aNode.ChildrenL() ); + CleanupClosePushL( childNodes ); + + TInt count( childNodes.Count() ); + + for ( TInt i = 0; i < count; i++ ) + { + CXnNodeAppIf* node( childNodes[i] ); + + if( node->Type()->Type() == XnPropertyNames::action::KProperty ) + { + HBufC* name = PropertyValueL( *node, AiUiDef::xml::property::KClass ); + CleanupStack::PushL( name ); + + if( name ) + { + // Content model found for the element, create content item + MAiPluginSettings* settings = AiUtility::CreatePluginSettingsL(); + CleanupDeletePushL( settings ); + + MAiPluginContentItem& item = settings->AiPluginContentItem(); + + // Type of the element is needed in content model + HBufC* type( NULL ); + type = AiUtility::CopyToBufferL( type, aNode.Type()->Type()); + CleanupStack::PushL( type ); + item.SetTypeL( *type ); + CleanupStack::PopAndDestroy( type ); + + item.SetNameL( *name ); + + aItemName = name; + aSettings.AppendL( settings ); + CleanupStack::Pop( settings ); + } + + // Ownership is given to aItemName + CleanupStack::Pop( name ); + + // First property element, which has class attribute is selected + break; + } + } + + CleanupStack::PopAndDestroy( &childNodes ); + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::GetConfigurationsL() +// ---------------------------------------------------------------------------- +// +// ConfigurationItemsL() +void CXmlUiController::GetConfigurationsL( CXnNodeAppIf& aNode, + RAiSettingsItemArray& aSettings, const TDesC& aConfOwner ) + { + // Find configuration nodes + RPointerArray< CXnNodeAppIf > nodes( aNode.ChildrenL() ); + CleanupClosePushL( nodes ); + + // Collect settings + TInt count( nodes.Count() ); + + for( TInt j = 0; j < count; j++ ) + { + CXnNodeAppIf* node( nodes[j] ); + + if( node->Type()->Type() == AiUiDef::xml::element::KConfiguration ) + { + HBufC* name( PropertyValueL( *node, AiUiDef::xml::property::KName ) ); + CleanupStack::PushL( name ); + + HBufC* value( PropertyValueL( *node, AiUiDef::xml::property::KValue ) ); + CleanupStack::PushL( value ); + + MAiPluginSettings* settings = AiUtility::CreatePluginSettingsL(); + CleanupDeletePushL( settings ); + + MAiPluginConfigurationItem& item( settings->AiPluginConfigurationItem() ); + + item.SetOwnerL( aConfOwner ); + item.SetNameL( *name ); + item.SetValueL( *value ); + + // Append settings into array. + aSettings.AppendL( settings ); + + CleanupStack::Pop( settings ); + CleanupStack::PopAndDestroy( value ); + CleanupStack::PopAndDestroy( name ); + } + } + + CleanupStack::PopAndDestroy( &nodes ); + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::ActivateUI() +// ---------------------------------------------------------------------------- +// +void CXmlUiController::ActivateUI() + { + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::GetContentObserver() +// ---------------------------------------------------------------------------- +// +MAiContentObserver& CXmlUiController::GetContentObserver() + { + return *iObserver; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::SetEventHandler() +// ---------------------------------------------------------------------------- +// +void CXmlUiController::SetEventHandler( MAiFwEventHandler& aFwEventHandler ) + { + iFwEventHandler = &aFwEventHandler; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::RemovePluginFromUI() +// ---------------------------------------------------------------------------- +// +void CXmlUiController::RemovePluginFromUI( MAiPropertyExtension& aPlugin ) + { + CContentRenderer* contentRenderer = + static_cast< CContentRenderer* >( iObserver ); + + if ( contentRenderer ) + { + contentRenderer->CleanPluginFromUi( aPlugin ); + } + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::FwEventHandler() +// ---------------------------------------------------------------------------- +// +MAiFwEventHandler* CXmlUiController::FwEventHandler() const + { + return iFwEventHandler; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::MainInterface() +// ---------------------------------------------------------------------------- +// +MAiMainUiController* CXmlUiController::MainInterface() + { + return this; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::SecondaryInterface() +// ---------------------------------------------------------------------------- +// +MAiSecondaryUiController* CXmlUiController::SecondaryInterface() + { + return NULL; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::RunApplicationL() +// ---------------------------------------------------------------------------- +// +void CXmlUiController::RunApplicationL() + { + iRunningAsMain = ETrue; + + User::LeaveIfError( + EikStart::RunApplication( &CXmlUiController::NewApplication ) ); + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::CoeEnv() +// ---------------------------------------------------------------------------- +// +CCoeEnv& CXmlUiController::CoeEnv() + { + __ASSERT_ALWAYS( iAppUi, Panic(ECriticalPointerNull) ); + return *iAppUi->CoeEnv(); + } + +// ---------------------------------------------------------------------------- +// 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; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::HandleUiEvent() +// ---------------------------------------------------------------------------- +// +TBool CXmlUiController::HandleUiEvent( TAny* aEvent, const TDesC8& aParam ) + { + CXnNodeAppIf* event( static_cast( aEvent ) ); + + TBool retval( EFalse ); + + if( event ) + { + TPtrC8 param1; + TPtrC8 param2; + const TDesC8& eventString( + aParam.Mid( AiUiDef::xml::event::KUiEventPrefix().Length() ) ); + + // Extract event name + TInt paramPos( eventString.Locate( KEventParameterSeparator ) ); + + const TDesC8& eventName( eventString.Left( Max( 0, paramPos ) ) ); + + if( eventName == AiUiDef::xml::event::KFocusGained ) + { + // Resolve event parameters + ResolveEventParameters( eventString, param1, param2 ); + + TRAP_IGNORE( HandleFocusGainedL( param1, param2, *event ) ); + + retval = ETrue; + } + else if( eventName == AiUiDef::xml::event::KSetElementSizeToCPS ) + { + // Resolve event parameters + ResolveEventParameters( eventString, param1, param2 ); + + TRAP_IGNORE( HandleSetElementSizeL( param1, *event )); + + retval = ETrue; + } + } + + return retval; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::HandleSetElementSizeL() +// ---------------------------------------------------------------------------- +// +void CXmlUiController::HandleSetElementSizeL( const TDesC8& aElementName, + CXnNodeAppIf& aOrigin ) + { + __UHEAP_MARK; + // Resolve ui elements + CXnNodeAppIf* element( + UiEngineL()->FindNodeByIdL( aElementName, aOrigin.Namespace() ) ); + + LeaveIfNull( element, KErrNotFound ); + + TRect rect( element->Rect() ); + + HBufC* elementName( NULL ); + elementName = AiUtility::CopyToBufferL( elementName, aElementName ); + CleanupStack::PushL( elementName ); + + iCPSpublisher->PublishSizeL( *elementName, rect.Width(), rect.Height() ); + + CleanupStack::PopAndDestroy( elementName ); + + __UHEAP_MARKEND; + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::HandleFocusGainedL() +// ---------------------------------------------------------------------------- +// +void CXmlUiController::HandleFocusGainedL( const TDesC8& aUiElement1, + const TDesC8& aUiElement2, CXnNodeAppIf& aOrigin ) + { + // Resolve ui elements + CXnNodeAppIf* element1( + UiEngineL()->FindNodeByIdL( aUiElement1, aOrigin.Namespace() ) ); + + LeaveIfNull( element1, KErrNotFound ); + + CXnNodeAppIf* element2( + UiEngineL()->FindNodeByIdL( aUiElement2, aOrigin.Namespace() ) ); + + LeaveIfNull( element2, KErrNotFound ); + + // swap display properties between ui elements + CXnProperty* display1( + element1->GetPropertyL( XnPropertyNames::style::common::KDisplay ) ); + + LeaveIfNull( display1, KErrNotFound ); + + CXnProperty* display2( + element2->GetPropertyL( XnPropertyNames::style::common::KDisplay ) ); + + LeaveIfNull( display2, KErrNotFound ); + + display1 = display1->CloneL(); + CleanupStack::PushL( display1 ); + + display2 = display2->CloneL(); + CleanupStack::PushL( display2 ); + + element1->SetPropertyL( display2 ); + CleanupStack::Pop( display2 ); + + element2->SetPropertyL( display1 ); + CleanupStack::Pop( display1 ); + } + +// ---------------------------------------------------------------------------- +// CXmlUiController::NewApplication() +// ---------------------------------------------------------------------------- +// +CApaApplication* CXmlUiController::NewApplication() + { + CXmlUiController* self = static_cast(Dll::Tls()); + __ASSERT_ALWAYS( self, Panic(ECriticalPointerNull) ); + return CApplication::New(*self); + } + +const TImplementationProxy KImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(KImplementationUidXmlUiController, CXmlUiController::NewL) + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(KImplementationTable) / sizeof(TImplementationProxy); + return KImplementationTable; + } + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluicontroller/src/xmluicontrollerpanic.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluicontroller/src/xmluicontrollerpanic.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* 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: Module specific panic definitions +* +*/ + + +#include +#include "xmluicontrollerpanic.h" + +using namespace AiXmlUiController; + +void AiXmlUiController::Panic( TAiXmlUiControllerPanic aPanic ) + { + _LIT( KPanicCategory, "XmlUiController" ); + User::Panic( KPanicCategory, aPanic ); + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/dom/bwins/xn3domdocumentu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/dom/bwins/xn3domdocumentu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,109 @@ +EXPORTS + ?IsRefNode@CXnDomNode@@QBEHXZ @ 1 NONAME ; int CXnDomNode::IsRefNode(void) const + ??1CXnDomAttribute@@UAE@XZ @ 2 NONAME ; CXnDomAttribute::~CXnDomAttribute(void) + ?Value@CXnDomAttribute@@QAEABVTDesC8@@XZ @ 3 NONAME ; class TDesC8 const & CXnDomAttribute::Value(void) + ?NewL@CXnDomDocument@@SAPAV1@AAVRReadStream@@@Z @ 4 NONAME ; class CXnDomDocument * CXnDomDocument::NewL(class RReadStream &) + ?InternalizeL@CXnDomDocument@@QAEXAAVRReadStream@@@Z @ 5 NONAME ; void CXnDomDocument::InternalizeL(class RReadStream &) + ?SetContentType@CXnDomNode@@QAEXABW4TContentType@@@Z @ 6 NONAME ; void CXnDomNode::SetContentType(enum TContentType const &) + ?RemoveItem@CXnDomList@@QAEXPAVMXnDomListItem@@@Z @ 7 NONAME ; void CXnDomList::RemoveItem(class MXnDomListItem *) + ?MarshallL@CXnDomDocument@@QAEPAVHBufC8@@XZ @ 8 NONAME ; class HBufC8 * CXnDomDocument::MarshallL(void) + ??1CXnDomDepthIterator@@UAE@XZ @ 9 NONAME ; CXnDomDepthIterator::~CXnDomDepthIterator(void) + ?IsValueSet@CXnDomProperty@@QAEHXZ @ 10 NONAME ; int CXnDomProperty::IsValueSet(void) + ?SetPCDataL@CXnDomNode@@QAEXABVTDesC8@@@Z @ 11 NONAME ; void CXnDomNode::SetPCDataL(class TDesC8 const &) + ?DescendantCount@CXnDomNode@@QBEHXZ @ 12 NONAME ; int CXnDomNode::DescendantCount(void) const + ?IsAutoIdent@CXnDomPropertyValue@@QAEHXZ @ 13 NONAME ; int CXnDomPropertyValue::IsAutoIdent(void) + ?AttributeList@CXnDomNode@@QBEAAVCXnDomList@@XZ @ 14 NONAME ; class CXnDomList & CXnDomNode::AttributeList(void) const + ?StringValue@CXnDomPropertyValue@@QAEABVTDesC8@@XZ @ 15 NONAME ; class TDesC8 const & CXnDomPropertyValue::StringValue(void) + ?SetRefNode@CXnDomNode@@QAEXH@Z @ 16 NONAME ; void CXnDomNode::SetRefNode(int) + ?AddItemL@CXnDomList@@QAEXPAVMXnDomListItem@@@Z @ 17 NONAME ; void CXnDomList::AddItemL(class MXnDomListItem *) + ?AddChildL@CXnDomNode@@QAEXPAV1@H@Z @ 18 NONAME ; void CXnDomNode::AddChildL(class CXnDomNode *, int) + ?IsInheritIdent@CXnDomPropertyValue@@QAEHXZ @ 19 NONAME ; int CXnDomPropertyValue::IsInheritIdent(void) + ?StringPool@CXnDomDocument@@QBEAAVCXnDomStringPool@@XZ @ 20 NONAME ; class CXnDomStringPool & CXnDomDocument::StringPool(void) const + ?Parent@CXnDomNode@@QBEPAV1@XZ @ 21 NONAME ; class CXnDomNode * CXnDomNode::Parent(void) const + ?Name@CXnDomAttribute@@UAEABVTDesC8@@XZ @ 22 NONAME ; class TDesC8 const & CXnDomAttribute::Name(void) + ?CloneL@CXnDomProperty@@QAEPAV1@XZ @ 23 NONAME ; class CXnDomProperty * CXnDomProperty::CloneL(void) + ?Last@CXnDomList@@QAEPAVMXnDomListItem@@XZ @ 24 NONAME ; class MXnDomListItem * CXnDomList::Last(void) + ?AddStringL@CXnDomStringPool@@QAEHABVTDesC8@@@Z @ 25 NONAME ; int CXnDomStringPool::AddStringL(class TDesC8 const &) + ?StringValueL@CXnDomPropertyValue@@QAEABVTDesC8@@XZ @ 26 NONAME ; class TDesC8 const & CXnDomPropertyValue::StringValueL(void) + ?SetPseudoClass@CXnDomProperty@@QAEXW4TPseudoClass@1@@Z @ 27 NONAME ; void CXnDomProperty::SetPseudoClass(enum CXnDomProperty::TPseudoClass) + ?ReplaceChildL@CXnDomNode@@QAEXPAV1@0@Z @ 28 NONAME ; void CXnDomNode::ReplaceChildL(class CXnDomNode *, class CXnDomNode *) + ?CreateRefNodeL@CXnDomNode@@QAEPAV1@XZ @ 29 NONAME ; class CXnDomNode * CXnDomNode::CreateRefNodeL(void) + ?Length@CXnDomList@@QBEHXZ @ 30 NONAME ; int CXnDomList::Length(void) const + ?AppendPCDataL@CXnDomNode@@QAEXABVTDesC8@@@Z @ 31 NONAME ; void CXnDomNode::AppendPCDataL(class TDesC8 const &) + ?ReleaseData@CXnDomPropertyValue@@QAEXXZ @ 32 NONAME ; void CXnDomPropertyValue::ReleaseData(void) + ?ItemIndex@CXnDomList@@QBEHABVMXnDomListItem@@@Z @ 33 NONAME ; int CXnDomList::ItemIndex(class MXnDomListItem const &) const + ?FloatValueL@CXnDomPropertyValue@@QBENXZ @ 34 NONAME ; double CXnDomPropertyValue::FloatValueL(void) const + ?LayoutNode@CXnDomNode@@QAEPAVCXnNode@@XZ @ 35 NONAME ; class CXnNode * CXnDomNode::LayoutNode(void) + ?StringPoolIndexL@CXnDomPropertyValue@@QBEFXZ @ 36 NONAME ; short CXnDomPropertyValue::StringPoolIndexL(void) const + ?FindByName@CXnDomList@@QAEPAVMXnDomListItem@@ABVTDesC8@@@Z @ 37 NONAME ; class MXnDomListItem * CXnDomList::FindByName(class TDesC8 const &) + ?StringPool@CXnDomNode@@QBEAAVCXnDomStringPool@@XZ @ 38 NONAME ; class CXnDomStringPool & CXnDomNode::StringPool(void) const + ?First@CXnDomList@@QAEPAVMXnDomListItem@@XZ @ 39 NONAME ; class MXnDomListItem * CXnDomList::First(void) + ?ValueStringPoolIndex@CXnDomAttribute@@QBEFXZ @ 40 NONAME ; short CXnDomAttribute::ValueStringPoolIndex(void) const + ?NewL@CXnDomDocument@@SAPAV1@PBVHBufC8@@@Z @ 41 NONAME ; class CXnDomDocument * CXnDomDocument::NewL(class HBufC8 const *) + ?DeleteChild@CXnDomNode@@QAEXPAV1@@Z @ 42 NONAME ; void CXnDomNode::DeleteChild(class CXnDomNode *) + ?AddChildL@CXnDomNode@@QAEXPAV1@@Z @ 43 NONAME ; void CXnDomNode::AddChildL(class CXnDomNode *) + ?NewL@CXnDomProperty@@SAPAV1@FAAVCXnDomStringPool@@@Z @ 44 NONAME ; class CXnDomProperty * CXnDomProperty::NewL(short, class CXnDomStringPool &) + ?NewL@CXnDomAttribute@@SAPAV1@ABVTDesC8@@AAVCXnDomStringPool@@@Z @ 45 NONAME ; class CXnDomAttribute * CXnDomAttribute::NewL(class TDesC8 const &, class CXnDomStringPool &) + ?ChildNodes@CXnDomNode@@QAEAAVCXnDomList@@XZ @ 46 NONAME ; class CXnDomList & CXnDomNode::ChildNodes(void) + ?NodeId@CXnDomNode@@QBEHXZ @ 47 NONAME ; int CXnDomNode::NodeId(void) const + ?IsNoneIdent@CXnDomPropertyValue@@QAEHXZ @ 48 NONAME ; int CXnDomPropertyValue::IsNoneIdent(void) + ?ItemIndex@CXnDomNode@@QBEHABVMXnDomListItem@@@Z @ 49 NONAME ; int CXnDomNode::ItemIndex(class MXnDomListItem const &) const + ?Item@CXnDomList@@QBEPAVMXnDomListItem@@H@Z @ 50 NONAME ; class MXnDomListItem * CXnDomList::Item(int) const + ?ExternalizeL@CXnDomDocument@@QBEXAAVRWriteStream@@@Z @ 51 NONAME ; void CXnDomDocument::ExternalizeL(class RWriteStream &) const + ?StringPool@CXnDomProperty@@QBEAAVCXnDomStringPool@@XZ @ 52 NONAME ; class CXnDomStringPool & CXnDomProperty::StringPool(void) const + ?SetNamespaceL@CXnDomNode@@QAEXABVTDesC8@@@Z @ 53 NONAME ; void CXnDomNode::SetNamespaceL(class TDesC8 const &) + ?CloneL@CXnDomPropertyValue@@QAEPAV1@XZ @ 54 NONAME ; class CXnDomPropertyValue * CXnDomPropertyValue::CloneL(void) + ?PCData@CXnDomNode@@QAEABVTDesC8@@XZ @ 55 NONAME ; class TDesC8 const & CXnDomNode::PCData(void) + ?ContentType@CXnDomNode@@QAEABW4TContentType@@XZ @ 56 NONAME ; enum TContentType const & CXnDomNode::ContentType(void) + ?DeleteItem@CXnDomList@@QAEXPAVMXnDomListItem@@@Z @ 57 NONAME ; void CXnDomList::DeleteItem(class MXnDomListItem *) + ?StringPool@CXnDomList@@QBEAAVCXnDomStringPool@@XZ @ 58 NONAME ; class CXnDomStringPool & CXnDomList::StringPool(void) const + ?Reset@CXnDomList@@QAEXXZ @ 59 NONAME ; void CXnDomList::Reset(void) + ?PropertyList@CXnDomNode@@QAEAAVCXnDomList@@XZ @ 60 NONAME ; class CXnDomList & CXnDomNode::PropertyList(void) + ?CloneL@CXnDomAttribute@@QAEPAV1@XZ @ 61 NONAME ; class CXnDomAttribute * CXnDomAttribute::CloneL(void) + ?RootNode@CXnDomDocument@@QBEPAVCXnDomNode@@XZ @ 62 NONAME ; class CXnDomNode * CXnDomDocument::RootNode(void) const + ??1CXnDomPropertyValue@@UAE@XZ @ 63 NONAME ; CXnDomPropertyValue::~CXnDomPropertyValue(void) + ?SetLayoutNode@CXnDomNode@@QAEXPAVCXnNode@@@Z @ 64 NONAME ; void CXnDomNode::SetLayoutNode(class CXnNode *) + ?PropertyValueList@CXnDomProperty@@QAEAAVCXnDomList@@XZ @ 65 NONAME ; class CXnDomList & CXnDomProperty::PropertyValueList(void) + ??1CXnDomDocument@@UAE@XZ @ 66 NONAME ; CXnDomDocument::~CXnDomDocument(void) + ?DeleteItem@CXnDomList@@QAEXH@Z @ 67 NONAME ; void CXnDomList::DeleteItem(int) + ?NewL@CXnDomDepthIterator@@SAPAV1@AAVCXnDomNode@@@Z @ 68 NONAME ; class CXnDomDepthIterator * CXnDomDepthIterator::NewL(class CXnDomNode &) + ?CloneWithoutKidsL@CXnDomNode@@QAEPAV1@AAVCXnDomStringPool@@@Z @ 69 NONAME ; class CXnDomNode * CXnDomNode::CloneWithoutKidsL(class CXnDomStringPool &) + ?RemoveItem@CXnDomList@@QAEXH@Z @ 70 NONAME ; void CXnDomList::RemoveItem(int) + ?CloneL@CXnDomDocument@@QAEPAV1@XZ @ 71 NONAME ; class CXnDomDocument * CXnDomDocument::CloneL(void) + ?NameStringPoolIndex@CXnDomAttribute@@QBEFXZ @ 72 NONAME ; short CXnDomAttribute::NameStringPoolIndex(void) const + ?PrimitiveValueType@CXnDomPropertyValue@@QBE?AW4TPrimitiveValueType@1@XZ @ 73 NONAME ; enum CXnDomPropertyValue::TPrimitiveValueType CXnDomPropertyValue::PrimitiveValueType(void) const + ?SetInherited@CXnDomProperty@@QAEXH@Z @ 74 NONAME ; void CXnDomProperty::SetInherited(int) + ?SetRgbColorL@CXnDomPropertyValue@@QAEXABVTRgb@@@Z @ 75 NONAME ; void CXnDomPropertyValue::SetRgbColorL(class TRgb const &) + ?AttributeValue@CXnDomNode@@QBEABVTDesC8@@ABV2@@Z @ 76 NONAME ; class TDesC8 const & CXnDomNode::AttributeValue(class TDesC8 const &) const + ?SetRootNode@CXnDomDocument@@QAEXPAVCXnDomNode@@@Z @ 77 NONAME ; void CXnDomDocument::SetRootNode(class CXnDomNode *) + ?DeleteAttributeList@CXnDomNode@@QAEXXZ @ 78 NONAME ; void CXnDomNode::DeleteAttributeList(void) + ?Inherited@CXnDomProperty@@QAEHXZ @ 79 NONAME ; int CXnDomProperty::Inherited(void) + ?NewL@CXnDomDocument@@SAPAV1@XZ @ 80 NONAME ; class CXnDomDocument * CXnDomDocument::NewL(void) + ?SetValueL@CXnDomAttribute@@QAEXABVTDesC8@@@Z @ 81 NONAME ; void CXnDomAttribute::SetValueL(class TDesC8 const &) + ?AddItemL@CXnDomList@@QAEXPAVMXnDomListItem@@H@Z @ 82 NONAME ; void CXnDomList::AddItemL(class MXnDomListItem *, int) + ?Namespace@CXnDomNode@@QAEABVTDesC8@@XZ @ 83 NONAME ; class TDesC8 const & CXnDomNode::Namespace(void) + ?SetNodeId@CXnDomNode@@QAEXH@Z @ 84 NONAME ; void CXnDomNode::SetNodeId(int) + ?PseudoClass@CXnDomProperty@@QBE?AW4TPseudoClass@1@XZ @ 85 NONAME ; enum CXnDomProperty::TPseudoClass CXnDomProperty::PseudoClass(void) const + ?CloneL@CXnDomNode@@QAEPAV1@AAVCXnDomStringPool@@ABVTDesC8@@@Z @ 86 NONAME ; class CXnDomNode * CXnDomNode::CloneL(class CXnDomStringPool &, class TDesC8 const &) + ?SetStringValueL@CXnDomPropertyValue@@QAEXW4TPrimitiveValueType@1@ABVTDesC8@@@Z @ 87 NONAME ; void CXnDomPropertyValue::SetStringValueL(enum CXnDomPropertyValue::TPrimitiveValueType, class TDesC8 const &) + ?SetFloatValueL@CXnDomPropertyValue@@QAEXW4TPrimitiveValueType@1@N@Z @ 88 NONAME ; void CXnDomPropertyValue::SetFloatValueL(enum CXnDomPropertyValue::TPrimitiveValueType, double) + ?Name@CXnDomNode@@UAEABVTDesC8@@XZ @ 89 NONAME ; class TDesC8 const & CXnDomNode::Name(void) + ?RgbColorValueL@CXnDomPropertyValue@@QBEABVTRgb@@XZ @ 90 NONAME ; class TRgb const & CXnDomPropertyValue::RgbColorValueL(void) const + ?First@CXnDomDepthIterator@@UAEPAVCXnDomNode@@XZ @ 91 NONAME ; class CXnDomNode * CXnDomDepthIterator::First(void) + ?Name@CXnDomProperty@@UAEABVTDesC8@@XZ @ 92 NONAME ; class TDesC8 const & CXnDomProperty::Name(void) + ?NextL@CXnDomDepthIterator@@UAEPAVCXnDomNode@@XZ @ 93 NONAME ; class CXnDomNode * CXnDomDepthIterator::NextL(void) + ?NewL@CXnDomPropertyValue@@SAPAV1@AAVCXnDomStringPool@@@Z @ 94 NONAME ; class CXnDomPropertyValue * CXnDomPropertyValue::NewL(class CXnDomStringPool &) + ?StringPoolIndex@CXnDomProperty@@QBEFXZ @ 95 NONAME ; short CXnDomProperty::StringPoolIndex(void) const + ?CreateElementNSL@CXnDomDocument@@QAEPAVCXnDomNode@@ABVTDesC8@@0@Z @ 96 NONAME ; class CXnDomNode * CXnDomDocument::CreateElementNSL(class TDesC8 const &, class TDesC8 const &) + ?CloneL@CXnDomNode@@QAEPAV1@AAVCXnDomStringPool@@@Z @ 97 NONAME ; class CXnDomNode * CXnDomNode::CloneL(class CXnDomStringPool &) + ?SetStringPoolIndexL@CXnDomPropertyValue@@QAEXW4TPrimitiveValueType@1@F@Z @ 98 NONAME ; void CXnDomPropertyValue::SetStringPoolIndexL(enum CXnDomPropertyValue::TPrimitiveValueType, short) + ?SetParent@CXnDomNode@@QAEXPAV1@@Z @ 99 NONAME ; void CXnDomNode::SetParent(class CXnDomNode *) + ?DomNodeCount@CXnDomDocument@@QBEHXZ @ 100 NONAME ; int CXnDomDocument::DomNodeCount(void) const + ?CloneL@CXnDomProperty@@QAEPAV1@AAVCXnDomStringPool@@@Z @ 101 NONAME ; class CXnDomProperty * CXnDomProperty::CloneL(class CXnDomStringPool &) + ?Size@CXnDomDocument@@QBEHXZ @ 102 NONAME ; int CXnDomDocument::Size(void) const + ?NewL@CXnDomProperty@@SAPAV1@ABVTDesC8@@AAVCXnDomStringPool@@@Z @ 103 NONAME ; class CXnDomProperty * CXnDomProperty::NewL(class TDesC8 const &, class CXnDomStringPool &) + ??1CXnDomProperty@@UAE@XZ @ 104 NONAME ; CXnDomProperty::~CXnDomProperty(void) + ?LastNode@CXnDomDocument@@QBEPAVCXnDomNode@@XZ @ 105 NONAME ; class CXnDomNode * CXnDomDocument::LastNode(void) const + ?SetOwnershipL@CXnDomNode@@QAEXABVTDesC8@@@Z @ 106 NONAME ; void CXnDomNode::SetOwnershipL(class TDesC8 const &) + ?ReadL@CXnDomDocument@@QAEPAVCXnDomNode@@AAVRReadStream@@@Z @ 107 NONAME ; class CXnDomNode * CXnDomDocument::ReadL(class RReadStream &) + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/dom/eabi/xn3domdocumentu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/dom/eabi/xn3domdocumentu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,148 @@ +EXPORTS + _ZN10CXnDomList10DeleteItemEP14MXnDomListItem @ 1 NONAME + _ZN10CXnDomList10DeleteItemEi @ 2 NONAME + _ZN10CXnDomList10FindByNameERK6TDesC8 @ 3 NONAME + _ZN10CXnDomList10RemoveItemEP14MXnDomListItem @ 4 NONAME + _ZN10CXnDomList10RemoveItemEi @ 5 NONAME + _ZN10CXnDomList4LastEv @ 6 NONAME + _ZN10CXnDomList5FirstEv @ 7 NONAME + _ZN10CXnDomList5ResetEv @ 8 NONAME + _ZN10CXnDomList8AddItemLEP14MXnDomListItem @ 9 NONAME + _ZN10CXnDomList8AddItemLEP14MXnDomListItemi @ 10 NONAME + _ZN10CXnDomNode10ChildNodesEv @ 11 NONAME + _ZN10CXnDomNode10LayoutNodeEv @ 12 NONAME + _ZN10CXnDomNode10SetPCDataLERK6TDesC8 @ 13 NONAME + _ZN10CXnDomNode10SetRefNodeEi @ 14 NONAME + _ZN10CXnDomNode11ContentTypeEv @ 15 NONAME + _ZN10CXnDomNode11DeleteChildEPS_ @ 16 NONAME + _ZN10CXnDomNode12PropertyListEv @ 17 NONAME + _ZN10CXnDomNode13AppendPCDataLERK6TDesC8 @ 18 NONAME + _ZN10CXnDomNode13ReplaceChildLEPS_S0_ @ 19 NONAME + _ZN10CXnDomNode13SetLayoutNodeEP7CXnNode @ 20 NONAME + _ZN10CXnDomNode13SetNamespaceLERK6TDesC8 @ 21 NONAME + _ZN10CXnDomNode14CreateRefNodeLEv @ 22 NONAME + _ZN10CXnDomNode14SetContentTypeERK12TContentType @ 23 NONAME + _ZN10CXnDomNode17CloneWithoutKidsLER16CXnDomStringPool @ 24 NONAME + _ZN10CXnDomNode19DeleteAttributeListEv @ 25 NONAME + _ZN10CXnDomNode4NameEv @ 26 NONAME + _ZN10CXnDomNode6CloneLER16CXnDomStringPool @ 27 NONAME + _ZN10CXnDomNode6CloneLER16CXnDomStringPoolRK6TDesC8 @ 28 NONAME + _ZN10CXnDomNode6PCDataEv @ 29 NONAME + _ZN10CXnDomNode9AddChildLEPS_ @ 30 NONAME + _ZN10CXnDomNode9AddChildLEPS_i @ 31 NONAME + _ZN10CXnDomNode9NamespaceEv @ 32 NONAME + _ZN10CXnDomNode9SetNodeIdEi @ 33 NONAME + _ZN10CXnDomNode9SetParentEPS_ @ 34 NONAME + _ZN14CXnDomDocument11SetRootNodeEP10CXnDomNode @ 35 NONAME + _ZN14CXnDomDocument12InternalizeLER11RReadStream @ 36 NONAME + _ZN14CXnDomDocument16CreateElementNSLERK6TDesC8S2_ @ 37 NONAME + _ZN14CXnDomDocument4NewLEPK6HBufC8 @ 38 NONAME + _ZN14CXnDomDocument4NewLER11RReadStream @ 39 NONAME + _ZN14CXnDomDocument4NewLEv @ 40 NONAME + _ZN14CXnDomDocument6CloneLEv @ 41 NONAME + _ZN14CXnDomDocument9MarshallLEv @ 42 NONAME + _ZN14CXnDomDocumentD0Ev @ 43 NONAME + _ZN14CXnDomDocumentD1Ev @ 44 NONAME + _ZN14CXnDomDocumentD2Ev @ 45 NONAME + _ZN14CXnDomProperty10IsValueSetEv @ 46 NONAME + _ZN14CXnDomProperty12SetInheritedEi @ 47 NONAME + _ZN14CXnDomProperty14SetPseudoClassENS_12TPseudoClassE @ 48 NONAME + _ZN14CXnDomProperty17PropertyValueListEv @ 49 NONAME + _ZN14CXnDomProperty4NameEv @ 50 NONAME + _ZN14CXnDomProperty4NewLERK6TDesC8R16CXnDomStringPool @ 51 NONAME + _ZN14CXnDomProperty4NewLEsR16CXnDomStringPool @ 52 NONAME + _ZN14CXnDomProperty6CloneLER16CXnDomStringPool @ 53 NONAME + _ZN14CXnDomProperty6CloneLEv @ 54 NONAME + _ZN14CXnDomProperty9InheritedEv @ 55 NONAME + _ZN14CXnDomPropertyD0Ev @ 56 NONAME + _ZN14CXnDomPropertyD1Ev @ 57 NONAME + _ZN14CXnDomPropertyD2Ev @ 58 NONAME + _ZN15CXnDomAttribute4NameEv @ 59 NONAME + _ZN15CXnDomAttribute4NewLERK6TDesC8R16CXnDomStringPool @ 60 NONAME + _ZN15CXnDomAttribute5ValueEv @ 61 NONAME + _ZN15CXnDomAttribute6CloneLEv @ 62 NONAME + _ZN15CXnDomAttribute9SetValueLERK6TDesC8 @ 63 NONAME + _ZN15CXnDomAttributeD0Ev @ 64 NONAME + _ZN15CXnDomAttributeD1Ev @ 65 NONAME + _ZN15CXnDomAttributeD2Ev @ 66 NONAME + _ZN16CXnDomStringPool10AddStringLERK6TDesC8 @ 67 NONAME + _ZN19CXnDomDepthIterator4NewLER10CXnDomNode @ 68 NONAME + _ZN19CXnDomDepthIterator5FirstEv @ 69 NONAME + _ZN19CXnDomDepthIterator5NextLEv @ 70 NONAME + _ZN19CXnDomDepthIteratorD0Ev @ 71 NONAME + _ZN19CXnDomDepthIteratorD1Ev @ 72 NONAME + _ZN19CXnDomDepthIteratorD2Ev @ 73 NONAME + _ZN19CXnDomPropertyValue11IsAutoIdentEv @ 74 NONAME + _ZN19CXnDomPropertyValue11IsNoneIdentEv @ 75 NONAME + _ZN19CXnDomPropertyValue11ReleaseDataEv @ 76 NONAME + _ZN19CXnDomPropertyValue11StringValueEv @ 77 NONAME + _ZN19CXnDomPropertyValue12SetRgbColorLERK4TRgb @ 78 NONAME + _ZN19CXnDomPropertyValue12StringValueLEv @ 79 NONAME + _ZN19CXnDomPropertyValue14IsInheritIdentEv @ 80 NONAME + _ZN19CXnDomPropertyValue14SetFloatValueLENS_19TPrimitiveValueTypeEd @ 81 NONAME + _ZN19CXnDomPropertyValue15SetStringValueLENS_19TPrimitiveValueTypeERK6TDesC8 @ 82 NONAME + _ZN19CXnDomPropertyValue19SetStringPoolIndexLENS_19TPrimitiveValueTypeEs @ 83 NONAME + _ZN19CXnDomPropertyValue4NewLER16CXnDomStringPool @ 84 NONAME + _ZN19CXnDomPropertyValue6CloneLEv @ 85 NONAME + _ZN19CXnDomPropertyValueD0Ev @ 86 NONAME + _ZN19CXnDomPropertyValueD1Ev @ 87 NONAME + _ZN19CXnDomPropertyValueD2Ev @ 88 NONAME + _ZNK10CXnDomList10StringPoolEv @ 89 NONAME + _ZNK10CXnDomList4ItemEi @ 90 NONAME + _ZNK10CXnDomList6LengthEv @ 91 NONAME + _ZNK10CXnDomList9ItemIndexERK14MXnDomListItem @ 92 NONAME + _ZNK10CXnDomNode10StringPoolEv @ 93 NONAME + _ZNK10CXnDomNode13AttributeListEv @ 94 NONAME + _ZNK10CXnDomNode14AttributeValueERK6TDesC8 @ 95 NONAME + _ZNK10CXnDomNode15DescendantCountEv @ 96 NONAME + _ZNK10CXnDomNode6NodeIdEv @ 97 NONAME + _ZNK10CXnDomNode6ParentEv @ 98 NONAME + _ZNK10CXnDomNode9IsRefNodeEv @ 99 NONAME + _ZNK10CXnDomNode9ItemIndexERK14MXnDomListItem @ 100 NONAME + _ZNK14CXnDomDocument10StringPoolEv @ 101 NONAME + _ZNK14CXnDomDocument12DomNodeCountEv @ 102 NONAME + _ZNK14CXnDomDocument12ExternalizeLER12RWriteStream @ 103 NONAME + _ZNK14CXnDomDocument4SizeEv @ 104 NONAME + _ZNK14CXnDomDocument8LastNodeEv @ 105 NONAME + _ZNK14CXnDomDocument8RootNodeEv @ 106 NONAME + _ZNK14CXnDomProperty10StringPoolEv @ 107 NONAME + _ZNK14CXnDomProperty11PseudoClassEv @ 108 NONAME + _ZNK14CXnDomProperty15StringPoolIndexEv @ 109 NONAME + _ZNK15CXnDomAttribute19NameStringPoolIndexEv @ 110 NONAME + _ZNK15CXnDomAttribute20ValueStringPoolIndexEv @ 111 NONAME + _ZNK19CXnDomPropertyValue11FloatValueLEv @ 112 NONAME + _ZNK19CXnDomPropertyValue14RgbColorValueLEv @ 113 NONAME + _ZNK19CXnDomPropertyValue16StringPoolIndexLEv @ 114 NONAME + _ZNK19CXnDomPropertyValue18PrimitiveValueTypeEv @ 115 NONAME + _ZTI10CXnDomList @ 116 NONAME ; ## + _ZTI10CXnDomNode @ 117 NONAME ; ## + _ZTI14CXnDomDocument @ 118 NONAME ; ## + _ZTI14CXnDomProperty @ 119 NONAME ; ## + _ZTI15CXnDomAttribute @ 120 NONAME ; ## + _ZTI16CXnDomStringPool @ 121 NONAME ; ## + _ZTI19CXnDomDepthIterator @ 122 NONAME ; ## + _ZTI19CXnDomPropertyValue @ 123 NONAME ; ## + _ZTV10CXnDomList @ 124 NONAME ; ## + _ZTV10CXnDomNode @ 125 NONAME ; ## + _ZTV14CXnDomDocument @ 126 NONAME ; ## + _ZTV14CXnDomProperty @ 127 NONAME ; ## + _ZTV15CXnDomAttribute @ 128 NONAME ; ## + _ZTV16CXnDomStringPool @ 129 NONAME ; ## + _ZTV19CXnDomDepthIterator @ 130 NONAME ; ## + _ZTV19CXnDomPropertyValue @ 131 NONAME ; ## + _ZThn4_N10CXnDomNode4NameEv @ 132 NONAME ; ## + _ZThn4_N14CXnDomProperty4NameEv @ 133 NONAME ; ## + _ZThn4_N14CXnDomPropertyD0Ev @ 134 NONAME ; ## + _ZThn4_N14CXnDomPropertyD1Ev @ 135 NONAME ; ## + _ZThn4_N15CXnDomAttribute4NameEv @ 136 NONAME ; ## + _ZThn4_N15CXnDomAttributeD0Ev @ 137 NONAME ; ## + _ZThn4_N15CXnDomAttributeD1Ev @ 138 NONAME ; ## + _ZThn4_N19CXnDomDepthIterator5FirstEv @ 139 NONAME ; ## + _ZThn4_N19CXnDomDepthIterator5NextLEv @ 140 NONAME ; ## + _ZThn4_N19CXnDomDepthIteratorD0Ev @ 141 NONAME ; ## + _ZThn4_N19CXnDomDepthIteratorD1Ev @ 142 NONAME ; ## + _ZThn4_N19CXnDomPropertyValueD0Ev @ 143 NONAME ; ## + _ZThn4_N19CXnDomPropertyValueD1Ev @ 144 NONAME ; ## + _ZN10CXnDomNode13SetOwnershipLERK6TDesC8 @ 145 NONAME + _ZN14CXnDomDocument5ReadLER11RReadStream @ 146 NONAME + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/dom/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/dom/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,34 @@ +/* +* 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: bld.inf for XnDomDocument.dll +* +*/ + + +#include + +PRJ_PLATFORMS +WINSCW ARMV5 + +PRJ_EXPORTS + +PRJ_MMPFILES +xndomdocument.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/dom/group/xndomdocument.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/dom/group/xndomdocument.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,58 @@ +/* +* 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: Project .mmp file +* +*/ + + +#include + +TARGET xn3domdocument.dll +CAPABILITY CAP_GENERAL_DLL +TARGETTYPE dll +UID 0x1000008d 0x10207392 +VENDORID VID_DEFAULT + +SOURCEPATH ../src + +SOURCE xndomdocument.cpp +SOURCE xndomnode.cpp +SOURCE xndomattribute.cpp +SOURCE xndomproperty.cpp +SOURCE xndompropertyvalue.cpp +SOURCE xndomlist.cpp +SOURCE xndomdepthiterator.cpp +SOURCE xndomstringpool.cpp + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY gdi.lib + + + +LANG SC + +START WINS + +END + +START MARM + +END diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/dom/src/xndomattribute.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/dom/src/xndomattribute.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,207 @@ +/* +* 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: Represent single xmluiml attribute +* +*/ + + + +// INCLUDE FILES +#include "xndomattribute.h" +#include "xndomstringpool.h" + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CXnDomAttribute::CXnDomAttribute +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnDomAttribute::CXnDomAttribute( CXnDomStringPool& aStringPool ): + iStringPool( aStringPool ), + iNameRef( KErrNotFound ), + iValueRef( KErrNotFound ) + { + } + + +// ----------------------------------------------------------------------------- +// CXnDomAttribute::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnDomAttribute::ConstructL( const TDesC8& aName ) + { + iNameRef = iStringPool.AddStringL( aName ); + } +// ----------------------------------------------------------------------------- +// CXnDomAttribute::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomAttribute* CXnDomAttribute::NewL( + const TDesC8& aName, + CXnDomStringPool& aStringPool ) + { + CXnDomAttribute* self = new( ELeave ) CXnDomAttribute( aStringPool ); + + CleanupStack::PushL( self ); + self->ConstructL( aName ); + CleanupStack::Pop( self ); + + return self; + } + + +// ----------------------------------------------------------------------------- +// CXnDomAttribute::NewL +// Two-phased stream constructor. +// ----------------------------------------------------------------------------- +// +CXnDomAttribute* CXnDomAttribute::NewL( + RReadStream& aStream, + CXnDomStringPool& aStringPool ) + { + CXnDomAttribute* self = new( ELeave ) CXnDomAttribute( aStringPool ); + CleanupStack::PushL( self ); + aStream >> *self; + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnDomAttribute::~CXnDomAttribute +// Destructor +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomAttribute::~CXnDomAttribute() + { + } + +// ----------------------------------------------------------------------------- +// CXnDomAttribute::CloneL +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomAttribute* CXnDomAttribute::CloneL() + { + CXnDomAttribute* clone = new (ELeave)CXnDomAttribute( iStringPool ); + clone->iNameRef = iNameRef; + clone->iValueRef = iValueRef; + return clone; + } + +// ----------------------------------------------------------------------------- +// CXnDomAttribute::CloneL +// ----------------------------------------------------------------------------- +// +CXnDomAttribute* CXnDomAttribute::CloneL( CXnDomStringPool& aStringPool ) + { + const TDesC8& name = iStringPool.String( iNameRef ); + + CXnDomAttribute* clone = CXnDomAttribute::NewL( name, aStringPool ); + CleanupStack::PushL( clone ); + if ( iValueRef > KErrNotFound ) + { + const TDesC8& value = iStringPool.String( iValueRef ); + clone->SetValueL( value ); + } + CleanupStack::Pop( clone ); + return clone; + + } + +// ----------------------------------------------------------------------------- +// CXnDomAttribute::Name +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CXnDomAttribute::Name() + { + return iStringPool.String( iNameRef ); + } + +// ----------------------------------------------------------------------------- +// CXnDomProperty::NameStringPoolIndex +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt16 CXnDomAttribute::NameStringPoolIndex()const + { + return iNameRef; + } +// ----------------------------------------------------------------------------- +// CXnDomAttribute::Value +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CXnDomAttribute::Value() + { + if ( iValueRef > KErrNotFound ) + { + return iStringPool.String( iValueRef ); + } + return KNullDesC8; + } + +// ----------------------------------------------------------------------------- +// CXnDomProperty::ValueStringPoolIndex +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt16 CXnDomAttribute::ValueStringPoolIndex()const + { + return iValueRef; + } +// ----------------------------------------------------------------------------- +// CXnDomAttribute::SetValueL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomAttribute::SetValueL( const TDesC8& aValue ) + { + iValueRef = iStringPool.AddStringL( aValue ); + } + + +// ----------------------------------------------------------------------------- +// CXnDomAttribute::Size +// ----------------------------------------------------------------------------- +// +TInt CXnDomAttribute::Size() const + { + TInt size( 0 ); + + size += sizeof(TInt16); // iNameRef + + size += sizeof(TInt16); // iValueRef + + return size; + } + +// ----------------------------------------------------------------------------- +// CXnDomAttribute::ExternalizeL +// ----------------------------------------------------------------------------- +// +void CXnDomAttribute::ExternalizeL( RWriteStream& aStream ) const + { + aStream.WriteInt16L( iNameRef ); + aStream.WriteInt16L( iValueRef ); + } + +// ----------------------------------------------------------------------------- +// CXnDomAttribute::InternalizeL +// ----------------------------------------------------------------------------- +// +void CXnDomAttribute::InternalizeL( RReadStream& aStream ) + { + iNameRef = aStream.ReadInt16L() + iStringPool.Offset(); + iValueRef = aStream.ReadInt16L() + iStringPool.Offset(); + } +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/dom/src/xndomdepthiterator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/dom/src/xndomdepthiterator.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,149 @@ +/* +* 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: Depth iterator walks the dom tree using depth first principle. +* +*/ + + + +// INCLUDE FILES +#include "xndomdepthiterator.h" +#include "xndomlist.h" +#include "xndomnode.h" + + +// Queue granularity value +/** +*/ +const TInt KMemoryAloc = 64; + +// ============================ LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnDomDepthIterator::CXnDomDepthIterator +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnDomDepthIterator::CXnDomDepthIterator( CXnDomNode* aRootNode ): + iStack( KMemoryAloc ), iStart( aRootNode ), iCurrent( aRootNode ) + { + } + +// ----------------------------------------------------------------------------- +// CXnDomDepthIterator::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnDomDepthIterator::ConstructL() + { + iStack.AppendL( iStart ); + } + +// ----------------------------------------------------------------------------- +// CXnDomDepthIterator::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomDepthIterator* CXnDomDepthIterator::NewL( CXnDomNode& aRootNode ) + { + CXnDomDepthIterator* self = new( ELeave ) CXnDomDepthIterator( &aRootNode ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnDomDepthIterator::~CXnDomDepthIterator() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomDepthIterator::~CXnDomDepthIterator() + { + iStack.Close(); + } + +// ----------------------------------------------------------------------------- +// CXnDomDepthIterator::First +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomNode* CXnDomDepthIterator::First() + { + return iStart; + } + +// ----------------------------------------------------------------------------- +// CXnDomDepthIterator::Next +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomNode* CXnDomDepthIterator::NextL() + { + if( iStack.Count() ) + { + // Pop + TInt topIndex( iStack.Count() - 1 ); + iCurrent = iStack[topIndex]; + iStack.Remove( topIndex ); + + CXnDomList& currentChildNodes( iCurrent->ChildNodes() ); + TInt currentChildCount( currentChildNodes.Length() ); + + // Push left most child to top + for( TInt i = currentChildCount - 1; i >= 0; --i ) + { + iStack.AppendL( static_cast< CXnDomNode* >( + currentChildNodes.Item( i ) ) ); + } + } + else + { + iCurrent = NULL; + iStack.Reset(); + iStack.AppendL( iStart ); + } + return iCurrent; + } + +/* +// ----------------------------------------------------------------------------- +// CXnDomDepthIterator::PushL +// ----------------------------------------------------------------------------- +// +void CXnDomDepthIterator::PushL( CXnDomNode& aNode ) + { + iDepthLevel.AppendL( &aNode ); + } +*/ +// ----------------------------------------------------------------------------- +// CXnDomDepthIterator::Pop +// ----------------------------------------------------------------------------- +// +/* +CXnDomNode* CXnDomDepthIterator::Pop() + { + CXnDomNode* pop = NULL; + TInt count( iDepthLevel.Count() ); + if ( count ) + { + pop = iDepthLevel[ count-1 ]; + iDepthLevel.Remove( count-1 ); + } + return pop; + } +*/ + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/dom/src/xndomdocument.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/dom/src/xndomdocument.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,302 @@ +/* +* 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: Represents the entire xmluiml specific xml and css data. +* +*/ + + + +// INCLUDE FILES +#include "xndomdocument.h" +#include "xndomnode.h" +#include "xndomlist.h" +#include "xndomstringpool.h" +#include + + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CXnDomDocument::CloneL() +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomDocument* CXnDomDocument::CloneL() + { + CXnDomDocument* clone = new (ELeave) CXnDomDocument; + CleanupStack::PushL( clone ); + + clone->iDomStringPool = iDomStringPool->CloneL(); + if ( iRootNode ) + { + clone->iRootNode = iRootNode->CloneL( *clone->iDomStringPool ); + } + + CleanupStack::Pop( clone ); + return clone; + } + +// ----------------------------------------------------------------------------- +// CXnDomDocument::CreateElementNSL +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomNode* CXnDomDocument::CreateElementNSL( + const TDesC8& aName, + const TDesC8& aNamespace ) + { + return CXnDomNode::NewL( aName, aNamespace, *iDomStringPool ); + } +// ----------------------------------------------------------------------------- +// CXnDomDocument::CXnDomDocument +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnDomDocument::CXnDomDocument() + { + } + +// ----------------------------------------------------------------------------- +// CXnDomDocument::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnDomDocument::ConstructL() + { + iDomStringPool = CXnDomStringPool::NewL(); + } + +// ----------------------------------------------------------------------------- +// CXnDomDocument::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomDocument* CXnDomDocument::NewL() + { + CXnDomDocument* self = new( ELeave ) CXnDomDocument; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } +// ----------------------------------------------------------------------------- +// CXnDomDocument::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomDocument* CXnDomDocument::NewL( + RReadStream& aStream ) + { + CXnDomDocument* self = new( ELeave ) CXnDomDocument; + + CleanupStack::PushL( self ); + aStream >> *self; + CleanupStack::Pop(self); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnDomDocument::NewL +// Constructs CXnDomDocument from streamed HBufC8. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomDocument* CXnDomDocument::NewL( + const HBufC8* aBufStream ) + { + RDesReadStream readStream( *aBufStream ); + CleanupClosePushL( readStream ); + CXnDomDocument* self = CXnDomDocument::NewL( readStream ); + CleanupStack::PopAndDestroy( &readStream ); + return self; + } + +// Destructor +EXPORT_C CXnDomDocument::~CXnDomDocument() + { + if ( iRootNode ) + { + delete iRootNode; + } + + if ( iDomStringPool ) + { + delete iDomStringPool; + } + } + +// ----------------------------------------------------------------------------- +// CXnDomDocument::DomNodeCount +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CXnDomDocument::DomNodeCount() const + { + TInt count( 0 ); + if ( iRootNode ) + { + count = iRootNode->DescendantCount(); + } + return count; + } + +// ----------------------------------------------------------------------------- +// CXnDomDocument::ExternalizeL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomDocument::ExternalizeL( RWriteStream& aStream ) const + { + aStream << *iDomStringPool; + + if ( iRootNode ) + { + aStream.WriteInt8L( ETrue ); //Root node exist + aStream << *iRootNode; + } + else + { + aStream.WriteInt8L( EFalse ); + } + } + +// ----------------------------------------------------------------------------- +// CXnDomDocument::InternalizeL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomDocument::InternalizeL( RReadStream& aStream ) + { + if(iDomStringPool) + { + delete iDomStringPool; + iDomStringPool = NULL; + } + iDomStringPool = CXnDomStringPool::NewL( aStream ); + + if ( iRootNode ) + { + delete iRootNode; + iRootNode = NULL; + } + + TBool rootNodeExist( aStream.ReadInt8L() ); + if ( rootNodeExist ) + { + iRootNode = CXnDomNode::NewL( aStream, *iDomStringPool ); + } + } + +// ----------------------------------------------------------------------------- +// CXnDomDocument::SetRootNode +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomDocument::SetRootNode( CXnDomNode* aRootNode ) + { + iRootNode = aRootNode; + iRootNode->SetParent( NULL ); + } + +// ----------------------------------------------------------------------------- +// CXnDomDocument::RootNode +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomNode* CXnDomDocument::RootNode() const + { + return iRootNode; + } + +// ----------------------------------------------------------------------------- +// CXnDomDocument::LastNode +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomNode* CXnDomDocument::LastNode() const + { + CXnDomNode* last = NULL; + if ( iRootNode ) + { + last = iRootNode; + CXnDomNode* tmp = iRootNode; + while( tmp ) + { + last = tmp; + tmp = static_cast( last->ChildNodes().Last() ); + } + } + return last; + } + +// ----------------------------------------------------------------------------- +// CXnDomDocument::Size +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CXnDomDocument::Size() const + { + TInt size( 1 ); //Root node information takes one byte + size += iDomStringPool->Size(); + + if ( iRootNode ) + { + + size += iRootNode->Size(); + } + + return size; + } + +// ----------------------------------------------------------------------------- +// CXnDomDocument::MarshallL +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* CXnDomDocument::MarshallL() + { + TInt dataLength = Size(); + HBufC8* writeBuf = HBufC8::NewLC( dataLength ); + TPtr8 p( writeBuf->Des() ); + RDesWriteStream writeStream( p ); //stream over the buffer + CleanupClosePushL( writeStream ); + writeStream << *this; //Stream object + CleanupStack::PopAndDestroy( &writeStream ); + CleanupStack::Pop( writeBuf ); + return writeBuf; + } + +// ----------------------------------------------------------------------------- +// CXnDomDocument::StringPool +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomStringPool& CXnDomDocument::StringPool() const + { + return *iDomStringPool; + } + +// ----------------------------------------------------------------------------- +// CXnDomDocument::ReadL +// Read contents from a stream. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomNode* CXnDomDocument::ReadL( + RReadStream& aStream ) + { + CXnDomNode* rootNode = NULL; + + aStream >> *iDomStringPool; + + TBool rootNodeExist( aStream.ReadInt8L() ); + if ( rootNodeExist ) + { + rootNode = CXnDomNode::NewL( aStream, *iDomStringPool ); + } + + return rootNode; + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/dom/src/xndomlist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/dom/src/xndomlist.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,384 @@ +/* +* 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: List class to hold CXnDomList objects. +* +*/ + + + +// INCLUDE FILES +#include "xndomlist.h" +#include "xndomnode.h" +#include "xndomattribute.h" +#include "xndomproperty.h" +#include "xndompropertyvalue.h" +#include "xndomstringpool.h" + + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnDomList::CXnDomList +// C++ parameter constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnDomList::CXnDomList( + TListType aListType, + CXnDomStringPool& aStringPool, + TInt aGranularity ): + iListType( aListType ), + iList( aGranularity ), + iStringPool( aStringPool ) + { + } +// ----------------------------------------------------------------------------- +// CXnDomList::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnDomList::ConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// CXnDomList::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnDomList* CXnDomList::NewL( + TListType aListType, + CXnDomStringPool& aStringPool, + TInt aGranularity) + { + CXnDomList* self = + new( ELeave ) CXnDomList( aListType, aStringPool,aGranularity ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } +// ----------------------------------------------------------------------------- +// CXnDomList::NewL +// Two-phased stream constructor. +// ----------------------------------------------------------------------------- +// +CXnDomList* CXnDomList::NewL( + RReadStream& aStream, + CXnDomStringPool& aStringPool ) + { + CXnDomList* self = new( ELeave ) CXnDomList( ENodeList, aStringPool ); + + CleanupStack::PushL( self ); + + aStream >> *self; + CleanupStack::Pop( self ); + + return self; + } + +// Destructor +CXnDomList::~CXnDomList() + { + iList.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// CXnDomList::Reset +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomList::Reset() + { + iList.Reset(); + } + +// ----------------------------------------------------------------------------- +// CXnDomList::AddItemL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomList::AddItemL( MXnDomListItem* aItem ) + { + iList.AppendL( aItem ); + } + +// ----------------------------------------------------------------------------- +// CXnDomList::AddItemL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomList::AddItemL( MXnDomListItem* aItem, TInt aIndex ) + { + iList.InsertL( aItem, aIndex ); + } + +// ----------------------------------------------------------------------------- +// CXnDomList::RemoveItem +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomList::RemoveItem( TInt aIndex ) + { + iList.Remove( aIndex); + iList.Compress(); + } +// ----------------------------------------------------------------------------- +// CXnDomList::DeleteItem +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomList::DeleteItem( TInt aIndex ) + { + delete iList[ aIndex ]; + iList.Remove( aIndex); + iList.Compress(); + } + +// ----------------------------------------------------------------------------- +// CXnDomList::RemoveItem +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomList::RemoveItem( MXnDomListItem* aItem ) + { + MXnDomListItem* tmp = NULL; + TInt count( iList.Count() ); + TBool stop( EFalse ); + for ( TInt i=0; iName() ) == 0 ) + { + return tmp; + } + } + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnDomList::ItemIndex +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CXnDomList::ItemIndex( const MXnDomListItem& aItem ) const + { + + MXnDomListItem* tmp = NULL; + TInt count( iList.Count() ); + for ( TInt i=0; iSize(); + } + return size; + } +// ----------------------------------------------------------------------------- +// CXnDomList::ExternalizeL +// ----------------------------------------------------------------------------- +// +void CXnDomList::ExternalizeL( RWriteStream& aStream ) const + { + aStream.WriteInt8L( iListType ); + + + TInt count( iList.Count() ); + aStream.WriteInt32L( count ); + + + for ( TInt i=0; i( aStream.ReadInt8L() ); + + TInt count ( aStream.ReadInt32L() ); + for ( TInt i=0; iConstructL(aName, aNS); + CleanupStack::Pop(self); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::NewL +// Two-phased stream constructor. +// ----------------------------------------------------------------------------- +// +CXnDomNode* CXnDomNode::NewL(RReadStream& aStream, + CXnDomStringPool& aStringPool) + { + CXnDomNode* self = new (ELeave) CXnDomNode(aStringPool); + + CleanupStack::PushL(self); + + aStream >> *self; + CleanupStack::Pop(self); + + return self; + } + +// Destructor +CXnDomNode::~CXnDomNode() + { + delete iChildList; + delete iAttributeList; + delete iPropertyList; + + delete iPCData; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::CloneL +// Clones this node and it's child nodes. This is a recursive function. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomNode* CXnDomNode::CloneL(CXnDomStringPool& aStringPool) + { + const TDesC8& name = iStringPool.String(iNameRef); + const TDesC8& ns = iStringPool.String(iNSRef); + + CXnDomNode* clone = CXnDomNode::NewL(name, ns, aStringPool); + CleanupStack::PushL(clone); + if (iPCData) + { + clone->AppendPCDataL(*iPCData); + } + clone->iNodeId = iNodeId; + clone->iRefNode = iRefNode; + + TInt childCount(iChildList->Length()); + + for (TInt i = 0; i < childCount; i++) + { + CXnDomNode* childClone = + static_cast (iChildList->Item(i))->CloneL( + aStringPool); + CleanupStack::PushL(childClone); + childClone->iParentNode = clone; + clone->iChildList->AddItemL(childClone); + CleanupStack::Pop(childClone); + } + + TInt attrCount(iAttributeList->Length()); + for (TInt j = 0; j < attrCount; j++) + { + CXnDomAttribute + * attrClone = + static_cast (iAttributeList->Item(j))->CloneL( + aStringPool); + CleanupStack::PushL(attrClone); + clone->iAttributeList->AddItemL(attrClone); + CleanupStack::Pop(attrClone); + } + + TInt propertyCount(iPropertyList->Length()); + for (TInt k = 0; k < propertyCount; k++) + { + CXnDomProperty + * propClone = + static_cast (iPropertyList->Item(k))->CloneL( + aStringPool); + CleanupStack::PushL(propClone); + clone->iPropertyList->AddItemL(propClone); + CleanupStack::Pop(propClone); + } + CleanupStack::Pop(clone); + return clone; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::CloneWithoutKidsL +// Clones only this node. This is a recursive function. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomNode* CXnDomNode::CloneWithoutKidsL( + CXnDomStringPool& aStringPool) + { + const TDesC8& name = iStringPool.String(iNameRef); + const TDesC8& ns = iStringPool.String(iNSRef); + + CXnDomNode* clone = CXnDomNode::NewL(name, ns, aStringPool); + CleanupStack::PushL(clone); + if (iPCData) + { + clone->AppendPCDataL(*iPCData); + } + clone->iNodeId = iNodeId; + clone->iRefNode = iRefNode; + + TInt attrCount(iAttributeList->Length()); + for (TInt j = 0; j < attrCount; j++) + { + CXnDomAttribute + * attrClone = + static_cast (iAttributeList->Item(j))->CloneL( + aStringPool); + CleanupStack::PushL(attrClone); + clone->iAttributeList->AddItemL(attrClone); + CleanupStack::Pop(attrClone); + } + + TInt propertyCount(iPropertyList->Length()); + for (TInt k = 0; k < propertyCount; k++) + { + CXnDomProperty + * propClone = + static_cast (iPropertyList->Item(k))->CloneL( + aStringPool); + CleanupStack::PushL(propClone); + clone->iPropertyList->AddItemL(propClone); + CleanupStack::Pop(propClone); + } + CleanupStack::Pop(clone); + return clone; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::CreateRefNodeL +// Recursive function to create referer nodes. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomNode* CXnDomNode::CreateRefNodeL() + { + const TDesC8& name = iStringPool.String(iNameRef); + const TDesC8& ns = iStringPool.String(iNSRef); + + CXnDomNode* ref = CXnDomNode::NewL(name, ns, iStringPool); + CleanupStack::PushL(ref); + + ref->iRefNode = ETrue; + + TInt childCount(iChildList->Length()); + + for (TInt i = 0; i < childCount; i++) + { + CXnDomNode + * childRef = + static_cast (iChildList->Item(i))->CreateRefNodeL(); + CleanupStack::PushL(childRef); + childRef->iParentNode = ref; + ref->iChildList->AddItemL(childRef); + CleanupStack::Pop(childRef); + } + + CXnDomAttribute* attr = NULL; + if (!iRefNode) + { + attr = static_cast (iAttributeList->FindByName( + KIdAttr)); + } + else + { + attr = static_cast (iAttributeList->FindByName( + KRefAttr)); + } + + if (attr) + { + CXnDomAttribute* newAttr = CXnDomAttribute::NewL(KRefAttr, + iStringPool); + CleanupStack::PushL(newAttr); + newAttr->SetValueL(attr->Value()); + ref->iAttributeList->AddItemL(newAttr); + CleanupStack::Pop(newAttr); + } + else + { + //referred node don't have an id or ref, thats not ok. + User::Leave(KErrArgument); + } + + CleanupStack::Pop(ref); + return ref; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::Name +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CXnDomNode::Name() + { + return iStringPool.String(iNameRef); + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::Namespace +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CXnDomNode::Namespace() + { + return iStringPool.String(iNSRef); + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::AttributeList +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomList& CXnDomNode::AttributeList() const + { + return *iAttributeList; + } +// ----------------------------------------------------------------------------- +// CXnDomNode::PropertyList +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomList& CXnDomNode::PropertyList() + { + return *iPropertyList; + } +// ----------------------------------------------------------------------------- +// CXnDomNode::SetParent +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomNode::SetParent(CXnDomNode* aParent) + { + iParentNode = aParent; + } +// ----------------------------------------------------------------------------- +// CXnDomNode::Parent +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomNode* CXnDomNode::Parent() const + { + return iParentNode; + } +// ----------------------------------------------------------------------------- +// CXnDomNode::AddChildL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomNode::AddChildL(CXnDomNode* aNode) + { + aNode->SetParent(this); + iChildList->AddItemL(aNode); + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::AddChildL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomNode::AddChildL(CXnDomNode* aNode, TInt aIndex) + { + aNode->SetParent(this); + iChildList->AddItemL(aNode, aIndex); + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::DeleteChild +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomNode::DeleteChild(CXnDomNode* aNode) + { + iChildList->DeleteItem(aNode); + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::ReplaceChildL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomNode::ReplaceChildL(CXnDomNode* aNode, + CXnDomNode* aNewNode) + { + CXnDomNode* swapChild = NULL; + CXnDomList& childList = aNode->ChildNodes(); + TInt childCount(childList.Length()); + for (TInt i = 0; i < childCount; i++) + { + swapChild = static_cast (childList.Item(i)); + aNewNode->AddChildL(swapChild); //Let the new node adopt the child + childList.RemoveItem(swapChild); //Remove it from the orginal parent + } + iChildList->DeleteItem(aNode); // Delete the old child + + aNewNode->SetParent(this); //Set new child + iChildList->AddItemL(aNewNode); + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::ChildNodes +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomList& CXnDomNode::ChildNodes() + { + return *iChildList; + } +// ----------------------------------------------------------------------------- +// CXnDomNode::SetNodeId +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomNode::SetNodeId(const TInt aNodeId) + { + iNodeId = aNodeId; + } +// ----------------------------------------------------------------------------- +// CXnDomNode::NodeId +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CXnDomNode::NodeId() const + { + return iNodeId; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::ItemIndex +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CXnDomNode::ItemIndex(const MXnDomListItem& aItem) const + { + return iChildList->ItemIndex(aItem); + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::AppendPCDataL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomNode::AppendPCDataL(const TDesC8& aPCData) + { + if (iPCData) + { + iPCData = iPCData->ReAllocL(iPCData->Length() + aPCData.Length()); + iPCData->Des().Append(aPCData); + } + else + { + iPCData = aPCData.AllocL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::PCData +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CXnDomNode::PCData() + { + if (iPCData) + { + return *iPCData; + } + return KNullDesC8; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::SetPCDataL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomNode::SetPCDataL(const TDesC8& aPCData) + { + if (iPCData) + { + delete iPCData; + iPCData = NULL; + } + iPCData = aPCData.AllocL(); + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::ContentType +// ----------------------------------------------------------------------------- +// +EXPORT_C const TContentType& CXnDomNode::ContentType() + { + return iContentType; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::SetContentType +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomNode::SetContentType(const TContentType& aContentType) + { + iContentType = aContentType; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::StringPool +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomStringPool& CXnDomNode::StringPool() const + { + return iStringPool; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::SetRefNode +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomNode::SetRefNode(TBool aRefNode) + { + iRefNode = aRefNode; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::IsRefNode +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CXnDomNode::IsRefNode() const + { + return iRefNode; + } +// ----------------------------------------------------------------------------- +// CXnDomNode::Size +// ----------------------------------------------------------------------------- +// +TInt CXnDomNode::Size() const + { + TInt size(0); + + size += sizeof(TInt16); //iNameRef + size += sizeof(TInt16); //iNSRef + size += sizeof(TBool); //iRefNode + if (iPCData) + { + size += sizeof(TInt8); + size += sizeof(TInt16); + size += iPCData->Size(); + size++; + } + else + { + size += sizeof(TInt8); + } + + size += sizeof(TInt32); //For nodeId + size += iAttributeList->Size(); + size += iPropertyList->Size(); + + size += iChildList->Size(); + + return size; + } +// ----------------------------------------------------------------------------- +// CXnDomNode::ExternalizeL +// NOTE: This function is not implemented yet! +// ----------------------------------------------------------------------------- +// +void CXnDomNode::ExternalizeL(RWriteStream& aStream) const + { + + aStream.WriteInt16L(iNameRef); + aStream.WriteInt16L(iNSRef); + aStream.WriteInt8L(iRefNode); + + if (iPCData) + { + aStream.WriteInt8L(ETrue); + aStream.WriteInt16L(iPCData->Length()); + aStream << *iPCData; + } + else + { + aStream.WriteInt8L(EFalse); + } + + aStream.WriteInt32L(iNodeId); + aStream << *iChildList; + aStream << *iAttributeList; + aStream << *iPropertyList; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::InternalizeL +// ----------------------------------------------------------------------------- +// +void CXnDomNode::InternalizeL(RReadStream& aStream) + { + iNameRef = aStream.ReadInt16L() + iStringPool.Offset(); + iNSRef = aStream.ReadInt16L() + iStringPool.Offset(); + iRefNode = aStream.ReadInt8L(); + + TInt len(0); + TBool exist(aStream.ReadInt8L()); + if (exist) + { + len = aStream.ReadInt16L(); + delete iPCData; + iPCData = NULL; + iPCData = HBufC8::NewL(aStream, len); + } + + iNodeId = aStream.ReadInt32L(); + + iChildList = CXnDomList::NewL(aStream, iStringPool); + TInt count(iChildList->Length()); + for (TInt i = 0; i < count; i++) + { + CXnDomNode* node = static_cast (iChildList->Item(i)); + if (node) + { + node->SetParent(this); + } + else + { + User::Leave(KErrArgument); + } + } + + iAttributeList = CXnDomList::NewL(aStream, iStringPool); + + iPropertyList = CXnDomList::NewL(aStream, iStringPool); + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::ReadL +// ----------------------------------------------------------------------------- +// +void CXnDomNode::ReadL(RReadStream& aStream) + { + iNameRef = aStream.ReadInt16L(); + iNSRef = aStream.ReadInt16L(); + iRefNode = aStream.ReadInt8L(); + + TBool exist(aStream.ReadInt8L()); + if (exist) + { + TInt len(0); + len = aStream.ReadInt16L(); + delete iPCData; + iPCData = NULL; + iPCData = HBufC8::NewL(aStream, len); + } + + iNodeId = aStream.ReadInt32L(); + + iChildList = CXnDomList::NewL(aStream, iStringPool); + TInt count(iChildList->Length()); + for (TInt i = 0; i < count; i++) + { + CXnDomNode* node = static_cast (iChildList->Item(i)); + if (node) + { + node->SetParent(this); + } + else + { + User::Leave(KErrArgument); + } + } + + iAttributeList = CXnDomList::NewL(aStream, iStringPool); + + iPropertyList = CXnDomList::NewL(aStream, iStringPool); + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::DescendantCount +// Recursive counting function +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CXnDomNode::DescendantCount() const + { + TInt count(1); //Node itself + + TInt length(iChildList->Length()); + for (TInt i = 0; i < length; i++) + { + count + += static_cast (iChildList->Item(i))->DescendantCount(); + } + + return count; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::DeleteAttributeList +// Deletes the attribute list +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomNode::DeleteAttributeList() + { + delete iAttributeList; + iAttributeList = NULL; + + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::AttributeValue +// Returns value of "name" attribute +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CXnDomNode::AttributeValue(const TDesC8& aAttribute) const + { + CXnDomAttribute* attribute = + static_cast (iAttributeList->FindByName( + aAttribute)); + if (attribute) + { + return attribute->Value(); + } + else + { + return KNullDesC8; + } + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::SetLayoutNode +// Sets pointer to associated layout node +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomNode::SetLayoutNode(CXnNode* aNode) + { + iLayoutNode = aNode; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::LayoutNode +// Gets pointer to associated layout node +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnNode* CXnDomNode::LayoutNode() + { + return iLayoutNode; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::SetNamespaceL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomNode::SetNamespaceL(const TDesC8& aNS) + { + iNSRef = iStringPool.AddStringL(aNS); + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::CloneL +// Clones this node and it's child nodes and sets new namespace. This is a +// recursive function. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomNode* CXnDomNode::CloneL(CXnDomStringPool& aStringPool, + const TDesC8& aNS) + { + const TDesC8& name = iStringPool.String(iNameRef); + + CXnDomNode* clone = CXnDomNode::NewL(name, aNS, aStringPool); + CleanupStack::PushL(clone); + if (iPCData) + { + clone->AppendPCDataL(*iPCData); + } + clone->iNodeId = iNodeId; + clone->iRefNode = iRefNode; + + TInt childCount(iChildList->Length()); + + for (TInt i = 0; i < childCount; i++) + { + CXnDomNode* childClone = + static_cast (iChildList->Item(i))->CloneL( + aStringPool, aNS); + CleanupStack::PushL(childClone); + childClone->iParentNode = clone; + clone->iChildList->AddItemL(childClone); + CleanupStack::Pop(childClone); + } + + TInt attrCount(iAttributeList->Length()); + for (TInt j = 0; j < attrCount; j++) + { + CXnDomAttribute + * attrClone = + static_cast (iAttributeList->Item(j))->CloneL( + aStringPool); + CleanupStack::PushL(attrClone); + clone->iAttributeList->AddItemL(attrClone); + CleanupStack::Pop(attrClone); + } + + TInt propertyCount(iPropertyList->Length()); + for (TInt k = 0; k < propertyCount; k++) + { + CXnDomProperty + * propClone = + static_cast (iPropertyList->Item(k))->CloneL( + aStringPool); + CleanupStack::PushL(propClone); + clone->iPropertyList->AddItemL(propClone); + CleanupStack::Pop(propClone); + } + CleanupStack::Pop(clone); + return clone; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::SetOwnershipL +// Clones this node and it's child nodes and sets new namespace. This is a +// recursive function. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomNode::SetOwnershipL(const TDesC8& aNS) + { + TInt childCount(iChildList->Length()); + + SetNamespaceL(aNS); + for (TInt i = 0; i < childCount; i++) + { + CXnDomNode* child = static_cast (iChildList->Item(i)); + child->SetOwnershipL(aNS); + } + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/dom/src/xndomproperty.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/dom/src/xndomproperty.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,298 @@ +/* +* 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: Represents a Css property. +* +*/ + + + +// INCLUDE FILES +#include "xndomproperty.h" +#include "xndompropertyvalue.h" +#include "xndomlist.h" +#include "xndomstringpool.h" + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CXnDomProperty::CXnDomProperty +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnDomProperty::CXnDomProperty( CXnDomStringPool& aStringPool ): + iStringPool( aStringPool ) + { + } +// ----------------------------------------------------------------------------- +// CXnDomProperty::CXnDomProperty +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnDomProperty::CXnDomProperty( + TInt16 aStringPoolIndex, + CXnDomStringPool& aStringPool ): + iStringPool( aStringPool ), + iNameRef( aStringPoolIndex ) + { + } +// ----------------------------------------------------------------------------- +// CXnDomProperty::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnDomProperty::ConstructL( const TDesC8& aName ) + { + iNameRef = iStringPool.AddStringL( aName ); + iPropValList = CXnDomList::NewL( CXnDomList::EPropertyValueList, iStringPool ); + } +// ----------------------------------------------------------------------------- +// CXnDomProperty::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnDomProperty::ConstructL() + { + iPropValList = CXnDomList::NewL( CXnDomList::EPropertyValueList, iStringPool ); + } +// ----------------------------------------------------------------------------- +// CXnDomProperty::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomProperty* CXnDomProperty::NewL( + const TDesC8& aName, + CXnDomStringPool& aStringPool ) + { + CXnDomProperty* self = new( ELeave ) CXnDomProperty( aStringPool ); + + CleanupStack::PushL( self ); + self->ConstructL( aName ); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnDomProperty::NewL +// Two-phased stream constructor. +// ----------------------------------------------------------------------------- +// +CXnDomProperty* CXnDomProperty::NewL( + RReadStream& aStream, + CXnDomStringPool& aStringPool ) + { + CXnDomProperty* self = + new( ELeave ) CXnDomProperty( aStringPool ); + + CleanupStack::PushL( self ); + + aStream >> *self; + CleanupStack::Pop( self ); + + return self; + } +// ----------------------------------------------------------------------------- +// CXnDomProperty::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomProperty* CXnDomProperty::NewL( + TInt16 aStringPoolIndex, + CXnDomStringPool& aStringPool ) + { + CXnDomProperty* self = + new (ELeave) CXnDomProperty( aStringPoolIndex, aStringPool ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } +// Destructor +EXPORT_C CXnDomProperty::~CXnDomProperty() + { + delete iPropValList; + } +// ----------------------------------------------------------------------------- +// CXnDomProperty::CloneL +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomProperty* CXnDomProperty::CloneL() + { + CXnDomProperty* clone = new (ELeave)CXnDomProperty( iStringPool ); + CleanupStack::PushL(clone); + + clone->iPropValList = CXnDomList::NewL( CXnDomList::EPropertyValueList, iStringPool ); + clone->iNameRef = iNameRef; + + TInt count( iPropValList->Length() ); + for (TInt i = 0; i < count; ++i) + { + CXnDomPropertyValue* val = static_cast( iPropValList->Item(i) ); + CXnDomPropertyValue* cloneVal = val->CloneL(); + CleanupStack::PushL( cloneVal ); + clone->iPropValList->AddItemL( cloneVal ); + CleanupStack::Pop( cloneVal ); + } + clone->iInherited = iInherited; + clone->iPseudoClass = iPseudoClass; + CleanupStack::Pop(clone); + return clone; + } + +// ----------------------------------------------------------------------------- +// CXnDomProperty::CloneL +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomProperty* CXnDomProperty::CloneL( CXnDomStringPool& aStringPool ) + { + const TDesC8& name = iStringPool.String( iNameRef ); + CXnDomProperty* clone = CXnDomProperty::NewL( name, aStringPool ); + CleanupStack::PushL(clone); + + TInt count( iPropValList->Length() ); + for (TInt i = 0; i < count; ++i) + { + CXnDomPropertyValue* val = static_cast( iPropValList->Item(i) ); + CXnDomPropertyValue* cloneVal = val->CloneL( aStringPool ); + CleanupStack::PushL( cloneVal ); + clone->iPropValList->AddItemL( cloneVal ); + CleanupStack::Pop( cloneVal ); + } + clone->iInherited = iInherited; + clone->iPseudoClass = iPseudoClass; + CleanupStack::Pop(clone); + return clone; + } + +// ----------------------------------------------------------------------------- +// CXnDomProperty::Name +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CXnDomProperty::Name() + { + return iStringPool.String( iNameRef ); + } + +// ----------------------------------------------------------------------------- +// CXnDomProperty::PropertyValue +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomList& CXnDomProperty::PropertyValueList() + { + return *iPropValList; + } + +// ----------------------------------------------------------------------------- +// CXnDomProperty::IsValueSet +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CXnDomProperty::IsValueSet() + { + return (iPropValList->Length() > 0); + } + + +// ----------------------------------------------------------------------------- +// CXnDomProperty::Inherited +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CXnDomProperty::Inherited() + { + return iInherited; + } +// ----------------------------------------------------------------------------- +// CXnDomProperty::SetInherited +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomProperty::SetInherited( TBool aInherited ) + { + iInherited = aInherited; + } + +// ----------------------------------------------------------------------------- +// CXnDomProperty::StringPool +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomStringPool& CXnDomProperty::StringPool() const + { + return iStringPool; + } +// ----------------------------------------------------------------------------- +// CXnDomProperty::StringPoolIndex +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt16 CXnDomProperty::StringPoolIndex()const + { + return iNameRef; + } +// ----------------------------------------------------------------------------- +// CXnDomProperty::PseudoClass +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomProperty::TPseudoClass CXnDomProperty::PseudoClass() const + { + return iPseudoClass; + } + +// ----------------------------------------------------------------------------- +// CXnDomProperty::SetPseudoClass +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomProperty::SetPseudoClass( TPseudoClass aPseudoClass ) + { + iPseudoClass = aPseudoClass; + } + +// ----------------------------------------------------------------------------- +// CXnDomProperty::Size +// ----------------------------------------------------------------------------- +// +TInt CXnDomProperty::Size() const + { + TInt size( 0 ); + + size += sizeof(TInt16); //iNameRef + size += iPropValList->Size(); + size += sizeof(TInt8); //iInherited + size += sizeof(TInt8); //iPseudoClass + + return size; + } + +// ----------------------------------------------------------------------------- +// CXnDomProperty::ExternalizeL +// ----------------------------------------------------------------------------- +// +void CXnDomProperty::ExternalizeL( RWriteStream& aStream ) const + { + aStream.WriteInt16L( iNameRef ); + aStream << *iPropValList; + aStream.WriteInt8L( iInherited ); + aStream.WriteInt8L( iPseudoClass ); + } +// ----------------------------------------------------------------------------- +// CXnDomProperty::InternalizeL +// ----------------------------------------------------------------------------- +// +void CXnDomProperty::InternalizeL( RReadStream& aStream ) + { + iNameRef = aStream.ReadInt16L() + iStringPool.Offset(); + iPropValList = CXnDomList::NewL( aStream, iStringPool ); + + iInherited = TBool( aStream.ReadInt8L() ); + iPseudoClass = TPseudoClass( aStream.ReadInt8L() ); + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/dom/src/xndompropertyvalue.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/dom/src/xndompropertyvalue.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,755 @@ +/* +* 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: Property's value encapsulation. +* +*/ + + + +// INCLUDE FILES +#include "xndompropertyvalue.h" +#include "xndomstringpool.h" +#include +// LOCAL CONSTANTS AND MACROS +_LIT8(KInherit, "inherit"); +_LIT8(KAuto, "auto"); +_LIT8(KNone, "none"); + +// ============================ LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnDomPropertyValue::CXnDomPropertyValue +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnDomPropertyValue::CXnDomPropertyValue( CXnDomStringPool& aStringPool ): + iStringPool( aStringPool ), + iPrimitiveValueType( (TPrimitiveValueType)KErrNotFound ) + { + } + +// ----------------------------------------------------------------------------- +// CXnDomPropertyValue::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnDomPropertyValue::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnDomPropertyValue::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomPropertyValue* CXnDomPropertyValue::NewL( + CXnDomStringPool& aStringPool ) + { + CXnDomPropertyValue* self = new( ELeave ) CXnDomPropertyValue( aStringPool ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } +// ----------------------------------------------------------------------------- +// CXnDomPropertyValue::NewL +// Two-phased stream constructor. +// ----------------------------------------------------------------------------- +// +CXnDomPropertyValue* CXnDomPropertyValue::NewL( + RReadStream& aStream, + CXnDomStringPool& aStringPool ) + { + CXnDomPropertyValue* self = new( ELeave ) CXnDomPropertyValue( aStringPool ); + + CleanupStack::PushL( self ); + aStream >> *self; + CleanupStack::Pop(self); + + return self; + } + +// Destructor +EXPORT_C CXnDomPropertyValue::~CXnDomPropertyValue() + { + ReleaseData(); + } +// ----------------------------------------------------------------------------- +// CXnDomPropertyValue::CloneL() +// Make a copy from this object +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomPropertyValue* CXnDomPropertyValue::CloneL() + { + CXnDomPropertyValue* clone = CXnDomPropertyValue::NewL( iStringPool ); + CleanupStack::PushL( clone ); + clone->iPrimitiveValueType = iPrimitiveValueType; + + + switch( iPrimitiveValueType ) + { + // allowed cases for real value + case ENumber: + case EPercentage: + case EEms: + case EExs: + case EPx: + case ECm: + case EMm: + case EIn: + case EPt: + case EPc: + case EDeg: + case ERad: + case EGrad: + case EMs: + case ES: + case EHz: + case EKHz: + case EUnitValue: + { + clone->iData.iRealValue = new (ELeave) TReal( *iData.iRealValue ); + break; + } + // allowed cases for string value + case EString: + case EIdent: + case EUri: + case EAttr: + case EUnknown: + { + clone->iData.iStringRef = iData.iStringRef; + clone->iIdent = iIdent; + break; + } + + case ERgbColor: + case ERgbaColor: + { + clone->iData.iRgbColor = new (ELeave) TRgb( *iData.iRgbColor ); +#ifdef SYMBIAN_GRAPHICS_ALPHA_SUPPORT_V1 + clone->iData.iRgbColor->SetAlpha( iData.iRgbColor->Alpha() ); +#endif + break; + } + default: + break; + } + CleanupStack::Pop( clone ); + return clone; + } + +// ----------------------------------------------------------------------------- +// CXnDomPropertyValue::CloneL( CXnDomStringPool& aStringPool ) +// Make a copy from this object +// ----------------------------------------------------------------------------- +// +CXnDomPropertyValue* CXnDomPropertyValue::CloneL( CXnDomStringPool& aStringPool ) + { + CXnDomPropertyValue* clone = CXnDomPropertyValue::NewL( aStringPool ); + CleanupStack::PushL( clone ); + clone->iPrimitiveValueType = iPrimitiveValueType; + + + switch( iPrimitiveValueType ) + { + // allowed cases for real value + case ENumber: + case EPercentage: + case EEms: + case EExs: + case EPx: + case ECm: + case EMm: + case EIn: + case EPt: + case EPc: + case EDeg: + case ERad: + case EGrad: + case EMs: + case ES: + case EHz: + case EKHz: + case EUnitValue: + { + clone->iData.iRealValue = new (ELeave) TReal( *iData.iRealValue ); + break; + } + // allowed cases for string value + case EString: + case EIdent: + case EUri: + case EAttr: + case EUnknown: + { + const TDesC8& value = iStringPool.String( iData.iStringRef ); + clone->iData.iStringRef = aStringPool.AddStringL( value ); + clone->iIdent = iIdent; + break; + } + + case ERgbColor: + case ERgbaColor: + { + clone->iData.iRgbColor = new (ELeave) TRgb( *iData.iRgbColor ); +#ifdef SYMBIAN_GRAPHICS_ALPHA_SUPPORT_V1 + clone->iData.iRgbColor->SetAlpha( iData.iRgbColor->Alpha() ); +#endif + break; + } + default: + break; + } + CleanupStack::Pop( clone ); + return clone; + } + +// ----------------------------------------------------------------------------- +// TReal CXnDomPropertyValue::FloatValueL +// Returns the float value +// ----------------------------------------------------------------------------- +// +EXPORT_C TReal CXnDomPropertyValue::FloatValueL() const + { + switch ( iPrimitiveValueType ) + { + // allowed cases for real value + case ENumber: + case EPercentage: + case EEms: + case EExs: + case EPx: + case ECm: + case EMm: + case EIn: + case EPt: + case EPc: + case EDeg: + case ERad: + case EGrad: + case EMs: + case ES: + case EHz: + case EKHz: + case EUnitValue: + break; + + + default: + User::Leave( KErrNotSupported ); + break; + } + + return *iData.iRealValue; + } + +// ----------------------------------------------------------------------------- +// TReal CXnDomPropertyValue::SetFloatValueL +// Sets the float value +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomPropertyValue::SetFloatValueL( + TPrimitiveValueType aValueType, + TReal aFloatValue ) + { + + switch ( aValueType ) + { + // allowed cases for real value + case ENumber: + case EPercentage: + case EEms: + case EExs: + case EPx: + case ECm: + case EMm: + case EIn: + case EPt: + case EPc: + case EDeg: + case ERad: + case EGrad: + case EMs: + case ES: + case EHz: + case EKHz: + case EUnitValue: + break; + + default: // not supported real value + User::Leave( KErrNotSupported ); + break; + } + + ReleaseData(); + + iPrimitiveValueType = aValueType; + iData.iRealValue = new ( ELeave ) TReal( aFloatValue ); + } + +// ----------------------------------------------------------------------------- +// const TDesC& CXnDomPropertyValue::StringValueL +// Returns the string value +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CXnDomPropertyValue::StringValueL() + { + switch ( iPrimitiveValueType ) + { + // allowed cases for string value + case EString: + case EIdent: + case EUri: + case EAttr: + case EUnknown: + break; + + default: // not supported string value + User::Leave( KErrNotSupported ); + break; + } + + + return iStringPool.String( iData.iStringRef ); + } +// ----------------------------------------------------------------------------- +// const TDesC& CXnDomPropertyValue::StringValue +// Returns the string value +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CXnDomPropertyValue::StringValue() + { + switch ( iPrimitiveValueType ) + { + // allowed cases for string value + case EString: + case EIdent: + case EUri: + case EAttr: + case EUnknown: + break; + + default: // not supported string value + return KNullDesC8; + + } + + + return iStringPool.String( iData.iStringRef ); + } +// ----------------------------------------------------------------------------- +// TReal CXnDomPropertyValue::SetStringValueL +// Sets the string value +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomPropertyValue::SetStringValueL( + TPrimitiveValueType aValueType, + const TDesC8& aStringValue ) + { + + switch ( aValueType ) + { + // allowed cases for string value + case EString: + case EIdent: + case EUri: + case EAttr: + case EUnknown: + break; + + default: // not supported string value + User::Leave( KErrNotSupported ); + break; + } + + ReleaseData(); + + iPrimitiveValueType = aValueType; + TInt stringRef = iStringPool.AddStringL( aStringValue ); + iData.iStringRef = stringRef; + + if ( aStringValue.Compare( KAuto ) == 0 ) + { + iIdent = EAuto; + } + else if ( aStringValue.Compare( KNone ) == 0 ) + { + iIdent = ENone; + } + else if ( aStringValue.Compare( KInherit ) == 0 ) + { + iIdent = EInherit; + } + } + + +// ----------------------------------------------------------------------------- +// const TRgb& CXnDomPropertyValue::RgbColorValueL +// Returns the TRgb object if supported +// ----------------------------------------------------------------------------- +// +EXPORT_C const TRgb& CXnDomPropertyValue::RgbColorValueL() const + { + if ( ERgbColor != iPrimitiveValueType && + ERgbaColor != iPrimitiveValueType ) + { + User::Leave( KErrNotSupported ); + } + return *iData.iRgbColor; + } + +// ----------------------------------------------------------------------------- +// TCSSPrimitiveValueType CXnDomPropertyValue::PrimitiveValueType +// Returns the primitive value type of the object +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomPropertyValue::TPrimitiveValueType + CXnDomPropertyValue::PrimitiveValueType() const + { + return iPrimitiveValueType; + } + + + +// ----------------------------------------------------------------------------- +// void CXnDomPropertyValue::SetRgbColor +// Sets the CSS rgba object +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomPropertyValue::SetRgbColorL( const TRgb& aColor ) + { + ReleaseData(); + iPrimitiveValueType = ERgbColor; + iData.iRgbColor = new (ELeave) TRgb(aColor); + } + +// ----------------------------------------------------------------------------- +// void CXnDomPropertyValue::ReleaseData +// Releases the union loaded heap allocated data +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomPropertyValue::ReleaseData() + { + switch( iPrimitiveValueType ) + { + // allowed cases for real value + case ENumber: + case EPercentage: + case EEms: + case EExs: + case EPx: + case ECm: + case EMm: + case EIn: + case EPt: + case EPc: + case EDeg: + case ERad: + case EGrad: + case EMs: + case ES: + case EHz: + case EKHz: + case EUnitValue: + { + delete iData.iRealValue; + iData.iRealValue = NULL; + break; + } + + + // allowed cases for string value + case EString: + case EIdent: + case EUri: + case EAttr: + case EUnknown: + { + iData.iStringRef = -1; + iData.iStringRef = NULL; + iIdent = ENotSet; + break; + } + + case ERgbColor: + case ERgbaColor: + { + delete iData.iRgbColor; + iData.iRgbColor = NULL; + break; + } + + + default: + break; + } + } +// ----------------------------------------------------------------------------- +// void CXnDomPropertyValue::IsInheritIdent +// Compares if value is 'inherit' +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CXnDomPropertyValue::IsInheritIdent() + { + return (iIdent == EInherit? ETrue : EFalse); + } + +// ----------------------------------------------------------------------------- +// void CXnDomPropertyValue::IsAutoIdent +// Compares if value is 'auto' +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CXnDomPropertyValue::IsAutoIdent() + { + return (iIdent == EAuto? ETrue : EFalse); + } + +// ----------------------------------------------------------------------------- +// void CXnDomPropertyValue::IsNoneIdent +// Compares if value is 'none' +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CXnDomPropertyValue::IsNoneIdent() + { + return (iIdent == ENone? ETrue : EFalse); + } +// ----------------------------------------------------------------------------- +// CXnDomPropertyValue::SetStringPoolIndexL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomPropertyValue::SetStringPoolIndexL( + TPrimitiveValueType aValueType, + TInt16 aStringPoolIndex ) + { + switch(aValueType) + { + case EString: + case EIdent: + case EUri: + case EAttr: + case EUnknown: + break; + default: + User::Leave( KErrNotSupported ); + } + ReleaseData(); + iPrimitiveValueType = aValueType; + iData.iStringRef = aStringPoolIndex; + } +// ----------------------------------------------------------------------------- +// CXnDomPropertyValue::SetStringPoolIndexL +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt16 CXnDomPropertyValue::StringPoolIndexL()const + { + switch(iPrimitiveValueType) + { + case EString: + case EIdent: + case EUri: + case EAttr: + case EUnknown: + break; + default: + User::Leave( KErrNotSupported ); + } + return iData.iStringRef; + } + +// ----------------------------------------------------------------------------- +// CXnDomPropertyValue::Size()const +// Count size of this object's data. +// ----------------------------------------------------------------------------- +// +TInt CXnDomPropertyValue::Size()const + { + TInt size( 0 ); + + size += sizeof(TInt8); //iPrimitiveValueType + + switch( iPrimitiveValueType ) + { + // allowed cases for real value + case ENumber: + case EPercentage: + case EEms: + case EExs: + case EPx: + case ECm: + case EMm: + case EIn: + case EPt: + case EPc: + case EDeg: + case ERad: + case EGrad: + case EMs: + case ES: + case EHz: + case EKHz: + case EUnitValue: + { + size += sizeof(TReal); + } + break; + // allowed cases for string value + case EString: + case EIdent: + case EUri: + case EAttr: + case EUnknown: + { + size += sizeof(TInt16); + size += sizeof(TIdentType); + } + break; + case ERgbColor: + case ERgbaColor: + { + size += sizeof(TRgb); + } + break; + default: + break; + } + return size; + } +// ----------------------------------------------------------------------------- +// CXnDomPropertyValue::ExternalizeL +// Serializing data to stream. +// ----------------------------------------------------------------------------- +// +void CXnDomPropertyValue::ExternalizeL( RWriteStream& aStream ) const + { + aStream.WriteInt8L( iPrimitiveValueType ); + + + switch( iPrimitiveValueType ) + { + // allowed cases for real value + case ENumber: + case EPercentage: + case EEms: + case EExs: + case EPx: + case ECm: + case EMm: + case EIn: + case EPt: + case EPc: + case EDeg: + case ERad: + case EGrad: + case EMs: + case ES: + case EHz: + case EKHz: + case EUnitValue: + { + aStream << *iData.iRealValue; + } + break; + // allowed cases for string value + case EString: + case EIdent: + case EUri: + case EAttr: + case EUnknown: + { + aStream << iData.iStringRef; + aStream.WriteInt8L( iIdent ); + } + break; + case ERgbColor: + case ERgbaColor: + { + aStream << *iData.iRgbColor; + } + break; + default: + break; + } + } +// ----------------------------------------------------------------------------- +// CXnDomPropertyValue::InternalizeL +// Deserializing data from stream to object +// ----------------------------------------------------------------------------- +// +void CXnDomPropertyValue::InternalizeL( RReadStream& aStream ) + { + iPrimitiveValueType = static_cast( aStream.ReadInt8L() ); + + ReleaseData(); + + switch( iPrimitiveValueType ) + { + // allowed cases for real value + case ENumber: + case EPercentage: + case EEms: + case EExs: + case EPx: + case ECm: + case EMm: + case EIn: + case EPt: + case EPc: + case EDeg: + case ERad: + case EGrad: + case EMs: + case ES: + case EHz: + case EKHz: + case EUnitValue: + { + iData.iRealValue = new ( ELeave ) TReal(); + aStream >> *iData.iRealValue; + } + break; + + // allowed cases for string value + case EString: + case EIdent: + case EUri: + case EAttr: + case EUnknown: + { + aStream >> iData.iStringRef; + iData.iStringRef += iStringPool.Offset(); + iIdent = static_cast( aStream.ReadInt8L() ); + } + break; + case ERgbColor: + case ERgbaColor: + { + iData.iRgbColor = new (ELeave) TRgb(); + aStream >> *iData.iRgbColor; + } + break; + + default: + break; + } + } + + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/dom/src/xndomstringpool.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/dom/src/xndomstringpool.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,215 @@ +/* +* 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: Represent string pool for dom strings +* +*/ + + + +// INCLUDE FILES +#include "xndomstringpool.h" + + +// ============================ LOCAL FUNCTIONS ================================ + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CXnDomStringPool::CXnDomStringPool +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnDomStringPool::CXnDomStringPool() + { + iStringPoolOffsetCurrent = iStringPoolOffsetNext = 0; + } + +// ----------------------------------------------------------------------------- +// CXnDomStringPool::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnDomStringPool::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnDomStringPool::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnDomStringPool* CXnDomStringPool::NewL() + { + CXnDomStringPool* self = new( ELeave ) CXnDomStringPool; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + + +// ----------------------------------------------------------------------------- +// CXnDomStringPool::NewL +// Two-phased stream constructor. +// ----------------------------------------------------------------------------- +// +CXnDomStringPool* CXnDomStringPool::NewL( RReadStream& aStream ) + { + CXnDomStringPool* self = new( ELeave ) CXnDomStringPool; + CleanupStack::PushL( self ); + aStream >> *self; + CleanupStack::Pop(self); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnDomStringPool::~CXnDomStringPool +// Destructor +// ----------------------------------------------------------------------------- +// +CXnDomStringPool::~CXnDomStringPool() + { + iStringPool.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// CXnDomStringPool::CloneL +// ----------------------------------------------------------------------------- +// +CXnDomStringPool* CXnDomStringPool::CloneL() + { + CXnDomStringPool* clone = CXnDomStringPool::NewL(); + CleanupStack::PushL( clone ); + + TInt count( iStringPool.Count() ); + for ( TInt i=0; iDes().AllocLC(); + clone->iStringPool.AppendL( tmp ); + CleanupStack::Pop( tmp ); + } + CleanupStack::Pop( clone ); + return clone; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::AddStringL +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CXnDomStringPool::AddStringL( const TDesC8& aString ) + { + TBool found( EFalse ); + TInt index( 0 ); + + TInt count( iStringPool.Count() ); + for (; index < count && !found; ) + { + if ( iStringPool[ index ]->Des().Compare( aString ) == 0 ) + { + found = ETrue; + } + else + { + index++; + } + } + if ( !found ) + { + HBufC8* tmp = aString.AllocLC(); + iStringPool.AppendL( tmp ); + CleanupStack::Pop( tmp ); + index = iStringPool.Count()-1; //Last item + iStringPoolOffsetNext++; + } + return index; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::String +// ----------------------------------------------------------------------------- +// +const TDesC8& CXnDomStringPool::String( const TInt aStringRef ) + { + return (*iStringPool[ aStringRef ]); + } + +// ----------------------------------------------------------------------------- +// CXnDomStringPool::Size +// ----------------------------------------------------------------------------- +// +TInt CXnDomStringPool::Size() const + { + TInt size( 0 ); + + TInt count( iStringPool.Count() ); + for ( TInt i=0; iSize(); //Buffer sixe in bytes + } + return size; + } + +// ----------------------------------------------------------------------------- +// CXnDomStringPool::ExternalizeL +// ----------------------------------------------------------------------------- +// +void CXnDomStringPool::ExternalizeL( RWriteStream& aStream ) const + { + TInt count( iStringPool.Count() ); + aStream.WriteInt16L( count ); + + for ( TInt i=0; iLength() ); + aStream << *iStringPool[i]; + } + } + +// ----------------------------------------------------------------------------- +// CXnDomStringPool::InternalizeL +// ----------------------------------------------------------------------------- +// +void CXnDomStringPool::InternalizeL( RReadStream& aStream ) + { + TInt len(0); + TInt16 count ( aStream.ReadInt16L() ); + + iStringPoolOffsetCurrent = iStringPoolOffsetNext; + iStringPoolOffsetNext += count; + + for ( TInt i=0; i + +TARGET xn3domvisitor.dll +TARGETTYPE PLUGIN +UID 0x10009d8d 0x102072BE +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE xndomvisitorproxy.cpp +SOURCE xndomvisitor.cpp + +START RESOURCE 102072BE.rss +#ifdef SYMBIAN_SECURE_ECOM +TARGET xn3domvisitor.rsc +#endif +END + + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY xn3domdocument.lib +LIBRARY flogger.lib +LIBRARY charconv.lib + +LANG SC diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/ecomelement/xndomvisitor/inc/xndomvisitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/inc/xndomvisitor.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,90 @@ +/* +* 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: Visitor class to modify DOM node element's data +* +*/ + + + +#ifndef XN_DOM_VISITOR_H +#define XN_DOM_VISITOR_H + +#include +#include "mxndomvisitor.h" + +// CLASS FORWARD + + +// CLASS DECLARATION + +/** +* Visitor class modifies DOM node element's data. +* +* @lib xndomvisitor.dll +* @since Series 60 3.1 +*/ +class CXnDomVisitor: public CBase, public MXnDomVisitor + { + public: + /** + * NewL construction + */ + static MXnDomVisitor* NewL(); + + public: // New functions + + /** + * Documented in MXnDomVisitor::IsVersion + */ + TBool IsVersion( const TDesC8& aVersion ); + + /** + * Documented in MXnDomVisitor::ModifyDataL + */ + void ModifyDataL( CXnDomNode& aNode ); + + /** + * Documented in MXnDomVisitor::SetElementTypeL + */ + void SetElementTypeL( CXnDomNode& aNode ); + + /** + * Documented in MXnDomVisitor::SetDtorKey + */ + void SetDtorKey( const TUid aDtorKey ); + + /** + * Documented in MXnDomVisitor::Release + */ + void Release(); + + private: + /** + * Destructor + */ + ~CXnDomVisitor(); + + /** + * C++ default constructor + */ + CXnDomVisitor(); + + private: + //ECom destructor key + TUid iDtorKey; + }; + +#endif // XN_DOM_VISITOR_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/ecomelement/xndomvisitor/inc/xndomvisitor.rh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/inc/xndomvisitor.rh Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,32 @@ +/* +* 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: Visitor class to modify DOM nodes data +* +*/ + + + +#ifndef XN_DOM_VISITOR_RH_H +#define XN_DOM_VISITOR_RH_H + + +// CONSTANTS +// implementation interface uid +#define KXnDomVisitorIId 0x10207396 +//implementation uid +#define KXnDomVisitorImplUid 0x10207397 + +#endif // XN_DOM_VISITOR_RH_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/ecomelement/xndomvisitor/inc/xnliteral.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/inc/xnliteral.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,297 @@ +/* +* 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: Literal definitions +* +*/ + + + +#ifndef XN_LITERAL_H +#define XN_LITERAL_H + +#include "xndomnode.h" +#include +// MODULE LITERAL DEFINITIONS +//Core +_STLIT8(KProperty, "property"); + +//Ui +_STLIT8(KXmluiml, "xmluiml"); +_STLIT8(KHeader, "header"); +_STLIT8(KInclude, "include"); +_STLIT8(KViews, "views"); +_STLIT8(KView, "view"); +_STLIT8(KPanes, "panes"); +_STLIT8(KStatusPane, "statuspane"); +_STLIT8(KMainPane, "mainpane"); +_STLIT8(KControlPane, "controlpane"); +_STLIT8(KDialogs, "dialogs"); +_STLIT8(KDialog, "dialog"); +_STLIT8(KNote, "note"); + +//Header +_STLIT8(KUiDefinition,"uidefinition"); +_STLIT8(KApplication, "application"); +_STLIT8(KDesc, "desc"); + +//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"); +_STLIT8(KText, "text"); +_STLIT8(KImage, "image"); +_STLIT8(KEditor, "editor"); +_STLIT8(KMarquee, "marquee"); +_STLIT8(KNewsticker, "newsticker"); +_STLIT8(KTooltip, "tooltip"); +//XHTML +_STLIT8(KObject, "object"); +_STLIT8(KParam, "param"); + +//Box +_STLIT8(KBox, "box"); + +//Interaction +_STLIT8(KAction, "action"); +_STLIT8(KTrigger, "trigger"); +_STLIT8(KEvent, "event"); + + +//PROPERTY LITERAL DEFINITIONS + +//Common properties +_STLIT8(KDisplay, "display"); +_STLIT8(KDisplayPriority, "_s60-display-priority"); +_STLIT8(KVisibility, "visibility"); +_STLIT8(KInitialFocus, "_s60-initial-focus"); + + +_STLIT8(KBlockProgression, "block-progression"); +_STLIT8(KDirection, "direction"); + +_STLIT8(KWidth, "width"); +_STLIT8(KHeight, "height"); + +_STLIT8(KMarginTop, "margin-top"); +_STLIT8(KMarginRight, "margin-right"); +_STLIT8(KMarginBottom, "margin-bottom"); +_STLIT8(KMarginLeft, "margin-left"); +_STLIT8(KBorderWidth, "border-width"); +_STLIT8(KBorderTopWidth, "border-top-width"); +_STLIT8(KBorderRightWidth, "border-right-width"); +_STLIT8(KBorderBottomWidth,"border-bottom-width"); +_STLIT8(KBorderLeftWidth, "border-left-width"); + +_STLIT8(KPaddingTop, "padding-top"); +_STLIT8(KPaddingRight, "padding-right"); +_STLIT8(KPaddingBottom, "padding-bottom"); +_STLIT8(KPaddingLeft, "padding-left"); + +_STLIT8(KPosition, "position"); +_STLIT8(KTop, "top"); +_STLIT8(KRight, "right"); +_STLIT8(KBottom, "bottom"); +_STLIT8(KLeft, "left"); +_STLIT8(KMinWidth, "min-width"); +_STLIT8(KMaxWidth, "max-width"); +_STLIT8(KMinHeight, "min-height"); +_STLIT8(KMaxHeight, "max-height"); + +_STLIT8(KColor, "color"); +_STLIT8(KBGColor, "background-color"); +_STLIT8(KBGImg, "background-image"); +_STLIT8(KBGSize, "background-size"); +_STLIT8(KBGRepeat, "background-repeat"); +_STLIT8(KBGPos, "background-position"); + +_STLIT8(KBorderTopStyle, "border-top-style"); +_STLIT8(KBorderRightStyle, "border-right-style"); +_STLIT8(KBorderBottomStyle,"border-bottom-style"); +_STLIT8(KBorderLeftStyle, "border-left-style"); +_STLIT8(KBorderColor, "border-color"); +_STLIT8(KBorderImg, "border-image"); + + +//Element with text properties +_STLIT8(KTextOverflowMode, "text-overflow-mode"); + +_STLIT8(KFontFamily, "font-family"); +_STLIT8(KFontSize, "font-size"); +_STLIT8(KFontWeight, "font-weight"); +_STLIT8(KFontStyle, "font-style"); +_STLIT8(KTextDecoration, "text-decoration"); + +//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"); +_STLIT8(KTabColor, "_s60-tab-color"); +_STLIT8(KTabImg, "_s60-tab-image"); +_STLIT8(KViewTransitionEffect, "_s60-view-transition-effect"); + +//View +_STLIT8(KTabLabel, "_s60-tab-label"); + +//Function pointer +typedef void (*FuncPtr) (TAny*); + +//Struct to hold type and function which operates it +typedef struct + { + const void* iName; + FuncPtr iFuncPtr; + TContentType iContentType; + }TXnElementVisitor; + +//Struct to follow up if property has capability to inherit +typedef struct + { + const void* iName; + TBool iInherit; + }TXnPropertyProxy; + + +// Common properties intermediate table +const TXnPropertyProxy KXnCommonPropertyTable[] = + { + {(const void*)&KDisplay, EFalse}, + {(const void*)&KDisplayPriority, EFalse}, + {(const void*)&KVisibility, ETrue}, + {(const void*)&KInitialFocus, EFalse}, + + {(const void*)&KBlockProgression, ETrue}, + {(const void*)&KDirection, ETrue}, + + {(const void*)&KWidth, EFalse}, + {(const void*)&KHeight, EFalse}, + + {(const void*)&KMarginTop, EFalse}, + {(const void*)&KMarginRight, EFalse}, + {(const void*)&KMarginBottom, EFalse}, + {(const void*)&KMarginLeft, EFalse}, + {(const void*)&KBorderWidth, EFalse}, + {(const void*)&KBorderTopWidth, EFalse}, + {(const void*)&KBorderRightWidth, EFalse}, + {(const void*)&KBorderBottomWidth, EFalse}, + {(const void*)&KBorderLeftWidth, EFalse}, + + {(const void*)&KPaddingTop, EFalse}, + {(const void*)&KPaddingRight, EFalse}, + {(const void*)&KPaddingBottom, EFalse}, + {(const void*)&KPaddingLeft, EFalse}, + + {(const void*)&KPosition, EFalse}, + {(const void*)&KTop, EFalse}, + {(const void*)&KRight, EFalse}, + {(const void*)&KBottom, EFalse}, + {(const void*)&KLeft, EFalse}, + + {(const void*)&KMinWidth, EFalse}, + {(const void*)&KMaxWidth, EFalse}, + {(const void*)&KMinHeight, EFalse}, + {(const void*)&KMaxHeight, EFalse}, + + //Appearance + {(const void*)&KColor, ETrue}, + {(const void*)&KBGColor, EFalse}, + {(const void*)&KBGImg, EFalse}, + {(const void*)&KBGSize, EFalse}, + {(const void*)&KBGRepeat, EFalse}, + {(const void*)&KBGPos, EFalse}, + + {(const void*)&KBorderTopStyle, EFalse}, + {(const void*)&KBorderRightStyle, EFalse}, + {(const void*)&KBorderBottomStyle, EFalse}, + {(const void*)&KBorderLeftStyle, EFalse}, + {(const void*)&KBorderColor, EFalse}, + {(const void*)&KBorderImg, EFalse} + + }; + + +const TXnPropertyProxy KXnElementWithTextPropertyTable[] = + { + {(const void*)&KTextOverflowMode, EFalse}, + {(const void*)&KFontFamily, ETrue}, + {(const void*)&KFontSize, ETrue}, + {(const void*)&KFontWeight, ETrue}, + {(const void*)&KFontStyle, ETrue}, + {(const void*)&KTextDecoration, EFalse} + }; + +const TXnPropertyProxy KXnTextElementPropertyTable[] = + { + {(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}, + {(const void*)&KTabStyle, ETrue}, + {(const void*)&KTabColor, ETrue}, + {(const void*)&KTabImg, EFalse}, + {(const void*)&KViewTransitionEffect, EFalse} + }; + +const TXnPropertyProxy KXnViewPropertyTable[] = + { + + {(const void*)&KTabLabel, EFalse} + + }; +// CLASS DECLARATION + + +#endif // MXN_DOM_VISITOR_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/ecomelement/xndomvisitor/src/102072BE.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/src/102072BE.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// 102072BE.RSS +// +#include +#include "xndomvisitor.rh" + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = 0x102072BE; +interfaces = + { + INTERFACE_INFO + { + interface_uid = KXnDomVisitorIId; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KXnDomVisitorImplUid; + version_no = 1; + display_name = "Node element ns"; + default_data = "inheritpropertyvisitor"; + opaque_data = ""; + } + }; + } + }; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/ecomelement/xndomvisitor/src/xndomvisitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/src/xndomvisitor.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,272 @@ +/* +* 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: Visitor class to modify DOM node element's data +* +*/ + + + +// INCLUDE FILES +#include "xndomvisitor.h" +#include "xnliteral.h" +#include "xndomlist.h" +#include "xndomproperty.h" +#include "xndomstringpool.h" +#include + +// CONSTANTS +_LIT8(KNS, "inheritpropertyvisitor"); + +//Function declarations +LOCAL_C void SetPropertiesL( const TXnPropertyProxy aTable[], TInt aCount, TAny* aData ); +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 ); + +const TXnElementVisitor KXnElementVisitorTable[]= + { + { (const void*)&KProperty, NULL, EEmpty}, + { (const void*)&KXmluiml, NULL, EEmpty}, + { (const void*)&KInclude, NULL, EEmpty}, + { (const void*)&KViews, NULL, EEmpty}, + { (const void*)&KView, &SetViewPropertiesL, EEmpty}, + { (const void*)&KPanes, &SetCommonPropertiesL, EEmpty}, + { (const void*)&KStatusPane, &SetCommonPropertiesL, EEmpty}, + { (const void*)&KMainPane, &SetCommonPropertiesL, EEmpty}, + { (const void*)&KControlPane, &SetCommonPropertiesL, EEmpty}, + { (const void*)&KDialogs, &SetCommonPropertiesL, EEmpty}, + { (const void*)&KDialog, &SetCommonPropertiesL, EEmpty}, + { (const void*)&KNote, &SetTextElementPropertiesL, EEmpty}, + { (const void*)&KUiDefinition, NULL, EEmpty}, + { (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}, + { (const void*)&KText, &SetTextElementPropertiesL, EPCData}, + { (const void*)&KImage, &SetCommonPropertiesL, EEmpty}, + { (const void*)&KEditor, &SetElementWithTextPropertiesL, EEmpty}, + { (const void*)&KMarquee, &SetElementWithTextPropertiesL, EPCData}, + { (const void*)&KNewsticker, &SetElementWithTextPropertiesL, EPCData}, + + { (const void*)&KObject, NULL, EPCData}, + { (const void*)&KParam, NULL, EEmpty}, + { (const void*)&KTooltip, &SetElementWithTextPropertiesL, EEmpty}, + + { (const void*)&KBox, &SetCommonPropertiesL, EEmpty}, + { (const void*)&KAction, NULL, EEmpty}, + { (const void*)&KTrigger, NULL, EEmpty}, + { (const void*)&KEvent, NULL, EEmpty} + }; + +// ============================ LOCAL FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// SetPropertiesL Set properties which can inherit and doesn't exist yet. +// Returns: On return proeprty list contains properties which can inherit +// ----------------------------------------------------------------------------- +// +LOCAL_C void SetPropertiesL( + const TXnPropertyProxy aTable[], + TInt aItemCount, + TAny* aData ) + { + CXnDomList* propertyList = reinterpret_cast( aData ); + CXnDomStringPool& stringPool = propertyList->StringPool(); + + for ( TInt i=0; i( aTable[i].iName ); + + CXnDomProperty* foundProperty = + static_cast( propertyList->FindByName( *name ) ); + if ( aTable[i].iInherit ) + { + if (!foundProperty) + { + property = CXnDomProperty::NewL( *name, stringPool ); + property->SetInherited( aTable[i].iInherit ); + CleanupStack::PushL( property ); + propertyList->AddItemL( property ); + CleanupStack::Pop( property ); + } + else + { + foundProperty->SetInherited( aTable[i].iInherit ); + } + } + } + } + +LOCAL_C void SetCommonPropertiesL( TAny* aData ) + { + TInt count( sizeof (KXnCommonPropertyTable) / sizeof(TXnPropertyProxy) ); + SetPropertiesL( KXnCommonPropertyTable, count, aData ); + } + +LOCAL_C void SetElementWithTextPropertiesL( TAny* aData ) + { + SetCommonPropertiesL( aData ); + TInt count( sizeof (KXnElementWithTextPropertyTable) / sizeof(TXnPropertyProxy) ); + SetPropertiesL( KXnElementWithTextPropertyTable, count, aData ); + } + +LOCAL_C void SetTextElementPropertiesL( TAny* aData ) + { + 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 ) + { + SetCommonPropertiesL( aData ); + TInt count( sizeof (KXnViewsAndViewPropertyTable) / sizeof(TXnPropertyProxy) ); + SetPropertiesL( KXnViewsAndViewPropertyTable, count, aData ); + } + +LOCAL_C void SetViewPropertiesL( TAny* aData ) + { + SetViewsAndViewPropertiesL( aData ); + TInt count( sizeof (KXnViewPropertyTable) / sizeof(TXnPropertyProxy) ); + SetPropertiesL( KXnViewPropertyTable, count, aData ); + } + + + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnDomVisitor::NewL +// ----------------------------------------------------------------------------- +MXnDomVisitor* CXnDomVisitor::NewL() + { + return new (ELeave) CXnDomVisitor(); + } + +// ----------------------------------------------------------------------------- +// CXnDomVisitor::CXnDomVisitor +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnDomVisitor::CXnDomVisitor() + { + } + + +// Destructor +CXnDomVisitor::~CXnDomVisitor() + { + REComSession::DestroyedImplementation( iDtorKey ); + } + +// ----------------------------------------------------------------------------- +// CXnDomVisitor::IsVersion +// ----------------------------------------------------------------------------- +TBool CXnDomVisitor::IsVersion( const TDesC8& aVersion ) + { + return (KNS().Compare( aVersion ) == 0); + } + +// ----------------------------------------------------------------------------- +// CXnDomVisitor::ModifyDataL +// ----------------------------------------------------------------------------- +void CXnDomVisitor::ModifyDataL( CXnDomNode& aNode ) + { + TInt count( sizeof(KXnElementVisitorTable) / sizeof( TXnElementVisitor ) ); + + TBool found = EFalse; + for ( TInt i=0; i( KXnElementVisitorTable[i].iName ); + + if ( name && name->Compare( aNode.Name() ) == 0) + { + if ( KXnElementVisitorTable[i].iFuncPtr ) + { + KXnElementVisitorTable[i].iFuncPtr( &aNode.PropertyList() ); + } + found = ETrue; + } + } + } + +// ----------------------------------------------------------------------------- +// CXnDomVisitor::SetElementTypeL +// ----------------------------------------------------------------------------- +void CXnDomVisitor::SetElementTypeL( CXnDomNode& aNode ) + { + TInt count( sizeof(KXnElementVisitorTable) / sizeof( TXnElementVisitor ) ); + + TBool found = EFalse; + for ( TInt i=0; i( KXnElementVisitorTable[i].iName ); + + if ( name && name->Compare( aNode.Name() ) == 0) + { + aNode.SetContentType(KXnElementVisitorTable[i].iContentType); + found = ETrue; + } + } + } +// ----------------------------------------------------------------------------- +// CXnDomVisitor::CreateElementL +// ----------------------------------------------------------------------------- +void CXnDomVisitor::SetDtorKey( const TUid aDtorKey ) + { + iDtorKey = aDtorKey; + } + +// ----------------------------------------------------------------------------- +// CXnDomVisitor::Release +// ----------------------------------------------------------------------------- +void CXnDomVisitor::Release() + { + delete this; + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/ecomelement/xndomvisitor/src/xndomvisitorproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/src/xndomvisitorproxy.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,47 @@ +/* +* 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: ECom plugins implementation proxy +* +*/ + + + +// INCLUDE FILES +#include "xndomvisitor.h" +#include "xndomvisitor.rh" + +#include +#include + + + +// Provides a key value pair table, this is used to identify +// the correct construction function for the requested interface. +const TImplementationProxy ImplementationTable[] = + { +#ifdef __EABI__ + IMPLEMENTATION_PROXY_ENTRY( KXnDomVisitorImplUid, CXnDomVisitor::NewL ) +#else + {KXnDomVisitorImplUid, CXnDomVisitor::NewL } +#endif + }; + +// Function used to return an instance of the proxy table. +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/ecomelement/xnecomelementproxy/bwins/xn3ecomelementproxyu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/ecomelement/xnecomelementproxy/bwins/xn3ecomelementproxyu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateImplementationL@TXnEComElementProxy@@SAPAVMXnDomVisitor@@ABVTDesC8@@@Z @ 1 NONAME ; class MXnDomVisitor * TXnEComElementProxy::CreateImplementationL(class TDesC8 const &) + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/ecomelement/xnecomelementproxy/eabi/xn3ecomelementproxyu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/ecomelement/xnecomelementproxy/eabi/xn3ecomelementproxyu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + _ZN19TXnEComElementProxy21CreateImplementationLERK6TDesC8 @ 1 NONAME + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/ecomelement/xnecomelementproxy/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/ecomelement/xnecomelementproxy/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,32 @@ +/* +* 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: Bld.inf file for EcomElementProxy module +* +*/ + + +#include + +PRJ_PLATFORMS + +PRJ_EXPORTS + +PRJ_MMPFILES +xnecomelementproxy.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/ecomelement/xnecomelementproxy/group/xnecomelementproxy.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/ecomelement/xnecomelementproxy/group/xnecomelementproxy.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,55 @@ +/* +* 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: Project makefile for +* +*/ + + +#include + +TARGET xn3ecomelementproxy.dll +CAPABILITY CAP_GENERAL_DLL +TARGETTYPE dll +UID 0x1000008d 0x10207393 + +VENDORID VID_DEFAULT + + +SOURCEPATH ../src +SOURCE xnecomelementproxy.cpp + + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../../../inc +USERINCLUDE ../../xndomvisitor/inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY charconv.lib + +LANG SC + +START WINS + +END + +START MARM + +END + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/ecomelement/xnecomelementproxy/src/xnecomelementproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/ecomelement/xnecomelementproxy/src/xnecomelementproxy.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ +/* +* 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: Entry point for accessing xmluiml language specific element plugins. +* +*/ + + + +// INCLUDE FILES +#include "xnecomelementproxy.h" +#include "utf.h" +#include "xndomvisitor.rh" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// TXnEComElementProxy::CreateImplementationL +// ----------------------------------------------------------------------------- +// +EXPORT_C MXnDomVisitor * TXnEComElementProxy::CreateImplementationL( + const TDesC8& aNS ) + { + TUid dtor={0}; + TUid interfaceUid = {KXnDomVisitorIId}; + // Let's find namespace e.g http://www.series60.com/xml/xmluiml/1 + TEComResolverParams resolverParams; + resolverParams.SetDataType( aNS ); + resolverParams.SetWildcardMatch( ETrue ); + + TAny * ecom = NULL; +#ifdef _DEBUG + TRAPD(err, ecom= REComSession::CreateImplementationL( interfaceUid, dtor, + NULL, resolverParams)); + if( err != KErrNone ) + { + REComSession::FinalClose(); + User::Leave( err ); + } +#else + ecom= REComSession::CreateImplementationL( interfaceUid, dtor, + NULL, resolverParams); +#endif + MXnDomVisitor* element = element = reinterpret_cast(ecom); + element->SetDtorKey( dtor ); + + return element; + } +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,54 @@ +/* +* 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: Master bld.inf which builds all Xuikon Framework's essential +* components, variant dependent initial data, and testing modules. +* +*/ + + +#include + +#include +#include "../inc/xuikon_builds_cfg.hrh" + +// building Xuikon Framework always-needed modules: +#include "../dom/group/bld.inf" +#include "../uiresource/group/bld.inf" +#include "../odt/group/bld.inf" + + +#include "../utils/group/bld.inf" +#include "../renderingplugins/extrenderingplugin/group/bld.inf" +#include "../uiengine/group/bld.inf" +#include "../renderingplugins/xntextfactory/group/bld.inf" +#include "../renderingplugins/xnviewfactory/group/bld.inf" +#include "../renderingplugins/xnbitmapfactory/group/bld.inf" +#include "../renderingplugins/xnmenufactory/group/bld.inf" +#include "../renderingplugins/xnpopupfactory/group/bld.inf" +#include "../renderingplugins/xnnppluginfactory/group/bld.inf" +#include "../renderingplugins/xnclockfactory/group/bld.inf" +#include "../renderingplugins/xnvolumecontrolfactory/group/bld.inf" +#include "../renderingplugins/xnnewstickerfactory/group/bld.inf" +#include "../renderingplugins/xntexteditorfactory/group/bld.inf" +#include "../ecomelement/group/bld.inf" + +PRJ_PLATFORMS + +ARMV5 WINSCW + +PRJ_EXPORTS +../rom/ai3xmluirendering.iby CORE_APP_LAYER_IBY_EXPORT_PATH(ai3xmluirendering.iby) +../rom/ai3xmluirendering_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(ai3xmluirendering_resources.iby) + +PRJ_MMPFILES diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/inc/xntimemon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/inc/xntimemon.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,186 @@ +/* +* 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: ?Description +* +*/ + + + +#ifndef CXN3TIMEMON_H +#define CXN3TIMEMON_H + +// INCLUDES +#include +#include +#include +#include +#include + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +class CXn3TimeMon : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXn3TimeMon * NewL(); + + /** + * Destructor. + */ + virtual ~CXn3TimeMon (); + + public: // New functions + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + inline static TTime StartTiming( const TDesC& aMsg ); + + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + inline static void StopTiming( TTime aStartTime, const TDesC& aMsg ); + + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + inline static void PrintUserMem(const TDesC& aMsg); + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // New functions + + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CXn3TimeMon (); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + // ?one_line_short_description_of_data + //?data_declaration; + // Reserved pointer for future extension + //TAny* iReserved; + + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + + }; + +inline TTime CXn3TimeMon::StartTiming(const TDesC& aMsg ) + { + TTime startTime; + startTime.HomeTime(); + RDebug::Print( aMsg ); + return startTime; + } + +inline void CXn3TimeMon::StopTiming( TTime aStartTime, const TDesC& aMsg ) + { + // calculating service time + TTime readyTime; + readyTime.HomeTime(); + TTimeIntervalMicroSeconds delay = readyTime.MicroSecondsFrom( aStartTime ); + TTime transferTime(delay.Int64()); + TBuf<64> timeString; + transferTime.FormatL(timeString,_L(" Time: %S%C microseconds")); + TBuf<256> tmp; + tmp.Append( aMsg ); + tmp.Append( timeString ); + RDebug::Print( tmp ); + } + +inline void CXn3TimeMon::PrintUserMem(const TDesC& aMsg) + { + TBuf<512> buffer; + TInt freeRAM; + HAL::Get( HALData::EMemoryRAMFree, freeRAM ); + RHeap heap = User::Heap(); + heap.Open(); + TInt _size = heap.Size(); + TInt largest = 0; + TInt available = heap.Available( largest ); + heap.Close(); + _LIT( KMemoryFormat, "FreeRAM: %d kB, User: - heap %d kB, available %d kB, largest block %d kB" ); + buffer.Format( KMemoryFormat, ( freeRAM / 1024), (_size / 1024), + (available / 1024), (largest / 1024 ) ); + + RDebug::Print( _L("Xuikon:RAM:%S: %S"), &aMsg, &buffer ); + } + +#endif // CXN3TIMEMON_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/inc/xuikon_builds_cfg.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/inc/xuikon_builds_cfg.hrh Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,70 @@ +/* +* 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: Build-flags definition file for Xuikon R&D. Should be deleted in product. +* +*/ + + +#ifndef __XUIKON_BUILDS_HRH__ +#define __XUIKON_BUILDS_HRH__ + + +#undef __3D_MENU + + +// Support for theme installation in UiEngine +//#define __XN3_THEME_INSTALLER +#undef __XN3_THEME_INSTALLER + +// _XN3_INTERNAL_ is for Xuikon internal image builds, never defined in official +// builds. The flag controls definition repository file exporting and iby-exporting. + +// Comment/uncomment the next lines (#define _XN3_INTERNAL_) if you are going to build internal/official build. +// The flag presumes that XuikonTestTools are located under Xuikon/internal-folder. +//#define _XN3_INTERNAL_ +#undef _XN3_INTERNAL_ + +// _XN3_DEBUG_ controls Xuikon debug-build. Can be used with internal and external +// builds as an additional build flag. +// Comment/uncomment the next line (#define _XN3_DEBUG_) if you are willing to allow RDebug-prints +// and Xuikon modified MemMon-app included in Xuikon-build. Its in your responsibility if you do so. +//#define _XN3_DEBUG_ +#undef _XN3_DEBUG_ + +// Support for detecting file changes in emulator +#undef _XN3_EMULATOR_SUPPORT_ + +// Flag for performace test instrumentations +//#define _XN3_PERFORMANCE_TEST_ +#undef _XN3_PERFORMANCE_TEST_ + +#ifdef _XN3_DEBUG_ +#define _XN3_PERFORMANCE_TEST_ +#if defined(WINSCW) || defined(__WINS__) //WINSCW for MMP +#define _XN3_EMULATOR_SUPPORT_ +#endif +#endif + +// Comment/uncomment the next line (#define _XN3_SECURITY_NOT_IN_USE_) if you are willing to take access rights +// and validity checks off in Xuikon-build. +//#define _XN3_SECURITY_NOT_IN_USE_ +#undef _XN3_SECURITY_NOT_IN_USE_ + +// using memory chunks in theme load +//#define _XN3_USE_CHUNK_MODE_ + +// using file handle in theme load - default +#undef _XN3_USE_CHUNK_MODE_ + +#endif// __XUIKON_BUILDS_HRH__ diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/odt/bwins/xn3odtu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/odt/bwins/xn3odtu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,7 @@ +EXPORTS + ?DomDocument@CXnODT@@QBEAAVCXnDomDocument@@XZ @ 1 NONAME ; class CXnDomDocument & CXnODT::DomDocument(void) const + ?InternalizeHeaderL@CXnODT@@SAXAAVRReadStream@@@Z @ 2 NONAME ; void CXnODT::InternalizeHeaderL(class RReadStream &) + ?InternalizeDomDocumentL@CXnODT@@QAEPAVCXnDomNode@@AAVRReadStream@@@Z @ 3 NONAME ; class CXnDomNode * CXnODT::InternalizeDomDocumentL(class RReadStream &) + ?NewL@CXnODT@@SAPAV1@XZ @ 4 NONAME ; class CXnODT * CXnODT::NewL(void) + ?InternalizeResourceListL@CXnODT@@SAPAV?$CArrayPtrSeg@VCXnResource@@@@AAVRReadStream@@@Z @ 5 NONAME ; class CArrayPtrSeg * CXnODT::InternalizeResourceListL(class RReadStream &) + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/odt/eabi/xn3odtu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/odt/eabi/xn3odtu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,9 @@ +EXPORTS + _ZN6CXnODT18InternalizeHeaderLER11RReadStream @ 1 NONAME + _ZN6CXnODT23InternalizeDomDocumentLER11RReadStream @ 2 NONAME + _ZN6CXnODT24InternalizeResourceListLER11RReadStream @ 3 NONAME + _ZN6CXnODT4NewLEv @ 4 NONAME + _ZNK6CXnODT11DomDocumentEv @ 5 NONAME + _ZTI6CXnODT @ 6 NONAME ; ## + _ZTV6CXnODT @ 7 NONAME ; ## + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/odt/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/odt/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,34 @@ +/* +* 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: ?Description +* +*/ + + +#include + +PRJ_PLATFORMS +ARMV5 WINSCW + +PRJ_EXPORTS +//Exporting new system headers: + +PRJ_MMPFILES +xnodt.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + +// End of File \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/odt/group/xnodt.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/odt/group/xnodt.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,42 @@ +/* +* 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: MMP-file for XnODT +* +*/ + + +#include + +TARGET xn3odt.dll +TARGETTYPE dll + +SOURCEPATH ../src +SOURCE xnodt.cpp + +USERINCLUDE ../../../inc +USERINCLUDE ../inc + +APP_LAYER_SYSTEMINCLUDE + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY xn3domdocument.lib +LIBRARY xn3resource.lib +LANG SC + +//end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/odt/src/xnodt.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/odt/src/xnodt.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,158 @@ +/* +* 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: Class represents an Object Description Tree of Xuikon. +* +*/ + +#include +#include +#include "xndomdocument.h" +#include "xnresource.h" +#include "xnodt.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnODT::CXnODT +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnODT::CXnODT() + { + } + +// ----------------------------------------------------------------------------- +// CXnODT::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnODT::ConstructL() + { + iDomDocument = CXnDomDocument::NewL(); + } + +// ----------------------------------------------------------------------------- +// CXnODT::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnODT* CXnODT::NewL() + { + CXnODT* self = new( ELeave ) CXnODT; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// Destructor +CXnODT::~CXnODT() + { + delete iDomDocument; + } + +// ----------------------------------------------------------------------------- +// CXnODT::InternalizeHeaderL +// Internalizes the ODT header +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void CXnODT::InternalizeHeaderL( RReadStream& aStream ) + { + // Dummy internalize to support legacy for backward compatibility + + // iAppUid + (void)aStream.ReadUint32L(); + // iProviderUid + (void)aStream.ReadUint32L(); + // iThemeUid + (void)aStream.ReadUint32L(); + + // iProviderName + HBufC::NewLC( aStream, KMaxFileName ); + // iThemeFullName + HBufC::NewLC( aStream, KMaxFileName ); + // iThemeShortName + HBufC::NewLC( aStream, KMaxFileName ); + // iThemeVersion + HBufC::NewLC( aStream, KMaxFileName ); + + CleanupStack::PopAndDestroy( 4 ); + + // iScreenSizeX + (void)aStream.ReadUint32L(); + // iScreenSizeY + (void)aStream.ReadUint32L(); + // iLanguage + (void)aStream.ReadInt32L(); + // iFlags + (void)aStream.ReadUint32L(); + + // consumes header delimiter + (void)aStream.ReadInt16L(); + } + +// ----------------------------------------------------------------------------- +// CXnODT::InternalizeResourceListL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C CArrayPtrSeg< CXnResource >* CXnODT::InternalizeResourceListL( + RReadStream& aStream ) + { + CArrayPtrSeg< CXnResource >* list = + new( ELeave ) CArrayPtrSeg( 4 ); + + CleanupStack::PushL( list ); + + // stream in the resource list + TInt count( aStream.ReadInt32L() ); + + for ( TInt i = 0; i < count; i++ ) + { + CXnResource* resource = CXnResource::NewL(); + CleanupStack::PushL( resource ); + + resource->InternalizeL( aStream ); + + list->AppendL( resource ); + CleanupStack::Pop( resource ); // now owned by array + } + + CleanupStack::Pop( list ); + + return list; + } + +// ----------------------------------------------------------------------------- +// CXnODT::InternalizeDomDocumentL +// Internalizes the ODT with shared document +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C CXnDomNode* CXnODT::InternalizeDomDocumentL( RReadStream& aStream ) + { + return ( iDomDocument->ReadL( aStream ) ); + } + +// ----------------------------------------------------------------------------- +// CXnODT::DomDocument +// Get DomDocument +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomDocument& CXnODT::DomDocument() const + { + return *iDomDocument; + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/bwins/extrenderingplugin.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/bwins/extrenderingplugin.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,10 @@ +EXPORTS + ?SizeChanged@CXnExtRenderingPluginAdapter@@UAEXXZ @ 1 NONAME ; void CXnExtRenderingPluginAdapter::SizeChanged(void) + ?NewL@CXnExtRenderingPluginAdapter@@SAPAV1@VTUid@@@Z @ 2 NONAME ; class CXnExtRenderingPluginAdapter * CXnExtRenderingPluginAdapter::NewL(class TUid) + ?ExitPowerSaveModeL@CXnExtRenderingPluginAdapter@@UAEXXZ @ 3 NONAME ; void CXnExtRenderingPluginAdapter::ExitPowerSaveModeL(void) + ?FocusChanged@CXnExtRenderingPluginAdapter@@UAEXW4TDrawNow@@@Z @ 4 NONAME ; void CXnExtRenderingPluginAdapter::FocusChanged(enum TDrawNow) + ?SkinChanged@CXnExtRenderingPluginAdapter@@UAEXXZ @ 5 NONAME ; void CXnExtRenderingPluginAdapter::SkinChanged(void) + ?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) + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/eabi/extrenderingplugin.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/eabi/extrenderingplugin.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,14 @@ +EXPORTS + _ZN28CXnExtRenderingPluginAdapter11SizeChangedEv @ 1 NONAME + _ZN28CXnExtRenderingPluginAdapter11SkinChangedEv @ 2 NONAME + _ZN28CXnExtRenderingPluginAdapter12FocusChangedE8TDrawNow @ 3 NONAME + _ZN28CXnExtRenderingPluginAdapter18ExitPowerSaveModeLEv @ 4 NONAME + _ZN28CXnExtRenderingPluginAdapter19EnterPowerSaveModeLEv @ 5 NONAME + _ZN28CXnExtRenderingPluginAdapter4NewLE4TUid @ 6 NONAME + _ZN28CXnExtRenderingPluginAdapterD0Ev @ 7 NONAME + _ZN28CXnExtRenderingPluginAdapterD1Ev @ 8 NONAME + _ZN28CXnExtRenderingPluginAdapterD2Ev @ 9 NONAME + _ZNK28CXnExtRenderingPluginAdapter7ImplUidEv @ 10 NONAME + _ZTI28CXnExtRenderingPluginAdapter @ 11 NONAME + _ZTV28CXnExtRenderingPluginAdapter @ 12 NONAME + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: External rendering plugin bld file +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +extrenderingplugin.mmp diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/group/extrenderingplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/group/extrenderingplugin.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,68 @@ +/* +* 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: external rendering plugin project file +* +*/ + +#include + + +TARGET extrenderingplugin.dll +TARGETTYPE dll + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +USERINCLUDE ../inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src + +SOURCE xnextrenderingpluginadapter.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), +//the GCC ARM def file in a BMARM directory, and the ARMV5 def file in a EABI directory. +//If def files are stored in these locations, the project files does not need to specify +//the location of the def files explicitly. If you want to store the def files in some other +//location, you will need to specify in the project file where the .def files are using +//the deffile keyword. + +//The following commented out code shows how the build system uses the implicit +// location for defiles. To create the DEF files Choose Project > Freeze Exports from Carbide +// or run 'abld freeze' from the command-line +//#if defined (WINS) +// DEFFILE ../bwins/extrenderingplugin.def +//#elif defined (GCC32) +// DEFFILE ../bmarm/extrenderingplugin.def +//#else +// DEFFILE ../eabi/extrenderingplugin.def +//#endif + +nostrictdef + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY ecom.lib +LIBRARY charconv.lib +LIBRARY cone.lib + +LANG SC + +#ifdef ENABLE_ABIV2_MODE +DEBUGGABLE +#endif + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/src/xnextrenderingpluginadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/extrenderingplugin/src/xnextrenderingpluginadapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,109 @@ +/* +* 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: External rendering plugin adapter base class implementation +* +*/ + +// System include files +#include +#include +#include + +// Local constants + +// TODO: Content controller ECom interface UID +const TUid KInterfaceUidContentController = { 0x20026F51 }; + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginAdapter::NewL() +// ---------------------------------------------------------------------------- +// +EXPORT_C CXnExtRenderingPluginAdapter* CXnExtRenderingPluginAdapter::NewL( TUid aImplUid ) + { + TAny* ptr = REComSession::CreateImplementationL( aImplUid, + _FOFF( CXnExtRenderingPluginAdapter, iDestructKey ) ); + + CXnExtRenderingPluginAdapter* adapter = + reinterpret_cast< CXnExtRenderingPluginAdapter* >( ptr ); + + if( adapter ) + { + adapter->iImplUid = aImplUid; + } + + return adapter; + } + +// ----------------------------------------------------------------------- +// CXnExtRenderingPluginAdapter::ImplUid() +// ----------------------------------------------------------------------- +// +EXPORT_C TUid CXnExtRenderingPluginAdapter::ImplUid() const + { + return iImplUid; + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginAdapter::~CXnExtRenderingPluginAdapter() +// ---------------------------------------------------------------------------- +// +EXPORT_C CXnExtRenderingPluginAdapter::~CXnExtRenderingPluginAdapter() + { + REComSession::DestroyedImplementation( iDestructKey ); + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginAdapter::EnterPowerSaveModeL() +// ---------------------------------------------------------------------------- +// +EXPORT_C void CXnExtRenderingPluginAdapter::EnterPowerSaveModeL() + { + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginAdapter::ExitPowerSaveModeL() +// ---------------------------------------------------------------------------- +// +EXPORT_C void CXnExtRenderingPluginAdapter::ExitPowerSaveModeL() + { + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginAdapter::SkinChanged() +// ---------------------------------------------------------------------------- +// +EXPORT_C void CXnExtRenderingPluginAdapter::SkinChanged() + { + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginAdapter::FocusChanged() +// ---------------------------------------------------------------------------- +// +EXPORT_C void CXnExtRenderingPluginAdapter::FocusChanged( TDrawNow /*aDrawNow*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginAdapter::SizeChanged() +// ---------------------------------------------------------------------------- +// +EXPORT_C void CXnExtRenderingPluginAdapter::SizeChanged() + { + } + + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Building information file +* +*/ + + +#include + +PRJ_PLATFORMS + +ARMV5 WINSCW + +PRJ_EXPORTS + +PRJ_MMPFILES + +xnbitmapfactory.mmp diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/group/xnbitmapfactory.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/group/xnbitmapfactory.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Xuikon Bitmap plugin. +* +*/ + + +#include +#include + +TARGET xn3bitmapfactory.dll +TARGETTYPE PLUGIN +UID 0x10009d8d AI3_UID_RENDERING_PLUGIN_BITMAPFACTORY + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE xnbitmapfactory.cpp +SOURCE xnbitmap.cpp +SOURCE xnbitmapadapter.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY xn3layoutengine.lib +LIBRARY xn3utils.lib +LIBRARY avkon.lib + +LANG SC + +START RESOURCE xn3bitmapfactory.rss +#ifdef SYMBIAN_SECURE_ECOM +TARGET xn3bitmapfactory.rsc +#endif +END diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/inc/xnbitmapadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/inc/xnbitmapadapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implements Xuikon image component. +* +*/ + + + +#ifndef _XNBITMAPADAPTER_H +#define _XNBITMAPADAPTER_H + +// INCLUDES +#include "xncontroladapter.h" + + +// FORWARD DECLARATIONS +class CXnNodePluginIf; + +// CLASS DECLARATION +/** +* @ingroup group_xnbitmapfactory +* @lib xn3bitmapfactory.dll +* @since Series 60 3.1 +*/ +class CXnBitmapAdapter : public CXnControlAdapter + { +public: + /** + * 2 phase construction. + */ + static CXnBitmapAdapter* NewL(CXnNodePluginIf& aNode); + + /** + * Destructor. + */ + virtual ~CXnBitmapAdapter(); + + +public: // New functions + /** + * Sets content bitmaps. Ownership is transferred. + * @since Series 60 3.1 + * @param aBitmap Bitmap to draw + * @param aMask Mask to use + */ + void SetContentBitmaps(CFbsBitmap* aBitmap, CFbsBitmap* aMask); + + /** + * Gets content bitmaps. Ownership not is transferred. + * @since Series 60 3.1 + * @param aBitmap Bitmap to draw + * @param aMask Mask to use + */ + void ContentBitmaps(CFbsBitmap*& aBitmap, CFbsBitmap*& aMask); + +public: // From Base classes + /** + * From CXnControlAdapter Handles the property changes. + * @since Series 60 3.1 + * @return void. + */ + void DoHandlePropertyChangeL(CXnProperty* aProperty = NULL); + + /** + * From CCoeControl Handles the resource change. + * @since Series 60 3.1 + * @param aType A type of the resource change + * @return void. + */ + void HandleScreenDeviceChangedL(); + + /** + * See CCoeControl documentation + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + /** + * From CCoeControl Handles the skin change + * @since Series 60 3.2 + * @return void. + */ + void SkinChanged(); + +protected: + /** + * Size change notification + */ + void SizeChanged(); + void Draw(const TRect& aRect) const; + +private: + CXnBitmapAdapter(CXnNodePluginIf& aNode); + void ConstructL(CXnNodePluginIf& aNode); + + void InitializeBitmapsL(); +private: // Data + // UI node, not owned + CXnNodePluginIf& iNode; + // Whether the bitmaps has been loaded or not. + mutable TBool iAreBitmapsLoaded; + // Whether the data API has been used or not. + TBool iAreBitmapsSet; + // Path of the bitmap + HBufC* iPath; + // The size of the current bitmap + TSize iBitmapSize; + // The path of the fallback image + HBufC* iFallbackPath; + // Whether fallback path has changed and bitmaps need to be reloaded + TBool iFallbackPathChange; + }; + + + +#endif // XNBITMAPADAPTER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/inc/xnbitmapfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/inc/xnbitmapfactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Factory for creating CXnBitmap -component +* +*/ + + + +#ifndef _XNBITMAPFACTORY_H +#define _XNBITMAPFACTORY_H + +// INCLUDES +#include "xncomponentfactory.h" +#include +#include + +#include +#include + +// FORWARD DECLARATIONS +class CXnComponent; +class CXnMap; +class CXnType; + +// CLASS DECLARATION + +/** +* @ingroup group_xnbitmapfactory +* Layout Area UI factory interface for creating UI representations of the layout areas. +* This class is wrapper for containing CBitmap +* +* @lib xn3bitmapfactory.dll +* @since Series 60 3.1 +*/ +// inheritance order must be this, despite codescanner warnings +class CXnBitmapFactory : public MXnComponentFactory, public CBase + { + public: // Data types + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnBitmapFactory* NewL(); + + /** + * Destructor. + */ + virtual ~CXnBitmapFactory(); + + public: // Functions from base classes + + /** + * @see MXnComponentFactory.h + */ + TXnComponentFactoryResponse MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent + ); + + /** + * @see MXnComponentFactory.h + */ + CXnControlAdapter* MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent = NULL + ); + + private: + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CXnBitmapFactory(); + }; + +// Exported factory function required by ECOM-framework +IMPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount); + +#endif // _XNBITMAPFACTORY_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/src/xn3bitmapfactory.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/src/xn3bitmapfactory.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// 102073FE.RSS +// +#include +#include + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = AI3_UID_RENDERING_PLUGIN_BITMAPFACTORY; +interfaces = + { + INTERFACE_INFO + { + interface_uid = AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI3_UID_RENDERING_PLUGIN_BITMAPFACTORY_IMPLEMENTATION; + version_no = 1; + display_name = "XnImage"; + default_data = "image"; + opaque_data = ""; + } + }; + } + }; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/src/xnbitmap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/src/xnbitmap.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Xuikon Bitmap component. +* +*/ + + + +#include "xnbitmap.h" +#include "xnbitmapadapter.h" +// ============================ MEMBER FUNCTIONS =============================== + + + + +// ----------------------------------------------------------------------------- +// CXnBitmap::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnBitmap* CXnBitmap::NewL() + { + CXnBitmap* self = new( ELeave ) CXnBitmap; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnBitmap::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnBitmap::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnBitmap::CXnBitmap +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnBitmap::CXnBitmap() + { + } + +// ----------------------------------------------------------------------------- +// CXnBitmap::~CXnBitmap +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnBitmap::~CXnBitmap() + { + } + +// ----------------------------------------------------------------------------- +// CXnBitmap::SetContentBitmaps +// ----------------------------------------------------------------------------- +// +void CXnBitmap::SetContentBitmaps(CFbsBitmap* aBitmap, CFbsBitmap* aMask) + { + (static_cast(ControlAdapter()))->SetContentBitmaps(aBitmap, aMask); + } + +// ----------------------------------------------------------------------------- +// CXnBitmap::ContentBitmaps +// ----------------------------------------------------------------------------- +// +void CXnBitmap::ContentBitmaps(CFbsBitmap*& aBitmap, CFbsBitmap*& aMask) + { + (static_cast(ControlAdapter()))->ContentBitmaps(aBitmap, aMask); + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +XnComponentInterface::MXnComponentInterface* CXnBitmap::MakeInterfaceL(const TDesC8& aType) + { + if (aType != XnImageInterface::KType) + { + return NULL; + } + XnImageInterface::MXnImageInterface* imgintr = static_cast(this); + return imgintr; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/src/xnbitmapadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/src/xnbitmapadapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,297 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Xuikon Bitmap Plugin. +* +*/ + + +#include "xnnodepluginif.h" +#include "xndomproperty.h" +#include "xnproperty.h" +#include "xncontroladapter.h" + +#include "xnbitmapadapter.h" + +_LIT(KSkin, "skin("); + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnBitmapAdapter::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnBitmapAdapter* CXnBitmapAdapter::NewL(CXnNodePluginIf& aNode) + { + CXnBitmapAdapter* self = new( ELeave ) CXnBitmapAdapter( aNode ); + + CleanupStack::PushL( self ); + self->ConstructL( aNode ); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnBitmapAdapter::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnBitmapAdapter::ConstructL(CXnNodePluginIf& aNode) + { + CXnControlAdapter::ConstructL( aNode ); + + iAreBitmapsLoaded = EFalse; + + iFallbackPathChange = ETrue; + } + +// ----------------------------------------------------------------------------- +// CXnBitmapAdapter::CXnBitmapAdapter +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnBitmapAdapter::CXnBitmapAdapter(CXnNodePluginIf& aNode) : iNode( aNode ) + { + } + +// ----------------------------------------------------------------------------- +// CXnBitmapAdapter::~CXnBitmapAdapter +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnBitmapAdapter::~CXnBitmapAdapter() + { + delete iPath; + delete iFallbackPath; + } + +// ----------------------------------------------------------------------------- +// CXnBitmapAdapter::SetContentBitmaps +// ----------------------------------------------------------------------------- +// +void CXnBitmapAdapter::SetContentBitmaps(CFbsBitmap* aBitmap, CFbsBitmap* aMask) + { + CXnControlAdapter::SetContentBitmaps( aBitmap, aMask ); + + iAreBitmapsSet = ETrue; + + TRAP_IGNORE( iNode.SetDirtyL() ); + } + +// ----------------------------------------------------------------------------- +// CXnBitmapAdapter::ContentBitmaps +// ----------------------------------------------------------------------------- +// +void CXnBitmapAdapter::ContentBitmaps(CFbsBitmap*& aBitmap, CFbsBitmap*& aMask) + { + CXnControlAdapter::ContentBitmaps( aBitmap, aMask ); + } + +// ----------------------------------------------------------------------------- +// CXnBitmapAdapter::Draw +// ----------------------------------------------------------------------------- +// +void CXnBitmapAdapter::Draw(const TRect& aRect) const + { + CXnControlAdapter::Draw( aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnBitmapAdapter::SizeChanged +// ----------------------------------------------------------------------------- +// +void CXnBitmapAdapter::SizeChanged() + { + CXnControlAdapter::SizeChanged(); + + if ( !iAreBitmapsSet ) + { + TSize size( Rect().Size() ); + + if( size != iBitmapSize ) + { + iBitmapSize = size; + + iAreBitmapsLoaded = EFalse; + + TRAP_IGNORE( InitializeBitmapsL() ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnBitmapAdapter::HandlePropertyChangeL +// ----------------------------------------------------------------------------- +// +void CXnBitmapAdapter::DoHandlePropertyChangeL( CXnProperty* aProperty ) + { + TBool reConstruct( ETrue ); + + if( aProperty ) + { + const TDesC8& name( aProperty->Property()->Name( ) ); + + //If display changed no need to reconstruct + if( name == XnPropertyNames::style::common::KDisplay( ) ) + { + reConstruct = EFalse; + } + // Visibility changed, no need to do anything. + else if( name == XnPropertyNames::style::common::KVisibility( ) ) + { + return; + } + else if( name == XnPropertyNames::appearance::common::KFallBackImage ) + { + HBufC* fallbackPath( aProperty->StringValueL( ) ); + + if( fallbackPath ) + { + CleanupStack::PushL( fallbackPath ); + + if( iFallbackPath ) + { + if( ( *fallbackPath ).Compare( *iFallbackPath ) ) + { + delete iFallbackPath; + iFallbackPath = NULL; + iFallbackPath = fallbackPath->AllocL( ); + iFallbackPathChange = ETrue; + } + } + else + { + iFallbackPath = fallbackPath->AllocL( ); + iFallbackPathChange = ETrue; + } + + CleanupStack::PopAndDestroy( fallbackPath ); + } + } + } + + //If data API has been used don't load new bitmaps. + if( !iAreBitmapsSet && reConstruct ) + { + InitializeBitmapsL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::HandleResourceChange +// ----------------------------------------------------------------------------- +// +void CXnBitmapAdapter::HandleScreenDeviceChangedL( ) + { + CXnControlAdapter::HandleScreenDeviceChangedL(); + } + +// ----------------------------------------------------------------------------- +// CXnBitmapAdapter::HandlePointerEventL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnBitmapAdapter::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + CXnControlAdapter::HandlePointerEventL( aPointerEvent ); + } + +// ----------------------------------------------------------------------------- +// CXnBitmapAdapter::SkinChanged +// ----------------------------------------------------------------------------- +// +void CXnBitmapAdapter::SkinChanged() + { + CXnControlAdapter::SkinChanged(); + + if( iPath ) + { + TInt pos( iPath->FindF( KSkin ) ); + + if( pos != KErrNotFound ) + { + iBitmapSize = Rect().Size(); + + iAreBitmapsLoaded = EFalse; + + TRAP_IGNORE( InitializeBitmapsL() ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnBitmapAdapter::InitializeBitmapsL +// ----------------------------------------------------------------------------- +// +void CXnBitmapAdapter::InitializeBitmapsL( ) + { + TBool pathChanged( EFalse ); + + CXnProperty* pathProperty( iNode.PathL( ) ); + CXnProperty* maskPathProperty( iNode.MaskPathL( ) ); + + if ( !pathProperty ) + { + return; + } + + HBufC* path( pathProperty->StringValueL( ) ); + + if( !path ) + { + return; + } + + CleanupStack::PushL( path ); + + HBufC* maskPath( NULL ); + + if( maskPathProperty ) + { + maskPath = maskPathProperty->StringValueL( ); + } + + CleanupStack::PushL( maskPath ); + + if( !iPath ) + { + iPath = path->AllocL( ); + } + + if( path->Des( ) != iPath->Des( ) ) + { + pathChanged = ETrue; + } + + if( !iAreBitmapsLoaded || pathChanged || iFallbackPathChange ) + { + delete iPath; + iPath = NULL; + iPath = path->AllocL( ); + + CXnControlAdapter::SetContentBitmaps( *path, ( maskPath ) + ? maskPath->Des( ) : KNullDesC() ); + + iAreBitmapsLoaded = ETrue; + iFallbackPathChange = EFalse; + + iNode.SetDirtyL(); + } + + CleanupStack::PopAndDestroy( 2, path ); + } + +// End of File + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/src/xnbitmapfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/src/xnbitmapfactory.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for factory creating container for Active Idle plugins. +* +*/ + + +#include +#include +#include +#include "xntype.h" +#include "xncomponent.h" +#include "xnnodepluginif.h" + +#include "xnbitmapfactory.h" +#include "xnbitmapadapter.h" + +#include "xnbitmap.h" +#include + +// ============================ MEMBER FUNCTIONS =============================== + + +_LIT8(KXnBitmap, "image"); +// ----------------------------------------------------------------------------- +// CXnBitmaplFactory::MakeXnComponentL +// ----------------------------------------------------------------------------- +// + +MXnComponentFactory::TXnComponentFactoryResponse CXnBitmapFactory::MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent + ) + { + MXnComponentFactory::TXnComponentFactoryResponse retVal = MXnComponentFactory::EXnFactoryResponseComponentNotSupported; + // Check that the given type of a control is parent (or ancestor) of this control + if (aNode.Type()->Type() == KXnBitmap) + { + aTargetComponent = CXnBitmap::NewL(); + retVal = MXnComponentFactory::EXnFactoryResponseComponentConstructed; + } + return retVal; + } + +// ----------------------------------------------------------------------------- +// CXnBitmaplFactory::MakeXnControlAdapterL +// ----------------------------------------------------------------------------- +// + +CXnControlAdapter* CXnBitmapFactory::MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* /*aParent*/ + ) + { + return CXnBitmapAdapter::NewL(aNode); + } + + +// ----------------------------------------------------------------------------- +// CXnBitmaplFactory::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnBitmapFactory* CXnBitmapFactory::NewL() + { + CXnBitmapFactory* self = new( ELeave ) CXnBitmapFactory; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnBitmapFactory::CXnBitmapFactory +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnBitmapFactory::CXnBitmapFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnBitmapFactory::~CXnBitmapFactory +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnBitmapFactory::~CXnBitmapFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnBitmapFactory::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnBitmapFactory::ConstructL() + { + } + + +// Define the interface UIDs +const TImplementationProxy ImplementationTable[] = + { + #ifdef __EABI__ + IMPLEMENTATION_PROXY_ENTRY(AI3_UID_RENDERING_PLUGIN_BITMAPFACTORY_IMPLEMENTATION, CXnBitmapFactory::NewL) + #else + {{AI3_UID_RENDERING_PLUGIN_BITMAPFACTORY_IMPLEMENTATION}, CXnBitmapFactory::NewL} + #endif + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* 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: Building information file +'* +*/ + + +#include + +PRJ_PLATFORMS + +ARMV5 WINSCW + + +PRJ_EXPORTS + +PRJ_MMPFILES + +xnclockfactory.mmp diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/group/xnclockfactory.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/group/xnclockfactory.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,62 @@ +/* +* 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: Xuikon clock plugin +* +*/ + + +#include +#include + +TARGET xn3clockfactory.dll +TARGETTYPE PLUGIN +UID 0x10009d8d AI3_UID_RENDERING_PLUGIN_CLOCKFACTORY + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE xnclockfactory.cpp +SOURCE xnclock.cpp +SOURCE xnclockadapter.cpp +SOURCE xnclockcontrol.cpp +SOURCE xnclockface.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY eikcoctl.lib +LIBRARY cone.lib +LIBRARY xn3layoutengine.lib +LIBRARY xn3utils.lib +LIBRARY xn3domdocument.lib +LIBRARY avkon.lib +LIBRARY cenrepnotifhandler.lib +LIBRARY aknskins.lib +LIBRARY aknicon.lib +LIBRARY fbscli.lib +LIBRARY gdi.lib + +LANG SC + +START RESOURCE xn3clockfactory.rss +#ifdef SYMBIAN_SECURE_ECOM +TARGET xn3clockfactory.rsc +#endif +END + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockadapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,186 @@ +/* +* 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: Wrapper class for CAknSkinnableClock +* +*/ + + + +#ifndef _XNCLOCKADAPTER_H +#define _XNCLOCKADAPTER_H + +// INCLUDES +#include "xncontroladapter.h" +#include + +// FORWARD DECLARATIONS +class CXnNodePluginIf; +class CXnClockControl; +class CAknLayoutFont; +class CFont; +class TRgb; + +// CLASS DECLARATION +/** +* @ingroup group_xnclockfactory +* @lib xnclockfactory.lib +* @since S60 +*/ +class CXnClockAdapter : public CXnControlAdapter, + public MCoeMessageMonitorObserver + { +public: + enum TClockFont + { + EDigitalFont, + EAmPmFont, + EDateFont + }; + +public: // constructor and destructor + /** + * 2 phase construction. + */ + static CXnClockAdapter* NewL( CXnControlAdapter* aParent, CXnNodePluginIf& aNode ); + + /** + * Destructor. + */ + ~CXnClockAdapter(); + +public: // New functions + + /** + * Gets font based on type + * + * @return Font based on aType, NULL if not found + */ + const CAknLayoutFont* FontL( const TInt aType ); + + /** + * Gets text color + * + * @return Text color + */ + const TRgb& TextColorL(); + + /** + * Gets date information + * + * @return A node which holds date information + */ + CXnNodePluginIf* Date() const; + + /** + * Gets day information + * + * @return A node which holds day information + */ + CXnNodePluginIf* Day() const; + + /** + * Calls DrawNow, if node is laidout + */ + void UpdateDisplay() const; + +public: // from base classes + + /** + * @see CXnControlAdapter documentation + */ + void DoHandlePropertyChangeL( CXnProperty* aProperty = NULL ); + + /* + * @see CXnControlAdapter documentation + */ + void SkinChanged(); + + /* + * @see CXnControlAdapter documentation + */ + void HandleScreenDeviceChangedL(); + + /* + * @see CCoeControl documentation + */ + void SizeChanged(); + + /** + * @see CCoeControl documentation + */ + void Draw( const TRect& aRect ) const; + + /** + * @see CCoeControl documentation + */ + void MakeVisible( TBool aVisible ); + +private: // from MCoeMessageMonitorObserver + /** + * @see MCoeMessageMonitorObserver documentation + */ + void MonitorWsMessage( const TWsEvent& aEvent ); + +private: // constructors + + /** + * C++ default constructor. + */ + CXnClockAdapter( CXnControlAdapter* aParent, CXnNodePluginIf& aNode ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + +private: // New functions + + /* + * Create font + */ + void CreateFontL( const TInt aType ); + + /* + * Create color + */ + void CreateColorL(); + +private: + // Parent control, not owned + CXnControlAdapter* iParent; + // UI node, not owned + CXnNodePluginIf& iNode; + // Digital clock date information, not owned + CXnNodePluginIf* iDate; + // Analog clock day information, not owned + CXnNodePluginIf* iDay; + // Clock control, owned + CXnClockControl* iClockControl; + // Digital clock font, not owned + CFont* iDigitalFont; + // AmPm font, not owned + CFont* iAmPmFont; + // Date font, not owned + CFont* iDateFont; + // Font color + TRgb iColor; + // Flag for initializing font color + TBool iColorSet; + // Flag indicating foreground state + TBool iForeground; + }; + +#endif // _XNCLOCKADAPTER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockcontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockcontrol.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2006-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: Control for xuikon's skinnable clock. +* +*/ + + +#ifndef _XNCLOCKCONTROL_H +#define _XNCLOCKCONTROL_H + +// INCLUDES + +// FORWARD DECLARATIONS +class CWindowGc; +class CXnClockAdapter; +class CXnClockChangeHandler; +class CXnClockFace; + +// CLASS DECLARATION +/** +* @ingroup group_xnclockfactory +* @lib xnclockfactory.lib +* @since S60 +*/ +class CXnClockControl : public CBase + { +public: // Constructors and destructor + + /** + * Two-phased constructor. + * + * @since S60 5.1 + * + * @param aContainerWindow Container window for the clock component. + * + * @param aFormatFromLocale Boolean flag to indicate whether the clock + * format should be updated from the locale. + * + * @param aContextPaneClock Boolean flag that indicates whether the + * clock is in the context pane. + * + * @return Newly constructed object. + */ + static CXnClockControl* NewL( CXnClockAdapter* aAdapter, + const TBool aFormatFromLocale, + const TClockFormat aFormat ); + + + /** + * Destructor. + */ + virtual ~CXnClockControl(); + +public: // New functions + + /** + * Updates the double buffer and redraws the clock. + */ + void UpdateDisplay(); + + /** + * Sets the format of the clock. + * + * @param aFormatFromLocale Wheter clock is getting format from locale + * @param aFormat New clock format. + */ + void SetFormatL( const TBool aFormatFromLocale, + const TClockFormat aFormat ); + + /** + * Gets the clock format + * + * @return Clock format. + */ + TClockFormat Format() const; + + /** + * Updates time and locale state of the clock. + */ + void TimeOrLocaleChanged(); + + /** + * Draws the clock + * + * @param aGc Context where to draw + * @param aRect Rect Clock rect + */ + void Draw( CWindowGc& aGc, const TRect& aRect ) const; + + /** + * Starts the clock timer. + * Used when the clock gains visibility. + */ + void StartTimer(); + + /** + * Stops the clock timer. + * Used when the clock loses visibility. + */ + void StopTimer(); + +private: // New functions + + /** + * Timer callback for clock updates + * + * @param aThis Pointer to the skinnable clock instance. + * + * @return Always returns @c KErrNone. + */ + static TInt TimerCallback( TAny* aThis ); + +private: + + /** + * C++ default constructor. + */ + CXnClockControl( CXnClockAdapter* aAdapter, + const TBool aFormatFromLocale, + const TClockFormat aFormat ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + +private: // data + + // Timer, owned + CPeriodic* iTimer; + // Clock face, owned + CXnClockFace* iFace; + // Clock change handler, owned + CXnClockChangeHandler* iHandler; + // Clock adapter, not owned + CXnClockAdapter* iAdapter; + // Clock format + TClockFormat iClockFormat; + // Flag indicating whetger format clock from locale + TBool iFormatFromLocale; + }; + +#endif // _XNCLOCKCONTROL_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockface.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,161 @@ +/* +* Copyright (c) 2002-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: Xuikon clock face. +* +*/ + + +#ifndef _XNCLOCKFACE_H +#define _XNCLOCKFACE_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CXnClockAdapter; +class CWindowGc; + +// CLASS DECLARATIONS +/** +* @ingroup group_xnclockfactory +* @lib xnclockfactory.lib +* @since S60 +*/ +class CXnClockFace : public CBase + { + public: // Destructor + + /** + * Destructor. + */ + virtual inline ~CXnClockFace() {}; + + public: // New methods + + /** + * Draws the given time to the given buffer bitmap. + * + * @since S60 5.1 + * + * @param aAdapter Clock adapter + * + * @param aGc Graphics context that can be used to draw to + * the clock + * + * @param aRect Rect where to scale the clock + * + * @param aTime Time to be used for drawing. + */ + virtual void DrawL( CXnClockAdapter& aAdapter, + CWindowGc& aGc, + const TRect& aRect, + const TTime& aTime ) = 0; + }; + +class CXnClockFaceDigital : public CXnClockFace + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnClockFaceDigital* NewL(); + + /** + * Destructor. + */ + virtual ~CXnClockFaceDigital(); + + public: // Functions from CXnClockFace + + /** + * @see CXnClockFace::DrawL + */ + void DrawL( CXnClockAdapter& aAdapter, + CWindowGc& aGc, + const TRect& aRect, + const TTime& aTime ); + + private: + + /** + * C++ default constructor. + */ + CXnClockFaceDigital(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + }; + +class CXnClockFaceAnalog : public CXnClockFace + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnClockFaceAnalog* NewL(); + + /** + * Destructor. + */ + virtual ~CXnClockFaceAnalog(); + + public: // Functions from CXnClockFace + + /** + * @see CXnClockFace::DrawL + */ + void DrawL( CXnClockAdapter& aAdapter, + CWindowGc& aGc, + const TRect& aRect, + const TTime& aTime ); + + private: // New functions + + /** + * Draws the hands of the clock. + * + * @param aGc Graphics context that can be used to draw to the + * clock + * + * @param aRect Rectangle defining the size of the clock. + * + * @param aDateTime Time to be used for drawing. + */ + void DrawHandsL( CWindowGc& aGc, const TRect& aRect, + const TDateTime& aDateTime ); + + private: + + /** + * C++ default constructor. + */ + CXnClockFaceAnalog(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + }; + +#endif // _XNCLOCKFACE_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockfactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,104 @@ +/* +* 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: Factory for creating CXnClock -component +* +*/ + + + +#ifndef _XNCLOCKFACTORY_H +#define _XNCLOCKFACTORY_H + +// INCLUDES +#include "xncomponentfactory.h" +#include +#include + +#include +#include + + +// FORWARD DECLARATIONS +class CXnComponent; + +// CLASS DECLARATION + +/** +* @ingroup group_xnclockfactory +* +* Component factory interface for creating UI representations of the elements. +* This class is wrapper for containing CAknSkinnableClock +* +* @lib xnclockfactory.lib +* @since S60 +*/ +// inheritance order must be this, despite codescanner warnings +class CXnClockFactory : public MXnComponentFactory, public CBase + { + public: // Data types + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnClockFactory* NewL(); + + /** + * Destructor. + */ + virtual ~CXnClockFactory(); + + + public: // Functions from base classes + + /** + * Creates the Xuikon component for clock component. + * @param aNode Corresponding DOM-node + * @param aTargetComponent Pointer reference to the component to be created. + */ + virtual TXnComponentFactoryResponse MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent + ); + + /** + * Creates the control adapter for clock component. + * @param aNode Corresponding DOM-node + */ + virtual CXnControlAdapter* MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent + ); + + private: + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CXnClockFactory(); + + }; + +// Exported factory function required by ECOM-framework +IMPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount); + +#endif // _XNCLOCKFACTORY_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xn3clockfactory.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xn3clockfactory.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,44 @@ +/* +* 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: +* +*/ +// xn3clockfactory.RSS +// +#include +#include + + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = AI3_UID_RENDERING_PLUGIN_CLOCKFACTORY; +interfaces = + { + INTERFACE_INFO + { + interface_uid = AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI3_UID_RENDERING_PLUGIN_CLOCKFACTORY_IMPLEMENTATION; + version_no = 1; + display_name = "XnClock"; + default_data = "clock"; + opaque_data = ""; + } + }; + } + }; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclock.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,86 @@ +/* +* 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: Implementation wrapper for CAknSkinnableClock +* +*/ + + +#include +#include +#include +#include "xncomponent.h" +#include "xnclock.h" +#include "xnclockadapter.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnClock::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnClock* CXnClock::NewL() + { + CXnClock* self = new( ELeave ) CXnClock; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnClock::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnClock::ConstructL() + { + CXnComponent::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// CXnClock::ConstructL +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnClock::CXnClock() + { + } + +// ----------------------------------------------------------------------------- +// CXnClock::ConstructL +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnClock::~CXnClock() + { + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +XnComponentInterface::MXnComponentInterface* CXnClock::MakeInterfaceL(const TDesC8& aType) + { + if( aType != XnClockInterface::KType ) + { + return NULL; + } + + XnClockInterface::MXnClockInterface* clockIf = static_cast< XnClockInterface::MXnClockInterface* >( this ); + + return clockIf; + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockadapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,555 @@ +/* +* 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: Implementation wrapper for CAknSkinnableClock +* +*/ + +// SYSTEM INCLUDE FILES +#include +#include +#include +#include + +// USER INCLUDE FILES +#include "xndomproperty.h" +#include "xndomlist.h" +#include "xnproperty.h" +#include "xntype.h" +#include "xnuienginepluginif.h" +#include "xnnodepluginif.h" +#include "xncontroladapter.h" +#include "xnclockcontrol.h" +#include "xnclockadapter.h" +#include "c_xnutils.h" + +// CONSTANTS +_LIT8( KDateInformation, "Clock/DateInformation" ); +_LIT8( KDayInformation, "Clock/DayInformation" ); + +_LIT( KDigitalFont, "EAknLogicalFontDigitalFont" ); +_LIT( KAmPmFont, "EAknLogicalFontSecondaryFont" ); +_LIT( KDateFont, "EAknLogicalFontSecondaryFont" ); + +// ============================ LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ClockFormat +// Resolves the clock format +// ----------------------------------------------------------------------------- +// +static TClockFormat ClockFormat( CXnProperty* aProperty, TBool& aUseLocale ) + { + // Default, from locale + TClockFormat format( TLocale().ClockFormat() ); + + aUseLocale = ETrue; + + if( aProperty ) + { + const TDesC8& name( aProperty->Property()->Name() ); + + if( name == XnPropertyNames::clock::KS60Format ) + { + const TDesC8& value( aProperty->StringValue() ); + + if( value == XnPropertyNames::clock::format::KDigital ) + { + format = EClockDigital; + aUseLocale = EFalse; + } + else if( value == XnPropertyNames::clock::format::KAnalog ) + { + format = EClockAnalog; + aUseLocale = EFalse; + } + } + } + + return format; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnClockAdapter* CXnClockAdapter::NewL( CXnControlAdapter* aParent, + CXnNodePluginIf& aNode ) + { + CXnClockAdapter* self = new( ELeave ) CXnClockAdapter( aParent, aNode ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::CXnClockAdapter +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnClockAdapter::CXnClockAdapter( CXnControlAdapter* aParent, + CXnNodePluginIf& aNode ) + : iParent( aParent ), iNode( aNode ) + { + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::~CXnClockAdapter +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnClockAdapter::~CXnClockAdapter() + { + iCoeEnv->RemoveMessageMonitorObserver( *this ); + + delete iClockControl; + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnClockAdapter::ConstructL() + { + CXnControlAdapter::ConstructL( iNode ); + + RPointerArray< CXnNodePluginIf > children( iNode.ChildrenL() ); + CleanupClosePushL( children ); + + for( TInt i = 0; i < children.Count(); i++ ) + { + CXnNodePluginIf* child( children[i] ); + + CXnProperty* id( child->IdL() ); + + if( id ) + { + if( id->StringValue() == KDateInformation ) + { + iDate = child; + } + else if( id->StringValue() == KDayInformation ) + { + iDay = child; + } + } + } + + CleanupStack::PopAndDestroy( &children ); + + TBool useLocale; + + CXnProperty* prop( + iNode.GetPropertyL( XnPropertyNames::clock::KS60Format ) ); + + TClockFormat format( ClockFormat( prop, useLocale ) ); + + iClockControl = CXnClockControl::NewL( this, useLocale, format ); + + iCoeEnv->AddMessageMonitorObserverL( *this ); + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::DoHandlePropertyChangeL +// ----------------------------------------------------------------------------- +// +void CXnClockAdapter::DoHandlePropertyChangeL( CXnProperty* aProperty ) + { + if( aProperty ) + { + const TDesC8& name( aProperty->Property()->Name() ); + + if( name == XnPropertyNames::clock::KS60Format ) + { + TBool useLocale; + + TClockFormat format( ClockFormat( aProperty, useLocale ) ); + + iClockControl->SetFormatL( useLocale, format ); + } + else if( name == XnPropertyNames::clock::KS60DigitalFontSize ) + { + iDigitalFont = NULL; + } + else if( name == XnPropertyNames::clock::KS60AmPmFontSize ) + { + iAmPmFont = NULL; + } + else if( name == XnPropertyNames::clock::KS60DateFontSize ) + { + iDateFont = NULL; + } + else if( name == XnPropertyNames::appearance::common::KColor ) + { + iColorSet = EFalse; + } + } + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::UpdateDisplay +// Draws the clock component +// ----------------------------------------------------------------------------- +// +void CXnClockAdapter::UpdateDisplay() const + { + if ( !iNode.Rect().IsEmpty() ) + { + DrawNow(); + } + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::Draw +// Draws the clock component +// ----------------------------------------------------------------------------- +// +void CXnClockAdapter::Draw( const TRect& aRect ) const + { + CXnControlAdapter::Draw( aRect ); + + CWindowGc& gc( SystemGc() ); + + iClockControl->Draw( gc, iNode.Rect() ); + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::MakeVisible +// +// ----------------------------------------------------------------------------- +// +void CXnClockAdapter::MakeVisible( TBool aVisible ) + { + TBool visible( IsVisible() ); + + if ( aVisible != visible ) + { + CCoeControl::MakeVisible( aVisible ); + + if ( !aVisible ) + { + iClockControl->StopTimer(); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::MonitorWsMessage +// +// ----------------------------------------------------------------------------- +// +void CXnClockAdapter::MonitorWsMessage( const TWsEvent& aEvent ) + { + TInt type( aEvent.Type() ); + + TBool foreground( iForeground ); + + if( type == KAknFullOrPartialForegroundGained ) + { + iForeground = ETrue; + } + else if( type == KAknFullOrPartialForegroundLost ) + { + iForeground = EFalse; + } + + if( foreground != iForeground && IsVisible() ) + { + if( iForeground ) + { + iClockControl->StartTimer(); + } + else + { + iClockControl->StopTimer(); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::FontL +// +// ----------------------------------------------------------------------------- +// +const CAknLayoutFont* CXnClockAdapter::FontL( const TInt aType ) + { + CFont* font( NULL ); + + if( aType == EDigitalFont ) + { + if( !iDigitalFont ) + { + CreateFontL( aType ); + } + + font = iDigitalFont; + } + else if( aType == EAmPmFont ) + { + if( !iAmPmFont ) + { + CreateFontL( aType ); + } + + font = iAmPmFont; + } + else if( aType == EDateFont ) + { + if( !iDateFont ) + { + CreateFontL( aType ); + } + + font = iDateFont; + } + + if( font ) + { + return CAknLayoutFont::AsCAknLayoutFontOrNull( font ); + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::TextColorL +// +// ----------------------------------------------------------------------------- +// +const TRgb& CXnClockAdapter::TextColorL() + { + if( !iColorSet ) + { + CreateColorL(); + } + + return iColor; + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::Date +// +// ----------------------------------------------------------------------------- +// +CXnNodePluginIf* CXnClockAdapter::Date() const + { + return iDate; + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::Day +// +// ----------------------------------------------------------------------------- +// +CXnNodePluginIf* CXnClockAdapter::Day() const + { + return iDay; + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::CreateFontL +// +// ----------------------------------------------------------------------------- +// +void CXnClockAdapter::CreateFontL( const TInt aType ) + { + TFontSpec spec; + TInt dummy; + + if( aType == EDigitalFont ) + { + iDigitalFont = NULL; + + CXnProperty* prop( iNode.GetPropertyL( + XnPropertyNames::clock::KS60DigitalFontSize ) ); + + // default + TInt height( ( iNode.Rect().Height() / 3 ) * 2 ); + + if ( prop ) + { + height = iNode.UiEngineL()->VerticalPixelValueL( + prop, iNode.Rect().Height() ); + } + + // No need to relase avkon font + CXnUtils::CreateFontL( KDigitalFont, + height, + spec.iFontStyle, + iDigitalFont, + dummy ); + } + else if( aType == EAmPmFont ) + { + iAmPmFont = NULL; + + CXnProperty* prop( iNode.GetPropertyL( + XnPropertyNames::clock::KS60AmPmFontSize ) ); + + // default + TInt height( ( iNode.Rect().Height() / 5 ) ); + + if ( prop ) + { + height = iNode.UiEngineL()->VerticalPixelValueL( + prop, iNode.Rect().Height() ); + } + + // No need to relase avkon font + CXnUtils::CreateFontL( KAmPmFont, + height, + spec.iFontStyle, + iAmPmFont, + dummy ); + } + else if( aType == EDateFont ) + { + iDateFont = NULL; + + CXnProperty* prop( iNode.GetPropertyL( + XnPropertyNames::clock::KS60DateFontSize ) ); + + // default + TInt height( ( iNode.Rect().Height() / 5 ) ); + + if ( prop ) + { + height = iNode.UiEngineL()->VerticalPixelValueL( + prop, iNode.Rect().Height() ); + } + + // No need to relase avkon font + CXnUtils::CreateFontL( KDateFont, + height, + spec.iFontStyle, + iDateFont, + dummy ); + } + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::CreateColorL +// +// ----------------------------------------------------------------------------- +// +void CXnClockAdapter::CreateColorL() + { + TRgb color; + + TInt result( KErrNone ); + + CXnProperty* prop( iNode.GetPropertyL( + XnPropertyNames::appearance::common::KColor ) ); + + if( !prop ) + { + return; + } + + CXnDomProperty* domProp( prop->Property() ); + + MAknsSkinInstance* skin( AknsUtils::SkinInstance() ); + + if( domProp ) + { + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* > + ( domProp->PropertyValueList().Item( 0 ) ); + + if( value->PrimitiveValueType() == CXnDomPropertyValue::ERgbColor ) + { + color = value->RgbColorValueL(); + } + else if( !value->IsAutoIdent() ) + { + HBufC* str( prop->StringValueL() ); + CleanupStack::PushL( str ); + + CXnUtils::StripQuotes( str ); + + TInt index( 0 ); + TAknsItemID skinID; + + TBool idResolved( CXnUtils::ResolveSkinItemIDL( *str, skinID, index ) ); + + result = KErrNotFound; + + if( idResolved ) + { + result = AknsUtils::GetCachedColor( skin, color, skinID, index ); + } + + CleanupStack::PopAndDestroy( str ); + } + + if( value->IsAutoIdent() || result != KErrNone ) + { + result = AknsUtils::GetCachedColor( skin, color, + KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); + } + } + + if( result == KErrNone ) + { + iColorSet = ETrue; + iColor = color; + } + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::SkinChanged +// Skin change notification +// ----------------------------------------------------------------------------- +// +void CXnClockAdapter::SkinChanged() + { + iAmPmFont = iDigitalFont = iDateFont = NULL; + iColorSet = EFalse; + + CXnControlAdapter::SkinChanged(); + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::HandleScreenDeviceChangedL +// Screen device change notification +// ----------------------------------------------------------------------------- +// +void CXnClockAdapter::HandleScreenDeviceChangedL() + { + iAmPmFont = iDigitalFont = iDateFont = NULL; + iColorSet = EFalse; + + CXnControlAdapter::HandleScreenDeviceChangedL(); + } + +// ----------------------------------------------------------------------------- +// CXnClockAdapter::SizeChanged +// Size changed notification +// ----------------------------------------------------------------------------- +// +void CXnClockAdapter::SizeChanged() + { + iAmPmFont = iDigitalFont = iDateFont = NULL; + iColorSet = EFalse; + + CXnControlAdapter::SizeChanged(); + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockcontrol.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockcontrol.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,315 @@ +/* +* Copyright (c) 2006-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: Implementation for xuikon clock. +* +*/ + + +// SYSTEM INCLUDE FILES +#include // for RChangeNotifier + +// USER INCLUDE FILES +#include "xncontroladapter.h" +#include "xnclockadapter.h" +#include "xnclockface.h" + +#include "xnclockcontrol.h" + + +// LOCAL CONSTANTS AND MACROS +static const TInt KIntervalTime( 60000000 ); // in microseconds + + +// MODULE DATA STRUCTURES +class CXnClockChangeHandler : public CActive + { + public: // Constructor and destructor + static CXnClockChangeHandler* NewL( + CXnClockControl& aClient ) + { + CXnClockChangeHandler* self = + new (ELeave) CXnClockChangeHandler( aClient ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + virtual ~CXnClockChangeHandler() + { + Cancel(); + iChangeNotifier.Close(); + } + + private: // From CActive + void DoCancel() + { + iChangeNotifier.LogonCancel(); + // Return value is ignored. + } + + void RunL() + { + if( iStatus.Int() & ( EChangesLocale | EChangesSystemTime ) ) + { + iClient.TimeOrLocaleChanged(); + } + + User::LeaveIfError( iChangeNotifier.Logon( iStatus ) ); + SetActive(); + } + + private: // Private constructors + void ConstructL() + { + User::LeaveIfError( iChangeNotifier.Create() ); + User::LeaveIfError( iChangeNotifier.Logon( iStatus ) ); + SetActive(); + } + + CXnClockChangeHandler( CXnClockControl& aClient ) + : CActive( EPriorityStandard ), iClient( aClient ) + { + CActiveScheduler::Add( this ); + } + + private: // Data + RChangeNotifier iChangeNotifier; + CXnClockControl& iClient; + }; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnClockControl::CXnClockControl +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnClockControl::CXnClockControl( CXnClockAdapter* aAdapter, + const TBool aFormatFromLocale, + const TClockFormat aFormat ) + : iAdapter( aAdapter ), + iClockFormat( aFormat ), + iFormatFromLocale ( aFormatFromLocale ) + { + } + +// ----------------------------------------------------------------------------- +// CXnClockControl::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnClockControl::ConstructL() + { + iTimer = CPeriodic::NewL( CActive::EPriorityHigh ); + + SetFormatL( iFormatFromLocale, iClockFormat ); + + iHandler = CXnClockChangeHandler::NewL( *this ); + } + +// ----------------------------------------------------------------------------- +// CXnClockControl::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnClockControl* CXnClockControl::NewL( CXnClockAdapter* aAdapter, + const TBool aFormatFromLocale, + const TClockFormat aFormat ) + { + CXnClockControl* self = + new (ELeave) CXnClockControl( aAdapter, aFormatFromLocale, aFormat ); + + CleanupStack::PushL( self ); + self->ConstructL(); + + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +CXnClockControl::~CXnClockControl() + { + delete iHandler; + delete iTimer; + delete iFace; + } + +// ----------------------------------------------------------------------------- +// CXnClockControl::UpdateDisplay +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnClockControl::UpdateDisplay() + { + if( !iFace ) + { + return; + } + + iAdapter->UpdateDisplay(); + } + +// ----------------------------------------------------------------------------- +// CXnClockControl::TimeOrLocaleChanged +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnClockControl::TimeOrLocaleChanged() + { + TLocale locale; + + if( iFormatFromLocale && ( locale.ClockFormat() != iClockFormat ) ) + { + TRAP_IGNORE( SetFormatL( iFormatFromLocale, locale.ClockFormat() ) ); + } + + UpdateDisplay(); + } + +// ----------------------------------------------------------------------------- +// CXnClockControl::SetFormatL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnClockControl::SetFormatL( const TBool aFormatFromLocale, + const TClockFormat aFormat ) + { + TClockFormat format( aFormat ); + + if( aFormatFromLocale ) + { + format = TLocale().ClockFormat(); + } + + iFormatFromLocale = aFormatFromLocale; + + if( format == iClockFormat && iFace ) + { + // Already correct face + return; + } + + iClockFormat = format; + + delete iFace; + iFace = NULL; + + if( format == EClockAnalog ) + { + iFace = CXnClockFaceAnalog::NewL(); + } + else if( format == EClockDigital ) + { + iFace = CXnClockFaceDigital::NewL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnClockControl::Format +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TClockFormat CXnClockControl::Format() const + { + return iClockFormat; + } + +// ----------------------------------------------------------------------------- +// CXnClockControl::Draw +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnClockControl::Draw( CWindowGc& aGc, const TRect& aRect ) const + { + if( iFace && !aRect.IsEmpty() ) + { + TTime homeTime; + homeTime.HomeTime(); + + TRAP_IGNORE( iFace->DrawL( *iAdapter, aGc, aRect, homeTime ) ); + + // Ensure timer is active + const_cast< CXnClockControl* >( this )->StartTimer(); + } + } + +// ----------------------------------------------------------------------------- +// CXnClockControl::TimerCallback +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CXnClockControl::TimerCallback( TAny* aThis ) + { + CXnClockControl* self = static_cast< CXnClockControl* >( aThis ); + + // Update the clock display + self->UpdateDisplay(); + + // Adjust the timer delay if necessary + TTime time; + time.HomeTime(); + TDateTime dateTime( time.DateTime() ); + + if( dateTime.Second() > 0 ) + { + self->iTimer->Cancel(); + self->iTimer->After( KIntervalTime - + 1000000 * dateTime.Second() - dateTime.MicroSecond() ); + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CXnClockControl::StartTimer +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnClockControl::StartTimer() + { + if ( iTimer && !iTimer->IsActive() ) + { + TTime time; + time.HomeTime(); + TDateTime dateTime( time.DateTime() ); + TCallBack callBack( TimerCallback, this ); + + iTimer->Start( + TTimeIntervalMicroSeconds32( + KIntervalTime - 1000000 * dateTime.Second() - dateTime.MicroSecond() ), + TTimeIntervalMicroSeconds32( KIntervalTime ), + callBack ); + } + } + +// ----------------------------------------------------------------------------- +// CXnClockControl::StopTimer +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnClockControl::StopTimer() + { + if ( iTimer && iTimer->IsActive() ) + { + iTimer->Cancel(); + } + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockface.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,369 @@ +/* +* Copyright (c) 2002-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: Implementation for xuikon clock face. +* +*/ + + +// SYSTEM INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include + +// USER INCLUDE FILES +#include "xnnodepluginif.h" +#include "xnclockadapter.h" +#include "xntext.h" + +#include "xnclockface.h" + + +// LOCAL CONSTANTS AND MACROS +_LIT( KAmPmFormat, "%B" ); +_LIT( KTimeFormat, "%J%:1%T" ); + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnClockFaceDigital::CXnClockFaceDigital +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnClockFaceDigital::CXnClockFaceDigital() + { + } + +// ----------------------------------------------------------------------------- +// CXnClockFaceDigital::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnClockFaceDigital::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnClockFaceDigital::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnClockFaceDigital* CXnClockFaceDigital::NewL() + { + CXnClockFaceDigital* self = + new ( ELeave ) CXnClockFaceDigital(); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +CXnClockFaceDigital::~CXnClockFaceDigital() + { + } + +// ----------------------------------------------------------------------------- +// CXnClockFaceDigital::DrawL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnClockFaceDigital::DrawL( CXnClockAdapter& aAdapter, CWindowGc& aGc, + const TRect& aRect, const TTime& aTime ) + { + TBuf< KMaxTimeFormatSpec > time; + 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 margin( extraWidth / 2 ); + + aGc.SetPenColor( color ); + + aGc.UseFont( clockFont ); + + CGraphicsContext::TTextAlign align; + + TBool mirrored( AknLayoutUtils::LayoutMirrored() ); + + if( mirrored ) + { + align = CGraphicsContext::ERight; + } + else + { + align = CGraphicsContext::ELeft; + } + + aGc.DrawText( time, aRect, offset, align, margin ); + + aGc.DiscardFont(); + + if( TLocale().TimeFormat() == ETime12 ) + { + TRect ampmRect( aRect ); + + if( mirrored ) + { + ampmRect.iBr.iX -= ( textWidth + ( margin / 2 ) ); + } + else + { + ampmRect.iTl.iX += ( textWidth + ( margin / 2 ) ); + } + + extraWidth = ampmRect.Width() - ampmWidth; + + margin = extraWidth / 2; + + 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() ); + + 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(); + } + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnClockFaceAnalog::CXnClockFaceAnalog +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnClockFaceAnalog::CXnClockFaceAnalog() + { + } + +// ----------------------------------------------------------------------------- +// CXnClockFaceAnalog::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnClockFaceAnalog::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnClockFaceAnalog::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnClockFaceAnalog* CXnClockFaceAnalog::NewL() + { + CXnClockFaceAnalog* self = + new( ELeave ) CXnClockFaceAnalog(); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +CXnClockFaceAnalog::~CXnClockFaceAnalog() + { + } + +// ----------------------------------------------------------------------------- +// CXnClockFaceAnalog::DrawL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnClockFaceAnalog::DrawL( CXnClockAdapter& /*aAdapter*/, CWindowGc& aGc, + const TRect& aRect, const TTime& aTime ) + { + TSize faceSize( aRect.Size() ); + + TDateTime dateTime( aTime.DateTime() ); + + MAknsSkinInstance* skin( AknsUtils::SkinInstance() ); + + // 1-2: Face number 1 + CFbsBitmap* skinBmp( NULL ); + CFbsBitmap* skinMask( NULL ); + + AknsUtils::GetCachedMaskedBitmap( skin, + KAknsIIDQsnHomeClockAnalogueFace, + skinBmp, + skinMask ); + + // If there is no bitmap, don't draw + if( !skinBmp ) + { + return; + } + + User::LeaveIfError( AknIconUtils::SetSize( skinBmp, faceSize ) ); + + if( skinMask ) + { + User::LeaveIfError( AknIconUtils::SetSize( skinMask, faceSize ) ); + + aGc.BitBltMasked( aRect.iTl, + skinBmp, + TRect( TPoint( 0, 0 ), skinBmp->SizeInPixels() ), + skinMask, + ETrue ); + } + else + { + aGc.BitBlt( aRect.iTl, skinBmp ); + } + + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + aGc.SetPenStyle( CGraphicsContext::ESolidPen ); + + DrawHandsL( aGc, aRect, dateTime ); + } + +// ----------------------------------------------------------------------------- +// CXnClockFaceAnalog::DrawHands +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnClockFaceAnalog::DrawHandsL( CWindowGc& aGc, + const TRect& aRect, + const TDateTime& aDateTime ) + { + TRect rect( aRect ); + + CFbsBitmap* hrbitmap( NULL ); + CFbsBitmap* hrmask( NULL ); + + CFbsBitmap* minbitmap( NULL ); + CFbsBitmap* minmask( NULL ); + + MAknsSkinInstance* skin( AknsUtils::SkinInstance() ); + + AknsUtils::GetCachedMaskedBitmap( + skin, KAknsIIDQsnHomeClockAnaloguePointerHour, + hrbitmap, hrmask ); + + AknsUtils::GetCachedMaskedBitmap( + skin, KAknsIIDQsnHomeClockAnaloguePointerMinute, + minbitmap, minmask ); + + User::LeaveIfError( AknIconUtils::SetSizeAndRotation( + hrbitmap, + rect.Size(), + EAspectRatioPreserved, + aDateTime.Hour() * 30 + aDateTime.Minute() / 2 ) ); + + aGc.BitBltMasked( rect.iTl, + hrbitmap, + TRect( TPoint( 0, 0 ), hrbitmap->SizeInPixels() ), + hrmask, + EFalse ); + + + User::LeaveIfError( AknIconUtils::SetSizeAndRotation( + minbitmap, + rect.Size(), + EAspectRatioPreserved, + aDateTime.Minute() * 6 ) ); + + aGc.BitBltMasked( rect.iTl, + minbitmap, + TRect( TPoint( 0, 0 ), minbitmap->SizeInPixels() ), + minmask, + EFalse ); + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockfactory.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,136 @@ +/* +* 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: Implementation for factory creating CXnClock-element +* +*/ + + +#include +#include +#include + +#include "xnclockfactory.h" +#include "xnclockadapter.h" +#include "xntype.h" +#include "xncomponent.h" +#include "xnnodepluginif.h" +#include "xndomnode.h" + +#include "xnclock.h" + +_LIT8( KXnClock, "clock" ); + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CXnClockFactory::MakeXnComponentL +// Creates the Xuikon component for clock control +// ----------------------------------------------------------------------------- +// +MXnComponentFactory::TXnComponentFactoryResponse CXnClockFactory::MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent + ) + { + MXnComponentFactory::TXnComponentFactoryResponse retVal = MXnComponentFactory::EXnFactoryResponseComponentNotSupported; + + // Check that the given type of a control is parent (or ancestor) of this control + if( aNode.Type()->Type() == KXnClock ) + { + CXnClock* container = CXnClock::NewL(); + + aTargetComponent = static_cast< CXnComponent* >( container ); + + retVal = MXnComponentFactory::EXnFactoryResponseComponentConstructed; + } + + return retVal; + } + +// ----------------------------------------------------------------------------- +// CXnClockFactory::MakeXnControlAdapterL +// Creates the control adapter for clock control +// ----------------------------------------------------------------------------- +// +CXnControlAdapter* CXnClockFactory::MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent) + { + return CXnClockAdapter::NewL( aParent, aNode ); + } + +// ----------------------------------------------------------------------------- +// CXnClockFactory::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnClockFactory* CXnClockFactory::NewL() + { + CXnClockFactory* self = new( ELeave ) CXnClockFactory; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnClockFactory::CXnClockFactory +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnClockFactory::CXnClockFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnClockFactory::~CXnClockFactory +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnClockFactory::~CXnClockFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnClockFactory::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnClockFactory::ConstructL() + { + } + + +// Define the interface UIDs +const TImplementationProxy ImplementationTable[] = + { +#ifdef __EABI__ + IMPLEMENTATION_PROXY_ENTRY( 0x2001CB52, CXnClockFactory::NewL ) +#else + { { 0x2001CB52 }, CXnClockFactory::NewL } +#endif + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); + + return ImplementationTable; + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Building information file +* +*/ + + +#include + +PRJ_PLATFORMS +ARMV5 WINSCW + + +PRJ_EXPORTS + +PRJ_MMPFILES +xnmenufactory.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/group/xnmenufactory.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/group/xnmenufactory.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,61 @@ +/* +* 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: ECOM-plugin for menu-component +* +*/ + + +#include +#include + +TARGET xn3menufactory.dll +TARGETTYPE PLUGIN +UID 0x10009d8d AI3_UID_RENDERING_PLUGIN_MENUFACTORY + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE xnmenu.cpp +SOURCE xnmenufactory.cpp +SOURCE xnmenuadapter.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY eikcore.lib +LIBRARY eikcoctl.lib +LIBRARY cone.lib +LIBRARY xn3layoutengine.lib +LIBRARY xn3utils.lib +LIBRARY avkon.lib +LIBRARY aknlayout2scalable.lib +LIBRARY cdlengine.lib +LIBRARY aknicon.lib +LIBRARY fbscli.lib +LIBRARY bitgdi.lib +LIBRARY bitmaptransforms.lib +LIBRARY xn3domdocument.lib +LIBRARY charconv.lib + +START RESOURCE xn3menufactory.rss +#ifdef SYMBIAN_SECURE_ECOM +TARGET xn3menufactory.rsc +#endif +END + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/inc/xnmenufactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/inc/xnmenufactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,107 @@ +/* +* 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: +* +*/ + + + +#ifndef _XNMENUFACTORY_H +#define _XNMENUFACTORY_H + +// INCLUDES +#include "xncomponentfactory.h" +#include +#include +#include + + + +// CONSTANTS +_LIT8(KMenu, "menubar"); + +// CLASS DECLARATION + +/** +* @ingroup group_xnmenufactory +* Layout Area UI factory interface for creating UI representations of the layout areas. +* This class is wrapper for containing menu +* +* @lib xn3menufactory.dll +* @since S60 3.1 +*/ +// inheritance order must be this, despite codescanner warnings +class CXnMenuFactory : public MXnComponentFactory, public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnMenuFactory* NewL(); + + /** + * Destructor. + */ + virtual ~CXnMenuFactory(); + + + public: // Functions from base classes + + + /** + * From MXnComponentFactory Interface for creating Ui control component. + * @since Series 60 3.1 + * @param aNode Component's node. + * @param aTargetComponent Created component is set here. + * @return EXnFactoryResponseComponentConstructed if component created. + */ + TXnComponentFactoryResponse MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent + ); + /** + * From MXnComponentFactory Interface for creating Ui control adapter. + * @since Series 60 3.1 + * @param aNode Component's node. + * @param aParent Parent of the adapter, which is created here. + * @return Created control adapter. + */ + CXnControlAdapter* MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent + ); + + private: + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CXnMenuFactory(); + + private: // Data + // Reserved pointer for future extension + }; + +// Exported factory function required by ECOM-framework +IMPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount); + +#endif // _XNMENUFACTORY_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xn3menufactory.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xn3menufactory.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,42 @@ +/* +* 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 + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = AI3_UID_RENDERING_PLUGIN_MENUFACTORY; +interfaces = + { + INTERFACE_INFO + { + interface_uid = AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI3_UID_RENDERING_PLUGIN_MENUFACTORY_IMPLEMENTATION; + version_no = 1; + display_name = "XnMenu"; + default_data = "menubar"; + opaque_data = ""; + } + }; + } + }; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenu.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenu.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,197 @@ +/* +* 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 menu +* +*/ + + +#include +#include +#include + +#include "xnmenu.h" +#include "xnmenuadapter.h" +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CXnMenu::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnMenu* CXnMenu::NewL() + { + CXnMenu* self = new( ELeave ) CXnMenu; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnMenu::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnMenu::ConstructL() + { + CXnComponent::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// CXnMenu::ConstructL +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnMenu::CXnMenu() + { + } + +// ----------------------------------------------------------------------------- +// CXnMenu::ConstructL +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnMenu::~CXnMenu() + { + } + + +// ----------------------------------------------------------------------------- +// CXnMenu::SetSoftKeyImageL +// +// ----------------------------------------------------------------------------- +// +void CXnMenu::SetSoftKeyImageL( CFbsBitmap* aBitmap, CFbsBitmap* aMask, + TSoftKeyPosition aPos, TBool aPreserveAspectRatio, TBool aInvertMask, + TBool aTransferOwnership ) + { + CXnMenuAdapter* adapter = static_cast< CXnMenuAdapter* >( ControlAdapter() ); + adapter->SetSoftKeyImageL( aBitmap, aMask, aPos, NULL, aPreserveAspectRatio, aInvertMask, aTransferOwnership ); + } + +// ----------------------------------------------------------------------------- +// CXnMenu::SetSoftKeyImageL +// +// ----------------------------------------------------------------------------- +// +void CXnMenu::SetSoftKeyImageL( CFbsBitmap* aBitmap, CFbsBitmap* aMask, + TSoftKeyPosition aPos, CXnNodeAppIf* aNode, TBool aPreserveAspectRatio, TBool aInvertMask, + TBool aTransferOwnership ) + { + CXnMenuAdapter* adapter = static_cast< CXnMenuAdapter* >( ControlAdapter() ); + adapter->SetSoftKeyImageL( aBitmap, aMask, aPos, aNode, aPreserveAspectRatio, aInvertMask, aTransferOwnership ); + } + +#if 0 // MSK icon +// ----------------------------------------------------------------------------- +// CXnMenu::SetSoftKeyImageL +// +// ----------------------------------------------------------------------------- +// +void CXnMenu::SetSoftKeyImageL( const TAknsItemID& aId, + const TDesC& aBmpFile, + const TInt32 aBmp, const TInt32 aBmpM, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos, + TBool aEnable ) + { + CXnMenuAdapter* adapter = static_cast< CXnMenuAdapter* >( ControlAdapter() ); + adapter->SetSoftKeyImageL( aId, aBmpFile, aBmp, aBmpM, aPos, aEnable ); + } +#endif // MSK icon + +// ----------------------------------------------------------------------------- +// CXnMenu::SetSoftKeyTextL +// +// ----------------------------------------------------------------------------- +// +void CXnMenu::SetSoftKeyTextL( const TDesC& aText, TSoftKeyPosition aPos ) + { + CXnMenuAdapter* adapter = static_cast< CXnMenuAdapter* >( ControlAdapter() ); + adapter->SetSoftKeyTextL( aText, aPos ); + } + +// ----------------------------------------------------------------------------- +// CXnMenu::SetSoftKeyL +// +// ----------------------------------------------------------------------------- +// +void CXnMenu::SetSoftKeyL( CXnNodePluginIf* aSoftkeyNode, TSoftKeyPosition aPos ) + { + CXnMenuAdapter* adapter = static_cast< CXnMenuAdapter* >( ControlAdapter() ); + adapter->SetSoftKeyL( aSoftkeyNode, aPos ); + } + +// ----------------------------------------------------------------------------- +// CXnMenu::SoftKeyL +// +// ----------------------------------------------------------------------------- +// +CXnNodePluginIf* CXnMenu::SoftKeyL( TSoftKeyPosition aPos ) + { + CXnMenuAdapter* adapter = static_cast< CXnMenuAdapter* >( ControlAdapter() ); + return adapter->SoftKeyL( aPos ); + } + +// ----------------------------------------------------------------------------- +// CXnMenu::SetObserver +// +// ----------------------------------------------------------------------------- +// +void CXnMenu::SetObserver( XnMenuInterface::MXnMenuObserver& aObserver ) + { + CXnMenuAdapter* adapter = static_cast< CXnMenuAdapter* >( ControlAdapter() ); + adapter->SetObserver( aObserver ); + } + +// ----------------------------------------------------------------------------- +// CXnMenu::RemoveObserver +// +// ----------------------------------------------------------------------------- +// +void CXnMenu::RemoveObserver() + { + CXnMenuAdapter* adapter = static_cast< CXnMenuAdapter* >( ControlAdapter() ); + adapter->RemoveObserver(); + } + +// ----------------------------------------------------------------------------- +// CXnMenu::TryDisplayingMenuBarL +// +// ----------------------------------------------------------------------------- +// +void CXnMenu::TryDisplayingMenuBarL( const TDesC& aMenuNodeId ) + { + CXnMenuAdapter* adapter = static_cast< CXnMenuAdapter* >( ControlAdapter() ); + + adapter->TryDisplayingMenuL( aMenuNodeId ); + } + +// ----------------------------------------------------------------------------- +// CXnMenu::MakeInterfaceL +// +// ----------------------------------------------------------------------------- +// +XnComponentInterface::MXnComponentInterface* CXnMenu::MakeInterfaceL( + const TDesC8& aType) + { + if( aType != XnMenuInterface::KType ) + { + return NULL; + } + + return static_cast( this ); + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenuadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenuadapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,2891 @@ +/* +* 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 menu +* +*/ + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +// User includes +#include "xnnodepluginif.h" +#include "xntype.h" +#include "xnproperty.h" + +#include "xndompropertyvalue.h" +#include "xndomproperty.h" +#include "xndomlist.h" + +#include "xnuienginepluginif.h" +#include "xncomponent.h" + +#include "xnappuiadapter.h" +#include "xnbitmap.h" +#include "xnmenuadapter.h" +#include "xncomponentnodeimpl.h" +#include "c_xnutils.h" + +#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( 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 KXnMenuArrayGranularity = 6; +const TInt KWideScreenWidth = 640; + +_LIT( KMskIconDialer, "#dialer"); + +using namespace XnPropertyNames; + +static CXnNodePluginIf* FindChildL(CXnNodePluginIf& aNode, + const TDesC8& aType, const TDesC8& aTarget = KNullDesC8); + +class CXnSoftkeyItem: public CBase + { +public: + CXnSoftkeyItem() + : iNode( NULL ), + iPosition( 0 ), + iCommandId( 0 ), + iLabel( NULL ), + iBitmap( NULL ), + iMask( NULL ), + iImageOn( EFalse ), + iInvertMask( EFalse ), + iPreserveAspectRatio( EFalse ), + iUpdateAppearance( ETrue ), + iOwnBitmaps( ETrue ), + iDefault( EFalse ) +#if 0 // MSK icon change + , + iId( KAknsIIDQsnIconColors ), + iBmpFile( NULL ), + iBmp( 0 ), + iBmpM( 0 ) +#endif // MSK icon change + { + } + + ~CXnSoftkeyItem() + { + Reset(); + } + + void Reset() + { + delete iLabel; + iLabel = NULL; + if ( iOwnBitmaps ) + { + delete iBitmap; + iBitmap = NULL; + delete iMask; + iMask = NULL; + } + else + { + iBitmap = NULL; + iMask = NULL; + } + + iImageOn = EFalse; + iInvertMask = EFalse; + iPreserveAspectRatio = EFalse; +#if 0 // MSK icon change + delete iBmpFile; + iBmpFile = NULL; +#endif // MSK icon change + } + + CXnNodePluginIf* iNode; + TInt iPosition; + TInt iCommandId; + HBufC* iLabel; + CFbsBitmap* iBitmap; + CFbsBitmap* iMask; + TBool iImageOn; + TBool iInvertMask; + TBool iPreserveAspectRatio; + TBool iUpdateAppearance; + TBool iOwnBitmaps; + TBool iDefault; +#if 0 // MSK icon change + TAknsItemID iId; + HBufC* iBmpFile; + TInt32 iBmp; + TInt32 iBmpM; +#endif // MSK icon change + }; + + +inline TAknWindowComponentLayout DoCompose( TAknWindowComponentLayout aLine1, + TAknWindowComponentLayout aLine2 ) + { + return TAknWindowComponentLayout::Compose( aLine1, aLine2 ); + } + +inline TAknTextComponentLayout DoComposeText( TAknWindowComponentLayout aLine1, + TAknTextComponentLayout aLine2 ) + { + return TAknWindowComponentLayout::ComposeText( aLine1, aLine2 ); + } + +// ----------------------------------------------------------------------------- +// IsNodeVisibleL +// +// ----------------------------------------------------------------------------- +// +static TBool IsNodeVisibleL(CXnNodePluginIf& aNode) + { + CXnProperty* propVisibility = aNode.VisibilityL(); + + if( propVisibility ) + { + const TDesC8& visibility = propVisibility->StringValue(); + + if( visibility == XnPropertyNames::style::common::visibility::KHidden ) + { + return EFalse; + } + } + + CXnProperty* propDisplay = aNode.DisplayL(); + + if( propDisplay ) + { + const TDesC8& display = propDisplay->StringValue(); + + if( display == XnPropertyNames::style::common::display::KNone ) + { + return EFalse; + } + } + + CXnProperty* propDisabled = aNode.GetPropertyL( XnPropertyNames::common::KDisabled ); + + if( propDisabled ) + { + const TDesC8& disabled = propDisabled->StringValue(); + + if( disabled == XnPropertyNames::KTrue ) + { + return EFalse; + } + } + + return ETrue; + } + +#ifdef _AVKON_CBA_LSC +// ----------------------------------------------------------------------------- +// +// Calculate touch sensitive softkey area for Top button (landscape) +// ----------------------------------------------------------------------------- +static TRect SoftkeyRectTopTouch() + { + TRect screen; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + + TAknLayoutRect layoutRect; + + TAknWindowComponentLayout rightAreaLayout( + AknLayoutScalable_Avkon::area_side_right_pane( 0 ) ); + + + layoutRect.LayoutRect( screen, DoCompose( rightAreaLayout, + AknLayoutScalable_Avkon::sctrl_sk_top_pane() ).LayoutLine() ); + TRect topSKRect( layoutRect.Rect() ); + + layoutRect.LayoutRect( topSKRect, + AknLayoutScalable_Avkon::aid_touch_sctrl_top().LayoutLine() ); + return layoutRect.Rect(); + } + +// ----------------------------------------------------------------------------- +// +// Calculate touch sensitive softkey area for right button (portrait) +// ----------------------------------------------------------------------------- +static TRect SoftkeyRectRightTouch() + { + TRect screen; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + + TAknLayoutRect layoutRect; + + TAknWindowComponentLayout bottomAreaLayout( + AknLayoutScalable_Avkon::area_bottom_pane( 0 ) ); + + + layoutRect.LayoutRect( screen, DoCompose( bottomAreaLayout, + AknLayoutScalable_Avkon::control_bg_pane() ).LayoutLine() ); + TRect rightSKRect( layoutRect.Rect() ); + layoutRect.LayoutRect( + rightSKRect, + AknLayoutScalable_Avkon::aid_touch_ctrl_right().LayoutLine() ); + return layoutRect.Rect(); + } + +// ----------------------------------------------------------------------------- +// +// Calculate touch sensitive softkey area for left button (portrait) +// ----------------------------------------------------------------------------- +static TRect SoftkeyRectLeftTouch() + { + TRect screen; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + + TAknLayoutRect layoutRect; + + TAknWindowComponentLayout bottomAreaLayout( + AknLayoutScalable_Avkon::area_bottom_pane( 0 ) ); + + + layoutRect.LayoutRect( screen, DoCompose( bottomAreaLayout, + AknLayoutScalable_Avkon::control_bg_pane() ).LayoutLine() ); + TRect leftSKRect( layoutRect.Rect() ); + layoutRect.LayoutRect( + leftSKRect, + AknLayoutScalable_Avkon::aid_touch_ctrl_left().LayoutLine() ); + + return layoutRect.Rect(); + + } + +// ----------------------------------------------------------------------------- +// +// Calculate touch sensitive softkey area for Bottom button (landscape) +// ----------------------------------------------------------------------------- +static TRect SoftkeyRectBottomTouch() + { + TRect screen; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + + TAknLayoutRect layoutRect; + + TAknWindowComponentLayout rightAreaLayout( AknLayoutScalable_Avkon::area_side_right_pane( 0 ) ); + + layoutRect.LayoutRect( screen, DoCompose( rightAreaLayout, + AknLayoutScalable_Avkon::sctrl_sk_bottom_pane() ).LayoutLine() ); + TRect bottomSKRect( layoutRect.Rect() ); + + layoutRect.LayoutRect( bottomSKRect, + AknLayoutScalable_Avkon::aid_touch_sctrl_bottom().LayoutLine() ); + return layoutRect.Rect(); + } +#endif +// ----------------------------------------------------------------------------- +// +// Calculate (whole) softkey area for Bottom button (landscape) +// ----------------------------------------------------------------------------- +static TBool HDLayoutActive() + { + TInt resourceId = 0; + CEikStatusPaneBase* statusPane = CEikStatusPaneBase::Current(); + + if ( statusPane ) // Return the resource ID of app statuspane if it exists. + { + resourceId = statusPane->CurrentLayoutResId(); + } + else // If this app does not have statuspane, then we ask the layout from AknCapServer. + { + resourceId = CAknSgcClient::CurrentStatuspaneResource(); + } + + TBool retVal = EFalse; + + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + // Can be widescreen only in landscape orientation. + retVal = ( resourceId == R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL || + resourceId == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE || + resourceId == R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT || + resourceId == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT ); + } + + return retVal; + } + +// ----------------------------------------------------------------------------- +// +// Calculate softkey image graphics area for Bottom button (landscape) +// ----------------------------------------------------------------------------- +static TRect SoftkeyRectBottomGraphics() + { + TRect screen; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + + TAknWindowComponentLayout rightAreaLayout( + AknLayoutScalable_Avkon::area_side_right_pane( 0 ) ); + + TAknWindowComponentLayout bottomSKLayout( + DoCompose( rightAreaLayout, + AknLayoutScalable_Avkon::sctrl_sk_bottom_pane() ) ); + + // Calculate softkey rects. + // Left (bottom in landscape) softkey layout. + TAknLayoutRect leftSoftkeyLayoutRect; + leftSoftkeyLayoutRect.LayoutRect( screen, + bottomSKLayout.LayoutLine() ); + TRect leftSoftKeyButtonRect( leftSoftkeyLayoutRect.Rect() ); + + // Calculate softkey image layout. + // Left (bottom in landscape) softkey layout. + TAknWindowLineLayout leftSoftkeyImageLayout( + DoCompose( + bottomSKLayout, + AknLayoutScalable_Avkon::sctrl_sk_bottom_pane_g1() ).LayoutLine() ); + + + TAknLayoutRect qgn_graf_sk_left; + qgn_graf_sk_left.LayoutRect( screen, leftSoftkeyImageLayout ); + + return qgn_graf_sk_left.Rect(); + } + +// ----------------------------------------------------------------------------- +// +// Calculate softkey image graphics area for Top button (landscape) +// ----------------------------------------------------------------------------- +static TRect SoftkeyRectTopGraphics() + { + TRect screen; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + + TAknWindowComponentLayout rightAreaLayout( + AknLayoutScalable_Avkon::area_side_right_pane( 0 ) ); + + TAknWindowComponentLayout topSKLayout( + DoCompose( rightAreaLayout, + AknLayoutScalable_Avkon::sctrl_sk_top_pane() ) ); + + // Calculate softkey rects. + // Right (top in landscape) softkey layout. + TAknLayoutRect rightSoftkeyLayoutRect; + rightSoftkeyLayoutRect.LayoutRect( screen, + topSKLayout.LayoutLine() ); + TRect rightSoftKeyButtonRect( rightSoftkeyLayoutRect.Rect() ); + + // Left (bottom in landscape) softkey layout. + // Right (top in landscape) softkey layout. + TAknWindowLineLayout rightSoftkeyImageLayout( + DoCompose( + topSKLayout, + AknLayoutScalable_Avkon::sctrl_sk_top_pane_g1() ).LayoutLine() ); + + TAknLayoutRect qgn_graf_sk_right; + qgn_graf_sk_right.LayoutRect( screen, rightSoftkeyImageLayout ); + return qgn_graf_sk_right.Rect(); + } + + +// ----------------------------------------------------------------------------- +// SoftkeyRectL +// Calculate soft key rect +// ----------------------------------------------------------------------------- +static TRect SoftkeyRectL( CEikButtonGroupContainer& aContainer, TInt aPos, TBool aImageOn ) + { + TRect rect; + + if( AknStatuspaneUtils::StaconPaneActive() ) + { + TInt variety( 0 ); + + if( AknStatuspaneUtils::StaconSoftKeysLeft() ) + { + variety = 1; + } + + TRect parentRect( iAvkonAppUi->ApplicationRect() ); + + switch( aPos ) + { + case CEikButtonGroupContainer::ELeftSoftkeyPosition: + { + TAknWindowComponentLayout layout0( AknLayoutScalable_Avkon::area_bottom_pane( 2 ) ); + TAknWindowComponentLayout layout1( AknLayoutScalable_Avkon::stacon_bottom_pane() ); + + // If clock is shown in stacon, cba area is smaller. + TInt bottomCbaVariety( variety ); + + if( AknStatuspaneUtils::ExtendedStaconPaneActive() ) + { + bottomCbaVariety += 2; + } + + TAknWindowComponentLayout layout2( AknLayoutScalable_Avkon::control_bottom_pane_stacon( bottomCbaVariety ) ); + + if( aImageOn ) + { + // Icon layout + TAknWindowComponentLayout iconLayout( AknLayoutScalable_Avkon::control_bottom_pane_stacon_g1() ); + + TAknWindowComponentLayout lskIconLayout( DoCompose( layout0, + DoCompose( layout1, DoCompose( layout2, iconLayout ) ) ) ); + + TAknWindowLineLayout lskIcon( lskIconLayout.LayoutLine() ); + + TAknLayoutRect qgn_icon_lsk; + + qgn_icon_lsk.LayoutRect( parentRect, lskIcon ); + + rect = qgn_icon_lsk.Rect(); + } + else + { + // Text layout + TAknTextComponentLayout textLayout( AknLayoutScalable_Avkon::control_bottom_pane_stacon_t1( variety ) ); + + TAknTextComponentLayout lskTextLayout( DoComposeText( layout0, + DoComposeText( layout1, DoComposeText( layout2, textLayout ) ) ) ); + + TAknTextLineLayout lskText( lskTextLayout.LayoutLine() ); + + TAknLayoutText qgn_text_lsk; + + qgn_text_lsk.LayoutText( parentRect, lskText ); + + rect = qgn_text_lsk.TextRect(); + } + } + break; + case CEikButtonGroupContainer::ERightSoftkeyPosition: + { + TAknWindowComponentLayout layout0( AknLayoutScalable_Avkon::area_top_pane( 2 ) ); + TAknWindowComponentLayout layout1( AknLayoutScalable_Avkon::stacon_top_pane() ); + + TInt topCbaVariety( variety ); + + if( AknStatuspaneUtils::ExtendedStaconPaneActive() ) + { + topCbaVariety += 4; + } + + TAknWindowComponentLayout layout2( AknLayoutScalable_Avkon::control_top_pane_stacon( topCbaVariety ) ); + + if( aImageOn ) + { + // Icon layout + TAknWindowComponentLayout iconLayout( AknLayoutScalable_Avkon::control_top_pane_stacon_g1() ); + + TAknWindowComponentLayout rskIconLayout( DoCompose( layout0, + DoCompose( layout1, DoCompose( layout2, iconLayout ) ) ) ); + + TAknWindowLineLayout rskIcon( rskIconLayout.LayoutLine() ); + + TAknLayoutRect qgn_icon_rsk; + + qgn_icon_rsk.LayoutRect( parentRect, rskIcon ); + + rect = qgn_icon_rsk.Rect(); + } + else + { + // Text layout + TAknTextComponentLayout textLayout( AknLayoutScalable_Avkon::control_top_pane_stacon_t1( variety ) ); + + TAknTextComponentLayout rskTextLayout( DoComposeText( layout0, + DoComposeText( layout1, DoComposeText( layout2, textLayout ) ) ) ); + + TAknTextLineLayout rskText( rskTextLayout.LayoutLine() ); + + TAknLayoutText qgn_text_rsk; + + qgn_text_rsk.LayoutText( parentRect, rskText ); + + rect = qgn_text_rsk.TextRect(); + } + } + break; + default: + User::Leave( KErrNotSupported ); + break; + + } + } + else + { + TInt textVariety( 0 ); + TInt graphVariety( 0 ); + + TBool mskEnabled( AknLayoutUtils::MSKEnabled() && Layout_Meta_Data::IsMSKEnabled() ); + + if ( mskEnabled ) + { + textVariety = Layout_Meta_Data::IsLandscapeOrientation() ? 2 : 3; + graphVariety = Layout_Meta_Data::IsLandscapeOrientation() ? 2 : 4; + } + else + { + textVariety = Layout_Meta_Data::IsLandscapeOrientation() ? 2 : 0; + graphVariety = Layout_Meta_Data::IsLandscapeOrientation() ? 2 : 4; + } + + CEikCba* cba( static_cast< CEikCba* >( aContainer.ButtonGroup() ) ); + + TRect parentRect( cba->Rect() ); + + switch( aPos ) + { + case CEikButtonGroupContainer::ELeftSoftkeyPosition: + { + if( aImageOn ) + { + if ( HDLayoutActive() && + AKN_LAYOUT_WINDOW_screen.iW == KWideScreenWidth ) + { + rect = SoftkeyRectBottomGraphics(); + } + else + { + + TAknLayoutRect qgn_icon_lsk; + + qgn_icon_lsk.LayoutRect( parentRect, + AknLayoutScalable_Avkon::control_pane_g1( graphVariety ).LayoutLine() ); + + rect = qgn_icon_lsk.Rect(); + } + } + else + { + TAknLayoutText qgn_text_lsk; + + qgn_text_lsk.LayoutText( parentRect, + AknLayoutScalable_Avkon::control_pane_t1( textVariety ).LayoutLine() ); + + rect = qgn_text_lsk.TextRect(); + } + } + break; + case CEikButtonGroupContainer::ERightSoftkeyPosition: + { + if( aImageOn ) + { + if ( HDLayoutActive() && + AKN_LAYOUT_WINDOW_screen.iW == KWideScreenWidth ) + { + rect = SoftkeyRectTopGraphics(); + } + else + { + TAknLayoutRect qgn_icon_rsk; + + qgn_icon_rsk.LayoutRect( parentRect, + AknLayoutScalable_Avkon::control_pane_g2( graphVariety ).LayoutLine() ); + + rect = qgn_icon_rsk.Rect(); + } + } + else + { + TAknLayoutText qgn_text_rsk; + + qgn_text_rsk.LayoutText( parentRect, + AknLayoutScalable_Avkon::control_pane_t2( textVariety ).LayoutLine() ); + + rect = qgn_text_rsk.TextRect(); + } + } + break; + case CEikButtonGroupContainer::EMiddleSoftkeyPosition: + { + if( !mskEnabled || aImageOn ) + { + // No msk, or asking image size for msk + User::Leave( KErrNotSupported ); + } + else + { + TAknLayoutText qgn_text_msk; + + qgn_text_msk.LayoutText( parentRect, + AknLayoutScalable_Avkon::control_pane_t3( textVariety ).LayoutLine() ); + + rect = qgn_text_msk.TextRect(); + } + } + break; + default: + User::Leave( KErrNotFound ); + break; + } + } + + return rect; + } +// ----------------------------------------------------------------------------- +// Get softkey image rect +// ----------------------------------------------------------------------------- +static TRect SoftkeyImageRect(CEikButtonGroupContainer& aContainer, TInt aPosition) + { + TRect ret; +#ifndef _AVKON_CBA_LSC + TAknLayoutRect softkeyImg; + CEikCba* cba( static_cast< CEikCba* >( aContainer.ButtonGroup() ) ); + TRect parentRect( cba->Rect() ); + + if(Layout_Meta_Data::IsLandscapeOrientation()) + { + if(aPosition == CEikButtonGroupContainer::ELeftSoftkeyPosition) + { + TAknWindowComponentLayout wcl = AknLayoutScalable_Avkon::control_pane_g1(2); + softkeyImg.LayoutRect(parentRect,wcl.LayoutLine() ); + } + else if(aPosition == CEikButtonGroupContainer::ERightSoftkeyPosition) + { + TAknWindowComponentLayout wcl = AknLayoutScalable_Avkon::control_pane_g2(2); + softkeyImg.LayoutRect(parentRect,wcl.LayoutLine() ); + } + } + else + { + if(aPosition == CEikButtonGroupContainer::ELeftSoftkeyPosition) + { + TAknWindowComponentLayout wcl = AknLayoutScalable_Avkon::control_pane_g1(4); + softkeyImg.LayoutRect(parentRect,wcl.LayoutLine() ); + } + else if(aPosition == CEikButtonGroupContainer::ERightSoftkeyPosition) + { + TAknWindowComponentLayout wcl = AknLayoutScalable_Avkon::control_pane_g2(4); + softkeyImg.LayoutRect(parentRect,wcl.LayoutLine() ); + + } + } + ret = softkeyImg.Rect(); +#else + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + if(aPosition == CEikButtonGroupContainer::ELeftSoftkeyPosition) + { + ret = SoftkeyRectTopTouch(); + } + else if(aPosition == CEikButtonGroupContainer::ERightSoftkeyPosition) + { + ret = SoftkeyRectBottomTouch(); + } + } + else // portrait + { + if(aPosition == CEikButtonGroupContainer::ELeftSoftkeyPosition) + { + ret = SoftkeyRectLeftTouch(); + } + else if(aPosition == CEikButtonGroupContainer::ERightSoftkeyPosition) + { + ret = SoftkeyRectRightTouch(); + } + } +#endif + return ret; + } + +// ----------------------------------------------------------------------------- +// CopyBitmapLC +// Copy bitmap +// ----------------------------------------------------------------------------- +static CFbsBitmap* CopyBitmapL( const CFbsBitmap* aBitmap ) + { + CFbsBitmap* copy = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( copy ); + + copy->Create( aBitmap->SizeInPixels(), aBitmap->DisplayMode() ); + + CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL( copy ); + CleanupStack::PushL( dev ); + + CFbsBitGc* gc = CFbsBitGc::NewL(); + CleanupStack::PushL( gc ); + + gc->Activate( dev ); + gc->BitBlt( TPoint( 0, 0 ), aBitmap ); + + CleanupStack::PopAndDestroy( 2 ); // gc, dev + + CleanupStack::Pop( copy ); + + return copy; + } + +// ----------------------------------------------------------------------------- +// MenuTypeL +// This is used to deactivate "active applications" menu item using the theme +// Get the "menutype" property from menubar and check if it has value +// "menuoptions" (default) or "menuoptionsnotaskswapper" and return +// correct menu type. +// ----------------------------------------------------------------------------- +static CEikMenuBar::TMenuType MenuTypeL( CXnNodePluginIf& aMenubarNode ) + { + CEikMenuBar::TMenuType menuType( CEikMenuBar::EMenuOptions ); + + CXnProperty* property( aMenubarNode.GetPropertyL( XnPropertyNames::menu::KMenuType ) ); + + if( property ) + { + if( property->StringValue() == XnPropertyNames::menu::menutype::KMenuOptionsNoTaskSwapper ) + { + menuType = CEikMenuBar::EMenuOptionsNoTaskSwapper; + } + } + + return menuType; + } + +// ----------------------------------------------------------------------------- +// FindChildL +// +// ----------------------------------------------------------------------------- +static CXnNodePluginIf* FindChildL( CXnNodePluginIf& aNode, + const TDesC8& aType, const TDesC8& aTarget ) + { + RPointerArray children( aNode.ChildrenL() ); + CleanupClosePushL( children ); + + CXnNodePluginIf* retval( NULL ); + + for( TInt i = 0; i < children.Count(); i++ ) + { + CXnNodePluginIf* child( children[i] ); + + if( child->Type()->Type() == aType ) + { + if( aTarget == KNullDesC8 ) + { + retval = child; + break; + } + else + { + CXnProperty* target( child->GetPropertyL( KXnTarget ) ); + + if( target && target->StringValue() == aTarget ) + { + retval = child; + break; + } + + CXnProperty* source( child->GetPropertyL( KXnSource ) ); + + if( source && source->StringValue() == aTarget ) + { + retval = child; + break; + } + } + } + } + + CleanupStack::PopAndDestroy( &children ); + + return retval; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnMenuAdapter* CXnMenuAdapter::NewL( CXnControlAdapter* aParent, CXnNodePluginIf& aNode ) + { + CXnMenuAdapter* self = new( ELeave ) CXnMenuAdapter; + + CleanupStack::PushL( self ); + self->ConstructL( aParent, aNode ); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::ConstructL( CXnControlAdapter* /*aParent*/, CXnNodePluginIf& aNode ) + { + iRootNode = &aNode; + + CXnControlAdapter::ConstructL( aNode ); + + iUiEngine = iRootNode->UiEngineL(); + + CAknAppUi* appui( iAvkonAppUi ); + + iPreviousMenuPaneId = appui->StatusPane()->CurrentLayoutResId(); + + CEikMenuBar* current( iEikonEnv->AppUiFactory()->SwapMenuBar( NULL ) ); + appui->RemoveFromStack( current ); + + delete current; + current = NULL; + + InitSoftkeyItemsL(); + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::CXnMenuAdapter +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnMenuAdapter::CXnMenuAdapter(): + iMenuItems( KXnMenuArrayGranularity ), + iIdCounter( KMenuCommandFirst ) + { + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::~CXnMenuAdapter +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnMenuAdapter::~CXnMenuAdapter() + { + StopDisplayingMenu(); + + if ( iAvkonAppUi ) + { + iAvkonAppUi->RemoveFromStack( iMenuBar ); + } + + if ( iMenuBar ) + { + delete iMenuBar; + } + + iSoftkeyItems.ResetAndDestroy(); + iMenuItems.Reset(); + } + +// ----------------------------------------------------------------------------- +// Create scaled bitmap from source bitmap. +// ----------------------------------------------------------------------------- +// +void CreateScaledBitmapL( + const TRect& aRect, + CFbsBitmap*& aTrgBitmap, + CFbsBitmap* aSrcBitmap, + TBool aPreserveAspectRatio ) + { + TRect destRect = aRect; + + if( aPreserveAspectRatio ) + { + // Calculate the bitmap image dimensions so that it uses maximum space + // of the given rectangle and maintains aspect ratio. + TInt srcHeight = aSrcBitmap->SizeInPixels().iHeight; + TInt srcWidth = aSrcBitmap->SizeInPixels().iWidth; + TReal scaleRatio( 1 ); //no scale as defaul + + // If any dimension is 0, then we do not bother to scale + if( aRect.Width() > 0 && aRect.Height() > 0 ) + { + TReal xRatio = ( (TReal )srcWidth / ( TReal )aRect.Width() ); + TReal yRatio = ( ( TReal )srcHeight / ( TReal )aRect.Height() ); + + //Find out appropriate scaling factor + xRatio > yRatio ? ( scaleRatio = xRatio ) : ( scaleRatio = yRatio ); + } + + // Scale the size for target bitmap + destRect.SetHeight( srcHeight / scaleRatio ); + destRect.SetWidth( srcWidth / scaleRatio ); + } + + aTrgBitmap = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( aTrgBitmap ); + + // It is allowed to create zero height or width bitmap. + TInt err( aTrgBitmap->Create( destRect.Size(), aSrcBitmap->DisplayMode() ) ); + + if( err == KErrNone ) + { + CXnUtils::ScaleBitmapL( destRect, aTrgBitmap, aSrcBitmap ); + } + + // we do not own the bitmap so just Pop. + CleanupStack::Pop( aTrgBitmap ); + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::PrepareSoftkeyImageL +// Make a copy of originals and scale them to right size. +// Finally place the scaled icon to right position of drawing area. +// ----------------------------------------------------------------------------- +CEikImage* CXnMenuAdapter::PrepareSoftkeyImageL( const CXnSoftkeyItem& aItem, const TSize& aSize ) + { + CFbsBitmap* bitmap( NULL ); + CFbsBitmap* mask( NULL ); + + // Start from bitmap + CFbsBitmap* source( aItem.iBitmap ); + + TInt count( 0 ); + + // Go through bitmap and mask + for( TInt i = 0; i < 2; i++ ) + { + if( !source ) + { + source = aItem.iMask; + continue; + } + + CFbsBitmap* scaled( NULL ); + + TScaleMode mode( aItem.iPreserveAspectRatio ? EAspectRatioPreserved : EAspectRatioNotPreserved ); + + if( AknIconUtils::IsMifIcon( source ) ) + { + AknIconUtils::SetSize( source, aSize, mode ); + + scaled = CopyBitmapL( source ); + } + else + { + CreateScaledBitmapL( TRect( aSize ), scaled, source, mode == EAspectRatioPreserved ); + } + + CleanupStack::PushL( scaled ); + + if( !aItem.iPreserveAspectRatio ) + { + count++; + + if( i == 0 ) + { + bitmap = scaled; + } + else + { + mask = scaled; + } + } + else + { + CFbsBitmap* target = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( target ); + + // Target is size of whole draw area + User::LeaveIfError( target->Create( aSize, source->DisplayMode() ) ); + + CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL( target ); + CleanupStack::PushL( dev ); + + CFbsBitGc* gc = CFbsBitGc::NewL(); + CleanupStack::PushL( gc ); + + gc->Activate( dev ); + + gc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc->SetPenStyle( CGraphicsContext::ENullPen ); + + if( aItem.iInvertMask ) + { + // White, with full transparent alpha channel + gc->SetBrushColor( TRgb( 0x00FFFFFF, 0 ) ); + } + else + { + // Black, with full transparent alpha channel + gc->SetBrushColor( TRgb( 0x00000000, 0 ) ); + } + + // Make whole target area transparent + gc->DrawRect( TRect( aSize ) ); + + TPoint iconPos; + + switch( AknLayoutUtils::CbaLocation() ) + { + case AknLayoutUtils::EAknCbaLocationBottom: + // Rsk must be moved to right, lsk is in correct place by default + if ( aItem.iPosition != CEikButtonGroupContainer::ELeftSoftkeyPosition ) + { + iconPos.iX = aSize.iWidth - scaled->SizeInPixels().iWidth; + } + break; + case AknLayoutUtils::EAknCbaLocationRight: + // Rsk and lsk must be moved to right + iconPos.iX = aSize.iWidth - scaled->SizeInPixels().iWidth; + break; + case AknLayoutUtils::EAknCbaLocationLeft: + // Already in correct position + default: + break; + } + + // Align horizontally to center + iconPos.iY = iconPos.iX ? 0 : ( ( aSize.iHeight - scaled->SizeInPixels().iHeight ) / 2 ); + + gc->SetBrushStyle( CGraphicsContext::ENullBrush ); + + // Blit image to correct position + gc->BitBlt( iconPos, scaled ); + + CleanupStack::PopAndDestroy( 2, dev ); + + CleanupStack::Pop( target ); + + CleanupStack::PopAndDestroy( scaled ); + + CleanupStack::PushL( target ); + count++; + + if( i == 0 ) + { + bitmap = target; + } + else + { + mask = target; + } + + + } + + // Go with mask next + source = aItem.iMask; + } + + // Takes ownership of scaled bitmap and mask + CEikImage* image = new ( ELeave ) CEikImage; + + image->SetPictureOwnedExternally( EFalse ); + image->SetPicture( bitmap, mask ); + + CleanupStack::Pop( count ); + + return image; + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::SetSoftkeyAppearanceL +// +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::SetSoftkeyAppearanceL( CXnSoftkeyItem& aItem ) + { +#if 0 // MSK icon change + if( IsNodeVisibleL( *aItem.iNode) ) + { + if( aItem.iImageOn ) + { + ChangeSoftkeyImageL( aItem ); + } + else if( aItem.iLabel )// change label + { + TBool left( EFalse ); + if ( aItem.iPosition == CEikButtonGroupContainer::ELeftSoftkeyPosition ) + { + left = ETrue; + EikSoftkeyImage::SetLabel( iContainer,left ); + } + else if ( aItem.iPosition == CEikButtonGroupContainer::ERightSoftkeyPosition ) + { + left = EFalse; + EikSoftkeyImage::SetLabel( iContainer,left ); + } + + iContainer->SetCommandL( aItem.iPosition, aItem.iCommandId, *aItem.iLabel ); + } + } + } +#else // MSK icon change + if( IsNodeVisibleL( *aItem.iNode) ) + { + if( aItem.iPosition == CEikButtonGroupContainer::ELeftSoftkeyPosition + || aItem.iPosition == CEikButtonGroupContainer::ERightSoftkeyPosition) + { + if(aItem.iImageOn) + { + ChangeSoftkeyImageL(aItem); + } + else if(aItem.iLabel)// change label + { + TBool left(EFalse); + if(aItem.iPosition == CEikButtonGroupContainer::ELeftSoftkeyPosition) + { + left = ETrue; + } + EikSoftkeyImage::SetLabel( iContainer,left ); + iContainer->SetCommandL( aItem.iPosition, aItem.iCommandId, *aItem.iLabel ); + + } + + } + else if(aItem.iPosition == CEikButtonGroupContainer::EMiddleSoftkeyPosition) + { + if( aItem.iLabel ) + { + // Msk will have predefined image based on command id + if( *aItem.iLabel == menu::KMSKDotImage16 ) + { + aItem.iCommandId = KCBACommandFirst; + } + else if(*aItem.iLabel == KMskIconDialer) + { +#ifndef _AVKON_CBA_LSC + aItem.iCommandId = EAknSoftkeyDialler; +#endif + } + else + { + aItem.iCommandId = KCBACommandMiddle; + } + iContainer->SetCommandL( aItem.iPosition, aItem.iCommandId, *aItem.iLabel ); + } + } + } + } +#endif // MSK icon change + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::InitSoftkeyItemsL +// +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::InitSoftkeyItemsL() + { + // No layout calulations needed + iRootNode->SetLayoutCapable( EFalse ); + + // create softkeyitems to hold data + + RPointerArray< CXnNodePluginIf > children( iRootNode->ChildrenL() ); + CleanupClosePushL( children ); + CXnSoftkeyItem* item(0); + for(TInt i=0;iType()->Type() == XnPropertyNames::softkey::KNodeName) + { + item = AppendSoftkeyItemL(children[i]); + if(item) + { + item->iDefault = ETrue; + } + } + } + CleanupStack::PopAndDestroy( &children ); + + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::InitSoftkeyItemL +// +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::InitSoftkeyItemImageL( CXnSoftkeyItem& aItem) + { + CXnNodePluginIf* node( aItem.iNode ); + + // No layout calulations needed + node->SetLayoutCapable( EFalse ); + +#if 0 // MSK icon change + if ( aItem.iPosition == CEikButtonGroupContainer::EMiddleSoftkeyPosition ) + { + aItem.iImageOn = ETrue; + return; + } +#endif // MSK icon change + + CXnProperty* pathProp( node->PathL() ); + if( pathProp ) + { + HBufC* bitmapPath( NULL ); + HBufC* maskPath( NULL ); + + bitmapPath = pathProp->StringValueL(); + CleanupStack::PushL( bitmapPath ); + TInt count( 1 ); + + CXnProperty* maskProp( node->MaskPathL() ); + + if( maskProp ) + { + maskPath = maskProp->StringValueL(); + CleanupStack::PushL( maskPath ); + count++; + } + + CFbsBitmap* bitmap( NULL ); + CFbsBitmap* mask( NULL ); + + // Call base class to get bitmap and mask + GetBitmapAndMask( bitmapPath ? *bitmapPath : KNullDesC(), + maskPath ? *maskPath : KNullDesC(), + bitmap, mask ); + + aItem.iImageOn = ETrue; + aItem.iBitmap = bitmap; + aItem.iMask = mask; + + CXnProperty* maskInvertedProp( node->GetPropertyL( XnPropertyNames::image::KMaskInverted ) ); + + if( maskInvertedProp ) + { + if( maskInvertedProp->StringValue() == XnPropertyNames::KTrue ) + { + aItem.iInvertMask = ETrue; + } + } + + CXnProperty* aspectRatioProp( node->GetPropertyL( XnPropertyNames::image::KS60AspectRatio ) ); + + if( aspectRatioProp ) + { + if( aspectRatioProp->StringValue() == XnPropertyNames::image::KPreserve ) + { + aItem.iPreserveAspectRatio = ETrue; + } + } + + CleanupStack::PopAndDestroy( count ); // path and/or mask + } + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::IsMskAvailable +// +// ----------------------------------------------------------------------------- +// +TBool CXnMenuAdapter::IsMskAvailable() + { + if( AknLayoutUtils::MSKEnabled() && Layout_Meta_Data::IsMSKEnabled() ) + { + return ETrue; + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::AddMenuItemL +// +// ----------------------------------------------------------------------------- +// +TInt CXnMenuAdapter::AddMenuItemL( TInt aParentIndex, + CXnNodePluginIf* aNode, RPointerArray< const TDesC8 >& aGroups ) + { + if ( !aNode ) + { + return 0; + } + + const TDesC8& name( aNode->Type()->Type() ); + + TInt retval( 0 ); + + TBool showByGroup( EFalse ); + + const TDesC8* id( NULL ); + + CXnProperty* prop( aNode->IdL() ); + + if( prop ) + { + id = &prop->StringValue(); + } + else + { + // If menuitem doesn't have id, group doesn't affect to it + showByGroup = ETrue; + } + + if( name == KXnMenuItem || + name == KXnDynMenuItem || + name == KXnWidgetMenuItem ) + { + const TDesC8& ns( aNode->Namespace() ); + + for( TInt i = 0; !showByGroup && i < aGroups.Count(); i++ ) + { + const TDesC8& groupId( *(aGroups)[i] ); + + CXnNodePluginIf* group( iUiEngine->FindNodeByIdL( groupId, ns ) ); + + if( group ) + { + RPointerArray< CXnNodePluginIf > + children( group->ChildrenL() ); + + CleanupClosePushL( children ); + + for( TInt j = 0; j < children.Count(); j++ ) + { + CXnProperty* prop( children[j]->GetPropertyL( + XnPropertyNames::action::KName ) ); + + if( prop ) + { + const TDesC8& name( prop->StringValue() ); + + if( name == *id ) + { + // The menuitem belongs to defined group + showByGroup = ETrue; + break; + } + } + } + + CleanupStack::PopAndDestroy( &children ); + } + } + + if( !showByGroup || !IsNodeVisibleL( *aNode ) ) + { + // Menuitem is invisible + return retval; + } + } + + TXnMenuItem item; + + item.iAutomaticSP = ETrue; + + item.iParentIndex = aParentIndex; + item.iData.iFlags = 0; + + CXnNodePluginIf* menuItem( NULL ); + + if( name == KXnMenuItem || name == KXnDynMenuItem ) + { + menuItem = aNode; + } + else if( name == KXnWidgetMenuItem ) + { + TRAP_IGNORE( menuItem = FindWidgetMenuItemL( aNode ) ); + } + + if( menuItem ) + { + const TDesC8& type( menuItem->Type()->Type() ); + + // check first if label comes from view + CXnProperty* label( aNode->LabelL() ); + + if ( !label ) + { + // get label from widget + label = menuItem->LabelL(); + } + + if( label ) + { + HBufC* itemLabel = label->StringValueL(); + item.iData.iText.Copy( *itemLabel ); + delete itemLabel; + } + else + { + item.iData.iText.Copy( KNullDesC ); + } + + TBool okToAdd( ETrue ); + + if( type == KXnDynMenuItem ) + { + okToAdd = EFalse; + + if( iObserver ) + { + okToAdd = iObserver->DynInitMenuItemL( menuItem->AppIfL() ); + } + } + + if( okToAdd ) + { + if ( id && *id == KHsShowHelp ) + { + // Help command id must be EAknCmdHelp to get editing input options + // shown correctly + item.iData.iCommandId = EAknCmdHelp; + } + else + { + item.iData.iCommandId = iIdCounter++; + } + + item.iData.iCascadeId = 0; + item.iNode = menuItem; + item.iIsCascade = EFalse; + iMenuItems.AppendL( item ); + + retval = 1; + } + } + + if( name == KXnMenu ) + { + // main level menu or submenu (cascade) + item.iData.iCommandId = iIdCounter++; + + if( aParentIndex == -1 ) + { + item.iData.iCascadeId = R_AVKON_MENUPANE_EMPTY; + } + else + { + item.iData.iCascadeId = iIdCounter++; + } + + item.iNode = aNode; + item.iIsCascade = ETrue; + iMenuItems.AppendL( item ); + + TInt currentIndex( iMenuItems.Count() - 1 ); + + RPointerArray< CXnNodePluginIf > children( aNode->ChildrenL() ); + CleanupClosePushL( children ); + + TInt count( 0 ); + + for( TInt i = 0; i < children.Count(); i++ ) + { + count += AddMenuItemL( currentIndex, children[i], aGroups ); + } + + if( aParentIndex != -1 && count == 0 ) + { + // Empty submenu, don't show it + iMenuItems.Delete( currentIndex ); + // Reverse counter as well + iIdCounter -= 2; + } + + CleanupStack::PopAndDestroy( &children ); + + retval = count; + } + + return retval; + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::PopulateMenuL +// +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::PopulateMenuL() + { + 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 ) + { + widgetSpecific = ETrue; + break; + } + } + + TBool widgetsShown( iUiEngine->WidgetsVisible() ); + + RPointerArray< const TDesC8 > groups; + CleanupClosePushL( groups ); + + if( iUiEngine->EditMode() ) + { + groups.AppendL( &KEditMode ); + } + else + { + groups.AppendL( widgetSpecific ? &KWidgetSpecific : &KViewSpecific ); + groups.AppendL( widgetsShown ? &KWidgetsShown : &KWidgetsHidden ); + } + + groups.AppendL( &KAlwaysShown ); + + // Recursively add menuitems + AddMenuItemL( -1, iMenuBarNode, groups ); + + CleanupStack::PopAndDestroy( &groups ); + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::OfferKeyEventL +// ----------------------------------------------------------------------------- +// +TKeyResponse CXnMenuAdapter::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) + { + TKeyResponse resp( EKeyWasNotConsumed ); + + if( IsMenuFocused() && aKeyEvent.iScanCode == EStdKeyNo ) + { + StopDisplayingMenu(); + + iKeyEventNode = NULL; + + return resp; + } + + const TDesC8* pos( &KNullDesC8 ); + + if( aKeyEvent.iScanCode == EStdKeyDevice0 ) + { + pos = &XnPropertyNames::softkey::type::KLeft; + } + else if( aKeyEvent.iScanCode == EStdKeyDevice1 ) + { + pos = &XnPropertyNames::softkey::type::KRight; + } + else if( aKeyEvent.iScanCode == EStdKeyDevice3 ) + { + pos = &XnPropertyNames::softkey::type::KMiddle; + } + + if( aType == EEventKeyDown ) + { + iKeyEventNode = FindSoftkeyNodeL( *pos ); + } + + if( aKeyEvent.iScanCode == EStdKeyDevice0 || + aKeyEvent.iScanCode == EStdKeyDevice1 || + aKeyEvent.iScanCode == EStdKeyDevice3 ) + { + CXnNodePluginIf* node( FindSoftkeyNodeL( *pos ) ); + + if( node && node == iKeyEventNode ) + { + // Let base class handle the event + resp = CXnControlAdapter::OfferKeyEventL( aKeyEvent, aType ); + } + } + + if( aType == EEventKeyUp ) + { + iKeyEventNode = NULL; + } + + return resp; + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::HandlePointerEventL +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + CXnNodePluginIf* node( FindSoftkeyItemByPosition( aPointerEvent.iParentPosition ) ); + + if( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + // The sofkey node which received the button down event + iPointerEventNode = node; + } + + if( node && node == iPointerEventNode ) + { + iUiEngine->DisableRenderUiLC(); + + // Handle event if location is in the grabbing node's area + CXnControlAdapter::HandlePointerEventL( aPointerEvent ); + + CleanupStack::PopAndDestroy(); + } + + if( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + // Reset grabbing node after the up event + iPointerEventNode = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::DoEnterPowerSaveModeL +// Enter power save mode +// ----------------------------------------------------------------------------- +void CXnMenuAdapter::DoEnterPowerSaveModeL(TModeEvent /*aEvent*/) + { + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::DoExitPowerSaveModeL +// Enter power save mode +// ----------------------------------------------------------------------------- +void CXnMenuAdapter::DoExitPowerSaveModeL(TModeEvent /*aEvent*/) + { + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::RestoreMenuL +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::RestoreMenuL( CCoeControl* aMenuControl, TInt aResourceId, + TMenuType aType ) + { + // let all menu pane resources propogate to default implementation, + // otherwise panic when trying to display menu + if ( aType == MEikMenuObserver::EMenuPane ) + { + if ( !( KMenuCommandFirst <= aResourceId && + aResourceId <= KMenuCommandLast ) + && aResourceId != R_AVKON_MENUPANE_EMPTY ) + { + MEikMenuObserver::RestoreMenuL( aMenuControl,aResourceId, aType ); + } + else + { + AddItemsToMenuPaneL( ( CEikMenuPane* )aMenuControl, aResourceId ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::DynInitMenuPaneL +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + if ( aResourceId == R_AVKON_MENUPANE_EMPTY ) + { + RestoreMenuL( aMenuPane, aResourceId, MEikMenuObserver::EMenuPane ); + } + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::SetEmphasis +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::SetEmphasis( CCoeControl* aMenuControl, + TBool aEmphasis ) + { + if ( iMenuBar && aMenuControl == iMenuBar ) + { + CXnAppUiAdapter* appui( + static_cast< CXnAppUiAdapter* >( iAvkonAppUi ) ); + + if ( aEmphasis && !iMenuShown ) + { + iMenuShown = ETrue; + + TRAP_IGNORE( appui->AddToStackL( appui->View(), + iMenuBar, + ECoeStackPriorityMenu ) ); + + iMenuBar->MakeVisible( ETrue ); + } + else if ( !aEmphasis && iMenuShown ) + { + iMenuShown = EFalse; + + appui->RemoveFromStack( iMenuBar ); + + iMenuBar->MakeVisible( EFalse ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::ProcessCommandL +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::ProcessCommandL( TInt aCommand ) + { + if ( ( KMenuCommandFirst <= aCommand && aCommand <= KMenuCommandLast ) || + aCommand == EAknCmdHelp ) + { + // find item for this command + for ( TInt i = 0; i< iMenuItems.Count(); i++ ) + { + if ( iMenuItems[i].iData.iCommandId == aCommand ) + { + CXnNodePluginIf* node( iMenuItems[i].iNode ); + + if ( node ) + { + StopDisplayingMenu(); + + iUiEngine->DisableRenderUiLC(); + + node->SetStateL( XnPropertyNames::style::common::KActive ); + + CleanupStack::PopAndDestroy(); + + break; + } + } + } + } + else + { + StopDisplayingMenu(); + + if( aCommand == EEikCmdEditPaste ) + { + // Paste event for AknCcpuSupport + TKeyEvent pasteEvent = + { EKeyF18, EEikCmdEditPaste, EModifierCtrl, 1 }; + + iCoeEnv->SimulateKeyEventL( pasteEvent, EEventKey ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::SetContainerL +// +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::SetContainerL( CEikButtonGroupContainer& aContainer ) + { + TBool updateNeeded( EFalse ); + + TInt statusPaneId( iAvkonAppUi->StatusPane()->CurrentLayoutResId() ); + + if(iPreviousMenuPaneId != statusPaneId) + { + updateNeeded = ETrue; + iPreviousMenuPaneId = statusPaneId; + } + + if((&aContainer) && (iContainer != &aContainer || updateNeeded)) + { + iUpdateLskAppearance = ETrue; + iUpdateMskAppearance = ETrue; + iUpdateRskAppearance = ETrue; + } + + iContainer = &aContainer; + + UpdateSoftkeyAppearancesL(); + + if (iContainer) + { + iContainer->DrawNow(); + } + } + +//-------------------------------------------------------------- +// CXnMenuAdapter::IsMenuFocused +// ------------------------------------------------------------ +TBool CXnMenuAdapter::IsMenuFocused() + { + return iMenuShown; + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::TryDisplayingMenuL +// Displays options menu if it is defined for the softkey item +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::TryDisplayingMenuL( const TDesC& aMenuNodeId ) + { + HBufC8* id = CnvUtfConverter::ConvertFromUnicodeToUtf8L( aMenuNodeId ); + CleanupStack::PushL( id ); + CXnNodePluginIf* node( iUiEngine->FindNodeByIdL( *id, iRootNode->Namespace() ) ); + CleanupStack::PopAndDestroy( id ); + + if( node && node->Type()->Type() == KXnMenu ) + { + TryDisplayingMenuL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::TryDisplayingMenuL +// Displays options menu if it is defined for the softkey item +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::TryDisplayingMenuL() + { + StopDisplayingMenu(); + + CreateMenuBarL(); + + if ( iMenuBar ) + { + CEikMenuBarTitle* title = new( ELeave ) CEikMenuBarTitle; + CleanupStack::PushL( title ); + + title->iData.iMenuPaneResourceId = R_AVKON_MENUPANE_EMPTY; + title->iTitleFlags = 0; + + // this cannot be done earlyer, than this callback + iMenuBar->TitleArray()->AddTitleL( title ); + CleanupStack::Pop( title ); + + iMenuBar->TryDisplayMenuBarL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::StopDisplayingMenu +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::StopDisplayingMenu() + { + if( iMenuShown && iMenuBar ) + { + iMenuBar->StopDisplayingMenuBar(); + } + } + +// --------------------------------------------------------------------------- +// CXnMenuAdapter::CreateMenuBarL +// --------------------------------------------------------------------------- +// +void CXnMenuAdapter::CreateMenuBarL() + { + if ( iMenuBar ) + { + // All ready created + return; + } + + // Create + RPointerArray< CXnNodePluginIf > children( iRootNode->ChildrenL() ); + CleanupClosePushL( children ); + + for( TInt i = 0; i < children.Count(); i++ ) + { + CXnNodePluginIf* node( children[i] ); + + TPtrC8 type( node->Type()->Type() ); + + // Currently only one menubar is allowed, + // but it can be assigned to any of the CBAs + // To change this, we have to create and maintain a list of menubars + if( type == KXnMenu ) + { + iMenuBarNode = node; + + iMenuBar = new ( ELeave ) CEikMenuBar; + iMenuBar->ConstructL( this ); + iMenuBar->SetMenuType( MenuTypeL( *iRootNode ) ); + + // All done + break; + } + } + CleanupStack::PopAndDestroy( &children ); + } + +//-------------------------------------------------------------- +// CXnMenuAdapter::HandleResourceChange +// Handles a change to the control's resources of type aType +// ------------------------------------------------------------ +void CXnMenuAdapter::HandleResourceChange( TInt aType ) + { + if( iMenuBar ) + { + iMenuBar->HandleResourceChange( aType ); + } + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::SetSoftKeyImageL +// +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::SetSoftKeyImageL( + CFbsBitmap* aBitmap, + CFbsBitmap* aMask, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos, + CXnNodeAppIf* aNode, + TBool aPreserveAspectRatio, TBool aInvertMask, + TBool aTransferOwnership) + { + if( ( !aBitmap && !aMask ) || aPos == XnMenuInterface::MXnMenuInterface::ECenter ) + { + // No images present and image can be set only to lsk or rsk + User::Leave( KErrArgument ); + } + + CXnSoftkeyItem* softkey(NULL); + + if( aPos == XnMenuInterface::MXnMenuInterface::ELeft) + { + if( aNode ) + { + softkey = SoftkeyItemL( aNode ); + } + else + { + softkey = SoftkeyItemL(CEikButtonGroupContainer::ELeftSoftkeyPosition); + } + iUpdateLskAppearance = ETrue; + } + else if(aPos == XnMenuInterface::MXnMenuInterface::ERight) + { + if( aNode ) + { + softkey = SoftkeyItemL( aNode ); + } + else + { + softkey = SoftkeyItemL(CEikButtonGroupContainer::ERightSoftkeyPosition); + } + iUpdateRskAppearance = ETrue; + } + + if(softkey) + { + softkey->Reset(); + softkey->iImageOn = ETrue; + + // Save new icon data + softkey->iBitmap = aBitmap; + softkey->iMask = aMask; + softkey->iPreserveAspectRatio = aPreserveAspectRatio; + softkey->iInvertMask = aInvertMask; + softkey->iOwnBitmaps = aTransferOwnership; + // Image set, mark node as dirty + softkey->iNode->SetDirtyL(); + + } + } + +#if 0 // MSK icon change +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::SetSoftKeyImageL +// +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::SetSoftKeyImageL( const TAknsItemID& aId, + const TDesC& aBmpFile, + const TInt32 aBmp, + const TInt32 aBmpM, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos, + TBool /*aEnable*/ ) + { + CXnSoftkeyItem* softkey( NULL ); + + switch( aPos ) + { + case XnMenuInterface::MXnMenuInterface::ECenter: + { + softkey = SoftkeyItemL( CEikButtonGroupContainer::EMiddleSoftkeyPosition ); + iUpdateMskAppearance = ETrue; + break; + } + // Currently only MSK icon updating supported here + case XnMenuInterface::MXnMenuInterface::ELeft: + case XnMenuInterface::MXnMenuInterface::ERight: + default: + { + break; + } + } + + if( softkey ) + { + softkey->Reset(); + softkey->iImageOn = ETrue; + + // Save new icon data + softkey->iBitmap = NULL; + softkey->iMask = NULL; + softkey->iPreserveAspectRatio = EFalse; + softkey->iInvertMask = EFalse; + softkey->iOwnBitmaps = ETrue; + delete softkey->iBmpFile; + softkey->iBmpFile = NULL; + softkey->iBmpFile = aBmpFile.AllocL(); + softkey->iId.Set( aId ); + softkey->iBmp = aBmp; + softkey->iBmpM = aBmpM; + + // Image set, mark node as dirty + softkey->iNode->SetDirtyL(); + } + } +#endif // MSK icon change + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::SetSoftKeyTextL +// +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::SetSoftKeyTextL( const TDesC& aText, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ) + { + CXnSoftkeyItem* softkey(NULL); + + switch( aPos ) + { + case XnMenuInterface::MXnMenuInterface::ELeft: + softkey = SoftkeyItemL(CEikButtonGroupContainer::ELeftSoftkeyPosition); + iUpdateLskAppearance = ETrue; + break; + case XnMenuInterface::MXnMenuInterface::ERight: + softkey = SoftkeyItemL(CEikButtonGroupContainer::ERightSoftkeyPosition); + iUpdateRskAppearance = ETrue; + break; + case XnMenuInterface::MXnMenuInterface::ECenter: + softkey = SoftkeyItemL(CEikButtonGroupContainer::EMiddleSoftkeyPosition); + iUpdateMskAppearance = ETrue; + break; + default: + break; + } + if(softkey) + { + softkey->Reset(); + + softkey->iImageOn = EFalse; + + softkey->iLabel = aText.AllocL(); + // Text set, mark parent as dirty + softkey->iNode->SetDirtyL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::SetSoftKeyL +// +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::SetSoftKeyL( CXnNodePluginIf* aSoftkeyNode, + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ) + { + + CXnSoftkeyItem* item = AppendSoftkeyItemL(aSoftkeyNode); + switch(aPos) + { + case XnMenuInterface::MXnMenuInterface::ELeft: + if(item) + { + iVisibleLSK = item; + } + else + { + iVisibleLSK = NULL; + } + iUpdateLskAppearance = ETrue; + break; + case XnMenuInterface::MXnMenuInterface::ECenter: + if(item) + { + iVisibleMSK = item; + } + else + { + iVisibleMSK = NULL; + } + iUpdateMskAppearance = ETrue; + break; + case XnMenuInterface::MXnMenuInterface::ERight: + if(item) + { + iVisibleRSK = item; + } + else + { + iVisibleRSK = NULL; + } + iUpdateRskAppearance = ETrue; + break; + } + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::SoftKeyL +// +// ----------------------------------------------------------------------------- +// +CXnNodePluginIf* CXnMenuAdapter::SoftKeyL( XnMenuInterface::MXnMenuInterface::TSoftKeyPosition aPos ) + { + CXnNodePluginIf* node(NULL); + CXnSoftkeyItem* item = SoftkeyItemL(aPos); + if(item) + { + node = item->iNode; + } + return node; + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::HandleScreenDeviceChangedL +// +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::HandleScreenDeviceChangedL() + { + CXnSoftkeyItem* left = + SoftkeyItemL(CEikButtonGroupContainer::ELeftSoftkeyPosition); + + CXnSoftkeyItem* middle = + SoftkeyItemL(CEikButtonGroupContainer::EMiddleSoftkeyPosition); + CXnSoftkeyItem* right = + SoftkeyItemL(CEikButtonGroupContainer::ERightSoftkeyPosition); + + if(left && left->iImageOn) + { + iUpdateLskAppearance = ETrue; + left->iNode->SetDirtyL(); + } + if(right && right->iImageOn) + { + iUpdateRskAppearance = ETrue; + right->iNode->SetDirtyL(); + } + if(middle && middle->iImageOn) + { + iUpdateMskAppearance = ETrue; + middle->iNode->SetDirtyL(); + } + CXnControlAdapter::HandleScreenDeviceChangedL(); + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::HandleMenuPropertyChangeL +// Change softkey appearance +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::HandleMenuPropertyChangeL(CXnNodePluginIf* aNode, CXnProperty* aProperty) + { + if ( !aNode ) + { + return; + } + + const TDesC8& type( aNode->Type()->Type() ); + + if ( type != softkey::KNodeName) + { + return; + } + + // Find target softkey + CXnSoftkeyItem* softkey( SoftkeyItemL( aNode ) ); + + if ( !softkey ) + { + return; + } + + SetUpdateAppearanceL( softkey ); + + const TDesC8* name( &KNullDesC8() ); + + if ( aProperty ) + { + name = &aProperty->Property()->Name(); + } + + if ( *name == menu::KLabel ) + { + softkey->Reset(); + softkey->iImageOn = EFalse; + softkey->iLabel = aProperty->StringValueL(); + } + else if ( *name == style::common::KDisplay ) + { + if ( aProperty->StringValue() == XnPropertyNames::style::common::display::KNone ) + { + if ( softkey->iPosition == CEikButtonGroupContainer::ELeftSoftkeyPosition ) + { + EikSoftkeyImage::SetLabel( iContainer,ETrue ); + iContainer->SetCommandL( CEikButtonGroupContainer::ELeftSoftkeyPosition,KCBACommandFirst, KNullDesC ); + } + else if ( softkey->iPosition == CEikButtonGroupContainer::ERightSoftkeyPosition ) + { + EikSoftkeyImage::SetLabel( iContainer,EFalse ); + iContainer->SetCommandL( CEikButtonGroupContainer::ERightSoftkeyPosition,KCBACommandSecond, KNullDesC ); + } + else if ( softkey->iPosition == CEikButtonGroupContainer::EMiddleSoftkeyPosition ) + { + iContainer->SetCommandL( CEikButtonGroupContainer::EMiddleSoftkeyPosition,KCBACommandMiddle, KNullDesC ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::SetObserver +// +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::SetObserver( XnMenuInterface::MXnMenuObserver& aObserver ) + { + iObserver = &aObserver; + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::RemoveObserver +// +// ----------------------------------------------------------------------------- +// +void CXnMenuAdapter::RemoveObserver() + { + iObserver = NULL; + } + +// --------------------------------------------------------------------------- +// CXnMenuAdapter::FindSoftKeyNodeByPosition +// --------------------------------------------------------------------------- +// +TBool CXnMenuAdapter::FindSoftKeyNodeByPosition( + const TPoint& aPosition, + CXnNodePluginIf*& aNode ) + { + CXnNodePluginIf* ret = FindSoftkeyItemByPosition(aPosition); + aNode = ret; + return (ret?ETrue:EFalse); + } +// --------------------------------------------------------------------------- +// CXnMenuAdapter::ButtonTouchableRectByPosition +// Gets a CBA button rectangle. Touchable are is larger than controls rect +// --------------------------------------------------------------------------- +// +TRect CXnMenuAdapter::ButtonTouchableRectByPosition( TInt aPosition) + { + TRect rect( 0, 0, 0, 0 ); + + TRect button1Rect( 0, 0, 0, 0 ); + TRect button2Rect( 0, 0, 0, 0 ); + TRect buttonMSKRect( 0, 0, 0, 0 ); + + // In touch layouts the button areas are read from the + // layout data because they are larger than the actual + // control size. +#ifndef _AVKON_CBA_LSC + CCoeControl* container = iContainer->ButtonGroup()->AsControl(); + TRect containerRect(container->PositionRelativeToScreen(),container->Size()); + TAknLayoutRect layoutRect; + layoutRect.LayoutRect( + containerRect, + AknLayoutScalable_Avkon::control_pane_g6( 0 ).LayoutLine() ); + button1Rect = layoutRect.Rect(); + + layoutRect.LayoutRect( + containerRect, + AknLayoutScalable_Avkon::control_pane_g8( 0 ).LayoutLine() ); + button2Rect = layoutRect.Rect(); + + layoutRect.LayoutRect( + containerRect, + AknLayoutScalable_Avkon::control_pane_g7( 0 ).LayoutLine() ); + buttonMSKRect = layoutRect.Rect(); +#else + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + button1Rect = SoftkeyRectTopTouch(); + button2Rect= SoftkeyRectBottomTouch(); + + } + else // portrait + { + button1Rect = SoftkeyRectLeftTouch(); + button2Rect = SoftkeyRectRightTouch(); + } +#endif + + switch ( aPosition ) + { + case CEikButtonGroupContainer::ELeftSoftkeyPosition: + { + rect = button1Rect; + break; + } + + case CEikButtonGroupContainer::ERightSoftkeyPosition: + { + rect = button2Rect; + break; + } + + case CEikButtonGroupContainer::EMiddleSoftkeyPosition: + { + rect = buttonMSKRect; + break; + } + + default: + { + break; + } + } + + + return rect; + } + +// --------------------------------------------------------------------------- +// CXnMenuAdapter::FindSoftkeyNodeL +// --------------------------------------------------------------------------- +// +CXnNodePluginIf* CXnMenuAdapter::FindSoftkeyNodeL(const TDesC8& aNodeType) + { + CXnNodePluginIf* ret(0); + + RPointerArray< CXnNodePluginIf > children( iRootNode->ChildrenL() ); + CleanupClosePushL( children ); + for(TInt i=0;iType()->Type() == XnPropertyNames::softkey::KNodeName) + { + if( SoftkeyPlaceL(*children[i]) == aNodeType + && IsNodeVisibleL( *children[i]) ) + { + ret = children[i]; + break; + } + + } + } + CleanupStack::PopAndDestroy( &children ); + return ret; + } + +// --------------------------------------------------------------------------- +// CXnMenuAdapter::UpdateSoftkeyAppearancesL +// --------------------------------------------------------------------------- +// +void CXnMenuAdapter::UpdateSoftkeyAppearancesL() + { + + if(iUpdateLskAppearance) + { + CXnSoftkeyItem* left = + SoftkeyItemL(CEikButtonGroupContainer::ELeftSoftkeyPosition); + if( left ) + { + SetSoftkeyAppearanceL(*left); + } + iUpdateLskAppearance = EFalse; + } + if(iUpdateRskAppearance) + { + CXnSoftkeyItem* right = + SoftkeyItemL(CEikButtonGroupContainer::ERightSoftkeyPosition); + if(right) + { + SetSoftkeyAppearanceL(*right); + } + iUpdateRskAppearance = EFalse; + } + if(iUpdateMskAppearance) + { + CXnSoftkeyItem* middle = + SoftkeyItemL(CEikButtonGroupContainer::EMiddleSoftkeyPosition); + if(middle) + { + SetSoftkeyAppearanceL(*middle); + } + iUpdateMskAppearance = EFalse; + } + } +// --------------------------------------------------------------------------- +// CXnMenuAdapter::ChangeSoftkeyImageL +// --------------------------------------------------------------------------- +// +void CXnMenuAdapter::ChangeSoftkeyImageL(const CXnSoftkeyItem& aSoftkey) + { +#if 0 // MSK icon change + if ( aSoftkey.iPosition == CEikButtonGroupContainer::ELeftSoftkeyPosition || + aSoftkey.iPosition == CEikButtonGroupContainer::ERightSoftkeyPosition ) + { +#endif // MSK icon change + TSize size; + if(AknLayoutUtils::PenEnabled()) + { + size = SoftkeyImageRect(*iContainer,aSoftkey.iPosition).Size(); + } + else + { + size = SoftkeyRectL( *iContainer,aSoftkey.iPosition, aSoftkey.iImageOn ).Size(); + } + + CEikImage* image( PrepareSoftkeyImageL( aSoftkey, size ) ); + TBool left(ETrue); + + if(aSoftkey.iPosition != CEikButtonGroupContainer::ELeftSoftkeyPosition) + { + left = EFalse; + } + EikSoftkeyImage::SetImage( iContainer, *image, left ); +#if 0 // MSK icon change + } + else if ( aSoftkey.iBmpFile ) + { + CEikCba* cba = static_cast< CEikCba* >( iContainer->ButtonGroup() ); + // use iAvkonAppUi + CAknAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + cba->UpdateMSKIconL( + aSoftkey.iId, + aSoftkey.iBmpFile->Des(), + aSoftkey.iBmp, + aSoftkey.iBmpM, + ETrue ); + cba->DrawNow(); + } +#endif // MSK icon change + } + +// --------------------------------------------------------------------------- +// CXnMenuAdapter::AddItemsToMenuPaneL +// --------------------------------------------------------------------------- +// +void CXnMenuAdapter::AddItemsToMenuPaneL(CEikMenuPane* aMenuPane, TInt aResourceId) + { + TInt parentIndexForNotification( 0 ); + + for ( TInt i = 0; i< iMenuItems.Count(); i++ ) + { + // find items belong to this pane + TInt parent( iMenuItems[i].iParentIndex ); + + if ( parent >= 0 ) + { + TInt cid( iMenuItems[parent].iData.iCascadeId ); + + if ( cid == aResourceId ) + { + if ( parent > 0 ) + { + parentIndexForNotification = parent; + break; + } + } + } + } + + TBool selectionEnabled( EFalse ); + TBool isRadio( EFalse ); + + if ( parentIndexForNotification != 0 ) + { + CXnNodePluginIf* node( iMenuItems[parentIndexForNotification].iNode ); + + CXnProperty* property( node->GetPropertyL( _L8( "selectiontype" ) ) ); + + if ( property && property->StringValue() == _L8( "multi" ) ) + { + selectionEnabled = ETrue; + } + else if ( property && property->StringValue() == _L8( "single" ) ) + { + selectionEnabled = ETrue; + isRadio = ETrue; + } + + node->SetStateL( XnPropertyNames::style::common::KActive ); + node->UnsetStateL( XnPropertyNames::style::common::KActive ); + } + + PopulateMenuL(); + + for ( TInt i = 0; i< iMenuItems.Count(); i++ ) + { + // find items belong to this pane + TInt parent( iMenuItems[i].iParentIndex ); + + if ( parent >= 0 ) + { + TInt cid( iMenuItems[parent].iData.iCascadeId ); + + if ( cid == aResourceId ) + { + if ( selectionEnabled ) + { + if ( !isRadio ) + { + iMenuItems[i].iData.iFlags |= + EEikMenuItemCheckBox; + } + else + { + iMenuItems[i].iData.iFlags |= + EEikMenuItemRadioStart| + EEikMenuItemRadioMiddle| + EEikMenuItemRadioEnd; + } + } + + aMenuPane->AddMenuItemL( iMenuItems[i].iData ); + + if ( selectionEnabled ) + { + CXnProperty* property( + iMenuItems[i].iNode->GetPropertyL( XnPropertyNames::menu::KChecked ) ); + + if ( property && property->StringValue() == XnPropertyNames::KTrue ) + { + aMenuPane->SetItemButtonState( + iMenuItems[i].iData.iCommandId, EEikMenuItemSymbolOn ); + } + } + } + } + } // for end + } + +// --------------------------------------------------------------------------- +// CXnMenuAdapter::AppendSoftkeyItemL +// --------------------------------------------------------------------------- +// +CXnSoftkeyItem* CXnMenuAdapter::AppendSoftkeyItemL(CXnNodePluginIf* aNode) + { + if(!aNode) + { + return NULL; + } + CXnProperty* property = + aNode->GetPropertyL( XnPropertyNames::softkey::KTypeAttribute ); + if(!property) + { + return NULL; + } + const TDesC8& skType = property->StringValue(); + if( skType != XnPropertyNames::softkey::type::KRight && + skType != XnPropertyNames::softkey::type::KLeft && + skType != XnPropertyNames::softkey::type::KMiddle ) + { + return NULL; + } + for( TInt i=0; iiNode == aNode ) + { + return iSoftkeyItems[i]; + } + } + CXnSoftkeyItem* softkey(0); + softkey = new (ELeave) CXnSoftkeyItem; + CleanupStack::PushL(softkey); + + if ( skType == XnPropertyNames::softkey::type::KRight ) + { + softkey->iPosition = CEikButtonGroupContainer::ERightSoftkeyPosition; + softkey->iCommandId = KCBACommandSecond; + } + else if ( skType == XnPropertyNames::softkey::type::KLeft ) + { + softkey->iPosition = CEikButtonGroupContainer::ELeftSoftkeyPosition; + softkey->iCommandId = KCBACommandFirst; + } + else + { + softkey->iPosition = CEikButtonGroupContainer::EMiddleSoftkeyPosition; + softkey->iCommandId = KCBACommandMiddle; + } + + softkey->iNode = aNode; + + CXnProperty* labelProp( aNode->LabelL() ); + CXnProperty* targetProp( aNode->GetPropertyL(KXnTarget) ); + + if(labelProp) + { + softkey->iImageOn = EFalse; + softkey->iLabel = labelProp->StringValueL(); + } + else if(targetProp) + { + softkey->iImageOn = EFalse; + softkey->iLabel = FindSoftkeyLabelL(aNode); + } +#if 0 // MSK icon change + else + { + InitSoftkeyItemImageL( *softkey ); + } +#else // MSK icon change + else if(softkey->iPosition != CEikButtonGroupContainer::EMiddleSoftkeyPosition) + { // we can't set own image to middle softkey + InitSoftkeyItemImageL( *softkey ); + } +#endif // MSK icon change + softkey->iUpdateAppearance = ETrue; + iSoftkeyItems.AppendL(softkey); + CleanupStack::Pop(softkey); + return softkey; + } +// --------------------------------------------------------------------------- +// CXnMenuAdapter::SoftkeyPlaceL +// --------------------------------------------------------------------------- +// +const TDesC8& CXnMenuAdapter::SoftkeyPlaceL(CXnNodePluginIf& aNode) + { + CXnProperty* property = + aNode.GetPropertyL( XnPropertyNames::softkey::KTypeAttribute ); + + if( property) + { + return property->StringValue(); + } + return KNullDesC8; + + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::FindSoftkeyItemByPosition +// +// ----------------------------------------------------------------------------- +CXnNodePluginIf* CXnMenuAdapter::FindSoftkeyItemByPosition( const TPoint& aPosition ) + { + CXnNodePluginIf* softkey(0); + TRAP_IGNORE( softkey = DoFindSoftkeyItemByPositionL( aPosition ) ); + return softkey; + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::DoFindSoftkeyItemByPositionL +// +// ----------------------------------------------------------------------------- +CXnNodePluginIf* CXnMenuAdapter::DoFindSoftkeyItemByPositionL( const TPoint& aPosition ) + { + TRect lsk( ButtonTouchableRectByPosition(CEikButtonGroupContainer::ELeftSoftkeyPosition) ); + TRect rsk( ButtonTouchableRectByPosition(CEikButtonGroupContainer::ERightSoftkeyPosition) ); + TRect msk( ButtonTouchableRectByPosition(CEikButtonGroupContainer::EMiddleSoftkeyPosition) ); + + CXnNodePluginIf* softkey(NULL); + CXnSoftkeyItem* item(NULL); + if ( lsk.Contains(aPosition) ) + { + item = SoftkeyItemL(CEikButtonGroupContainer::ELeftSoftkeyPosition); + } + else if(msk.Contains(aPosition)) + { + item = SoftkeyItemL(CEikButtonGroupContainer::EMiddleSoftkeyPosition); + } + else if( rsk.Contains(aPosition) ) + { + item = SoftkeyItemL(CEikButtonGroupContainer::ERightSoftkeyPosition); + } + if(item) + { + softkey = item->iNode; + } + return softkey; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +CXnSoftkeyItem* CXnMenuAdapter::SoftkeyItemL(TInt aPosition) + { + CXnSoftkeyItem* softkeyItem(0); + if(iVisibleLSK && aPosition == CEikButtonGroupContainer::ELeftSoftkeyPosition) + { + return iVisibleLSK; + } + else if(iVisibleRSK && aPosition == CEikButtonGroupContainer::ERightSoftkeyPosition) + { + return iVisibleRSK; + } + else if(iVisibleMSK && aPosition == CEikButtonGroupContainer::EMiddleSoftkeyPosition) + { + return iVisibleMSK; + } + + // return default + for(TInt i=0;iiPosition == aPosition && + softkeyItem->iDefault && + IsNodeVisibleL(*softkeyItem->iNode)) + { + return softkeyItem; + } + } + return NULL; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +CXnSoftkeyItem* CXnMenuAdapter::SoftkeyItemL(CXnNodePluginIf* aNode) + { + CXnSoftkeyItem* softkeyItem(0); + for(TInt i=0;iiNode == aNode) + { + return softkeyItem; + } + } + return NULL; + } + +CXnSoftkeyItem* CXnMenuAdapter::SoftkeyItemL(CXnNodeAppIf* aNode) + { + CXnSoftkeyItem* softkeyItem(0); + for(TInt i=0;iiNode->AppIfL()) == aNode) + { + return softkeyItem; + } + } + return NULL; + } +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + +void CXnMenuAdapter::SetUpdateAppearanceL(CXnSoftkeyItem* aItem) + { + if ( aItem && IsNodeVisibleL( *aItem->iNode ) ) + { + aItem->iNode->SetDirtyL(); + + switch ( aItem->iPosition ) + { + case CEikButtonGroupContainer::ELeftSoftkeyPosition: + iUpdateLskAppearance = ETrue; + iVisibleLSK = NULL; + break; + case CEikButtonGroupContainer::EMiddleSoftkeyPosition: + iUpdateMskAppearance = ETrue; + iVisibleMSK = NULL; + break; + case CEikButtonGroupContainer::ERightSoftkeyPosition: + iUpdateRskAppearance = ETrue; + iVisibleRSK = NULL; + break; + } + } + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::FindWidgetMenuItemL +// +// ----------------------------------------------------------------------------- +CXnNodePluginIf* CXnMenuAdapter::FindWidgetMenuItemL( CXnNodePluginIf* aNode ) + { + CXnNodePluginIf* focusedNode( iUiEngine->FocusedNodeL() ); + + CXnNodePluginIf* menuItem( NULL ); + + if ( focusedNode && aNode ) + { + // Get element + CXnNodePluginIf& pluginNode( iUiEngine->PluginNodeL( focusedNode ) ); + + RPointerArray< CXnNodePluginIf > children( pluginNode.ChildrenL() ); + CleanupClosePushL( children ); + + CXnNodePluginIf* widgetExtNode( NULL ); + + if( children.Count() > 0 ) + { + // children[0] must be element + widgetExtNode = FindChildL( *children[0], KXnMenuExtension ); + } + + if( !widgetExtNode ) + { + widgetExtNode = focusedNode; + } + + if ( widgetExtNode ) + { + CXnProperty* prop( aNode->GetPropertyL( KXnSource ) ); + + if ( prop ) + { + const TDesC8& source( prop->StringValue() ); + + // Try to find + menuItem = FindChildL( *widgetExtNode, + KXnMenuItem, + source ); + + if ( !menuItem ) + { + // Try to find + menuItem = FindChildL( *widgetExtNode, + KXnDynMenuItem, + source ); + } + } + } + + CleanupStack::PopAndDestroy( &children ); + } + + if( menuItem && IsNodeVisibleL( *menuItem ) ) + { + return menuItem; + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnMenuAdapter::FindSoftkeyLabelL +// +// ----------------------------------------------------------------------------- +HBufC* CXnMenuAdapter::FindSoftkeyLabelL( CXnNodePluginIf* aNode ) + { + if( !aNode ) + { + return NULL; + } + + CXnProperty* targerProp( aNode->GetPropertyL( KXnTarget ) ); + + if ( targerProp && iRootNode ) + { + CXnNodePluginIf* widgetSoftkeyNode( + FindChildL( *iRootNode, + KXnWidgetSoftkey, + targerProp->StringValue() ) ); + + if ( widgetSoftkeyNode ) + { + CXnProperty* label( widgetSoftkeyNode->LabelL() ); + + if( label ) + { + return label->StringValueL(); + } + } + } + + return NULL;; + } + +//end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenufactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenufactory.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,124 @@ +/* +* 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 factory creating container for a menu +* +*/ + + +#include +#include +#include + +#include "xnmenuadapter.h" +#include "xnmenufactory.h" +#include "xnmenu.h" + +#include "xntype.h" +#include "xncomponent.h" +#include "xnnodepluginif.h" +#include +#include "xndomnode.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +MXnComponentFactory::TXnComponentFactoryResponse CXnMenuFactory::MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent + + ) + { + MXnComponentFactory::TXnComponentFactoryResponse retVal = + MXnComponentFactory::EXnFactoryResponseComponentNotSupported; + // Check that the given type of a control is parent (or ancestor) of this control + if(aNode.Type()->Type() == KXnMenuBar) + { + CXnMenu* container = CXnMenu::NewL(); + aTargetComponent = static_cast(container); + retVal = MXnComponentFactory::EXnFactoryResponseComponentConstructed; + return retVal; + } + return retVal; + } + +CXnControlAdapter* CXnMenuFactory::MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent + ) + { + CXnControlAdapter* controlAdapter = CXnMenuAdapter::NewL( aParent, aNode ); + return controlAdapter; + } + +// ----------------------------------------------------------------------------- +// CXnMenuFactory::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnMenuFactory* CXnMenuFactory::NewL() + { + CXnMenuFactory* self = new( ELeave ) CXnMenuFactory; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnMenuFactory::CXnMenuFactory +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnMenuFactory::CXnMenuFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnMenuFactory::~CXnMenuFactory +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnMenuFactory::~CXnMenuFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnMenuFactory::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnMenuFactory::ConstructL() + { + } + + +// Define the interface UIDs +const TImplementationProxy ImplementationTable[] = + { +#ifdef __EABI__ + IMPLEMENTATION_PROXY_ENTRY(AI3_UID_RENDERING_PLUGIN_MENUFACTORY_IMPLEMENTATION, CXnMenuFactory::NewL) +#else + {{AI3_UID_RENDERING_PLUGIN_MENUFACTORY_IMPLEMENTATION}, CXnMenuFactory::NewL} +#endif + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Building information file +* +*/ + + +#include + +PRJ_PLATFORMS + +ARMV5 WINSCW + +PRJ_EXPORTS + +PRJ_MMPFILES + +xnnewstickerfactory.mmp diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/group/xnnewstickerfactory.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/group/xnnewstickerfactory.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,62 @@ +/* +* 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: +* +*/ + + +#include +#include + +TARGET xn3newstickerfactory.dll +TARGETTYPE PLUGIN +UID 0x10009d8d AI3_UID_RENDERING_PLUGIN_NEWSTICKERFACTORY + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE xnnewstickerfactory.cpp +SOURCE xnnewsticker.cpp +SOURCE xnnewstickeradapter.cpp +SOURCE xnnewstickercontrol.cpp +SOURCE xnnewstickersvgcontrol.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY gdi.lib +LIBRARY egul.lib +LIBRARY charconv.lib +LIBRARY aknskins.lib +LIBRARY xn3layoutengine.lib +LIBRARY xn3utils.lib +LIBRARY xn3domdocument.lib +LIBRARY avkon.lib +LIBRARY fbscli.lib +LIBRARY bitgdi.lib +LIBRARY aknicon.lib +LIBRARY svgengine.lib + +LANG SC +START RESOURCE xn3newstickerfactory.rss +#ifdef SYMBIAN_SECURE_ECOM +TARGET xn3newstickerfactory.rsc +#endif +END diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickeradapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickeradapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,460 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Wrapper class for Newsticker text label. +* +*/ + + +#ifndef _XNNEWSTICKERADAPTER_H +#define _XNNEWSTICKERADAPTER_H + +// INCLUDES +#include "xncontroladapter.h" +#include "xnnewsticker.h" + +// FORWARD DECLARATIONS +class CXnNodePluginIf; +class CXnNewstickerControl; +class CXnNewstickerSvgControl; + +// CONSTANTS +// The default values for the newsticker control +const TInt KXnNewstickerDelay = 1000000; // start scrolling after a delay of 1 second +const TInt KXnNewstickerInterval = 100000; // scroll 10 times in a second +const TInt KXnNewstickerScrollAmount = 6; // scroll 6 pixels at time +const TInt KXnNewstickerLoops = 1; // loop amount +const TInt KNoDelay = 0; // No delay to start the animation +const TInt KAnimationTime = 6000000; // The animation lasts 6 seconds + +// CLASS DECLARATION + +/** +* @ingroup group_xnnewstickerfactory +* +* Newsticker adapter class implementation. +* +* @lib xnnewstickerfactory.dll +* @since Series 60 3.2 +*/ +class CXnNewstickerAdapter : public CXnControlAdapter, + XnNewstickerInterface::MXnNewstickerCallbackInterface + { + public: + + /** + * State of the whole control. + */ + enum TState + { + ENotStarted = 1, // No scrolling has been done + EPaused, // Text is shown, but not scrolled + EText, // Text is shown and scrolled continuously + EAnimation, // SVG animation is shown + EScrollEnded // Looping is false and scrolling has ended + }; + + enum TScrollBehaviour + { + EScroll, + ESlide, + EAlternate, + EScrollAlternate + }; + + public: + + /** + * 2 phase construction. + * @param aParent Parent control + * @param aNode UI node + */ + static CXnNewstickerAdapter* NewL(CXnControlAdapter* aParent, CXnNodePluginIf& aNode); + + /** + * Destructor. + */ + virtual ~CXnNewstickerAdapter(); + + public: // New functions + + /** + * Append new title to the end of the title list. + * @param aTitle The new title to add. + */ + void AppendTitleL(const TDesC& aTitle); + + /** + * Insert new title to the end of the title list. + * @param aTitle The new title to add. + * @param aIndex The place to add the title. + */ + void InsertTitleL(const TDesC& aTitle, TInt aIndex); + + /** + * Update title text. + * @param aTitle The new title to add. + * @param aIndex The place to update the title. + */ + void UpdateTitleL(const TDesC& aTitle, TInt aIndex); + + /** + * Delete the title. + * @param aIndex The title index to delete. + */ + void DeleteTitleL(TInt aIndex); + + /** + * Returns index of the currently selected title. + * @return The index of the current title. + */ + TInt CurrentTitleIndex(); + + /** + * Return the title of the given index. + * @param aIndex The index to return the title. + * @return The title of the given index. + */ + const TDesC& Title(TInt aIndex); + + /** + * Set the separator image for all titles. + * @param aIcon The separator image. This must be mif icon. + * @return KErrNone if successful, KErrArgument if the icon is not mif. + */ + TInt SetSeparatorImageL(CGulIcon* aIcon); + + /** + * Delete all titles. + */ + void ClearTitles(); + + /** + * Append the SVG title to be shown. + * @param aByteData The SVG data. + */ + void AppendSvgTitleL(const TDesC8& aByteData); + + /** + * Insert the SVG title to be shown. + * @param aByteData The SVG data. + */ + void InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex); + + /** + * Set callback interface. + * @param aCallback The callback interface pointer. + */ + void SetCallbackInterfaceL( + XnNewstickerInterface::MXnNewstickerCallbackInterface* aCallback); + + /** + * Start showing the titles. + */ + void StartL(); + + /** + * Stop showing the titles. + */ + void StopL(); + + /** + * Show SVG next. + */ + void ShowSvgL(); + + /** + * Callback which will be called by the CPeriodic. + * @param aPtr User defined pointer. + * @return ETrue if the method should be called again. + */ + static TInt PeriodicEventL(TAny * aPtr); + + /** + * Draw background for the newsticker control area. + * @param aRect The visivle area of newsticker component. + * @param aGc Window graphics context. + */ + void DrawBackgroundL(const TRect& aRect, CWindowGc& aGc) const; + + + /** + * Returns the bitmap context. + * @return Bitmap context. + */ + inline CBitmapContext* BufferGc() const { return iBufferGc; }; + + + /** + * Returns the background bitmap + * @return Background bitmap + */ + inline const CFbsBitmap* BackgroundBitmap() const { return iBackgroundBitmap; }; + + /** + * Returns the state of the newsticker control. + * @return Current state. + */ + inline TState CurrentState() const { return iState; }; + + /** + * Returns the current scroll behaviour + * @return current scroll behaviour + */ + inline TInt ScrollBehaviour() const { return iScrollBehaviour; }; + + /** + * Reset periodic timer to set display time. + */ + void SetTimerToDisplaytime(); + + /** + * Reset periodic timer to set scroll delay time. + */ + void SetTimerToScrolltime(); + + public: // from base classes + + // From MXnNewstickerCallbackInterface + /** + * Called when the title has been shown and is now offscreen. + * @param aTitleIndex The title that has been completely shown. + */ + void TitleScrolled(TInt aTitleIndex); + + /** + * See CCoeControl documentation + */ + void SizeChanged(); + + /** + * See CCoeControl documentation + */ + void HandlePointerEventL(const TPointerEvent& aPointerEvent); + + /** + * See CCoeControl documentation + */ + void FocusChanged(TDrawNow aDrawNow); + + /** + * See CCoeControl documentation + */ + TKeyResponse OfferKeyEventL( + const TKeyEvent& aKeyEvent, TEventCode aType); + + /** + * See CXnControlAdapter documentation + */ + void Draw(const TRect& aRect) const; + + /** + * Enter power save mode. This is done when application goes to background or lights go off. + * Derived classes should override this function and stop animations, timers etc. when the function is called. + */ + void DoEnterPowerSaveModeL(TModeEvent aEvent); + + /** + * Exit power save mode. This is done when application comes to foreground or lights go on. + * Derived classes should override this function and restart animations, timers etc. when the function is called. + */ + void DoExitPowerSaveModeL(TModeEvent aEvent); + + /** + * From CXnControlAdapter Handles the property changes. + * @since Series 60 3.1 + * @return void. + */ + void DoHandlePropertyChangeL(CXnProperty* aProperty = NULL); + + /** + * Skin change notification. + * See CXnControlAdapter documentation + */ + void SkinChanged(); + + void ReportNewstickerEventL(const TDesC8& aEventName); + + /** + * See CCoeControl documentation + */ + void DrawNow() const; + + /** + * If newsticker is not focusable, finds and draws focusable parent + */ + TBool DrawFocusableParentL() const; + + private: + + CXnNewstickerAdapter(CXnControlAdapter* aParent, CXnNodePluginIf& aNode); + + void ConstructL(); + + /** + * Sets text properties, such as color, font, etc. + */ + void SetTextPropertiesL(); + + /** + * Sets newsticker timing properties. + */ + void SetNewstickerPropertiesL(); + + /** + * Creates a new doublebuffer for newsticker. + */ + void UpdateDoubleBufferL(); + + /** + * Draws a reconstructed background for newsticker. + */ + void UpdateBackgroundL() const; + + /** + * Same as SizeChanged(), but this is an L function. + */ + void SizeChangedL(); + + /** + * Checks if feed can be started + */ + TBool CheckDisplayL( CXnNodePluginIf& aNode ); + + void RestartL(); + private: + + /** + * The state of the newsticker control. + */ + TState iState; + + /** + * The timer to use for scrolling events. + * Own. + */ + CPeriodic* iPeriodicTimer; + + /** + * The callback interface which is used when a title has been shown. + * Not own. + */ + XnNewstickerInterface::MXnNewstickerCallbackInterface* iCallback; + + /** + * The control handling the text title showing + * Own. + */ + CXnNewstickerControl* iControl; + + /** + * The control handling the svg title showing + * Own. + */ + CXnNewstickerSvgControl* iSvgControl; + + /** + * Delay between loops in microseconds. + */ + TInt iDelay; + + /** + * The interval between ticks. + */ + TInt iInterval; + + /** + * The alternate interval between ticks. + */ + TInt iAlternateInterval; + + /** + * The current interval between ticks. + */ + TInt iCurrentInterval; + + /** + * Amount of loops executed + */ + TInt iLoops; + + /** + * The animation time in microseconds. + */ + TInt iAnimationTime; + + /** + * UI node + * Not own. + */ + CXnNodePluginIf& iNode; + + /** + * Font for control. + * Own. + */ + CFont* iFont; + + /** + * Whether the font needs to be released or not. + */ + TBool iReleaseFont; + + /** + * Bitmap device. Used to draw on the drawing buffer + * Own. + */ + CFbsBitmapDevice* iBufferDevice; + + /** + * Drawing buffer + * Own. + */ + CFbsBitmap* iDrawingBuffer; + + /** + * Bitmap Graphic Context. Used to draw on the drawing buffer + * Own. + */ + CBitmapContext* iBufferGc; + + /** + * Pointer to background bitmap. + * Own. + */ + mutable CFbsBitmap* iBackgroundBitmap; + + /** + * For the display property (content is either shown or not) + */ + TBool iDisplay; + + /** + * For keeping track of the current powersave mode state + */ + TBool iPowerSaveMode; + + /** + * Current scroll behaviour + */ + TInt iScrollBehaviour; + + /** + * Restart animation after title has been updated + */ + TBool iRestartAfterUpdate; + }; + +#endif // XNNEWSTICKERADAPTER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickercontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickercontrol.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,554 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Text scrolling functionality. +* +*/ + + +#ifndef XNNEWSTICKERCONTROL_H +#define XNNEWSTICKERCONTROL_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CXnNewstickerAdapter; +class CFont; + +// CLASS DECLARATION + +/** +* @ingroup group_xnnewstickerfactory +* +* Newsticker control for XUIKON text scrolling functionality. +* +* @lib xn3newstickerfactory.dll +* @since Series 60 3.2 +*/ +class CXnNewstickerControl : public CBase + { + public: + + /** + * Two-phased constructor. + * @param aAdapter Parent control + * @param aLoops Max number of loops to be executed + * @param aScrollAmount The amount of pixels scrolled per iteration + * @param aScrollDelay The interval between iterations + * @param aStartDelay The delay before the animation starts + * @return Pointer to this. + */ + static CXnNewstickerControl* NewL(CXnNewstickerAdapter* aAdapter); + + /** + * Sets newsticker scroll amount. + * @param aScrollAmount A scroll amount. + * @return void + */ + void SetScrollAmount(TInt aScrollAmount); + + /** + * Sets the rect of the visible area. + * @param aContentRect The visible rect. + * @return void + */ + void SetNewstickerRect(TRect& aContentRect); + + /** + * Checks whether a western layout is used. + * @return Returns true if wesern layout is in use. + */ + TBool IsWestern(); + + // Routed from MXnNewstickerInterface. + + /** + * Append new title to the end of the title list. + * @param aTitle The new title to add. + */ + void AppendTitleL(const TDesC& aTitle); + + /** + * Insert new title to the end of the title list. + * @param aTitle The new title to add. + * @param aIndex The place to add the title. + */ + void InsertTitleL(const TDesC& aTitle, TInt aIndex); + + /** + * Update title in the title list. + * @param aTitle The new title to add. + * @param aIndex The place to add the title. + */ + void UpdateTitleL(const TDesC& aTitle, TInt aIndex); + + /** + * Delete the title. + * @param aIndex The title index to delete. + */ + void DeleteTitleL(TInt aIndex); + + /** + * Returns index of the currently selected title. + * @return The index of the current title. + */ + TInt CurrentTitleIndex(); + + /** + * Return the title of the given index. + * @param aIndex The index to return the title. + * @return The title of the given index. + */ + const TDesC& Title(TInt aIndex); + + /** + * Set the separator image for all titles. + * @param aIcon The separator image. This must be mif icon. + * @return KErrNone if successful, KErrArgument if the icon is not mif. + */ + TInt SetSeparatorImageL(CGulIcon* aIcon); + + /** + * Delete all titles. + */ + void ClearTitles(); + + /** + * Append the SVG title to be shown. + * @param aByteData The SVG data. + */ + void AppendSvgTitleL(const TDesC8& aByteData); + + /** + * Insert the SVG title to be shown. + * @param aByteData The SVG data. + */ + void InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex); + + /** + * Return the current svg title. + * @return The current svg title. + */ + const TDesC8& CurrentSvgTitle(); + + /** + * Return the number of titles in the list. + * @return The number of titles in the list. + */ + TInt TitleCount() const; + + /** + * Move to the next title. + */ + void MoveToNextL(); + + /** + * Move to the previous title. + */ + void MoveToPrevL(); + + /** + * Move to first title + */ + void MoveToFirstL(); + + /** + * Move to last title + */ + void MoveToLastL(); + + /** + * Move to the previous title. + */ + void MoveToCurrent(); + + /** + * Sets font for bitmap graphic context. + * @param aFont Font family. + */ + void SetFont(CFont* aFont); + + /** + * Sets text color for bitmap graphic context. + * @param aColor Color in RGB format. + */ + void SetTextColor(TRgb aColor); + + /** + * Sets the underline style for all subsequently drawn text. + * @param aStyle Underline style, which can be either on of off. + */ + void SetTextUnderlineStyle(TFontUnderline aStyle); + + /** + * Sets the strikethrough style for all subsequently drawn text. + * @param aStyle Strikethrough style, which can be either on of off. + */ + void SetTextStrikethroughStyle(TFontStrikethrough aStyle); + + /** + * Destructor + */ + virtual ~CXnNewstickerControl(); + + /** + * Creates background bitmap + */ + void CreateBufferBitmapL(); + + /** + * Advance text and issue a callback to parent + */ + void DoScrollL(); + + /** + * Blit visible stuff to d-buffer. Drawing direction is left-to-right. + */ + void PrepareToDrawLtrL(); + + /** + * Blit visible stuff to d-buffer. Drawing direction is right-to-left. + */ + void PrepareToDrawRtlL(); + + /** + * Blit double buffer to gc. + */ + void Draw(); + + /** + * Blit double buffer to gc. Draws only the last title truncated. + */ + void DrawStatic(); + + /** + * Sets iFirstdrawingOffset as a start position. + */ + void SetBeginningState(); + + /** + * Return the font + * @return font + */ + inline const CFont* Font() { return iFont; }; + + /** + * Return the text color. + * @return Text color. + */ + inline const TRgb TextColor() { return iTextColor; }; + + /** + * Return font underline flag. + * @return Font underline flag. + */ + inline const TFontUnderline TextUnderlineStyle() { return iUnderlining; }; + + /** + * Return the font strikethrough flag. + * @return Font strikethrough flag. + */ + inline const TFontStrikethrough TextStrikethroughStyle() { return iStrikethrough; }; + + /** + * Set scroll looping property + */ + void SetScrollLooping( TBool aLoop ); + + /** + * Return scroll looping property + * @return TBool + */ + TBool ScrollLooping(); + + /** + * @return ETrue if all the text fits on the drawing rect. In that case no scrolling and + * text alignment should be used + */ + TBool TextFitInNewstickerRect(); + + /** + * @param aAlignment ( ELayoutAlignCenter, ELayoutAlignLeft or ELayoutAlignRight ) + * ELayoutAlignLeft default in western, ELayoutAlignRight in AH. + */ + void SetTextAlignment(TInt aAlignment); + + /** + * @return ETrue if the current text fits on + * the drawing rect (when scrolling behaviour is scroll-alternate) + * EFalse otherwise. + * If this is ETrue then no scrolling and text alignment should be used + */ + TBool CalculateCurrentTextFitInNewstickerRect(); + + private: + + CXnNewstickerControl(CXnNewstickerAdapter* aAdapter); + + void ConstructL(); + + /** + * Calculate the indexes and offset after new title has been inserted. + * @param aIndex The inserted index. + */ + void CountIndexAfterInsertL(TInt aIndex); + + /** + * @return ETrue if all the text fits on the drawing rect (when scrolling behaviour is slide) + * EFalse otherwise. + * If this is ETrue then no scrolling and text alignment should be used + */ + TBool CalculateTextFitInNewstickerRect(); + + /** + * @return text alignment from properties if text fits to the rect or scroll behaviour is alternate. + * otherwise returns default alignment value (left in western, right in AH). + */ + CGraphicsContext::TTextAlign TextAlignment(); + /** + * Get the index of the next title that has content + * + * @param aStartSearch The index where to start search + * @param aBackwards Search backwards + * + * @return The next index that has content or -1 if nothing was found + */ + TInt GetNextTitleWithContent( TInt aStartSearch, TBool aBackwards = EFalse ); + + TBool IsVisibleTitles(); + + private: // Data + + /** + * Helper class containing the title text and its length in pixels. + * + * @lib xnnewstickerfactory.dll + * @since Series 60 3.2 + */ + class CTitleData : public CBase + { + public: + + /** + * Destructor + */ + virtual ~CTitleData(); + + /** + * Two-phased constructor. + * @param aTitle The title text. + * @param aLenghtInPixels The lenght of title text in pixels. + * @return Pointer to this. + */ + static CTitleData* NewL(const TDesC& aTitle, TInt aLenghtInPixels); + + /** + * Two-phased constructor. + * @param aTitle The title text. + * @param aLenghtInPixels The lenght of title text in pixels. + * @return Pointer to this. + */ + static CTitleData* NewLC(const TDesC& aTitle, TInt aLenghtInPixels); + + /** + * Two-phased constructor. + * @param aByteData The SVG title. + * @param aLenghtInPixels The lenght of title text in pixels. + * @return Pointer to this. + */ + static CTitleData* NewL(const TDesC8& aByteData); + + /** + * Two-phased constructor. + * @param aByteData The SVG title. + * @param aLenghtInPixels The lenght of title text in pixels. + * @return Pointer to this. + */ + static CTitleData* NewLC(const TDesC8& aByteData); + + /** + * Return the title text. + * @return The title text. + */ + const TDesC& TitleText(); + + /** + * Set new title text + */ + void SetTitleTextL(const TDesC& aTitle); + + /** + * Return the title text lenght in pixels. + * @return The title text lenght in pixels. + */ + TInt TitleTextLengthInPixels(); + + /** + * Return the title text lenght in pixels. + * @param aLenghtInPixels The lenght of title text in pixels. + */ + void SetTitleTextLengthInPixels(TInt aLenghtInPixels); + + /** + * ETrue if the title is svg, EFalse if it is text. + * @return ETrue if the title is svg, EFalse if it is text. + */ + TBool IsSvgTitle(); + + /** + * Return the svg title data. + * @return The svg title data. + */ + const TDesC8& SvgTitleData(); + + private: + + CTitleData(TInt aLenghtInPixels = 0); + + void ConstructL(const TDesC& aTitle); + + void ConstructL(const TDesC8& aByteData); + + private: // Data + + /** + * ETrue if the title is SVG, EFalse if it is text. + */ + TBool iTitleIsSvg; + + /** + * The title text. Owned. + */ + HBufC* iText; + + /** + * The svg title. Owned. + */ + HBufC8* iData; + + /** + * The title text length in pixels. + */ + TInt iTextLenghtInPixels; + }; + + /** + * List of titles to show. + */ + RPointerArray iTitles; + + /** + * The index of the title which is drawn first. + */ + TInt iFirstDrawingTitleIndex; + + /** + * The number of pixels of the first title and separator image which + * have already been shown. In other words, the number of the pixels + * that are not visible in the screen. The iFirstDrawingTitleIndex + * is updated when: + * iFirstDrawingOffset > iTextLenghtInPixels + iSeparatorImageWidth + */ + TInt iFirstDrawingOffset; + + /** + * The width of the.separator image. + */ + TInt iImageWidthInPixels; + + /** + * The index of the title which is selected if user activates the + * control. + */ + TInt iCurrentTitleIndex; + + /** + * The separator image. + * Owned. + */ + CGulIcon* iSeparatorimage; + + /** + * The separator image including the gap between image and text. + * Owned. + */ + TInt iSeparatorImageWidth; + + /** + * Font + * Not own. + */ + CFont* iFont; + + /** + * Baseline for the text. + */ + TInt iTextBaseline; + + /** + * Color for the text + */ + TRgb iTextColor; + + /** + * Whether to use underlining for the text + */ + TFontUnderline iUnderlining; + + /** + * Whether to use strikethrough for the text + */ + TFontStrikethrough iStrikethrough; + + /** + * A rect in which the scrolling text is shown. + */ + TRect iContentRect; + + /** + * Amount of pixels the text moves in a tick. + */ + TInt iSpeed; + + /** + * Whether the scrolling texts will loop or not. + * If false, the scrolling will end at the last index. + */ + TBool iScrollLooping; + + /** + * Whether the text direction is LTR or RTL. + */ + TBool iIsWestern; + + /** + * Parent control adapter + * Not own. + */ + CXnNewstickerAdapter* iAdapter; + + /** + * ETrue if there is only one title, it fits in the rect and + * scroll behaviour is slide + */ + TBool iTextFitInNewstickerRect; + /** + * Text alignment from the properties + */ + TInt iTextAlignment; + }; + +#endif // XNNEWSTICKERCONTROL_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickerfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickerfactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Factory for creating CXnNewsticker -component +* +*/ + + +#ifndef _XNNEWSTICKERFACTORY_H +#define _XNNEWSTICKERFACTORY_H + +// INCLUDES +#include "xncomponentfactory.h" + +// FORWARD DECLARATIONS +class CXnComponent; + +// CLASS DECLARATION + +/** +* @ingroup group_xnnewstickerfactory +* +* Component factory interface for creating UI representations of the newsticker element. +* +* @lib xn3newstickerfactory.dll +* @since Series 60 3.2 +*/ +// inheritance order must be this, despite codescanner warnings +class CXnNewstickerFactory : public MXnComponentFactory, public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnNewstickerFactory* NewL(); + + /** + * Destructor. + */ + virtual ~CXnNewstickerFactory(); + + public: // Functions from base classes + + /** + * Creates the Xuikon component for newsticker component. + * @param aNode Corresponding DOM-node + * @param aTargetComponent Pointer reference to the component to be created. + * @return EXnFactoryResponseComponentConstructed if component created. + */ + virtual TXnComponentFactoryResponse MakeXnComponentL(CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent); + + /** + * From MXnComponentFactory Interface for creating UI control adapter. + * @param aNode Component's node. + * @param aParent Parent of the adapter, which is created here. + * @return Created control adapter. + */ + virtual CXnControlAdapter* MakeXnControlAdapterL(CXnNodePluginIf& aNode, + CXnControlAdapter* aParent); + + private: + + void ConstructL(); + + CXnNewstickerFactory(); + }; + +// Exported factory function required by ECOM-framework +IMPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount); + +#endif // _XNNEWSTICKERFACTORY_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickersvgcontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickersvgcontrol.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,203 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Svg scrolling functionality. +* +*/ + + +#ifndef XNNEWSTICKERSVGCONTROL_H +#define XNNEWSTICKERSVGCONTROL_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// FORWARD DECLARATIONS +class CXnNewstickerAdapter; +class CSvgEngineInterfaceImpl; + +// CLASS DECLARATION + +/** +* @ingroup group_xnnewstickerfactory +* +* Newsticker control for XUIKON svg scrolling functionality. +* +* @lib xn3newstickerfactory.dll +* @since Series 60 3.2 +*/ +class CXnNewstickerSvgControl : public CBase, public MSvgRequestObserver + { + public: + /** + * Two-phased constructor. + * @param aAdapter Parent control + * @return Pointer to this. + */ + static CXnNewstickerSvgControl* NewL(CXnNewstickerAdapter* aAdapter); + + /** + * Destructor + */ + virtual ~CXnNewstickerSvgControl(); + + public: // New functions + /** + * Start showing the SVG until StopL is called. + * @param aSvgData The svg byte data to show. + */ + void StartL(const TDesC8& aSvgData); + + /** + * Stop the SVG showing and started with the StartL. + */ + void StopL(); + + /** + * Sets the rect of the visible area. + * @since S60 v3.1 + * @param aContentRect The visible rect. + * @param aDevice The current graphics device. + * @return void + */ + void SetSvgRectL(TRect& aContentRect, CGraphicsDevice& aDevice ); + + /** + * Draws the SVG into screen + */ + void Draw() const; + + public: //From MSvgRequestObserver + + /** + * This method is called by the SVG Engine when all data for a certain + * step, such as animation frame, have been updated. This usually means + * the off-screen image (passed in to 'ConstructL' of CSvgEngineInterface) + * has been updated. The client usually redraws the image onto + * the screen. + */ + void UpdateScreen(); + + /** + * This method is for future extension, in which an external script engine + * could be used to evaluate a script description. + * + * @param : aScript -- A description of script from the "on" attribute. + * @param : aCallerElement -- The element that calls the script by a + * an event of the "on" attribute. + * @return : For future use. Value is ignored. + */ + TBool ScriptCall(const TDesC& aScript, CSvgElementImpl* aCallerElement); + + /** + * This method is called to retrieve the file handle of an image name. + * The session (RFs) object passed in is guaranteed to be connected, so + * the client must NOT call aSession.Connect(). + * + * The implementation for the client of this method is usually if not always: + * TInt X::FetchImage(const TDesC& aFilename, RFs& aSession, RFile& aFileHandle) + * { + * // Check for "http", get data from remote site, save to disk + * // Get absolute path to aFilename: absolutepath + * return aFileHandle.Open(aSession, absolutepath, EFileRead); + * } + * + * Note: Use EFileShareReadersOnly to prevent file locking. + * + * The API AssignImageData() can be used to avoid block the parsing + * thread due this method taking too long to return. This is + * accomplished by returning a non-KErrNone value (i.e. KErrNotFound), + * and storing the URI parameter. The image data then could be + * assigned the the URI in another thread/Active-Object. + * + * @param : aUri -- the relative path of an image file. + * @param : aSession -- File session used by client to open file. + * @param : aFileHandle -- File handle used by client to open file. + * @return : KErrNone if Open command successful, otherwise error-code + * from Open command. The SVG engine will proceed loading the file + * only if the return value is KErrNone. + */ + TInt FetchImage(const TDesC& aUri, RFs& aSession, RFile& aFileHandle); + + /** + * This method is called to retrieve the file handle of an svg font file. + * This file must be SVG 1.1 .svg file. When the engine comes acrossed + * a font-family name that it doesnt know it will request "fontfamilyname".svg + * file through this method. The client can either provide the svg file + * or the engine will default to system text. + * + * The usage of this method is exactly the same as the FetchImage method above + * + * @param : aUri -- the relative path of an image file. + * @param : aSession -- File session used by client to open file. + * @param : aFileHandle -- File handle used by client to open file. + * @return : KErrNone if Open command successful, otherwise error-code + * from Open command. The SVG engine will proceed loading the file + * only if the return value is KErrNone. + */ + TInt FetchFont(const TDesC& aUri, RFs& aSession, RFile& aFileHandle); + + /** + * This Method updates the presentation status + * @param : TInt32& aNoOfAnimation + */ + void UpdatePresentation(const TInt32& aNoOfAnimation); + + private: + + CXnNewstickerSvgControl(CXnNewstickerAdapter* aAdapter); + + void ConstructL(); + + private: // Data + /** + * Parent control adapter + * Not own. + */ + CXnNewstickerAdapter* iAdapter; + + /** + * Pointer to SVG rendering engine + * Owned. + */ + CSvgEngineInterfaceImpl* iSVGEngine; + + /** + * Pointer to svg bitmap. + * Own. + */ + CFbsBitmap* iBitmap; + + /** + * Pointer to svg mask. + * Own. + */ + CFbsBitmap* iMaskBitmap; + + /** + * A rect in which the svg is shown. + */ + TRect iContentRect; + + /** + * Defines whether the content has been loaded + */ + TBool iHasContent; + }; + +#endif // XNNEWSTICKERSVGCONTROL_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xn3newstickerfactory.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xn3newstickerfactory.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// 10207483.RSS +// +#include +#include + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = AI3_UID_RENDERING_PLUGIN_NEWSTICKERFACTORY; +interfaces = + { + INTERFACE_INFO + { + interface_uid = AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI3_UID_RENDERING_PLUGIN_NEWSTICKERFACTORY_IMPLEMENTATION; + version_no = 1; + display_name = "XnNewsticker"; + default_data = "newsticker"; + opaque_data = ""; + } + }; + } + }; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewsticker.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewsticker.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,203 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for the interface class CXnNewsticker. +* +*/ + + +#include + +#include "xnnewsticker.h" +#include "xnnewstickeradapter.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnNewsticker::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnNewsticker* CXnNewsticker::NewL() + { + CXnNewsticker* self = new(ELeave) CXnNewsticker; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnNewsticker::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnNewsticker::ConstructL() + { + CXnComponent::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// CXnNewsticker::CXnNewsticker +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnNewsticker::CXnNewsticker() + { + } + +// ----------------------------------------------------------------------------- +// CXnNewsticker::~CXnNewsticker +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnNewsticker::~CXnNewsticker() + { + } + + +// --------------------------------------------------------- +// CXnNewsticker::AppendTitleL +// --------------------------------------------------------- +// +void CXnNewsticker::AppendTitleL(const TDesC& aTitle) + { + (static_cast + (ControlAdapter()))->AppendTitleL(aTitle); + } + + +// --------------------------------------------------------- +// CXnNewsticker::InsertTitleL +// --------------------------------------------------------- +// +void CXnNewsticker::InsertTitleL(const TDesC& aTitle, TInt aIndex) + { + (static_cast + (ControlAdapter()))->InsertTitleL(aTitle, aIndex); + } + +// --------------------------------------------------------- +// CXnNewsticker::UpdateTitleL +// --------------------------------------------------------- +// +void CXnNewsticker::UpdateTitleL(const TDesC& aTitle, TInt aIndex) + { + (static_cast + (ControlAdapter()))->UpdateTitleL(aTitle, aIndex); + } + + +// --------------------------------------------------------- +// CXnNewsticker::DeleteTitle +// --------------------------------------------------------- +// +void CXnNewsticker::DeleteTitle(TInt aIndex) + { + CXnNewstickerAdapter* adapter = + static_cast(ControlAdapter()); + TRAP_IGNORE(adapter->DeleteTitleL(aIndex)); + } + + +// --------------------------------------------------------- +// CXnNewsticker::CurrentTitleIndex +// --------------------------------------------------------- +// +TInt CXnNewsticker::CurrentTitleIndex() + { + return (static_cast + (ControlAdapter()))->CurrentTitleIndex(); + } + + +// --------------------------------------------------------- +// CXnNewsticker::Title +// --------------------------------------------------------- +// +const TDesC& CXnNewsticker::Title(TInt aIndex) + { + return (static_cast + (ControlAdapter()))->Title(aIndex); + } + + +// --------------------------------------------------------- +// CXnNewsticker::SetSeparatorImageL +// --------------------------------------------------------- +// +TInt CXnNewsticker::SetSeparatorImageL(CGulIcon* aIcon) + { + return (static_cast + (ControlAdapter()))->SetSeparatorImageL(aIcon); + } + + +// --------------------------------------------------------- +// CXnNewsticker::ClearTitles +// --------------------------------------------------------- +// +void CXnNewsticker::ClearTitles() + { + (static_cast + (ControlAdapter()))->ClearTitles(); + } + + +// --------------------------------------------------------- +// CXnNewsticker::AppendSvgTitleL +// --------------------------------------------------------- +// +void CXnNewsticker::AppendSvgTitleL(const TDesC8& aByteData) + { + (static_cast + (ControlAdapter()))->AppendSvgTitleL(aByteData); + } + +// --------------------------------------------------------- +// CXnNewsticker::InsertSvgTitleL +// --------------------------------------------------------- +// +void CXnNewsticker::InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex) + { + (static_cast + (ControlAdapter()))->InsertSvgTitleL(aByteData, aIndex); + } + +// --------------------------------------------------------- +// CXnNewsticker::SetCallbackInterfaceL +// --------------------------------------------------------- +// +void CXnNewsticker::SetCallbackInterfaceL( + XnNewstickerInterface::MXnNewstickerCallbackInterface* aCallback) + { + (static_cast + (ControlAdapter()))->SetCallbackInterfaceL(aCallback); + } + +// --------------------------------------------------------- +// CXnNewsticker::MakeInterfaceL +// --------------------------------------------------------- +// +XnComponentInterface::MXnComponentInterface* CXnNewsticker::MakeInterfaceL(const TDesC8& aType) + { + if (aType != XnNewstickerInterface::KType) + { + return NULL; + } + XnNewstickerInterface::MXnNewstickerInterface* newstickerintr = + static_cast(this); + return newstickerintr; + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickeradapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickeradapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1261 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for wrapper for a label +* +*/ + +// System includes +#include +#include +#include + +// User includes +#include "xnviewnodeimpl.h" +#include "xndompropertyvalue.h" +#include "xndomlist.h" +#include "xnproperty.h" +#include "xnnodepluginif.h" +#include "xntype.h" + +#include "c_xnutils.h" + +#include "xnnewstickeradapter.h" +#include "xnnewstickercontrol.h" +#include "xnnewstickersvgcontrol.h" +#include "xncomponentnodeimpl.h" + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// GetIntPropertyL +// Gets an integer property from the node. +// Returns: aNode UI node +// aproperty The property that is to be found +// return The value of the property. If not found, KErrNotFound returned. +// ----------------------------------------------------------------------------- +// +static TInt GetIntPropertyL( + CXnNodePluginIf& aNode, + const TDesC8& aProperty) + { + CXnProperty* prop = aNode.GetPropertyL(aProperty); + if(prop) + { + CXnDomPropertyValue* value = + static_cast(prop->Property()->PropertyValueList().Item(0)); + if(CXnDomPropertyValue::ENumber == value->PrimitiveValueType()) + { + TInt integer = static_cast(prop->FloatValueL()); + return integer; + } + } + return KErrNotFound; + } + +// ----------------------------------------------------------------------------- +// CopyBitmapData +// Copies a data from source bitmap to target bitmap. +// ----------------------------------------------------------------------------- +// +static TInt CopyBitmapData( + CFbsBitmap& aTarget, + const CFbsBitmap& aSource, + TPoint aSourcePoint) + { + TSize targetSize(aTarget.SizeInPixels()); + TSize sourceSize(aSource.SizeInPixels()); + TInt lineLength(targetSize.iWidth); + TInt maxSourceLineLength(sourceSize.iWidth - aSourcePoint.iX); + if(lineLength > maxSourceLineLength) + { + lineLength = maxSourceLineLength; + } + TInt rowCount(targetSize.iHeight); + TInt maxSourceRowCount(sourceSize.iHeight - aSourcePoint.iY); + if(rowCount > maxSourceRowCount) + { + rowCount = maxSourceRowCount; + } + + // Get bitmap display mode + TDisplayMode displayMode(aSource.DisplayMode()); + + // Create buffer for a scan line + HBufC8* scanLine = HBufC8::New( + aSource.ScanLineLength(lineLength, displayMode)); + if(!scanLine) + { + return KErrNoMemory; + } + + TPtr8 scanPtr(scanLine->Des()); + + // Copy all rows to destination bitmap + for(TInt row(0); row < rowCount; row++) + { + aSource.GetScanLine(scanPtr, + TPoint(aSourcePoint.iX, aSourcePoint.iY + row), + lineLength, displayMode); + aTarget.SetScanLine(scanPtr, row); + } + delete scanLine; + return KErrNone; + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::CheckDisplayL +// --------------------------------------------------------- +// +TBool CXnNewstickerAdapter::CheckDisplayL( CXnNodePluginIf& aNode ) + { + if( iPowerSaveMode ) + { + iDisplay = EFalse; + + return iDisplay; + } + + CXnProperty* displayProp( aNode.DisplayL() ); + + if( displayProp ) + { + const TDesC8& display( displayProp->StringValue() ); + + if( display != XnPropertyNames::style::common::display::KBlock ) + { + return EFalse; + } + } + + CXnProperty* visibilityProp( aNode.VisibilityL()); + + if( visibilityProp ) + { + const TDesC8& visibility( visibilityProp->StringValue() ); + + if( visibility != XnPropertyNames::style::common::visibility::KVisible ) + { + return EFalse; + } + } + + + CXnNodePluginIf* parent( aNode.ParentL() ); + + TBool ret( ETrue ); + + if( parent ) + { + ret = CheckDisplayL( *parent ); + } + + iDisplay = ret; + + return iDisplay; + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::SetNewstickerPropertiesL +// --------------------------------------------------------- +// +void CXnNewstickerAdapter::SetNewstickerPropertiesL() + { + // scroll amount + TInt scrollamount = GetIntPropertyL( iNode, + XnPropertyNames::newsticker::KXnScrollAmount ); // px + + if( KErrNotFound == scrollamount ) + { + scrollamount = KXnNewstickerScrollAmount; + } + + CXnProperty* prop( iNode.GetPropertyL( XnPropertyNames::newsticker::KScrollBehaviour ) ); + + if( prop ) + { + if ( prop->StringValue() == XnPropertyNames::newsticker::scroll_behaviour::KAlternate ) + { + scrollamount = 0; + iScrollBehaviour = EAlternate; + } + else if ( prop->StringValue() == XnPropertyNames::newsticker::scroll_behaviour::KSlide ) + { + iScrollBehaviour = ESlide; + } + else if ( prop->StringValue() == XnPropertyNames::newsticker::scroll_behaviour::KScrollAlternate ) + { + iScrollBehaviour = EScrollAlternate; + } + else + { + iScrollBehaviour = EScroll; + } + } + else + { + iScrollBehaviour = EScroll; + } + + iControl->SetScrollAmount( scrollamount ); + + if( iScrollBehaviour == EScroll || iScrollBehaviour == ESlide ) + { + // scroll delay + TInt scrolldelay = GetIntPropertyL( iNode, + XnPropertyNames::newsticker::KXnScrollDelay ); // ms + + if( KErrNotFound == scrolldelay ) + { + scrolldelay = KXnNewstickerInterval; + } + else + { + scrolldelay *= 1000; // change to microseconds + } + + iInterval = scrolldelay; + + // start delay + TInt startdelay = GetIntPropertyL( iNode, + XnPropertyNames::newsticker::KXnStartDelay ); // ms + + if( KErrNotFound == startdelay ) + { + startdelay = KXnNewstickerDelay; + } + else + { + startdelay *= 1000; // change to microseconds + } + + iDelay = startdelay; + } + else if( iScrollBehaviour == EScrollAlternate ) + { + // scroll delay + TInt scrolldelay = GetIntPropertyL( iNode, + XnPropertyNames::newsticker::KXnScrollDelay ); // ms + + if( KErrNotFound == scrolldelay ) + { + scrolldelay = KXnNewstickerInterval; + } + else + { + scrolldelay *= 1000; // change to microseconds + } + + iInterval = scrolldelay; + + TInt alternateTime( GetIntPropertyL( iNode, XnPropertyNames::newsticker::KDisplayTime ) ); + + if( alternateTime == KErrNotFound ) + { + alternateTime = 0; + } + + alternateTime *= 1000; // change to ms + + iAlternateInterval = alternateTime; + + // start delay + TInt startdelay = GetIntPropertyL( iNode, + XnPropertyNames::newsticker::KXnStartDelay ); // ms + + if( KErrNotFound == startdelay ) + { + startdelay = 0; + } + else + { + startdelay *= 1000; // change to microseconds + } + + iDelay = startdelay; + } + else // TScrollBehaviour::EAlternate + { + TInt alternateTime( GetIntPropertyL( iNode, XnPropertyNames::newsticker::KDisplayTime ) ); + + if( alternateTime == KErrNotFound ) + { + alternateTime = 0; + } + + alternateTime *= 1000; // change to ms + + iDelay = 0; + iInterval = alternateTime; + } + + // animation time + iAnimationTime = GetIntPropertyL( iNode, + XnPropertyNames::newsticker::KXnNewstickerAnimationDelay ); // ms + + if( KErrNotFound == iAnimationTime ) + { + iAnimationTime = KAnimationTime; + } + else + { + iAnimationTime *= 1000; // change to microseconds + } + + // _s60-scroll-loop property. True by default. + CXnProperty* loopProp( iNode.GetPropertyL( XnPropertyNames::newsticker::KScrollLoop ) ); + + if( loopProp && loopProp->StringValue() == XnPropertyNames::KFalse ) + { + iControl->SetScrollLooping( EFalse ); + } + else + { + iControl->SetScrollLooping( ETrue ); + } + CXnProperty* restartProperty( iNode.GetPropertyL( XnPropertyNames::newsticker::KRestartAfterUpdate ) ); + if ( restartProperty && restartProperty->StringValue() == XnPropertyNames::KTrue ) + { + iRestartAfterUpdate = ETrue; + } + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnNewstickerAdapter* CXnNewstickerAdapter::NewL(CXnControlAdapter* aParent, + CXnNodePluginIf& aNode) + { + CXnNewstickerAdapter* self = new( ELeave ) CXnNewstickerAdapter( aParent, aNode ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::ConstructL() + { + CXnControlAdapter::ConstructL( iNode ); + + iControl = CXnNewstickerControl::NewL( this ); + iSvgControl = CXnNewstickerSvgControl::NewL( this ); + + iPeriodicTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + + iPowerSaveMode = ETrue; + + iRestartAfterUpdate = EFalse; + SetTextPropertiesL(); + SetNewstickerPropertiesL(); + + RPointerArray children = iNode.ChildrenL(); + CleanupClosePushL( children ); + for( TInt i = 0; i < children.Count(); ++i ) + { + CXnNodePluginIf* child( children[i] ); + + CXnType* xnType = child->Type(); + // We only care for nodes + if ( xnType && xnType->Type() == XnPropertyNames::title::KTitle ) + { + // Append title, if one is given from the theme use that. + // If no content yet available create empty title so that + // indexing is always current + const TDesC8& pcData( child->GetPCData() ); + + HBufC* pcData16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L( pcData ); + CleanupStack::PushL( pcData16 ); + + TPtr ptr( pcData16->Des() ); + + CXnUtils::CollapseWhiteSpace( iNode, ptr ); + + if( ptr.Length() > 0 ) + { + iControl->AppendTitleL( *pcData16 ); + } + else + { + iControl->AppendTitleL( KNullDesC ); + } + + CleanupStack::PopAndDestroy( pcData16 ); + } + } + CleanupStack::PopAndDestroy( &children ); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::CXnNewstickerAdapter +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnNewstickerAdapter::CXnNewstickerAdapter(CXnControlAdapter* /*aParent*/, + CXnNodePluginIf& aNode) + : iState(ENotStarted), iNode(aNode) + { + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::~CXnNewstickerAdapter +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnNewstickerAdapter::~CXnNewstickerAdapter() + { + if( iPeriodicTimer ) + { + iPeriodicTimer->Cancel(); + } + + delete iPeriodicTimer; + + if( iFont && iReleaseFont ) + { + CWsScreenDevice* dev = iCoeEnv->ScreenDevice(); + dev->ReleaseFont( iFont ); + } + + delete iControl; + + if( iState == EAnimation ) + { + TRAP_IGNORE( iSvgControl->StopL() ); + } + + delete iSvgControl; + delete iBufferDevice; + delete iDrawingBuffer; + delete iBufferGc; + delete iBackgroundBitmap; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::SetTextPropertiesL +// Sets text properties, such as color, font, etc. +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::SetTextPropertiesL() + { + if (iFont && iReleaseFont) + { + CWsScreenDevice* dev = iCoeEnv->ScreenDevice(); + dev->ReleaseFont(iFont); + iFont = NULL; + } + CXnUtils::CreateFontL(iNode, iFont, iReleaseFont); + iControl->SetFont(iFont); + + TBool colorSet(EFalse); + CXnProperty* colorProperty = iNode.GetPropertyL(XnPropertyNames::appearance::common::KColor); + if (colorProperty != NULL) + { + CXnDomProperty* domProperty = colorProperty->Property(); + if(domProperty) + { + TRgb textColor; + TInt error( KErrNotSupported ); + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* > + ( domProperty->PropertyValueList().Item( 0 ) ); + if( value->IsAutoIdent() ) + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + error = AknsUtils::GetCachedColor(skinInstance, textColor, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6); + } + else if( value->PrimitiveValueType() == CXnDomPropertyValue::ERgbColor ) + { + textColor = value->RgbColorValueL(); + error = KErrNone; + } + else + { + HBufC* colorString = colorProperty->StringValueL(); + CleanupStack::PushL( colorString ); + + CXnUtils::StripQuotes( colorString ); + + TInt index = 0; + TAknsItemID skinID; + + TBool idResolved = CXnUtils::ResolveSkinItemIDL( colorString->Des(), skinID, index ); + + if( idResolved ) + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + error = AknsUtils::GetCachedColor( skinInstance, textColor, skinID, index ); + } + else // use auto value if skin id is invalid. + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + error = AknsUtils::GetCachedColor(skinInstance, textColor, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6); + } + CleanupStack::PopAndDestroy( colorString ); + } + if (error == KErrNone) + { + iControl->SetTextColor(textColor); + colorSet = ETrue; + } + } + } + + if(!colorSet) // Use text skin color + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TRgb textColor; + TInt error = AknsUtils::GetCachedColor( skinInstance, textColor, + KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6); + if (error == KErrNone) + { + iControl->SetTextColor(textColor); + } + } + + CXnProperty* textDecorationProp = + iNode.GetPropertyL(XnPropertyNames::appearance::common::KTextDecoration); + if(textDecorationProp) + { + CXnDomList& propertyValueList = textDecorationProp->Property()->PropertyValueList(); + TInt valueCount = propertyValueList.Length(); + for (TInt i = 0; i < valueCount; ++i) + { + CXnDomPropertyValue* value = + static_cast<CXnDomPropertyValue*>(propertyValueList.Item(i)); + if (value->StringValueL() == + XnPropertyNames::appearance::common::textdecoration::KUnderline) + { + iControl->SetTextUnderlineStyle(EUnderlineOn); + } + if (value->StringValueL() == + XnPropertyNames::appearance::common::textdecoration::KLinethrough) + { + iControl->SetTextStrikethroughStyle(EStrikethroughOn); + } + } + } + + TGulAlignmentValue alignment = CXnUtils::TextAlignment( iNode ); + + TInt textAlignment( ELayoutAlignLeft ); // all are vertically top aligned by default (avkon) + + switch( alignment ) + { + case EHCenterVCenter: + textAlignment = ELayoutAlignCenter; + break; + case EHRightVCenter: + textAlignment = ELayoutAlignRight; + break; + default: + break; + } + + iControl->SetTextAlignment(textAlignment); + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::AppendTitleL +// --------------------------------------------------------- +// +void CXnNewstickerAdapter::AppendTitleL(const TDesC& aTitle) + { + iControl->AppendTitleL(aTitle); + iNode.SetDirtyL(); + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::InsertTitleL +// --------------------------------------------------------- +// +void CXnNewstickerAdapter::InsertTitleL(const TDesC& aTitle, TInt aIndex) + { + iControl->InsertTitleL(aTitle, aIndex); + iNode.SetDirtyL(); + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::UpdateTitleL +// --------------------------------------------------------- +// +void CXnNewstickerAdapter::UpdateTitleL(const TDesC& aTitle, TInt aIndex) + { + iControl->UpdateTitleL(aTitle, aIndex); + iNode.SetDirtyL(); + if ( iRestartAfterUpdate ) + { + RestartL(); + } + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::DeleteTitleL +// --------------------------------------------------------- +// +void CXnNewstickerAdapter::DeleteTitleL(TInt aIndex) + { + if( iState == EAnimation && iControl->CurrentTitleIndex() == aIndex ) + { + // About to delete the currently showing animation + iSvgControl->StopL(); + iControl->DeleteTitleL( aIndex ); + + RestartL(); + } + else + { + iControl->DeleteTitleL(aIndex); + } + + iNode.SetDirtyL(); + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::CurrentTitleIndex +// --------------------------------------------------------- +// +TInt CXnNewstickerAdapter::CurrentTitleIndex() + { + return iControl->CurrentTitleIndex(); + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::Title +// --------------------------------------------------------- +// +const TDesC& CXnNewstickerAdapter::Title(TInt aIndex) + { + return iControl->Title(aIndex); + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::SetSeparatorImageL +// --------------------------------------------------------- +// +TInt CXnNewstickerAdapter::SetSeparatorImageL(CGulIcon* aIcon) + { + return iControl->SetSeparatorImageL(aIcon); + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::ClearTitles +// --------------------------------------------------------- +// +void CXnNewstickerAdapter::ClearTitles() + { + iControl->ClearTitles(); + TRAP_IGNORE(iNode.SetDirtyL()); + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::AppendSvgTitleL +// --------------------------------------------------------- +// +void CXnNewstickerAdapter::AppendSvgTitleL(const TDesC8& aByteData) + { + iControl->AppendSvgTitleL(aByteData); + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::InsertSvgTitleL +// --------------------------------------------------------- +// +void CXnNewstickerAdapter::InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex) + { + iControl->InsertSvgTitleL(aByteData, aIndex); + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::SetCallbackInterfaceL +// --------------------------------------------------------- +// +void CXnNewstickerAdapter::SetCallbackInterfaceL( + XnNewstickerInterface::MXnNewstickerCallbackInterface* aCallback) + { + iCallback = aCallback; + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::TitleScrolled +// --------------------------------------------------------- +// +void CXnNewstickerAdapter::TitleScrolled(TInt aTitleIndex) + { + if (iCallback) + { + iCallback->TitleScrolled(aTitleIndex); + } + // if not looping, see if the last item was scrolled... + if( !iControl->ScrollLooping() && + aTitleIndex == iControl->TitleCount() - 1 ) + { + iState = EScrollEnded; + TRAP_IGNORE( StopL() ); + DrawNow(); + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::DrawBackground() +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::DrawBackgroundL(const TRect& aRect, CWindowGc& aGc) const + { + RPointerArray<CXnControlAdapter> adapters; + + for ( CXnNodePluginIf* node = &iNode; node; ) + { + CXnControlAdapter* adapter( node->Control() ); + + if ( adapter ) + { + adapters.Append( adapter ); + } + + node = node->ParentL(); + } + + for ( TInt i = adapters.Count() - 1; i >= 0; --i ) + { + adapters[i]->Draw( aRect, aGc ); + } + + adapters.Reset(); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::SetTimerToDisplaytime() +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::SetTimerToDisplaytime() + { + if( iCurrentInterval != iAlternateInterval ) + { + iPeriodicTimer->Cancel(); + + iPeriodicTimer->Start( + TTimeIntervalMicroSeconds32( iAlternateInterval ), + TTimeIntervalMicroSeconds32( iAlternateInterval ), + TCallBack( CXnNewstickerAdapter::PeriodicEventL, this ) ); + iCurrentInterval = iAlternateInterval; + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::SetTimerToScrolltime() +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::SetTimerToScrolltime() + { + if( iCurrentInterval != iInterval ) + { + iPeriodicTimer->Cancel(); + + iPeriodicTimer->Start( + TTimeIntervalMicroSeconds32( iInterval ), + TTimeIntervalMicroSeconds32( iInterval ), + TCallBack( CXnNewstickerAdapter::PeriodicEventL, this ) ); + iCurrentInterval = iInterval; + } + } +// --------------------------------------------------------- +// CXnNewstickerAdapter::StartL +// --------------------------------------------------------- +// +void CXnNewstickerAdapter::StartL() + { + if( iDisplay && !iPowerSaveMode ) + { + if( iControl->TitleCount() == 0 ) + { + // Nothing to show + return; + } + + if( iPeriodicTimer && !iPeriodicTimer->IsActive() ) + { + TInt startDelay( ( iState == ENotStarted ) ? iDelay : KNoDelay ); + + // Start + if ( ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate && + iControl->CalculateCurrentTextFitInNewstickerRect() ) + { + iPeriodicTimer->Start( + TTimeIntervalMicroSeconds32( startDelay ), + TTimeIntervalMicroSeconds32( iAlternateInterval ), + TCallBack( CXnNewstickerAdapter::PeriodicEventL, this ) ); + iCurrentInterval = iAlternateInterval; + } + else + { + iPeriodicTimer->Start( + TTimeIntervalMicroSeconds32( startDelay ), + TTimeIntervalMicroSeconds32( iInterval ), + TCallBack( CXnNewstickerAdapter::PeriodicEventL, this ) ); + iCurrentInterval = iInterval; + } + + iState = EText; + } + } + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::StopL +// --------------------------------------------------------- +// +void CXnNewstickerAdapter::StopL() + { + if( iState == EAnimation ) + { + iSvgControl->StopL(); + } + + // Have we already been started + if( iPeriodicTimer->IsActive() ) + { + // Yes, cancel and set the state + iPeriodicTimer->Cancel(); + + if ( iState == EScrollEnded ) + { + iControl->MoveToLastL(); + iControl->DrawStatic(); + } + else if ( iState == EText || iState == EAnimation ) + { + iState = EPaused; + } + } + // Entering power save mode => Move to last item and draw it + if ( ( iScrollBehaviour == EAlternate || + iScrollBehaviour == EScrollAlternate ) + && iPowerSaveMode ) + { + iState = EPaused; + iControl->MoveToLastL(); + iControl->DrawStatic(); + } + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::ShowSvgL +// --------------------------------------------------------- +// +void CXnNewstickerAdapter::ShowSvgL() + { + // Get next animation from model and start it + iSvgControl->StartL( iControl->CurrentSvgTitle() ); + + // Set the end timer + iState = EAnimation; + + iPeriodicTimer->Cancel(); + + iPeriodicTimer->Start( + TTimeIntervalMicroSeconds32( iAnimationTime ), + TTimeIntervalMicroSeconds32( iAnimationTime ), + TCallBack( CXnNewstickerAdapter::PeriodicEventL, this ) ); + iCurrentInterval = iAnimationTime; + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::PeriodicEventL +// --------------------------------------------------------- +// +TInt CXnNewstickerAdapter::PeriodicEventL( TAny* aPtr ) + { + CXnNewstickerAdapter* self = static_cast< CXnNewstickerAdapter* >( aPtr ); + + if( self->iState == EText ) + { + // Do the text scroll + self->iControl->DoScrollL(); + } + else if( self->iState == EAnimation ) + { + self->iSvgControl->StopL(); + self->TitleScrolled( self->iControl->CurrentTitleIndex() ); + // Animation scroll has been ended, start the next scroll + self->iState = ENotStarted; + self->iPeriodicTimer->Cancel(); + self->StartL(); + // Do the first draw + self->iControl->SetBeginningState(); + self->iControl->DoScrollL(); + } + + return KErrNone; + } + +void CXnNewstickerAdapter::RestartL() + { + if ( iPowerSaveMode ) + { + return; + } + // Restart + iState = ENotStarted; + iPeriodicTimer->Cancel(); + + iControl->MoveToFirstL(); + StartL(); + + // Do the first draw + iControl->SetBeginningState(); + } +// --------------------------------------------------------- +// CXnNewstickerAdapter::SizeChanged() +// --------------------------------------------------------- +// +void CXnNewstickerAdapter::SizeChanged() + { + CXnControlAdapter::SizeChanged(); + TRAP_IGNORE( SizeChangedL() ); + } + +// --------------------------------------------------------- +// CXnNewstickerAdapter::SizeChangedL() +// --------------------------------------------------------- +// +void CXnNewstickerAdapter::SizeChangedL() + { + UpdateDoubleBufferL(); + + TRect rect( Rect() ); + + iControl->SetNewstickerRect( rect ); + iSvgControl->SetSvgRectL( rect, *SystemGc().Device() ); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::HandlePointerEventL +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::HandlePointerEventL(const TPointerEvent& aPointerEvent) + { + if ( AknLayoutUtils::PenEnabled() ) + { + CXnControlAdapter::HandlePointerEventL(aPointerEvent); + } + } +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::DoHandlePropertyChangeL +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::DoHandlePropertyChangeL( CXnProperty* aProperty ) + { + SetTextPropertiesL(); + SetNewstickerPropertiesL(); + //New code to check do we need Start or Stop Newsticker + if( aProperty ) + { + const TDesC8& name( aProperty->Property()->Name() ); + + if( name == XnPropertyNames::style::common::KDisplay || + name == XnPropertyNames::style::common::KVisibility ) + { + if( CheckDisplayL( iNode ) ) + { + StartL(); + } + else + { + StopL(); + } + } + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::FocusChanged +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::FocusChanged(TDrawNow /*aDrawNow*/) + { + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::SkinChanged +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::SkinChanged() + { + CXnControlAdapter::SkinChanged(); + TRAP_IGNORE( SetTextPropertiesL() ); + } + +void CXnNewstickerAdapter::ReportNewstickerEventL(const TDesC8& aEventName) + { + TBuf8<8>index(KNullDesC8); + index.Num(CurrentTitleIndex()); + + iNode.ReportTriggerEventL(aEventName, + XnPropertyNames::action::trigger::name::KTitleIndex, index); + } +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::OfferKeyEventL +// ----------------------------------------------------------------------------- +// +TKeyResponse CXnNewstickerAdapter::OfferKeyEventL( + const TKeyEvent& aKeyEvent, TEventCode aType) + { + TKeyResponse resp = EKeyWasNotConsumed; + TBool restart = EFalse; + + CXnControlAdapter::OfferKeyEventL(aKeyEvent, aType); + + if(aType == EEventKey) + { + if (aKeyEvent.iScanCode == EStdKeyRightArrow) + { + restart = ETrue; + if(iControl->IsWestern()) + { + iControl->MoveToNextL(); + } + else + { + iControl->MoveToPrevL(); + } + StopL(); + } + else if (aKeyEvent.iScanCode == EStdKeyLeftArrow) + { + restart = ETrue; + if(iControl->IsWestern()) + { + iControl->MoveToPrevL(); + } + else + { + iControl->MoveToNextL(); + } + StopL(); + } + } + if(aType == EEventKeyUp) + { + if (aKeyEvent.iScanCode == EStdKeyDevice3) // rocker + { + restart = ETrue; + StopL(); + iControl->MoveToCurrent(); + } + } + + if( restart ) + { + // Restart and do the first draw + iState = ENotStarted; + StartL(); + iControl->DoScrollL(); + } + + return resp; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::Draw +// Draws the text component +// ----------------------------------------------------------------------------- +void CXnNewstickerAdapter::Draw(const TRect& aRect) const + { + CXnControlAdapter::Draw( aRect ); + + TRAP_IGNORE( UpdateBackgroundL() ); + // In powersave-/editmode only draw the last title. + if ( iScrollBehaviour == EAlternate && iPowerSaveMode ) + { + iControl->DrawStatic(); + + // Blit double buffer + SystemGc().BitBlt( Rect().iTl, iDrawingBuffer ); + } + else if( iState == EText || iState == EPaused && + iControl->CurrentTitleIndex() >= 0 ) + { + iControl->Draw(); + + // Blit double buffer + SystemGc().BitBlt( Rect().iTl, iDrawingBuffer ); + } + else if( iState == EAnimation ) + { + iSvgControl->Draw(); + + // Blit double buffer + SystemGc().BitBlt( Rect().iTl, iDrawingBuffer ); + } + else if( iState == EScrollEnded ) + { + iControl->DrawStatic(); + SystemGc().BitBlt( Rect().iTl, iDrawingBuffer ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::UpdateDoubleBufferL +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::UpdateDoubleBufferL() + { + TDisplayMode displayMode( SystemGc().Device()->DisplayMode() ); + + // Create double buffer + if( iDrawingBuffer ) + { + delete iDrawingBuffer; + iDrawingBuffer = NULL; + delete iBufferDevice; + iBufferDevice = NULL; + delete iBufferGc; + iBufferGc = NULL; + } + + iDrawingBuffer = new ( ELeave ) CFbsBitmap(); + iDrawingBuffer->Create( iNode.Rect().Size(), displayMode ); + iBufferDevice = CFbsBitmapDevice::NewL( iDrawingBuffer ); + iBufferDevice->CreateBitmapContext( iBufferGc ); + iBufferGc->UseFont( iControl->Font() ); + iBufferGc->SetPenColor( iControl->TextColor() ); + iBufferGc->SetStrikethroughStyle( iControl->TextStrikethroughStyle() ); + iBufferGc->SetUnderlineStyle( iControl->TextUnderlineStyle() ); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::UpdateBackgroundL +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::UpdateBackgroundL() const + { + TDisplayMode displayMode( SystemGc().Device()->DisplayMode() ); + + // Create "screenshot" from the background appearance + if( iBackgroundBitmap ) + { + delete iBackgroundBitmap; + iBackgroundBitmap = NULL; + } + + iBackgroundBitmap = new ( ELeave ) CFbsBitmap(); + iBackgroundBitmap->Create( iNode.Rect().Size(), displayMode ); + + CFbsBitmap* tmpBitmap = new ( ELeave ) CFbsBitmap(); + CleanupStack::PushL( tmpBitmap ); + + CWsScreenDevice* scrDevice = static_cast< CWsScreenDevice* >( SystemGc().Device() ); + + TSize tmpSize( scrDevice->SizeInPixels() ); + + tmpBitmap->Create( tmpSize, displayMode ); + + CFbsBitmapDevice* tmpDevice = CFbsBitmapDevice::NewL( tmpBitmap ); + CleanupStack::PushL( tmpDevice ); + + CBitmapContext* bc( NULL ); + + tmpDevice->CreateBitmapContext( bc ); + CleanupStack::PushL( bc ); + + DrawBackgroundL( iNode.Rect(), reinterpret_cast< CWindowGc& >( *bc ) ); + + CopyBitmapData( *iBackgroundBitmap, *tmpBitmap, iNode.Rect().iTl ); + + CleanupStack::PopAndDestroy( 3 ); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::DoEnterPowerSaveModeL +// Enter power save mode +// ----------------------------------------------------------------------------- +void CXnNewstickerAdapter::DoEnterPowerSaveModeL(TModeEvent /*aEvent*/) + { + iDisplay = EFalse; + iPowerSaveMode = ETrue; + + StopL(); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::DoExitPowerSaveModeL +// Exit power save mode +// ----------------------------------------------------------------------------- +void CXnNewstickerAdapter::DoExitPowerSaveModeL(TModeEvent /*aEvent*/) + { + iPowerSaveMode = EFalse; + + if( CheckDisplayL( iNode ) ) + { + RestartL(); + + if( iDrawingBuffer ) + { + DrawNow(); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::DrawNow +// Draw +// ----------------------------------------------------------------------------- +void CXnNewstickerAdapter::DrawNow() const + { + TBool parentDrawn = EFalse; + TRAP_IGNORE( parentDrawn = DrawFocusableParentL() ); + if ( !parentDrawn ) + { + CCoeControl::DrawNow(); + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::DrawFocusableParentL +// Draws focusable parent +// ----------------------------------------------------------------------------- +TBool CXnNewstickerAdapter::DrawFocusableParentL() const + { + TBool parentDrawn = EFalse; + + if ( !iNode.IsFocusedState() ) + { + // node is not focusable, find focusable and focused parent + CXnNodePluginIf* parent = iNode.ParentL(); + while ( parent && !parent->IsFocusedState() ) + { + parent = parent->ParentL(); + } + + if (parent) + { + // focusable parent found, draw it + parent->Control()->DrawNow(); + parentDrawn = ETrue; + } + } + + return parentDrawn; + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickercontrol.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickercontrol.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1402 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Text scrolling functionality. +* +*/ + + +// INCLUDE FILES +#include <AknUtils.h> +#include <gulicon.h> +#include <AknsDrawUtils.h> +#include <AknBidiTextUtils.h> + +#include "xnnewstickercontrol.h" +#include "xnnewstickeradapter.h" +#include "xnproperty.h" + +// CONSTANTS +/** +* for the empty space in pixels between text and image. +*/ +const TInt KGap = 10; + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CTitleData::CTitleData +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnNewstickerControl::CTitleData::CTitleData(TInt aLenghtInPixels) : + iTitleIsSvg(EFalse), iTextLenghtInPixels(aLenghtInPixels) + { + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +CXnNewstickerControl::CTitleData::~CTitleData() + { + delete iText; + delete iData; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CTitleData::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::CTitleData::ConstructL(const TDesC& aTitle) + { + delete iText; + iText = NULL; + iText = aTitle.AllocL(); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CTitleData::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::CTitleData::ConstructL(const TDesC8& aByteData) + { + iTitleIsSvg = ETrue; + iData = aByteData.AllocL(); + iText = KNullDesC().AllocL(); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CTitleData::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnNewstickerControl::CTitleData* CXnNewstickerControl::CTitleData::NewL( + const TDesC& aTitle, TInt aLenghtInPixels) + { + CXnNewstickerControl::CTitleData* self = + CXnNewstickerControl::CTitleData::NewLC(aTitle, aLenghtInPixels); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CTitleData::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnNewstickerControl::CTitleData* CXnNewstickerControl::CTitleData::NewLC( + const TDesC& aTitle, TInt aLenghtInPixels) + { + CXnNewstickerControl::CTitleData* self = + new(ELeave) CXnNewstickerControl::CTitleData(aLenghtInPixels); + CleanupStack::PushL(self); + self->ConstructL(aTitle); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CTitleData::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnNewstickerControl::CTitleData* CXnNewstickerControl::CTitleData::NewL( + const TDesC8& aByteData) + { + CXnNewstickerControl::CTitleData* self = + CXnNewstickerControl::CTitleData::NewLC(aByteData); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CTitleData::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnNewstickerControl::CTitleData* CXnNewstickerControl::CTitleData::NewLC( + const TDesC8& aByteData) + { + CXnNewstickerControl::CTitleData* self = + new(ELeave) CXnNewstickerControl::CTitleData(); + CleanupStack::PushL(self); + self->ConstructL(aByteData); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CTitleData::TitleText +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +const TDesC& CXnNewstickerControl::CTitleData::TitleText() + { + return *iText; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CTitleData::SetTitleText +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::CTitleData::SetTitleTextL(const TDesC& aTitle) + { + HBufC* newTitle = aTitle.AllocL(); + delete iText; + iText = newTitle; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CTitleData::TitleTextLengthInPixels +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CXnNewstickerControl::CTitleData::TitleTextLengthInPixels() + { + return iTextLenghtInPixels; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CTitleData::SetTitleTextLengthInPixels +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::CTitleData::SetTitleTextLengthInPixels(TInt aLenghtInPixels) + { + iTextLenghtInPixels = aLenghtInPixels; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CTitleData::IsSvgTitle +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CXnNewstickerControl::CTitleData::IsSvgTitle() + { + return iTitleIsSvg; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CTitleData::SvgTitleData +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +const TDesC8& CXnNewstickerControl::CTitleData::SvgTitleData() + { + return *iData; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CXnNewstickerControl +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnNewstickerControl::CXnNewstickerControl(CXnNewstickerAdapter* aAdapter) : + iFirstDrawingTitleIndex(0), + iFirstDrawingOffset(0), + iImageWidthInPixels(0), + iCurrentTitleIndex(-1), + iSeparatorimage(NULL), + iSeparatorImageWidth(0), + iFont(NULL), + iTextBaseline(0), + iTextColor(KRgbBlack), + iUnderlining(EUnderlineOff), + iStrikethrough(EStrikethroughOff), + iIsWestern(ETrue), + iAdapter(aAdapter), + iTextAlignment(ELayoutAlignLeft) + { + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::ConstructL() + { + if(AknLayoutUtils::LayoutMirrored()) + { + iIsWestern = EFalse; + iTextAlignment = ELayoutAlignRight; + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnNewstickerControl* CXnNewstickerControl::NewL(CXnNewstickerAdapter* aAdapter) + { + CXnNewstickerControl* self = new(ELeave)CXnNewstickerControl(aAdapter); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::~CXnNewstickerControl() +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnNewstickerControl::~CXnNewstickerControl() + { + iTitles.ResetAndDestroy(); + delete iSeparatorimage; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::SetScrollAmount +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::SetScrollAmount(TInt aScrollAmount) + { + iSpeed = aScrollAmount; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::SetNewstickerRect +// Set visible rect. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::SetNewstickerRect(TRect& aContentRect) + { + if(iContentRect != aContentRect) + { + iContentRect = aContentRect; + iTextBaseline = iContentRect.Height() / 2 + iFont->AscentInPixels() / 2; + SetBeginningState(); + for(TInt i = 0; i < iTitles.Count(); i++) + { + if(!iTitles[i]->IsSvgTitle()) + { + TInt textWidth = iFont->TextWidthInPixels( + iTitles[i]->TitleText()); + iTitles[i]->SetTitleTextLengthInPixels(textWidth); + } + } + CalculateTextFitInNewstickerRect(); + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::IsWestern +// Returns ETrue if western layout is used, otherwise EFalse is returned. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CXnNewstickerControl::IsWestern() + { + return iIsWestern; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::AppendTitleL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::AppendTitleL(const TDesC& aTitle) + { + TInt textWidth = iFont->TextWidthInPixels(aTitle); + CTitleData* title = CTitleData::NewLC(aTitle, textWidth); + iTitles.AppendL(title); + CleanupStack::Pop(title); + + CalculateTextFitInNewstickerRect(); + + // if this is the first item + if(iTitles.Count() == 1) + { + iCurrentTitleIndex = 0; + iAdapter->StartL(); + } + } + +// --------------------------------------------------------- +// CXnNewstickerControl::InsertTitleL +// --------------------------------------------------------- +// +void CXnNewstickerControl::InsertTitleL(const TDesC& aTitle, TInt aIndex) + { + TInt textWidth = iFont->TextWidthInPixels(aTitle); + CTitleData* title = CTitleData::NewLC(aTitle, textWidth); + iTitles.InsertL(title, aIndex); + CleanupStack::Pop(title); + + + CountIndexAfterInsertL(aIndex); + CalculateTextFitInNewstickerRect(); + } + +// --------------------------------------------------------- +// CXnNewstickerControl::UpdateTitleL +// --------------------------------------------------------- +// +void CXnNewstickerControl::UpdateTitleL(const TDesC& aTitle, TInt aIndex) + { + if ( aIndex >= 0 && aIndex < iTitles.Count() ) + { + CTitleData* titleData = iTitles[aIndex]; + TInt textWidth = iFont->TextWidthInPixels(aTitle); + titleData->SetTitleTextL(aTitle); + titleData->SetTitleTextLengthInPixels(textWidth); + CalculateTextFitInNewstickerRect(); + } + else + { + AppendTitleL(aTitle); + } + } + +// --------------------------------------------------------- +// CXnNewstickerControl::DeleteTitle +// --------------------------------------------------------- +// +void CXnNewstickerControl::DeleteTitleL(TInt aIndex) + { + TInt count = iTitles.Count(); + if (aIndex >= 0 && aIndex < count) + { + // If the last item will be deleted + if(count == 1) + { + iAdapter->StopL(); + iFirstDrawingTitleIndex = GetNextTitleWithContent( 0 ); + SetBeginningState(); + iCurrentTitleIndex = -1; + } + if (aIndex == iFirstDrawingTitleIndex) + { + // If this happens to be the last item in the list + if(aIndex == count - 1) + { + iFirstDrawingTitleIndex = GetNextTitleWithContent( 0 ); + } + SetBeginningState(); + iCurrentTitleIndex = iFirstDrawingTitleIndex; + } + + // Check if the title was deleted before the current title + else if (aIndex < iFirstDrawingTitleIndex) + { + iCurrentTitleIndex--; + iFirstDrawingTitleIndex = GetNextTitleWithContent( iFirstDrawingTitleIndex-1, ETrue); + } + UpdateTitleL(KNullDesC, aIndex); + CalculateTextFitInNewstickerRect(); + } + } + +// --------------------------------------------------------- +// CXnNewstickerControl::CurrentTitleIndex +// --------------------------------------------------------- +// +TInt CXnNewstickerControl::CurrentTitleIndex() + { + return iCurrentTitleIndex; + } + +// --------------------------------------------------------- +// CXnNewstickerControl::Title +// --------------------------------------------------------- +// +const TDesC& CXnNewstickerControl::Title(TInt aIndex) + { + if (aIndex < 0 || aIndex > iTitles.Count()) + { + return KNullDesC; + } + + if (iTitles[aIndex]->IsSvgTitle()) + { + return KNullDesC; + } + + return iTitles[aIndex]->TitleText(); + } + +// --------------------------------------------------------- +// CXnNewstickerControl::SetSeparatorImageL +// --------------------------------------------------------- +// +TInt CXnNewstickerControl::SetSeparatorImageL(CGulIcon* aIcon) + { + CFbsBitmap* bitmap = aIcon->Bitmap(); + if(AknIconUtils::IsMifIcon(bitmap)) + { + delete iSeparatorimage; + iSeparatorimage = aIcon; + TInt maxHeight = iContentRect.Height(); + TSize size = TSize(maxHeight, maxHeight); + AknIconUtils::SetSize(bitmap, size, EAspectRatioPreservedAndUnusedSpaceRemoved); + iSeparatorImageWidth = bitmap->SizeInPixels().iWidth + KGap; + return KErrNone; + } + else + { + iSeparatorimage = NULL; + return KErrNotSupported; + } + } + +// --------------------------------------------------------- +// CXnNewstickerControl::ClearTitles +// --------------------------------------------------------- +// +void CXnNewstickerControl::ClearTitles() + { + TRAP_IGNORE(iAdapter->StopL()); + iFirstDrawingTitleIndex = 0; + SetBeginningState(); + iCurrentTitleIndex = -1; + // Don't delete just clear the contents + for( TInt i = 0; i < iTitles.Count(); ++i ) + { + TRAP_IGNORE( UpdateTitleL( KNullDesC, i ) ); + } + iTextFitInNewstickerRect = EFalse; + } + +// --------------------------------------------------------- +// CXnNewstickerControl::AppendSvgTitleL +// --------------------------------------------------------- +// +void CXnNewstickerControl::AppendSvgTitleL(const TDesC8& aByteData) + { + CTitleData* title = CTitleData::NewLC(aByteData); + iTitles.AppendL(title); + CleanupStack::Pop(title); + + // if this is the first item + if(iTitles.Count() == 1) + { + iCurrentTitleIndex = 0; + iAdapter->StartL(); + } + } + +// --------------------------------------------------------- +// CXnNewstickerControl::InsertSvgTitleL +// --------------------------------------------------------- +// +void CXnNewstickerControl::InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex) + { + CTitleData* title = CTitleData::NewLC(aByteData); + iTitles.InsertL(title, aIndex); + CleanupStack::Pop(title); + CountIndexAfterInsertL(aIndex); + } + +// --------------------------------------------------------- +// CXnNewstickerControl::CurrentSvgTitle +// --------------------------------------------------------- +// +const TDesC8& CXnNewstickerControl::CurrentSvgTitle() + { + CTitleData* title = iTitles[iFirstDrawingTitleIndex]; + // Is it SVG title + if (title->IsSvgTitle()) + { + // Yes, advance the title index + iFirstDrawingTitleIndex++; + if (iFirstDrawingTitleIndex >= iTitles.Count()) + { + iFirstDrawingTitleIndex = 0; + } + + // Return the data + return title->SvgTitleData(); + } + + // Not svg title, return empty desc + return KNullDesC8; + } + +// --------------------------------------------------------- +// CXnNewstickerControl::TitleCount +// --------------------------------------------------------- +// +TInt CXnNewstickerControl::TitleCount() const + { + return iTitles.Count(); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::MoveToNext +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::MoveToNextL() + { + // If there are no titles, don't do anything. + if (!IsVisibleTitles()) + { + return ; + } + // Skip notification of the first title + if ( iCurrentTitleIndex != GetNextTitleWithContent( 0 ) ) + { + iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleScrolled); + } + // Don't report the last TitleToScroll in case the scroll ended + if ( iAdapter->CurrentState() != CXnNewstickerAdapter::EScrollEnded ) + { + iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleToScroll); + } + iAdapter->TitleScrolled(iFirstDrawingTitleIndex); + if (iAdapter->CurrentState() == CXnNewstickerAdapter::EAnimation) + { + iCurrentTitleIndex = GetNextTitleWithContent( iCurrentTitleIndex + 1 ); + iFirstDrawingTitleIndex = iCurrentTitleIndex; + } + else + { + iCurrentTitleIndex = GetNextTitleWithContent( iFirstDrawingTitleIndex + 1); + iFirstDrawingTitleIndex = iCurrentTitleIndex; + } + + // Check that we are still in range + if (iFirstDrawingTitleIndex >= iTitles.Count() || iFirstDrawingTitleIndex < 0) + { + iFirstDrawingTitleIndex = GetNextTitleWithContent( 0 ); + iCurrentTitleIndex = iFirstDrawingTitleIndex; + } + + SetBeginningState(); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::MoveToFirstL +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::MoveToFirstL() + { + // If there are no titles, don't do anything. + if (!IsVisibleTitles()) + { + return ; + } + // Something already scrolling, report scroll done + if ( iAdapter->CurrentState() == CXnNewstickerAdapter::EText ) + { + iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleScrolled); + iAdapter->TitleScrolled(iFirstDrawingTitleIndex); + } + + TInt start = 0; // iIsWestern ? 0 : (iTitles.Count() - 1); + + iCurrentTitleIndex = GetNextTitleWithContent( start ); + iFirstDrawingTitleIndex = iCurrentTitleIndex; + iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleToScroll); + SetBeginningState(); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::MoveToLastL +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::MoveToLastL() + { + // If there are no titles, don't do anything. + if (!IsVisibleTitles()) + { + return ; + } + // Something already scrolling, report scroll done + if ( iAdapter->CurrentState() == CXnNewstickerAdapter::EText ) + { + iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleScrolled); + iAdapter->TitleScrolled(iFirstDrawingTitleIndex); + } + + TInt start = iTitles.Count() - 1; // iIsWestern ? (iTitles.Count() - 1) : 0; + + iCurrentTitleIndex = GetNextTitleWithContent( start, ETrue ); + iFirstDrawingTitleIndex = iCurrentTitleIndex; + iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleToScroll); + SetBeginningState(); + } +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::MoveToPrev +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::MoveToPrevL() + { + // If there are no titles, don't do anything. + if (!IsVisibleTitles()) + { + return ; + } + + iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleScrolled); + + if (iAdapter->CurrentState() == CXnNewstickerAdapter::EAnimation) + { + iCurrentTitleIndex = GetNextTitleWithContent( iCurrentTitleIndex - 1, ETrue ); + iFirstDrawingTitleIndex = iCurrentTitleIndex; + } + else + { + iFirstDrawingTitleIndex = GetNextTitleWithContent( iFirstDrawingTitleIndex - 1, ETrue ); + iCurrentTitleIndex = iFirstDrawingTitleIndex; + } + // Check that we are still in range + if (iFirstDrawingTitleIndex >= iTitles.Count() || iFirstDrawingTitleIndex < 0) + { + iFirstDrawingTitleIndex = GetNextTitleWithContent( iTitles.Count() - 1, ETrue ); + iCurrentTitleIndex = iFirstDrawingTitleIndex; + } + + iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleToScroll); + SetBeginningState(); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::MoveToCurrent +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::MoveToCurrent() + { + // If there are no titles, don't do anything. + if (!IsVisibleTitles()) + { + return ; + } + + iFirstDrawingTitleIndex = iCurrentTitleIndex; + SetBeginningState(); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CountIndexAfterInsert +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::CountIndexAfterInsertL(TInt aIndex) + { + // Check if the new title was inserted before the first drawing title + if (aIndex <= iFirstDrawingTitleIndex) + { + iCurrentTitleIndex++; + iFirstDrawingTitleIndex++; + } + + // if this is the first item + if(iTitles.Count() == 1 && GetNextTitleWithContent( 0 ) == 0) + { + iCurrentTitleIndex = 0; + iFirstDrawingTitleIndex = 0; + iAdapter->StartL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::SetFont +// ----------------------------------------------------------------------------- +void CXnNewstickerControl::SetFont(CFont* aFont) + { + if(iFont != aFont) + { + for(TInt i = 0; i < iTitles.Count(); i++) + { + if(!iTitles[i]->IsSvgTitle()) + { + TInt textWidth = aFont->TextWidthInPixels( + iTitles[i]->TitleText()); + iTitles[i]->SetTitleTextLengthInPixels(textWidth); + } + } + iFont = aFont; + iTextBaseline = iContentRect.Height() / 2 + iFont->AscentInPixels() / 2; + CBitmapContext* gc = iAdapter->BufferGc(); + if(gc) + { + gc->UseFont(aFont); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::SetTextColor +// ----------------------------------------------------------------------------- +void CXnNewstickerControl::SetTextColor(TRgb aColor) + { + iTextColor = aColor; + CBitmapContext* gc = iAdapter->BufferGc(); + if(gc) + { + gc->SetPenColor(iTextColor); + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::SetTextUnderlineStyle +// ----------------------------------------------------------------------------- +void CXnNewstickerControl::SetTextUnderlineStyle(TFontUnderline aStyle) + { + iUnderlining = aStyle; + CBitmapContext* gc = iAdapter->BufferGc(); + if(gc) + { + gc->SetUnderlineStyle(iUnderlining); + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::SetTextUnderlineStyle +// ----------------------------------------------------------------------------- +void CXnNewstickerControl::SetTextStrikethroughStyle(TFontStrikethrough aStyle) + { + iStrikethrough = aStyle; + CBitmapContext* gc = iAdapter->BufferGc(); + if(gc) + { + gc->SetStrikethroughStyle(iStrikethrough); + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::PrepareToDrawL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::PrepareToDrawLtrL() + { + CBitmapContext* gc = iAdapter->BufferGc(); + const CFbsBitmap* background = iAdapter->BackgroundBitmap(); + if(!gc || !background || !IsVisibleTitles() ) + { + return; + } + iFirstDrawingTitleIndex = GetNextTitleWithContent( iFirstDrawingTitleIndex ); + if ( iFirstDrawingTitleIndex < 0 ) + { + return; + } + if (iTitles[iFirstDrawingTitleIndex]->IsSvgTitle()) + { + // Show SVG title + iAdapter->ShowSvgL(); + + // Just in case, draw background to d-buffer + gc->BitBlt(TPoint(0,0), background); + return; + } + + CGraphicsContext::TTextAlign alignment = TextAlignment(); + if ( iTextFitInNewstickerRect || + iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EAlternate && iTitles.Count() == 1 ) + { + iAdapter->StopL(); + SetBeginningState(); + } + + TInt drawingPos(-iFirstDrawingOffset); + + // At first, draw background + gc->BitBlt(TPoint(0,0), background); + TInt textLeft = iTitles[iFirstDrawingTitleIndex]->TitleTextLengthInPixels() - + iFirstDrawingOffset; + TInt drawingTitleIndex = iFirstDrawingTitleIndex; + TInt drawingOffset(0); + + // Main drawing loop. This loop runs as long as drawing area is not filled + // if Scroll behaviour is slide, then short text drawn only once. + FOREVER + { + TRect clipRect(TPoint(drawingPos,0), TPoint(iContentRect.Width(), iContentRect.Height())); + if ( iTextFitInNewstickerRect ) + { + clipRect.SetWidth( clipRect.Width()-drawingPos); + } + // if the rest text fits into visible area + if (textLeft <= iContentRect.Width() - drawingOffset) + { + gc->DrawText(iTitles[drawingTitleIndex]->TitleText(), + clipRect, + iTextBaseline, + alignment); + + TInt drawnLength = iTitles[drawingTitleIndex]->TitleTextLengthInPixels() + KGap; + drawingPos += drawnLength; + drawingOffset = drawingPos; + + // Update title index, if needed + drawingTitleIndex++; + if(drawingTitleIndex >= iTitles.Count()) + { + drawingTitleIndex = 0; + if ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::ESlide || iTextFitInNewstickerRect ) + { + // what a dirty code! + break; + } + } + if(iSeparatorimage) + { + textLeft = 0; + } + else + { + if (iTitles[drawingTitleIndex]->IsSvgTitle()) + { + return; + } + else + { + textLeft = iTitles[drawingTitleIndex]->TitleTextLengthInPixels(); + } + } + } + else + { + // Clip the text if needed in alternate mode + if ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EAlternate ) + { + HBufC* title = iTitles[drawingTitleIndex]->TitleText().AllocLC(); + TPtr titlePtr = title->Des(); + TInt maxLength = iContentRect.Width(); + AknBidiTextUtils::ConvertToVisualAndClipL( + titlePtr, *iFont, maxLength, maxLength ); + gc->DrawText( titlePtr, clipRect, iTextBaseline, alignment ); + CleanupStack::PopAndDestroy( title ); + } + else + { + gc->DrawText(iTitles[drawingTitleIndex]->TitleText(), + clipRect, + iTextBaseline, + alignment); + + } + break; + } + + if(iSeparatorimage) + { + TInt imageLeft = iSeparatorImageWidth - KGap; + + // if the rest of the image fits into visible area + if (imageLeft <= iContentRect.Width() - drawingOffset) + { + gc->BitBltMasked(TPoint(drawingPos, 0), iSeparatorimage->Bitmap(), + TRect(TPoint(0,0), + iSeparatorimage->Bitmap()->SizeInPixels()), iSeparatorimage->Mask(), ETrue); + drawingPos += iSeparatorImageWidth; + drawingOffset = drawingPos; + textLeft = iTitles[drawingTitleIndex]->TitleTextLengthInPixels(); + if (iTitles[drawingTitleIndex]->IsSvgTitle()) + { + return; + } + } + else + { + gc->BitBltMasked(TPoint(drawingPos, 0), iSeparatorimage->Bitmap(), + TRect(TPoint(0,0), iSeparatorimage->Bitmap()->SizeInPixels()), + iSeparatorimage->Mask(), ETrue); + break; + } + } + + if( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EAlternate || + iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate ) + { + break; + } + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::PrepareToDrawRtlL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::PrepareToDrawRtlL() + { + CBitmapContext* gc = iAdapter->BufferGc(); + const CFbsBitmap* background = iAdapter->BackgroundBitmap(); + if(!gc || !background || !IsVisibleTitles() ) + { + return; + } + if (iTitles[iFirstDrawingTitleIndex]->IsSvgTitle()) + { + // Show SVG title + iAdapter->ShowSvgL(); + + // Just in case, draw background to d-buffer + gc->BitBlt(TPoint(0,0), background); + return; + } + + CGraphicsContext::TTextAlign alignment = TextAlignment(); + if ( iTextFitInNewstickerRect || + iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EAlternate && iTitles.Count() == 1 ) + { + SetBeginningState(); + iAdapter->StopL(); + } + + // At first, draw background + gc->BitBlt(TPoint(0,0), background); + + TInt textLeft = iFirstDrawingOffset - + iTitles[iFirstDrawingTitleIndex]->TitleTextLengthInPixels(); + if(textLeft >= iContentRect.Width() ) + { + textLeft = 0; + } + TInt drawingTitleIndex = iFirstDrawingTitleIndex; + TInt drawingOffset(iContentRect.iBr.iX); + + TRect clipRect(TPoint(0,0), TPoint(iFirstDrawingOffset, iContentRect.Height())); + TInt clipWidth = clipRect.Width(); + // Main drawing loop. This loop runs as long as drawing area is not filled + FOREVER + { + // if the rest text fits into visible area + if (textLeft <= drawingOffset) + { + HBufC* title = iTitles[drawingTitleIndex]->TitleText().AllocLC(); + TPtr titlePtr = title->Des(); + + // convert to visual, do not clip + TInt maxLength = iTitles[drawingTitleIndex]->TitleTextLengthInPixels(); + AknBidiTextUtils::ConvertToVisualAndClipL( titlePtr, *iFont, + maxLength, maxLength ); + + gc->DrawText( titlePtr, clipRect, iTextBaseline, alignment ); + CleanupStack::PopAndDestroy( title ); + + TInt drawnLength = iTitles[drawingTitleIndex]->TitleTextLengthInPixels() + KGap; + clipWidth -= drawnLength; + clipRect.SetWidth(clipWidth); + drawingOffset = clipRect.iBr.iX; + + // Update title index + drawingTitleIndex++; + if(drawingTitleIndex >= iTitles.Count()) + { + drawingTitleIndex = 0; + if ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::ESlide || iTextFitInNewstickerRect) + { + // what a dirty code! + break; + } + } + if(iSeparatorimage) + { + textLeft = 0xfff; + } + else + { + if (iTitles[drawingTitleIndex]->IsSvgTitle()) + { + return; + } + else + { + textLeft = iTitles[drawingTitleIndex]->TitleTextLengthInPixels(); + } + } + } + else + { + // Clip the text if needed in alternate mode + if ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EAlternate ) + { + HBufC* title = iTitles[drawingTitleIndex]->TitleText().AllocLC(); + TPtr titlePtr = title->Des(); + TInt maxLength = iContentRect.Width(); + AknBidiTextUtils::ConvertToVisualAndClipL( + titlePtr, *iFont, maxLength, maxLength ); + gc->DrawText( titlePtr, clipRect, iTextBaseline, alignment ); + CleanupStack::PopAndDestroy( title ); + } + else + { + gc->DrawText(iTitles[drawingTitleIndex]->TitleText(), clipRect, + iTextBaseline, alignment); + } + break; + } + + if(iSeparatorimage) + { + TInt imageLeft = iSeparatorImageWidth - KGap; + + // if the rest of the image fits into visible area + if (imageLeft <= drawingOffset) + { + gc->BitBltMasked(TPoint(clipRect.iBr.iX - imageLeft, 0), + iSeparatorimage->Bitmap(), TRect(TPoint(0,0), + iSeparatorimage->Bitmap()->SizeInPixels()), + iSeparatorimage->Mask(), ETrue); + clipWidth -= iSeparatorImageWidth; + clipRect.SetWidth(clipWidth); + drawingOffset = clipRect.iBr.iX; + textLeft = iTitles[drawingTitleIndex]->TitleTextLengthInPixels(); + if (iTitles[drawingTitleIndex]->IsSvgTitle()) + { + return; + } + } + else + { + gc->BitBltMasked(TPoint(clipRect.iBr.iX - imageLeft, 0), + iSeparatorimage->Bitmap(), TRect(TPoint(0,0), + iSeparatorimage->Bitmap()->SizeInPixels()), + iSeparatorimage->Mask(), ETrue); + break; + } + } + + if( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EAlternate || + iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate ) + { + break; + } + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::DoScrollL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::DoScrollL() + { + // If there are no titles, don't do anything. + if( !IsVisibleTitles() || iFirstDrawingTitleIndex < 0 ) + { + return; + } + + iAdapter->DrawNow(); + + if( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScroll || + iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::ESlide || + ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate && + !CalculateCurrentTextFitInNewstickerRect() ) ) + { + iAdapter->SetTimerToScrolltime(); + iFirstDrawingOffset += iSpeed; // advance text + TInt titleLen = iTitles[iFirstDrawingTitleIndex]->TitleTextLengthInPixels() + + iSeparatorImageWidth; + + // if 100% (or more) has been drawn update... + if ((iIsWestern && iFirstDrawingOffset >= titleLen) || + (!iIsWestern && iFirstDrawingOffset - titleLen >= iContentRect.Width())) + { + iAdapter->TitleScrolled(iFirstDrawingTitleIndex); + iFirstDrawingTitleIndex = GetNextTitleWithContent( iFirstDrawingTitleIndex + 1); + if(iFirstDrawingTitleIndex >= iTitles.Count()) + { + iFirstDrawingTitleIndex = GetNextTitleWithContent( 0 ); + if (iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::ESlide ) + { + if ( iIsWestern ) + { + iFirstDrawingOffset = -(iContentRect.iBr.iX-iContentRect.iTl.iX-KGap); + } + else + { + iFirstDrawingOffset = 0; + } + } + else + { + iFirstDrawingOffset -= titleLen + KGap; + } + } + else + { + iFirstDrawingOffset -= titleLen + KGap; + } + iCurrentTitleIndex = iFirstDrawingTitleIndex; + + if( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate && + CalculateCurrentTextFitInNewstickerRect() ) + { + MoveToNextL(); + } + } + // but if less than 100% and more than 75% has been drawn, update only current title index. + else if (((iIsWestern && iFirstDrawingOffset >= titleLen * 0.75) || + (!iIsWestern && iFirstDrawingOffset - titleLen >= iContentRect.iBr.iX * 0.75)) && + iFirstDrawingTitleIndex == iCurrentTitleIndex) + { + iCurrentTitleIndex++; + if(iCurrentTitleIndex >= iTitles.Count()) + { + iCurrentTitleIndex = 0; + } + iCurrentTitleIndex = GetNextTitleWithContent( iCurrentTitleIndex ); + + if( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate && + CalculateCurrentTextFitInNewstickerRect() ) + { + MoveToNextL(); + } + } + } + else if( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate && + CalculateCurrentTextFitInNewstickerRect() ) + { + iAdapter->SetTimerToDisplaytime(); + MoveToNextL(); + } + else + { + MoveToNextL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::Draw +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::Draw() + { + if( IsVisibleTitles() > 0 ) + { + if( iIsWestern ) + { + TRAP_IGNORE( PrepareToDrawLtrL() ); + } + else + { + TRAP_IGNORE( PrepareToDrawRtlL() ); + } + } + else + { + CBitmapContext* gc = iAdapter->BufferGc(); + const CFbsBitmap* background = iAdapter->BackgroundBitmap(); + if ( gc && background ) + { + gc->BitBlt(TPoint(0,0), background); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::DrawStatic +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::DrawStatic() + { + // draw to buffer gc + CBitmapContext* gc = iAdapter->BufferGc(); + const CFbsBitmap* background = iAdapter->BackgroundBitmap(); + if( !gc || !background || !IsVisibleTitles() ) + { + return; + } + gc->BitBlt( TPoint(0,0), background ); + + // Get the last title + TInt index = GetNextTitleWithContent( iTitles.Count() - 1, ETrue ); + const TDesC& title = Title( index ); + + // truncate text if needed + HBufC* visualText = HBufC::New(title.Length() + KAknBidiExtraSpacePerLine); + if (visualText) + { + TPtr visualTextPtr(visualText->Des()); + TInt maxLength = iContentRect.Width(); + AknBidiTextUtils::ConvertToVisualAndClip( + title, visualTextPtr, *iFont, maxLength, maxLength ); + + TRect blitRect( 0, 0, iContentRect.Width(), iContentRect.Height() ); + gc->DrawText( *visualText, blitRect, iTextBaseline, TextAlignment() ); + delete visualText; + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::SetBeginningState +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::SetBeginningState() + { + iFirstDrawingOffset = 0; + if(!iIsWestern) + { + iFirstDrawingOffset = iContentRect.Width(); + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::SetScrollLooping +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::SetScrollLooping( TBool aLoop ) + { + iScrollLooping = aLoop; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::ScrollLooping +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CXnNewstickerControl::ScrollLooping() + { + return iScrollLooping; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::TextFitInNewstickerRect +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CXnNewstickerControl::TextFitInNewstickerRect() + { + return iTextFitInNewstickerRect; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CalculateTextFitInNewstickerRect +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CXnNewstickerControl::CalculateTextFitInNewstickerRect() + { + if ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::ESlide && + iTitles.Count() == 1 ) + { + const TInt count = iTitles.Count(); + TInt textWidth=0; + const TInt rectWidth = iContentRect.Width(); + for (TInt i=0; i<count && textWidth<rectWidth;i++) + { + textWidth += iTitles[i]->TitleTextLengthInPixels(); + } + iTextFitInNewstickerRect = (textWidth<rectWidth); + } + else + { + iTextFitInNewstickerRect = EFalse; + } + return iTextFitInNewstickerRect; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::CalculateCurrentTextFitInNewstickerRect +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CXnNewstickerControl::CalculateCurrentTextFitInNewstickerRect() + { + if ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate ) + { + const TInt count = iTitles.Count(); + TInt textWidth=0; + const TInt rectWidth = iContentRect.Width(); + if( iCurrentTitleIndex < count ) + { + textWidth = iTitles[iCurrentTitleIndex]->TitleTextLengthInPixels(); + } + return ( textWidth < rectWidth ); + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::SetTextAlignment +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::SetTextAlignment(TInt aAlignment) + { + iTextAlignment = aAlignment; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::TextAlignment +// if title fits to the drawing rect and scrolling behaviour is ESlide then +// use alignment value +// if scroll behaviour is alternate then use alignment value +// otherwise return ELeft in western and ERight on AH +// ----------------------------------------------------------------------------- +// +CGraphicsContext::TTextAlign CXnNewstickerControl::TextAlignment() + { + CGraphicsContext::TTextAlign alignment = iIsWestern ? CGraphicsContext::ELeft : CGraphicsContext::ERight; + + if ( iTextFitInNewstickerRect || iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EAlternate || + ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate && + CalculateCurrentTextFitInNewstickerRect() ) ) + { + switch( iTextAlignment ) + { + default: + case ELayoutAlignLeft: + alignment = CGraphicsContext::ELeft; + break; + case ELayoutAlignRight: + alignment = CGraphicsContext::ERight; + break; + case ELayoutAlignCenter: + alignment = CGraphicsContext::ECenter; + break; + } + } + return alignment; + } + +TInt CXnNewstickerControl::GetNextTitleWithContent( TInt aStartSearch, TBool aBackwards ) + { + TInt dir = 1; + if ( aBackwards ) + { + dir = -1; + } + for( TInt i = aStartSearch; i < iTitles.Count() && i >= 0; i += dir ) + { + if ( iTitles[i]->TitleTextLengthInPixels() != 0 ) + { + return i; + } + } + return aStartSearch; + } + +TBool CXnNewstickerControl::IsVisibleTitles() + { + for( TInt i = 0; i < iTitles.Count() ; ++i ) + { + if ( iTitles[i]->TitleTextLengthInPixels() != 0 ) + { + return ETrue; + } + } + return EFalse; + } + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickerfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickerfactory.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for factory creating CXn3Newsticker-element +* +*/ + + +#include "xntype.h" +#include "xnnodepluginif.h" +#include "xnproperty.h" +#include <ecom/implementationproxy.h> + +#include "xnnewstickerfactory.h" +#include "xnnewstickeradapter.h" +#include <aisystemuids.hrh> + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// E32Dll implements the Symbian OS dll entry point +// ----------------------------------------------------------------------------- +// +#ifndef EKA2 +GLDEF_C TInt E32Dll(TDllReason) + { + return KErrNone; + } +#endif + +// ----------------------------------------------------------------------------- +// CXnEikLabelFactory::MakeXnComponentL +// Creates the Xuikon component for label control +// ----------------------------------------------------------------------------- +// +MXnComponentFactory::TXnComponentFactoryResponse CXnNewstickerFactory::MakeXnComponentL( + CXnNodePluginIf& aNode, CXnComponent*& aTargetComponent) + { + MXnComponentFactory::TXnComponentFactoryResponse retVal = + MXnComponentFactory::EXnFactoryResponseComponentNotSupported; + // Check that the given type of a control is parent (or ancestor) of this control + if(aNode.Type()->Type() == XnPropertyNames::newsticker::KXnNewsticker) + { + CXnNewsticker* container = CXnNewsticker::NewL(); + aTargetComponent = static_cast<CXnComponent*>(container); + retVal = MXnComponentFactory::EXnFactoryResponseComponentConstructed; + return retVal; + } + return retVal; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerFactory::MakeXnControlAdapterL +// Creates the control adapter for label control +// ----------------------------------------------------------------------------- +// +CXnControlAdapter* CXnNewstickerFactory::MakeXnControlAdapterL( + CXnNodePluginIf& aNode, CXnControlAdapter* aParent) + { + return CXnNewstickerAdapter::NewL(aParent, aNode); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerFactory::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnNewstickerFactory* CXnNewstickerFactory::NewL() + { + CXnNewstickerFactory* self = new(ELeave) CXnNewstickerFactory; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerFactory::CXnNewstickerFactory +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnNewstickerFactory::CXnNewstickerFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerFactory::~CXnNewstickerFactory +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnNewstickerFactory::~CXnNewstickerFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerFactory::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnNewstickerFactory::ConstructL() + { + } + +// Define the interface UIDs +const TImplementationProxy ImplementationTable[] = + { +#ifdef __EABI__ + IMPLEMENTATION_PROXY_ENTRY(AI3_UID_RENDERING_PLUGIN_NEWSTICKERFACTORY_IMPLEMENTATION, CXnNewstickerFactory::NewL) +#else + {{AI3_UID_RENDERING_PLUGIN_NEWSTICKERFACTORY_IMPLEMENTATION}, CXnNewstickerFactory::NewL} +#endif + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickersvgcontrol.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickersvgcontrol.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,222 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Text scrolling functionality. +* +*/ + + +// INCLUDE FILES +#include <SVGEngineInterfaceImpl.h> + +#include "xnnewstickersvgcontrol.h" +#include "xnnewstickeradapter.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnNewstickerSvgControl::CXnNewstickerSvgControl +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnNewstickerSvgControl::CXnNewstickerSvgControl(CXnNewstickerAdapter* aAdapter) : + iAdapter(aAdapter) + { + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerSvgControl::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnNewstickerSvgControl::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerSvgControl::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnNewstickerSvgControl* CXnNewstickerSvgControl::NewL(CXnNewstickerAdapter* aAdapter) + { + CXnNewstickerSvgControl* self = new(ELeave)CXnNewstickerSvgControl(aAdapter); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerSvgControl::~CXnNewstickerSvgControl() +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnNewstickerSvgControl::~CXnNewstickerSvgControl() + { + delete iBitmap; + delete iMaskBitmap; + if(iSVGEngine) + { + iSVGEngine->Destroy(); + delete iSVGEngine; + } + } + +// --------------------------------------------------------- +// CXnNewstickerSvgControl::StartL +// --------------------------------------------------------- +// +void CXnNewstickerSvgControl::StartL(const TDesC8& aSvgData) + { + iHasContent = ETrue; + if(!iSVGEngine) + { + TFontSpec fspec; + iSVGEngine = CSvgEngineInterfaceImpl::NewL(iBitmap,this, fspec); + } + + MSvgError* error = iSVGEngine->Load(aSvgData); + User::LeaveIfError(error->SystemErrorCode()); + + // Get the size of the bitmap and set the SVG size to match + TSize tmpsize = iBitmap->SizeInPixels(); + iSVGEngine->SetSvgDimensionToFrameBuffer(tmpsize.iWidth, tmpsize.iHeight); + iSVGEngine->SetBackgroundColor(0x00FFFFFF, NULL); + iSVGEngine->Start(); + } + +// --------------------------------------------------------- +// CXnNewstickerSvgControl::StopL +// --------------------------------------------------------- +// +void CXnNewstickerSvgControl::StopL() + { + iHasContent = EFalse; + if(iSVGEngine) + { + iSVGEngine->Stop(); + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerSvgControl::SetSvgRectL +// Set visible rect. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnNewstickerSvgControl::SetSvgRectL(TRect& aContentRect, CGraphicsDevice& aDevice ) + { + iContentRect = aContentRect; + + TDisplayMode displayMode = aDevice.DisplayMode(); + + if(iBitmap) + { + delete iBitmap; + iBitmap = NULL; + } + iBitmap = new (ELeave) CFbsBitmap(); + iBitmap->Create(iContentRect.Size(),displayMode); + + if(iMaskBitmap) + { + delete iMaskBitmap; + iMaskBitmap = NULL; + } + iMaskBitmap = new (ELeave) CFbsBitmap(); + iMaskBitmap->Create(iContentRect.Size(),EGray256); + + if(iSVGEngine && iHasContent) + { + iSVGEngine->SetFrameBuffer(iBitmap); + TSize tmpsize = iBitmap->SizeInPixels(); + iSVGEngine->SetSvgDimensionToFrameBuffer(tmpsize.iWidth, tmpsize.iHeight); + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerSvgControl::Draw +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnNewstickerSvgControl::Draw() const + { + TPoint point(iContentRect.iTl); + iAdapter->BufferGc()->BitBlt(TPoint(0,0), iAdapter->BackgroundBitmap()); + iAdapter->BufferGc()->BitBltMasked(TPoint(0,0), iBitmap, + TRect(iBitmap->SizeInPixels()), iMaskBitmap, ETrue); + } + +// --------------------------------------------------------------------------- +// From class MSvgRequestObserver. +// CXnNewstickerSvgControl::UpdateScreen +// --------------------------------------------------------------------------- +// +void CXnNewstickerSvgControl::UpdateScreen() + { + iSVGEngine->GenerateMask(iMaskBitmap, NULL); + + iAdapter->DrawNow(); + } + +// --------------------------------------------------------------------------- +// From class MSvgRequestObserver. +// CXnNewstickerSvgControl::ScriptCall +// --------------------------------------------------------------------------- +// +TBool CXnNewstickerSvgControl::ScriptCall( + const TDesC& /*aScript*/, + CSvgElementImpl* /*aCallerElement*/) + { + return EFalse; + } + +// --------------------------------------------------------------------------- +// From class MSvgRequestObserver. +// CXnNewstickerSvgControl::FetchImage +// --------------------------------------------------------------------------- +// +TInt CXnNewstickerSvgControl::FetchImage( + const TDesC& /*aUri*/, + RFs& /*aSession*/, + RFile& /*aFileHandle*/) + { + return KErrNotFound; + } + +// --------------------------------------------------------------------------- +// From class MSvgRequestObserver. +// CXnNewstickerSvgControl::FetchFont +// --------------------------------------------------------------------------- +// +TInt CXnNewstickerSvgControl::FetchFont( + const TDesC& /*aUri*/, + RFs& /*aSession*/, + RFile& /*aFileHandle*/) + { + return KErrNotFound; + } + +// --------------------------------------------------------------------------- +// From class MSvgRequestObserver. +// CXnNewstickerSvgControl::UpdatePresentation +// --------------------------------------------------------------------------- +// +void CXnNewstickerSvgControl::UpdatePresentation(const TInt32& /*aNoOfAnimation*/) + { + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,25 @@ +/* +* 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: Building information file +* +*/ + + +PRJ_PLATFORMS +ARMV5 WINSCW + +PRJ_EXPORTS + +PRJ_MMPFILES +xnnppluginfactory.mmp diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/group/xnnppluginfactory.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/group/xnnppluginfactory.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,58 @@ +/* +* 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: Mmp-file for XnNPPluginFactory +* +*/ + + +#include <platform_paths.hrh> +#include <platform/mw/aisystemuids.hrh> + +TARGET xn3nppluginfactory.dll +TARGETTYPE PLUGIN +UID 0x10009d8d AI3_UID_RENDERING_PLUGIN_NPPLUGINFACTORY + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE xnnppluginfactory.cpp +SOURCE xnnpplugin.cpp +SOURCE xnnppluginadapter.cpp +SOURCE xnnpplugincontroladapter.cpp +SOURCE xnnppluginhandler.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY cone.lib +LIBRARY bafl.lib +LIBRARY efsrv.lib + +LIBRARY xn3resource.lib + +LIBRARY xn3layoutengine.lib +LIBRARY xn3utils.lib +LIBRARY xn3domdocument.lib + +START RESOURCE xn3nppluginfactory.rss +#ifdef SYMBIAN_SECURE_ECOM +TARGET xn3nppluginfactory.rsc +#endif +END + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/inc/xnnpplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/inc/xnnpplugin.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,65 @@ +/* +* 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: Wrapper class for Netscape Plugin API. +* +*/ + + + +#ifndef _XNNPPLUGIN_H +#define _XNNPPLUGIN_H + +// INCLUDES +#include "xncomponent.h" + +// CLASS DECLARATION + +/** +* @ingroup group_xnnppluginfactory +* +* Wrapper class for Netscape Plugin API. +* +* @lib xn3nppluginfactory.lib +* @since Series 60 3.1 +*/ +class CXnNPPlugin : public CXnComponent + { + public: // Constructors and destructor + /** + * Two-phased constructor. + */ + static CXnNPPlugin* NewL(); + + /** + * Destructor. + */ + virtual ~CXnNPPlugin(); + + private: + /** + * C++ default constructor. + */ + CXnNPPlugin(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: + }; + +#endif // _XNNPPLUGIN_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/inc/xnnppluginadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/inc/xnnppluginadapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,114 @@ +/* +* 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: Wrapper class for Netscape plugin implementation. +* +*/ + + + +#ifndef _XNNPPLUGINADAPTER_H +#define _XNNPPLUGINADAPTER_H + +// INCLUDES +#include "xncontroladapter.h" +#include "xnnpplugincontroladapter.h" +#include <npupp.h> + + +// FORWARD DECLARATIONS +class CXnNodePluginIf; +class CXnNPPluginHandler; + +// CLASS DECLARATION + +/** +* @ingroup group_xnnppluginfactory +* +* Wrapper class for Netscape plugin implementation. +* +* @lib xn3nppluginfactory.lib +* @since Series 60 3.1 +*/ +class CXnNPPluginAdapter : public CXnControlAdapter + { + public: // Constructors and destructor + /** + * Two-phased constructor. + * @param aParent Parent of the adapter. + * @param aNode Corresponding DOM-node + */ + static CXnNPPluginAdapter* NewL( CXnControlAdapter* aParent, CXnNodePluginIf& aNode ); + + /** + * Destructor. + */ + virtual ~CXnNPPluginAdapter(); + + public: // Functions from base classes + + /** + * From CCoeControl Responds to changes to the size and position + * of the contents of this control. + * @since Series 60 3.1 + * @return void + */ + void SizeChanged(); + + /** + * Enter power save mode. This is done when application goes to background or lights go off. + * Derived classes should override this function and stop animations, timers etc. when the function is called. + */ + void DoEnterPowerSaveModeL(TModeEvent aEvent); + + /** + * Exit power save mode. This is done when application comes to foreground or lights go on. + * Derived classes should override this function and restart animations, timers etc. when the function is called. + */ + void DoExitPowerSaveModeL(TModeEvent aEvent); + + private: + /** + * C++ default constructor. + */ + CXnNPPluginAdapter(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( CXnControlAdapter* aParent, CXnNodePluginIf& aNode ); + + TInt ConstructPluginL( CXnControlAdapter* aParent ); + + private: // Data + //Node interface, not owned + CXnNodePluginIf* iNode; + //File server handle, owned + RFs iFs; + //CFileman instance, owned + CFileMan* iFileman; + //Stores the content file name, owned + HBufC* iContentFile; + //Pointer to plugin controller, owned + CXnNPPluginControlAdapter* iPluginController; + //Pointer to plugin handler, owned + CXnNPPluginHandler* iPluginHandler; + //Pointer to NPP instance, owned + NPP iInstance; + //Pointer to NPN functions, owned + NPPluginFuncs* iPluginFuncs; + }; + +#endif // _XNNPPLUGINADAPTER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/inc/xnnpplugincontroladapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/inc/xnnpplugincontroladapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,163 @@ +/* +* 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: The plugin can use this interface to communicate with the browser. +* +*/ + + + +#ifndef CPLUGINCONTROLADAPTER_H +#define CPLUGINCONTROLADAPTER_H + +// INCLUDES +#include <PluginAdapterInterface.h> + +// CLASS DECLARATION + +/** +* @ingroup group_xnnppluginfactory +* +* The plugin can use this interface to communicate with the browser. +* +* @lib xn3nppluginfactory.lib +* @since Series 60 3.1 +*/ +/* Note that inheritance order must be MPluginAdapter, CBase don't change it */ +class CXnNPPluginControlAdapter : public MPluginAdapter, public CBase + { + public: // Functions from base classes + + /** + * Gets the pointer to the minor version number of the plugin. + * @since Series 60 3.1 + * @return 1. + */ + TUint16 GetVersion() { return 1; }; + + /** + * Called when the plug-in has completed its creation. + * This function is called from the constructL function of the plug-in. + * @since Series 60 3.1 + * @param aPluginControl A pointer to the plug-in control window + * @return None + */ + void PluginConstructedL( CCoeControl* aPluginControl ); + + /** + * Called after the plug-in has been deleted. + * This function is called from the destructor of the plug-in. + * @since Series 60 3.1 + * @return None + */ + void PluginFinishedL(); + +#ifndef __SERIES60_30__ + + /** + * Called by the plug-in to open a URL in the parent frame. + * This function is not implemented in Series 60. + * @since Series 60 3.1 + * @param aUrl Name of the URL to open + * @return None + */ + inline void OpenUrlL( const TDesC& /*aUrl*/ ) {}; + + /** + * Called by the plug-in to open a URL in a named window or frame. + * This function is not implemented in Series 60. + * @since Series 60 3.1 + * @param aUrl Name of the URL to open + * @param aNewTargetWindowName The name of the target window or frame + * @return None + */ + inline void OpenUrlInTargetWindowL( const TDesC& /*aUrl*/, + const TDesC& /*aNewTargetWindowName*/ ) {}; + + /** + * Specifies whether or not the frame has a previous navigation history item. + * This function is not implemented in Series 60. + * @since Series 60 3.1 + * @return true if the frame has a previous navigation history item false otherwise + */ + inline TBool HasNavigationHistoryPrevious() const { return EFalse; }; + + /** + * Informs the browser to load the next navigation history URL in its parent frame. + * This function is not implemented in Series 60. + * @since Series 60 3.1 + * @return None + */ + inline void LoadNavigationHistoryPreviousL() {}; + + /** + * Returns whether the frame has a next navigation history item. + * This function is not implemented in Series 60. + * @since Series 60 3.1 + * @return Returns whether the frame has a next navigation history item. + */ + inline TBool HasNavigationHistoryNext() const { return EFalse; }; + + /** + * Informs the browser to load the next navigation history URL in its parent frame. + * This function is not implemented in Series 60. + * @since Series 60 3.1 + * @return None + */ + inline void LoadNavigationHistoryNextL() {}; + +#endif // __SERIES60_30__ + /** + * Returns the window system level control object for the plug-in. + * @since Series 60 3.1 + * @return A pointer to the parent control window. + */ + CCoeControl* GetParentControl(); + + /** + * Returns the observer for the plug-in control. + * @since Series 60 3.1 + * @return Observer that the plug-in can use to send events to the browser. + */ + MCoeControlObserver* GetParentControlObserver(); + + /** + * Sets the plug-in notifier allowing the plug-in to control portions of the browser. + * @since Series 60 3.1 + * @param aNotifier Pointer to an interface that the browser can use to send + * events to the plug-in. + * @return None + */ + void SetPluginNotifier( MPluginNotifier *aNotifier ); + /** + * Tells the plugin adapter if plugin content can accept user interaction. This function + * is called from the plugin. + * @since Series 60 3nd Edition + * @param None + * @return None + */ + void SetContentInteractive(TBool /*aInteractive*/ ); + + + public: // Data + // Pointer to Browser Plugins control adapter, not owned + CCoeControl* iNPPControlAdapter; + // Pointer to parent control adapter, not owned + CCoeControl* iParentControlAdapter; + // Set by plugin. Notifies plugin through MPluginNotifier functions + MPluginNotifier* iPluginNotifier; +}; + +#endif // CPLUGINCONTROLADAPTER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/inc/xnnppluginfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/inc/xnnppluginfactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,93 @@ +/* +* 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: Factory for creating CXnNPPlugin -component +* +*/ + + +#ifndef _XNNPPLUGINFACTORY_H +#define _XNNPPLUGINFACTORY_H + +// INCLUDES +#include <ecom/implementationproxy.h> +#include "xncomponentfactory.h" + +// FORWARD DECLARATIONS +class CXnComponent; + +// CLASS DECLARATION + +/** +* @ingroup group_xnnppluginfactory +* +* Layout Area UI factory interface for creating UI representations of the layout areas. +* This class is wrapper for containing CBitmap +* +* @lib xn3nppluginfactory.lib +* @since Series 60 3.1 +*/ +// inheritance order must be this, despite codescanner warnings +class CXnNPPluginFactory : public MXnComponentFactory, public CBase + { + public: // Data types + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnNPPluginFactory* NewL(); + + /** + * Destructor. + */ + virtual ~CXnNPPluginFactory(); + + public: // Functions from base classes + /** + * Creates the Xuikon component for text component. + * @param aNode Corresponding DOM-node + * @param aTargetComponent Pointer reference to the component to be created. + */ + virtual TXnComponentFactoryResponse MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent ); + /** + * Creates the control adapter for text component. + * @param aNode Corresponding DOM-node + * @param aParent Parent of the adapter, which is created here. + * @return Created control adapter. + */ + virtual CXnControlAdapter* MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent = NULL ); + private: + /** + * C++ default constructor. + */ + CXnNPPluginFactory(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + }; + +// Exported factory function required by ECOM-framework +IMPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ); + +#endif // _XNNPPLUGINFACTORY_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/inc/xnnppluginhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/inc/xnnppluginhandler.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,85 @@ +/* +* 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: Loads the browser plugin via ECOM. +* +*/ + + + +#ifndef XNNPPLUGINHANDLER_H +#define XNNPPLUGINHANDLER_H + +// INCLUDES +#include <e32base.h> +#include <npupp.h> + +// FORWARD DECLARATIONS +class CEcomBrowserPluginInterface; + +// CLASS DECLARATION + +/** +* @ingroup group_xnnppluginfactory +* +* Loads the browser plugin via ECOM. +* +* @lib xn3nppluginfactory.lib +* @since Series 60 3.1 +*/ +class CXnNPPluginHandler : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnNPPluginHandler* NewL(); + + /** + * Destructor. + */ + virtual ~CXnNPPluginHandler(); + + + public: // New functions + /** + * Loads the plugin using ECOM interface. The mime type of the + * plugin is passed to the function. + * @since Series 60 3.1 + * @param aResolveparam The mime type of the plugin to be loaded. + * @param aPluginFuncs Netscape plugin functions + * @return KErrNotFound if the mime type is not found. + */ + TInt LoadSpecificPluginL( const TDesC8& aResolveparam, NPPluginFuncs** aPluginFuncs ); + + private: + + /** + * C++ default constructor. + */ + CXnNPPluginHandler(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + //Plugin interface, owned + CEcomBrowserPluginInterface* iPluginInterface; + }; + +#endif // XNNPPLUGINHANDLER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/src/xn3nppluginfactory.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/src/xn3nppluginfactory.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// 1020745A.RSS +// +#include <ecom/registryinfo.rh> +#include <platform/mw/aisystemuids.hrh> + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = AI3_UID_RENDERING_PLUGIN_NPPLUGINFACTORY; +interfaces = + { + INTERFACE_INFO + { + interface_uid = AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI3_UID_RENDERING_PLUGIN_NPPLUGINFACTORY_IMPLEMENTATION; + version_no = 1; + display_name = "Xnnppluginfactory"; + default_data = "object"; + opaque_data = ""; + } + }; + } + }; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/src/xnnpplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/src/xnnpplugin.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,68 @@ +/* +* 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 Netscape Plugin API. +* +*/ + + +// INCLUDE FILES +#include "xnnpplugin.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnNPPlugin::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnNPPlugin* CXnNPPlugin::NewL() + { + CXnNPPlugin* self = new( ELeave ) CXnNPPlugin; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnNPPlugin::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnNPPlugin::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnNPPlugin::CXnNPPlugin +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnNPPlugin::CXnNPPlugin() + { + } + +// ----------------------------------------------------------------------------- +// CXnNPPlugin::~CXnNPPlugin +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnNPPlugin::~CXnNPPlugin() + { + } + +// End of file + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/src/xnnppluginadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/src/xnnppluginadapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,316 @@ +/* +* 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 Netscape Plugin API. +* +*/ + + +// INCLUDE FILES +#include "xnnppluginadapter.h" +#include "xnnpplugincontroladapter.h" +#include "xnnppluginhandler.h" +#include "xnproperty.h" +#include "xndomproperty.h" +#include "xndompropertyvalue.h" +#include "xndomlist.h" +#include "xnnodepluginif.h" +#include "xnuienginepluginif.h" +#include "xnresource.h" +#include "c_xnutils.h" + +// MACROS +_LIT8( KContentFile, "contentfile" ); +_LIT8( KMediaType, "mediatype" ); + +// LOCAL FUNCTION PROTOTYPES +const TDesC8& GetStringPropertyL( CXnNodePluginIf& aNode, const TDesC8& aProperty ); +CXnResource* FindResource(TXnUiEnginePluginIf& aEngine, const TDesC& aResourceFileName ); + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// GetStringProperty Retrieves the string property for the node. +// Returns: CXnNodePluginIf& aNode A node. +// TDesC8& aProperty A name of the property. +// const TDesC8 The value of property. +// ----------------------------------------------------------------------------- +// +const TDesC8& GetStringPropertyL( + CXnNodePluginIf& aNode, + const TDesC8& aProperty ) + { + CXnProperty* prop = aNode.GetPropertyL( aProperty ); + if( prop ) + { + CXnDomPropertyValue* value = + static_cast<CXnDomPropertyValue*>(prop->Property()->PropertyValueList().Item(0)); + if( CXnDomPropertyValue::EIdent == value->PrimitiveValueType() || + CXnDomPropertyValue::EString == value->PrimitiveValueType() ) + { + return prop->StringValue(); + } + } + return KNullDesC8; + } + +// ----------------------------------------------------------------------------- +// FindResource Locates a resource from the resource list. +// Returns: TXnUiEnginePluginIf& Pointer to UIEngine. +// const TDesC& The name of the resource file. +// CCnResource The actual resource. +// ----------------------------------------------------------------------------- +// +CXnResource* FindResource( + TXnUiEnginePluginIf& aEngine, + const TDesC& aResourceFileName ) + { + if (aResourceFileName == KNullDesC) + { + return NULL; + } + CArrayPtrSeg<CXnResource>& resources = aEngine.Resources(); + for (TInt i = resources.Count() - 1; i >= 0; --i) + { + CXnResource* res = resources.At(i); + if (res->ResourceId().Compare(aResourceFileName) == 0 ) + { + return res; + } + } + return NULL; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnNPPluginAdapter::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnNPPluginAdapter* CXnNPPluginAdapter::NewL( + CXnControlAdapter* aParent, + CXnNodePluginIf& aNode ) + { + CXnNPPluginAdapter* self = new( ELeave ) CXnNPPluginAdapter; + + CleanupStack::PushL( self ); + self->ConstructL( aParent, aNode ); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnNPPluginAdapter::CXnNPPluginAdapter +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnNPPluginAdapter::CXnNPPluginAdapter() + { + } + +// ----------------------------------------------------------------------------- +// CXnNPPluginAdapter::~CXnNPPluginAdapter +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnNPPluginAdapter::~CXnNPPluginAdapter() + { + //Clean up the content file from private folder. + iFs.Close(); + delete iContentFile; + + if( iPluginFuncs ) + { + iPluginFuncs->destroy(iInstance,NULL); + } + delete iPluginFuncs; + delete iPluginController; + delete iPluginHandler; + delete iInstance; + } + +// ----------------------------------------------------------------------------- +// CXnNPPluginAdapter::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnNPPluginAdapter::ConstructL( + CXnControlAdapter* aParent, + CXnNodePluginIf& aNode ) + { + iNode = &aNode; + + CXnControlAdapter::ConstructL( aNode ); + + iPluginHandler = CXnNPPluginHandler::NewL(); + + iPluginController = new (ELeave)CXnNPPluginControlAdapter; + ConstructPluginL( aParent ); + } + + +// ----------------------------------------------------------------------------- +// CXnNPPluginAdapter::ConstructPluginL +// Function returns if something goes wrong in plugin loading. +// ----------------------------------------------------------------------------- +// +TInt CXnNPPluginAdapter::ConstructPluginL( CXnControlAdapter* aParent ) + { + const TDesC8& mimeType = GetStringPropertyL( *iNode, KMediaType ); + const TDesC8& contentFile = GetStringPropertyL( *iNode, KContentFile ); + + iContentFile = HBufC::NewL( contentFile.Length() ); + TPtr cFilePtr = iContentFile->Des(); + cFilePtr.Copy( contentFile ); + + //Connect to file server + User::LeaveIfError( iFs.Connect() ); + iFs.CreatePrivatePath( EDriveC ); + + // Return if plugin could not be loaded. + if( KErrNone != iPluginHandler->LoadSpecificPluginL( mimeType, &iPluginFuncs )) + { + return KErrGeneral; + } + + // Call parent + iPluginController->iParentControlAdapter = aParent; + + iInstance = ( NPP ) User::AllocL( sizeof( NPP_t )); + iInstance->ndata = ( void* ) iPluginController; + iInstance->pdata = NULL; + + CDesCArray* argn = new( ELeave ) CDesCArrayFlat(1); + CDesCArray* argv = new( ELeave ) CDesCArrayFlat(1); + + argn->AppendL( KNullDesC ); + argv->AppendL( KNullDesC ); + + if (( iPluginFuncs ) && ( iPluginFuncs->newp )) + { + TDesC8* string( NULL ); + iPluginFuncs->newp(*string, iInstance, NP_EMBED, CONST_CAST( CDesCArray*, argn ), + CONST_CAST( CDesCArray*, argv ), NULL); + } + else + { + delete argn; + delete argv; + return KErrGeneral; + } + + TRect rect = iNode->Rect(); + // Coordinates for the plugin always start from (0,0) and are relative + // to the parent CCoeControl + NPWindow window; + window.x = 0; + window.y = 0; + window.width = rect.Width(); + window.height = rect.Height(); + window.type = NPWindowTypeDrawable; + window.window = ( void* ) iPluginController; + window.clipRect.top = window.x; + window.clipRect.bottom = window.x + window.height; + window.clipRect.left = window.y; + window.clipRect.right = window.y + window.width; + // Finally set the window. + iPluginFuncs->setwindow(iInstance,&window); + + NPStream* npstream = ( NPStream* )User::AllocL( sizeof( NPStream )); + npstream->url = NULL; + npstream->notifyData = NULL; + + TPtr resFileName = iContentFile->Des(); + /*TInt bitmapIndex; + CXnResource* resource = CXnUtils::FindResource( iNode->UiEngineL()->Resources(), + resFileName, bitmapIndex ); + if( !resource ) + { + User::Leave( KErrNotFound ); + } + TParsePtrC pathParser( resource->FileName() ); + TPtrC driveAndPath = pathParser.DriveAndPath();*/ + + npstream->url = resFileName.AllocL(); + + iPluginFuncs->asfile( iInstance, npstream, resFileName ); + + // Tell the plugin to destroy its stream + iPluginFuncs->destroystream( iInstance, npstream, 0 ); + // Delete the NPStream object + delete npstream->url; + delete npstream; + delete argn; + delete argv; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CXnNPPluginAdapter::SizeChanged +// (Other items were commented in header.) +// ----------------------------------------------------------------------------- +// +void CXnNPPluginAdapter::SizeChanged() + { + if( iPluginFuncs ) + { + TRect rect = iNode->Rect(); + // Coordinates for the plugin always start from (0,0) and are relative + // to the parent CCoeControl + NPWindow window; + window.x = 0; + window.y = 0; + window.width = rect.Width(); + window.height = rect.Height(); + window.type = NPWindowTypeDrawable; + window.window = ( void* ) iPluginController; + window.clipRect.top = window.x; + window.clipRect.bottom = window.x + window.height; + window.clipRect.left = window.y; + window.clipRect.right = window.y + window.width; + // Finally set the window. + iPluginFuncs->setwindow(iInstance,&window); + // Set the correct position to the parent CCoeControl. + iPluginController->iNPPControlAdapter->SetPosition( TPoint( rect.iTl.iX, rect.iTl.iY )); + } + } +// ----------------------------------------------------------------------------- +// CXnNPPluginAdapter::DoEnterPowerSaveModeL +// Enter power save mode +// ----------------------------------------------------------------------------- +void CXnNPPluginAdapter::DoEnterPowerSaveModeL(TModeEvent /*aEvent*/) + { + if ( iPluginController->iPluginNotifier ) + { + iPluginController->iPluginNotifier->NotifyL + (MPluginNotifier::EApplicationFocusChanged, NULL); + } + } + +// ----------------------------------------------------------------------------- +// CXnNPPluginAdapter::DoExitPowerSaveModeL +// Exit power save mode +// ----------------------------------------------------------------------------- +void CXnNPPluginAdapter::DoExitPowerSaveModeL(TModeEvent /*aEvent*/) + { + if ( iPluginController->iPluginNotifier ) + { + TBool param(ETrue); + iPluginController->iPluginNotifier->NotifyL + (MPluginNotifier::EApplicationFocusChanged, ¶m ); + + } + } +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/src/xnnpplugincontroladapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/src/xnnpplugincontroladapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,83 @@ +/* +* 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: The plugin can use this interface to communicate with the browser. +* +*/ + + + +// INCLUDE FILES +#include "xnnpplugincontroladapter.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnNPPluginControlAdapter::PluginConstructedL +// Other items were commented in header. +// ----------------------------------------------------------------------------- +// +void CXnNPPluginControlAdapter::PluginConstructedL( CCoeControl* aControl ) + { + iNPPControlAdapter = aControl; + } + +// ----------------------------------------------------------------------------- +// CXnNPPluginControlAdapter::PluginFinishedL +// Other items were commented in header. +// ----------------------------------------------------------------------------- +// +void CXnNPPluginControlAdapter::PluginFinishedL() + { + } + +// ----------------------------------------------------------------------------- +// CXnNPPluginControlAdapter::GetParentControl +// Other items were commented in header. +// ----------------------------------------------------------------------------- +// +CCoeControl* CXnNPPluginControlAdapter::GetParentControl() + { + return iParentControlAdapter; + } + +// ----------------------------------------------------------------------------- +// CXnNPPluginControlAdapter::GetParentControlObserver +// Other items were commented in header. +// ----------------------------------------------------------------------------- +// +MCoeControlObserver* CXnNPPluginControlAdapter::GetParentControlObserver() + { + return iParentControlAdapter->Observer(); + } + +// ----------------------------------------------------------------------------- +// CXnNPPluginControlAdapter::SetPluginNotifier +// Other items were commented in header. +// ----------------------------------------------------------------------------- +// +void CXnNPPluginControlAdapter::SetPluginNotifier( MPluginNotifier* aNotifier ) + { + iPluginNotifier = aNotifier; + } +// ----------------------------------------------------------------------------- +// CXnNPPluginControlAdapter::SetContentInteractive +// Other items were commented in header. +// ----------------------------------------------------------------------------- +// +void CXnNPPluginControlAdapter::SetContentInteractive(TBool /*aInteractive*/ ) + { + } + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/src/xnnppluginfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/src/xnnppluginfactory.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,130 @@ +/* +* 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: Factory class for XnNPPlugin, which wraps the Netscape Plugin API. +* +*/ + + + +// INCLUDE FILES +#include "xnnppluginfactory.h" +#include "xnnppluginadapter.h" +#include "xnnpplugin.h" +#include "xntype.h" +#include "xnnodepluginif.h" +#include <aisystemuids.hrh> + +// MACROS +_LIT8( KXnObject, "object" ); + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CXnEikLabelFactory::MakeXnComponentL +// Creates the Xuikon component for label control +// ----------------------------------------------------------------------------- +// +MXnComponentFactory::TXnComponentFactoryResponse CXnNPPluginFactory::MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent ) + { + MXnComponentFactory::TXnComponentFactoryResponse retVal = + MXnComponentFactory::EXnFactoryResponseComponentNotSupported; + + // Check that the given type of a control is parent (or ancestor) of this control + if ( aNode.Type()->Type() == KXnObject ) + { + aTargetComponent = CXnNPPlugin::NewL(); + retVal = MXnComponentFactory::EXnFactoryResponseComponentConstructed; + } + + return retVal; + } + +// ----------------------------------------------------------------------------- +// CXnTextFactory::MakeXnControlAdapterL +// Creates the control adapter for label control +// ----------------------------------------------------------------------------- +// +CXnControlAdapter* CXnNPPluginFactory::MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent ) + { + return CXnNPPluginAdapter::NewL( aParent, aNode ); + } + + +// ----------------------------------------------------------------------------- +// CXnNPPluginFactory::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnNPPluginFactory* CXnNPPluginFactory::NewL() + { + CXnNPPluginFactory* self = new( ELeave ) CXnNPPluginFactory; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnNPPluginFactory::CXnNPPluginFactory +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnNPPluginFactory::CXnNPPluginFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnNPPluginFactory::~CXnNPPluginFactory +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnNPPluginFactory::~CXnNPPluginFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnNPPluginFactory::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnNPPluginFactory::ConstructL() + { + } + +// Define the interface UIDs +const TImplementationProxy ImplementationTable[] = + { + #ifdef __EABI__ + IMPLEMENTATION_PROXY_ENTRY( AI3_UID_RENDERING_PLUGIN_NPPLUGINFACTORY_IMPLEMENTATION, CXnNPPluginFactory::NewL ) + #else + {{AI3_UID_RENDERING_PLUGIN_NPPLUGINFACTORY_IMPLEMENTATION}, CXnNPPluginFactory::NewL} + #endif + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); + + return ImplementationTable; + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/src/xnnppluginhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnppluginfactory/src/xnnppluginhandler.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,415 @@ +/* +* 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: Loads the browser plugin via ECOM. +* +*/ + + + +// INCLUDE FILES +#include "xnnppluginhandler.h" +#include <ecom/implementationinformation.h> +#include <CEcomBrowserPluginInterface.h> + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ParseAndMatchMimeTypeL Parses the matching mime types from the.given string. +// Returns: TDesC8&: String that holds the mime types. +// TDesC8&: Mime type to match with. +// ----------------------------------------------------------------------------- +// +TBool ParseAndMatchMimeTypeL( + const TDesC8& aMIMEDescription, + const TDesC8& aMatch ) + { + _LIT(KPatternPtr, ";|"); + + TUint end = aMIMEDescription.Length(); + TUint i = 0; + TUint marker = 0; + TUint mimeSeparator = '|'; + + // Parse the aMIMEDescription string. + for (; i < end;) + { + // Search until end of buffer or match one of the delimiters ';' or '|'. + // We are looking for the mimeType, ie "text/html", "application/pdf", etc. + for (; (i < end) && (KPatternPtr().Locate((aMIMEDescription)[i]) == + KErrNotFound); i++) + { + // Walking the aMIMEDescription string + } + + if (i > marker) + { + // Try matching the found mime type with the given type. + TPtrC8 newString( aMIMEDescription.Mid(marker, i - marker ).Ptr(), i - marker ); + if( newString == aMatch ) + { + return ETrue; + } + } + + // Are we at the end of the supported mime string + if (i == end) + { + // This break with i=end means we leave outer for loop + break; + } + + marker = ++i; + if ((aMIMEDescription)[i - 1] == mimeSeparator) + { + // Found a mime separator '|', get next supported mime + continue; + } + } // end of for + return EFalse; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperGetUrl +// Unsupported. +// ----------------------------------------------------------------------------- +// +static NPError PluginWrapperGetUrl(NPP /*aInstance*/, const TDesC& /*aUrl*/, + const TDesC* /*aWindowType*/ ) + { + return NPERR_GENERIC_ERROR; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperPostUrl +// Unsupported. +// ----------------------------------------------------------------------------- +// +static NPError PluginWrapperPostUrl(NPP /*aInstance*/, const TDesC& /*aUrl*/, + const TDesC* /*aWindowType*/, const TDesC& /*aBuf*/, NPBool /*aFile*/) + { + return NPERR_GENERIC_ERROR; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperRequestRead +// Unsupported. +// ----------------------------------------------------------------------------- +// +static NPError PluginWrapperRequestRead(NPStream* /*aStream*/, + NPByteRange* /*aRangeList*/) + { + return NPERR_GENERIC_ERROR; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperNewStream +// Unsupported. +// ----------------------------------------------------------------------------- +// +static NPError PluginWrapperNewStream(NPP /*aInstance*/, NPMIMEType /*aType*/, + const TDesC* /*aWindowType*/, NPStream** /*aStream*/) + { + return NPERR_GENERIC_ERROR; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperWrite +// Unsupported. +// ----------------------------------------------------------------------------- +// +static TInt32 PluginWrapperWrite(NPP /*aInstance*/, NPStream* /*aStream*/, + TInt32 /*aLen*/, void* /*aBuffer*/) + { + return NPERR_GENERIC_ERROR; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperDestroyStream +// Unsupported. +// ----------------------------------------------------------------------------- +// +static NPError PluginWrapperDestroyStream(NPP /*aInstance*/, + NPStream* /*aStream*/, NPReason /*aReason*/) + { + return NPERR_GENERIC_ERROR; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperStatus +// Unsupported. +// ----------------------------------------------------------------------------- +// +static void PluginWrapperStatus(NPP /*aInstance*/, const TDesC& /*aMessage*/) + { + } + +// ----------------------------------------------------------------------------- +// PluginWrapperUAgent +// Unsupported. +// ----------------------------------------------------------------------------- +// +static const TDesC* PluginWrapperUAgent(NPP /*aInstance*/) + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperMemAlloc +// Unsupported. +// ----------------------------------------------------------------------------- +// +static void* PluginWrapperMemAlloc( uint32 /*aSize*/ ) + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperMemFree +// Unsupported. +// ----------------------------------------------------------------------------- +// +static void PluginWrapperMemFree( void* aPtr ) + { + delete aPtr; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperMemFlush +// Unsupported. +// ----------------------------------------------------------------------------- +// +static uint32 PluginWrapperMemFlush(uint32 /*aSize*/) + { + return NPERR_GENERIC_ERROR; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperReloadPlugins +// Unsupported. +// ----------------------------------------------------------------------------- +// +static void PluginWrapperReloadPlugins(NPBool /*aReloadPages*/) + { + } + +// ----------------------------------------------------------------------------- +// PluginWrapperGetJavaEnv +// Unsupported. +// ----------------------------------------------------------------------------- +// +static JRIEnv* PluginWrapperGetJavaEnv() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperGetJavaPeer +// Unsupported. +// ----------------------------------------------------------------------------- +// +static jref PluginWrapperGetJavaPeer(NPP /*aInstance*/) + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperGetUrlNotify +// Unsupported. +// ----------------------------------------------------------------------------- +// +static NPError PluginWrapperGetUrlNotify(NPP /*aInstance*/, const TDesC& /*aUrl*/, + const TDesC* /*aWindowType*/, void* /*aNotifyData*/) + { + return NPERR_GENERIC_ERROR; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperPostUrlNotify +// Unsupported. +// ----------------------------------------------------------------------------- +// +static NPError PluginWrapperPostUrlNotify(NPP /*aInstance*/, const TDesC& /*aUr*l*/, + const TDesC* /*aWindowType*/, const TDesC& /*aBuf*/, NPBool /*aFile*/, void* /*aNotifyData*/) + { + return NPERR_GENERIC_ERROR; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperGetValue +// Unsupported. +// ----------------------------------------------------------------------------- +// +static NPError PluginWrapperGetValue(NPP /*aInstance*/, NPNVariable /*aVariable*/, + void* /*aRetValue*/) + { + return NPERR_NO_ERROR; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperSetValue +// Unsupported. +// ----------------------------------------------------------------------------- +// +static NPError PluginWrapperSetValue(NPP /*aInstance*/, NPPVariable /*aVariable*/, + void * /*aRetValue*/) + { + return NPERR_GENERIC_ERROR; + } + +// ----------------------------------------------------------------------------- +// PluginWrapperInvalidateRect +// Unsupported. +// ----------------------------------------------------------------------------- +// +static void PluginWrapperInvalidateRect(NPP /*aInstance*/, NPRect * /*aRect*/) + { + } + +// ----------------------------------------------------------------------------- +// PluginWrapperInvalidateRegion +// Unsupported. +// ----------------------------------------------------------------------------- +// +static void PluginWrapperInvalidateRegion(NPP /*aInstance*/, NPRegion /*aRegion*/) + { + } + +// ----------------------------------------------------------------------------- +// PluginWrapperForceRedraw +// Unsupported. +// ----------------------------------------------------------------------------- +// +static void PluginWrapperForceRedraw(NPP /*aInstance*/) + { + } + +const NPNetscapeFuncs PluginWrapperFuncs = + { + sizeof(NPNetscapeFuncs), + 1, + PluginWrapperGetUrl, + PluginWrapperPostUrl, + PluginWrapperRequestRead, + PluginWrapperNewStream, + PluginWrapperWrite, + PluginWrapperDestroyStream, + PluginWrapperStatus, + PluginWrapperUAgent, + PluginWrapperMemAlloc, + PluginWrapperMemFree, + PluginWrapperMemFlush, + PluginWrapperReloadPlugins, + PluginWrapperGetJavaEnv, + PluginWrapperGetJavaPeer, + PluginWrapperGetUrlNotify, + PluginWrapperPostUrlNotify, + PluginWrapperGetValue, + PluginWrapperSetValue, + PluginWrapperInvalidateRect, + PluginWrapperInvalidateRegion, + PluginWrapperForceRedraw + }; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnNPPluginHandler::CXnNPPluginHandler +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnNPPluginHandler::CXnNPPluginHandler() + { + } + +// ----------------------------------------------------------------------------- +// CXnNPPluginHandler::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnNPPluginHandler::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnNPPluginHandler::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnNPPluginHandler* CXnNPPluginHandler::NewL() + { + CXnNPPluginHandler* self = new( ELeave ) CXnNPPluginHandler; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// Destructor +CXnNPPluginHandler::~CXnNPPluginHandler() + { + delete iPluginInterface; + } + +// ----------------------------------------------------------------------------- +// CXnNPPluginHandler::LoadSpecificPluginL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CXnNPPluginHandler::LoadSpecificPluginL( + const TDesC8& aResolveparam, + NPPluginFuncs** aPluginFuncs ) + { + RImplInfoPtrArray implInfoArray; + CImplementationInformation* impl = NULL; + REComSession::ListImplementationsL( KBrowserPluginInterfaceUid, implInfoArray ); + TBool implFound( EFalse ); + TInt count = implInfoArray.Count(); + for(TInt index = 0; index < count; ++index ) + { + impl = implInfoArray[index]; + if( ParseAndMatchMimeTypeL( impl->DataType(), aResolveparam ) ) + { + implFound = ETrue; + break; + } + } + + if( !implFound ) + { + implInfoArray.ResetAndDestroy(); + implInfoArray.Close(); + return KErrNotFound; + } + + NPPluginFuncs* pluginFuncs = (NPPluginFuncs*) User::AllocLC(sizeof (NPPluginFuncs)); + Mem::FillZ((void*) pluginFuncs, sizeof (NPPluginFuncs)); + + iPluginInterface = CEcomBrowserPluginInterface::CreatePluginL( + impl->ImplementationUid(),(NPNetscapeFuncs *) (&PluginWrapperFuncs), pluginFuncs ); + + CleanupStack::Pop(pluginFuncs); + + *aPluginFuncs = pluginFuncs; + pluginFuncs = NULL; + + implInfoArray.ResetAndDestroy(); + implInfoArray.Close(); + return KErrNone; + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Building information file +* +*/ + + +#include <platform_paths.hrh> + +PRJ_PLATFORMS +ARMV5 WINSCW + +PRJ_EXPORTS + +PRJ_MMPFILES + +xnpopupfactory.mmp diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/group/xnpopupfactory.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/group/xnpopupfactory.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,54 @@ +/* +* 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: ECOM-plugin for popup-component +* +*/ + + +#include <platform_paths.hrh> +#include <platform/mw/aisystemuids.hrh> + +TARGET xn3popupfactory.dll +TARGETTYPE PLUGIN +UID 0x10009d8d AI3_UID_RENDERING_PLUGIN_POPUPFACTORY + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE xnpopupfactory.cpp +SOURCE xnpopup.cpp +SOURCE xnpopupadapter.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY eikcore.lib +LIBRARY cone.lib +LIBRARY xn3layoutengine.lib +LIBRARY xn3utils.lib +LIBRARY xn3domdocument.lib +LIBRARY avkon.lib +LIBRARY ws32.lib + +START RESOURCE xn3popupfactory.rss +#ifdef SYMBIAN_SECURE_ECOM +TARGET xn3popupfactory.rsc +#endif +END + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/inc/xnpopupadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/inc/xnpopupadapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,109 @@ +/* +* 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: Control adapter class for tooltips and other popups +* +*/ + + + +#ifndef _XNPOPUPADAPTER_H +#define _XNPOPUPADAPTER_H + +// INCLUDES +#include "xncontroladapter.h" +#include <e32base.h> + +// FORWARD DECLARATIONS +class CXnNodePluginIf; + +// CLASS DECLARATION +/** +* @ingroup group_xnpopupfactory +* @lib NONE +* @since Series 60 3.1 +*/ +class CXnPopupAdapter : public CXnControlAdapter + { +public: + enum TPositionHint + { + ENone, + EAboveLeft, + EAboveRight, + EBelowLeft, + EBelowRight, + ELeft, + ERight + }; + +public: + /** + * 2 phase construction. + */ + static CXnPopupAdapter* NewL(CXnNodePluginIf& aNode, CXnControlAdapter* aParent); + + /** + * Destructor. + */ + virtual ~CXnPopupAdapter(); + +public: // New functions + /** + * Shows the popup + * @param aContainerRect Rectangle containing the control that has a popup. + * The popup will not overlap with this rect. + */ + void ShowPopupL(const TRect& aContainerRect); + void ShowPopupL(const TRect& aContainerRect, + TTimeIntervalMicroSeconds32 aShowDelay, + TTimeIntervalMicroSeconds32 aDisplayTime); + /** + * Hides the popup + */ + void HidePopupL(); + + /** + * @see CXnControlAdapter + */ + void DoEnterPowerSaveModeL( TModeEvent aEvent ); + + /** + * @see CXnControlAdapter + */ + void HandleScreenDeviceChangedL(); + + /** + * @see CXnControlAdapter + */ + void DoHandlePropertyChangeL(CXnProperty* aProperty = NULL); + +private: + void Draw(const TRect& aRect) const; + + CXnPopupAdapter(); + void ConstructL(CXnNodePluginIf& aNode, CXnControlAdapter* aParent); + + void CalculatePosition( TRect aPopupRect ); + +private: + mutable CXnNodePluginIf* iNode; + CActive* iActiveObject; + CCoeAppUi* iAppUi; + TRect iContainerRect; + TRect iPopupRect; + TPositionHint iPositionHint; + }; +#endif // _XNPOPUPADAPTER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/inc/xnpopupfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/inc/xnpopupfactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Factory class for creating tooltips and other popups +* +*/ + + + +#ifndef _XNPOPUPFACTORY_H +#define _XNPOPUPFACTORY_H + +// INCLUDES +#include "xncomponentfactory.h" +#include <e32base.h> +#include <ecom/ecom.h> +#include <ecom/implementationproxy.h> + +// CLASS DECLARATION + +/** +* @ingroup group_xnpopupfactory +* +* Layout Area UI factory interface for creating UI representations of the layout areas. +* This class is wrapper for containing a popup +* +* @lib NONE +* @since Series 60 3.1 +*/ +// inheritance order must be this, despite codescanner warnings +class CXnPopupFactory : public MXnComponentFactory, public CBase + { + public: // Data types + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnPopupFactory* NewL(); + + /** + * Destructor. + */ + virtual ~CXnPopupFactory(); + + public: // Functions from base classes + + + /** + * From MXnComponentFactory Interface for creating Ui control component. + * @since Series 60 3.1 + * @param aNode Component's node. + * @param aTargetComponent Created component is set here. + * @return EXnFactoryResponseComponentConstructed if component created. + */ + TXnComponentFactoryResponse MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent + ); + + /** + * From MXnComponentFactory Interface for creating Ui control adapter. + * @since Series 60 3.1 + * @param aNode Component's node. + * @param aParent Parent of the adapter, which is created here. + * @return Created control adapter. + */ + CXnControlAdapter* MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent + ); + + private: + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CXnPopupFactory(); + }; + +// Exported factory function required by ECOM-framework +IMPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount); + +#endif // _XNEIKLABELFACTORY_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/src/xn3popupfactory.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/src/xn3popupfactory.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// 1020747E.RSS +// +#include <ecom/registryinfo.rh> +#include <platform/mw/aisystemuids.hrh> + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = AI3_UID_RENDERING_PLUGIN_POPUPFACTORY; +interfaces = + { + INTERFACE_INFO + { + interface_uid = AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI3_UID_RENDERING_PLUGIN_POPUPFACTORY_IMPLEMENTATION; + version_no = 1; + display_name = "XnPopup"; + default_data = "tooltip"; + opaque_data = ""; + } + }; + } + }; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/src/xnpopup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/src/xnpopup.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,108 @@ +/* +* 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 a popup +* +*/ + + +#include <e32base.h> +#include <coecntrl.h> +#include <barsread.h> + +#include "xnpopup.h" +#include "xnpopupadapter.h" + +// ============================ MEMBER FUNCTIONS =============================== + + + + +// ----------------------------------------------------------------------------- +// CXnPopup::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnPopup* CXnPopup::NewL() + { + CXnPopup* self = new( ELeave ) CXnPopup; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnPopup::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnPopup::ConstructL() + { + CXnComponent::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// CXnPopup::ConstructL +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnPopup::CXnPopup() + { + } + +// ----------------------------------------------------------------------------- +// CXnPopup::ConstructL +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnPopup::~CXnPopup() + { + } + + +// ----------------------------------------------------------------------------- +// CXnPopup::ShowPopup +// Shows the popup +// ----------------------------------------------------------------------------- +void CXnPopup::ShowPopupL(const TRect& aContainerRect) + { + static_cast<CXnPopupAdapter*>(ControlAdapter())->ShowPopupL(aContainerRect); + } +void CXnPopup::ShowPopupL(const TRect& aContainerRect, TTimeIntervalMicroSeconds32 aShowDelay, TTimeIntervalMicroSeconds32 aDisplayTime) + { + static_cast<CXnPopupAdapter*>(ControlAdapter())->ShowPopupL(aContainerRect, aShowDelay, aDisplayTime); + } + +// ----------------------------------------------------------------------------- +// CXnPopup::HidePopup +// Hides the popup +// ----------------------------------------------------------------------------- +void CXnPopup::HidePopupL() + { + static_cast<CXnPopupAdapter*>(ControlAdapter())->HidePopupL(); + } +// ----------------------------------------------------------------------------- +// CXnPopup::MakeInterfaceL +// ----------------------------------------------------------------------------- +XnComponentInterface::MXnComponentInterface* CXnPopup::MakeInterfaceL(const TDesC8& aType) + { + if (aType != XnPopupInterface::KType) + { + return NULL; + } + XnPopupInterface::MXnPopupInterface* popup = static_cast<XnPopupInterface::MXnPopupInterface*>(this); + return popup; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/src/xnpopupadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/src/xnpopupadapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,544 @@ +/* +* 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: Implementation for a popup +* +*/ + + +#include "xnpopupadapter.h" + +#include "xncomponentnodeimpl.h" +#include "xnnodepluginif.h" +#include "xnproperty.h" +#include "xndompropertyvalue.h" +#include "xndomlist.h" +#include "xncomponent.h" + +#include <AknUtils.h> + +const TInt KStartDelay = 1000000; +const TInt KDisplayTime = 0; + +// ----------------------------------------------------------------------------- +// Control +// Gets a CXnControlAdapter from node +// ----------------------------------------------------------------------------- +static CXnControlAdapter* Control( CXnNodePluginIf* aNode ) + { + if( aNode ) + { + CXnComponent* component( NULL ); + + if( aNode->ComponentNodeImpl() ) + { + component = aNode->ComponentNodeImpl()->Component(); + } + + if( component ) + { + return component->ControlAdapter(); + } + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// IsNodeDisplayedL +// +// ----------------------------------------------------------------------------- +static TBool IsNodeDisplayedL( CXnNodePluginIf* aNode ) + { + CXnProperty* visibilityProp( aNode->VisibilityL() ); + + // Am I visible? + if( visibilityProp ) + { + const TDesC8& visibility( visibilityProp->StringValue() ); + + if( visibility != XnPropertyNames::style::common::visibility::KVisible ) + { + return EFalse; + } + } + + // Am I displayed? + CXnProperty* displayProp( aNode->DisplayL() ); + + if( displayProp ) + { + const TDesC8& display( displayProp->StringValue() ); + + if( display != XnPropertyNames::style::common::display::KBlock ) + { + return EFalse; + } + } + + return ETrue; + } + +// ----------------------------------------------------------------------------- +// class CXnPopupController +// +// ----------------------------------------------------------------------------- +class CXnPopupController : public CActive + { + public: + static CXnPopupController* NewL(CXnControlAdapter& aAdapter) + { + CXnPopupController* self = new (ELeave) CXnPopupController; + CleanupStack::PushL(self); + self->ConstructL(aAdapter); + CleanupStack::Pop(self); + return self; + } + ~CXnPopupController() + { + iDestroying = ETrue; + Cancel(); + iTimer.Close(); + } + void SetTimes(TTimeIntervalMicroSeconds32 aShowDelay, TTimeIntervalMicroSeconds32 aDisplayTime) + { + Cancel(); + iShowDelay = aShowDelay; + iDisplayTime = aDisplayTime; + iShowing = ETrue; + iTimer.After(iStatus, aShowDelay); + SetActive(); + } + private: + CXnPopupController() : CActive(0) + { + } + void ConstructL(CXnControlAdapter& aAdapter) + { + iAdapter = &aAdapter; + User::LeaveIfError(iTimer.CreateLocal()); + CActiveScheduler::Add(this); + } + void RunL() + { + if (iShowing) + { + iAdapter->ActivateL(); + iAdapter->MakeVisible(ETrue); + + // Check are childs visible + CXnNodePluginIf* node( iAdapter->Component()->Node() ); + + RPointerArray<CXnNodePluginIf> children( node->ChildrenL() ); + CleanupClosePushL( children ); + + TInt visibleCount( 0 ); + + for( TInt i = 0; i < children.Count(); i++ ) + { + CXnNodePluginIf* child( children[i] ); + + TBool visible( IsNodeDisplayedL( child ) ); + + CCoeControl* control( Control( child ) ); + + if( control ) + { + control->MakeVisible( visible ); + } + + if( visible ) + { + visibleCount++; + } + } + + CleanupStack::PopAndDestroy( &children ); + + if( visibleCount == 0 ) + { + iAdapter->MakeVisible( EFalse ); + // Nothing to show + return; + } + + iAdapter->DrawNow(); + iShowing = EFalse; + if (iDisplayTime.Int() != 0) + { + iHiding = ETrue; + iTimer.After(iStatus, iDisplayTime); + SetActive(); + } + } + else if (iHiding) + { + iAdapter->MakeVisible(EFalse); + iHiding = EFalse; + } + } + void DoCancel() + { + if (!iDestroying) + { + iAdapter->MakeVisible(EFalse); + } + + iTimer.Cancel(); + } + private: + TBool iDestroying; + CXnControlAdapter* iAdapter; + RTimer iTimer; + TBool iShowing; + TBool iHiding; + TTimeIntervalMicroSeconds32 iShowDelay; + TTimeIntervalMicroSeconds32 iDisplayTime; + }; + + +static CActive* CreateActiveObjectL(CXnControlAdapter& aAdapter) + { + return CXnPopupController::NewL(aAdapter); + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnPopup::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnPopupAdapter* CXnPopupAdapter::NewL(CXnNodePluginIf& aNode, CXnControlAdapter* aParent) + { + CXnPopupAdapter* self = new( ELeave ) CXnPopupAdapter; + + CleanupStack::PushL( self ); + self->ConstructL(aNode, aParent); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnPopupAdapter::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnPopupAdapter::ConstructL(CXnNodePluginIf& aNode, CXnControlAdapter* /*aParent*/) + { + MakeVisible(EFalse); + CXnProperty* positionHintProp = aNode.GetPropertyL(XnPropertyNames::tooltip::KPositionHint); + if( positionHintProp ) + { + const TDesC8& displayHintVal = positionHintProp->StringValue(); + if( displayHintVal == XnPropertyNames::tooltip::positionhint::KAboveLeft ) + { + iPositionHint = EAboveLeft; + } + else if( displayHintVal == XnPropertyNames::tooltip::positionhint::KAboveRight ) + { + iPositionHint = EAboveRight; + } + else if( displayHintVal == XnPropertyNames::tooltip::positionhint::KBelowLeft ) + { + iPositionHint = EBelowLeft; + } + else if( displayHintVal == XnPropertyNames::tooltip::positionhint::KBelowRight ) + { + iPositionHint = EBelowRight; + } + else if( displayHintVal == XnPropertyNames::tooltip::positionhint::KRight ) + { + iPositionHint = ERight; + } + else if( displayHintVal == XnPropertyNames::tooltip::positionhint::KLeft ) + { + iPositionHint = ELeft; + } + } + if(iPositionHint == ENone) + { + // Use default value + if(AknLayoutUtils::LayoutMirrored()) + { + iPositionHint = EAboveRight; + } + else + { + iPositionHint = EAboveLeft; + } + } + + CreateWindowL(); + + if( CAknEnv::Static()->TransparencyEnabled() ) + { + // try to enable window transparency + if ( Window().SetTransparencyAlphaChannel() == KErrNone ) + { + TRgb color( ~0 ); + Window().SetBackgroundColor( color ); + } + } + + CXnControlAdapter::ConstructL(aNode); + iNode = &aNode; + iAppUi = CCoeEnv::Static()->AppUi(); + } + +// ----------------------------------------------------------------------------- +// CXnPopupAdapter::CXnPopupAdapter +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnPopupAdapter::CXnPopupAdapter(): iPositionHint( ENone ) + { + } + +// ----------------------------------------------------------------------------- +// CXnPopupAdapter::~CXnPopupAdapter +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnPopupAdapter::~CXnPopupAdapter() + { + delete iActiveObject; + } + +// ----------------------------------------------------------------------------- +// CXnPopupAdapter::ShowPopupL +// Shows the popup +// ----------------------------------------------------------------------------- +// +void CXnPopupAdapter::ShowPopupL(const TRect& aContainerRect) + { + // Don't show tooltip if display property is none. + CXnProperty* displayProperty( iNode->DisplayL() ); + + if( displayProperty ) + { + const TDesC8& displayValue = displayProperty->StringValue(); + + if( displayValue == XnPropertyNames::style::common::display::KNone ) + { + return; + } + } + + CXnProperty* visibilityProp( iNode->VisibilityL() ); + + if( visibilityProp ) + { + const TDesC8& value( visibilityProp->StringValue() ); + + if( value == XnPropertyNames::style::common::visibility::KHidden ) + { + return; + } + } + + TTimeIntervalMicroSeconds32 startDelay(KStartDelay); + TTimeIntervalMicroSeconds32 displayTime(KDisplayTime); + CXnProperty* startDelayProperty = iNode->GetPropertyL(XnPropertyNames::tooltip::KStartDelay); + if (startDelayProperty) + { + CXnDomPropertyValue* value = static_cast<CXnDomPropertyValue*>(startDelayProperty->Property()->PropertyValueList().Item(0)); + TInt factor = 1; + if (value->PrimitiveValueType() == CXnDomPropertyValue::ES) + { + factor = 1000000; + } + else if (value->PrimitiveValueType() == CXnDomPropertyValue::EMs) + { + factor = 1000; + } + startDelay = factor * static_cast<TInt>(startDelayProperty->FloatValueL()); + } + CXnProperty* displayTimeProperty = iNode->GetPropertyL(XnPropertyNames::tooltip::KDisplayTime); + if (displayTimeProperty) + { + CXnDomPropertyValue* value = static_cast<CXnDomPropertyValue*>(displayTimeProperty->Property()->PropertyValueList().Item(0)); + TInt factor = 1; + if (value->PrimitiveValueType() == CXnDomPropertyValue::ES) + { + factor = 1000000; + } + else if (value->PrimitiveValueType() == CXnDomPropertyValue::EMs) + { + factor = 1000; + } + displayTime = factor * static_cast<TInt>(displayTimeProperty->FloatValueL()); + } + if (displayTime.Int() == 0 ) + { + return; + } + ShowPopupL(aContainerRect, startDelay, displayTime); + } + +// ----------------------------------------------------------------------------- +// CXnPopupAdapter::ShowPopupL +// Shows the popup +// ----------------------------------------------------------------------------- +// +void CXnPopupAdapter::ShowPopupL(const TRect& aContainerRect, TTimeIntervalMicroSeconds32 aShowDelay, TTimeIntervalMicroSeconds32 aDisplayTime) + { + if (!iActiveObject) + { + iActiveObject = CreateActiveObjectL(*this); + } + + iActiveObject->Cancel(); + + // Calculates position according to position hint and + // set new rect for CCoeControl. + CalculatePosition(aContainerRect); + + static_cast<CXnPopupController*>(iActiveObject)->SetTimes(aShowDelay, aDisplayTime); + } + +// ----------------------------------------------------------------------------- +// CXnPopupAdapter::HidePopupL +// Hides the popup +// ----------------------------------------------------------------------------- +// +void CXnPopupAdapter::HidePopupL() + { + if (!iActiveObject) + { + MakeVisible(EFalse); + return; + } + iActiveObject->Cancel(); + MakeVisible(EFalse); + } + +// ----------------------------------------------------------------------------- +// CXnPopupAdapter::Draw +// Draws the popup. +// ----------------------------------------------------------------------------- +// +void CXnPopupAdapter::Draw(const TRect& aRect) const + { + CXnControlAdapter::Draw(aRect); + } + +// ----------------------------------------------------------------------------- +// CXnPopupAdapter::DoEnterPowerSaveModeL +// Hides the popup when power save mode is entered. +// ----------------------------------------------------------------------------- +// +void CXnPopupAdapter::DoEnterPowerSaveModeL( TModeEvent /*aEvent*/ ) + { + HidePopupL(); + } + +// ----------------------------------------------------------------------------- +// CXnPopupAdapter::Draw +// Hides the popup when screen device is changed. +// ----------------------------------------------------------------------------- +// +void CXnPopupAdapter::HandleScreenDeviceChangedL() + { + HidePopupL(); + CXnControlAdapter::HandleScreenDeviceChangedL(); + } + +// ----------------------------------------------------------------------------- +// CXnPopupAdapter::DoHandlePropertyChangeL +// Handles property changes +// ----------------------------------------------------------------------------- +// +void CXnPopupAdapter::DoHandlePropertyChangeL(CXnProperty* aProperty) + { + if( aProperty ) + { + const TDesC8& name( aProperty->Property()->Name() ); + + if( name == XnPropertyNames::style::common::KDisplay ) + { + const TDesC8& display( aProperty->StringValue() ); + + if( display != XnPropertyNames::style::common::display::KBlock ) + { + HidePopupL(); + } + } + else if( name == XnPropertyNames::style::common::KVisibility ) + { + const TDesC8& visibility( aProperty->StringValue() ); + + if( visibility != XnPropertyNames::style::common::visibility::KVisible ) + { + HidePopupL(); + } + } + } + } + +// ----------------------------------------------------------------------------- +// CalculatePosition +// +// ----------------------------------------------------------------------------- +void CXnPopupAdapter::CalculatePosition( TRect aPopupRect ) + { + TRect clientRect = static_cast<CEikAppUi&>(*iAppUi).ClientRect(); + TPoint offset(clientRect.iTl); + TRect controlRect = iNode->BorderRect(); + TRect contentRect(0, 0, clientRect.iBr.iX, clientRect.iBr.iY); // entire screen except control pane + TRect rect; + switch(iPositionHint) + { + case CXnPopupAdapter::EAboveLeft: + rect = TRect(TPoint(aPopupRect.iTl.iX, aPopupRect.iTl.iY - controlRect.Height()), TPoint(aPopupRect.iTl.iX + controlRect.Width(), aPopupRect.iTl.iY)); + break; + case CXnPopupAdapter::EAboveRight: + rect = TRect(TPoint(aPopupRect.iBr.iX - controlRect.Width(), aPopupRect.iTl.iY - controlRect.Height()), TPoint(aPopupRect.iBr.iX, aPopupRect.iTl.iY)); + break; + case CXnPopupAdapter::EBelowLeft: + rect = TRect(TPoint(aPopupRect.iTl.iX, aPopupRect.iBr.iY), TPoint(aPopupRect.iTl.iX + controlRect.Width(), aPopupRect.iBr.iY + controlRect.Height())); + break; + case CXnPopupAdapter::EBelowRight: + rect = TRect(TPoint(aPopupRect.iBr.iX - controlRect.Width(), aPopupRect.iBr.iY), TPoint(aPopupRect.iBr.iX, aPopupRect.iBr.iY + controlRect.Height())); + break; + case CXnPopupAdapter::ERight: + rect = TRect(TPoint(aPopupRect.iBr.iX, aPopupRect.iTl.iY), TPoint(aPopupRect.iBr.iX + controlRect.Width(), aPopupRect.iTl.iY + controlRect.Height())); + break; + case CXnPopupAdapter::ELeft: + rect = TRect(TPoint(aPopupRect.iTl.iX - controlRect.Width(), aPopupRect.iTl.iY), TPoint(aPopupRect.iTl.iX, aPopupRect.iTl.iY + controlRect.Height())); + break; + default: + break; + } + rect.Move(offset); + if(rect.iTl.iY < contentRect.iTl.iY) + { + rect.Move(0, contentRect.iTl.iY - rect.iTl.iY); + } + if(rect.iTl.iX < contentRect.iTl.iX) + { + rect.Move(contentRect.iTl.iX - rect.iTl.iX, 0); + } + if(rect.iBr.iY > contentRect.iBr.iY) + { + rect.Move(0, contentRect.iBr.iY - rect.iBr.iY); + } + if(rect.iBr.iX > contentRect.iBr.iX) + { + rect.Move(contentRect.iBr.iX - rect.iBr.iX, 0); + } + this->SetRect( rect ); + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/src/xnpopupfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/src/xnpopupfactory.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for factory creating a popup. +* +*/ + + +#include <e32base.h> +#include <coecntrl.h> + +#include "xnpopupfactory.h" +#include "xnpopup.h" +#include "xntype.h" +#include "xncomponent.h" +#include "xnpopupadapter.h" +#include "xnnodepluginif.h" +#include <aisystemuids.hrh> + +// CONSTANTS +_LIT8(KPopup, "tooltip"); + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// E32Dll implements the Symbian OS dll entry point +// Entry point needed for EKA1 kernel only +// ----------------------------------------------------------------------------- +// +#ifndef EKA2 +GLDEF_C TInt E32Dll( + TDllReason) + { + + return KErrNone; + + } +#endif + +MXnComponentFactory::TXnComponentFactoryResponse CXnPopupFactory::MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent + + ) + { + MXnComponentFactory::TXnComponentFactoryResponse retVal = MXnComponentFactory::EXnFactoryResponseComponentNotSupported; + // Check that the given type of a control is parent (or ancestor) of this control + if(aNode.Type()->Type() == KPopup) + { + CXnPopup* container = CXnPopup::NewL(); + aTargetComponent = static_cast<CXnComponent*>(container); + retVal = MXnComponentFactory::EXnFactoryResponseComponentConstructed; + return retVal; + } + return retVal; + } + +CXnControlAdapter* CXnPopupFactory::MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent + ) + { + CXnControlAdapter* controlAdapter = CXnPopupAdapter::NewL(aNode, aParent); + return controlAdapter; + } + +// ----------------------------------------------------------------------------- +// CXnPopupFactory::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnPopupFactory* CXnPopupFactory::NewL() + { + CXnPopupFactory* self = new( ELeave ) CXnPopupFactory; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnPopupFactory::CXnPopupFactory +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnPopupFactory::CXnPopupFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnPopupFactory::~CXnPopupFactory +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnPopupFactory::~CXnPopupFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnPopupFactory::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnPopupFactory::ConstructL() + { + } + +// Define the interface UIDs +const TImplementationProxy ImplementationTable[] = + { +#ifdef __EABI__ + IMPLEMENTATION_PROXY_ENTRY(AI3_UID_RENDERING_PLUGIN_POPUPFACTORY_IMPLEMENTATION, CXnPopupFactory::NewL) +#else + {{AI3_UID_RENDERING_PLUGIN_POPUPFACTORY_IMPLEMENTATION}, CXnPopupFactory::NewL} +#endif + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,29 @@ +/* +* 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: Building information file +'* +*/ + +#include <platform_paths.hrh> + +PRJ_PLATFORMS + +ARMV5 WINSCW + + +PRJ_EXPORTS + +PRJ_MMPFILES + +xntexteditorfactory.mmp diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/group/xntexteditorfactory.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/group/xntexteditorfactory.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,67 @@ +/* +* 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: Xuikon text editor plugin +* +*/ + + +#include <platform_paths.hrh> +#include <platform/mw/aisystemuids.hrh> + +TARGET xn3texteditorfactory.dll +TARGETTYPE PLUGIN +UID 0x10009d8d AI3_UID_RENDERING_PLUGIN_TEXTEDITORFACTORY + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE xntexteditorfactory.cpp +SOURCE xntexteditor.cpp +SOURCE xntexteditoradapter.cpp +SOURCE xntexteditorpublisher.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY eikcoctl.lib +LIBRARY eikctl.lib +LIBRARY form.lib +LIBRARY cone.lib +LIBRARY uiklaf.lib +LIBRARY xn3layoutengine.lib +LIBRARY xn3utils.lib +LIBRARY xn3domdocument.lib +LIBRARY avkon.lib +LIBRARY fepbase.lib +LIBRARY peninputClient.lib +LIBRARY liwservicehandler.lib +LIBRARY charconv.lib +LIBRARY eikcore.lib +LIBRARY gdi.lib +LIBRARY etext.lib +LIBRARY aknskins.lib + +LANG SC + +START RESOURCE xn3texteditorfactory.rss +#ifdef SYMBIAN_SECURE_ECOM +TARGET xn3texteditorfactory.rsc +#endif +END + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/inc/xntexteditoradapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/inc/xntexteditoradapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,158 @@ +/* +* 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: Wrapper class for CEikEdwin +* +*/ + +#ifndef _XNTEXTEDITORADAPTER_H +#define _XNTEXTEDITORADAPTER_H + +// System includes +#include <e32base.h> + +// User includes +#include "xncontroladapter.h" +#include "xnuienginepluginif.h" + +// Forward declarations +class CXnNodePluginIf; +class CEikEdwin; +class CXnTextEditorPublisher; + +// CLASS DECLARATION +class CXnTextEditorAdapter : public CXnControlAdapter + { +public: + // constructor and destructor + + /** + * 2 phase construction. + */ + static CXnTextEditorAdapter* NewL( + CXnControlAdapter* aParent, CXnNodePluginIf& aNode ); + + /** + * Destructor. + */ + ~CXnTextEditorAdapter(); + +public: + // New functions + + /** + * Gets editor + * + * @since S60 5.0 + * @return Editor, ownership is not transfered + */ + CEikEdwin* Editor() const { return iEditor; }; + + /** + * Set text to the text field + * + * @since S60 5.0 + * @param aText Text to set + */ + void SetTextL( const TDesC& aText ); + + /** + * Return the text of the text field + * + * @since S60 5.0 + * @return Text, ownership is transfered + */ + HBufC* Text() const; + +public: // from base classes + + /** + * See CCoeControl documentation + */ + TInt CountComponentControls() const; + + /** + * See CCoeControl documentation + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * See CCoeControl documentation + */ + void SizeChanged(); + + /** + * See CCoeControl documentation + */ + TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); + + /** + * See CXnControlAdapter documentation + */ + TBool RefusesFocusLoss() const; + + /** + * See CCoeControl documentation + */ + void FocusChanged( TDrawNow aDrawNow ); + + /** + * See CCoeControl documentation + */ + void Draw( const TRect& aRect ) const; + +private: + // from MCoeControlObserver + + /** + * See MCoeControlObserver documentation + */ + void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); + +private: + // private constrcutors + + CXnTextEditorAdapter( CXnControlAdapter* aParent, CXnNodePluginIf& aNode ); + + void ConstructL(); + +private: + // new functions + + void SetPropertiesL(); + +private: + // data + /** Parent control, not owned */ + CXnControlAdapter* iParent; + /** UI node, not owned */ + CXnNodePluginIf& iNode; + /** UI engine, not owned */ + TXnUiEnginePluginIf* iUiEngine; + /** Editor, owned */ + CEikEdwin* iEditor; + /** CPS publisher wrapper, owned */ + CXnTextEditorPublisher* iEditorPublisher; + // Font, owned */ + CFont* iFont; + /** Flag to indicate whether the font needs to be released or not */ + TBool iReleaseFont; + /** Max line amount */ + TInt iMaxLines; + /** Flag to indicate whether focus loss is refused */ + TBool iRefusesFocusLoss; + }; + +#endif // _XNTEXTEDITORADAPTER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/inc/xntexteditorfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/inc/xntexteditorfactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,99 @@ +/* +* 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: Factory for creating CXnEditor -component +* +*/ + + +#ifndef _XNTEXTEDITORFACTORY_H +#define _XNTEXTEDITORFACTORY_H + +// INCLUDES +#include "xncomponentfactory.h" +#include <e32base.h> +#include <e32std.h> + +#include <ecom/ecom.h> +#include <ecom/implementationproxy.h> + + +// FORWARD DECLARATIONS +class CXnComponent; + +// CLASS DECLARATION + +/** +* Component factory interface for creating UI representations of the elements. +* This class is wrapper for containing CEikEdwin +* +* @lib xneditorfactory.lib +* @since S60 +*/ +// inheritance order must be this, despite codescanner warnings +class CXnTextEditorFactory : public MXnComponentFactory, public CBase + { +public: // Data types + +public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnTextEditorFactory* NewL(); + + /** + * Destructor. + */ + virtual ~CXnTextEditorFactory(); + + +public: // Functions from base classes + + /** + * Creates the Xuikon component for editor component. + * @param aNode Corresponding DOM-node + * @param aTargetComponent Pointer reference to the component to be created. + */ + virtual TXnComponentFactoryResponse MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent); + + /** + * Creates the control adapter for editor component. + * @param aNode Corresponding DOM-node + */ + virtual CXnControlAdapter* MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent); + +private: + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CXnTextEditorFactory(); + + }; + +// Exported factory function required by ECOM-framework +IMPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount); + +#endif // _XNTEXTEDITORFACTORY_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/inc/xntexteditorpublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/inc/xntexteditorpublisher.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,76 @@ +/* +* 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: CPS Publishing for text editor. +* +*/ + +#ifndef XNTEXTEDITORPUBLISHER_H +#define XNTEXTEDITORPUBLISHER_H + +#include <e32base.h> +#include <eikedwob.h> + +// FORWARD DECLARATIONS +class CLiwServiceHandler; +class MLiwInterface; +class CXnTextEditorAdapter; + +class CXnTextEditorPublisher : public CBase, public MEikEdwinObserver + { + public: + /** + * Two-phased constructor. + */ + static CXnTextEditorPublisher* NewL( CXnTextEditorAdapter& aAdapter, + const TDesC8& aNodeId ); + + /** + * Destructor. + */ + virtual ~CXnTextEditorPublisher(); + + private: + CXnTextEditorPublisher( CXnTextEditorAdapter& aAdapter ); + void ConstructL( const TDesC8& aNodeId ); + + public: // From MEikEdwinObserver + /** + * @see MEikEdwinObserver. + */ + void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType); + + void PublishTextL( const TDesC& aText ); + + private: // New functions + void InitCpsInterfaceL(); + void AddDataToCpsL( const TDesC& aPublisherId, const TDesC& aContentType, + const TDesC& aContentId, const TDesC8& aDataKey, const TDesC& aData ); + void RemoveDataFromCpsL( const TDesC& aPublisherId, const TDesC& aContentType, + const TDesC& aContentId ); + + + private: + CXnTextEditorAdapter& iAdapter; + HBufC* iNodeId; // Own + MLiwInterface* iCpsInterface; // Not own + CLiwServiceHandler* iServiceHandler; // Own + HBufC* iTextBuffer; // Own + }; + +#endif //XNTEXTEDITORPUBLISHER_H + + + + + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xn3texteditorfactory.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xn3texteditorfactory.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include <ecom/registryinfo.rh> +#include <platform/mw/aisystemuids.hrh> + + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = AI3_UID_RENDERING_PLUGIN_TEXTEDITORFACTORY; +interfaces = + { + INTERFACE_INFO + { + interface_uid = AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI3_UID_RENDERING_PLUGIN_TEXTEDITORFACTORY_IMPLEMENTATION; + version_no = 1; + display_name = "XnTextEditor"; + default_data = "texteditor"; + opaque_data = ""; + } + }; + } + }; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditor.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,103 @@ +/* +* 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: Implementation wrapper for CEikEdwin +* +*/ + +#include <e32base.h> +#include <coecntrl.h> +#include <barsread.h> +#include "xncomponent.h" +#include "xntexteditor.h" +#include "xntexteditoradapter.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnTextEditor::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnTextEditor* CXnTextEditor::NewL() + { + CXnTextEditor* self = new( ELeave ) CXnTextEditor; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnTextEditor::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnTextEditor::ConstructL() + { + CXnComponent::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// CXnTextEditor::ConstructL +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnTextEditor::CXnTextEditor() + { + } + +// ----------------------------------------------------------------------------- +// CXnTextEditor::ConstructL +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnTextEditor::~CXnTextEditor() + { + } + +// --------------------------------------------------------- +// CXnTextEditor::SetTextL +// --------------------------------------------------------- +// +void CXnTextEditor::SetTextL(const TDesC& aText) + { + (static_cast<CXnTextEditorAdapter*>(ControlAdapter()))->SetTextL(aText); + } + +// --------------------------------------------------------- +// CXnTextEditor::Text +// --------------------------------------------------------- +// +const HBufC* CXnTextEditor::Text() + { + return (static_cast<CXnTextEditorAdapter*>(ControlAdapter()))->Text(); + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +XnComponentInterface::MXnComponentInterface* CXnTextEditor::MakeInterfaceL(const TDesC8& aType) + { + if( aType != XnTextEditorInterface::KType ) + { + return NULL; + } + + XnTextEditorInterface::MXnTextEditorInterface* editorIf = static_cast< XnTextEditorInterface::MXnTextEditorInterface* >( this ); + + return editorIf; + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditoradapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditoradapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,505 @@ +/* +* 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: Implementation wrapper for CEikEdwin +* +*/ + +// System includes +#include <e32base.h> +#include <e32const.h> +#include <e32property.h> + +#include <eikedwin.h> +#include <AknUtils.h> +#include <AknsUtils.h> +#include <aknview.h> +#include <aknedsts.h> +#include <txtglobl.h> +#include <txtfmlyr.h> +#include <txtfrmat.h> +#include <txtrich.h> +#include <gdi.h> + +#include <activeidle2domainpskeys.h> + +// User includes +#include "xnappuiadapter.h" +#include "xndompropertyvalue.h" +#include "xndomlist.h" +#include "xndomproperty.h" +#include "xnproperty.h" +#include "xnnodepluginif.h" +#include "xncontroladapter.h" +#include "xntexteditoradapter.h" +#include "xntexteditorpublisher.h" +#include "xnnodepluginif.h" +#include "xneditmode.h" +#include "c_xnutils.h" + +const TInt KMaxLength = 100; + +_LIT8( KCpsPublishing, "cpspublishing" ); +_LIT8( KMaxLineAmount, "max-line-amount" ); +_LIT8( KMaxCharAmount, "max-char-amount" ); + +_LIT( KEnterChar, "\x2029" ); + +// Local macros +#define IS_ARROW_KEY( k ) \ + ( k == EStdKeyLeftArrow || k == EStdKeyRightArrow || \ + k == EStdKeyUpArrow || k == EStdKeyDownArrow ) + +// ============================ LOCAL FUNCTIONS ================================ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnTextEditorAdapter* CXnTextEditorAdapter::NewL( CXnControlAdapter* aParent, + CXnNodePluginIf& aNode ) + { + CXnTextEditorAdapter* self = + new( ELeave ) CXnTextEditorAdapter( aParent, aNode ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::CXnTextEditorAdapter +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnTextEditorAdapter::CXnTextEditorAdapter( CXnControlAdapter* aParent, + CXnNodePluginIf& aNode ) + : iParent( aParent ), iNode( aNode ) + { + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::~CXnTextEditorAdapter +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnTextEditorAdapter::~CXnTextEditorAdapter() + { + if ( iAvkonAppUi ) + { + iAvkonAppUi->RemoveFromStack( iEditor ); + } + + if( iFont && iReleaseFont ) + { + CWsScreenDevice* dev( iCoeEnv->ScreenDevice() ); + dev->ReleaseFont( iFont ); + } + + delete iEditorPublisher; + delete iEditor; + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnTextEditorAdapter::ConstructL() + { + CXnControlAdapter::ConstructL( iNode ); + iUiEngine = iNode.UiEngineL(); + + // Max line amount + iMaxLines = 0; + + CXnProperty* maxlinesProp( iNode.GetPropertyL( KMaxLineAmount ) ); + + if ( maxlinesProp ) + { + iMaxLines = maxlinesProp->FloatValueL(); + } + + // Max char amount + TInt maxChars( KMaxLength ); + + CXnProperty* maxcharsProp( iNode.GetPropertyL( KMaxCharAmount ) ); + + if ( maxcharsProp ) + { + maxChars = maxcharsProp->FloatValueL(); + } + + iEditor = new ( ELeave ) CEikEdwin; + + iEditor->SetContainerWindowL( *iParent ); + iEditor->ConstructL( 0, maxChars, maxChars, iMaxLines ); + + // Set allowed input modes + iEditor->SetAknEditorAllowedInputModes( EAknEditorAllInputModes ); + + // Set the default input mode + iEditor->SetAknEditorInputMode( + EAknEditorTextInputMode | EAknEditorNumericInputMode ); + + // Set allowed case modes + iEditor->SetAknEditorPermittedCaseModes( EAknEditorAllCaseModes ); + + // Set the default case mode + iEditor->SetAknEditorCase( EAknEditorTextCase ); + + iEditor->AddFlagToUserFlags( + CEikEdwin::ENoAutoSelection | CEikEdwin::EAllowUndo ); + + // Set numeric keymap + iEditor->SetAknEditorNumericKeymap( EAknEditorPlainNumberModeKeymap ); + + iEditor->SetSuppressBackgroundDrawing( ETrue ); + + iEditor->SetObserver( this ); + + // Default not focused + iEditor->SetFocus( EFalse ); + + SetPropertiesL(); + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::CountComponentControls +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CXnTextEditorAdapter::CountComponentControls() const + { + if( iEditor ) + { + return 1; + } + + return 0; + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::ComponentControl +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +CCoeControl* CXnTextEditorAdapter::ComponentControl( TInt aIndex ) const + { + if( aIndex == 0 ) + { + return iEditor; + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::SizeChanged +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnTextEditorAdapter::SizeChanged() + { + iEditor->SetRect( iNode.Rect() ); + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::OfferKeyEventL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TKeyResponse CXnTextEditorAdapter::OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + TKeyResponse ret( EKeyWasNotConsumed ); + + if ( !IsFocused() ) + { + return ret; + } + + ret = iEditor->OfferKeyEventL( aKeyEvent, aType ); + + if ( IS_ARROW_KEY( aKeyEvent.iScanCode ) ) + { + if ( ret == EKeyWasNotConsumed && aType == EEventKey ) + { + iRefusesFocusLoss = EFalse; + + ret = CXnControlAdapter::OfferKeyEventL( aKeyEvent, aType ); + } + } + + if ( aKeyEvent.iCode == EKeyEnter ) + { + if ( iEditorPublisher && iMaxLines == 1 ) + { + TInt length( iEditor->TextLength() ); + + HBufC* content = HBufC::NewLC( length + 1 ); + TPtr ptr( content->Des() ); + + iEditor->GetText( ptr ); + + ptr.Append( KEnterChar ); + + iEditorPublisher->PublishTextL( *content ); + + CleanupStack::PopAndDestroy( content ); + } + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::RefusesFocusLoss +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CXnTextEditorAdapter::RefusesFocusLoss() const + { + return iRefusesFocusLoss; + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::FocusChanged +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +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 ); + } + else + { + value = EPSAiForwardNumericKeysToPhone; + + appui->RemoveFromStack( iEditor ); + + iEditor->SetFocus( EFalse, aDrawNow ); + } + + iRefusesFocusLoss = isFocused; + + RProperty::Set( KPSUidAiInformation, + KActiveIdleForwardNumericKeysToPhone, + value ); + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::Draw +// Draws the editor component +// ----------------------------------------------------------------------------- +// +void CXnTextEditorAdapter::Draw( const TRect& aRect ) const + { + CXnControlAdapter::Draw( aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::HandleControlEventL +// +// ----------------------------------------------------------------------------- +// +void CXnTextEditorAdapter::HandleControlEventL( CCoeControl* aControl, + TCoeEvent aEventType ) + { + if ( aControl == iEditor ) + { + // If background drawing is suppressed, then we need to call draw here + if ( aEventType == EEventStateChanged ) + { + DrawNow(); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::SetTextL +// Sets the new content to the underlying CEikEdwin +// ----------------------------------------------------------------------------- +// +void CXnTextEditorAdapter::SetTextL( const TDesC& aText ) + { + iEditor->SetTextL( &aText ); + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::Text +// Returns the text contained in the underlying CEikEdwin +// ----------------------------------------------------------------------------- +// +HBufC* CXnTextEditorAdapter::Text() const + { + HBufC* text( NULL ); + + TRAP_IGNORE( text = iEditor->GetTextInHBufL() ); + + // Ownership is transfered to the calller + return text; + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorAdapter::SetPropertiesL +// Sets text properties +// ----------------------------------------------------------------------------- +// +void CXnTextEditorAdapter::SetPropertiesL() + { + // Whether to publish text to CPS + CXnProperty* cpspublishingProp( iNode.GetPropertyL( KCpsPublishing ) ); + CXnProperty* idProp( iNode.IdL() ); + + if ( cpspublishingProp && idProp && + cpspublishingProp->StringValue() == XnPropertyNames::KTrue ) + { + iEditorPublisher = CXnTextEditorPublisher::NewL( + *this, idProp->StringValue() ); + } + + // Store current state + if ( iFont && iReleaseFont ) + { + CWsScreenDevice* dev( iCoeEnv->ScreenDevice() ); + dev->ReleaseFont( iFont ); + iFont = NULL; + } + + // Get new font + CXnUtils::CreateFontL( iNode, iFont, iReleaseFont ); + + // And set font + TCharFormat cf; + TCharFormatMask cfm; + cfm.SetAttrib( EAttColor ); + cfm.SetAttrib( EAttFontTypeface ); + cfm.SetAttrib( EAttFontHeight ); + cfm.SetAttrib( EAttFontPosture ); + cfm.SetAttrib( EAttFontStrokeWeight ); + cfm.SetAttrib( EAttLineSpacing ); + cfm.SetAttrib( EAttLineSpacingControl ); + cf.iFontSpec = iFont->FontSpecInTwips(); + + // Set linespacing + CXnProperty* lineSpaceProp( + iNode.GetPropertyL( XnPropertyNames::appearance::common::KFontLineSpace ) ); + + if ( lineSpaceProp ) + { + TInt lineSpace = + iUiEngine->VerticalPixelValueL( lineSpaceProp, iNode.Rect().Height() ); + + CParaFormatLayer*pFormatLayer = CEikonEnv::NewDefaultParaFormatLayerL(); + CleanupStack::PushL(pFormatLayer); + CParaFormat* paraformat = CParaFormat::NewLC(); + TParaFormatMask paraFormatMask; + paraFormatMask.SetAttrib(EAttLineSpacing); + paraFormatMask.SetAttrib(EAttLineSpacingControl); + paraformat->iLineSpacingControl = CParaFormat::ELineSpacingExactlyInTwips; + CGraphicsDevice* screenDevice = iEikonEnv->ScreenDevice(); + TInt lineHeight = screenDevice->VerticalPixelsToTwips( iFont->HeightInPixels() + lineSpace ); + paraformat->iLineSpacingInTwips = lineHeight; + pFormatLayer->SetL(paraformat, paraFormatMask); + iEditor->SetParaFormatLayer(pFormatLayer); // Edwin takes the ownership + CleanupStack::PopAndDestroy(paraformat); + CleanupStack::Pop(pFormatLayer); + } + + // Get text color and set it + TRgb textColor; + CXnProperty* colorProperty( + iNode.GetPropertyL( XnPropertyNames::appearance::common::KColor ) ); + + if ( colorProperty ) + { + CXnDomProperty* domProperty( colorProperty->Property() ); + + if ( domProperty ) + { + TInt error( KErrNotSupported ); + + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( + domProperty->PropertyValueList().Item( 0 ) ); + + if ( value->IsAutoIdent() ) + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + error = AknsUtils::GetCachedColor(skinInstance, textColor, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6); + } + else if ( value->PrimitiveValueType() == CXnDomPropertyValue::ERgbColor ) + { + textColor = value->RgbColorValueL(); + error = KErrNone; + } + else + { + HBufC* colorString = colorProperty->StringValueL(); + CleanupStack::PushL( colorString ); + CXnUtils::StripQuotes( colorString ); + TInt index = 0; + TAknsItemID skinID; + TBool idResolved = CXnUtils::ResolveSkinItemIDL( colorString->Des(), skinID, index ); + + if ( idResolved ) + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + error = AknsUtils::GetCachedColor( skinInstance, textColor, skinID, index ); + } + else // use auto value if skin id is invalid. + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + error = AknsUtils::GetCachedColor(skinInstance, textColor, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6); + } + + CleanupStack::PopAndDestroy( colorString ); + } + + if ( error == KErrNone ) + { + cf.iFontPresentation.iTextColor = textColor; + } + else + { + cf.iFontPresentation.iTextColor = KRgbBlack; + } + } + } + + CCharFormatLayer *pCharFL = CCharFormatLayer::NewL(cf,cfm); + iEditor->SetCharFormatLayer(pCharFL); + iEditor->SetTextBaselineSpacing( 2 ); + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditorfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditorfactory.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,136 @@ +/* +* 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: Implementation for factory creating CXnEditor-element +* +*/ + +#include <e32base.h> +#include <coecntrl.h> +#include <barsread.h> + +#include "xntexteditorfactory.h" +#include "xntexteditoradapter.h" +#include "xntype.h" +#include "xncomponent.h" +#include "xnnodepluginif.h" +#include "xndomnode.h" +#include "aisystemuids.hrh" + +#include "xntexteditor.h" + +_LIT8( KXnTextEditor, "texteditor" ); + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CXnTextEditorFactory::MakeXnComponentL +// Creates the Xuikon component for editor control +// ----------------------------------------------------------------------------- +// +MXnComponentFactory::TXnComponentFactoryResponse CXnTextEditorFactory::MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent + ) + { + MXnComponentFactory::TXnComponentFactoryResponse retVal = MXnComponentFactory::EXnFactoryResponseComponentNotSupported; + + // Check that the given type of a control is parent (or ancestor) of this control + if( aNode.Type()->Type() == KXnTextEditor ) + { + CXnTextEditor* container = CXnTextEditor::NewL(); + + aTargetComponent = static_cast< CXnComponent* >( container ); + + retVal = MXnComponentFactory::EXnFactoryResponseComponentConstructed; + } + + return retVal; + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorFactory::MakeXnControlAdapterL +// Creates the control adapter for editor control +// ----------------------------------------------------------------------------- +// +CXnControlAdapter* CXnTextEditorFactory::MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent) + { + return CXnTextEditorAdapter::NewL( aParent, aNode ); + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorFactory::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnTextEditorFactory* CXnTextEditorFactory::NewL() + { + CXnTextEditorFactory* self = new( ELeave ) CXnTextEditorFactory; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorFactory::CXnTextEditorFactory +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnTextEditorFactory::CXnTextEditorFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorFactory::~CXnTextEditorFactory +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnTextEditorFactory::~CXnTextEditorFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorFactory::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnTextEditorFactory::ConstructL() + { + } + + +// Define the interface UIDs +const TImplementationProxy ImplementationTable[] = + { +#ifdef __EABI__ + IMPLEMENTATION_PROXY_ENTRY( AI3_UID_RENDERING_PLUGIN_TEXTEDITORFACTORY_IMPLEMENTATION, CXnTextEditorFactory::NewL ) +#else + { { AI3_UID_RENDERING_PLUGIN_TEXTEDITORFACTORY_IMPLEMENTATION }, CXnTextEditorFactory::NewL } +#endif + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); + + return ImplementationTable; + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditorpublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditorpublisher.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,278 @@ +/* +* 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: CPS Publishing for text editor. +* +*/ + +#include "xntexteditorpublisher.h" + +#include "xntexteditoradapter.h" +#include <LiwServiceHandler.h> +#include <LiwVariant.h> +#include <LiwGenericParam.h> +#include <eikedwin.h> +#include <eikedwin.h> +#include <utf.h> + + +//#include <StringLoader.h> // StringLoader + +_LIT8( KCPService, "Service.ContentPublishing" ); +_LIT8( KCPInterface, "IDataSource" ); + +_LIT8( KType, "type" ); +_LIT( KCpData, "cp_data" ); + +_LIT8( KPublisherId, "publisher" ); +_LIT8( KContentTypeId, "content_type" ); +_LIT8( KContentId, "content_id" ); + +_LIT(KAI3HSPublisher, "ai3homescreen"); +_LIT(KContentType, "editorinput"); + +_LIT8( KData, "data"); + +_LIT8( KDataMap, "data_map" ); + +_LIT8( KItem, "item" ); +_LIT8( KAdd, "Add" ); +_LIT8( KDelete, "Delete" ); + +// ============================ LOCAL FUNCTIONS =============================== +static void DoResetAndDestroy( TAny* aPtr ) + { + __ASSERT_DEBUG( aPtr, User::Invariant() ); + reinterpret_cast< RCriteriaArray* >( aPtr )->ResetAndDestroy(); + } + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// Two-phased constructor. Can leave. +// ----------------------------------------------------------------------------- +// +CXnTextEditorPublisher* CXnTextEditorPublisher::NewL( CXnTextEditorAdapter& aAdapter, + const TDesC8& aNodeId ) + { + CXnTextEditorPublisher* self = new (ELeave) CXnTextEditorPublisher( aAdapter ); + CleanupStack::PushL( self ); + self->ConstructL( aNodeId ); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +CXnTextEditorPublisher::~CXnTextEditorPublisher() + { + if( iNodeId ) + { + TRAP_IGNORE( RemoveDataFromCpsL( KAI3HSPublisher, KContentType, iNodeId->Des() ) ); + } + if( iCpsInterface ) + { + iCpsInterface->Close(); + iCpsInterface = NULL; + } + if( iServiceHandler ) + { + iServiceHandler->Reset(); + delete iServiceHandler; + iServiceHandler = NULL; + } + CEikEdwin* editor = iAdapter.Editor(); + if( editor ) + { + editor->RemoveEdwinObserver( this ); + } + delete iNodeId; + delete iTextBuffer; + } + +// ----------------------------------------------------------------------------- +// C++ default constructor. Must not leave. +// ----------------------------------------------------------------------------- +// +CXnTextEditorPublisher::CXnTextEditorPublisher( CXnTextEditorAdapter& aAdapter ) : + iAdapter( aAdapter ) + { + } + +// ----------------------------------------------------------------------------- +// 2nd phase constructor. Can leave. +// ----------------------------------------------------------------------------- +// +void CXnTextEditorPublisher::ConstructL( const TDesC8& aNodeId ) + { + iNodeId = CnvUtfConverter::ConvertToUnicodeFromUtf8L( aNodeId ); + InitCpsInterfaceL(); + CEikEdwin* editor = iAdapter.Editor(); + if( editor ) + { + editor->SetEdwinObserver( this ); + TInt len = editor->MaxLength(); + iTextBuffer = HBufC::NewL( len ); + } + } + +// ----------------------------------------------------------------------------- +// Uses the CPS interface to add given data +// ----------------------------------------------------------------------------- +// +void CXnTextEditorPublisher::AddDataToCpsL( const TDesC& aPublisherId, + const TDesC& aContentType, const TDesC& aContentId, + const TDesC8& aDataKey, const TDesC& aData ) + { + if( iCpsInterface ) + { + CLiwGenericParamList& inparam = iServiceHandler->InParamListL(); + CLiwGenericParamList& outparam = iServiceHandler->OutParamListL(); + + TLiwGenericParam cptype( KType, TLiwVariant( KCpData )); + cptype.PushL(); + + inparam.AppendL( cptype ); + + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); + CLiwDefaultMap* map = CLiwDefaultMap::NewLC(); + + // Add data to data map + map->InsertL( aDataKey, TLiwVariant( aData )); + + // Create content data map + cpdatamap->InsertL( KPublisherId, TLiwVariant( aPublisherId )); + cpdatamap->InsertL( KContentTypeId, TLiwVariant( aContentType )); + cpdatamap->InsertL( KContentId, TLiwVariant( aContentId )); + cpdatamap->InsertL( KDataMap, TLiwVariant(map) ); + + TLiwGenericParam item( KItem, TLiwVariant( cpdatamap )); + item.PushL(); + + inparam.AppendL( item ); + + iCpsInterface->ExecuteCmdL( KAdd, inparam, outparam); + + CleanupStack::PopAndDestroy( 4, &cptype ); // &item, map, cpdatamap, + + outparam.Reset(); + inparam.Reset(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CXnTextEditorPublisher::RemoveDataFromCpsL( const TDesC& aPublisherId, + const TDesC& aContentType, const TDesC& aContentId ) + { + if( iCpsInterface && iServiceHandler ) + { + CLiwGenericParamList& inparam = iServiceHandler->InParamListL(); + CLiwGenericParamList& outparam = iServiceHandler->OutParamListL(); + + TLiwGenericParam cptype( KType, TLiwVariant( KCpData )); + cptype.PushL(); + inparam.AppendL( cptype ); + + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); + cpdatamap->InsertL( KPublisherId, TLiwVariant( aPublisherId )); + cpdatamap->InsertL( KContentTypeId, TLiwVariant( aContentType )); + cpdatamap->InsertL( KContentId, TLiwVariant( aContentId )); + + TLiwGenericParam item( KItem, TLiwVariant( cpdatamap )); + item.PushL(); + inparam.AppendL( item ); + + iCpsInterface->ExecuteCmdL( KDelete, inparam, outparam ); + + CleanupStack::PopAndDestroy( 3, &cptype ); // cpdatamap, &item + outparam.Reset(); + inparam.Reset(); + } + } + +// ----------------------------------------------------------------------------- +// Gets the CPS messaging interface +// ----------------------------------------------------------------------------- +// +void CXnTextEditorPublisher::InitCpsInterfaceL() + { + if( !iServiceHandler ) + { + iServiceHandler = CLiwServiceHandler::NewL(); + } + + CLiwGenericParamList& inParam = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParam = iServiceHandler->OutParamListL(); + + RCriteriaArray a; + TCleanupItem item( DoResetAndDestroy, &a ); + CleanupStack::PushL( item ); + + CLiwCriteriaItem* crit = CLiwCriteriaItem::NewLC( KLiwCmdAsStr, KCPInterface, + KCPService ); + crit->SetServiceClass( TUid::Uid(KLiwClassBase) ); + + a.AppendL(crit); + + CleanupStack::Pop( crit ); + + iServiceHandler->AttachL(a); + iServiceHandler->ExecuteServiceCmdL( *crit, inParam, outParam ); + + CleanupStack::PopAndDestroy(); // item; + + // 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; + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorPublisher::HandleEdwinEventL +// ----------------------------------------------------------------------------- +// +void CXnTextEditorPublisher::HandleEdwinEventL(CEikEdwin* aEdwin, TEdwinEvent aEventType) + { + if( aEventType == MEikEdwinObserver::EEventTextUpdate) + { + TPtr bufferDes = iTextBuffer->Des(); + bufferDes.Zero(); + aEdwin->GetText( bufferDes ); + PublishTextL( bufferDes ); + } + } + +// ----------------------------------------------------------------------------- +// CXnTextEditorPublisher::PublishTextL +// ----------------------------------------------------------------------------- +// +void CXnTextEditorPublisher::PublishTextL( const TDesC& aText ) + { + AddDataToCpsL( KAI3HSPublisher, KContentType, iNodeId->Des(), KData, aText ); + } + +// END OF FILE + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntextfactory/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntextfactory/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* 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: Building information file +'* +*/ + + +#include <platform_paths.hrh> + +PRJ_PLATFORMS + +ARMV5 WINSCW + + +PRJ_EXPORTS + +PRJ_MMPFILES + +xntextfactory.mmp diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntextfactory/group/xntextfactory.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntextfactory/group/xntextfactory.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,62 @@ +/* +* 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: +* +*/ + + +#include <platform_paths.hrh> +#include <platform/mw/aisystemuids.hrh> + +TARGET xn3textfactory.dll +TARGETTYPE PLUGIN +UID 0x10009d8d AI3_UID_RENDERING_PLUGIN_TEXTFACTORY + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE xntextfactory.cpp +SOURCE xntext.cpp +SOURCE xntextadapter.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY eikcoctl.lib +LIBRARY cone.lib +LIBRARY gdi.lib +LIBRARY bitgdi.lib +LIBRARY fbscli.lib +LIBRARY egul.lib +LIBRARY charconv.lib +LIBRARY aknskins.lib +LIBRARY xn3layoutengine.lib +LIBRARY xn3utils.lib +LIBRARY xn3domdocument.lib +LIBRARY fntstr.lib +LIBRARY aknpictograph.lib +LIBRARY avkon.lib +LANG SC + +START RESOURCE xn3textfactory.rss +#ifdef SYMBIAN_SECURE_ECOM +TARGET xn3textfactory.rsc +#endif +END + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntextfactory/inc/xntextadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntextfactory/inc/xntextadapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,149 @@ +/* +* 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: Wrapper class for CEikLabel. +* +*/ + + + +#ifndef _XNTEXTADAPTER_H +#define _XNTEXTADAPTER_H + +// INCLUDES +#include "xncontroladapter.h" +#include <e32base.h> +#include <eiklabel.h> +#include <AknPictographDrawerInterface.h> // for japanese variants + +// FORWARD DECLARATIONS +class CXnNodePluginIf; +class CAknPictographInterface; + +// CLASS DECLARATION +/** +* @ingroup group_xntextfactory +* @lib xn3textfactory.lib +* @since Series 60 3.1 +*/ +class CXnTextAdapter : public CXnControlAdapter, + public MAknPictographAnimatorCallBack + { +public: + /** + * 2 phase construction. + */ + static CXnTextAdapter* NewL(CXnControlAdapter* aParent, CXnNodePluginIf& aNode); + + /** + * Destructor. + */ + virtual ~CXnTextAdapter(); + +public: // New functions + /** + * Sets the new content to the underlying CEikLabel + * @param aText The new content + */ + void SetTextL(const TDesC& aText); + + /** + * Returns the text contained in the underlying CEikLabel + * @return TDesC* The text + */ + const TDesC* Text() const; + +public: // from base classes + TInt CountComponentControls() const; + CCoeControl* ComponentControl(TInt aIndex) const; + virtual void SizeChanged(); + virtual void SkinChanged(); + + /** + * From CXnControlAdapter Handles the property changes. + * @since Series 60 3.1 + * @return void. + */ + void DoHandlePropertyChangeL(CXnProperty* aProperty = NULL); + + /** + * From CCoeControl Handles the resource change. + * @since Series 60 3.1 + * @param aType A type of the resource change + * @return void. + */ + void HandleScreenDeviceChangedL(); + + /** + * See CCoeControl documentation + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + /** + * See MAknPictographInterface documentation + */ + void DrawPictographArea(); + + /** + * See CXnControlAdapter documentation + */ + TSize MeasureAdaptiveContentL( const TSize& aAvailableSize ); + +private: + + CXnTextAdapter(CXnControlAdapter* aParent, CXnNodePluginIf& aNode); + void ConstructL(); + void ConstructTextL(); + virtual void Draw(const TRect& aRect) const; + + void UpdateBackgroundL() const; + void DrawBackground(const TRect& aRect, CWindowGc& aGc) const; + TInt RestrictSizeL(); + + void SetLineSpacingL( TInt aReference ); + TSize MeasureTextL( const TSize& aAvailableSize ); + void UpdateTextL( const TDesC* aText ); + void UpdateTextL( const TDesC8& aText ); + + /** + * Sets text properties, such as color, font, etc. + * @param aNode UI node + * @return ETrue if text needs reconstruction, EFalse otherwise + */ + TBool SetTextPropertiesL( CXnNodePluginIf& aNode ); + + /** + * Same as SizeChanged(), but this is an L function. + */ + void SizeChangedL(); + + +private: + CEikLabel* iLabel; // Label to draw text + CXnControlAdapter* iParent; // Parent control, not owned + CXnNodePluginIf& iNode; // UI node, not owned + CFont* iFont; // Used font, owned + TBool iReleaseFont; // Whether the font needs to be released or not. + TUint8 iFlags; // Flags for text properties + CAknPictographInterface* iPictographInterface; // Pictograph interface. + CWindowGc* iGc; // Window graphics context. Not own. + mutable CFbsBitmap* iBackgroundBitmap; // Pointer to background bitmap. Own. + TInt iMaxLines; //Max lines for wrapped text string + HBufC* iText; + }; + + + +#endif // XNTEXTADAPTER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntextfactory/inc/xntextfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntextfactory/inc/xntextfactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,104 @@ +/* +* 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: Factory for creating CXnText -component +* +*/ + + + +#ifndef _XNTEXTFACTORY_H +#define _XNTEXTFACTORY_H + +// INCLUDES +#include "xncomponentfactory.h" +#include <e32base.h> +#include <e32std.h> + +#include <ecom/ecom.h> +#include <ecom/implementationproxy.h> + + +// FORWARD DECLARATIONS +class CXnComponent; + +// CLASS DECLARATION + +/** +* @ingroup group_xntextfactory +* +* Component factory interface for creating UI representations of the elements. +* This class is wrapper for containing CEikLabel +* +* @lib xn3textfactory.lib +* @since Series 60 3.1 +*/ +// inheritance order must be this, despite codescanner warnings +class CXnTextFactory : public MXnComponentFactory, public CBase + { + public: // Data types + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnTextFactory* NewL(); + + /** + * Destructor. + */ + virtual ~CXnTextFactory(); + + + public: // Functions from base classes + + /** + * Creates the Xuikon component for text component. + * @param aNode Corresponding DOM-node + * @param aTargetComponent Pointer reference to the component to be created. + */ + virtual TXnComponentFactoryResponse MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent + ); + + /** + * Creates the control adapter for text component. + * @param aNode Corresponding DOM-node + */ + virtual CXnControlAdapter* MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent + ); + + private: + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CXnTextFactory(); + + }; + +// Exported factory function required by ECOM-framework +IMPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount); + +#endif // _XNTEXTFACTORY_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntextfactory/src/xn3textfactory.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntextfactory/src/xn3textfactory.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// 1020726D.RSS +// +#include <ecom/registryinfo.rh> +#include <platform/mw/aisystemuids.hrh> + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = AI3_UID_RENDERING_PLUGIN_TEXTFACTORY; +interfaces = + { + INTERFACE_INFO + { + interface_uid = AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI3_UID_RENDERING_PLUGIN_TEXTFACTORY_IMPLEMENTATION; + version_no = 1; + display_name = "XnText"; + default_data = "text"; + opaque_data = ""; + } + }; + } + }; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntextfactory/src/xntext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntextfactory/src/xntext.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,103 @@ +/* +* 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: Implementation for wrapper for CEikLabel +* +*/ + + +#include <e32base.h> +#include <coecntrl.h> +#include <barsread.h> +#include "xncomponent.h" +#include "xntext.h" +#include "xntextadapter.h" + +// ============================ MEMBER FUNCTIONS =============================== + + + + +// ----------------------------------------------------------------------------- +// CXnText::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnText* CXnText::NewL() + { + CXnText* self = new( ELeave ) CXnText; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnText::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnText::ConstructL() + { + CXnComponent::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// CXnText::ConstructL +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnText::CXnText() + { + } + +// ----------------------------------------------------------------------------- +// CXnText::ConstructL +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnText::~CXnText() + { + } + +// --------------------------------------------------------- +// CXnText::SetTextL +// --------------------------------------------------------- +// +void CXnText::SetTextL(const TDesC& aText) + { + (static_cast<CXnTextAdapter*>(ControlAdapter()))->SetTextL(aText); + } + +// --------------------------------------------------------- +// CXnText::Text +// --------------------------------------------------------- +// +const TDesC* CXnText::Text() + { + return (static_cast<CXnTextAdapter*>(ControlAdapter()))->Text(); + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +XnComponentInterface::MXnComponentInterface* CXnText::MakeInterfaceL(const TDesC8& aType) + { + if (aType != XnTextInterface::KType) + { + return NULL; + } + XnTextInterface::MXnTextInterface* textintr = static_cast<XnTextInterface::MXnTextInterface*>(this); + return textintr; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntextfactory/src/xntextadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntextfactory/src/xntextadapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1155 @@ +/* +* 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: Implementation for wrapper for a label +* +*/ + + +#include <e32base.h> +#include <coecntrl.h> +#include <barsread.h> +#include <gulcolor.h> +#include <utf.h> + +#include <AknsUtils.h> +#include <AknPictographInterface.h> // for japanese variants. +#include <AknBidiTextUtils.h> +#include <AknUtils.h> +#include <AknLayoutFont.h> + +#include "xnnodepluginif.h" +#include "xndompropertyvalue.h" +#include "xndomproperty.h" +#include "xndomlist.h" +#include "xnproperty.h" +#include "xncomponent.h" +#include "xnuienginepluginif.h" +#include "xncomponent.h" +#include "xncontroladapter.h" +#include "c_xnutils.h" +#include "xntype.h" +#include "xntextadapter.h" +#include "xncomponentnodeimpl.h" +#include "xnviewnodeimpl.h" +#include "xneditmode.h" + +namespace XnText + { + const TUint8 KClip = 0x01; + const TUint8 KEllipse = 0x02; + const TUint8 KWrap = 0x04; + const TUint8 KOverflowVisible = 0x08; + const TUint8 KLtr = 0x10; + const TUint8 KConstructText = 0x20; + + _LIT8( tooltip, "tooltip" ); + _LIT8( clock, "clock" ); + } + +// ----------------------------------------------------------------------------- +// IsBitSet +// Test whether bit is set in a flag +// ----------------------------------------------------------------------------- +static TBool IsBitSet(TUint8 aBit,TUint8 aFlag) + { + return ( aFlag & aBit ); + } + +// ----------------------------------------------------------------------------- +// SetLabelTextL +// Prepares text to label, wraps or clips if needed +// ----------------------------------------------------------------------------- +static void SetLabelTextL( CEikLabel& aLabel, const TDesC& aSource, TInt aMaxLineWidth, + TInt aMaxLines, TUint8 aFlags, TBool aMeasureOnly = EFalse ) + { + // By default, let the label do the logical to visual conversion + TBool conversion( ETrue ); + + if( IsBitSet( XnText::KOverflowVisible, aFlags ) || aSource == KNullDesC ) + { + // no clipping or wrapping needed if, + // overflow is visible + // no text or no space, + // or text fits to given space + aLabel.SetTextL( aSource ); + } + else + { + AknBidiTextUtils::TParagraphDirectionality dir( AknBidiTextUtils::EImplicit ); + + const CFont* font( aLabel.Font() ); + + HBufC* buffer( NULL ); + + if( IsBitSet( XnText::KEllipse, aFlags ) ) + { + buffer = aSource.AllocLC(); + + TPtr ptr( buffer->Des() ); + + AknBidiTextUtils::ConvertToVisualAndClipL( + ptr, *font, aMaxLineWidth, aMaxLineWidth, dir ); + + + // The text is already in visual form, no need for conversion + conversion = EFalse; + + aLabel.SetTextL( *buffer ); + + CleanupStack::PopAndDestroy( buffer ); + } + else if( IsBitSet( XnText::KWrap, aFlags ) ) + { + if( aMaxLines > 0 ) + { + CArrayFixFlat< TInt >* array = new ( ELeave ) CArrayFixFlat< TInt >( 8 ); + CleanupStack::PushL( array ); + + for( TInt i = 0; i < aMaxLines; i++ ) + { + array->AppendL( aMaxLineWidth ); + } + + buffer = HBufC::NewLC( aSource.Length() + aMaxLines * + ( KAknBidiExtraSpacePerLine + 1 ) ); + + TPtr ptr( buffer->Des() ); + + AknBidiTextUtils::ConvertToVisualAndWrapToStringL( + aSource, *array, *font, ptr, ETrue, dir ); + } + else + { + CArrayFixFlat< TPtrC >* array = new ( ELeave ) CArrayFixFlat< TPtrC >( 8 ); + CleanupStack::PushL( array ); + + HBufC* temp = AknBidiTextUtils::ConvertToVisualAndWrapToArrayL( + aSource, aMaxLineWidth, *font, *array, dir ); + + CleanupStack::PushL( temp ); + + TInt lineCount( array->Count() ); + + buffer = HBufC::NewLC( temp->Length() + ( lineCount - 1 ) ); + + TPtr ptr( buffer->Des() ); + + for( TInt i = 0; i < lineCount; i++ ) + { + TPtrC line( array->At( i ) ); + + ptr.Append( line ); + + if( i + 1 < lineCount ) + { + ptr.Append( '\n' ); + } + } + + CleanupStack::Pop(); + CleanupStack::PopAndDestroy( temp ); + CleanupStack::PushL( buffer ); + } + + // The text is already in visual form, no need for conversion + conversion = EFalse; + + aLabel.SetTextL( *buffer ); + + CleanupStack::PopAndDestroy( 2 ); // buffer, array + } + else + { + aLabel.SetTextL( aSource ); + } + } + + if( !aMeasureOnly ) + { + // Text is truly set, set conversion and defer draw + aLabel.UseLogicalToVisualConversion( conversion ); + } + } + +// ----------------------------------------------------------------------------- +// CopyBitmapData +// Copies a data from source bitmap to target bitmap. +// ----------------------------------------------------------------------------- +// +static TInt CopyBitmapData( + CFbsBitmap& aTarget, + const CFbsBitmap& aSource, + TPoint aSourcePoint) + { + TSize targetSize(aTarget.SizeInPixels()); + TSize sourceSize(aSource.SizeInPixels()); + TInt lineLength(targetSize.iWidth); + TInt maxSourceLineLength(sourceSize.iWidth - aSourcePoint.iX); + if(lineLength > maxSourceLineLength) + { + lineLength = maxSourceLineLength; + } + TInt rowCount(targetSize.iHeight); + TInt maxSourceRowCount(sourceSize.iHeight - aSourcePoint.iY); + if(rowCount > maxSourceRowCount) + { + rowCount = maxSourceRowCount; + } + + // Get bitmap display mode + TDisplayMode displayMode(aSource.DisplayMode()); + + // Create buffer for a scan line + HBufC8* scanLine = HBufC8::New( + aSource.ScanLineLength(lineLength, displayMode)); + if(!scanLine) + { + return KErrNoMemory; + } + + TPtr8 scanPtr(scanLine->Des()); + + // Copy all rows to destination bitmap + for(TInt row(0); row < rowCount; row++) + { + aSource.GetScanLine(scanPtr, + TPoint(aSourcePoint.iX, aSourcePoint.iY + row), + lineLength, displayMode); + aTarget.SetScanLine(scanPtr, row); + } + delete scanLine; + return KErrNone; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnTextAdapter* CXnTextAdapter::NewL(CXnControlAdapter* aParent, CXnNodePluginIf& aNode) + { + CXnTextAdapter* self = new( ELeave ) CXnTextAdapter( aParent, aNode ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::CXnTextAdapter +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnTextAdapter::CXnTextAdapter(CXnControlAdapter* aParent, CXnNodePluginIf& aNode) + : iParent( aParent ), iNode( aNode ) + { + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::~CXnTextAdapter +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnTextAdapter::~CXnTextAdapter() + { + delete iLabel; + + delete iText; + + if( iFont && iReleaseFont ) + { + CWsScreenDevice* dev = iCoeEnv->ScreenDevice(); + dev->ReleaseFont( iFont ); + } + + if( iPictographInterface ) + { + delete iPictographInterface; + } + + delete iBackgroundBitmap; + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnTextAdapter::ConstructL() + { + iGc = &SystemGc(); + + iLabel = new ( ELeave ) CEikLabel; + iLabel->SetContainerWindowL( *iParent ); + iLabel->SetTextL( KNullDesC ); + + CXnControlAdapter::ConstructL( iNode ); + + iPictographInterface = CAknPictographInterface::NewL( *iLabel, *this ); + iLabel->EnablePictographsL( *iPictographInterface ); + + SetTextPropertiesL( iNode ); + UpdateTextL( iNode.GetPCData() ); + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::ConstructTextL +// Construct the text component according to properties. +// ----------------------------------------------------------------------------- +// +void CXnTextAdapter::ConstructTextL() + { + if( !iText ) + { + // CEikLabel will panic in ::Draw if text is not set + SetLabelTextL( *iLabel, KNullDesC, 0, 0, 0 ); + return; + } + + if( !( iFlags & XnText::KConstructText ) ) + { + return; + } + + TRect rect( iNode.Rect() ); + + SetLineSpacingL( rect.Height() ); + + TInt flags( iFlags ); + + // Now we must restrict side into parent + flags = RestrictSizeL(); + + SetLabelTextL( *iLabel, *iText, iLabel->Rect().Width(), iMaxLines, flags ); + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::SetTextPropertiesL +// Sets text properties, such as color, font, etc. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CXnTextAdapter::SetTextPropertiesL( CXnNodePluginIf& aNode ) + { + // Store current state + const CFont* font( iFont ); + TInt flags( iFlags ); + TInt maxLines( iMaxLines ); + + if( iFont && iReleaseFont ) + { + CWsScreenDevice* dev = iCoeEnv->ScreenDevice(); + dev->ReleaseFont( iFont ); + iFont = NULL; + } + + // Find out the font and set it + CXnUtils::CreateFontL( aNode, iFont, iReleaseFont ); + iLabel->SetFont( iFont ); + + // Turn off all graphic context effects + iLabel->SetUnderlining( EFalse ); + iLabel->SetStrikethrough( EFalse ); + + //following data types are used due to we are handling text via CEikLabel instead of direct + //font color and effects manipulation via graphics context. + //We manipulate pen and brush colors indirectly via + //Label's OverrideColorL method applying EColorControlBackground and EColorLabelText parameters + //with corresponding RGB value. + TRgb textColor; + TRgb effectsColor; + TBool textColorSet( EFalse ); + TBool effectsColorSet( EFalse ); + TBool effectsDevColorSet( EFalse ); + + CXnProperty* colorProperty = aNode.GetPropertyL( XnPropertyNames::appearance::common::KColor ); + + if( colorProperty != NULL ) + { + CXnDomProperty* domProperty = colorProperty->Property(); + + if( domProperty ) + { + TInt error( KErrNotSupported ); + + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* > + ( domProperty->PropertyValueList().Item( 0 ) ); + + if( value->IsAutoIdent() ) + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + error = AknsUtils::GetCachedColor(skinInstance, textColor, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6); + } + else if( value->PrimitiveValueType() == CXnDomPropertyValue::ERgbColor ) + { + textColor = value->RgbColorValueL(); + error = KErrNone; + } + else + { + HBufC* colorString = colorProperty->StringValueL(); + CleanupStack::PushL( colorString ); + + CXnUtils::StripQuotes( colorString ); + + TInt index = 0; + TAknsItemID skinID; + + TBool idResolved = CXnUtils::ResolveSkinItemIDL( colorString->Des(), skinID, index ); + + if( idResolved ) + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + error = AknsUtils::GetCachedColor( skinInstance, textColor, skinID, index ); + } + else // use auto value if skin id is invalid. + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + error = AknsUtils::GetCachedColor(skinInstance, textColor, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6); + } + CleanupStack::PopAndDestroy( colorString ); + } + if (error == KErrNone) + { + textColorSet = ETrue; + } + } + } + + CXnProperty* effectsProperty = aNode.GetPropertyL(XnPropertyNames::appearance::common::KTextEffects); + if ( effectsProperty ) + { + TInt error(KErrNotSupported); + effectsDevColorSet = ETrue; //some color needed, device color by default + CXnProperty* effectsColorProperty = aNode.GetPropertyL(XnPropertyNames::appearance::common::KEffectsColor); + if (effectsColorProperty) + { + CXnDomProperty* domProperty = effectsColorProperty->Property(); + if( domProperty ) + { + CXnDomPropertyValue* value = static_cast<CXnDomPropertyValue*>(domProperty->PropertyValueList().Item(0)); + if (value->IsAutoIdent()) + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + error = AknsUtils::GetCachedColor(skinInstance, effectsColor, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6); + } + else if (value->PrimitiveValueType() == CXnDomPropertyValue::ERgbColor) + { + effectsColor = value->RgbColorValueL(); + error = KErrNone; + } + else + { + HBufC* colorString = effectsColorProperty->StringValueL(); + CleanupStack::PushL( colorString ); + CXnUtils::StripQuotes( colorString ); + + TInt index = 0; + TAknsItemID skinID; + + TBool idResolved = CXnUtils::ResolveSkinItemIDL( colorString->Des(), skinID, index ); + if( idResolved ) + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + error = AknsUtils::GetCachedColor( skinInstance, effectsColor, skinID, index ); + } + else // use auto value if skin id is invalid. + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + error = AknsUtils::GetCachedColor(skinInstance, effectsColor, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6); + } + CleanupStack::PopAndDestroy( colorString ); + } + if ( error == KErrNone ) + { + effectsColorSet = ETrue; //theme color found + effectsDevColorSet = EFalse;//device color not needed + } + } + } + } + + if ( textColorSet ) + { + if ( effectsColorSet ) + {//theme font color and theme effects color + iLabel->OverrideColorL(EColorControlBackground, textColor); + iLabel->OverrideColorL(EColorLabelText, effectsColor); + } + else if ( effectsDevColorSet ) + {//theme font color and device effects color + iLabel->OverrideColorL(EColorControlBackground, textColor); + } + else + {//theme font color, but no effects defined + iLabel->OverrideColorL(EColorLabelText, textColor); + } + } + else if ( effectsColorSet ) + {//device font color and theme effects color + iLabel->OverrideColorL(EColorLabelText, effectsColor); + }//else device font color and device effects color (default) + + CXnProperty* textDecorationProp = aNode.GetPropertyL( XnPropertyNames::appearance::common::KTextDecoration ); + + if( textDecorationProp ) + { + CXnDomList& propertyValueList = textDecorationProp->Property()->PropertyValueList(); + + TInt valueCount = propertyValueList.Length(); + + for( TInt i = 0; i < valueCount; ++i ) + { + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( propertyValueList.Item( i ) ); + + if( value->StringValueL() == XnPropertyNames::appearance::common::textdecoration::KUnderline ) + { + iLabel->SetUnderlining( ETrue ); + } + + if( value->StringValueL() == XnPropertyNames::appearance::common::textdecoration::KLinethrough ) + { + iLabel->SetStrikethrough( ETrue ); + } + } + } + + iFlags = 0; + iFlags |= XnText::KEllipse; //default + iFlags |= XnText::KLtr; + iMaxLines = 0; + + TGulAlignmentValue alignment = CXnUtils::TextAlignment( aNode ); + + TInt labelAlignment( ELayoutAlignLeft ); // all are vertically top aligned by default (avkon) + + switch( alignment ) + { + case EHCenterVCenter: + labelAlignment = ELayoutAlignCenter; + break; + case EHRightVCenter: + labelAlignment = ELayoutAlignRight; + break; + default: + break; + } + + iLabel->SetLabelAlignment( labelAlignment ); // avkon extension needs this, it modifys horizontal alignment + iLabel->SetAlignment( alignment ); // call to have vertical alignment + + CXnProperty* direction = iNode.GetPropertyL( XnPropertyNames::style::common::KDirection ); + const TDesC8* directionValue = &XnPropertyNames::style::common::direction::KLTR; + + if( direction ) + { + directionValue = &direction->StringValue(); + } + + if( *directionValue == XnPropertyNames::style::common::direction::KRTL ) + { + iLabel->SetLabelAlignment( ELayoutAlignBidi ); + iFlags &= ~XnText::KLtr; + } + + CXnProperty* overflowProp = aNode.GetPropertyL( XnPropertyNames::appearance::common::KTextOverflowMode ); + + if( overflowProp ) + { + CXnDomList& propertyValueList = overflowProp->Property()->PropertyValueList(); + + TInt valueCount = propertyValueList.Length(); + + for( TInt i = 0; i < valueCount; ++i ) + { + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( propertyValueList.Item( i ) ); + + if( value->StringValueL() == XnPropertyNames::appearance::common::textoverflow::KClipMode ) + { + iFlags |= XnText::KClip; + iFlags &= ~XnText::KWrap; + iFlags &= ~XnText::KEllipse; + } + else if( value->StringValueL() == XnPropertyNames::appearance::common::textoverflow::KWrapMode ) + { + iFlags |= XnText::KWrap; + iFlags &= ~XnText::KClip; + iFlags &= ~XnText::KEllipse; + } + } + + //Get max lines amount for wrap + if( iFlags & XnText::KWrap ) + { + CXnProperty* maxlinesProp = aNode.GetPropertyL( XnPropertyNames::appearance::common::textoverflow::KMaxLineAmount ); + + if( maxlinesProp ) + { + iMaxLines = static_cast< TInt >( maxlinesProp->FloatValueL() ); + } + } + } + + CXnProperty* overflowProperty = iNode.GetPropertyL( XnPropertyNames::style::common::KOverflow ); + + if( overflowProperty ) + { + const TDesC8& overflowValue = overflowProperty->StringValue(); + + if( overflowValue == XnPropertyNames::style::common::visibility::KVisible ) + { + iFlags |= XnText::KOverflowVisible; + } + } + + if( flags & XnText::KConstructText ) + { + iFlags |= XnText::KConstructText; + } + + if( font != iFont || flags != iFlags || maxLines != iMaxLines ) + { + return ETrue; + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::SetTextL +// Sets the new content to the underlying CEikLabel +// ----------------------------------------------------------------------------- +// +void CXnTextAdapter::SetTextL( const TDesC& aText ) + { + UpdateTextL( &aText ); + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::Text +// Returns the text contained in the underlying CEikLabel +// ----------------------------------------------------------------------------- +// +const TDesC* CXnTextAdapter::Text() const + { + if( iFlags & XnText::KConstructText ) + { + return iText; + } + else + { + return iLabel->Text(); + } + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::CountComponentControls +// Returns the number of component controls. +// ----------------------------------------------------------------------------- +// +TInt CXnTextAdapter::CountComponentControls() const + { + return 1; + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::ComponentControl +// Returns the component control of the given index +// ----------------------------------------------------------------------------- +// +CCoeControl* CXnTextAdapter::ComponentControl(TInt aIndex) const + { + if( aIndex == 0 ) + { + return iLabel; + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::DoHandlePropertyChangeL +// ----------------------------------------------------------------------------- +// +void CXnTextAdapter::DoHandlePropertyChangeL(CXnProperty* aProperty) + { + if( aProperty ) + { + const TDesC8& name( aProperty->Property()->Name() ); + + if( name == XnPropertyNames::style::common::KDisplay || + name == XnPropertyNames::style::common::KVisibility || + name == XnPropertyNames::style::common::KWidth || + name == XnPropertyNames::style::common::KHeight ) + { + return; + } + + if( name == XnPropertyNames::common::KPCData ) + { + UpdateTextL( iNode.GetPCData() ); + } + } + + if( SetTextPropertiesL( iNode ) ) + { + iFlags |= XnText::KConstructText; + } + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::HandleResourceChange +// ----------------------------------------------------------------------------- +// +void CXnTextAdapter::HandleScreenDeviceChangedL() + { + if( SetTextPropertiesL( iNode ) ) + { + iFlags |= XnText::KConstructText; + } + + CXnControlAdapter::HandleScreenDeviceChangedL(); + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::HandlePointerEventL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CXnTextAdapter::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + if( AknLayoutUtils::PenEnabled() ) + { + CXnControlAdapter::HandlePointerEventL( aPointerEvent ); + } + } + +// --------------------------------------------------------- +// CXnTextAdapter::SizeChanged() +// Called by framework when the view size is changed +// (other items were commented in a header). +// --------------------------------------------------------- +// +void CXnTextAdapter::SizeChanged() + { + TRAP_IGNORE( SizeChangedL() ); + } + + // --------------------------------------------------------- +// CXnTextAdapter::SizeChangedL() +// --------------------------------------------------------- +// +void CXnTextAdapter::SizeChangedL() + { + if( SetTextPropertiesL( iNode ) ) + { + iFlags |= XnText::KConstructText; + } + + TRect rect( iNode.Rect() ); + + TRect labelRect( iLabel->Rect() ); + iLabel->SetRect( rect ); + + if( iText ) + { + TInt textWidth( iLabel->Font()->TextWidthInPixels( *iText ) ); + + TInt rectWidth( rect.Width() ); + + if( iFlags & XnText::KOverflowVisible ) + { + TBool isTooltip( iNode.ParentL()->Type()->Type() == XnText::tooltip ); + + // Tooltip can grow and shrink, others just grow + if( isTooltip || textWidth > rectWidth ) + { + rect = Rect(); + + TInt dx( textWidth - rectWidth ); + + if( dx != 0 ) + { + rect.Resize( dx, 0 ); + SetSizeWithoutNotification( rect.Size() ); + + // Update + iLabel->SetRect( rect ); + } + } + } + } + if( labelRect != iLabel->Rect() ) + { + iFlags |= XnText::KConstructText; + } + } + +// --------------------------------------------------------- +// CXnTextAdapter::SkinChanged() +// Called by framework when the skin is changed +// (other items were commented in a header). +// --------------------------------------------------------- +// +void CXnTextAdapter::SkinChanged() + { + TRAP_IGNORE + ( + if( SetTextPropertiesL( iNode ) ) + { + iFlags |= XnText::KConstructText; + } + ); + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::Draw +// Draws the text component +// ----------------------------------------------------------------------------- +// +void CXnTextAdapter::Draw(const TRect& aRect) const + { + CXnTextAdapter* adapter = const_cast< CXnTextAdapter* >( this ); + + if( iFlags & XnText::KConstructText ) + { + TRAPD( err, adapter->ConstructTextL() ); + + adapter->iFlags &= ~XnText::KConstructText; + + if( err ) + { + return; + } + } + + CXnControlAdapter::Draw( aRect ); + + if( iPictographInterface ) + { + TRAP_IGNORE( UpdateBackgroundL() ); + iGc->BitBlt( iNode.Rect().iTl, iBackgroundBitmap ); + } + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::DrawPictographArea +// Draws the text component +// ----------------------------------------------------------------------------- +// +void CXnTextAdapter::DrawPictographArea() + { + DrawNow(); + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::UpdateBackgroundL +// ----------------------------------------------------------------------------- +// +void CXnTextAdapter::UpdateBackgroundL() const + { + CGraphicsDevice* gdevice = iGc->Device(); + TDisplayMode displayMode = gdevice->DisplayMode(); + + // create "screenshot" from the background appearance + if( iBackgroundBitmap ) + { + delete iBackgroundBitmap; + iBackgroundBitmap = NULL; + } + + iBackgroundBitmap = new (ELeave) CFbsBitmap(); + iBackgroundBitmap->Create( iNode.Rect().Size(), displayMode ); + CFbsBitmap* tmpBitmap = new (ELeave) CFbsBitmap; + CleanupStack::PushL( tmpBitmap ); + + CWsScreenDevice* scrDevice = static_cast<CWsScreenDevice*>( iGc->Device() ); + TSize tmpSize = scrDevice->SizeInPixels(); + tmpBitmap->Create( tmpSize, displayMode ); + + CFbsBitmapDevice* tmpDevice = CFbsBitmapDevice::NewL( tmpBitmap ); + CleanupStack::PushL( tmpDevice ); + CBitmapContext* bc( NULL ); + tmpDevice->CreateBitmapContext( bc ); + CleanupStack::PushL( bc ); + DrawBackground( iNode.Rect(), reinterpret_cast<CWindowGc&>( *bc ) ); + CopyBitmapData( *iBackgroundBitmap, *tmpBitmap, iNode.Rect().iTl ); + CleanupStack::PopAndDestroy( 3 ); + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::DrawBackground +// ----------------------------------------------------------------------------- +// +void CXnTextAdapter::DrawBackground(const TRect& aRect, CWindowGc& aGc) const + { + RPointerArray<CXnControlAdapter> adapters; + + for( CXnNodePluginIf* node = &iNode; node; ) + { + TRAP_IGNORE( + CXnControlAdapter* adapter( node->Control() ); + + if ( adapter ) + { + adapters.AppendL( adapter ); + } + + node = node->ParentL() + ); + } + + for( TInt i = adapters.Count() - 1; i >= 0; --i ) + { + adapters[i]->Draw( aRect, aGc ); + } + + adapters.Reset(); + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::MeasureAdaptiveContentL +// ----------------------------------------------------------------------------- +// +TSize CXnTextAdapter::MeasureAdaptiveContentL( const TSize& aAvailableSize ) + { + TSize size; + + if( ( aAvailableSize.iWidth > 0 ) && ( aAvailableSize.iHeight > 0 ) ) + { + size = MeasureTextL( aAvailableSize ); + } + + return size; + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::RestrictSizeL +// ----------------------------------------------------------------------------- +// +TInt CXnTextAdapter::RestrictSizeL() + { + CXnNodePluginIf* parent( iNode.ParentL() ); + + if( !parent ) + { + // No parent where to restrict own size + return iFlags; + } + + TRect parentRect( parent->Rect() ); + + if( parentRect.IsEmpty() ) + { + return iFlags; + } + + TRect rect( Rect() ); + + TInt dx( 0 ); + TInt dy( 0 ); + + // Restrict own size inside parent rect to prevent flowing outside parent's rect + if( rect.iBr.iX > parentRect.iBr.iX ) + { + dx = rect.iBr.iX - parentRect.iBr.iX; + } + + if( rect.iBr.iY > parentRect.iBr.iY ) + { + dy = rect.iBr.iY - parentRect.iBr.iY; + } + + if( dx == 0 && dy == 0 ) + { + // No need to change sizes + return iFlags; + } + + TInt flags( iFlags ); + + if( parent->Type()->Type() == XnText::tooltip ) + { + // Remove temporarily to allow tooltip truncation + flags &= ~XnText::KOverflowVisible; + } + + // Clip text again, parent size restriction may result in re-clipping + if( !IsBitSet( XnText::KOverflowVisible, flags ) ) + { + TSize size( rect.Size() ); + + size.iWidth -= dx; + size.iHeight -= dy; + + // Update own size ... + SetSizeWithoutNotification( size ); + + // ... and label + rect = iLabel->Rect(); + + rect.Resize( -dx, -dy ); + + iLabel->SetRect( rect ); + } + + return flags; + } + +// ----------------------------------------------------------------------------- +// CXnTextAdapter::SetLineSpacingL +// ----------------------------------------------------------------------------- +// +void CXnTextAdapter::SetLineSpacingL( TInt aReference ) + { + // Set linespacing, one pixel is the default + TInt lineSpace( 1 ); + + CXnProperty* lineSpaceProp( + iNode.GetPropertyL( XnPropertyNames::appearance::common::KFontLineSpace ) ); + + if( lineSpaceProp ) + { + lineSpace = iNode.UiEngineL()->VerticalPixelValueL( lineSpaceProp, aReference ); + } + + if( lineSpace < 1 ) + { + // Must be at least 1 + lineSpace = 1; + } + + const CAknLayoutFont* layoutFont( CAknLayoutFont::AsCAknLayoutFontOrNull( iFont ) ); + + if( layoutFont ) + { + TInt textPaneHeight = layoutFont->TextPaneHeight(); + + lineSpace += ( textPaneHeight - iFont->HeightInPixels() ); + } + /* end of CEikLabel fix */ + + iLabel->SetPixelGapBetweenLines( lineSpace ); + } + +// ----------------------------------------------------------------------------- +// MeasureTextL +// Measures the text dimensions fitted to available size +// ----------------------------------------------------------------------------- +// +TSize CXnTextAdapter::MeasureTextL( const TSize& aAvailableSize ) + { + TSize size; + + if( !iText || *iText == KNullDesC ) + { + return size; + } + + // Save the current text before measure + HBufC* original( iLabel->Text()->AllocLC() ); + + SetLineSpacingL( 0 ); + + SetLabelTextL( *iLabel, *iText, aAvailableSize.iWidth, iMaxLines, iFlags, ETrue ); + + TPtrC text( *iLabel->Text() ); + + // help CEikLabel to calculate its content size more precisely + iLabel->iMargin.iBottom = iLabel->Font()->DescentInPixels(); + + // Get the size needed for the text + size = iLabel->CalcMinimumSize( text ); + + // Restore original text + iLabel->SetTextL( *original ); + CleanupStack::PopAndDestroy( original ); + + return size; + } + +// ----------------------------------------------------------------------------- +// UpdateTextL +// ----------------------------------------------------------------------------- +// +void CXnTextAdapter::UpdateTextL( const TDesC8& aText ) + { + HBufC* text( CnvUtfConverter::ConvertToUnicodeFromUtf8L( aText ) ); + + CleanupStack::PushL( text ); + + UpdateTextL( text ); + + CleanupStack::PopAndDestroy( text ); + } + +// ----------------------------------------------------------------------------- +// UpdateTextL +// ----------------------------------------------------------------------------- +// +void CXnTextAdapter::UpdateTextL( const TDesC* aText ) + { + if( aText ) + { + if( iText && *iText == *aText ) + { + // New text is same as current + return; + } + + if( iText && iText->Des().MaxLength() >= aText->Length() ) + { + // New text fits to earlier allocated space + *iText = *aText; + } + else + { + // Need to reserve space for new text + delete iText; + iText = NULL; + iText = aText->AllocL(); + } + + TPtr ptr( iText->Des() ); + + CXnUtils::CollapseWhiteSpace( iNode, ptr ); + + iFlags |= XnText::KConstructText; + + iNode.SetDirtyL(); + + const TDesC8& parentType( iNode.ParentL()->Type()->Type() ); + + if( parentType == XnText::tooltip ) + { + // Force tooltip text size to be recalculted by layout algorithm + SetSizeWithoutNotification( TSize() ); + } + else if( parentType == XnText::clock ) + { + iNode.ParentL()->SetDirtyL(); + } + } + } + +// End of file + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xntextfactory/src/xntextfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xntextfactory/src/xntextfactory.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,132 @@ +/* +* 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: Implementation for factory creating CXnText-element +* +*/ + + +#include <e32base.h> +#include <coecntrl.h> +#include <barsread.h> + +#include "xntextfactory.h" +#include "xntextadapter.h" +#include "xntype.h" +#include "xncomponent.h" +#include "xnnodepluginif.h" +#include <aisystemuids.hrh> +#include "xndomnode.h" + +#include "xntext.h" + +// ============================ MEMBER FUNCTIONS =============================== + + +_LIT8(KXnText, "text"); + +// ----------------------------------------------------------------------------- +// CXnEikLabelFactory::MakeXnComponentL +// Creates the Xuikon component for label control +// ----------------------------------------------------------------------------- +// +MXnComponentFactory::TXnComponentFactoryResponse CXnTextFactory::MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent + ) + { + MXnComponentFactory::TXnComponentFactoryResponse retVal = MXnComponentFactory::EXnFactoryResponseComponentNotSupported; + // Check that the given type of a control is parent (or ancestor) of this control + if(aNode.Type()->Type() == KXnText) + { + CXnText* container = CXnText::NewL(); + aTargetComponent = static_cast<CXnComponent*>(container); + retVal = MXnComponentFactory::EXnFactoryResponseComponentConstructed; + return retVal; + } + return retVal; + } + +// ----------------------------------------------------------------------------- +// CXnTextFactory::MakeXnControlAdapterL +// Creates the control adapter for label control +// ----------------------------------------------------------------------------- +// +CXnControlAdapter* CXnTextFactory::MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent) + { + return CXnTextAdapter::NewL(aParent, aNode); + } + +// ----------------------------------------------------------------------------- +// CXnTextFactory::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnTextFactory* CXnTextFactory::NewL() + { + CXnTextFactory* self = new( ELeave ) CXnTextFactory; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnTextFactory::CXnTextFactory +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnTextFactory::CXnTextFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnTextFactory::~CXnTextFactory +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnTextFactory::~CXnTextFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnTextFactory::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnTextFactory::ConstructL() + { + } + + +// Define the interface UIDs +const TImplementationProxy ImplementationTable[] = + { +#ifdef __EABI__ + IMPLEMENTATION_PROXY_ENTRY(AI3_UID_RENDERING_PLUGIN_TEXTFACTORY_IMPLEMENTATION, CXnTextFactory::NewL) +#else + {{AI3_UID_RENDERING_PLUGIN_TEXTFACTORY_IMPLEMENTATION}, CXnTextFactory::NewL} +#endif + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,27 @@ +/* +* 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: Building information file +* +*/ + + +PRJ_PLATFORMS +ARMV5 WINSCW + + +PRJ_EXPORTS + +PRJ_MMPFILES + +xnviewfactory.mmp diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/group/xnviewfactory.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/group/xnviewfactory.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,53 @@ +/* +* 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: ECOM-plugin for view-component +* +*/ + + +#include <platform_paths.hrh> +#include <platform/mw/aisystemuids.hrh> + +TARGET xn3viewfactory.dll +TARGETTYPE PLUGIN +UID 0x10009d8d AI3_UID_RENDERING_PLUGIN_VIEWFACTORY + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE viewfactory.cpp +SOURCE view.cpp +SOURCE viewcontrol.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY aknskins.lib +LIBRARY xn3layoutengine.lib +LIBRARY xn3utils.lib +LIBRARY xn3domdocument.lib +LIBRARY ws32.lib + +START RESOURCE xn3viewfactory.rss +#ifdef SYMBIAN_SECURE_ECOM +TARGET xn3viewfactory.rsc +#endif +END + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/inc/view.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/inc/view.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ +/* +* 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: Wrapper class for CAknView. +* +*/ + + + +#ifndef _VIEWPLUGIN_H +#define _VIEWPLUGIN_H + +// System includes +#include <e32base.h> + +// User includes +#include "xncomponent.h" + + +// CLASS DECLARATION +/** +* @ingroup group_xnviewfactory +* @lib xn3viewfactory.dll +* @since S6060 3.1 +*/ +class CXnViewPlugin : public CXnComponent + { +public: + /** + * 2 phase construction. + */ + static CXnViewPlugin* NewL(); + + /** + * Destructor. + */ + virtual ~CXnViewPlugin(); + +private: + + CXnViewPlugin(); + void ConstructL(); + +private: + }; + +#endif // _VIEWPLUGIN_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/inc/viewcontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/inc/viewcontrol.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Xuikon View plugin. +* +*/ + +#ifndef _VIEWCONTROL_H +#define _VIEWCONTROL_H + +// System includes +#include <e32base.h> + +// User includes +#include "xncontroladapter.h" + +// Forward declarations +class CXnNodePluginIf; + +// Class declaration +/** +* @ingroup group_xnviewfactory +* @lib xn3viewfactory.dll +* @since S6060 3.1 +*/ +class CViewControl : public CXnControlAdapter + { +public: + // Constructors and destructor + + /** + * 2 phase construction. + */ + static CViewControl* NewL( CXnNodePluginIf& aNode ); + + /** + * Destructor. + */ + ~CViewControl(); + +private: + // Constructor + CViewControl(); + + void ConstructL( CXnNodePluginIf& aNode ); + +private: + // data + + }; + +#endif // _VIEWCONTROL_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/inc/viewfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/inc/viewfactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Factory for creating CXnView -component +* +*/ + + + +#ifndef _XNVIEWFACTORY_H +#define _XNVIEWFACTORY_H + +// INCLUDES +#include "xncomponentfactory.h" +#include <e32base.h> +#include <ecom/ecom.h> +#include <ecom/implementationproxy.h> + +// FORWARD DECLARATIONS + +/** +* @ingroup group_xnviewfactory +* +* Layout Area UI factory interface for creating UI representations of the layout areas. +* This class is wrapper for containing a box +* +* @lib xn3viewfactory.dll +* @since S6060 3.1 +*/ +// inheritance order must be this, despite codescanner warnings +class CXnViewFactory : public MXnComponentFactory, public CBase + { + public: // Data types + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnViewFactory* NewL(); + + /** + * Destructor. + */ + virtual ~CXnViewFactory(); + + public: // Functions from base classes + + /** + * From MXnComponentFactory Interface for creating a view component. + * @since Series 60 3.1 + * @param aNode Component's node. + * @param aTargetComponent Created component is set here. + * @return EXnFactoryResponseComponentConstructed if component created. + */ + TXnComponentFactoryResponse MakeXnComponentL( + CXnNodePluginIf& aNode, CXnComponent*& aTargetComponent ); + + + /** + * From MXnComponentFactory Interface for creating Ui control adapter. + * @since Series 60 3.1 + * @param aNode Component's node. + * @param aParent Parent of the adapter, which is created here. + * @return Created control adapter. + */ + CXnControlAdapter* MakeXnControlAdapterL(CXnNodePluginIf& aNode, + CXnControlAdapter* aParent = NULL); + + private: + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CXnViewFactory(); + + private: // Data + }; + +// Exported factory function required by ECOM-framework +IMPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount); + +#endif // _XNVIEWFACTORY_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/src/view.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/src/view.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,76 @@ +/* +* 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 +* +*/ + + +#include <e32base.h> +#include <coecntrl.h> +#include <barsread.h> + +#include "view.h" +#include "xncomponent.h" +#include "xncontroladapter.h" + + +// ============================ MEMBER FUNCTIONS =============================== + + + + +// ----------------------------------------------------------------------------- +// CXnViewPlugin::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnViewPlugin* CXnViewPlugin::NewL() + { + CXnViewPlugin* self = new( ELeave ) CXnViewPlugin; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnViewPlugin::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnViewPlugin::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnViewPlugin::ConstructL +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnViewPlugin::CXnViewPlugin() + { + } + +// ----------------------------------------------------------------------------- +// CXnViewPlugin::ConstructL +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnViewPlugin::~CXnViewPlugin() + { + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/src/viewcontrol.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/src/viewcontrol.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,71 @@ +/* +* 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 <e32base.h> +#include <coecntrl.h> + +// User includes +#include "viewcontrol.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CViewControl::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CViewControl* CViewControl::NewL(CXnNodePluginIf& aNode) + { + CViewControl* self = new( ELeave ) CViewControl; + + CleanupStack::PushL( self ); + self->ConstructL( aNode ); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CViewControl::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CViewControl::ConstructL(CXnNodePluginIf& aNode) + { + CXnControlAdapter::ConstructL( aNode ); + } + +// ----------------------------------------------------------------------------- +// CViewControl::ViewControl +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CViewControl::CViewControl() + { + } + +// ----------------------------------------------------------------------------- +// CViewControl::~ViewControl +// C++ destructor +// ----------------------------------------------------------------------------- +// +CViewControl::~CViewControl() + { + } + +//end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/src/viewfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/src/viewfactory.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for factory creating container for a box +* +*/ + + +#include <e32base.h> +#include <coecntrl.h> +#include <barsread.h> + +#include "viewfactory.h" +#include "view.h" +#include "viewcontrol.h" +#include "xncontroladapter.h" +#include "xncomponent.h" +#include "xnnodepluginif.h" +#include "xntype.h" +#include <aisystemuids.hrh> + +// CONSTANTS +_LIT8(KView, "view"); + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CXnViewFactory::MakeXnComponentL +// Creates the Xuikon component for view control +// ----------------------------------------------------------------------------- +// +MXnComponentFactory::TXnComponentFactoryResponse CXnViewFactory::MakeXnComponentL( + CXnNodePluginIf& aNode, CXnComponent*& aTargetComponent ) + { + // Check that the given type of a control is parent (or ancestor) of this control + if( aNode.Type()->Type() == KView ) + { + CXnViewPlugin* container = CXnViewPlugin::NewL(); + aTargetComponent = static_cast< CXnComponent* >( container ); + + return MXnComponentFactory::EXnFactoryResponseComponentConstructed;; + } + + return MXnComponentFactory::EXnFactoryResponseComponentNotSupported;; + } + + +// ----------------------------------------------------------------------------- +// CXnViewFactory::MakeXnControlAdapterL +// Creates the control adapter for view control +// ----------------------------------------------------------------------------- +// +CXnControlAdapter* CXnViewFactory::MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* /*aParent*/) + { + return CViewControl::NewL( aNode ); + } + +// ----------------------------------------------------------------------------- +// CXnViewFactory::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnViewFactory* CXnViewFactory::NewL() + { + CXnViewFactory* self = new( ELeave ) CXnViewFactory; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnViewFactory::CXnViewFactory +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnViewFactory::CXnViewFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnViewFactory::~CXnViewFactory +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnViewFactory::~CXnViewFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnViewFactory::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnViewFactory::ConstructL() + { + } + +// Define the interface UIDs +const TImplementationProxy ImplementationTable[] = + { +#ifdef __EABI__ + IMPLEMENTATION_PROXY_ENTRY(AI3_UID_RENDERING_PLUGIN_VIEWFACTORY_IMPLEMENTATION, CXnViewFactory::NewL) +#else + {{AI3_UID_RENDERING_PLUGIN_VIEWFACTORY_IMPLEMENTATION}, CXnViewFactory::NewL} +#endif + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/src/xn3viewfactory.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnviewfactory/src/xn3viewfactory.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// 102049AE.RSS +// +#include <ecom/registryinfo.rh> +#include <platform/mw/aisystemuids.hrh> + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = AI3_UID_RENDERING_PLUGIN_VIEWFACTORY; +interfaces = + { + INTERFACE_INFO + { + interface_uid = AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI3_UID_RENDERING_PLUGIN_VIEWFACTORY_IMPLEMENTATION; + version_no = 1; + display_name = "XnView"; + default_data = "view"; + opaque_data = ""; + } + }; + } + }; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,27 @@ +/* +* 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: Building information file +* +*/ + + +#include <platform_paths.hrh> + +PRJ_PLATFORMS +ARMV5 WINSCW + +PRJ_EXPORTS + +PRJ_MMPFILES +xnvolumecontrolfactory.mmp diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/group/xnvolumecontrolfactory.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/group/xnvolumecontrolfactory.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2002-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 <platform_paths.hrh> +#include <platform/mw/aisystemuids.hrh> + +TARGET xn3volumecontrolfactory.dll +TARGETTYPE PLUGIN +UID 0x10009d8d AI3_UID_RENDERING_PLUGIN_VOLUMECONTROLFACTORY + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE xnvolumecontrolfactory.cpp +SOURCE xnvolumecontrol.cpp +SOURCE xnvolumecontroladapter.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY eikcoctl.lib +LIBRARY cone.lib +LIBRARY xn3layoutengine.lib +LIBRARY xn3utils.lib +LIBRARY xn3domdocument.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY efsrv.lib +LANG SC + +RESOURCE xn3volumecontrol.rss + +START RESOURCE xn3volumecontrolfactory.rss +#ifdef SYMBIAN_SECURE_ECOM +TARGET xn3volumecontrolfactory.rsc +#endif +END \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/inc/xnvolumecontrol.rsg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/inc/xnvolumecontrol.rsg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1 @@ +#define R_XNVOLUMECONTROLDYNAMIC 1 diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/inc/xnvolumecontroladapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/inc/xnvolumecontroladapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,172 @@ +/* +* 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: Wrapper class for AknVolumeControl +* +*/ + + +#ifndef _XNVOLUMECONTROLADAPTER_H +#define _XNVOLUMECONTROLADAPTER_H + +// INCLUDES +#include <e32base.h> +#include "xncontroladapter.h" + +// FORWARD DECLARATIONS +class CXnNodePluginIf; +class MXnVolumeControlObserver; +class CAknVolumeControl; + +// CLASS DECLARATION +/** +* @ingroup group_xnvolumecontrolfactory +* @lib xnvolumecontrol.lib +* @since Series 60 3.2 +*/ +class CXnVolumeControlAdapter : public CXnControlAdapter, public MCoeControlBackground + { +public: + /** + * 2 phase construction. + */ + static CXnVolumeControlAdapter* NewL(CXnControlAdapter* aParent, CXnNodePluginIf& aNode); + + /** + * Destructor. + */ + virtual ~CXnVolumeControlAdapter(); + +public: // New functions + /** + * Sets the value of the volume control + * @param aValue new value + */ + void SetValueL( TInt aValue ); + + /** + * Returns the value of the volume control + */ + TInt ValueL(); + + /** + * Sets the range for the volume control + * @param aMinimumValue Minimum value + * @param aMaximumValue Maximum value + */ + void SetRangeL( TInt aMimimumValue, TInt aMaximumValue ); + + /** + * Returns the minimum and maximum value of the volume control range + * @param aMinimumValue minimum value reference + * @param aMaximumValue maximum value reference + */ + void GetRangeL( TInt& aMinimumValue, TInt& aMaximumValue ); + + /** + * Sets the observer for the volume control + * @param pointer to the observer + */ + void SetObserver( MXnVolumeControlObserver* aObserver ); + +public: // from base classes + + /** + * From CXnControlAdapter Handles the property changes. + * @since Series 60 3.1 + * @return void. + */ + void DoHandlePropertyChangeL( CXnProperty* aProperty = NULL ); + + /** + * From CCoeControl Handles the resource change. + * @since Series 60 3.1 + * @param aType A type of the resource change + * @return void. + */ + void HandleScreenDeviceChangedL(); + + /** + * See CCoeControl documentation + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + /** + * See CCoeControl documentation + */ + void SizeChanged(); + + /** + * See CCoeControl documentation + */ + TInt CountComponentControls() const; + + /** + * See CCoeControl documentation + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * From MCoeControlBackground. Draws the background for a given control. + * @param aGc Graphics context used for drawing. + * @param aControl The control being drawn. + * @param aRect The area to be redrawn. + */ + void Draw( CWindowGc& aGc, const CCoeControl& aControl, + const TRect& aRect ) const; + +private: + CXnVolumeControlAdapter(CXnControlAdapter* aParent, CXnNodePluginIf& aNode); + + void ConstructL(); + + virtual void Draw(const TRect& aRect) const; + + /** + * Returns the current volume value from property + */ + TInt GetCurrentValueL(); + + /** + * Notifies the observer with new volume value + */ + void NotifyObserverL(); + + /** + * Sets volume control CSS properties + * @param aNode UI Node + * @return void + */ + void SetVolumeControlPropertiesL(); + + /** + * Constructs the volume control component from resource + */ + void ConstructVolumeControlL(); + +private: + CXnControlAdapter* iParent; // Parent control, not owned + CXnNodePluginIf& iNode; // UI node, not owned + CAknVolumeControl* iVolumeControl; // Avkon Volume control. Owned. + MXnVolumeControlObserver* iObserver; // Observer. Not owned. + TRect iHitRect; // Rect where pointer event previously hit + TInt iSteps; // number of steps + TInt iMutedValue; // previous value when muted + TBool iMuted; // is muted? + TBool iButton1Down; // Button 1 is pressed down + + }; + +#endif // _XNVOLUMECONTROLADAPTER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/inc/xnvolumecontrolfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/inc/xnvolumecontrolfactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,101 @@ +/* +* 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: Factory for creating CXnVolumeControl -component +* +*/ + + +#ifndef _XNVOLUMECONTROLFACTORY_H +#define _XNVOLUMECONTROLFACTORY_H + +// INCLUDES +#include <e32base.h> +#include <e32std.h> +#include <ecom/ecom.h> +#include <ecom/implementationproxy.h> +#include "xncomponentfactory.h" + +// FORWARD DECLARATIONS +class CXnComponent; + +// CLASS DECLARATION + +/** +* @ingroup group_xnvolumecontrolfactory +* +* Component factory interface for creating UI representations of the elements. +* This class is wrapper for containing CEikLabel +* +* @lib xnvolumecontrol.lib +* @since Series 60 3.2 +*/ +// inheritance order must be this, despite codescanner warnings +class CXnVolumeControlFactory : public MXnComponentFactory, public CBase + { + public: // Data types + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnVolumeControlFactory* NewL(); + + /** + * Destructor. + */ + virtual ~CXnVolumeControlFactory(); + + + public: // Functions from base classes + + /** + * Creates the Xuikon component for text component. + * @param aNode Corresponding DOM-node + * @param aTargetComponent Pointer reference to the component to be created. + */ + virtual TXnComponentFactoryResponse MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent + ); + + /** + * Creates the control adapter for text component. + * @param aNode Corresponding DOM-node + */ + virtual CXnControlAdapter* MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent + ); + + private: + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CXnVolumeControlFactory(); + + }; + +// Exported factory function required by ECOM-framework +IMPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount); + +#endif // _XNVOLUMECONTROLFACTORY_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/src/xn3volumecontrol.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/src/xn3volumecontrol.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include <avkon.hrh> +#include <avkon.rh> // VOLUME +#include <avkon.mbg> // bitmap IDs +#include <uikon.hrh> + +RESOURCE VOLUME r_xnvolumecontroldynamic + { + flags=EDynRangeSettingsVolumeControl; + value=1; + bmpfile=AVKON_BITMAP_FILE; + bmpid=EMbmAvkonQgn_indi_speaker; + bmpmask=EMbmAvkonQgn_indi_speaker_mask; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/src/xn3volumecontrolfactory.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/src/xn3volumecontrolfactory.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// 1020726F.RSS +// +#include <ecom/registryinfo.rh> +#include <platform/mw/aisystemuids.hrh> + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = AI3_UID_RENDERING_PLUGIN_VOLUMECONTROLFACTORY; +interfaces = + { + INTERFACE_INFO + { + interface_uid = AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI3_UID_RENDERING_PLUGIN_VOLUMECONTROLFACTORY_IMPLEMENTATION; + version_no = 1; + display_name = "XnVolumeControl"; + default_data = "slider"; + opaque_data = ""; + } + }; + } + }; +} diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/src/xnvolumecontrol.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/src/xnvolumecontrol.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,136 @@ +/* +* 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: Implementation for wrapper for AknVolumeControl +* +*/ + + +#include <e32base.h> +#include <coecntrl.h> +#include "xncomponent.h" +#include "xnvolumecontrol.h" +#include "xnvolumecontroladapter.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnText::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnVolumeControl* CXnVolumeControl::NewL() + { + CXnVolumeControl* self = new( ELeave ) CXnVolumeControl; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnText::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnVolumeControl::ConstructL() + { + CXnComponent::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// CXnText::ConstructL +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnVolumeControl::CXnVolumeControl() + { + } + +// ----------------------------------------------------------------------------- +// CXnText::ConstructL +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnVolumeControl::~CXnVolumeControl() + { + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControl::SetValue +// ----------------------------------------------------------------------------- +// +void CXnVolumeControl::SetValue( TInt aValue ) + { + TRAP_IGNORE( (static_cast<CXnVolumeControlAdapter*>( ControlAdapter() ) )-> + SetValueL( aValue ) ); + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControl::Value +// ----------------------------------------------------------------------------- +// +TInt CXnVolumeControl::Value() + { + TInt value = 0; + TRAPD( err, value = (static_cast<CXnVolumeControlAdapter*>( ControlAdapter() ) )->ValueL() ); + if( !err ) + { + return value; + } + else return KErrNotFound; + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControl::SetRange +// ----------------------------------------------------------------------------- +// +void CXnVolumeControl::SetRange( TInt aMinimumValue, TInt aMaximumValue ) + { + TRAP_IGNORE( (static_cast<CXnVolumeControlAdapter*>( ControlAdapter() ) )-> + SetRangeL( aMinimumValue, aMaximumValue ) ); + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControl::GetRange +// ----------------------------------------------------------------------------- +// +void CXnVolumeControl::GetRange( TInt& aMinimumValue, TInt& aMaximumValue ) + { + TRAP_IGNORE( (static_cast<CXnVolumeControlAdapter*>( ControlAdapter() ) )-> + GetRangeL( aMinimumValue, aMaximumValue ) ); + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControl::SetObserver +// ----------------------------------------------------------------------------- +// +void CXnVolumeControl::SetObserver( MXnVolumeControlObserver* aObserver ) + { + (static_cast<CXnVolumeControlAdapter*>( ControlAdapter() ) )->SetObserver( aObserver ); + } + +// --------------------------------------------------------- +// CXnVolumeControl::MakeInterfaceL +// --------------------------------------------------------- +XnComponentInterface::MXnComponentInterface* CXnVolumeControl::MakeInterfaceL(const TDesC8& aType) + { + if (aType != XnVolumeControlInterface::KType) + { + return NULL; + } + XnVolumeControlInterface::MXnVolumeControlInterface* volumeIF = static_cast<XnVolumeControlInterface::MXnVolumeControlInterface*>(this); + return volumeIF; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/src/xnvolumecontroladapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/src/xnvolumecontroladapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,533 @@ +/* +* 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: Implementation for wrapper for a volume control component +* +*/ + + +#include <e32base.h> +#include <coecntrl.h> +#include <barsread.h> +#include <barsc.h> +#include <Aknvolumecontrol.h> + +#include "xnnodepluginif.h" +#include "xndompropertyvalue.h" +#include "xndomproperty.h" +#include "xndomlist.h" +#include "xnproperty.h" +#include "xncomponent.h" +#include "xnuienginepluginif.h" +#include "xncomponentnodeimpl.h" +#include "xncontroladapter.h" +#include "xntype.h" + +#include "xnvolumecontroladapter.h" +#include "xnvolumecontrolobserver.h" +#include "xnvolumecontrol.rsg" + +_LIT( KResourceFileName, "z:\\resource\\plugins\\xn3volumecontrol.rsc" ); + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnVolumeControlAdapter::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnVolumeControlAdapter* CXnVolumeControlAdapter::NewL(CXnControlAdapter* aParent, + CXnNodePluginIf& aNode) + { + CXnVolumeControlAdapter* self = new( ELeave ) CXnVolumeControlAdapter(aParent, aNode); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlAdapter::CXnVolumeControlAdapter +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnVolumeControlAdapter::CXnVolumeControlAdapter(CXnControlAdapter* aParent, + CXnNodePluginIf& aNode) + : iParent( aParent ), iNode( aNode ) + { + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlAdapter::~CXnVolumeControlAdapter +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnVolumeControlAdapter::~CXnVolumeControlAdapter() + { + delete iVolumeControl; + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlAdapter::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnVolumeControlAdapter::ConstructL() + { + ConstructVolumeControlL(); + + iVolumeControl->SetValue( ValueL() ); + + CXnControlAdapter::ConstructL( iNode ); + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlAdapter::ConstructVolumeControL +// ----------------------------------------------------------------------------- +// +void CXnVolumeControlAdapter::ConstructVolumeControlL() + { + delete iVolumeControl; + iVolumeControl = NULL; + + iVolumeControl = new ( ELeave ) CAknVolumeControl; + iVolumeControl->SetContainerWindowL( *iParent ); + iVolumeControl->SetBackground( this ); + + RFs fsSession; + + TInt err( fsSession.Connect() ); + + if( err ) + { + User::Leave( err ); + } + + CleanupClosePushL( fsSession ); + + RResourceFile resourceFile; + resourceFile.OpenL( fsSession, KResourceFileName ); + CleanupClosePushL( resourceFile ); + + HBufC8* resource = resourceFile.AllocReadLC( R_XNVOLUMECONTROLDYNAMIC ); + + TResourceReader reader; + reader.SetBuffer( resource ); + + iVolumeControl->ConstructFromResourceL( reader ); + iVolumeControl->SetRect( iNode.Rect() ); + + CleanupStack::PopAndDestroy( 3, &fsSession ); // resource, resourceFile, fsSession + + SetVolumeControlPropertiesL(); + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlAdapter::SetObserver +// ----------------------------------------------------------------------------- +// +void CXnVolumeControlAdapter::SetObserver( MXnVolumeControlObserver* aObserver ) + { + iObserver = aObserver; + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlAdapter::SetValue +// ----------------------------------------------------------------------------- +// +void CXnVolumeControlAdapter::SetValueL( TInt aValue ) + { + TInt minRange; + TInt maxRange; + + GetRangeL( minRange, maxRange ); + + if( aValue >= minRange && aValue <= maxRange ) + { + CXnDomStringPool& sp = iNode.UiEngineL()->StringPool(); + CXnDomPropertyValue* value = CXnDomPropertyValue::NewL( sp ); + CleanupStack::PushL( value ); + value->SetFloatValueL( CXnDomPropertyValue::ENumber, aValue ); + CXnProperty* valueProperty = CXnProperty::NewL( XnPropertyNames::action::KValue, value, sp ); + CleanupStack::Pop( value ); + CleanupStack::PushL( valueProperty ); + iNode.SetPropertyL( valueProperty ); + CleanupStack::Pop( valueProperty ); + } + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlAdapter::Value +// ----------------------------------------------------------------------------- +// +TInt CXnVolumeControlAdapter::ValueL() + { + return GetCurrentValueL(); + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlAdapter::SetRange +// ----------------------------------------------------------------------------- +// +void CXnVolumeControlAdapter::SetRangeL( TInt aMinimumValue, TInt aMaximumValue ) + { + CXnDomStringPool& sp = iNode.UiEngineL()->StringPool(); + + // Set min value property + CXnDomPropertyValue* minValue = CXnDomPropertyValue::NewL( sp ); + CleanupStack::PushL( minValue ); + minValue->SetFloatValueL( CXnDomPropertyValue::ENumber, aMinimumValue ); + CXnProperty* minValueProperty = CXnProperty::NewL( XnPropertyNames::volumecontrol::KMinRange, minValue, sp ); + CleanupStack::Pop( minValue ); + CleanupStack::PushL( minValueProperty ); + iNode.SetPropertyL( minValueProperty ); + CleanupStack::Pop( minValueProperty ); + + // Set max value property + CXnDomPropertyValue* maxValue = CXnDomPropertyValue::NewL( sp ); + CleanupStack::PushL( maxValue ); + maxValue->SetFloatValueL( CXnDomPropertyValue::ENumber, aMaximumValue ); + CXnProperty* maxValueProperty = CXnProperty::NewL( XnPropertyNames::volumecontrol::KMaxRange, maxValue, sp ); + CleanupStack::Pop( maxValue ); + CleanupStack::PushL( maxValueProperty ); + iNode.SetPropertyL( maxValueProperty ); + CleanupStack::Pop( maxValueProperty ); + + iVolumeControl->SetRange( aMinimumValue, aMaximumValue ); + iSteps = aMaximumValue - aMinimumValue; + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlAdapter::GetRange +// ----------------------------------------------------------------------------- +// +void CXnVolumeControlAdapter::GetRangeL( TInt& aMinimumValue, TInt& aMaximumValue ) + { + CXnProperty* minRange = iNode.GetPropertyL( XnPropertyNames::volumecontrol::KMinRange ); + aMinimumValue = static_cast<TInt>( minRange->FloatValueL() ); + + CXnProperty* maxRange = iNode.GetPropertyL( XnPropertyNames::volumecontrol::KMaxRange ); + aMaximumValue = static_cast<TInt>( maxRange->FloatValueL() ); + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlAdapter::DoHandlePropertyChangeL +// ----------------------------------------------------------------------------- +// +void CXnVolumeControlAdapter::DoHandlePropertyChangeL( CXnProperty* aProperty ) + { + if (aProperty) + { + TInt minValue; + TInt maxValue; + GetRangeL( minValue, maxValue ); + + if( aProperty->Property()->Name() == XnPropertyNames::volumecontrol::KVolumeLevelAdjustment ) + { + CXnDomStringPool& sp = iNode.UiEngineL()->StringPool(); + CXnDomPropertyValue* value = CXnDomPropertyValue::NewL( sp ); + CleanupStack::PushL( value ); + + const TDesC8& strValue = aProperty->StringValue(); + // Increase volume + if( strValue == XnPropertyNames::volumecontrol::KIncrease ) + { + TInt newValue = ValueL() + 1; + if( newValue >= minValue && newValue <= maxValue ) + { + value->SetFloatValueL( CXnDomPropertyValue::ENumber, ValueL() + 1 ); + } + else + { + CleanupStack::PopAndDestroy( value ); + return; + } + } + // Decrease volume + else if( strValue == XnPropertyNames::volumecontrol::KDecrease ) + { + TInt newValue = ValueL() - 1; + if( newValue >= minValue && newValue <= maxValue ) + { + value->SetFloatValueL( CXnDomPropertyValue::ENumber, ValueL() - 1 ); + } + else + { + CleanupStack::PopAndDestroy( value ); + return; + } + } + // Mute + else if( strValue == XnPropertyNames::volumecontrol::KMute ) + { + if( iMuted ) + { + value->SetFloatValueL( CXnDomPropertyValue::ENumber, iMutedValue ); + iMuted = EFalse; + } + else + { + value->SetFloatValueL( CXnDomPropertyValue::ENumber, minValue ); + iMutedValue = GetCurrentValueL(); + iMuted = ETrue; + } + } + CXnProperty* valueProperty = CXnProperty::NewL( XnPropertyNames::action::KValue, value, sp ); + CleanupStack::Pop( value ); + CleanupStack::PushL( valueProperty ); + iNode.SetPropertyL( valueProperty ); + CleanupStack::Pop( valueProperty ); + } + else if( aProperty->Property()->Name() == XnPropertyNames::action::KValue ) + { + TInt newValue = static_cast<TInt>( aProperty->FloatValueL() ); + if( newValue >= minValue && newValue <= maxValue ) + { + iVolumeControl->SetValue( newValue ); + NotifyObserverL(); + } + } + } + else + { + return; + } + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlAdapter::HandleScreenDeviceChangedL +// ----------------------------------------------------------------------------- +// +void CXnVolumeControlAdapter::HandleScreenDeviceChangedL() + { + + ConstructVolumeControlL(); + + CXnControlAdapter::HandleScreenDeviceChangedL(); + } + +// --------------------------------------------------------- +// CXnVolumeControlAdapter::SizeChanged() +// Called by framework when the view size is changed +// (other items were commented in a header). +// --------------------------------------------------------- +// +void CXnVolumeControlAdapter::SizeChanged() + { + CXnControlAdapter::SizeChanged(); + if( iVolumeControl ) + { + iVolumeControl->SetRect( iNode.Rect() ); + } + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlAdapter::CountComponentControls +// Returns the number of component controls. +// ----------------------------------------------------------------------------- +// +TInt CXnVolumeControlAdapter::CountComponentControls() const + { + return 1; + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlAdapter::ComponentControl +// Returns the component control of the given index +// ----------------------------------------------------------------------------- +// +CCoeControl* CXnVolumeControlAdapter::ComponentControl( TInt aIndex ) const + { + if( aIndex == 0 ) + { + return iVolumeControl; + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::Draw +// ----------------------------------------------------------------------------- +// +void CXnVolumeControlAdapter::Draw(CWindowGc& aGc, const CCoeControl& /*aControl*/, + const TRect& aRect) const + { + CXnControlAdapter::Draw( aRect, aGc ); + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlAdapter::Draw +// Draws the text component +// ----------------------------------------------------------------------------- +// +void CXnVolumeControlAdapter::Draw(const TRect& aRect) const + { + CXnControlAdapter::Draw( aRect ); + } + +// ---------------------------------------------------------------------------- +// CXnVolumeControlAdapter::HandlePointerEventL +// Handles the pointer events. +// ---------------------------------------------------------------------------- +// +void CXnVolumeControlAdapter::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + TRect rect( iVolumeControl->Rect() ); + + TReal incrementWidth( TReal( rect.Width() ) / iSteps ); + + TInt leftX( rect.iTl.iX ); + + if( aPointerEvent.iType == TPointerEvent::EButton1Down || + aPointerEvent.iType == TPointerEvent::EMove && iButton1Down ) + { + // By default change the value + TBool valueSet( EFalse ); + + for( TInt i = 1; i <= iSteps && !valueSet; i++ ) + { + // Calculate pixel range + TReal minX( leftX + ( ( i - 1 ) * incrementWidth ) ); + TReal maxX( minX + incrementWidth ); + + if( aPointerEvent.iPosition.iX >= minX && aPointerEvent.iPosition.iX <= maxX ) + { + TBool changeValue( ETrue ); + + if( iHitRect == TRect::EUninitialized ) + { + // Initialize + iHitRect = TRect( minX, rect.iTl.iY, maxX, rect.iBr.iY ); + } + else if( !( iHitRect.Contains( aPointerEvent.iPosition ) ) ) + { + // Reset, as position is changed + iHitRect = TRect( TRect::EUninitialized ); + changeValue = EFalse; + } + else + { + // Still in same slot, do not change value + changeValue = EFalse; + } + + if( changeValue ) + { + TInt value = ValueL(); + + if( value == i ) + { + value = value - 1; + } + else + { + value = i; + } + + //SetValueL will notify also the observer + SetValueL( value ); + DrawDeferred(); + valueSet = ETrue; + } + } + } + } + + if( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + iButton1Down = ETrue; + } + + else if( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + // Reset + iButton1Down = EFalse; + iHitRect = TRect( TRect::EUninitialized ); + } + } + +// ---------------------------------------------------------------------------- +// CXnVolumeControlAdapter::SetVolumeControlProperties +// Sets CSS properties for the volume control +// ---------------------------------------------------------------------------- +// +void CXnVolumeControlAdapter::SetVolumeControlPropertiesL() + { + // Read minrange property + CXnProperty* minRange = iNode.GetPropertyL( XnPropertyNames::volumecontrol::KMinRange ); + TInt minValue = 0; + + if( minRange ) + { + minValue = static_cast<TInt>( minRange->FloatValueL() ); + } + + // Read maxrange property + CXnProperty* maxRange = iNode.GetPropertyL( XnPropertyNames::volumecontrol::KMaxRange ); + TInt maxValue = 20; + + if( maxRange ) + { + maxValue = static_cast<TInt>( maxRange->FloatValueL() ); + } + + SetRangeL( minValue, maxValue ); + + TInt midRange( iSteps / 2 ); + TInt volValue( 0 ); + + if( iVolumeControl->Value() < minValue || + iVolumeControl->Value() > maxValue ) + { + // Set around to mid + volValue = midRange; + } + + // Read value property + CXnProperty* value = iNode.GetPropertyL( XnPropertyNames::action::KValue ); + + if( value ) + { + TInt valueProp = static_cast< TInt >( value->FloatValueL() ); + + if( valueProp >= minValue && valueProp <= maxValue ) + { + volValue = valueProp; + } + } + + SetValueL( volValue ); + } + +// ---------------------------------------------------------------------------- +// CXnVolumeControlAdapter::GetCurrentValue +// ---------------------------------------------------------------------------- +// +TInt CXnVolumeControlAdapter::GetCurrentValueL() + { + CXnProperty* valueProperty = iNode.GetPropertyL( XnPropertyNames::action::KValue ); + return static_cast<TInt>( valueProperty->FloatValueL() ); + } + +// ---------------------------------------------------------------------------- +// CXnVolumeControlAdapter::NotifyObserver +// ---------------------------------------------------------------------------- +// +void CXnVolumeControlAdapter::NotifyObserverL() + { + if( iObserver ) + { + iObserver->VolumeChanged( GetCurrentValueL() ); + } + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/src/xnvolumecontrolfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/src/xnvolumecontrolfactory.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,130 @@ +/* +* 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: Implementation for factory creating CXnVolumeControl -element +* +*/ + + +#include <e32base.h> +#include <coecntrl.h> +#include <barsread.h> + +#include "xnvolumecontrolfactory.h" +#include "xnvolumecontroladapter.h" +#include "xntype.h" +#include "xncomponent.h" +#include "xnnodepluginif.h" +#include "xndomnode.h" +#include "xncomponentnodeimpl.h" +#include <aisystemuids.hrh> +#include "xnvolumecontrol.h" + +// ============================ MEMBER FUNCTIONS =============================== + +_LIT8(KSlider, "slider" ); + +// ----------------------------------------------------------------------------- +// CXnVolumeControlFactory::MakeXnComponentL +// Creates the Xuikon component for label control +// ----------------------------------------------------------------------------- +// +MXnComponentFactory::TXnComponentFactoryResponse CXnVolumeControlFactory::MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent + ) + { + MXnComponentFactory::TXnComponentFactoryResponse retVal = MXnComponentFactory::EXnFactoryResponseComponentNotSupported; + // Check that the given type of a control is parent (or ancestor) of this control + if(aNode.Type()->Type() == KSlider) + { + CXnVolumeControl* container = CXnVolumeControl::NewL(); + aTargetComponent = static_cast<CXnComponent*>(container); + retVal = MXnComponentFactory::EXnFactoryResponseComponentConstructed; + } + return retVal; + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlFactory::MakeXnControlAdapterL +// Creates the control adapter for label control +// ----------------------------------------------------------------------------- +// +CXnControlAdapter* CXnVolumeControlFactory::MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent) + { + return CXnVolumeControlAdapter::NewL(aParent, aNode); + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlFactory::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnVolumeControlFactory* CXnVolumeControlFactory::NewL() + { + CXnVolumeControlFactory* self = new( ELeave ) CXnVolumeControlFactory; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlFactory::CXnVolumeControlFactory +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnVolumeControlFactory::CXnVolumeControlFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlFactory::~CXnVolumeControlFactory +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnVolumeControlFactory::~CXnVolumeControlFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnVolumeControlFactory::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnVolumeControlFactory::ConstructL() + { + } + + +// Define the interface UIDs +const TImplementationProxy ImplementationTable[] = + { +#ifdef __EABI__ + IMPLEMENTATION_PROXY_ENTRY(AI3_UID_RENDERING_PLUGIN_VOLUMECONTROLFACTORY_IMPLEMENTATION, CXnVolumeControlFactory::NewL) +#else + {{AI3_UID_RENDERING_PLUGIN_VOLUMECONTROLFACTORY_IMPLEMENTATION}, CXnVolumeControlFactory::NewL} +#endif + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/rom/ai3xmluirendering.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/rom/ai3xmluirendering.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: IBY file for AI3 Framework's essential modules. Modules to +* be placed on ROM-image listed here are mandatory parts of AI3 +* Framework - Framework cannot start without. +* +*/ + + +#ifndef XMLUIRENDERING_IBY +#define XMLUIRENDERING_IBY + +#include <bldvariant.hrh> + +file=ABI_DIR\BUILD_DIR\xn3ecomelementproxy.dll SHARED_LIB_DIR\xn3ecomelementproxy.dll +file=ABI_DIR\BUILD_DIR\xn3layoutengine.dll SHARED_LIB_DIR\xn3layoutengine.dll +file=ABI_DIR\BUILD_DIR\cpswrapper.dll SHARED_LIB_DIR\cpswrapper.dll +file=ABI_DIR\BUILD_DIR\hspswrapper.dll SHARED_LIB_DIR\hspswrapper.dll +file=ABI_DIR\BUILD_DIR\xn3utils.dll SHARED_LIB_DIR\xn3utils.dll +file=ABI_DIR\BUILD_DIR\xn3domdocument.dll SHARED_LIB_DIR\xn3domdocument.dll +file=ABI_DIR\BUILD_DIR\xn3odt.dll SHARED_LIB_DIR\xn3odt.dll +file=ABI_DIR\BUILD_DIR\xn3resource.dll SHARED_LIB_DIR\xn3resource.dll +file=ABI_DIR\BUILD_DIR\hscontentcontrol.dll SHARED_LIB_DIR\hscontentcontrol.dll +file=ABI_DIR\BUILD_DIR\extrenderingplugin.dll SHARED_LIB_DIR\extrenderingplugin.dll + +// Volume Control +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 + +// Stock plugins +ECOM_PLUGIN( xn3textfactory.dll , xn3textfactory.rsc ) +ECOM_PLUGIN( xn3viewfactory.dll , xn3viewfactory.rsc ) +ECOM_PLUGIN( xn3bitmapfactory.dll , xn3bitmapfactory.rsc ) +ECOM_PLUGIN( xn3menufactory.dll , xn3menufactory.rsc ) +ECOM_PLUGIN( xn3domvisitor.dll , xndomvisitor.rsc ) +ECOM_PLUGIN( xn3popupfactory.dll , xn3popupfactory.rsc ) +ECOM_PLUGIN( xn3newstickerfactory.dll , xn3newstickerfactory.rsc ) +ECOM_PLUGIN( xn3volumecontrolfactory.dll , xn3volumecontrolfactory.rsc ) +ECOM_PLUGIN( xn3clockfactory.dll , xn3clockfactory.rsc ) +ECOM_PLUGIN( xn3nppluginfactory.dll , xn3nppluginfactory.rsc ) +ECOM_PLUGIN( xn3texteditorfactory.dll , xn3texteditorfactory.rsc ) + +#endif // XMLUIRENDERING_IBY + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/rom/ai3xmluirendering_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/rom/ai3xmluirendering_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Image description file for project ActiveIdle3 +* +*/ + +#ifndef XMLUIRENDERINGRESOURCES_IBY +#define XMLUIRENDERINGRESOURCES_IBY + + +#include <data_caging_paths_for_iby.hrh> + +data=\epoc32\data\Z\resource\apps\xnuiengine.rsc APP_RESOURCE_DIR\xnuiengine.rsc + +#endif // XMLUIRENDERINGRESOURCES_IBY diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/bwins/xn3layoutengineu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/bwins/xn3layoutengineu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,239 @@ +EXPORTS + ?SetComponentNeedsCreation@CXnComponentNodeImpl@@QAEXH@Z @ 1 NONAME ; void CXnComponentNodeImpl::SetComponentNeedsCreation(int) + ?ScaleBitmapL@CXnUtils@@SAXABVTRect@@PAVCFbsBitmap@@1@Z @ 2 NONAME ; void CXnUtils::ScaleBitmapL(class TRect const &, class CFbsBitmap *, class CFbsBitmap *) + ?IsFocusedState@CXnNodePluginIf@@QAEHXZ @ 3 NONAME ; int CXnNodePluginIf::IsFocusedState(void) + ?ChildrenL@CXnNodePluginIf@@QAE?AV?$RPointerArray@VCXnNodePluginIf@@@@XZ @ 4 NONAME ; class RPointerArray<class CXnNodePluginIf> CXnNodePluginIf::ChildrenL(void) + ?DynInitMenuItemL@CXnAppUiAdapter@@UAEHABVTDesC16@@PAV?$RPointerArray@VCXnNodeAppIf@@@@@Z @ 5 NONAME ; int CXnAppUiAdapter::DynInitMenuItemL(class TDesC16 const &, class RPointerArray<class CXnNodeAppIf> *) + ?NewL@CXnComponent@@SAPAV1@XZ @ 6 NONAME ; class CXnComponent * CXnComponent::NewL(void) + ?FindNodeByIdL@TXnUiEngineAppIf@@QAEPAVCXnNodeAppIf@@ABVTDesC8@@0@Z @ 7 NONAME ; class CXnNodeAppIf * TXnUiEngineAppIf::FindNodeByIdL(class TDesC8 const &, class TDesC8 const &) + ?IsStateSet@CXnNodeAppIf@@QAEHABVTDesC8@@@Z @ 8 NONAME ; int CXnNodeAppIf::IsStateSet(class TDesC8 const &) + ?FindNodeByIdL@TXnUiEnginePluginIf@@QAEPAVCXnNodePluginIf@@ABVTDesC16@@0@Z @ 9 NONAME ; class CXnNodePluginIf * TXnUiEnginePluginIf::FindNodeByIdL(class TDesC16 const &, class TDesC16 const &) + ?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) + ?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<class CXnNodeAppIf> 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<class CXnNodeAppIf> 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<class CXnNodeAppIf> &) + ?FocusVisible@TXnUiEnginePluginIf@@QAEHXZ @ 62 NONAME ; int TXnUiEnginePluginIf::FocusVisible(void) + ?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) + ?FindResource@CXnUtils@@SAPAVCXnResource@@AAV?$CArrayPtrSeg@VCXnResource@@@@ABVTDesC16@@AAH@Z @ 66 NONAME ; class CXnResource * CXnUtils::FindResource(class CArrayPtrSeg<class CXnResource> &, class TDesC16 const &, int &) + ?UnsetStateL@CXnNodeAppIf@@QAEXABVTDesC8@@@Z @ 67 NONAME ; void CXnNodeAppIf::UnsetStateL(class TDesC8 const &) + ?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) + ?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 *) + ?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) + ?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<class CXnNodeAppIf> &) + ?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<class CXnNodeAppIf> 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<class CXnProperty> *) + ?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<class CXnNodeAppIf> &) + ?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<class CXnResource> & 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<class CXnNodePluginIf> 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<class CXnNodeAppIf> 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<class CXnNodeAppIf> &) + ?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) + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/eabi/xn3layoutengineu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/eabi/xn3layoutengineu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,291 @@ +EXPORTS + _ZN11CXnDocument12CreateAppUiLEv @ 1 NONAME + _ZN11CXnDocument3UidEv @ 2 NONAME + _ZN11CXnDocumentC1ER15CEikApplication4TUid @ 3 NONAME + _ZN11CXnDocumentC2ER15CEikApplication4TUid @ 4 NONAME + _ZN11CXnDocumentD0Ev @ 5 NONAME + _ZN11CXnDocumentD1Ev @ 6 NONAME + _ZN11CXnDocumentD2Ev @ 7 NONAME + _ZN11CXnProperty11FloatValueLEv @ 8 NONAME + _ZN11CXnProperty11StringValueEv @ 9 NONAME + _ZN11CXnProperty12StringValueLEv @ 10 NONAME + _ZN11CXnProperty4NewLEP14CXnDomProperty @ 11 NONAME + _ZN11CXnProperty4NewLERK6TDesC8P19CXnDomPropertyValueR16CXnDomStringPool @ 12 NONAME + _ZN11CXnProperty4NewLERK6TDesC8S2_N19CXnDomPropertyValue19TPrimitiveValueTypeER16CXnDomStringPool @ 13 NONAME + _ZN11CXnProperty4NewLERK6TDesC8dN19CXnDomPropertyValue19TPrimitiveValueTypeER16CXnDomStringPool @ 14 NONAME + _ZN11CXnProperty6CloneLEv @ 15 NONAME + _ZN11CXnProperty8PropertyEv @ 16 NONAME + _ZN12CXnComponent10ConstructLEv @ 17 NONAME + _ZN12CXnComponent14ControlAdapterEv @ 18 NONAME + _ZN12CXnComponent14MakeInterfaceLERK6TDesC8 @ 19 NONAME + _ZN12CXnComponent17SetControlAdapterEP17CXnControlAdapter @ 20 NONAME + _ZN12CXnComponent18ExitPowerSaveModeLEv @ 21 NONAME + _ZN12CXnComponent19EnterPowerSaveModeLEv @ 22 NONAME + _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 + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* 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: Building information file +* +*/ + + +#include <platform_paths.hrh> + +PRJ_PLATFORMS + +ARMv5 WINSCW + + +PRJ_EXPORTS + +PRJ_MMPFILES + +xnlayoutengine.mmp diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/group/xnlayoutengine.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/group/xnlayoutengine.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,159 @@ +/* +* 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: +* +*/ + + +#include <platform_paths.hrh> +#include <data_caging_paths.hrh> +#include <bldvariant.hrh> +#include "../../inc/xuikon_builds_cfg.hrh" +#include <platform/mw/aisystemuids.hrh> +#include "../../../inc/ai3.hrh" + +TARGET xn3layoutengine.dll +TARGETTYPE DLL +UID 0x1000008d AI3_UID_LAYOUT_ENGINE + +VENDORID VID_DEFAULT +CAPABILITY CAP_GENERAL_DLL +SOURCEPATH ../src + +SOURCE xnapplication.cpp +SOURCE xnappuiadapter.cpp +SOURCE xnappuiadapterimpl.cpp +SOURCE xncomponent.cpp +SOURCE xncomponentfactory.cpp +SOURCE xncomponentnodeimpl.cpp +SOURCE xncontroladapter.cpp +SOURCE xnpopupcontroladapter.cpp +SOURCE xncontroladapterimpl.cpp +SOURCE xnkeyeventdispatcher.cpp +SOURCE xndocument.cpp +SOURCE xnnode.cpp +SOURCE xnnodeappif.cpp +SOURCE xnnodepluginif.cpp +SOURCE xnnodeimpl.cpp +SOURCE xnnodepredicate.cpp +SOURCE xnodtparser.cpp +SOURCE xnpanic.cpp +SOURCE xnproperty.cpp +SOURCE xnpropertycomparator.cpp +SOURCE xnpropertylist.cpp +SOURCE xnuiengine.cpp +SOURCE xnuiengineappif.cpp +SOURCE xnuienginepluginif.cpp +SOURCE xnuiengineimpl.cpp +SOURCE xnviewadapter.cpp +SOURCE xnviewnodeimpl.cpp +SOURCE xnviewsnodeimpl.cpp +SOURCE xnutils.cpp +SOURCE xnuistatelistener.cpp +SOURCE xncomposer.cpp +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 +SOURCE xnviewmanager.cpp +SOURCE xnwidgetextensionadapter.cpp +SOURCE xnscrollablecontroladapter.cpp +SOURCE xnoomsyshandler.cpp +SOURCE xnlistquerydialogadapter.cpp +SOURCE xnwallpaperview.cpp +SOURCE xnwallpapercontainer.cpp +SOURCE xneffectmanager.cpp +SOURCE xnbgcontrol.cpp +SOURCE xninactivitymonitor.cpp +SOURCE xnfocuscontrol.cpp +SOURCE xnextrenderingpluginwrapper.cpp + +START RESOURCE xnuiengine.rss +HEADER +TARGETPATH APP_RESOURCE_DIR +LANGUAGE_IDS +END + + +USERINCLUDE ../inc // uiengine +USERINCLUDE ../../inc // xmluirendering +USERINCLUDE ../../../inc // idlehomescreen +USERINCLUDE ../../../sapiwrapper/hspswrapper/inc // hspswrapper +USERINCLUDE ../../../sapiwrapper/cpswrapper/inc // cpswrapper +USERINCLUDE ../../../hscontentcontrol/inc // hscontentcontrolfactory + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY bafl.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY egul.lib +LIBRARY fbscli.lib +LIBRARY ws32.lib +LIBRARY efsrv.lib +LIBRARY apparc.lib +LIBRARY ecom.lib +LIBRARY estor.lib +LIBRARY gdi.lib +LIBRARY hal.lib + +LIBRARY liwservicehandler.lib +LIBRARY hspswrapper.lib +LIBRARY cpswrapper.lib +LIBRARY xn3utils.lib +LIBRARY xn3odt.lib +LIBRARY xn3domdocument.lib +LIBRARY avkon.lib +LIBRARY charconv.lib +LIBRARY aknicon.lib +LIBRARY inetprotutil.lib +LIBRARY xn3resource.lib +LIBRARY svgengine.lib +LIBRARY aknskins.lib +LIBRARY fntstr.lib +LIBRARY cdlengine.lib +LIBRARY aknlayout2scalable.lib +LIBRARY bitgdi.lib +LIBRARY hwrmlightclient.lib +LIBRARY commonengine.lib +LIBRARY aknnotify.lib +LIBRARY aknphysics.lib +LIBRARY gfxtrans.lib +LIBRARY aknswallpaperutils.lib +LIBRARY aknskinsrv.lib +LIBRARY centralrepository.lib +LIBRARY mgfetch.lib +LIBRARY hscontentcontrol.lib +LIBRARY hscontentinfo.lib +LIBRARY hsccproviderclient.lib +LIBRARY extrenderingplugin.lib + +#if defined(_XN3_DEBUG_) || defined(AI3_DEBUG_PERFORMANCE) +LIBRARY flogger.lib +#endif + +#ifdef RD_TACTILE_FEEDBACK +LIBRARY touchfeedback.lib +#endif //RD_TACTILE_FEEDBACK + + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnappuiadapterimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnappuiadapterimpl.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,184 @@ +/* +* 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: Adapter for Avkon for Xuikon +* +*/ + + +#ifndef XNAPPUIADAPTERIMPL_H +#define XNAPPUIADAPTERIMPL_H + +// System includes +#include <e32base.h> + + +// Forward declarations +class CXnUiEngine; +class CXnAppUiAdapter; +class CXnViewAdapter; +class CXnViewManager; +class CXnUiStateListener; +class CHsContentControlFactory; +class MHsContentControlUi; +class CHsCcProviderClient; +class CXnEffectManager; +class MHsContentControl; + +// Constants + +// Class declaration + +/** +* Avkon Adapter for Xuikon +* +* @ingroup group_xnlayoutengine +* @lib xn3layoutengine.lib +* @since Series 60 3.1 +*/ +NONSHARABLE_CLASS( CXnAppUiAdapterImpl ) : public CBase + { +public: + // Constructors and destructor + + /** + * Second-phase constructor + * + * @since Series 60 3.1 + * @param aApplicationUid App Id + * @param aAdapter An AppUi adapter + */ + static CXnAppUiAdapterImpl* NewL( TUid aApplicationUid, + CXnAppUiAdapter& aAdapter ); + + /** + * Second-phase constructor + * + * @since S60 5.0 + */ + void ConstructL(); + + /** + * Destructor. + */ + ~CXnAppUiAdapterImpl(); + +public: + // New functions + + /** + * Get the UI engine + * + * @since Series 60 3.1 + * @return UI engine + */ + CXnUiEngine& UiEngine() const; + + /** + * Get the View manager + * + * @since S60 5.0 + * @return ViewManager + */ + CXnViewManager& ViewManager() const; + + /** + * Get the View adapter + * + * @since S60 5.0 + * @return ViewAdapter + */ + CXnViewAdapter& ViewAdapter() const; + + /** + * Get the UI state listener + * + * @since S60 5.0 + * @return UiStateListener + */ + CXnUiStateListener& UiStateListener() const; + + /** + * Gets the Content control UI interface + * + * @since S60 5.0 + * @param aType Content control UI type + * @return Content control UI interface, NULL if not present + */ + MHsContentControlUi* HsContentController( const TDesC8& aType ) const; + + /** + * Get the effect manager + * + * @since S60 5.0 + * @return Effect manager + */ + CXnEffectManager* EffectManager() const; + + /** + * Gets the Content control server interface + * + * @since S60 5.0 + * @return Content control server interface, NULL if not present + */ + MHsContentControl* HsContentControlSrv() const; + + /** + * Reload the UI after application root configuration is changed + * + * @since S60 5.0 + */ + void ReloadUiL(); + + /** + * Handles a change to the control's resources of type aType + * + * @since Series 60 3.1 + * @param aType Changed resource type + */ + void HandleResourceChangeL( TInt aType ); + +private: + + /** + * C++ default constructor. + */ + CXnAppUiAdapterImpl( TUid aApplicationUid, + CXnAppUiAdapter& aAdapter ); + +private: + // Data + /** AppUi, Not owned. */ + CXnAppUiAdapter& iAdapter; + /** Application uid */ + TUid iApplicationUid; + /** UiEngine, Owned */ + CXnUiEngine* iUiEngine; + /** View Adapter, Owned */ + CXnViewAdapter* iViewAdapter; + /** View Manager, Owned */ + CXnViewManager* iViewManager; + /** UI State listener, Owned */ + CXnUiStateListener* iUiStateListener; + /** Content control factory, Owned */ + CHsContentControlFactory* iContentControlFactory; + /** Content control provider client, Owned */ + CHsCcProviderClient* iCcProviderClient; + /** Effect manager, Owned */ + CXnEffectManager* iEffectManager; + /** Resource offset */ + TInt iResourceOffset; + }; + +#endif // XNAPPUIADAPTERIMPL_H + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnbgcontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnbgcontrol.h Thu Dec 17 08:40:49 2009 +0200 @@ -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: Background appearance drawer +* +*/ + + +#ifndef _XNBGCONTROL_H +#define _XNBGCONTROL_H + +// System includes +#include <e32base.h> +#include <coecntrl.h> + +// User includes + +// Forward declarations +class CAknsLayeredBackgroundControlContext; + +/** + * Background appearance drawer + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CXnBgControl ) : public CCoeControl + { +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 ); + +private: + // data + + /** Background control context, Owned */ + CAknsLayeredBackgroundControlContext* iBgContext; + /** Compound Control, Not owned */ + CCoeControl* iControl; + }; + +#endif // _XNBGCONTROL_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xncomposer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xncomposer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,155 @@ +/* +* 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: Composer header +* +*/ + + +#ifndef __XNCOMPOSER_H__ +#define __XNCOMPOSER_H__ + +// System includes +#include <e32base.h> +#include <f32file.h> + +// User includes +#include "hspswrapper.h" +#include "hspssapi.h" + +// Forward declarations +class CXnODT; +class CXnDomNode; +class CXnViewManager; +class CXnRootData; +class CXnViewData; +class CXnPluginData; + +using namespace hspswrapper; + +/** + * This class loads views and plugins defined in HSPS, to the DOM tree. + * The feature of this class is to load views',and plugin's data from + * storage. + * + * The class supports multiple views. It is mandatory to call one of methods, + * described below when a plugin/view is added to the Homscreen, + * or the Homescreen is being constructed. + * + * As the first ComposeInitialViewL function should be run. + * It loads the first view and its plugins(via ComposeViewL and + * ComposePluginL). ComposeViewL should be called when a view, and its + * plugins, is composed. ComposePluginL should be called always when a plugin + * is added to the view. + * + * @ingroup group_xnlayoutengine + * Composer Implementation + * @lib xn3layoutengine.lib + * @since Series 60 5.0 + */ +NONSHARABLE_CLASS( CXnComposer ) : public CBase + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + * + * @param aUiEngineImpl Provides plugin resources store + * @return Property list object. + */ + static CXnComposer* NewL( CHspsWrapper& aWrapper ); + + /** + * Destructor. + */ + ~CXnComposer(); + +protected: + + /** + * C++ default constructor. + */ + CXnComposer( CHspsWrapper& aWrapper ); + + /** + * Two-phased constructor. + * + * @param aComparator Propety comparator. + */ + void ConstructL(); + +public: + // new functions + + /** + * Composes application root configuration. + * + * @param aRootData Application root data. + * @return ODT tree, ownership is granted to caller. NULL if failed. + */ + CXnODT* ComposeRootL( CXnRootData& aRootData ); + + /** + * Composes a view. + * + * @param aViewData View data for the composed view. + * @return KErrNone if succesful, error otherwise + */ + TInt ComposeViewL( CXnViewData& aViewData ); + + /** + * Composes a widget. + * + * @param aPluginData Plugin data for the composed widget. + * @return KErrNone if succesful, error otherwise + */ + TInt ComposeWidgetL( CXnPluginData& aPluginData ); + +private: + // new functions + + CXnDomNode* GetOdtL( const CObjectMap& aObject, + CXnPluginData& aPluginData ); + + /** + * Finds an object from the provided array. + * + * @param aResourceObjects An array of objects. + * @param aTag A tag of an object to be found. + * @return Object instance if succesful, NULL otherwise + */ + const CObjectMap* FindObject( + RPointerArray<CObjectMap>& aResourceObjects, + const TDesC8& aTag ) const; + +private: + // Data + + /** + * HSPS Wrapper, not owned + */ + CHspsWrapper& iWrapper; + + /* + * ODT, not owned + */ + CXnODT* iODT; + + /** + * Handle to file server session, owned + */ + RFs iFs; + }; + +#endif // __XNCOMPOSER_H__ diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xncontroladapterimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xncontroladapterimpl.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,561 @@ +/* +* 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: Xuikon control adapter header file +* +*/ + + +#ifndef __XNCONTROLADAPTERIMPL_H__ +#define __XNCONTROLADAPTERIMPL_H__ + +// System includes +#include <e32base.h> +#include <coecntrl.h> +#include <AknIconUtils.h> +#include <AknsEffectAnim.h> +#include <AknsItemID.h> + +// User includes +#include "xngesturehelper.h" + +// Forward declarations +class CXnNodePluginIf; +class CXnComponent; +class CWindowGc; +class CXnControlAdapter; +class CXnNode; +class CXnProperty; +class CGulIcon; +class CXnUiEngine; + +//Constants +_LIT( KMif, "mif(" ); +_LIT8( KMenuBarNode, "menubar" ); +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; + + +// Class declaration + +/** +* Control adapter class implementation. +* +* @ingroup group_xnlayoutengine +* @lib xn3layoutengine.lib +* @since Series 60 3.1 +*/ +NONSHARABLE_CLASS( CXnControlAdapterImpl ) : public CBase, + public MAknsEffectAnimObserver + { +public: + + /** + * Response of property change handled/not handled + */ + enum TPropertyChangeResponse + { + /** The property change was not handled. */ + EPropertyChangeNotConsumed, + /** The property change was handled. */ + EPropertyChangeConsumed + }; + +public: + + /** + * Icon provider used by AknIconUtils + * + * @since Series 60 3.1 + */ + class TIconProvider : public MAknIconFileProvider + { + public: + /** + * Constructor + * + * @param aFile File handle to use + */ + TIconProvider( RFile& aFile ); + + public: + + /** + * Destructor. + */ + virtual ~TIconProvider(); + + // Functions from base classes + /** + * From MAknIconFileProvider Returns an open file handle to the icon + * file. + * This method should leave if an icon file with specified type does + * not exist. That may be the case e.g. with MBM file, + * if there are no bitmap icons. + * + * Note! RFs::ShareProtected must be called to the RFs instance used + * for opening the file. + * + * @param aFile Icon file should be opened in this file handle, which + * is an empty file handle, when the AknIcon framework calls this + * method. The AknIcon framework takes care of closing the file handle + * after having used it. + * + * @param aType Icon file type. + */ + virtual void RetrieveIconFileHandleL( RFile& aFile, + const TIconFileType /*aType*/); + + /** + * From MAknIconFileProvider With this method, AknIcon framework + * informs that it does not use this MAknIconFileProvider instance + * any more. After this call, + * it is ok to delete the object. This can be implemented simply + * e.g. by deleting self in this callback. + * Normally, this callback is invoked when the icon in question + * is deleted. + * Note, however, that if the same MAknIconFileProvider instance is + * supplied in multiple CreateIcon calls, then it must be accessible + * by AknIcon framework until it has signalled a matching amount + * of these callbacks. + */ + virtual void Finished(); + + private: + + // file to use + RFile iFile; + }; + +public: + // Constructors and destructor + + /** + * Two-phased constructor. + * + * @param aNode + * @param aDadapter Control adapter + * @param gc Window gc + */ + static CXnControlAdapterImpl* NewL( CXnNodePluginIf& aNode, + CXnControlAdapter& aAdapter, CWindowGc& gc ); + + /** + * Destructor. + */ + virtual ~CXnControlAdapterImpl(); + +public: + // New functions + + /** + * Sets component pointer. + * + * @since Series 60 3.1 + * @param aComponent Component pointer. + */ + void SetComponent( CXnComponent* aComponent ); + + /** + * Gets the component pointer. + * + * @since Series 60 3.1 + * @return Component pointer. + */ + CXnComponent* Component(); + + /** + * Const-version of getting the component pointer. + * + * @since Series 60 3.1 + * @return Component pointer. + */ + CXnComponent* Component() const; + + /** + * Add a child adapter + * + * @since Series 60 3.1 + * @param aChild Child adapter + */ + void AppendChildL(CXnControlAdapter& aChild, CXnNode& aNode); + + /** + * Checks if the control should be drawn, according to visibility and + * display properties. + * + * @since Series 60 3.1 + * @return ETrue if drawing is ok, EFalse otherwise + */ + TBool IsDrawingAllowed() const; + + /** + * Gets content bitmaps. Ownership is not transferred. + * + * @since Series 60 3.1 + * @param aBitmap Bitmap to draw + * @param aMask Mask to use + */ + void ContentBitmaps( CFbsBitmap*& aBitmap, CFbsBitmap*& aMask ); + + /** + * Sets content bitmaps. Ownership is transferred. + * + * @since Series 60 3.1 + * @param aBitmap Bitmap to draw + * @param aMask Mask to use + */ + void SetContentBitmaps( CFbsBitmap* aBitmap, CFbsBitmap* aMask ); + + /** + * Sets content bitmaps. Ownership is transferred. + * + * @since Series 60 3.1 + * @param aBitmapUrl Url of the bitmap to draw + * @param aMaskUrl Url of the bitmap mask to use + */ + void SetContentBitmapsL( const TDesC& aBitmapUrl, const TDesC& aMaskUrl ); + + /** + * Load a bitmap from the server. Ownership is transferred. + * + * @since Series 60 3.1 + * @param aBitmapUrl Url of the bitmap to load + * @return Bitmap + */ + CFbsBitmap* LoadBitmap( const TDesC& aBitmapUrl ); + + /** + * Load a bitmap and mask from the server. Ownership is transferred. + * + * @since Series 60 3.1 + * @param aBitmapUrl Url of the bitmap to load + * @param aMaskUrl Url of the mask to load, if any + * @param aBitmap Fetched bitmap + * @param aMask Fetched mask + * @return void + */ + void GetBitmapAndMask( const TDesC& aBitmapUrl, const TDesC& aMaskUrl, + CFbsBitmap*& aBitmap, CFbsBitmap*& aMask ); + + /** + * Handles pointer events + * This method must always be called, even when it's overridden by derived + * classes + * + * @param aPointerEvent pointer event + */ + TBool HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + /** + * Draws the control + * This method must always be called, even when it's overridden by derived + * classes + * + * @param aRect TRect to draw + */ + void Draw( const TRect& aRect ) const; + + /** + * Draws the control using a client-specified gc. + * + * @param aRect TRect to draw + * @param aGc Gc used for drawing + */ + void Draw( const TRect& aRect, CWindowGc& aGc ) const; + + /** + * Return a child control by index + * This method must not be overridden by derived classes + * + * @param aIndex Index of the child to return + * @return Control at the given index + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * From CCoeControl Return count of children + * This method must not be overridden by derived classes + * + * @return Count of children + */ + TInt CountComponentControls() const; + + /** + * Draws content image. + * + * @since Series 60 3.1 + */ + void DrawContentImage() const; + + /** + * Draws content image. + * + * @param aGc Gc used for drawing + * @since Series 60 3.1 + */ + void DrawContentImageL( CWindowGc& aGc ) const; + + /** + * Size change notification + */ + void SizeChanged(); + + /** + * Skin change notification + */ + void SkinChanged(); + + /** + * Focus changed notification + * + * @since S60 5.0 + * @param aFocused Control's current foucs state + */ + void FocusChangedL( TBool aFocused ); + + /** + * Initialize or refresh background and border bitmaps + * This is called when for example the skin or control size is changed + */ + void InitializeBackgroundAndBorderBitmapsL(); + + /** + * This is called to measure adaptive content dimensions. + * + * @since 3.2 + * @param aAvailableSize Not used + * @return For now it returns default size - zero + */ + TSize MeasureAdaptiveContentL( const TSize& aAvailableSize ); + + /** + * Sets the control blank + * + * @since S60 5.1 + * @param aBlank, ETrue sets blank, EFalse resets blank + */ + void SetBlank( TBool aBlank ); + + /** + * Creates trigger node for swipe event + * + * @since S60 5.1 + * @param aUiEngine reference to uiengine + * @param aDirection Direction of swipe + * @return trigger node for swipe + */ + CXnNode* BuildSwipeTriggerNodeLC( CXnUiEngine& aUiEngine, + const TDesC8& aDirection ); + +public: + // Functions from base classes + + /** + * From CCoeControl Handles key events. + * + * @since Series 60 3.1 + * @param aKeyEvent Key event. + * @param aType Event type. + * @return Key response + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * From MAknLongTapDetectorCallBack. Handles the long tap events. + * + * @since Series 60 3.1 + * @param aPenEventLocation Long tap event location relative to parent + * control. + * @param aPenEventScreenLocation Long tap event location relative to + * screen. + */ + void HandleLongTapEventL( const TPoint& aPenEventLocation, + const TPoint& aPenEventScreenLocation ); + + /** + * Creates highlight animation from a skin id when one is available. + */ + void CreateAnimationL(); + + /** + * MAknsEffectAnimObserver callback. Draws the adapter again and renders + * the animated area. + * + * @param aError Error - zero if error, nonzero otherwise + */ + virtual void AnimFrameReady( TInt aError, TInt ); + + /** + * Starts highlight animation. + * + * @param aAnimRestart When true, the animation is stopped and then + * started again. + */ + void StartHighlightAnimation( TBool aAnimRestart = EFalse ); + + /** + * Stops highlight animation. + */ + void StopHighlightAnimation(); + + /** + * Handles property change + */ + void DoHandlePropertyChangeL( CXnProperty* aProperty = NULL ); + + /** + * Handles change of device screen + */ + void HandleScreenDeviceChangedL(); + + /** + * Updates background image + * + * @param aProperty If it is background image, initializes background + * bitmap + * @return CXnControlAdapterImpl::TPropertyChangeResponse whether it was + * consumed + */ + CXnControlAdapterImpl::TPropertyChangeResponse UpdateBackgroundImageL( + CXnProperty* aProperty ); + + /** + * Forwards event to gesture helper + * + * @param aPointerEvent Event to be forwarded + * @return ETrue when swipe took place, EFalse otherwise + */ + TBool PassEventToGestureHelperL( + const TPointerEvent& aPointerEvent ); + + /* + * Resets child adapters + */ + void RemoveChildAdapters(); + + /* + * Returns Child adapters + * + * @return Returns child adapters + */ + RPointerArray< CXnControlAdapter >& ChildAdapters(); + +protected: + // New functions + + /** + * C++ default constructor. + */ + CXnControlAdapterImpl( CXnNodePluginIf& aNode ); + + /** + * Two-phased constructor. + */ + void ConstructL( CXnNodePluginIf& aNode, CXnControlAdapter& aAdapter, + CWindowGc& gc ); + +private: + void DoDrawL( const TRect& aRect, CWindowGc& aGc ) const; + void DrawBackgroundDataL( const TRect& aRect, CXnNode& aNode, + CWindowGc& aGc ); + void DrawEditModeBgData( CXnNode& aNode, CWindowGc& aGc ); + void DrawTransparentColorL( CXnNode& aNode, CWindowGc& aGc, + CFbsBitmap* aMask ); + void DrawBackgroundSkinL( CXnNode& aNode, CFbsBitmap* aMask, + CWindowGc& aGc,CXnProperty* aBgColor, TRect aRect = TRect::EUninitialized ); + void DrawBackgroundSkin(const TAknsItemID& aSkinId, CWindowGc& aGc, + TRect aRect ); + void DrawBackgroundImageL( const TRect& aRect, CXnNode& aNode, + CWindowGc& aGc, CFbsBitmap* aBitmap, CFbsBitmap* aMask ); + RFs& FsSession(); + +private: + // Data + + /** Node */ + CXnNodePluginIf& iNode; + /** Pointer to component base object. */ + CXnComponent* iComponent; + /** child controls */ + mutable RPointerArray< CXnControlAdapter > iChildren; + /** content image */ + mutable CFbsBitmap* iContentBitmap; + /** content bitmap index */ + mutable TInt iContentBitmapIndex; + /** content mask */ + mutable CFbsBitmap* iContentMask; + /** content mask index */ + mutable TInt iContentMaskIndex; + /** background image */ + mutable CFbsBitmap* iBackgroundBitmap; + /** background mask */ + mutable CFbsBitmap* iBackgroundMask; + /** background image index */ + mutable TInt iBackgroundBitmapIndex; + /** border image */ + mutable CFbsBitmap* iBorderBitmap; + /** border image index */ + mutable TInt iBorderBitmapIndex; + /** border image split value for top border */ + mutable TInt iBorderBitmapDividerTop; + /** border image split value for right border */ + mutable TInt iBorderBitmapDividerRight; + /** border image split value for bottom border */ + mutable TInt iBorderBitmapDividerBottom; + /** border image split value for left border */ + mutable TInt iBorderBitmapDividerLeft; + /** graphics context */ + mutable CWindowGc* iGc; + /** control adapter */ + mutable CXnControlAdapter* iAdapter; + /** icon provider, for AknIconUtils */ + mutable TIconProvider* iIconProvider; + /** scaled content image */ + mutable CFbsBitmap* iScaledContentBitmap; + /** scaled content mask */ + mutable CFbsBitmap* iScaledContentMask; + /** scaled transparent color */ + mutable CGulIcon* iScaledTransparentColor; + /** scaled background skin */ + mutable CGulIcon* iScaledBackgroundSkin; + /** scaled background image */ + mutable CFbsBitmap* iScaledBackgroundImage; + /** skin animation object for skin highlight animation */ + CAknsEffectAnim* iAnimation; + /** skin animation identifier */ + 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; + }; + +#endif //__XNCONTROLADAPTERIMPL_H__ diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xneditor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xneditor.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,301 @@ +/* +* 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: Manages Ai3 personalization +* +*/ + + +#ifndef C_XNEDITOR_H +#define C_XNEDITOR_H + +// System includes +#include <e32base.h> +#include <badesca.h> +#include <hscontentcontroller.h> +#include <hscontentinfo.h> +#include <hscontentinfoarray.h> +#include <AknsSrvClient.h> + +// User includes +#include "hspswrapper.h" +#include "cpswrapper.h" +#include "xnviewmanager.h" + +// Forward declarations +class CXnNode; +class CAknListQueryDialog; +class CXnViewManager; +class CXnViewData; + +namespace hspswrapper + { + class CPropertyMap; + class CAddPluginResult; + class MHspsWrapperObserver; + } + +namespace cpswrapper + { + class CCpsWrapper; + class CPublisherMap; + class CPublisherInfo; + class MCpsWrapperObserver; + } + +using namespace hspswrapper; +using namespace cpswrapper; + +// Class declaration + +/** + * Editor handles ai3 personalization + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CXnEditor ) : public CBase, + public MXnViewObserver, + public MCpsWrapperObserver, + public MHspsWrapperObserver, + public MHsContentController + { +public: + //constructors and destructor + + /** + * Two-phased constructor. + * + * @param aViewManager View manager + * @param aWrapper HSPS wrapper + */ + static CXnEditor* NewL( CXnViewManager& aViewManager, + const TDesC8& aUid ); + + /** + * Two-phased constructor. + * + * @param aViewManager View manager + * @param aWrapper HSPS wrapper + */ + static CXnEditor* NewLC( CXnViewManager& aViewManager, + const TDesC8& aUid ); + + /** + * Destructor. + */ + ~CXnEditor(); + +public: + // new functions + + /** + * Remove uregistered widget from all the views. + * + * @since S60 5.0 + * @param aPublisher publisher + */ + void RemoveUnRegisteredWidgetL( const TDesC& aPublisher ); + + /** + * Removes uninstalled widget from all views + * + * @since S60 5.0 + * @param aContentInfo content info + */ + void RemoveUnInstalledWidgetL( const CHsContentInfo& aContentInfo ); + + /** + * Runs add widget list query + * + * @since S60 5.0 + */ + void AddWidgetL(); + + /** + * Remove widget from current view. + * + * @since S60 5.0 + * @param aNode Plugin (or its child) where to remove widget. + */ + void RemoveWidgetL( CXnNode* aNode ); + + /** + * Replaces widget configuration to HSPS + * + * @since S60 5.0 + * @param aContentInfo content info + */ + void ReplaceWidgetL( CHsContentInfo& aContentInfo, TBool aUseHsps = ETrue ); + /** + * Commit a new order of plugins to the HSPS. + * + * @since S60 5.0 + * @param aPluginArray Array of plugins + */ + void ReorderWidgetsL( RPointerArray< CXnNode >* aPluginArray ); + + /** + * Toggles widgets' visibility + * + * @since S60 5.0 + * @return Current widgets' visibility state + */ + TBool ToggleWidgetsVisibiltyL(); + + /** + * Queries wheter the widgets are visible or not + * + * @since S60 5.0 + * @return ETrue if widgets are now visible, EFalse otherwise + */ + TBool WidgetsVisible() const; + + /** + * Sets target plugin for add/remove + * + * @since S60 5.0 + * @param aNode a plugin node to be set as target for add/remove action + */ + void SetTargetPlugin( CXnNode* aNode ); + + /** + * Handles changing of wallpaper + * + * @since S60 5.0 + */ + void SetWallpaperL(); + + /** + * Returns the HSPS Wrapper object owned by this. + * + * @since S60 5.0 + * @return HSPSWrapper + */ + CHspsWrapper& HspsWrapper() const; + +private: + // from MHsContentController + + TInt WidgetListL( CHsContentInfoArray& aArray ); + + TInt ViewListL( CHsContentInfoArray& aArray ); + + TInt AppListL( CHsContentInfoArray& aArray ); + + TInt AddWidgetL( CHsContentInfo& aInfo ); + + TInt RemoveWidgetL( CHsContentInfo& aInfo ); + + TInt AddViewL( CHsContentInfo& aInfo ); + + TInt RemoveViewL( CHsContentInfo& aInfo ); + + TInt ActivateViewL( CHsContentInfo& aInfo ); + + TInt ActivateAppL( CHsContentInfo& aInfo ); + +private: + // constructors + + /** + * C++ constructor + */ + CXnEditor( CXnViewManager& aViewManager ); + + /** + * Leaving constructor + */ + void ConstructL( const TDesC8& aUid ); + +private: + // new functions + + void TemplatedWidgetsL( RPointerArray< CHsContentInfo >& aWidgets ); + + void HSPSPluginsL( RPointerArray< CHsContentInfo >& aWidgets, + const TDesC8& aType ); + + CPublisherInfo* PublisherInfoL( const CHsContentInfo& aContentInfo ); + + TInt TemplateWidgetCanBeAddedRemovedL( CHsContentInfo& aContentInfo ); + TInt NonTemplateWidgetCanBeAddedRemovedL( CHsContentInfo& aContentInfo ); + + TBool IsCurrentViewFull(); + void FilterWidgetListL( CHsContentInfoArray& aContentInfoArray, + TBool aIgnoreViewFull ); + void FilterViewListL( CHsContentInfoArray& aContentInfoArray ); + + /** + * Notifies the MHsContentControl and the MHsContentControlUi if widget list was changed. + */ + void WidgetListChanged(); + + /** + * Notifies the MHsContentControl and the MHsContentControlUi if view list was changed. + */ + void ViewListChanged(); + +private: + // from MXnViewObserver + + void NotifyViewActivatedL( const CXnViewData& aViewData ); + + void NotifyViewDeactivatedL( const CXnViewData& /*aViewData*/ ); + + void NotifyConfigureWidgetL( const CHsContentInfo& aContentInfo, + CXnPluginData& aPluginData ); + + void NotifyWidgetAdditionL( const CXnPluginData& aPluginData ); + + void NotifyWidgetRemovalL( const CXnPluginData& aPluginData ); + + void NotifyViewAdditionL( const CXnPluginData& /*aPluginData*/ ); + + void NotifyViewRemovalL( const CXnPluginData& /*aPluginData*/ ); + +private: + // from MCpsWrapperObserver + + void NotifyWidgetUnregisteredL( const TDesC& aPublisher ); + + void NotifyWidgetRegisteredL(); + +private: + // from MHspsWrapperObserver + + TInt HandleNotifyL( const TDesC8& aEvent, const TDesC8& aAppConfUid, + const TDesC8& aPluginName, const TDesC8& aOrigUid, + const TDesC8& aPluginUid, const TDesC8& aPluginId ); + +private: + // data + + /** View manager, not owned */ + CXnViewManager& iViewManager; + /** HSPS wrapper, owned */ + CHspsWrapper* iHspsWrapper; + /** CPS wrapper, owned */ + CCpsWrapper* iCpsWrapper; + /** Publisher map, owned */ + CPublisherMap* iPublisherMap; + /** Add widget listquery, not owned */ + CAknListQueryDialog* iQuery; + /** Target plugin for add/remove, not owned */ + CXnNode* iTargetPlugin; + /** Widgets visibility state */ + TBool iWidgetsVisibilityState; + }; + +#endif // C_XNEDITOR_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xneffectmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xneffectmanager.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,139 @@ +/* +* 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: Effect manager. +* +*/ + + + +#ifndef CXNEFFECTMANAGER_H +#define CXNEFFECTMANAGER_H + +// INCLUDES +#include <e32base.h> + +// CLASS DECLARATION +class CXnPluginData; +class CXnViewData; +class CXnNode; + +/** + * Struct which holds needed info of effect. + */ +NONSHARABLE_STRUCT( TXnEffect ) + { + CXnNode* iNode; + TInt iState; + TInt iType; + TInt iId; + }; + +/** + * Effect manager. + * Handles starting and ending effects. + * + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CXnEffectManager ) : public CBase + { +public: + /** + * Two-phased constructor. + * @return new instance of CXnEffectManager. + */ + static CXnEffectManager* NewL(); + + /** + * 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<CXnPluginData>& aPlugins ); + + /** + * Begin handling of fullscreen effect. + * @param aId effect id + * @aView view data + */ + void BeginFullscreenEffectL( TInt aId, CXnViewData& aView ); + + /** + * When UiRendered is called effect is ended and will be drawn + */ + void UiRendered(); + + /** + * When UiLayouted is called effect is started if it was not started earlier. + */ + void UiLayouted(); + +private: + /** + * Starts fullscreen effect. + * @param aEffect effect data + */ + void DoBeginFullscreenEffect( TXnEffect& aEffect ); + + /** + * Starts control effect. + * @param aEffect effect data + */ + void DoBeginControlEffect( TXnEffect& aEffect ); + + /** + * Removes and destroys effect from effect list. + * @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 ); + + /** + * C++ default constructor. + */ + CXnEffectManager(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + +private: // data + /** + * List of started effects. + */ + RPointerArray<TXnEffect> iEffects; + }; + +#endif // CXNEFFECTMANAGER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnextrenderingpluginwrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnextrenderingpluginwrapper.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,113 @@ +/* +* 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: External rendering plugin wrapper header +* +*/ + +#ifndef XNEXTRENDERINGPLUGINWRAPPER_H +#define XNEXTRENDERINGPLUGINWRAPPER_H + +// System includes +#include <e32base.h> +#include <xnextrenderingpluginadapter.h> + +// User includes +#include "xncontroladapter.h" +#include "xnproperty.h" +#include "xncomponent.h" +#include "xnnodepluginif.h" + +/** + * CXnExtRenderingPluginWrapper class + * + * + * @code + * + * @endcode + * + * @lib extrenderingplugin.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CXnExtRenderingPluginWrapper ) : public CXnControlAdapter + { +public: // Constructor and destructor + /** + * Two-phased constructor. + */ + static CXnExtRenderingPluginWrapper* NewL( + CXnNodePluginIf& aNode, CXnExtRenderingPluginAdapter& aAdapter ); + + /** + * Destructor. + */ + virtual ~CXnExtRenderingPluginWrapper(); + +private: // Constructors + /** + * Constructor + */ + CXnExtRenderingPluginWrapper( CXnExtRenderingPluginAdapter& aAdapter ); + + /** + * Second phase constructor + */ + void ConstructL( CXnNodePluginIf& aNode ); + +private: + TInt CountComponentControls() const; + + CCoeControl* ComponentControl(TInt aIndex) const; + + void HandleScreenDeviceChangedL(); + + void MakeVisible(TBool aVisible); + + void FocusChanged(TDrawNow aDrawNow); + + void SetContainerWindowL(const CCoeControl& aContainer); + + void SkinChanged(); + + void SizeChanged(); + + TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); + +public: // New functions + + /** + * @see CXnControlAdapter + */ + void DoEnterPowerSaveModeL( TModeEvent aEvent ); + + /** + * @see CXnControlAdapter + */ + void DoExitPowerSaveModeL( TModeEvent aEvent ); + +private: // Data + + /** + * Rendering plugin adapter. Own. + */ + CXnExtRenderingPluginAdapter* iAdapter; + + /** + * Node. Not own. + */ + CXnNodePluginIf* iNode; + }; + +#endif // XNEXTRENDERINGPLUGINFACTORY_H + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnfocuscontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnfocuscontrol.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,127 @@ +/* +* 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: Focus appearance drawer +* +*/ + + +#ifndef _XNFOCUSCONTROL_H +#define _XNFOCUSCONTROL_H + +// System includes +#include <e32base.h> + +// User includes +#include "xninactivitymonitor.h" + +// Forward declarations +class CXnAppUiAdapter; +class CWindowGc; + +/** + * Focus appearance drawer + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CXnFocusControl ) : public CBase, + public MXnInactivityObserver + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnFocusControl* NewL( CXnAppUiAdapter& aAppUiAdapter ); + + /** + * Two-phased constructor. Leaving on stack + */ + static CXnFocusControl* NewLC( CXnAppUiAdapter& aAppUiAdapter ); + + /** + * Destructor + */ + ~CXnFocusControl(); + +private: + // private constructors + + /** + * Leaving constructor + */ + void ConstructL(); + + /** + * C++ default constructor + */ + CXnFocusControl( CXnAppUiAdapter& aAppUiAdapter ); + +private: + // from MXnInactivityObserver + + /** + * @see MXnInactivityObserver + */ + void InactivityTimerExpired(); + +public: + // new functions + + /** + * Makes focus viisble + * + * @since S60 5.0 + * @param aVisible, ETrue visible, EFalse invisible + */ + void MakeVisible( TBool aVisible ); + + /** + * Queries whether focus is visible + * + * @since S60 5.0 + * @return ETrue if focus visible, EFalse otherwise + */ + TBool IsVisible() const; + + /** + * Draws the 1st state and 2nd state focus appearenace + * + * @since S60 5.0 + * @param aRect Rect where to draw + * @param aGc Context + */ + void Draw( const TRect& aRect, CWindowGc& aGc ) const; + +private: + // new functions + + void DoMakeVisibleL( TBool aVisible ); + +private: + // data + + /** 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 */ + TBool iRefused; + }; + +#endif // _XNFOCUSCONTROL_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xngesture.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xngesture.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,367 @@ +/* +* 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 <e32base.h> + +// 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 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xngesture.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xngesture.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,68 @@ +/* +* 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 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xngesturedefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xngesturedefs.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,97 @@ +/* +* 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 <e32std.h> + +/** + * 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 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xngesturehelper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xngesturehelper.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,185 @@ +/* +* 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 <e32base.h> + +// 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 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xngesturerecogniser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xngesturerecogniser.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,110 @@ +/* +* 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 <e32std.h> + + +/** + * 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 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnhittest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnhittest.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,176 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class to hold hit region information +* +*/ + + +#ifndef _XNHITTEST_H +#define _XNHITTEST_H + +// System includes +#include <e32base.h> +#include <coemain.h> + +// 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 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xninactivitymonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xninactivitymonitor.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,115 @@ +/* +* 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: Inactivity monitor +* +*/ + + +#ifndef _NXINACTIVITYMONITOR_H +#define _NXINACTIVITYMONITOR_H + +// System includes +#include <e32base.h> + +// User includes + +// Forward declarations + +/** + * User inactivity observer + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( MXnInactivityObserver ) + { +public: + /** + * Notifies inactivity timer is expired + * + * @since S60 5.0 + */ + virtual void InactivityTimerExpired() = 0; + }; + +/** + * User inactivity monitor + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CXnInactivityMonitor ) : public CTimer + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnInactivityMonitor* NewL( MXnInactivityObserver& aObserver ); + + /** + * Two-phased constructor. Leaving on stack + */ + static CXnInactivityMonitor* NewLC( MXnInactivityObserver& aObserver ); + + /** + * Destructor + */ + ~CXnInactivityMonitor(); + +private: + // private constructors + + /** + * Leaving constructor + */ + void ConstructL(); + + /** + * C++ default constructor + */ + CXnInactivityMonitor( MXnInactivityObserver& aObserver ); + +private: + // from CTimer + + void RunL(); + +public: + // new functions + + /** + * Starts inactivity monitoring + * + * @since S60 5.0 + */ + void Start(); + + /** + * Stops inactivity monitoring + * + * @since S60 5.0 + */ + void Stop(); + +private: + // data + /** Inactivity observer, Not owned */ + MXnInactivityObserver& iObserver; + }; + +#endif // _NXINACTIVITYMONITOR_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnkeyeventdispatcher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnkeyeventdispatcher.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,228 @@ +/* +* 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: Key event dispatcher header +* +*/ + + +#ifndef __XNKEYEVENTDISPATCHER_H__ +#define __XNKEYEVENTDISPATCHER_H__ + +// System includes +#include <e32base.h> +#include <coecntrl.h> +#include <eikmobs.h> + +// Uder includes +#include "xnviewmanager.h" + +// Forward declarations +class CXnNode; +class CXnUiEngine; +class CEikButtonGroupContainer; +class CXnViewData; +class CXnPluginData; + +// Class declaration + +/** + * Control adapter class implementation. + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since Series 60 3.1 + */ +NONSHARABLE_CLASS( CXnKeyEventDispatcher ) : public CCoeControl, + public MCoeMessageMonitorObserver, + public MXnViewObserver + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnKeyEventDispatcher* NewL( CXnUiEngine& aUiEngine ); + + /** + * Destructor. + */ + ~CXnKeyEventDispatcher(); + +private: + // From CCoeControl + + /** + * @see CCoeControl + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + +private: + // from MCoeMessageMonitorObserver + + /** + * @see MCoeMessageMonitorObserver + */ + void MonitorWsMessage( const TWsEvent& aEvent ); + +public: + // New functions + + /** + * Set the node to which key events are given + * + * @since Series 60 3.1 + * @param aNode Node to set + * @param aSource A source of event that triggered focus change. + */ + void SetNodeL( CXnNode* aNode, TInt aSource = 0 ); + + /** + * Set the node to which key events are given, but do not notify. + * + * @since Series 60 3.1 + * @param aNode Node to set + */ + void SetNodeWithoutNotificationL( CXnNode* aNode ); + + /** + * Get the node to which holds focus + * + * @since Series 60 3.1 + * @return Focused node, NULL if no focus. + */ + CXnNode* FocusedNode() const; + + /** + * Set the node to which menu events are given + * + * @since Series 60 3.1 + * @param aNode Node to set + */ + void SetMenuNodeL( CXnNode* aNode ); + + /** + * Removes the node to which menu events are given + * + * @since Series 60 3.2 + */ + void ResetMenuNodeL(); + + /** + * Refresh current menu + * + * @since Series 60 3.1 + */ + void RefreshMenuL(); + + /** + * Checks whether the menu is focused. + * + * @since S60 3.1 + * @return ETrue if menu is focused. + */ + TBool IsMenuFocused() const; + + /** + * Set node as passive, and add it to the passive focused node array. + * + * @since Series 60 3.2 + * @param aNode Node to use. + */ + void AddPassiveFocusedNodeL( CXnNode* aNode ); + + /** + * Unset the passive focus from the node, and remove it from the passive + * focused node array. + * + * @since Series 60 3.2 + * @param aNode Node to use. + */ + void RemovePassiveFocusedNodeL( CXnNode* aNode ); + + /** + * Clear the passive focused node array, and unset the passive focus + * states. + * + * @since Series 60 3.2 + */ + void ClearPassiveFocusedNodesL(); + +private: + // new functions + + void SetNodeL( CXnNode* aToLose, CXnNode* aToGain, TBool aNotify, + TInt aSource = 0 ); + + void ResolveAndSetFocusL(); + + void ClearStateL(); + +protected: + // New functions + + /** + * C++ default constructor. + */ + CXnKeyEventDispatcher( CXnUiEngine& aUiEngine ); + + /** + * Two-phased constructor. + */ + void ConstructL(); + +private: + // from MXnViewObserver + + void NotifyViewActivatedL( const CXnViewData& aViewData ); + + void NotifyViewDeactivatedL( const CXnViewData& aViewData ); + + void NotifyConfigureWidgetL( const CHsContentInfo& aContentInfo, + CXnPluginData& aPluginData ); + + void NotifyWidgetAdditionL( const CXnPluginData& aPluginData ); + void NotifyWidgetRemovalL( const CXnPluginData& aPluginData ); + void NotifyViewAdditionL( const CXnPluginData& /*aPluginData*/ ){}; + void NotifyViewRemovalL( const CXnPluginData& /*aPluginData*/ ){}; + +private: + // Data + + /** Reference to uiengine */ + CXnUiEngine& iUiEngine; + /** Losefocus trigger, owned */ + CXnNode* iLoseFocus; + /** Gainfocus trigger, owned */ + CXnNode* iGainFocus; + /** Node that receives key events */ + CXnNode* iNode; + /** Previous key event receiver */ + CXnNode* iPreviousNode; + /** Node that receives menu events */ + CXnNode* iMenuNode; + /** Node that was focused when keyevent started */ + CXnNode* iKeyEventNode; + /** Event code for keyevents */ + TEventCode iEventCode; + /** Focused node is changed during keyevent process */ + TBool iFocusChanged; + /** Command button array for softkeys, not owned */ + CEikButtonGroupContainer* iCbaContainer; + /** For storing the nodes that have passive focus. */ + RPointerArray< CXnNode > iPassiveFocusedNodes; + }; + +#endif //__XNKEYEVENTDISPATCHER_H__ diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnlayoutengine.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnlayoutengine.hrh Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,213 @@ +/* +* 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: Layout file resource header +* +*/ + + +#ifndef XNLAYOUTENGINE_HRH +#define XNLAYOUTENGINE_HRH + +// Data types + +STRUCT LAYOUT + { + STRUCT nodes[]; + } + +STRUCT MAPPINGS + { + STRUCT mappings[]; + } + +/** node type - bitmap,skinbitmap,control */ +STRUCT NODE + { + LONG type; + + // node identification + /** area id */ + LTEXT nodeid; + /** parent area id */ + LTEXT parentnodeid = ""; + /** branch id, used for identifying optional branches */ + LTEXT branchid = ""; + /** 1 or 0, tells whether a branch is enabled */ + LONG enabled = 1; + /** horizontal alignment of the area: 0-100000, 50000 is center */ + LONG horizontalalignment = 0; + /** vertical alignment of the area: 0-100000, 50000 is center */ + LONG verticalalignment = 0; + + /** + * area priority, 0 is "must", consequent values are so that higher + * numbers + * mean higher priority + */ + LONG priority = 0; + + /** + * 1 or 0, tells whether area aspect ratio should be preserved when + * resizing + */ + LONG lockaspectratio = 0; + + // we assume that minimum dimensions are always absolute and always + // in pixels + + /** minimum width in pixels */ + LONG pixelminimumwidth; + /** minimum width in pixels */ + LONG pixelminimumheight; + /** maximum size */ + STRUCT maximumsize; + /** preferred size */ + STRUCT preferredsize; + /** area margins */ + STRUCT margins; + /** include data for included layout file */ + STRUCT include; + /** orientation of child areas */ + STRUCT childorientation; + /** node-specific data, depending on the node type */ + STRUCT nodedata; + } + +/** child area layout is defined as rows x columns */ +STRUCT CHILD_ORIENTATION + { + LONG rows = 0; + LONG columns = 0; + } + +/** margins are assumed absolute and in pixels */ +STRUCT MARGIN + { + LONG left = 0; + LONG right = 0; + LONG top = 0; + LONG bottom = 0; + } + +/** maximum size can be pixels, twips or percentage of parent area */ +STRUCT MAXIMUMSIZE + { + LONG pixelmaximumwidth = 0; + LONG pixelmaximumheight = 0; + + LONG twipmaximumwidth = 0; + LONG twipmaximumheight = 0; + + /** percentage, 0-1000000, 1000000 is 100% */ + LONG relativemaximumwidth = 0; + /** percentage, 0-1000000, 1000000 is 100% */ + LONG relativemaximumheight = 0; + } + +/** preferred size can be pixels, twips or percentage of parent area */ +STRUCT PREFERREDSIZE + { + LONG pixelpreferredwidth = 0; + LONG pixelpreferredheight = 0; + + LONG twippreferredwidth = 0; + LONG twippreferredheight = 0; + + /** percentage, 0-1000000, 1000000 is 100% */ + LONG relativepreferredwidth = 0; + /** percentage, 0-1000000, 1000000 is 100% */ + LONG relativepreferredheight = 0; + } + +/** sub-areas are included from external files by filename */ +STRUCT INCLUDE + { + LTEXT file = ""; + } + +/** bitmap area defines a file name and a bitmap id */ +STRUCT BITMAPAREA + { + /** file name */ + LTEXT file; + + /** + * id is string in order to allow different representations for image data + */ + LTEXT bitmapid; + /** mask file name is optional */ + LTEXT maskfile = ""; + + /** + * mask id is optional. id is string in order to allow different + * representations for image data + */ + LTEXT maskbitmapid = ""; + /** is mask inverted */ + LONG invertmask = 0; + /** is mask enabled */ + LONG enablemask = 0; + } + +/** skin area defines a skin id and a bitmap id */ +STRUCT SKINBITMAPAREA + { + /** skin file id */ + LONG skinfileid; + /** skin bitmap id */ + LONG bitmapid; + /** mask file id */ + LONG maskfileid = 0; + /** mask bitmap id */ + LONG maskbitmapid = 0; + /** is mask inverted */ + LONG invertmask = 0; + /** is mask enabled */ + LONG enablemask = 0; + } + +STRUCT CONTROLAREA + { + /** node UI type, an UID */ + LONG uitype; + /** construction data file name */ + LTEXT resourcefile = ""; + + /** + * construction data id in the file - string in order to allow different + * data representations + */ + LTEXT resourceid = ""; + } + +/** mapping defines a name that maps a hierarchical name */ +STRUCT MAPPING + { + /** mapping name (for example, "button1") */ + LTEXT key; + + /** + * mapping path, a blank-separated path + * (for example, "rootnode statusnode left_area") + */ + LTEXT path; + } + +STRUCT FILEVERSION + { + /** version string */ + LTEXT version; + } + +#endif // XNLAYOUTENGINE_HRH diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnnodepredicate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnnodepredicate.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,66 @@ +/* +* 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: Node predicate header +* +*/ + + +#ifndef XNNODEPREDICATE_H +#define XNNODEPREDICATE_H + +// System includes +#include <e32base.h> + +// forward declarations +class CXnNode; + +// Class declarations + +/** + * Compares two objects. + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since Series 60 3.1 + */ +class MXnNodePredicate + { +public: + // Constructors and destructor + + /** + * C++ default constructor. + */ + IMPORT_C MXnNodePredicate(); + + /** + * Destructor. + */ + IMPORT_C virtual ~MXnNodePredicate(); + +public: + // New functions + + /** + * Tests whether an object matches the predicate + * + * @since Series 60 3.1 + * @param aItem Object to test + * @return ETrue if matches, EFalse if not + */ + IMPORT_C virtual TBool Match( CXnNode& aItem ); + }; + +#endif // XNNODEPREDICATE_H + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnodtparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnodtparser.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,150 @@ +/* +* 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: Parser for parsing ODT (Object Description Tree) data +* +*/ + + +#ifndef _CXNODTPARSER_H +#define _CXNODTPARSER_H + +// System includes +#include <e32base.h> + +// Constants + +// Forward declarations +class CXnViewManager; +class CXnUiEngine; +class CXnEcomHandler; +class CXnRootData; +class CXnViewData; +class CXnPluginData; +class CXnDomStringPool; +class CXnDomNode; +class CXnNode; + +// Class declaration + +/** + * Layout file parser for reading ODT data to create the UI tree. + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since Series 60 3.1 + */ +NONSHARABLE_CLASS( CXnODTParser ) : public CBase + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + * + * @param aManager View Manager + * @param aXnEcomHandler Ecom handler + */ + static CXnODTParser* NewL( CXnViewManager& aManager, + CXnEcomHandler& aXnEcomHandler ); + + /** + * Destructor. + */ + virtual ~CXnODTParser(); + +public: + // New functions + + /** + * Loads application root + * + * @param aRootData Root data + * @param aAppUid Application uid + */ + void LoadRootL( CXnRootData& aRootData, TUid aAppUid ); + + /** + * Loads view + * + * @param aViewData View data + */ + void LoadViewL( CXnViewData& aViewData ); + + /** + * Destroys view + * + * @param aViewData View data + */ + void DestroyView( CXnViewData& aViewData ); + + /** + * Loads widget + * + * @param aPluginData Plugin data + */ + void LoadWidgetL( CXnPluginData& aPluginData ); + + /** + * Destroys widget + * + * @param aPluginData Plugin data + */ + void DestroyWidgetL( CXnPluginData& aPluginData ); + +private: + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CXnODTParser( CXnViewManager& aManager, + CXnEcomHandler& aXnEcomHandler ); + +private: + // new functions + void CreateNodesL( CXnDomNode* aSourceNode, CXnDomStringPool& aSp, + CXnPluginData& aPluginData ); + + void ConstructNodeL( CXnDomNode& aSource, + CXnDomStringPool& aSp, + CXnPluginData& aPluginData ); + + void CreateControlsL( CXnDomNode* aNode, CXnPluginData& aPluginData ); + + void ConstructControlL( CXnNode* aNode, CXnPluginData& aPluginData ); + + TBool CreateBuiltInControlL( CXnNode& aNode, const TDesC8& aName ); + + TBool CreateExternalControlL( CXnNode& aNode, const TDesC8& aName ); + + void CreateFactoryControlL( CXnNode& aNode, const TDesC8& aName ); + + void HandleWidgetBackgroundL( CXnNode* aWidgetNode ); + +private: + // Data + + /** View manager, not owned */ + CXnViewManager& iManager; + /** UiEngine, not owned */ + CXnUiEngine& iUiEngine; + /** ECOM helper object, not owned */ + CXnEcomHandler& iEcomHandler; + }; + +#endif // _CXNODTPARSER_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnplugindata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnplugindata.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,507 @@ +/* +* 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 +* +*/ + + +#ifndef _XNPLUGINDATA_H +#define _XNPLUGINDATA_H + +// System includes +#include <e32base.h> +#include <babitflags.h> + +// Forward declarations +class CXnNode; +class CXnDomNode; +class CXnResource; +class CXnControlAdapter; +class CXnViewData; +class CXnODT; +class CXnDataPluginLoader; +class CXnViewManager; +class CPeriodic; +// Constants + +// Class declaration + +/** + * Holds plugin data in UiEngine + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CXnPluginData ) : public CBase + { +public: + // Data types + enum + { + EUseEmpty, + EIsDispose, + EIsOccupied, + EIsEmpty, + EIsRemovable, + EIsActive, + EIsInitial, + EIsDataPluginsReady + }; + +public: + // Constructors and destructor + + /** + * Two-phased constructor. + * + * @param aParent Parent + */ + static CXnPluginData* NewL( CXnPluginData& aParent ); + + /** + * Two-phased constructor. Leaving on stack + * + * @param aParent Parent + */ + static CXnPluginData* NewLC( CXnPluginData& aParent ); + + /** + * Destructor + */ + ~CXnPluginData(); + +protected: + + /** + * C++ constructor + * + * @param aParent + */ + CXnPluginData( CXnPluginData& aParent ); + + /** + * C++ constructor + * + * @param aManager + */ + CXnPluginData( CXnViewManager& aManager ); + + /** + * C++ constructor + */ + CXnPluginData(); + + /** + * Leaving constructor + */ + void ConstructL(); + +public: + // New functions + + /** + * Loads content to plugin + */ + virtual void LoadL(); + + /** + * Destroys content from plugin + */ + virtual void Destroy(); + + /** + * Sets plugindata node + * + * @param aNode Node to be set. + */ + inline void SetNode( CXnDomNode* aNode ); + + /** + * Returns plugindata node + * + * @return Dom Node + */ + inline CXnDomNode* Node() const; + + /** + * Sets Owner + * + * @param Dom node owner + */ + inline void SetOwner( CXnDomNode* aOwner ); + + /** + * Returns owner + * + * @return Returns the owning dom node + */ + inline CXnDomNode* Owner() const; + + /** + * Returns parent + * + * @return ViewData Parent + */ + inline CXnPluginData* Parent() const; + + /** + * Returns View Manager + * + * @return View manager + */ + inline CXnViewManager& ViewManager() const; + + /** + * Returns state of the parent - active/ not active + * + * @return ETrue - parent active + * EFalse - parent not active + */ + inline virtual TBool Active() const; + + /** + * Sets new configuration ID + * + * @param aConfigurationId Config ID + */ + void SetConfigurationIdL( const TDesC8& aConfigurationId ); + + /** + * Returns Config. ID + * + * @return Id + */ + inline const TDesC8& ConfigurationId() const; + + /** + * Sets new plugin ID + * + * @param aPluginId Plugin ID + */ + void SetPluginIdL( const TDesC8& aPluginId ); + + /** + * Returns plugin ID + * + * @return Plugin ID + */ + inline const TDesC8& PluginId() const; + + /** + * Sets new plugin UID + * + * @param aPluginUid Plugin UID + */ + void SetPluginUidL( const TDesC8& aPluginUid ); + + /** + * Returns plugin UID + * + * @return Plugin Uid + */ + inline const TDesC8& PluginUid() const; + + /** + * Sets new plugin name + * + * @param aPluginName Plugin name + */ + void SetPluginNameL( const TDesC8& aPluginName ); + + /** + * Returns plugin name + * + * @return Plugin name + */ + inline const TDesC8& PluginName() const; + + /** + * Sets new plugin type + * + * @param aPluginType Plugin type + */ + void SetPluginTypeL( const TDesC8& aPluginType ); + + /** + * Returns plugin type + * + * @return Plugin type + */ + 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 + * + * @param const TDesC& aPublisherName - Publisher name + */ + void SetPublisherNameL( const TDesC8& aPublisherName ); + + /** + * void SetPublisherNameL( const TDesC& aPublisherName ) + * Sets the name of the publisher + * + * @param const TDesC& aPublisherName - Publisher name + */ + void SetPublisherNameL( const TDesC& aPublisherName ); + + /** + * inline const TDesC16& PublisherName() + * Returns the publisher name + * + * @param + * @return - *iPublisherName or KNullDesC16() + */ + inline const TDesC& PublisherName() const; + + /** + * Sets new resources. + * + * @param aResources resource list + */ + void SetResources( CArrayPtrSeg< CXnResource >* aResources ); + + /** + * Adds resources to the list + * + * @param aList List are added to + */ + virtual void ResourcesL( CArrayPtrSeg< CXnResource >& aList ) const; + + /** + * Adds control from Node's control + * + * @param aNode Node which control should be added + */ + void SetControlL( CXnNode* aNode ); + + /** + * Returns list of controls + * + * @param aList List where controls are added + */ + virtual void ControlsL( RPointerArray< CXnControlAdapter >& aList ) const; + + /** + * Sets content source + * + * @param aNode Node to be added + */ + void SetContentSourceNodeL( CXnNode* aNode ); + + /** + * Returns all content source nodes + * + * @param aList List where they are returned + */ + virtual void ContentSourceNodesL( RPointerArray< CXnNode >& aList ) const; + + /** + * Adds appearance nodes + * + * @param aNode Node to be added + */ + void SetAppearanceNodeL( CXnNode* aNode ); + + /** + * Returns list of appearance nodes + * + * @param aList List of apperance nodes + */ + virtual void AppearanceNodesL( RPointerArray< CXnNode >& aList ) const; + + /** + * Adds an initial focus node + * + * @param aNode Node + */ + void SetInitialFocusNodeL( CXnNode* aNode ); + + /** + * Returns list of focus nodes + * + * @param aList List of focus nodes + */ + virtual void InitialFocusNodesL( RPointerArray< CXnNode >& aList ) const; + + /** + * Sets the plugin occupied + */ + inline void SetOccupied(); + + /* + * Checks whether occupied + * + * @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 + * + * @return ETrue when removable EFalse when not + */ + inline TBool Removable() const; + + /* + * Queries whether this plugin is holding "empty" widget + * + * @return ETrue if empty, EFalse otherwise + */ + TBool Empty() const; + + /* + * Sets this plugin to hold "empty" widget + * + * @param aPluginId PluginId for later usage + */ + void SetEmptyL( const TDesC8& aPluginId ); + + /** + * Flushes plugin data + */ + void Flush(); + + /** + * Sets/Unsets the popup + * @param aVisible sets the popup visible or invisible + * @param aNode a pointer to the popup node + */ + void SetIsDisplayingPopup ( TBool aVisible, CXnNode* aNode ); + + /** + * Checks if the popup is displayed + */ + TBool IsDisplayingPopup () const; + + + /** + * Returns list of plugindata + * + * @return List of plugindata + */ + inline RPointerArray< CXnPluginData >& PluginData() const; + + /** + * Loads data plugins associated to the plugin data + * + */ + virtual void LoadDataPluginsL(); + + /** + * Deletes data plugins associated to the plugin data + */ + virtual void DestroyDataPluginsL(); + + /** + * Indicates that all data plugins are loaded by data plugin loader + * + * @param aStatus Loading status + */ + 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; + + +private: + // New functions + + static TInt RunL( TAny* aAny ); + +protected: + // data + + /** Data plugin loader, Owned */ + CPeriodic* iLoader; + /** Data plugin load index */ + TInt iLoadIndex; + /** Plugins data */ + mutable RPointerArray< CXnPluginData > iPluginsData; + /** List of plugin resources, Owned */ + CArrayPtrSeg< CXnResource >* iResources; + /** List of controls, Not owned */ + RPointerArray< CXnControlAdapter > iControls; + /** List of content source nodes, Not owned */ + RPointerArray< CXnNode > iContentSourceNodes; + /** List of appearance nodes, Not owned */ + RPointerArray< CXnNode > iAppearanceNodes; + /** List of initial focus nodes, Not owned */ + RPointerArray< CXnNode > iInitialFocusNodes; + /** List of popup focus nodes, Not owned */ + RPointerArray< CXnNode > iPopupNodes; + + /** Parent, Not owned */ + CXnPluginData* iParent; + /** View manager, Not owned */ + CXnViewManager& iManager; + /** This plugin's node, Not owned */ + CXnDomNode* iNode; + /** This plugin's owner, Not owned */ + CXnDomNode* iOwner; + /** config ID, Owned */ + HBufC8* iConfigurationId; + /** Plugin ID, Owned */ + HBufC8* iPluginId; + /** Plugin UID, Owned */ + HBufC8* iPluginUid; + /** Plugin name, Owned */ + 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; + }; + +// Inline functions +#include "xnplugindata.inl" + +#endif // _XNPLUGINDATA_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnplugindata.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnplugindata.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,207 @@ +/* +* 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 - inline functions +* +*/ + + +#ifndef _XNPLUGINDATA_INL_ +#define _XNPLUGINDATA_INL_ + +// --------------------------------------------------------------------------- +// Sets plugindata node +// --------------------------------------------------------------------------- +// +inline void CXnPluginData::SetNode( CXnDomNode* aNode ) + { + iNode = aNode; + }; + +// --------------------------------------------------------------------------- +// Returns plugindata node +// --------------------------------------------------------------------------- +// +inline CXnDomNode* CXnPluginData::Node() const + { + return iNode; + }; + +// --------------------------------------------------------------------------- +// Sets Owner +// --------------------------------------------------------------------------- +// +inline void CXnPluginData::SetOwner( CXnDomNode* aOwner ) + { + iOwner = aOwner; + }; + +// --------------------------------------------------------------------------- +// Returns Owner +// --------------------------------------------------------------------------- +// +inline CXnDomNode* CXnPluginData::Owner() const + { + return iOwner; + }; + +// ----------------------------------------------------------------------------- +// Return the parent of this plugin data +// ----------------------------------------------------------------------------- +// +inline CXnPluginData* CXnPluginData::Parent() const + { + return iParent; + }; + +// ----------------------------------------------------------------------------- +// Return view manager +// ----------------------------------------------------------------------------- +// +inline CXnViewManager& CXnPluginData::ViewManager() const + { + return iManager; + }; + +// --------------------------------------------------------------------------- +// Queries whether this plugin is in active view +// --------------------------------------------------------------------------- +// +inline TBool CXnPluginData::Active() const + { + TBool retval( EFalse ); + + if( iParent ) + { + retval = iParent->Active(); + } + + return retval; + }; + +// --------------------------------------------------------------------------- +// Returns Config. ID +// --------------------------------------------------------------------------- +// +inline const TDesC8& CXnPluginData::ConfigurationId() const + { + return iConfigurationId ? *iConfigurationId : KNullDesC8(); + }; + +// --------------------------------------------------------------------------- +// Returns plugin ID +// --------------------------------------------------------------------------- +// +inline const TDesC8& CXnPluginData::PluginId() const + { + return iPluginId ? *iPluginId : KNullDesC8(); + }; + +// --------------------------------------------------------------------------- +// Returns plugin UID +// --------------------------------------------------------------------------- +// +inline const TDesC8& CXnPluginData::PluginUid() const + { + return iPluginUid ? *iPluginUid : KNullDesC8(); + }; + +// --------------------------------------------------------------------------- +// Returns plugin name +// --------------------------------------------------------------------------- +// +inline const TDesC8& CXnPluginData::PluginName() const + { + return iPluginName ? *iPluginName : KNullDesC8(); + }; + +// --------------------------------------------------------------------------- +// Returns plugin type +// --------------------------------------------------------------------------- +// +inline const TDesC8& CXnPluginData::Type() const + { + return iPluginType ? *iPluginType : KNullDesC8(); + }; + +// --------------------------------------------------------------------------- +// Returns plugin state +// --------------------------------------------------------------------------- +// +inline const TDesC8& CXnPluginData::PluginState() const + { + return iPluginState ? *iPluginState : KNullDesC8(); + }; + +// --------------------------------------------------------------------------- +// Returns the publisher name +// --------------------------------------------------------------------------- +// +inline const TDesC& CXnPluginData::PublisherName() const + { + return iPublisherName ? *iPublisherName : KNullDesC16(); + }; + +// ----------------------------------------------------------------------------- +// Sets this plugin occupied, i.e. holding widget +// ----------------------------------------------------------------------------- +// +inline void CXnPluginData::SetOccupied() + { + iFlags.Set( EIsOccupied ); + }; + +// ----------------------------------------------------------------------------- +// Queries whether the plugin is occupied +// ----------------------------------------------------------------------------- +// +inline TBool CXnPluginData::Occupied() const + { + return ( iFlags.IsSet( EIsOccupied ) ? ETrue : EFalse ); + }; + +// --------------------------------------------------------------------------- +// Sets removable +// --------------------------------------------------------------------------- +// +inline void CXnPluginData::SetRemovable( TBool aRemovable ) + { + if( aRemovable ) + { + iFlags.Set( EIsRemovable ); + } + else + { + iFlags.Clear( EIsRemovable ); + } + }; + +// --------------------------------------------------------------------------- +// Returns removable +// --------------------------------------------------------------------------- +// +inline TBool CXnPluginData::Removable() const + { + return ( iFlags.IsSet( EIsRemovable ) ? ETrue : EFalse ); + }; + +// --------------------------------------------------------------------------- +// Returns list of plugindata +// --------------------------------------------------------------------------- +// +inline RPointerArray< CXnPluginData >& CXnPluginData::PluginData() const + { + return iPluginsData; + }; + +#endif // _XNPLUGINDATA_INL_ diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnplugindefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnplugindefs.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,98 @@ +/* +* 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: Plugin constant definitions +* +*/ + + +#ifndef _XNPLUGINDEFS_H_ +#define _XNPLUGINDEFS_H_ + +// System includes +#include <e32std.h> + +// Constants +const TInt KContentIdMaxLength ( 255 ); +const TInt KResultMaxLength ( 255 ); +const TInt KSAPIContentNameMaxLength ( 255 ); +const TUint KSepratorChar ( '/' ); + +_LIT8( KPluginInterface, "2001f48a" ); +_LIT8( KPlugin, "plugin" ); +_LIT8( KKeyWidget, "widget" ); +_LIT8( KKeyTemplate, "template"); +_LIT8( KType, "type" ); +_LIT8( KConfigurationId, "configurationid" ); +_LIT8( KConfigurationUid, "configurationuid" ); +_LIT8( KPluginId, "pluginId" ); +_LIT8( KPluginName, "pluginname" ); +_LIT16( KContentSource16, "ContentSource" ); +_LIT8( KContentSource, "ContentSource" ); +_LIT8( KContentData, "contentdata" ); +_LIT8( KView, "view" ); +_LIT8( KApplication, "application" ); +_LIT( KSeperator, "/" ); +_LIT( KOpen, "(" ); +_LIT( KClose, ")" ); +_LIT( KHSOnLine_OffLine, "online_offline" ); +_LIT( KHSOnLine, "online" ); +_LIT( KHSOffLine, "offline" ); + +_LIT8( KNameSeperator, ":" ); +_LIT8( KOpenBrace, "[" ); +_LIT8( KCloseBrace, "]" ); + +_LIT8( KSettingsConfiguration, "settingsconfiguration" ); +_LIT8( KConfigurationModel, "configuration" ); +_LIT8( KContentModel, "contentmodel") ; +_LIT8( KContentSourceNode, "contentsource"); + +_LIT8( KSource, "source" ); +_LIT8( KLaunch, "launch" ); +_LIT8( KName, "name" ); +_LIT8( KStatus, "status" ); + +_LIT( KDummy16, "empty" ); +_LIT8( KDummy8, "empty" ); + +// CPS constants +_LIT( KTemplatedWidget, "ai3templatedwidget" ); +_LIT( KPublisher16, "publisher" ); +_LIT8( KPublisher, "publisher" ); +_LIT8( KContentType, "content_type" ); +_LIT8( KContentId, "content_id" ); +_LIT8( KFilter, "filter" ); +_LIT8( KGetList, "GetList" ); +_LIT8( KResults, "results" ); +_LIT8( KTemplateType, "template_type" ); +_LIT8( KWidgetName, "widget_name" ); +_LIT8( KWidgetInfo, "widget_info" ); + +_LIT8( KTrigger, "trigger" ); +_LIT8( KPubTrigger, "pubtrigger" ); +_LIT8( KDataMap, "data_map" ); +_LIT8( KWidgetTriggerName, "(selected)" ); +_LIT8( KItem, "item" ); +_LIT( KAll, "all" ); +_LIT8( KOperation, "operation" ); +_LIT8( KChangeInfo, "change_info" ); +_LIT8( KDelete, "delete" ); +_LIT8( KRequestNotification, "RequestNotification" ); +_LIT8( KOpen8, "(" ); + +_LIT8( KWallpaper, "wallpaper" ); +_LIT8( KPath, "path" ); +_LIT8( KWRTTemplate, "ai3templatedwidget"); + +#endif /* _XNPLUGINDEFS_H_ */ diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnpointarray.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnpointarray.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Array of points +* +*/ + + +#ifndef _XNPOINTARRAY_H_ +#define _XNPOINTARRAY_H_ + +// System includes +#include <e32std.h> + +/** + * 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 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnpointarray.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnpointarray.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: 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 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnpopupcontroladapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnpopupcontroladapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,130 @@ +/* +* 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: Popup control adapter +* +*/ + +#ifndef __XNPOPUPCONTROLADAPTER_H__ +#define __XNPOPUPCONTROLADAPTER_H__ + +// System includes +#include <e32base.h> +#include <eikmobs.h> + +// User includes +#include "xncontroladapter.h" +#include "xnmenu.h" + +// Forward declarations +class CXnNodePluginIf; +class CXnNode; +class CXnUiEngine; +class CAknStylusPopUpMenu; + +// Class declaration + +/** + * Popup Control adapter interface class + * + * @ingroup group_xnlayoutengine + * @lib xnlayoutengine.lib + * @since Series 60 5.0 + */ +NONSHARABLE_CLASS( CXnPopupControlAdapter ) : public CXnControlAdapter, + public MEikMenuObserver + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + * + * @param aNode Node + */ + static CXnPopupControlAdapter* NewL( CXnNodePluginIf& aNode ); + + /** + * Destructor. + */ + ~CXnPopupControlAdapter(); + +private: + // Constructors + + /** + * C++ default constructor. + */ + CXnPopupControlAdapter(); + + /** + * Two-phased constructor. + */ + void ConstructL( CXnNodePluginIf& aNode ); + +private: + // From MEikMenuObserver + void ProcessCommandL( TInt aCommandId ); + void SetEmphasis( CCoeControl* aMenuControl, TBool aEmphasis ); + +public: + // New functions + + /* + * Sets dynamic menuitem observer + * + * @param aObserver Observer + */ + void SetObserver( XnMenuInterface::MXnMenuObserver& aObserver ); + + /* + * Makes stylus popup menu visible + * + * @param aPlugin Plugin which displays this popup + */ + void TryDisplayingStylusPopupL( CXnNode& aPlugin ); + + /* + * Screen device change notification + * + * @see CXnControlAdapter documentation + */ + void HandleScreenDeviceChangedL(); + +private: + // New functions + void PopulateMenuL( CXnNode* aItem, CXnNode& aPlugin ); + void ShowMenuL( CXnNode& aPlugin, TPoint aPosition ); + void HideMenuL(); + +private: + // Data + + /** UiEngine, Not owned */ + CXnUiEngine* iUiEngine; + /** Node - received in constructor, Not owned */ + CXnNode* iNode; + /** Observer, Not owned */ + XnMenuInterface::MXnMenuObserver* iObserver; + /** Stylus popup menu, Owned */ + CAknStylusPopUpMenu* iStylusPopupMenu; + /** Stylus popup menu items, Owned */ + RPointerArray< CXnNode > iMenuItems; + /** Stylus popup menu command ids */ + TInt iCommandId; + /** Flag to indicate whether popup menu is shown */ + TBool iMenuShown; + }; + +#endif // __XNPOPUPCONTROLADAPTER_H__ + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnpropertycomparator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnpropertycomparator.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,64 @@ +/* +* 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: Compares two objects. +* +*/ + + +#ifndef XNPROPERTYCOMPARATOR_H +#define XNPROPERTYCOMPARATOR_H + +// User includes +#include "xncomparator.h" + +// Class declaration + +/** + * Compares two objects. + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since Series 60 3.1 + */ +NONSHARABLE_CLASS( TXnPropertyComparator ) : public MXnComparator + { +public: + // Constructors and destructor + + /** + * C++ default constructor. + */ + TXnPropertyComparator(); + + /** + * Destructor. + */ + ~TXnPropertyComparator(); + +public: + // Functions from MXnComparator + + /** + * From MXnComparator. + * Compares two objects for equality. + * + * @since Series 60 3.1 + * @param aItem1 First item + * @param aItem1 Second item + * @return ETrue if equal, EFalse if not equal + */ + TBool Equals( CBase& aItem1, CBase& aItem2 ); + }; + +#endif // XNPROPERTYCOMPARATOR_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnpropertylist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnpropertylist.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,150 @@ +/* +* 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: Property list implementation +* +*/ + + +#ifndef __XNPROPERTYLIST_H__ +#define __XNPROPERTYLIST_H__ + +// System includes +#include <e32base.h> + +// User includes +#include "xndomproperty.h" + +// Forward declarations +class CXnPropertyComparator; +class CXnMap; +class CXnProperty; + +struct CXnPropertyKey : public CBase + { + const TDesC8* iString; + CXnDomProperty::TPseudoClass iPseudoClass; + }; + +// Class declaration + +/** + * Property list + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since Series 60 3.1 + */ +NONSHARABLE_CLASS( CXnPropertyList ) : public CBase + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + * + * @return Property list object. + */ + static CXnPropertyList* NewL(); + + /** + * Destructor. + */ + ~CXnPropertyList(); + +public: + // New functions + + /** + * Set a property. The list will assume ownership of the property. + * If an equal property is already in the list, it will be replaced with + * the new property and the old property will be destroyed. + * + * @since Series 60 3.1 + * @param aProperty Property to set. + */ + void SetPropertyL( CXnProperty* aProperty ); + + /** + * Gets a property. The list will retain ownership of the property, + * the caller must not destroy the property. The returned pointer will + * become invalid if the property is replaced in the list by a subsequent + * SetL(). + * + * @since Series 60 3.1 + * @param aProperty Property key + * @return The property mapped to the key or NULL if not found. + */ + CXnProperty* GetProperty( const TDesC8& aKey ) const; + + /** + * Set a state + * + * @since Series 60 3.1 + * @param aState State to set. + * @return ETrue if pseudoclass found, EFalse otherwise + */ + TBool SetStateL( const TDesC8& aState ); + + /** + * Check whether a state is set + * + * @since Series 60 3.1 + * @param aState State to be checked + * @return ETrue if set, EFalse if not + */ + TBool IsStateSet( const TDesC8& aState ); + + /** + * Unset a state + * + * @since Series 60 3.1 + * @param aState State to unset. + * @return ETrue if pseudoclass found, EFalse otherwise + */ + TBool UnsetState( const TDesC8& aState ); + + /** + * Clone the list + * + * @since Series 60 3.1 + * @return Clone of the list + */ + CXnPropertyList* CloneL(); +protected: + // New functions + + /** + * C++ default constructor. + */ + CXnPropertyList(); + +private: + + /** + * Two-phased constructor. + * @param aComparator Propety comparator. + */ + void ConstructL(); + +private: + // Data + + /** Map of property objects. */ + CXnMap* iMap; + /** Currently used pseudoclasses (states) */ + RArray< CXnDomProperty::TPseudoClass > iCurrentPseudoClasses; + }; + +#endif //__XNPROPERTYLIST_H__ + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnrootdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnrootdata.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,205 @@ +/* +* 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 application configuration info +* +*/ + + +#ifndef _XNROOTDATA_H +#define _XNROOTDATA_H + +// System includes +#include <e32base.h> +#include <babitflags.h> + +// User includes +#include "xnplugindata.h" + +// Forward declarations +class CXnViewManager; +class CXnViewData; +class CXnEcomHandler; +class CXnODTParser; +class CXnODT; + +/** + * Holds root data in UiEngine + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CXnRootData ) : public CXnPluginData + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnRootData* NewL( CXnViewManager& aManager, TUid aApplicationUid ); + + /** + * Two-phased constructor. Leaving on stack + */ + static CXnRootData* NewLC( CXnViewManager& aManager, TUid aApplicationUid ); + + /** + * Destructor + */ + ~CXnRootData(); + +protected: + /** + * C++ constructor + */ + CXnRootData( CXnViewManager& aManager, TUid aApplicationUid ); + +private: + // private constructors + + /** + * Leaving constructor + */ + void ConstructL(); + +public: + // From CXnPluginData + + /** + * @see CXnPluginData + */ + void LoadL(); + + /** + * @see CXnPluginData + */ + void Destroy(); + +public: + // New functions + + /** + * Loads remaining application views + */ + void LoadRemainingViews(); + + /** + * Cancels load remaining application views + */ + void CancelLoadRemainingViews(); + + /** + * Gets application active view data + * + * @return Active view data + */ + CXnViewData& ActiveViewData() const; + + /** + * Gets previous view data from currently active one + * + * @return Previous view data + */ + CXnViewData& PreviousViewData() const; + + /** + * Gets next view data from currently active one + * + * @return Next view data + */ + CXnViewData& NextViewData() const; + + /** + * Sets view data to destroyal list + * + * @param aViewData View data to destroy + */ + void DestroyViewData( CXnViewData* aViewData ); + + /** + * Gets ODT + * + * @return ODT + */ + CXnODT* ODT() const; + + /** + * Gets root node from ODT + * + * @return Root node + */ + CXnNode* RootNode() const; + + /** + * Gets ODT Parser + * + * @return ODT Parser + */ + CXnODTParser& Parser() const; + + /** + * Gets Ecom handler + * + * @return Ecom handler + */ + CXnEcomHandler& EcomHandler() const; + + /** + * Sets maximum pages allowed + * + * @param aPages maximum pages + */ + void SetMaxPages( TInt32 aPages ); + + /** + * Get maximum pages allowed + * + * @return number of pages allowed + */ + TInt32 MaxPages(); + +private: + // New functions + + TBool AllViewsLoaded() const; + TBool AllViewsDestroyed() const; + + static TInt RunLoadL( TAny* aAny ); + static TInt RunDestroyL( TAny *aAny ); + +private: + // data + + /** Timer for loading views, Owned */ + CPeriodic* iLoadTimer; + /** Timer for deleting views, Owned */ + CPeriodic* iDestroyTimer; + /** Application Uid */ + TUid iApplicationUid; + /** ECom handler, Owned */ + CXnEcomHandler* iEcomHandler; + /** ODT Parser, Owned */ + CXnODTParser* iParser; + /** ODT which describes application configuration, Owned */ + CXnODT* iODT; + /** Array of views waiting destruction */ + RPointerArray< CXnViewData > iViewsToDestroy; + /** Flag to determine remaining view load direction */ + TBool iLoadForward; + /** Maximum of views allowed */ + TInt32 iMaxPages; + }; + +#endif // _XNROOTDATA_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnscrollablecontroladapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnscrollablecontroladapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,231 @@ +/* +* 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: Scrollable control adapter +* +*/ + +#ifndef __XNSCROLLABLECONTROLADAPTER_H__ +#define __XNSCROLLABLECONTROLADAPTER_H__ + +// INCLUDES +#include "xncontroladapter.h" +#include <e32base.h> +#include <aknphysicsobserveriface.h> +#include <coeccntx.h> + +// FORWARD DECLARATIONS +class CXnNodePluginIf; +class CXnUiEngine; +class CXnNode; +class CAknPhysics; + + +// CLASS DECLARATION + +/** +* @ingroup group_xnlayoutengine +* Popup Control adapter interface class +* @lib xnlayoutengine.lib +* @since Series 60 5.0 +*/ +NONSHARABLE_CLASS( CXnScrollableControlAdapter ) : public CXnControlAdapter, + public MAknPhysicsObserver, public MCoeControlContext, public MCoeControlHitTest + { + public: // Constructors and destructor + /** + * Two-phased constructor. + */ + static CXnScrollableControlAdapter* NewL( CXnNodePluginIf& aNode ); + + /** + * Destructor. + */ + ~CXnScrollableControlAdapter(); + + private: // Functions from base classes + + /** + * see CCoeControl + */ + void HandlePointerEventL(const TPointerEvent& aPointerEvent); + + /** + * see CCoeControl + */ + void Draw(const TRect& aRect) const; + + /** + * see CCoeControl + */ + void SizeChanged(); + + /** + * @see CCoeControl documentation + */ + void MakeVisible( TBool aVisible ); + + /** + * @see MCoeControlHitTest documentation + */ + TBool HitRegionContains( const TPoint& aPoint, const CCoeControl& aControl) const; + + /** + * @see CXnControlAdapter documentation + */ + void HandleScreenDeviceChangedL(); + + public: // New functions + /** + * Returns Called when view position changes. + * + * @param aNewPosition New view position. + */ + const TPoint DeltaPosition() const; + + /** + * Reset state. + * + */ + void ResetState(); + + /** + * Scroll box so that the given node is shown. + * + */ + void ShowItem( CXnNode& aNode ); + + /** + * Layout has changed somewhere. Act if needed. + * + */ + void LayoutChangedL(); + + public: // Functions from base classes + /** + * From MAknPhysicsObserver. + * + * Physics emulation has moved the view. + * + * When this method is called client should update its visual and logical + * states to reflect the changes caused by view move. Note that if the + * parameter @c aDrawNow is @c EFalse client is not allowed to redraw the + * display but should only update its logical state. + * Physics engine will ensure that the last frame is always drawn. + * + * @since S60 v5.0 + * + * @param aNewPosition The new position of the view. + * @param aDrawNow @c ETrue if client should redraw the screen, + * otherwise @c EFalse. + * @param aFlags Additional flags, not used currently. + */ + void ViewPositionChanged( const TPoint& aNewPosition, + TBool aDrawNow, TUint aFlags ); + + /** + * From MAknPhysicsObserver. + * Called when emulation ended. + */ + void PhysicEmulationEnded(); + + /** + * From MAknPhysicsObserver. + * Returns the observer view position. + * + * @return Physics observer view position. + */ + TPoint ViewPosition() const; + + /** + * see MCoeControlContext + */ + void ResetContext( CWindowGc& aGc ) const; + + private: // Constructors + /** + * C++ default constructor. + */ + CXnScrollableControlAdapter( CXnNodePluginIf& aNode ); + + /** + * Two-phased constructor. + */ + void ConstructL(); + + private: // New functions + void ReadPropertiesL(); + void InitPhysicEngineL(); + + private: // Data + /** + * UiEngine. + * Not owned. + */ + CXnUiEngine* iUiEngine; + + /** + * Layout node. + */ + CXnNodePluginIf& iNode; + + /** + * Physics. + * Own. + */ + CAknPhysics* iPhysics; + + /** + * Pointer down start time. + */ + TTime iStartTime; + + /** + * Start (pointer down) position. + */ + TPoint iStartPosition; + + /** + * Position at previous pointer event. + */ + TPoint iPreviousPosition; + + /** + * Current view position. + */ + TPoint iCurrentPosition; + + /** + * View position at the beginning. + */ + TPoint iStartViewPosition; + + /** + * Current pointer position. + */ + TPoint iStylusPosition; + + /** + * Visible area, i.e. area of the scollable control that is to be drawn. + */ + TRect iViewPort; + + /** + * True, if layout has been changed and engine needs to be reset. + */ + TBool iLayoutChanged; + }; + +#endif // __XNSCROLLABLECONTROLADAPTER_H__ + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnuiengineimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnuiengineimpl.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,673 @@ +/* +* 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: Layout calculation and UI rendering mechanism implementations. +* +*/ + + +#ifndef _CXNUIENGINEIMPL_H +#define _CXNUIENGINEIMPL_H + +// System includes + +// User includes +#include "xnuistatelistener.h" +#include "xnviewmanager.h" +#include "xnmenu.h" + +// Forward declarations +class CCoeControl; +class CXnControlAdapter; +class CXnNode; +class CXnPointerArray; +class CXnODT; +class CGraphicsDevice; +class CXnUiEngine; +class CXnKeyEventDispatcher; +class CXnEditor; +class CXnResource; +class CXnEditMode; +class CXnHitTest; +class CXnViewManager; +class CXnViewData; +class CXnPluginData; + +// Constants +namespace XnLayoutPhase + { + const TInt ENone = 0x00; + const TInt ELayout = 0x01; + const TInt EMeasure = 0x02; + } + +namespace XnLayoutControl + { + const TInt ELayoutUI = 0x01; + const TInt ERenderUI = 0x02; + const TInt ERefreshMenu = 0x04; + const TInt EIgnoreState = 0x08; + const TInt EViewDirty = 0x10; + const TInt EEffectStarted = 0x20; + const TInt EFirstPassDraw = 0x40; + } + +NONSHARABLE_STRUCT( TXnDirtyRegion ) + { + RRegion iRegion; + CCoeControl* iControl; // Not own. + + ~TXnDirtyRegion() + { + iRegion.Close(); + } + }; + + +// Class declaration + +/** + * Layout calculation and UI rendering mechanism + * implementations. + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since Series 60 3.1 + */ +NONSHARABLE_CLASS( CXnUiEngineImpl ) : public CBase, + public MXnViewObserver, + public MXnUiResourceChangeObserver, + public XnMenuInterface::MXnMenuObserver + { + +public: + // Constructors and destructor + + /** + * Two-phased constructor. + * + * @param aUiEngine Ui engine + * @param aViewManager View manager + */ + static CXnUiEngineImpl* NewL( CXnUiEngine& aUiEngine, + CXnAppUiAdapter& aAdapter ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + + /** + * Destructor. + */ + virtual ~CXnUiEngineImpl(); + +public: + // New functions + + /** + * Gets AppUi + * + * @since S60 5.0 + * @return AppUi + */ + CXnAppUiAdapter& AppUiAdapter() const; + + /** + * Lays out the UI + * + * @since Series 60 3.1 + * @param aNode Starting point of the layout + */ + void LayoutUIL( CXnNode* aNode = NULL ); + + /** + * Creates UI implementations for the UI, adjusts control coordinates + * according to the layout + * + * @since Series 60 3.1 + * @param aNode Starting point + */ + void RenderUIL( CXnNode* aNode = NULL ); + + /** + * Gets the root node of the UI + * + * @since Series 60 3.1 + * @return Root node + */ + CXnNode* RootNode(); + + /** + * Gets the ODT + * + * @since Series 60 3.1 + * @return ODT + */ + CXnODT* ODT(); + + /** + * Finds a node by id + * + * @since Series 60 3.1 + * @param aNode Node id + * @param aNamespace Namespace + * @return Node with given id + */ + CXnNode* FindNodeByIdL( const TDesC& aNodeId, + const TDesC& aNamespace = KNullDesC ); + /** + * Finds a node by id, b-bit version + * + * @since Series 60 3.1 + * @param aNode Node id + * @param aNamespace Namespace + * @return Node with given id + */ + CXnNode* FindNodeByIdL( const TDesC8& aNodeId, + const TDesC8& aNamespace = KNullDesC8 ); + /** + * Finds nodes by class + * + * @since Series 60 3.1 + * @param aClassId Class id + * @return Nodes with given class id + */ + CXnPointerArray* FindNodeByClassL( const TDesC& aClassId, + const TDesC& aNamespace = KNullDesC ); + + /** + * Finds nodes by class + * + * @since Series 60 3.1 + * @param aClassId Class id + * @return Nodes with given class id + */ + CXnPointerArray* FindNodeByClassL( const TDesC8& aClassId, + const TDesC8& aNamespace = KNullDesC8 ); + + /** + * Gets resources of the UI + * + * @since Series 60 3.1 + * @return List of resources + */ + CArrayPtrSeg< CXnResource >& Resources(); + + /** + * Sets currently focused node + * + * @since Series 60 3.1 + * @param aFocusedNode Currently focused node + * @param aSource A source of event that triggered focus change. + */ + void SetFocusedNodeL( CXnNode* aFocusedNode, TInt aSource = 0 ); + + /** + * Get currently focused node + * + * @since Series 60 3.1 + * @return Focused node. + */ + CXnNode* FocusedNode(); + + /** + * Checks if the UI is in Edit mode. + * + * @since Series 60 5.0 + * @return ETrue if the current mode is edit, otherwise EFalse. + */ + TBool IsEditMode(); + + /** + * Get a numeric value of a property in vertical pixels + * + * @since Series 60 3.1 + * @param aValue Property + * @param aReferenceValue Value used for percentage calculation + * @return Value in vertical pixels + */ + TInt VerticalPixelValueL( CXnProperty* aValue, TInt aReferenceValue ); + + /** + * Get a numeric value of a property in horizontal pixels + * + * @since Series 60 3.1 + * @param aValue Property + * @param aReferenceValue Value used for percentage calculation + * @return Value in horizontal pixels + */ + TInt HorizontalPixelValueL( CXnProperty* aValue, TInt aReferenceValue ); + + /** + * Get a numeric value of a property in vertical twips + * + * @since Series 60 3.1 + * @param aValue Property + * @param aReferenceValue Value used for percentage calculation + * @return Value in vertical twips + */ + TInt VerticalTwipValueL( CXnProperty* aValue, TInt aReferenceValue ); + + /** + * Get a numeric value of a property in horizontal twips + * + * @since Series 60 3.1 + * @param aValue Property + * @param aReferenceValue Value used for percentage calculation + * @return Value in horizontal pixels + */ + TInt HorizontalTwipValueL( CXnProperty* aValue, TInt aReferenceValue ); + + /** + * Refresh current menu + * + * @since Series 60 3.1 + */ + void RefreshMenuL(); + + /** + * Returns view manager + * + * @since S60 5.0 + * @return view manager + */ + CXnViewManager* ViewManager(); + + /** + * Returns the active view + + * @since Series 60 3.1 + * @return Active view node + */ + CXnNode* ActiveView(); + + /** + * Add a dirty node. LayoutUiL and RenderUiL will only perform operations + * on the set of dirty nodes. + * + * @since Series 60 3.1 + * @param aNode Dirty node. + * @param aLayoutPhaseHint, a hint where to start next layout phase + */ + void AddDirtyNodeL( CXnNode* aNode, TInt aLevel ); + + /** + * Get the size of the current screen device + * + * @since Series 60 3.1 + * @return Size of the current screen device + */ + TSize ScreenDeviceSize() const; + + /** + * Checks whether the dialog is displaying. + * + * @since Series 60 3.1 + * @return ETrue if dialog is displaying. + */ + TBool IsDialogDisplaying(); + + /** + * Handles a change to the control's resources of type aType + * + * @since Series 60 3.1 + * @param aType Changed resource type + */ + void HandleResourceChangeL( TInt aType ); + + /** + * Checks whether the menu is displaying. + * + * @since Series 60 3.1 + * @return ETrue if menu is displaying. + */ + TBool IsMenuDisplaying(); + + /** + * Returns menubar node + * + * @since Series 60 3.2 + * @return Menubar node + */ + CXnNode* MenuBarNode() const; + + /** + * Returns stylus popup node + * + * @since S60 60 5.0 + * @return stylus popup node + */ + CXnNode* StylusPopupNode() const; + + /** + * Set node as passive, and add it to the passive focused node array. + * + * @since Series 60 3.2 + * @param aNode Node to use. + */ + void AddPassiveFocusedNodeL( CXnNode* aNode ); + + /** + * Unset the passive focus from the node, and remove it from the passive + * focused node array. + * + * @since Series 60 3.2 + * @param aNode Node to use. + */ + void RemovePassiveFocusedNodeL( CXnNode* aNode ); + + /** + * Clear the passive focused node array, and unset the passive focus + * states. + * + * @since Series 60 3.2 + */ + void ClearPassiveFocusedNodesL(); + + /** + * Sets node's dropped state + * + * @since Series 60 3.2 + * @param aNode Node + * @param aDropped Dropped + */ + void SetNodeDroppedL( CXnNode& aNode, TInt aDropped ) const; + + /** + * Checks if node is adaptive, but doesn't have any content + * + * @since Series 60 3.2 + * @param aNode node + * @param aAvailableSize size to be checked + */ + void CheckAdaptiveContentL( CXnNode& aNode, TSize aAvailableSize ) const; + + /** + * Adds a node which can be focused + * + * @since Series 60 3.2 + * @param aNode Node + */ + void AddFocusCandidateL( CXnNode* aNode ); + + /** + * Sets client rect + * + * @since Series 60 3.2 + * @param aRect area to be set + * @param aDrawNow Call rendering routines if ETrue + */ + void SetClientRectL( TRect aRect, TBool aDrawNow = ETrue ); + + /** + * Fetch editor to operate on AI3 widgets. + * + * @since Series 60 5.0 + * @return Pointer to Editor + */ + CXnEditor* Editor() const; + + /** + * Gets client rect + * + * @since Series 60 3.2 + * @return client rect + */ + TRect ClientRect() const; + + /** + * Gets pointer to edit mode storage. + * + * @since Series 60 5.0 + * @return edit mode storage + */ + CXnEditMode* EditMode(); + + /** + * Get current view plugins nodes. + * + * @since Series 60 5.0 + * @return Pointer to plugin node array + */ + 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 + * @param aPath path from which file is found + * @param aFile file to which resource is set + * @return errorcode + */ + TInt GetThemeResource( const TDesC& aPath, RFile& aFile ); + + /** + * Analyse added widget + * + * @since S60 5.1 + * @param aNode Widget to be analyzed + * @return ETrue if fits, EFalse otherwise + */ + TBool AnalyseAddedWidgetL( CXnNode& aNode ); + + /** + * Disables layoyt and redraw, places cleanup item to cleanup stack + * for enabling layot and redraw + * + * @since Series 60 5.0 + */ + void DisableRenderUiLC(); + + /** + * Set event dispatcher + * + * @since Series 60 5.0 + * @param aDispather Event dispatcher + */ + void SetEventDispatcher( CXnKeyEventDispatcher* aDispatcher ); + +private: + + IMPORT_C static void EnableRenderUi( TAny* aAny ); + +private: + // constructors + + /** + * C++ default constructor. + */ + CXnUiEngineImpl( CXnUiEngine& aUiEngine, CXnAppUiAdapter& aAdapter ); + +private: + // new functions + + /** + * Prepares to the layout algorithm run + * + * @since Series 60 3.2 + */ + void PrepareRunLayoutL(); + + /** + * Runs the layout algorithm + * + * @since Series 60 3.2 + */ + TInt RunLayoutL( CXnNode* aNode ); + + /** + * Checks if layout is currently disabled + * + * @since Series 60 3.2 + */ + TBool IsLayoutDisabled(); + + void AddToRedrawListL( CXnNode* aNode, TRect aRect = + TRect::EUninitialized ); + + void AddToDirtyListL( CXnNode* aNode ); + + /** + * Finds a node where to start layout + * + * @since Series 60 5.0 + */ + CXnNode* StartLayoutFromL(); + + void ForceRenderUIL( TBool aLayoutOnly = EFalse ); + + CCoeControl* WindowOwningControl( CXnNode& aNode ); + + TXnDirtyRegion* FindDirtyRegionL( CXnNode& aNode ); + + void AddRedrawRectL( TRect aRect, CXnNode& aNode ); + + void ReportScreenDeviceChangeL(); + +private: + //Derived functions + + /** + * from MXnViewObserver + */ + void NotifyViewActivatedL( const CXnViewData& aViewData ); + + /** + * from MXnViewObserver + */ + void NotifyViewDeactivatedL( const CXnViewData& /*aViewData*/ ); + + /** + * from MXnViewObserver + */ + void NotifyConfigureWidgetL( const CHsContentInfo& /*aContentInfo*/, + CXnPluginData& /*aPluginData*/ ); + + /** + * from MXnViewObserver + */ + void NotifyWidgetAdditionL( const CXnPluginData& aPluginData ); + + /** + * from MXnViewObserver + */ + void NotifyWidgetRemovalL( const CXnPluginData& /*aPluginData*/ ); + + /** + * from MXnViewObserver + */ + void NotifyViewAdditionL( const CXnPluginData& /*aPluginData*/ ){}; + + /** + * from MXnViewObserver + */ + void NotifyViewRemovalL( const CXnPluginData& /*aPluginData*/ ){}; + +private: + // from MXnMenuObserver + + TBool DynInitMenuItemL( CXnNodeAppIf& aMenuItem, CXnNodeAppIf* aPlugin = NULL ); + +private: + // from MXnPropertyChangeObserver + + /** + * Property changed + * + * @since S60 5.1 + * @param aKey key value + * @param aValue property value + */ + void PropertyChangedL( const TUint32 aKey, const TInt aValue ); + +private: + // from MXnUiResourceChangeObserver + + /** + * @see MXnUiResourceChangeObserver + */ + void NotifyStatusPaneSizeChanged(); + + /** + * @see MXnUiResourceChangeObserver + */ + void NotifyResourceChanged( TInt aType ); + +private: + // Data + + /** Current screen device, Owned */ + CGraphicsDevice* iCurrentGraphicsDevice; + /** UI engine - received from constructor's input parameters, Not owned */ + CXnUiEngine* iUiEngine; + /** AppUi, Not owned */ + CXnAppUiAdapter& iAppUiAdapter; + /** Not owned. View manager */ + CXnViewManager& iViewManager; + /** Key event dispatcher, Not owned */ + CXnKeyEventDispatcher* iKeyEventDispatcher; + /** ControlAdapters, not owned */ + const RPointerArray< CXnControlAdapter >* iControlAdapterList; + /** Region pending redraw */ + RPointerArray<TXnDirtyRegion> iRedrawRegions; + /** List of currently dirty nodes */ + RPointerArray< CXnNode > iDirtyList; + /** Array of nodes which can be focused */ + RPointerArray< CXnNode > iFocusCandidateList; + /** current view */ + CXnNode* iCurrentView; + /** current view control adapter, not owned */ + CXnControlAdapter* iCurrentViewControlAdapter; + /** Controls layouting */ + TInt iLayoutControl; + /** Layout algo phase */ + TInt iLayoutPhase; + /** Unit in pixels (width). */ + TReal iHorizontalUnitInPixels; + /** Unit in pixels (height). */ + TReal iVerticalUnitInPixels; + /** Cached menu node */ + CXnNode* iMenuNode; + /** Cached styluspopup node */ + CXnNode* iStylusPopupNode; + /** Drawing area */ + TRect iClientRect; + /** Owned. Edit mode storage; */ + CXnEditMode* iEditMode; + /** Owned. hittest */ + CXnHitTest* iHitTest; + /** Disable count */ + TInt iDisableCount; + }; + +#endif // _CXNUIENGINEIMPL_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnuistatelistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnuistatelistener.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,240 @@ +/* +* 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: +* Xuikon UI state controller +* +*/ + +#ifndef XNUISTATELISTENER_H +#define XNUISTATELISTENER_H + +// System includes +#include <e32base.h> +#include <hwrmlight.h> +#include <eikspane.h> + +// User includes +#include "xnpropertysubscriber.h" + +// Forward declarations +class CXnAppUiAdapter; + +// Constants + +// Class declaration +/** + * UI resource change observer interface + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( MXnUiResourceChangeObserver ) + { +public: + /** + * Notifies statuspane is changed. + * + * @since S60 5.0 + */ + virtual void NotifyStatusPaneSizeChanged() = 0; + + /** + * Notifies resource changes + * + * @since S60 5.0 + * @param aType Resource type + */ + virtual void NotifyResourceChanged( TInt aType ) = 0; + + /** + * Notifies HW flip/slide status changes + * + * @since S60 5.0 + * @param aStatus flip/slide status + */ + /* virtual void NotifyFlipStatusChangedL( TInt aStatus ) = 0;*/ + }; + +// Class declaration +/** + * UI state observer interface + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( MXnUiStateObserver ) + { +public: + // new types + enum TForegroundStatus + { + EUnknown, + EBackground, + EForeground, + EPartialForeground, + }; +public: + /** + * Notifies foreground changes + * + * @since S60 5.0 + * @param aState Foreground state + */ + virtual void NotifyForegroundChanged( + TForegroundStatus aStatus ) = 0; + + /** + * Notifies primary display light status is changed. + * + * @since S60 5.0 + * @param aLightsOn ETrue if lights on, EFalse otherwise + */ + virtual void NotifyLightStatusChanged( TBool aLightsOn ) = 0; + + /** + * Notifies in-call state is changed. + * + * @since S60 5.0 + * @param aInCall ETrue if in-call on, EFalse otherwise + */ + virtual void NotifyInCallStateChaged( TBool aInCall ) = 0; + }; + +/** + * UI state listener + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CXnUiStateListener ) : public CBase, + public MCoeMessageMonitorObserver, + public MEikStatusPaneObserver, + public MHWRMLightObserver, + public MXnPropertyChangeObserver + { +private: + // friend classes + friend class CXnAppUiAdapterImpl; + +public: + /** + * Two-phased constructor. + */ + static CXnUiStateListener* NewL( CXnAppUiAdapter& aAdapter ); + static CXnUiStateListener* NewLC( CXnAppUiAdapter& aAdapter ); + + /** + * Destructor. + */ + ~CXnUiStateListener(); + +private: + /** + * 2nd phase construtor + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CXnUiStateListener( CXnAppUiAdapter& aAdapter ); + +public: + // New functions + + /* + * Adds MXnUiStateObserver + * + * @since S60 5.0 + * @param aObserver Observer to add + */ + void AddObserver( const MXnUiStateObserver& aObserver ); + + /* + * Removes MXnUiStateObserver + * + * @since S60 5.0 + * @param aObserver Observer to remove + */ + void RemoveObserver( const MXnUiStateObserver& aObserver ); + + /* + * Adds MXnUiResourceChangeObserver + * + * @since S60 5.0 + * @param aObserver Observer to add + */ + void AddObserver( const MXnUiResourceChangeObserver& aObserver ); + + /* + * Removes MXnUiResourceChangeObserver + * + * @since S60 5.0 + * @param aObserver Observer to remove + */ + void RemoveObserver( const MXnUiResourceChangeObserver& aObserver ); + +public: + void SetEditModeActive( TBool aActive ); + +private: + // New functions + void HandleResourceChangeL( TInt aType ); + +private: + // from MCoeMessageMonitorObserver + void MonitorWsMessage( const TWsEvent& aEvent ); + +private: + // from MEikStatusPaneObserver + void HandleStatusPaneSizeChange(); + +private: + // from MHWRMLightObserver + void LightStatusChanged( TInt aTarget, CHWRMLight::TLightStatus aStatus ); + +private: + // from MXnPropertyChangeObserver + void PropertyChangedL( const TUint32 aKey, const TInt aValue ); + +private: + // Data + + // AppUi, not owned */ + CXnAppUiAdapter& iAppUiAdapter; + /** Light status observer, Owned */ + CHWRMLight* iLightObserver; + /** Publish&Subscribe observer for call state, Owned */ + CXnPropertySubscriber* iCallStateObserver; + /** MXnUiStateObservers, Not owned */ + RPointerArray< MXnUiStateObserver > iUiStateObservers; + /** MXnUiResourceChangeObservers, Not owned */ + RPointerArray< MXnUiResourceChangeObserver > iResourceChangeObservers; + /** Foreground status */ + MXnUiStateObserver::TForegroundStatus iForegroundStatus; + /** Light status */ + CHWRMLight::TLightStatus iLightStatus; + /** In-call state */ + TBool iInCallState; + /** Last received foreground message */ + TInt iForegroundType; + }; + +#endif // XNUISTATELISTENER_H + +// End of file + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnviewadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnviewadapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,223 @@ +/* +* 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: Xuikon view adapter header file +* +*/ + +#ifndef XNVIEWADAPTER_H +#define XNVIEWADAPTER_H + +// System includes +#include <aknview.h> +#include <babitflags.h> + +// User includes +#include "xnuistatelistener.h" + +// Forward declarations +class CXnNode; +class CXnViewData; +class CXnViewManager; +class CXnAppUiAdapter; +class CXnControlAdapter; +class CXnKeyEventDispatcher; +class CXnBgControl; +class CXnFocusControl; + +// Class declaration +/** + * Adapts Xuikon view to Avkon view facilities. + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CXnViewAdapter ) : public CAknView, + public MXnUiStateObserver + { +private: + // friend classes + friend class CXnViewManager; + +public: + /** + * Two-phase constructor + */ + static CXnViewAdapter* NewL( CXnAppUiAdapter& aAdapter ); + + /** + * Destructor. + */ + ~CXnViewAdapter(); + +public: + // new functions + + /** + * Flushes view's internals, called when appplication UI is reloaded. + * + * @since S60 5.0 + */ + void ReloadUiL(); + + /** + * Notifies view it will be destroyed + * + * @since S60 5.0 + */ + void PrepareDestroy(); + + /** + * Gets event dispatcher + * + * @since S60 5.0 + * @return Event dispatcher + */ + CXnKeyEventDispatcher* EventDispatcher() const; + + /** + * Gets bg control + * + * @since S60 5.0 + * return Bg control + */ + CCoeControl& BgControl() const; + + /** + * Gets focus control + * + * @since S60 5.0 + * return Focus control + */ + CXnFocusControl& FocusControl() const; + + /** + * updates rsk by mode + * + * @since S60 5.0 + */ + void UpdateRskByModeL(); + +public: + // from CAknView + + /** + * @see CAknView + */ + TUid Id() const; + +private: + // from CAknView + + /** + * @see CAknView + */ + void DoActivateL( + const TVwsViewId &aPrevViewId, + TUid aCustomMessageId, + const TDesC8 &aCustomMessage ); + + /** + * @see CAknView + */ + void DoDeactivate(); + +private: + // from MXnUiStateObserver + + /** + * @see MXnUiStateObserver + */ + void NotifyForegroundChanged( + MXnUiStateObserver::TForegroundStatus aStatus ); + + /** + * @see MXnUiStateObserver + */ + void NotifyLightStatusChanged( TBool aLightsOn ); + + /** + * @see MXnUiStateObserver + */ + void NotifyInCallStateChaged( TBool aInCall ); + +private: + // new functions + + /** + * Changes current container's controls state. + * + * @since S60 5.0 + * @param aAwake ETrue if controls should exit from powersavemode, + * EFalse if controls should enter to powersavemode. + */ + void ChangeControlsStateL( TBool aAwake ); + + /** + * Activates new container ro view. + * Deactivates internally previous container if it exists. + * This is always called from DoActivateL or from CXnViewManager. + * + * @since S60 5.0 + * @param aContainer Container to activate + * @param aEnterEditState ETrue if activated container should be set to edit state. + */ + void ActivateContainerL( CXnViewData& aContainer, + TBool aEnterEditState = EFalse ); + + /** + * Deactivates the current container from view. + * + * @since S60 5.0 + */ + void DeactivateContainerL(); + +private: + + /** + * C++ Constructor + **/ + CXnViewAdapter( CXnAppUiAdapter& aAdapter ); + + /** + * Two-phased constructor. + */ + void ConstructL(); + +private: + // Data + + /** AppUi, Not owned */ + CXnAppUiAdapter& iAppUiAdapter; + /** Bg control, Owned */ + CXnBgControl* iBgControl; + /** Focus control, Owned */ + CXnFocusControl* iFocusControl; + /* Event dispatcher, Owned */ + CXnKeyEventDispatcher* iEventDispatcher; + /* Activate trigger, Owned */ + CXnNode* iActivate; + /* Deactivate trigger, Owned */ + CXnNode* iDeactivate; + /** EditState trigger, Owned */ + CXnNode* iEditState; + /** Active container, Not owned */ + const CXnViewData* iContainer; + /** Flags */ + TBitFlags32 iFlags; + }; + +#endif // XNVIEWADAPTER_H + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,220 @@ +/* +* 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 +* +*/ + + +#ifndef _XNVIEWDATA_H +#define _XNVIEWDATA_H + +// User inlcudes +#include "xnplugindata.h" + +// Forward declarations +class CXnViewManager; + +// Constants + +// Class declaration + +/** + * Holds view data in UiEngine + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CXnViewData ) : public CXnPluginData + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnViewData* NewL( CXnPluginData& aParent ); + static CXnViewData* NewLC( CXnPluginData& aParent ); + + ~CXnViewData(); + +private: + // private constructors + + CXnViewData( CXnPluginData& aParent ); + void ConstructL(); + +public: + // From CXnPluginData + + /** + * @see CXnPluginData + */ + void LoadL(); + + /** + * @see CXnPluginData + */ + void Destroy(); + + /** + * @see CXnPluginData + */ + void ResourcesL( CArrayPtrSeg< CXnResource >& aList ) const; + + /** + * @see CXnPluginData + */ + void ControlsL( RPointerArray< CXnControlAdapter >& aList ) const; + + /** + * @see CXnPluginData + */ + void ContentSourceNodesL( RPointerArray< CXnNode >& aList ) const; + + /** + * @see CXnPluginData + */ + void InitialFocusNodesL( RPointerArray< CXnNode >& aList ) const; + + /** + * @see CXnPluginData + */ + void AppearanceNodesL( RPointerArray< CXnNode >& aList ) const; + + /* + * @see CXnPluginData + */ + void LoadDataPluginsL(); + + /* + * @see CXnPluginData + */ + void DataPluginsLoadCompletedL( TInt aStatus ); + + /* + * @see CXnPluginData + */ + void DestroyDataPluginsL(); + + /* + * @see CXnPluginData + */ + TBool DataPluginsLoaded() const; + +public: + // New functions + + /** + * Sets viewdata to active/ not active + * + * @param aActive ETrue active, EFalse not active + */ + void SetActiveL( TBool aActive ); + + /** + * Returns if active or not + * + * @return ETrue active, EFalse otherwise + */ + inline TBool Active() const; + + /** + * Sets viewdata to be initial + */ + inline void SetInitial(); + + /** + * Returns if initial or not + * + * @return ETrue initial, EFalse otherwise + */ + 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 + */ + inline void SetUseEmptyWidget( TBool aUse ); + + /** + * Returns whether empty widget is in use in this view + * + * @return ETrue if empty widget is used, EFalse otherwise + */ + inline TBool UseEmptyWidget() const; + + /** + * Finds and reurns plugin/view data for node + * + * @param aNode Node + * @return Plugin data + */ + CXnPluginData& Plugin( CXnNode* aNode ); + + /** + * Finds and reurns plugin/view data for namespace + * + * @param aNamespace Namespace + * @return Plugin data + */ + CXnPluginData* Plugin( const TDesC8& aNamespace ); + + /** + * Gets view data's plugin nodes + * + * @param aList Data returned in list + */ + void PluginNodesL( RPointerArray< CXnNode >& aList ) const; + + /** + * return view data's view node + * + * @return View node + */ + CXnNode* ViewNode() const; + + /** + * Sets view's locking_status attribute (locked/none) to determine if view + * is prevented from removing/deleting or not + * + * @param aLockingStatusString attr. locking_status ("locked"/"none") + */ + void SetLockingStatus( const TDesC8& aLockingStatusString ); +private: + // data + + /** Focused Node, Not owned */ + CXnNode* iFocusedNode; + + }; + +#include "xnviewdata.inl" + +#endif // _XNVIEWDATA_H diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,92 @@ +/* +* 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 view info - inline functions +* +*/ + + +#ifndef _XNVIEWDATA_INL_ +#define _XNVIEWDATA_INL_ + +// --------------------------------------------------------------------------- +// Returns if active or not +// --------------------------------------------------------------------------- +// +inline TBool CXnViewData::Active() const + { + return ( iFlags.IsSet( EIsActive ) ? ETrue : EFalse ); + }; + +// --------------------------------------------------------------------------- +// Sets viewdata to be initial +// --------------------------------------------------------------------------- +// +inline void CXnViewData::SetInitial() + { + iFlags.Set( EIsInitial ); + }; + +// --------------------------------------------------------------------------- +// Returns if initial or not +// --------------------------------------------------------------------------- +// +inline TBool CXnViewData::Initial() const + { + return ( iFlags.IsSet( EIsInitial ) ? ETrue : EFalse ); + }; + +// --------------------------------------------------------------------------- +// 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 +// --------------------------------------------------------------------------- +// +inline void CXnViewData::SetUseEmptyWidget( TBool aUse ) + { + if( aUse ) + { + iFlags.Set( EUseEmpty ); + } + else + { + iFlags.Clear( EUseEmpty ); + } + }; + +// --------------------------------------------------------------------------- +// Returns whether to use empty widget +// --------------------------------------------------------------------------- +// +inline TBool CXnViewData::UseEmptyWidget() const + { + return ( iFlags.IsSet( EUseEmpty ) ? ETrue : EFalse ); + }; + +#endif // _XNVIEWDATA_INL_ diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnviewsnodeimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnviewsnodeimpl.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,98 @@ +/* +* 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: Views node implementation +* +*/ + + +#ifndef __XNVIEWSNODEIMPL_H__ +#define __XNVIEWSNODEIMPL_H__ + +// System includes +#include <e32base.h> + +// User includes +#include "xnnodeimpl.h" + +// Forward declarations +class CXnType; +class CXnComponent; + +// Class declaration + +/** + * Implementation of views node. + * + * @ingroup group_xnlayoutengine + * @lib xn3layoutengine.lib + * @since Series 60 3.1 + */ +class CXnViewsNodeImpl : public CXnNodeImpl + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + * + * @param aType Type. + */ + IMPORT_C static CXnViewsNodeImpl* NewL( CXnType* aType ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CXnViewsNodeImpl(); + +public: + // New functions + + /** + * Gets the component associated with the node impl + * + * @since Series 60 3.1 + * @return Component associated with the node impl + */ + IMPORT_C CXnComponent* Component(); + + /** + * Sets the component associated with the node impl + * + * @since Series 60 3.1 + * @param aComponent Component associated with the node impl + */ + IMPORT_C void SetComponent( CXnComponent* aComponent ); + +protected: + + /** + * C++ default constructor. + */ + IMPORT_C CXnViewsNodeImpl(); + + /** + * Two-phased constructor. + * + * @param aType Type. + */ + IMPORT_C void ConstructL( CXnType* aType ); + +private: + // Data + + /** Component associated with the node impl */ + CXnComponent* iComponent; + }; + +#endif // __XNVIEWSNODEIMPL_H__ diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnwallpapercontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnwallpapercontainer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,85 @@ +/* +* 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: Wallpaper view's container. +* +*/ + + + +#ifndef XNWALLPAPERCONTAINER_H +#define XNWALLPAPERCONTAINER_H + +// INCLUDES +#include <coecntrl.h> +#include <AknsBasicBackgroundControlContext.h> + +// CLASS DECLARATION + +/** +* Wallpaper container. +* Contains wallpaper setting items. +* +* @since S60 v5.0 +*/ +NONSHARABLE_CLASS( CXnWallpaperContainer ) : public CCoeControl + { +public: + /** + * Two-phased constructor. + * @return new instance of CXnWallpaperContainer. + */ + static CXnWallpaperContainer* NewL(); + + /** + * Destructor. + */ + ~CXnWallpaperContainer(); + + /** + * From CCoeControl + */ + void Draw( const TRect& aRect ) const; + +private: + /** + * From CCoeControl + */ + virtual void SizeChanged(); + + /** + * From CCoeControl + */ + virtual void HandleResourceChange(TInt aType); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CXnWallpaperContainer(); + +private: + /** + * Background context. + * Own. + */ + CAknsBasicBackgroundControlContext* iBgContext; + }; + +#endif // XNWALLPAPERCONTAINER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnwallpaperview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnwallpaperview.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Wallpaper view. View is used to get skin background +* to image selection grid. +* +*/ + + + +#ifndef CXNWALLPAPERVIEW_H +#define CXNWALLPAPERVIEW_H + +// INCLUDES +#include <aknview.h> + +class CXnWallpaperContainer; +class CXnUiEngine; + +// CONSTANTS +const TUid KWallpaperViewUid = { 0x200286DB }; + +// CLASS DECLARATION + +/** +* Wallpaper view. +* Possible to define current Idle background image. +* +* @since S60 v5.0 +*/ +NONSHARABLE_CLASS( CXnWallpaperView ) : public CAknView + { +public: + + /** + * Two-phased constructor. + * @return new instance of CXnWallpaperView. + */ + static CXnWallpaperView* NewL( CXnUiEngine& aEngine ); + + /** + * Destructor. + */ + ~CXnWallpaperView(); + + /** + * From CAknView. + * Returns view id. + * @return An unsigned integer (view id). + */ + TUid Id() const; + +private: + + /* From CAknView. */ + void DoActivateL( + const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /* From CAknView. */ + void DoDeactivate(); + + /** + * C++ default constructor. + */ + CXnWallpaperView( CXnUiEngine& aEngine ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + +private: // data + + /** + * Wallpaper container. + * Own. + */ + CXnWallpaperContainer* iContainer; + + /** + * Reference to uiengine. + */ + CXnUiEngine& iEngine; + }; + +#endif // CXNWALLPAPERVIEW_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/inc/xnwidgetextensionadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnwidgetextensionadapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Widget extension adapter +* +*/ + +#ifndef __XNWIDGETEXTENSIONADAPTER_H__ +#define __XNWIDGETEXTENSIONADAPTER_H__ + +// INCLUDES +#include "xncontroladapter.h" +#include <e32base.h> + +#include "xncontroladapter.h" + +// Forward declarations +class CXnAppUiAdapter; +class CXnNode; +class CXnUiEngine; + +// CLASS DECLARATION + +/** +* @ingroup group_xnlayoutengine +* Popup Control adapter interface class +* @lib xnlayoutengine.lib +* @since Series 60 5.0 +*/ +NONSHARABLE_CLASS( CXnWidgetExtensionAdapter ) : public CXnControlAdapter/*, + public MCoeMessageMonitorObserver*/ + { + 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 ); + + /** + * see CCoeControl + */ + void HandlePointerEventL(const TPointerEvent& aPointerEvent); + + /** + * see CCoeControl + */ + void Draw(const TRect& aRect) const; + + private: // Constructors + /** + * C++ default constructor. + */ + CXnWidgetExtensionAdapter( CXnNodePluginIf& aNode ); + + /** + * 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; + + + }; + +#endif // __XNWIDGETEXTENSIONADAPTER_H__ + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnapplication.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnapplication.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,61 @@ +/* +* 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: Base class of all Xuikon-based applications +* +*/ + +// INCLUDE FILES +#include "xnapplication.h" +#include "xndocument.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnApplication::CXnApplication +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnApplication::CXnApplication( TUid aApplicationUid ) + { + iApplicationUid = aApplicationUid; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnApplication::~CXnApplication() + { + } + +// ----------------------------------------------------------------------------- +// CXnApplication::AppDllUid +// Returns the application uid. +// ----------------------------------------------------------------------------- +// +EXPORT_C TUid CXnApplication::AppDllUid() const + { + return iApplicationUid; + } + +// ----------------------------------------------------------------------------- +// CXnApplication::CreateDocumentL +// Creates a document +// ----------------------------------------------------------------------------- +// +EXPORT_C CApaDocument* CXnApplication::CreateDocumentL() + { + return new ( ELeave ) CXnDocument( *this, iApplicationUid ); + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnappuiadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnappuiadapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,343 @@ +/* +* 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 Avkon AppUi adapter +* +*/ + +// System includes +#include <aknview.h> +#include <akntoolbar.h> + +// User includes +#include "xnappuiadapter.h" +#include "xnappuiadapterimpl.h" +#include "xnviewadapter.h" +#include "xnuiengineappif.h" +#include "xnfocuscontrol.h" + +#include "xuikon_builds_cfg.hrh" + +#ifdef _XN_PERFORMANCE_TEST_ +#include "xntimemon.h" +#endif + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::CXnAppUiAdapter +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnAppUiAdapter::CXnAppUiAdapter( TUid aApplicationUid ) + : iApplicationUid( aApplicationUid ) + { + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::ConstructL +// Second-phase constructor +// ----------------------------------------------------------------------------- +// +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_ + + CAknViewAppUi::BaseConstructL( EAknEnableSkin | EAknEnableMSK ); + + CAknToolbar* toolbar( CurrentFixedToolbar() ); + + if ( toolbar ) + { + toolbar->SetToolbarVisibility( EFalse ); + + 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_ + + 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_ + } + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnAppUiAdapter::~CXnAppUiAdapter() + { + delete iUiEngineAppIf; + + delete iImpl; + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::HandleResourceChangeL +// Handles resource changes +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnAppUiAdapter::HandleResourceChangeL( TInt aType ) + { +#ifdef _XN_PERFORMANCE_TEST_ + RDebug::Print( _L( "CXnAppUiAdapter::HandleResourceChangeL - start" ) ); +#endif //_XN_PERFORMANCE_TEST_ + + CAknViewAppUi::HandleResourceChangeL( aType ); + + if ( iImpl ) + { + iImpl->HandleResourceChangeL( aType ); + } + +#ifdef _XN_PERFORMANCE_TEST_ + RDebug::Print( _L( "CXnAppUiAdapter::HandleResourceChangeL - end" ) ); +#endif //_XN_PERFORMANCE_TEST_ + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::UiEngine +// Get UI engine proxy +// ----------------------------------------------------------------------------- +// +EXPORT_C TXnUiEngineAppIf* CXnAppUiAdapter::UiEngineL() + { + if ( !iUiEngineAppIf ) + { + iUiEngineAppIf = new ( ELeave ) TXnUiEngineAppIf( UiEngine() ); + } + + return iUiEngineAppIf; + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::HandleXuikonEventL +// Handle callbacks from the engine +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnAppUiAdapter::HandleXuikonEventL( + CXnNodeAppIf& /*aOrigin*/, + CXnNodeAppIf& /*aTrigger*/, + CXnDomNode& /*aTriggerDefinition*/, + CXnDomNode& /*aEvent*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::LoadDataPluginsL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnAppUiAdapter::LoadDataPluginsL( + RPointerArray< CXnNodeAppIf >& /*aList*/ ) + { + // Default empty implementation + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::DestroyDataPluginsL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnAppUiAdapter::DestroyDataPluginsL( + RPointerArray< CXnNodeAppIf >& /*aList*/ ) + { + // Default empty implementation + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::DynInitMenuItemL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CXnAppUiAdapter::DynInitMenuItemL( const TDesC& /*aItemType*/, + RPointerArray< CXnNodeAppIf >* /*aList*/ ) + { + // Default empty implementation + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::SetOnlineStateL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnAppUiAdapter::SetOnlineStateL( + RPointerArray< CXnNodeAppIf >& /*aList*/ ) + { + // Default empty implementation + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::View +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CAknView& CXnAppUiAdapter::View() const + { + return iImpl->ViewAdapter(); + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::HandlePageSwitch +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnAppUiAdapter::HandlePageSwitch() + { + // Default empty implementation + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::HandleEnterEditModeL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnAppUiAdapter::HandleEnterEditModeL( TBool /*aEnter*/ ) + { + // Default empty implementation + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::ReloadUiL +// +// ----------------------------------------------------------------------------- +// +void CXnAppUiAdapter::ReloadUiL() + { + iImpl->ReloadUiL(); + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::UiEngine +// +// ----------------------------------------------------------------------------- +// +CXnUiEngine& CXnAppUiAdapter::UiEngine() const + { + return iImpl->UiEngine(); + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::ViewManager +// +// ----------------------------------------------------------------------------- +// +CXnViewManager& CXnAppUiAdapter::ViewManager() const + { + return iImpl->ViewManager(); + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::ViewAdapter +// +// ----------------------------------------------------------------------------- +// +CXnViewAdapter& CXnAppUiAdapter::ViewAdapter() const + { + return iImpl->ViewAdapter(); + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::UiStateListener +// +// ----------------------------------------------------------------------------- +// +CXnUiStateListener& CXnAppUiAdapter::UiStateListener() const + { + return iImpl->UiStateListener(); + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::HsContentController +// +// ----------------------------------------------------------------------------- +// +MHsContentControlUi* CXnAppUiAdapter::HsContentController( + const TDesC8& aType ) const + { + return iImpl->HsContentController( aType ); + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::EffectManager +// +// ----------------------------------------------------------------------------- +// +CXnEffectManager* CXnAppUiAdapter::EffectManager() const + { + return iImpl->EffectManager(); + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::HsContentControlSrv +// +// ----------------------------------------------------------------------------- +// +MHsContentControl* CXnAppUiAdapter::HsContentControlSrv() const + { + return iImpl->HsContentControlSrv(); + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::FocusShown +// +// ----------------------------------------------------------------------------- +// +TBool CXnAppUiAdapter::FocusShown() const + { + return iImpl->ViewAdapter().FocusControl().IsVisible(); + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::HideFocus +// +// ----------------------------------------------------------------------------- +// +void CXnAppUiAdapter::HideFocus() + { + return iImpl->ViewAdapter().FocusControl().MakeVisible( EFalse ); + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapter::ShowFocus +// +// ----------------------------------------------------------------------------- +// +void CXnAppUiAdapter::ShowFocus() + { + return iImpl->ViewAdapter().FocusControl().MakeVisible( ETrue ); + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnappuiadapterimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnappuiadapterimpl.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,244 @@ +/* +* 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 Avkon adapter +* +*/ + +// System includes +#include <hsccproviderclient.h> +#include <hscontentcontroller.h> +#include <hscontentcontrolui.h> +#include <bautils.h> +#include <data_caging_path_literals.hrh> + +// User includes +#include "xnappuiadapter.h" +#include "xnuiengine.h" +#include "xnviewmanager.h" +#include "xnviewadapter.h" +#include "xnuistatelistener.h" +#include "hscontentcontrolfactory.h" +#include "xneditor.h" +#include "xnwallpaperview.h" +#include "xneffectmanager.h" + +#include "xnappuiadapterimpl.h" + +// Constants +_LIT( KResourceDrive, "z:" ); +_LIT( KResourceFile, "xnuiengine.rsc" ); + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnAppUiAdapterImpl* CXnAppUiAdapterImpl::NewL( TUid aApplicationUid, + CXnAppUiAdapter& aAdapter ) + { + return new ( ELeave ) CXnAppUiAdapterImpl( aApplicationUid, aAdapter ); + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::CXnAppUiAdapterImpl +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnAppUiAdapterImpl::CXnAppUiAdapterImpl( TUid aApplicationUid, + CXnAppUiAdapter& aAdapter ) + : iAdapter( aAdapter ), iApplicationUid( aApplicationUid ) + { + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::ConstructL +// Second-phase constructor +// ----------------------------------------------------------------------------- +// +void CXnAppUiAdapterImpl::ConstructL() + { +#ifdef _XN_PERFORMANCE_TEST_ + RDebug::Print( _L( "CXnAppUiAdapterImpl::ConstructL() - start" ) ); +#endif //_XN_PERFORMANCE_TEST_ + + TFileName resFile; + resFile.Append( KResourceDrive ); + resFile.Append( KDC_APP_RESOURCE_DIR ); + resFile.Append( KResourceFile ); + BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), + resFile ); + + iResourceOffset = CCoeEnv::Static()->AddResourceFileL( resFile ); + + iContentControlFactory = CHsContentControlFactory::NewL(); + + iUiStateListener = CXnUiStateListener::NewL( iAdapter ); + + iViewManager = CXnViewManager::NewL( iAdapter ); + + iUiEngine = CXnUiEngine::NewL( iAdapter ); + + iViewManager->SetUiEngine( *iUiEngine ); + + // iViewAdapter is owned by CAknViewAppUi + iViewAdapter = CXnViewAdapter::NewL( iAdapter ); + + iViewManager->LoadUiL(); + + iCcProviderClient = CHsCcProviderClient::NewL( iViewManager->Editor() ); + + CXnWallpaperView* wallpaper = CXnWallpaperView::NewL( *iUiEngine ); + iAdapter.AddViewL( wallpaper ); + + iEffectManager = CXnEffectManager::NewL(); + +#ifdef _XN_PERFORMANCE_TEST_ + RDebug::Print( _L( "CXnAppUiAdapterImpl::ConstructL() - end" ) ); +#endif //_XN_PERFORMANCE_TEST_ + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::ReloadUiL +// Reloads UI when application root configuration is changed +// ----------------------------------------------------------------------------- +// +void CXnAppUiAdapterImpl::ReloadUiL() + { +#ifdef _XN_PERFORMANCE_TEST_ + RDebug::Print( _L( "CXnAppUiAdapterImpl::ReloadUiL() - start" ) ); +#endif //_XN_PERFORMANCE_TEST_ + + iViewAdapter->ReloadUiL(); + + iViewManager->ReloadUiL(); + +#ifdef _XN_PERFORMANCE_TEST_ + RDebug::Print( _L( "CXnAppUiAdapterImpl::ReloadUiL() - end" ) ); +#endif //_XN_PERFORMANCE_TEST_ + } + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +CXnAppUiAdapterImpl::~CXnAppUiAdapterImpl() + { + if ( iViewAdapter ) + { + iViewAdapter->PrepareDestroy(); + } + + delete iContentControlFactory; + + delete iUiEngine; + + delete iUiStateListener; + + delete iViewManager; + + delete iCcProviderClient; + + delete iEffectManager; + + CCoeEnv::Static()->DeleteResourceFile( iResourceOffset ) ; + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::UiEngine +// Gets UI engine +// ----------------------------------------------------------------------------- +// +CXnUiEngine& CXnAppUiAdapterImpl::UiEngine() const + { + return *iUiEngine; + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::ViewAdapter +// Gets view adapter +// ----------------------------------------------------------------------------- +// +CXnViewAdapter& CXnAppUiAdapterImpl::ViewAdapter() const + { + return *iViewAdapter; + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::ViewManager +// Gets view manager +// ----------------------------------------------------------------------------- +// +CXnViewManager& CXnAppUiAdapterImpl::ViewManager() const + { + return *iViewManager; + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::UiStateListener +// Gets UI state listener +// ----------------------------------------------------------------------------- +// +CXnUiStateListener& CXnAppUiAdapterImpl::UiStateListener() const + { + return *iUiStateListener; + } + + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::HsContentController +// Gets Content control UI interface +// ----------------------------------------------------------------------------- +// +MHsContentControlUi* CXnAppUiAdapterImpl::HsContentController( + const TDesC8& aType ) const + { + return iContentControlFactory->GetHsContentController( aType ); + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::EffectManager +// Get effect manager. +// ----------------------------------------------------------------------------- +// +CXnEffectManager* CXnAppUiAdapterImpl::EffectManager() const + { + return iEffectManager; + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::HsContentControlSrv +// Gets Content control server interface +// ----------------------------------------------------------------------------- +// +MHsContentControl* CXnAppUiAdapterImpl::HsContentControlSrv() const + { + return iCcProviderClient; + } + +// ----------------------------------------------------------------------------- +// CXnAppUiAdapterImpl::HandleResourceChangeL +// Handles resource changes +// ----------------------------------------------------------------------------- +// +void CXnAppUiAdapterImpl::HandleResourceChangeL( TInt aType ) + { + iUiStateListener->HandleResourceChangeL( aType ); + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnbgcontrol.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnbgcontrol.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,233 @@ +/* +* 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 <aknappui.h> +#include <AknUtils.h> +#include <AknsUtils.h> +#include <AknsDrawUtils.h> +#include <AknsLayeredBackgroundControlContext.h> +#include <gdi.h> + +// User includes +#include "xnappuiadapter.h" +#include "xnuiengine.h" +#include "xneditmode.h" +#include "xnviewadapter.h" +#include "xnfocuscontrol.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() + { + delete iBgContext; + } + +// ----------------------------------------------------------------------------- +// CXnBgControl::CXnBgControl() +// C++ default constructor. +// ----------------------------------------------------------------------------- +// +CXnBgControl::CXnBgControl() + { + } + +// ----------------------------------------------------------------------------- +// CXnBgControl::ConstructL() +// 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CXnBgControl::ConstructL() + { + CreateWindowL(); + + EnableDragEvents(); + + Window().SetPointerGrab( ETrue ); + + iBgContext = CAknsLayeredBackgroundControlContext::NewL( + KAknsIIDWallpaper, TRect(), ETrue, 1 ); + + ActivateL(); + + MakeVisible( ETrue ); + + SetComponentsToInheritVisibility( ETrue ); + } + +// ----------------------------------------------------------------------------- +// 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() + { + TRect rect; + +#ifdef RD_FULLSCREEN_WALLPAPER + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, rect ); +#else + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect ); +#endif + + iBgContext->SetRect( rect ); + } + +// ----------------------------------------------------------------------------- +// 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 + { + MAknsSkinInstance* skin( AknsUtils::SkinInstance() ); + + AknsDrawUtils::Background( skin, iBgContext, this, gc, aRect ); + } + } + +// ----------------------------------------------------------------------------- +// CXnBgControl::SetCompoundControl() +// +// ----------------------------------------------------------------------------- +// +void CXnBgControl::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + 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; + } + +// End of file + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xncomponent.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xncomponent.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,152 @@ +/* +* 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: Xuikon component source +* +*/ + +// INCLUDES +#include "xncomponent.h" +#include "xncontroladapter.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnComponent::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnComponent* CXnComponent::NewL() + { + CXnComponent* self = new ( ELeave ) CXnComponent; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnComponent::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnComponent::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnComponent::CXnComponent() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnComponent::CXnComponent() + { + } + +// ----------------------------------------------------------------------------- +// CXnComponent::~CXnComponent() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnComponent::~CXnComponent() + { + delete iAdapter; + } + +// ----------------------------------------------------------------------------- +// CXnComponent::SetControlAdapter() +// Sets component control adapter. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnComponent::SetControlAdapter( CXnControlAdapter* aAdapter ) + { + if ( iAdapter ) + { + return; + } + iAdapter = aAdapter; + if ( iAdapter ) + { + iAdapter->SetComponent( this ); + } + } + +// ----------------------------------------------------------------------------- +// CXnComponent::ControlAdapter() +// Returns pointer to component control adapter. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnControlAdapter* CXnComponent::ControlAdapter() + { + return iAdapter; + } + +// ----------------------------------------------------------------------------- +// CXnComponent::Node +// Returns node associated with the component +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnNodePluginIf* CXnComponent::Node() + { + return iNode; + } + +// ----------------------------------------------------------------------------- +// CXnComponent::SetNode +// Sets node associated with the component +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnComponent::SetNode( CXnNodePluginIf& aNode ) + { + iNode = &aNode; + } + +// ----------------------------------------------------------------------------- +// CXnComponent::EnterPowerSaveModeL +// Enter power save mode +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnComponent::EnterPowerSaveModeL() + { + if ( iAdapter ) + { + iAdapter->EnterPowerSaveModeL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnComponent::ExitPowerSaveModeL +// Exit power save mode +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnComponent::ExitPowerSaveModeL() + { + if ( iAdapter ) + { + iAdapter->ExitPowerSaveModeL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnComponent::MakeInterfaceL +// Create a component interface according to the given type. +// ----------------------------------------------------------------------------- +// +EXPORT_C XnComponentInterface::MXnComponentInterface* CXnComponent::MakeInterfaceL( + const TDesC8& /*aType*/ ) + { + return NULL; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xncomponentfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xncomponentfactory.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,181 @@ +/* +* 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: Component factory interface +* +*/ + +// User includes +#include "xnappuiadapter.h" +#include "xnviewadapter.h" +#include "xncomponentfactory.h" +#include "xncomponent.h" +#include "xnnodepluginif.h" +#include "xncomponentnodeimpl.h" +#include "xnviewnodeimpl.h" +#include "xncontroladapter.h" +#include "xnpanic.h" +#include "xntype.h" + +// Constants +_LIT8( KToolTip, "tooltip" ); +_LIT8( KView, "view" ); + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// FindParentAdapter +// Find a parent control adapter up the node chain +// ----------------------------------------------------------------------------- +// +static CXnControlAdapter* FindParentAdapter( CXnNode& aNode ) + { + CXnNode* parent( aNode.Parent() ); + + for( ; parent; parent = parent->Parent() ) + { + CXnControlAdapter* control( parent->Control() ); + + if( control ) + { + return control; + } + } + + return NULL; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// MXnComponentFactory::MXnComponentFactory +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C MXnComponentFactory::MXnComponentFactory() + { + } + +// ----------------------------------------------------------------------------- +// MXnComponentFactory::CreateXnComponentL +// Creates a component +// ----------------------------------------------------------------------------- +// +EXPORT_C MXnComponentFactory::TXnComponentFactoryResponse MXnComponentFactory::CreateXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent ) + { + const TDesC8& type( aNode.Type()->Type() ); + + MXnComponentFactory::TXnComponentFactoryResponse response = + MakeXnComponentL( aNode, aTargetComponent ); + + CleanupStack::PushL( aTargetComponent ); + + if ( response != EXnFactoryResponseComponentConstructed ) + { + CleanupStack::PopAndDestroy( aTargetComponent ); + + return response; + } + + CXnControlAdapter* parentAdapter( FindParentAdapter( aNode.Node() ) ); + CXnControlAdapter* adapter( MakeXnControlAdapterL( aNode, parentAdapter ) ); + + aTargetComponent->SetNode( aNode ); + + if ( type == KView ) + { + CXnAppUiAdapter* appui = static_cast< CXnAppUiAdapter* >( iAvkonAppUi ); + + adapter->SetContainerWindowL( appui->ViewAdapter().BgControl() ); + + aNode.ViewNodeImpl()->SetComponent( aTargetComponent ); + } + else + { + aNode.ComponentNodeImpl()->SetComponent( aTargetComponent ); + } + + if ( parentAdapter ) + { + parentAdapter->AppendChildL( *adapter, aNode.Node() ); + } + + aTargetComponent->SetControlAdapter( adapter ); + + if ( !adapter ) + { + CleanupStack::Pop( aTargetComponent ); + + return response; + } + + adapter->SetComponent( aTargetComponent ); + adapter->SetComponentsToInheritVisibility( ETrue ); + adapter->MakeVisible( EFalse ); + + if ( type != KToolTip ) + { + // Don't activate tooltip yet + adapter->ActivateL(); + } + + CleanupStack::Pop( aTargetComponent ); + + return response; + } + +// ----------------------------------------------------------------------------- +// MXnComponentFactory::DoesNodeNeedComponentImplL +// Check whether a node needs a component node implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool MXnComponentFactory::DoesNodeNeedComponentImplL( + const TDesC8& /*aType*/ ) + { + return ETrue; + } + +// ----------------------------------------------------------------------------- +// MXnComponentFactory::MakeXnComponentL +// Factory method to create component +// ----------------------------------------------------------------------------- +// +EXPORT_C MXnComponentFactory::TXnComponentFactoryResponse MXnComponentFactory::MakeXnComponentL( + CXnNodePluginIf& /*aNode*/, + CXnComponent*& /*aTargetComponent*/ ) + { + return EXnFactoryResponseComponentNotSupported; + } + +// ----------------------------------------------------------------------------- +// MXnComponentFactory::MakeXnComponentL +// Factory method to create control adapter +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnControlAdapter* MXnComponentFactory::MakeXnControlAdapterL( + CXnNodePluginIf& /*aNode*/, + CXnControlAdapter* /*aParent*/ ) + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// Default destructor +// ----------------------------------------------------------------------------- +// +EXPORT_C MXnComponentFactory::~MXnComponentFactory() + { + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xncomponentnodeimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xncomponentnodeimpl.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,124 @@ +/* +* 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: Xuikon component node implementation source +* +*/ + +// INCLUDES +#include "xncomponentnodeimpl.h" +#include "xncomponent.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnComponentNodeImpl::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnComponentNodeImpl* CXnComponentNodeImpl::NewL( CXnType* aType ) + { + CXnComponentNodeImpl* self = new ( ELeave ) CXnComponentNodeImpl; + + CleanupStack::PushL( self ); + self->ConstructL( aType ); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnComponentNodeImpl::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnComponentNodeImpl::ConstructL( CXnType* aType ) + { + CXnNodeImpl::ConstructL( aType ); + iComponentNeedsCreation = ETrue; + } + +// ----------------------------------------------------------------------------- +// CXnComponentNodeImpl::CXnComponentNodeImpl() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnComponentNodeImpl::CXnComponentNodeImpl() + { + } + +// ----------------------------------------------------------------------------- +// CXnComponentNodeImpl::~CXnComponentNodeImpl() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnComponentNodeImpl::~CXnComponentNodeImpl() + { + delete iComponent; + } + +// ----------------------------------------------------------------------------- +// CXnComponentNodeImpl::Component +// Return the component +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnComponent* CXnComponentNodeImpl::Component() + { + return iComponent; + } + +// ----------------------------------------------------------------------------- +// CXnComponentNodeImpl::SetComponent +// Set the component +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnComponentNodeImpl::SetComponent( CXnComponent* aComponent ) + { + iComponent = aComponent; + } + +// ----------------------------------------------------------------------------- +// CXnComponentNodeImpl::DoesComponentNeedCreation +// Check whether the component is to be created +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CXnComponentNodeImpl::DoesComponentNeedCreation() const + { + return iComponentNeedsCreation; + } + +// ----------------------------------------------------------------------------- +// CXnComponentNodeImpl::SetComponentNeedsCreation +// Set whether the component is to be created +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnComponentNodeImpl::SetComponentNeedsCreation( TBool aFlag ) + { + iComponentNeedsCreation = aFlag; + } + +// ----------------------------------------------------------------------------- +// CXnComponentNodeImpl::MakeInterfaceL +// Create a component interface according to the given type. +// ----------------------------------------------------------------------------- +// +EXPORT_C XnComponentInterface::MXnComponentInterface* CXnComponentNodeImpl::MakeInterfaceL( + const TDesC8& aType ) + { + if ( !iComponent ) + { + return NULL; + } + return iComponent->MakeInterfaceL( aType ); + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xncomposer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xncomposer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,833 @@ +/* +* 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: Application configuration composer +* +*/ + +// System includes +#include <s32file.h> + +// User includes +#include "xncomposer.h" +#include "xnplugindata.h" +#include "xnrootdata.h" +#include "xnviewdata.h" +#include "xnodt.h" +#include "xnproperty.h" +#include "xnresource.h" +#include "xndomdocument.h" +#include "xndomnode.h" +#include "xndomlist.h" +#include "xndomattribute.h" +#include "xnpanic.h" +#include "xnplugindefs.h" + +// Constants +_LIT8( KStateWaitConfirmation, "WaitForConfirmation" ); +_LIT8( KStateError, "Error" ); + +_LIT8( KXmluiml, "xmluiml" ); +_LIT8( KApp, "application" ); +_LIT8( KViews, "views" ); +_LIT8( KWidget, "widget" ); +_LIT8( KUseEmptyWidget, "use_empty_widget" ); +_LIT8( KRemovable, "removable" ); + +_LIT8( KEmptyWidgetUid, "0x2001F47F" ); + +_LIT( KCDrive, "C:" ); +_LIT8( KTagXuikon, "xuikon" ); + +using namespace hspswrapper; + +// ======== LOCAL FUNCTIONS ======== +// --------------------------------------------------------------------------- +// Finds recursively node by name +// @return returns pointer to desired node, NULL if nothing found +// --------------------------------------------------------------------------- +// +CXnDomNode* FindNodeByName( CXnDomNode* aNode, const TDesC8& aName ) + { + if ( !aNode ) + { + return NULL; + } + + if ( aNode->Name() == aName ) + { + return aNode; + } + + CXnDomList& list( aNode->ChildNodes() ); + + for ( TInt i = 0; i < list.Length() ; i++ ) + { + CXnDomNode* retval( FindNodeByName( + static_cast< CXnDomNode* >( list.Item( i ) ), aName ) ); + + if ( retval ) + { + return retval; + } + } + + return NULL; + } + +// --------------------------------------------------------------------------- +// FindNodeById +// Finds recursively node by id +// @return returns pointer to desired node, NULL if nothing found +// --------------------------------------------------------------------------- +// +CXnDomNode* FindNodeById( CXnDomNode* aNode, const TDesC8& aId ) + { + if ( !aNode ) + { + return NULL; + } + + CXnDomList& attributes( aNode->AttributeList() ); + + CXnDomAttribute* id( + static_cast< CXnDomAttribute* >( + attributes.FindByName( XnPropertyNames::common::KId ) ) ); + + if ( id && id->Value() == aId ) + { + return aNode; + } + + CXnDomList& list( aNode->ChildNodes() ); + + for ( TInt i = 0; i < list.Length() ; i++ ) + { + CXnDomNode* retval( FindNodeById( + static_cast< CXnDomNode* >( list.Item( i ) ), aId ) ); + + if ( retval ) + { + return retval; + } + } + + return NULL; + } + +// ---------------------------------------------------------------------------- +// UpdateResourcesPathL +// ---------------------------------------------------------------------------- +// +static void UpdateResourcesPathL( CArrayPtrSeg< CXnResource >& aList, + TPtrC aNewPath ) + { + TFileName newFilename; + + for ( TInt i = 0; i < aList.Count(); i++ ) + { + CXnResource& res( *aList[i] ); + const TDesC& filename( res.FileName() ); + + TParsePtrC fileParser( filename ); + TPtrC nameAndExt( fileParser.NameAndExt() ); + + newFilename = aNewPath; + newFilename.Append( nameAndExt ); + + res.SetFileNameL( newFilename ); + } + } + +// -------------------------------------------------------------------------- +// UpdateSettingsL +// +// -------------------------------------------------------------------------- +// +static void UpdateSettingsL( const TDesC8& aElementId, + RPointerArray< CPropertyMap >& aProperties, CXnDomNode& aRootNode ) + { + CXnDomNode* node( FindNodeById( &aRootNode, aElementId ) ); + + if( !node ) + { + return; + } + + CXnDomStringPool& sp( node->StringPool() ); + + for ( TInt i = 0; i < aProperties.Count(); i++ ) + { + CPropertyMap* property( aProperties[i] ); + + const TDesC8& name( property->Name() ); + const TDesC8& value( property->Value() ); + + CXnDomList& attributes( node->AttributeList() ); + + CXnDomAttribute* attribute( + static_cast< CXnDomAttribute* >( attributes.FindByName( name ) ) ); + + if ( attribute ) + { + // Update current attribute + attribute->SetValueL( value ); + } + else + { + // Need to create new attribute + attribute = CXnDomAttribute::NewL( name, sp ); + CleanupStack::PushL( attribute ); + + attribute->SetValueL( value ); + + node->AttributeList().AddItemL( attribute ); + CleanupStack::Pop( attribute ); + } + } + } + + +// -------------------------------------------------------------------------- +// UpdatePluginFromSettingsL() +// Updates plugin from settings +// -------------------------------------------------------------------------- +// +static void UpdatePluginFromSettingsL( CHspsConfiguration& aConfiguration, + CXnDomNode& aRootNode ) + { + RPointerArray< CItemMap >& settings( aConfiguration.Settings() ); + + for ( TInt i = 0; i < settings.Count(); i++ ) + { + CItemMap* setting( settings[i] ); + + const TDesC8& itemId( setting->ItemId() ); + + RPointerArray< CPropertyMap >& properties( setting->Properties() ); + + UpdateSettingsL( itemId, properties, aRootNode ); + } + } + +// -------------------------------------------------------------------------- +// MergeLD() +// -------------------------------------------------------------------------- +// +static CXnDomNode* MergeLD( CXnDomNode* aRoot, + CXnPluginData& aPluginData, TBool aMergeView = EFalse ) + { + CXnDomNode* parent( aPluginData.Owner() ); + + CXnDomNode* childToFind( NULL ); + + if ( aMergeView ) + { + childToFind = FindNodeByName( aRoot, KView ); + } + else + { + childToFind = FindNodeByName( aRoot, KWidget ); + } + + if( !childToFind || aRoot->Name() != KXmluiml ) + { + delete aRoot; + + return NULL; + } + + aPluginData.SetNode( childToFind ); + + CXnDomList& list( aRoot->ChildNodes() ); + + TInt index( list.ItemIndex( *childToFind ) ); + + CXnDomNode* node = + static_cast< CXnDomNode* >( list.Item( index ) ); + + list.RemoveItem( index ); + + // sets namespace recursively + node->SetOwnershipL( aPluginData.PluginId() ); + + // Takes ownership + parent->AddChildL( node ); + + delete aRoot; + aRoot = NULL; + + if ( aMergeView ) + { + // Return the last view + TInt index( parent->ChildNodes().Length() - 1 ); + + return ( static_cast< CXnDomNode* >( + parent->ChildNodes().Item( index ) ) ); + } + else + { + // Return <widget> + return node; + } + } + +// -------------------------------------------------------------------------- +// UseEmptyWidget +// Determines whether to use empty widget in this view configuration +// -------------------------------------------------------------------------- +// +static TBool UseEmptyWidget( CXnDomNode& aView ) + { + CXnDomAttribute* attribute( + static_cast< CXnDomAttribute* >( + aView.AttributeList().FindByName( KUseEmptyWidget ) ) ); + + if ( attribute && attribute->Value() == XnPropertyNames::KTrue ) + { + return ETrue; + } + + 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 +// Two-phased constructor. +// -------------------------------------------------------------------------- +// +CXnComposer* CXnComposer::NewL( CHspsWrapper& aWrapper ) + { + CXnComposer* self = new ( ELeave ) CXnComposer( aWrapper ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// -------------------------------------------------------------------------- +// CXnComposer::~CXnComposer +// Destructor +// -------------------------------------------------------------------------- +// +CXnComposer::~CXnComposer() + { + iFs.Close(); + } + +// -------------------------------------------------------------------------- +// CXnComposer::CXnComposer +// C++ default constructor can NOT contain any code, that +// might leave. +// -------------------------------------------------------------------------- +// +CXnComposer::CXnComposer( CHspsWrapper& aWrapper ) + : iWrapper( aWrapper ) + { + } + +// -------------------------------------------------------------------------- +// CXnComposer::ConstructL +// Symbian 2nd phase constructor can leave. +// -------------------------------------------------------------------------- +// +void CXnComposer::ConstructL() + { + User::LeaveIfError( iFs.Connect() ); + } + +// -------------------------------------------------------------------------- +// CXnComposer::ComposeRootL() +// Composes the application root configuration +// -------------------------------------------------------------------------- +// +CXnODT* CXnComposer::ComposeRootL( CXnRootData& aRootData ) + { + // Not owned + iODT = NULL; + + // Get application configuration + CHspsConfiguration* configuration( iWrapper.GetAppConfigurationL() ); + CleanupStack::PushL( configuration ); + + const TDesC8& state( configuration->PluginInfo().ConfigurationState() ); + + aRootData.SetConfigurationIdL( configuration->ConfId() ); + + if ( state.CompareF( KStateError ) == 0 || + configuration->Resources().Count() == 0 ) + { + CleanupStack::PopAndDestroy( configuration ); + + return NULL; + } + + // Get application configuration odt resource + CXnODT* odt = CXnODT::NewL(); + CleanupStack::PushL( odt ); + + // Save for later usage, not owned + iODT = odt; + + // Find a resource which can be internalized + const CObjectMap* resourceObject = FindObject( + configuration->Resources(), KTagXuikon() ); + if ( !resourceObject ) + { + CleanupStack::PopAndDestroy( 2, configuration ); + + return NULL; + } + + CXnDomNode* root( GetOdtL( *resourceObject, aRootData ) ); + if ( !root ) + { + CleanupStack::PopAndDestroy( 2, configuration ); + + return NULL; + } + + odt->DomDocument().SetRootNode( root ); + + // "views" node is the owner node of view nodes + CXnDomNode* views( FindNodeByName( root, KViews ) ); + + if ( !views ) + { + CleanupStack::PopAndDestroy( 2, configuration ); + + return NULL; + } + + CPluginInfo& info( configuration->PluginInfo() ); + + aRootData.SetOwner( root ); + aRootData.SetNode( views ); + + aRootData.SetPluginNameL( info.Name() ); + aRootData.SetPluginUidL( info.Uid() ); + + aRootData.SetPluginTypeL( KApp ); + + aRootData.SetMaxPages( info.MaxChild() ); + + // Get plugins (= views) in this application configuration + RPointerArray< CPluginMap >& plugins( configuration->PluginMaps() ); + + if ( ( plugins.Count() == 0 ) || ( aRootData.MaxPages() <= 0 ) ) + { + CleanupStack::PopAndDestroy( 2, configuration ); + + return NULL; + } + + RPointerArray< CXnPluginData >& array( aRootData.PluginData() ); + + TInt index( 0 ); + + for ( TInt i = 0; ( i < plugins.Count() ) && ( i < aRootData.MaxPages() ); + i++ ) + { + CPluginMap* plugin( plugins[i] ); + + CXnViewData* view = CXnViewData::NewLC( aRootData ); + + // Give view data ownership to CXnRootData + array.AppendL( view ); + CleanupStack::Pop( view ); + + view->SetOwner( views ); + + view->SetPluginIdL( plugin->PluginId() ); + + if ( plugin->ActivationState() ) + { + index = i; + } + + view->SetLockingStatus( plugin->LockingStatus() ); + } + + CXnViewData* initial( static_cast< CXnViewData* >( array[ index ] ) ); + + initial->SetInitial(); + + CleanupStack::Pop( odt ); + + CleanupStack::PopAndDestroy( configuration ); + + // Ownership is granted to the caller + return odt; + } + +// -------------------------------------------------------------------------- +// CXnComposer::ComposeViewL() +// Composes a view +// -------------------------------------------------------------------------- +// +TInt CXnComposer::ComposeViewL( CXnViewData& aViewData ) + { + TInt retval( KXnErrPluginFailure ); + + if ( aViewData.PluginId() == KNullDesC8 ) + { + return retval; + } + + // Get view configuration + CHspsConfiguration* configuration( + iWrapper.GetPluginConfigurationL( aViewData.PluginId() ) ); + CleanupStack::PushL( configuration ); + + const TDesC8& state( configuration->PluginInfo().ConfigurationState() ); + + if ( state.CompareF( KStateError ) == 0 || + configuration->Resources().Count() == 0 ) + { + CleanupStack::PopAndDestroy( configuration ); + + return retval; + } + + aViewData.SetConfigurationIdL( configuration->ConfId() ); + aViewData.SetPluginStateL( KStateWaitConfirmation ); + + // Find a resource which can be internalized + const CObjectMap* resourceObject = FindObject( + configuration->Resources(), KTagXuikon ); + if ( !resourceObject ) + { + CleanupStack::PopAndDestroy( configuration ); + + return retval; + } + + CXnDomNode* root( GetOdtL( *resourceObject, aViewData ) ); + if ( !root ) + { + CleanupStack::PopAndDestroy( configuration ); + + return retval; + } + + root->SetNamespaceL( aViewData.PluginId() ); + + // Merge view to root. Note that root will be obsolete after this call + CXnDomNode* viewRoot( MergeLD( root, aViewData, ETrue ) ); + + if ( viewRoot ) + { + // Finalise view data + CPluginInfo& info( configuration->PluginInfo() ); + aViewData.SetPluginNameL( info.Name() ); + aViewData.SetPluginUidL( info.Uid() ); + + aViewData.SetPluginTypeL( KView ); + + // Find first <plugin> element from this view + CXnDomNode* pluginNode( FindNodeByName( viewRoot, KPlugin ) ); + + UpdatePluginFromSettingsL( *configuration, *viewRoot ); + + aViewData.SetUseEmptyWidget( UseEmptyWidget( *viewRoot ) ); + + if ( pluginNode ) + { + // This assumes all <plugin> elements are siblings + CXnDomNode* pluginParent( pluginNode->Parent() ); + + CXnDomList& list( pluginParent->ChildNodes() ); + + // Get plugins configuration + RPointerArray< CPluginMap >& plugins( configuration->PluginMaps() ); + + RPointerArray< CXnPluginData >& array( aViewData.PluginData() ); + + TInt count( 0 ); + + for ( TInt i = 0; i < list.Length(); i++ ) + { + CXnDomNode* node = + static_cast< CXnDomNode* >( list.Item( i ) ); + + // We are interested only about <plugin> elements + if ( node->Name() == KPlugin ) + { + // Create plugin data + CXnPluginData* widget = CXnPluginData::NewLC( aViewData ); + + // Give ownership to view data + array.AppendL( widget ); + CleanupStack::Pop( widget ); + + // <plugin> element + widget->SetOwner( node ); + + if ( count < plugins.Count() ) + { + widget->SetPluginIdL( plugins[ count ]->PluginId() ); + } + + count++; + } + } + } + + retval = KErrNone; + } + + CleanupStack::PopAndDestroy( configuration ); + + return retval; + } + +// -------------------------------------------------------------------------- +// ComposeWidgetL() +// Composes a widget +// -------------------------------------------------------------------------- +// +TInt CXnComposer::ComposeWidgetL( CXnPluginData& aPluginData ) + { + TInt retval( KXnErrPluginFailure ); + + if ( aPluginData.PluginId() == KNullDesC8 ) + { + return retval; + } + + // Get widget configuration + CHspsConfiguration* configuration( + iWrapper.GetPluginConfigurationL( aPluginData.PluginId() ) ); + CleanupStack::PushL( configuration ); + + // Empty widget is not composed at all + if ( configuration->PluginInfo().Uid().CompareF( KEmptyWidgetUid ) == 0 ) + { + aPluginData.SetEmptyL( aPluginData.PluginId() ); + + CleanupStack::PopAndDestroy( configuration ); + + return KErrNone; + } + + const TDesC8& state( configuration->PluginInfo().ConfigurationState() ); + + if ( state.CompareF( KStateError ) == 0 || + configuration->Resources().Count() == 0 ) + { + CleanupStack::PopAndDestroy( configuration ); + + return retval; + } + + aPluginData.SetConfigurationIdL( configuration->ConfId() ); + aPluginData.SetPluginStateL( KStateWaitConfirmation ); + + // Find a resource which can be internalized + const CObjectMap* resourceObject = FindObject( + configuration->Resources(), KTagXuikon ); + if ( !resourceObject ) + { + CleanupStack::PopAndDestroy( configuration ); + + return retval; + } + + CXnDomNode* root( GetOdtL( *resourceObject, aPluginData ) ); + if ( !root ) + { + CleanupStack::PopAndDestroy( configuration ); + + return retval; + } + + // Update plugin namespace + root->SetNamespaceL( aPluginData.PluginId() ); + + // Nested plugins are not supported currently. + // Note root will be obsolete after this call. + CXnDomNode* widgetRoot( MergeLD( root, aPluginData ) ); + + if ( widgetRoot ) + { + // Finalise plugin data + CPluginInfo& info( configuration->PluginInfo() ); + + aPluginData.SetPluginNameL( info.Name() ); + aPluginData.SetPluginUidL( info.Uid() ); + + aPluginData.SetPluginTypeL( info.Type() ); + + UpdatePluginFromSettingsL( *configuration, *widgetRoot ); + + if ( info.Type() == KKeyTemplate ) + { + CXnDomNode* node( FindNodeByName( widgetRoot, KContentSourceNode ) ); + + if ( node ) + { + CXnDomList& attributes( node->AttributeList() ); + + CXnDomAttribute* attribute( static_cast< CXnDomAttribute* >( + attributes.FindByName( KName ) ) ); + + if ( attribute ) + { + aPluginData.SetPublisherNameL( attribute->Value() ); + } + } + } + + aPluginData.SetRemovable( Removable( *widgetRoot ) ); + + retval = KErrNone; + } + + CleanupStack::PopAndDestroy( configuration ); + + return retval; + } + +// -------------------------------------------------------------------------- +// CXnComposer::GetOdtL() +// +// -------------------------------------------------------------------------- +// +CXnDomNode* CXnComposer::GetOdtL( const CObjectMap& aObject, + CXnPluginData& aPluginData ) + { + if( !iODT ) + { + return NULL; + } + + CXnDomNode* root( NULL ); + + TBuf8< KMaxFileName > resource; + TFileName privatePath; + TFileName filename; + + // Get private path + User::LeaveIfError( iFs.PrivatePath( privatePath ) ); + + // Get resource path and name + resource = aObject.Path(); + resource.Append( aObject.NameL() ); + + // Copy from TBuf8 to TBuf + filename.Copy( resource ); + + // insert private path and + filename.Insert( 0, privatePath ); + + // ... c-drive + filename.Insert( 0, KCDrive ); + + RFile file; + + User::LeaveIfError( file.Open( iFs, filename, EFileShareReadersOnly ) ); + CleanupClosePushL( file ); + + TInt size( 0 ); + file.Size( size ); + + if ( size ) + { + CFileStore* store( CDirectFileStore::FromLC( file ) ); + + RStoreReadStream instream; + CleanupClosePushL( instream ); + + instream.OpenLC( *store, store->Root() ); + + // Consume header + CXnODT::InternalizeHeaderL( instream ); + + CArrayPtrSeg< CXnResource >* list( + CXnODT::InternalizeResourceListL( instream ) ); + + aPluginData.SetResources( list ); + + // Set correct resource path + UpdateResourcesPathL( + *list, TParsePtrC( filename ).DriveAndPath() ); + + root = iODT->InternalizeDomDocumentL( instream ); + + // Destroy the stream object, close the instream, destroy store + CleanupStack::PopAndDestroy( 3, store ); + } + + CleanupStack::PopAndDestroy( &file ); + + return root; + } + +// -------------------------------------------------------------------------- +// CXnComposer::FindObject() +// Finds an object from the provided array +// -------------------------------------------------------------------------- +// +const CObjectMap* CXnComposer::FindObject( + RPointerArray<CObjectMap>& aResourceObjects, + const TDesC8& aTag ) const + { + CObjectMap* object = NULL; + + const TInt count = aResourceObjects.Count(); + if ( count ) + { + + // Find an object with the provided tag + for( TInt objectIndex=0; objectIndex < count; objectIndex++ ) + { + CObjectMap* o = aResourceObjects[ objectIndex ]; + if ( o->Tag() == aTag ) + { + object = o; + break; + } + } + + // If the tag was not found, return first object + if( !object ) + { + object = aResourceObjects[ 0 ]; + } + } + + return object; + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xncontroladapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xncontroladapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,584 @@ +/* +* 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: Xuikon control adapter source file +* +*/ + + +// System includes +#include <AknUtils.h> + +// User includes +#include "xncontroladapter.h" +#include "xncontroladapterimpl.h" +#include "xnproperty.h" +#include "xnnodepluginif.h" +#include "xnnode.h" +#include "xnuiengine.h" +#include "xncomponent.h" +#include "xncomponentnodeimpl.h" +#include "xntype.h" + +#include "xnviewnodeimpl.h" +#include "xneditmode.h" + +// Constants +const TInt KLongTapStartDelay( 500000 ); // 0.5s +const TInt KLongTapTimeDelay( 1500000 ); // 1.5s + +// ----------------------------------------------------------------------------- +// CreateLongTapDetectorL +// Checks wheter longtap detector is needed for this node +// ----------------------------------------------------------------------------- +// +static TBool CreateLongTapDetectorL( CXnNode& aNode ) + { + if ( AknLayoutUtils::PenEnabled() ) + { + if ( aNode.Type()->Type() == KMenuBarNode ) + { + RPointerArray< CXnNode >& children( aNode.Children() ); + + for ( TInt i = 0; i < children.Count(); i++ ) + { + CXnProperty* prop( children[i]->GetPropertyL( + XnPropertyNames::common::KLongTap ) ); + + if ( prop && prop->StringValue() == XnPropertyNames::KTrue ) + { + return ETrue; + } + } + } + else + { + CXnProperty* prop( aNode.GetPropertyL( + XnPropertyNames::common::KLongTap ) ); + + if ( prop && prop->StringValue() == XnPropertyNames::KTrue ) + { + return ETrue; + } + } + } + + return EFalse; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::NewL +// Two-phased constructor. Can leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnControlAdapter* CXnControlAdapter::NewL( CXnNodePluginIf& aNode ) + { + CXnControlAdapter* self = new ( ELeave ) CXnControlAdapter; + CleanupStack::PushL( self ); + self->ConstructL( aNode ); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::~CXnControlAdapter +// Destructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnControlAdapter::~CXnControlAdapter() + { + delete iImpl; + delete iLongTapDetector; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::CXnControlAdapter +// C++ default constructor. Must not leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnControlAdapter::CXnControlAdapter() + { + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::ConstructL +// 2nd phase constructor. Can leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::ConstructL( CXnNodePluginIf& aNode ) + { + iImpl = CXnControlAdapterImpl::NewL( aNode, *this, SystemGc() ); + + if ( CreateLongTapDetectorL( aNode.Node() ) ) + { + iLongTapDetector = CAknLongTapDetector::NewL( this ); + + iLongTapDetector->SetTimeDelayBeforeAnimation( KLongTapStartDelay ); + iLongTapDetector->SetLongTapDelay( KLongTapTimeDelay ); + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::SetComponent +// Sets component object to adapter. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::SetComponent( CXnComponent* aComponent ) + { + iImpl->SetComponent( aComponent ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::Component +// Returns component attached to this adapter +// ----------------------------------------------------------------------------- +// +CXnComponent* CXnControlAdapter::Component() const + { + return const_cast< CXnComponent* >( iImpl->Component() ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::Component +// Gets component object from adapter. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnComponent* CXnControlAdapter::Component() + { + return iImpl->Component(); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::OfferKeyEventL +// Handles key events. +// ----------------------------------------------------------------------------- +// +EXPORT_C TKeyResponse CXnControlAdapter::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + return iImpl->OfferKeyEventL( aKeyEvent, aType ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::HandleControlEventL +// Handles control events. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::HandleControlEventL( + CCoeControl* /*aControl*/, + TCoeEvent /*aEventType*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::HandleLongTapEventL +// Handles the long tap events. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::HandleLongTapEventL( + const TPoint& aPenEventLocation, + const TPoint& aPenEventScreenLocation ) + { + CXnNode* node( &Component()->Node()->Node() ); + + CXnUiEngine* engine( node->UiEngine() ); + + engine->DisableRenderUiLC(); + + iImpl->HandleLongTapEventL( aPenEventLocation, aPenEventScreenLocation ); + + CleanupStack::PopAndDestroy(); // DisableRenderUiLC; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::EnableLongTapAnimation +// Handles the long tap events. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::EnableLongTapAnimation( const TBool aAnimation ) + { + if ( iLongTapDetector ) + { + iLongTapDetector->EnableLongTapAnimation( aAnimation ); + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::HandlePointerEventL +// Handle pointer events +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::HandlePointerEventL( + const TPointerEvent& aPointerEvent ) + { + TBool consumed( EFalse ); + + switch( aPointerEvent.iType ) + { + case TPointerEvent::EButton1Down: + case TPointerEvent::EButton1Up: + case TPointerEvent::EDrag: + consumed = iImpl->HandlePointerEventL( aPointerEvent ); + break; + default: + break; + } + + if ( !consumed ) + { + CCoeControl::HandlePointerEventL( aPointerEvent ); + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::Draw +// Draws the control +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::Draw( const TRect& aRect ) const + { + iImpl->Draw( aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::Draw +// Draws the control +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::Draw( const TRect& aRect, CWindowGc& aGc ) const + { + iImpl->Draw( aRect, aGc ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::ComponentControl +// Return a child control by index +// ----------------------------------------------------------------------------- +// +EXPORT_C CCoeControl* CXnControlAdapter::ComponentControl( TInt aIndex ) const + { + return iImpl->ComponentControl( aIndex ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::CountComponentControls +// Return count of children +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CXnControlAdapter::CountComponentControls() const + { + return iImpl->CountComponentControls(); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::SetVisible +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::SetVisible( TBool aVisible ) + { + MakeVisible( aVisible ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::AppendChildL +// ----------------------------------------------------------------------------- +// +void CXnControlAdapter::AppendChildL(CXnControlAdapter& aChild, CXnNode& aNode) + { + iImpl->AppendChildL(aChild, aNode); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::IsDrawingAllowed +// Checks whether drawing is allowed +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CXnControlAdapter::IsDrawingAllowed() const + { + return iImpl->IsDrawingAllowed(); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::ContentBitmaps +// Gets content bitmaps +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::ContentBitmaps( + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask ) + { + iImpl->ContentBitmaps( aBitmap, aMask ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::SetContentBitmaps +// Sets content bitmaps +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::SetContentBitmaps( + CFbsBitmap* aBitmap, + CFbsBitmap* aMask ) + { + iImpl->SetContentBitmaps( aBitmap, aMask ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::SetContentBitmaps +// Sets content bitmaps +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::SetContentBitmaps( + const TDesC& aBitmapUrl, + const TDesC& aMaskUrl ) + { + TRAP_IGNORE( iImpl->SetContentBitmapsL( aBitmapUrl, aMaskUrl ) ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::DrawContentImage +// Draws content image +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::DrawContentImage() const + { + iImpl->DrawContentImage(); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::SizeChanged +// Control size change notification +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::SizeChanged() + { + iImpl->SizeChanged(); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::SkinChanged +// Skin change notification +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::SkinChanged() + { + TRAP_IGNORE( Component()->Node()->SetDirtyL() ); + + iImpl->SkinChanged(); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::FocusChanged +// Focus change notification +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::FocusChanged( TDrawNow /*aDrawNow*/ ) + { + TRAP_IGNORE( iImpl->FocusChangedL( IsFocused() ) ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::LoadBitmap +// Load a bitmap from the server. Ownership is transferred. +// ----------------------------------------------------------------------------- +// +EXPORT_C CFbsBitmap* CXnControlAdapter::LoadBitmap( const TDesC& aBitmapUrl ) + { + return iImpl->LoadBitmap( aBitmapUrl ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::GetBitmapAndMask +// Load a bitmap and mask from the server. Ownership is transferred. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::GetBitmapAndMask( + const TDesC& aBitmapUrl, + const TDesC& aMaskUrl, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask ) + { + iImpl->GetBitmapAndMask( aBitmapUrl, aMaskUrl, aBitmap, aMask ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::EnterPowerSaveModeL +// Enter power save mode +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::EnterPowerSaveModeL( TModeEvent aEvent ) + { + iImpl->StopHighlightAnimation(); + DoEnterPowerSaveModeL( aEvent ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::DoEnterPowerSaveModeL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::DoEnterPowerSaveModeL( TModeEvent /* aEvent */ ) + { + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::ExitPowerSaveModeL +// Exit power save mode +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::ExitPowerSaveModeL( TModeEvent aEvent ) + { + iImpl->StartHighlightAnimation(); + DoExitPowerSaveModeL( aEvent ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::DoExitPowerSaveModeL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::DoExitPowerSaveModeL( TModeEvent /*aEvent*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::SetLocalUiZoomL +// Set local UI zoom level +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::SetLocalUiZoomL( TAknUiZoom /*aZoom*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::HandleScreenDeviceChangedL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::HandleScreenDeviceChangedL() + { + CXnNode& node( Component()->Node()->Node() ); + + if ( CreateLongTapDetectorL( node ) ) + { + if ( !iLongTapDetector ) + { + iLongTapDetector = CAknLongTapDetector::NewL( this ); + } + } + else + { + delete iLongTapDetector; + iLongTapDetector = NULL; + } + + Component()->Node()->SetDirtyL(); + + iImpl->HandleScreenDeviceChangedL(); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::HandlePropertyChangeL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::HandlePropertyChangeL( CXnProperty* aProperty ) + { + // Check component focus. + CXnComponent* component( iImpl->Component() ); + + if ( component ) + { + CXnNodePluginIf* node( component->Node() ); + + if ( node ) + { + if ( node->IsFocusedState() ) + { + iImpl->StartHighlightAnimation(); + } + else + { + iImpl->StopHighlightAnimation(); + } + } + } + + if ( iImpl->UpdateBackgroundImageL( aProperty) == + CXnControlAdapterImpl::EPropertyChangeNotConsumed ) + { + DoHandlePropertyChangeL( aProperty ); + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::DoHandlePropertyChangeL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::DoHandlePropertyChangeL( CXnProperty* aProperty ) + { + iImpl->DoHandlePropertyChangeL( aProperty ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::MeasureAdaptiveContentL +// Measures the content dimensions +// ----------------------------------------------------------------------------- +// +EXPORT_C TSize CXnControlAdapter::MeasureAdaptiveContentL( + const TSize& aAvailableSize ) + { + return iImpl->MeasureAdaptiveContentL( aAvailableSize ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::ResetStylusCounter +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::ResetStylusCounter() + { + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::SetBlank +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnControlAdapter::SetBlank( TBool aBlank ) + { + iImpl->SetBlank( aBlank ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::LongTapDetector +// ----------------------------------------------------------------------------- +// +EXPORT_C CAknLongTapDetector* CXnControlAdapter::LongTapDetector() const + { + return iLongTapDetector; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapter::RemoveChildAdapters +// ----------------------------------------------------------------------------- +// +void CXnControlAdapter::RemoveChildAdapters() + { + iImpl->RemoveChildAdapters(); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +RPointerArray<CXnControlAdapter>& CXnControlAdapter::ChildAdapters() + { + return iImpl->ChildAdapters(); + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,5960 @@ +/* +* 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: Xuikon control adapter source file +* +*/ + + +// System includes +#include <utf.h> +#include <SVGEngineInterfaceImpl.h> +#include <s32file.h> +#include <mifconvdefs.h> +//skinning support +#include <AknsFrameBackgroundControlContext.h> +#include <AknsDrawUtils.h> +#include <aknconsts.h> +#include <AknUtils.h> +#include <AknsListBoxBackgroundControlContext.h> +#include <gulicon.h> +#ifdef RD_TACTILE_FEEDBACK +#include <touchfeedback.h> +#endif // RD_TACTILE_FEEDBACK + +// User includes +#include "xnappuiadapter.h" +#include "xnviewadapter.h" +#include "xnviewmanager.h" +#include "xncontroladapterimpl.h" +#include "xncontroladapter.h" +#include "xnmenuadapter.h" +#include "xncomponentnodeimpl.h" +#include "xntype.h" +#include "xnnodepluginif.h" +#include "xnuiengine.h" +#include "xnviewnodeimpl.h" +#include "c_xnutils.h" +#include "xndomdocument.h" +#include "xndomattribute.h" +#include "xndomnode.h" +#include "xnproperty.h" +#include "xndomlist.h" +#include "xnodt.h" +#include "xnresource.h" +#include "xnhittest.h" +#include "xnplugindata.h" +#include "xnnode.h" +#include "xnpanic.h" +#include "xnviewdata.h" +#include "xnscrollablecontroladapter.h" +#include "xnfocuscontrol.h" +#include "xneditmode.h" + +_LIT8(KScrollableBoxNodeName, "scrollablebox"); + +using namespace XnGestureHelper; +#include "xngesture.h" + +// Constants +const TInt KSkinGfxInnerRectShrink = 5; +const TInt KFocusGrowValue = 3; + + +// LOCAL FUNCTION PROTOTYPES +static TRgb ConvertHslToRgb( TInt aHue, TInt aSaturation, TInt aLightness ); +static void ConvertRgbToHsl( TRgb aRGB, TUint& aHue, TUint& aSaturation, + TUint& aLightness ); +static void LoadFbsBitmapL( + CXnResource& aResource, CFbsBitmap*& aTarget, RFs& aFsSession ); +static void LoadMbmBitmapL( CXnResource& aResource, + TInt aBitmapIndex, CFbsBitmap*& aTarget, RFs& aFsSession ); +static void LoadSVGBitmapL( CXnResource& aResource, + CFbsBitmap*& aBitmap, CFbsBitmap*& aBitmapMask, + TRect aRect, RFs& aFsSession ); +static TBool GetBitmapL( CXnUiEngine& aEngine, CXnNode& aNode, + const TDesC& aResourceFileName, TInt& aBitmapIndex, + CFbsBitmap*& aTarget, CFbsBitmap*& aBitmapMask, + CXnControlAdapterImpl::TIconProvider*& aIconProvider, + TRect aRect, RFs& aFsSession ); + +static void LimitRectToPaddingRect( CXnNode& aNode, TRect& aRect ); +static void DrawSpaceBackgroundY( CWindowGc& aGc, TInt aYRepeatCount, + CXnNode& aNode, TRect& aRect, CFbsBitmap* aBitmap, TRect aBitmapRect, + TRect aImageRect, TInt& aYOffset ); +static void DrawRepeatBackgroundY( CWindowGc& aGc, TInt aYRepeatCount, + CXnNode& aNode, TRect& aRect, CFbsBitmap* aBitmap, TRect aBitmapRect, + TRect aImageRect, TInt& aYOffset ); +static void StripQuotes( HBufC*& aString ); +static void DrawBackgroundColorL( + const TRect& /*aRect*/, CXnNode& aNode, CWindowGc& aGc ); +static void GetBackroundRepeatValuesL( CXnNode& aNode, TBool& aRepeatX, + TBool& aRepeatY, TBool& aSpaceX, TBool& aSpaceY ); +static void DrawRepeatedBackgroundImage( CWindowGc& aGc, CXnNode& aNode, + TRect& aRect, TRect aImageRect, TRect aBitmapRect, + CFbsBitmap* aBitmap, TBool aRepeatX, TBool aRepeatY, TBool aSpaceX, + TBool aSpaceY, TInt aXRepeatCount, TInt aYRepeatCount ); +static TBool GetBackgroundPositionFromPropertyL( + CXnNode& aNode, TBool aScaleImage, TRect& aRect, + TRect aImageRect, CFbsBitmap* aBitmap, TBool& aHeightSet ); +static TBool GetBackgroundSizeFromPropertyL( TRect& aRect, CXnNode& aNode, + CFbsBitmap* aBitmap, TBool& aScaleImage ); +static TRgb LighterColor( const TRgb& aRgb ); +static TRgb DarkerColor( const TRgb& aRgb ); +static void DrawSolidTopBorder( CArrayFix< TPoint >* aArray, CWindowGc& aGc ); +static void SplitTopBorderPolygonL( CArrayFix< TPoint >* aArray, + CArrayFix< TPoint >*& aUpperPart, CArrayFix< TPoint >*& aLowerPart ); +static void DrawRidgeTopBorderL( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static void DrawGrooveTopBorderL( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static void DrawInsetTopBorder( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static void DrawOutsetTopBorder( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static TBool GetBorderColorL( + const TDesC8& aPropertyName, CXnNode& aNode, CWindowGc& aGc, TRgb& aRgb ); +static void DrawTopBorderL( + const TRect& /*aRect*/, CXnNode& aNode, CWindowGc& aGc ); +static void DrawBottomBorderL( + const TRect& /*aRect*/, CXnNode& aNode, CWindowGc& aGc ); +static void DrawSolidBottomBorder( CArrayFix< TPoint >* aArray, CWindowGc& aGc ); +static void SplitBottomBorderPolygonL( CArrayFix< TPoint >* aArray, + CArrayFix< TPoint >*& aUpperPart, CArrayFix< TPoint >*& aLowerPart ); +static void DrawRidgeBottomBorderL( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static void DrawGrooveBottomBorderL( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static void DrawInsetBottomBorder( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static void DrawOutsetBottomBorder( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static void DrawSolidLeftBorder( + CArrayFix< TPoint >* aArray, CWindowGc& aGc ); +static void SplitLeftBorderPolygonL( CArrayFix< TPoint >* aArray, + CArrayFix< TPoint >*& aLeftPart, CArrayFix< TPoint >*& aRightPart ); +static void DrawRidgeLeftBorderL( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static void DrawGrooveLeftBorderL( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static void DrawInsetLeftBorder( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static void DrawOutsetLeftBorder( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static void DrawLeftBorderL( + const TRect& /*aRect*/, CXnNode& aNode, CWindowGc& aGc ); +static void DrawRightBorderL( + const TRect& /*aRect*/, CXnNode& aNode, CWindowGc& aGc ); +static void DrawSolidRightBorder( + CArrayFix< TPoint >* aArray, CWindowGc& aGc ); +static void SplitRightBorderPolygonL( CArrayFix< TPoint >* aArray, + CArrayFix< TPoint >*& aLeftPart, CArrayFix< TPoint >*& aRightPart ); +static void DrawRidgeRightBorderL( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static void DrawGrooveRightBorderL( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static void DrawInsetRightBorder( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static void DrawOutsetRightBorder( + CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb ); +static void DrawBorderImagesL( + const TRect& /*aRect*/, CXnNode& aNode, CWindowGc& aGc, + CFbsBitmap* aBitmap, TInt aBorderBitmapDividerTop, + TInt aBorderBitmapDividerRight, + TInt aBorderBitmapDividerBottom, TInt aBorderBitmapDividerLeft ); +static TBool IsPropertyNone( CXnProperty& aProperty ); +static void DrawBordersL( const TRect& aRect, CXnNode& aNode, CWindowGc& aGc ); +static void SwapChildArrays( RPointerArray< CXnControlAdapter >& originalArray, + RPointerArray< CXnControlAdapter >& sortedArray ); +static CXnProperty* GetZIndexL( CXnControlAdapter* aAdapter ); +static void InsertChildToSortedArrayL( + RPointerArray< CXnControlAdapter >& aTargetArray, + CXnControlAdapter* aChild ); +static void InitializeBackgroundBitmapL( CXnUiEngine& aEngine, CXnNode& aNode, + TInt& aBitmapIndex, CFbsBitmap*& aBitmap, CFbsBitmap*& aMask, + CXnControlAdapterImpl::TIconProvider*& aIconProvider, RFs& aFsSession ); +static HBufC* GetBackgroundImagePathLC( CXnNode& aNode ); +static CFbsBitmap* InitializeBorderBitmapL( + CXnUiEngine& aEngine, CXnNode& aNode, + TInt& aBitmapIndex, TInt& aBorderBitmapDividerTop, + TInt& aBorderBitmapDividerRight, TInt& aBorderBitmapDividerBottom, + TInt& aBorderBitmapDividerLeft, + CXnControlAdapterImpl::TIconProvider*& aIconProvider, RFs& aFsSession ); +static void DrawDottedBorder( + TRect aBorderRect, CWindowGc& aGc, TRgb& aRgb, TBool aHorizontal ); +static HBufC* GetBackgroundImageMaskPathLC( CXnNode& aNode ); +static CFbsBitmap* CreateBitmapFromColorL( TSize aSize, TRgb aColor ); +static TBool CreateGestureHelperL( CXnNode& aNode ); +static TInt AccessResourceFileL( + CXnResource& aResource, RFile& aFile, RFs& aFsSession ); +static void DrawFocusAppearance( CXnNode& aNode, CWindowGc& aGc ); +static CXnDomNode* HasHoldTrigger( CXnDomNode* aNode ); +static void CancelFocusRefusalL( CXnUiEngine& aUiEngine ); + +// ============================= LOCAL FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +static CXnScrollableControlAdapter* IsChildOfScrollableControl( CXnNode& aNode ) + { + CXnNode* parent = aNode.Parent(); + while( parent ) + { + if( parent->Type()->Type() == KScrollableBoxNodeName ) + { + CXnScrollableControlAdapter* ret = static_cast<CXnScrollableControlAdapter*>(parent->Control()); + return ret; + } + parent = parent->Parent(); + } + return NULL; + } + +// ----------------------------------------------------------------------------- +// SetControlContext +// +// ----------------------------------------------------------------------------- +// +static void SetControlContext(CXnControlAdapter& aChild, CXnNode& aNode) + { + CXnScrollableControlAdapter* scrollableControl = IsChildOfScrollableControl( aNode ); + if(scrollableControl) + { + aNode.SetScrollableControl(scrollableControl); + aChild.CopyControlContextFrom(scrollableControl); + } + } + +// ----------------------------------------------------------------------------- +// AccessResourceFileL +// Opens a resource file for accessing. The caller must close the file. +// ----------------------------------------------------------------------------- +// +static TInt AccessResourceFileL( + CXnResource& aResource, + RFile& aFile, + RFs& aFsSession ) + { + TInt err = KErrNone; + + // parse file name and extension + const TDesC& fileName = aResource.FileName(); + TParsePtrC fileParser( fileName ); + TPtrC filepath = fileParser.DriveAndPath(); + + // open resource file + aFsSession.SetSessionPath( filepath ); + aFsSession.ShareProtected(); + err = aFile.Open( aFsSession, fileName, EFileShareReadersOnly ); + if ( err != KErrNone ) + { + aFile.Close(); + } + + return err; + } + +// ----------------------------------------------------------------------------- +// LoadFbsBitmapL +// Loads a bitmap file from the theme server and creates a CFbsBitmap +// ----------------------------------------------------------------------------- +// +static void LoadFbsBitmapL( + CXnResource& aResource, + CFbsBitmap*& aTarget, + RFs& aFsSession ) + { + RFile file; + + TInt ret = AccessResourceFileL( aResource, file, aFsSession ); + if ( ret == KErrNone ) + { + CleanupClosePushL( file ); + aTarget = new ( ELeave ) CFbsBitmap; + if ( !aTarget ) + { + CleanupStack::PopAndDestroy(); + return; + } + RFileReadStream readStream( file ); + CleanupClosePushL( readStream ); + aTarget->InternalizeL( readStream ); + CleanupStack::PopAndDestroy( &readStream ); + CleanupStack::PopAndDestroy( &file ); + } + } + +// ----------------------------------------------------------------------------- +// LoadMifBitmapL +// Loads a bitmap file from the theme server and creates a CFbsBitmap +// ----------------------------------------------------------------------------- +// +static void LoadMifBitmapL( + CXnResource& aResource, + TInt aBitmapIndex, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask, + CXnControlAdapterImpl::TIconProvider*& aIconProvider, + RFs& aFsSession, + const TRect& aRect ) + { + RFile file; + + TInt ret = AccessResourceFileL( aResource, file, aFsSession ); + if ( ret == KErrNone ) + { + aIconProvider = new ( ELeave ) CXnControlAdapterImpl::TIconProvider( file ); + } + + if ( ret == KErrNone ) + { + // Mask is next after bitmap + AknIconUtils::CreateIconL( aBitmap, aMask, *aIconProvider, + aBitmapIndex + KMifIdFirst, aBitmapIndex + KMifIdFirst + 1 ); + AknIconUtils::SetSize( aBitmap, aRect.Size(), EAspectRatioNotPreserved ); + } + } + +// ----------------------------------------------------------------------------- +// LoadMbmBitmapL +// Loads a bitmap file from the theme server and creates a CFbsBitmap +// ----------------------------------------------------------------------------- +// +static void LoadMbmBitmapL( + CXnResource& aResource, + TInt aBitmapIndex, + CFbsBitmap*& aTarget, + RFs& aFsSession ) + { + RFile file; + + TInt ret = AccessResourceFileL( aResource, file, aFsSession ); + if ( ret == KErrNone ) + { + CleanupClosePushL( file ); + aTarget = new ( ELeave ) CFbsBitmap; + aTarget->Load( file, aBitmapIndex ); + CleanupStack::PopAndDestroy(); + } + } + +// ----------------------------------------------------------------------------- +// LoadSVGBitmapL +// Loads an SVG file from the theme server and creates a CFbsBitmap. +// ----------------------------------------------------------------------------- +// +static void LoadSVGBitmapL( + CXnResource& aResource, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aBitmapMask, + TRect /*aRect*/, + RFs& aFsSession ) + { + RFile file; + + TInt ret = AccessResourceFileL( aResource, file, aFsSession ); + if ( ret == KErrNone ) + { + CleanupClosePushL( file ); + + CFbsBitmap* frameBuffer = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( frameBuffer ); + + frameBuffer->Create( TSize( 0, 0 ), EColor16M ); + + TFontSpec fontSpec; + CSvgEngineInterfaceImpl* svgEngine = + CSvgEngineInterfaceImpl::NewL( frameBuffer, NULL, fontSpec ); + + CleanupStack::PushL( svgEngine ); + + 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 ); + + aBitmap = target; + + CFbsBitmap* mask = new ( ELeave ) CFbsBitmap; + mask->Create( contentSize, EGray256 ); + svgEngine->GenerateMask( mask ); + + aBitmapMask = mask; + + CleanupStack::PopAndDestroy( 3, &file ); // frameBuffer, svgEngine, file + } + } + + +// ----------------------------------------------------------------------------- +// ResolveMifIDL +// Resolves a mif id from a given string. +// ----------------------------------------------------------------------------- +// +static TBool ResolveMifIDL( + const TDesC& aMifId, + TInt& aMifID ) + { + HBufC* str = aMifId.AllocL(); + TPtr ptrMif = str->Des(); + ptrMif.TrimAll(); + TInt pos( ptrMif.FindF( KMif ) ); + if ( KErrNotFound != pos ) + { + pos += KMif().Length(); + TPtr ptr = ptrMif.MidTPtr( pos, ( ptrMif.Length() - pos ) ); + ptr.TrimAll(); + TInt offset( ptr.Locate( KRightParenthesis ) ); + if ( KErrNotFound != offset ) + { + TLex lex( ptr.Left( offset ) ); + lex.SkipSpace(); + lex.Val( aMifID ); + delete str; + return ETrue; + } + } + delete str; + return EFalse; + } + +// ----------------------------------------------------------------------------- +// LoadSkinBitmapL +// Loads a skin bitmap and creates a CFbsBitmap from it. +// ----------------------------------------------------------------------------- +// +static TBool LoadSkinBitmapL( + const TDesC& aSkinId, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aBitmapMask, + TRect aRect ) + { + TAknsItemID itemID; + + MAknsSkinInstance* skin( AknsUtils::SkinInstance() ); + + TInt mifId( 0 ); + + TInt mifFound( ResolveMifIDL( aSkinId, mifId ) ); + + TInt colorIndex( KErrNotFound ); + + if ( skin && CXnUtils::ResolveSkinItemIDL( aSkinId, itemID, colorIndex ) ) + { + if ( itemID.iMajor == EAknsMajorAppIcon ) // Check if appl. icon request + { + TUid applUid; + applUid = TUid::Uid( itemID.iMinor ); + + AknsUtils::CreateAppIconLC( + skin, applUid, EAknsAppIconTypeList, aBitmap, aBitmapMask ); + AknIconUtils::SetSize( + aBitmap, aRect.Size(), EAspectRatioNotPreserved ); + CleanupStack::Pop( 2 ); //aBitmap, aBitmapMask + + return ETrue; + } + else + { + TInt error( KErrNone ); + + // if we have a color index, then we create a colored icon + if ( colorIndex != KErrNotFound ) + { + TRgb defaultColor( 0, 0, 0 ); + + TRAP( error, AknsUtils::CreateColorIconL( + skin, itemID, KAknsIIDQsnTextColors, + colorIndex, aBitmap, aBitmapMask, + KNullDesC, mifId, mifId + 1, defaultColor ) ); + } + else + { + TRAP( error, AknsUtils::CreateIconL( + skin, itemID, aBitmap, aBitmapMask, KNullDesC, + mifId, mifId + 1 ) ); + } + + if ( error != KErrNone ) + { + error = KErrNone; + TRAP( error, AknsUtils::CreateIconL( + skin, itemID, aBitmap, KNullDesC, mifId ) ); + } + + if ( error == KErrNone ) + { + AknIconUtils::SetSize( + aBitmap, aRect.Size(), EAspectRatioNotPreserved ); + + return ETrue; + } + } + } + + if ( mifFound ) + { + AknIconUtils::CreateIconL( + aBitmap, aBitmapMask, KAvkonBitmapFile, mifId, mifId + 1 ); + AknIconUtils::SetSize( + aBitmap, aRect.Size(), EAspectRatioNotPreserved ); + + return ETrue; + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// GetBitmap +// Fetches a bitmap +// ----------------------------------------------------------------------------- +// +static TBool GetBitmapL( + CXnUiEngine& aEngine, + CXnNode& /*aNode*/, + const TDesC& aResourceFileName, + TInt& aBitmapIndex, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aBitmapMask, + CXnControlAdapterImpl::TIconProvider*& aIconProvider, + TRect aRect, + RFs& aFsSession ) + { + if ( LoadSkinBitmapL( aResourceFileName, aBitmap, aBitmapMask, aRect ) ) + { + return ETrue; + } + + CXnResource* resource( CXnUtils::FindResource( + aEngine.Resources(), aResourceFileName, aBitmapIndex ) ); + + if ( resource ) + { + if ( resource->ResourceType() == EResourceSVG ) + { + LoadSVGBitmapL( *resource, aBitmap, aBitmapMask, aRect, aFsSession ); + + return ETrue; + } + else if ( resource->ResourceType() == EResourceMIF ) + { + LoadMifBitmapL( *resource, aBitmapIndex, aBitmap, + aBitmapMask, aIconProvider, aFsSession, aRect ); + + return ETrue; + } + else if ( resource->ResourceType() == EResourceMBM ) + { + LoadMbmBitmapL( *resource, aBitmapIndex, aBitmap, aFsSession ); + + return ETrue; + } + else if ( resource->ResourceType() == EResourceFBS ) + { + LoadFbsBitmapL( *resource, aBitmap, aFsSession ); + + return ETrue; + } + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// DrawBackgroundColorL +// Draws background color to the padding rect +// ----------------------------------------------------------------------------- +// +static void DrawBackgroundColorL( + const TRect& /*aRect*/, + CXnNode& aNode, + CWindowGc& aGc ) + { + CXnProperty* colorProperty( aNode.BackgroundColorL() ); + + if ( colorProperty ) + { + TRect paddingRect = aNode.PaddingRect(); + + CXnDomPropertyValue* value = + static_cast< CXnDomPropertyValue* >( + colorProperty->Property()->PropertyValueList().Item( 0 ) ); + + if ( value->PrimitiveValueType() == CXnDomPropertyValue::ERgbColor ) + { + TRgb rgb( value->RgbColorValueL() ); + + aGc.SetPenColor( rgb ); + + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + + aGc.DrawRect( paddingRect ); + } + } + } + +// ----------------------------------------------------------------------------- +// StripQuotes +// Strips enclosing quotes from a string +// ----------------------------------------------------------------------------- +// +static void StripQuotes( HBufC*& aString ) + { + TInt pos1 = aString->Locate( '\"' ); + TInt pos2 = aString->Locate( '\'' ); + // check, if the first character is " or ' + if ( pos1 == 0 || pos2 == 0 ) + { + TInt len = aString->Length() - 2; + TPtr ptr = aString->Des(); + TPtrC16 newString( aString->Mid( 1, len ).Ptr(), len ); + ptr = newString; + } + } + +// ----------------------------------------------------------------------------- +// DrawRepeatBackgroundY +// Draws repeated background in the vertical direction +// ----------------------------------------------------------------------------- +// +static void DrawRepeatBackgroundY( + CWindowGc& aGc, TInt aYRepeatCount, CXnNode& aNode, TRect& aRect, + CFbsBitmap* aBitmap, TRect aBitmapRect, + TRect aImageRect, TInt& aYOffset ) + { + for (TInt i = 0; i <= aYRepeatCount && aRect.iTl.iY < aNode.PaddingRect().iBr.iY;) + { + TRect newRect; + newRect = TRect( + aRect.iTl, + TPoint( + aRect.iTl.iX + aImageRect.Width(), + aRect.iTl.iY + aImageRect.Height() ) ); + aGc.DrawBitmap( newRect, aBitmap, aBitmapRect ); + aRect.Move( 0, newRect.Height() ); + aYOffset += newRect.Height(); + if ( ++i == aYRepeatCount || aYRepeatCount == 0 ) + { + break; + } + } + } + +// ----------------------------------------------------------------------------- +// DrawSpaceBackgroundY +// Draws spaced background in the vertical direction +// ----------------------------------------------------------------------------- +// +static void DrawSpaceBackgroundY( + CWindowGc& aGc, TInt aYRepeatCount, CXnNode& aNode, TRect& aRect, + CFbsBitmap* aBitmap, TRect aBitmapRect, + TRect aImageRect, TInt& aYOffset ) + { + for (TInt j = 0; j <= aYRepeatCount && aRect.iTl.iY < aNode.PaddingRect().iBr.iY;) + { + TRect newRect = aRect; + newRect = TRect( + aRect.iTl, + TPoint( + aRect.iTl.iX + aImageRect.Width(), + aRect.iTl.iY + aImageRect.Height() ) ); + aGc.DrawBitmap( newRect, aBitmap, aBitmapRect ); + aRect.Move( 0, newRect.Height() ); + aYOffset += newRect.Height(); + if ( ++j == aYRepeatCount || aYRepeatCount == 0 ) + { + break; + } + } + } + +// ----------------------------------------------------------------------------- +// LimitRectToPaddingRect +// Limits a rect so that it does not exceed padding rect +// ----------------------------------------------------------------------------- +// +static void LimitRectToPaddingRect( CXnNode& aNode, TRect& aRect ) + { + TRect tmpRect = aNode.PaddingRect(); + if ( aRect.iTl.iX < tmpRect.iTl.iX ) + { + aRect.SetRect( tmpRect.iTl.iX, aRect.iTl.iY, aRect.iBr.iX, aRect.iBr.iY ); + } + if ( aRect.iTl.iY < tmpRect.iTl.iY ) + { + aRect.SetRect( aRect.iTl.iX, tmpRect.iTl.iY, aRect.iBr.iX, aRect.iBr.iY ); + } + if ( aRect.iBr.iX > tmpRect.iBr.iX ) + { + aRect.SetRect( aRect.iTl.iX, aRect.iTl.iY, tmpRect.iBr.iX, aRect.iBr.iY ); + } + if ( aRect.iBr.iY > tmpRect.iBr.iY ) + { + aRect.SetRect( aRect.iTl.iX, aRect.iTl.iY, aRect.iBr.iX, tmpRect.iBr.iY ); + } + } + +// ----------------------------------------------------------------------------- +// GetBackroundRepeatValuesL +// Gets background repeat information from node properties +// ----------------------------------------------------------------------------- +// +static void GetBackroundRepeatValuesL( + CXnNode& aNode, + TBool& aRepeatX, + TBool& aRepeatY, + TBool& aSpaceX, + TBool& aSpaceY ) + { + CXnProperty* backgroundRepeatProperty = aNode.GetPropertyL( + XnPropertyNames::appearance::common::KBackGroundRepeat ); + if ( backgroundRepeatProperty ) + { + CXnDomList& propertyValueList = + backgroundRepeatProperty->Property()->PropertyValueList(); + TInt valueCount = propertyValueList.Length(); + for ( TInt i = 0; i < valueCount; ++i ) + { + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( + propertyValueList.Item( i ) ); + if ( value->PrimitiveValueType() == CXnDomPropertyValue::EString || + value->PrimitiveValueType() == CXnDomPropertyValue::EIdent ) + { + switch ( i ) + { + case 0: + { + if ( value->StringValueL() == + XnPropertyNames::appearance::common::backgroundrepeat::KRepeat ) + { + aRepeatX = ETrue; + aRepeatY = ETrue; + } + else if ( value->StringValueL() == + XnPropertyNames::appearance::common::backgroundrepeat::KSpace ) + { + aSpaceX = ETrue; + aSpaceY = ETrue; + } + else if ( value->StringValueL() == + XnPropertyNames::appearance::common::backgroundrepeat::KRepeatX ) + { + aRepeatX = ETrue; + aRepeatY = EFalse; + } + else if ( value->StringValueL() == + XnPropertyNames::appearance::common::backgroundrepeat::KRepeatY ) + { + aRepeatX = EFalse; + aRepeatY = ETrue; + } + break; + } + case 1: + { + if ( value->StringValueL() == + XnPropertyNames::appearance::common::backgroundrepeat::KRepeat ) + { + aRepeatY = ETrue; + aSpaceY = EFalse; + } + else if ( value->StringValueL() == + XnPropertyNames::appearance::common::backgroundrepeat::KSpace ) + { + aRepeatY = EFalse; + aSpaceY = ETrue; + } + else if ( value->StringValueL() == + XnPropertyNames::appearance::common::backgroundrepeat::KNoRepeat ) + { + aRepeatY = EFalse; + aSpaceY = EFalse; + } + break; + } + } + } + } + } + } + +// ----------------------------------------------------------------------------- +// DrawRepeatedBackgroundImage +// Draws a repeated background image +// ----------------------------------------------------------------------------- +// +static void DrawRepeatedBackgroundImage( + CWindowGc& aGc, + CXnNode& aNode, + TRect& aRect, + TRect aImageRect, + TRect aBitmapRect, + CFbsBitmap* aBitmap, + TBool aRepeatX, + TBool aRepeatY, + TBool aSpaceX, + TBool aSpaceY, + TInt aXRepeatCount, + TInt aYRepeatCount ) + { + TRect paddingRect = aNode.PaddingRect(); + if ( aRepeatX && !aRepeatY && !aSpaceX && !aSpaceY ) + { + aRect.SetRect( TPoint( paddingRect.iTl.iX, aRect.iTl.iY ), aRect.Size() ); + for ( TInt i = 0; i <= aXRepeatCount && aRect.iTl.iX < paddingRect.iBr.iX; ) + { + TRect newRect = TRect( + aRect.iTl, + TPoint( + aRect.iTl.iX + aImageRect.Width(), + aRect.iTl.iY + aImageRect.Height() ) ); + aGc.DrawBitmap( newRect, aBitmap, aBitmapRect ); + aRect.Move( newRect.Width(), 0 ); + if ( ++i == aXRepeatCount || aXRepeatCount == 0 ) + { + break; + } + } + } + else if ( !aRepeatX && !aRepeatY && aSpaceX && !aSpaceY ) + { + aRect.SetRect( TPoint( paddingRect.iTl.iX, aRect.iTl.iY ), aRect.Size() ); + if ( aImageRect.Width() < paddingRect.Width() && aXRepeatCount > 0 ) + { + aRect.Move( + ( paddingRect.Width() - aImageRect.Width() * aXRepeatCount ) / 2, + 0 ); + } + for ( TInt i = 0; i <= aXRepeatCount && aRect.iTl.iX < paddingRect.iBr.iX; ) + { + TRect newRect = TRect( + aRect.iTl, + TPoint( + aRect.iTl.iX + aImageRect.Width(), + aRect.iTl.iY + aImageRect.Height() ) ); + aGc.DrawBitmap( newRect, aBitmap, aBitmapRect ); + aRect.Move( newRect.Width(), 0 ); + if ( ++i == aXRepeatCount || aXRepeatCount == 0 ) + { + break; + } + } + } + else if ( !aRepeatX && aRepeatY && !aSpaceX && !aSpaceY ) + { + aRect.SetRect( TPoint( aRect.iTl.iX, paddingRect.iTl.iY ), aRect.Size() ); + TInt yOffset = 0; + DrawRepeatBackgroundY( + aGc, aYRepeatCount, aNode, aRect, + aBitmap, aBitmapRect, + aImageRect, yOffset ); + } + else if ( !aRepeatX && !aRepeatY && !aSpaceX && aSpaceY ) + { + aRect.SetRect( TPoint( aRect.iTl.iX, paddingRect.iTl.iY ), aRect.Size() ); + if ( aImageRect.Height() < paddingRect.Height() && aYRepeatCount > 0 ) + { + aRect.Move( + 0, + ( paddingRect.Height() - aImageRect.Height() * aYRepeatCount ) / 2 ); + } + TInt yOffset = 0; + DrawSpaceBackgroundY( + aGc, aYRepeatCount, aNode, aRect, + aBitmap, aBitmapRect, + aImageRect, yOffset ); + } + else if ( aRepeatX && aRepeatY && !aSpaceX && !aSpaceY ) + { + aRect.SetRect( paddingRect.iTl, aRect.Size() ); + TInt yOffset = 0; + for ( TInt i = 0; i <= aXRepeatCount && aRect.iTl.iX < paddingRect.iBr.iX; ) + { + aRect.Move( 0, -yOffset ); + yOffset = 0; + TRect newRect = TRect( + aRect.iTl, + TPoint( + aRect.iTl.iX + aImageRect.Width(), + aRect.iTl.iY + aImageRect.Height() ) ); + aRect = newRect; + DrawRepeatBackgroundY( + aGc, aYRepeatCount, aNode, aRect, + aBitmap, aBitmapRect, + aImageRect, yOffset ); + aRect.Move( newRect.Width(), 0 ); + if ( ++i == aXRepeatCount || aXRepeatCount == 0 ) + { + break; + } + } + } + else if ( !aRepeatX && !aRepeatY && aSpaceX && aSpaceY ) + { + aRect.SetRect( paddingRect.iTl, aRect.Size() ); + if ( aImageRect.Width() < paddingRect.Width() && aXRepeatCount > 0 ) + { + aRect.Move( + ( paddingRect.Width() - aImageRect.Width() * aXRepeatCount ) / 2, + 0 ); + } + if ( aImageRect.Height() < paddingRect.Height() && aYRepeatCount > 0 ) + { + aRect.Move( + 0, + ( paddingRect.Height() - aImageRect.Height() * aYRepeatCount ) / 2 ); + } + TInt yOffset = 0; + for ( TInt i = 0; i <= aXRepeatCount && aRect.iTl.iX < paddingRect.iBr.iX; ) + { + aRect.Move( 0, -yOffset ); + yOffset = 0; + TRect newRect = TRect( + aRect.iTl, + TPoint( + aRect.iTl.iX + aImageRect.Width(), + aRect.iTl.iY + aImageRect.Height() ) ); + aRect = newRect; + DrawSpaceBackgroundY( + aGc, aYRepeatCount, aNode, aRect, + aBitmap, aBitmapRect, + aImageRect, yOffset ); + aRect.Move( newRect.Width(), 0 ); + if ( ++i == aXRepeatCount || aXRepeatCount == 0 ) + { + break; + } + } + } + else if ( aRepeatX && !aRepeatY && !aSpaceX && aSpaceY ) + { + aRect.SetRect( paddingRect.iTl, aRect.Size() ); + if ( aImageRect.Height() < paddingRect.Height() && aYRepeatCount > 0 ) + { + aRect.Move( + 0, + ( paddingRect.Height() - aImageRect.Height() * aYRepeatCount ) / 2 ); + } + TInt yOffset = 0; + for ( TInt i = 0; i <= aXRepeatCount && aRect.iTl.iX < paddingRect.iBr.iX; ) + { + aRect.Move( 0, -yOffset ); + yOffset = 0; + TRect newRect = TRect( + aRect.iTl, + TPoint( + aRect.iTl.iX + aImageRect.Width(), + aRect.iTl.iY + aImageRect.Height() ) ); + aRect = newRect; + DrawSpaceBackgroundY( + aGc, aYRepeatCount, aNode, aRect, + aBitmap, aBitmapRect, + aImageRect, yOffset ); + aRect.Move( newRect.Width(), 0 ); + if ( ++i == aXRepeatCount || aXRepeatCount == 0 ) + { + break; + } + } + } + else if ( !aRepeatX && aRepeatY && aSpaceX && !aSpaceY ) + { + aRect.SetRect( paddingRect.iTl, aRect.Size() ); + TInt yOffset = 0; + if ( aImageRect.Width() < paddingRect.Width() && aXRepeatCount > 0 ) + { + aRect.Move( + ( paddingRect.Width() - aImageRect.Width() * aXRepeatCount ) / 2, + -yOffset ); + } + for ( TInt i = 0; i <= aXRepeatCount && aRect.iTl.iX < paddingRect.iBr.iX; ) + { + aRect.Move( 0, -yOffset ); + yOffset = 0; + TRect newRect = TRect( + aRect.iTl, + TPoint( + aRect.iTl.iX + aImageRect.Width(), + aRect.iTl.iY + aImageRect.Height() ) ); + aRect = newRect; + DrawRepeatBackgroundY( + aGc, aYRepeatCount, aNode, aRect, + aBitmap, aBitmapRect, + aImageRect, yOffset ); + aRect.Move( newRect.Width(), 0 ); + if ( ++i == aXRepeatCount || aXRepeatCount == 0 ) + { + break; + } + } + } + } + +// ----------------------------------------------------------------------------- +// GetBackgroundPositionFromPropertyL +// Gets background position information from node properties +// ----------------------------------------------------------------------------- +// +static TBool GetBackgroundPositionFromPropertyL( + CXnNode& aNode, + TBool aScaleImage, + TRect& aRect, + TRect aImageRect, + CFbsBitmap* aBitmap, + TBool& aHeightSet ) + { + CXnProperty* backgroundPositionProperty = aNode.GetPropertyL( + XnPropertyNames::appearance::common::KBackGroundPosition ); + TBool centerHorizontal = ETrue; + if ( backgroundPositionProperty ) + { + CXnDomList& propertyValueList = + backgroundPositionProperty->Property()->PropertyValueList(); + TSize size; + for ( TInt i = propertyValueList.Length() - 1; i >= 0; --i ) + { + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( + propertyValueList.Item( i ) ); + if ( value->PrimitiveValueType() == CXnDomPropertyValue::EString || + value->PrimitiveValueType() == CXnDomPropertyValue::EIdent ) + { + if ( aScaleImage ) + { + size = aImageRect.Size(); + } + else + { + size = aBitmap->SizeInPixels(); + } + switch ( i ) + { + case 0: + { + // StringValueL will not leave, we check the type first + if ( value->StringValueL() == + XnPropertyNames::appearance::common::backgroundposition::KRight ) + { + centerHorizontal = EFalse; + aRect.Move( aRect.Width(), 0 ); + aRect.Move( -size.iWidth, 0 ); + } + else if ( value->StringValueL() == + XnPropertyNames::appearance::common::backgroundposition::KLeft ) + { + centerHorizontal = EFalse; + } + else if ( value->StringValueL() == + XnPropertyNames::appearance::common::backgroundposition::KBottom ) + { + aHeightSet = ETrue; + aRect.Move( 0, aRect.Height() ); + aRect.Move( 0, -size.iHeight ); + } + else if ( value->StringValueL() == + XnPropertyNames::appearance::common::backgroundposition::KTop ) + { + aHeightSet = ETrue; + } + break; + } + case 1: + { + // StringValueL will not leave, we check the type first + if ( value->StringValueL() == + XnPropertyNames::appearance::common::backgroundposition::KRight ) + { + aRect.Move( aRect.Width(), 0 ); + aRect.Move( -size.iWidth, 0 ); + centerHorizontal = EFalse; + } + else if ( value->StringValueL() == + XnPropertyNames::appearance::common::backgroundposition::KLeft ) + { + centerHorizontal = EFalse; + } + else if ( value->StringValueL() == + XnPropertyNames::appearance::common::backgroundposition::KBottom ) + { + aHeightSet = ETrue; + aRect.Move( 0, aRect.Height() ); + aRect.Move( 0, -size.iHeight ); + } + else if ( value->StringValueL() == + XnPropertyNames::appearance::common::backgroundposition::KTop ) + { + aHeightSet = ETrue; + } + break; + } + } + } + else if ( value->PrimitiveValueType() == CXnDomPropertyValue::EPercentage ) + { + // FloatValueL will not leave, we check the type first + TReal percentage = value->FloatValueL(); + if ( percentage > 100 ) + { + percentage = 100; + } + TSize size = aImageRect.Size(); + switch ( i ) + { + case 0: + { + TInt rectOffset = ( percentage / 100.0 ) * aRect.Width(); + TInt bitmapOffset = ( percentage / 100.0 ) * size.iWidth; + aRect.Move( rectOffset, 0 ); + aRect.Move( -bitmapOffset, 0 ); + centerHorizontal = EFalse; + break; + } + case 1: + { + aHeightSet = ETrue; + TInt rectOffset = ( percentage / 100.0 ) * aRect.Height(); + TInt bitmapOffset = ( percentage / 100.0 ) * size.iHeight; + aRect.Move( 0, rectOffset ); + aRect.Move( 0, -bitmapOffset ); + break; + } + } + } + else + { + CXnDomPropertyValue* tmpValue = NULL; + TRAPD( error, tmpValue = value->CloneL(); ); + if ( error != KErrNone ) + { + return EFalse; + } + CXnProperty* tmpProperty = NULL; + TRAP( error, tmpProperty = CXnProperty::NewL( + KNullDesC8, + tmpValue, + aNode.UiEngine()->ODT()->DomDocument().StringPool() ); ); + if ( error != KErrNone ) + { + delete tmpValue; + return EFalse; + } + switch ( i ) + { + case 0: + { + TInt intValue = 0; + TRAP( error, + intValue = aNode.UiEngine()->HorizontalPixelValueL( + tmpProperty, 0 ); ); + if ( error != KErrNone ) + { + delete tmpProperty; + return EFalse; + } + aRect.Move( intValue, 0 ); + centerHorizontal = EFalse; + break; + } + case 1: + { + aHeightSet = ETrue; + TInt intValue = 0; + TRAP( error, + intValue = aNode.UiEngine()->VerticalPixelValueL( + tmpProperty, 0 ); ); + if ( error != KErrNone ) + { + delete tmpProperty; + return EFalse; + } + aRect.Move( 0, intValue ); + break; + } + } + delete tmpProperty; + } + } + if ( centerHorizontal ) + { + aRect.Move( aRect.Width() / 2, 0 ); + aRect.Move( -size.iWidth / 2, 0 ); + } + } + else + { + aHeightSet = ETrue; + } + return ETrue; + } + +// ----------------------------------------------------------------------------- +// GetBackgroundSizeFromPropertyL +// Gets background size information from node properties +// ----------------------------------------------------------------------------- +// +static TBool GetBackgroundSizeFromPropertyL( + TRect& aRect, + CXnNode& aNode, + CFbsBitmap* aBitmap, + TBool& aScaleImage ) + { + CXnProperty* backgroundSizeProperty = aNode.GetPropertyL( + XnPropertyNames::appearance::common::KBackGroundSize ); + TBool widthAuto = ETrue; + TBool heightAuto = ETrue; + TBool heightSet = EFalse; + TSize size = aBitmap->SizeInPixels(); + if ( backgroundSizeProperty ) + { + widthAuto = EFalse; + heightAuto = EFalse; + CXnDomList& propertyValueList = + backgroundSizeProperty->Property()->PropertyValueList(); + for ( TInt i = propertyValueList.Length() - 1; i >= 0; --i ) + { + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( + propertyValueList.Item( i ) ); + if ( value->IsAutoIdent() ) + { + switch ( i ) + { + case 0: + { + widthAuto = ETrue; + break; + } + case 1: + { + heightAuto = ETrue; + break; + } + } + } + } + for ( TInt i = propertyValueList.Length() - 1; i >= 0; --i ) + { + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( + propertyValueList.Item( i ) ); + if ( value->IsAutoIdent() ) + { + continue; + } + else if ( value->PrimitiveValueType() == CXnDomPropertyValue::EPercentage ) + { + // FloatValueL will not leave, we check the type first + TReal percentage = 100; + TRAP_IGNORE( percentage = value->FloatValueL() ); + if ( percentage > 100 ) + { + percentage = 100; + } + switch ( i ) + { + case 0: + { + TInt widthOffset = ( 1 - ( percentage / 100.0 ) ) * aRect.Width(); + if ( heightAuto ) + { + TReal aspectRatio = + static_cast< TReal >( size.iHeight ) / + static_cast< TReal >( size.iWidth ); + aRect.Resize( -widthOffset, 0 ); + aRect.SetHeight( + static_cast< TInt >( + static_cast< TReal >( + aRect.Width() ) * aspectRatio + 0.5 ) ); + aScaleImage = ETrue; + heightSet = ETrue; + } + else + { + aRect.Resize( -widthOffset, 0 ); + aScaleImage = ETrue; + } + if ( !heightSet ) + { + TInt heightOffset = ( 1 - ( percentage / 100.0 ) ) * aRect.Height(); + aRect.Resize( 0, -heightOffset ); + } + break; + } + case 1: + { + TInt heightOffset = ( 1 - ( percentage / 100.0 ) ) * aRect.Height(); + if ( widthAuto ) + { + TReal aspectRatio = + static_cast< TReal >( size.iHeight ) / + static_cast< TReal >( size.iWidth ); + aRect.Resize( 0, -heightOffset ); + aRect.SetWidth( + static_cast< TInt >( + static_cast< TReal >( + aRect.Height() ) / aspectRatio + 0.5 ) ); + aScaleImage = ETrue; + heightSet = ETrue; + } + else + { + aRect.Resize( 0, -heightOffset ); + aScaleImage = ETrue; + heightSet = ETrue; + } + break; + } + } + } + else + { + CXnDomPropertyValue* tmpValue = NULL; + TRAPD( error, tmpValue = value->CloneL(); ); + if ( error != KErrNone ) + { + return EFalse; + } + CXnProperty* tmpProperty = NULL; + TRAP( error, tmpProperty = CXnProperty::NewL( + KNullDesC8, tmpValue, + aNode.UiEngine()->ODT()->DomDocument().StringPool() ); ); + if ( error != KErrNone ) + { + delete tmpValue; + return EFalse; + } + switch ( i ) + { + case 0: + { + TInt intValue = 0; + TRAP( error, + intValue = aNode.UiEngine()->HorizontalPixelValueL( + tmpProperty, 0 ); ); + TInt widthOffset = aRect.Width() - intValue; + if ( heightAuto ) + { + TReal aspectRatio = + static_cast< TReal >( size.iHeight ) / + static_cast< TReal >( size.iWidth ); + aRect.Resize( -widthOffset, 0 ); + aRect.SetHeight( + static_cast< TInt >( + static_cast< TReal >( + aRect.Width() ) * aspectRatio + 0.5 ) ); + aScaleImage = ETrue; + heightSet = ETrue; + } + else + { + aRect.Resize( -widthOffset, 0 ); + aScaleImage = ETrue; + } + if ( !heightSet ) + { + TInt heightOffset = aRect.Height() - intValue; + aRect.Resize( 0, -heightOffset ); + } + break; + } + case 1: + { + TInt intValue = 0; + TRAP( error, + intValue = aNode.UiEngine()->VerticalPixelValueL( + tmpProperty, 0 ); ); + TInt heightOffset = aRect.Height() - intValue; + if ( widthAuto ) + { + TReal aspectRatio = + static_cast< TReal >( size.iHeight ) / + static_cast< TReal >( size.iWidth ); + aRect.Resize( 0, -heightOffset ); + aRect.SetWidth( + static_cast< TInt >( + static_cast< TReal >( + aRect.Height() ) / aspectRatio + 0.5 ) ); + aScaleImage = ETrue; + heightSet = ETrue; + } + else + { + aRect.Resize( 0, -heightOffset ); + aScaleImage = ETrue; + heightSet = ETrue; + } + break; + } + } + delete tmpProperty; + } + } + } + if ( widthAuto && heightAuto ) + { + if ( size.iHeight < aRect.Height() ) + { + aRect.SetHeight( size.iHeight ); + } + if ( size.iWidth < aRect.Width() ) + { + aRect.SetWidth( size.iWidth ); + } + aScaleImage = EFalse; + } + return ETrue; + } + +// ----------------------------------------------------------------------------- +// LighterColor +// Gets a color that has more HSL lightness (used for border effects) +// ----------------------------------------------------------------------------- +// +static TRgb LighterColor( const TRgb& aRgb ) + { + TUint hue; + TUint saturation; + TUint lightness; + ConvertRgbToHsl( aRgb, hue, saturation, lightness ); + if ( ( static_cast< TInt >( lightness ) + 10 ) <= 100 ) + { + lightness += 10; + } + else + { + lightness = 100; + } + return ConvertHslToRgb( hue, saturation, lightness ); + } + +// ----------------------------------------------------------------------------- +// DarkerColor +// Gets a color that has less HSL lightness (used for border effects) +// ----------------------------------------------------------------------------- +// +static TRgb DarkerColor( const TRgb& aRgb ) + { + TUint hue; + TUint saturation; + TUint lightness; + ConvertRgbToHsl( aRgb, hue, saturation, lightness ); + if ( ( static_cast< TInt >( lightness ) - 10 ) >= 0 ) + { + lightness -= 10; + } + else + { + lightness = 0; + } + return ConvertHslToRgb( hue, saturation, lightness ); + } + +// ----------------------------------------------------------------------------- +// DrawSolidTopBorder +// Draw a top border with solid style +// ----------------------------------------------------------------------------- +// +static void DrawSolidTopBorder( CArrayFix< TPoint >* aArray, CWindowGc& aGc ) + { + aGc.DrawPolygon( aArray ); + } + +// ----------------------------------------------------------------------------- +// SplitTopBorderPolygonL +// Split top border to two parts for border effect drawing +// ----------------------------------------------------------------------------- +// +static void SplitTopBorderPolygonL( + CArrayFix< TPoint >* aArray, + CArrayFix< TPoint >*& aUpperPart, + CArrayFix< TPoint >*& aLowerPart ) + { + TPoint leftHalf = + TPoint( + ( *aArray )[0].iX + ( ( *aArray )[3].iX - ( *aArray )[0].iX ) / 2, + ( *aArray )[0].iY + ( ( *aArray )[3].iY - ( *aArray )[0].iY ) / 2); + TPoint rightHalf = + TPoint( + ( *aArray )[2].iX + ( ( *aArray )[1].iX - ( *aArray )[2].iX ) / 2, + ( *aArray )[1].iY + ( ( *aArray )[2].iY - ( *aArray )[1].iY ) / 2); + aUpperPart->AppendL( ( *aArray )[0] ); + aUpperPart->AppendL( ( *aArray )[1] ); + aUpperPart->AppendL( rightHalf ); + aUpperPart->AppendL( leftHalf ); + aLowerPart->AppendL( leftHalf ); + aLowerPart->AppendL( rightHalf ); + aLowerPart->AppendL( ( *aArray )[2] ); + aLowerPart->AppendL( ( *aArray )[3] ); + } + +// ----------------------------------------------------------------------------- +// DrawRidgeTopBorderL +// Draw top border with ridge style +// ----------------------------------------------------------------------------- +// +static void DrawRidgeTopBorderL( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, TRgb& aRgb ) + { + CArrayFix< TPoint >* upperPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( upperPart ); + CArrayFix< TPoint >* lowerPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( lowerPart ); + SplitTopBorderPolygonL( aArray, upperPart, lowerPart ); + TRgb rgb = LighterColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( upperPart ); + rgb = DarkerColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( lowerPart ); + CleanupStack::PopAndDestroy( lowerPart ); + CleanupStack::PopAndDestroy( upperPart ); + } + +// ----------------------------------------------------------------------------- +// DrawGrooveTopBorderL +// Draw top border with groove style +// ----------------------------------------------------------------------------- +// +static void DrawGrooveTopBorderL( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, TRgb& aRgb ) + { + CArrayFix< TPoint >* upperPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( upperPart ); + CArrayFix< TPoint >* lowerPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( lowerPart ); + SplitTopBorderPolygonL( aArray, upperPart, lowerPart ); + TRgb rgb = DarkerColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( upperPart ); + rgb = LighterColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( lowerPart ); + CleanupStack::PopAndDestroy( lowerPart ); + CleanupStack::PopAndDestroy( upperPart ); + } + +// ----------------------------------------------------------------------------- +// DrawInsetTopBorder +// Draw top border with inset style +// ----------------------------------------------------------------------------- +// +static void DrawInsetTopBorder( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, TRgb& aRgb ) + { + TRgb rgb = DarkerColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( aArray ); + } + +// ----------------------------------------------------------------------------- +// DrawOutsetTopBorder +// Draw top border with outset style +// ----------------------------------------------------------------------------- +// +static void DrawOutsetTopBorder( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, TRgb& aRgb ) + { + TRgb rgb = LighterColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( aArray ); + } + +// ----------------------------------------------------------------------------- +// GetBorderColorL +// Get border color from properties +// ----------------------------------------------------------------------------- +// +static TBool GetBorderColorL( + const TDesC8& aPropertyName, + CXnNode& aNode, + CWindowGc& aGc, + TRgb& aRgb ) + { + CXnProperty* colorProperty = aNode.GetPropertyL( aPropertyName ); + CXnProperty* currentColorProperty = aNode.GetPropertyL( + XnPropertyNames::appearance::common::KColor ); + CXnProperty* borderColorProperty = aNode.GetPropertyL( + XnPropertyNames::appearance::common::KBorderColor ); + if ( colorProperty ) + { + CXnDomProperty* domProperty = colorProperty->Property(); + CXnDomPropertyValue* propertyValue = NULL; + propertyValue = static_cast< CXnDomPropertyValue* >( + domProperty->PropertyValueList().Item( 0 ) ); + if ( propertyValue->IsAutoIdent() ) + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TInt error = AknsUtils::GetCachedColor( + skinInstance, + aRgb, + KAknsIIDQsnLineColors, + EAknsCIQsnLineColorsCG4 ); + if ( error != KErrNone ) + { + return EFalse; + } + } + else + { + TRAPD( error, aRgb = propertyValue->RgbColorValueL(); ); + if ( error != KErrNone ) + { + return EFalse; + } + } + aGc.SetPenColor( aRgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( aRgb ); + } + else if ( borderColorProperty ) + { + CXnDomProperty* domProperty = borderColorProperty->Property(); + CXnDomPropertyValue* propertyValue = NULL; + propertyValue = static_cast< CXnDomPropertyValue* >( + domProperty->PropertyValueList().Item( 0 ) ); + if ( propertyValue->IsAutoIdent() ) + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TInt error = AknsUtils::GetCachedColor( + skinInstance, + aRgb, + KAknsIIDQsnLineColors, + EAknsCIQsnLineColorsCG4 ); + if ( error != KErrNone ) + { + return EFalse; + } + } + else + { + TRAPD( error, aRgb = propertyValue->RgbColorValueL(); ); + if ( error != KErrNone ) + { + return EFalse; + } + } + aGc.SetPenColor( aRgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( aRgb ); + } + else if ( currentColorProperty ) + { + CXnDomProperty* domProperty = currentColorProperty->Property(); + CXnDomPropertyValue* propertyValue = NULL; + propertyValue = static_cast< CXnDomPropertyValue* >( + domProperty->PropertyValueList().Item( 0 ) ); + if ( propertyValue->IsAutoIdent() ) + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TInt error = AknsUtils::GetCachedColor( + skinInstance, + aRgb, + KAknsIIDQsnLineColors, + EAknsCIQsnLineColorsCG4 ); + if ( error != KErrNone ) + { + return EFalse; + } + } + else + { + TRAPD( error, aRgb = propertyValue->RgbColorValueL(); ); + if ( error != KErrNone ) + { + return EFalse; + } + } + aGc.SetPenColor( aRgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( aRgb ); + } + else + { + return EFalse; + } + return ETrue; + } + +// ----------------------------------------------------------------------------- +// DrawTopBorderL +// Draw top border +// ----------------------------------------------------------------------------- +// +static void DrawTopBorderL( + const TRect& /*aRect*/, + CXnNode& aNode, + CWindowGc& aGc ) + { + TRect borderRect = aNode.BorderRect(); + TRect paddingRect = aNode.PaddingRect(); + TRgb rgb; + if ( !GetBorderColorL( XnPropertyNames::appearance::common::KBorderTopColor, aNode, aGc, rgb ) ) + { + return; + } + TPoint tl = borderRect.iTl; + TPoint bl = paddingRect.iTl; + bl.iY -= 1; + bl.iX -= 1; + TPoint tr = borderRect.iTl; + tr.iX += borderRect.Width()-1; + TPoint br = paddingRect.iTl; + br.iX += paddingRect.Width(); + br.iY -= 1; + CArrayFix< TPoint >* array = NULL; + array = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + TRAPD( error, + array->AppendL( tl ); + array->AppendL( tr ); + array->AppendL( br ); + array->AppendL( bl ) ); + if ( error != KErrNone ) + { + delete array; + return; + } + CXnProperty* borderTopStyle = aNode.BorderTopStyleL(); + CXnProperty* borderStyle = aNode.BorderStyleL(); + const TDesC8& borderStyleString = ( borderTopStyle ) ? + borderTopStyle->StringValue() : + ( borderStyle ) ? borderStyle->StringValue() : KNullDesC8; + if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KSolid ) + { + DrawSolidTopBorder( array, aGc ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KInset ) + { + DrawInsetTopBorder( array, aGc, rgb ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KOutset ) + { + DrawOutsetTopBorder( array, aGc, rgb ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KRidge ) + { + TRAP_IGNORE( DrawRidgeTopBorderL( array, aGc, rgb ) ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KGroove ) + { + TRAP_IGNORE( DrawGrooveTopBorderL( array, aGc, rgb ) ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KDotted ) + { + TPoint end( borderRect.iBr.iX, paddingRect.iTl.iY ); + TRect rect( borderRect.iTl, end ); + DrawDottedBorder( rect, aGc, rgb, ETrue ); + } + delete array; + } + +// ----------------------------------------------------------------------------- +// DrawSolidBottomBorder +// Draw bottom border with solid style +// ----------------------------------------------------------------------------- +// +static void DrawSolidBottomBorder( CArrayFix< TPoint >* aArray, CWindowGc& aGc ) + { + aGc.DrawPolygon( aArray ); + } + +// ----------------------------------------------------------------------------- +// SplitBottomBorderPolygonL +// Split bottom border to two parts for border effect drawing +// ----------------------------------------------------------------------------- +// +static void SplitBottomBorderPolygonL( + CArrayFix< TPoint >* aArray, + CArrayFix< TPoint >*& aUpperPart, + CArrayFix< TPoint >*& aLowerPart ) + { + TPoint leftHalf = + TPoint( + ( *aArray )[3].iX + ( ( *aArray )[0].iX - ( *aArray )[3].iX ) / 2, + ( *aArray )[3].iY + ( ( *aArray )[0].iY - ( *aArray )[3].iY ) / 2); + TPoint rightHalf = + TPoint( + ( *aArray )[1].iX + ( ( *aArray )[2].iX - ( *aArray )[1].iX ) / 2, + ( *aArray )[2].iY + ( ( *aArray )[1].iY - ( *aArray )[2].iY ) / 2); + aUpperPart->AppendL( ( *aArray )[0] ); + aUpperPart->AppendL( ( *aArray )[1] ); + aUpperPart->AppendL( rightHalf ); + aUpperPart->AppendL( leftHalf ); + aLowerPart->AppendL( leftHalf ); + aLowerPart->AppendL( rightHalf ); + aLowerPart->AppendL( ( *aArray )[2] ); + aLowerPart->AppendL( ( *aArray )[3] ); + } + +// ----------------------------------------------------------------------------- +// DrawRidgeBottomBorderL +// Draw bottom border with ridge style +// ----------------------------------------------------------------------------- +// +static void DrawRidgeBottomBorderL( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, + TRgb& aRgb ) + { + CArrayFix< TPoint >* upperPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( upperPart ); + CArrayFix< TPoint >* lowerPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( lowerPart ); + SplitBottomBorderPolygonL( aArray, upperPart, lowerPart ); + TRgb rgb = LighterColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( upperPart ); + rgb = DarkerColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( lowerPart ); + CleanupStack::PopAndDestroy( lowerPart ); + CleanupStack::PopAndDestroy( upperPart ); + } + +// ----------------------------------------------------------------------------- +// DrawGrooveBottomBorderL +// Draw bottom border with groove style +// ----------------------------------------------------------------------------- +// +static void DrawGrooveBottomBorderL( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, + TRgb& aRgb ) + { + CArrayFix< TPoint >* upperPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( upperPart ); + CArrayFix< TPoint >* lowerPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( lowerPart ); + SplitBottomBorderPolygonL( aArray, upperPart, lowerPart ); + TRgb rgb = DarkerColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( upperPart ); + rgb = LighterColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( lowerPart ); + CleanupStack::PopAndDestroy( lowerPart ); + CleanupStack::PopAndDestroy( upperPart ); + } + +// ----------------------------------------------------------------------------- +// DrawInsetBottomBorder +// Draw bottom border with inset style +// ----------------------------------------------------------------------------- +// +static void DrawInsetBottomBorder( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, + TRgb& aRgb ) + { + TRgb rgb = LighterColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( aArray ); + } + +// ----------------------------------------------------------------------------- +// DrawOutsetBottomBorder +// Draw bottom border with outset style +// ----------------------------------------------------------------------------- +// +static void DrawOutsetBottomBorder( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, + TRgb& aRgb ) + { + TRgb rgb = DarkerColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( aArray ); + } + +// ----------------------------------------------------------------------------- +// DrawDottedBorder +// Draw dotted border +// ----------------------------------------------------------------------------- +// +static void DrawDottedBorder( + TRect aBorderRect, + CWindowGc& aGc, + TRgb& aRgb, + TBool aHorizontal ) + { + TInt height( aBorderRect.Height() ); + TInt width( aBorderRect.Width() ); + + TInt squareSide( Min( height, width ) ); + + if ( !squareSide ) + { + return; + } + + // Square size 1, 2 and 3 can be drawn with pen patterns + if ( squareSide < 4 ) + { + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + + aGc.SetPenColor( aRgb ); + + for ( TInt i = 0; i < squareSide; i++ ) + { + TPoint start; + TPoint end; + + if ( aHorizontal ) + { + start = TPoint( aBorderRect.iTl.iX, aBorderRect.iTl.iY + i ); + end = TPoint( + aBorderRect.iTl.iX + aBorderRect.Width(), + aBorderRect.iTl.iY + i ); + } + else + { + start = TPoint( aBorderRect.iTl.iX + i, aBorderRect.iTl.iY ); + end = TPoint( + aBorderRect.iTl.iX + i, + aBorderRect.iTl.iY + aBorderRect.Height() ); + } + + if ( squareSide == 3 ) + { + // dashed pen pattern 111000... + aGc.SetPenStyle( CGraphicsContext::EDashedPen ); + aGc.DrawLine( start, end ); + } + else + { + // dotted pen pattern 1000... + aGc.SetPenStyle( CGraphicsContext::EDottedPen ); + aGc.DrawLine( start, end ); + + if ( aHorizontal ) + { + start.iX += ( squareSide == 1 ) ? 2 : 1; + } + else + { + start.iY += ( squareSide == 1 ) ? 2 : 1; + } + + aGc.SetPenStyle( CGraphicsContext::EDottedPen ); + aGc.DrawLine( start, end ); + } + } + } + else + { + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetPenStyle( CGraphicsContext::ENullPen ); + + aGc.SetBrushColor( aRgb ); + + TInt divideCount( 0 ); + + if ( aHorizontal ) + { + divideCount = width / squareSide; + } + else + { + divideCount = height / squareSide; + } + + TRect drawingRect( aBorderRect.iTl, TSize( squareSide, squareSide ) ); + + // every other is drawn + TInt count( divideCount / 2 ); + + for ( TInt i = 0; i <= count; i++ ) + { + aGc.DrawRect( drawingRect ); + + if ( aHorizontal ) + { + drawingRect.Move( squareSide * 2, 0 ); + } + else + { + drawingRect.Move( 0, squareSide * 2 ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// DrawBottomBorder +// Draw bottom border +// ----------------------------------------------------------------------------- +// +static void DrawBottomBorderL( + const TRect& /*aRect*/, + CXnNode& aNode, + CWindowGc& aGc ) + { + TRect borderRect = aNode.BorderRect(); + TRect paddingRect = aNode.PaddingRect(); + TRgb rgb; + if ( !GetBorderColorL( XnPropertyNames::appearance::common::KBorderBottomColor, aNode, aGc, rgb ) ) + { + return; + } + TPoint tl = paddingRect.iBr; + tl.iX -= paddingRect.Width() + 1; + TPoint bl = borderRect.iBr; + bl.iX -= borderRect.Width(); + bl.iY-= 1; + TPoint tr = paddingRect.iBr; + TPoint br = borderRect.iBr; + br.iY -= 1; + br.iX -= 1; + CArrayFix< TPoint >* array = NULL; + array = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + TRAPD( error, + array->AppendL( tl ); + array->AppendL( tr ); + array->AppendL( br ); + array->AppendL( bl ); ); + if ( error != KErrNone ) + { + delete array; + return; + } + CXnProperty* borderBottomStyle = aNode.BorderBottomStyleL(); + CXnProperty* borderStyle = aNode.BorderStyleL(); + const TDesC8& borderStyleString = ( borderBottomStyle ) ? + borderBottomStyle->StringValue() : + ( borderStyle ) ? borderStyle->StringValue() : KNullDesC8; + if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KSolid ) + { + DrawSolidBottomBorder( array, aGc ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KInset ) + { + DrawInsetBottomBorder( array, aGc, rgb ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KOutset ) + { + DrawOutsetBottomBorder( array, aGc, rgb ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KRidge ) + { + TRAP_IGNORE( DrawRidgeBottomBorderL( array, aGc, rgb ) ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KGroove ) + { + TRAP_IGNORE( DrawGrooveBottomBorderL( array, aGc, rgb ) ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KDotted ) + { + TPoint origo( borderRect.iTl.iX, paddingRect.iBr.iY ); + TRect rect( origo, borderRect.iBr ); + DrawDottedBorder( rect, aGc, rgb, ETrue ); + } + delete array; + } + +// ----------------------------------------------------------------------------- +// DrawSolidLeftBorder +// ----------------------------------------------------------------------------- +// +static void DrawSolidLeftBorder( CArrayFix< TPoint >* aArray, CWindowGc& aGc ) + { + aGc.DrawPolygon( aArray ); + } + +// ----------------------------------------------------------------------------- +// SplitLeftBorderPolygonL +// ----------------------------------------------------------------------------- +// +static void SplitLeftBorderPolygonL( + CArrayFix< TPoint >* aArray, + CArrayFix< TPoint >*& aLeftPart, + CArrayFix< TPoint >*& aRightPart ) + { + TPoint upHalf = + TPoint( + ( *aArray )[0].iX + ( ( *aArray )[1].iX - ( *aArray )[0].iX ) / 2, + ( *aArray )[0].iY + ( ( *aArray )[1].iY - ( *aArray )[0].iY ) / 2); + TPoint downHalf = + TPoint( + ( *aArray )[3].iX + ( ( *aArray )[2].iX - ( *aArray )[3].iX ) / 2, + ( *aArray )[2].iY + ( ( *aArray )[3].iY - ( *aArray )[2].iY ) / 2); + aLeftPart->AppendL( ( *aArray )[0] ); + aLeftPart->AppendL( upHalf ); + aLeftPart->AppendL( downHalf ); + aLeftPart->AppendL( ( *aArray )[3] ); + + aRightPart->AppendL( upHalf ); + aRightPart->AppendL( ( *aArray )[1] ); + aRightPart->AppendL( ( *aArray )[2]) ; + aRightPart->AppendL( downHalf ); + } + +// ----------------------------------------------------------------------------- +// DrawRidgeLeftBorderL +// ----------------------------------------------------------------------------- +// +static void DrawRidgeLeftBorderL( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, + TRgb& aRgb ) + { + CArrayFix< TPoint >* leftPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( leftPart ); + CArrayFix< TPoint >* rightPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( rightPart ); + SplitLeftBorderPolygonL( aArray, leftPart, rightPart ); + TRgb rgb = LighterColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( leftPart ); + rgb = DarkerColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( rightPart ); + CleanupStack::PopAndDestroy( rightPart ); + CleanupStack::PopAndDestroy( leftPart ); + } + +// ----------------------------------------------------------------------------- +// DrawGrooveLeftBorderL +// ----------------------------------------------------------------------------- +// +static void DrawGrooveLeftBorderL( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, + TRgb& aRgb ) + { + CArrayFix< TPoint >* leftPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( leftPart ); + CArrayFix< TPoint >* rightPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( rightPart ); + SplitLeftBorderPolygonL( aArray, leftPart, rightPart ); + TRgb rgb = DarkerColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( leftPart ); + rgb = LighterColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( rightPart ); + CleanupStack::PopAndDestroy( rightPart ); + CleanupStack::PopAndDestroy( leftPart ); + } + +// ----------------------------------------------------------------------------- +// DrawInsetLeftBorder +// ----------------------------------------------------------------------------- +// +static void DrawInsetLeftBorder( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, + TRgb& aRgb ) + { + TRgb rgb = DarkerColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( aArray ); + } + +// ----------------------------------------------------------------------------- +// DrawOutsetLeftBorder +// ----------------------------------------------------------------------------- +// +static void DrawOutsetLeftBorder( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, + TRgb& aRgb ) + { + TRgb rgb = LighterColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( aArray ); + } + +// ----------------------------------------------------------------------------- +// DrawLeftBorderL +// ----------------------------------------------------------------------------- +// +static void DrawLeftBorderL( + const TRect& /*aRect*/, + CXnNode& aNode, + CWindowGc& aGc ) + { + TRect borderRect = aNode.BorderRect(); + TRect paddingRect = aNode.PaddingRect(); + TRgb rgb; + if ( !GetBorderColorL( XnPropertyNames::appearance::common::KBorderLeftColor, aNode, aGc, rgb ) ) + { + return; + } + TPoint tl = borderRect.iTl; + TPoint bl = borderRect.iBr; + bl.iX -= borderRect.Width(); + TPoint tr = paddingRect.iTl; + tr.iX -= 1; + tr.iY -= 1; + TPoint br = paddingRect.iBr; + br.iX -= paddingRect.Width() + 1; + CArrayFix< TPoint >* array = NULL; + array = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + TRAPD( error, + array->AppendL( tl ); + array->AppendL( tr ); + array->AppendL( br ); + array->AppendL( bl ); ); + if ( error != KErrNone ) + { + delete array; + return; + } + CXnProperty* borderLeftStyle = aNode.BorderLeftStyleL(); + CXnProperty* borderStyle = aNode.BorderStyleL(); + const TDesC8& borderStyleString = ( borderLeftStyle ) ? + borderLeftStyle->StringValue() : + ( borderStyle ) ? borderStyle->StringValue() : KNullDesC8; + if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KSolid ) + { + DrawSolidLeftBorder( array, aGc ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KInset ) + { + DrawInsetLeftBorder( array, aGc, rgb ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KOutset ) + { + DrawOutsetLeftBorder( array, aGc, rgb ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KRidge ) + { + TRAP_IGNORE( DrawRidgeLeftBorderL( array, aGc, rgb ) ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KGroove ) + { + TRAP_IGNORE( DrawGrooveLeftBorderL( array, aGc, rgb ) ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KDotted ) + { + TPoint origo( borderRect.iTl.iX, paddingRect.iTl.iY ); + TPoint end( paddingRect.iTl.iX, paddingRect.iBr.iY ); + TRect rect( origo, end ); + DrawDottedBorder( rect, aGc, rgb, EFalse ); + } + delete array; + } + +// ----------------------------------------------------------------------------- +// DrawSolidRightBorder +// ----------------------------------------------------------------------------- +// +static void DrawSolidRightBorder( CArrayFix< TPoint >* aArray, CWindowGc& aGc ) + { + aGc.DrawPolygon( aArray ); + } + +// ----------------------------------------------------------------------------- +// SplitRightBorderPolygonL +// ----------------------------------------------------------------------------- +// +static void SplitRightBorderPolygonL( + CArrayFix< TPoint >* aArray, + CArrayFix< TPoint >*& aLeftPart, + CArrayFix< TPoint >*& aRightPart ) + { + TPoint upHalf = + TPoint( + ( *aArray )[0].iX + ( ( *aArray )[1].iX - ( *aArray )[0].iX ) / 2, + ( *aArray )[1].iY + ( ( *aArray )[0].iY - ( *aArray )[1].iY ) / 2); + TPoint downHalf = + TPoint( + ( *aArray )[3].iX + ( ( *aArray )[2].iX - ( *aArray )[3].iX ) / 2, + ( *aArray )[3].iY + ( ( *aArray )[2].iY - ( *aArray )[3].iY ) / 2); + aLeftPart->AppendL( ( *aArray )[0] ); + aLeftPart->AppendL( upHalf ); + aLeftPart->AppendL( downHalf ); + aLeftPart->AppendL( ( *aArray )[3] ); + + aRightPart->AppendL( upHalf ); + aRightPart->AppendL( ( *aArray )[1] ); + aRightPart->AppendL( ( *aArray )[2]) ; + aRightPart->AppendL( downHalf ); + } + +// ----------------------------------------------------------------------------- +// DrawRidgeRightBorderL +// ----------------------------------------------------------------------------- +// +static void DrawRidgeRightBorderL( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, + TRgb& aRgb ) + { + CArrayFix< TPoint >* leftPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( leftPart ); + CArrayFix< TPoint >* rightPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( rightPart ); + SplitRightBorderPolygonL( aArray, leftPart, rightPart ); + TRgb rgb = LighterColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( leftPart ); + rgb = DarkerColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( rightPart ); + CleanupStack::PopAndDestroy( rightPart ); + CleanupStack::PopAndDestroy( leftPart ); + } + +// ----------------------------------------------------------------------------- +// DrawGrooveRightBorderL +// ----------------------------------------------------------------------------- +// +static void DrawGrooveRightBorderL( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, + TRgb& aRgb ) + { + CArrayFix< TPoint >* leftPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( leftPart ); + CArrayFix< TPoint >* rightPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + CleanupStack::PushL( rightPart ); + SplitRightBorderPolygonL( aArray, leftPart, rightPart ); + TRgb rgb = DarkerColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( leftPart ); + rgb = LighterColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( rightPart ); + CleanupStack::PopAndDestroy( rightPart ); + CleanupStack::PopAndDestroy( leftPart ); + } + +// ----------------------------------------------------------------------------- +// DrawInsetRightBorder +// ----------------------------------------------------------------------------- +// +static void DrawInsetRightBorder( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, + TRgb& aRgb ) + { + TRgb rgb = LighterColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( aArray ); + } + +// ----------------------------------------------------------------------------- +// DrawOutsetRightBorder +// ----------------------------------------------------------------------------- +// +static void DrawOutsetRightBorder( + CArrayFix< TPoint >* aArray, + CWindowGc& aGc, + TRgb& aRgb ) + { + TRgb rgb = DarkerColor( aRgb ); + aGc.SetPenColor( rgb ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetBrushColor( rgb ); + aGc.DrawPolygon( aArray ); + } + +// ----------------------------------------------------------------------------- +// DrawRightBorderL +// ----------------------------------------------------------------------------- +// +static void DrawRightBorderL( + const TRect& /*aRect*/, + CXnNode& aNode, + CWindowGc& aGc ) + { + TRect borderRect = aNode.BorderRect(); + TRect paddingRect = aNode.PaddingRect(); + TRgb rgb; + if ( !GetBorderColorL( XnPropertyNames::appearance::common::KBorderRightColor, aNode, aGc, rgb ) ) + { + return; + } + TPoint tl = paddingRect.iTl; + tl.iX += paddingRect.Width(); + TPoint bl = paddingRect.iBr; + TPoint tr = borderRect.iTl; + tr.iX += borderRect.Width()-1; + TPoint br = borderRect.iBr; + br.iX -= 1; + br.iY -= 1; + CArrayFix< TPoint >* array = NULL; + array = new ( ELeave ) CArrayFixFlat< TPoint >( 3 ); + TRAPD( error, + array->AppendL( tl ); + array->AppendL( tr ); + array->AppendL( br ); + array->AppendL( bl ); ); + if ( error != KErrNone ) + { + delete array; + return; + } + CXnProperty* borderRightStyle = aNode.BorderRightStyleL(); + CXnProperty* borderStyle = aNode.BorderStyleL(); + const TDesC8& borderStyleString = ( borderRightStyle ) ? + borderRightStyle->StringValue() : + ( borderStyle ) ? borderStyle->StringValue() : KNullDesC8; + if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KSolid ) + { + DrawSolidRightBorder( array, aGc ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KInset ) + { + DrawInsetRightBorder( array, aGc, rgb ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KOutset ) + { + DrawOutsetRightBorder( array, aGc, rgb ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KRidge ) + { + TRAP_IGNORE( DrawRidgeRightBorderL( array, aGc, rgb ) ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KGroove ) + { + TRAP_IGNORE( DrawGrooveRightBorderL( array, aGc, rgb ) ); + } + else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KDotted ) + { + TPoint origo( paddingRect.iBr.iX, paddingRect.iTl.iY ); + TPoint end( borderRect.iBr.iX, paddingRect.iBr.iY ); + TRect rect( origo, end ); + DrawDottedBorder( rect, aGc, rgb, EFalse ); + } + delete array; + } + +// ----------------------------------------------------------------------------- +// DrawBorderImagesL +// ----------------------------------------------------------------------------- +// +static void DrawBorderImagesL( + const TRect& /*aRect*/, + CXnNode& aNode, + CWindowGc& aGc, + CFbsBitmap* aBitmap, + TInt aBorderBitmapDividerTop, + TInt aBorderBitmapDividerRight, + TInt aBorderBitmapDividerBottom, + TInt aBorderBitmapDividerLeft ) + { + CXnProperty* pathProperty = aNode.BorderImageL(); + if ( !pathProperty ) + { + return; + } + TRect borderRect = aNode.BorderRect(); + TRect paddingRect = aNode.PaddingRect(); + TRect topLeft = TRect( borderRect.iTl, paddingRect.iTl ); + TRect topLeftSource = TRect( + TPoint( 0, 0 ), + TPoint( aBorderBitmapDividerLeft, aBorderBitmapDividerTop ) ); + aGc.DrawBitmap( topLeft, aBitmap, topLeftSource ); + TRect bottomLeft = TRect( + TPoint( borderRect.iTl.iX, paddingRect.iTl.iY + paddingRect.Height() ), + TPoint( paddingRect.iTl.iX, borderRect.iTl.iY + borderRect.Height() ) ); + TSize imageSize = aBitmap->SizeInPixels(); + TRect bottomLeftSource = TRect( + TPoint( 0, imageSize.iHeight - aBorderBitmapDividerBottom ), + TPoint( aBorderBitmapDividerLeft, imageSize.iHeight ) ); + aGc.DrawBitmap( bottomLeft, aBitmap, bottomLeftSource ); + TRect topRight = TRect( + TPoint( paddingRect.iBr.iX, borderRect.iTl.iY ), + TPoint( borderRect.iBr.iX, paddingRect.iTl.iY ) ); + TRect topRightSource = TRect( + TPoint( imageSize.iWidth - aBorderBitmapDividerRight, 0 ), + TPoint( imageSize.iWidth, aBorderBitmapDividerTop ) ); + aGc.DrawBitmap( topRight, aBitmap, topRightSource ); + TRect bottomRight = TRect( paddingRect.iBr, borderRect.iBr ); + TRect bottomRightSource = TRect( + TPoint( + imageSize.iWidth - aBorderBitmapDividerRight, + imageSize.iHeight - aBorderBitmapDividerBottom ), + TPoint( + imageSize.iWidth, + imageSize.iHeight ) ); + aGc.DrawBitmap( bottomRight, aBitmap, bottomRightSource ); + TBool xStretch = ETrue; + TBool xRepeat = EFalse; + TBool xRound = EFalse; + TBool yStretch = ETrue; + TBool yRepeat = EFalse; + TBool yRound = EFalse; + if ( pathProperty ) + { + CXnDomList& propertyValueList = pathProperty->Property()->PropertyValueList(); + TBool xHandled = EFalse; + TInt count = propertyValueList.Length(); + for ( TInt i = 0; i < count; ++i ) + { + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( + propertyValueList.Item( i ) ); + if ( value->PrimitiveValueType() == CXnDomPropertyValue::EString || + value->PrimitiveValueType() == CXnDomPropertyValue::EIdent ) + { + const TDesC8& stringValue = value->StringValueL(); + if ( !xHandled ) + { + xHandled = ETrue; + if ( stringValue == XnPropertyNames::appearance::common::borderimage::KStretch ) + { + xStretch = ETrue; + yStretch = ETrue; + } + else if ( stringValue == XnPropertyNames::appearance::common::borderimage::KRepeat ) + { + xStretch = EFalse; + yStretch = EFalse; + xRepeat = ETrue; + yRepeat = ETrue; + } + else if ( stringValue == XnPropertyNames::appearance::common::borderimage::KRound ) + { + xStretch = EFalse; + yStretch = EFalse; + xRound = ETrue; + yRound = ETrue; + } + } + else + { + if ( stringValue == XnPropertyNames::appearance::common::borderimage::KStretch ) + { + yStretch = ETrue; + yRepeat = EFalse; + yRound = EFalse; + } + else if ( stringValue == XnPropertyNames::appearance::common::borderimage::KRepeat ) + { + yStretch = EFalse; + yRepeat = ETrue; + yRound = EFalse; + } + else if ( stringValue == XnPropertyNames::appearance::common::borderimage::KRound ) + { + yStretch = EFalse; + yRepeat = EFalse; + yRound = ETrue; + } + } + } + } + } + TRect top = TRect( + TPoint( paddingRect.iTl.iX, borderRect.iTl.iY ), + TPoint( paddingRect.iBr.iX, paddingRect.iTl.iY ) ); + TRect topSource = TRect( + TPoint( aBorderBitmapDividerLeft, 0 ), + TPoint( imageSize.iWidth - aBorderBitmapDividerRight, aBorderBitmapDividerTop ) ); + if ( xStretch ) + { + aGc.DrawBitmap( top, aBitmap, topSource ); + } + else if ( xRepeat && topSource.Width() ) + { + TInt count = top.Width() / topSource.Width(); + TInt topWidth = top.Width(); + top.SetWidth( topSource.Width() ); + for ( TInt i = 0; i < count; ++i ) + { + aGc.DrawBitmap( top, aBitmap, topSource ); + top.Move( topSource.Width(), 0 ); + } + top.SetWidth( topWidth - count * topSource.Width() ); + aGc.DrawBitmap( top, aBitmap, topSource ); + } + else if ( xRound && topSource.Width() ) + { + TInt count = top.Width() / topSource.Width(); + TInt topWidth = top.Width(); + //top.Move((topWidth - count * topSource.Width()) / 2, 0); + if ( ( count * topSource.Width() ) < topWidth ) + { + ++count; + top.SetWidth( topWidth / count ); + } + else + { + top.SetWidth( topSource.Width() ); + } + for ( TInt i = 0; i < count; ++i ) + { + aGc.DrawBitmap( top, aBitmap, topSource ); + top.Move( top.Width(), 0 ); + } + } + TRect right = TRect( + TPoint( paddingRect.iBr.iX, paddingRect.iTl.iY ), + TPoint( borderRect.iBr.iX, paddingRect.iBr.iY ) ); + TRect rightSource = TRect( + TPoint( imageSize.iWidth - aBorderBitmapDividerRight, aBorderBitmapDividerTop ), + TPoint( imageSize.iWidth, imageSize.iHeight - aBorderBitmapDividerBottom ) ); + if ( yStretch ) + { + aGc.DrawBitmap( right, aBitmap, rightSource ); + } + else if ( yRepeat && rightSource.Height() ) + { + TInt count = right.Height() / rightSource.Height(); + TInt rightHeight = right.Height(); + right.SetHeight( rightSource.Height() ); + for ( TInt i = 0; i < count; ++i ) + { + aGc.DrawBitmap( right, aBitmap, rightSource ); + right.Move( 0, rightSource.Height() ); + } + right.SetHeight( rightHeight - count * rightSource.Height() ); + aGc.DrawBitmap( right, aBitmap, rightSource ); + } + else if ( yRound && rightSource.Height() ) + { + TInt count = right.Height() / rightSource.Height(); + TInt rightHeight = right.Height(); + if ( ( count * rightSource.Height() ) < rightHeight ) + { + ++count; + right.SetHeight( rightHeight / count ); + } + else + { + right.SetHeight( rightSource.Width() ); + } + for ( TInt i = 0; i < count; ++i ) + { + aGc.DrawBitmap( right, aBitmap, rightSource ); + right.Move( 0, right.Height() ); + } + } + TRect bottom = TRect( + TPoint( paddingRect.iTl.iX, paddingRect.iBr.iY ), + TPoint( paddingRect.iBr.iX, borderRect.iBr.iY ) ); + TRect bottomSource = TRect( + TPoint( aBorderBitmapDividerLeft, imageSize.iHeight - aBorderBitmapDividerBottom ), + TPoint( imageSize.iWidth - aBorderBitmapDividerRight, imageSize.iHeight ) ); + if ( xStretch ) + { + aGc.DrawBitmap( bottom, aBitmap, bottomSource ); + } + else if ( xRepeat && bottomSource.Width() ) + { + TInt count = bottom.Width() / bottomSource.Width(); + TInt bottomWidth = bottom.Width(); + bottom.SetWidth( bottomSource.Width() ); + for ( TInt i = 0; i < count; ++i ) + { + aGc.DrawBitmap( bottom, aBitmap, bottomSource ); + bottom.Move( bottomSource.Width(), 0 ); + } + bottom.SetWidth( bottomWidth - count * bottomSource.Width() ); + aGc.DrawBitmap( bottom, aBitmap, bottomSource ); + } + else if ( xRound && bottomSource.Width() ) + { + TInt count = bottom.Width() / bottomSource.Width(); + TInt bottomWidth = bottom.Width(); + if ( ( count * bottomSource.Width() ) < bottomWidth ) + { + ++count; + bottom.SetWidth( bottomWidth / count ); + } + else + { + bottom.SetWidth( bottomSource.Width() ); + } + for ( TInt i = 0; i < count; ++i ) + { + aGc.DrawBitmap( bottom, aBitmap, bottomSource ); + bottom.Move( bottom.Width(), 0 ); + } + } + TRect left = TRect( + TPoint( borderRect.iTl.iX, paddingRect.iTl.iY ), + TPoint( paddingRect.iTl.iX, paddingRect.iBr.iY ) ); + TRect leftSource = TRect( + TPoint( 0, aBorderBitmapDividerTop ), + TPoint( aBorderBitmapDividerLeft, imageSize.iHeight - aBorderBitmapDividerBottom ) ); + if ( yStretch ) + { + aGc.DrawBitmap( left, aBitmap, leftSource ); + } + else if ( yRepeat && leftSource.Height() ) + { + TInt count = left.Height() / leftSource.Height(); + TInt leftHeight = left.Height(); + left.SetHeight( leftSource.Height() ); + for ( TInt i = 0; i < count; ++i ) + { + aGc.DrawBitmap( left, aBitmap, leftSource ); + left.Move( 0, leftSource.Height() ); + } + left.SetHeight( leftHeight - count * leftSource.Height() ); + aGc.DrawBitmap( left, aBitmap, leftSource ); + } + else if ( yRound && leftSource.Height() ) + { + TInt count = left.Height() / leftSource.Height(); + TInt leftHeight = left.Height(); + if ( ( count * leftSource.Height() ) < leftHeight ) + { + ++count; + left.SetHeight( leftHeight / count ); + } + else + { + left.SetHeight( leftSource.Width() ); + } + for ( TInt i = 0; i < count; ++i ) + { + aGc.DrawBitmap( left, aBitmap, leftSource ); + left.Move( 0, left.Height() ); + } + } + } + +// ----------------------------------------------------------------------------- +// IsPropertyNone +// ----------------------------------------------------------------------------- +// +static TBool IsPropertyNone( CXnProperty& aProperty ) + { + if ( &aProperty ) + { + TInt index = 0; + CXnDomProperty* domProperty = aProperty.Property(); + CXnDomPropertyValue* domPropertyValue = + static_cast< CXnDomPropertyValue* >( + domProperty->PropertyValueList().Item( index ) ); + return domPropertyValue->IsNoneIdent(); + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// DrawBordersL +// ----------------------------------------------------------------------------- +// +static void DrawBordersL( const TRect& aRect, CXnNode& aNode, CWindowGc& aGc ) + { + TRect borderRect( aNode.BorderRect() ); + + if( aNode.PaddingRect() == borderRect ) + { + return; + } + + CXnProperty* commonBorderStyle( aNode.BorderStyleL() ); + CXnProperty* borderStyle( aNode.BorderTopStyleL() ); + + if ( ( borderStyle && !IsPropertyNone( *borderStyle ) ) || + ( commonBorderStyle && !IsPropertyNone( *commonBorderStyle ) ) ) + { + DrawTopBorderL( aRect, aNode, aGc ); + } + + borderStyle = aNode.BorderLeftStyleL(); + + if ( ( borderStyle && !IsPropertyNone( *borderStyle ) ) || + ( commonBorderStyle && !IsPropertyNone( *commonBorderStyle ) ) ) + { + DrawLeftBorderL( aRect, aNode, aGc ); + } + + borderStyle = aNode.BorderRightStyleL(); + + if ( ( borderStyle && !IsPropertyNone( *borderStyle ) ) || + ( commonBorderStyle && !IsPropertyNone( *commonBorderStyle ) ) ) + { + DrawRightBorderL( aRect, aNode, aGc ); + } + + borderStyle = aNode.BorderBottomStyleL(); + + if ( ( borderStyle && !IsPropertyNone( *borderStyle ) ) || + ( commonBorderStyle && !IsPropertyNone( *commonBorderStyle ) ) ) + { + DrawBottomBorderL( aRect, aNode, aGc ); + } + } + +// ----------------------------------------------------------------------------- +// SwapChildArrays +// ----------------------------------------------------------------------------- +// +static void SwapChildArrays( + RPointerArray< CXnControlAdapter >& originalArray, + RPointerArray< CXnControlAdapter >& sortedArray ) + { + originalArray.Reset(); + TInt count = sortedArray.Count(); + for ( TInt i = 0; i < count; ++i ) + { + originalArray.Append( sortedArray[i] ); + } + sortedArray.Reset(); + } + +// ----------------------------------------------------------------------------- +// IsChildZIndexLowerThanCandidateZIndexL +// ----------------------------------------------------------------------------- +// +static TBool IsChildZIndexLowerThanCandidateZIndexL( + CXnProperty* aChildZIndex, + CXnDomPropertyValue* aChildZIndexValue, + CXnProperty* aCandidateZIndex ) + { + if ( !aChildZIndex && !aCandidateZIndex ) + { + return ETrue; + } + if ( !aChildZIndex ) + { + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( + aCandidateZIndex->Property()->PropertyValueList().Item( 0 ) ); + if ( value->IsAutoIdent() ) + { + return ETrue; + } + TReal num = value->FloatValueL(); + if ( num > 0 ) + { + return ETrue; + } + } + else if ( !aCandidateZIndex ) + { + if ( aChildZIndexValue->IsAutoIdent() ) + { + return ETrue; + } + TReal num = aChildZIndexValue->FloatValueL(); + if ( num < 0 ) + { + return ETrue; + } + } + else + { + CXnDomPropertyValue* candidateValue = + static_cast< CXnDomPropertyValue* >( + aCandidateZIndex->Property()->PropertyValueList().Item( 0 ) ); + if ( aChildZIndexValue->IsAutoIdent() && candidateValue->IsAutoIdent() ) + { + return ETrue; + } + else if ( aChildZIndexValue->IsAutoIdent() && !candidateValue->IsAutoIdent() ) + { + return ETrue; + } + else if ( !aChildZIndexValue->IsAutoIdent() && candidateValue->IsAutoIdent() ) + { + return EFalse; + } + TReal childNum = aChildZIndexValue->FloatValueL(); + TReal candidateNum = candidateValue->FloatValueL(); + if ( childNum <= candidateNum ) + { + return ETrue; + } + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// GetZIndex +// ----------------------------------------------------------------------------- +// +static CXnProperty* GetZIndexL( CXnControlAdapter* aAdapter ) + { + CXnComponent* component = aAdapter->Component(); + if ( !component ) + { + return NULL; + } + CXnNode& node = component->Node()->Node(); + return node.ZIndexL(); + } + +// ----------------------------------------------------------------------------- +// InsertChildToSortedArrayL +// ----------------------------------------------------------------------------- +// +static void InsertChildToSortedArrayL( + RPointerArray< CXnControlAdapter >& aTargetArray, + CXnControlAdapter* aChild ) + { + CXnProperty* childZIndex = GetZIndexL( aChild ); + CXnDomPropertyValue* childValue = NULL; + if ( childZIndex ) + { + childValue = static_cast< CXnDomPropertyValue* >( + childZIndex->Property()->PropertyValueList().Item( 0 ) ); + } + TInt count = aTargetArray.Count(); + for ( TInt i = 0; i < count; ++i ) + { + CXnControlAdapter* candidate = aTargetArray[i]; + if ( IsChildZIndexLowerThanCandidateZIndexL( + childZIndex, childValue, GetZIndexL( candidate ) ) ) + { + aTargetArray.Insert( aChild, i ); + return; + } + } + aTargetArray.Append( aChild ); + } + +// ----------------------------------------------------------------------------- +// InitializeBackgroundBitmapL +// ----------------------------------------------------------------------------- +// +static void InitializeBackgroundBitmapL( CXnUiEngine& aEngine, CXnNode& aNode, + TInt& aBitmapIndex, CFbsBitmap*& aBitmap, CFbsBitmap*& aMask, + CXnControlAdapterImpl::TIconProvider*& aIconProvider, RFs& aFsSession ) + { + HBufC* bgPath( GetBackgroundImagePathLC( aNode ) ); + TPtr ptr( bgPath->Des() ); + + GetBitmapL( aEngine, aNode, ptr, aBitmapIndex, + aBitmap, aMask, aIconProvider, aNode.PaddingRect(), aFsSession ); + + CleanupStack::PopAndDestroy( bgPath ); + + if ( !aMask ) + { + HBufC* bgMaskPath( GetBackgroundImageMaskPathLC( aNode ) ); + TPtr ptr( bgMaskPath->Des() ); + + if ( ptr != KNullDesC ) + { + CFbsBitmap* tmpMask( NULL ); + + TRAP_IGNORE( GetBitmapL( aEngine, aNode, ptr, aBitmapIndex, aMask, + tmpMask, aIconProvider, aNode.PaddingRect(), aFsSession ) ); + + delete tmpMask; + } + + CleanupStack::PopAndDestroy( bgMaskPath ); + } + } + +// ----------------------------------------------------------------------------- +// GetBackgroundImagePathLC +// ----------------------------------------------------------------------------- +// +static HBufC* GetBackgroundImagePathLC( CXnNode& aNode ) + { + CXnProperty* pathProperty( aNode.BackgroundImageL() ); + + if ( pathProperty && pathProperty->StringValue() != KNullDesC8 ) + { + HBufC* path( pathProperty->StringValueL() ); + CleanupStack::PushL( path ); + + CXnUtils::StripQuotes( path ); + + return path; + } + + return KNullDesC().AllocLC(); + } + +// ----------------------------------------------------------------------------- +// GetBackgroundImageMaskPathLC +// ----------------------------------------------------------------------------- +// +static HBufC* GetBackgroundImageMaskPathLC( CXnNode& aNode ) + { + CXnProperty* pathProperty( aNode.GetPropertyL( + XnPropertyNames::common::KBackgroundMask ) ); + + if ( pathProperty && pathProperty->StringValue() != KNullDesC8 ) + { + HBufC* path( pathProperty->StringValueL() ); + CleanupStack::PushL( path ); + + CXnUtils::StripQuotes( path ); + + return path; + } + + return KNullDesC().AllocLC(); + } + +// ----------------------------------------------------------------------------- +// InitializeBorderBitmapL +// ----------------------------------------------------------------------------- +// +static CFbsBitmap* InitializeBorderBitmapL( + CXnUiEngine& aEngine, + CXnNode& aNode, + TInt& aBitmapIndex, + TInt& aBorderBitmapDividerTop, + TInt& aBorderBitmapDividerRight, + TInt& aBorderBitmapDividerBottom, + TInt& aBorderBitmapDividerLeft, + CXnControlAdapterImpl::TIconProvider*& aIconProvider, + RFs& aFsSession ) + { + CXnProperty* pathProperty = aNode.BorderImageL(); + CFbsBitmap* returnValue = NULL; + CFbsBitmap* bitmapMask = NULL; + + CXnDomList& propertyValueList = pathProperty->Property()->PropertyValueList(); + TInt count = propertyValueList.Length(); + + for ( TInt i = 0; i < propertyValueList.Length(); ++i ) + { + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( + propertyValueList.Item( i ) ); + + if ( value->PrimitiveValueType() == CXnDomPropertyValue::EUri ) + { + const TDesC8& path = value->StringValueL(); + + HBufC* utfPath = HBufC::NewL( path.Length() ); + TPtr16 ptr = utfPath->Des(); + + CnvUtfConverter::ConvertToUnicodeFromUtf8( ptr, path ); + CleanupStack::PushL( utfPath ); + + StripQuotes( utfPath ); + + GetBitmapL( aEngine, aNode, *utfPath, aBitmapIndex, returnValue, + bitmapMask, aIconProvider, aNode.BorderRect(), aFsSession ); + + delete bitmapMask; + + CleanupStack::PopAndDestroy( utfPath ); + } + else if ( value->PrimitiveValueType() == CXnDomPropertyValue::EPercentage ) + { + CXnDomPropertyValue* tmpValue = NULL; + tmpValue = value->CloneL(); + CXnProperty* tmpProperty = NULL; + CleanupStack::PushL( tmpValue ); + tmpProperty = CXnProperty::NewL( + KNullDesC8, + tmpValue, + aNode.UiEngine()->ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( tmpValue ); + TSize imageSize = returnValue->SizeInPixels(); + CleanupStack::PushL( tmpProperty ); + TInt intValue = static_cast< TInt >( value->FloatValueL() ); + TInt dividerValue = 0; + + switch ( i ) + { + case 1: + { + dividerValue = aNode.UiEngine()->VerticalPixelValueL( + tmpProperty, imageSize.iHeight ); + aBorderBitmapDividerTop = dividerValue; + break; + } + case 2: + { + dividerValue = aNode.UiEngine()->HorizontalPixelValueL( + tmpProperty, imageSize.iWidth ); + aBorderBitmapDividerRight = dividerValue; + break; + } + case 3: + { + dividerValue = aNode.UiEngine()->VerticalPixelValueL( + tmpProperty, imageSize.iHeight ); + aBorderBitmapDividerBottom = dividerValue; + break; + } + case 4: + { + dividerValue = aNode.UiEngine()->HorizontalPixelValueL( + tmpProperty, imageSize.iWidth ); + aBorderBitmapDividerLeft = dividerValue; + break; + } + } + + CleanupStack::PopAndDestroy( tmpProperty ); + } + else if ( value->PrimitiveValueType() == CXnDomPropertyValue::EString || + value->PrimitiveValueType() == CXnDomPropertyValue::EIdent ) + { + } + else + { + TInt intValue = static_cast< TInt >( value->FloatValueL() ); + + switch ( i ) + { + case 1: + { + aBorderBitmapDividerTop = intValue; + break; + } + case 2: + { + aBorderBitmapDividerRight = intValue; + break; + } + case 3: + { + aBorderBitmapDividerBottom = intValue; + break; + } + case 4: + { + aBorderBitmapDividerLeft = intValue; + break; + } + } + } + } + + return returnValue; + } + +// ----------------------------------------------------------------------------- +// BuildTriggerTypeNodeL +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildTriggerTypeNodeL( const TDesC8& aName, + const TDesC8& aValue, CXnUiEngine& aUiEngine ) + { + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + CXnType* type = CXnType::NewL( XnPropertyNames::action::KProperty ); + CleanupStack::PushL( type ); + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( nameValue ); + nameValue->SetStringValueL( CXnDomPropertyValue::EString, aName ); + CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::KName, + nameValue, aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + node->SetPropertyL( name ); + CleanupStack::Pop( name ); + CXnDomPropertyValue* valueValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( valueValue ); + valueValue->SetStringValueL( CXnDomPropertyValue::EString, aValue ); + CXnProperty* value = CXnProperty::NewL( XnPropertyNames::action::KValue, + valueValue, aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( valueValue ); + CleanupStack::PushL( value ); + node->SetPropertyL( value ); + CleanupStack::Pop( value ); + CleanupStack::Pop( node ); + return node; + } + +// ----------------------------------------------------------------------------- +// BuildTriggerNodeL +// Builds a trigger node +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildTriggerNodeL( + CXnUiEngine& aUiEngine, + const TDesC8& aTriggerName, + const TDesC8& aTriggerValueName, + const TDesC8& aTriggerValue ) + { + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger ); + CleanupStack::PushL( type ); + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + CXnDomPropertyValue* nameValue = + CXnDomPropertyValue::NewL( aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( nameValue ); + nameValue->SetStringValueL( CXnDomPropertyValue::EString, aTriggerName ); + CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::trigger::KName, + nameValue, aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + node->SetPropertyL( name ); + CleanupStack::Pop( name ); + CXnNode* triggerType = BuildTriggerTypeNodeL( aTriggerValueName, + aTriggerValue, aUiEngine ); + CleanupStack::PushL( triggerType ); + node->AddChildL( triggerType ); + CleanupStack::Pop( triggerType ); + CleanupStack::Pop( node ); + return node; + } + +// ----------------------------------------------------------------------------- +// BuildTriggerNodeL +// Builds a trigger node +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildTriggerNodeL( + CXnUiEngine& aUiEngine, + const TDesC8& aTriggerName ) + { + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger ); + CleanupStack::PushL( type ); + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + CXnDomPropertyValue* nameValue = + CXnDomPropertyValue::NewL( aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( nameValue ); + nameValue->SetStringValueL( CXnDomPropertyValue::EString, aTriggerName ); + CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::trigger::KName, + nameValue, aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + node->SetPropertyL( name ); + CleanupStack::Pop( name ); + CleanupStack::Pop( node ); + return node; + } + +// ----------------------------------------------------------------------------- +// Create scaled bitmap from source bitmap. +// ----------------------------------------------------------------------------- +// +void CreateScaledBitmapL( + const TRect& aRect, + CFbsBitmap*& aTrgBitmap, + CFbsBitmap* aSrcBitmap, + TBool aPreserveAspectRatio, + TBool aForceFallBack ) + { + TRect destRect = aRect; + + if ( aPreserveAspectRatio ) + { + // Calculate the bitmap image dimensions so that it uses maximum space + // of the given rectangle and maintains aspect ratio. + TInt srcHeight = aSrcBitmap->SizeInPixels().iHeight; + TInt srcWidth = aSrcBitmap->SizeInPixels().iWidth; + TReal scaleRatio( 1 ); //no scale as defaul + + //If any dimension is 0, then we do not bother to scale + if ( aRect.Width() > 0 && aRect.Height() > 0 ) + { + TReal xRatio = ( ( TReal )srcWidth / ( TReal )aRect.Width() ); + TReal yRatio = ( ( TReal )srcHeight / ( TReal )aRect.Height() ); + //Find out appropriate scaling factor + xRatio > yRatio ? ( scaleRatio = xRatio ) : ( scaleRatio = yRatio ); + } + + //Scale the size for target bitmap + destRect.SetHeight( srcHeight / scaleRatio ); + destRect.SetWidth( srcWidth / scaleRatio ); + } + + // see if there's a need to scale. If source and destination size are the same, + // then we don't need to duplicate the bitmap. aTrgBitmap will be null. + TSize srcSize = aSrcBitmap->SizeInPixels(); + TSize destSize = destRect.Size(); + if ( srcSize == destSize ) + { + return; + } + + aTrgBitmap = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( aTrgBitmap ); + //It is allowed to create zero height or width bitmap. + TInt err( aTrgBitmap->Create( destRect.Size(), aSrcBitmap->DisplayMode() ) ); + + if ( err == KErrNone ) + { + CXnUtils::ScaleBitmapExtL( destRect, aTrgBitmap, aSrcBitmap, aForceFallBack ); + } + + //we do not own the bitmap so just Pop. + CleanupStack::Pop( aTrgBitmap ); + } + +// ----------------------------------------------------------------------------- +// 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 +// ----------------------------------------------------------------------------- +// +static CXnNode* SoftkeyNode( CXnNode* aMenuBarNode, const TPoint aPosition ) + { + if ( aMenuBarNode ) + { + CXnMenuAdapter* adapter = static_cast< CXnMenuAdapter* >( + aMenuBarNode->ComponentNodeImpl()->Component()->ControlAdapter() ); + + CXnNodePluginIf* node( NULL ); + + if ( adapter->FindSoftKeyNodeByPosition( aPosition, node ) ) + { + return &node->Node(); + } + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// DrawFocusAppearance +// Draws focus appearance +// ----------------------------------------------------------------------------- +// +static void DrawFocusAppearance( CXnNode& aNode, CWindowGc& aGc ) + { + TBool grow( EFalse ); + + const TDesC8& name( aNode.DomNode()->Name() ); + + if( name == XnPropertyNames::KPlugin ) + { + grow = ETrue; + } + else + { + TRect marginRect( aNode.MarginRect() ); + + CXnNode* parent( aNode.Parent() ); + + for( ; parent; parent = parent->Parent() ) + { + if( parent->DomNode()->Name() == XnPropertyNames::KPlugin ) + { + if( parent->Rect() == marginRect ) + { + grow = ETrue; + } + + break; + } + } + } + + TRect rect( aNode.PaddingRect() ); + + if( grow ) + { + rect.Grow( KFocusGrowValue, KFocusGrowValue ); + } + + CXnAppUiAdapter* appui( + static_cast< CXnAppUiAdapter* >( iAvkonAppUi ) ); + + appui->ViewAdapter().FocusControl().Draw( rect, aGc ); + } + +// ----------------------------------------------------------------------------- +// HasHoldTrigger +// Queries whether this node has a hold trigger defined +// ----------------------------------------------------------------------------- +// +static CXnDomNode* HasHoldTrigger( CXnDomNode* aNode ) + { + if ( !aNode ) + { + return NULL; + } + + if ( aNode->Name() == XnPropertyNames::action::KTrigger ) + { + CXnDomList& list( aNode->AttributeList() ); + + CXnDomAttribute* name( NULL ); + + name = static_cast< CXnDomAttribute* >( + list.FindByName( XnPropertyNames::action::KName ) ); + + if ( name && name->Value() == XnPropertyNames::action::trigger::name::KHold ) + { + return aNode; + } + } + + CXnDomList& list( aNode->ChildNodes() ); + + for ( TInt i = 0; i < list.Length(); i++ ) + { + CXnDomNode* retval( HasHoldTrigger( + static_cast< CXnDomNode* >( list.Item( i ) ) ) ); + + if ( retval ) + { + return retval; + } + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// CancelFocusRefusalL +// Cancels focus refusal +// ----------------------------------------------------------------------------- +// +static void CancelFocusRefusalL( CXnUiEngine& aUiEngine ) + { + CXnNode* focused( aUiEngine.FocusedNode() ); + + if ( focused ) + { + CXnControlAdapter* control( focused->Control() ); + + if ( control && control->RefusesFocusLoss() ) + { + // It is now time to give up holding focus + focused->UnsetStateL( + XnPropertyNames::style::common::KFocus ); + } + } + } + +// ----------------------------------------------------------------------------- +// BuildSwipeTriggerNodeLC +// Build trigger node for swipe event +// ----------------------------------------------------------------------------- +// +CXnNode* CXnControlAdapterImpl::BuildSwipeTriggerNodeLC( + CXnUiEngine& aUiEngine, + const TDesC8& aDirection ) + { + CXnDomStringPool& sp( aUiEngine.ODT()->DomDocument().StringPool() ); + + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + + CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger ); + CleanupStack::PushL( type ); + + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + + CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( sp ); + CleanupStack::PushL( nameValue ); + + nameValue->SetStringValueL( + CXnDomPropertyValue::EString, + XnPropertyNames::action::trigger::name::KSwipe ); + + CXnProperty* name = CXnProperty::NewL( + XnPropertyNames::action::trigger::KName, + nameValue, sp ); + + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + + node->SetPropertyL( name ); + CleanupStack::Pop( name ); + + CXnDomPropertyValue* reasonValue = CXnDomPropertyValue::NewL( sp ); + CleanupStack::PushL( reasonValue ); + + reasonValue->SetStringValueL( CXnDomPropertyValue::EString, aDirection ); + + CXnProperty* reason = CXnProperty::NewL( + XnPropertyNames::action::trigger::name::swipe::KDirection, + reasonValue, sp ); + + CleanupStack::Pop( reasonValue ); + + CleanupStack::PushL( reason ); + node->SetPropertyL( reason ); + CleanupStack::Pop( reason ); + + return node; + } + +// ----------------------------------------------------------------------------- +// CreateGestureHelperL +// Checks whether gesture is needed to be detected for this node +// ----------------------------------------------------------------------------- +// +static TBool CreateGestureHelperL( CXnNode& aNode ) + { + if ( AknLayoutUtils::PenEnabled() ) + { + CXnProperty* prop( aNode.GetPropertyL( XnPropertyNames::common::KSwipe ) ); + + if ( prop && prop->StringValue() == XnPropertyNames::KTrue ) + { + return ETrue; + } + } + + return EFalse; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::NewL +// Two-phased constructor. Can leave. +// ----------------------------------------------------------------------------- +// +CXnControlAdapterImpl* CXnControlAdapterImpl::NewL( + CXnNodePluginIf& aNode, + CXnControlAdapter& aAdapter, + CWindowGc& aGc ) + { + CXnControlAdapterImpl* self = new ( ELeave ) CXnControlAdapterImpl( aNode ); + CleanupStack::PushL( self ); + self->ConstructL( aNode, aAdapter, aGc ); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::~CXnControlAdapterImpl +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnControlAdapterImpl::~CXnControlAdapterImpl() + { + delete iBackgroundBitmap; + delete iBackgroundMask; + delete iBorderBitmap; + delete iContentBitmap; + delete iContentMask; + + delete iScaledContentBitmap; + delete iScaledContentMask; + + delete iScaledTransparentColor; + delete iScaledBackgroundSkin; + delete iScaledBackgroundImage; + + iChildren.Reset(); + + if ( iAnimation ) + { + iAnimation->Stop(); + delete iAnimation; + } + + if ( iGestureHelper ) + { + delete iGestureHelper; + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::CXnControlAdapterImpl +// C++ default constructor. Must not leave. +// ----------------------------------------------------------------------------- +// +CXnControlAdapterImpl::CXnControlAdapterImpl( CXnNodePluginIf& aNode ) + : iNode( aNode ) + { + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::SetComponent +// Sets component object to adapter. +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::SetComponent( CXnComponent* aComponent ) + { + iComponent = aComponent; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::Component +// Gets component object from adapter. +// ----------------------------------------------------------------------------- +// +CXnComponent* CXnControlAdapterImpl::Component() + { + return iComponent; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::Component +// Gets component object from adapter. +// ----------------------------------------------------------------------------- +// +CXnComponent* CXnControlAdapterImpl::Component() const + { + return iComponent; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::OfferKeyEventL +// Handles key events. +// ----------------------------------------------------------------------------- +// +TKeyResponse CXnControlAdapterImpl::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + CXnNode* node( &iNode.Node() ); + + // Need to get softkey nodes + CXnUiEngine* engine( node->UiEngine() ); + + CXnNode* menuBar( engine->MenuBarNode() ); + + CXnNode* temp( node ); + + 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 ) + { + pos = &XnPropertyNames::softkey::type::KRight; + } + else if ( aKeyEvent.iScanCode == EStdKeyDevice3 ) + { + pos = &XnPropertyNames::softkey::type::KMiddle; + } + + if ( pos ) + { + node = SoftkeyNodeL( menuBar, *pos ); + } + + break; + } + } + + if ( !node ) + { + return EKeyWasNotConsumed; + } + + if ( aKeyEvent.iScanCode == EStdKeyDevice0 || // RSK + aKeyEvent.iScanCode == EStdKeyDevice1 || // LSK + aKeyEvent.iScanCode == EStdKeyDevice3 ) // MSK + { + if ( aType == EEventKeyDown ) + { + iLongtap = EFalse; + + if ( aKeyEvent.iScanCode == EStdKeyDevice3 || + aKeyEvent.iScanCode == EStdKeyEnter ) + { + if ( node->IsStateSet( XnPropertyNames::style::common::KFocus ) ) + { + // Set "pressed down" + node->SetStateL( + XnPropertyNames::style::common::KPressedDown ); + + node->UiEngine()->RenderUIL(); + } + } + + _LIT8( KDown, "3" ); // EEventKeyDown == 3 + + CXnNode* keydown( BuildTriggerNodeL( *engine, + XnPropertyNames::action::trigger::name::KActivate, + XnPropertyNames::action::trigger::name::keyevent::KEventType, KDown ) ); + CleanupStack::PushL( keydown ); + + node->ReportXuikonEventL( *keydown ); + + CleanupStack::PopAndDestroy( keydown ); + } + else if( aType == EEventKey ) + { + if ( aKeyEvent.iRepeats == 0 ) + { + if ( !HasHoldTrigger( node->DomNode() ) ) + { + // If node doesn't define hold trigger, then report activate + // immediately. Otherwise activate is triggered with keyup event + node->SetStateL( + XnPropertyNames::style::common::KActive ); + } + } + else + { + CXnNode* hold( BuildTriggerNodeL( *engine, + XnPropertyNames::action::trigger::name::KHold ) ); + CleanupStack::PushL( hold ); + + node->ReportXuikonEventL( *hold ); + + CleanupStack::PopAndDestroy( hold ); + + iLongtap = ETrue; + } + } + + else if ( aType == EEventKeyUp ) + { + if ( !iLongtap ) + { + if ( HasHoldTrigger( node->DomNode() ) ) + { + // Hold trigger defined, report activate event here + node->SetStateL( + XnPropertyNames::style::common::KActive ); + } + else + { + _LIT8( KUp, "2" ); // EEventKeyUp == 2 + + CXnNode* keyup( BuildTriggerNodeL( *engine, + XnPropertyNames::action::trigger::name::KActivate, + XnPropertyNames::action::trigger::name::keyevent::KEventType, KUp ) ); + CleanupStack::PushL( keyup ); + + node->ReportXuikonEventL( *keyup ); + + CleanupStack::PopAndDestroy( keyup ); + } + } + + if ( aKeyEvent.iScanCode == EStdKeyDevice3 || + aKeyEvent.iScanCode == EStdKeyEnter ) + { + // Reset "pressed down" + node->UnsetStateL( + XnPropertyNames::style::common::KPressedDown ); + + node->UiEngine()->RenderUIL(); + } + + iLongtap = EFalse; + } + } + else + { + // Other than softkey node + node->OfferKeyEventL( aKeyEvent, aType ); + } + + CXnNode* viewNode( engine->ActiveView() ); + + if ( viewNode && node != viewNode ) + { + viewNode->OfferKeyEventL( aKeyEvent, aType ); + } + + return EKeyWasConsumed; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::HandleLongTapEventL +// Handles the long tap events. +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::HandleLongTapEventL( + const TPoint& /*aPenEventLocation*/, const TPoint& aPenEventScreenLocation ) + { + CXnNode* node( &iNode.Node() ); + + CXnUiEngine* engine( node->UiEngine() ); + + TBool menuBar( node == engine->MenuBarNode() ); + + if ( menuBar ) + { + // Need to update node to match to the real softkey node + node = SoftkeyNode( engine->MenuBarNode(), aPenEventScreenLocation ); + } + + if ( node ) + { + CXnProperty* prop( node->GetPropertyL( + XnPropertyNames::common::KLongTap ) ); + + if ( prop && prop->StringValue() == XnPropertyNames::KTrue ) + { + CXnUiEngine* engine( node->UiEngine() ); + CXnAppUiAdapter& appui( engine->AppUiAdapter() ); + + CancelFocusRefusalL( *engine ); + + appui.HideFocus(); + + CCoeControl& bg( appui.ViewAdapter().BgControl() ); + + // Ignore events + bg.IgnoreEventsUntilNextPointerUp(); + + // Indicate long tap has taken plave + iLongtap = ETrue; + + CXnNode* hold = BuildTriggerNodeL( *engine, + XnPropertyNames::action::trigger::name::KHold ); + + CleanupStack::PushL( hold ); + + node->ReportXuikonEventL( *hold ); + + CleanupStack::PopAndDestroy( hold ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::HandlePointerEventL +// Handle pointer events +// ----------------------------------------------------------------------------- +// +TBool CXnControlAdapterImpl::HandlePointerEventL( + const TPointerEvent& aPointerEvent ) + { + const TPointerEvent& event( aPointerEvent ); + + // Forward event to gesture helper + if( PassEventToGestureHelperL( aPointerEvent ) ) + { + // Swipe took place, consume this event + return ETrue; + } + + CXnNode* node( &iNode.Node() ); + + CXnUiEngine* engine( node->UiEngine() ); + + TBool menuBar( node == engine->MenuBarNode() ); + + if ( menuBar ) + { + // Need to update node to match to the real softkey node + node = SoftkeyNode( engine->MenuBarNode(), event.iParentPosition ); + + if ( !node ) + { + // No softkey node found, consume event + return ETrue; + } + } + + CAknLongTapDetector* detector( iAdapter->LongTapDetector() ); + + if ( detector ) + { + if ( menuBar ) + { + // CXnMenuAdapter owns the longtap detector, but only + // softkey nodes can have longtap functionality, so + // need to check whether this softkey node has a longtap + // property defined + CXnProperty* prop( + node->GetPropertyL( XnPropertyNames::common::KLongTap ) ); + + if ( prop && prop->StringValue() == XnPropertyNames::KTrue ) + { + detector->PointerEventL( event ); + } + } + else + { + detector->PointerEventL( event ); + } + } + + CXnProperty* focusable( + node->GetPropertyL( XnPropertyNames::common::KFocusable ) ); + + if ( !menuBar && ( !focusable || + focusable->StringValue() == XnPropertyNames::KFalse ) ) + { + iLongtap = EFalse; + + return EFalse; + } + + if ( event.iType == TPointerEvent::EButton1Down ) + { + iLongtap = EFalse; + + if ( !menuBar ) + { + CancelFocusRefusalL( *engine ); + } + + if ( !menuBar && !engine->FocusedNode() ) + { + // Require focus to be shown + engine->AppUiAdapter().ShowFocus(); + +#ifdef RD_TACTILE_FEEDBACK + MTouchFeedback* feedback( MTouchFeedback::Instance() ); + + if ( feedback ) + { + feedback->InstantFeedback( ETouchFeedbackBasic ); + } +#endif + 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 ) ) + { + // Remove pressed down + node->UnsetStateL( XnPropertyNames::style::common::KPressedDown ); + node->HideTooltipsL(); + } + } + } + else if ( event.iType == TPointerEvent::EButton1Up ) + { + if ( !iLongtap ) + { + if ( menuBar ) + { + 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->SetStateL( XnPropertyNames::style::common::KActive ); + } + } + + // Remove focus + engine->AppUiAdapter().HideFocus(); + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::DoDrawL +// Leaving draw function. +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::DoDrawL( const TRect& aRect, CWindowGc& aGc ) const + { + CXnNode& node = iComponent->Node()->Node(); + + DrawBordersL( aRect, node, aGc ); + + const_cast< CXnControlAdapterImpl* >( this )->DrawBackgroundDataL( aRect, node, aGc ); + + if ( iAdapter->IsFocused() ) + { + DrawFocusAppearance( node, aGc ); + } + + if ( iAnimation ) + { + TRect rect = iComponent->Node()->Rect(); + iAnimation->Render( aGc, rect ); + } + + if ( iBorderBitmap ) + { + DrawBorderImagesL( + aRect, node, aGc, iBorderBitmap, + iBorderBitmapDividerTop, iBorderBitmapDividerRight, + iBorderBitmapDividerBottom, iBorderBitmapDividerLeft ); + } + + DrawContentImageL( aGc ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::DrawBackgroundDataL +// Draws the background (color and image) +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::DrawBackgroundDataL( + const TRect& aRect, + 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() ) + { + DrawEditModeBgData( aNode, aGc ); + return; + } + + if ( !iBackgroundBitmap && iBackgroundMask ) + // mask, but no bitmap: draw masked color (if available) + { + DrawTransparentColorL( aNode, aGc, iBackgroundMask ); + } + else if ( !iBackgroundBitmap || !iBackgroundMask ) + // no mask or no bitmap: draw color (if available) + { + DrawBackgroundColorL( aRect, aNode, aGc ); + } + + CXnProperty* colorProperty( aNode.BackgroundColorL() ); + DrawBackgroundSkinL( aNode, iBackgroundMask, aGc, colorProperty ); + + if ( !iBackgroundBitmap ) + { + return; + } + + CXnProperty* pathProperty( aNode.BackgroundImageL() ); + + if ( pathProperty && pathProperty->StringValue() != KNullDesC8 ) + { + if ( iBackgroundMask ) + { + // draw transparent background image + DrawBackgroundImageL( aRect, aNode, aGc, iBackgroundBitmap, iBackgroundMask ); + } + else + { + // draw background image without mask + DrawBackgroundImageL( aRect, aNode, aGc, iBackgroundBitmap, NULL ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::DrawEditModeBgDataL +// +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::DrawEditModeBgData( + CXnNode& aNode, + CWindowGc& aGc ) + { + // Draw rastered background for plugins + const TDesC8& widgetType = aNode.DomNode()->Name(); + if( widgetType == XnPropertyNames::KPlugin ) + { + TRect rect = aNode.PaddingRect(); + DrawBackgroundSkin( KAknsIIDQgnHomeEditBgWidget, aGc, rect ); + + CXnPluginData& data( aNode.UiEngine()->ViewManager()->ActiveViewData().Plugin( &aNode ) ); + if( !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. + TInt w = rect.Width(); + TInt h = rect.Height(); + rect.Shrink( ( w - h * 0.5 ) * 0.5, h * 0.25 ); + DrawBackgroundSkin( KAknsIIDQgnHomeAdd, aGc, rect ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::DrawTransparentColorL +// Draws masked background by RGB color. +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::DrawTransparentColorL( + CXnNode& aNode, + CWindowGc& aGc, + CFbsBitmap* aMask ) + { + CXnProperty* colorProperty( aNode.BackgroundColorL() ); + + if ( colorProperty ) + { + // check value type + CXnDomPropertyValue* value = + static_cast< CXnDomPropertyValue* >( + colorProperty->Property()->PropertyValueList().Item( 0 ) ); + + if ( value->PrimitiveValueType() == CXnDomPropertyValue::ERgbColor ) + { + TRect paddingRect = aNode.PaddingRect(); + aMask->SetDisplayMode( EGray256 ); + + aGc.SetBrushColor( NULL ); + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + + if ( !iScaledTransparentColor ) + { + CFbsBitmap* bitmap( NULL ); + CFbsBitmap* mask( NULL ); + + mask = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( mask ); + + mask->Create( paddingRect.Size(), EGray256 ); + + CXnUtils::ScaleBitmapL( + TRect( 0, 0, paddingRect.Width(), paddingRect.Height() ), + mask, aMask ); + + CXnDomPropertyValue* value = + static_cast< CXnDomPropertyValue* >( + colorProperty->Property()->PropertyValueList().Item( 0 ) ); + + TRgb rgb( value->RgbColorValueL() ); + + bitmap = CreateBitmapFromColorL( paddingRect.Size(), rgb ); + CleanupStack::PushL( bitmap ); + + iScaledTransparentColor = CGulIcon::NewL( bitmap, mask ); + + CleanupStack::Pop( 2 ); + } + + aGc.DrawBitmapMasked( paddingRect, + iScaledTransparentColor->Bitmap(), + TRect( TPoint( 0, 0 ), paddingRect.Size() ), + iScaledTransparentColor->Mask(), + EFalse ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::DrawBackgroundSkinL +// Draws a skin item to the given rect +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::DrawBackgroundSkin(const TAknsItemID& aSkinId, + CWindowGc& aGc, TRect aRect) + { + TRect shrunkRect = aRect; + + shrunkRect.Shrink( + KSkinGfxInnerRectShrink, + KSkinGfxInnerRectShrink ); + + AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), aGc, + aRect, shrunkRect, aSkinId, KAknsIIDDefault ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::DrawBackgroundSkinL +// Draws a skin item to the padding rect +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::DrawBackgroundSkinL(CXnNode& aNode, + CFbsBitmap* aMask, CWindowGc& aGc, CXnProperty* aBgColor, + TRect aRect) + { + if( aRect == TRect::EUninitialized ) + { + aRect = aNode.PaddingRect(); + } + + //CXnProperty* colorProperty( aNode.BackgroundColorL() ); + CXnProperty* colorProperty( aBgColor ); + if ( colorProperty ) + { + HBufC* skinID = colorProperty->StringValueL(); + CleanupStack::PushL( skinID ); + + if ( skinID->Length() != 0 ) + { + TAknsItemID itemID; + StripQuotes( skinID ); + + if ( CXnUtils::ResolveSkinItemIDL( *skinID, itemID ) ) + { + if ( aMask ) // If there is a mask, draw masked. + { + TRect paddingRect = aRect; + TRect outerRect = TRect( paddingRect.Size() ); + TRect innerRect = outerRect; + innerRect.Shrink( + KSkinGfxInnerRectShrink, + KSkinGfxInnerRectShrink ); + + if ( !iScaledBackgroundSkin ) + { + CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( bitmap ); + + CFbsBitmap* mask = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( mask ); + + bitmap->Create( outerRect.Size(), aGc.Device()->DisplayMode() ); + + CFbsBitmapDevice* device = CFbsBitmapDevice::NewL( bitmap ); + CleanupStack::PushL( device ); + + CBitmapContext* bc( NULL ); + + User::LeaveIfError( device->CreateBitmapContext( bc ) ); + CleanupStack::PushL( bc ); + + CAknsFrameBackgroundControlContext* frameContext = + CAknsFrameBackgroundControlContext::NewL( + itemID, outerRect, innerRect, EFalse ); + CleanupStack::PushL( frameContext ); + + AknsDrawUtils::Background( AknsUtils::SkinInstance(), + frameContext, NULL, + static_cast< CWindowGc& >( *bc ), + outerRect, KAknsDrawParamNoClearUnderImage ); + + aMask->SetDisplayMode( EGray256 ); + + aGc.SetBrushColor( NULL ); + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + + mask->Create( paddingRect.Size(), EGray256 ); + + CXnUtils::ScaleBitmapL( outerRect, mask, aMask ); + + CleanupStack::PopAndDestroy( 3 ); + + iScaledBackgroundSkin = CGulIcon::NewL( bitmap, mask ); + + CleanupStack::Pop( 2 ); + } + + CFbsBitmap* bitmap( iScaledBackgroundSkin->Bitmap() ); + CFbsBitmap* mask( iScaledBackgroundSkin->Mask() ); + + aGc.BitBltMasked( paddingRect.iTl, bitmap, outerRect, mask, ETrue ); + } + else // draw background skin graphics without mask + { + TRect paddingRect = aRect; + TRect shrunkRect = paddingRect; + + shrunkRect.Shrink( + KSkinGfxInnerRectShrink, + KSkinGfxInnerRectShrink ); + + CAknsFrameBackgroundControlContext* frameContext = + CAknsFrameBackgroundControlContext::NewL( + itemID, paddingRect, shrunkRect, EFalse ); + + CleanupStack::PushL( frameContext ); + + AknsDrawUtils::Background( AknsUtils::SkinInstance(), + frameContext, + NULL, + aGc, + paddingRect, + KAknsDrawParamNoClearUnderImage ); + + CleanupStack::PopAndDestroy( frameContext ); + } + } + } + + CleanupStack::PopAndDestroy( skinID ); + } + } + +// ----------------------------------------------------------------------------- +// DrawBackgroundImageL +// Draws the background image +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::DrawBackgroundImageL( + const TRect& aRect, + CXnNode& aNode, + CWindowGc& aGc, + CFbsBitmap* aBitmap, + CFbsBitmap* aMask ) + { + if ( !aBitmap ) + { + return; + } + + TRect rect = aNode.PaddingRect(); + TBool scaleImage = EFalse; + + if (!GetBackgroundSizeFromPropertyL( rect, aNode, aBitmap, scaleImage ) ) + { + return; + } + if ( AknIconUtils::IsMifIcon( aBitmap ) ) + { + if ( scaleImage ) + { + AknIconUtils::SetSize( aBitmap, rect.Size(), EAspectRatioNotPreserved ); + } + else + { + AknIconUtils::SetSize( aBitmap, rect.Size(), EAspectRatioPreserved ); + } + } + TRect imageRect = rect; + rect = aNode.PaddingRect(); + TBool heightSet = EFalse; + TBool backgroundPosFound = EFalse; + TRAP_IGNORE( backgroundPosFound = GetBackgroundPositionFromPropertyL( + aNode, scaleImage, rect, imageRect, aBitmap, heightSet ); ); + if ( !backgroundPosFound ) + { + return; + } + if ( !heightSet ) + { + rect.Move( 0, rect.Height() / 2 ); + if ( scaleImage ) + { + rect.Move( 0, -imageRect.Height() / 2 ); + } + else + { + rect.Move( 0, -aBitmap->SizeInPixels().iHeight / 2 ); + } + } + TRect tmpRect = aNode.PaddingRect(); + LimitRectToPaddingRect( aNode, rect ); + TBool repeatX = EFalse; + TBool repeatY = EFalse; + TBool spaceX = EFalse; + TBool spaceY = EFalse; + TRAP_IGNORE( GetBackroundRepeatValuesL( aNode, repeatX, repeatY, spaceX, spaceY ) ); + TRect bitmapRect = TRect( + TPoint( 0, 0 ), + TPoint( aBitmap->SizeInPixels().iWidth, aBitmap->SizeInPixels().iHeight ) ); + TInt xRepeatCount = 0; + TInt yRepeatCount = 0; + TRect paddingRect = aNode.PaddingRect(); + if ( scaleImage ) + { + if ( imageRect.Width() && imageRect.Height() ) + { + xRepeatCount = paddingRect.Width() / imageRect.Width(); + yRepeatCount = paddingRect.Height() / imageRect.Height(); + } + } + else + { + TSize size = aBitmap->SizeInPixels(); + if ( size.iWidth == 0 || size.iHeight == 0 ) + { + return; + } + xRepeatCount = paddingRect.Width() / size.iWidth; + yRepeatCount = paddingRect.Height() / size.iHeight; + } + + if ( xRepeatCount == 0 && yRepeatCount == 0 || + !repeatX && !repeatY && !spaceX && !spaceY ) + { + TRect newRect = TRect( + rect.iTl, + TPoint( + rect.iTl.iX + imageRect.Width(), + rect.iTl.iY + imageRect.Height() ) ); + aGc.SetClippingRect( aRect ); + + if ( aMask ) + { + aMask->SetDisplayMode( EGray256 ); + + aGc.SetBrushColor( NULL ); + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + + if ( !iScaledBackgroundImage ) + { + CFbsBitmap* mask( NULL ); + + mask = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( mask ); + + mask->Create( bitmapRect.Size(), EGray256 ); + + CXnUtils::ScaleBitmapL( + TRect( + 0, + 0, + bitmapRect.Width(), + bitmapRect.Height() ), + mask, + aMask ); + + iScaledBackgroundImage = mask; + + CleanupStack::Pop( mask ); + } + + aGc.DrawBitmapMasked( newRect, aBitmap, bitmapRect, + iScaledBackgroundImage, EFalse ); + } + else + { + TRect newRect = TRect( + rect.iTl, + TPoint( + rect.iTl.iX + imageRect.Width(), + rect.iTl.iY + imageRect.Height() ) ); + aGc.SetClippingRect( aRect ); + + aGc.DrawBitmap( newRect, aBitmap, bitmapRect ); + } + + aGc.CancelClippingRect(); + + return; + } + + DrawRepeatedBackgroundImage( + aGc, + aNode, + rect, + imageRect, + bitmapRect, + aBitmap, + repeatX, + repeatY, + spaceX, + spaceY, + xRepeatCount, + yRepeatCount ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::Draw +// Draws the control +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::Draw( const TRect& aRect ) const + { + if ( iBlank ) + { + return; + } + + CWindowGc& gc = iAdapter->SystemGc(); + //gc.SetClippingRect(aRect); +#ifdef _XN_DEBUG_ + CXnComponent* comp = Component(); + CXnNode& node = comp->Node()->Node(); + TRect contentRect = node.Rect(); + TRect marginRect = node.MarginRect(); + TRect paddingRect = node.PaddingRect(); + + gc.SetBrushStyle( CGraphicsContext::ENullBrush ); + gc.SetPenColor( KRgbBlue ); + gc.DrawRect( marginRect ); + gc.SetPenColor( KRgbGray ); + gc.DrawRect( paddingRect ); + gc.SetPenColor( KRgbRed ); + gc.DrawRect( contentRect ); +#endif + TRAP_IGNORE( DoDrawL( aRect, gc )); + //gc.CancelClippingRect(); + RPointerArray< CXnControlAdapter > sortedArray; + TBool needsSorting = EFalse; + for ( TInt count = iChildren.Count() - 1; count >= 0; --count ) + { + needsSorting = ETrue; + CXnControlAdapter* child = iChildren[count]; + TRAP_IGNORE( InsertChildToSortedArrayL( sortedArray, child ) ); + } + if ( !needsSorting ) + { + return; + } + SwapChildArrays( iChildren, sortedArray ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::Draw +// Draws the control +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::Draw( const TRect& aRect, CWindowGc& aGc ) const + { + if ( iBlank ) + { + return; + } + + aGc.SetClippingRect( aRect ); +#ifdef _XN_DEBUG_ + CXnComponent* comp = Component(); + CXnNode& node = comp->Node()->Node(); + TRect contentRect = node.Rect(); + TRect marginRect = node.MarginRect(); + TRect paddingRect = node.PaddingRect(); + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + aGc.SetPenColor( KRgbBlue ); + aGc.DrawRect( marginRect ); + aGc.SetPenColor( KRgbGray ); + aGc.DrawRect( paddingRect ); + aGc.SetPenColor( KRgbRed ); + aGc.DrawRect( contentRect ); +#endif + TRAP_IGNORE( DoDrawL( aRect, aGc ) ); + aGc.CancelClippingRect(); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::ComponentControl +// Return a child control by index +// ----------------------------------------------------------------------------- +// +CCoeControl* CXnControlAdapterImpl::ComponentControl( TInt aIndex ) const + { + return iChildren[aIndex]; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::CountComponentControls +// Return count of children +// ----------------------------------------------------------------------------- +// +TInt CXnControlAdapterImpl::CountComponentControls() const + { + return iChildren.Count(); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::AppendChildL +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::AppendChildL(CXnControlAdapter& aChild, CXnNode& aNode) + { + if( !aChild.OwnsWindow() ) + { + SetControlContext( aChild, aNode ); + if( iChildren.Append( &aChild ) != KErrNone ) + { + User::Leave( KXnErrAppendingChildToControlAdapterFailed ); + } + aChild.SetContainerWindowL( *iAdapter ); + } + } + + +// ----------------------------------------------------------------------------- +// ConvertHslToRgb +// Converts a HSL color to RGB color +// ----------------------------------------------------------------------------- +// +static TRgb ConvertHslToRgb( + TInt aHue, TInt aSaturation, TInt aLightness ) + { + TRgb rgb( 0, 0, 0 ); + TReal h( aHue ); + h /= 360; + TReal s( aSaturation ); + s /= 100; + TReal l( aLightness ); + l /= 100; + + if ( 0 == aSaturation ) + { + rgb.SetRed( TInt( l * 255 ) ); + rgb.SetGreen( TInt( l * 255 ) ); + rgb.SetBlue( TInt( l * 255 ) ); + } + else + { + TReal m1( 0 ); + TReal m2( 0 ); + + // l<=0.5: PUT l*(s+1) IN m2 + if ( aLightness < 0.5 ) + { + m2 = l * ( s + 1.0 ); + } + // PUT l+s-l*s IN m2 + else + { + m2 = l + s - ( l * s ); + } + + // PUT l*2-m2 IN m1 + m1 = l * 2.0 - m2; + + TReal helperH( h ); + TReal helperM1( m1 ); + TReal helperM2( m2 ); + + // calculate Red + helperH = h + ( 1.0 / 3.0 ); + + // IF h<0: PUT h+1 IN h + if ( helperH < 0 ) + { + helperH += 1.0; + } + + // IF h>1: PUT h-1 IN h + else if ( helperH > 1 ) + { + helperH -= 1.0; + } + else + { + } + + TReal val( 0 ); + + // IF h*6<1: RETURN m1+(m2-m1)*h*6 + if ( ( helperH * 6 ) < 1 ) + { + val = ( 255 * ( helperM1 + ( helperM2 - helperM1 ) * helperH * 6.0 ) ); + } + + // IF h*2<1: RETURN m2 ) + else if ( ( helperH * 2.0 ) < 1.0 ) + { + val = ( 255.0 * helperM2 ); + } + + // IF h*3<2: RETURN m1+(m2-m1)*(2/3-h)*6 + else if ( ( helperH * 3.0 ) < 2.0 ) + { + val = ( 255.0 * ( helperM1 + ( helperM2 - helperM1 ) * + ( 2.0 / 3.0 - helperH ) * 6.0 ) ); + } + else + { + val = 255.0 * helperM1; + } + TInt tmpVal = TInt( val + 0.5 ); + rgb.SetRed( ( tmpVal >= 0) ? tmpVal : -tmpVal ); + + // calculate Green + // PUT hue.to.rgb(m1, m2, h ) IN g + helperH = h; + helperM1 = m1; + helperM2 = m2; + + // IF h<0: PUT h+1 IN h + if ( helperH < 0 ) + { + helperH += 1.0; + } + // IF h>1: PUT h-1 IN h + else if ( helperH > 1 ) + { + helperH -= 1.0; + } + else + { + } + + // IF h*6<1: RETURN m1+(m2-m1)*h*6 + if ( ( helperH * 6 ) < 1 ) + { + val = ( 255.0 * ( helperM1 + ( helperM2 - helperM1 ) * helperH * 6.0 ) ); + } + // IF h*2<1: RETURN m2 + else if ( ( helperH * 2 ) < 1 ) + { + val = ( 255.0 * helperM2 ); + } + // IF h*3<2: RETURN m1+(m2-m1)*(2/3-h)*6 + else if ( ( helperH * 3 ) < 2 ) + { + val = ( 255.0 * ( helperM1 + ( helperM2 - helperM1 ) * + ( 2.0 / 3.0 - helperH ) * 6.0 ) ); + } + else + { + val = 255.0 * helperM1; + } + + tmpVal = TInt( val + 0.5 ); + rgb.SetGreen( ( tmpVal >= 0) ? tmpVal : tmpVal ); + + // calculate Blue + // PUT hue.to.rgb(m1, m2, h-1/3) IN b + helperH = h - ( 1.0 / 3.0 ); + helperM1 = m1; + helperM2 = m2; + + // IF h<0: PUT h+1 IN h + if ( helperH < 0 ) + { + helperH += 1.0; + } + // IF h>1: PUT h-1 IN h + else if ( helperH > 1 ) + { + helperH -= 1.0; + } + else + { + } + + // IF h*6<1: RETURN m1+(m2-m1)*h*6 + if ( ( helperH * 6 ) < 1 ) + { + val = ( 255.0 * ( helperM1 + ( helperM2 - helperM1 ) * helperH * 6.0 ) ); + } + // IF h*2<1: RETURN m2 + else if ( ( helperH * 2 ) < 1 ) + { + val = ( 255.0 * helperM2 ); + } + // IF h*3<2: RETURN m1+(m2-m1)*(2/3-h)*6 + else if ( ( helperH * 3 ) < 2 ) + { + val = ( 255.0 * ( helperM1 + ( helperM2 - helperM1 ) * + ( 2.0 / 3.0 - helperH ) * 6.0 ) ); + } + else + { + val = 255.0 * helperM1; + } + + tmpVal = TInt( val + 0.5 ); + rgb.SetBlue( ( tmpVal >= 0) ? tmpVal : -tmpVal ); + + } + return rgb; + } + +// ----------------------------------------------------------------------------- +// ConvertRgbToHsl +// Converts a RGB color to HSL color +// ----------------------------------------------------------------------------- +// +static void ConvertRgbToHsl( + TRgb aRGB, + TUint& aHue, + TUint& aSaturation, + TUint& aLightness ) + { + TReal red = static_cast< TReal >( aRGB.Red() ) / 255.0; + TReal green = static_cast< TReal >( aRGB.Green() ) / 255.0; + TReal blue = static_cast< TReal >( aRGB.Blue() ) / 255.0; + TReal maxColor = ( red > green && red > blue ) ? + red : ( green > red && green > blue ) ? green : blue; + TReal minColor = ( red <= green && red <= blue ) ? + red : ( green <= red && green <= blue ) ? green : blue; + TReal lightness = ( maxColor + minColor ) / 2.0; + if ( maxColor == minColor ) + { + aSaturation = 0; + aHue = 0; + aLightness = static_cast< TInt >( 100.0 * lightness + 0.5 ); + return; + } + + if ( lightness < 0.5 ) + { + TReal saturation = ( maxColor - minColor ) / ( maxColor + minColor ); + aSaturation = static_cast< TInt >( 100.0 * saturation + 0.5 ); + } + else + { + TReal saturation = ( maxColor - minColor ) / ( 2.0 - maxColor - minColor ); + aSaturation = static_cast< TInt >( 100.0 * saturation + 0.5 ); + } + + if ( red == maxColor ) + { + TReal hue = ( green - blue ) / ( maxColor - minColor ); + TInt tmp = static_cast< TInt >( 60.0 * hue + 0.5 ); + aHue = ( tmp >= 0 ) ? tmp : tmp + 360; + } + else if ( green == maxColor ) + { + TReal hue = 2.0 + ( ( blue - red ) / ( maxColor - minColor ) ); + TInt tmp = static_cast< TInt >( 60.0 * hue + 0.5 ); + aHue = ( tmp >= 0 ) ? tmp : tmp + 360; + } + else + { + TReal hue = 4.0 + ( ( red - green ) / ( maxColor - minColor ) ); + TInt tmp = static_cast< TInt >( 60.0 * hue + 0.5 ); + aHue = ( tmp >= 0 ) ? tmp : tmp + 360; + } + + aLightness = static_cast< TInt >( 100.0 * lightness + 0.5 ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::IsDrawingAllowed +// Checks whether drawing is allowed +// ----------------------------------------------------------------------------- +// +TBool CXnControlAdapterImpl::IsDrawingAllowed() const + { + TBool retVal = EFalse; + CXnNode& node = Component()->Node()->Node(); + CXnProperty* propVisibility = NULL; + TRAP_IGNORE( propVisibility = node.VisibilityL() ); + if ( propVisibility ) + { + const TDesC8& visibility = propVisibility->StringValue(); + if ( visibility != KNullDesC8 ) + { + if ( visibility == XnPropertyNames::style::common::visibility::KHidden ) + { + return EFalse; + } + else + { + retVal = ETrue; + } + } + } + else + { + // default value for visibility + retVal = ETrue; + } + CXnProperty* propDisplay = NULL; + TRAP_IGNORE( propDisplay = node.DisplayL() ); + if ( propDisplay ) + { + const TDesC8& display = propDisplay->StringValue(); + if ( display != KNullDesC8 ) + { + if ( display == XnPropertyNames::style::common::display::KNone ) + { + return EFalse; + } + else + { + retVal = ETrue; + } + } + } + if ( node.IsDropped() ) + { + return EFalse; + } + else + { + retVal = ETrue; + } + return retVal; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::ContentBitmaps +// Gets content bitmaps +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::ContentBitmaps( + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask ) + { + aBitmap = iContentBitmap; + aMask = iContentMask; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::SetContentBitmaps +// Sets content bitmaps +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::SetContentBitmaps( + CFbsBitmap* aBitmap, + CFbsBitmap* aMask ) + { + delete iContentBitmap; + iContentBitmap = NULL; + + delete iContentMask; + iContentMask = NULL; + + delete iScaledContentBitmap; + iScaledContentBitmap = NULL; + + delete iScaledContentMask; + iScaledContentMask = NULL; + + iContentBitmap = aBitmap; + iContentMask = aMask; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::SetContentBitmapsL +// Sets content bitmaps +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::SetContentBitmapsL( const TDesC& aBitmapUrl, + const TDesC& aMaskUrl ) + { + delete iContentBitmap; + iContentBitmap = NULL; + + delete iContentMask; + iContentMask = NULL; + + delete iScaledContentBitmap; + iScaledContentBitmap = NULL; + + delete iScaledContentMask; + iScaledContentMask = NULL; + + CXnNode& node( iNode.Node() ); + CXnUiEngine* engine( node.UiEngine() ); + + TRect rect( node.Rect() ); + + GetBitmapL( *engine, node, aBitmapUrl, iContentBitmapIndex, + iContentBitmap, iContentMask, iIconProvider, rect, FsSession() ); + if ( !iContentBitmap ) + { + CXnProperty* prop( node.GetPropertyL( + XnPropertyNames::appearance::common::KFallBackImage ) ); + + if ( prop ) + { + HBufC* fallBackImage( prop->StringValueL( ) ); + + CleanupStack::PushL( fallBackImage ); + + if ( *fallBackImage != KNullDesC ) + { + StripQuotes( fallBackImage ); + + GetBitmapL( *engine, node, *fallBackImage, iContentBitmapIndex, + iContentBitmap, iContentMask, iIconProvider, rect, FsSession() ); + } + + CleanupStack::PopAndDestroy( fallBackImage ); + } + } + + if ( !iContentMask ) + { + if ( aMaskUrl != KNullDesC ) + { + CFbsBitmap* bitmapMask( NULL ); + + GetBitmapL( *engine, node, aMaskUrl, iContentMaskIndex, + iContentMask, bitmapMask, iIconProvider, rect, FsSession() ); + + delete bitmapMask; + } + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::DrawContentImage +// Draws content image +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::DrawContentImage() const + { + TRAP_IGNORE( DrawContentImageL( *iGc ) ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::DrawContentImage +// Draws content image +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::DrawContentImageL( CWindowGc& aGc ) const + { + if ( !iContentBitmap ) + { + return; + } + + TRect rect = iComponent->Node()->Node().Rect(); + + // Check if the node has a property "preserve image aspect ratio". + TBool preserveAspectRatio = EFalse; + CXnNode& currentNode = iComponent->Node()->Node(); + + CXnProperty* aspectProperty = currentNode.GetPropertyL( + XnPropertyNames::image::KS60AspectRatio ); + if ( aspectProperty ) + { + const TDesC8& value = aspectProperty->StringValue(); + + if ( value.CompareF( XnPropertyNames::image::KPreserve ) == 0 ) + { + preserveAspectRatio = ETrue; + } + } + + TRect bitmapRect = rect; + bitmapRect.Move( -rect.iTl.iX, -rect.iTl.iY ); + + if ( AknIconUtils::IsMifIcon( iContentBitmap ) ) + { + if ( preserveAspectRatio ) + { + AknIconUtils::SetSize( + iContentBitmap, bitmapRect.Size(), EAspectRatioPreserved ); + } + else + { + AknIconUtils::SetSize( + iContentBitmap, bitmapRect.Size(), EAspectRatioNotPreserved ); + } + //Calculate new point to start draw in order to center bitmap to drawing area + rect.iTl.iY += + ( rect.Height() - iContentBitmap->SizeInPixels().iHeight ) / 2; + rect.iTl.iX += + ( rect.Width() - iContentBitmap->SizeInPixels().iWidth ) / 2; + + if ( iContentMask ) + { + // Based on the avkon's assumtion that mask is always inverted, the + // value of aInvertMask parameter is set to 'ETrue' + aGc.BitBltMasked( rect.iTl, iContentBitmap, bitmapRect, iContentMask, + ETrue ); + } + else + { + aGc.BitBlt( rect.iTl, iContentBitmap, bitmapRect ); + } + } + else + { + if ( !iScaledContentBitmap ) + { + TBool forceFallBack = CXnUtils::DoesScaleBitmapUseFallBack( + iContentBitmap ); + + TRAPD( err, CreateScaledBitmapL( bitmapRect, + iScaledContentBitmap, + iContentBitmap, + preserveAspectRatio, + forceFallBack ) ); + if ( err ) + { + // return if CreateScaledBitmapL() leaves. This prevents the + // drawing of the original content bitmap which is wrong size. + return; + } + } + if ( iContentMask && !iScaledContentMask ) + { + TBool forceFallBack = CXnUtils::DoesScaleBitmapUseFallBack( + iContentMask ); + + TRAPD( err, CreateScaledBitmapL( bitmapRect, + iScaledContentMask, + iContentMask, + preserveAspectRatio, + forceFallBack ) ); + if ( err ) + { + // return if CreateScaledBitmapL() leaves. This prevents the + // drawing of the original content mask which is wrong size + // (and may distort the image). + return; + } + } + + CFbsBitmap* bitmap( 0 ); + CFbsBitmap* mask( 0 ); + + if ( iScaledContentBitmap ) + { + bitmap = iScaledContentBitmap; + } + else + { + bitmap = iContentBitmap; + } + + if ( iScaledContentMask ) + { + mask = iScaledContentMask; + } + else + { + mask = iContentMask; + } + + if ( bitmap && mask ) + { + //Calculate new point to start draw in order to center bitmap to + // drawing area + rect.iTl.iY += + ( rect.Height() - bitmap->SizeInPixels().iHeight ) / 2; + rect.iTl.iX += + ( rect.Width() - bitmap->SizeInPixels().iWidth ) / 2; + + // Based on the avkon's assumtion that mask is always inverted, the + // value of aInvertMask parameter is set to 'ETrue' + aGc.BitBltMasked( rect.iTl, bitmap, bitmapRect, mask, ETrue ); + } + else if ( bitmap ) + { + //Calculate new point to start draw in order to center bitmap to + // drawing area + rect.iTl.iY += + ( rect.Height() - bitmap->SizeInPixels().iHeight ) / 2; + rect.iTl.iX += + ( rect.Width() - bitmap->SizeInPixels().iWidth ) / 2; + + aGc.BitBlt( rect.iTl, bitmap ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::SizeChanged +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::SizeChanged() + { + delete iScaledContentBitmap; + iScaledContentBitmap = NULL; + + delete iScaledContentMask; + iScaledContentMask = NULL; + + delete iScaledTransparentColor; + iScaledTransparentColor = NULL; + + delete iScaledBackgroundSkin; + iScaledBackgroundSkin = NULL; + + delete iScaledBackgroundImage; + iScaledBackgroundImage = NULL; + + TRAP_IGNORE( InitializeBackgroundAndBorderBitmapsL() ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::SkinChanged +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::SkinChanged() + { + delete iScaledContentBitmap; + iScaledContentBitmap = NULL; + + delete iScaledContentMask; + iScaledContentMask = NULL; + + delete iScaledTransparentColor; + iScaledTransparentColor = NULL; + + delete iScaledBackgroundSkin; + iScaledBackgroundSkin = NULL; + + delete iScaledBackgroundImage; + iScaledBackgroundImage = NULL; + + TRAP_IGNORE( InitializeBackgroundAndBorderBitmapsL() ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::FocusChangedL +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::FocusChangedL( TBool aFocused ) + { + CXnNode& node( iNode.Node() ); + + CXnUiEngine* engine( node.UiEngine() ); + + CXnNode* menubar( engine->MenuBarNode() ); + + if ( engine->IsEditMode() || !node.IsLayoutCapable() || !menubar ) + { + return; + } + + XnMenuInterface::MXnMenuInterface* menuIf( NULL ); + + XnComponentInterface::MakeInterfaceL( menuIf, menubar->AppIfL() ); + + if ( !menuIf ) + { + return; + } + + CXnViewManager* manager( engine->ViewManager() ); + + const TDesC8& ns( node.Namespace() ); + + CXnPluginData* data( manager->ActiveViewData().Plugin( ns ) ); + + if ( !data ) + { + return; + } + + CXnNode* plugin( data->Node()->LayoutNode() ); + + CXnNode* extension( NULL ); + + if ( plugin == engine->ActiveView() ) + { + // Pretend that this node is extension + extension = &node; + } + else + { + RPointerArray< CXnNode >& children( plugin->Children() ); + + for ( TInt i = 0; i < children.Count(); i++ ) + { + CXnNode* child( children[i] ); + + const TDesC8& type( child->Type()->Type() ); + + if ( type == XnPropertyNames::menu::KMenuExtension ) + { + extension = child; + break; + } + } + } + + if ( !extension ) + { + // No extension available + return; + } + + // Find proper softkey from extension + RPointerArray< CXnNode >& children( extension->Children() ); + + for ( TInt i = 0; i < children.Count(); i++ ) + { + CXnNode* child( children[i] ); + + const TDesC8& type( child->Type()->Type() ); + + if ( type == XnPropertyNames::softkey::KNodeName ) + { + + CXnProperty* prop( child->GetPropertyL( + XnPropertyNames::softkey::KTypeAttribute ) ); + + if ( prop ) + { + const TDesC8& type( prop->StringValue() ); + + XnMenuInterface::MXnMenuInterface::TSoftKeyPosition pos; + + if ( type == XnPropertyNames::softkey::type::KLeft ) + { + pos = XnMenuInterface::MXnMenuInterface::ELeft; + } + else if ( type == XnPropertyNames::softkey::type::KMiddle ) + { + pos = XnMenuInterface::MXnMenuInterface::ECenter; + } + else if ( type == XnPropertyNames::softkey::type::KRight ) + { + pos = XnMenuInterface::MXnMenuInterface::ERight; + } + else + { + // Declaration error + __ASSERT_DEBUG( EFalse, Panic( EXnInvalidState ) ); + break; + } + + if ( aFocused ) + { + // Set softkey + menuIf->SetSoftKeyL( &child->PluginIfL(), pos ); + } + else + { + // Remove softkey + menuIf->SetSoftKeyL( NULL, pos ); + } + + // This is not a correct way to do dirty setting, + // but here in case of menubar it is acceptable + engine->AddDirtyNodeL( menubar, XnDirtyLevel::ERender ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::InitializeBackgroundandBorderBitmapsL +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::InitializeBackgroundAndBorderBitmapsL() + { + CXnNode& node( iNode.Node() ); + CXnUiEngine* engine( node.UiEngine() ); + + CXnProperty* backgroundImageProperty( node.BackgroundImageL() ); + + if ( backgroundImageProperty ) + { + delete iBackgroundBitmap; + iBackgroundBitmap = NULL; + + delete iBackgroundMask; + iBackgroundMask = NULL; + + delete iScaledTransparentColor; + iScaledTransparentColor = NULL; + + delete iScaledBackgroundSkin; + iScaledBackgroundSkin = NULL; + + delete iScaledBackgroundImage; + iScaledBackgroundImage = NULL; + + InitializeBackgroundBitmapL( *engine, node, iBackgroundBitmapIndex, + iBackgroundBitmap, iBackgroundMask, iIconProvider, FsSession() ); + + HBufC* bgPath( GetBackgroundImagePathLC( node ) ); + + if ( *bgPath != KNullDesC ) + { + iAnimIDResolved = CXnUtils::ResolveSkinItemIDL( *bgPath, iAnimIID ); + } + + CleanupStack::PopAndDestroy( bgPath ); + } + + CXnProperty* borderImageProperty( node.BorderImageL() ); + + if ( borderImageProperty ) + { + delete iBorderBitmap; + iBorderBitmap = NULL; + + iBorderBitmap = InitializeBorderBitmapL( + *engine, node, + iBorderBitmapIndex, iBorderBitmapDividerTop, + iBorderBitmapDividerRight, + iBorderBitmapDividerBottom, iBorderBitmapDividerLeft, + iIconProvider, FsSession() ); + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::ConstructL +// 2nd phase constructor. Can leave. +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::ConstructL( + CXnNodePluginIf& aNode, + CXnControlAdapter& aAdapter, + CWindowGc& aGc ) + { + iGc = &aGc; + + iAdapter = &aAdapter; + + if ( CreateGestureHelperL( aNode.Node() ) ) + { + iGestureHelper = CXnGestureHelper::NewL( aNode.Node() ); + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::LoadBitmap +// Load a bitmap from the server. Ownership is transferred. +// ----------------------------------------------------------------------------- +// +CFbsBitmap* CXnControlAdapterImpl::LoadBitmap( const TDesC& aBitmapUrl ) + { + CXnNode& node( iNode.Node() ); + CXnUiEngine* engine( node.UiEngine() ); + + CFbsBitmap* bitmap( NULL ); + CFbsBitmap* mask( NULL ); + + TRect rect( node.Rect() ); + + TInt index( 0 ); + + TRAP_IGNORE( GetBitmapL( + *engine, node, + aBitmapUrl, index, + bitmap, mask, + iIconProvider, rect, FsSession() ) ); + + delete mask; + + return bitmap; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::GetBitmapAndMask +// Load a bitmap and mask from the server. Ownership is transferred. +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::GetBitmapAndMask( + const TDesC& aBitmapUrl, + const TDesC& aMaskUrl, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask ) + { + CXnNode& node( iNode.Node() ); + CXnUiEngine* engine( node.UiEngine() ); + + TRect rect( node.Rect() ); + + TInt index( 0 ); + + TRAP_IGNORE( GetBitmapL( + *engine, node, + aBitmapUrl, index, + aBitmap, aMask, + iIconProvider, rect, FsSession() ) ); + + if ( !aMask ) + { + if ( aMaskUrl != KNullDesC ) + { + CFbsBitmap* bitmapMask( NULL ); + + TRAP_IGNORE( GetBitmapL( + *engine, node, + aMaskUrl, index, + aMask, bitmapMask, + iIconProvider, rect, FsSession() ) ); + + delete bitmapMask; + } + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::AnimFrameReady +// Callback of the animated skin background. +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::AnimFrameReady( TInt aError, TInt /* aAnimId */ ) + { + if ( !aError ) + { + iAdapter->DrawNow(); + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::CreateAnimationL +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::CreateAnimationL( /* TDesC& aPath */ ) + { + if ( iAnimation ) + { + delete iAnimation; + iAnimation = NULL; + } + + iAnimation = CAknsEffectAnim::NewL( this ); + TBool ok = iAnimation->ConstructFromSkinL( iAnimIID ); + if ( !ok ) + { + delete iAnimation; + iAnimation = NULL; + User::Leave( KErrNotSupported ); + } + + CXnNode& node = iComponent->Node()->Node(); + if ( !node.IsLaidOut() ) + { + // Animation is created before layout of nodes has been calculated + node.UiEngine()->LayoutUIL( &node ); + } + TRect rect( node.Rect() ); + + iAnimation->BeginConfigInputLayersL( rect.Size(), ETrue ); + + if ( iAnimation->InputRgbGc() ) + { + TRect mainPane; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane ); + TRect mainPaneRect( mainPane.Size() ); + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = NULL; + const TAknsItemID* id = &KAknsIIDNone; + if ( AknsUtils::AvkonSkinEnabled() ) + { + cc = CAknsListBoxBackgroundControlContext::NewL( + KAknsIIDQsnBgAreaMainListGene, + mainPaneRect, + EFalse, + *id, + mainPaneRect ); + + AknsDrawUtils::DrawBackground( AknsUtils::SkinInstance(), + cc, + NULL, + *iAnimation->InputRgbGc(), + TPoint(), + rect, + KAknsDrawParamBottomLevelRGBOnly ); + } + } + + iAnimation->EndConfigInputLayersL(); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::StartHighlightAnimation() +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::StartHighlightAnimation( TBool aAnimRestart ) + { + TBool focused = EFalse; + + // No need to start animation again if already running + if ( iAnimation ) + { + if ( iAnimation->State() == EAknsAnimStateRunning && !aAnimRestart ) + { + return; + } + } + // Check control's focus + if ( iComponent ) + { + CXnNodePluginIf* pluginIf = iComponent->Node(); + if ( pluginIf ) + { + focused = pluginIf->IsFocusedState(); + } + else + { + return; + } + } + + // If the node is not focused or no Anim ID, return. + if ( !focused || !iAnimIDResolved ) + { + return; + } + + // Restart animation + if ( aAnimRestart ) + { + if ( iAnimation ) + { + iAnimation->Stop(); + delete iAnimation; + iAnimation = NULL; + + TRAPD( error, CreateAnimationL() ); + + if ( !error ) + { + iAnimation->Start(); + return; + } + } + } + + // Node is focused. Try to start animation. + if ( iAnimation ) + { + iAnimation->Start(); + } + else + { + TRAPD( error, CreateAnimationL() ); + + if ( !error ) + { + iAnimation->Start(); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::StopHighlightAnimation() +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::StopHighlightAnimation() + { + if ( iAnimation ) + { + // Stop animation and delete. + iAnimation->Stop(); + delete iAnimation; + iAnimation = NULL; + + iAdapter->DrawNow(); + } + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::MeasureAdaptiveContentL +// ----------------------------------------------------------------------------- +// +TSize CXnControlAdapterImpl::MeasureAdaptiveContentL( + const TSize& /* aAvailableSize */ ) + { + // By default the size is 0 + return TSize( 0, 0 ); + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::SetBlank +// +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::SetBlank( TBool aBlank ) + { + iBlank = aBlank; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::DoHandlePropertyChangeL +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::DoHandlePropertyChangeL( CXnProperty* /*aProperty*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::UpdateBackgroundImageL +// ----------------------------------------------------------------------------- +// +CXnControlAdapterImpl::TPropertyChangeResponse CXnControlAdapterImpl::UpdateBackgroundImageL( + CXnProperty* aProperty ) + { + if ( aProperty ) + { + const TDesC8& name( aProperty->Property()->Name() ); + + if ( name == XnPropertyNames::appearance::common::KBackGroundImage ) + { + delete iBackgroundBitmap; + iBackgroundBitmap = NULL; + + delete iBackgroundMask; + iBackgroundMask = NULL; + + delete iScaledTransparentColor; + iScaledTransparentColor = NULL; + + delete iScaledBackgroundSkin; + iScaledBackgroundSkin = NULL; + + delete iScaledBackgroundImage; + iScaledBackgroundImage = NULL; + + InitializeBackgroundBitmapL( *( iNode.Node().UiEngine() ), iNode.Node(), + iBackgroundBitmapIndex, iBackgroundBitmap, iBackgroundMask, + iIconProvider, FsSession()); + + return EPropertyChangeConsumed; + } + } + + return EPropertyChangeNotConsumed; + } + +// ----------------------------------------------------------------------------- +// CXnControlAdapterImpl::HandleScreenDeviceChangedL +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::HandleScreenDeviceChangedL() + { + } + +// ----------------------------------------------------------------------------- +// CreateBitmapFromColorL +// Creates a bitmap object with the given size and fill color +// ----------------------------------------------------------------------------- +// +static CFbsBitmap* CreateBitmapFromColorL( TSize aSize, TRgb aColor ) + { + CFbsBitmap* newBitmap = new ( ELeave ) CFbsBitmap; + newBitmap->Create( aSize, EColor16M ); + CleanupStack::PushL( newBitmap ); + + CFbsBitmapDevice* bitmapDev = CFbsBitmapDevice::NewL( newBitmap ); + CleanupStack::PushL( bitmapDev ); + + CFbsBitGc* bc = NULL; + User::LeaveIfError( bitmapDev->CreateContext( bc ) ); + CleanupStack::PushL( bc ); + + bc->SetBrushColor( aColor ); + bc->Clear(); // area is filled with the brush color + + CleanupStack::PopAndDestroy( bc ); + CleanupStack::PopAndDestroy( bitmapDev ); + CleanupStack::Pop( newBitmap ); + return newBitmap; + } + +// ----------------------------------------------------------------------------- +// PassEventToGestureHelperL +// Forwards event to gesturehelper +// ----------------------------------------------------------------------------- +// +TBool CXnControlAdapterImpl::PassEventToGestureHelperL( + const TPointerEvent& aPointerEvent ) + { + TBool ret( EFalse ); + + 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() ); + + RPointerArray< CXnPluginData >& plugins( + engine->ViewManager()->ActiveViewData().PluginData() ); + + for ( TInt i = 0; i < plugins.Count(); i++ ) + { + CXnPluginData* plugin( plugins[i] ); + + if ( plugin->Occupied() ) + { + CXnNode* widget( plugin->Node()->LayoutNode() ); + + if ( widget->MarginRect().Contains( aPointerEvent.iPosition ) ) + { + // Resolve swipe destination + CXnProperty* prop( widget->GetPropertyL( + XnPropertyNames::common::KSwipeDestination ) ); + + 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; + } + } + } + } + + 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; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::RemoveChildAdapters() + { + iChildren.Reset(); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +RPointerArray< CXnControlAdapter >& CXnControlAdapterImpl::ChildAdapters() + { + return iChildren; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +RFs& CXnControlAdapterImpl::FsSession() + { + return iAdapter->ControlEnv()->FsSession(); + } + + +// ============================= TIconProvider =============================== + +// ----------------------------------------------------------------------------- +// Constructor +// ----------------------------------------------------------------------------- +// +CXnControlAdapterImpl::TIconProvider::TIconProvider( RFile& aFile ) : + iFile( aFile ) + { + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +CXnControlAdapterImpl::TIconProvider::~TIconProvider() + { + iFile.Close(); + } + +// ----------------------------------------------------------------------------- +// Retreive Icon handle +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::TIconProvider::RetrieveIconFileHandleL( + RFile& aFile, const TIconFileType /*aType*/) + { + aFile.Duplicate( iFile ); + } + +// ----------------------------------------------------------------------------- +// Finish +// ----------------------------------------------------------------------------- +// +void CXnControlAdapterImpl::TIconProvider::Finished() + { + iFile.Close(); + delete this; + } + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xndocument.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xndocument.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,63 @@ +/* +* 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 document base class +* +*/ + +// INCLUDE FILES +#include "xndocument.h" +#include "xnappuiadapter.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnDocument::CXnDocument +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDocument::CXnDocument( CEikApplication& aApp, TUid aApplicationUid ) + : CAknDocument( aApp ) + { + iApplicationUid = aApplicationUid; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDocument::~CXnDocument() + { + } + +// ----------------------------------------------------------------------------- +// CXnDocument::CreateAppUiL +// Creates an AppUi +// ----------------------------------------------------------------------------- +// +EXPORT_C CEikAppUi* CXnDocument::CreateAppUiL() + { + CEikAppUi* appUi = new ( ELeave ) CXnAppUiAdapter( iApplicationUid ); + return appUi; + } + +// ----------------------------------------------------------------------------- +// CXnDocument::Uid +// Get the application uid +// ----------------------------------------------------------------------------- +// +EXPORT_C TUid CXnDocument::Uid() + { + return iApplicationUid; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xneditmode.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xneditmode.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,847 @@ +/* +* 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: Edit mode for widget drag and drop. +* +*/ + +// System includes +#include <AknUtils.h> +#include <gulgcmap.h> +#include <akntitle.h> +#include <barsread.h> +#include <xnuiengine.rsg> + +#ifdef RD_TACTILE_FEEDBACK +#include <touchfeedback.h> +#endif // RD_TACTILE_FEEDBACK + +// User includes +#include "xnappuiadapter.h" +#include "xnviewmanager.h" +#include "xnviewadapter.h" +#include "xnviewdata.h" +#include "xnnodeimpl.h" +#include "xndomnode.h" +#include "xnnode.h" +#include "xnproperty.h" +#include "xnuiengine.h" +#include "xncontroladapter.h" +#include "xnpopupcontroladapter.h" +#include "xnfocuscontrol.h" +#include "xneditor.h" +#include "xntype.h" +#include "xnmenu.h" + +#include "xneditmode.h" + +// Constants +_LIT8( KMenu, "menu" ); + +// ============================ LOCAL FUNCTIONS ================================ + +// ----------------------------------------------------------------------------- +// CopyBitmap +// Copies a data from source bitmap to target bitmap. +// ----------------------------------------------------------------------------- +// +static TInt CopyBitmap( CFbsBitmap& aTarget, const CFbsBitmap& aSource, + TPoint aSourcePoint ) + { + TSize targetSize( aTarget.SizeInPixels() ); + TSize sourceSize( aSource.SizeInPixels() ); + + TInt lineLength( targetSize.iWidth ); + TInt maxSourceLineLength( sourceSize.iWidth - aSourcePoint.iX ); + + if ( lineLength > maxSourceLineLength ) + { + lineLength = maxSourceLineLength; + } + + TInt rowCount( targetSize.iHeight ); + TInt maxSourceRowCount( sourceSize.iHeight - aSourcePoint.iY ); + + if ( rowCount > maxSourceRowCount ) + { + rowCount = maxSourceRowCount; + } + + // Get bitmap display mode + TDisplayMode displayMode( aSource.DisplayMode() ); + + // Create buffer for a scan line + HBufC8* scanLine = HBufC8::New( aSource.ScanLineLength( + lineLength, displayMode ) ); + + if ( !scanLine ) + { + return KErrNoMemory; + } + + TPtr8 scanPtr( scanLine->Des() ); + + // Copy all rows to destination bitmap + for ( TInt row = 0; row < rowCount; row++ ) + { + aSource.GetScanLine( scanPtr, + TPoint( aSourcePoint.iX, aSourcePoint.iY + row ), + lineLength, displayMode ); + + aTarget.SetScanLine( scanPtr, row ); + } + + delete scanLine; + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// SetVisibilityL +// Sets node either visible or hidden +// ----------------------------------------------------------------------------- +// +static void SetVisibilityL( CXnNode& aNode, const TDesC8& aVisibility ) + { + CXnUiEngine* engine( aNode.UiEngine() ); + + CXnDomStringPool& sp( aNode.DomNode()->StringPool() ); + + CXnProperty* prop = CXnProperty::NewL( + XnPropertyNames::style::common::KVisibility, + aVisibility, + CXnDomPropertyValue::EString, sp ); + CleanupStack::PushL( prop ); + + aNode.SetPropertyL( prop ); + + CleanupStack::Pop( prop ); + } + +// ----------------------------------------------------------------------------- +// ResolveMenuIdL +// Resolves <menu> element and its id based on aMenuBar <menubar> element +// ----------------------------------------------------------------------------- +// +static HBufC* ResolveMenuIdL( CXnNode& aMenuBar ) + { + HBufC* retval( NULL ); + + RPointerArray< CXnNode >& children( aMenuBar.Children() ); + + for ( TInt i = 0; i < children.Count(); i++ ) + { + CXnNode* child( children[i] ); + + if ( child->Type()->Type() == KMenu ) + { + CXnProperty* prop( + child->GetPropertyL( XnPropertyNames::common::KId ) ); + + if ( prop ) + { + // Ownership is passed to the caller + retval = prop->StringValueL(); + } + + break; + } + } + + return retval; + } + +#ifdef RD_TACTILE_FEEDBACK +// ----------------------------------------------------------------------------- +// Feedback +// Gives instant touch feedback +// ----------------------------------------------------------------------------- +// +static void Feedback( TTouchLogicalFeedback aType ) + { + MTouchFeedback* fb( MTouchFeedback::Instance() ); + + if ( fb ) + { + fb->InstantFeedback( aType ); + } + } +#endif // RD_TACTILE_FEEDBACK + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnEditMode::CXnEditMode +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnEditMode::CXnEditMode( CXnUiEngine& aUiEngine ) + : iUiEngine( aUiEngine ), + iViewManager( *iUiEngine.ViewManager() ), + iState( CXnEditMode::ENone ), + iStylusDownPos( TPoint::EUninitialized ), + iPreviousPos( TPoint::EUninitialized ), + iDrawPos( TPoint::EUninitialized ), + iLastDrawRect( TRect::EUninitialized ) + { + } + +// ----------------------------------------------------------------------------- +// CXnEditMode::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnEditMode::ConstructL() + { + CreateWindowL(); + + ActivateL(); + + Window().SetRequiredDisplayMode( EColor16MA ); + + if ( Window().SetTransparencyAlphaChannel() == KErrNone ) + { + Window().SetBackgroundColor( ~0 ); + } + + EnableDragEvents(); + + CCoeControl::MakeVisible( EFalse ); + + TRect rect; + + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect ); + + iMainpane = new ( ELeave ) CFbsBitmap; + User::LeaveIfError( iMainpane->Create( TSize(), EColor16MA ) ); + + iWidget = new ( ELeave ) CFbsBitmap; + User::LeaveIfError( iWidget->Create( TSize(), EColor16MA ) ); + + iBmpDevice = CFbsBitmapDevice::NewL( iMainpane ); + + iBmpGc = CFbsBitGc::NewL(); + + iBmpGc->Activate( iBmpDevice ); + + iMapGc = CWindowToBitmapMappingGc::NewL( + *static_cast< CWsScreenDevice* >( SystemGc().Device() ), *iBmpGc ); + + SetRect( rect ); + } + +// ----------------------------------------------------------------------------- +// CXnEditMode::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnEditMode* CXnEditMode::NewL( CXnUiEngine& aEngine ) + { + CXnEditMode* self = new ( ELeave ) CXnEditMode( aEngine ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnEditMode::~CXnEditMode +// Destructor +// ----------------------------------------------------------------------------- +// +CXnEditMode::~CXnEditMode() + { + TRAP_IGNORE( StopDragL() ); + + delete iMapGc; + delete iBmpGc; + delete iBmpDevice; + delete iMainpane; + delete iWidget; + } + +// ----------------------------------------------------------------------------- +// CXnEditMode::UpdateScreen +// Updates invalid parts of the screen. All drawing must be done from here +// ----------------------------------------------------------------------------- +// +void CXnEditMode::UpdateScreen() + { + if ( iState == CXnEditMode::EDragging ) + { + if ( !iWidget || iDrawPos == TPoint::EUninitialized ) + { + return; + } + + TRect drawRect( iDrawPos, iWidget->SizeInPixels() ); + + if ( iLastDrawRect != TRect::EUninitialized ) + { + drawRect.BoundingRect( iLastDrawRect ); + } + + iLastDrawRect = drawRect; + + DrawNow( drawRect ); + } + else + { + if ( iLastDrawRect != TRect::EUninitialized ) + { + DrawNow( iLastDrawRect ); + } + + iDrawPos = TPoint::EUninitialized; + iLastDrawRect = TRect::EUninitialized; + } + } + +// ----------------------------------------------------------------------------- +// CXnEditMode::Draw +// +// ----------------------------------------------------------------------------- +// +void CXnEditMode::Draw( const TRect& aRect ) const + { + CWindowGc& gc( SystemGc() ); + + gc.SetClippingRect( Rect() ); + + gc.Clear( aRect ); + + if ( iWidget && iState == CXnEditMode::EDragging ) + { + gc.BitBlt( iDrawPos, iWidget ); + } + + gc.Reset(); + } + +// ----------------------------------------------------------------------------- +// CXnEditMode::MakeVisible +// +// ----------------------------------------------------------------------------- +// +void CXnEditMode::MakeVisible( TBool aVisible ) + { + TBool visible( IsVisible() ? ETrue : EFalse ); + + if ( aVisible == visible ) + { + return; + } + + CCoeControl::MakeVisible( aVisible ); + + CXnAppUiAdapter& appui( iUiEngine.AppUiAdapter() ); + + // Remove focus + appui.HideFocus(); + + CCoeControl& bg( appui.ViewAdapter().BgControl() ); + + if ( aVisible ) + { + bg.DrawableWindow()->SetPointerGrab( EFalse ); + + Window().SetOrdinalPosition( 0 ); + Window().SetPointerGrab( ETrue ); + Window().ClaimPointerGrab(); + } + else + { + Window().SetPointerGrab( EFalse ); + + bg.DrawableWindow()->SetPointerGrab( ETrue ); + } + } + +// ----------------------------------------------------------------------------- +// CXnEditMode::HandlePointerEventL +// +// ----------------------------------------------------------------------------- +// +void CXnEditMode::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + if ( !AknLayoutUtils::PenEnabled() ) + { + return; + } + + if ( aPointerEvent.iType != TPointerEvent::EButton1Down && + iStylusDownPos == TPoint::EUninitialized ) + { + return; + } + + // For performance reasons, discard the event if delta between previous + // event is within 'KOffset'. + TInt KOffset( 5 ); + TRect rect( + aPointerEvent.iPosition.iX - KOffset, + aPointerEvent.iPosition.iY - KOffset, + aPointerEvent.iPosition.iX + KOffset, + aPointerEvent.iPosition.iY + KOffset ); + + if ( aPointerEvent.iType == TPointerEvent::EDrag && + rect.Contains( iPreviousPos ) ) + { + return; + } + + RPointerArray< CXnPluginData >& plugins( + iViewManager.ActiveViewData().PluginData() ); + + CXnNode* node( NULL ); + + for ( TInt i = 0; i < plugins.Count(); i++ ) + { + CXnPluginData* data( plugins[i] ); + + CXnNode* plugin( data->Owner()->LayoutNode() ); + + CXnControlAdapter* ctrl( plugin->Control() ); + + if ( ctrl->IsVisible() && + ctrl->Rect().Contains( aPointerEvent.iPosition ) ) + { + node = plugin; + break; + } + } + + if ( !node ) + { + if ( iTargetNode ) + { + iTargetNode->UnsetStateL( XnPropertyNames::style::common::KFocus ); + } + + iTargetNode = NULL; + } + + if ( node && node != iTargetNode ) + { + if ( !node->IsStateSet( XnPropertyNames::style::common::KEdit ) ) + { + // Not in edit state + node = NULL; + } + else + { + iTargetNode = node; + + iUiEngine.DisableRenderUiLC(); + + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + iUiEngine.AppUiAdapter().ShowFocus(); + + node->SetStateL( XnPropertyNames::style::common::KFocus ); +#ifdef RD_TACTILE_FEEDBACK + Feedback( ETouchFeedbackBasic ); +#endif + } + else if ( aPointerEvent.iType == TPointerEvent::EDrag ) + { + if ( iState == CXnEditMode::EDragging ) + { + node->SetStateL( XnPropertyNames::style::common::KFocus ); + #ifdef RD_TACTILE_FEEDBACK + Feedback( ETouchFeedbackSensitive ); + #endif + } + else if ( iDraggingNode && + !iDraggingNode->MarginRect().Contains( aPointerEvent.iPosition ) ) + { + iDraggingNode->UnsetStateL( + XnPropertyNames::style::common::KFocus ); + + iDraggingNode = NULL; + } + } + + CleanupStack::PopAndDestroy(); + } + } + + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + iDragged = EFalse; + + if ( node ) + { + CXnPluginData& plugin( iUiEngine.ViewManager()-> + ActiveViewData().Plugin( node ) ); + + if ( plugin.Occupied() ) + { + StartDragL( *node ); + + iDrawPos = iDraggingNode->BorderRect().iTl; + + iStylusDownPos = iPreviousPos = aPointerEvent.iPosition; + } + else + { + iDraggingNode = node; + + iStylusDownPos = iPreviousPos = aPointerEvent.iPosition; + } + } + } + else if ( aPointerEvent.iType == TPointerEvent::EDrag ) + { + const TInt KDragTreshold( 30 ); + + TInt dx( Abs( aPointerEvent.iPosition.iX - iStylusDownPos.iX ) ); + TInt dy( Abs( aPointerEvent.iPosition.iY - iStylusDownPos.iY ) ); + + TBool dragged( iDragged ); + + if ( dx > KDragTreshold || dy > KDragTreshold ) + { + iDragged = ETrue; + + if ( !dragged && iDragged && iDraggingNode && + iState == CXnEditMode::EDragging ) + { + // Hide the node which will be dragged from layout tree + SetVisibilityL( *iDraggingNode, + XnPropertyNames::style::common::visibility::KHidden ); + + iUiEngine.RenderUIL(); + } + } + + if ( iDragged && iWidget && iDraggingNode && iState == CXnEditMode::EDragging ) + { + // Resolve draw position + TPoint dp( iPreviousPos - aPointerEvent.iPosition ); + + iDrawPos -= dp; + + // Update previous position + iPreviousPos = aPointerEvent.iPosition; + + UpdateScreen(); + } + } + else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + // Cancel + if ( !iTargetNode || !iDraggingNode || + iDraggingNode == iTargetNode || + !iTargetNode->MarginRect().Contains( aPointerEvent.iPosition ) ) + { + CXnNode* node( iDraggingNode ); + + iUiEngine.DisableRenderUiLC(); + + StopDragL(); + + iUiEngine.RenderUIL(); + + CleanupStack::PopAndDestroy(); // DisableRenderUiLC + + UpdateScreen(); + + if ( node && !iDragged ) + { + CXnPluginData& plugin( iUiEngine.ViewManager()-> + ActiveViewData().Plugin( node ) ); + + if ( plugin.Occupied() ) + { + CXnNode* popup( iUiEngine.StylusPopupNode() ); + + if ( popup ) + { + CXnPopupControlAdapter* control = + static_cast< CXnPopupControlAdapter* >( + popup->Control() ); + + if ( control ) + { + control->TryDisplayingStylusPopupL( *node ); + } + } + } + else + { + // empty slot, start add widget query + iUiEngine.Editor()->SetTargetPlugin( node ); + iUiEngine.Editor()->AddWidgetL(); + } + } + } + else // Reorder + { + if ( iDraggingNode && iTargetNode ) + { + iUiEngine.DisableRenderUiLC(); + + CXnNode* parent1( iDraggingNode->Parent() ); + CXnNode* parent2( iTargetNode->Parent() ); + + if ( parent1 == parent2 ) + { + parent1->ReorderNodesL( iDraggingNode, iTargetNode ); + + // Update plugin positions to HSPS + iUiEngine.Editor()->ReorderWidgetsL( + iUiEngine.Plugins() ); + } + + StopDragL(); + + iUiEngine.RenderUIL(); + + CleanupStack::PopAndDestroy(); // DisableRenderUiLC + + UpdateScreen(); + } + } + + iUiEngine.AppUiAdapter().HideFocus(); + } + } + +// ----------------------------------------------------------------------------- +// CXnEditMode::OfferKeyEventL +// +// ----------------------------------------------------------------------------- +// +TKeyResponse CXnEditMode::OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + if ( IsVisible() && aType == EEventKey ) + { + CXnNode* focused( iUiEngine.FocusedNode() ); + + if ( focused && ( aKeyEvent.iScanCode == EStdKeyDevice3 || + aKeyEvent.iScanCode == EStdKeyEnter ) ) + { + CXnPluginData& plugin( iUiEngine.ViewManager()-> + ActiveViewData().Plugin( focused ) ); + + if ( plugin.Occupied() ) + { + // Open context menu + CXnNode* menubar( iUiEngine.MenuBarNode() ); + + if ( menubar ) + { + HBufC* id( ResolveMenuIdL( *menubar ) ); + CleanupStack::PushL( id ); + + if ( id ) + { + XnMenuInterface::MXnMenuInterface* menuIf( NULL ); + + XnComponentInterface::MakeInterfaceL( + menuIf, menubar->AppIfL() ); + + if ( menuIf ) + { + menuIf->TryDisplayingMenuBarL( *id ); + iUiEngine.Editor()->SetTargetPlugin( focused ); + } + } + + CleanupStack::PopAndDestroy( id ); + } + } + else + { + // empty slot, start add widget query + iUiEngine.Editor()->SetTargetPlugin( focused ); + iUiEngine.Editor()->AddWidgetL(); + } + + return EKeyWasConsumed; + } + } + + return EKeyWasNotConsumed; + } + +// ----------------------------------------------------------------------------- +// CXnEditMode::SizeChanged +// +// ----------------------------------------------------------------------------- +// +void CXnEditMode::SizeChanged() + { + TSize size( Rect().Size() ); + + iBmpDevice->Resize( size ); + + // Needs to be called if the device is resized + iBmpGc->Resized(); + + iMainpane->Resize( size ); + } + +// ----------------------------------------------------------------------------- +// CXnEditMode::StartDragL() +// +// ----------------------------------------------------------------------------- +// +void CXnEditMode::StartDragL( CXnNode& aNode ) + { + CXnControlAdapter* control( aNode.Control() ); + + TRect rect( control->Rect() ); + + // Clear first with alpha + TRgb rgb( TRgb::Color16MA( 0 ) ); + rgb.SetAlpha( 64 ); + + iMapGc->SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); + + iMapGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + iMapGc->SetBrushColor( rgb ); + + iMapGc->Clear( rect ); + + iState = CXnEditMode::EShootContent; + + CWindowGc* gc( control->CustomGc() ); + + control->SetCustomGc( iMapGc ); + + control->DrawNow( rect ); + + control->SetCustomGc( gc ); + + if ( iWidget->SizeInPixels() != rect.Size() ) + { + iWidget->Resize( rect.Size() ); + } + + User::LeaveIfError( CopyBitmap( *iWidget, *iMainpane, rect.iTl ) ); + + iState = CXnEditMode::EDragging; + + iDraggingNode = &aNode; + } + +// ----------------------------------------------------------------------------- +// CXnEditMode::StopDragL() +// ----------------------------------------------------------------------------- +// +void CXnEditMode::StopDragL() + { + if ( iDraggingNode && iState == CXnEditMode::EDragging ) + { + SetVisibilityL( *iDraggingNode, + XnPropertyNames::style::common::visibility::KVisible ); + + iDraggingNode->SetStateL( XnPropertyNames::style::common::KFocus ); + iDraggingNode->Parent()->SetDirtyL( XnDirtyLevel::ELayoutAndRender ); + } + + iDraggingNode = iTargetNode = NULL; + + iPreviousPos = iStylusDownPos = TPoint::EUninitialized; + + iState = CXnEditMode::EDragAndDrop; + } + +// ----------------------------------------------------------------------------- +// CXnEditMode::HandleScreenDeviceChangedL +// ----------------------------------------------------------------------------- +// +void CXnEditMode::HandleScreenDeviceChangedL() + { + if ( iState != CXnEditMode::ENone ) + { + if ( iState == CXnEditMode::EDragging ) + { + IgnoreEventsUntilNextPointerUp(); + } + + StopDragL(); + } + + SetRect( iUiEngine.ClientRect() ); + + UpdateScreen(); + } + +// ----------------------------------------------------------------------------- +// CXnEditMode::SetEditModeL() +// ----------------------------------------------------------------------------- +// +void CXnEditMode::SetEditModeL( CXnEditMode::TEditState aState ) + { + // Enter to edit mode + if ( aState == CXnEditMode::EDragAndDrop ) + { + iState = aState; + + iUiEngine.AppUiAdapter().HandleEnterEditModeL( ETrue ); + SetStatusPaneTitleL(); + + MakeVisible( ETrue ); + } + + // Exit from edit mode + else if ( aState == CXnEditMode::ENone ) + { + iDraggingNode = NULL; + iTargetNode = NULL; + + iState = aState; + + iUiEngine.AppUiAdapter().HandleEnterEditModeL( EFalse ); + + MakeVisible( EFalse ); + } + } + +// ----------------------------------------------------------------------------- +// CXnEditMode::EditState() +// +// ----------------------------------------------------------------------------- +// +CXnEditMode::TEditState CXnEditMode::EditState() const + { + return iState; + } + +// ----------------------------------------------------------------------------- +// 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 + } + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1766 @@ +/* +* 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: Manages Ai3 personalization +* +*/ + +// System includes +#include <StringLoader.h> +#include <aknlistquerydialog.h> +#include <aknnotewrappers.h> +#include <utf.h> +#include <AknsWallpaperUtils.h> +#include <centralrepository.h> +#include <AknSkinsInternalCRKeys.h> +#include "../../../inc/ai3.hrh" + +#include <xnuiengine.rsg> +#include <hscontentcontrolui.h> +#include <hscontentcontrol.h> + +// User includes +#include "xnuiengine.h" +#include "xnproperty.h" +#include "xnnode.h" +#include "xntype.h" +#include "xntext.h" +#include "xnappuiadapter.h" + +#include "xndomnode.h" +#include "xndomproperty.h" +#include "xndompropertyvalue.h" +#include "xndomlist.h" +#include "xndomattribute.h" +#include "hspssapi.h" +#include "cpssapi.h" +#include "xneditmode.h" +#include "xndomdocument.h" +#include "xnnodeimpl.h" +#include "xnodt.h" +#include "xnplugindefs.h" + +#include "xnviewmanager.h" +#include "xnplugindata.h" +#include "xnrootdata.h" +#include "xnviewdata.h" +#include "xnwallpaperview.h" + +#include "xneditor.h" +#include "xnpanic.h" + +using namespace hspswrapper; +using namespace cpswrapper; + +// LOCAL CONSTANTS AND MACROS +_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" ); + +_LIT8( KSingle, "single" ); +_LIT8( KMulti, "multi" ); + +_LIT8( KWMUi, "WmContentControlUI" ); + +const TInt32 KMultiInstanceUnlimitedValue = -1; +const TInt32 KMultiInstanceHiddenValue = 0; + +const TUid KDummyUid = { 0x0000000 }; +enum + { + ECanBeAdded = 0x01, + ECanBeRemoved + }; + +// ====================== LOCAL FUNTION PROTOTYPES ============================ +static void DeletePluginInfos( TAny* aObject ); +static void DeleteItemMaps( TAny* aObject ); +static void DeleteWidgetInfo( TAny* aObject ); + +static TPtrC ParseWidgetName( const CHsContentInfo& aContentInfo ); +static void SetPropertyL( CXnNode& aNode, const TDesC8& aAttribute, + const TDesC8& aValue ); +static void ShowErrorNoteL( const TDesC& aMsg ); +static CXnPluginData* DeterminePlugin( CXnViewManager& aViewManager, + CXnNode* aPredicate = NULL ); +static CXnPluginData* DeterminePlugin( + RPointerArray< CXnPluginData >& aPlugins, + const CHsContentInfo& aContentInfo ); + +// ============================ LOCAL FUNCTIONS =============================== + +// --------------------------------------------------------------------------- +// DeletePluginInfos +// --------------------------------------------------------------------------- +// +static void DeletePluginInfos( TAny* aObject ) + { + reinterpret_cast< + RPointerArray< hspswrapper::CPluginInfo >* >( + aObject )->ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// DeleteItemMaps +// --------------------------------------------------------------------------- +// +static void DeleteItemMaps( TAny* aObject ) + { + reinterpret_cast< + RPointerArray< hspswrapper::CItemMap >* >( + aObject )->ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// DeleteWidgetInfo +// --------------------------------------------------------------------------- +// +static void DeleteWidgetInfo( TAny* aObject ) + { + reinterpret_cast< + RPointerArray< CHsContentInfo >* >( aObject )->ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// ParseWidgetName +// --------------------------------------------------------------------------- +// +static TPtrC ParseWidgetName( const CHsContentInfo& aContentInfo ) + { + TPtrC retval( aContentInfo.Name() ); + + TInt pos( retval.Locate( ':' ) ); + + if ( pos != KErrNotFound ) + { + retval.Set( retval.Right( retval.Length() - pos - 1 ) ); + } + + return retval; + } + +// --------------------------------------------------------------------------- +// SetPropertyL +// --------------------------------------------------------------------------- +// +static void SetPropertyL( CXnNode& aNode, + const TDesC8& aAttribute, const TDesC8& aValue ) + { + CXnDomNode* node( aNode.DomNode() ); + + if ( node ) + { + CXnDomStringPool& sp( node->StringPool() ); + + // create new property + CXnDomPropertyValue* value = CXnDomPropertyValue::NewL( sp ); + CleanupStack::PushL( value ); + + value->SetStringValueL( CXnDomPropertyValue::EString, aValue ); + + CXnProperty* prop = CXnProperty::NewL( aAttribute, value, sp ); + + CleanupStack::Pop( value ); + CleanupStack::PushL( prop ); + + aNode.SetPropertyL( prop ); + + CleanupStack::Pop( prop ); + } + } + +// --------------------------------------------------------------------------- +// ShowErrorNoteL +// --------------------------------------------------------------------------- +// +static void ShowErrorNoteL( const TDesC& aMsg ) + { + CAknErrorNote* note = new ( ELeave ) CAknErrorNote; + CleanupStack::PushL( note ); + + note->ExecuteLD( aMsg ); + + CleanupStack::Pop( note ); + } + +// --------------------------------------------------------------------------- +// DeterminePlugin +// Determinates target plugin where widget should be added +// --------------------------------------------------------------------------- +// +CXnPluginData* DeterminePlugin( CXnViewManager& aViewManager, + CXnNode* aPredicate ) + { + CXnViewData& viewData( aViewManager.ActiveViewData() ); + + if ( aPredicate ) + { + CXnPluginData& plugin( viewData.Plugin( aPredicate ) ); + + if ( !plugin.Occupied() ) + { + return &plugin; + } + } + + RPointerArray< CXnNode >& nodes( aViewManager.PluginNodes() ); + + for ( TInt i = 0; i < nodes.Count(); i++ ) + { + CXnNode* node( nodes[i] ); + + CXnPluginData& plugin( viewData.Plugin( node ) ); + + if ( !plugin.Occupied() ) + { + return &plugin; + } + } + + return NULL; + } + +// --------------------------------------------------------------------------- +// DeterminePlugin +// Determines target plugin based widget info +// --------------------------------------------------------------------------- +// +CXnPluginData* DeterminePlugin( RPointerArray< CXnPluginData >& aPlugins, + const CHsContentInfo& aContentInfo ) + { + for ( TInt i = 0; i < aPlugins.Count(); i++ ) + { + CXnPluginData* plugin( aPlugins[i] ); + + if ( plugin->Occupied() && plugin->PluginId() == aContentInfo.PluginId() ) + { + return plugin; + } + } + + return NULL; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// --------------------------------------------------------------------------- +// CXnEditor::NewL +// --------------------------------------------------------------------------- +// +CXnEditor* CXnEditor::NewL( CXnViewManager& aViewManager, + const TDesC8& aUid ) + { + CXnEditor* self = CXnEditor::NewLC( aViewManager, aUid ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CXnEditor::NewLC +// --------------------------------------------------------------------------- +// +CXnEditor* CXnEditor::NewLC( CXnViewManager& aViewManager, + const TDesC8& aUid ) + { + CXnEditor* self = new ( ELeave ) CXnEditor( aViewManager ); + CleanupStack::PushL( self ); + self->ConstructL( aUid ); + return self; + } + +// --------------------------------------------------------------------------- +// CXnEditor::CXnEditor +// --------------------------------------------------------------------------- +// +CXnEditor::CXnEditor( CXnViewManager& aViewManager ) + : iViewManager( aViewManager ), + iWidgetsVisibilityState( ETrue ) + { + iViewManager.AddObserver( *this ); + } + +// --------------------------------------------------------------------------- +// CXnEditor::ConstructL +// --------------------------------------------------------------------------- +// +void CXnEditor::ConstructL( const TDesC8& aUid ) + { + iCpsWrapper = CCpsWrapper::NewL( *this ); + iHspsWrapper = CHspsWrapper::NewL( aUid, this ); + } + +// --------------------------------------------------------------------------- +// CXnEditor::~CXnEditor +// --------------------------------------------------------------------------- +// +CXnEditor::~CXnEditor() + { + iViewManager.RemoveObserver( *this ); + + delete iCpsWrapper; + delete iHspsWrapper; + delete iPublisherMap; + } + +// ----------------------------------------------------------------------------- +// CXnEditor::IsCurrentViewFull +// ----------------------------------------------------------------------------- +// +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; + } + +// ----------------------------------------------------------------------------- +// CXnEditor::FilterWidgetListL +// ----------------------------------------------------------------------------- +// +void CXnEditor::FilterWidgetListL( CHsContentInfoArray& aContentInfoArray, + TBool aIgnoreViewFull ) + { + RPointerArray< CHsContentInfo >& list( aContentInfoArray.Array() ); + + TBool viewFull = ( aIgnoreViewFull ? EFalse : IsCurrentViewFull() ); + + for ( TInt i = 0; i < list.Count(); i++ ) + { + CHsContentInfo* info( list[i] ); + + info->SetCanBeAdded( EFalse ); + info->SetCanBeRemoved( EFalse ); + + TInt result( 0 ); + + if ( info->Type() != KKeyTemplate() ) + { + result = NonTemplateWidgetCanBeAddedRemovedL( *info ); + } + else + { + result = TemplateWidgetCanBeAddedRemovedL( *info ); + } + + if ( ( result & ECanBeAdded ) && !viewFull ) + { + info->SetCanBeAdded( ETrue ); + } + + if ( result & ECanBeRemoved ) + { + info->SetCanBeRemoved( ETrue ); + } + } + } + +// --------------------------------------------------------------------------- +// CXnEditor::TemplateWidgetCanBeAddedRemovedL +// --------------------------------------------------------------------------- +// +TInt CXnEditor::TemplateWidgetCanBeAddedRemovedL( + CHsContentInfo& aInfo ) + { + TInt retval( 0 ); + + TInt widgetCount( 0 ); + + RPointerArray< CXnPluginData > plugins; + CleanupClosePushL( plugins ); + + if ( aInfo.IsWrt() ) + { + // Get plugins globally from all pages + iViewManager.PluginDataL( plugins, ETrue ); + } + else + { + // Get plugins from current page + iViewManager.PluginDataL( plugins, EFalse ); + } + + // Get widgets in current configuration + for ( TInt i = 0; i < plugins.Count(); i++ ) + { + CXnPluginData* plugin( plugins[i] ); + + if ( !plugin->Occupied() ) + { + continue; + } + + if ( plugin->PublisherName() == aInfo.PublisherId() ) + { + if ( plugin->Removable() ) + { + // To enable widget remove + aInfo.SetPluginIdL( plugin->PluginId() ); + + retval |= ECanBeRemoved; + } + + widgetCount++; + } + } + + if ( widgetCount < aInfo.MaxWidgets() ) + { + retval |= ECanBeAdded; + } + + CleanupStack::PopAndDestroy( &plugins ); + + return retval; + } + +// --------------------------------------------------------------------------- +// CXnEditor::NonTemplateWidgetCanBeAddedRemovedL +// +// --------------------------------------------------------------------------- +// +TInt CXnEditor::NonTemplateWidgetCanBeAddedRemovedL( + CHsContentInfo& aInfo ) + { + TInt retval( 0 ); + + TInt widgetCount( 0 ); + + CXnViewData& activeView( iViewManager.ActiveViewData() ); + + RPointerArray< CXnPluginData >& plugins( activeView.PluginData() ); + + for ( TInt i = 0; i < plugins.Count(); i++ ) + { + CXnPluginData* plugin( plugins[i] ); + + if ( !plugin->Occupied() ) + { + continue; + } + + if ( plugin->PluginUid().CompareF( aInfo.Uid() ) == 0 ) + { + if ( plugin->Removable() ) + { + // To enable widget remove + aInfo.SetPluginIdL( plugin->PluginId() ); + + retval |= ECanBeRemoved; + } + + widgetCount++; + } + } + + if ( widgetCount < aInfo.MaxWidgets() || + aInfo.MaxWidgets() == KMultiInstanceUnlimitedValue ) + { + retval |= ECanBeAdded; + } + + return retval; + } + + +// --------------------------------------------------------------------------- +// CXnEditor::FilterViewListL +// --------------------------------------------------------------------------- +// +void CXnEditor::FilterViewListL( CHsContentInfoArray& aContentInfoArray ) + { + RPointerArray< CHsContentInfo >& list( aContentInfoArray.Array() ); + + RPointerArray< CXnPluginData >& views( + iViewManager.ActiveAppData().PluginData() ); + + TInt viewAmount( iViewManager.ViewAmount() ); + + const TInt KMaxViewAmount( 6 ); + + 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 ); + } + } + } + +// --------------------------------------------------------------------------- +// CXnEditor::RemoveUnRegisteredWidgetL +// --------------------------------------------------------------------------- +// +void CXnEditor::RemoveUnRegisteredWidgetL( const TDesC16& aPublisher ) + { + RPointerArray< CXnPluginData > plugins; + CleanupClosePushL( plugins ); + + iViewManager.PluginDataL( plugins, ETrue ); + + for ( TInt i = 0; i < plugins.Count(); i++ ) + { + CXnPluginData* plugin( plugins[i] ); + + if( plugin->Occupied() && plugin->PublisherName() == aPublisher ) + { + iViewManager.UnloadWidgetFromPluginL( *plugin ); + } + } + + CleanupStack::PopAndDestroy( &plugins ); + } + +// --------------------------------------------------------------------------- +// CXnEditor::RemoveUnInstalledWidgetL +// --------------------------------------------------------------------------- +// +void CXnEditor::RemoveUnInstalledWidgetL( const CHsContentInfo& aContentInfo ) + { + RPointerArray< CXnPluginData > plugins; + CleanupClosePushL( plugins ); + + iViewManager.PluginDataL( plugins, ETrue ); + + CXnPluginData* plugin( DeterminePlugin( plugins, aContentInfo ) ); + + if ( plugin ) + { + iViewManager.UnloadWidgetFromPluginL( *plugin ); + } + + CleanupStack::PopAndDestroy( &plugins ); + } + +// --------------------------------------------------------------------------- +// CXnEditor::ReplaceWidgetL +// --------------------------------------------------------------------------- +// +void CXnEditor::ReplaceWidgetL( CHsContentInfo& aContentInfo, TBool aUseHsps ) + { + RPointerArray< CXnPluginData > plugins; + CleanupClosePushL( plugins ); + + iViewManager.PluginDataL( plugins, ETrue ); + + CXnPluginData* match = NULL; + + for( TInt i = 0; i < plugins.Count(); i++ ) + { + CXnPluginData* plugin( plugins[i] ); + + if( plugin->PluginId() == aContentInfo.PluginId() ) + { + match = plugin; + break; + } + } + + if( match ) + { + iViewManager.ReplaceWidgetToPluginL( aContentInfo, *match, aUseHsps ); + } + + CleanupStack::PopAndDestroy( &plugins ); + } + +// --------------------------------------------------------------------------- +// CXnEditor::AddWidgetL +// --------------------------------------------------------------------------- +// +void CXnEditor::AddWidgetL() + { + MHsContentControlUi* ui( + iViewManager.AppUiAdapter().HsContentController( KWMUi ) ); + + if( ui ) + { + ui->SetContentController( this ); + ui->Activate(); + + return; + } + + CXnPluginData* plugin( NULL ); + + if ( iTargetPlugin ) + { + plugin = DeterminePlugin( iViewManager, iTargetPlugin ); + } + else + { + plugin = DeterminePlugin( iViewManager ); + } + + iTargetPlugin = NULL; + + CHsContentInfoArray* info = CHsContentInfoArray::NewL(); + 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 ); + + CDesCArrayFlat* array = new ( ELeave ) CDesCArrayFlat( 8 ); + CleanupStack::PushL( array ); + + for ( TInt i = 0; i < widgets.Count(); i++ ) + { + CHsContentInfo* widget( widgets[i] ); + + if ( widget->CanBeAdded() ) + { + TPtrC name( ParseWidgetName( *widget ) ); + + array->InsertIsqAllowDuplicatesL( name ); + } + } + + const TDesC8& ns( iViewManager.ViewNode()->Namespace() ); + + CXnNode* link( iViewManager.UiEngine().FindNodeByIdL( KDownload, ns ) ); + + if ( link ) + { + CXnText* textIf( NULL ); + + XnComponentInterface::MakeInterfaceL( textIf, link->AppIfL() ); + + if ( textIf ) + { + const TDesC* text( textIf->Text() ); + + if ( text ) + { + // First item is always Download link + array->InsertL( 0, *text ); + } + } + } + + // Display dialog + TInt selectedIndex( 0 ); + + CAknListQueryDialog* query = + new ( ELeave ) CAknListQueryDialog( &selectedIndex ); + + query->PrepareLC( R_LISTQUERY_ADD_WIDGET ); + + query->SetItemTextArray( array ); + query->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + // Save dialog pointer for later usage + iQuery = query; + + TBool linkSelected( EFalse ); + + if ( query->RunLD() ) + { + // Download link is always the first one, if it is defined + if ( link && selectedIndex == 0 ) + { + // Activate download link shortcut + link->SetStateL( XnPropertyNames::style::common::KActive ); + link->UnsetStateL( XnPropertyNames::style::common::KActive ); + + linkSelected = ETrue; + } + else + { + if ( !plugin ) + { + // No room for new widget, so error note. + HBufC* msg = StringLoader::LoadLC( R_QTN_HS_ADD_WIDGET_FULL ); + ShowErrorNoteL( *msg ); + CleanupStack::PopAndDestroy( msg ); + } + } + + const TDesC& selectedName( ( *array )[selectedIndex] ); + + for ( TInt i = 0; plugin && !linkSelected && i < widgets.Count(); i++ ) + { + CHsContentInfo* widget( widgets[i] ); + + TPtrC name( ParseWidgetName( *widget ) ); + + if ( selectedName == name ) + { + TInt ret( iViewManager.LoadWidgetToPluginL( *widget, *plugin ) ); + + if ( ret == KErrNone ) + { + CXnNode *node( plugin->Owner()->LayoutNode() ); + + // Analyse added widget + TBool widgetOk( iViewManager.UiEngine().AnalyseAddedWidgetL( + *node ) ); + + if ( !widgetOk ) + { + iViewManager.UnloadWidgetFromPluginL( *plugin ); + + // Widget doesn't fit to UI + HBufC* msg = StringLoader::LoadLC( + R_QTN_HS_ADD_WIDGET_FULL ); + + ShowErrorNoteL( *msg ); + + CleanupStack::PopAndDestroy( msg ); + } + } + + break; + } + } + } + + // Dialog ended and deleted by RunLD + iQuery = NULL; + + CleanupStack::PopAndDestroy( 2, info ); // array + } + +// --------------------------------------------------------------------------- +// CXnEditor::RemoveWidgetL +// --------------------------------------------------------------------------- +// +void CXnEditor::RemoveWidgetL( CXnNode* aNode ) + { + if ( iTargetPlugin ) + { + aNode = iTargetPlugin; + } + + iTargetPlugin = NULL; + + if ( !aNode ) + { + return; + } + + CXnPluginData& plugin( iViewManager.ActiveViewData().Plugin( aNode ) ); + + if( plugin.Removable() ) + { + TRAP_IGNORE( iViewManager.UnloadWidgetFromPluginL( plugin ) ); + } + } + +// --------------------------------------------------------------------------- +// CXnEditor::ReorderWidgetsL +// --------------------------------------------------------------------------- +// +void CXnEditor::ReorderWidgetsL( RPointerArray< CXnNode >* aPluginArray ) + { + if ( !aPluginArray ) + { + return; + } + + CXnViewData& viewData( iViewManager.ActiveViewData() ); + + const TDesC8& configurationId( viewData.ConfigurationId() ); + + CDesC8ArrayFlat* ids = new ( ELeave ) CDesC8ArrayFlat( 6 ); + CleanupStack::PushL( ids ); + + for ( TInt i = 0; i < aPluginArray->Count(); i++ ) + { + CXnPluginData& plugin( viewData.Plugin( ( *aPluginArray )[i] ) ); + + const TDesC8& id( plugin.PluginId() ); + + if ( id != KNullDesC8 ) + { + ids->AppendL( id ); + } + } + + iHspsWrapper->MovePluginsL( configurationId, *ids ); + + CleanupStack::PopAndDestroy( ids ); + } + +// --------------------------------------------------------------------------- +// CXnEditor::PublisherInfoL +// --------------------------------------------------------------------------- +// +CPublisherInfo* CXnEditor::PublisherInfoL( const CHsContentInfo& aContentInfo ) + { + if ( !iPublisherMap ) + { + return NULL; + } + + 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]; + + if ( info->WidgetName() == widgetName && + info->PublisherId() == publisherId ) + { + break; + } + } + + return info; + } + +// --------------------------------------------------------------------------- +// CXnEditor::TemplatedWidgetsL +// --------------------------------------------------------------------------- +// +void CXnEditor::TemplatedWidgetsL( 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() ); + + 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; + } + } + } + + 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 +// --------------------------------------------------------------------------- +// +TBool CXnEditor::ToggleWidgetsVisibiltyL() + { + RPointerArray< CXnPluginData >& plugins( + iViewManager.ActiveViewData().PluginData() ); + + TBool useEmpty( iViewManager.ActiveViewData().UseEmptyWidget() ); + + TBool stateChanged( EFalse ); + + for ( TInt i = 0; i < plugins.Count(); i++ ) + { + CXnPluginData* plugin( plugins[i] ); + + if( !plugin->Removable() ) + { + // Don't touch to non-removable widget + continue; + } + + if ( iWidgetsVisibilityState ) + { + // Currently visible, make invisible + stateChanged = ETrue; + + SetPropertyL( *plugin->Owner()->LayoutNode(), + XnPropertyNames::style::common::KVisibility, + XnPropertyNames::style::common::visibility::KHidden ); + } + else + { + // Currently invisible, make visible + if ( plugin->Occupied() ) + { + stateChanged = ETrue; + + SetPropertyL( *plugin->Owner()->LayoutNode(), + XnPropertyNames::style::common::KVisibility, + XnPropertyNames::style::common::visibility::KVisible ); + } + else if( useEmpty ) + { + stateChanged = ETrue; + + SetPropertyL( *plugin->Owner()->LayoutNode(), + XnPropertyNames::style::common::KVisibility, + XnPropertyNames::style::common::visibility::KBlank ); + } + } + } + + if ( stateChanged ) + { + // Update + iWidgetsVisibilityState = !iWidgetsVisibilityState; + } + + return iWidgetsVisibilityState; + } + +// --------------------------------------------------------------------------- +// CXnEditor::WidgetsVisible +// --------------------------------------------------------------------------- +// +TBool CXnEditor::WidgetsVisible() const + { + return iWidgetsVisibilityState; + } + +// --------------------------------------------------------------------------- +// CXnEditor::SetTargetPlugin +// --------------------------------------------------------------------------- +// +void CXnEditor::SetTargetPlugin( CXnNode* aNode ) + { + iTargetPlugin = aNode; + } + +// --------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// CXnEditor::NotifyViewActivatedL +// ----------------------------------------------------------------------------- +// +void CXnEditor::NotifyViewActivatedL( const CXnViewData& aViewData ) + { + RPointerArray< CXnPluginData >& plugins( aViewData.PluginData() ); + + TBool emptyInUse( aViewData.UseEmptyWidget() ); + TBool editState( iViewManager.UiEngine().EditMode()->EditState() ); + + iWidgetsVisibilityState = EFalse; + + for ( TInt i = 0; i < plugins.Count(); i++ ) + { + CXnPluginData* plugin( plugins[i] ); + + if ( plugin->Occupied() ) + { + // At least one widget visible + iWidgetsVisibilityState = ETrue; + } + + if ( plugin->Occupied() || editState ) + { + // Make widget visible + SetPropertyL( *plugin->Owner()->LayoutNode(), + XnPropertyNames::style::common::KVisibility, + XnPropertyNames::style::common::visibility::KVisible ); + } + else + { + if ( emptyInUse ) + { + // Make empty space blank + SetPropertyL( *plugin->Owner()->LayoutNode(), + XnPropertyNames::style::common::KVisibility, + XnPropertyNames::style::common::visibility::KBlank ); + } + else + { + // Nothing in this plugin hide + SetPropertyL( *plugin->Owner()->LayoutNode(), + XnPropertyNames::style::common::KDisplay, + XnPropertyNames::style::common::display::KNone ); + } + } + } + } + +// --------------------------------------------------------------------------- +// CXnEditor::NotifyConfigureWidgetL +// --------------------------------------------------------------------------- +// +void CXnEditor::NotifyConfigureWidgetL( const CHsContentInfo& aContentInfo, + CXnPluginData& aPluginData ) + { + if ( aContentInfo.Type() != KKeyTemplate ) + { + // Doesn't need configuration + return; + } + + const TDesC8& pluginId( aPluginData.PluginId() ); + + CHspsConfiguration* pluginConf( + iHspsWrapper->GetPluginConfigurationL( pluginId ) ); + + CleanupStack::PushL( pluginConf ); + + const CPublisherInfo* info = PublisherInfoL( aContentInfo ); + + __ASSERT_DEBUG( info != NULL, Panic( EXnInvalidPublisherInfo ) ); + if ( !info ) + { + User::Leave( KErrBadHandle ); + } + RPointerArray< CItemMap > itemMapListIn; + CleanupStack::PushL( TCleanupItem( DeleteItemMaps, &itemMapListIn ) ); + RPointerArray< CItemMap >& settings = pluginConf->Settings(); + + HBufC8* publisherId = CnvUtfConverter::ConvertFromUnicodeToUtf8L( + info->PublisherId() ); + CleanupStack::PushL( publisherId ); + + aPluginData.SetPublisherNameL( info->PublisherId() ); + + CItemMap* itemMap( 0 ); + CPropertyMap* property( 0 ); + CPropertyMap* propertyIn( 0 ); + + for ( TInt i = 0; i < settings.Count(); ++i ) + { + CItemMap* readItem = settings[i]; + itemMap = CItemMap::NewLC(); + itemMap->SetItemIdL( readItem->ItemId() ); + const TDesC8& itemName = readItem->ItemName(); + itemMap->SetItemNameL( itemName ); + + RPointerArray< CPropertyMap >& properties = readItem->Properties(); + for ( int j = 0; j < properties.Count(); ++j ) + { + property = properties[j]; + propertyIn = CPropertyMap::NewLC(); + propertyIn->SetNameL( property->Name() ); + // Dispatching is based on item name + if ( itemName == KContentSource() ) + { + propertyIn->SetValueL( *publisherId ); + } + else if ( itemName == KContentData() ) + { + // If this default template with full configuration + TInt pos = property->Value().LocateReverse( KSepratorChar ); + if ( KErrNotFound != pos ) + { + propertyIn->SetValueL( property->Value() ); + } + else + { + HBufC8* contentData = HBufC8::NewLC( publisherId->Length() + + KSeperator().Length() + + property->Value().Length()); + contentData->Des().Copy( *publisherId ); + contentData->Des().Append( KSeperator ); + contentData->Des().Append( property->Value() ); + propertyIn->SetValueL( *contentData ); + CleanupStack::PopAndDestroy( contentData ); + } + } + else if ( itemName.Find( KPublisher ) != KErrNotFound ) + { + propertyIn->SetValueL( *publisherId ); + } + else if ( !KPubTrigger().Compare( itemName ) ) + { + HBufC8* triggerData = HBufC8::NewLC( + publisherId->Length() + + KSeperator().Length() + + KPublisher().Length() + + KWidgetTriggerName().Length()); + triggerData->Des().Copy( *publisherId ); + triggerData->Des().Append( KSeperator ); + triggerData->Des().Append( KPublisher ); + triggerData->Des().Append( KWidgetTriggerName ); + + propertyIn->SetValueL( *triggerData ); + CleanupStack::PopAndDestroy( triggerData ); + } + else if ( !KTrigger().Compare( itemName ) ) + { + // If this default template with full configuration + TInt pos = property->Value().LocateReverse( KSepratorChar ); + if ( KErrNotFound != pos ) + { + propertyIn->SetValueL( property->Value() ); + } + else + { + HBufC8* triggerData = HBufC8::NewLC( + publisherId->Length() + + KSeperator().Length() + + property->Value().Length() + + KOpen().Length() + + property->Value().Length() + + KClose().Length() ); + triggerData->Des().Copy( *publisherId ); + triggerData->Des().Append( KSeperator ); + triggerData->Des().Append( property->Value() ); + triggerData->Des().Append( KOpen ); + triggerData->Des().Append( property->Value() ); + triggerData->Des().Append( KClose ); + propertyIn->SetValueL( *triggerData ); + CleanupStack::PopAndDestroy( triggerData ); + } + } + else + { + // unrecognized items are not handled + } + itemMap->AddPropertyMapL( propertyIn ); + CleanupStack::Pop( propertyIn ); + } + itemMapListIn.AppendL( itemMap ); + CleanupStack::Pop( itemMap ); + } + iHspsWrapper->SetPluginSettingsL( pluginId, itemMapListIn ); + + CleanupStack::PopAndDestroy( publisherId ); + CleanupStack::PopAndDestroy( &itemMapListIn ); + CleanupStack::PopAndDestroy( pluginConf ); + } + +// --------------------------------------------------------------------------- +// CXnEditor::NotifyWidgetAdditionL +// --------------------------------------------------------------------------- +// +void CXnEditor::NotifyWidgetAdditionL( const CXnPluginData& aPluginData ) + { + CXnNode* node( aPluginData.Owner()->LayoutNode() ); + + // At least one widget is visible + iWidgetsVisibilityState = ETrue; + + // Ensure the new widget is visible + SetPropertyL( *node, + XnPropertyNames::style::common::KVisibility, + XnPropertyNames::style::common::visibility::KVisible ); + + SetPropertyL( *node, + XnPropertyNames::style::common::KDisplay, + XnPropertyNames::style::common::display::KBlock ); + + node->SetDirtyL( XnDirtyLevel::ELayoutAndRenderSiblings ); + + WidgetListChanged(); + } + +// --------------------------------------------------------------------------- +// CXnEditor::NotifyWidgetRemovalL +// --------------------------------------------------------------------------- +// +void CXnEditor::NotifyWidgetRemovalL( const CXnPluginData& aPluginData ) + { + CXnNode* node( aPluginData.Owner()->LayoutNode() ); + + CXnViewData& viewData( + static_cast< CXnViewData& >( *aPluginData.Parent() ) ); + + TBool emptyInUse( viewData.UseEmptyWidget() ); + + if ( emptyInUse ) + { + if ( iViewManager.UiEngine().IsEditMode() ) + { + // Ensure the plugin which was holding + // the removed widget is visible when edit mode is active + SetPropertyL( *node, + XnPropertyNames::style::common::KVisibility, + XnPropertyNames::style::common::visibility::KVisible ); + } + else + { + // Ensure the plugin which was holding + // the removed widget is blank now + SetPropertyL( *node, + XnPropertyNames::style::common::KVisibility, + XnPropertyNames::style::common::visibility::KBlank ); + } + } + else + { + // Ensure the plugin which was holding the removed widget is invisible + SetPropertyL( *node, + XnPropertyNames::style::common::KDisplay, + XnPropertyNames::style::common::display::KNone ); + + // Reodred layout tree by moving the plugin which was holding the + // removed widget as the last one in layout tree's plugin the list + CXnNode *parent( node->Parent() ); + + RPointerArray< CXnNode >& children( parent->Children() ); + + TInt nodeIndex( children.Find( node ) ); + + children.Remove( nodeIndex ); + children.Insert( node, children.Count() - 1 ); + } + + node->SetDirtyL( XnDirtyLevel::ERender ); + + iTargetPlugin = NULL; + + if ( aPluginData.Active() ) + { + CXnViewData& viewData( iViewManager.ActiveViewData() ); + + RPointerArray< CXnPluginData >& plugins( viewData.PluginData() ); + + TBool occupied( EFalse ); + + for ( TInt i = 0; i < plugins.Count(); i++ ) + { + if ( plugins[i]->Occupied() && plugins[i]->Removable() ) + { + occupied = ETrue; + break; + } + } + + if ( !occupied ) + { + // No more widgets in the active view + iWidgetsVisibilityState = EFalse; + } + } + + WidgetListChanged(); + } + +// --------------------------------------------------------------------------- +// CXnEditor::NotifyViewAdditionL +// --------------------------------------------------------------------------- +// +void CXnEditor::NotifyViewAdditionL( const CXnPluginData& /*aPluginData*/ ) + { + ViewListChanged(); + } + +// --------------------------------------------------------------------------- +// CXnEditor::NotifyViewRemovalL +// --------------------------------------------------------------------------- +// +void CXnEditor::NotifyViewRemovalL( const CXnPluginData& /*aPluginData*/ ) + { + ViewListChanged(); + } + +// --------------------------------------------------------------------------- +// CXnEditor::NotifyWidgetUnregisteredL +// --------------------------------------------------------------------------- +// +void CXnEditor::NotifyWidgetUnregisteredL( const TDesC& aPublisher ) + { + RemoveUnRegisteredWidgetL( aPublisher ); + WidgetListChanged(); + } + +// --------------------------------------------------------------------------- +// CXnEditor::NotifyWidgetRegisteredL +// --------------------------------------------------------------------------- +// +void CXnEditor::NotifyWidgetRegisteredL() + { + WidgetListChanged(); + } + +// --------------------------------------------------------------------------- +// CXnEditor::NotifyViewDeactivatedL +// --------------------------------------------------------------------------- +// +void CXnEditor::NotifyViewDeactivatedL( const CXnViewData& /*aViewData*/) + { + } + +// --------------------------------------------------------------------------- +// CXnEditor::SetWallpaperL +// --------------------------------------------------------------------------- +// +void CXnEditor::SetWallpaperL() + { + // Display dialog + TInt selectedIndex( 0 ); + + CAknListQueryDialog* query = + new ( ELeave ) CAknListQueryDialog( &selectedIndex ); + CleanupStack::PushL( query ); + query->PrepareLC( R_LISTQUERY_CHANGE_WALLPAPER ); + + if ( query->RunLD() ) + { + if ( selectedIndex == 0 ) + { + // set wallpaper. No need to check return value. If successful, + // avkon calls SkinConfigurationChanged function + AknsWallpaperUtils::SetIdleWallpaper( + KNullDesC, + NULL ); + } + else if ( selectedIndex == 1 ) + { + iViewManager.AppUiAdapter().ActivateLocalViewL( KWallpaperViewUid, KDummyUid, KSingle ); + } + else if ( selectedIndex == 2 ) + { + iViewManager.AppUiAdapter().ActivateLocalViewL( KWallpaperViewUid, KDummyUid, KMulti ); + } + } + CleanupStack::Pop( query ); + } + +// ----------------------------------------------------------------------------- +// CXnEditor::HandleNotifyL +// Handles notifications from HSPS wrapper +// ----------------------------------------------------------------------------- +// +TInt CXnEditor::HandleNotifyL( + const TDesC8& aEvent, + const TDesC8& /*aAppConfUid*/, + const TDesC8& aPluginName, + 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( 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 ) + { + CHsContentInfo* info = CHsContentInfo::NewLC(); + + info->SetNameL( aPluginName ); + info->SetUidL( aPluginUid ); + info->SetPluginIdL( aPluginId ); + + RemoveUnInstalledWidgetL( *info ); + WidgetListChanged(); + + CleanupStack::PopAndDestroy( info ); + } + else if ( aEvent == KEventRootConfActivated ) + { + iViewManager.AppUiAdapter().ReloadUiL(); + } + else if ( aEvent == KEventPluginInstalled ) + { + WidgetListChanged(); + } + else if ( aEvent == KEventPluginUpdated ) + { + // If the plugin is in use then reload the widget + if ( aPluginId.Length() > 0 ) + { + CHsContentInfo* info = CHsContentInfo::NewLC(); + info->SetNameL( aPluginName ); + info->SetUidL( aPluginUid ); + info->SetPluginIdL( aPluginId ); + ReplaceWidgetL( *info ); + CleanupStack::PopAndDestroy( info ); + } + WidgetListChanged(); + } + else if ( aEvent == KEventPluginActivated ) + { + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CXnEditor::WidgetListChanged +// ----------------------------------------------------------------------------- +// +void CXnEditor::WidgetListChanged() + { + MHsContentControlUi* ui( + iViewManager.AppUiAdapter().HsContentController( KWMUi ) ); + + if( ui ) + { + ui->NotifyWidgetListChanged(); + } + MHsContentControl* srv( iViewManager.AppUiAdapter().HsContentControlSrv() ); + if ( srv ) + { + srv->NotifyWidgetListChanged(); + } + } + +// ----------------------------------------------------------------------------- +// CXnEditor::ViewListChanged +// ----------------------------------------------------------------------------- +// +void CXnEditor::ViewListChanged() + { + MHsContentControlUi* ui( + iViewManager.AppUiAdapter().HsContentController( KWMUi ) ); + + if( ui ) + { + ui->NotifyViewListChanged(); + } + MHsContentControl* srv( iViewManager.AppUiAdapter().HsContentControlSrv() ); + if ( srv ) + { + srv->NotifyViewListChanged(); + } + } + +// ----------------------------------------------------------------------------- +// CXnEditor::HspsWrapper +// ----------------------------------------------------------------------------- +// +CHspsWrapper& CXnEditor::HspsWrapper() const + { + return *iHspsWrapper; + } + +// ----------------------------------------------------------------------------- +// from MHsContentController +// ----------------------------------------------------------------------------- +// +TInt CXnEditor::WidgetListL( CHsContentInfoArray& aArray ) + { + RPointerArray< CHsContentInfo >& array( aArray.Array() ); + + // get installed widgets from HSPS (type: "widget") + HSPSPluginsL( array, KKeyWidget ); + // get installed widgets from HSPS + TemplatedWidgetsL( array ); + + FilterWidgetListL( aArray, EFalse ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// from MHsContentController +// ----------------------------------------------------------------------------- +// +TInt CXnEditor::ViewListL( CHsContentInfoArray& aArray ) + { + RPointerArray< CHsContentInfo >& array( aArray.Array() ); + + // get installed views from HSPS + HSPSPluginsL( array, KView ); + + FilterViewListL( aArray ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// from MHsContentController +// ----------------------------------------------------------------------------- +// +TInt CXnEditor::AppListL( CHsContentInfoArray& aArray ) + { + RPointerArray< CHsContentInfo >& array( aArray.Array() ); + + HSPSPluginsL( array, KApplication ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// from MHsContentController +// ----------------------------------------------------------------------------- +// +TInt CXnEditor::AddWidgetL( CHsContentInfo& aInfo ) + { + TInt ret( KErrNone ); + + const TDesC8& type( aInfo.Type() ); + + if ( ( type != KKeyWidget && type != KKeyTemplate ) || + aInfo.Uid() == KNullDesC8 ) + { + // malformed content info + return KErrArgument; + } + + if ( !aInfo.CanBeAdded() ) + { + // the widget can not be added. Return proper error code + if ( IsCurrentViewFull() ) + { + return KHsErrorViewFull; + } + else + { + return KHsErrorMaxInstanceCountExceeded; + } + } + + CXnPluginData* plugin( NULL ); + + if( iTargetPlugin ) + { + plugin = DeterminePlugin( iViewManager, iTargetPlugin ); + } + else + { + plugin = DeterminePlugin( iViewManager ); + } + + iTargetPlugin = NULL; + + if ( !plugin ) + { + return KErrGeneral; + } + + ret = iViewManager.LoadWidgetToPluginL( aInfo, *plugin ); + + if( ret == KErrNone ) + { + CXnNode* node( plugin->Owner()->LayoutNode() ); + TBool widgetOk( iViewManager.UiEngine().AnalyseAddedWidgetL( *node ) ); + + if( !widgetOk ) + { + iViewManager.UnloadWidgetFromPluginL( *plugin ); + + ret = KHsErrorDoesNotFit; + } + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// from MHsContentController +// ----------------------------------------------------------------------------- +// +TInt CXnEditor::RemoveWidgetL( CHsContentInfo& aInfo ) + { + if ( !aInfo.CanBeRemoved() || aInfo.PluginId() == KNullDesC8 || + ( aInfo.Type() != KKeyWidget && aInfo.Type() != KKeyTemplate ) ) + { + return KErrArgument; + } + + TInt retval( KErrNotFound ); + + RPointerArray< CXnPluginData > plugins; + CleanupClosePushL( plugins ); + + // Search only from active view + iViewManager.PluginDataL( plugins ); + + CXnPluginData* plugin( DeterminePlugin( plugins, aInfo ) ); + + if ( plugin && plugin->Removable() ) + { + retval = iViewManager.UnloadWidgetFromPluginL( *plugin ); + } + + CleanupStack::PopAndDestroy( &plugins ); + + return retval; + } + +// ----------------------------------------------------------------------------- +// from MHsContentController +// ----------------------------------------------------------------------------- +// +TInt CXnEditor::AddViewL( CHsContentInfo& aInfo ) + { + if ( !aInfo.CanBeAdded() || aInfo.Uid() == KNullDesC8 || + aInfo.Type() != KView ) + { + return KErrArgument; + } + + return iViewManager.AddViewL( aInfo ); + } + +// ----------------------------------------------------------------------------- +// from MHsContentController +// ----------------------------------------------------------------------------- +// +TInt CXnEditor::RemoveViewL( CHsContentInfo& aInfo ) + { + if ( !aInfo.CanBeRemoved() || aInfo.PluginId() == KNullDesC8 || + aInfo.Type() != KView ) + { + return KErrArgument; + } + + return iViewManager.RemoveViewL( aInfo ); + } + +// ----------------------------------------------------------------------------- +// from MHsContentController +// ----------------------------------------------------------------------------- +// +TInt CXnEditor::ActivateViewL( CHsContentInfo& aInfo ) + { + if ( aInfo.Type() != KView ) + { + return KErrArgument; + } + + return iViewManager.ActivateViewL( aInfo.PluginId() ); + } + +// ----------------------------------------------------------------------------- +// from MHsContentController +// ----------------------------------------------------------------------------- +// +TInt CXnEditor::ActivateAppL( CHsContentInfo& aInfo ) + { + if ( aInfo.Type() != KApplication ) + { + return KErrArgument; + } + + return iViewManager.ActivateAppL( aInfo.Uid() ); + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xneffectmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xneffectmanager.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,294 @@ +/* +* 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: Effect manager. +* +*/ + + +// INCLUDE FILES +#include "xneffectmanager.h" +#include "xnplugindata.h" +#include "xnviewdata.h" +#include "xnnode.h" +#include "xndomnode.h" +#include "xncontroladapter.h" + +// SYSTEM INCLUDE FILES +#include <eikapp.h> +#include <aknappui.h> +#include <gfxtranseffect/gfxtranseffect.h> // For transition effects +#include <akntranseffect.h> // For transition effects + +// CONSTANTS +const TInt KEffectTypeFullscreen = 1; +const TInt KEffectTypeControl = 2; + +const TInt KWaitForLayout = 1; +const TInt KEffectStarted = 2; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// C++ default constructor. +// ----------------------------------------------------------------------------- +// +CXnEffectManager::CXnEffectManager() + { + } + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CXnEffectManager::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnEffectManager* CXnEffectManager::NewL() + { + CXnEffectManager* self = new (ELeave) CXnEffectManager(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnEffectManager::~CXnEffectManager() + { + GfxTransEffect::AbortFullScreen(); + iEffects.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// CXnEffectManager::BeginControlEffectL +// ----------------------------------------------------------------------------- +// +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<CXnPluginData>& 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 ) + { + return; + } + + TXnEffect* effect = new (ELeave) TXnEffect; + CleanupStack::PushL( effect ); + effect->iId = aId; + effect->iType = KEffectTypeFullscreen; + effect->iNode = aView.ViewNode(); + iEffects.AppendL( effect ); + CleanupStack::Pop( effect ); + + if ( !aView.ViewNode()->IsLaidOut() ) + { + effect->iState = KWaitForLayout; + } + else + { + DoBeginFullscreenEffect( *effect ); + } + } + +// ----------------------------------------------------------------------------- +// CXnEffectManager::UiRendered +// ----------------------------------------------------------------------------- +// +void CXnEffectManager::UiRendered() + { + for ( TInt i = 0; i < iEffects.Count(); ) + { + TInt count = iEffects.Count(); // for debugging + 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() ); + } + RemoveEffect( effect ); + } + else + { + i++; + } + } + } + +// ----------------------------------------------------------------------------- +// CXnEffectManager::UiLayouted +// ----------------------------------------------------------------------------- +// +void CXnEffectManager::UiLayouted() + { + TInt count = iEffects.Count(); + for ( TInt i = 0; i < count; i++ ) + { + TXnEffect* effect = iEffects[i]; + if ( effect && effect->iNode && + effect->iState == KWaitForLayout && + effect->iNode->IsLaidOut()) + { + if ( effect->iType == KEffectTypeFullscreen ) + { + DoBeginFullscreenEffect( *effect ); + } + else if ( effect->iType == KEffectTypeControl ) + { + DoBeginControlEffect( *effect ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// CXnEffectManager::DoBeginFullscreenEffect +// ----------------------------------------------------------------------------- +// +void CXnEffectManager::DoBeginFullscreenEffect( TXnEffect& aEffect ) + { + CCoeEnv* coe( CCoeEnv::Static() ); + + if ( coe->WsSession().GetFocusWindowGroup() != + coe->RootWin().Identifier() ) + { + // Window group is not focused + RemoveEffect( &aEffect ); + return; + } + + const TInt flags( AknTransEffect::TParameter::EActivateExplicitCancel ); + const TUid targetAppUid( iAvkonAppUi->Application()->AppDllUid() ); + + // Set effect begin point + GfxTransEffect::BeginFullScreen( aEffect.iId , iAvkonAppUi->ClientRect(), + AknTransEffect::EParameterType, AknTransEffect::GfxTransParam( + targetAppUid, flags ) ); + + aEffect.iState = KEffectStarted; + } + +// ----------------------------------------------------------------------------- +// CXnEffectManager::DoBeginControlEffect +// ----------------------------------------------------------------------------- +// +void CXnEffectManager::DoBeginControlEffect( TXnEffect& aEffect ) + { + CCoeEnv* coe( CCoeEnv::Static() ); + + if ( coe->WsSession().GetFocusWindowGroup() != + coe->RootWin().Identifier() ) + { + // Window group is not focused + RemoveEffect( &aEffect ); + return; + } + + // Set effect begin point + if ( aEffect.iNode ) + { + GfxTransEffect::Begin( aEffect.iNode->Control() , aEffect.iId ); + aEffect.iState = KEffectStarted; + } + else + { + RemoveEffect( &aEffect ); + } + } + +// ----------------------------------------------------------------------------- +// CXnEffectManager::RemoveEffect +// ----------------------------------------------------------------------------- +// +void CXnEffectManager::RemoveEffect( TXnEffect* aEffect ) + { + TInt index = iEffects.Find( aEffect ); + if ( index != KErrNotFound ) + { + TXnEffect* temp = iEffects[index]; + iEffects.Remove( index ); + delete temp; + } + } + +// ----------------------------------------------------------------------------- +// 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 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnextrenderingpluginwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnextrenderingpluginwrapper.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,178 @@ +/* +* 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: External rendering plugin wrapper implementation +* +*/ + +// System include files + +// User include files +#include "xnextrenderingpluginwrapper.h" + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::NewL() +// ---------------------------------------------------------------------------- +// +CXnExtRenderingPluginWrapper* CXnExtRenderingPluginWrapper::NewL( + CXnNodePluginIf& aNode, CXnExtRenderingPluginAdapter& aAdapter ) + { + CXnExtRenderingPluginWrapper* self = new ( ELeave ) CXnExtRenderingPluginWrapper( aAdapter ); + CleanupStack::PushL( self ); + self->ConstructL( aNode ); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::ConstructL() +// ---------------------------------------------------------------------------- +// +void CXnExtRenderingPluginWrapper::ConstructL( CXnNodePluginIf& aNode ) + { + iNode = &aNode; + CXnControlAdapter::ConstructL( aNode ); + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::CXnExtRenderingPluginWrapper() +// ---------------------------------------------------------------------------- +// +CXnExtRenderingPluginWrapper::CXnExtRenderingPluginWrapper( CXnExtRenderingPluginAdapter& aAdapter ) + { + iAdapter = &aAdapter; + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::~CXnExtRenderingPluginWrapper() +// ---------------------------------------------------------------------------- +// +CXnExtRenderingPluginWrapper::~CXnExtRenderingPluginWrapper() + { + delete iAdapter; + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::CountComponentControls() +// ---------------------------------------------------------------------------- +// +TInt CXnExtRenderingPluginWrapper::CountComponentControls() const + { + return 1; + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::ComponentControl() +// ---------------------------------------------------------------------------- +// +CCoeControl* CXnExtRenderingPluginWrapper::ComponentControl( TInt aIndex ) const + { + if( aIndex == 0 ) + { + return iAdapter; + } + else + { + return NULL; + } + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::OfferKeyEventL() +// ---------------------------------------------------------------------------- +// +TKeyResponse CXnExtRenderingPluginWrapper::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) + { + return iAdapter->OfferKeyEventL( aKeyEvent, aType ); + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::SizeChanged() +// ---------------------------------------------------------------------------- +// +void CXnExtRenderingPluginWrapper::SizeChanged() + { + iAdapter->SetRect( iNode->Rect() ); + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::SkinChanged() +// ---------------------------------------------------------------------------- +// +void CXnExtRenderingPluginWrapper::SkinChanged() + { + CXnControlAdapter::SkinChanged(); + iAdapter->SkinChanged(); + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::SetContainerWindowL() +// ---------------------------------------------------------------------------- +// +void CXnExtRenderingPluginWrapper::SetContainerWindowL(const CCoeControl& aContainer) + { + CXnControlAdapter::SetContainerWindowL( aContainer ); + iAdapter->SetContainerWindowL( *this ); + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::MakeVisible() +// ---------------------------------------------------------------------------- +// +void CXnExtRenderingPluginWrapper::MakeVisible( TBool aVisible ) + { + CXnControlAdapter::MakeVisible( aVisible ); + iAdapter->MakeVisible( aVisible ); + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::FocusChanged() +// ---------------------------------------------------------------------------- +// +void CXnExtRenderingPluginWrapper::FocusChanged( TDrawNow aDrawNow ) + { + CXnControlAdapter::FocusChanged( aDrawNow ); + iAdapter->FocusChanged( aDrawNow ); + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::HandleScreenDeviceChangedL() +// ---------------------------------------------------------------------------- +// +void CXnExtRenderingPluginWrapper::HandleScreenDeviceChangedL() + { + CXnControlAdapter::HandleScreenDeviceChangedL(); + iAdapter->HandleResourceChange( KEikDynamicLayoutVariantSwitch ); + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::DoEnterPowerSaveModeL() +// ---------------------------------------------------------------------------- +// +void CXnExtRenderingPluginWrapper::DoEnterPowerSaveModeL( TModeEvent /*aEvent*/ ) + { + iAdapter->EnterPowerSaveModeL(); + } + +// ---------------------------------------------------------------------------- +// CXnExtRenderingPluginWrapper::DoExitPowerSaveModeL() +// ---------------------------------------------------------------------------- +// +void CXnExtRenderingPluginWrapper::DoExitPowerSaveModeL( TModeEvent /*aEvent*/ ) + { + iAdapter->ExitPowerSaveModeL(); + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnfocuscontrol.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnfocuscontrol.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,211 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Focus appearance drawer +* +*/ + +// System includes +#include <AknsDrawUtils.h> +#include <AknsUtils.h> +#include <AknsItemID.h> + +// User includes +#include "xncontroladapter.h" +#include "xnproperty.h" +#include "xnappuiadapter.h" +#include "xnuiengine.h" +#include "xnnode.h" +#include "xninactivitymonitor.h" + +#include "xnfocuscontrol.h" + +// Constants +const TInt KSkinGfxInnerRectShrink( 5 ); + +// ============================ LOCAL FUNCTIONS ================================ + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CXnFocusControl::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnFocusControl* CXnFocusControl::NewL( CXnAppUiAdapter& aAppUiAdapter ) + { + CXnFocusControl* self = CXnFocusControl::NewLC( aAppUiAdapter ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnFocusControl::NewLC() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnFocusControl* CXnFocusControl::NewLC( CXnAppUiAdapter& aAppUiAdapter ) + { + CXnFocusControl* self = new ( ELeave ) CXnFocusControl( aAppUiAdapter ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnFocusControl::~CXnFocusControl() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +CXnFocusControl::~CXnFocusControl() + { + delete iMonitor; + } + +// ----------------------------------------------------------------------------- +// CXnFocusControl::CXnFocusControl() +// C++ default constructor. +// ----------------------------------------------------------------------------- +// +CXnFocusControl::CXnFocusControl( CXnAppUiAdapter& aAppUiAdapter ) + : iAppUiAdapter( aAppUiAdapter ) + { + } + +// ----------------------------------------------------------------------------- +// CXnFocusControl::ConstructL() +// 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CXnFocusControl::ConstructL() + { + iMonitor = CXnInactivityMonitor::NewL( *this ); + } + +// ----------------------------------------------------------------------------- +// CXnFocusControl::InactivityTimerExpired() +// +// ----------------------------------------------------------------------------- +// +void CXnFocusControl::InactivityTimerExpired() + { + MakeVisible( EFalse ); + } + +// ----------------------------------------------------------------------------- +// CXnFocusControl::MakeVisible() +// +// ----------------------------------------------------------------------------- +// +void CXnFocusControl::MakeVisible( TBool aVisible ) + { + TRAP_IGNORE( DoMakeVisibleL( aVisible ) ); + } + +// ----------------------------------------------------------------------------- +// CXnFocusControl::DoMakeVisibleL() +// +// ----------------------------------------------------------------------------- +// +void CXnFocusControl::DoMakeVisibleL( TBool aVisible ) + { + if ( aVisible != iVisible ) + { + if ( !aVisible ) + { + iVisible = aVisible; + + iRefused = EFalse; + + iMonitor->Stop(); + + CXnNode* node( iAppUiAdapter.UiEngine().FocusedNode() ); + + if ( node ) + { + CXnControlAdapter* control( node->Control() ); + + if ( control && control->RefusesFocusLoss() ) + { + // Need to keep drawing focus appearance + iRefused = ETrue; + + node->UnsetStateL( + XnPropertyNames::style::common::KPressedDown ); + } + else + { + node->UnsetStateL( + XnPropertyNames::style::common::KFocus ); + } + + iAppUiAdapter.UiEngine().RenderUIL(); + } + } + else + { + iRefused = EFalse; + + iVisible = aVisible; + + iMonitor->Start(); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnFocusControl::IsVisible() +// +// ----------------------------------------------------------------------------- +// +TBool CXnFocusControl::IsVisible() const + { + return iVisible; + } + +// ----------------------------------------------------------------------------- +// CXnFocusControl::Draw() +// +// ----------------------------------------------------------------------------- +// +void CXnFocusControl::Draw( const TRect& aRect, CWindowGc& aGc ) const + { + if ( IsVisible() || iRefused ) + { + CXnNode* node( iAppUiAdapter.UiEngine().FocusedNode() ); + + if ( node ) + { + TRect innerRect( aRect ); + + innerRect.Shrink( + KSkinGfxInnerRectShrink, KSkinGfxInnerRectShrink ); + + MAknsSkinInstance* skin( AknsUtils::SkinInstance() ); + + if ( node->IsStateSet( XnPropertyNames::style::common::KPressedDown ) ) + { + AknsDrawUtils::DrawFrame( skin, aGc, aRect, innerRect, + KAknsIIDQsnFrHomePressed, KAknsIIDDefault ); + } + + if ( node->IsStateSet( XnPropertyNames::style::common::KFocus ) ) + { + AknsDrawUtils::DrawFrame( skin, aGc, aRect, innerRect, + KAknsIIDQsnFrHome, KAknsIIDDefault ); + } + } + } + } + +// End of file + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xngesture.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xngesture.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,752 @@ +/* +* 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 <e32math.h> + +#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 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xngesturehelper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xngesturehelper.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,420 @@ +/* +* 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 <e32base.h> +#include <w32std.h> + +// 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 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xngesturerecogniser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xngesturerecogniser.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,228 @@ +/* +* 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 <e32math.h> + +#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 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnhittest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnhittest.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,193 @@ +/* +* 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 <e32base.h> + +#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 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xninactivitymonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xninactivitymonitor.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,121 @@ +/* +* 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: Inactivity Monitor +* +*/ + +// System includes + +// User includes +#include "xninactivitymonitor.h" + +// Constants +const TInt KInactivityInterval( 6 ); + +// ============================ LOCAL FUNCTIONS ================================ + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CXnInactivityMonitor::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnInactivityMonitor* CXnInactivityMonitor::NewL( + MXnInactivityObserver& aObserver ) + { + CXnInactivityMonitor* self = CXnInactivityMonitor::NewLC( aObserver ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnInactivityMonitor::NewLC() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnInactivityMonitor* CXnInactivityMonitor::NewLC( + MXnInactivityObserver& aObserver ) + { + CXnInactivityMonitor* self = + new ( ELeave ) CXnInactivityMonitor( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnInactivityMonitor::~CXnInactivityMonitor() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +CXnInactivityMonitor::~CXnInactivityMonitor() + { + Stop(); + } + +// ----------------------------------------------------------------------------- +// CXnInactivityMonitor::CXnInactivityMonitor() +// C++ default constructor. +// ----------------------------------------------------------------------------- +// +CXnInactivityMonitor::CXnInactivityMonitor( MXnInactivityObserver& aObserver ) + : CTimer( CActive::EPriorityStandard ), iObserver( aObserver ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CXnInactivityMonitor::ConstructL() +// 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CXnInactivityMonitor::ConstructL() + { + CTimer::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// CXnInactivityMonitor::RunL() +// +// ----------------------------------------------------------------------------- +// +void CXnInactivityMonitor::RunL() + { + iObserver.InactivityTimerExpired(); + } + +// ----------------------------------------------------------------------------- +// CXnInactivityMonitor::Start() +// +// ----------------------------------------------------------------------------- +// +void CXnInactivityMonitor::Start() + { + Cancel(); + + Inactivity( KInactivityInterval ); + } + +// ----------------------------------------------------------------------------- +// CXnInactivityMonitor::Stop() +// +// ----------------------------------------------------------------------------- +// +void CXnInactivityMonitor::Stop() + { + Cancel(); + } + +// End of file + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnkeyeventdispatcher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnkeyeventdispatcher.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,724 @@ +/* +* 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: Event dispatcher +* +*/ + +// System includes +#include <AknUtils.h> + +// User includes +#include "xnappuiadapter.h" +#include "xnfocuscontrol.h" +#include "xnkeyeventdispatcher.h" +#include "xntype.h" +#include "xncomponentnodeimpl.h" +#include "xnproperty.h" +#include "xnuiengine.h" +#include "xnodt.h" +#include "xndomdocument.h" +#include "xndomnode.h" +#include "xnmenuadapter.h" +#include "xneditmode.h" +#include "xnviewmanager.h" +#include "xnviewdata.h" +#include "xnnode.h" + +// Local macros +#define IS_ARROW_KEY( k ) \ + ( k == EStdKeyLeftArrow || k == EStdKeyRightArrow || \ + k == EStdKeyUpArrow || k == EStdKeyDownArrow ) + +// ----------------------------------------------------------------------------- +// SetInitialFocusL +// ----------------------------------------------------------------------------- +// +static void SetInitialFocusL( RPointerArray< CXnNode >& aArray ) + { + for ( TInt i = 0; i < aArray.Count(); i++ ) + { + CXnNode* node( aArray[i] ); + + node->SetStateWithoutNotificationL( + XnPropertyNames::style::common::KFocus ); + + if ( node->IsStateSet( XnPropertyNames::style::common::KFocus ) ) + { + break; + } + } + } + +// ----------------------------------------------------------------------------- +// BuildTriggerNodeL +// Builds a trigger node +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildTriggerNodeL( + CXnUiEngine& aUiEngine, + const TDesC8& aTriggerName ) + { + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + + CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger ); + CleanupStack::PushL( type ); + + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + + CleanupStack::Pop( type ); + + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + + CXnDomPropertyValue* nameValue = + CXnDomPropertyValue::NewL( aUiEngine.ODT()->DomDocument().StringPool() ); + + CleanupStack::PushL( nameValue ); + + nameValue->SetStringValueL( CXnDomPropertyValue::EString, aTriggerName ); + + CXnProperty* name = + CXnProperty::NewL( XnPropertyNames::action::trigger::KName, nameValue, + aUiEngine.ODT()->DomDocument().StringPool() ); + + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + node->SetPropertyL( name ); + CleanupStack::Pop( name ); + + CleanupStack::Pop( node ); + + return node; + } + +// ----------------------------------------------------------------------------- +// MenuAdapter +// Gets menuadapter from node, NULL if not available +// ----------------------------------------------------------------------------- +// +static CXnMenuAdapter* MenuAdapter( CXnNode* aNode ) + { + if ( aNode ) + { + return static_cast< CXnMenuAdapter* >( aNode->Control() ); + } + + return NULL; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::NewL +// Two-phased constructor. Can leave. +// ----------------------------------------------------------------------------- +// +CXnKeyEventDispatcher* CXnKeyEventDispatcher::NewL( CXnUiEngine& aUiEngine ) + { + CXnKeyEventDispatcher* self = new ( ELeave ) CXnKeyEventDispatcher( aUiEngine ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::~CXnKeyEventDispatcher +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnKeyEventDispatcher::~CXnKeyEventDispatcher() + { + iCoeEnv->RemoveMessageMonitorObserver( *this ); + + iUiEngine.ViewManager()->RemoveObserver( *this ); + + delete iLoseFocus; + delete iGainFocus; + iPassiveFocusedNodes.Reset(); + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::CXnKeyEventDispatcher +// C++ default constructor. Must not leave. +// ----------------------------------------------------------------------------- +// +CXnKeyEventDispatcher::CXnKeyEventDispatcher( CXnUiEngine& aUiEngine ) + : iUiEngine( aUiEngine ) + { + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::ConstructL +// 2nd phase constructor. Can leave. +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::ConstructL() + { + MakeVisible( EFalse ); + + iUiEngine.ViewManager()->AddObserver( *this ); + + iCoeEnv->AddMessageMonitorObserverL( *this ); + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::MonitorWsMessage +// +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::MonitorWsMessage( const TWsEvent& aEvent ) + { + TInt type( aEvent.Type() ); + + if ( type == EEventPointer && AknLayoutUtils::PenEnabled() ) + { + const TUint handle( aEvent.Handle() ); + + CCoeControl* destination = reinterpret_cast< CCoeControl* >( handle ); + + TPointerEvent& event( *aEvent.Pointer() ); + + if ( iCbaContainer ) + { + CEikCba* cba = + static_cast< CEikCba* >( iCbaContainer->ButtonGroup() ); + + if ( destination == cba && iCbaContainer->IsVisible() ) + { + CXnMenuAdapter* adapter( MenuAdapter( iMenuNode ) ); + + if ( adapter ) + { + TRAP_IGNORE( + adapter->HandlePointerEventL( *aEvent.Pointer() ) ); + } + } + } + } + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::OfferKeyEventL +// Handles key events. +// ----------------------------------------------------------------------------- +// +TKeyResponse CXnKeyEventDispatcher::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + TKeyResponse resp( EKeyWasNotConsumed ); + + iEventCode = aType; + + CXnNode* node( NULL ); + + TBool keyYesNoApps( EFalse ); + + if ( iUiEngine.IsMenuDisplaying() || + aKeyEvent.iScanCode == EStdKeyDevice0 || + aKeyEvent.iScanCode == EStdKeyDevice1 ) + { + iFocusChanged = EFalse; + // 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 + node = iMenuNode; + } + else if ( aKeyEvent.iScanCode == EStdKeyApplication0 || + aKeyEvent.iScanCode == EStdKeyYes || + aKeyEvent.iScanCode == EStdKeyNo ) + { + 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 + node = ( !iNode ) ? iUiEngine.ActiveView() : iNode; + } + else + { + CXnAppUiAdapter& appui( iUiEngine.AppUiAdapter() ); + + if ( IS_ARROW_KEY( aKeyEvent.iScanCode ) && aType == EEventKey ) + { + if ( !appui.FocusShown() ) + { + appui.ShowFocus(); + + if ( !iNode ) + { + // Find initial location for focus + ResolveAndSetFocusL(); + + return EKeyWasConsumed; + } + } + } + + CCoeControl* editmode( iUiEngine.EditMode() ); + + if ( editmode->OfferKeyEventL( aKeyEvent, aType ) == EKeyWasConsumed ) + { + return EKeyWasConsumed; + } + + // Offer keyevent to the focused node + node = iNode; + + if ( aType == EEventKeyDown ) + { + // Reset state + iFocusChanged = EFalse; + iKeyEventNode = iNode; + } + + if ( iFocusChanged && ( aType == EEventKeyUp ) ) + { + // Pass keyup event to + // previously focused node + node = iKeyEventNode; + } + } + + if ( !keyYesNoApps ) + { + if ( iEventCode == EEventNull && aType != EEventKeyDown ) + { + // We are waiting for down event + return resp; + } + } + + if ( !node ) + { + return resp; + } + + iUiEngine.DisableRenderUiLC(); + + CXnControlAdapter* adapter( node->Control() ); + + if( adapter && adapter->IsVisible() ) + { + resp = adapter->OfferKeyEventL( aKeyEvent, aType ); + } + + if ( aType != EEventKeyUp && iKeyEventNode != iNode ) + { + // Focused node is changed during keyevent + iFocusChanged = ETrue; + } + + if ( aType == EEventKeyUp ) + { + iEventCode = EEventNull; + } + + iUiEngine.RenderUIL(); + CleanupStack::PopAndDestroy(); // DisableRenderUiLC + + return resp; + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::SetNode +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::SetNodeL( CXnNode* aNode, TInt aSource ) + { + if ( iNode == aNode ) + { + return; + } + + iPreviousNode = iNode; + iNode = aNode; + + SetNodeL( iPreviousNode, iNode, ETrue, aSource ); + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::SetNodeWithoutNotificationL +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::SetNodeWithoutNotificationL( CXnNode* aNode ) + { + if ( iNode == aNode ) + { + return; + } + + iPreviousNode = iNode; + iNode = aNode; + + SetNodeL( iPreviousNode, iNode, EFalse ); + } + +// ----------------------------------------------------------------------------- +// SetNodeL +// Changes focused node, runs gain focus/lose focus triggers if needed +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::SetNodeL( CXnNode* aToLose, CXnNode* aToGain, + TBool aNotify, TInt aSource ) + { + if ( aToLose ) + { + aToLose->SetDirtyL( XnDirtyLevel::ERender ); + + aToLose->UnsetStateL( XnPropertyNames::style::common::KFocus ); + aToLose->UnsetStateL( XnPropertyNames::style::common::KHold ); + aToLose->UnsetStateL( XnPropertyNames::style::common::KActive ); + + if ( aNotify ) + { + if ( !iLoseFocus ) + { + iLoseFocus = BuildTriggerNodeL( iUiEngine, + XnPropertyNames::action::trigger::name::KLoseFocus ); + } + + aToLose->ReportXuikonEventL( *iLoseFocus ); + } + + CXnControlAdapter* adapter( aToLose->Control() ); + + if ( adapter ) + { + adapter->SetFocus( EFalse ); + } + } + + if ( aToGain ) + { + aToGain->SetDirtyL( XnDirtyLevel::ERender ); + + if ( aNotify ) + { + if ( !iGainFocus ) + { + iGainFocus = BuildTriggerNodeL( iUiEngine, + XnPropertyNames::action::trigger::name::KGainFocus ); + } + + aToGain->ReportXuikonEventL( *iGainFocus, aSource ); + } + + CXnControlAdapter* adapter( aToGain->Control() ); + + if ( adapter ) + { + adapter->SetFocus( ETrue ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::FocusedNode +// ----------------------------------------------------------------------------- +// +CXnNode* CXnKeyEventDispatcher::FocusedNode() const + { + if ( iNode && iNode->IsStateSet( XnPropertyNames::style::common::KFocus ) ) + { + return iNode; + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::RefreshMenu +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::RefreshMenuL() + { + CXnMenuAdapter* menuAdapter( MenuAdapter( iMenuNode ) ); + + if ( menuAdapter ) + { + menuAdapter->SetContainerL( *iCbaContainer ); + } + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::SetMenuNode +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::SetMenuNodeL( CXnNode* aNode ) + { + CXnMenuAdapter* menuAdapter( MenuAdapter( aNode ) ); + + iCbaContainer = iAvkonAppUi->Cba(); + + if ( menuAdapter ) + { + iMenuNode = aNode; + + menuAdapter->SetContainerL( *iCbaContainer ); + + CXnProperty* prop( iMenuNode->DisplayL() ); + + if ( prop && prop->StringValue() == + XnPropertyNames::style::common::display::KNone ) + { + iCbaContainer->MakeVisible( EFalse ); + } + else + { + iCbaContainer->MakeVisible( ETrue ); + } + } + else + { + iCbaContainer->MakeVisible( EFalse ); + + // The node passed in wasn't a valid menu node + ResetMenuNodeL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::ResetMenuNodeL +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::ResetMenuNodeL() + { + iMenuNode = NULL; + + iCbaContainer = NULL; + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::IsMenuFocused +// ----------------------------------------------------------------------------- +// +TBool CXnKeyEventDispatcher::IsMenuFocused() const + { + CXnMenuAdapter* menuAdapter( MenuAdapter( iMenuNode ) ); + + if ( menuAdapter ) + { + return menuAdapter->IsMenuFocused(); + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::AddPassiveFocusedNode +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::AddPassiveFocusedNodeL( CXnNode* aNode ) + { + if ( !aNode->IsStateSet( XnPropertyNames::style::common::KFocus ) && + !aNode->IsStateSet( XnPropertyNames::style::common::KPassiveFocus ) ) + { + iPassiveFocusedNodes.AppendL( aNode ); + aNode->SetStateL( XnPropertyNames::style::common::KPassiveFocus ); + } + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::RemovePassiveFocusedNode +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::RemovePassiveFocusedNodeL( CXnNode* aNode ) + { + for ( TInt i = 0; i < iPassiveFocusedNodes.Count(); i++ ) + { + CXnNode* node( iPassiveFocusedNodes[i] ); + + if ( node == aNode ) + { + iPassiveFocusedNodes.Remove( i ); + + aNode->UnsetStateL( + XnPropertyNames::style::common::KPassiveFocus ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::AddPassiveFocusedNode +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::ClearPassiveFocusedNodesL() + { + for ( TInt i = 0; i < iPassiveFocusedNodes.Count(); i++ ) + { + iPassiveFocusedNodes[i]->UnsetStateL( + XnPropertyNames::style::common::KPassiveFocus ); + } + + iPassiveFocusedNodes.Reset(); + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::NotifyViewActivatedL +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::NotifyViewActivatedL( + const CXnViewData& /*aViewData*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::NotifyViewDeactivatedL +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::NotifyViewDeactivatedL( + const CXnViewData& /*aViewData*/ ) + { + iMenuNode = NULL; + ClearPassiveFocusedNodesL(); + ClearStateL(); + + iUiEngine.AppUiAdapter().HideFocus(); + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::NotifyWidgetAdditionL +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::NotifyWidgetAdditionL( + const CXnPluginData& aPluginData ) + { + if ( aPluginData.Active() ) + { + iUiEngine.AppUiAdapter().ShowFocus(); + + RPointerArray< CXnNode > initial; + CleanupClosePushL( initial ); + + if ( iUiEngine.IsEditMode() ) + { + initial.AppendL( aPluginData.Owner()->LayoutNode() ); + } + else + { + aPluginData.InitialFocusNodesL( initial ); + } + + SetInitialFocusL( initial ); + + CleanupStack::PopAndDestroy( &initial ); + } + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::NotifyWidgetRemovalL +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::NotifyWidgetRemovalL( + const CXnPluginData& aPluginData ) + { + if ( aPluginData.Active() ) + { + ClearPassiveFocusedNodesL(); + + if ( iNode ) + { + CXnViewData& activeViewData( + iUiEngine.ViewManager()->ActiveViewData() ); + + const CXnPluginData& pluginData( + activeViewData.Plugin( iNode ) ); + + if ( &pluginData == &aPluginData ) + { + // The plugin is removed which was holding focus + ClearStateL(); + } + } + } + } + +// ----------------------------------------------------------------------------- +// CCXnKeyEventDispatcher::NotifyConfigureWidgetL +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::NotifyConfigureWidgetL( + const CHsContentInfo& /*aContentInfo*/, CXnPluginData& /*aPluginData*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::ResolveAndSetFocusL +// Used to bring focus visible in the initial location when focus is invisible +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::ResolveAndSetFocusL() + { + // <plugin> elements are always kept in appearance order + RPointerArray< CXnNode >& list( *iUiEngine.Plugins() ); + + if ( iUiEngine.IsEditMode() ) + { + SetInitialFocusL( list ); + } + else + { + RPointerArray< CXnNode > initial; + CleanupClosePushL( initial ); + + CXnViewData& activeView( iUiEngine.ViewManager()->ActiveViewData() ); + + // 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() ) + { + plugin.InitialFocusNodesL( initial ); + } + } + + // if no inital focus nodes were found in plugins with + // open popups, search again with all plugins + if ( initial.Count() == 0 ) + { + for ( TInt i = 0; i < list.Count(); i++ ) + { + CXnPluginData& plugin( activeView.Plugin( list[i] ) ); + plugin.InitialFocusNodesL( initial ); + } + } + + // set initial focus + SetInitialFocusL( initial ); + + CleanupStack::PopAndDestroy( &initial ); + } + } + +// ----------------------------------------------------------------------------- +// CXnKeyEventDispatcher::ClearStateL +// ----------------------------------------------------------------------------- +// +void CXnKeyEventDispatcher::ClearStateL() + { + SetNodeL( NULL ); + + iNode = NULL; + iPreviousNode = NULL; + iKeyEventNode = NULL; + iFocusChanged = EFalse; + iEventCode = EEventNull; + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnlistquerydialogadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnlistquerydialogadapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,362 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: List query dialog adapter and data interface +* +*/ + + +// System includes +#include <e32base.h> +#include <aknlistquerydialog.h> +#include <utf.h> +#include <xnuiengine.rsg> + +// User includes +#include "xnappuiadapter.h" +#include "xnlistquerydialogadapter.h" +#include "xnnodepluginif.h" +#include "xntype.h" +#include "xnproperty.h" +#include "xnuiengine.h" +#include "xnodt.h" +#include "xndomdocument.h" +#include "xndomnode.h" +#include "xndomlist.h" +#include "xndomattribute.h" + +// ======== LOCAL FUNCTIONS ======== +// --------------------------------------------------------------------------- +// Finds recursively node by type +// @return returns pointer to desired node, NULL if nothing found +// --------------------------------------------------------------------------- +// +CXnDomNode* FindNodeByType( CXnDomNode* aNode, const TDesC8& aName ) + { + if ( aNode == NULL ) + { + return NULL; + } + + if ( aNode->Name() == aName ) + { + return aNode; + } + + CXnDomList& list( aNode->ChildNodes() ); + + for ( TInt i = 0; i < list.Length() ; i++ ) + { + CXnDomNode* retval( FindNodeByType( + static_cast< CXnDomNode* >( list.Item( i ) ), aName ) ); + + if ( retval ) + { + return retval; + } + } + + return NULL; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnListQueryDialog* CXnListQueryDialog::NewL() + { + CXnListQueryDialog* self = new( ELeave ) CXnListQueryDialog; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnListQueryDialog::ConstructL() + { + CXnComponent::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnListQueryDialog::CXnListQueryDialog() + { + } + +// ----------------------------------------------------------------------------- +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnListQueryDialog::~CXnListQueryDialog() + { + } + +// --------------------------------------------------------- +// Replaces or appends item into list +// --------------------------------------------------------- +// +void CXnListQueryDialog::ReplaceItemL( const TDesC& aText, TInt aIndex ) + { + (static_cast<CXnListQueryDialogAdapter*>(ControlAdapter()))->ReplaceItemL( aText, aIndex ); + } + +// --------------------------------------------------------- +// Inserts or appends item into list +// --------------------------------------------------------- +// +void CXnListQueryDialog::InsertItemL( const TDesC& aText, TInt aIndex ) + { + (static_cast<CXnListQueryDialogAdapter*>(ControlAdapter()))->InsertItemL( aText, aIndex ); + } + +// --------------------------------------------------------- +// Deletes item from the list +// --------------------------------------------------------- +// +void CXnListQueryDialog::DeleteItem( TInt aIndex ) + { + return (static_cast<CXnListQueryDialogAdapter*>(ControlAdapter()))->DeleteItem( aIndex ); + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +XnComponentInterface::MXnComponentInterface* CXnListQueryDialog::MakeInterfaceL(const TDesC8& aType) + { + if (aType != XnListQueryDialogInterface::KType) + { + return NULL; + } + XnListQueryDialogInterface::MXnListQueryDialogInterface* interface = + static_cast<XnListQueryDialogInterface::MXnListQueryDialogInterface*>( this ); + return interface; + } + + +// ----------------------------------------------------------------------------- +// Two-phased constructor. Can leave. +// ----------------------------------------------------------------------------- +// +CXnListQueryDialogAdapter* CXnListQueryDialogAdapter::NewL( CXnNodePluginIf& aNode ) + { + CXnListQueryDialogAdapter* self = + new ( ELeave ) CXnListQueryDialogAdapter( aNode ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnListQueryDialogAdapter::~CXnListQueryDialogAdapter() + { + delete iItemArray; + iStaticItems.Close(); + } + +// ----------------------------------------------------------------------------- +// C++ default constructor. Must not leave. +// ----------------------------------------------------------------------------- +// +CXnListQueryDialogAdapter::CXnListQueryDialogAdapter( CXnNodePluginIf& aNode ) + : iNode( aNode ) + { + } + +// ----------------------------------------------------------------------------- +// 2nd phase constructor. Can leave. +// ----------------------------------------------------------------------------- +// +void CXnListQueryDialogAdapter::ConstructL() + { + CXnControlAdapter::ConstructL( iNode ); + iItemArray = new ( ELeave ) CDesCArrayFlat( 8 ); + // find normal menu items and dynamic menu items + // Only one dynamic item allowed + RPointerArray< CXnNodePluginIf > children( iNode.ChildrenL() ); + CleanupClosePushL( children ); + for ( TInt i = 0; i < children.Count(); i++ ) + { + CXnNodePluginIf* node( children[i] ); + if ( node->Type()->Type() == XnPropertyNames::menu::KMenuItem) + { + iStaticItems.AppendL( node ); + CXnProperty* labelProp = node->GetPropertyL( XnPropertyNames::menu::KLabel ); + if( labelProp ) + { + HBufC* label( labelProp->StringValueL()); + CleanupStack::PushL( label ); + iItemArray->AppendL( *label ); + CleanupStack::PopAndDestroy( label ); + } + } + else if( node->Type()->Type() == XnPropertyNames::menu::KDynMenuItem ) + { + iDynamicItem = node; + } + } + CleanupStack::PopAndDestroy( &children ); + } + +// ----------------------------------------------------------------------------- +// Replaces or appends item into list +// ----------------------------------------------------------------------------- +// +void CXnListQueryDialogAdapter::ReplaceItemL(const TDesC& aText, TInt aIndex ) + { + aIndex += iStaticItems.Count(); + TInt count( iItemArray->Count()); + if( aIndex >= count ) + { + iItemArray->AppendL( aText ); + } + else + { + iItemArray->Delete( aIndex ); + iItemArray->InsertL( aIndex, aText ); + } + } + +// ----------------------------------------------------------------------------- +// Inserts or appends item into list +// ----------------------------------------------------------------------------- +// +void CXnListQueryDialogAdapter::InsertItemL(const TDesC& aText, TInt aIndex ) + { + aIndex += iStaticItems.Count(); + TInt count( iItemArray->Count()); + if( count < aIndex ) + { + aIndex = count; + } + iItemArray->InsertL( aIndex, aText ); + } + +// ----------------------------------------------------------------------------- +// Deletes item from the list +// ----------------------------------------------------------------------------- +// +void CXnListQueryDialogAdapter::DeleteItem( TInt aIndex ) + { + aIndex += iStaticItems.Count(); + if( aIndex < iItemArray->Count()) + { + iItemArray->Delete( aIndex ); + } + } + +// ----------------------------------------------------------------------------- +// Displays the list query dialog +// ----------------------------------------------------------------------------- +// +void CXnListQueryDialogAdapter::TryDisplayingDialogL( ) + { + CXnAppUiAdapter& appui( static_cast< CXnAppUiAdapter& >( *iAvkonAppUi ) ); + + appui.HideFocus(); + + TInt selectedIndex( 0 ); + + CAknListQueryDialog* query = + new ( ELeave ) CAknListQueryDialog( &selectedIndex ); + + query->PrepareLC( R_XML_LISTQUERY ); +/* Not tested + CAknPopupHeadingPane* heading( query->QueryHeading() ); + if ( heading ) + { + CXnProperty* prop( iNode.GetPropertyL( + XnPropertyNames::listquerydialog::KS60Heading ) ); + + if ( prop ) + { + HBufC* header( prop->StringValueL() ); + CleanupStack::Push( header ); + heading->SetTextL( *header ); + CleanupStack::PopAndDestroy( header ); + } + else + { + heading->SetTextL( KNullDesC() ); + } + } +*/ + query->SetItemTextArray( iItemArray ); + query->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + if ( query->RunLD() ) + { + ActivateItemL( selectedIndex ); + } + } + +// ----------------------------------------------------------------------------- +// Runs the activate event for the item node +// ----------------------------------------------------------------------------- +// +void CXnListQueryDialogAdapter::ActivateItemL( TInt aIndex ) + { + if( aIndex < iStaticItems.Count()) + { + iStaticItems[aIndex]->Node().SetStateL( + XnPropertyNames::style::common::KActive ); + iStaticItems[aIndex]->Node().UnsetStateL( + XnPropertyNames::style::common::KActive ); + } + else + { + ModifyDynamicEventL( aIndex - iStaticItems.Count()); + iDynamicItem->Node().SetStateL( + XnPropertyNames::style::common::KActive ); + iDynamicItem->Node().UnsetStateL( + XnPropertyNames::style::common::KActive ); + } + } + +// ----------------------------------------------------------------------------- +// Replaces the '#' char by index in event. Syntax "(#" +// ----------------------------------------------------------------------------- +// +void CXnListQueryDialogAdapter::ModifyDynamicEventL( TInt aIndex ) + { + CXnDomNode* eventNode = FindNodeByType( iDynamicItem->Node().DomNode(), XnPropertyNames::action::KEvent ); + + CXnDomAttribute* attribute = static_cast<CXnDomAttribute*> + (eventNode->AttributeList().FindByName( XnPropertyNames::action::event::KName )); + + HBufC8* nameStr( attribute->Value().AllocLC()); + TPtr8 namePtr = nameStr->Des(); + + //Find '(' char + TInt pos = namePtr.Locate('('); + TBuf8<4> index; + index.AppendNum( aIndex ); + namePtr.Replace( pos+1, 1, index ); + + attribute->SetValueL( namePtr ); + CleanupStack::PopAndDestroy( nameStr ); + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnnode.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnnode.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1140 @@ +/* +* 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: Node of the layout tree +* +*/ + +// INCLUDES +#include "xnnode.h" +#include "xnnodepluginif.h" +#include "xnnodeappif.h" +#include "xnnodeimpl.h" +#include "xnviewsnodeimpl.h" +#include "xnviewnodeimpl.h" +#include "xncomponentnodeimpl.h" +#include "xnproperty.h" +#include "xntype.h" +#include "xncomponent.h" +#include "xnscrollablecontroladapter.h" + +_LIT8( KView, "view" ); + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnNode::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnNode* CXnNode::NewL() + { + CXnNode* self = new ( ELeave ) CXnNode; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnNode::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnNode::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnNode::CXnNode() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnNode::CXnNode() + { + } + +// ----------------------------------------------------------------------------- +// CXnNode::~CXnNode() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +CXnNode::~CXnNode() + { + delete iImpl; + delete iPluginIf; + delete iAppIf; + } + +// ----------------------------------------------------------------------------- +// CXnNode::Impl +// ----------------------------------------------------------------------------- +// +CXnNodeImpl* CXnNode::Impl() + { + return iImpl; + } + +// ----------------------------------------------------------------------------- +// CXnNode::RootNodeImpl +// ----------------------------------------------------------------------------- +// +CXnNodeImpl* CXnNode::RootNodeImpl() + { + return iRootNodeImpl; + } + +// ----------------------------------------------------------------------------- +// CXnNode::ViewNodeImpl +// ----------------------------------------------------------------------------- +// +CXnViewNodeImpl* CXnNode::ViewNodeImpl() + { + return iViewNodeImpl; + } + +// ----------------------------------------------------------------------------- +// CXnNode::ComponentNodeImpl +// ----------------------------------------------------------------------------- +// +CXnComponentNodeImpl* CXnNode::ComponentNodeImpl() + { + return iComponentNodeImpl; + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetImpl +// ----------------------------------------------------------------------------- +// +void CXnNode::SetImpl( CXnNodeImpl* aImpl ) + { + if ( aImpl ) + { + delete iImpl; + iImpl = aImpl; + iImpl->SetNode( *this ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetRootNodeImpl +// ----------------------------------------------------------------------------- +// +void CXnNode::SetRootNodeImpl( CXnNodeImpl* aRootNodeImpl ) + { + if ( aRootNodeImpl ) + { + delete iImpl; + iRootNodeImpl = aRootNodeImpl; + iImpl = iRootNodeImpl; + iImpl->SetNode( *this ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetViewsNodeImpl +// ----------------------------------------------------------------------------- +// +void CXnNode::SetViewsNodeImpl( CXnViewsNodeImpl* aViewsNodeImpl ) + { + if ( aViewsNodeImpl ) + { + delete iImpl; + iViewsNodeImpl = aViewsNodeImpl; + iImpl = iViewsNodeImpl; + iImpl->SetNode( *this ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetViewNodeImpl +// ----------------------------------------------------------------------------- +// +void CXnNode::SetViewNodeImpl( CXnViewNodeImpl* aViewNodeImpl ) + { + if ( aViewNodeImpl ) + { + delete iImpl; + iViewNodeImpl = aViewNodeImpl; + iImpl = iViewNodeImpl; + iImpl->SetNode( *this ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetComponentNodeImpl +// ----------------------------------------------------------------------------- +// +void CXnNode::SetComponentNodeImpl( CXnComponentNodeImpl* aComponentNodeImpl ) + { + if ( aComponentNodeImpl ) + { + delete iImpl; + iComponentNodeImpl = aComponentNodeImpl; + iImpl = iComponentNodeImpl; + iImpl->SetNode( *this ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetDropped +// ----------------------------------------------------------------------------- +// +void CXnNode::SetDropped( const TInt aDropped ) + { + iImpl->SetDropped( aDropped ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::IsDropped +// ----------------------------------------------------------------------------- +// +TInt CXnNode::IsDropped() const + { + return iImpl->IsDropped(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::Type() +// Returns control type. +// ----------------------------------------------------------------------------- +// +CXnType* CXnNode::Type() + { + return iImpl->Type(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::Parent +// Get component parent +// ----------------------------------------------------------------------------- +// +CXnNode* CXnNode::Parent() const + { + return iImpl->Parent(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetParent +// Set component parent +// ----------------------------------------------------------------------------- +// +void CXnNode::SetParent( CXnNode& aParent ) + { + iImpl->SetParent( aParent ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::AddChildL +// Adds a child to this container. +// ----------------------------------------------------------------------------- +// +void CXnNode::AddChildL( CXnNode* aChild ) + { + if ( aChild ) + { + iImpl->AddChildL( aChild ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNode::Children +// ----------------------------------------------------------------------------- +// +RPointerArray< CXnNode >& CXnNode::Children() + { + return iImpl->Children(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetPCDataL +// ----------------------------------------------------------------------------- +void CXnNode::SetPCDataL( const TDesC8& aData ) + { + iImpl->SetPCDataL( aData ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::GetPCData +// ----------------------------------------------------------------------------- +const TDesC8& CXnNode::GetPCData() const + { + return iImpl->GetPCData(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetPropertyWithoutNotificationL +// Set a property. +// ----------------------------------------------------------------------------- +// +void CXnNode::SetPropertyWithoutNotificationL( CXnProperty* aProperty ) + { + if ( aProperty ) + { + iImpl->SetPropertyWithoutNotificationL( aProperty ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetPropertyL +// Set a property. +// ----------------------------------------------------------------------------- +// +void CXnNode::SetPropertyL( CXnProperty* aProperty ) + { + if ( aProperty ) + { + iImpl->SetPropertyL( aProperty ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetPropertyArrayL +// Set a property array. +// ----------------------------------------------------------------------------- +// +void CXnNode::SetPropertyArrayL( RPointerArray< CXnProperty >* aPropertyArray ) + { + if ( aPropertyArray ) + { + iImpl->SetPropertyArrayL( *aPropertyArray ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNode::InitializePropertyL +// Set a property. +// ----------------------------------------------------------------------------- +// +void CXnNode::InitializePropertyL( CXnProperty* aProperty ) + { + if ( aProperty ) + { + iImpl->InitializePropertyL( aProperty ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNode::GetProperty +// Gets a property. +// ----------------------------------------------------------------------------- +// +CXnProperty* CXnNode::GetPropertyL( const TDesC8& aKey ) const + { + return iImpl->GetPropertyL( aKey ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetStateL +// Set a state +// ----------------------------------------------------------------------------- +// +void CXnNode::SetStateL( const TDesC8& aState, TInt aSource ) + { + iImpl->SetStateL( aState, aSource ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::IsStateSet +// Check whether a state is set or not +// ----------------------------------------------------------------------------- +// +TBool CXnNode::IsStateSet( const TDesC8& aState ) + { + return iImpl->IsStateSet( aState ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetStateWithoutNotificationL +// Set a state +// ----------------------------------------------------------------------------- +// +void CXnNode::SetStateWithoutNotificationL( const TDesC8& aState ) + { + iImpl->SetStateWithoutNotificationL( aState ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::UnsetState +// Unset a pseudoclass +// ----------------------------------------------------------------------------- +// +void CXnNode::UnsetStateL( const TDesC8& aState ) + { + iImpl->UnsetStateL( aState ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetRect +// ----------------------------------------------------------------------------- +// +void CXnNode::SetRect( const TRect& aRect ) + { + iImpl->SetRect( aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::Rect +// ----------------------------------------------------------------------------- +// +TRect CXnNode::Rect() + { + return iImpl->Rect(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetBorderRect +// ----------------------------------------------------------------------------- +// +void CXnNode::SetBorderRect( const TRect& aRect ) + { + iImpl->SetBorderRect( aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::BorderRect +// ----------------------------------------------------------------------------- +// +TRect CXnNode::BorderRect() + { + return iImpl->BorderRect(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetNormalFlowBorderRect +// ----------------------------------------------------------------------------- +// +void CXnNode::SetNormalFlowBorderRect( const TRect& aRect ) + { + iImpl->SetNormalFlowBorderRect( aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::NormalFlowBorderRect +// ----------------------------------------------------------------------------- +// +TRect CXnNode::NormalFlowBorderRect() + { + return iImpl->NormalFlowBorderRect(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetMarginRect +// ----------------------------------------------------------------------------- +// +void CXnNode::SetMarginRect( const TRect& aRect ) + { + iImpl->SetMarginRect( aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::MarginRect +// ----------------------------------------------------------------------------- +// +TRect CXnNode::MarginRect() + { + return iImpl->MarginRect(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetPaddingRect +// ----------------------------------------------------------------------------- +// +void CXnNode::SetPaddingRect( const TRect& aRect ) + { + iImpl->SetPaddingRect( aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::PaddingRect +// ----------------------------------------------------------------------------- +// +TRect CXnNode::PaddingRect() + { + return iImpl->PaddingRect(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetUiEngine +// ----------------------------------------------------------------------------- +// +void CXnNode::SetUiEngine( CXnUiEngine& aEngine ) + { + iImpl->SetUiEngine( aEngine ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::UiEngine +// ----------------------------------------------------------------------------- +// +CXnUiEngine* CXnNode::UiEngine() + { + return iImpl->UiEngine(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::ReportXuikonEventL +// ----------------------------------------------------------------------------- +// +TBool CXnNode::ReportXuikonEventL( CXnNode& aEventData, TInt aSource ) + { + return iImpl->ReportXuikonEventL( aEventData, aSource ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::OfferKeyEventL +// ----------------------------------------------------------------------------- +// +void CXnNode::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) + { + iImpl->OfferKeyEventL( aKeyEvent, aType ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetLayoutCapable +// ----------------------------------------------------------------------------- +// +void CXnNode::SetLayoutCapable( const TBool aLayoutCapable ) + { + iImpl->SetLayoutCapable( aLayoutCapable ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetLayoutCapable +// ----------------------------------------------------------------------------- +// +TBool CXnNode::IsLayoutCapable() const + { + return iImpl->IsLayoutCapable(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetRenderedL +// ----------------------------------------------------------------------------- +// +void CXnNode::SetRenderedL() + { + iImpl->SetRenderedL(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetLaidOutL +// ----------------------------------------------------------------------------- +// +void CXnNode::SetLaidOutL() + { + iImpl->SetLaidOutL(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::IsLaidOut +// ----------------------------------------------------------------------------- +// +TBool CXnNode::IsLaidOut() const + { + return iImpl->IsLaidOut(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::ClearRenderedAndLaidOut +// ----------------------------------------------------------------------------- +// +void CXnNode::ClearRenderedAndLaidOut() + { + iImpl->ClearRenderedAndLaidOut(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::PluginIfL +// Get node plugin interface +// ----------------------------------------------------------------------------- +// +CXnNodePluginIf& CXnNode::PluginIfL() + { + if ( iPluginIf ) + { + return *iPluginIf; + } + else + { + iPluginIf = new ( ELeave ) CXnNodePluginIf( *this ); + return *iPluginIf; + } + } + +// ----------------------------------------------------------------------------- +// CXnNode::AppIfL +// Get node plugin interface +// ----------------------------------------------------------------------------- +// +CXnNodeAppIf& CXnNode::AppIfL() + { + if ( iAppIf ) + { + return *iAppIf; + } + else + { + iAppIf = new ( ELeave ) CXnNodeAppIf( *this ); + return *iAppIf; + } + } + +// ----------------------------------------------------------------------------- +// CXnNode::MakeInterfaceL +// Create a component interface according to the given type. +// ----------------------------------------------------------------------------- +// +XnComponentInterface::MXnComponentInterface* CXnNode::MakeInterfaceL( + const TDesC8& aType ) + { + return iImpl->MakeInterfaceL( aType ); + } + +CXnProperty* CXnNode::WidthL() + { + return iImpl->WidthL(); + } + +CXnProperty* CXnNode::HeightL() + { + return iImpl->HeightL(); + } + +CXnProperty* CXnNode::MarginLeftL() + { + return iImpl->MarginLeftL(); + } + +CXnProperty* CXnNode::MarginRightL() + { + return iImpl->MarginRightL(); + } + +CXnProperty* CXnNode::BorderLeftL() + { + return iImpl->BorderLeftL(); + } + +CXnProperty* CXnNode::BorderRightL() + { + return iImpl->BorderRightL(); + } + +CXnProperty* CXnNode::PaddingLeftL() + { + return iImpl->PaddingLeftL(); + } + +CXnProperty* CXnNode::PaddingRightL() + { + return iImpl->PaddingRightL(); + } + +CXnProperty* CXnNode::MarginTopL() + { + return iImpl->MarginTopL(); + } + +CXnProperty* CXnNode::MarginBottomL() + { + return iImpl->MarginBottomL(); + } + +CXnProperty* CXnNode::BorderTopL() + { + return iImpl->BorderTopL(); + } + +CXnProperty* CXnNode::BorderBottomL() + { + return iImpl->BorderBottomL(); + } + +CXnProperty* CXnNode::PaddingTopL() + { + return iImpl->PaddingTopL(); + } + +CXnProperty* CXnNode::PaddingBottomL() + { + return iImpl->PaddingBottomL(); + } + +CXnProperty* CXnNode::BorderWidthL() + { + return iImpl->BorderWidthL(); + } + +CXnProperty* CXnNode::BlockProgressionL() + { + return iImpl->BlockProgressionL(); + } + +CXnProperty* CXnNode::DirectionL() + { + return iImpl->DirectionL(); + } + +CXnProperty* CXnNode::PositionL() + { + return iImpl->PositionL(); + } + +CXnProperty* CXnNode::MaxHeightL() + { + return iImpl->MaxHeightL(); + } + +CXnProperty* CXnNode::MinHeightL() + { + return iImpl->MinHeightL(); + } + +CXnProperty* CXnNode::MaxWidthL() + { + return iImpl->MaxWidthL(); + } + +CXnProperty* CXnNode::MinWidthL() + { + return iImpl->MinWidthL(); + } + +CXnProperty* CXnNode::DisplayL() + { + return iImpl->DisplayL(); + } + +CXnProperty* CXnNode::VisibilityL() + { + return iImpl->VisibilityL(); + } + +CXnProperty* CXnNode::LeftL() + { + return iImpl->LeftL(); + } + +CXnProperty* CXnNode::RightL() + { + return iImpl->RightL(); + } + +CXnProperty* CXnNode::TopL() + { + return iImpl->TopL(); + } + +CXnProperty* CXnNode::BottomL() + { + return iImpl->BottomL(); + } + +CXnProperty* CXnNode::BorderLeftStyleL() + { + return iImpl->BorderLeftStyleL(); + } + +CXnProperty* CXnNode::BorderRightStyleL() + { + return iImpl->BorderRightStyleL(); + } + +CXnProperty* CXnNode::BorderTopStyleL() + { + return iImpl->BorderTopStyleL(); + } + +CXnProperty* CXnNode::BorderBottomStyleL() + { + return iImpl->BorderBottomStyleL(); + } + +CXnProperty* CXnNode::BorderStyleL() + { + return iImpl->BorderStyleL(); + } + +CXnProperty* CXnNode::BorderImageL() + { + return iImpl->BorderImageL(); + } + +CXnProperty* CXnNode::DisplayPriorityL() + { + return iImpl->DisplayPriorityL(); + } + +CXnProperty* CXnNode::NameL() + { + return iImpl->NameL(); + } + +CXnProperty* CXnNode::ValueL() + { + return iImpl->ValueL(); + } + +CXnProperty* CXnNode::LabelL() + { + return iImpl->LabelL(); + } + +CXnProperty* CXnNode::InitialFocusL() + { + return iImpl->InitialFocusL(); + } + +CXnProperty* CXnNode::ClassL() + { + return iImpl->ClassL(); + } + +CXnProperty* CXnNode::IdL() + { + return iImpl->IdL(); + } +CXnProperty* CXnNode::PathL() + { + return iImpl->PathL(); + } +CXnProperty* CXnNode::MaskPathL() + { + return iImpl->MaskPathL(); + } + +CXnProperty* CXnNode::NavIndexL() + { + 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(); + } + +CXnProperty* CXnNode::BackgroundColorL() + { + return iImpl->BackgroundColorL(); + } + +CXnProperty* CXnNode::BackgroundImageL() + { + return iImpl->BackgroundImageL(); + } + +CXnProperty* CXnNode::FocusBackgroundL() + { + 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 +// ----------------------------------------------------------------------------- +// +void CXnNode::SetDomNode( CXnDomNode* aDomNode ) + { + if ( aDomNode ) + { + iImpl->SetDomNode( aDomNode ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNode::DomNode +// Returns the DOM node pointer +// ----------------------------------------------------------------------------- +// +CXnDomNode* CXnNode::DomNode() + { + return iImpl->DomNode(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetHandleTooltip +// Sets handle tooltip flag. +// ----------------------------------------------------------------------------- +// +void CXnNode::SetHandleTooltip( TBool aFlag ) + { + iImpl->SetHandleTooltip( aFlag ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::MeasureAdaptiveContentL +// Measures the adaptive content dimensions. +// ----------------------------------------------------------------------------- +// +TSize CXnNode::MeasureAdaptiveContentL( const TSize& aAvailableSize ) + { + return iImpl->MeasureAdaptiveContentL( aAvailableSize ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::IsAdaptive +// Checks if the node has adaptive content +// ----------------------------------------------------------------------------- +// +TInt CXnNode::IsAdaptive( TBool aIgnoreSizeFixed ) const + { + return iImpl->IsAdaptive( aIgnoreSizeFixed ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetAdaptiveL +// Marks the node as content based. +// ----------------------------------------------------------------------------- +// +void CXnNode::SetAdaptiveL( const TInt aAdaptive ) + { + iImpl->SetAdaptiveL( aAdaptive ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::FixAdaptiveSizeL +// Marks the node as content based. +// ----------------------------------------------------------------------------- +// +void CXnNode::FixAdaptiveSizeL( const TSize& aFixedSize ) + { + iImpl->FixAdaptiveSizeL( aFixedSize ); + } + +// ----------------------------------------------------------------------------- +// 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 +// ----------------------------------------------------------------------------- +// +void CXnNode::SetDirtyL( TInt aLevel, TBool aDisplayedState ) + { + iImpl->SetDirtyL( aLevel, aDisplayedState ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::RunFocusChangeL +// Runs focus change +// ----------------------------------------------------------------------------- +// +TBool CXnNode::RunFocusChangeL( RPointerArray< CXnNode >& aFocusCandidates ) + { + return iImpl->RunFocusChangeL( aFocusCandidates ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::ReorderNodesL +// ----------------------------------------------------------------------------- +// +void CXnNode::ReorderNodesL( CXnNode* aSource, CXnNode* aTarget ) + { + if ( aSource && aTarget ) + { + iImpl->ReorderNodesL( aSource, aTarget ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNode::FindViewNode +// ----------------------------------------------------------------------------- +// +CXnNode* CXnNode::FindViewNode() + { + CXnNode* tmp = NULL; + tmp = Parent(); + while( tmp ) + { + if ( tmp->Type()->Type() == KView ) + { + break; + } + else + { + tmp = tmp->Parent(); + } + } + return tmp; + } + +// ----------------------------------------------------------------------------- +// CXnNode::ShowTooltipsL +// ----------------------------------------------------------------------------- +// +void CXnNode::ShowTooltipsL() + { + if ( IsStateSet( XnPropertyNames::action::trigger::name::KFocus ) ) + { + iImpl->HidePopupsL(); + iImpl->ShowPopupsL( Rect() ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNode::HideTooltipsL +// ----------------------------------------------------------------------------- +// +void CXnNode::HideTooltipsL() + { + iImpl->HidePopupsL(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::Namespace +// ----------------------------------------------------------------------------- +// +const TDesC8& CXnNode::Namespace() + { + return iImpl->Namespace(); + } + +// ----------------------------------------------------------------------------- +// CXnNode::ControlL +// ----------------------------------------------------------------------------- +// +CXnControlAdapter* CXnNode::Control() const + { + CXnComponent* component( NULL ); + + if ( iViewNodeImpl ) + { + component = iViewNodeImpl->Component(); + } + else if ( iComponentNodeImpl ) + { + component = iComponentNodeImpl->Component(); + } + + if ( component ) + { + return component->ControlAdapter(); + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnNode::SetScrollableControl() +// ----------------------------------------------------------------------------- +// +void CXnNode::SetScrollableControl( CXnScrollableControlAdapter* aScrollableControl ) + { + iImpl->SetScrollableControl( aScrollableControl ); + } + +// ----------------------------------------------------------------------------- +// CXnNode::ScrollableControl() +// ----------------------------------------------------------------------------- +// +CXnScrollableControlAdapter* CXnNode::ScrollableControl() + { + return iImpl->ScrollableControl(); + } + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnnodeappif.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnnodeappif.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,281 @@ +/* +* 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: Node of the layout tree +* +*/ + +// INCLUDES +#include "xnnode.h" +#include "xnnodeappif.h" +#include "xntype.h" +#include "xnuiengine.h" +#include "xndomnode.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::CXnNodeAppIf() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnNodeAppIf::CXnNodeAppIf( CXnNode& aNode ) + { + iNode = &aNode; + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::Type() +// Returns control type. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnType* CXnNodeAppIf::Type() + { + return iNode->Type(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::SetPCDataL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodeAppIf::SetPCDataL( const TDesC8& aData ) + { + iNode->SetPCDataL( aData ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::GetPCData +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CXnNodeAppIf::GetPCData() const + { + return iNode->GetPCData(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::SetPropertyL +// Set a property. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodeAppIf::SetPropertyL( CXnProperty* aProperty ) + { + iNode->SetPropertyL( aProperty ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::SetPropertyArrayL +// Set a property array. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodeAppIf::SetPropertyArrayL( + RPointerArray< CXnProperty >* aPropertyArray ) + { + iNode->SetPropertyArrayL( aPropertyArray ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::GetProperty +// Gets a property. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnProperty* CXnNodeAppIf::GetPropertyL( CXnProperty& /*aProperty*/ ) const + { + return NULL;//return iNode->GetPropertyL(aProperty); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::GetProperty +// Gets a property. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnProperty* CXnNodeAppIf::GetPropertyL( const TDesC8& aKey ) const + { + return iNode->GetPropertyL( aKey ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::SetStateL +// Set a state +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodeAppIf::SetStateL( const TDesC8& aState ) + { + iNode->SetStateL( aState ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::IsStateSet +// Check whether a state is set or not +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CXnNodeAppIf::IsStateSet( const TDesC8& aState ) + { + return iNode->IsStateSet( aState ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::UnsetState +// Unset a pseudoclass +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodeAppIf::UnsetStateL( const TDesC8& aState ) + { + iNode->UnsetStateL( aState ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::Rect +// ----------------------------------------------------------------------------- +// +EXPORT_C TRect CXnNodeAppIf::Rect() + { + return iNode->Rect(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::BorderRect +// ----------------------------------------------------------------------------- +// +EXPORT_C TRect CXnNodeAppIf::BorderRect() + { + return iNode->BorderRect(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::MarginRect +// ----------------------------------------------------------------------------- +// +EXPORT_C TRect CXnNodeAppIf::MarginRect() + { + return iNode->MarginRect(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::PaddingRect +// ----------------------------------------------------------------------------- +// +EXPORT_C TRect CXnNodeAppIf::PaddingRect() + { + return iNode->PaddingRect(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::UiEngine +// ----------------------------------------------------------------------------- +// +EXPORT_C TXnUiEngineAppIf* CXnNodeAppIf::UiEngineL() + { + return &(iNode->UiEngine()->AppIfL()); + } + +// ----------------------------------------------------------------------------- +// Get internal node +// ----------------------------------------------------------------------------- +// +CXnNode& CXnNodeAppIf::Node() + { + return *iNode; + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::MakeInterfaceL +// Create a component interface according to the given type. +// ----------------------------------------------------------------------------- +// +EXPORT_C XnComponentInterface::MXnComponentInterface* CXnNodeAppIf::MakeInterfaceL( + const TDesC8& aType ) + { + return iNode->MakeInterfaceL( aType ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::Children +// ----------------------------------------------------------------------------- +// +EXPORT_C RPointerArray< CXnNodeAppIf > CXnNodeAppIf::ChildrenL() + { + RPointerArray< CXnNode >& nodes = iNode->Children(); + RPointerArray< CXnNodeAppIf > appNodes; + CleanupClosePushL( appNodes ); + TInt count = nodes.Count(); + for ( TInt i = 0; i < count; ++i ) + { + appNodes.AppendL( &nodes[i]->AppIfL() ); + } + CleanupStack::Pop( &appNodes ); + // Compiler will generate bitwise copy ctor, thus + // caller of this function must call reset or close for copied RPointerArrays, + // which is very nasty thing to do... + return appNodes; + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::ParentL +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnNodeAppIf* CXnNodeAppIf::ParentL() const + { + CXnNode* parent = iNode->Parent(); + if ( !parent ) + { + return NULL; + } + return &( parent->AppIfL() ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::InternalDomNodeType +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CXnNodeAppIf::InternalDomNodeType() const + { + CXnDomNode* node = iNode->DomNode(); + if ( node ) + { + return node->Name(); + } + return KNullDesC8; + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::ShowTooltipsL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodeAppIf::ShowTooltipsL() + { + iNode->ShowTooltipsL(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::HideTooltipsL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodeAppIf::HideTooltipsL() + { + iNode->HideTooltipsL(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeAppIf::Namespace +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CXnNodeAppIf::Namespace() + { + CXnDomNode* node = iNode->DomNode(); + if ( node ) + { + return node->Namespace(); + } + return KNullDesC8; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,10400 @@ +/* +* 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: Implementation part of bridge pattern in CXnNode +* +*/ + +// System includes +#include <AknUtils.h> +#include <utf.h> +#include <mmf/common/mmfcontrollerpluginresolver.h> + +// User includes +#include "xnnodeimpl.h" +#include "xnnode.h" +#include "xnpropertylist.h" +#include "xnproperty.h" +#include "xnuiengine.h" +#include "xnappuiadapter.h" +#include "xncontroladapter.h" +#include "xnpopupcontroladapter.h" +#include "xnmenuadapter.h" +#include "xndomlist.h" +#include "xndomdocument.h" +#include "xnpointerarray.h" +#include "xnodt.h" +#include "xntype.h" +#include "xndomnode.h" +#include "xndomattribute.h" +#include "xndompropertyvalue.h" +#include "xnpopup.h" +#include "c_xnutils.h" +#include "xneditmode.h" +#include "xneditor.h" +#include "xntext.h" +#include "xnhittest.h" +#include "xnscrollablecontroladapter.h" +#include "xnviewdata.h" +#include "xnpanic.h" +#include "xnlistquerydialogadapter.h" +#include "xneffectmanager.h" +#include "xnviewadapter.h" + +// Local constants +_LIT8( KRef, "ref" ); +_LIT8( KId, "id" ); +_LIT8( KName, "name" ); +_LIT8( KToolTip, "tooltip" ); +_LIT8( KMenuBar, "menubar" ); + +_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; + +_LIT8( KPseudoClassFocus, "focus" ); +_LIT8( KPseudoClassPressedDown, "presseddown" ); +_LIT8( KPseudoClassPassiveFocus, "passivefocus" ); +_LIT8( KPseudoClassHold, "hold" ); +_LIT8( KPseudoClassHover, "hover" ); +_LIT8( KPseudoClassLink, "link" ); +_LIT8( KPseudoClassVisited, "visited" ); +_LIT8( KPseudoClassActive, "active" ); +_LIT8( KPseudoClassEdit, "edit" ); + +_LIT8( KCompound, "compound" ); +_LIT8( KTrue, "true" ); +_LIT8( KDisplay, "display" ); +_LIT8( KBlock, "block" ); +_LIT8( KNone, "none" ); +_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() : + iWidths( 1 ), + iHeights( 1 ), + iMarginLefts( 1 ), + iMarginRights( 1 ), + iBorderLefts( 1 ), + iBorderRights( 1 ), + iPaddingLefts( 1 ), + iPaddingRights( 1 ), + iMarginTops( 1 ), + iMarginBottoms( 1 ), + iBorderTops( 1 ), + iBorderBottoms( 1 ), + iPaddingTops( 1 ), + iPaddingBottoms( 1 ), + iBorderWidths( 1 ), + iBlockProgressions( 1 ), + iDirections( 1 ), + iPositions( 1 ), + iMaxHeights( 1 ), + iMinHeights( 1 ), + iMaxWidths( 1 ), + iMinWidths( 1 ), + iDisplays( 2 ), + iVisibilities( 1 ), + iLefts( 1 ), + iRights( 1 ), + iTops( 1 ), + iBottoms( 1 ), + iBorderLeftStyles( 1 ), + iBorderRightStyles( 1 ), + iBorderTopStyles( 1 ), + iBorderBottomStyles( 1 ), + iBorderStyles( 1 ), + iDisplayPriorities( 1 ), + iNavIndexes( 1 ), + iBackgroundColors( 1 ), + iBackgroundImages( 1 ), + iFocusBackgrounds( 2 ) + { + } + + ~CLayoutPropertyCache() + { + iWidths.Reset(); + iHeights.Reset(); + iMarginLefts.Reset(); + iMarginRights.Reset(); + iBorderLefts.Reset(); + iBorderRights.Reset(); + iPaddingLefts.Reset(); + iPaddingRights.Reset(); + iMarginTops.Reset(); + iMarginBottoms.Reset(); + iBorderTops.Reset(); + iBorderBottoms.Reset(); + iPaddingTops.Reset(); + iPaddingBottoms.Reset(); + iBorderWidths.Reset(); + iBlockProgressions.Reset(); + iDirections.Reset(); + iPositions.Reset(); + iMaxHeights.Reset(); + iMinHeights.Reset(); + iMaxWidths.Reset(); + iMinWidths.Reset(); + iDisplays.Reset(); + iVisibilities.Reset(); + iLefts.Reset(); + iRights.Reset(); + iTops.Reset(); + iBottoms.Reset(); + iBorderLeftStyles.Reset(); + iBorderRightStyles.Reset(); + iBorderTopStyles.Reset(); + iBorderBottomStyles.Reset(); + iBorderStyles.Reset(); + iDisplayPriorities.Reset(); + iNavIndexes.Reset(); + iBackgroundColors.Reset(); + iZIndexes.Reset(); + iBackgroundImages.Reset(); + iFocusBackgrounds.Reset(); + } + + CXnProperty* iWidth; + RPointerArray< CXnProperty > iWidths; + CXnProperty* iHeight; + RPointerArray< CXnProperty > iHeights; + CXnProperty* iMarginLeft; + RPointerArray< CXnProperty > iMarginLefts; + CXnProperty* iMarginRight; + RPointerArray< CXnProperty > iMarginRights; + CXnProperty* iBorderLeft; + RPointerArray< CXnProperty > iBorderLefts; + CXnProperty* iBorderRight; + RPointerArray< CXnProperty > iBorderRights; + CXnProperty* iPaddingLeft; + RPointerArray< CXnProperty > iPaddingLefts; + CXnProperty* iPaddingRight; + RPointerArray< CXnProperty > iPaddingRights; + CXnProperty* iMarginTop; + RPointerArray< CXnProperty > iMarginTops; + CXnProperty* iMarginBottom; + RPointerArray< CXnProperty > iMarginBottoms; + CXnProperty* iBorderTop; + RPointerArray< CXnProperty > iBorderTops; + CXnProperty* iBorderBottom; + RPointerArray< CXnProperty > iBorderBottoms; + CXnProperty* iPaddingTop; + RPointerArray< CXnProperty > iPaddingTops; + CXnProperty* iPaddingBottom; + RPointerArray< CXnProperty > iPaddingBottoms; + CXnProperty* iBorderWidth; + RPointerArray< CXnProperty > iBorderWidths; + CXnProperty* iBlockProgression; + RPointerArray< CXnProperty > iBlockProgressions; + CXnProperty* iDirection; + RPointerArray< CXnProperty > iDirections; + CXnProperty* iPosition; + RPointerArray< CXnProperty > iPositions; + CXnProperty* iMaxHeight; + RPointerArray< CXnProperty > iMaxHeights; + CXnProperty* iMinHeight; + RPointerArray< CXnProperty > iMinHeights; + CXnProperty* iMaxWidth; + RPointerArray< CXnProperty > iMaxWidths; + CXnProperty* iMinWidth; + RPointerArray< CXnProperty > iMinWidths; + CXnProperty* iDisplay; + RPointerArray< CXnProperty > iDisplays; + CXnProperty* iVisibility; + RPointerArray< CXnProperty > iVisibilities; + CXnProperty* iLeft; + RPointerArray< CXnProperty > iLefts; + CXnProperty* iRight; + RPointerArray< CXnProperty > iRights; + CXnProperty* iTop; + RPointerArray< CXnProperty > iTops; + CXnProperty* iBottom; + RPointerArray< CXnProperty > iBottoms; + CXnProperty* iBorderLeftStyle; + RPointerArray< CXnProperty > iBorderLeftStyles; + CXnProperty* iBorderRightStyle; + RPointerArray< CXnProperty > iBorderRightStyles; + CXnProperty* iBorderTopStyle; + RPointerArray< CXnProperty > iBorderTopStyles; + CXnProperty* iBorderBottomStyle; + RPointerArray< CXnProperty > iBorderBottomStyles; + CXnProperty* iBorderStyle; + RPointerArray< CXnProperty > iBorderStyles; + CXnProperty* iBorderImage; + CXnProperty* iDisplayPriority; + RPointerArray< CXnProperty > iDisplayPriorities; + CXnProperty* iNavIndex; + RPointerArray< CXnProperty > iNavIndexes; + CXnProperty* iZIndex; + RPointerArray< CXnProperty > iZIndexes; + CXnProperty* iBackgroundColor; + RPointerArray< CXnProperty > iBackgroundColors; + CXnProperty* iBackgroundImage; + RPointerArray< CXnProperty > iBackgroundImages; + CXnProperty* iFocusBackground; + RPointerArray< CXnProperty > iFocusBackgrounds; + }; + +// 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, + CXnDomNode& aTriggerNode ); +static void GetFocusCandidatesL( + CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnDomNode& aEventNode, + 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 RunActivateL( + CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnDomNode& aEventNode ); +static void RunDeactivateL( + CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnDomNode& aEventNode ); +static void RunSystemSetPCDataL( + CXnNodeImpl* aThis, CXnUiEngine& aEngine, const TDesC8& aId, + const TDesC8& aData ); +static void GetNumberValues( const TDesC8& aData, TReal& aNumber, + CXnDomPropertyValue::TPrimitiveValueType& aValueType ); +static void RunSystemSetNumberL( CXnUiEngine& aEngine, CXnNode* aNode, + const TDesC8& aName, const RPointerArray< HBufC8 >& aValues ); +static void RunSystemSetRGBL( CXnUiEngine& aEngine, CXnNode* aNode, + const TDesC8& aName, const RPointerArray< HBufC8 >& aValues ); +static void RunSystemSetStringL( + CXnUiEngine& aEngine, CXnNode* aNode, const TDesC8& aName, + const RPointerArray< HBufC8 >& aValues, + const CXnDomPropertyValue::TPrimitiveValueType aValueType ); +static void GetSystemSetDataL( CXnDomNode& aDomNode, HBufC8*& aId, + const TDesC8** aPseudoClass = NULL, const TDesC8** aName = NULL, + RPointerArray< HBufC8 >* aValues = NULL, const TDesC8** aType = NULL, + TBool aSettings = EFalse, const TDesC8& aProvidedId = KNullDesC8, + const TDesC8** aClassId = NULL ); +static void RunSystemSetL( + CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnDomNode& aEventNode, + TBool aSettings = EFalse, const TDesC8& aId = KNullDesC8 ); +static void RunTryDisplayingMenuL( + CXnUiEngine& aEngine, CXnDomNode& aEventNode ); +static void RunTryDisplayingStylusPopupL( + CXnNodeImpl* aThis, CXnNode& aNode, CXnUiEngine& aEngine, + CXnDomNode& aEventNode ); +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 ); +static void RunEventsL( CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnNode& aNode, + CXnDomNode& aActionNode, CXnDomNode& aTriggerNode, CXnNode& aEventData ); +static TBool DoMatchTriggerForHighLevelKeyEventL( CXnNode& aNode, + const TKeyEvent& aKeyEvent, TEventCode aType, const TDesC8& highLevelKey ); +static TBool MatchTriggerForKeyEventL( + CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnNode& aNode, + const TKeyEvent& aKeyEvent, TEventCode aType, + CXnDomNode& aActionNode, CXnDomNode& aTriggerNode ); +static TBool MatchTriggerForEventL( + CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnNode& aNode, + CXnNode& aEventData, CXnDomNode& aActionNode, CXnDomNode& aTriggerNode, + TInt aSource ); +static TBool MatchActionForKeyEventL( + CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnNode& aNode, + const TKeyEvent& aKeyEvent, TEventCode aType, CXnDomNode& aActionNode ); +static TBool IsTriggerActiveL( CXnDomNode& aNode ); +static TBool MatchActionForEventL( + CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnNode& aNode, + CXnNode& aEventData, CXnDomNode& aActionNode, TInt aSource ); +static CXnNode* FindLoopedFocusableNodeL( CXnNode& aNode, TBool aForward ); +static CXnNode* FindNextFocusableNodeByNavIndexL( CXnNode& aNode, TBool aForward ); +static TBool FindNextFocusableNodeL( CXnNode& aNode, TBool aForward ); +static CXnNode* FindNextNodeFromRightL( + RPointerArray< CXnNode >& aArray, CXnNode& aNode, TBool stayInNamespace = EFalse, CXnUiEngine* aEngine = NULL ); +static CXnNode* FindNextNodeFromLeftL( + RPointerArray< CXnNode >& aArray, CXnNode& aNode, TBool stayInNamespace = EFalse, CXnUiEngine* aEngine = NULL ); +static CXnNode* FindNextNodeFromBelowL( + RPointerArray< CXnNode >& aArray, CXnNode& aNode, TBool stayInNamespace = EFalse ); +static CXnNode* FindNextNodeFromAboveL( + RPointerArray< CXnNode >& aArray, CXnNode& aNode, TBool stayInNamespace = EFalse ); +static CXnNode* FindPluginNode( CXnNode& aNode ); +static TBool DoInternalFocusChangeL( + CXnUiEngine& aEngine, CXnNode& aNode, const TKeyEvent& aKeyEvent, + TEventCode aType ); +static TBool DoTriggerKeyEventL( + CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnNode& aNode, + const TKeyEvent& aKeyEvent, TEventCode aType ); +static void DoTriggerEventL( + CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnNode& aNode, + CXnNode& aActionsParent, CXnNode& aEventData, TInt aSource ); +static TBool DoReceiveFocusL( CXnNode& aNode, CXnUiEngine& aEngine ); +static CXnNode* BuildActivateTriggerNodeL( CXnUiEngine& aUiEngine ); +static void DoSetActiveL( CXnNode& aNode, CXnUiEngine& aUiEngine ); +static void InformPropertyChangeL( CXnNode& aNode, CXnProperty* aProperty = NULL ); +static CXnNode* BuildEventTypeNodeL( TEventCode aType, CXnUiEngine& aUiEngine ); +static CXnNode* BuildModifiersNodeL( + const TKeyEvent& aKeyEvent, CXnUiEngine& aUiEngine ); +static CXnNode* BuildKeyCodeNodeL( + const TKeyEvent& aKeyEvent, CXnUiEngine& aUiEngine ); +static CXnNode* BuildScanCodeNodeL( + const TKeyEvent& aKeyEvent, CXnUiEngine& aUiEngine ); +static CXnNode* BuildRepeatsNodeL( + const TKeyEvent& aKeyEvent, CXnUiEngine& aUiEngine ); +static void BuildPropertyNodesL( CXnNode& aNode, const TKeyEvent& aKeyEvent, + TEventCode aType, CXnUiEngine& aUiEngine ); +static CXnNode* BuildKeyTriggerNodeL( const TKeyEvent& aKeyEvent, TEventCode aType, + CXnUiEngine& aUiEngine ); +static CXnDomPropertyValue* GetNavIndexL( CXnNode& aNode ); +static CXnNode* BackwardL( CXnNode& aNode ); +static CXnNode* ForwardL( CXnNode& aNode ); +static CXnNode* BackwardLoopL( CXnNode& aNode ); +static CXnNode* ForwardLoopL( CXnNode& aNode ); +static TInt CompareNavIndexesL( + CXnDomPropertyValue* aCurrentPropertyValue, + CXnDomPropertyValue* aNextPropertyValue ); +static void ReplaceOrAppend( + CXnProperty* aProperty, RPointerArray< CXnProperty >& aArray, + TBool aAppendOnly ); +static TBool DisplayValueMatchL( CXnNode& aNode, const TDesC8& aDisplayValue ); +static void SetStringPropertyToNodeL( + CXnDomStringPool& aStringPool, CXnNode& aNode, + const TDesC8& aPropertyName, const TDesC8& aPropertyValue ); +static void SetFloatPropertyToNodeL( + CXnDomStringPool& aStringPool, CXnNode& aNode, + const TDesC8& aPropertyName, TReal aPropertyValue, + CXnDomPropertyValue::TPrimitiveValueType aValueType ); +static CXnNode* FindYoungestSiblingWithDisplayL( + RPointerArray< CXnNode >& aSiblingArray, + const TDesC8& aDisplayValue, + TInt& aIndex ); +static CXnNode* FindOldestSiblingWithDisplayL( + RPointerArray< CXnNode >& aSiblingArray, + const TDesC8& aDisplayValue, + TInt& aIndex ); +static TBool IsCompoundNodeL( CXnNode* aNode ); +static void NotifyScrollNodeL( CXnNode* aNode, TBool aBegin, TBool aGainEnd ); +static void DoCompoundNodeBeginKeyL( + RPointerArray< CXnNode >& aChildren, CXnNode* aFocusedNode ); +static void DoCompoundNodeEndKeyL( + RPointerArray< CXnNode >& aChildren, CXnNode* aFocusedNode ); +static void DoCompoundNodeScrollingL( + CXnNode& aFocusedNode, + const TKeyEvent& aKeyEvent, + TEventCode aType ); +static CXnNode* BuildTriggerNodeL( + CXnUiEngine& aUiEngine, const TDesC8& aTriggerName ); +static CXnNode* IsNodeNavigableL( CXnNode* aParent ); +static TBool IsNodeNavigableL( CXnNode& aNode, TBool aIgnoreDropped = EFalse ); +static TInt DirtyLevelFromPropertyL( CXnNode& aNode, const TDesC8& aPropName ); +static TBool IsNodeDisplayedL( + CXnNode& aNode, TBool aCheckVisiblity = EFalse, TBool aCheckParent = ETrue ); +static void EnableStatePropertyL( + CXnNode& aNode, + CXnDomProperty::TPseudoClass aPseudoClass, + CXnProperty* ( CXnNode::* aGetCachedPropertyL )(), + CXnProperty*& aProperty, + RPointerArray< CXnProperty >& aArray, TInt& aLevel, + TBool aInformChange = EFalse ); +static void DisableStatePropertyL( + CXnNode& aNode, + CXnDomProperty::TPseudoClass aPseudoClass, + CXnProperty* ( CXnNode::* aGetCachedPropertyL )(), + CXnProperty*& aProperty, + RPointerArray< CXnProperty >& aArray, + RArray< CXnDomProperty::TPseudoClass >& aStates, TInt& aLevel, + TBool aInformChange = EFalse ); +static TBool MatchTitleScrollTriggerL( + CXnNode& aEventData, CXnDomNode& aTriggerNode ); + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// Checks whether trigger is runnable +// ----------------------------------------------------------------------------- +// +TBool IsTriggerRunnableL( CXnDomNode& aTriggerNode ) + { + TBool ret( ETrue ); + CXnNode* layoutNode = aTriggerNode.LayoutNode(); + if ( layoutNode ) + { + CXnProperty* display = + layoutNode->GetPropertyL( XnPropertyNames::style::common::KDisplay ); + + if ( display && display->StringValue() == + XnPropertyNames::style::common::display::KNone ) + { + ret = EFalse; + } + } + return ret; + } + +// ----------------------------------------------------------------------------- +// DirtyLevelFromPropertyL +// ----------------------------------------------------------------------------- +// +static TInt DirtyLevelFromPropertyL( CXnNode& aNode, const TDesC8& aPropName ) + { + if ( aPropName == XnPropertyNames::style::common::KDisplay || + aPropName == XnPropertyNames::style::common::KBlockProgression || + aPropName == XnPropertyNames::style::common::KDirection || + aPropName == XnPropertyNames::style::common::KPosition || + aPropName == XnPropertyNames::style::common::KTop || + aPropName == XnPropertyNames::style::common::KLeft || + aPropName == XnPropertyNames::style::common::KBottom || + aPropName == XnPropertyNames::style::common::KRight || + aPropName == XnPropertyNames::style::common::KWidth || + aPropName == XnPropertyNames::style::common::KHeight || + aPropName == XnPropertyNames::style::common::KMinWidth || + aPropName == XnPropertyNames::style::common::KMaxWidth || + aPropName == XnPropertyNames::style::common::KMinHeight || + aPropName == XnPropertyNames::style::common::KMaxHeight || + aPropName == XnPropertyNames::style::common::KS60DisplayPriority || + aPropName == XnPropertyNames::style::common::KMarginTop || + aPropName == XnPropertyNames::style::common::KMarginRight || + aPropName == XnPropertyNames::style::common::KMarginBottom || + aPropName == XnPropertyNames::style::common::KMarginLeft || + aPropName == XnPropertyNames::style::common::KBorderWidth || + aPropName == XnPropertyNames::style::common::KBorderTopWidth || + aPropName == XnPropertyNames::style::common::KBorderRightWidth || + aPropName == XnPropertyNames::style::common::KBorderBottomWidth || + aPropName == XnPropertyNames::style::common::KBorderLeftWidth || + aPropName == XnPropertyNames::style::common::KBorderLeftWidth || + aPropName == XnPropertyNames::style::common::KPaddingRight || + aPropName == XnPropertyNames::style::common::KPaddingBottom || + aPropName == XnPropertyNames::style::common::KPaddingLeft ) + { + TInt retval( XnDirtyLevel::ELayoutAndRenderSiblings ); + + CXnProperty* prop( aNode.PositionL() ); + + if ( prop ) + { + const TDesC8& value( prop->StringValue() ); + + if ( value == XnPropertyNames::style::common::position::KAbsolute || + value == XnPropertyNames::style::common::position::KFloating ) + { + retval = XnDirtyLevel::ELayoutAndRender; + } + } + + if ( aNode.Type()->Type() == KToolTip ) + { + retval = XnDirtyLevel::ELayoutAndRender; + } + + return retval; + } + else + { + return XnDirtyLevel::ERender; + } + } + +// ----------------------------------------------------------------------------- +// IsNodeDisplayedL +// Check whether a node is displayed or not +// ----------------------------------------------------------------------------- +// +static TBool IsNodeDisplayedL( + CXnNode& aNode, + TBool aCheckVisiblity, + TBool aCheckParent ) + { + if ( !aNode.IsLayoutCapable() ) + { + return EFalse; + } + + if ( aCheckVisiblity ) + { + CXnProperty* visibilityProp( aNode.VisibilityL() ); + + // Am I visible? + if ( visibilityProp ) + { + const TDesC8& visibility( visibilityProp->StringValue() ); + + if ( visibility != XnPropertyNames::style::common::visibility::KVisible ) + { + return EFalse; + } + } + } + + // Am I displayed? + CXnProperty* displayProp( aNode.DisplayL() ); + + if ( displayProp ) + { + const TDesC8& display( displayProp->StringValue() ); + + if ( display != XnPropertyNames::style::common::display::KBlock ) + { + return EFalse; + } + } + + if ( aCheckParent ) + { + CXnNode* parent( aNode.Parent() ); + + // Is my parent displayed? + for ( ; parent; parent = parent->Parent() ) + { + CXnProperty* displayProp( parent->DisplayL() ); + + if ( displayProp ) + { + const TDesC8& display( displayProp->StringValue() ); + + if ( display != XnPropertyNames::style::common::display::KBlock ) + { + return EFalse; + } + } + } + } + + return ETrue; + } + +// ----------------------------------------------------------------------------- +// IsNodeNavigableL +// Check whether a node or its child is navigable, ignores dropped state +// ----------------------------------------------------------------------------- +// +static CXnNode* IsNodeNavigableL( CXnNode* aParent ) + { + if ( IsNodeNavigableL( *aParent, ETrue ) ) + { + return aParent; + } + + RPointerArray< CXnNode >& children( aParent->Children() ); + + TInt count( children.Count() ); + + CXnNode* retval = NULL; + for ( TInt i = 0; i < count; i++ ) + { + retval = IsNodeNavigableL( children[i] ); + if ( retval ) + { + return retval; + } + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// IsNodeNavigableL() +// Check if node can be navigated +// ----------------------------------------------------------------------------- +// +static TBool IsNodeNavigableL( CXnNode& aNode, TBool aIgnoreDropped ) + { + if ( !aNode.IsLayoutCapable() || ( !aIgnoreDropped && aNode.IsDropped() ) ) + { + return EFalse; + } + + CXnProperty* displayProp( aNode.DisplayL() ); + + if ( displayProp ) + { + const TDesC8& display( displayProp->StringValue() ); + + if ( display != XnPropertyNames::style::common::display::KBlock ) + { + return EFalse; + } + } + + CXnProperty* visibilityProp( aNode.VisibilityL() ); + + if ( visibilityProp ) + { + const TDesC8& visibility( visibilityProp->StringValue() ); + + if ( visibility != XnPropertyNames::style::common::visibility::KVisible ) + { + return EFalse; + } + } + + CXnProperty* focusableProp( + aNode.GetPropertyL( XnPropertyNames::common::KFocusable ) ); + + if ( focusableProp ) + { + const TDesC8& focus( focusableProp->StringValue() ); + + if ( focus != XnPropertyNames::KTrue ) + { + return EFalse; + } + } + else + { + return EFalse; + } + CXnProperty* disabledProp( + aNode.GetPropertyL( XnPropertyNames::common::KDisabled ) ); + + if ( disabledProp ) + { + const TDesC8& disabled( disabledProp->StringValue() ); + + if ( disabled == XnPropertyNames::KTrue ) + { + return EFalse; + } + } + + // The node can be navigated. Then check parents display and visibilty properties + CXnNode* parent( aNode.Parent() ); + + for ( ; parent; parent = parent->Parent() ) + { + CXnProperty* displayProp( parent->DisplayL() ); + + if ( displayProp ) + { + const TDesC8& display( displayProp->StringValue() ); + + if ( display != XnPropertyNames::style::common::display::KBlock ) + { + return EFalse; + } + } + + CXnProperty* visibilityProp( parent->VisibilityL() ); + + if ( visibilityProp ) + { + const TDesC8& visibility( visibilityProp->StringValue() ); + + if ( visibility != XnPropertyNames::style::common::visibility::KVisible ) + { + return EFalse; + } + } + } + + return ETrue; + } + +// ----------------------------------------------------------------------------- +// EnableStatePropertyL() +// ----------------------------------------------------------------------------- +// +static void EnableStatePropertyL( + CXnNode& aNode, + CXnDomProperty::TPseudoClass aPseudoClass, + CXnProperty* ( CXnNode::* aGetCachedPropertyL )(), + CXnProperty*& aProperty, + RPointerArray< CXnProperty >& aArray, TInt& aLevel, + TBool aInformChange ) + { + TBool doInform( EFalse ); + + for ( TInt i = aArray.Count() - 1; i >= 0; --i ) + { + if ( aArray[i]->Property()->PseudoClass() == aPseudoClass ) + { + CXnProperty* temp( aArray[i] ); + + if ( aLevel < XnDirtyLevel::ELayoutAndRenderSiblings || + aInformChange ) + { + TInt level( XnDirtyLevel::ENone ); + + // Get current cached prop + CXnProperty* prop( ( aNode.*aGetCachedPropertyL )() ); + + if ( !temp && prop ) + { + level = DirtyLevelFromPropertyL( + aNode, prop->Property()->Name() ); + } + else if ( ( temp && !prop ) || + ( temp && prop && !prop->EqualsL( *temp ) ) ) + { + level = DirtyLevelFromPropertyL( + aNode, temp->Property()->Name() ); + } + + if ( aInformChange && ( level != XnDirtyLevel::ENone ) ) + { + doInform = ETrue; + } + + if ( level > aLevel && aNode.IsLayoutCapable()) + { + aLevel = level; + } + } + + aProperty = temp; + + if ( doInform ) + { + // Property is changed + InformPropertyChangeL( aNode, temp ); + } + + break; + } + } + } + +// ----------------------------------------------------------------------------- +// DisableStatePropertyL() +// ----------------------------------------------------------------------------- +// +static void DisableStatePropertyL( + CXnNode& aNode, + CXnDomProperty::TPseudoClass aPseudoClass, + CXnProperty* ( CXnNode::* aGetCachedPropertyL )(), + CXnProperty*& aProperty, + RPointerArray< CXnProperty >& aArray, + RArray< CXnDomProperty::TPseudoClass >& aStates, TInt& aLevel, + TBool aInformChange ) + { + CXnProperty* currentStateProperty( NULL ); + + TBool doInform( EFalse ); + + if ( aProperty && aProperty->Property()->PseudoClass() == aPseudoClass ) + { + // Is there an other pseudo state where to return? + for ( TInt i = aArray.Count() - 1; !currentStateProperty && i >= 0; --i ) + { + for ( TInt j = aStates.Count() - 1; j >= 0; --j ) + { + if ( aArray[i]->Property()->PseudoClass() == aStates[j] && + aArray[i]->Property()->PseudoClass() != aPseudoClass ) + { + currentStateProperty = aArray[i]; + break; + } + } + } + + // No, use the property from state "none" + for ( TInt i = aArray.Count() - 1; !currentStateProperty && i >= 0; --i ) + { + for ( TInt j = aStates.Count() - 1; j >= 0; --j ) + { + if ( aArray[i]->Property()->PseudoClass() == CXnDomProperty::ENone && + aArray[i]->Property()->PseudoClass() != aPseudoClass ) + { + currentStateProperty = aArray[i]; + break; + } + } + } + + CXnProperty* temp( currentStateProperty ); + + if ( aLevel < XnDirtyLevel::ELayoutAndRenderSiblings || aInformChange ) + { + TInt level( XnDirtyLevel::ENone ); + + // Get current cached prop + CXnProperty* prop( ( aNode.*aGetCachedPropertyL )() ); + + if ( !temp && prop ) + { + level = DirtyLevelFromPropertyL( aNode, prop->Property()->Name() ); + } + else if ( ( temp && !prop ) || ( temp && prop && !prop->EqualsL( *temp ) ) ) + { + level = DirtyLevelFromPropertyL( aNode, temp->Property()->Name() ); + } + + if ( aInformChange && ( level != XnDirtyLevel::ENone ) ) + { + doInform = ETrue; + } + + if ( level > aLevel && aNode.IsLayoutCapable()) + { + aLevel = level; + } + } + + aProperty = temp; + + if ( doInform ) + { + // Property is changed + InformPropertyChangeL( aNode, temp ); + } + } + } + +// ----------------------------------------------------------------------------- +// EnableStatePropertiesL() +// ----------------------------------------------------------------------------- +// +static void EnableStatePropertiesL( + CXnNode& aNode, + CXnDomProperty::TPseudoClass aPseudoClass, + CLayoutPropertyCache*& aLayoutPropertyCache ) + { + if ( !aLayoutPropertyCache ) + { + aLayoutPropertyCache = new ( ELeave ) CLayoutPropertyCache; + } + + TInt level( XnDirtyLevel::ENone ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::WidthL, + aLayoutPropertyCache->iWidth, + aLayoutPropertyCache->iWidths, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::HeightL, + aLayoutPropertyCache->iHeight, + aLayoutPropertyCache->iHeights, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::MarginLeftL, + aLayoutPropertyCache->iMarginLeft, + aLayoutPropertyCache->iMarginLefts, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::MarginRightL, + aLayoutPropertyCache->iMarginRight, + aLayoutPropertyCache->iMarginRights, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderLeftL, + aLayoutPropertyCache->iBorderLeft, + aLayoutPropertyCache->iBorderLefts, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderRightL, + aLayoutPropertyCache->iBorderRight, + aLayoutPropertyCache->iBorderRights, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::PaddingLeftL, + aLayoutPropertyCache->iPaddingLeft, + aLayoutPropertyCache->iPaddingLefts, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::PaddingRightL, + aLayoutPropertyCache->iPaddingRight, + aLayoutPropertyCache->iPaddingRights, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::MarginTopL, + aLayoutPropertyCache->iMarginTop, + aLayoutPropertyCache->iMarginTops, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::MarginBottomL, + aLayoutPropertyCache->iMarginBottom, + aLayoutPropertyCache->iMarginBottoms, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderTopL, + aLayoutPropertyCache->iBorderTop, + aLayoutPropertyCache->iBorderTops, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderBottomL, + aLayoutPropertyCache->iBorderBottom, + aLayoutPropertyCache->iBorderBottoms, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::PaddingTopL, + aLayoutPropertyCache->iPaddingTop, + aLayoutPropertyCache->iPaddingTops, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::PaddingBottomL, + aLayoutPropertyCache->iPaddingBottom, + aLayoutPropertyCache->iPaddingBottoms, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderWidthL, + aLayoutPropertyCache->iBorderWidth, + aLayoutPropertyCache->iBorderWidths, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::BlockProgressionL, + aLayoutPropertyCache->iBlockProgression, + aLayoutPropertyCache->iBlockProgressions, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::DirectionL, + aLayoutPropertyCache->iDirection, + aLayoutPropertyCache->iDirections, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::PositionL, + aLayoutPropertyCache->iPosition, + aLayoutPropertyCache->iPositions, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::MaxHeightL, + aLayoutPropertyCache->iMaxHeight, + aLayoutPropertyCache->iMaxHeights, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::MinHeightL, + aLayoutPropertyCache->iMinHeight, + aLayoutPropertyCache->iMinHeights, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::MaxWidthL, + aLayoutPropertyCache->iMaxWidth, + aLayoutPropertyCache->iMaxWidths, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::MinWidthL, + aLayoutPropertyCache->iMinWidth, + aLayoutPropertyCache->iMinWidths, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::DisplayL, + aLayoutPropertyCache->iDisplay, + aLayoutPropertyCache->iDisplays, level, ETrue ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::VisibilityL, + aLayoutPropertyCache->iVisibility, + aLayoutPropertyCache->iVisibilities, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::LeftL, + aLayoutPropertyCache->iLeft, + aLayoutPropertyCache->iLefts, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::RightL, + aLayoutPropertyCache->iRight, + aLayoutPropertyCache->iRights, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::TopL, + aLayoutPropertyCache->iTop, + aLayoutPropertyCache->iTops, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::BottomL, + aLayoutPropertyCache->iBottom, + aLayoutPropertyCache->iBottoms, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderLeftStyleL, + aLayoutPropertyCache->iBorderLeftStyle, + aLayoutPropertyCache->iBorderLeftStyles, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderRightStyleL, + aLayoutPropertyCache->iBorderRightStyle, + aLayoutPropertyCache->iBorderRightStyles, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderTopStyleL, + aLayoutPropertyCache->iBorderTopStyle, + aLayoutPropertyCache->iBorderTopStyles, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderBottomStyleL, + aLayoutPropertyCache->iBorderBottomStyle, + aLayoutPropertyCache->iBorderBottomStyles, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderStyleL, + aLayoutPropertyCache->iBorderStyle, + aLayoutPropertyCache->iBorderStyles, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::DisplayPriorityL, + aLayoutPropertyCache->iDisplayPriority, + aLayoutPropertyCache->iDisplayPriorities, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::NavIndexL, + aLayoutPropertyCache->iNavIndex, + aLayoutPropertyCache->iNavIndexes, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::ZIndexL, + aLayoutPropertyCache->iZIndex, + aLayoutPropertyCache->iZIndexes, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::BackgroundColorL, + aLayoutPropertyCache->iBackgroundColor, + aLayoutPropertyCache->iBackgroundColors, level ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::BackgroundImageL, + aLayoutPropertyCache->iBackgroundImage, + aLayoutPropertyCache->iBackgroundImages, level, ETrue ); + + EnableStatePropertyL( + aNode, aPseudoClass, CXnNode::FocusBackgroundL, + aLayoutPropertyCache->iFocusBackground, + aLayoutPropertyCache->iFocusBackgrounds, level ); + + aNode.SetDirtyL( level ); + } + +// ----------------------------------------------------------------------------- +// DisableStatePropertiesL() +// ----------------------------------------------------------------------------- +// +static void DisableStatePropertiesL( + CXnNode& aNode, + CXnDomProperty::TPseudoClass aPseudoClass, + RArray< CXnDomProperty::TPseudoClass >& aStates, + CLayoutPropertyCache*& aLayoutPropertyCache ) + { + if ( !aLayoutPropertyCache ) + { + aLayoutPropertyCache = new ( ELeave ) CLayoutPropertyCache; + } + + TInt level( XnDirtyLevel::ENone ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::WidthL, + aLayoutPropertyCache->iWidth, + aLayoutPropertyCache->iWidths, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::HeightL, + aLayoutPropertyCache->iHeight, + aLayoutPropertyCache->iHeights, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::MarginLeftL, + aLayoutPropertyCache->iMarginLeft, + aLayoutPropertyCache->iMarginLefts, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::MarginRightL, + aLayoutPropertyCache->iMarginRight, + aLayoutPropertyCache->iMarginRights, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderLeftL, + aLayoutPropertyCache->iBorderLeft, + aLayoutPropertyCache->iBorderLefts, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderRightL, + aLayoutPropertyCache->iBorderRight, + aLayoutPropertyCache->iBorderRights, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::PaddingLeftL, + aLayoutPropertyCache->iPaddingLeft, + aLayoutPropertyCache->iPaddingLefts, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::PaddingRightL, + aLayoutPropertyCache->iPaddingRight, + aLayoutPropertyCache->iPaddingRights, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::MarginTopL, + aLayoutPropertyCache->iMarginTop, + aLayoutPropertyCache->iMarginTops, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::MarginBottomL, + aLayoutPropertyCache->iMarginBottom, + aLayoutPropertyCache->iMarginBottoms, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderTopL, + aLayoutPropertyCache->iBorderTop, + aLayoutPropertyCache->iBorderTops, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderBottomL, + aLayoutPropertyCache->iBorderBottom, + aLayoutPropertyCache->iBorderBottoms, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::PaddingTopL, + aLayoutPropertyCache->iPaddingTop, + aLayoutPropertyCache->iPaddingTops, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::PaddingBottomL, + aLayoutPropertyCache->iPaddingBottom, + aLayoutPropertyCache->iPaddingBottoms, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderWidthL, + aLayoutPropertyCache->iBorderWidth, + aLayoutPropertyCache->iBorderWidths, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::BlockProgressionL, + aLayoutPropertyCache->iBlockProgression, + aLayoutPropertyCache->iBlockProgressions, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::DirectionL, + aLayoutPropertyCache->iDirection, + aLayoutPropertyCache->iDirections, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::PositionL, + aLayoutPropertyCache->iPosition, + aLayoutPropertyCache->iPositions, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::MaxHeightL, + aLayoutPropertyCache->iMaxHeight, + aLayoutPropertyCache->iMaxHeights, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::MinHeightL, + aLayoutPropertyCache->iMinHeight, + aLayoutPropertyCache->iMinHeights, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::MaxWidthL, + aLayoutPropertyCache->iMaxWidth, + aLayoutPropertyCache->iMaxWidths, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::MinWidthL, + aLayoutPropertyCache->iMinWidth, + aLayoutPropertyCache->iMinWidths, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::DisplayL, + aLayoutPropertyCache->iDisplay, + aLayoutPropertyCache->iDisplays, aStates, level, ETrue ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::VisibilityL, + aLayoutPropertyCache->iVisibility, + aLayoutPropertyCache->iVisibilities, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::LeftL, + aLayoutPropertyCache->iLeft, + aLayoutPropertyCache->iLefts, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::RightL, + aLayoutPropertyCache->iRight, + aLayoutPropertyCache->iRights, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::TopL, + aLayoutPropertyCache->iTop, + aLayoutPropertyCache->iTops, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::BottomL, + aLayoutPropertyCache->iBottom, + aLayoutPropertyCache->iBottoms, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderLeftStyleL, + aLayoutPropertyCache->iBorderLeftStyle, + aLayoutPropertyCache->iBorderLeftStyles, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderRightStyleL, + aLayoutPropertyCache->iBorderRightStyle, + aLayoutPropertyCache->iBorderRightStyles, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderTopStyleL, + aLayoutPropertyCache->iBorderTopStyle, + aLayoutPropertyCache->iBorderTopStyles, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderBottomStyleL, + aLayoutPropertyCache->iBorderBottomStyle, + aLayoutPropertyCache->iBorderBottomStyles, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::BorderStyleL, + aLayoutPropertyCache->iBorderStyle, + aLayoutPropertyCache->iBorderStyles, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::DisplayPriorityL, + aLayoutPropertyCache->iDisplayPriority, + aLayoutPropertyCache->iDisplayPriorities, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::NavIndexL, + aLayoutPropertyCache->iNavIndex, + aLayoutPropertyCache->iNavIndexes, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::ZIndexL, + aLayoutPropertyCache->iZIndex, + aLayoutPropertyCache->iZIndexes, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::BackgroundColorL, + aLayoutPropertyCache->iBackgroundColor, + aLayoutPropertyCache->iBackgroundColors, aStates, level ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::BackgroundImageL, + aLayoutPropertyCache->iBackgroundImage, + aLayoutPropertyCache->iBackgroundImages, aStates, level, ETrue ); + + DisableStatePropertyL( + aNode, aPseudoClass, CXnNode::FocusBackgroundL, + aLayoutPropertyCache->iFocusBackground, + aLayoutPropertyCache->iFocusBackgrounds, aStates, level ); + + aNode.SetDirtyL( level ); + } + +// ----------------------------------------------------------------------------- +// AllocateLayoutCache() +// ----------------------------------------------------------------------------- +// +static TBool AllocateLayoutCache( CLayoutPropertyCache*& aLayoutPropertyCache ) + { + if ( !aLayoutPropertyCache ) + { + aLayoutPropertyCache = new CLayoutPropertyCache; + } + + return aLayoutPropertyCache ? ETrue : EFalse; + } + +// ----------------------------------------------------------------------------- +// DoSetCachedProperty() +// ----------------------------------------------------------------------------- +// +static void DoSetCachedProperty( + CXnProperty* aProperty,\ + CXnProperty*& aCachedPropertyToSet, + RPointerArray< CXnProperty >& aArray, + TBool aInitializing, + TBool aArrayOnly ) + { + ReplaceOrAppend( aProperty, aArray, aInitializing ); + + if ( !aArrayOnly ) + { + aCachedPropertyToSet = aProperty; + } + } + +// ----------------------------------------------------------------------------- +// SetCachedProperty() +// ----------------------------------------------------------------------------- +// +static void SetCachedProperty( + CXnProperty* aProperty, + CLayoutPropertyCache*& aLayoutPropertyCache, + CXnProperty*& aRef, + CXnProperty*& aName, + CXnProperty*& aValue, + CXnProperty*& aLabel, + CXnProperty*& aInitialFocus, + CXnProperty*& aClass, + CXnProperty*& aId, + CXnProperty*& aPath, + CXnProperty*& aMaskPath, + CGridPropertyCache*& aGridPropertyCache, + TBool aInitializing, + TBool aArrayOnly) + { + const TDesC8& name = aProperty->Property()->Name(); + if ( !AllocateLayoutCache( aLayoutPropertyCache ) ) + { + return; + } + if ( name == XnPropertyNames::common::KId ) + { + aId = aProperty; + } + else if ( name == XnPropertyNames::common::KClass ) + { + aClass = aProperty; + } + else if ( name == XnPropertyNames::style::common::KWidth ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iWidth, + aLayoutPropertyCache->iWidths, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KHeight ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iHeight, + aLayoutPropertyCache->iHeights, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KBlockProgression ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iBlockProgression, + aLayoutPropertyCache->iBlockProgressions, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KDirection ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iDirection, + aLayoutPropertyCache->iDirections, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KPosition ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iPosition, + aLayoutPropertyCache->iPositions, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KDisplay ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iDisplay, + aLayoutPropertyCache->iDisplays, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KVisibility ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iVisibility, + aLayoutPropertyCache->iVisibilities, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::action::KName ) + { + aName = aProperty; + } + else if ( name == XnPropertyNames::action::KValue ) + { + aValue = aProperty; + } + else if ( name == XnPropertyNames::menu::KLabel ) + { + aLabel = aProperty; + } + else if ( name == XnPropertyNames::image::KPath ) + { + aPath = aProperty; + } + else if ( name == XnPropertyNames::image::KMaskPath ) + { + aMaskPath = aProperty; + } + else if ( name == KRef ) + { + aRef = aProperty; + } + else if ( name == XnPropertyNames::style::common::KMarginLeft ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iMarginLeft, + aLayoutPropertyCache->iMarginLefts, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KMarginRight ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iMarginRight, + aLayoutPropertyCache->iMarginRights, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KBorderLeftWidth ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iBorderLeft, + aLayoutPropertyCache->iBorderLefts, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KBorderRightWidth ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iBorderRight, + aLayoutPropertyCache->iBorderRights, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KPaddingLeft ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iPaddingLeft, + aLayoutPropertyCache->iPaddingLefts, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KPaddingRight ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iPaddingRight, + aLayoutPropertyCache->iPaddingRights, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KMarginTop ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iMarginTop, + aLayoutPropertyCache->iMarginTops, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KMarginBottom ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iMarginBottom, + aLayoutPropertyCache->iMarginBottoms, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KBorderTopWidth ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iBorderTop, + aLayoutPropertyCache->iBorderTops, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KBorderBottomWidth ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iBorderBottom, + aLayoutPropertyCache->iBorderBottoms, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KPaddingTop ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iPaddingTop, + aLayoutPropertyCache->iPaddingTops, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KPaddingBottom ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iPaddingBottom, + aLayoutPropertyCache->iPaddingBottoms, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KBorderWidth ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iBorderWidth, + aLayoutPropertyCache->iBorderWidths, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KMaxHeight ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iMaxHeight, + aLayoutPropertyCache->iMaxHeights, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KMinHeight ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iMinHeight, + aLayoutPropertyCache->iMinHeights, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KMaxWidth ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iMaxWidth, + aLayoutPropertyCache->iMaxWidths, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KMinWidth ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iMinWidth, + aLayoutPropertyCache->iMinWidths, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KLeft ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iLeft, + aLayoutPropertyCache->iLefts, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KRight ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iRight, + aLayoutPropertyCache->iRights, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KTop ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iTop, + aLayoutPropertyCache->iTops, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KBottom ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iBottom, + aLayoutPropertyCache->iBottoms, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::appearance::common::KBorderLeftStyle ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iBorderLeftStyle, + aLayoutPropertyCache->iBorderLeftStyles, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::appearance::common::KBorderRightStyle ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iBorderRightStyle, + aLayoutPropertyCache->iBorderRightStyles, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::appearance::common::KBorderTopStyle ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iBorderTopStyle, + aLayoutPropertyCache->iBorderTopStyles, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::appearance::common::KBorderBottomStyle ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iBorderBottomStyle, + aLayoutPropertyCache->iBorderBottomStyles, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::appearance::common::KBorderStyle ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iBorderStyle, + aLayoutPropertyCache->iBorderStyles, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::appearance::common::KBorderImage ) + { + aLayoutPropertyCache->iBorderImage = aProperty; + } + else if ( name == XnPropertyNames::style::common::KZIndex ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iZIndex, + aLayoutPropertyCache->iZIndexes, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::appearance::common::KBackGroundColor ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iBackgroundColor, + aLayoutPropertyCache->iBackgroundColors, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::appearance::common::KBackGroundImage ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iBackgroundImage, + aLayoutPropertyCache->iBackgroundImages, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::appearance::common::KFocusBackground ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iFocusBackground, + aLayoutPropertyCache->iFocusBackgrounds, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::style::common::KS60DisplayPriority ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iDisplayPriority, + aLayoutPropertyCache->iDisplayPriorities, + aInitializing, aArrayOnly ); + } + else if ( name == XnPropertyNames::common::KInitialFocus ) + { + aInitialFocus = aProperty; + } + else if ( name == XnPropertyNames::style::common::KNavIndex ) + { + DoSetCachedProperty( + aProperty, + aLayoutPropertyCache->iNavIndex, + 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; + } + } + } + +// ----------------------------------------------------------------------------- +// ReplaceOrAppend() +// ----------------------------------------------------------------------------- +// +static void ReplaceOrAppend( + CXnProperty* aProperty, + RPointerArray< CXnProperty >& aArray, + TBool aAppendOnly ) + { + if ( !aAppendOnly ) + { + for ( TInt i = aArray.Count() - 1; i >= 0; --i ) + { + if ( aArray[i] == aProperty ) + { + aArray.Remove( i ); + } + else if ( aArray[i]->Property()->PseudoClass() == + aProperty->Property()->PseudoClass() && + aArray[i]->Property()->Name() == + aProperty->Property()->Name() ) + { + aArray.Remove( i ); + } + } + } + aArray.Append( aProperty ); + } + +// ----------------------------------------------------------------------------- +// IsPropertyPseudoClass() +// ----------------------------------------------------------------------------- +// +static TBool IsPropertyPseudoClass( + CXnDomProperty::TPseudoClass aPseudoClass, + RArray< CXnDomProperty::TPseudoClass >& aArray ) + { + for ( TInt i = aArray.Count() - 1; i >= 0; --i ) + { + if ( aArray[i] == aPseudoClass ) + { + return ETrue; + } + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// InsertPropertyPseudoClassL() +// ----------------------------------------------------------------------------- +// +static void InsertPropertyPseudoClassL( + CXnDomProperty::TPseudoClass aPseudoClass, + RArray< CXnDomProperty::TPseudoClass >& aArray ) + { + if ( !IsPropertyPseudoClass( aPseudoClass, aArray ) ) + { + User::LeaveIfError( aArray.Append( aPseudoClass ) ); + } + } + +// ----------------------------------------------------------------------------- +// BuildEventTypeNodeL +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildEventTypeNodeL( TEventCode aType, CXnUiEngine& aUiEngine ) + { + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + CXnType* type = CXnType::NewL( XnPropertyNames::action::KProperty ); + CleanupStack::PushL( type ); + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( nameValue ); + nameValue->SetStringValueL( + CXnDomPropertyValue::EString, + XnPropertyNames::action::trigger::name::keyevent::KEventType ); + CXnProperty* name = CXnProperty::NewL( + XnPropertyNames::action::KName, + nameValue, aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + node->SetPropertyL( name ); + CleanupStack::Pop( name ); + CXnDomPropertyValue* valueValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( valueValue ); + valueValue->SetFloatValueL( CXnDomPropertyValue::ENumber, aType ); + CXnProperty* value = CXnProperty::NewL( + XnPropertyNames::action::KValue, valueValue, + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( valueValue ); + CleanupStack::PushL( value ); + node->SetPropertyL( value ); + CleanupStack::Pop( value ); + CleanupStack::Pop( node ); + return node; + } + +// ----------------------------------------------------------------------------- +// BuildModifiersNodeL +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildModifiersNodeL( + const TKeyEvent& aKeyEvent, + CXnUiEngine& aUiEngine ) + { + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + CXnType* type = CXnType::NewL( XnPropertyNames::action::KProperty ); + CleanupStack::PushL( type ); + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( nameValue ); + nameValue->SetStringValueL( + CXnDomPropertyValue::EString, + XnPropertyNames::action::trigger::name::keyevent::KModifiers ); + CXnProperty* name = CXnProperty::NewL( + XnPropertyNames::action::KName, + nameValue, + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + node->SetPropertyL( name ); + CleanupStack::Pop( name ); + CXnDomPropertyValue* valueValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( valueValue ); + valueValue->SetFloatValueL( + CXnDomPropertyValue::ENumber, aKeyEvent.iModifiers ); + CXnProperty* value = CXnProperty::NewL( + XnPropertyNames::action::KValue, + valueValue, + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( valueValue ); + CleanupStack::PushL( value ); + node->SetPropertyL( value ); + CleanupStack::Pop( value ); + CleanupStack::Pop( node ); + return node; + } + +// ----------------------------------------------------------------------------- +// BuildKeyCodeNodeL +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildKeyCodeNodeL( + const TKeyEvent& aKeyEvent, + CXnUiEngine& aUiEngine ) + { + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + CXnType* type = CXnType::NewL( XnPropertyNames::action::KProperty ); + CleanupStack::PushL( type ); + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( nameValue ); + nameValue->SetStringValueL( + CXnDomPropertyValue::EString, + XnPropertyNames::action::trigger::name::keyevent::KKeyCode ); + CXnProperty* name = CXnProperty::NewL( + XnPropertyNames::action::KName, + nameValue, + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + node->SetPropertyL( name ); + CleanupStack::Pop( name ); + CXnDomPropertyValue* valueValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( valueValue ); + valueValue->SetFloatValueL( CXnDomPropertyValue::ENumber, aKeyEvent.iCode ); + CXnProperty* value = CXnProperty::NewL( + XnPropertyNames::action::KValue, + valueValue, + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( valueValue ); + CleanupStack::PushL( value ); + node->SetPropertyL( value ); + CleanupStack::Pop( value ); + CleanupStack::Pop( node ); + return node; + } + +// ----------------------------------------------------------------------------- +// BuildScanCodeNodeL +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildScanCodeNodeL( + const TKeyEvent& aKeyEvent, + CXnUiEngine& aUiEngine ) + { + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + CXnType* type = CXnType::NewL( XnPropertyNames::action::KProperty ); + CleanupStack::PushL( type ); + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( nameValue ); + nameValue->SetStringValueL( + CXnDomPropertyValue::EString, + XnPropertyNames::action::trigger::name::keyevent::KScanCode ); + CXnProperty* name = CXnProperty::NewL( + XnPropertyNames::action::KName, + nameValue, + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + node->SetPropertyL( name ); + CleanupStack::Pop( name ); + CXnDomPropertyValue* valueValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( valueValue ); + valueValue->SetFloatValueL( + CXnDomPropertyValue::ENumber, aKeyEvent.iScanCode ); + CXnProperty* value = CXnProperty::NewL( + XnPropertyNames::action::KValue, + valueValue, + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( valueValue ); + CleanupStack::PushL( value ); + node->SetPropertyL( value ); + CleanupStack::Pop( value ); + CleanupStack::Pop( node ); + return node; + } + +// ----------------------------------------------------------------------------- +// BuildRepeatsNodeL +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildRepeatsNodeL( + const TKeyEvent& aKeyEvent, + CXnUiEngine& aUiEngine ) + { + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + CXnType* type = CXnType::NewL( XnPropertyNames::action::KProperty ); + CleanupStack::PushL( type ); + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( nameValue ); + nameValue->SetStringValueL( + CXnDomPropertyValue::EString, + XnPropertyNames::action::trigger::name::keyevent::KRepeats ); + CXnProperty* name = CXnProperty::NewL( + XnPropertyNames::action::KName, + nameValue, + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + node->SetPropertyL( name ); + CleanupStack::Pop( name ); + CXnDomPropertyValue* valueValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( valueValue ); + valueValue->SetFloatValueL( + CXnDomPropertyValue::ENumber, aKeyEvent.iRepeats ); + CXnProperty* value = CXnProperty::NewL( + XnPropertyNames::action::KValue, + valueValue, + aUiEngine.ODT()->DomDocument().StringPool()) ; + CleanupStack::Pop( valueValue ); + CleanupStack::PushL( value ); + node->SetPropertyL( value ); + CleanupStack::Pop( value ); + CleanupStack::Pop( node ); + return node; + } + +// ----------------------------------------------------------------------------- +// BuildActivateTriggerNodeL +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildActivateTriggerNodeL( CXnUiEngine& aUiEngine ) + { + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger ); + CleanupStack::PushL( type ); + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( nameValue ); + nameValue->SetStringValueL( CXnDomPropertyValue::EString, + XnPropertyNames::action::trigger::name::KActivate ); + CXnProperty* name = CXnProperty::NewL( + XnPropertyNames::action::trigger::KName, + nameValue, + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + node->SetPropertyL( name ); + CleanupStack::Pop( name ); + CleanupStack::Pop( node ); + return node; + } + +// ----------------------------------------------------------------------------- +// BuildPropertyNodesL +// ----------------------------------------------------------------------------- +// +static void BuildPropertyNodesL( + CXnNode& aNode, + const TKeyEvent& aKeyEvent, + TEventCode aType, + CXnUiEngine& aUiEngine ) + { + CXnNode* eventType = BuildEventTypeNodeL( aType, aUiEngine ); + CleanupStack::PushL( eventType ); + aNode.AddChildL( eventType ); + CleanupStack::Pop( eventType ); + CXnNode* modifiers = BuildModifiersNodeL( aKeyEvent, aUiEngine ); + CleanupStack::PushL( modifiers ); + aNode.AddChildL( modifiers ); + CleanupStack::Pop( modifiers ); + CXnNode* keyCode = BuildKeyCodeNodeL( aKeyEvent, aUiEngine ); + CleanupStack::PushL( keyCode ); + aNode.AddChildL( keyCode ); + CleanupStack::Pop( keyCode ); + CXnNode* scanCode = BuildScanCodeNodeL( aKeyEvent, aUiEngine ); + CleanupStack::PushL( scanCode ); + aNode.AddChildL( scanCode ); + CleanupStack::Pop( scanCode ); + CXnNode* repeats = BuildRepeatsNodeL( aKeyEvent, aUiEngine ); + CleanupStack::PushL( repeats ); + aNode.AddChildL( repeats ); + CleanupStack::Pop( repeats ); + } + +// ----------------------------------------------------------------------------- +// BuildKeyTriggerNodeL +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildKeyTriggerNodeL( + const TKeyEvent& aKeyEvent, + TEventCode aType, + CXnUiEngine& aUiEngine ) + { + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger ); + CleanupStack::PushL( type ); + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( nameValue ); + nameValue->SetStringValueL( + CXnDomPropertyValue::EString, + XnPropertyNames::action::trigger::name::KKeyEvent ); + CXnProperty* name = CXnProperty::NewL( + XnPropertyNames::action::trigger::KName, + nameValue, + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + node->SetPropertyL( name ); + CleanupStack::Pop( name ); + BuildPropertyNodesL( *node, aKeyEvent, aType, aUiEngine ); + CleanupStack::Pop( node ); + return node; + } + +// ----------------------------------------------------------------------------- +// PseudoClassFromName +// ----------------------------------------------------------------------------- +// +static CXnDomProperty::TPseudoClass PseudoClassFromName( const TDesC8& aName ) + { + if ( aName == KPseudoClassFocus ) + { + return CXnDomProperty::EFocus; + } + else if ( aName == KPseudoClassPassiveFocus ) + { + return CXnDomProperty::EPassiveFocus; + } + else if ( aName == KPseudoClassHold ) + { + return CXnDomProperty::EHold; + } + else if ( aName == KPseudoClassHover ) + { + return CXnDomProperty::EHover; + } + else if ( aName == KPseudoClassLink ) + { + return CXnDomProperty::ELink; + } + else if ( aName == KPseudoClassVisited ) + { + return CXnDomProperty::EVisited; + } + else if ( aName == KPseudoClassActive ) + { + return CXnDomProperty::EActive; + } + else if ( aName == KPseudoClassEdit ) + { + return CXnDomProperty::EEdit; + } + else if ( aName == KPseudoClassPressedDown ) + { + return CXnDomProperty::EPressedDown; + } + return CXnDomProperty::ENone; + } + +// ----------------------------------------------------------------------------- +// PseudoClassName +// ----------------------------------------------------------------------------- +// +static const TDesC8& PseudoClassName( CXnDomProperty::TPseudoClass aPseudoClass ) + { + switch ( aPseudoClass ) + { + case CXnDomProperty::EFocus: + return KPseudoClassFocus; + case CXnDomProperty::EPassiveFocus: + return KPseudoClassPassiveFocus; + case CXnDomProperty::EHold: + return KPseudoClassHold; + case CXnDomProperty::EHover: + return KPseudoClassHover; + case CXnDomProperty::ELink: + return KPseudoClassLink; + case CXnDomProperty::EVisited: + return KPseudoClassVisited; + case CXnDomProperty::EActive: + return KPseudoClassActive; + case CXnDomProperty::EEdit: + return KPseudoClassEdit; + default: + return KNullDesC8; + } + } + +// ----------------------------------------------------------------------------- +// CheckRefAttributeL +// ----------------------------------------------------------------------------- +// +static const TDesC8* CheckRefAttributeL( CXnProperty* aRef ) + { + if ( !aRef ) + { + return NULL; + } + + return &aRef->StringValue(); + } + +// ----------------------------------------------------------------------------- +// DoMatchTriggerForKeyEventL +// ----------------------------------------------------------------------------- +// +static TBool DoMatchTriggerForKeyEventL( + const TKeyEvent& aKeyEvent, TEventCode aType, + CXnDomNode& aTriggerNode ) + { + TInt triggerEventType = EEventKeyDown; + TInt triggerKeyCode = 0; + TInt triggerScanCode = 0; + TInt triggerModifiers = 0; + CXnDomList& triggerChildren = aTriggerNode.ChildNodes(); + TInt triggerCount = triggerChildren.Length(); + TBool triggerScanCodeSet = EFalse; + TBool triggerKeyCodeSet = EFalse; + for ( TInt i = 0; i < triggerCount; ++i ) + { + CXnDomNode* node = static_cast< CXnDomNode* >( + triggerChildren.Item( i ) ); + CXnDomList& attrs = node->AttributeList(); + CXnDomAttribute* nameAttribute = static_cast< CXnDomAttribute* >( + attrs.FindByName( XnPropertyNames::action::KName ) ); + CXnDomAttribute* valueAttribute = static_cast< CXnDomAttribute* >( + attrs.FindByName( XnPropertyNames::action::KValue ) ); + if ( nameAttribute->Value() == + XnPropertyNames::action::trigger::name::keyevent::KEventType ) + { + TLex8 lex( valueAttribute->Value() ); + lex.Val( triggerEventType ); + } + else if ( nameAttribute->Value() == + XnPropertyNames::action::trigger::name::keyevent::KModifiers ) + { + TLex8 lex( valueAttribute->Value() ); + lex.Val( triggerModifiers ); + } + else if ( nameAttribute->Value() == + XnPropertyNames::action::trigger::name::keyevent::KKeyCode ) + { + TLex8 lex( valueAttribute->Value() ); + lex.Val( triggerKeyCode ); + triggerKeyCodeSet = ETrue; + } + else if ( nameAttribute->Value() == + XnPropertyNames::action::trigger::name::keyevent::KScanCode ) + { + TLex8 lex( valueAttribute->Value() ); + lex.Val( triggerScanCode ); + triggerScanCodeSet = ETrue; + } + } + return + aType == triggerEventType && + ( triggerKeyCodeSet ? ( aKeyEvent.iCode == triggerKeyCode ) : ETrue ) && + ( triggerScanCodeSet ? ( aKeyEvent.iScanCode == triggerScanCode ) : ETrue ) && + ( ( aKeyEvent.iModifiers & 0xFFFFFFFE ) == ( triggerModifiers & 0xFFFFFFFE ) ); + } + +// ----------------------------------------------------------------------------- +// MatchTriggerForKeyEventL +// ----------------------------------------------------------------------------- +// +static TBool MatchTriggerForKeyEventL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnNode& aNode, + const TKeyEvent& aKeyEvent, + TEventCode aType, + CXnDomNode& aActionNode, + CXnDomNode& aTriggerNode ) + { + CXnDomList& attrs = aTriggerNode.AttributeList(); + CXnDomAttribute* attribute = static_cast< CXnDomAttribute* >( + attrs.FindByName(XnPropertyNames::action::trigger::KName ) ); + if ( !attribute ) + { + return EFalse; + } + + const TDesC8& nameString = attribute->Value(); + if ( nameString == KNullDesC8 ) + { + return EFalse; + } + if ( nameString == XnPropertyNames::action::trigger::name::KKeyEvent ) + { + TBool match = DoMatchTriggerForKeyEventL( aKeyEvent, aType, aTriggerNode ); + if ( match ) + { + CXnNode* eventNode = BuildKeyTriggerNodeL( aKeyEvent, aType, aEngine ); + CleanupStack::PushL( eventNode ); + RunEventsL( aThis, aEngine, aNode, aActionNode, aTriggerNode, *eventNode ); + CleanupStack::PopAndDestroy( eventNode ); + } + return match; + } + else if ( aType == EEventKey && + ( nameString == XnPropertyNames::action::trigger::name::KUp || + nameString == XnPropertyNames::action::trigger::name::KDown || + nameString == XnPropertyNames::action::trigger::name::KLeft || + nameString == XnPropertyNames::action::trigger::name::KRight ) ) + { + TBool match = DoMatchTriggerForHighLevelKeyEventL( + aNode, aKeyEvent, aType, nameString ); + if ( match ) + { + CXnNode* eventNode = BuildKeyTriggerNodeL( aKeyEvent, aType, aEngine ); + CleanupStack::PushL( eventNode ); + RunEventsL( aThis, aEngine, aNode, aActionNode, aTriggerNode, *eventNode ); + CleanupStack::PopAndDestroy( eventNode ); + } + return match; + } + else if ( aKeyEvent.iScanCode == EStdKeyDevice3 && + aKeyEvent.iRepeats > 0 && + nameString == XnPropertyNames::action::trigger::name::KHold ) + { + CXnNode* eventNode = BuildKeyTriggerNodeL( aKeyEvent, aType, aEngine ); + CleanupStack::PushL( eventNode ); + RunEventsL( aThis, aEngine, aNode, aActionNode, aTriggerNode, *eventNode ); + CleanupStack::PopAndDestroy( eventNode ); + return ETrue; + } + else if ( ( ( aKeyEvent.iScanCode == EStdKeyDevice0 ) || + ( aKeyEvent.iScanCode == EStdKeyDevice1 ) ) && + aKeyEvent.iRepeats > 0 && + nameString == XnPropertyNames::action::trigger::name::KHold ) + { + CXnNode* eventNode = BuildKeyTriggerNodeL( aKeyEvent, aType, aEngine ); + CleanupStack::PushL( eventNode ); + RunEventsL( aThis, aEngine, aNode, aActionNode, aTriggerNode, *eventNode ); + CleanupStack::PopAndDestroy( eventNode ); + return ETrue; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// 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->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 +// ----------------------------------------------------------------------------- +// +static TBool MatchActivateTriggerPropertiesL( + CXnNode& aEventData, + CXnDomNode& aTriggerNode ) + { + RPointerArray< CXnNode >& eventChildren = aEventData.Children(); + TInt eventCount = eventChildren.Count(); + + if ( eventCount ) + { + CXnNode* node = eventChildren[0]; + CXnProperty* nameProperty = node->NameL(); + CXnProperty* valueProperty = node->ValueL(); + + if ( !nameProperty || !valueProperty ) + { + return EFalse; + } + + const TDesC8& name = nameProperty->StringValue(); + + if ( name == XnPropertyNames::action::trigger::name::keyevent::KEventType ) + { + const TDesC8& valueName = valueProperty->StringValue(); + + CXnDomList& children = aTriggerNode.ChildNodes(); + TInt count = children.Length(); + + if ( ( valueName == _L8( "3" ) ) ) //keydown + { + // check that no eventype has been defined + if ( !count ) + { + return EFalse; + } + } + else if ( ( valueName == _L8( "2" ) ) ) //keyup + { + ///check that some eventtype has been defined + if ( !count ) + { + return EFalse; + } + + CXnDomNode* node = static_cast< CXnDomNode* >( children.Item( 0 ) ); + CXnDomList& attrs = node->AttributeList(); + CXnDomAttribute* nameAttribute = static_cast< CXnDomAttribute* >( + attrs.FindByName( XnPropertyNames::action::KName ) ); + CXnDomAttribute* valueAttribute = static_cast< CXnDomAttribute* >( + attrs.FindByName( XnPropertyNames::action::KValue ) ); + + const TDesC8& name = nameAttribute->Value(); + + // check that eventype name matches + if ( name != + XnPropertyNames::action::trigger::name::keyevent::KEventType ) + { + return EFalse; + } + else + { + //check that eventype value matches + const TDesC8& valueName = valueAttribute->Value(); + if ( valueName != _L8( "2" ) ) + { + return EFalse; + } + } + } + } + } + + return ETrue; + } + +// ----------------------------------------------------------------------------- +// MatchScreenDeviceChangePropertiesL +// Checks if triggered node properties match +// ones defined in theme +// ----------------------------------------------------------------------------- +// +static TBool MatchScreenDeviceChangePropertiesL( + CXnNode& aEventData, + CXnDomNode& aTriggerNode ) + { + CXnDomList& attributeList( aTriggerNode.AttributeList() ); + + const TDesC8& reason( + XnPropertyNames::action::trigger::name::uidefinitionmodification::KReason ); + + CXnDomAttribute* attribute( static_cast< CXnDomAttribute* > + ( attributeList.FindByName( reason ) ) ); + + if ( !attribute ) + { + // Reason not defined, run events for plain screendevicechange trigger + return ETrue; + } + + const TDesC8& value( attribute->Value() ); + + if ( value == + XnPropertyNames::action::trigger::name::uidefinitionmodification::reason::KLandscape || + value == + XnPropertyNames::action::trigger::name::uidefinitionmodification::reason::KPortrait ) + { + CXnProperty* reasonProp( aEventData.GetPropertyL( reason ) ); + + if ( reasonProp ) + { + const TDesC8& reasonValue( reasonProp->StringValue() ); + + if ( reasonValue == value ) + { + return ETrue; + } + } + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// MatchSwipeTriggerL +// Check if trigger matches the one defined in theme +// ----------------------------------------------------------------------------- +// +static TBool MatchSwipeTriggerL( + CXnNode& aEventData, + CXnDomNode& aTriggerNode ) + { + CXnDomList& attributeList( aTriggerNode.AttributeList() ); + + const TDesC8& reason( XnPropertyNames::action::trigger::name::swipe::KDirection); + + CXnDomAttribute* attribute( static_cast< CXnDomAttribute* > + ( attributeList.FindByName( reason ) ) ); + + if ( !attribute ) + { + // Reason not defined + return EFalse; + } + + const TDesC8& value( attribute->Value() ); + + if ( value == XnPropertyNames::action::trigger::name::swipe::direction::KLeft || + value == XnPropertyNames::action::trigger::name::swipe::direction::KRight ) + { + CXnProperty* reasonProp( aEventData.GetPropertyL( reason ) ); + + if ( reasonProp ) + { + const TDesC8& reasonValue( reasonProp->StringValue() ); + + if ( reasonValue == value ) + { + return ETrue; + } + } + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// MatchValueAttributeTriggerL +// Check if trigger matches the one defined in theme +// ----------------------------------------------------------------------------- +// +static TBool MatchValueAttributeTriggerL( CXnNode& aEventData, + CXnDomNode& aTriggerNode ) + { + CXnDomList& attributeList( aTriggerNode.AttributeList() ); + + const TDesC8& reason( XnPropertyNames::action::KValue ); + + CXnDomAttribute* attribute( static_cast< CXnDomAttribute* > + ( attributeList.FindByName( reason ) ) ); + + if ( !attribute ) + { + // Reason not defined + return EFalse; + } + + const TDesC8& value( attribute->Value() ); + + CXnProperty* reasonProp( aEventData.GetPropertyL( reason ) ); + + if ( reasonProp ) + { + const TDesC8& reasonValue( reasonProp->StringValue() ); + + if ( reasonValue == value ) + { + return ETrue; + } + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// MatchTitleScrollTriggerL +// ----------------------------------------------------------------------------- +// +static TBool MatchTitleScrollTriggerL(CXnNode& aEventData, + CXnDomNode& aTriggerNode ) + { + CXnDomList& attributeList( aTriggerNode.AttributeList() ); + + const TDesC8& reason( XnPropertyNames::action::trigger::name::KTitleIndex ); + + CXnDomAttribute* attribute( static_cast< CXnDomAttribute* > + ( attributeList.FindByName( reason ) ) ); + + if ( !attribute ) + { + // Reason not defined + return ETrue; + } + else + { + const TDesC8& value( attribute->Value() ); + + CXnProperty* reasonProp( aEventData.GetPropertyL( reason ) ); + + if ( reasonProp ) + { + const TDesC8& reasonValue( reasonProp->StringValue() ); + + if ( reasonValue == value ) + { + return ETrue; + } + } + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// MatchTriggerForEventL +// ----------------------------------------------------------------------------- +// +static TBool MatchTriggerForEventL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnNode& aNode, + CXnNode& aEventData, + CXnDomNode& aActionNode, + CXnDomNode& aTriggerNode, + TInt aSource ) + { + const TDesC8& nameString( aTriggerNode.AttributeValue( KName ) ); + + if ( nameString == KNullDesC8 ) + { + return EFalse; + } + + CXnProperty* eventName( aEventData.NameL() ); + const TDesC8& eventNameString( eventName->StringValue() ); + + 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 ( !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 ) + { + if ( !MatchTitleScrollTriggerL( aEventData, aTriggerNode ) ) + { + return EFalse; + } + } + else if ( nameString == + XnPropertyNames::action::trigger::name::KScreenDeviceChange ) + { + if ( !MatchScreenDeviceChangePropertiesL( aEventData, aTriggerNode ) ) + { + return EFalse; + } + } + else if ( nameString == XnPropertyNames::action::trigger::name::KSwipe ) + { + if ( !MatchSwipeTriggerL( aEventData, aTriggerNode ) ) + { + return EFalse; + } + } + else if ( nameString == XnPropertyNames::action::trigger::name::KWidgetAmount || + nameString == XnPropertyNames::action::trigger::name::KCallState || + nameString == XnPropertyNames::action::trigger::name::KEditMode ) + { + if ( !MatchValueAttributeTriggerL( aEventData, aTriggerNode ) ) + { + 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 ); + + return ETrue; + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// GetFocusCandidatesL +// ----------------------------------------------------------------------------- +// +static void GetFocusCandidatesL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnDomNode& aEventNode, + RPointerArray< CXnNode >& aFocusCandidates ) + { + 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() ); + + // Is the event's node child a property? + if ( type == XnPropertyNames::action::KProperty ) + { + CXnDomList& attributeList( dnode->AttributeList() ); + + CXnDomAttribute* attribute( static_cast< CXnDomAttribute* > + ( attributeList.FindByName( XnPropertyNames::action::KValue ) ) ); + + if ( attribute ) + { + CXnNode* node( aEngine.FindNodeByIdL( + attribute->Value(), aThis->Namespace() ) ); + + if ( node ) + { + aFocusCandidates.AppendL( node ); + } + } + } + } + } + +// ----------------------------------------------------------------------------- +// RunPassiveFocusChangeL +// ----------------------------------------------------------------------------- +// +static void RunPassiveFocusChangeL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnDomNode& aEventNode, + const TDesC8& aString ) + { + 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 ) + { + CXnDomList& attrs = dnode->AttributeList(); + CXnDomAttribute* attribute = static_cast< CXnDomAttribute* >( + attrs.FindByName(XnPropertyNames::action::KValue ) ); + if ( attribute ) + { + CXnNode* node = aEngine.FindNodeByIdL( + attribute->Value(), aThis->Namespace() ); + if ( node ) + { + if ( aString == XnPropertyNames::action::event::KSetPassiveFocus ) + { + aEngine.AddPassiveFocusedNodeL( node ); + } + else if ( aString == XnPropertyNames::action::event::KResetPassiveFocus ) + { + aEngine.RemovePassiveFocusedNodeL( node ); + } + else if ( aString == XnPropertyNames::action::event::KSetActiveFocus ) + { + CXnNode* previousNode = aEngine.FocusedNode(); + if ( previousNode != node ) + { + if ( IsNodeNavigableL( *node ) ) + { + node->SetStateL( XnPropertyNames::style::common::KFocus ); + aEngine.AddPassiveFocusedNodeL( previousNode ); + break; + } + } + } + } + } + } + } + } + +// ----------------------------------------------------------------------------- +// RunAppUiNotificationL +// ----------------------------------------------------------------------------- +// +static void RunAppUiNotificationL( + CXnUiEngine& aEngine, + CXnNode& aNode, + CXnDomNode& aEventNode, + CXnDomNode& aTriggerNode, + CXnNode& aEventData ) + { + CXnAppUiAdapter& adapter( aEngine.AppUiAdapter() ); + + adapter.HandleXuikonEventL( + aNode.AppIfL(), aEventData.AppIfL(), aTriggerNode, aEventNode ); + } + +// ----------------------------------------------------------------------------- +// 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 ); + 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 ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// RunActivateNextViewL +// ----------------------------------------------------------------------------- +// +static void RunActivateNextViewL( CXnUiEngine& aEngine ) + { + aEngine.ViewManager()->ActivateNextViewL(); + } + +// ----------------------------------------------------------------------------- +// RunActivatePreviousViewL +// ----------------------------------------------------------------------------- +// +static void RunActivatePreviousViewL( CXnUiEngine& aEngine ) + { + aEngine.ViewManager()->ActivatePreviousViewL(); + } + +// ----------------------------------------------------------------------------- +// RunAddViewL +// ----------------------------------------------------------------------------- +// +static void RunAddViewL( CXnUiEngine& aEngine ) + { + aEngine.ViewManager()->AddViewL(); + } + +// ----------------------------------------------------------------------------- +// RunRemoveViewL +// ----------------------------------------------------------------------------- +// +static void RunRemoveViewL( CXnUiEngine& aEngine ) + { + aEngine.ViewManager()->RemoveViewL(); + } + +// ----------------------------------------------------------------------------- +// RunActivateL +// ----------------------------------------------------------------------------- +// +static void RunActivateL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnDomNode& aEventNode ) + { + 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->SetStateL( XnPropertyNames::style::common::KActive ); + return; + } + } + } + + CXnNode* focused( aEngine.FocusedNode() ); + + if ( focused ) + { + focused->SetStateL( XnPropertyNames::style::common::KActive ); + } + } + +// ----------------------------------------------------------------------------- +// RunEditL +// ----------------------------------------------------------------------------- +// +static void RunEditL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnDomNode& aEventNode ) + { + TBool keyEditMode(EFalse); + + aEngine.DisableRenderUiLC(); + + // Set plugins to edit state + RPointerArray< CXnPluginData>& plugins( + aEngine.ViewManager()->ActiveViewData().PluginData() ); + + CXnDomStringPool& sp( aEventNode.StringPool() ); + + 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& name = dnode->AttributeValue( + XnPropertyNames::action::event::systemset::KName ); + const TDesC8& value = dnode->AttributeValue( + XnPropertyNames::action::event::systemset::KValue ); + + if ( name != KNullDesC8 && value != KNullDesC8 ) + { + // Find node by id + if ( name == XnPropertyNames::common::KId ) + { + CXnNode* node( aEngine.FindNodeByIdL( value, aThis->Namespace() ) ); + + if ( node ) + { + node->SetStateL( XnPropertyNames::style::common::KEdit ); + } + } + // Find nodes by class + else if ( name == XnPropertyNames::common::KClass ) + { + CXnPointerArray* array = aEngine.FindNodeByClassL( value ); + CleanupStack::PushL( array ); + + if ( array ) + { + const TInt count( array->Container().Count() ); + + for ( TInt i = 0; i < count; ++i ) + { + CXnNode* node( static_cast< CXnNode* >( + array->Container()[i] ) ); + + CXnProperty* editable( node->GetPropertyL( + XnPropertyNames::style::common::edit::KEditable ) ); + + if ( !editable || + editable->StringValue() != XnPropertyNames::KFalse ) + { + node->SetStateL( XnPropertyNames::style::common::KEdit ); + } + } + } + + 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(); + + 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 ); + } + + CleanupStack::PopAndDestroy(); + + aEngine.AppUiAdapter().ViewAdapter().UpdateRskByModeL(); + } + +// ----------------------------------------------------------------------------- +// RunResetEditL +// ----------------------------------------------------------------------------- +// +static void RunResetEditL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnDomNode& aEventNode ) + { + TBool keyEditMode( + aEngine.EditMode()->EditState() == CXnEditMode::EKeyMove ); + + 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& name = dnode->AttributeValue( + XnPropertyNames::action::event::systemset::KName ); + const TDesC8& value = dnode->AttributeValue( + XnPropertyNames::action::event::systemset::KValue ); + + if ( name != KNullDesC8 && value != KNullDesC8 ) + { + if ( name == XnPropertyNames::common::KId ) + { + CXnNode* node( aEngine.FindNodeByIdL( value, aThis->Namespace() ) ); + + if ( node ) + { + node->UnsetStateL( + XnPropertyNames::style::common::KEdit ); + } + } + else if ( name == XnPropertyNames::common::KClass ) + { + CXnPointerArray* array( aEngine.FindNodeByClassL( value ) ); + CleanupStack::PushL( array ); + + const TInt count = array->Container().Count(); + + for ( TInt i = 0; i < count; ++i ) + { + CXnNode* node = static_cast< CXnNode* >( + array->Container()[i] ); + + if ( node && + node->IsStateSet( XnPropertyNames::style::common::KEdit ) ) + { + node->UnsetStateL( XnPropertyNames::style::common::KEdit ); + } + } + + CleanupStack::PopAndDestroy( array ); + } + } + } + } + + RPointerArray< CXnPluginData>& plugins( + aEngine.ViewManager()->ActiveViewData().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() ); + + 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 ); + } + } + } + + aEngine.EditMode()->SetEditModeL( CXnEditMode::ENone ); + + aEngine.AppUiAdapter().ViewAdapter().UpdateRskByModeL(); + } + +// ----------------------------------------------------------------------------- +// RunDeactivateL +// ----------------------------------------------------------------------------- +// +static void RunDeactivateL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnDomNode& aEventNode ) + { + 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->UnsetStateL( XnPropertyNames::style::common::KActive ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// RunSystemSetPCDataL +// ----------------------------------------------------------------------------- +// +static void RunSystemSetPCDataL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + const TDesC8& aId, + const TDesC8& aData ) + { + CXnNode* node = aEngine.FindNodeByIdL( aId, aThis->Namespace() ); + + if ( node ) + { + node->SetPCDataL( aData ); + } + } + +// ----------------------------------------------------------------------------- +// GetNumberValues +// ----------------------------------------------------------------------------- +// +static void GetNumberValues( + const TDesC8& aData, + TReal& aNumber, + CXnDomPropertyValue::TPrimitiveValueType& aValueType ) + { + TLex8 lex( aData ); + lex.Val( aNumber ); + TPtrC8 rest = lex.Remainder(); + if ( rest.FindF( _L8( "%" ) ) != KErrNotFound ) + { + aValueType = CXnDomPropertyValue::EPercentage; + } + else if (rest.FindF( _L8( "em" ) ) != KErrNotFound ) + { + aValueType = CXnDomPropertyValue::EEms; + } + else if ( rest.FindF( _L8( "ex" ) ) != KErrNotFound ) + { + aValueType = CXnDomPropertyValue::EExs; + } + else if ( rest.FindF( _L8( "px" ) ) != KErrNotFound ) + { + aValueType = CXnDomPropertyValue::EPx; + } + else if ( rest.FindF( _L8( "u" ) ) != KErrNotFound ) + { + aValueType = CXnDomPropertyValue::EUnitValue; + } + else if ( rest.FindF( _L8( "cm" ) ) != KErrNotFound ) + { + aValueType = CXnDomPropertyValue::ECm; + } + else if ( rest.FindF( _L8( "mm" ) ) != KErrNotFound ) + { + aValueType = CXnDomPropertyValue::EMm; + } + else if ( rest.FindF( _L8( "in" ) ) != KErrNotFound ) + { + aValueType = CXnDomPropertyValue::EIn; + } + else if ( rest.FindF( _L8( "pt" ) ) != KErrNotFound ) + { + aValueType = CXnDomPropertyValue::EPt; + } + else if ( rest.FindF( _L8( "pc" ) ) != KErrNotFound ) + { + aValueType = CXnDomPropertyValue::EPc; + } + else + { + aValueType = CXnDomPropertyValue::ENumber; + } + } + +// ----------------------------------------------------------------------------- +// RunSystemSetNumberL +// ----------------------------------------------------------------------------- +// +static void RunSystemSetNumberL( + CXnUiEngine& aEngine, + CXnNode* aNode, + const TDesC8& aName, + const RPointerArray< HBufC8 >& aValues ) + { + if ( aNode ) + { + CXnDomStringPool& sp = aEngine.ODT()->DomDocument().StringPool(); + CXnDomProperty* prop = CXnDomProperty::NewL( aName, sp ); + CleanupStack::PushL( prop ); + + for ( TInt i = 0; i < aValues.Count(); i++ ) + { + const TDesC8& value = ( *aValues[i] ); + + CXnDomPropertyValue* propVal = CXnDomPropertyValue::NewL( sp ); + CleanupStack::PushL( propVal ); + + CXnDomPropertyValue::TPrimitiveValueType type; + TReal realValue; + + GetNumberValues( value, realValue, type ); + propVal->SetFloatValueL( type, realValue ); + + prop->PropertyValueList().AddItemL( propVal ); + CleanupStack::Pop( propVal ); + } + + CXnProperty* propertyValue = CXnProperty::NewL( prop ); + + CleanupStack::Pop( prop ); + CleanupStack::PushL( propertyValue ); + + aNode->SetPropertyL( propertyValue ); + + CleanupStack::Pop( propertyValue ); + } + } + +// ----------------------------------------------------------------------------- +// RunSystemSetRGBL +// ----------------------------------------------------------------------------- +// +static void RunSystemSetRGBL( + CXnUiEngine& aEngine, + CXnNode* aNode, + const TDesC8& aName, + const RPointerArray< HBufC8 >& aValues ) + { + if ( aNode ) + { + CXnDomStringPool& sp = aEngine.ODT()->DomDocument().StringPool(); + CXnDomProperty* prop = CXnDomProperty::NewL( aName, sp ); + CleanupStack::PushL( prop ); + + for ( TInt i = 0; i < aValues.Count(); i++ ) + { + const TDesC8& value = ( *aValues[i] ); + + CXnDomPropertyValue* propVal = CXnDomPropertyValue::NewL( sp ); + CleanupStack::PushL( propVal ); + + TRgb rgb; + + if ( CXnUtils::GetRgbValue( rgb, value ) ) + { + propVal->SetRgbColorL( rgb ); + prop->PropertyValueList().AddItemL( propVal ); + CleanupStack::Pop( propVal ); + } + else + { + CleanupStack::PopAndDestroy( propVal ); + } + } + + CXnProperty* propertyValue = CXnProperty::NewL( prop ); + + CleanupStack::Pop( prop ); + CleanupStack::PushL( propertyValue ); + + aNode->SetPropertyL( propertyValue ); + + CleanupStack::Pop( propertyValue ); + } + } + +// ----------------------------------------------------------------------------- +// RunSystemSetStringL +// ----------------------------------------------------------------------------- +// +static void RunSystemSetStringL( + CXnUiEngine& aEngine, + CXnNode* aNode, + const TDesC8& aName, + const RPointerArray< HBufC8 >& aValues, + const CXnDomPropertyValue::TPrimitiveValueType aValueType ) + { + if ( aNode ) + { + CXnDomStringPool& sp = aEngine.ODT()->DomDocument().StringPool(); + CXnDomProperty* prop = CXnDomProperty::NewL( aName, sp ); + CleanupStack::PushL( prop ); + + for ( TInt i = 0; i < aValues.Count(); i++ ) + { + const TDesC8& value = ( *aValues[i] ); + + CXnDomPropertyValue* propVal = CXnDomPropertyValue::NewL( sp ); + CleanupStack::PushL( propVal ); + + propVal->SetStringValueL( aValueType, value ); + prop->PropertyValueList().AddItemL( propVal ); + CleanupStack::Pop( propVal ); + } + + CXnProperty* propertyValue = CXnProperty::NewL( prop ); + + CleanupStack::Pop( prop ); + CleanupStack::PushL( propertyValue ); + + aNode->SetPropertyL( propertyValue ); + + CleanupStack::Pop( propertyValue ); + } + } + +// ----------------------------------------------------------------------------- +// 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 +// ----------------------------------------------------------------------------- +// +static void GetSystemSetDataL( + CXnDomNode& aDomNode, + HBufC8*& aId, + const TDesC8** aPseudoClass, + const TDesC8** aName, + RPointerArray< HBufC8 >* aValues, + const TDesC8** aType, + TBool aSettings, + const TDesC8& aProvidedId, + const TDesC8** aClassId ) + { + CXnDomList& children = aDomNode.ChildNodes(); + + if ( aSettings ) + { + aId = aProvidedId.AllocL(); + } + + TInt count = children.Length(); + + for ( TInt i = 0; i < count; ++i ) + { + CXnDomNode* node = static_cast< CXnDomNode* >( children.Item( i ) ); + const TDesC8& nodeType = node->Name(); + + if ( nodeType == XnPropertyNames::action::KProperty ) + { + const TDesC8& name = node->AttributeValue( + XnPropertyNames::action::event::systemset::KName ); + const TDesC8& value = node->AttributeValue( + XnPropertyNames::action::event::systemset::KValue ); + + if ( !aSettings && + ( name == XnPropertyNames::action::event::systemset::KId ) ) + { + HBufC8* utfName = HBufC8::NewL( value.Length() ); + TPtr8 ptr = utfName->Des(); + ptr = value; + aId = utfName; + } + else if ( name == XnPropertyNames::action::event::systemset::KPseudoClass ) + { + *aPseudoClass = &value; + } + else if ( name == XnPropertyNames::action::event::systemset::KName ) + { + *aName = &value; + } + else if ( name == XnPropertyNames::action::event::systemset::KValue ) + { + if ( aValues ) + { + HBufC8* valueH = HBufC8::NewLC( value.Length() + KUnitMaxLen ); + TPtr8 ptr( valueH->Des() ); + ptr.Append( value ); + aValues->AppendL( valueH ); //take ownership + CleanupStack::Pop( valueH ); + } + } + else if ( name == XnPropertyNames::action::event::systemset::KType ) + { + *aType = &value; + } + else if ( name == XnPropertyNames::action::event::systemset::KUnit ) + { + if ( value.Length() > KUnitMaxLen ) + { +#ifdef _XN_DEBUG_ + RDebug::Print( _L( "xnnodeimpl GetSystemSetDataL - unexpected length of type string" ) ); +#endif + User::Leave( KErrNotSupported ); + } + if ( aValues ) + { + TInt index = aValues->Count() - 1; + HBufC8* valueH = ( *aValues )[index]; + TPtr8 ptr( valueH->Des() ); + ptr.Append( value ); + } + } + else if ( name == XnPropertyNames::action::event::systemset::KClass ) + { + *aClassId = &value; + } + } + } + } + +// ----------------------------------------------------------------------------- +// RunTryDisplayingMenuL +// ----------------------------------------------------------------------------- +// +static void RunTryDisplayingMenuL( CXnUiEngine& aEngine, CXnDomNode& aEventNode ) + { + CXnNode* menubar( aEngine.MenuBarNode() ); + + if ( menubar ) + { + 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 ) ); + + if ( id != KNullDesC8 ) + { + HBufC* menuId( CnvUtfConverter::ConvertToUnicodeFromUtf8L( id ) ); + CleanupStack::PushL( menuId ); + + XnMenuInterface::MXnMenuInterface* menuIf( NULL ); + XnComponentInterface::MakeInterfaceL( menuIf, menubar->AppIfL() ); + + if ( menuIf ) + { + menuIf->TryDisplayingMenuBarL( *menuId ); + } + + CleanupStack::PopAndDestroy( menuId ); + } + } + } + } + } + +// ----------------------------------------------------------------------------- +// RunTryDisplayingListQueryDialogL +// ----------------------------------------------------------------------------- +// +static void RunTryDisplayingListQueryDialogL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnDomNode& aEventNode ) + { + CXnDomList& children( aEventNode.ChildNodes() ); + + TInt count( children.Length() ); + + if ( count > 0 ) + { + CXnDomNode* node = static_cast< CXnDomNode* >( children.Item( 0 ) ); + + const TDesC8& type( node->Name() ); + + if ( type == XnPropertyNames::action::KProperty ) + { + const TDesC8& id( + node->AttributeValue( XnPropertyNames::action::KValue ) ); + + if ( id != KNullDesC8 ) + { + CXnNode* dialog( aEngine.FindNodeByIdL( id, aThis->Namespace() ) ); + + if ( dialog && dialog->Type()->Type() == XnPropertyNames::listquerydialog::KListQueryDialog ) + { + CXnListQueryDialogAdapter* adapter = + static_cast< CXnListQueryDialogAdapter* > ( dialog->Control() ); + + adapter->TryDisplayingDialogL(); + } + + } + } + } + } + +// ----------------------------------------------------------------------------- +// RunTryDisplayingStylusPopupL +// ----------------------------------------------------------------------------- +// +static void RunTryDisplayingStylusPopupL( + CXnNodeImpl* aThis, + CXnNode& aNode, + CXnUiEngine& aEngine, + CXnDomNode& aEventNode ) + { + CXnDomList& children( aEventNode.ChildNodes() ); + + TInt count( children.Length() ); + + if ( count > 0 ) + { + CXnDomNode* node = static_cast< CXnDomNode* >( children.Item( 0 ) ); + + const TDesC8& type( node->Name() ); + + if ( type == XnPropertyNames::action::KProperty ) + { + const TDesC8& id( node->AttributeValue( + XnPropertyNames::action::KValue ) ); + + if ( id != KNullDesC8 ) + { + CXnNode* popup( aEngine.FindNodeByIdL( id, aThis->Namespace() ) ); + + if ( popup && popup->Type()->Type() == _L8("styluspopup") ) + { + CXnPopupControlAdapter* adapter = + static_cast< CXnPopupControlAdapter* > ( popup->Control() ); + + adapter->TryDisplayingStylusPopupL( aNode ); + } + } + } + } + } + +// ----------------------------------------------------------------------------- +// RunSetInitialFocusL +// ----------------------------------------------------------------------------- +// +static void RunSetInitialFocusL( CXnUiEngine& aEngine ) + { + TBool editState( aEngine.EditMode()->EditState() ); + + CXnViewManager* manager( aEngine.ViewManager() ); + + RPointerArray< CXnNode >& pluginNodes( manager->PluginNodes() ); + + if ( editState ) + { + TBool pluginFocused( EFalse ); + + for ( TInt i = 0; i < pluginNodes.Count(); i++ ) + { + CXnNode* node( pluginNodes[i] ); + + if ( node->IsStateSet( XnPropertyNames::style::common::KFocus ) ) + { + pluginFocused = ETrue; + break; + } + } + + if ( !pluginFocused ) + { + for ( TInt i = 0; i < pluginNodes.Count(); i++ ) + { + CXnNode* node( pluginNodes[i] ); + + node->SetStateWithoutNotificationL( + XnPropertyNames::style::common::KFocus ); + + if ( node->IsStateSet( + XnPropertyNames::style::common::KFocus ) ) + { + break; + } + } + } + } + else + { + CXnViewData& viewData( manager->ActiveViewData() ); + + RPointerArray< CXnPluginData > plugins; + CleanupClosePushL( plugins ); + + for( TInt i = 0; i < pluginNodes.Count(); i++ ) + { + CXnPluginData& data( viewData.Plugin( pluginNodes[i] ) ); + + if( data.Occupied() ) + { + plugins.AppendL( &data ); + } + } + + plugins.Append( &viewData ); + + RPointerArray< CXnNode > list; + CleanupClosePushL( list ); + + for( TInt i = 0; i < plugins.Count(); i++ ) + { + plugins[i]->InitialFocusNodesL( list ); + } + + for ( TInt i = 0; i < list.Count(); i++ ) + { + CXnNode* node( list[i] ); + + node->SetStateWithoutNotificationL( + XnPropertyNames::style::common::KFocus ); + + if ( node->IsStateSet( XnPropertyNames::style::common::KFocus ) ) + { + break; + } + } + + CleanupStack::PopAndDestroy( 2, &plugins ); // list + } + } + +// ----------------------------------------------------------------------------- +// RunSystemSetL +// ----------------------------------------------------------------------------- +// +static void RunSystemSetL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnDomNode& aEventNode, + TBool aSettings, + const TDesC8& aId ) + { + HBufC8* id = NULL; + const TDesC8* pseudoClass = NULL; + const TDesC8* name = NULL; + const TDesC8* type = NULL; + const TDesC8* classId = NULL; + + RPointerArray< HBufC8 > values; + CleanupResetAndDestroyPushL( values ); + + GetSystemSetDataL( + aEventNode, id, &pseudoClass, &name, + &values, &type, aSettings, aId, &classId ); + + CleanupStack::PushL( id ); + + if ( !name && id ) + { + for ( TInt i = 0; i < values.Count(); i++ ) + { + const TDesC8* value = values[i]; + + RunSystemSetPCDataL( aThis, aEngine, *id, *value ); + } + } + else if ( name && id && type ) + { + CXnNode* node = aEngine.FindNodeByIdL( *id, aThis->Namespace() ); + + if ( *type == XnPropertyNames::action::event::systemset::type::KString ) + { + RunSystemSetStringL( + aEngine, node, *name, values, CXnDomPropertyValue::EString ); + } + else if ( *type == + XnPropertyNames::action::event::systemset::type::KNumeric ) + { + RunSystemSetNumberL( + aEngine, node, *name, values ); + } + else if ( *type == XnPropertyNames::action::event::systemset::type::KRGB ) + { + RunSystemSetRGBL( + aEngine, node, *name, values ); + } + else if ( *type == XnPropertyNames::action::event::systemset::type::KUrl ) + { + RunSystemSetStringL( + aEngine, node, *name, values, CXnDomPropertyValue::EUri ); + } + else if ( *type == + XnPropertyNames::action::event::systemset::type::KAttribute ) + { + RunSystemSetStringL( + aEngine, node, *name, values, CXnDomPropertyValue::EAttr ); + } + } + else if ( name && classId && type ) + { + CXnPointerArray* array = aEngine.FindNodeByClassL( *classId ); + CleanupStack::PushL( array ); + + const TInt count = array->Container().Count(); + + for ( TInt i = 0; i < count; ++i ) + { + CXnNode* node = static_cast< CXnNode* >(array->Container()[i]); + if ( *type == XnPropertyNames::action::event::systemset::type::KString ) + { + RunSystemSetStringL( + aEngine, node, *name, values, CXnDomPropertyValue::EString ); + } + else if ( *type == + XnPropertyNames::action::event::systemset::type::KNumeric ) + { + RunSystemSetNumberL( + aEngine, node, *name, values ); + } + else if ( *type == XnPropertyNames::action::event::systemset::type::KRGB ) + { + RunSystemSetRGBL( + aEngine, node, *name, values ); + } + else if ( *type == XnPropertyNames::action::event::systemset::type::KUrl ) + { + RunSystemSetStringL( + aEngine, node, *name, values, CXnDomPropertyValue::EUri ); + } + else if ( *type == + XnPropertyNames::action::event::systemset::type::KAttribute ) + { + RunSystemSetStringL( + aEngine, node, *name, values, CXnDomPropertyValue::EAttr ); + } + } + CleanupStack::PopAndDestroy( array ); + } + + CleanupStack::PopAndDestroy( 2, &values ); + } + +// ----------------------------------------------------------------------------- +// 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 +// ----------------------------------------------------------------------------- +// +static TBool RunEventL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnNode& aNode, + CXnDomNode& aEventNode, + CXnDomNode& aTriggerNode, + CXnNode& aEventData ) + { + const TDesC8& nameString( aEventNode.AttributeValue( KName ) ); + + if ( nameString == KNullDesC8 ) + { + return EFalse; + } + + const TDesC8& system( XnPropertyNames::action::event::KSystemPrefix() ); + + if ( nameString.Find( system ) != 0 ) + { + // event doesn't contain "system/" prefix + RunAppUiNotificationL( aEngine, aNode, + aEventNode, aTriggerNode, aEventData ); + } + else if ( nameString == XnPropertyNames::action::event::KSetFocus ) + { + RPointerArray< CXnNode > focusCandidates; + CleanupClosePushL( focusCandidates ); + + GetFocusCandidatesL( aThis, aEngine, aEventNode, focusCandidates ); + + TBool retval( aNode.RunFocusChangeL( focusCandidates ) ); + + CleanupStack::PopAndDestroy( &focusCandidates ); + + return retval; + } + else if ( nameString == XnPropertyNames::action::event::KSetInitialFocus ) + { + RunSetInitialFocusL( aEngine ); + return ETrue; + } + else if ( nameString == XnPropertyNames::action::event::KSet ) + { + RunSystemSetL( aThis, aEngine, aEventNode ); + return ETrue; + } + else if ( nameString == XnPropertyNames::action::event::KSetPassiveFocus || + nameString == XnPropertyNames::action::event::KResetPassiveFocus || + nameString == XnPropertyNames::action::event::KSetActiveFocus ) + { + RunPassiveFocusChangeL( aThis, aEngine, aEventNode, nameString ); + return ETrue; + } + else if ( nameString == XnPropertyNames::action::event::KClearPassiveFocuses ) + { + aEngine.ClearPassiveFocusedNodesL(); + return ETrue; + } + else if ( nameString == XnPropertyNames::action::event::KSetEditMode ) + { + RunEditL( aThis, aEngine, aEventNode ); + return ETrue; + } + else if ( nameString == XnPropertyNames::action::event::KResetEditMode ) + { + 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(); + } + else if ( nameString == XnPropertyNames::action::event::KRemoveFocusedWidget ) + { + aEngine.Editor()->RemoveWidgetL( aEngine.FocusedNode() ); + } + else if ( nameString == XnPropertyNames::action::event::KRunFullScreenEffect ) + { + RunFullScreenEffectL( aEngine, aEventNode ); + } + else if ( nameString == XnPropertyNames::action::event::KActivateNextView ) + { + RunActivateNextViewL( aEngine ); + } + else if ( nameString == XnPropertyNames::action::event::KActivatePreviousView ) + { + RunActivatePreviousViewL( aEngine ); + } + else if ( nameString == XnPropertyNames::action::event::KAddView ) + { + RunAddViewL( aEngine ); + } + else if ( nameString == XnPropertyNames::action::event::KRemoveView ) + { + RunRemoveViewL( aEngine ); + } + else if ( nameString == XnPropertyNames::action::event::KActivateView ) + { + RunActivateViewL( aThis, aEngine, aEventNode ); + } + else if ( nameString == XnPropertyNames::action::event::KActivate ) + { + RunActivateL( aThis, aEngine, aEventNode ); + return ETrue; + } + else if ( nameString == XnPropertyNames::action::event::KActivateSelectedItem ) + { + CXnNode* focusedNode = aEngine.FocusedNode(); + if ( focusedNode ) + { + CXnNode* activate = BuildActivateTriggerNodeL( aEngine ); + CleanupStack::PushL( activate ); + focusedNode->ReportXuikonEventL( *activate ); + CleanupStack::PopAndDestroy( activate ); + } + return EFalse; + } + else if ( nameString == XnPropertyNames::action::event::KDeactivate ) + { + 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 ); + } + else if ( nameString == + XnPropertyNames::action::event::KTryDisplayingListQueryDialog ) + { + RunTryDisplayingListQueryDialogL( aThis, aEngine, aEventNode ); + } + else if ( nameString == XnPropertyNames::action::event::KTryDisplayingStylusPopup ) + { + RunTryDisplayingStylusPopupL( aThis, aNode, aEngine, aEventNode ); + return ETrue; + } + else if ( nameString == XnPropertyNames::action::event::KToggleWidgetsVisibilty ) + { + aEngine.Editor()->ToggleWidgetsVisibiltyL(); + + // check if focused widget need to be changed + CXnNode* focused( aEngine.FocusedNode() ); + + if ( !focused || !IsNodeNavigableL( focused ) ) + { + RunSetInitialFocusL( aEngine ); + } + + return ETrue; + } + else if ( nameString == XnPropertyNames::action::event::KReportEnterEditMode ) + + { + CXnNode* trigger( BuildTriggerNodeL( aEngine, + XnPropertyNames::action::trigger::name::KEditMode ) ); + CleanupStack::PushL( trigger ); + + CXnDomStringPool& sp( aEngine.ODT()->DomDocument().StringPool() ); + + CXnProperty* value( CXnProperty::NewL( + XnPropertyNames::action::KValue, + XnPropertyNames::action::trigger::name::editmode::KEnter, + CXnDomPropertyValue::EString, sp ) ); + CleanupStack::PushL( value ); + + trigger->SetPropertyL( value ); + CleanupStack::Pop( value ); + + aEngine.ActiveView()->ReportXuikonEventL( *trigger ); + + CleanupStack::PopAndDestroy( trigger ); + + return ETrue; + } + else if( nameString == XnPropertyNames::action::event::KReportExitEditMode ) + { + CXnNode* trigger( BuildTriggerNodeL( aEngine, + XnPropertyNames::action::trigger::name::KEditMode ) ); + CleanupStack::PushL( trigger ); + + CXnDomStringPool& sp( aEngine.ODT()->DomDocument().StringPool() ); + + CXnProperty* value( CXnProperty::NewL( + XnPropertyNames::action::KValue, + XnPropertyNames::action::trigger::name::editmode::KExit, + CXnDomPropertyValue::EString, sp ) ); + CleanupStack::PushL( value ); + + trigger->SetPropertyL( value ); + CleanupStack::Pop( value ); + + aEngine.ActiveView()->ReportXuikonEventL( *trigger ); + + CleanupStack::PopAndDestroy( trigger ); + + 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.Editor()->SetWallpaperL(); + return ETrue; + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// RunEventsL +// ----------------------------------------------------------------------------- +// +static void RunEventsL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnNode& aNode, + CXnDomNode& aActionNode, + CXnDomNode& aTriggerNode, + CXnNode& aEventData ) + { + CXnDomList& children = aActionNode.ChildNodes(); + TInt count = children.Length(); + TBool render = EFalse; + for ( TInt i = 0; i < count; ++i ) + { + CXnDomNode* node = static_cast< CXnDomNode* >(children.Item( i ) ); + const TDesC8& type = node->Name(); + if ( type == XnPropertyNames::action::KEvent ) + { + TBool tmp = RunEventL( + aThis, aEngine, aNode, *node, aTriggerNode, aEventData ); + if ( !render ) + { + render = tmp; + } + } + } + if ( render ) + { + aEngine.RenderUIL( NULL ); + } + } + +// ----------------------------------------------------------------------------- +// DoMatchTriggerForHighLevelKeyEventL +// ----------------------------------------------------------------------------- +// +static TBool DoMatchTriggerForHighLevelKeyEventL( + CXnNode& aNode, + const TKeyEvent& aKeyEvent, + TEventCode aType, + const TDesC8& aHighLevelKey ) + { + const TDesC8* key; + + switch ( aKeyEvent.iCode ) + { + case EKeyLeftArrow: + key = &XnPropertyNames::action::trigger::name::KLeft; + break; + case EKeyRightArrow: + key = &XnPropertyNames::action::trigger::name::KRight; + break; + case EKeyUpArrow: + key = &XnPropertyNames::action::trigger::name::KUp; + break; + case EKeyDownArrow: + key = &XnPropertyNames::action::trigger::name::KDown; + break; + default: + key = NULL; + break; + } + + if ( !key || aType != EEventKey ) + { + return EFalse; + } + + CXnNode* parent( aNode.Parent() ); + + if ( !parent || aNode.ViewNodeImpl() ) + { + if ( *key == aHighLevelKey ) + { + return ETrue; + } + } + else + { + const TDesC8* direction( + &XnPropertyNames::style::common::direction::KLTR ); + const TDesC8* orientation( + &XnPropertyNames::style::common::block_progression::KTB ); + + CXnProperty* directionProperty( parent->DirectionL() ); + + if ( directionProperty ) + { + direction = &directionProperty->StringValue(); + } + + CXnProperty* orientationProperty( parent->BlockProgressionL() ); + + if ( orientationProperty ) + { + orientation = &orientationProperty->StringValue(); + } + + if ( *direction == XnPropertyNames::style::common::direction::KLTR && + ( *orientation == XnPropertyNames::style::common::block_progression::KLR || + *orientation == XnPropertyNames::style::common::block_progression::KRL ) ) + { + if ( *key == aHighLevelKey ) + { + return ETrue; + } + } + else if ( *direction == XnPropertyNames::style::common::direction::KRTL && + ( *orientation == XnPropertyNames::style::common::block_progression::KLR || + *orientation == XnPropertyNames::style::common::block_progression::KRL ) ) + { + if ( *key == XnPropertyNames::action::trigger::name::KRight && + aHighLevelKey == XnPropertyNames::action::trigger::name::KLeft ) + { + return ETrue; + } + + if ( *key == XnPropertyNames::action::trigger::name::KLeft && + aHighLevelKey == XnPropertyNames::action::trigger::name::KRight ) + { + return ETrue; + } + + if ( *key == XnPropertyNames::action::trigger::name::KDown && + aHighLevelKey == XnPropertyNames::action::trigger::name::KDown ) + { + return ETrue; + } + + if ( *key == XnPropertyNames::action::trigger::name::KUp && + aHighLevelKey == XnPropertyNames::action::trigger::name::KUp ) + { + return ETrue; + } + } + else if ( *direction == XnPropertyNames::style::common::direction::KLTR && + *orientation == XnPropertyNames::style::common::block_progression::KTB ) + { + if ( *key == XnPropertyNames::action::trigger::name::KUp && + aHighLevelKey == XnPropertyNames::action::trigger::name::KLeft ) + { + return ETrue; + } + + if ( *key == XnPropertyNames::action::trigger::name::KDown && + aHighLevelKey == XnPropertyNames::action::trigger::name::KRight ) + { + return ETrue; + } + + if ( *key == XnPropertyNames::action::trigger::name::KLeft && + aHighLevelKey == XnPropertyNames::action::trigger::name::KDown ) + { + return ETrue; + } + + if ( *key == XnPropertyNames::action::trigger::name::KRight && + aHighLevelKey == XnPropertyNames::action::trigger::name::KUp ) + { + return ETrue; + } + } + else if ( *direction == XnPropertyNames::style::common::direction::KRTL && + *orientation == XnPropertyNames::style::common::block_progression::KTB ) + { + if ( *key == XnPropertyNames::action::trigger::name::KDown && + aHighLevelKey == XnPropertyNames::action::trigger::name::KLeft ) + { + return ETrue; + } + + if ( *key == XnPropertyNames::action::trigger::name::KUp && + aHighLevelKey == XnPropertyNames::action::trigger::name::KRight ) + { + return ETrue; + } + + if ( *key == XnPropertyNames::action::trigger::name::KLeft && + aHighLevelKey == XnPropertyNames::action::trigger::name::KDown ) + { + return ETrue; + } + + if ( *key == XnPropertyNames::action::trigger::name::KRight && + aHighLevelKey == XnPropertyNames::action::trigger::name::KUp ) + { + return ETrue; + } + } + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// MatchActionForKeyEventL +// ----------------------------------------------------------------------------- +// +static TBool MatchActionForKeyEventL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnNode& aNode, + const TKeyEvent& aKeyEvent, TEventCode aType, + CXnDomNode& aActionNode ) + { + CXnDomList& children = aActionNode.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::KTrigger ) + { + if ( node && ( IsTriggerRunnableL( *node ) || IsTriggerActiveL( *node ) ) ) + { + TBool match = MatchTriggerForKeyEventL( + aThis, aEngine, aNode, aKeyEvent, aType, aActionNode, *node ); + if ( match ) + { + return match; + } + } + } + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// IsTriggerActiveL +// ----------------------------------------------------------------------------- +// +static TBool IsTriggerActiveL( CXnDomNode& aNode ) + { + CXnDomList& propList = aNode.PropertyList(); + TInt count = propList.Length(); + for ( TInt j = 0; j < count; j++ ) + { + CXnDomProperty* prop = static_cast< CXnDomProperty* >( propList.Item( j ) ); + const TDesC8& propName = prop->Name(); + if ( propName == XnPropertyNames::style::common::KDisplay ) + { + CXnDomList& propValList = prop->PropertyValueList(); + TInt propValCount(propValList.Length()); + for ( TInt k = 0; k < propValCount; k++ ) + { + CXnDomPropertyValue* propVal = + static_cast< CXnDomPropertyValue* >( propValList.Item( k ) ); + CXnDomPropertyValue::TPrimitiveValueType type = + propVal->PrimitiveValueType(); + switch ( type ) + { + case CXnDomPropertyValue::EString: + case CXnDomPropertyValue::EIdent: + case CXnDomPropertyValue::EUri: + case CXnDomPropertyValue::EAttr: + case CXnDomPropertyValue::EUnknown: + { + const TDesC8& value = propVal->StringValueL(); + if ( value == XnPropertyNames::style::common::display::KNone ) + { + return EFalse; + } + else + { + return ETrue; + } + } + } + } + } + } + return ETrue; + } + +// ----------------------------------------------------------------------------- +// MatchActionForEventL +// ----------------------------------------------------------------------------- +// +static TBool MatchActionForEventL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnNode& aNode, + CXnNode& aEventData, + CXnDomNode& aActionNode, + TInt aSource ) + { + CXnDomList& children = aActionNode.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::KTrigger && + node && IsTriggerRunnableL( *node ) ) + { + TBool match = MatchTriggerForEventL( + aThis, aEngine, aNode, aEventData, aActionNode, *node, aSource ); + if ( match ) + { + return match; + } + } + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// FindLoopedFocusableNodeL +// ----------------------------------------------------------------------------- +// +static CXnNode* FindLoopedFocusableNodeL( CXnNode& aNode, TBool aForward ) + { + if ( aNode.ViewNodeImpl() ) + { + return NULL; + } + CXnNode* nextNode = NULL; + CXnProperty* navLoopProperty = aNode.GetPropertyL( + XnPropertyNames::style::common::KS60NavLooping ); + if ( navLoopProperty ) + { + const TDesC8& loopValue = navLoopProperty->StringValue(); + if ( loopValue != KNullDesC8 && + loopValue == XnPropertyNames::grid::s60_focus_looping::KStop ) + { + return NULL; + } + } + if ( aForward ) + { + nextNode = ForwardLoopL( aNode ); + } + else + { + nextNode = BackwardLoopL( aNode ); + } + return nextNode; + } + +// ----------------------------------------------------------------------------- +// GetNavIndexL +// ----------------------------------------------------------------------------- +// +static CXnDomPropertyValue* GetNavIndexL( CXnNode& aNode ) + { + CXnProperty* navIndexProperty = aNode.NavIndexL(); + CXnDomPropertyValue* value = NULL; + if ( navIndexProperty ) + { + value = static_cast< CXnDomPropertyValue* >( + navIndexProperty->Property()->PropertyValueList().Item( 0 ) ); + } + return value; + } + +// ----------------------------------------------------------------------------- +// ForwardL +// ----------------------------------------------------------------------------- +// +static CXnNode* ForwardL( CXnNode& aNode ) + { + RPointerArray< CXnNode >& siblings = aNode.Parent()->Children(); + CXnNode* nextNode = NULL; + CXnDomPropertyValue* navIndexValue = GetNavIndexL( aNode ); + CXnDomPropertyValue* prevIndexValue = NULL; + CXnDomPropertyValue* tmpIndexValue = NULL; + TInt count = siblings.Count(); + TInt nodePosition = count; + TBool first = ETrue; + for ( TInt i = 0; i < count; ++i ) + { + CXnNode* tmpNode = siblings[i]; + if ( tmpNode == &aNode ) + { + nodePosition = i; + continue; + } + if ( !IsNodeNavigableL( *tmpNode ) ) + { + continue; + } + tmpIndexValue = GetNavIndexL( *tmpNode ); + if ( tmpIndexValue ) + { + if ( tmpIndexValue->IsNoneIdent() ) + { + // nav index set as none, skipping + continue; + } + } + if ( ( CompareNavIndexesL( tmpIndexValue, navIndexValue ) == 0 ) && + ( first || + ( CompareNavIndexesL( tmpIndexValue, prevIndexValue ) < 0 ) ) && + ( i > nodePosition ) ) + { + first = EFalse; + prevIndexValue = tmpIndexValue; + nextNode = tmpNode; + } + else if ( ( CompareNavIndexesL( tmpIndexValue, navIndexValue ) > 0 ) && + ( first || + ( CompareNavIndexesL( tmpIndexValue, prevIndexValue ) < 0 ) ) ) + { + first = EFalse; + prevIndexValue = tmpIndexValue; + nextNode = tmpNode; + } + } + return nextNode; + } + +// ----------------------------------------------------------------------------- +// ForwardLoopL +// ----------------------------------------------------------------------------- +// +static CXnNode* ForwardLoopL( CXnNode& aNode ) + { + RPointerArray< CXnNode >& siblings = aNode.Parent()->Children(); + CXnNode* nextNode = NULL; + CXnDomPropertyValue* navIndexValue = GetNavIndexL( aNode ); + CXnDomPropertyValue* tmpIndexValue = NULL; + CXnDomPropertyValue* prevIndexValue = NULL; + TInt count = siblings.Count(); + TInt nodePosition = count; + TBool first = ETrue; + for ( TInt i = 0; i < count; ++i ) + { + CXnNode* tmpNode = siblings[i]; + if ( tmpNode == &aNode ) + { + nodePosition = i; + continue; + } + if ( !IsNodeNavigableL( *tmpNode ) ) + { + continue; + } + tmpIndexValue = GetNavIndexL( *tmpNode ); + if ( tmpIndexValue ) + { + if ( tmpIndexValue->IsNoneIdent() ) + { + // nav index set as none, skipping + continue; + } + } + if ( ( CompareNavIndexesL( navIndexValue, tmpIndexValue ) == 0 ) && + ( first || + ( CompareNavIndexesL( tmpIndexValue, prevIndexValue ) < 0 ) ) && + ( i < nodePosition ) ) + { + first = EFalse; + prevIndexValue = tmpIndexValue; + nextNode = tmpNode; + } + else if ( ( CompareNavIndexesL( tmpIndexValue, navIndexValue ) < 0 ) && + ( first || + ( CompareNavIndexesL( tmpIndexValue, prevIndexValue ) < 0 ) ) ) + { + first = EFalse; + prevIndexValue = tmpIndexValue; + nextNode = tmpNode; + } + } + return nextNode; + } + +// ----------------------------------------------------------------------------- +// BackwardL +// ----------------------------------------------------------------------------- +// +static CXnNode* BackwardL( CXnNode& aNode ) + { + RPointerArray< CXnNode >& siblings = aNode.Parent()->Children(); + CXnNode* nextNode = NULL; + CXnDomPropertyValue* navIndexValue = GetNavIndexL( aNode ); + CXnDomPropertyValue* tmpIndexValue = NULL; + TInt count = siblings.Count(); + CXnDomPropertyValue* nextIndexValue = GetNavIndexL( *siblings[count - 1] ); + TInt nodePosition = 0; + TBool first = ETrue; + for ( TInt i = count - 1; i > -1; --i ) + { + CXnNode* tmpNode = siblings[i]; + if ( tmpNode == &aNode ) + { + nodePosition = i; + continue; + } + if ( !IsNodeNavigableL( *tmpNode ) ) + { + continue; + } + tmpIndexValue = GetNavIndexL( *tmpNode ); + if ( tmpIndexValue ) + { + if ( tmpIndexValue->IsNoneIdent() ) + { + // nav index set as none, skipping + continue; + } + } + if ( ( CompareNavIndexesL( navIndexValue, tmpIndexValue ) == 0 ) && + ( first || + ( CompareNavIndexesL( tmpIndexValue, nextIndexValue ) > 0 ) ) && + ( i < nodePosition ) ) + { + first = EFalse; + nextIndexValue = tmpIndexValue; + nextNode = tmpNode; + } + else if ( ( CompareNavIndexesL( tmpIndexValue, navIndexValue ) < 0 ) && + ( first || + ( CompareNavIndexesL( tmpIndexValue, nextIndexValue ) > 0 ) ) ) + { + first = EFalse; + nextIndexValue = tmpIndexValue; + nextNode = tmpNode; + } + } + return nextNode; + } + +// ----------------------------------------------------------------------------- +// BackwardLoopL +// ----------------------------------------------------------------------------- +// +static CXnNode* BackwardLoopL( CXnNode& aNode ) + { + RPointerArray<CXnNode>& siblings = aNode.Parent()->Children(); + CXnNode* nextNode = NULL; + CXnDomPropertyValue* navIndexValue = GetNavIndexL( aNode ); + CXnDomPropertyValue* tmpIndexValue = NULL; + TInt count = siblings.Count(); + CXnDomPropertyValue* nextIndexValue = GetNavIndexL( *siblings[count - 1] ); + TInt nodePosition = 0; + TBool first = ETrue; + for ( TInt i = count - 1; i > -1; --i ) + { + CXnNode* tmpNode = siblings[i]; + if ( tmpNode == &aNode ) + { + nodePosition = i; + continue; + } + if ( !IsNodeNavigableL( *tmpNode ) ) + { + continue; + } + tmpIndexValue = GetNavIndexL( *tmpNode ); + if ( tmpIndexValue ) + { + if ( tmpIndexValue->IsNoneIdent() ) + { + // nav index set as none, skipping + continue; + } + } + if ( ( CompareNavIndexesL( tmpIndexValue, navIndexValue ) == 0 ) && + ( first || + ( CompareNavIndexesL( tmpIndexValue, nextIndexValue ) > 0 ) ) && + ( i > nodePosition ) ) + { + first = EFalse; + nextIndexValue = tmpIndexValue; + nextNode = tmpNode; + } + else if ( ( CompareNavIndexesL( tmpIndexValue, navIndexValue ) > 0 ) && + ( first || + ( CompareNavIndexesL( tmpIndexValue, nextIndexValue ) > 0 ) ) ) + { + first = EFalse; + nextIndexValue = tmpIndexValue; + nextNode = tmpNode; + } + } + return nextNode; + } + +// ----------------------------------------------------------------------------- +// CompareNavIndexesL +// ----------------------------------------------------------------------------- +// +static TInt CompareNavIndexesL( + CXnDomPropertyValue* aCurrentPropertyValue, + CXnDomPropertyValue* aNextPropertyValue ) + { + if ( !aCurrentPropertyValue && !aNextPropertyValue ) + { + return 0; + } + else if ( aCurrentPropertyValue && !aNextPropertyValue ) + { + if ( aCurrentPropertyValue->IsAutoIdent() ) + { + return 0; + } + return 1; + } + else if ( !aCurrentPropertyValue && aNextPropertyValue ) + { + if ( aNextPropertyValue->IsAutoIdent() ) + { + return 0; + } + return -1; + } + else if ( aCurrentPropertyValue->IsAutoIdent() && + aNextPropertyValue->IsAutoIdent() ) + { + return 0; + } + else if ( !aCurrentPropertyValue->IsAutoIdent() && + aNextPropertyValue->IsAutoIdent() ) + { + return 1; + } + else if ( aCurrentPropertyValue->IsAutoIdent() && + !aNextPropertyValue->IsAutoIdent() ) + { + return -1; + } + else + { + return + aCurrentPropertyValue->FloatValueL() < aNextPropertyValue->FloatValueL() ? + -1 : + aCurrentPropertyValue->FloatValueL() == aNextPropertyValue->FloatValueL() ? + 0 : + 1; + } + } + +// ----------------------------------------------------------------------------- +// FindNextFocusableNodeByNavIndexL +// ----------------------------------------------------------------------------- +// +static CXnNode* FindNextFocusableNodeByNavIndexL( CXnNode& aNode, TBool aForward ) + { + if ( aNode.ViewNodeImpl() ) + { + return NULL; + } + CXnNode* nextNode = NULL; + if ( aForward ) + { + nextNode = ForwardL( aNode ); + } + else + { + nextNode = BackwardL( aNode ); + } + return nextNode; + } + +// ----------------------------------------------------------------------------- +// FindNextFocusableNodeL +// ----------------------------------------------------------------------------- +// +TBool FindNextFocusableNodeL( CXnNode& aNode, TBool aForward ) + { + CXnNode* node( FindNextFocusableNodeByNavIndexL( aNode, aForward ) ); + + if ( !node ) + { + node = FindLoopedFocusableNodeL( aNode, aForward ); + } + + if ( node ) + { + node->SetStateL( XnPropertyNames::style::common::KFocus ); + if( node && node->ScrollableControl() ) + { + node->ScrollableControl()->ShowItem( *node ); + } + return ETrue; + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// FindNextNodeFromRightL +// ----------------------------------------------------------------------------- +// +static CXnNode* FindNextNodeFromRightL( + RPointerArray< CXnNode >& aArray, + CXnNode& aNode, + TBool stayInNamespace, + CXnUiEngine* aEngine ) + { + + CXnNode* nextNode = NULL; + TRect rect = aNode.PaddingRect(); + + for ( TInt i = 0; i < aArray.Count(); ++i ) + { + CXnNode* tmpNode = aArray[i]; + if ( tmpNode == &aNode ) + { + continue; + } + if ( !IsNodeNavigableL( *tmpNode ) ) + { + continue; + } + if ( tmpNode->FindViewNode() != tmpNode->UiEngine()->ActiveView() ) + { + // do not shift focus to another view + continue; + } + + const TDesC8& tmpNamespace = tmpNode->Impl()->Namespace(); + const TDesC8& nodeNamespace = aNode.Impl()->Namespace(); + + if ( stayInNamespace && tmpNamespace != nodeNamespace ) + { + // if staying in the same namespace is required, + // do not shift focus to a different namespace + continue; + } + + // TODO: only plugin widgets are available in edit mode + + TRect tmpRect = tmpNode->PaddingRect(); + + // temp node qualification: + // 1. left edge of temp node is to the right from focused's right edge + // 2. top edge of temp node is NOT below the bottom edge of focused node + // 3. bottom edge of temp node is NOT above the top edge of focused node + if ( rect.iBr.iX - 1 < tmpRect.iTl.iX && + rect.iBr.iY - 1 >= tmpRect.iTl.iY && + rect.iTl.iY <= tmpRect.iBr.iY - 1 ) + { + if ( !nextNode ) + { + nextNode = tmpNode; + } + else + { + // left edge of temp node is closer to focused than next node's + // left edge + if ( tmpRect.iTl.iX < nextNode->PaddingRect().iTl.iX ) + { + nextNode = tmpNode; + continue; + } + // left edge of temp and next are at the same level + else if ( tmpRect.iTl.iX == nextNode->PaddingRect().iTl.iX ) + { + // top edges are at the same level, choose this one + if ( tmpRect.iTl.iY == rect.iTl.iY ) + { + nextNode = tmpNode; + continue; + } + // top edges are not at the same level + else + { + if ( !AknLayoutUtils::LayoutMirrored() ) + { + // candidate's top edge is below focused's top edge + // and previous candidate's top edge is above + // focused's top edge + if ( nextNode->PaddingRect().iTl.iY < rect.iTl.iY && + tmpRect.iTl.iY > rect.iTl.iY ) + { + nextNode = tmpNode; + continue; + } + // previous candidate's top edge is below focused's + // top edge. Also, candidate's top edge is below + // focused's top edge. Select the highest one. + else if ( nextNode->PaddingRect().iTl.iY > rect.iTl.iY && + tmpRect.iTl.iY > rect.iTl.iY && + tmpRect.iTl.iY < nextNode->PaddingRect().iTl.iY ) + { + nextNode = tmpNode; + continue; + } + } + else // arabic/hebrew layout + { + // candidate's top edge is above focused's top edge + // and previous candidate's top edge is below + // focused's top edge + if ( nextNode->PaddingRect().iTl.iY > rect.iTl.iY && + tmpRect.iTl.iY < rect.iTl.iY ) + { + nextNode = tmpNode; + continue; + } + // candidate's and previous' top edge is below focused's + // top edge. Select the highest one. + else if ( nextNode->PaddingRect().iTl.iY > rect.iTl.iY && + tmpRect.iTl.iY > rect.iTl.iY && + tmpRect.iTl.iY < nextNode->PaddingRect().iTl.iY ) + { + nextNode = tmpNode; + continue; + } + } + } + } + else + { + continue; + } + } + } + } + + // 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; + + for ( TInt i = 0; i < aArray.Count(); ++i ) + { + CXnNode* tmpNode = aArray[i]; + if ( tmpNode == &aNode ) + { + continue; + } + if ( !IsNodeNavigableL( *tmpNode ) ) + { + continue; + } + if ( tmpNode->FindViewNode() != tmpNode->UiEngine()->ActiveView() ) + { + // do not shift focus to another view + continue; + } + + const TDesC8& tmpNamespace = tmpNode->Impl()->Namespace(); + const TDesC8& nodeNamespace = aNode.Impl()->Namespace(); + + if ( stayInNamespace && tmpNamespace != nodeNamespace ) + { + // if staying in the same namespace is required, + // do not shift focus to a different namespace + continue; + } + // TODO: only plugin widgets are available in edit mode + + TRect tmpRect = tmpNode->PaddingRect(); + + // temp node qualification: + // left edge of temp node is to the right from focused's right edge + if ( rect.iBr.iX - 1 < tmpRect.iTl.iX ) + { + // tmp is above the focused node + if ( tmpRect.iBr.iY - 1 < rect.iTl.iY ) + { + if ( candidateAbove == NULL ) + { + candidateAbove = tmpNode; + } + else + { + // use pythagorean theorem to determine the closest node + TInt xDistTmp = tmpRect.iTl.iX - rect.iBr.iX; + TInt yDistTmp = tmpRect.iBr.iY - rect.iTl.iY; + TReal tmpDist = Abs( ( xDistTmp * xDistTmp ) + ( yDistTmp * yDistTmp ) ); + + TInt xCand = candidateAbove->PaddingRect().iTl.iX - rect.iBr.iX; + TInt yCand = candidateAbove->PaddingRect().iBr.iY - rect.iTl.iY; + TReal cDist = Abs( ( xCand * xCand ) + ( yCand * yCand ) ); + + if ( tmpDist < cDist ) + { + candidateAbove = tmpNode; + } + } + } + else + { + if ( candidateBelow == NULL ) + { + candidateBelow = tmpNode; + } + else + { + // use pythagorean theorem to determine the closest node + TInt xDistTmp = tmpRect.iTl.iX - rect.iBr.iX; + TInt yDistTmp = tmpRect.iTl.iY - rect.iBr.iY; + TReal tmpDist = Abs( ( xDistTmp * xDistTmp ) + ( yDistTmp * yDistTmp ) ); + + TInt xCand = candidateBelow->PaddingRect().iTl.iX - rect.iBr.iX; + TInt yCand = candidateBelow->PaddingRect().iTl.iY - rect.iBr.iY; + TReal cDist = Abs( ( xCand * xCand ) + ( yCand * yCand ) ); + + if ( tmpDist < cDist ) + { + candidateBelow = tmpNode; + } + } + } + } + } + + if ( !AknLayoutUtils::LayoutMirrored() ) + { + if ( candidateBelow ) + { + nextNode = candidateBelow; + } + else + { + if ( candidateAbove ) + { + nextNode = candidateAbove; + } + } + } + else + { + if ( candidateAbove ) + { + nextNode = candidateAbove; + } + else + { + if ( candidateBelow ) + { + nextNode = candidateBelow; + } + } + } + } + + // loop to the right + if ( !nextNode ) + { + CXnNode* candidateAbove = NULL; + CXnNode* candidateBelow = NULL; + + for ( TInt i = 0; i < aArray.Count(); ++i ) + { + CXnNode* tmpNode = aArray[i]; + if ( !IsNodeNavigableL( *tmpNode ) ) + { + continue; + } + if ( tmpNode->FindViewNode() != tmpNode->UiEngine()->ActiveView() ) + { + // do not shift focus to another view + continue; + } + + const TDesC8& tmpNamespace = tmpNode->Impl()->Namespace(); + const TDesC8& nodeNamespace = aNode.Impl()->Namespace(); + + if ( stayInNamespace && tmpNamespace != nodeNamespace ) + { + // if staying in the same namespace is required, + // do not shift focus to a different namespace + continue; + } + + // TODO: only plugin widgets are available in edit mode + TRect tmpRect = tmpNode->PaddingRect(); + + // tmp is above the focused node + if ( tmpRect.iBr.iY <= rect.iTl.iY ) + { + if ( candidateAbove == NULL ) + { + candidateAbove = tmpNode; + } + else + { + // use pythagorean theorem to determine the closest node + TInt xDistTmp = tmpRect.iTl.iX; + TInt yDistTmp = tmpRect.iTl.iY - rect.iTl.iY; + TReal tmpDist = Abs( ( xDistTmp * xDistTmp ) + ( yDistTmp * yDistTmp ) ); + + TInt xCand = candidateAbove->PaddingRect().iTl.iX; + TInt yCand = candidateAbove->PaddingRect().iTl.iY - rect.iTl.iY; + TReal cDist = Abs( ( xCand * xCand ) + ( yCand * yCand ) ); + + if ( tmpDist < cDist ) + { + candidateAbove = tmpNode; + } + } + } + else + { + if ( candidateBelow == NULL ) + { + candidateBelow = tmpNode; + } + else + { + // use pythagorean theorem to determine the closest node + TInt xDistTmp = tmpRect.iTl.iX; + TInt yDistTmp = rect.iTl.iY - tmpRect.iTl.iY; + TReal tmpDist = Abs( ( xDistTmp * xDistTmp ) + ( yDistTmp * yDistTmp ) ); + + TInt xCand = candidateBelow->PaddingRect().iTl.iX; + TInt yCand = rect.iTl.iY - candidateBelow->PaddingRect().iTl.iY; + TReal cDist = Abs( ( xCand * xCand ) + ( yCand * yCand ) ); + + if ( tmpDist < cDist ) + { + candidateBelow = tmpNode; + } + } + } + } + + if ( candidateAbove && candidateBelow ) + { + CXnNode* pluginAbove = FindPluginNode( *candidateAbove ); + CXnNode* pluginBelow = FindPluginNode( *candidateBelow ); + + TReal aboveDist = 0; + TReal belowDist = 0; + + if ( pluginAbove ) + { + TInt xAbove = pluginAbove->PaddingRect().iTl.iX; + TInt yAbove = 0; + if ( !AknLayoutUtils::LayoutMirrored() ) + { + yAbove = rect.iTl.iY - pluginAbove->PaddingRect().iTl.iY; + } + else + { + yAbove = rect.iTl.iY - pluginAbove->PaddingRect().iBr.iY; + } + aboveDist = Abs( ( xAbove * xAbove ) + ( yAbove * yAbove ) ); + } + else + { + TInt xAbove = candidateAbove->PaddingRect().iTl.iX; + TInt yAbove = 0; + if ( !AknLayoutUtils::LayoutMirrored() ) + { + yAbove = rect.iTl.iY - candidateAbove->PaddingRect().iTl.iY; + } + else + { + yAbove = rect.iTl.iY - candidateAbove->PaddingRect().iBr.iY; + } + + aboveDist = Abs( ( xAbove * xAbove ) + ( yAbove * yAbove ) ); + } + + if ( pluginBelow ) + { + TInt xBelow = pluginBelow->PaddingRect().iTl.iX; + TInt yBelow = pluginBelow->PaddingRect().iTl.iY - rect.iTl.iY; + belowDist = Abs( ( xBelow * xBelow ) + ( yBelow * yBelow ) ); + } + else + { + TInt xBelow = candidateBelow->PaddingRect().iTl.iX; + TInt yBelow = candidateBelow->PaddingRect().iTl.iY - rect.iTl.iY; + belowDist = Abs( ( xBelow * xBelow ) + ( yBelow * yBelow ) ); + } + + if ( aboveDist < belowDist ) + { + nextNode = candidateAbove; + } + else if ( belowDist < aboveDist ) + { + nextNode = candidateBelow; + } + else + { + if ( !AknLayoutUtils::LayoutMirrored() ) + { + nextNode = candidateBelow; + } + else + { + nextNode = candidateAbove; + } + } + } + else if ( candidateAbove ) + { + nextNode = candidateAbove; + } + else if ( candidateBelow ) + { + nextNode = candidateBelow; + } + else + { + // do nothing + } + } + + if ( stayInNamespace && !nextNode ) + { + return &aNode; + } + + return nextNode; + } + +// ----------------------------------------------------------------------------- +// FindNextNodeFromLeftL +// ----------------------------------------------------------------------------- +// +static CXnNode* FindNextNodeFromLeftL( + RPointerArray< CXnNode >& aArray, + CXnNode& aNode, + TBool stayInNamespace, + CXnUiEngine* aEngine ) + { + CXnNode* nextNode = NULL; + TRect rect = aNode.PaddingRect(); + + for ( TInt i = 0; i < aArray.Count(); ++i ) + { + CXnNode* tmpNode = aArray[i]; + if ( tmpNode == &aNode ) + { + continue; + } + if ( !IsNodeNavigableL( *tmpNode ) ) + { + continue; + } + if ( tmpNode->FindViewNode() != tmpNode->UiEngine()->ActiveView() ) + { + // do not shift focus to another view + continue; + } + + const TDesC8& tmpNamespace = tmpNode->Impl()->Namespace(); + const TDesC8& nodeNamespace = aNode.Impl()->Namespace(); + + if ( stayInNamespace && tmpNamespace != nodeNamespace ) + { + // if staying in the same namespace is required, + // do not shift focus to a different namespace + continue; + } + + // TODO: only plugin widgets are available in edit mode + + TRect tmpRect = tmpNode->PaddingRect(); + + // temp node qualification: + // 1. right edge of temp node is to the left from focused's left edge + // 2. top edge of temp node is NOT below the bottom edge of focused node + // 3. bottom edge of temp node is NOT above the top edge of focused node + if ( rect.iTl.iX > tmpRect.iBr.iX - 1 && + rect.iBr.iY - 1 >= tmpRect.iTl.iY && + rect.iTl.iY <= tmpRect.iBr.iY - 1 ) + { + if ( !nextNode ) + { + nextNode = tmpNode; + } + else + { + // right edge of temp node is closer to focused than next node's + // right edge + if ( tmpRect.iBr.iX - 1 > nextNode->PaddingRect().iBr.iX - 1 ) + { + nextNode = tmpNode; + continue; + } + // left edge of temp and next are at the same level + else if ( tmpRect.iBr.iX - 1 == nextNode->PaddingRect().iBr.iX - 1 ) + { + // top edges are at the same level, choose this one + if ( tmpRect.iTl.iY == rect.iTl.iY ) + { + nextNode = tmpNode; + continue; + } + // top edges are not at the same level + else + { + if ( !AknLayoutUtils::LayoutMirrored() ) + { + // candidate's top edge is below focused's top edge + // and previous candidate's top edge is above focused's + // top edge + if ( nextNode->PaddingRect().iTl.iY > rect.iTl.iY && + tmpRect.iTl.iY < rect.iTl.iY ) + { + nextNode = tmpNode; + continue; + } + // candidate's and previous candidate's top edge is + // above focused's top edge. Select highest one. + else if ( nextNode->PaddingRect().iTl.iY < rect.iTl.iY && + tmpRect.iTl.iY < rect.iTl.iY && + tmpRect.iTl.iY < nextNode->PaddingRect().iTl.iY ) + { + nextNode = tmpNode; + continue; + } + } + else // arabic/hebrew layout + { + // candidate's top edge is below focused's top edge + // and previous candidate's top edge is above + // focused's top edge + if ( nextNode->PaddingRect().iTl.iY < rect.iTl.iY && + tmpRect.iTl.iY > rect.iTl.iY ) + { + nextNode = tmpNode; + continue; + } + // previous candidate's top edge is below focused's + // top edge. Also, candidate's top edge is below + // focused's top edge. Select the highest one. + else if ( nextNode->PaddingRect().iTl.iY > rect.iTl.iY && + tmpRect.iTl.iY > rect.iTl.iY && + tmpRect.iTl.iY < nextNode->PaddingRect().iTl.iY ) + { + nextNode = tmpNode; + continue; + } + } + } + } + else + { + continue; + } + } + } + } + + if ( !nextNode ) + { + if ( !stayInNamespace && aEngine && + aEngine->ViewManager()->ViewAmount() != KOneView ) + { + aEngine->ViewManager()->ActivatePreviousViewL(); + return nextNode; + } + CXnNode* candidateAbove = NULL; + CXnNode* candidateBelow = NULL; + + for ( TInt i = 0; i < aArray.Count(); ++i ) + { + CXnNode* tmpNode = aArray[i]; + if ( tmpNode == &aNode ) + { + continue; + } + if ( !IsNodeNavigableL( *tmpNode ) ) + { + continue; + } + if ( tmpNode->FindViewNode() != tmpNode->UiEngine()->ActiveView() ) + { + // do not shift focus to another view + continue; + } + + const TDesC8& tmpNamespace = tmpNode->Impl()->Namespace(); + const TDesC8& nodeNamespace = aNode.Impl()->Namespace(); + + if ( stayInNamespace && tmpNamespace != nodeNamespace ) + { + // if staying in the same namespace is required, + // do not shift focus to a different namespace + continue; + } + + // TODO: only plugin widgets are available in edit mode + TRect tmpRect = tmpNode->PaddingRect(); + + // temp node qualification: + // right edge of temp node is to the left from focused's left edge + if ( tmpRect.iBr.iX < rect.iTl.iX - 1 ) + { + // tmp is above the focused node + if ( tmpRect.iBr.iY < rect.iTl.iY ) + { + if ( candidateAbove == NULL ) + { + candidateAbove = tmpNode; + } + else + { + // use pythagorean theorem to determine the closest node + TInt xDistTmp = rect.iTl.iX - tmpRect.iBr.iX; + TInt yDistTmp = rect.iTl.iY - tmpRect.iBr.iY; + TReal tmpDist = Abs( ( xDistTmp * xDistTmp ) + ( yDistTmp * yDistTmp ) ); + + TInt xCand = rect.iTl.iX - candidateAbove->PaddingRect().iTl.iX; + TInt yCand = rect.iTl.iY - candidateAbove->PaddingRect().iBr.iY; + TReal cDist = Abs( ( xCand * xCand ) + ( yCand * yCand ) ); + + if ( tmpDist < cDist ) + { + candidateAbove = tmpNode; + } + } + } + else + { + if ( candidateBelow == NULL ) + { + candidateBelow = tmpNode; + } + else + { + // use pythagorean theorem to determine the closest node + TInt xDistTmp = rect.iTl.iX - tmpRect.iBr.iX; + TInt yDistTmp = rect.iBr.iY - tmpRect.iTl.iY; + TReal tmpDist = Abs( ( xDistTmp * xDistTmp ) + ( yDistTmp * yDistTmp ) ); + + TInt xCand = rect.iTl.iX - candidateBelow->PaddingRect().iBr.iX; + TInt yCand = rect.iBr.iY - candidateBelow->PaddingRect().iTl.iY; + TReal cDist = Abs( ( xCand * xCand ) + ( yCand * yCand ) ); + + if ( tmpDist < cDist ) + { + candidateBelow = tmpNode; + } + } + } + } + } + + if ( !AknLayoutUtils::LayoutMirrored() ) + { + if ( candidateAbove ) + { + nextNode = candidateAbove; + } + else + { + if ( candidateBelow ) + { + nextNode = candidateBelow; + } + } + } + else + { + if ( candidateBelow ) + { + nextNode = candidateBelow; + } + else + { + if ( candidateAbove ) + { + nextNode = candidateAbove; + } + } + } + } + + // get view width to get looping x point + TInt viewWidth = aNode.FindViewNode()->PaddingRect().Width(); + + // loop to the left + if ( !nextNode ) + { + CXnNode* candidateAbove = NULL; + CXnNode* candidateBelow = NULL; + + for ( TInt i = 0; i < aArray.Count(); ++i ) + { + CXnNode* tmpNode = aArray[i]; + /* + if ( tmpNode == &aNode ) + { + continue; + } + */ + if ( !IsNodeNavigableL( *tmpNode ) ) + { + continue; + } + if ( tmpNode->FindViewNode() != tmpNode->UiEngine()->ActiveView() ) + { + // do not shift focus to another view + continue; + } + + const TDesC8& tmpNamespace = tmpNode->Impl()->Namespace(); + const TDesC8& nodeNamespace = aNode.Impl()->Namespace(); + + if ( stayInNamespace && tmpNamespace != nodeNamespace ) + { + // if staying in the same namespace is required, + // do not shift focus to a different namespace + continue; + } + + + // TODO: only plugin widgets are available in edit mode + TRect tmpRect = tmpNode->PaddingRect(); + + // tmp is above the focused node + if ( tmpRect.iBr.iY <= rect.iTl.iY ) + { + if ( candidateAbove == NULL ) + { + candidateAbove = tmpNode; + } + else + { + // use pythagorean theorem to determine the closest node + TInt xDistTmp = viewWidth - tmpRect.iBr.iX; + TInt yDistTmp = rect.iTl.iY - tmpRect.iBr.iY; + TReal tmpDist = Abs( ( xDistTmp * xDistTmp ) + ( yDistTmp * yDistTmp ) ); + + TInt xCand = viewWidth - candidateAbove->PaddingRect().iBr.iX; + TInt yCand = rect.iTl.iY - candidateAbove->PaddingRect().iTl.iY; + TReal cDist = Abs( ( xCand * xCand ) + ( yCand * yCand ) ); + + if ( tmpDist < cDist ) + { + candidateAbove = tmpNode; + } + } + } + else + { + if ( candidateBelow == NULL ) + { + candidateBelow = tmpNode; + } + else + { + // use pythagorean theorem to determine the closest node + TInt xDistTmp = viewWidth - tmpRect.iBr.iX; + TInt yDistTmp = tmpRect.iTl.iY - rect.iTl.iY; + TReal tmpDist = Abs( ( xDistTmp * xDistTmp ) + ( yDistTmp * yDistTmp ) ); + + TInt xCand = viewWidth - candidateBelow->PaddingRect().iBr.iX; + TInt yCand = candidateBelow->PaddingRect().iTl.iY - rect.iTl.iY; + TReal cDist = Abs( ( xCand * xCand ) + ( yCand * yCand ) ); + + if ( tmpDist < cDist ) + { + candidateBelow = tmpNode; + } + } + } + } + + if ( candidateAbove && candidateBelow ) + { + CXnNode* pluginAbove = FindPluginNode( *candidateAbove ); + CXnNode* pluginBelow = FindPluginNode( *candidateBelow ); + + TReal aboveDist = 0; + TReal belowDist = 0; + + if ( pluginAbove ) + { + // compare to bottom right when looping to left + TInt xAbove = viewWidth - pluginAbove->PaddingRect().iBr.iX; + TInt yAbove = 0; + if ( !AknLayoutUtils::LayoutMirrored() ) + { + yAbove = rect.iTl.iY - pluginAbove->PaddingRect().iBr.iY; + } + else + { + yAbove = rect.iTl.iY - pluginAbove->PaddingRect().iTl.iY; + } + + aboveDist = Abs( (xAbove * xAbove) + (yAbove * yAbove) ); + } + else + { + TInt xAbove = viewWidth - candidateAbove->PaddingRect().iBr.iX; + TInt yAbove = 0; + if ( !AknLayoutUtils::LayoutMirrored() ) + { + yAbove = rect.iTl.iY - candidateAbove->PaddingRect().iBr.iY; + } + else + { + yAbove = rect.iTl.iY - candidateAbove->PaddingRect().iTl.iY; + } + aboveDist = Abs( ( xAbove * xAbove ) + ( yAbove * yAbove ) ); + } + + if ( pluginBelow ) + { + TInt xBelow = viewWidth - pluginBelow->PaddingRect().iBr.iX; + TInt yBelow = pluginBelow->PaddingRect().iTl.iY - rect.iTl.iY; + belowDist = Abs( ( xBelow * xBelow ) + ( yBelow * yBelow ) ); + } + else + { + TInt xBelow = viewWidth - candidateBelow->PaddingRect().iBr.iX; + TInt yBelow = candidateBelow->PaddingRect().iTl.iY - rect.iTl.iY; + belowDist = Abs( ( xBelow * xBelow ) + ( yBelow * yBelow ) ); + } + + if ( aboveDist < belowDist ) + { + nextNode = candidateAbove; + } + else if ( belowDist < aboveDist ) + { + nextNode = candidateBelow; + } + else + { + if ( !AknLayoutUtils::LayoutMirrored() ) + { + nextNode = candidateBelow; + } + else + { + nextNode = candidateAbove; + } + } + } + else if ( candidateAbove ) + { + nextNode = candidateAbove; + } + else if ( candidateBelow ) + { + nextNode = candidateBelow; + } + else + { + // do nothing + } + } + + if ( stayInNamespace && !nextNode ) + { + return &aNode; + } + + return nextNode; + } + +// ----------------------------------------------------------------------------- +// FindNextNodeFromBelowL +// ----------------------------------------------------------------------------- +// +static CXnNode* FindNextNodeFromBelowL( + RPointerArray< CXnNode >& aArray, + CXnNode& aNode, TBool stayInNamespace ) + { + CXnNode* nextNode = NULL; + TRect rect = aNode.PaddingRect(); + + for ( TInt i = 0; i < aArray.Count(); ++i ) + { + CXnNode* tmpNode = aArray[i]; + if ( tmpNode == &aNode ) + { + continue; + } + if ( !IsNodeNavigableL( *tmpNode ) ) + { + continue; + } + if ( tmpNode->FindViewNode() != tmpNode->UiEngine()->ActiveView() ) + { + // do not shift focus to another view + continue; + } + + const TDesC8& tmpNamespace = tmpNode->Impl()->Namespace(); + const TDesC8& nodeNamespace = aNode.Impl()->Namespace(); + + if ( stayInNamespace && tmpNamespace != nodeNamespace ) + { + // if staying in the same namespace is required, + // do not shift focus to a different namespace + continue; + } + + // TODO: only plugin widgets are available in edit mode + + TRect tmpRect = tmpNode->PaddingRect(); + + // temp node qualification: + // 1. top edge of the temp node is below bottom edge of focused node + // 2. temp node's right or left edge is between focused's left or right edge + if ( tmpRect.iTl.iY > rect.iBr.iY - 1 && + tmpRect.iBr.iX - 1 >= rect.iTl.iX && + tmpRect.iTl.iX <= rect.iBr.iX - 1 ) + { + if ( !nextNode ) + { + nextNode = tmpNode; + } + else + { + // temp node is closer than next node + if ( tmpRect.iTl.iY < nextNode->PaddingRect().iTl.iY ) + { + nextNode = tmpNode; + continue; + } + // top edge of temp node and next are at the same level + else if ( tmpRect.iTl.iY == nextNode->PaddingRect().iTl.iY ) + { + // western layout: take the leftmost one + if ( !AknLayoutUtils::LayoutMirrored() && + tmpRect.iBr.iX - 1 < nextNode->PaddingRect().iBr.iX - 1 ) + { + nextNode = tmpNode; + continue; + } + // arabic/hebrew layout: take the rightmost one + if ( AknLayoutUtils::LayoutMirrored() && + tmpRect.iBr.iX - 1 > nextNode->PaddingRect().iBr.iX - 1 ) + { + nextNode = tmpNode; + continue; + } + } + else + { + continue; + } + } + } + } + + // no nodes found on the right, try looping + if ( !nextNode ) + { + for ( TInt i = 0; i < aArray.Count(); ++i ) + { + CXnNode* tmpNode = aArray[i]; + TRect tmpRect = tmpNode->PaddingRect(); + if ( tmpNode == &aNode ) + { + continue; + } + if ( !IsNodeNavigableL( *tmpNode ) ) + { + continue; + } + if ( tmpRect.Intersects( rect ) ) + { + continue; + } + if ( tmpNode->FindViewNode() != tmpNode->UiEngine()->ActiveView() ) + { + // do not shift focus to another view + continue; + } + + const TDesC8& tmpNamespace = tmpNode->Impl()->Namespace(); + const TDesC8& nodeNamespace = aNode.Impl()->Namespace(); + + if ( stayInNamespace && tmpNamespace != nodeNamespace ) + { + // if staying in the same namespace is required, + // do not shift focus to a different namespace + continue; + } + + // TODO: only plugin widgets are available in edit mode + + // temp node's right or left edge must be between focused's left or + // right edge + if ( tmpRect.iBr.iX - 1 >= rect.iTl.iX && + tmpRect.iTl.iX <= rect.iBr.iX - 1 ) + { + if ( !nextNode ) + { + nextNode = tmpNode; + } + else + { + // temp node is closer than next node + if ( tmpRect.iTl.iY < nextNode->PaddingRect().iTl.iY ) + { + nextNode = tmpNode; + continue; + } + // top edge of temp node and next are at the same level + else if ( tmpRect.iTl.iY == nextNode->PaddingRect().iTl.iY ) + { + // western layout: take the leftmost one + if ( !AknLayoutUtils::LayoutMirrored() && + tmpRect.iBr.iX - 1 < nextNode->PaddingRect().iBr.iX - 1 ) + { + nextNode = tmpNode; + continue; + } + // arabic/hebrew layout: take the rightmost one + if ( AknLayoutUtils::LayoutMirrored() && + tmpRect.iBr.iX - 1 > nextNode->PaddingRect().iBr.iX - 1 ) + { + nextNode = tmpNode; + continue; + } + } + else + { + continue; + } + } + } + } + } + + if ( stayInNamespace && !nextNode ) + { + return &aNode; + } + + return nextNode; + } + +// ----------------------------------------------------------------------------- +// FindNextNodeFromAboveL +// ----------------------------------------------------------------------------- +// +static CXnNode* FindNextNodeFromAboveL( + RPointerArray< CXnNode >& aArray, + CXnNode& aNode, TBool stayInNamespace ) + { + CXnNode* nextNode = NULL; + TRect rect = aNode.PaddingRect(); + + for ( TInt i = 0; i < aArray.Count(); ++i ) + { + CXnNode* tmpNode = aArray[i]; + if ( tmpNode == &aNode ) + { + continue; + } + if ( !IsNodeNavigableL( *tmpNode ) ) + { + continue; + } + if ( tmpNode->FindViewNode() != tmpNode->UiEngine()->ActiveView() ) + { + // do not shift focus to another view + continue; + } + + const TDesC8& tmpNamespace = tmpNode->Impl()->Namespace(); + const TDesC8& nodeNamespace = aNode.Impl()->Namespace(); + + if ( stayInNamespace && tmpNamespace != nodeNamespace ) + { + // if staying in the same namespace is required, + // do not shift focus to a different namespace + continue; + } + + // TODO: only plugin widgets are available in edit mode + TRect tmpRect = tmpNode->PaddingRect(); + + // temp node qualification: + // 1. bottom edge of the temp node is above the top edge of focused node + // 2. temp node's right or left edge is between focused's left or right edge + if ( tmpRect.iBr.iY - 1 < rect.iTl.iY && + tmpRect.iBr.iX - 1 >= rect.iTl.iX && + tmpRect.iTl.iX <= rect.iBr.iX - 1 ) + { + if ( !nextNode ) + { + nextNode = tmpNode; + } + else + { + // temp node is closer than next node + if ( tmpRect.iBr.iY - 1 > nextNode->PaddingRect().iBr.iY - 1 ) + { + nextNode = tmpNode; + continue; + } + // bottom edge of temp and next node are at the same level + else if ( tmpRect.iBr.iY - 1 == nextNode->PaddingRect().iBr.iY - 1 ) + { + // western layout: take the leftmost one + if ( !AknLayoutUtils::LayoutMirrored() && + tmpRect.iBr.iX - 1 < nextNode->PaddingRect().iBr.iX - 1 ) + { + nextNode = tmpNode; + continue; + } + // arabic/hebrew layout: take the rightmost one + if ( AknLayoutUtils::LayoutMirrored() && + tmpRect.iBr.iX - 1 > nextNode->PaddingRect().iBr.iX - 1 ) + { + nextNode = tmpNode; + continue; + } + } + else + { + continue; + } + } + } + } + + // no nodes found on the right, try looping + if ( !nextNode ) + { + for ( TInt i = 0; i < aArray.Count(); ++i ) + { + CXnNode* tmpNode = aArray[i]; + TRect tmpRect = tmpNode->PaddingRect(); + if ( tmpNode == &aNode ) + { + continue; + } + if ( !IsNodeNavigableL( *tmpNode ) ) + { + continue; + } + if ( tmpRect.Intersects( rect ) ) + { + continue; + } + if ( tmpNode->FindViewNode() != tmpNode->UiEngine()->ActiveView() ) + { + // do not shift focus to another view + continue; + } + + const TDesC8& tmpNamespace = tmpNode->Impl()->Namespace(); + const TDesC8& nodeNamespace = aNode.Impl()->Namespace(); + + if ( stayInNamespace && tmpNamespace != nodeNamespace ) + { + // if staying in the same namespace is required, + // do not shift focus to a different namespace + continue; + } + + // TODO: only plugin widgets are available in edit mode + + // temp node's right or left edge must be between focused's left or + // right edge + if ( tmpRect.iBr.iX - 1 >= rect.iTl.iX && + tmpRect.iTl.iX <= rect.iBr.iX - 1 ) + { + if ( !nextNode ) + { + nextNode = tmpNode; + } + else + { + // temp node is closer than next node + if ( tmpRect.iBr.iY - 1 > nextNode->PaddingRect().iBr.iY - 1 ) + { + nextNode = tmpNode; + continue; + } + // bottom edge of temp and next node are at the same level + else if ( tmpRect.iBr.iY - 1 == nextNode->PaddingRect().iBr.iY - 1 ) + { + // western layout: take the leftmost one + if ( !AknLayoutUtils::LayoutMirrored() && + tmpRect.iBr.iX - 1 < nextNode->PaddingRect().iBr.iX - 1 ) + { + nextNode = tmpNode; + continue; + } + // arabic/hebrew layout: take the rightmost one + if ( AknLayoutUtils::LayoutMirrored() && + tmpRect.iBr.iX - 1 > nextNode->PaddingRect().iBr.iX - 1 ) + { + nextNode = tmpNode; + continue; + } + } + else + { + continue; + } + } + } + } + } + + if ( stayInNamespace && !nextNode ) + { + return &aNode; + } + + return nextNode; + } + +// ----------------------------------------------------------------------------- +// FindPluginNode +// ----------------------------------------------------------------------------- +// +static CXnNode* FindPluginNode( CXnNode& aNode ) + { + _LIT8( KPlugin, "plugin" ); + + CXnNode* pluginNode = NULL; + CXnNode* tmp = &aNode; + + while( tmp->Parent() ) + { + tmp = tmp->Parent(); + const TDesC8& nodeType = tmp->DomNode()->Name(); + + if ( nodeType == KPlugin ) + { + pluginNode = tmp; + break; + } + } + + return pluginNode; + } + +// ----------------------------------------------------------------------------- +// DoInternalFocusChangeL +// ----------------------------------------------------------------------------- +// +static TBool DoInternalFocusChangeL( CXnUiEngine& aEngine, + CXnNode& aNode, const TKeyEvent& aKeyEvent, TEventCode aType ) + { + if ( aNode.ViewNodeImpl() ) + { + return EFalse; + } + if ( aType != 1 ) + { + return EFalse; + } + if ( aKeyEvent.iScanCode != EStdKeyLeftArrow && + aKeyEvent.iScanCode != EStdKeyRightArrow && + aKeyEvent.iScanCode != EStdKeyDownArrow && + aKeyEvent.iScanCode != EStdKeyUpArrow ) + { + return EFalse; + } + CXnNode* parent = aNode.Parent(); + if ( !parent ) + { + return EFalse; + } + + // Handle 'appearance' navigation first, if the current node has + // "nav-index: appearance"... + CXnProperty* navind = aNode.NavIndexL(); + if ( navind && navind->StringValue() == XnPropertyNames::style::common::KAppearance ) + { + + CXnAppUiAdapter& appui = static_cast< CXnAppUiAdapter& >( *iAvkonAppUi ); + CXnPluginData& plugin( + appui.ViewManager().ActiveViewData().Plugin( &aNode ) ); + + // find if node is in a widget that contatins some opened popup window + + TBool containsPopUp = plugin.IsDisplayingPopup(); + + CXnNode* nextNode( NULL ); + RPointerArray< CXnNode >& array = aEngine.ViewManager()->AppearanceNodes(); + if ( aKeyEvent.iScanCode == EStdKeyDownArrow ) + { + nextNode = FindNextNodeFromBelowL( array, aNode, containsPopUp ); + } + else if ( aKeyEvent.iScanCode == EStdKeyUpArrow ) + { + nextNode = FindNextNodeFromAboveL( array, aNode, containsPopUp ); + } + else if ( aKeyEvent.iScanCode == EStdKeyRightArrow ) + { + nextNode = FindNextNodeFromRightL( array, aNode, containsPopUp, &aEngine ); + } + else if ( aKeyEvent.iScanCode == EStdKeyLeftArrow ) + { + nextNode = FindNextNodeFromLeftL( array, aNode, containsPopUp, &aEngine ); + } + if ( nextNode ) + { + if( nextNode && nextNode->ScrollableControl() ) + { + nextNode->ScrollableControl()->ShowItem( *nextNode ); + } + nextNode->SetStateL( XnPropertyNames::style::common::KFocus ); + return ETrue; + } + } + else + { + const TDesC8* direction( &XnPropertyNames::style::common::direction::KLTR ); + const TDesC8* orientation( &XnPropertyNames::style::common::block_progression::KTB ); + + CXnProperty* directionProperty( parent->DirectionL() ); + + if ( directionProperty ) + { + direction = &directionProperty->StringValue(); + } + + CXnProperty* orientationProperty( parent->BlockProgressionL() ); + + if ( orientationProperty ) + { + orientation = &orientationProperty->StringValue(); + } + + TBool match = EFalse; + + if ( *direction == XnPropertyNames::style::common::direction::KLTR && + ( *orientation == XnPropertyNames::style::common::block_progression::KLR || + *orientation == XnPropertyNames::style::common::block_progression::KRL ) ) + { + if ( aKeyEvent.iScanCode == EStdKeyLeftArrow ) + { + match = FindNextFocusableNodeL( aNode, EFalse ); + } + if ( aKeyEvent.iScanCode == EStdKeyRightArrow ) + { + match = FindNextFocusableNodeL( aNode, ETrue ); + } + } + else if ( *direction == XnPropertyNames::style::common::direction::KRTL && + ( *orientation == XnPropertyNames::style::common::block_progression::KLR || + *orientation == XnPropertyNames::style::common::block_progression::KRL ) ) + { + if ( aKeyEvent.iScanCode == EStdKeyRightArrow ) + { + match = FindNextFocusableNodeL( aNode, EFalse ); + } + if ( aKeyEvent.iScanCode == EStdKeyLeftArrow ) + { + match = FindNextFocusableNodeL( aNode, ETrue ); + } + } + else if ( *direction == XnPropertyNames::style::common::direction::KLTR && + *orientation == XnPropertyNames::style::common::block_progression::KTB ) + { + if ( aKeyEvent.iScanCode == EStdKeyUpArrow ) + { + match = FindNextFocusableNodeL( aNode, EFalse ); + } + if ( aKeyEvent.iScanCode == EStdKeyDownArrow ) + { + match = FindNextFocusableNodeL( aNode, ETrue ); + } + } + else if ( *direction == XnPropertyNames::style::common::direction::KRTL && + *orientation == XnPropertyNames::style::common::block_progression::KTB ) + { + if ( aKeyEvent.iScanCode == EStdKeyDownArrow ) + { + match = FindNextFocusableNodeL( aNode, EFalse ); + } + if ( aKeyEvent.iScanCode == EStdKeyUpArrow ) + { + match = FindNextFocusableNodeL( aNode, ETrue ); + } + } + return match; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// DoTriggerKeyEventL +// ----------------------------------------------------------------------------- +// +static TBool DoTriggerKeyEventL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnNode& aNode, + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + CXnDomNode* domNode = aNode.DomNode(); + CXnDomList& children = domNode->ChildNodes(); + TInt count = children.Length(); + TBool returnValue = EFalse; + for ( TInt i = 0; i < count; ++i ) + { + CXnDomNode* node = static_cast< CXnDomNode* >( children.Item( i ) ); + const TDesC8& type = node->Name(); + if ( type == XnPropertyNames::action::KActions ) + { + CXnDomList& actionChildren = node->ChildNodes(); + TInt actionCount = actionChildren.Length(); + for ( TInt j = 0; j < actionCount; ++j ) + { + CXnDomNode* actionNode = + static_cast< CXnDomNode* >( actionChildren.Item( j ) ); + const TDesC8& actionType = actionNode->Name(); + if ( actionType == XnPropertyNames::action::KAction ) + { + TBool match = MatchActionForKeyEventL( + aThis, aEngine, aNode, aKeyEvent, aType, *actionNode ); + if ( match ) + { + returnValue = ETrue; + } + } + } + } + } + + if ( returnValue ) + { + // Return is removed from here to enable auto navigation altough the + // action is alreadytriggered. This enables simpler theme definitions + // especially in AI2 case. If regression is observed then return should + // be restored here. Task ou1s60ui#3386. + //return returnValue; + } + + DoCompoundNodeScrollingL( aNode, aKeyEvent, aType ); + + returnValue = DoInternalFocusChangeL( aEngine, aNode, aKeyEvent, aType ); + + if ( returnValue ) + { + aEngine.RenderUIL(); + } + + return returnValue; + } + +// ----------------------------------------------------------------------------- +// DoTriggerEventL +// ----------------------------------------------------------------------------- +// +static void DoTriggerEventL( + CXnNodeImpl* aThis, + CXnUiEngine& aEngine, + CXnNode& aNode, + CXnNode& aActionsParent, + CXnNode& aEventData, + TInt aSource ) + { + CXnDomList& children( aActionsParent.DomNode()->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::KActions ) + { + CXnDomList& actionChildren = node->ChildNodes(); + TInt actionCount = actionChildren.Length(); + for ( TInt j = 0; j < actionCount; ++j ) + { + CXnDomNode* actionNode = + static_cast< CXnDomNode* >( actionChildren.Item( j ) ); + const TDesC8& actionType = actionNode->Name(); + if ( actionType == XnPropertyNames::action::KAction ) + { + TBool match = MatchActionForEventL( + aThis, aEngine, aNode, aEventData, *actionNode, aSource ); + } + } + } + } + } + +// ----------------------------------------------------------------------------- +// DoReceiveFocusL +// ----------------------------------------------------------------------------- +// +static TBool DoReceiveFocusL( CXnNode& aNode, CXnUiEngine& /*aEngine*/ ) + { + CXnProperty* focusable = aNode.GetPropertyL( + XnPropertyNames::common::KFocusable ); + CXnProperty* disabled = aNode.GetPropertyL( + XnPropertyNames::common::KDisabled ); + if ( focusable ) + { + const TDesC8& focusValue = focusable->StringValue(); + if ( focusValue != KNullDesC8 ) + { + if ( focusValue != XnPropertyNames::KTrue ) + { + return EFalse; + } + } + } + else + { + return EFalse; + } + if ( disabled ) + { + const TDesC8& disabledValue = disabled->StringValue(); + if ( disabledValue != KNullDesC8 ) + { + if ( disabledValue == XnPropertyNames::KTrue ) + { + return EFalse; + } + } + } + if ( !IsNodeNavigableL( aNode ) ) + { + return EFalse; + } + + return ETrue; + } + +// ----------------------------------------------------------------------------- +// DoSetActiveL +// ----------------------------------------------------------------------------- +// +static void DoSetActiveL( CXnNode& aNode, CXnUiEngine& aUiEngine ) + { + CXnNode* activate = BuildActivateTriggerNodeL( aUiEngine ); + activate->SetUiEngine( aUiEngine ); + CleanupStack::PushL( activate ); + aNode.ReportXuikonEventL( *activate ); + CleanupStack::PopAndDestroy( activate ); + } + +// ----------------------------------------------------------------------------- +// Informs the component about the property change. +// ----------------------------------------------------------------------------- +// +static void InformPropertyChangeL( CXnNode& aNode, CXnProperty* aProperty ) + { + //Inform the component about the property change. + CXnNode* parent( aNode.Parent() ); + + if ( parent ) + { + if ( parent->Type()->Type() == KMenuBar ) + { + CXnMenuAdapter* adapter = + static_cast< CXnMenuAdapter* >( parent->Control() ); + + if ( adapter ) + { + adapter->HandleMenuPropertyChangeL( &aNode.PluginIfL(), aProperty ); + } + } + else if ( aNode.IsLayoutCapable() ) + { + CXnControlAdapter* adapter( aNode.Control() ); + + if ( adapter ) + { + adapter->HandlePropertyChangeL( aProperty ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// Informs parent and its children about the property change. +// ----------------------------------------------------------------------------- +// +static void InformChildrenPropertyChangeL( + CXnNode& aParent, + CXnProperty* aProperty, + TBool aInformParent = ETrue ) + { + RPointerArray< CXnNode >& children( aParent.Children() ); + if ( aInformParent ) + { + InformPropertyChangeL( aParent, aProperty ); + } + TInt count( children.Count() ); + for ( TInt i = 0 ; i < count; i++ ) + { + InformChildrenPropertyChangeL( *children[i], aProperty, ETrue ); + } + } + +// ----------------------------------------------------------------------------- +// DisplayValueMatchL +// ----------------------------------------------------------------------------- +// +static TBool DisplayValueMatchL( + CXnNode& aNode, + const TDesC8& aDisplayValue ) + { + CXnProperty* display = aNode.GetPropertyL( KDisplay ); + if ( display ) + { + const TDesC8& value = display->StringValue(); + if ( value.Compare( aDisplayValue ) == KErrNone ) + { + return ETrue; + } + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// SetFloatPropertyToNodeL +// Set float property to a node +// ----------------------------------------------------------------------------- +// +static void SetFloatPropertyToNodeL( + CXnDomStringPool& aStringPool, CXnNode& aNode, + const TDesC8& aPropertyName, TReal aPropertyValue, + CXnDomPropertyValue::TPrimitiveValueType aValueType ) + { + // create property + CXnProperty* prop = CXnProperty::NewL( + aPropertyName, aPropertyValue, aValueType, aStringPool ); + + CleanupStack::PushL( prop ); + aNode.SetPropertyL( prop ); + CleanupStack::Pop( prop ); + } + +// ----------------------------------------------------------------------------- +// SetStringPropertyToNodeL +// Set string property to a node +// ----------------------------------------------------------------------------- +// +static void SetStringPropertyToNodeL( + CXnDomStringPool& aStringPool, + CXnNode& aNode, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue ) + { + // create property + CXnProperty* prop = CXnProperty::NewL( + aPropertyName, aPropertyValue, CXnDomPropertyValue::EString, aStringPool ); + + CleanupStack::PushL( prop ); + aNode.SetPropertyL( prop ); + CleanupStack::Pop( prop ); + } + +// ----------------------------------------------------------------------------- +// FindYoungestSiblingWithDisplayL +// Seek youngest sibling node with given display value +// ----------------------------------------------------------------------------- +// +static CXnNode* FindYoungestSiblingWithDisplayL( + RPointerArray< CXnNode >& aSiblingArray, + const TDesC8& aDisplayValue, + TInt& aIndex ) + { + aIndex = KErrNotFound; + CXnNode* node = NULL; + TInt siblingCount( aSiblingArray.Count() ); + //Find youngest sibling with display block + for ( TInt i = siblingCount; i > 0; ) + { + node = aSiblingArray[--i]; + if ( DisplayValueMatchL( *node, aDisplayValue ) ) + { + aIndex = i; + return node; + } + } + return NULL; + } + +// ----------------------------------------------------------------------------- +// FindOldestSiblingWithDisplayL +// Seek oldest sibling node with given display value +// ----------------------------------------------------------------------------- +// +static CXnNode* FindOldestSiblingWithDisplayL( + RPointerArray< CXnNode >& aSiblingArray, + const TDesC8& aDisplayValue, + TInt& aIndex ) + { + aIndex = KErrNotFound; + CXnNode* node = NULL; + TInt siblingCount( aSiblingArray.Count() ); + //Find oldest sibling with display block + for ( TInt i = 0; i < siblingCount; i++ ) + { + node = aSiblingArray[i]; + if ( DisplayValueMatchL( *node, aDisplayValue ) ) + { + aIndex = i; + return node; + } + } + return NULL; + } + +// ----------------------------------------------------------------------------- +// ScrollBoxToBeginningL +// Show the oldest siblings that fit into the compound box. +// ----------------------------------------------------------------------------- +// +static void ScrollBoxToBeginningL( RPointerArray< CXnNode >& aSiblingArray ) + { + CXnNode* node = NULL; + TInt toBeDisplayed(0); + TInt siblingCount( aSiblingArray.Count() ); + for ( TInt i = 0; i < siblingCount; i++ ) + { + node = aSiblingArray[i]; + if ( DisplayValueMatchL( *node, KBlock ) ) + { + CXnDomStringPool& sp = node->DomNode()->StringPool(); + //Switch the display to 'none' to visible siblings. + SetStringPropertyToNodeL( sp, *node, KDisplay, KNone ); + node = aSiblingArray[toBeDisplayed]; + toBeDisplayed++; + //Switch the display to 'block' to hidden siblings. + SetStringPropertyToNodeL( sp, *node, KDisplay, KBlock ); + } + } + } + +// ----------------------------------------------------------------------------- +// ScrollBoxToEndL +// Show the youngest siblings that fit into the compound box. +// ----------------------------------------------------------------------------- +// +static void ScrollBoxToEndL( RPointerArray< CXnNode >& aSiblingArray ) + { + CXnNode* node = NULL; + TInt siblingCount( aSiblingArray.Count() ); + TInt toBeDisplayed( siblingCount - 1 ); + for ( TInt i = siblingCount; i > 0; ) + { + node = aSiblingArray[--i]; + if ( DisplayValueMatchL( *node, KBlock ) ) + { + CXnDomStringPool& sp = node->DomNode()->StringPool(); + //Switch the display to 'none' to visible siblings. + SetStringPropertyToNodeL( sp, *node, KDisplay, KNone ); + node = aSiblingArray[toBeDisplayed]; + toBeDisplayed--; + //Switch the display to 'block' to hidden siblings. + SetStringPropertyToNodeL( sp, *node, KDisplay, KBlock ); + } + } + } + +// ----------------------------------------------------------------------------- +// IsCompoundNodeL +// Checks whether the node is coumound node. +// ----------------------------------------------------------------------------- +// +static TBool IsCompoundNodeL( CXnNode* aNode ) + { + if ( !aNode ) + { + return EFalse; + } + CXnProperty* compoundProperty = aNode->GetPropertyL( KCompound ); + if ( compoundProperty ) + { + const TDesC8& value = compoundProperty->StringValue(); + if ( !value.Compare( KTrue ) ) + { + return ETrue; + } + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// IsLoopingSetL +// Checks whether the node is set to loop. +// ----------------------------------------------------------------------------- +// +static TBool IsLoopingNodeL( CXnNode* aNode ) + { + if ( !aNode ) + { + return EFalse; + } + CXnProperty* navLoopProperty = aNode->GetPropertyL( + XnPropertyNames::style::common::KS60NavLooping ); + if ( navLoopProperty ) + { + const TDesC8& loopValue = navLoopProperty->StringValue(); + if ( loopValue == XnPropertyNames::grid::s60_focus_looping::KStop ) + { + return EFalse; + } + } + return ETrue; + } + +// ----------------------------------------------------------------------------- +// NotifyScrollNodeL +// Notify scroll node i.e compound box first and last siblings that there is +// nothing more to scroll +// ----------------------------------------------------------------------------- +// +static void NotifyScrollNodeL( CXnNode* aNode, TBool aBegin, TBool aGainEnd ) + { + RPointerArray< CXnNode >& siblings = aNode->Parent()->Children(); + // Last sibling is assumend to be an end scrolling node + CXnNode* scrollNode = siblings[0]; + if ( !aBegin ) + { + scrollNode = siblings[siblings.Count() - 1]; + } + CXnNode* triggerNode = + BuildTriggerNodeL( *scrollNode->UiEngine(), aGainEnd?KGainEnd:KLoseEnd ); + triggerNode->SetUiEngine( *scrollNode->UiEngine() ); + CleanupStack::PushL( triggerNode ); + scrollNode->ReportXuikonEventL( *triggerNode ); + CleanupStack::PopAndDestroy( triggerNode ); + } + +// ----------------------------------------------------------------------------- +// DoCompoundNodeBeginKeyL +// If key towards begin of list was pressed scroll to that direction +// ----------------------------------------------------------------------------- +// +static void DoCompoundNodeBeginKeyL( + RPointerArray< CXnNode >& aChildren, + CXnNode* aFocusedNode ) + { + TInt oldestIndex( 0 ); + // Notify scrollNode if aFocusedNode is node end of the list + CXnNode* lastItem = aChildren[aChildren.Count() - 1]; + if ( aFocusedNode == lastItem && !IsLoopingNodeL( lastItem ) ) + { + NotifyScrollNodeL( aChildren[0]->Parent(), EFalse, EFalse ); + } + CXnNode* node = FindOldestSiblingWithDisplayL( aChildren, KBlock, oldestIndex ); + // Set next node's display to block + if ( node && node == aFocusedNode ) + { + if ( oldestIndex - 1 >= 0 ) + { + node = aChildren[oldestIndex - 1]; + CXnDomStringPool& sp = node->DomNode()->StringPool(); + SetStringPropertyToNodeL( sp, *node, KDisplay, KBlock ); + // find youngest sibling with display block + TInt index( 0 ); + node = FindYoungestSiblingWithDisplayL( aChildren, KBlock, index ); + if ( node ) + { + SetStringPropertyToNodeL( sp, *node, KDisplay, KNone ); + } + } + else + { + if ( IsLoopingNodeL( node ) ) + { + ScrollBoxToEndL( aChildren ); + } + else + { + NotifyScrollNodeL( aChildren[0]->Parent(), ETrue, ETrue ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// DoCompoundNodeEndKeyL +// If key towards end of list was pressed scroll to that direction +// ----------------------------------------------------------------------------- +// +static void DoCompoundNodeEndKeyL( + RPointerArray< CXnNode >& aChildren, + CXnNode* aFocusedNode ) + { + TInt index( 0 ); + TInt siblingCount( aChildren.Count() ); + // Notify scrollNode if aFocusedNode is first node of the list + CXnNode* firstItem = aChildren[0]; + if ( aFocusedNode == firstItem && !IsLoopingNodeL( firstItem ) ) + { + NotifyScrollNodeL( aChildren[0]->Parent(), ETrue, EFalse ); + } + CXnNode* node = FindYoungestSiblingWithDisplayL( aChildren, KBlock, index ); + // Set next node's display to block + if ( node && node == aFocusedNode ) + { + if ( index < siblingCount - 1 ) + { + node = aChildren[index + 1]; + CXnDomStringPool& sp = node->DomNode()->StringPool(); + SetStringPropertyToNodeL( sp , *node, KDisplay, KBlock ); + // find oldest sibling with display block + TInt oldestIndex( 0 ); + node = FindOldestSiblingWithDisplayL( aChildren, KBlock, oldestIndex ); + if ( node ) + { + SetStringPropertyToNodeL( sp, *node, KDisplay, KNone ); + } + } + else // we are end of list + { + if ( IsLoopingNodeL( node ) ) + { + ScrollBoxToBeginningL( aChildren ); + } + else + { + NotifyScrollNodeL( aChildren[0]->Parent(), EFalse, ETrue ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// DoCompoundNodeScrollingL +// Process compound node key events +// ----------------------------------------------------------------------------- +// +static void DoCompoundNodeScrollingL( + CXnNode& aFocusedNode, + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + if ( aType != EEventKey ) + { + return; + } + CXnNode* compoundNode = aFocusedNode.Parent(); + if ( IsCompoundNodeL( compoundNode ) ) + { + RPointerArray< CXnNode >& children = compoundNode->Children(); + + if ( aKeyEvent.iScanCode != EStdKeyLeftArrow && + aKeyEvent.iScanCode != EStdKeyRightArrow && + aKeyEvent.iScanCode != EStdKeyDownArrow && + aKeyEvent.iScanCode != EStdKeyUpArrow ) + { + return; + } + CXnNode* parent = aFocusedNode.Parent(); + if ( !parent ) + { + return; + } + else + { + const TDesC8* direction( + &XnPropertyNames::style::common::direction::KLTR ); + const TDesC8* orientation( + &XnPropertyNames::style::common::block_progression::KTB ); + + CXnProperty* directionProperty( parent->DirectionL() ); + + if ( directionProperty ) + { + direction = &directionProperty->StringValue(); + } + + CXnProperty* orientationProperty( parent->BlockProgressionL() ); + + if ( orientationProperty ) + { + orientation = &orientationProperty->StringValue(); + } + + if ( *direction == XnPropertyNames::style::common::direction::KLTR && + ( *orientation == XnPropertyNames::style::common::block_progression::KLR || + *orientation == XnPropertyNames::style::common::block_progression::KRL ) ) + { + if ( aKeyEvent.iScanCode == EStdKeyLeftArrow ) + { + DoCompoundNodeBeginKeyL( children, &aFocusedNode ); + } + if ( aKeyEvent.iScanCode == EStdKeyRightArrow ) + { + DoCompoundNodeEndKeyL( children, &aFocusedNode ); + } + } + else if ( *direction == XnPropertyNames::style::common::direction::KRTL && + ( *orientation == XnPropertyNames::style::common::block_progression::KLR || + *orientation == XnPropertyNames::style::common::block_progression::KRL ) ) + { + if ( aKeyEvent.iScanCode == EStdKeyLeftArrow ) + { + DoCompoundNodeEndKeyL( children, &aFocusedNode ); + } + if ( aKeyEvent.iScanCode == EStdKeyRightArrow ) + { + DoCompoundNodeBeginKeyL( children, &aFocusedNode ); + } + } + else if ( *direction == XnPropertyNames::style::common::direction::KLTR && + *orientation == XnPropertyNames::style::common::block_progression::KTB ) + { + if ( aKeyEvent.iScanCode == EStdKeyUpArrow ) + { + DoCompoundNodeBeginKeyL( children, &aFocusedNode ); + } + else if ( aKeyEvent.iScanCode == EStdKeyDownArrow ) + { + DoCompoundNodeEndKeyL( children, &aFocusedNode ); + } + } + else if ( *direction == XnPropertyNames::style::common::direction::KRTL && + *orientation == XnPropertyNames::style::common::block_progression::KTB ) + { + if ( aKeyEvent.iScanCode == EStdKeyDownArrow ) + { + DoCompoundNodeBeginKeyL( children, &aFocusedNode ); + } + else if ( aKeyEvent.iScanCode == EStdKeyUpArrow ) + { + DoCompoundNodeEndKeyL( children, &aFocusedNode ); + } + } + } + } + } + +// ----------------------------------------------------------------------------- +// BuildTriggerNodeL +// Builds a trigger node +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildTriggerNodeL( + CXnUiEngine& aUiEngine, + const TDesC8& aTriggerName ) + { + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger ); + CleanupStack::PushL( type ); + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + CXnDomPropertyValue* nameValue = + CXnDomPropertyValue::NewL( aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( nameValue ); + nameValue->SetStringValueL( CXnDomPropertyValue::EString, aTriggerName ); + CXnProperty* name = CXnProperty::NewL( + XnPropertyNames::action::trigger::KName, + nameValue, + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + node->SetPropertyL( name ); + CleanupStack::Pop( name ); + CleanupStack::Pop( node ); + return node; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnNodeImpl* CXnNodeImpl::NewL( CXnType* aType ) + { + CXnNodeImpl* self = new ( ELeave ) CXnNodeImpl; + + CleanupStack::PushL( self ); + self->ConstructL( aType ); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::ConstructL( CXnType* aType ) + { + iType = aType; + iPropertyList = CXnPropertyList::NewL(); + iLayoutCapable = ETrue; + iHandleTooltip = ETrue; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::CXnNodeImpl() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnNodeImpl::CXnNodeImpl() + : iDropped( 0 ), iChildren( 1 ), iAdaptive( 0 ) + { + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::~CXnNodeImpl() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +CXnNodeImpl::~CXnNodeImpl() + { + delete iPropertyList; + delete iType; + iPropertyPseudoClasses.Reset(); + iStates.Reset(); + iChildren.ResetAndDestroy(); + delete iGridPropertyCache; + delete iLayoutPropertyCache; + DeletePeriodic(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetNode +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetNode( CXnNode& aNode ) + { + iNode = &aNode; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::Node +// ----------------------------------------------------------------------------- +// +CXnNode* CXnNodeImpl::Node() + { + return iNode; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetRect +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetRect( const TRect& aRect ) + { + iRect = aRect; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::Rect +// ----------------------------------------------------------------------------- +// +TRect CXnNodeImpl::Rect() + { + return AdjustRectIfNeeded(iRect); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetBorderRect +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetBorderRect( const TRect& aRect ) + { + iBorderRect = aRect; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BorderRect +// ----------------------------------------------------------------------------- +// +TRect CXnNodeImpl::BorderRect() + { + return AdjustRectIfNeeded(iBorderRect); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetNormalFlowBorderRect +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetNormalFlowBorderRect( const TRect& aRect ) + { + iNormalFlowBorderRect = aRect; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::NormalFlowBorderRect +// ----------------------------------------------------------------------------- +// +TRect CXnNodeImpl::NormalFlowBorderRect() + { + return AdjustRectIfNeeded(iNormalFlowBorderRect); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetMarginRect +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetMarginRect( const TRect& aRect ) + { + iMarginRect = aRect; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::MarginRect +// ----------------------------------------------------------------------------- +// +TRect CXnNodeImpl::MarginRect() + { + return AdjustRectIfNeeded(iMarginRect); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetPaddingRect +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetPaddingRect( const TRect& aRect ) + { + iPaddingRect = aRect; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::PaddingRect +// ----------------------------------------------------------------------------- +// +TRect CXnNodeImpl::PaddingRect() + { + return AdjustRectIfNeeded(iPaddingRect); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::Type() +// Returns control type. +// ----------------------------------------------------------------------------- +// +CXnType* CXnNodeImpl::Type() + { + return iType; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::Parent +// Get component parent +// ----------------------------------------------------------------------------- +// +CXnNode* CXnNodeImpl::Parent() const + { + return iParent; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetParent +// Set component parent +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetParent( CXnNode& aParent ) + { + iParent = &aParent; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::AddChildL +// Adds a child to this container. +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::AddChildL( CXnNode* aChild ) + { + TInt err = iChildren.Append( aChild ); + if ( err != KErrNone ) + { + User::Leave( KXnErrAddChildToAreaFailed ); + } + aChild->SetParent( *iNode ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::Children +// ----------------------------------------------------------------------------- +// +RPointerArray< CXnNode >& CXnNodeImpl::Children() + { + return iChildren; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetPCDataL +// Set a property. +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetPCDataL( const TDesC8& aData ) + { + iDomNode->SetPCDataL( aData ); + + SetDirtyL( XnDirtyLevel::ERender ); + + CXnDomStringPool& sp( iDomNode->StringPool() ); + + CXnDomPropertyValue* newValue = CXnDomPropertyValue::NewL( sp ); + CleanupStack::PushL( newValue ); + newValue->SetStringValueL( CXnDomPropertyValue::EString, KNullDesC8 ); + // create property + CXnProperty* prop = CXnProperty::NewL( + XnPropertyNames::common::KPCData, newValue, sp ); + CleanupStack::Pop( newValue ); + CleanupStack::PushL( prop ); + + InformPropertyChangeL( *iNode, prop ); + + CleanupStack::PopAndDestroy( prop ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::GetPCData +// Set a property. +// ----------------------------------------------------------------------------- +// +const TDesC8& CXnNodeImpl::GetPCData() + { + if ( iRef ) + { + CXnNode* refNode( NULL ); + TRAP_IGNORE( refNode = RefNodeL( this, iRef, iUiEngine ) ); + + if ( refNode ) + { + return refNode->GetPCData(); + } + } + + return iDomNode->PCData(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetHandleTooltip() +// Sets wheter to handle tooltips +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetHandleTooltip( TBool aFlag ) + { + iHandleTooltip = aFlag; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::ShowPopupsL() +// Searchs and shoes tooltips +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::ShowPopupsL( TRect aRect, TInt aSource ) + { + if ( iHandleTooltip ) + { + for ( TInt i = 0; i < iChildren.Count(); i++ ) + { + CXnNode* node( iChildren[i] ); + + if ( node->Type()->Type() == KToolTip ) + { + CXnNodeAppIf& tooltipNode( node->AppIfL() ); + CXnPopup* popup( NULL ); + + XnComponentInterface::MakeInterfaceL( popup, tooltipNode ); + + if ( popup ) + { + if ( aSource == XnEventSource::EStylus ) + { + const TTimeIntervalMicroSeconds32 delay( 0 ); + const TTimeIntervalMicroSeconds32 display( 1000 * 1000 * 6 ); + + popup->ShowPopupL( aRect, delay, display ); + } + else + { + popup->ShowPopupL( aRect ); + } + } + } + } + } + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::HidePopupsL() +// Searchs and hides tooltips +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::HidePopupsL() + { + if ( iHandleTooltip ) + { + for ( TInt i = 0; i < iChildren.Count(); i++ ) + { + CXnNode* node( iChildren[i] ); + + if ( node->Type()->Type() == KToolTip ) + { + CXnNodeAppIf& tooltipNode( node->AppIfL() ); + CXnPopup* popup( NULL ); + + XnComponentInterface::MakeInterfaceL( popup, tooltipNode ); + + if ( popup ) + { + popup->HidePopupL(); + } + } + } + } + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetPropertyL +// Sets a property, informs property change and builds trigger. +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetPropertyL( CXnProperty* aProperty, TBool aNotify ) + { + TInt level( DoSetPropertyL( aProperty ) ); + + if ( !aNotify || level == XnDirtyLevel::ENone ) + { + // all done + return; + } + + InformPropertyChangeL( *iNode, aProperty ); + + if ( iLayoutCapable && iNode->Parent() ) + { + const TDesC8* value( NULL ); + const TDesC8& name( aProperty->Property()->Name() ); + TBool informChildren( EFalse ); + + if ( name == XnPropertyNames::style::common::KDisplay ) + { + value = &XnPropertyNames::style::common::display::KNone; + informChildren = ETrue; + } + else if ( name == XnPropertyNames::style::common::KVisibility ) + { + value = &XnPropertyNames::style::common::visibility::KHidden; + informChildren = ETrue; + } + + if ( value ) + { + if ( *value == aProperty->StringValue() ) + { + CXnNode* loseVisualisation( + BuildTriggerNodeL( + *iUiEngine, + XnPropertyNames::action::trigger::name::KLoseVisualisation ) ); + + CleanupStack::PushL( loseVisualisation ); + + CXnNode* focused( iUiEngine->FocusedNode() ); + + for ( CXnNode* node = focused; node; node = node->Parent() ) + { + if ( node == iNode ) + { + // Focus is either in this node or + // somewhere in this node's childrens + focused->UnsetStateL( + XnPropertyNames::style::common::KFocus ); + + focused->UnsetStateL( + XnPropertyNames::style::common::KHold ); + + focused->UnsetStateL( + XnPropertyNames::style::common::KActive ); + + // Report losevisualisation to focused node if the node + // is 'visualisationaware' + CXnProperty* visaware = GetPropertyL( + XnPropertyNames::common::KVisualisationAware ); + + if ( visaware && visaware->StringValue() == + XnPropertyNames::KTrue ) + { + focused->ReportXuikonEventL( *loseVisualisation ); + } + + break; + } + } + + if ( focused != iNode ) + { + // Report losevisualisation to this node if the node + // is 'visualisationaware' + CXnProperty* visaware = GetPropertyL( + XnPropertyNames::common::KVisualisationAware ); + if ( visaware && visaware->StringValue() == + XnPropertyNames::KTrue ) + { + iNode->ReportXuikonEventL( *loseVisualisation ); + } + } + + CleanupStack::PopAndDestroy( loseVisualisation ); + } + else + { + if ( !iUiEngine->FocusedNode() ) + { + CXnNode* node( IsNodeNavigableL( Node() ) ); + + if ( node ) + { + // This node can be focused + iUiEngine->AddFocusCandidateL( node ); + } + } + } + } + + if ( informChildren && ( iNode->Children().Count() > 0 ) ) + { + //we have already done inform for the parent, so EFalse + InformChildrenPropertyChangeL( *iNode, aProperty, EFalse ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetPropertyWithoutNotificationL +// Sets a property. +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetPropertyWithoutNotificationL( CXnProperty* aProperty ) + { + SetPropertyL( aProperty, EFalse ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetPropertyArrayL +// Sets an array of properties and after all the properties are set informs +// property change. +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetPropertyArrayL( + RPointerArray< CXnProperty >& aPropertyArray ) + { + TBool informPropertyChange( EFalse ); + + TInt count( aPropertyArray.Count() ); + + iUiEngine->DisableRenderUiLC(); + + for ( TInt i = 0; i < count; i++ ) + { + CXnProperty* aProp( aPropertyArray[i] ); + + const TDesC8& name( aProp->Property()->Name() ); + + if ( name == XnPropertyNames::style::common::KDisplay || + name == XnPropertyNames::style::common::KVisibility ) + { + SetPropertyL( aProp ); + } + else + { + SetPropertyL( aProp, EFalse ); + informPropertyChange = ETrue; + } + } + + if ( informPropertyChange ) + { + InformPropertyChangeL( *iNode, NULL ); + } + + CleanupStack::PopAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::DoSetPropertyL +// Does the actual property update +// ----------------------------------------------------------------------------- +// +TInt CXnNodeImpl::DoSetPropertyL( CXnProperty* aProperty ) + { + 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 ) ); + + if ( prop && prop->EqualsL( *aProperty ) ) + { + // No change in the property value + delete aProperty; + + return level; + } + + level = DirtyLevelFromPropertyL( *iNode, name ); + + // Save the displayed state, before setting the property + TBool isDisplayed( IsNodeDisplayedL( *iNode ) ); + + CXnDomProperty::TPseudoClass pseudoClass( aProperty->Property()->PseudoClass() ); + + if ( pseudoClass != CXnDomProperty::ENone ) + { + InsertPropertyPseudoClassL( pseudoClass, iPropertyPseudoClasses ); + + if ( IsStateSet( PseudoClassName( pseudoClass ) ) ) + { + SetCachedProperty( + aProperty, + iLayoutPropertyCache, + iRef, + iName, + iValue, + iLabel, + iInitialFocus, + iClass, + iId, + iPath, + iMaskPath, + iGridPropertyCache, + EFalse, + EFalse ); + } + } + else + { + SetCachedProperty( + aProperty, + iLayoutPropertyCache, + iRef, + iName, + iValue, + iLabel, + iInitialFocus, + iClass, + iId, + iPath, + iMaskPath, + iGridPropertyCache, + EFalse, + EFalse ); + } + + iPropertyList->SetPropertyL( aProperty ); + + TBool isDisplayedNow( IsNodeDisplayedL( *iNode ) ); + + level = ( iAdaptive & XnAdaptive::EIgnoreDirty ) ? XnDirtyLevel::ENone : level; + + // This is from layout calculation point of view + TBool displayed( ETrue ); + + if ( isDisplayed && !isDisplayedNow ) + { + // Node loses its visualisation (either display: none, or + // visibility: hidden) Make sure control is hidden + CCoeControl* ctrl( iNode->Control() ); + + if ( ctrl ) + { + ctrl->MakeVisible( EFalse ); + } + } + else if ( !isDisplayed && isDisplayedNow ) + { + // Node gains its visualisation (both display: block, and + // visibility: visible) + // Run gainvisualisation trigger, if node is 'visualisationaware' + CXnProperty* visaware( + GetPropertyL( XnPropertyNames::common::KVisualisationAware ) ); + + if ( visaware && visaware->StringValue() == XnPropertyNames::KTrue ) + { + CXnNode* gainVisualisation( BuildTriggerNodeL( *iUiEngine, + XnPropertyNames::action::trigger::name::KGainVisualisation ) ); + CleanupStack::PushL( gainVisualisation ); + iNode->ReportXuikonEventL( *gainVisualisation ); + CleanupStack::PopAndDestroy( gainVisualisation ); + } + } + else if ( !isDisplayed && !isDisplayedNow ) + { + // No change + displayed = EFalse; + } + + SetDirtyL( level, displayed ); + + return level; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::InitializePropertyL +// Set a property. +// ----------------------------------------------------------------------------- +// +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( + aProperty->Property()->PseudoClass(), iPropertyPseudoClasses ); + + SetCachedProperty( + aProperty, + iLayoutPropertyCache, + iRef, + iName, + iValue, + iLabel, + iInitialFocus, + iClass, + iId, + iPath, + iMaskPath, + iGridPropertyCache, + ETrue, + ETrue ); + } + else + { + SetCachedProperty( + aProperty, + iLayoutPropertyCache, + iRef, + iName, + iValue, + iLabel, + iInitialFocus, + iClass, + iId, + iPath, + iMaskPath, + iGridPropertyCache, + ETrue, + EFalse ); + } + + iPropertyList->SetPropertyL( aProperty ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::GetPropertyL +// Gets a property. +// ----------------------------------------------------------------------------- +// +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 ); + + if ( property ) + { + attribute = property->Property(); + CXnDomList& list = attribute->PropertyValueList(); + + if ( list.Length() == 0 ) + { + return NULL; + } + + CXnDomPropertyValue* attributeValue = + static_cast< CXnDomPropertyValue* >( list.Item( 0 ) ); + + if ( !attributeValue ) + { + return NULL; + } + + if ( attributeValue->IsInheritIdent() && iParent ) + { + // inherited values are queried from the parent + property = iParent->GetPropertyL( aKey ); + } + + // otherwise just return the value + return property; + } + + // if not found, return NULL + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetStateL +// Set a pseudoclass +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetStateL( const TDesC8& aState, TInt aSource ) + { + if ( IsStateSet( aState ) ) + { + return; + } + + TBool focusReceived( EFalse ); + TBool activated( EFalse ); + TBool stateChanged( EFalse ); + + if ( aState == XnPropertyNames::action::trigger::name::KFocus ) + { + if ( !iUiEngine->AppUiAdapter().FocusShown() ) + { + return; + } + + focusReceived = DoReceiveFocusL( *iNode, *iUiEngine ); + + if ( focusReceived ) + { + // focused + HidePopupsL(); + ShowPopupsL( iNode->Rect(), aSource ); + + if ( IsStateSet( XnPropertyNames::action::trigger::name::KPassiveFocus ) ) + { + iUiEngine->RemovePassiveFocusedNodeL( iNode ); + } + + stateChanged = focusReceived = iPropertyList->SetStateL( aState ); + } + } + else if ( aState == XnPropertyNames::style::common::KPressedDown ) + { + if ( IsStateSet( XnPropertyNames::action::trigger::name::KFocus ) ) + { + iPropertyList->SetStateL( + XnPropertyNames::style::common::KPressedDown ); + iNode->SetDirtyL( XnDirtyLevel::ERender ); + } + } + else if ( aState == XnPropertyNames::style::common::KActive ) + { + activated = ETrue; + } + else if ( aState == XnPropertyNames::action::trigger::name::KPassiveFocus ) + { + // is focusable node + if ( DoReceiveFocusL( *iNode, *iUiEngine ) ) + { + // focused + stateChanged = iPropertyList->SetStateL( aState ); + } + } + else + { + stateChanged = iPropertyList->SetStateL( aState ); + } + + if ( stateChanged ) + { + CXnDomProperty::TPseudoClass pseudoClass( PseudoClassFromName( aState ) ); + + if ( pseudoClass != CXnDomProperty::ENone ) + { + iStates.Append( pseudoClass ); + + // Ensure that pseudo class is defined + InsertPropertyPseudoClassL( pseudoClass, iPropertyPseudoClasses ); + + if ( IsPropertyPseudoClass( pseudoClass, iPropertyPseudoClasses ) ) + { + EnableStatePropertiesL( *iNode, pseudoClass, iLayoutPropertyCache ); + + InformPropertyChangeL( *iNode ); + } + } + + if ( aState == XnPropertyNames::style::common::KPressedDown ) + { + iNode->SetDirtyL( XnDirtyLevel::ERender ); + } + } + + if ( focusReceived && aState == XnPropertyNames::action::trigger::name::KFocus ) + { + iUiEngine->SetFocusedNodeL( iNode, aSource ); + } + + if ( activated ) + { + DoSetActiveL( *iNode, *iUiEngine ); + } + + if ( stateChanged ) + { + iUiEngine->RenderUIL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::IsStateSet +// Check whether a state is set or not +// ----------------------------------------------------------------------------- +// +TBool CXnNodeImpl::IsStateSet( const TDesC8& aState ) + { + return iPropertyList->IsStateSet( aState ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetStateWithoutNotificationL +// Set a pseudoclass +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetStateWithoutNotificationL( const TDesC8& aState ) + { + if ( IsStateSet( aState ) ) + { + return; + } + + TBool setState( ETrue ); + + if ( aState == XnPropertyNames::action::trigger::name::KFocus ) + { + if ( !iUiEngine->AppUiAdapter().FocusShown() ) + { + return; + } + + setState = DoReceiveFocusL( *iNode, *iUiEngine ); + } + + if ( setState && iPropertyList->SetStateL( aState ) ) + { + CXnDomProperty::TPseudoClass pseudoClass( PseudoClassFromName( aState ) ); + + if ( pseudoClass != CXnDomProperty::ENone ) + { + iStates.Append( pseudoClass ); + + // Ensure that pseudo class is defined + InsertPropertyPseudoClassL( pseudoClass, iPropertyPseudoClasses ); + + if ( IsPropertyPseudoClass( pseudoClass, iPropertyPseudoClasses ) ) + { + EnableStatePropertiesL( *iNode, pseudoClass, iLayoutPropertyCache ); + } + } + + if ( aState == XnPropertyNames::action::trigger::name::KFocus ) + { + iUiEngine->SetFocusedNodeL( iNode ); + + HidePopupsL(); + } + + iUiEngine->RenderUIL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::UnsetStateL +// Unset a pseudoclass +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::UnsetStateL( const TDesC8& aState ) + { + if ( !IsStateSet( aState ) ) + { + return; + } + + if ( aState == XnPropertyNames::action::trigger::name::KFocus ) + { + HidePopupsL(); + + iPropertyList->UnsetState( + XnPropertyNames::style::common::KPressedDown ); + + if ( iUiEngine->FocusedNode() == iNode ) + { + iUiEngine->SetFocusedNodeL( NULL ); + } + } + + TBool stateChanged( iPropertyList->UnsetState( aState ) ); + + if ( stateChanged ) + { + CXnDomProperty::TPseudoClass pseudoClass( PseudoClassFromName( aState ) ); + + if ( IsPropertyPseudoClass( pseudoClass, iPropertyPseudoClasses ) ) + { + DisableStatePropertiesL( + *iNode, pseudoClass, iStates, iLayoutPropertyCache ); + + InformPropertyChangeL( *iNode ); + } + + for ( TInt i = iStates.Count() - 1; i >= 0; --i ) + { + if ( iStates[i] == pseudoClass ) + { + iStates.Remove( i ); + } + } + + if ( aState == XnPropertyNames::style::common::KPressedDown ) + { + iNode->SetDirtyL( XnDirtyLevel::ERender ); + } + + iUiEngine->RenderUIL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetUiEngine +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetUiEngine( CXnUiEngine& aEngine ) + { + iUiEngine = &aEngine; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::UiEngine +// ----------------------------------------------------------------------------- +// +CXnUiEngine* CXnNodeImpl::UiEngine() + { + return iUiEngine; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::ReportXuikonEventL +// ----------------------------------------------------------------------------- +// +TBool CXnNodeImpl::ReportXuikonEventL( CXnNode& aEventData, TInt aSource ) + { + CXnProperty* prop( GetPropertyL( KActionsHandler ) ); + + CXnNode* handler( NULL ); + + iUiEngine->DisableRenderUiLC(); + + if ( prop ) + { + const TDesC8& value( prop->StringValue() ); + + handler = iUiEngine->FindNodeByIdL( value, Namespace() ); + } + + if ( handler && handler->Type()->Type() == KActionsHandler ) + { + // Let <actionshandler> node to handle actions + DoTriggerEventL( this, *iUiEngine, *iNode, + *handler, aEventData, aSource ); + } + else + { + // Let this node to handle actions + DoTriggerEventL( this, *iUiEngine, *iNode, + *iNode, aEventData, aSource ); + } + + CleanupStack::PopAndDestroy(); // DisableRenderUiLC + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::OfferKeyEventL +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) + { + DoTriggerKeyEventL( this, *iUiEngine, *iNode, aKeyEvent, aType ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetDropped +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetDropped( const TInt aDropped ) + { + if ( Type()->Type() != KToolTip ) + { + iDropped = aDropped; + + TInt count( iChildren.Count() ); + + for ( TInt i = 0; i < count; i++ ) + { + iChildren[i]->SetDropped( aDropped ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::IsDropped +// ----------------------------------------------------------------------------- +// +TInt CXnNodeImpl::IsDropped() const + { + return iDropped; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetLayoutCapable +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetLayoutCapable( const TBool aLayoutCapable ) + { + iLayoutCapable = aLayoutCapable; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::IsLayoutCapable +// ----------------------------------------------------------------------------- +// +TBool CXnNodeImpl::IsLayoutCapable() const + { + return iLayoutCapable; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetRenderedL +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetRenderedL() + { + if ( !iLayoutCapable ) + { + return; + } + + CXnControlAdapter* control = + static_cast< CXnControlAdapter* >( iNode->Control() ); + + if ( control ) + { + TBool displayed( IsNodeDisplayedL( *iNode, ETrue, EFalse ) ); + + control->SetBlank( EFalse ); + + if ( iDropped || !displayed ) + { + // Need to check blank here + CXnProperty* prop( VisibilityL() ); + + if ( prop && prop->StringValue() == + XnPropertyNames::style::common::visibility::KBlank ) + { + control->SetBlank( ETrue ); + control->MakeVisible( EFalse ); + control->SetComponentsToInheritVisibility( EFalse ); + control->MakeVisible( ETrue ); + control->SetComponentsToInheritVisibility( ETrue ); + } + else + { + if ( control->IsVisible() ) + { + control->MakeVisible( EFalse ); + } + } + } + else + { + CCoeControl* parent( control->Parent() ); + + TBool parentVisible( ETrue ); + + if ( parent && !parent->IsVisible() ) + { + parentVisible = EFalse; + } + + if ( !control->IsVisible() && parentVisible ) + { + TBool found( EFalse ); + + for ( CXnNode* node = iNode; !found && node; node = node->Parent() ) + { + if ( node->Type()->Type() == KToolTip ) + { + // Tooltip control handles its visibility internally + found = ETrue; + } + } + + if ( !found ) + { + control->MakeVisible( ETrue ); + } + } + } + } + + iRendered = ETrue; + + for ( TInt i = 0; i < iChildren.Count(); i++ ) + { + iChildren[i]->SetRenderedL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetLaidOutL +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetLaidOutL() + { + if ( !iLayoutCapable ) + { + return; + } + + if ( iDropped || !IsNodeDisplayedL( *iNode ) ) + { + return; + } + + iLaidOut = ETrue; + + for ( TInt i = 0; i < iChildren.Count(); i++ ) + { + iChildren[i]->SetLaidOutL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::IsLaidOut +// ----------------------------------------------------------------------------- +// +TBool CXnNodeImpl::IsLaidOut() const + { + return iLaidOut; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::ClearRenderedAndLaidOut +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::ClearRenderedAndLaidOut() + { + if ( !iRendered && !iLaidOut ) + { + return; + } + + TRect empty; + + SetRect( empty ); + SetPaddingRect( empty ); + SetBorderRect( empty ); + SetNormalFlowBorderRect( empty ); + SetMarginRect( empty ); + + iRendered = EFalse; + iLaidOut = EFalse; + + if ( iLayoutCapable ) + { + for ( TInt i = 0; i < iChildren.Count(); i++ ) + { + iChildren[i]->ClearRenderedAndLaidOut(); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::MakeInterfaceL +// Create a component interface according to the given type. +// ----------------------------------------------------------------------------- +// +XnComponentInterface::MXnComponentInterface* CXnNodeImpl::MakeInterfaceL( + const TDesC8& /*aType*/ ) + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// PropertyL +// 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 )(); + } + + if ( aLayoutPropertyCache && aProperty ) + { + CXnDomProperty* attribute = aProperty->Property(); + CXnDomList& list = attribute->PropertyValueList(); + + if ( list.Length() == 0 ) + { + return NULL; + } + + CXnDomPropertyValue* attributeValue = + static_cast< CXnDomPropertyValue* >( list.Item( 0 ) ); + + if ( !attributeValue ) + { + return NULL; + } + + if ( attributeValue->IsInheritIdent() && aParent ) + { + // inherited values are queried from the parent + return ( aParent->*aFunc )(); + } + + // otherwise just return the value + return aProperty; + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// 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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::HeightL +// Returns height property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::MarginLeftL +// Returns margin-left property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::MarginRightL +// Returns margin-right property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BorderLeftL +// Returns border-left property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BorderRightL +// Returns border-right property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::PaddingLeftL +// Returns padding-left property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::PaddingRightL +// Returns PaddingRightL property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::MarginTopL +// Returns margin-top property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::MarginBottomL +// Returns margin-bottom property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BorderTopL +// Returns border-top property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BorderBottomL +// Returns border-bottom property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::PaddingTopL +// Returns padding-top property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::PaddingBottomL +// Returns padding-bottom property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BorderWidthL +// Returns border-width property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BlockProgressionL +// Returns block-progression property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::DirectionL +// Returns direction property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::PositionL +// Returns position property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::MaxHeightL +// Returns max-height property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::MinHeightL +// Returns min-height property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::MaxWidthL +// Returns max-width property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::MinWidthL +// Returns min-width property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::DisplayL +// Returns display property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::LeftL +// Returns left property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::RightL +// Returns right property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::TopL +// Returns top property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BottomL +// Returns bottom property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BorderLeftStyleL +// Returns border-left-style property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BorderRightStyleL +// Returns border-right-style property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BorderTopStyleL +// Returns border-top-style property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BorderBottomStyleL +// Returns border-bottom-style property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BorderStyleL +// Returns border-style property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BorderImageL +// Returns border-image property. +// ----------------------------------------------------------------------------- +// +CXnProperty* CXnNodeImpl::BorderImageL() + { + CXnProperty* property = + iLayoutPropertyCache ? iLayoutPropertyCache->iBorderImage : NULL; + return PropertyL( this, property, &CXnNode::BorderImageL, + iUiEngine, iLayoutPropertyCache, + iParent, iRef ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::DisplayPriorityL +// Returns display-priority property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::NameL +// Returns name property. +// ----------------------------------------------------------------------------- +// +CXnProperty* CXnNodeImpl::NameL() + { + return PropertyL( this, iName, &CXnNode::NameL, + iUiEngine, this, + iParent, iRef ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::ValueL +// Returns value property. +// ----------------------------------------------------------------------------- +// +CXnProperty* CXnNodeImpl::ValueL() + { + return PropertyL( this, iValue, &CXnNode::ValueL, + iUiEngine, this, + iParent, iRef ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::VisibilityL +// Returns visibility property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::LabelL +// Returns label property. +// ----------------------------------------------------------------------------- +// +CXnProperty* CXnNodeImpl::LabelL() + { + return PropertyL( this, iLabel, &CXnNode::LabelL, + iUiEngine, this, + iParent, iRef ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::InitialFocusL +// Returns initial-focus property. +// ----------------------------------------------------------------------------- +// +CXnProperty* CXnNodeImpl::InitialFocusL() + { + return PropertyL( this, iInitialFocus, &CXnNode::InitialFocusL, + iUiEngine, this, + iParent, iRef ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::ClassL +// Returns class property. +// ----------------------------------------------------------------------------- +// +CXnProperty* CXnNodeImpl::ClassL() + { + return PropertyL( this, iClass, &CXnNode::ClassL, + iUiEngine, this, + iParent, iRef ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::IdL +// Returns id property. +// ----------------------------------------------------------------------------- +// +CXnProperty* CXnNodeImpl::IdL() + { + if ( iId ) + { + CXnDomProperty* attribute = iId->Property(); + CXnDomList& list = attribute->PropertyValueList(); + if ( list.Length() == 0 ) + { + return NULL; + } + CXnDomPropertyValue* attributeValue = + static_cast< CXnDomPropertyValue* >( list.Item( 0 ) ); + if ( !attributeValue ) + { + return NULL; + } + if ( attributeValue->IsInheritIdent() + && iParent ) + { + // inherited values are queried from the parent + return iParent->IdL(); + } + // otherwise just return the value + return iId; + } + // if not found, return NULL + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::PathL +// Returns path property. +// ----------------------------------------------------------------------------- +// +CXnProperty* CXnNodeImpl::PathL() + { + return PropertyL( this, iPath, &CXnNode::PathL, + iUiEngine, this, + iParent, iRef ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::MaskPathL +// Returns maskpath property. +// ----------------------------------------------------------------------------- +// +CXnProperty* CXnNodeImpl::MaskPathL() + { + return PropertyL( this, iMaskPath, &CXnNode::MaskPathL, + iUiEngine, this, + iParent, iRef ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::NavIndexL +// Returns nav-index property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::ZIndexL +// Returns z-index property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BackgroundColorL +// Returns background-color property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::BackgroundImageL +// Returns background-image property. +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::FocusBackgroundL +// Returns focus-background property. +// ----------------------------------------------------------------------------- +// +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; + } + +// ---------------------------------------------------------------------------- +// CXnNodeImpl::SetDomNode +// Sets DOM node +// ---------------------------------------------------------------------------- +// +void CXnNodeImpl::SetDomNode( CXnDomNode* aDomNode ) + { + iDomNode = aDomNode; + } + +// ---------------------------------------------------------------------------- +// CXnNodeImpl::DomNode +// Returns the DOM node pointer +// ---------------------------------------------------------------------------- +// +CXnDomNode* CXnNodeImpl::DomNode() + { + return iDomNode; + } + +// ---------------------------------------------------------------------------- +// CXnNodeImpl::MeasureAdaptiveContentL +// Measures the adaptive content dimensions. +// ---------------------------------------------------------------------------- +// +TSize CXnNodeImpl::MeasureAdaptiveContentL( const TSize& aAvailableSize ) + { + TSize empty; + + TInt adaptive( IsAdaptive() ); + + if ( aAvailableSize.iWidth <= 0 && ( adaptive & XnAdaptive::EWidth ) || + aAvailableSize.iHeight <= 0 && ( adaptive & XnAdaptive::EHeight ) ) + { + // No available size, don't even try to measure + return empty; + } + + // node is displayed as default + TBool displayed( ETrue ); + + CXnProperty* displayProp( DisplayL() ); + + if ( displayProp ) + { + const TDesC8& value( displayProp->StringValue() ); + + if ( value != XnPropertyNames::style::common::display::KBlock ) + { + // Not displayed + displayed = EFalse; + } + } + + if ( adaptive && iLayoutCapable && !iDropped && displayed ) + { + CXnControlAdapter* adapter( iNode->Control() ); + + // What is my size? + if ( adapter ) + { + TInt width( 0 ); + TInt height( 0 ); + + TSize size = adapter->MeasureAdaptiveContentL( aAvailableSize ); + + if ( adaptive & XnAdaptive::EWidth ) + { + width = size.iWidth; + } + + if ( adaptive & XnAdaptive::EHeight ) + { + height = size.iHeight; + } + + return TSize( width, height ); + } + } + + return empty; + } + +// ---------------------------------------------------------------------------- +// CXnNodeImpl::IsAdaptive +// Checks if the node have adaptive content +// ---------------------------------------------------------------------------- +// +TInt CXnNodeImpl::IsAdaptive( TBool aIgnoreSizeFixed ) const + { + if ( !iAdaptive ) + { + return XnAdaptive::ENone; + } + + TInt adaptive( iAdaptive ); + + if ( ( adaptive & XnAdaptive::ESizeFixed ) && !aIgnoreSizeFixed ) + { + // When size is fixed, pretend non-adaptive + return XnAdaptive::ENone; + } + + // Remove measure control flags + adaptive &= ~XnAdaptive::EMeasure; + adaptive &= ~XnAdaptive::ESizeFixed; + + return adaptive; + } + +// ---------------------------------------------------------------------------- +// CXnNodeImpl::SetAdaptiveL +// Marks the node to have adaptive content +// ---------------------------------------------------------------------------- +// +void CXnNodeImpl::SetAdaptiveL( const TInt aAdaptive ) + { + TInt adaptive( aAdaptive ); + + // Force adaptive nodes to be auto + if ( adaptive & XnAdaptive::EMeasure ) + { + if ( iAdaptive & XnAdaptive::EMeasure ) + { + // Measure already pending + return; + } + + if ( iAdaptive & XnAdaptive::EWidth ) + { + adaptive |= XnAdaptive::EWidth; + } + + if ( iAdaptive & XnAdaptive::EHeight ) + { + adaptive |= XnAdaptive::EHeight; + } + + // Reset + iAdaptive = XnAdaptive::ENone; + } + + if ( ( adaptive & XnAdaptive::EWidth ) && + !( iAdaptive & XnAdaptive::EWidth ) ) + { + iAdaptive |= XnAdaptive::EIgnoreDirty; + + SetStringPropertyToNodeL( + DomNode()->StringPool(), *Node(), + XnPropertyNames::style::common::KWidth, + XnPropertyNames::style::common::KAuto ); + + // Width is adaptive + iAdaptive |= XnAdaptive::EWidth; + + iAdaptive &= ~XnAdaptive::EIgnoreDirty; + } + + if ( ( adaptive & XnAdaptive::EHeight ) && + !( iAdaptive & XnAdaptive::EHeight ) ) + { + iAdaptive |= XnAdaptive::EIgnoreDirty; + + SetStringPropertyToNodeL( + DomNode()->StringPool(), *Node(), + XnPropertyNames::style::common::KHeight, + XnPropertyNames::style::common::KAuto ); + + // Height is adaptive + iAdaptive |= XnAdaptive::EHeight; + + iAdaptive &= ~XnAdaptive::EIgnoreDirty; + } + + // Size is no more fixed + iAdaptive &= ~XnAdaptive::ESizeFixed; + + // and it needs to be measured + iAdaptive |= XnAdaptive::EMeasure; + } + +// ---------------------------------------------------------------------------- +// CXnNodeImpl::FixAdaptiveSize +// Fixes the adaptive node's size +// ---------------------------------------------------------------------------- +// +void CXnNodeImpl::FixAdaptiveSizeL( const TSize& aFixedSize ) + { + // Is there measure pending + if ( iAdaptive & XnAdaptive::EMeasure ) + { + if ( iAdaptive & XnAdaptive::EWidth ) + { + iAdaptive |= XnAdaptive::EIgnoreDirty; + + SetFloatPropertyToNodeL( + DomNode()->StringPool(), *Node(), + XnPropertyNames::style::common::KWidth, + aFixedSize.iWidth, CXnDomPropertyValue::EPx ); + + iAdaptive &= ~XnAdaptive::EIgnoreDirty; + } + + if ( iAdaptive & XnAdaptive::EHeight ) + { + iAdaptive |= XnAdaptive::EIgnoreDirty; + + SetFloatPropertyToNodeL( + DomNode()->StringPool(), *Node(), + XnPropertyNames::style::common::KHeight, + aFixedSize.iHeight, CXnDomPropertyValue::EPx ); + + iAdaptive &= ~XnAdaptive::EIgnoreDirty; + } + + // Measure done + iAdaptive &= ~XnAdaptive::EMeasure; + // Size is now fixed + iAdaptive |= XnAdaptive::ESizeFixed; + } + } + +// ---------------------------------------------------------------------------- +// 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 +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetDirtyL( TInt aLevel, TBool aDisplayedState ) + { + if( !aDisplayedState ) + { + // check if node isn't displayed indeed (def. param. = EFalse) + aDisplayedState = IsNodeDisplayedL( *iNode ); + } + if ( iLayoutCapable ) + { + if ( aLevel == XnDirtyLevel::ENone ) + { + // nothing to do + return; + } + + if ( aLevel == XnDirtyLevel::ELayoutAndRenderSiblings ) + { + if ( iParent ) + { + // Siblings needs to be laid out also + RPointerArray< CXnNode >& siblings( iParent->Children() ); + + for ( TInt i = 0; i < siblings.Count(); i++ ) + { + CXnNode* sibling( siblings[i] ); + + if ( sibling == iNode ) + { + sibling->SetDirtyL( XnDirtyLevel::ELayoutAndRender, + aDisplayedState ); + } + else + { + sibling->SetDirtyL( XnDirtyLevel::ELayoutAndRender ); + } + } + } + } + else + { + if ( ( iParent || iNode == iUiEngine->RootNode() ) && + iNode != iUiEngine->ActiveView() ) + { + // Full redraw (without layout) can be done by setting rootnode + // level to ERender + if ( aLevel == XnDirtyLevel::ERender && !iLaidOut && + iNode != iUiEngine->RootNode() ) + { + aLevel = XnDirtyLevel::ELayoutAndRender; + } + + if ( aDisplayedState ) + { + iUiEngine->AddDirtyNodeL( iNode, aLevel ); + } + else + { + ClearRenderedAndLaidOut(); + } + } + } + } + else if ( iParent && iParent->Type()->Type() == KMenuBar ) + { + // Mark menu to be refreshed + iUiEngine->AddDirtyNodeL( iParent, XnDirtyLevel::ERender ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::RunFocusChangeL +// ----------------------------------------------------------------------------- +// +TBool CXnNodeImpl::RunFocusChangeL( RPointerArray< CXnNode >& aFocusCandidates ) + { + for ( TInt i = 0; i < aFocusCandidates.Count(); i++ ) + { + CXnNode* node( aFocusCandidates[i] ); + + if ( IsNodeNavigableL( *node ) ) + { + if( node->ScrollableControl() ) + { + node->ScrollableControl()->ShowItem( *node ); + } + + node->SetStateWithoutNotificationL( + XnPropertyNames::style::common::KFocus ); + + // All done + return ETrue; + } + } + + // Focus change failed + CXnNode* focused( iUiEngine->FocusedNode() ); + + if ( focused ) + { + // Is the currently focused node still navigable + if ( !IsNodeNavigableL( *focused ) ) + { + // No, remove focus + focused->UnsetStateL( XnPropertyNames::style::common::KFocus ); + } + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::ReorderNodesL +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::ReorderNodesL( CXnNode* aSource, CXnNode* aTarget ) + { + TInt target = -1; + TInt source = -1; + TInt childCount = iChildren.Count(); + RPointerArray< CXnNode > lockedNodes; + CleanupClosePushL( lockedNodes ); + RArray< TInt > lockedNodeIndex; + CleanupClosePushL( lockedNodeIndex ); + + for ( TInt i = 0; i < childCount; i++ ) + { + CXnNode* tmpNode = iChildren[i]; + CXnProperty* editable = tmpNode->GetPropertyL( + XnPropertyNames::style::common::edit::KEditable ); + if ( editable && editable->StringValue() == XnPropertyNames::KFalse ) + { + lockedNodes.AppendL( tmpNode ); + lockedNodeIndex.AppendL( i ); + continue; + } + + if ( tmpNode == aSource ) + { + source = i; + } + if ( tmpNode == aTarget ) + { + target = i; + } + } + if ( source != -1 && target != -1 ) + { + if ( target < source ) + { + iChildren.InsertL( aSource, target ); + iChildren.Remove( source + 1 ); + } + else if ( source < target ) + { + iChildren.Remove( source ); + iChildren.InsertL( aSource, target ); + } + + // put the locked nodes to the original places + TInt lockedNodeCount = lockedNodes.Count(); + TInt lockedIndexCount = lockedNodeIndex.Count(); + if ( lockedNodeCount != lockedIndexCount ) + { + return; + } + // First remove all the locked nodes + for ( TInt j = 0; j < lockedNodeCount; j++ ) + { + CXnNode* tmpLockedNode = lockedNodes[j]; + TInt ind = iChildren.FindL( tmpLockedNode ); + if ( KErrNotFound != ind ) + { + iChildren.Remove( ind ); + } + } + + //And then put them again to the original places + for ( TInt j = 0; j < lockedNodeCount; j++ ) + { + CXnNode* tmpLockedNode = lockedNodes[j]; + iChildren.InsertL( tmpLockedNode, lockedNodeIndex[j] ); + } + } + + lockedNodes.Reset(); + lockedNodeIndex.Reset(); + CleanupStack::PopAndDestroy( 2 ); // lockedNodes, lockedNodeIndex + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::FindNextNodeL +// ----------------------------------------------------------------------------- +// +CXnNode* CXnNodeImpl::FindNextNodeL( + RPointerArray< CXnNode >& aArray, + CXnNode& aNode, + TInt aDirection ) + { + CXnNode* node = NULL; + if ( aDirection == EStdKeyRightArrow ) + { + node = FindNextNodeFromRightL( aArray, aNode ); + } + else if ( aDirection == EStdKeyLeftArrow ) + { + node = FindNextNodeFromLeftL( aArray, aNode ); + } + else if ( aDirection == EStdKeyUpArrow ) + { + node = FindNextNodeFromAboveL( aArray, aNode ); + } + else if ( aDirection == EStdKeyDownArrow ) + { + node = FindNextNodeFromBelowL( aArray, aNode ); + } + return node; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::Namespace +// ----------------------------------------------------------------------------- +// +const TDesC8& CXnNodeImpl::Namespace() + { + return DomNode()->Namespace(); + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::SetScrollableControl() +// ----------------------------------------------------------------------------- +// +void CXnNodeImpl::SetScrollableControl( CXnScrollableControlAdapter* aScrollableControl ) + { + iScrollableControl = aScrollableControl; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::ScrollableControl() +// ----------------------------------------------------------------------------- +// +CXnScrollableControlAdapter* CXnNodeImpl::ScrollableControl() + { + return iScrollableControl; + } + +// ----------------------------------------------------------------------------- +// CXnNodeImpl::AdjustRectIfNeeded +// ----------------------------------------------------------------------------- +// +TRect CXnNodeImpl::AdjustRectIfNeeded( TRect aRect ) + { + if(iScrollableControl) + { + aRect.Move( iScrollableControl->DeltaPosition() ); + } + return aRect; + } + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnnodepluginif.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnnodepluginif.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,583 @@ +/* +* 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: Node of the layout tree +* +*/ + + +// User includes +#include "xnnodepluginif.h" +#include "xnnode.h" +#include "xnuiengine.h" +#include "xncomponentnodeimpl.h" +#include "xnproperty.h" +#include "xntype.h" +#include "xndomdocument.h" +#include "xnodt.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::CXnNodePluginIf() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnNodePluginIf::CXnNodePluginIf( CXnNode& aNode ) + { + iNode = &aNode; + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::ViewNodeImpl +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnViewNodeImpl* CXnNodePluginIf::ViewNodeImpl() + { + return iNode->ViewNodeImpl(); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::ComponentNodeImpl +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnComponentNodeImpl* CXnNodePluginIf::ComponentNodeImpl() + { + return iNode->ComponentNodeImpl(); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::IsDrawingAllowed +// ----------------------------------------------------------------------------- +// +TBool CXnNodePluginIf::IsDrawingAllowed() const + { + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::Type() +// Returns control type. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnType* CXnNodePluginIf::Type() + { + return iNode->Type(); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::Parent +// Get component parent +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnNodePluginIf* CXnNodePluginIf::ParentL() const + { + CXnNode* node = iNode->Parent(); + if ( !node ) + { + return NULL; + } + return &( node->PluginIfL() ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::AddChildL +// Adds a child to this container. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodePluginIf::AddChildL( CXnNodePluginIf* aChild ) + { + iNode->AddChildL( &( aChild->Node() ) ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::Children +// ----------------------------------------------------------------------------- +// +EXPORT_C RPointerArray< CXnNodePluginIf > CXnNodePluginIf::ChildrenL() + { + RPointerArray< CXnNode >& nodes = iNode->Children(); + RPointerArray< CXnNodePluginIf > pluginNodes; + CleanupClosePushL( pluginNodes ); + + TInt count = nodes.Count(); + for ( TInt i = 0; i < count; ++i ) + { + pluginNodes.AppendL( &nodes[i]->PluginIfL() ); + } + CleanupStack::Pop( &pluginNodes ); + // Compiler will generate bitwise copy ctor, thus + // caller of this function must call reset or close for copied RPointerArrays, + // which is very nasty thing to do... + return pluginNodes; + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::SetPCDataL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodePluginIf::SetPCDataL( const TDesC8& aData ) + { + iNode->SetPCDataL( aData ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::GetPCData +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CXnNodePluginIf::GetPCData() const + { + return iNode->GetPCData(); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::SetPropertyL +// Set a property. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodePluginIf::SetPropertyL( CXnProperty* aProperty ) + { + iNode->SetPropertyL( aProperty ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::SetPropertyL +// Set a property. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodePluginIf::SetPropertyWithoutNotificationL( CXnProperty* aProperty ) + { + iNode->SetPropertyWithoutNotificationL( aProperty ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::GetProperty +// Gets a property. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnProperty* CXnNodePluginIf::GetPropertyL( CXnProperty& /*aProperty*/ ) const + { + return NULL; // iNode->GetPropertyL( aProperty ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::GetProperty +// Gets a property. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnProperty* CXnNodePluginIf::GetPropertyL( const TDesC8& aKey ) const + { + return iNode->GetPropertyL( aKey ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::SetStateL +// Set a state +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodePluginIf::SetStateL( const TDesC8& aState ) + { + iNode->SetStateL( aState ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::UnsetState +// Unset a pseudoclass +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodePluginIf::UnsetStateL( const TDesC8& aState ) + { + iNode->UnsetStateL( aState ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::IsFocusedState +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CXnNodePluginIf::IsFocusedState() + { + return iNode->IsStateSet( _L8( "focus" ) ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::SetRect +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodePluginIf::SetRect( const TRect& aRect ) + { + iNode->SetRect( aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::Rect +// ----------------------------------------------------------------------------- +// +EXPORT_C TRect CXnNodePluginIf::Rect() + { + return iNode->Rect(); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::SetBorderRect +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodePluginIf::SetBorderRect( const TRect& aRect ) + { + iNode->SetBorderRect( aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::BorderRect +// ----------------------------------------------------------------------------- +// +EXPORT_C TRect CXnNodePluginIf::BorderRect() + { + return iNode->BorderRect(); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::SetMarginRect +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodePluginIf::SetMarginRect( const TRect& aRect ) + { + iNode->SetMarginRect( aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::MarginRect +// ----------------------------------------------------------------------------- +// +EXPORT_C TRect CXnNodePluginIf::MarginRect() + { + return iNode->MarginRect(); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::SetPaddingRect +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodePluginIf::SetPaddingRect( const TRect& aRect ) + { + iNode->SetPaddingRect( aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::PaddingRect +// ----------------------------------------------------------------------------- +// +EXPORT_C TRect CXnNodePluginIf::PaddingRect() + { + return iNode->PaddingRect(); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::UiEngine +// ----------------------------------------------------------------------------- +// +EXPORT_C TXnUiEnginePluginIf* CXnNodePluginIf::UiEngineL() + { + return &( iNode->UiEngine()->PluginIfL() ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::SetLayoutCapable +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodePluginIf::SetLayoutCapable( const TBool aLayoutCapable ) + { + iNode->SetLayoutCapable( aLayoutCapable ); + } + +// ----------------------------------------------------------------------------- +// Get internal node +// ----------------------------------------------------------------------------- +// +CXnNode& CXnNodePluginIf::Node() + { + return *iNode; + } + +// ----------------------------------------------------------------------------- +// Get app interface +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnNodeAppIf& CXnNodePluginIf::AppIfL() + { + return iNode->AppIfL(); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::MakeInterfaceL +// Create a component interface according to the given type. +// ----------------------------------------------------------------------------- +// +EXPORT_C XnComponentInterface::MXnComponentInterface* CXnNodePluginIf::MakeInterfaceL( + const TDesC8& aType ) + { + return iNode->MakeInterfaceL( aType ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::DisplayL +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnProperty* CXnNodePluginIf::DisplayL() + { + return iNode->DisplayL(); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::VisibilityL +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnProperty* CXnNodePluginIf::VisibilityL() + { + return iNode->VisibilityL(); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::LabelL +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnProperty* CXnNodePluginIf::LabelL() + { + return iNode->LabelL(); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::IdL +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnProperty* CXnNodePluginIf::IdL() + { + return iNode->IdL(); + } + +// ----------------------------------------------------------------------------- +// 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 +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodePluginIf::SetHandleTooltip( TBool aFlag ) + { + iNode->SetHandleTooltip( aFlag ); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodePluginIf::ReportTriggerEventL( + const TDesC8& aTriggerName, + const TDesC8& aValueName, + const TDesC8& aValue ) + { + CXnNode* trigger = CXnNode::NewL(); + CleanupStack::PushL( trigger ); + CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger ); + CleanupStack::PushL( type ); + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + trigger->SetImpl( impl ); + trigger->SetUiEngine( *iNode->UiEngine() ); + + CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( + iNode->UiEngine()->ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( nameValue ); + nameValue->SetStringValueL( CXnDomPropertyValue::EString, aTriggerName ); + + CXnProperty* name = CXnProperty::NewL( + XnPropertyNames::action::trigger::KName, + nameValue, + iNode->UiEngine()->ODT()->DomDocument().StringPool() ); + + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + trigger->SetPropertyL( name ); + CleanupStack::Pop( name ); + + CXnDomPropertyValue* indexValue = CXnDomPropertyValue::NewL( + iNode->UiEngine()->ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( indexValue ); + indexValue->SetStringValueL( CXnDomPropertyValue::EString, aValue ); + + CXnProperty* index = CXnProperty::NewL( + aValueName, + indexValue, + iNode->UiEngine()->ODT()->DomDocument().StringPool() ); + + CleanupStack::Pop( indexValue ); + CleanupStack::PushL( index ); + trigger->SetPropertyL( index ); + CleanupStack::Pop( index ); + + iNode->ReportXuikonEventL( *trigger, 0 ); + + CleanupStack::PopAndDestroy( trigger ); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::PathL +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnProperty* CXnNodePluginIf::PathL() + { + return iNode->PathL(); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::MaskPathL +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnProperty* CXnNodePluginIf::MaskPathL() + { + return iNode->MaskPathL(); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::SetDirtyL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnNodePluginIf::SetDirtyL() + { + const TDesC8& type( iNode->Type()->Type() ); + + if ( iNode->IsAdaptive( ETrue ) || + type == _L8( "grid" ) || + type == _L8( "list" ) ) + { + iNode->SetDirtyL( XnDirtyLevel::ELayoutAndRender ); + } + else + { + iNode->SetDirtyL( XnDirtyLevel::ERender ); + } + + // If node's parent is tooltip, it must be relayouted because it will + // grow based on childs + CXnNode* parent( iNode->Parent() ); + + if ( parent && parent->Type()->Type() == _L8( "tooltip" ) ) + { + parent->SetDirtyL( XnDirtyLevel::ELayoutAndRender ); + } + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::Namespace +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CXnNodePluginIf::Namespace() + { + return iNode->Namespace(); + } + +// ----------------------------------------------------------------------------- +// CXnNodePluginIf::ControlL +// Gets the control associated to this node +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnControlAdapter* CXnNodePluginIf::Control() const + { + return iNode->Control(); + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnnodepredicate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnnodepredicate.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,41 @@ +/* +* 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: Node predicate +* +*/ + +// INCLUDES +#include "xnnodepredicate.h" + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +EXPORT_C MXnNodePredicate::MXnNodePredicate() + { + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +EXPORT_C MXnNodePredicate::~MXnNodePredicate() + { + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool MXnNodePredicate::Match( CXnNode& /*aItem*/ ) + { + return EFalse; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnodtparser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnodtparser.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1318 @@ +/* +* 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: ODT parser +* +*/ +#include <aisystemuids.hrh> +#include <xnextrenderingpluginadapter.h> +#include <ecom/ecom.h> +#include <ecom/implementationinformation.h> + +#include "xnextrenderingpluginwrapper.h" + +#include "xnodt.h" +#include "xndomdocument.h" +#include "xndomnode.h" +#include "xndomattribute.h" +#include "xndomlist.h" +#include "xnnode.h" + +#include "xnecomhandler.h" +#include "xnuiengine.h" +#include "xntype.h" +#include "xncontroladapter.h" +#include "xnpopupcontroladapter.h" +#include "xnwidgetextensionadapter.h" +#include "xnscrollablecontroladapter.h" +#include "xnlistquerydialogadapter.h" + +#include "xncomponent.h" +#include "xncomponentnodeimpl.h" +#include "xnviewnodeimpl.h" +#include "xnviewsnodeimpl.h" +#include "xnproperty.h" +#include "xncomponentfactory.h" +#include "xnarray.h" +#include "xnviewmanager.h" +#include "xnplugindata.h" +#include "xnrootdata.h" +#include "xnviewdata.h" + +#include "xnodtparser.h" + +_LIT8( KWidgetBgSkinId, "SKIN(268458534 9886)" ); + +// CONSTANTS +_LIT8( KXMLUIMLNodeName, "xmluiml" ); +_LIT8( KViewsNodeName, "views" ); +_LIT8( KViewNodeName, "view" ); +_LIT8( KBoxNodeName, "box" ); +_LIT8( KButtonNodeName, "button" ); +_LIT8( KStylusPopupNodeName, "styluspopup" ); +_LIT8( KListNodeName, "list" ); +_LIT8( KGridNodeName, "grid" ); +_LIT8( KImageNodeName, "image" ); +_LIT8( KTooltipNodeName, "tooltip" ); +_LIT8( KMenuBarNodeName, "menubar" ); +_LIT8( KMenuNodeName, "menu" ); +_LIT8( KMenuItemNodeName, "menuitem" ); +_LIT8( KDynMenuItemNodeName, "dynmenuitem" ); +_LIT8( KWidgetMenuItemNodeName, "widgetmenuitem" ); +_LIT8( KActionsNodeName, "actions" ); +_LIT8( KActionNodeName, "action" ); +_LIT8( KTriggerNodeName, "trigger" ); +_LIT8( KEventNodeName, "event" ); +_LIT8( KTextNodeName, "text" ); +_LIT8( KGridCellTemplateNodeName, "gridcelltemplate" ); +_LIT8( KListRowTemplateNodeName, "listrowtemplate" ); +_LIT8( KMarqueeNodeName, "marquee" ); +_LIT8( KObjectNodeName, "object" ); +_LIT8( KTracksterNodeName, "trackster" ); +_LIT8( KPropertyNodeName, "property" ); +_LIT8( KConfigurationNodeName, "configuration" ); +_LIT8( KNewstickerNodeName, "newsticker" ); +_LIT8( KAttributeNodeName, "attribute" ); +_LIT8( KItemNodeName, "item" ); +_LIT8( KDescNodeName, "desc" ); +_LIT8( KTextZoomNodeName, "textzoom" ); +_LIT8( KVolumeControlNodeName, "volumecontrol" ); +_LIT8( KPluginNodeName, "plugin" ); +_LIT8( KWidgetNodeName, "widget" ); +_LIT8( KSliderNodeName, "slider" ); +_LIT8( KClockNodeName, "clock" ); +_LIT8( KSoftkeyNodeName,"softkey" ); +_LIT8( KConditionalTrigger,"conditional" ); +_LIT8( KCondtionalOn, "true" ); +_LIT8( KListQueryDialogNodeName, "listquerydialog" ); +_LIT8( KSettingsConfigurationNodeName, "settingsconfiguration" ); +_LIT8( KContentSourceNodeName, "contentsource" ); +_LIT8( KMenuExtensionNodeName, "menuextension" ); +_LIT8( KWidgetExtensionNodeName, "widgetextension" ); +_LIT8( KTextEditorNodeName, "texteditor" ); +_LIT8( KActionsHandlerNodeName, "actionshandler" ); +_LIT8( KScrollableBoxNodeName, "scrollablebox" ); +_LIT8( KPopUpNodeName, "popup" ); + +// LOCAL FUNCTION PROTOTYPES +#ifdef _XN3_DEBUG_ +#include <flogger.h> +#include <utf.h> +static void PrintDomL( CXnDomDocument* aDomDocument ); +#endif + +static CXnNode* BuildRootNodeL( CXnUiEngine& aEngine ); + +static CXnNode* FindAncestorWhoActAsParent( CXnDomNode& aSource ); + +static TBool CreateTriggerInLayoutNodeTree( CXnDomNode& aSource ); + +static void CopyPropertiesFromDomNodeToNodeL( + CXnNode& aTarget, + CXnDomNode& aSource, + CXnDomStringPool& aStringPool ); +static CXnNode* ConstructNodeFromPluginL( + CXnEcomHandler& aEcomHandler, + CXnDomNode& aSource ); +static CXnNode* ConstructKnownBuiltinNodeL( CXnDomNode& aSource ); +static CXnNode* ConstructGeneralNodeL( CXnDomNode& aSource ); + +// ============================= LOCAL FUNCTIONS =============================== + + +// ---------------------------------------------------------------------------- +// CleanupResetAndDestroy() +// ---------------------------------------------------------------------------- +// +template<class T> +static void CleanupResetAndDestroy( TAny* aObj ) + { + if( aObj ) + { + static_cast<T*>( aObj )->ResetAndDestroy(); + } + } + +// ---------------------------------------------------------------------------- +// CleanupResetAndDestroyPushL +// ---------------------------------------------------------------------------- +// +template<class T> +static void CleanupResetAndDestroyPushL(T& aArray) + { + CleanupStack::PushL( TCleanupItem( &CleanupResetAndDestroy<T>, &aArray ) ); + } + +#ifdef _XN3_DEBUG_ +_LIT( KLogFolder," xnlayoutengine" ); +_LIT( KLogDom, "dom.log" ); +#define _LOGT( aDescription ) RFileLogger::Write( \ + KLogFolder, KLogDom, EFileLoggingModeOverwrite, aDescription ); +#define _LOGTFRM1( a, b ) RFileLogger::WriteFormat( \ + KLogFolder, KLogDom, EFileLoggingModeOverwrite, ( a ), ( b ) ) +#define _LOGTFRM2( a, b, c ) RFileLogger::WriteFormat( \ + KLogFolder, KLogDom, EFileLoggingModeOverwrite, ( a ), ( b ), ( c ) ); +#define _LOGTFRM3( a, b, c, d ) RFileLogger::WriteFormat( \ + KLogFolder, KLogDom, EFileLoggingModeOverwrite, ( a ), ( b ), ( c ), ( d ) ); +static const TInt GetNodeDepth( CXnDomNode *aNode ) + { + TInt depth = 0; + CXnDomNode* node( aNode ); + while ( node ) + { + node = node->Parent(); + if ( node ) + { + depth++; + } + } + return depth; + } + +//----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +static HBufC8* GetFixedTextLC( + const TDesC8& aText, + const TInt aDepth, + const TDesC8& aDelim ) + { + HBufC8 *buf = HBufC8::NewL( aDepth * aDelim.Length() + aText.Length() + 1 ); + TInt i = 0; + for ( ; i < aDepth; i++ ) + { + buf->Des().Append( aDelim ); + } + buf->Des().Append( aText ); + return buf; + } + +//----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +static void PrintDomL( CXnDomDocument* aDomDocument ) + { +__UHEAP_MARK; + TInt attrCount( 0 ); + TInt propCount( 0 ); + + CXnDomDepthIterator* iter = + CXnDomDepthIterator::NewL( *aDomDocument->RootNode() ); + CleanupStack::PushL( iter ); + + _LIT8( KDelim, "\t" ); + CXnDomNode* nodeParent( NULL ); + CXnDomNode* node = iter->First(); + while ( node ) + { + const TInt depth = GetNodeDepth( node ); + + HBufC8 *nameBuf = GetFixedTextLC( node->Name(), depth, KDelim ); + CleanupStack::PushL( nameBuf ); + const TDesC8& name = nameBuf->Des(); + + HBufC8 *nsBuf = GetFixedTextLC( node->Namespace(), depth, KDelim ); + CleanupStack::PushL( nsBuf ); + const TDesC8& ns = nsBuf->Des(); + + _LOGTFRM2( _L8( "%S -------------------------- %S\n" ), &name, &ns ); + + CXnDomList& attrList = node->AttributeList(); + TInt length( attrList.Length() ); + attrCount += length; + + for ( TInt i = 0; i < length; i++ ) + { + CXnDomAttribute* attr = static_cast< CXnDomAttribute* >( + attrList.Item( i ) ); + + HBufC8 *attrBuf = GetFixedTextLC( attr->Name(), depth, KDelim ); + CleanupStack::PushL( attrBuf ); + const TDesC8& attrName = attrBuf->Des(); + + const TDesC8& attrValue = attr->Value(); + + _LOGTFRM2( _L8( "%S=%S\n" ), &attrName, &attrValue ); + + CleanupStack::PopAndDestroy( attrBuf ); + } + + if ( node->Parent() ) + { + nodeParent = node; + } + node = iter->NextL(); + + CleanupStack::PopAndDestroy( nsBuf ); + CleanupStack::PopAndDestroy( nameBuf ); + } + CleanupStack::PopAndDestroy( iter ); + + _LOGTFRM1( _L8( "****DOM Size: %d ****\n" ), aDomDocument->Size() ); + _LOGTFRM1( _L8( "****DOM Node Count: %d ****\n" ), aDomDocument->DomNodeCount() ); + _LOGTFRM1( _L8( "****DOM Attribute Count: %d ****\n" ), attrCount ); +__UHEAP_MARKEND; + } + +#endif +// ----------------------------------------------------------------------------- +// BuildRootNodeL() +// Builds root node +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildRootNodeL( CXnUiEngine& aEngine ) + { + CXnType* type = CXnType::NewL( KXMLUIMLNodeName ); + CleanupStack::PushL( type ); + + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + + CleanupStack::Pop( type ); + CleanupStack::PushL( impl ); + + CXnNode* node = CXnNode::NewL(); + node->SetRootNodeImpl( impl ); + CleanupStack::Pop( impl ); + + node->SetUiEngine( aEngine ); + + return node; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +CXnNode* FindAncestorWhoActAsParent( CXnDomNode& aSource ) + { + CXnNode* ret( NULL ); + CXnDomNode* parent = aSource.Parent(); + + while ( !ret && parent ) + { + ret = parent->LayoutNode(); + parent = parent->Parent(); + } + return ret; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +TBool CreateTriggerInLayoutNodeTree( CXnDomNode& aSource ) + { + TBool ret( EFalse ); + + CXnDomAttribute* attribute = static_cast< CXnDomAttribute* >( + aSource.AttributeList().FindByName( KConditionalTrigger ) ); + + if ( attribute && attribute->Value() == KCondtionalOn ) + { + ret = ETrue; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CopyDomPropertiesFromDomNodeToNodeL +// ----------------------------------------------------------------------------- +// +static void CopyDomPropertiesFromDomNodeToNodeL( + CXnNode& aTarget, + CXnDomNode& aSource ) + { + CXnDomList& propertyList = aSource.PropertyList(); + for ( TInt count = propertyList.Length() - 1; count >= 0; --count ) + { + CXnDomProperty* domProperty = static_cast< CXnDomProperty* >( + propertyList.Item( count ) ); + CXnProperty* property = CXnProperty::NewSharedL( domProperty ); + CleanupStack::PushL( property ); + aTarget.InitializePropertyL( property ); + CleanupStack::Pop( property ); + } + } + +// ----------------------------------------------------------------------------- +// CopyDomAtributesFromDomNodeToNodeL +// ----------------------------------------------------------------------------- +// +static void CopyDomAttributesFromDomNodeToNodeL( + CXnNode& aTarget, + CXnDomNode& aSource, + CXnDomStringPool& aStringPool ) + { + CXnDomList& attributeList = aSource.AttributeList(); + for ( TInt count = attributeList.Length() - 1; count >= 0; --count ) + { + CXnDomAttribute* attribute = static_cast< CXnDomAttribute* >( + attributeList.Item( count ) ); +#ifdef _DEBUG + const TDesC8& name = attribute->Name(); + const TDesC8& attrValue = attribute->Value(); +#endif + if ( attribute->ValueStringPoolIndex() == KErrNotFound ) + { + continue; + } + + if ( attribute->NameStringPoolIndex() == KErrNotFound ) + { + continue; + } + CXnDomProperty* clone = + CXnDomProperty::NewL( attribute->NameStringPoolIndex(), aStringPool ); + CleanupStack::PushL( clone ); + CXnDomPropertyValue* propertyValue = + CXnDomPropertyValue::NewL( aStringPool ); + CleanupStack::PushL( propertyValue ); + propertyValue->SetStringPoolIndexL( + CXnDomPropertyValue::EString, attribute->ValueStringPoolIndex() ); + CXnDomList& propertyList = clone->PropertyValueList(); + propertyList.AddItemL( propertyValue ); + CleanupStack::Pop( propertyValue ); + CXnProperty* property = CXnProperty::NewL( clone ); + CleanupStack::Pop( clone ); + CleanupStack::PushL( property ); + aTarget.InitializePropertyL( property ); + CleanupStack::Pop( property ); + } + + //aSource.DeleteAttributeList(); + // delete attributes from dom node tree + if ( aSource.Name() != KTriggerNodeName ) + { + CXnDomList& attrList = aSource.AttributeList(); + while ( attrList.Length() ) + { + attrList.DeleteItem( attrList.Length() - 1 ); + } + } + } + +// ----------------------------------------------------------------------------- +// CopyPropertiesFromDomNodeToNodeL +// ----------------------------------------------------------------------------- +// +static void CopyPropertiesFromDomNodeToNodeL( + CXnNode& aTarget, + CXnDomNode& aSource, + CXnDomStringPool& aStringPool ) + { + CopyDomPropertiesFromDomNodeToNodeL( aTarget, aSource ); + CopyDomAttributesFromDomNodeToNodeL( aTarget, aSource, aStringPool ); + } + +// ----------------------------------------------------------------------------- +// ConstructNodeFromPluginL +// ----------------------------------------------------------------------------- +// +static CXnNode* ConstructNodeFromPluginL( + CXnEcomHandler& aEcomHandler, + CXnDomNode& aSource ) + { + CXnNode* returnValue = NULL; + const TDesC8& name = aSource.Name(); + + CXnArray* componentFactories = CXnArray::NewL(); + CleanupStack::PushL( componentFactories ); + + TUid interfaceUid = { AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID }; + aEcomHandler.PluginsL( interfaceUid, name, *componentFactories ); + TInt count = componentFactories->Container().Count(); + TBool componentNodeImplNeeded = ETrue; + // invoke factory chain + for ( TInt i = 0; i < count; ++i ) + { + MXnComponentFactory* factory = static_cast< MXnComponentFactory* >( + componentFactories->Container()[i] ); + componentNodeImplNeeded = factory->DoesNodeNeedComponentImplL( name ); + } + CleanupStack::PopAndDestroy( componentFactories ); + if ( componentNodeImplNeeded ) + { + CXnType* type = CXnType::NewL( name ); + CleanupStack::PushL( type ); + CXnComponentNodeImpl* impl = CXnComponentNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + CleanupStack::PushL( impl ); + returnValue = CXnNode::NewL(); + returnValue->SetComponentNodeImpl( impl ); + CleanupStack::Pop( impl ); + } + else + { + if ( name == KActionsNodeName || + name == KActionNodeName || + name == KEventNodeName || + name == KTriggerNodeName || + name == KMenuNodeName || + name == KMenuItemNodeName || + name == KPropertyNodeName || + name == KSoftkeyNodeName ) + { + return ConstructGeneralNodeL( aSource ); + } + } + return returnValue; + } + +// ----------------------------------------------------------------------------- +// ConstructKnownBuiltinNodeL +// ----------------------------------------------------------------------------- +// +static CXnNode* ConstructKnownBuiltinNodeL( CXnDomNode& aSource ) + { + CXnNode* returnValue = NULL; + const TDesC8& name = aSource.Name(); + if ( name == KMenuNodeName || + name == KMenuItemNodeName || + name == KPropertyNodeName || + name == KSoftkeyNodeName || + name == KTriggerNodeName ) + { + return ConstructGeneralNodeL( aSource ); + } + CXnType* type = CXnType::NewL( name ); + CleanupStack::PushL( type ); + if ( name == KViewsNodeName ) + { + CXnViewsNodeImpl* impl = CXnViewsNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + CleanupStack::PushL( impl ); + returnValue = CXnNode::NewL(); + returnValue->SetViewsNodeImpl( impl ); + CleanupStack::Pop( impl ); + } + else if ( name == KViewNodeName ) + { + CXnViewNodeImpl* impl = CXnViewNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + CleanupStack::PushL( impl ); + returnValue = CXnNode::NewL(); + returnValue->SetViewNodeImpl( impl ); + CleanupStack::Pop( impl ); + } + else if ( name == KGridCellTemplateNodeName || + name == KListRowTemplateNodeName || + name == KBoxNodeName || + name == KButtonNodeName || + name == KListNodeName || + name == KGridNodeName || + name == KImageNodeName || + name == KMenuBarNodeName || + name == KTooltipNodeName || + name == KMarqueeNodeName || + name == KTextNodeName || + name == KObjectNodeName || + name == KTracksterNodeName || + name == KNewstickerNodeName || + name == KSliderNodeName || + name == KClockNodeName || + name == KStylusPopupNodeName || + name == KPopUpNodeName || + name == KWidgetExtensionNodeName || + name == KTextEditorNodeName ) + { + CXnComponentNodeImpl* impl = CXnComponentNodeImpl::NewL( type ); + CleanupStack::Pop( type ) ; + CleanupStack::PushL( impl ); + returnValue = CXnNode::NewL(); + returnValue->SetComponentNodeImpl( impl ); + CleanupStack::Pop( impl ); + } + else + { + CleanupStack::PopAndDestroy( type ); + + if ( name == KVolumeControlNodeName || + name == KWidgetNodeName || + name == KPluginNodeName ) + { + CXnType* type = CXnType::NewL( KBoxNodeName ); + CleanupStack::PushL( type ); + CXnComponentNodeImpl* impl = CXnComponentNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + CleanupStack::PushL( impl ); + returnValue = CXnNode::NewL(); + returnValue->SetComponentNodeImpl( impl ); + CleanupStack::Pop( impl ); + } + } + return returnValue; + } + +// ----------------------------------------------------------------------------- +// ConstructGeneralNodeL +// ----------------------------------------------------------------------------- +// +static CXnNode* ConstructGeneralNodeL( CXnDomNode& aSource ) + { + CXnType* type = CXnType::NewL( aSource.Name() ); + CleanupStack::PushL( type ); + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + CleanupStack::PushL( impl ); + CXnNode* tmpNode = CXnNode::NewL(); + tmpNode->SetImpl( impl ); + CleanupStack::Pop( impl ); + return tmpNode; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnODTParser::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnODTParser* CXnODTParser::NewL( CXnViewManager& aManager, + CXnEcomHandler& aEcomHandler ) + { + CXnODTParser* self = new ( ELeave ) CXnODTParser( aManager, aEcomHandler ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnODTParser::CXnODTParser +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnODTParser::CXnODTParser( CXnViewManager& aManager, + CXnEcomHandler& aEcomHandler ) + : iManager( aManager ), iUiEngine( aManager.UiEngine() ), + iEcomHandler( aEcomHandler ) + { + } + +// ----------------------------------------------------------------------------- +// CXnODTParser::~CXnODTParser +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnODTParser::~CXnODTParser() + { + } + +// ----------------------------------------------------------------------------- +// CXnODTParser::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnODTParser::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnODTParser::LoadRootL +// ----------------------------------------------------------------------------- +// +void CXnODTParser::LoadRootL( CXnRootData& aRootData, TUid /*aAppUid*/ ) + { + CXnDomNode* root( aRootData.Owner() ); + + CXnDomStringPool& sp( root->StringPool() ); + + CXnAppUiAdapter& appui( iManager.AppUiAdapter() ); + + // Build root + CXnNode* node( BuildRootNodeL( iUiEngine ) ); + + // Let root nodes to know each other + CXnDomNode* dom( aRootData.ODT()->DomDocument().RootNode() ); + dom->SetLayoutNode( node ); + node->SetDomNode( dom ); + + CreateNodesL( root, sp, aRootData ); + + // root doesn't have any controls + + aRootData.SetOccupied(); + } + +// ----------------------------------------------------------------------------- +// CXnODTParser::LoadViewL +// ----------------------------------------------------------------------------- +// +void CXnODTParser::LoadViewL( CXnViewData& aViewData ) + { + // <view> element + CXnDomNode* view( aViewData.Node() ); + + CXnDomStringPool& sp( view->StringPool() ); + + // from <view> element + CreateNodesL( view, sp, aViewData ); + CreateControlsL( view, aViewData ); + + // By default make controls invisible + CXnControlAdapter* adapter( view->LayoutNode()->Control() ); + + if( adapter ) + { + adapter->MakeVisible( EFalse ); + } + + aViewData.SetOccupied(); + } + +// ----------------------------------------------------------------------------- +// CXnODTParser::DestroyView +// ----------------------------------------------------------------------------- +// +void CXnODTParser::DestroyView( CXnViewData& aViewData ) + { + CXnNode* view( aViewData.Node()->LayoutNode() ); + + // Destroy view and all its child nodes + CXnNode* parent( view->Parent() ); + + RPointerArray< CXnNode >& children( parent->Children() ); + + TInt index( children.Find( view ) ); + + if ( index != KErrNotFound ) + { + children.Remove( index ); + + delete view; + view = NULL; + + CXnDomNode* owner( aViewData.Owner() ); + owner->DeleteChild( aViewData.Node() ); + } + } + +// ----------------------------------------------------------------------------- +// CXnODTParser::LoadWidgetL +// ----------------------------------------------------------------------------- +// +void CXnODTParser::LoadWidgetL( CXnPluginData& aPluginData ) + { + if ( aPluginData.Empty() ) + { + // Holds "empty" widget + return; + } + + // <widget> element + CXnDomNode* widget( aPluginData.Node() ); + + CXnDomStringPool& sp( widget->StringPool() ); + + // from <widget> element + CreateNodesL( widget, sp, aPluginData ); + CreateControlsL( widget, aPluginData ); + + HandleWidgetBackgroundL( widget->LayoutNode() ); + + // By default make controls invisible + CXnControlAdapter* adapter( widget->LayoutNode()->Control() ); + + if( adapter ) + { + adapter->MakeVisible( EFalse ); + } + + aPluginData.SetOccupied(); + } + +// ----------------------------------------------------------------------------- +// CXnODTParser::DestroyWidget +// ----------------------------------------------------------------------------- +// +void CXnODTParser::DestroyWidgetL( CXnPluginData& aPluginData ) + { + CXnViewData& parent( + static_cast< CXnViewData& >( *aPluginData.Parent() ) ); + + // Check is any of plugin data's controls in views draw chain and remove + CXnControlAdapter* control( parent.Node()->LayoutNode()->Control() ); + + RPointerArray< CXnControlAdapter >& controls( control->ChildAdapters() ); + + RPointerArray< CXnControlAdapter > pluginControls; + CleanupClosePushL( pluginControls ); + + aPluginData.ControlsL( pluginControls ); + + // Remove from view chain if found + for ( TInt i = 0; i < pluginControls.Count(); i++ ) + { + CXnControlAdapter* control( pluginControls[i] ); + + TInt index( controls.Find( control ) ); + + if ( index != KErrNotFound ) + { + controls.Remove( index ); + } + } + + CleanupStack::PopAndDestroy( &pluginControls ); + + CXnNode* widgetNode( aPluginData.Node()->LayoutNode() ); + + CXnNode* owner( widgetNode->Parent() ); + + RPointerArray< CXnNode >& children( owner->Children() ); + + TInt index( children.Find( widgetNode ) ); + + // Destroy widget and all its child nodes + if ( index != KErrNotFound ) + { + children.Remove( index ); + + delete widgetNode; + widgetNode = NULL; + + CXnDomNode* owner( aPluginData.Owner() ); + owner->DeleteChild( aPluginData.Node() ); + } + + owner->Control()->RemoveChildAdapters(); + } + +// ----------------------------------------------------------------------------- +// CXnODTParser::CreateNodesL +// Creates node tree +// ----------------------------------------------------------------------------- +// +void CXnODTParser::CreateNodesL( + CXnDomNode* aSourceNode, + CXnDomStringPool& aSp, + CXnPluginData& aPluginData ) + { + if ( aSourceNode ) + { + ConstructNodeL( *aSourceNode, aSp, aPluginData ); + + CXnDomList& childList( aSourceNode->ChildNodes() ); + + TInt count( childList.Length() ); + + for ( TInt i = 0; i < count; ++i ) + { + CreateNodesL( + static_cast< CXnDomNode* >( childList.Item( i ) ), + aSp, aPluginData ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnODTParser::ConstructNodeL +// Creates layout node and control for it +// ----------------------------------------------------------------------------- +// +void CXnODTParser::ConstructNodeL( + CXnDomNode& aSource, + CXnDomStringPool& aSp, + CXnPluginData& aPluginData ) + { + const TDesC8& name( aSource.Name() ); + + if ( name == KActionsNodeName || + name == KActionNodeName || + name == KEventNodeName || + name == KXMLUIMLNodeName || + name == KAttributeNodeName || + name == KItemNodeName ) + { + return; + } + + if ( name == KTriggerNodeName ) + { + if ( !CreateTriggerInLayoutNodeTree( aSource ) ) + { + return; + } + } + + const TDesC8& parentName( aSource.Parent()->Name() ); + + if ( name == KPropertyNodeName && + ( parentName == KTriggerNodeName || + parentName == KEventNodeName || + parentName == KPropertyNodeName || + parentName == KAttributeNodeName ) ) + { + return; + } + + CXnNode* node( ConstructKnownBuiltinNodeL( aSource ) ); + + if ( !node ) + { + node = ConstructNodeFromPluginL( iEcomHandler, aSource ); + + if ( !node ) + { + node = ConstructGeneralNodeL( aSource ); + + if ( !node ) + { + return; + } + } + } + + if ( name == KMenuBarNodeName || + name == KListQueryDialogNodeName || + name == KMenuNodeName || + name == KMenuItemNodeName || + name == KDynMenuItemNodeName || + name == KWidgetMenuItemNodeName || + name == KPropertyNodeName || + name == KDescNodeName || + name == KTextZoomNodeName || + name == KConfigurationNodeName || + name == KSoftkeyNodeName || + name == KTriggerNodeName || + name == KSettingsConfigurationNodeName || + name == KContentSourceNodeName || + name == KMenuExtensionNodeName || + name == KStylusPopupNodeName || + name == KActionsHandlerNodeName ) + { + node->SetLayoutCapable( EFalse ); + } + + CXnNode* parent( FindAncestorWhoActAsParent( aSource ) ); + + if( !parent ) + { + delete node; + + return; + } + + parent->AddChildL( node ); + + if ( !parent->IsLayoutCapable() ) + { + node->SetLayoutCapable( EFalse ); + } + + aSource.SetLayoutNode( node ); + node->SetDomNode( &aSource ); + + node->SetUiEngine( iUiEngine ); + + CopyPropertiesFromDomNodeToNodeL( *node, aSource, aSp ); + + if ( name == KTriggerNodeName ) + { + if ( iUiEngine.IsEditMode() ) + { + node->SetStateL( XnPropertyNames::style::common::KEdit ); + } + } + + // Mark adaptive layoutable nodes + TInt adaptive( XnAdaptive::ENone ); + + CXnProperty* width( node->WidthL() ); + + if ( width ) + { + const TDesC8& w( width->StringValue() ); + + if ( w == XnPropertyNames::style::common::KAdaptive ) + { + adaptive = XnAdaptive::EWidth; + } + } + + CXnProperty* height( node->HeightL() ); + + if ( height ) + { + const TDesC8& h( height->StringValue() ); + + if ( h == XnPropertyNames::style::common::KAdaptive ) + { + adaptive |= XnAdaptive::EHeight; + } + } + + if ( adaptive != XnAdaptive::ENone ) + { + node->SetAdaptiveL( adaptive ); + } + + // Collect nodes, which nav-index property is 'appearance' to + // an array + CXnProperty* navindex( node->NavIndexL() ); + + if ( navindex && + navindex->StringValue() == XnPropertyNames::style::common::KAppearance ) + { + aPluginData.SetAppearanceNodeL( node ); + } + + // Collect initial focus nodes. + CXnProperty* initialFocusProp( node->InitialFocusL() ); + + if ( initialFocusProp ) + { + aPluginData.SetInitialFocusNodeL( node ); + } + } + +// ----------------------------------------------------------------------------- +// CXnODTParser::CreateControlsL() +// Run control creation 1st phase +// ----------------------------------------------------------------------------- +// +void CXnODTParser::CreateControlsL( CXnDomNode* aNode, + CXnPluginData& aPluginData ) + { + if ( aNode ) + { + ConstructControlL( aNode->LayoutNode(), aPluginData ); + + CXnDomList& childList( aNode->ChildNodes() ); + + TInt count( childList.Length() ); + + for ( TInt i = 0; i < count; ++i ) + { + CreateControlsL( + static_cast< CXnDomNode* >( childList.Item( i ) ), aPluginData ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnODTParser::ConstructControlL() +// Run control creation 1st phase +// ----------------------------------------------------------------------------- +// +void CXnODTParser::ConstructControlL( CXnNode* aNode, + CXnPluginData& aPluginData ) + { + if( !aNode ) + { + return; + } + + CXnComponentNodeImpl* impl( aNode->ComponentNodeImpl() ); + CXnViewNodeImpl* viewImpl( aNode->ViewNodeImpl() ); + + TBool needsCreation( EFalse ); + + if ( ( impl && impl->DoesComponentNeedCreation() ) || viewImpl ) + { + needsCreation = ETrue; + } + + const TDesC8& name( aNode->Type()->Type() ); + + if ( needsCreation ) + { + // Try if builtin control can be created + if ( !CreateBuiltInControlL( *aNode, name ) ) + { + // Not builtin, invoke factory chain + CreateFactoryControlL( *aNode, name ); + } + + // Fill plugin data + aPluginData.SetControlL( aNode ); + } + + if ( name == KContentSourceNodeName ) + { + aPluginData.SetContentSourceNodeL( aNode ); + } + } + +// ----------------------------------------------------------------------------- +// CXnODTParser::CreateExternalControlL() +// Creates external control +// ----------------------------------------------------------------------------- +// +TBool CXnODTParser::CreateExternalControlL( CXnNode& aNode, + const TDesC8& aName ) + { + CXnExtRenderingPluginAdapter* adapter( NULL ); + + // Get implementations via ECom + RImplInfoPtrArray plugins; + CleanupResetAndDestroyPushL( plugins ); + + REComSession::ListImplementationsL( + TUid::Uid( AI3_EXTERNAL_RENDERING_PLUGIN_ECOM_UID ), plugins ); + + for( TInt i = 0; i < plugins.Count(); i++ ) + { + CImplementationInformation* information( plugins[i] ); + + if( information->DataType().Compare( aName ) == 0 ) + { + adapter = CXnExtRenderingPluginAdapter::NewL( + information->ImplementationUid() ); + break; + } + } + CleanupStack::PopAndDestroy(); // plugins + + if( adapter ) + { + CXnComponent* component = CXnComponent::NewL(); + CleanupStack::PushL( component ); + + CXnControlAdapter* parentAdapter( NULL ); + + // Find parent control + CXnNode* parent( aNode.Parent() ); + + for ( ; parent; parent = parent->Parent() ) + { + parentAdapter = parent->Control(); + + if ( parentAdapter ) + { + break; + } + } + + CXnExtRenderingPluginWrapper* wrapper = + CXnExtRenderingPluginWrapper::NewL( aNode.PluginIfL(), *adapter ); + CleanupStack::PushL( wrapper ); + + parentAdapter->AppendChildL( *wrapper, aNode ); + CleanupStack::Pop( wrapper ); + + component->SetControlAdapter( wrapper ); + + aNode.ComponentNodeImpl()->SetComponent( component ); + + component->SetNode( aNode.PluginIfL() ); + + wrapper->SetComponent( component ); + + wrapper->SetComponentsToInheritVisibility( ETrue ); + + wrapper->ActivateL(); + + CleanupStack::Pop( component ); + + return ETrue; + } + else + { + return EFalse; + } + } + +// CXnODTParser::CreateFactoryControlL() +// Creates factory control +// ----------------------------------------------------------------------------- +// +void CXnODTParser::CreateFactoryControlL( CXnNode& aNode, + const TDesC8& aName ) + { + CXnArray* factories = CXnArray::NewL(); + CleanupStack::PushL( factories ); + + TUid interfaceUid = { AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID }; + + iEcomHandler.PluginsL( interfaceUid, aName, *factories ); + + CXnComponent* component( NULL ); + + TInt count( factories->Container().Count() ); + + // Invoke factory chain + for ( TInt i = 0; i < count; i++ ) + { + MXnComponentFactory* factory = + static_cast< MXnComponentFactory* >( + ( factories->Container() )[i] ); + + if ( factory->CreateXnComponentL( aNode.PluginIfL(), component ) == + MXnComponentFactory::EXnFactoryResponseComponentConstructed ) + + { + // All done + break; + } + } + + CleanupStack::PopAndDestroy( factories ); + } + +// ----------------------------------------------------------------------------- +// CXnODTParser::CreateBuiltInControlL() +// Creates builtin control +// ----------------------------------------------------------------------------- +// +TBool CXnODTParser::CreateBuiltInControlL( CXnNode& aNode, + const TDesC8& aName ) + { + if ( aName != KBoxNodeName && aName != KButtonNodeName && + aName != KStylusPopupNodeName && aName != KScrollableBoxNodeName&& + aName != KWidgetExtensionNodeName && + aName != KPopUpNodeName && + aName != XnPropertyNames::listquerydialog::KListQueryDialog ) + { + return CreateExternalControlL( aNode, aName ); + } + + CXnComponent* component = CXnComponent::NewL(); + CleanupStack::PushL( component ); + + CXnControlAdapter* parentAdapter( NULL ); + + CXnProperty* position( aNode.PositionL() ); + + if ( position ) + { + const TDesC8& value( position->StringValue() ); + + if ( value == XnPropertyNames::style::common::position::KFloating ) + { + // Find view node and append floating control to its compound + for ( CXnNode* node = &aNode; node; node = node->Parent() ) + { + if ( node->ViewNodeImpl() ) + { + parentAdapter = node->Control(); + + break; + } + } + } + } + + if ( !parentAdapter ) + { + // Find parent control + CXnNode* parent( aNode.Parent() ); + + for ( ; parent; parent = parent->Parent() ) + { + parentAdapter = parent->Control(); + + if ( parentAdapter ) + { + break; + } + } + } + + CXnControlAdapter* adapter( NULL ); + + if( aName == KStylusPopupNodeName ) + { + adapter = CXnPopupControlAdapter::NewL( aNode.PluginIfL() ); + CleanupStack::PushL( adapter ); + } + else if( aName == KWidgetExtensionNodeName || + aName == KPopUpNodeName ) + { + adapter = CXnWidgetExtensionAdapter::NewL( aNode.PluginIfL() ); + CleanupStack::PushL( adapter ); + CXnProperty* prop = CXnProperty::NewL( + XnPropertyNames::style::common::KPosition, + XnPropertyNames::style::common::position::KFloating, + CXnDomPropertyValue::EString, + aNode.UiEngine()->ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( prop ); + aNode.SetPropertyL( prop ); + CleanupStack::Pop( prop ); + } + else if( aName == KScrollableBoxNodeName ) + { + adapter = CXnScrollableControlAdapter::NewL( aNode.PluginIfL() ); + CleanupStack::PushL( adapter ); + } + else if( aName == XnPropertyNames::listquerydialog::KListQueryDialog ) + { + CleanupStack::PopAndDestroy( component ); + CXnListQueryDialog* listQuery = CXnListQueryDialog::NewL(); + component = static_cast<CXnComponent*>( listQuery ); + CleanupStack::PushL( component ); + adapter = CXnListQueryDialogAdapter::NewL( aNode.PluginIfL() ); + CleanupStack::PushL( adapter ); + } + else + { + adapter = CXnControlAdapter::NewL( aNode.PluginIfL() ); + CleanupStack::PushL( adapter ); + } + + parentAdapter->AppendChildL( *adapter, aNode ); + CleanupStack::Pop( adapter ); + + component->SetControlAdapter( adapter ); + + aNode.ComponentNodeImpl()->SetComponent( component ); + + component->SetNode( aNode.PluginIfL() ); + + adapter->SetComponent( component ); + + adapter->SetComponentsToInheritVisibility( ETrue ); + + adapter->ActivateL(); + + CleanupStack::Pop( component ); + + return ETrue; + } + +// -------------------------------------------------------------------------- +// CXnODTParser::HandleWidgetBackgroundL() +// +// -------------------------------------------------------------------------- +// +void CXnODTParser::HandleWidgetBackgroundL( CXnNode* aWidgetNode ) + { + if( aWidgetNode ) + { + CXnUiEngine* uiengine = aWidgetNode->UiEngine(); + CXnProperty* bgImageProp = aWidgetNode->BackgroundImageL(); + CXnProperty* bgColorProp = aWidgetNode->BackgroundColorL(); + + // Set default bg color if it has not been defined by a widget + if( !bgImageProp && !bgColorProp && uiengine ) + { + CXnDomPropertyValue* value = CXnDomPropertyValue::NewL( + uiengine->ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( value ); + value->SetStringValueL( CXnDomPropertyValue::EString, KWidgetBgSkinId ); + + CXnProperty* bgColor = CXnProperty::NewL( + XnPropertyNames::appearance::common::KBackGroundColor, + value, uiengine->ODT()->DomDocument().StringPool() ); + + CleanupStack::Pop( value ); + CleanupStack::PushL( bgColor ); + aWidgetNode->SetPropertyL( bgColor ); + CleanupStack::Pop( bgColor ); + } + } + } + +// End of file + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnoomsyshandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnoomsyshandler.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,174 @@ +/* +* 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: +* Helper system for handling Out-Of-Memory cases. +* +*/ + +// System includes +#include <hal.h> +#include <e32std.h> +#include <e32cmn.h> +#include <aknnotewrappers.h> +#include <e32svr.h> +#include <StringLoader.h> +#include <xnuiengine.rsg> + +// User includes +#include "xnoomsyshandler.h" +#include "xnpanic.h" + +//Constants +const TInt64 KMinInterval = 5000000; // 5 seconds + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Two-phased constructor. +// --------------------------------------------------------------------------- +// +CXnOomSysHandler* CXnOomSysHandler::NewL() + { + CXnOomSysHandler* self = new ( ELeave ) CXnOomSysHandler(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CXnOomSysHandler::~CXnOomSysHandler() + { + delete iMsg; + iMsg = NULL; + } + +// ----------------------------------------------------------------------------- +// Checks if required amount of memory is available on heap +// ----------------------------------------------------------------------------- +// +TBool CXnOomSysHandler::HeapAvailable( TInt aAmount ) + { + if( aAmount == EMinNotDef ) + { + aAmount = EMem512kB; + } + + // Gather needed data... + + // Space already allocated. + TInt allocated; + User::Heap().AllocSize( allocated ); + + // Max space for heap. Heap can extend only up to this value. + const TInt heapMax = User::Heap().MaxLength(); + + // Available memory in heap's current state. + TInt obsolete = 0; + const TInt availableHeap = User::Heap().Available( obsolete ); + + // Current heap size. + const TInt heapSize = allocated + availableHeap; + + // Heap extension requirement. Can be negative. + const TInt extensionRequirement = aAmount - availableHeap; + + // Max. heap extension possible limited by heap max. + const TInt heapExtensionMax = heapMax - heapSize; + + // System free ram. + TInt ramFree = 0; + HAL::Get( HALData::EMemoryRAMFree, ramFree ); + + // Checking... + + // Fits into current heap allocation. + if( availableHeap >= aAmount ) + { + return ETrue; + } + + // Fits if current heap extends. heap size and therefore + // it's possibilities to extend is limited by max heap + // size and by available system memory. + if( ( heapExtensionMax ) >= extensionRequirement && + ( ramFree >= extensionRequirement ) ) + { + return ETrue; + } + + // Does not fit. + return EFalse; + } + +// ----------------------------------------------------------------------------- +// Handle potential OOM failure. +// ----------------------------------------------------------------------------- +// +void CXnOomSysHandler::HandlePotentialOomL() + { + if( AllowDialog() ) + { + CAknErrorNote* dialog = new (ELeave) CAknErrorNote(); + dialog->ExecuteLD( *iMsg ); + dialog = NULL; + } + } + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor. +// --------------------------------------------------------------------------- +// +void CXnOomSysHandler::ConstructL() + { + iMsg = StringLoader::LoadL( R_QTN_HS_HS_MEMORY_FULL ); + } + +// --------------------------------------------------------------------------- +// C++ constructor. +// --------------------------------------------------------------------------- +// +CXnOomSysHandler::CXnOomSysHandler() + { + iPreviousDialogPopupTime = 0; + } + +//------------------------------------------------------------------------------ +// Check whether OOM dialog can be shown. +// Prevents OOM dialogs popping up more often than +// defined in KMinInterval. +// ----------------------------------------------------------------------------- +// +TBool CXnOomSysHandler::AllowDialog() + { + TTime now; + now.HomeTime(); + + TTimeIntervalMicroSeconds interval + = now.MicroSecondsFrom( iPreviousDialogPopupTime ); + + if( iPreviousDialogPopupTime == 0 || // Not set yet. + interval.Int64() >= KMinInterval ) // Proper interval passed. + { + iPreviousDialogPopupTime = now.Int64(); + return ETrue; + } + else + { + return EFalse; + } + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnpanic.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnpanic.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,34 @@ +/* +* 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: Panic and error codes +* +*/ + +// INCLUDE FILES +#include "xnpanic.h" + +// CONSTANTS +_LIT( KXnPanic, "UIEngine" ); + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// Panic +// Implementation of Xuikon UI Engine panic mechanism +// ----------------------------------------------------------------------------- +// +GLDEF_C void Panic( TXnPanic aPanic ) + { + User::Panic( KXnPanic, aPanic ); + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnplugindata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnplugindata.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,692 @@ +/* +* 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 +* +*/ + +// System includes +#include <utf.h> + +// User includes +#include "xnappuiadapter.h" +#include "xncomposer.h" +#include "xnodtparser.h" +#include "xnresource.h" +#include "xnodt.h" +#include "xnnode.h" +#include "xnplugindata.h" +#include "xnviewdata.h" +#include "xnviewmanager.h" +#include "xnoomsyshandler.h" + +// Constants +_LIT8( KStateWaitConfirmation, "WaitForConfirmation" ); +_LIT8( KStateConfirmed, "Confirmed" ); +_LIT8( KStateError, "Error" ); + +// ============================ LOCAL FUNCTIONS ================================ + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CXnPluginData::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnPluginData* CXnPluginData::NewL( CXnPluginData& aParent ) + { + CXnPluginData* self = CXnPluginData::NewLC( aParent ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::NewLC() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnPluginData* CXnPluginData::NewLC( CXnPluginData& aParent ) + { + CXnPluginData* self = new ( ELeave ) CXnPluginData( aParent ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::CXnPluginData() +// C++ constructor +// ----------------------------------------------------------------------------- +// +CXnPluginData::CXnPluginData( CXnPluginData& aParent ) + : iParent( &aParent ), iManager( iParent->ViewManager() ) + { + // Plugin data is removable by default + iFlags.Set( EIsRemovable ); + // Assume plugins ready + iFlags.Set( EIsDataPluginsReady ); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::CXnPluginData() +// C++ constructor +// ----------------------------------------------------------------------------- +// +CXnPluginData::CXnPluginData( CXnViewManager& aManager ) + : iParent( NULL ), iManager( aManager ) + { + // This constructor overload is used by CXnRootData + // Assume plugins are ready + iFlags.Set( EIsDataPluginsReady ); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::~CXnPluginData() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +CXnPluginData::~CXnPluginData() + { + RevertPluginState(); + + if ( iLoader ) + { + iLoader->Cancel(); + } + + delete iLoader; + + Flush(); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::ConstructL() +// 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CXnPluginData::ConstructL() + { + iLoader = CPeriodic::NewL( CActive::EPriorityUserInput ); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::LoadL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::LoadL() + { + if ( Occupied() || PluginState().CompareF( KStateError ) == 0 ) + { + return; + } + + if ( !CXnOomSysHandler::HeapAvailable( WIDGET_MIN_MEM ) ) + { + ViewManager().OomSysHandler().HandlePotentialOomL(); + return; + } + + iFlags.Clear( EIsEmpty ); + iFlags.Set( EIsRemovable ); + + TRAPD( error, + + if ( iManager.Composer().ComposeWidgetL( *this ) == KErrNone ) + { + iManager.Parser().LoadWidgetL( *this ); + } + ); + + if ( Empty() ) + { + // All done + return; + } + + if ( error || !Occupied() ) + { + if( error == KErrNoMemory ) + { + ViewManager().OomSysHandler().HandlePotentialOomL(); + } + + // Mark this plugin ready, View Manager will remove it + DataPluginsLoadCompletedL( KErrGeneral ); + } + else + { + if ( Active() ) + { + // Load data plugins will set confirmation state to "wait" + LoadDataPluginsL(); + } + else + { + // Composed succesfully to inactive page. Set confirmed + SetPluginStateL( KStateConfirmed ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::Destroy() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::Destroy() + { + if ( Occupied() ) + { + TRAP_IGNORE( + DestroyDataPluginsL(); + iManager.Parser().DestroyWidgetL( *this ); + ); + } + + Flush(); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::LoadDataPluginsL +// Loads data plugins associated to the plugin +// ----------------------------------------------------------------------------- +// +void CXnPluginData::LoadDataPluginsL() + { + if ( !Active() || !Occupied() ) + { + iFlags.Set( EIsDataPluginsReady ); + + return; + } + + if ( iContentSourceNodes.Count() == 0 ) + { + DataPluginsLoadCompletedL( KErrNone ); + } + else + { + iLoader->Cancel(); + + iFlags.Clear( EIsDataPluginsReady ); + + iLoadIndex = 0; + + iLoader->Start( TTimeIntervalMicroSeconds32( 0 ), + TTimeIntervalMicroSeconds32( 0 ), + TCallBack( RunL, this ) ); + } + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::DataPluginsLoadCompletedL +// Indicates that all data plugins are loaded +// ----------------------------------------------------------------------------- +// +void CXnPluginData::DataPluginsLoadCompletedL( TInt aStatus ) + { + iFlags.Set( EIsDataPluginsReady ); + + const TDesC8& state( aStatus == KErrNone + ? KStateConfirmed() : KStateError() ); + + SetPluginStateL( state ); + + iManager.SetDataPluginLoadCompleteL( *this ); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::DataPluginsLoaded +// Queries whether all data plugins are loaded +// ----------------------------------------------------------------------------- +// +TBool CXnPluginData::DataPluginsLoaded() const + { + return ( iFlags.IsSet( EIsDataPluginsReady ) ? ETrue : EFalse ); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::DestroyDataPluginsL +// Remove data plugins associated to the plugin +// ----------------------------------------------------------------------------- +// +void CXnPluginData::DestroyDataPluginsL() + { + if ( Occupied() ) + { + iFlags.Set( EIsDataPluginsReady ); + + if ( iLoader->IsActive() ) + { + // Not all plugins loaded yet + iLoader->Cancel(); + + RevertPluginState(); + } + + // 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 ); + + User::Heap().Compress(); + } + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::SetConfigurationIdL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::SetConfigurationIdL( const TDesC8& aConfigurationId ) + { + delete iConfigurationId; + iConfigurationId = NULL; + + iConfigurationId = aConfigurationId.AllocL(); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::SetPluginIdL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::SetPluginIdL( const TDesC8& aPluginId ) + { + delete iPluginId; + iPluginId = NULL; + + iPluginId = aPluginId.AllocL(); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::SetPluginUidL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::SetPluginUidL( const TDesC8& aPluginUid ) + { + delete iPluginUid; + iPluginUid = NULL; + + iPluginUid = aPluginUid.AllocL(); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::SetPluginNameL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::SetPluginNameL( const TDesC8& aPluginName ) + { + delete iPluginName; + iPluginName = NULL; + + iPluginName = aPluginName.AllocL(); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::SetPublisherName () +// Set the publisher name +// ----------------------------------------------------------------------------- +// +void CXnPluginData::SetPublisherNameL( const TDesC8& aPublisherName ) + { + delete iPublisherName; + iPublisherName = NULL; + + iPublisherName = + CnvUtfConverter::ConvertToUnicodeFromUtf8L( aPublisherName ); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::SetPublisherName() +// Set the publisher name +// ----------------------------------------------------------------------------- +// +void CXnPluginData::SetPublisherNameL( const TDesC& aPublisherName ) + { + delete iPublisherName; + iPublisherName = NULL; + + iPublisherName = aPublisherName.AllocL(); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::SetPluginTypeL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::SetPluginTypeL( const TDesC8& aPluginType ) + { + delete iPluginType; + iPluginType = NULL; + + iPluginType = aPluginType.AllocL(); + } + +// ----------------------------------------------------------------------------- +// 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() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::SetResources( CArrayPtrSeg< CXnResource >* aResources ) + { + if ( iResources ) + { + iResources->ResetAndDestroy(); + + delete iResources; + iResources = NULL; + } + + iResources = aResources; + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::ResourcesL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::ResourcesL( CArrayPtrSeg< CXnResource >& aList ) const + { + for ( TInt i = 0; iResources && i < iResources->Count(); i++ ) + { + aList.AppendL( iResources->At(i) ); + } + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::SetControlL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::SetControlL( CXnNode* aNode ) + { + CXnControlAdapter* control( aNode->Control() ); + + if ( control ) + { + User::LeaveIfError( iControls.InsertInAddressOrder( control ) ); + } + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::ControlsL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::ControlsL( RPointerArray< CXnControlAdapter >& aList ) const + { + for ( TInt i = 0; i < iControls.Count(); i++ ) + { + aList.AppendL( iControls[i] ); + } + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::SetContentSourceNodeL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::SetContentSourceNodeL( CXnNode* aNode ) + { + User::LeaveIfError( iContentSourceNodes.InsertInAddressOrder( aNode ) ); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::ContentSourceNodesL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::ContentSourceNodesL( RPointerArray< CXnNode >& aList ) const + { + for ( TInt i = 0; i < iContentSourceNodes.Count(); i++ ) + { + aList.AppendL( iContentSourceNodes[i] ); + } + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::SetAppearanceNodeL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::SetAppearanceNodeL( CXnNode* aNode ) + { + User::LeaveIfError( iAppearanceNodes.InsertInAddressOrder( aNode ) ); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::AppearanceNodesL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::AppearanceNodesL( RPointerArray< CXnNode >& aList ) const + { + for ( TInt i = 0; i < iAppearanceNodes.Count(); i++ ) + { + aList.AppendL( iAppearanceNodes[i] ); + } + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::SetInitialFocusNodeL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::SetInitialFocusNodeL( CXnNode* aNode ) + { + User::LeaveIfError( iInitialFocusNodes.InsertInAddressOrder( aNode ) ); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::InitialFocusNodesL() +// ----------------------------------------------------------------------------- +// +void CXnPluginData::InitialFocusNodesL( RPointerArray< CXnNode >& aList ) const + { + for ( TInt i = 0; i < iInitialFocusNodes.Count(); i++ ) + { + aList.AppendL( iInitialFocusNodes[i] ); + } + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::Flush() +// Flushes this plugins data +// ----------------------------------------------------------------------------- +// +void CXnPluginData::Flush() + { + // Don't touch to iOwner, because this plugin might be reused later + + iFlags.ClearAll(); + + // This is default + iFlags.Set( EIsRemovable ); + iFlags.Set( EIsDataPluginsReady ); + + iNode = NULL; + + iLoadIndex = 0; + + delete iConfigurationId; + iConfigurationId = NULL; + + delete iPluginId; + iPluginId = NULL; + + delete iPluginUid; + iPluginUid = NULL; + + delete iPluginName; + iPluginName = NULL; + + delete iPluginType; + iPluginType = NULL; + + delete iPluginState; + iPluginState = NULL; + + delete iPublisherName; + iPublisherName = NULL; + + if ( iResources ) + { + iResources->ResetAndDestroy(); + delete iResources; + iResources = NULL; + } + + iControls.Reset(); + iContentSourceNodes.Reset(); + iAppearanceNodes.Reset(); + iInitialFocusNodes.Reset(); + iPopupNodes.Reset(); + iPluginsData.ResetAndDestroy(); + + User::Heap().Compress(); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::Empty() +// +// ----------------------------------------------------------------------------- +// +TBool CXnPluginData::Empty() const + { + return ( iFlags.IsSet( EIsEmpty ) ? ETrue : EFalse ); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::SetEmpty() +// +// ----------------------------------------------------------------------------- +// +void CXnPluginData::SetEmptyL( const TDesC8& aPluginId ) + { + if ( Occupied() ) + { + User::Leave( KErrInUse ); + } + + HBufC8* id( aPluginId.AllocL() ); + + Flush(); + + // Takes ownership + iPluginId = id; + + iFlags.Set( EIsEmpty ); + iFlags.Clear( EIsRemovable ); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::SetIsDisplayingPopup() +// +// ----------------------------------------------------------------------------- +// +void CXnPluginData::SetIsDisplayingPopup ( TBool aVisible, CXnNode* aNode ) + { + + if ( aVisible ) + { + iPopupNodes.InsertInAddressOrder( aNode ); + } + else + { + TInt index( iPopupNodes.Find( aNode ) ); + if ( index != KErrNotFound ) + { + iPopupNodes.Remove( index ); + } + } + } + + +//------------------------------------------------------------------------------ +// CXnPluginData::IsDisplayingPopup() +// +//------------------------------------------------------------------------------ +// +TBool CXnPluginData::IsDisplayingPopup() const + { + return ( iPopupNodes.Count() > 0 ); + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::RunL() +// +// ----------------------------------------------------------------------------- +// +/* static */ TInt CXnPluginData::RunL( TAny* aAny ) + { + CXnPluginData* self = static_cast< CXnPluginData* >( aAny ); + + self->iLoader->Cancel(); + + RPointerArray< CXnNodeAppIf >list; + CleanupClosePushL( list ); + + for ( TInt i = 0; i < self->iContentSourceNodes.Count(); i++ ) + { + 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 ); + } + else + { + self->DataPluginsLoadCompletedL( KErrNone ); + } + + CleanupStack::PopAndDestroy( &list ); + + return KErrNone; + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnpointarray.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnpointarray.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,56 @@ +/* +* 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 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnpopupcontroladapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnpopupcontroladapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,349 @@ +/* +* 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: Popup control adapter +* +*/ + +// System includes +#include <e32base.h> +#include <e32const.h> +#include <coecntrl.h> +#include <AknUtils.h> +#include <aknstyluspopupmenu.h> + +// User includes +#include "xnappuiadapter.h" +#include "xnproperty.h" +#include "xncontroladapter.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" + +// Constants +_LIT8( KMenuItem, "menuitem" ); +_LIT8( KDynMenuItem, "dynmenuitem" ); +_LIT8( KWidgetMenuItem, "widgetmenuitem" ); +_LIT8( KMenuExtension, "menuextension" ); + +_LIT8( KSource, "source" ); +_LIT8( KTarget, "target" ); + +// ============================ LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// FindWidgetMenuItemL +// ----------------------------------------------------------------------------- +// +CXnNode* FindWidgetMenuItemL( const TDesC8& aSource, + CXnNode& aPlugin ) + { + if( aPlugin.Children().Count() == 0 ) + { + return NULL; + } + + // Get <widget> element from the <plugin> element + RPointerArray< CXnNode >& children( aPlugin.Children()[0]->Children() ); + + for ( TInt i = children.Count() - 1; i >= 0; i-- ) + { + if ( children[i]->Type()->Type() == KMenuExtension ) + { + RPointerArray< CXnNode >& items( children[i]->Children() ); + + for ( TInt i = 0; i < items.Count(); i++ ) + { + CXnProperty* prop( items[i]->GetPropertyL( KTarget ) ); + + if ( prop && prop->StringValue() == aSource ) + { + return items[i]; + } + } + + break; + } + } + + return NULL; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnPopupControlAdapter::NewL +// Two-phased constructor. Can leave. +// ----------------------------------------------------------------------------- +// +CXnPopupControlAdapter* CXnPopupControlAdapter::NewL( CXnNodePluginIf& aNode ) + { + CXnPopupControlAdapter* self = + new ( ELeave ) CXnPopupControlAdapter(); + + CleanupStack::PushL( self ); + + self->ConstructL( aNode ); + + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnPopupControlAdapter::~CXnPopupControlAdapter +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnPopupControlAdapter::~CXnPopupControlAdapter() + { + delete iStylusPopupMenu; + + iMenuItems.Reset(); + } + +// ----------------------------------------------------------------------------- +// CXnPopupControlAdapter::CXnPopupControlAdapter +// C++ default constructor. Must not leave. +// ----------------------------------------------------------------------------- +// +CXnPopupControlAdapter::CXnPopupControlAdapter() + { + } + +// ----------------------------------------------------------------------------- +// CXnPopupControlAdapter::ConstructL +// 2nd phase constructor. Can leave. +// ----------------------------------------------------------------------------- +// +void CXnPopupControlAdapter::ConstructL( CXnNodePluginIf& aNode ) + { + CXnControlAdapter::ConstructL( aNode ); + + iNode = &aNode.Node(); + iUiEngine = iNode->UiEngine(); + } + +// ----------------------------------------------------------------------------- +// CXnPopupControlAdapter::ProcessCommandL +// ----------------------------------------------------------------------------- +// +void CXnPopupControlAdapter::ProcessCommandL( TInt aCommandId ) + { + // Resolve selected item + for ( TInt i = 0; aCommandId != KErrCancel && i < iMenuItems.Count(); i++ ) + { + if ( i == aCommandId ) + { + // Do the actual item selection + iMenuItems[i]->SetStateL( + XnPropertyNames::style::common::KActive ); + + break; + } + } + + iMenuItems.Reset(); + iCommandId = 0; + + iMenuShown = EFalse; + } + +// ----------------------------------------------------------------------------- +// CXnPopupControlAdapter::SetEmphasis +// ----------------------------------------------------------------------------- +// +void CXnPopupControlAdapter::SetEmphasis( CCoeControl* /*aMenuControl*/, + TBool /*aEmphasis*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CXnPopupControlAdapter::SetObserver +// ----------------------------------------------------------------------------- +// +void CXnPopupControlAdapter::SetObserver( + XnMenuInterface::MXnMenuObserver& aObserver ) + { + iObserver = &aObserver; + } + +// ----------------------------------------------------------------------------- +// CXnPopupControlAdapter::TryDisplayingStylusPopupL +// ----------------------------------------------------------------------------- +// +void CXnPopupControlAdapter::TryDisplayingStylusPopupL( CXnNode& aPlugin ) + { + HideMenuL(); + + TPointerEvent event( iUiEngine->HitTest().PointerEvent() ); + + delete iStylusPopupMenu; + iStylusPopupMenu = NULL; + + // Popup is positioned relatively to screen + iStylusPopupMenu = CAknStylusPopUpMenu::NewL( this, event.iParentPosition ); + + RPointerArray< CXnNode >& children( iNode->Children() ); + + for ( TInt i = 0; i < children.Count(); i++ ) + { + PopulateMenuL( children[i], aPlugin ); + } + + ShowMenuL( aPlugin, event.iParentPosition ); + } + +// ----------------------------------------------------------------------------- +// CXnPopupControlAdapter::HandleScreenDeviceChangedL +// ----------------------------------------------------------------------------- +// +void CXnPopupControlAdapter::HandleScreenDeviceChangedL() + { + HideMenuL(); + } + +// ----------------------------------------------------------------------------- +// CXnPopupControlAdapter::PopulateMenuL +// ----------------------------------------------------------------------------- +// +void CXnPopupControlAdapter::PopulateMenuL( CXnNode* aItem, CXnNode& aPlugin ) + { + CXnNode* menuitem( NULL ); + CXnProperty* prop( NULL ); + + TBool mappedItem( EFalse ); + + // Map widget menuitem first + if ( aItem->Type()->Type() == KWidgetMenuItem ) + { + // Widget menuitem is shown if a widget defined by the "aPlugin" + // defines a proper source - target menuitem pairing + CXnProperty* source( aItem->GetPropertyL( KSource ) ); + + if ( source ) + { + CXnNode* widgetItem( + FindWidgetMenuItemL( source->StringValue(), aPlugin ) ); + + if ( widgetItem ) + { + mappedItem = ETrue; + + // 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; + } + } + } + + const TDesC8& type( aItem->Type()->Type() ); + + if ( type == KMenuItem ) + { + // By default plain menuitems are always shown + menuitem = aItem; + } + else if ( type == KDynMenuItem && iObserver ) + { + // Let observer decide whether dynmenuitem is visible or not + if ( iObserver->DynInitMenuItemL( aItem->AppIfL(), &aPlugin.AppIfL() ) ) + { + menuitem = aItem; + } + } + + if ( menuitem ) + { + CXnProperty* display = menuitem->DisplayL(); + if ( display && display->StringValue() == XnPropertyNames::style::common::display::KNone ) + { + return; + } + + if ( !mappedItem ) + { + prop = menuitem->LabelL(); + } + + if ( prop ) + { + HBufC* label( prop->StringValueL() ); + CleanupStack::PushL( label ); + + iStylusPopupMenu->AddMenuItemL( *label, iCommandId++ ); + iMenuItems.AppendL( menuitem ); + + CleanupStack::PopAndDestroy( label ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnPopupControlAdapter::ShowMenuL +// ----------------------------------------------------------------------------- +// +void CXnPopupControlAdapter::ShowMenuL( CXnNode& aPlugin, TPoint aPosition ) + { + if ( iMenuItems.Count() > 0 && !iMenuShown ) + { + iUiEngine->AppUiAdapter().HideFocus(); + + iUiEngine->Editor()->SetTargetPlugin( &aPlugin ); + + if ( AknLayoutUtils::LayoutMirrored() ) + { + iStylusPopupMenu->SetPosition( aPosition, + CAknStylusPopUpMenu::EPositionTypeRightBottom ); + } + else + { + iStylusPopupMenu->SetPosition( aPosition, + CAknStylusPopUpMenu::EPositionTypeLeftBottom ); + } + + iStylusPopupMenu->ShowMenu(); + iMenuShown = ETrue; + } + } + +// ----------------------------------------------------------------------------- +// CXnPopupControlAdapter::HideMenuL +// ----------------------------------------------------------------------------- +// +void CXnPopupControlAdapter::HideMenuL() + { + if ( iMenuShown ) + { + ProcessCommandL( KErrCancel ); + + delete iStylusPopupMenu; + iStylusPopupMenu = NULL; + + iMenuShown = EFalse; + } + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnproperty.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnproperty.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,373 @@ +/* +* 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: Xuikon property source +* +*/ + +// INCLUDE FILES +#include "xnproperty.h" +#include "xndomproperty.h" +#include "xndompropertyvalue.h" +#include "xndomlist.h" +#include "xndomstringpool.h" +#include <utf.h> +#include <gdi.h> + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnProperty::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnProperty* CXnProperty::NewL( CXnDomProperty* aProperty ) + { + CXnProperty* self = new ( ELeave ) CXnProperty; + + CleanupStack::PushL( self ); + + self->ConstructL( aProperty ); + + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnProperty::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnProperty* CXnProperty::NewL( const TDesC8& aName, + CXnDomPropertyValue* aPropertyValue, CXnDomStringPool& aStringPool ) + { + CXnProperty* self = new ( ELeave ) CXnProperty; + + CleanupStack::PushL( self ); + + self->ConstructL( aName, aPropertyValue, aStringPool ); + + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnProperty::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnProperty* CXnProperty::NewL( const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + CXnDomPropertyValue::TPrimitiveValueType aValueType, + CXnDomStringPool& aStringPool ) + { + CXnProperty* self = new ( ELeave ) CXnProperty; + CleanupStack::PushL( self ); + + self->ConstructL( aPropertyName, aPropertyValue, aValueType, aStringPool ); + + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnProperty::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnProperty* CXnProperty::NewL( const TDesC8& aPropertyName, + TReal aPropertyValue, + CXnDomPropertyValue::TPrimitiveValueType aValueType, + CXnDomStringPool& aStringPool ) + { + CXnProperty* self = new ( ELeave ) CXnProperty; + CleanupStack::PushL( self ); + + self->ConstructL( aPropertyName, aPropertyValue, aValueType, aStringPool ); + + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnProperty::NewSharedL +// ----------------------------------------------------------------------------- +// +CXnProperty* CXnProperty::NewSharedL( CXnDomProperty* aProperty ) + { + CXnProperty* self = new ( ELeave ) CXnProperty; + + CleanupStack::PushL( self ); + + self->ConstructSharedL( aProperty ); + + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnProperty::~CXnProperty +// Destructor +// ----------------------------------------------------------------------------- +// +CXnProperty::~CXnProperty() + { + if ( iIsDomPropertyOwned ) + { + delete iProperty; + } + } + +// ----------------------------------------------------------------------------- +// CXnProperty::CXnProperty +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnProperty::CXnProperty() + { + } + +// ----------------------------------------------------------------------------- +// CXnProperty::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnProperty::ConstructL( CXnDomProperty* aProperty ) + { + iProperty = aProperty; + iIsDomPropertyOwned = ETrue; + } + +// ----------------------------------------------------------------------------- +// CXnProperty::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnProperty::ConstructL( const TDesC8& aName, + CXnDomPropertyValue* aPropertyValue, CXnDomStringPool& aStringPool ) + { + iProperty = CXnDomProperty::NewL( aName, aStringPool ); + iIsDomPropertyOwned = ETrue; + + CXnDomList& propertyValueList = iProperty->PropertyValueList(); + propertyValueList.AddItemL( aPropertyValue ); + } + +// ----------------------------------------------------------------------------- +// CXnProperty::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnProperty::ConstructL( const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + CXnDomPropertyValue::TPrimitiveValueType aValueType, + CXnDomStringPool& aStringPool ) + { + iProperty = CXnDomProperty::NewL( aPropertyName, aStringPool ); + iIsDomPropertyOwned = ETrue; + + CXnDomPropertyValue* newValue = CXnDomPropertyValue::NewL( aStringPool ); + CleanupStack::PushL( newValue ); + + newValue->SetStringValueL( aValueType, aPropertyValue ); + + CXnDomList& propertyValueList( iProperty->PropertyValueList() ); + + propertyValueList.AddItemL( newValue ); + + CleanupStack::Pop( newValue ); + } + +// ----------------------------------------------------------------------------- +// CXnProperty::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnProperty::ConstructL( const TDesC8& aPropertyName, + TReal aPropertyValue, + CXnDomPropertyValue::TPrimitiveValueType aValueType, + CXnDomStringPool& aStringPool ) + { + iProperty = CXnDomProperty::NewL( aPropertyName, aStringPool ); + iIsDomPropertyOwned = ETrue; + + CXnDomPropertyValue* newValue = CXnDomPropertyValue::NewL( aStringPool ); + CleanupStack::PushL( newValue ); + + newValue->SetFloatValueL( aValueType, aPropertyValue ); + + CXnDomList& propertyValueList( iProperty->PropertyValueList() ); + + propertyValueList.AddItemL( newValue ); + + CleanupStack::Pop( newValue ); + } + +// ----------------------------------------------------------------------------- +// CXnProperty::ConstructSharedL +// ----------------------------------------------------------------------------- +// +void CXnProperty::ConstructSharedL( CXnDomProperty* aProperty ) + { + iProperty = aProperty; + iIsDomPropertyOwned = EFalse; + } + +// ----------------------------------------------------------------------------- +// CXnProperty::EqualsL +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CXnProperty::EqualsL( CXnProperty& aProperty ) const + { + TBool equals( EFalse ); + + if ( aProperty.Property()->PseudoClass() != iProperty->PseudoClass() ) + { + return equals; + } + + if ( aProperty.Property()->Name() != iProperty->Name() ) + { + return equals; + } + + CXnDomPropertyValue* value1 = static_cast< CXnDomPropertyValue* >( + iProperty->PropertyValueList().Item( 0 ) ); + CXnDomPropertyValue::TPrimitiveValueType primitiveValueType1 = + value1->PrimitiveValueType(); + + CXnDomPropertyValue* value2 = static_cast< CXnDomPropertyValue* >( + aProperty.Property()->PropertyValueList().Item( 0 ) ); + CXnDomPropertyValue::TPrimitiveValueType primitiveValueType2 = + value2->PrimitiveValueType(); + + switch ( primitiveValueType1 ) + { + case CXnDomPropertyValue::ENumber: + case CXnDomPropertyValue::EPercentage: + case CXnDomPropertyValue::EEms: + case CXnDomPropertyValue::EExs: + case CXnDomPropertyValue::EPx: + case CXnDomPropertyValue::ECm: + case CXnDomPropertyValue::EMm: + case CXnDomPropertyValue::EIn: + case CXnDomPropertyValue::EPt: + case CXnDomPropertyValue::EPc: + case CXnDomPropertyValue::EDeg: + case CXnDomPropertyValue::ERad: + case CXnDomPropertyValue::EGrad: + case CXnDomPropertyValue::EMs: + case CXnDomPropertyValue::ES: + case CXnDomPropertyValue::EHz: + case CXnDomPropertyValue::EKHz: + case CXnDomPropertyValue::EUnitValue: + if ( primitiveValueType1 == primitiveValueType2 ) + { + equals = ( value1->FloatValueL() == value2->FloatValueL() ); + } + break; + case CXnDomPropertyValue::EString: + case CXnDomPropertyValue::EIdent: + case CXnDomPropertyValue::EUri: + case CXnDomPropertyValue::EAttr: + case CXnDomPropertyValue::EUnknown: + if ( primitiveValueType2 == CXnDomPropertyValue::EString || + primitiveValueType2 == CXnDomPropertyValue::EIdent || + primitiveValueType2 == CXnDomPropertyValue::EUri || + primitiveValueType2 == CXnDomPropertyValue::EAttr || + primitiveValueType2 == CXnDomPropertyValue::EUnknown ) + { + equals = ( value1->StringValueL() == value2->StringValueL() ); + } + break; + case CXnDomPropertyValue::ERgbColor: + case CXnDomPropertyValue::ERgbaColor: + if ( primitiveValueType1 == primitiveValueType2 ) + { + TRgb rgb1( value1->RgbColorValueL() ); + TRgb rgb2( value2->RgbColorValueL() ); + + equals = ( rgb1 == rgb2 ); + } + break; + default: + break; + } + + return equals; + } + +// ----------------------------------------------------------------------------- +// CXnProperty::Property +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomProperty* CXnProperty::Property() + { + return iProperty; + } + +// ----------------------------------------------------------------------------- +// CXnProperty::StringValueL +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC* CXnProperty::StringValueL() + { + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( + iProperty->PropertyValueList().Item( 0 ) ); + const TDesC8& name = StringValue(); + HBufC* utfName = HBufC::NewL( name.Length() ); + TPtr16 ptr = utfName->Des(); + CnvUtfConverter::ConvertToUnicodeFromUtf8( ptr, name ); + return utfName; + } + +// ----------------------------------------------------------------------------- +// CXnProperty::StringValue +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CXnProperty::StringValue() + { + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( + iProperty->PropertyValueList().Item( 0 ) ); + return value->StringValue(); + } + +// ----------------------------------------------------------------------------- +// CXnProperty::FloatValueL +// ----------------------------------------------------------------------------- +// +EXPORT_C TReal CXnProperty::FloatValueL() + { + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( + iProperty->PropertyValueList().Item( 0 ) ); + return value->FloatValueL(); + } + +// ----------------------------------------------------------------------------- +// CXnProperty::CloneL +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnProperty* CXnProperty::CloneL() + { + CXnDomProperty* property = iProperty->CloneL(); + CleanupStack::PushL( property ); + CXnProperty* returnValue = CXnProperty::NewL( property ); + CleanupStack::Pop( property ); + return returnValue; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnpropertycomparator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnpropertycomparator.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,59 @@ +/* +* 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: Compares two objects. +* +*/ + +// INCLUDES +#include "xnpropertycomparator.h" +#include "xnproperty.h" +#include "xnpropertylist.h" +#include "xndomproperty.h" + +// ----------------------------------------------------------------------------- +// TXnPropertyComparator::TXnPropertyComparator() +// ----------------------------------------------------------------------------- +// +TXnPropertyComparator::TXnPropertyComparator() + { + } + +// ----------------------------------------------------------------------------- +// TXnPropertyComparator::~TXnPropertyComparator() +// ----------------------------------------------------------------------------- +// +TXnPropertyComparator::~TXnPropertyComparator() + { + } + +// ----------------------------------------------------------------------------- +// TXnPropertyComparator::Equals() +// ----------------------------------------------------------------------------- +// +TBool TXnPropertyComparator::Equals( CBase& aItem1, CBase& aItem2 ) + { + CXnPropertyKey& item1 = static_cast< CXnPropertyKey& >( aItem1 ); + CXnProperty& item2 = static_cast< CXnProperty& >( aItem2 ); + // return ETrue if keys match and pseudoclasses are not set + // or if keys match and both pseudoclasses are set and match + CXnDomProperty* property2 = item2.Property(); + if ( item1.iPseudoClass == property2->PseudoClass() && + *( item1.iString ) == property2->Name() ) + { + // names match, pseudoclasses match or are both not set + return ETrue; + } + // all other cases return false. + return EFalse; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnpropertylist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnpropertylist.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,397 @@ +/* +* 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: Xuikon property list +* +*/ + +// INCLUDES +#include "xnpropertylist.h" +#include "xnproperty.h" +#include "xnproperty.h" +#include "xnpropertycomparator.h" +#include "xncomparator.h" +#include "xnmap.h" +#include "xndomproperty.h" +#include "xndompropertyvalue.h" +#include "xnpanic.h" + +// LOCAL CONSTANTS AND MACROS +_LIT8( KPseudoClassFocus, "focus" ); +_LIT8( KPseudoClassPassiveFocus, "passivefocus" ); +_LIT8( KPseudoClassHold, "hold" ); +_LIT8( KPseudoClassHover, "hover" ); +_LIT8( KPseudoClassLink, "link" ); +_LIT8( KPseudoClassVisited, "visited" ); +_LIT8( KPseudoClassActive, "active" ); +_LIT8( KPseudoClassEdit, "edit" ); +_LIT8( KPseudoClassPressedDown, "presseddown" ); + +// LOCAL FUNCTION PROTOTYPES +static const TDesC8& PseudoClassName( + CXnDomProperty::TPseudoClass aPseudoClass ); +static CXnDomProperty::TPseudoClass PseudoClassFromName( + const TDesC8& aName ); +static TInt FindPseudoClass( + const RArray< CXnDomProperty::TPseudoClass >& aArray, + const TDesC8& aPseudoClass ); + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// PseudoClassName +// ----------------------------------------------------------------------------- +// +static const TDesC8& PseudoClassName( CXnDomProperty::TPseudoClass aPseudoClass ) + { + switch ( aPseudoClass ) + { + case CXnDomProperty::EFocus: + return KPseudoClassFocus; + case CXnDomProperty::EPassiveFocus: + return KPseudoClassPassiveFocus; + case CXnDomProperty::EHold: + return KPseudoClassHold; + case CXnDomProperty::EHover: + return KPseudoClassHover; + case CXnDomProperty::ELink: + return KPseudoClassLink; + case CXnDomProperty::EVisited: + return KPseudoClassVisited; + case CXnDomProperty::EActive: + return KPseudoClassActive; + case CXnDomProperty::EEdit: + return KPseudoClassEdit; + case CXnDomProperty::EPressedDown: + return KPseudoClassPressedDown; + default: + return KNullDesC8; + } + } + +// ----------------------------------------------------------------------------- +// PseudoClassFromName +// ----------------------------------------------------------------------------- +// +static CXnDomProperty::TPseudoClass PseudoClassFromName( const TDesC8& aName ) + { + if ( aName == KPseudoClassFocus ) + { + return CXnDomProperty::EFocus; + } + else if ( aName == KPseudoClassPassiveFocus ) + { + return CXnDomProperty::EPassiveFocus; + } + else if ( aName == KPseudoClassHold ) + { + return CXnDomProperty::EHold; + } + else if ( aName == KPseudoClassHover ) + { + return CXnDomProperty::EHover; + } + else if ( aName == KPseudoClassLink ) + { + return CXnDomProperty::ELink; + } + else if ( aName == KPseudoClassVisited ) + { + return CXnDomProperty::EVisited; + } + else if ( aName == KPseudoClassActive ) + { + return CXnDomProperty::EActive; + } + else if ( aName == KPseudoClassEdit ) + { + return CXnDomProperty::EEdit; + } + else if ( aName == KPseudoClassPressedDown ) + { + return CXnDomProperty::EPressedDown; + } + return CXnDomProperty::ENone; + } + +// ----------------------------------------------------------------------------- +// FindPseudoClass +// ----------------------------------------------------------------------------- +// +static TInt FindPseudoClass( + const RArray< CXnDomProperty::TPseudoClass >& aArray, + const TDesC8& aPseudoClass ) + { + for ( TInt i = aArray.Count() - 1; i >= 0; --i ) + { + CXnDomProperty::TPseudoClass item = aArray[i]; + if ( PseudoClassName( item ) == aPseudoClass ) + { + return i; + } + } + return KErrNotFound; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnPropertyList::NewL() +// ----------------------------------------------------------------------------- +// +CXnPropertyList* CXnPropertyList::NewL() + { + CXnPropertyList* self = new ( ELeave ) CXnPropertyList; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop();//self + return self; + } + +// ----------------------------------------------------------------------------- +// CXnPropertyList::~CXnPropertyList() +// ----------------------------------------------------------------------------- +// +CXnPropertyList::~CXnPropertyList() + { + delete iMap; + + iCurrentPseudoClasses.Reset(); + } + +// ----------------------------------------------------------------------------- +// CXnPropertyList::CXnPropertyList() +// ----------------------------------------------------------------------------- +// +CXnPropertyList::CXnPropertyList() + { + } + +// ----------------------------------------------------------------------------- +// CXnPropertyList::ConstructL() +// ----------------------------------------------------------------------------- +// +void CXnPropertyList::ConstructL() + { + iMap = CXnMap::NewL( new ( ELeave ) TXnPropertyComparator ); + } + +// ----------------------------------------------------------------------------- +// CXnPropertyList::SetPropertyL +// Set a property. +// ----------------------------------------------------------------------------- +// +void CXnPropertyList::SetPropertyL( CXnProperty* aProperty ) + { + CXnPropertyKey key; + key.iString = &( aProperty->Property()->Name() ); + key.iPseudoClass = aProperty->Property()->PseudoClass(); + + CXnProperty* tmp = static_cast< CXnProperty* >( iMap->Get( key ) ); + if ( tmp == aProperty ) + { + return; + } + TBool replaced = EFalse; + for ( TInt i = ( iMap->Container() ).Count() - 1; i >= 0; --i ) + { + tmp = static_cast< CXnProperty* >( ( iMap->Container() )[i] ); + if ( aProperty->Property()->PseudoClass() == CXnDomProperty::ENone ) + { + const TDesC8& tmpName = tmp->Property()->Name(); + const TDesC8& propertyName = aProperty->Property()->Name(); + if ( tmpName == propertyName ) + { + if ( tmp->Property()->PseudoClass() != CXnDomProperty::ENone ) + { + TBool pseudoMatch = EFalse; + for ( TInt j = iCurrentPseudoClasses.Count() - 1; j >= 0; --j ) + { + CXnDomProperty::TPseudoClass pseudoClass = + iCurrentPseudoClasses[j]; + if ( tmp->Property()->PseudoClass() == pseudoClass ) + { + pseudoMatch = ETrue; + break; + } + } + if ( !pseudoMatch ) + { + continue; + } + CXnProperty* newProperty = aProperty->CloneL(); + CleanupStack::PushL( newProperty ); + newProperty->Property()->SetPseudoClass( + tmp->Property()->PseudoClass() ); + // add new object + if ( ( iMap->Container()).Append( newProperty ) != KErrNone ) + { + User::Leave( KXnErrAddingProperyToListFailed ); + } + CleanupStack::Pop( newProperty ); + } + if ( ( iMap->Container() ).Append( aProperty )!= KErrNone ) + { + User::Leave( KXnErrAddingProperyToListFailed_2 ); + } + replaced = ETrue; + // remove old object + delete tmp; + ( iMap->Container() ).Remove( i ); + } + } + else + { + const TDesC8& tmpName = tmp->Property()->Name(); + const TDesC8& propertyName = aProperty->Property()->Name(); + if ( tmp->Property()->PseudoClass() != CXnDomProperty::ENone && + tmp->Property()->PseudoClass() == aProperty->Property()->PseudoClass() && + tmpName == propertyName ) + { + if ( ( iMap->Container() ).Append( aProperty )!= KErrNone ) + { + User::Leave( KXnErrAddingProperyToListFailed_3 ); + } + replaced = ETrue; + // remove old object + delete tmp; + ( iMap->Container() ).Remove( i ); + } + } + } + if ( replaced ) + { + return; + } + if ( aProperty->Property()->PseudoClass() != CXnDomProperty::ENone ) + { + for ( TInt i = iCurrentPseudoClasses.Count() - 1; i >= 0; --i ) + { + CXnDomProperty::TPseudoClass pseudoClass = iCurrentPseudoClasses[i]; + CXnProperty* newProperty = aProperty->CloneL(); + CleanupStack::PushL( newProperty ); + newProperty->Property()->SetPseudoClass( pseudoClass ); + // add new object + User::LeaveIfError( ( iMap->Container() ).Append( newProperty ) ); + if ( ( iMap->Container() ).Append( newProperty )!= KErrNone ) + { + User::Leave( KXnErrAddingProperyToListFailed_4 ); + } + CleanupStack::Pop( newProperty ); + } + } + if ( ( iMap->Container() ).Append( aProperty )!= KErrNone ) + { + User::Leave( KXnErrAddingProperyToListFailed_5 ); + } + } + +// ----------------------------------------------------------------------------- +// CXnPropertyList::GetProperty +// Gets a property. +// ----------------------------------------------------------------------------- +// +CXnProperty* CXnPropertyList::GetProperty( const TDesC8& aKey ) const + { + CXnPropertyKey key; + key.iString = &aKey; + for ( TInt i = iCurrentPseudoClasses.Count() - 1; i >= 0; --i ) + { + key.iPseudoClass = iCurrentPseudoClasses[i]; + CXnProperty* property = static_cast< CXnProperty* >( iMap->Get( key ) ); + if ( property ) + { + return property; + } + } + + key.iPseudoClass = CXnDomProperty::ENone; + CXnProperty* property = static_cast< CXnProperty* >( iMap->Get( key ) ); + if ( property ) + { + return property; + } + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnPropertyList::SetPseudoClassL +// Set a pseudoclass +// ----------------------------------------------------------------------------- +// +TBool CXnPropertyList::SetStateL( const TDesC8& aState ) + { + if ( FindPseudoClass( iCurrentPseudoClasses, aState ) < 0 ) + { + User::LeaveIfError( iCurrentPseudoClasses.Append( + PseudoClassFromName( aState ) ) ); + return ETrue; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CXnPropertyList::IsStateSet +// Check whether a state is set or not +// ----------------------------------------------------------------------------- +// +TBool CXnPropertyList::IsStateSet( const TDesC8& aState ) + { + if ( FindPseudoClass( iCurrentPseudoClasses, aState ) < 0 ) + { + return EFalse; + } + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CXnPropertyList::UnsetPseudoClass +// Unset a pseudoclass +// ----------------------------------------------------------------------------- +// +TBool CXnPropertyList::UnsetState( const TDesC8& aState ) + { + TInt index = FindPseudoClass( iCurrentPseudoClasses, aState ); + if ( index < 0 ) + { + return EFalse; + } + iCurrentPseudoClasses.Remove( index ); + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CXnPropertyList::CloneL +// Clone the list +// ----------------------------------------------------------------------------- +// +CXnPropertyList* CXnPropertyList::CloneL() + { + CXnPropertyList* clone = CXnPropertyList::NewL(); + CleanupStack::PushL( clone ); + TInt count = iCurrentPseudoClasses.Count(); + for ( TInt i = 0; i < count; ++i ) + { + User::LeaveIfError( clone->iCurrentPseudoClasses.Append( + iCurrentPseudoClasses[i] ) ); + } + clone->iMap = CXnMap::NewL( new ( ELeave ) TXnPropertyComparator ); + count = iMap->Container().Count(); + for ( TInt i = 0; i < count; ++i ) + { + User::LeaveIfError( clone->iMap->Container().Append( + static_cast< CXnProperty* >( iMap->Container()[i] )->CloneL() ) ); + } + CleanupStack::Pop( clone ); + return clone; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnpropertysubscriber.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnpropertysubscriber.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Subscribes properties from P&S +* +*/ + +#include "xnpropertysubscriber.h" + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +CXnPropertySubscriber::CXnPropertySubscriber( + MXnPropertyChangeObserver& aObserver, + const TUint32 aKey ) + : CActive( EPriorityStandard ), + iPropertyChangeObserver( aObserver ), + iKey( aKey ) + { + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +CXnPropertySubscriber* CXnPropertySubscriber::NewLC( + const TUid aUid, + const TUint32 aKey, + MXnPropertyChangeObserver& aObserver ) + { + CXnPropertySubscriber* self = + new ( ELeave ) CXnPropertySubscriber( aObserver, aKey ); + CleanupStack::PushL( self ); + self->ConstructL( aUid, aKey ); + return self; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +CXnPropertySubscriber* CXnPropertySubscriber::NewL( + const TUid aUid, + const TUint32 aKey, + MXnPropertyChangeObserver& aObserver ) + { + CXnPropertySubscriber* self = CXnPropertySubscriber::NewLC( + aUid, aKey, aObserver ); + CleanupStack::Pop(); // self; + return self; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CXnPropertySubscriber::ConstructL( + const TUid aUid, + const TUint32 aKey ) + { + User::LeaveIfError( iProperty.Attach( aUid, aKey ) ); + CActiveScheduler::Add( this ); // Add to scheduler + // initial subscription and process current property value + RunL(); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +CXnPropertySubscriber::~CXnPropertySubscriber() + { + Cancel(); // Cancel any request, if outstanding + iProperty.Close(); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CXnPropertySubscriber::DoCancel() + { + iProperty.Close(); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CXnPropertySubscriber::RunL() + { + // resubscribe before processing new value to prevent missing updates + iProperty.Subscribe( iStatus ); + SetActive(); + + TInt intValue; + if ( iProperty.Get( intValue ) != KErrNotFound ) + { + iPropertyChangeObserver.PropertyChangedL( iKey, intValue ); + } + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnrootdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnrootdata.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,645 @@ +/* +* 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 application root configuration info +* +*/ + +// User includes +#include "xnviewmanager.h" +#include "xnviewdata.h" + +#include "xnappuiadapter.h" +#include "xncontroladapter.h" +#include "xnuiengine.h" +#include "xnecomhandler.h" +#include "xncomposer.h" +#include "xnodtparser.h" + +#include "xndomdocument.h" +#include "xndomnode.h" +#include "xnodt.h" + +#include "xnnode.h" +#include "xntype.h" + +#include "xnpanic.h" + +#include "xnplugindata.h" +#include "xnrootdata.h" + +// Constants +const TInt KScheduleInterval( 1000000 ); + +// ============================ LOCAL FUNCTIONS ================================ + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CXnRootData::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnRootData* CXnRootData::NewL( CXnViewManager& aManager, + TUid aApplicationUid ) + { + CXnRootData* self = CXnRootData::NewLC( aManager, aApplicationUid ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnRootData::NewLC() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnRootData* CXnRootData::NewLC( CXnViewManager& aManager, + TUid aApplicationUid ) + { + CXnRootData* self = new ( ELeave ) CXnRootData( aManager, aApplicationUid ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnRootData::CXnRootData() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnRootData::CXnRootData( CXnViewManager& aManager, TUid aApplicationUid ) + : CXnPluginData( aManager ), iApplicationUid( aApplicationUid ) + { + iFlags.Clear( EIsRemovable ); + } + +// ----------------------------------------------------------------------------- +// CXnRootData::~CXnRootData() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +CXnRootData::~CXnRootData() + { + if ( iLoadTimer ) + { + iLoadTimer->Cancel(); + } + + delete iLoadTimer; + + if ( iDestroyTimer ) + { + iDestroyTimer->Cancel(); + } + + delete iDestroyTimer; + + iViewsToDestroy.ResetAndDestroy(); + + iPluginsData.ResetAndDestroy(); + + delete iODT->DomDocument().RootNode()->LayoutNode(); + + delete iODT; + + delete iParser; + delete iEcomHandler; + + User::Heap().Compress(); + } + +// ----------------------------------------------------------------------------- +// CXnRootData::ConstructL() +// 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CXnRootData::ConstructL() + { + CXnPluginData::ConstructL(); + + iEcomHandler = CXnEcomHandler::NewL(); + + iParser = CXnODTParser::NewL( iManager, *iEcomHandler ); + + iLoadTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + iDestroyTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + } + +// ----------------------------------------------------------------------------- +// CXnRootData::LoadL() +// +// ----------------------------------------------------------------------------- +// +void CXnRootData::LoadL() + { + 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 ); + } + + RPointerArray< CXnViewData > failedPlugins; + CleanupClosePushL( failedPlugins ); + + TBool succeed( EFalse ); + + for ( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + CXnViewData* plugin( + static_cast< CXnViewData* >( iPluginsData[ i ] ) ); + + if ( plugin->Initial() ) + { + plugin->LoadL(); + + 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 ) + { + // 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; + } + + CleanupStack::PopAndDestroy( &failedPlugins ); + } + +// ----------------------------------------------------------------------------- +// CXnRootData::Destroy() +// +// ----------------------------------------------------------------------------- +// +void CXnRootData::Destroy() + { + iLoadTimer->Cancel(); + iDestroyTimer->Cancel(); + + iFlags.Set( EIsDispose ); + + iDestroyTimer->Start( TTimeIntervalMicroSeconds32( 0 ), + TTimeIntervalMicroSeconds32( 0 ), + TCallBack( RunDestroyL, this ) ); + } + +// ----------------------------------------------------------------------------- +// CXnRootData::LoadRemainingViews() +// +// ----------------------------------------------------------------------------- +// +void CXnRootData::LoadRemainingViews() + { + if ( iFlags.IsClear( EIsDispose ) && !AllViewsLoaded() ) + { + iLoadForward = ETrue; + + iLoadTimer->Cancel(); + + iLoadTimer->Start( TTimeIntervalMicroSeconds32( KScheduleInterval ), + TTimeIntervalMicroSeconds32( KScheduleInterval ), + TCallBack( RunLoadL, this ) ); + } + } + +// ----------------------------------------------------------------------------- +// CXnRootData::CancelLoadRemainingViews() +// +// ----------------------------------------------------------------------------- +// +void CXnRootData::CancelLoadRemainingViews() + { + if ( iFlags.IsClear( EIsDispose ) && !AllViewsLoaded() ) + { + iLoadTimer->Cancel(); + } + } + +// ----------------------------------------------------------------------------- +// CXnRootData::ODT() +// +// ----------------------------------------------------------------------------- +// +CXnODT* CXnRootData::ODT() const + { + return iODT; + } + +// ----------------------------------------------------------------------------- +// CXnRootData::RootNode() +// +// ----------------------------------------------------------------------------- +// +CXnNode* CXnRootData::RootNode() const + { + return iODT->DomDocument().RootNode()->LayoutNode(); + } + +// ----------------------------------------------------------------------------- +// CXnRootData::Parser() +// +// ----------------------------------------------------------------------------- +// +CXnODTParser& CXnRootData::Parser() const + { + return *iParser; + } + +// ----------------------------------------------------------------------------- +// CXnRootData::EcomHandler() +// +// ----------------------------------------------------------------------------- +// +CXnEcomHandler& CXnRootData::EcomHandler() const + { + return *iEcomHandler; + } + +// ----------------------------------------------------------------------------- +// CXnRootData::ActiveViewData() +// Finds the active view data +// ----------------------------------------------------------------------------- +// +CXnViewData& CXnRootData::ActiveViewData() const + { + for ( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + CXnViewData& plugin( static_cast< CXnViewData& >( *iPluginsData[i] ) ); + + if ( plugin.Active() ) + { + return plugin; + } + } + + // If active is not set, then try initial + for ( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + CXnViewData& plugin( static_cast< CXnViewData& >( *iPluginsData[i] ) ); + + if ( plugin.Initial() ) + { + return plugin; + } + } + + Panic( EXnInvalidConfiguration ); + + // Remove compiler warning + return static_cast< CXnViewData& > ( *iPluginsData[0] ); + } + +// ----------------------------------------------------------------------------- +// CXnRootData::PreviousViewData() +// Finds the active view data +// ----------------------------------------------------------------------------- +// +CXnViewData& CXnRootData::PreviousViewData() const + { + CXnViewData& active( ActiveViewData() ); + + TInt count( iPluginsData.Count() ); + + if ( count == 1 ) + { + // Only one view available + return active; + } + + TInt index( iPluginsData.Find( &active ) ); + + if ( index == 0 ) + { + // Return the last + return static_cast< CXnViewData& >( *iPluginsData[ count - 1 ] ); + } + else + { + // Return the previous + return static_cast< CXnViewData& >( *iPluginsData[ index - 1 ] ); + } + } + +// ----------------------------------------------------------------------------- +// CXnRootData::NextViewData() +// Finds the active view data +// ----------------------------------------------------------------------------- +// +CXnViewData& CXnRootData::NextViewData() const + { + CXnViewData& active( ActiveViewData() ); + + TInt count( iPluginsData.Count() ); + + if ( count == 1 ) + { + // Only one view available + return active; + } + + TInt index( iPluginsData.Find( &active ) ); + + if ( index + 1 < count ) + { + // Return the next + return static_cast< CXnViewData& >( *iPluginsData[ index + 1 ] ); + } + else + { + // Return the first + return static_cast< CXnViewData& >( *iPluginsData[ 0 ] ); + } + } + +// ----------------------------------------------------------------------------- +// CXnRootData::DestroyViewData() +// Sets view data to be destroyed +// ----------------------------------------------------------------------------- +// +void CXnRootData::DestroyViewData( CXnViewData* aViewData ) + { + TInt index( iPluginsData.Find( aViewData ) ); + + if ( index != KErrNotFound ) + { + iPluginsData.Remove( index ); + + if ( iViewsToDestroy.Find( aViewData ) == KErrNotFound ) + { + iViewsToDestroy.Append( aViewData ); + + iDestroyTimer->Cancel(); + + iDestroyTimer->Start( TTimeIntervalMicroSeconds32( 0 ), + TTimeIntervalMicroSeconds32( 0 ), + TCallBack( RunDestroyL, this ) ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnRootData::AllViewsLoaded() +// +// ----------------------------------------------------------------------------- +// +TBool CXnRootData::AllViewsLoaded() const + { + for ( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + if ( !iPluginsData[i]->Occupied() ) + { + return EFalse; + } + } + + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CXnRootData::AllViewsDestroyed() +// +// ----------------------------------------------------------------------------- +// +TBool CXnRootData::AllViewsDestroyed() const + { + return ( iPluginsData.Count() == 0 ) && iFlags.IsSet( EIsDispose ); + } + +// ----------------------------------------------------------------------------- +// CXnRootData::RunLoadL() +// +// ----------------------------------------------------------------------------- +// +/* static */ TInt CXnRootData::RunLoadL( TAny* aAny ) + { + CXnRootData* self = static_cast< CXnRootData* >( aAny ); + + if ( self->iFlags.IsSet( EIsDispose ) ) + { + self->iLoadTimer->Cancel(); + } + else + { + CXnPluginData& active( self->ActiveViewData() ); + + CXnPluginData* toLoad( NULL ); + + TInt index( self->iPluginsData.Find( &active ) ); + TInt count( self->iPluginsData.Count() ); + + if ( self->iLoadForward ) + { + self->iLoadForward = EFalse; + + // Start from the next one + index = index + 1; + + if ( index == count ) + { + index = 0; + } + + for ( TInt i = index; i < self->iPluginsData.Count(); i++ ) + { + if ( !self->iPluginsData[i]->Occupied() ) + { + toLoad = self->iPluginsData[i]; + break; + } + } + } + else + { + self->iLoadForward = ETrue; + + if ( index == 0 ) + { + index = count - 1; + } + else + { + index = index - 1; + } + + for ( TInt i = index; i >= 0; i-- ) + { + if ( !self->iPluginsData[i]->Occupied() ) + { + toLoad = self->iPluginsData[i]; + break; + } + } + } + + if ( !self->AllViewsLoaded() && toLoad ) + { + toLoad->LoadL(); + } + + if ( self->AllViewsLoaded() ) + { + self->iLoadTimer->Cancel(); + } + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CXnRootData::SetMaxPages( TInt32 aPages ) +// +// ----------------------------------------------------------------------------- +// +void CXnRootData::SetMaxPages( TInt32 aPages ) + { + iMaxPages = aPages; + } + +// ----------------------------------------------------------------------------- +// CXnRootData::MaxPages() +// +// ----------------------------------------------------------------------------- +// +TInt32 CXnRootData::MaxPages() + { + return iMaxPages; + } + +// ----------------------------------------------------------------------------- +// CXnRootData::RunDestroyL() +// +// ----------------------------------------------------------------------------- +// +/* static */ TInt CXnRootData::RunDestroyL( TAny* aAny ) + { + CXnRootData* self = static_cast< CXnRootData* >( aAny ); + + if( self->iFlags.IsSet( EIsDispose ) ) + { + for ( TInt i = 0; i < self->iViewsToDestroy.Count(); i++ ) + { + if ( self->iPluginsData.Find( + self->iViewsToDestroy[i] ) == KErrNotFound ) + { + // These must be deleted also + self->iPluginsData.AppendL( self->iViewsToDestroy[i] ); + } + } + + self->iViewsToDestroy.Reset(); + + if ( self->iPluginsData.Count() > 0 ) + { + CXnPluginData* toDestroy( self->iPluginsData[0] ); + + delete toDestroy; + toDestroy = NULL; + + self->iPluginsData.Remove( 0 ); + + User::Heap().Compress(); + } + + if ( self->AllViewsDestroyed() ) + { + // All done + delete self; + } + } + else + { + if ( self->iViewsToDestroy.Count() > 0 ) + { + CXnPluginData* toDestroy( self->iViewsToDestroy[0] ); + + delete toDestroy; + toDestroy = NULL; + + self->iViewsToDestroy.Remove( 0 ); + + User::Heap().Compress(); + } + + if ( self->iViewsToDestroy.Count() == 0 ) + { + if ( self->iFlags.IsClear( EIsDispose ) ) + { + self->iDestroyTimer->Cancel(); + } + } + } + + return KErrNone; + } + +// End of file + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnscrollablecontroladapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnscrollablecontroladapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,405 @@ +/* +* 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: +* +*/ + +// System includes +#include <e32base.h> +#include <e32const.h> +#include <coecntrl.h> +#include <coemain.h> +#include <aknphysics.h> + +// User includes +#include "xncontroladapter.h" +#include "xnuiengine.h" +#include "xnnode.h" +#include "xnnodepluginif.h" +#include "xnproperty.h" + +#include "xnscrollablecontroladapter.h" + +// Constants +const TInt KOffset( 25 ); + +_LIT8(KViewportHeight, "viewport-height"); +_LIT8(KViewportWidth, "viewport-width"); +_LIT8(KViewportTop, "viewport-top"); +_LIT8(KViewportLeft, "viewport-left"); + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnScrollableControlAdapter::NewL +// Two-phased constructor. Can leave. +// ----------------------------------------------------------------------------- +// +CXnScrollableControlAdapter* CXnScrollableControlAdapter::NewL( + CXnNodePluginIf& aNode ) + { + CXnScrollableControlAdapter* self = + new ( ELeave ) CXnScrollableControlAdapter( aNode ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnScrollableControlAdapter::~CXnScrollableControlAdapter +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnScrollableControlAdapter::~CXnScrollableControlAdapter() + { + delete iPhysics; + } + +// ----------------------------------------------------------------------------- +// CXnScrollableControlAdapter::CXnScrollableControlAdapter +// C++ default constructor. Must not leave. +// ----------------------------------------------------------------------------- +// +CXnScrollableControlAdapter::CXnScrollableControlAdapter( CXnNodePluginIf& aNode ) + : iNode( aNode ), iStartPosition( 0, 0), iPreviousPosition( 0, 0 ), + iCurrentPosition( 0, 0 ), iLayoutChanged( EFalse ) + { + } + +// ----------------------------------------------------------------------------- +// CXnScrollableControlAdapter::ConstructL +// 2nd phase constructor. Can leave. +// ----------------------------------------------------------------------------- +// +void CXnScrollableControlAdapter::ConstructL() + { + CXnControlAdapter::ConstructL( iNode ); + SetControlContext( this ); + SetHitTest( this ); + iUiEngine = iNode.Node().UiEngine(); + + iNode.Node().SetScrollableControl( this ); + } + +// ----------------------------------------------------------------------------- +// CXnScrollableControlAdapter::HandlePointerEventL +// +// ----------------------------------------------------------------------------- +// +void CXnScrollableControlAdapter::HandlePointerEventL( + const TPointerEvent& aPointerEvent ) + { + if( !iPhysics ) + { + return; + } + TPoint stylusPos = aPointerEvent.iPosition; + switch( aPointerEvent.iType ) + { + case TPointerEvent::EButton1Down: + { + iPhysics->StopPhysics(); + iPhysics->ResetFriction(); + iStartPosition = stylusPos; + iStartTime.HomeTime(); + iPreviousPosition = iCurrentPosition; + iStylusPosition = stylusPos; + } + break; + case TPointerEvent::EButton1Up: + { + TInt distance = iStartPosition.iY - stylusPos.iY; + TPoint drag( 0, distance ); + iPhysics->StartPhysics( drag, iStartTime ); + } + break; + case TPointerEvent::EDrag: + { + TPoint distanceFromStart( iStartPosition - stylusPos ); + + if( Abs( distanceFromStart.iY ) > KOffset ) + { + CXnNode* focused( iUiEngine->FocusedNode() ); + + if ( focused ) + { + // Remove pressed down + focused->UnsetStateL( + XnPropertyNames::style::common::KPressedDown ); + focused->HideTooltipsL(); + } + } + + TInt deltaY( iStylusPosition.iY - stylusPos.iY ); + iStylusPosition = stylusPos; + TPoint deltaPoint( 0, deltaY ); + iPhysics->RegisterPanningPosition( deltaPoint ); + } + break; + default: + break; + } + + CXnControlAdapter::HandlePointerEventL( aPointerEvent ); + } + +// ----------------------------------------------------------------------------- +// CXnScrollableControlAdapter::Draw +// +// ----------------------------------------------------------------------------- +// +void CXnScrollableControlAdapter::Draw( const TRect& aRect ) const + { + CXnControlAdapter::Draw( aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnScrollableControlAdapter::SizeChanged +// +// ----------------------------------------------------------------------------- +void CXnScrollableControlAdapter::SizeChanged() + { + TRAP_IGNORE( + ReadPropertiesL(); + InitPhysicEngineL(); ); + + CXnControlAdapter::SizeChanged(); + } + +// ----------------------------------------------------------------------------- +// CXnScrollableControlAdapter::MakeVisible +// +// ----------------------------------------------------------------------------- +// +void CXnScrollableControlAdapter::MakeVisible( TBool aVisible ) + { + TBool visible( IsVisible() ? ETrue : EFalse ); + + if ( visible == aVisible ) + { + return; + } + + if( aVisible ) + { + TRAP_IGNORE( InitPhysicEngineL() ); + } + + CCoeControl::MakeVisible( aVisible ); + } + +// ----------------------------------------------------------------------------- +// CXnScrollableControlAdapter::HitRegionContains +// +// ----------------------------------------------------------------------------- +// +TBool CXnScrollableControlAdapter::HitRegionContains( const TPoint& aPoint, + const CCoeControl& /*aControl*/) const + { + return iViewPort.Contains( aPoint ); + } + +// ----------------------------------------------------------------------------- +// CXnScrollableControlAdapter::HandleScreenDeviceChangedL +// +// ----------------------------------------------------------------------------- +void CXnScrollableControlAdapter::HandleScreenDeviceChangedL() + { + // The new layout has not been calculated yet. + // Therefore we need to read new propertues and initialise engine when LayoutChagedL() is called next time. + iLayoutChanged = ETrue; + CXnControlAdapter::HandleScreenDeviceChangedL(); + } + +// ----------------------------------------------------------------------------- +// CXnScrollableControlAdapter::DeltaPosition +// +// ----------------------------------------------------------------------------- +const TPoint CXnScrollableControlAdapter::DeltaPosition() const + { + return iStartViewPosition - iCurrentPosition; + } + +// ----------------------------------------------------------------------------- +// CXnScrollableControlAdapter::ResetState +// +// ----------------------------------------------------------------------------- +void CXnScrollableControlAdapter::ResetState() + { + iStartViewPosition = TPoint( 0, 0 ); + iCurrentPosition = TPoint( 0, 0 ); + iPreviousPosition = TPoint( 0, 0 ); + } + +// ----------------------------------------------------------------------------- +// CXnScrollableControlAdapter::ShowItem +// +// ----------------------------------------------------------------------------- +void CXnScrollableControlAdapter::ShowItem( CXnNode& aNode ) + { + TRect rect = aNode.MarginRect(); + if( !iViewPort.Contains( rect.iTl ) || !iViewPort.Contains( rect.iBr ) ) + { + TInt delta( 0 ); + if( rect.iTl.iY < iViewPort.iTl.iY ) + { + delta = rect.iTl.iY - iViewPort.iTl.iY; + } + else if( rect.iBr.iY > iViewPort.iBr.iY ) + { + delta = rect.iBr.iY - iViewPort.iBr.iY; + } + TPoint newPosition = iPreviousPosition + TPoint( 0, delta ); + ViewPositionChanged( newPosition, ETrue, 0 ); + } + } + +// ----------------------------------------------------------------------------- +// CXnScrollableControlAdapter::LayoutChangedL +// +// ----------------------------------------------------------------------------- +void CXnScrollableControlAdapter::LayoutChangedL() + { + if( iLayoutChanged ) + { + iLayoutChanged = EFalse; + ReadPropertiesL(); + InitPhysicEngineL(); + } + } + +// --------------------------------------------------------------------------- +// CXnScrollableControlAdapter::ViewPositionChanged +// --------------------------------------------------------------------------- +// +void CXnScrollableControlAdapter::ViewPositionChanged( + const TPoint& aNewPosition, TBool aDrawNow, TUint /*aFlags*/ ) + { + TPoint diff = TPoint( 0, aNewPosition.iY - iPreviousPosition.iY ); + iPreviousPosition = aNewPosition; + iCurrentPosition += diff; + TPoint tmpPos = iNode.Control()->Position(); + tmpPos -= diff; + iNode.Control()->SetPosition( tmpPos ); + if( aDrawNow ) + { + DrawNow( iViewPort ); + } + } + +// --------------------------------------------------------------------------- +// CXnScrollableControlAdapter::PhysicEmulationEnded +// --------------------------------------------------------------------------- +// +void CXnScrollableControlAdapter::PhysicEmulationEnded() + { + } + +// --------------------------------------------------------------------------- +// CXnScrollableControlAdapter::ViewPosition +// --------------------------------------------------------------------------- +// +TPoint CXnScrollableControlAdapter::ViewPosition() const + { + return iCurrentPosition; + } + +// --------------------------------------------------------------------------- +// CXnScrollableControlAdapter::ResetContext +// --------------------------------------------------------------------------- +// +void CXnScrollableControlAdapter::ResetContext( CWindowGc& aGc ) const + { + aGc.Reset(); + aGc.SetClippingRect( iViewPort ); + } + +// --------------------------------------------------------------------------- +// CXnScrollableControlAdapter::InitPhysicEngineL +// --------------------------------------------------------------------------- +// +void CXnScrollableControlAdapter::InitPhysicEngineL() + { + // Init physic engine + if ( !iPhysics && CAknPhysics::FeatureEnabled() ) + { + iPhysics = CAknPhysics::NewL( *this, this ); + } + if( !iPhysics ) + { + return; + } + TSize viewPortSize = iViewPort.Size(); + TSize totalSize( iNode.MarginRect().Size() ); + iPhysics->InitPhysicsL( totalSize, viewPortSize, EFalse ); + iCurrentPosition = TPoint( 0, viewPortSize.iHeight / 2 ); + iPreviousPosition = iStartViewPosition = iCurrentPosition; + } + +// --------------------------------------------------------------------------- +// CXnScrollableControlAdapter::ReadPropertiesL +// --------------------------------------------------------------------------- +// +void CXnScrollableControlAdapter::ReadPropertiesL() + { + TInt width( 0 ); + TInt height( 0 ); + TInt top( 0 ); + TInt left( 0 ); + + // Width + CXnProperty* prop = iNode.GetPropertyL( KViewportWidth ); + if( prop ) + { + width = iUiEngine->HorizontalPixelValueL( + prop, iNode.MarginRect().Width() ); + } + if( width == 0 ) + { + width = iNode.MarginRect().Width(); + } + + // Height + prop = iNode.GetPropertyL( KViewportHeight ); + if( prop ) + { + height = iUiEngine->VerticalPixelValueL( + prop, iNode.MarginRect().Height() ); + } + if( height == 0 ) + { + height = iNode.MarginRect().Height(); + } + + // Top + prop = iNode.GetPropertyL( KViewportTop ); + if( prop ) + { + top = iUiEngine->VerticalPixelValueL( + prop, iNode.MarginRect().Height() ); + } + + // Left + prop = iNode.GetPropertyL( KViewportLeft ); + if( prop ) + { + left = iUiEngine->HorizontalPixelValueL( + prop, iNode.MarginRect().Width() ); + } + + iViewPort = TRect( iNode.MarginRect().iTl, TSize( width, height ) ); + iViewPort.Move( left, top ); + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnuiengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengine.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,547 @@ +/* +* 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: UI Engine class +* +*/ + +// User includes +#include "xnuiengine.h" +#include "xnuienginepluginif.h" +#include "xnuiengineappif.h" +#include "xnuiengineimpl.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnUiEngine::CXnUiEngine +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnUiEngine::CXnUiEngine() + { + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::ConstructL +// Symbian 2nd phase constructor can leave +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::ConstructL( CXnAppUiAdapter& aAdapter ) + { + iUiEngineImpl = CXnUiEngineImpl::NewL( *this, aAdapter ); + + iUiEngineImpl->ConstructL(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::NewL +// Two-phased constructor +// ----------------------------------------------------------------------------- +// +CXnUiEngine* CXnUiEngine::NewL( CXnAppUiAdapter& aAdapter ) + { + CXnUiEngine* self = new ( ELeave ) CXnUiEngine; + + CleanupStack::PushL( self ); + self->ConstructL( aAdapter ); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::~CXnUiEngine +// Destructor +// ----------------------------------------------------------------------------- +// +CXnUiEngine::~CXnUiEngine() + { + delete iUiEngineImpl; + delete iPluginIf; + delete iAppIf; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::AppUiAdapter +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +CXnAppUiAdapter& CXnUiEngine::AppUiAdapter() const + { + return iUiEngineImpl->AppUiAdapter(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::RootNode +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +CXnNode* CXnUiEngine::RootNode() + { + return iUiEngineImpl->RootNode(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::FindNodeByIdL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +CXnNode* CXnUiEngine::FindNodeByIdL( + const TDesC& aAreaId, const TDesC& aNamespace ) + { + return iUiEngineImpl->FindNodeByIdL( aAreaId, aNamespace ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::FindNodeByIdL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +CXnNode* CXnUiEngine::FindNodeByIdL( + const TDesC8& aAreaId, const TDesC8& aNamespace ) + { + return iUiEngineImpl->FindNodeByIdL( aAreaId, aNamespace ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::FindNodeByClassL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +CXnPointerArray* CXnUiEngine::FindNodeByClassL( const TDesC& aClassId, + const TDesC& aNamespace ) + { + return iUiEngineImpl->FindNodeByClassL( aClassId, aNamespace ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::FindNodeByClassL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +CXnPointerArray* CXnUiEngine::FindNodeByClassL( const TDesC8& aClassId, + const TDesC8& aNamespace ) + { + return iUiEngineImpl->FindNodeByClassL( aClassId, aNamespace ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::RenderUIL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::RenderUIL( CXnNode* aNode ) + { + iUiEngineImpl->LayoutUIL( aNode ); + iUiEngineImpl->RenderUIL( aNode ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::LayoutUIL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::LayoutUIL( CXnNode* aNode ) + { + iUiEngineImpl->LayoutUIL( aNode ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::Resources +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +CArrayPtrSeg< CXnResource >& CXnUiEngine::Resources() + { + return iUiEngineImpl->Resources(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::SetFocusedNodeL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::SetFocusedNodeL( CXnNode* aFocusedNode, TInt aSource ) + { + iUiEngineImpl->SetFocusedNodeL( aFocusedNode, aSource ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::FocusedNode +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +CXnNode* CXnUiEngine::FocusedNode() + { + return iUiEngineImpl->FocusedNode(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::IsEditMode +// Returns ETrue if the current mode is edit, otherwise EFalse. +// ----------------------------------------------------------------------------- +// +TBool CXnUiEngine::IsEditMode() + { + return iUiEngineImpl->IsEditMode(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::ODT +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +CXnODT* CXnUiEngine::ODT() + { + return iUiEngineImpl->ODT(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::VerticalPixelValueL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +TInt CXnUiEngine::VerticalPixelValueL( + CXnProperty* aValue, TInt aReferenceValue ) + { + return iUiEngineImpl->VerticalPixelValueL( aValue, aReferenceValue ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::HorizontalPixelValueL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +TInt CXnUiEngine::HorizontalPixelValueL( + CXnProperty* aValue, TInt aReferenceValue ) + { + return iUiEngineImpl->HorizontalPixelValueL( aValue, aReferenceValue ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::VerticalTwipValueL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +TInt CXnUiEngine::VerticalTwipValueL( + CXnProperty* aValue, TInt aReferenceValue ) + { + return iUiEngineImpl->VerticalTwipValueL( aValue, aReferenceValue ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::HorizontalTwipValueL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +TInt CXnUiEngine::HorizontalTwipValueL( + CXnProperty* aValue, TInt aReferenceValue ) + { + return iUiEngineImpl->HorizontalTwipValueL( aValue, aReferenceValue ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::ActivateViewL +// Activate a view +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::ActivateViewL( CXnNode& /*aViewNode*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::ViewManager +// ----------------------------------------------------------------------------- +// +CXnViewManager* CXnUiEngine::ViewManager() + { + return iUiEngineImpl->ViewManager(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::ActiveView +// Returns the active view +// ----------------------------------------------------------------------------- +// +CXnNode* CXnUiEngine::ActiveView() + { + return iUiEngineImpl->ActiveView(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::RefreshMenuL +// Refresh current menu +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::RefreshMenuL() + { + iUiEngineImpl->RefreshMenuL(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::AddDirtyNodeL +// Add a dirty node +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::AddDirtyNodeL( CXnNode* aNode, TInt aLevel ) + { + iUiEngineImpl->AddDirtyNodeL( aNode, aLevel ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::PluginIfL +// Get plugin interface +// ----------------------------------------------------------------------------- +// +TXnUiEnginePluginIf& CXnUiEngine::PluginIfL() + { + if ( iPluginIf ) + { + return *iPluginIf; + } + else + { + iPluginIf = new ( ELeave ) TXnUiEnginePluginIf( *this ); + return *iPluginIf; + } + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::AppIfL +// Get application interface +// ----------------------------------------------------------------------------- +// +TXnUiEngineAppIf& CXnUiEngine::AppIfL() + { + if ( iAppIf ) + { + return *iAppIf; + } + else + { + iAppIf = new ( ELeave ) TXnUiEngineAppIf( *this ); + return *iAppIf; + } + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::ScreenDeviceSize +// Get the size of the current screen device +// ----------------------------------------------------------------------------- +// +TSize CXnUiEngine::ScreenDeviceSize() const + { + return iUiEngineImpl->ScreenDeviceSize(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::IsDialogDisplaying +// Checks whether the dialog is displaying or not +// ----------------------------------------------------------------------------- +// +TBool CXnUiEngine::IsDialogDisplaying() + { + return iUiEngineImpl->IsDialogDisplaying(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::IsMenuDisplaying +// Checks whether the menu is displaying or not +// ----------------------------------------------------------------------------- +// +TBool CXnUiEngine::IsMenuDisplaying() + { + return iUiEngineImpl->IsMenuDisplaying(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::MenuBarNode +// Returns menubar node +// ----------------------------------------------------------------------------- +// +CXnNode* CXnUiEngine::MenuBarNode() const + { + return iUiEngineImpl->MenuBarNode(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::StylusPopupNode +// Returns stylus popup node +// ----------------------------------------------------------------------------- +// +CXnNode* CXnUiEngine::StylusPopupNode() const + { + return iUiEngineImpl->StylusPopupNode(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::AddPassiveFocusedNode +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::AddPassiveFocusedNodeL( CXnNode* aNode ) + { + iUiEngineImpl->AddPassiveFocusedNodeL( aNode ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::RemovePassiveFocusedNode +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::RemovePassiveFocusedNodeL( CXnNode* aNode ) + { + iUiEngineImpl->RemovePassiveFocusedNodeL( aNode ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::AddPassiveFocusedNode +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::ClearPassiveFocusedNodesL() + { + iUiEngineImpl->ClearPassiveFocusedNodesL(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::SetClientRectL +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::SetClientRectL( TRect aRect, TBool aDrawNow ) + { + return iUiEngineImpl->SetClientRectL( aRect, aDrawNow ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::ClientRect +// ----------------------------------------------------------------------------- +// +TRect CXnUiEngine::ClientRect() const + { + return iUiEngineImpl->ClientRect(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::SetNodeDroppedL +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::SetNodeDroppedL( CXnNode& aNode, TInt aDropped ) const + { + iUiEngineImpl->SetNodeDroppedL( aNode, aDropped ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::CheckAdaptiveContentL +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::CheckAdaptiveContentL( + CXnNode& aNode, TSize aAvailableSize ) const + { + iUiEngineImpl->CheckAdaptiveContentL( aNode, aAvailableSize ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::AddFocusCandidateL +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::AddFocusCandidateL( CXnNode* aNode ) + { + iUiEngineImpl->AddFocusCandidateL( aNode ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::Editor +// ----------------------------------------------------------------------------- +// +CXnEditor* CXnUiEngine::Editor() const + { + return iUiEngineImpl->Editor(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::EditMode +// ----------------------------------------------------------------------------- +// +CXnEditMode* CXnUiEngine::EditMode() + { + return iUiEngineImpl->EditMode(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::Plugins +// ----------------------------------------------------------------------------- +// +RPointerArray< CXnNode >* CXnUiEngine::Plugins() + { + return iUiEngineImpl->Plugins(); + } + +// ----------------------------------------------------------------------------- +// 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 +// ----------------------------------------------------------------------------- +// +TInt CXnUiEngine::GetThemeResource( const TDesC& aPath, RFile& aFile ) + { + return iUiEngineImpl->GetThemeResource( aPath, aFile ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::AnalyseAddedWidgetL +// ----------------------------------------------------------------------------- +// +TBool CXnUiEngine::AnalyseAddedWidgetL( CXnNode& aNode ) + { + return iUiEngineImpl->AnalyseAddedWidgetL( aNode ); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::DisableRenderUiLC() + { + iUiEngineImpl->DisableRenderUiLC(); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CXnUiEngine::SetEventDispatcher( CXnKeyEventDispatcher* aDispatcher ) + { + iUiEngineImpl->SetEventDispatcher( aDispatcher ); + } + +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason ) + { + return KErrNone; + } +#endif diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnuiengine.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengine.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,163 @@ +/* +* 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: +* +*/ + + +// ========== RESOURCE IDENTIFIER ============================================= + +NAME XNAI + +// ========== INCLUDE FILES =================================================== + +#include <eikon.rh> +#include <eikcore.rsg> +#include <avkon.rsg> +#include <avkon.rh> +#include <avkon.mbg> +#include <e32keys.h> +#include <activeidle3.loc> +// ========== RESOURCE DEFINITIONS ============================================ + +RESOURCE RSS_SIGNATURE { } +RESOURCE TBUF { buf = ""; } + +// Select widget-dialog +RESOURCE AVKON_LIST_QUERY r_listquery_add_widget + { + items = + { + AVKON_LIST_QUERY_DLG_LINE + { + control = AVKON_LIST_QUERY_CONTROL + { + listtype = EAknCtSinglePopupMenuListBox; + heading = qtn_hs_select_widget; + listbox = AVKON_LIST_QUERY_LIST + { + // dynamically filled + }; + }; + } + }; + softkeys = R_AVKON_SOFTKEYS_SELECT_BACK; + } + + +// xml listquery dialog +RESOURCE AVKON_LIST_QUERY r_xml_listquery + { + items = + { + AVKON_LIST_QUERY_DLG_LINE + { + control = AVKON_LIST_QUERY_CONTROL + { + listtype = EAknCtSinglePopupMenuListBox; + // heading = dynamically filled + listbox = AVKON_LIST_QUERY_LIST + { + // dynamically filled + }; + }; + } + }; + softkeys = R_AVKON_SOFTKEYS_SELECT_BACK; + } + +RESOURCE TBUF r_qtn_hs_add_widget_full + { + buf = qtn_hs_add_widget_full; + } + +RESOURCE TBUF r_qtn_hs_error_widgets_removed + { + buf = qtn_hs_error_widgets_removed; + } + +RESOURCE TBUF r_qtn_hs_hs_memory_full + { + buf = qtn_hs_hs_memory_full; + } + +RESOURCE TBUF r_qtn_hs_max_amount_of_pages_note + { + buf = qtn_hs_max_amount_of_pages_note; + } + +RESOURCE TBUF r_qtn_hs_delete_page + { + buf = qtn_hs_delete_current_page; + } + +RESOURCE TITLE_PANE r_qtn_hs_title_editmode + { + txt = qtn_hs_title_editing; + } + +RESOURCE DIALOG r_yes_no_hs_remove_view + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = qtn_hs_delete_current_page; + }; + } + }; + } + +RESOURCE ARRAY r_array_change_wallpaper + { + items = + { + LBUF {txt = qtn_hs_default; }, + LBUF {txt = qtn_hs_image; }, + LBUF {txt = qtn_hs_slideshow; } + }; + } + +// Change wallpaper-dialog +RESOURCE AVKON_LIST_QUERY r_listquery_change_wallpaper + { + items = + { + AVKON_LIST_QUERY_DLG_LINE + { + control = AVKON_LIST_QUERY_CONTROL + { + listtype = EAknCtSinglePopupMenuListBox; + heading = qtn_hs_title_change_wallpaper; + listbox = AVKON_LIST_QUERY_LIST + { + array_id = r_array_change_wallpaper; + }; + }; + } + }; + softkeys = R_AVKON_SOFTKEYS_SELECT_BACK; + } + +RESOURCE TBUF r_qtn_hs_operation_failed_no_disk + { + buf = qtn_hs_operation_failed_no_disk; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnuiengineappif.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengineappif.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,318 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Layout calculation and UI rendering mechanism implementations. +* +*/ + +// User includes +#include "xnuiengineappif.h" +#include "xnuiengine.h" +#include "xnnode.h" +#include "xnodt.h" +#include "xndomdocument.h" +#include "xnpointerarray.h" +#include "xneditor.h" +#include "xnnodeappif.h" +#include "xnviewdata.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// TXnUiEngineAppIf::TXnUiEngineAppIf +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +TXnUiEngineAppIf::TXnUiEngineAppIf( CXnUiEngine& aUiEngine ) + { + iUiEngine = &aUiEngine; + } + +// ----------------------------------------------------------------------------- +// TXnUiEngineAppIf::RootNode +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnNodeAppIf& TXnUiEngineAppIf::RootNodeL() + { + return iUiEngine->RootNode()->AppIfL(); + } + +// ----------------------------------------------------------------------------- +// TXnUiEngineAppIf::FindNodeByIdL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnNodeAppIf* TXnUiEngineAppIf::FindNodeByIdL( + const TDesC& aNodeId, + const TDesC& aNamespace ) + { + CXnNode* node( iUiEngine->FindNodeByIdL( aNodeId, aNamespace ) ); + + if ( node ) + { + return &( node->AppIfL() ); + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// TXnUiEngineAppIf::FindNodeByIdL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnNodeAppIf* TXnUiEngineAppIf::FindNodeByIdL( + const TDesC8& aNodeId, + const TDesC8& aNamespace ) + { + CXnNode* node( iUiEngine->FindNodeByIdL( aNodeId, aNamespace ) ); + + if ( node ) + { + return &( node->AppIfL() ); + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// TXnUiEngineAppIf::FindNodeByClassL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C RPointerArray< CXnNodeAppIf > TXnUiEngineAppIf::FindNodeByClassL( + const TDesC& aClassId, const TDesC& aNamespace ) + { + CXnPointerArray* array = iUiEngine->FindNodeByClassL( + aClassId, aNamespace ); + CleanupStack::PushL( array ); + RPointerArray< CXnNodeAppIf > interfaceArray; + CleanupClosePushL( interfaceArray ); + const TInt count = array->Container().Count(); + interfaceArray.ReserveL( count ); + for ( TInt i = 0; i < count; ++i ) + { + 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 ); + CleanupStack::PopAndDestroy( array ); + return interfaceArray; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::FindNodeByClassL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C RPointerArray< CXnNodeAppIf > TXnUiEngineAppIf::FindNodeByClassL( + const TDesC8& aClassId, const TDesC8& aNamespace ) + { + CXnPointerArray* array = iUiEngine->FindNodeByClassL( + aClassId, aNamespace ); + CleanupStack::PushL( array ); + RPointerArray< CXnNodeAppIf > interfaceArray; + CleanupClosePushL( interfaceArray ); + const TInt count = array->Container().Count(); + interfaceArray.ReserveL( count ); + for ( TInt i = 0; i < count; ++i ) + { + 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 ); + CleanupStack::PopAndDestroy( array ); + return interfaceArray; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::FindNodeByClassL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C RPointerArray< CXnNodeAppIf > TXnUiEngineAppIf::FindContentSourceNodesL( + const TDesC8& aNamespace ) + { + RPointerArray< CXnNodeAppIf > interfaceArray; + CleanupClosePushL( interfaceArray ); + + CXnViewManager* manager( iUiEngine->ViewManager() ); + + CXnPluginData* data( manager->ActiveViewData().Plugin( aNamespace ) ); + + if ( data ) + { + RPointerArray< CXnNode > nodes; + CleanupClosePushL( nodes ); + + data->ContentSourceNodesL( nodes ); + + for ( TInt i = 0; i < nodes.Count(); i++ ) + { + interfaceArray.AppendL( &nodes[i]->AppIfL() ); + } + + CleanupStack::PopAndDestroy( &nodes ); + } + + CleanupStack::Pop( &interfaceArray ); + + return interfaceArray; + } + +// ----------------------------------------------------------------------------- +// TXnUiEngineAppIf::RenderUIL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C void TXnUiEngineAppIf::RenderUIL( CXnNodeAppIf* aNode ) + { + CXnNode* node = NULL; + if ( aNode != NULL ) + { + node = &( aNode->Node() ); + } + iUiEngine->RenderUIL( node ); + } + +// ----------------------------------------------------------------------------- +// TXnUiEngineAppIf::StringPool +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomStringPool& TXnUiEngineAppIf::StringPool() + { + return iUiEngine->ODT()->DomDocument().StringPool(); + } + +// ----------------------------------------------------------------------------- +// TXnUiEngineAppIf::ActivateViewL +// Activate a view +// ----------------------------------------------------------------------------- +// +EXPORT_C void TXnUiEngineAppIf::ActivateViewL( CXnNodeAppIf& aViewNode ) + { + iUiEngine->ActivateViewL( aViewNode.Node() ); + } + +// ----------------------------------------------------------------------------- +// TXnUiEngineAppIf::ActiveView +// Return the active view +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnNodeAppIf* TXnUiEngineAppIf::ActiveView() + { + CXnNodeAppIf* ret( NULL ); + TRAP_IGNORE( ret = &( iUiEngine->ActiveView()->AppIfL() ) ); + return ret; + } + +// ----------------------------------------------------------------------------- +// TXnUiEngineAppIf::RefreshMenuL +// Refresh current menu +// ----------------------------------------------------------------------------- +// +EXPORT_C void TXnUiEngineAppIf::RefreshMenuL() + { + iUiEngine->RefreshMenuL(); + } + +// ----------------------------------------------------------------------------- +// TXnUiEngineAppIf::IsMenuDisplaying +// Checks whether the menu is displaying or not. +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool TXnUiEngineAppIf::IsMenuDisplaying() + { + return iUiEngine->IsMenuDisplaying(); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TXnUiEngineAppIf::GetPluginNodeArrayL( + RPointerArray< CXnNodeAppIf >& aArray ) + { + aArray.Reset(); + RPointerArray< CXnNode >* plugins = iUiEngine->Plugins(); + if ( !plugins ) + { + return 0; + } + TInt count( plugins->Count() ); + for ( TInt i = 0; i < count; ++i ) + { + CXnNode* tmp = ( *plugins )[i]; + aArray.AppendL( &( tmp->AppIfL() ) ); + } + return count; + } + +// ----------------------------------------------------------------------------- +// TXnUiEngineAppIf::FocusedNode +// Gets the currently focused node +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnNodeAppIf* TXnUiEngineAppIf::FocusedNode() + { + CXnNode* focused( iUiEngine->FocusedNode() ); + CXnNodeAppIf* ret( NULL ); + + if ( focused ) + { + TRAP_IGNORE( ret = &( focused->AppIfL() ) ); + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// TXnUiEngineAppIf::IsEditMode +// Returns ETrue if the current mode is edit, otherwise EFalse. +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool TXnUiEngineAppIf::IsEditMode() + { + return ( iUiEngine->IsEditMode() ); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +EXPORT_C void TXnUiEngineAppIf::SetUiEngine( CXnUiEngine* aUiEngine ) + { + iUiEngine = aUiEngine; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TXnUiEngineAppIf::GetThemeResource( + const TDesC& aPath, RFile& aFile ) + { + return iUiEngine->GetThemeResource( aPath, aFile ); + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool TXnUiEngineAppIf::WidgetsVisible() const + { + return iUiEngine->Editor()->WidgetsVisible(); + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,10024 @@ +/* +* 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: Layout calculation and UI rendering mechanism implementations. +* +*/ + + +// System includes +#include <utf.h> +#include <eikapp.h> +#include <AknUtils.h> +#include <layoutmetadata.cdl.h> + +// User includes +#include "xnuiengine.h" +#include "xnuiengineimpl.h" +#include "xnuistatelistener.h" +#include "xnpointerarray.h" +#include "xnodt.h" +#include "xndomlist.h" +#include "xndompropertyvalue.h" +#include "xnmenuadapter.h" +#include "xnpopupcontroladapter.h" +#include "xnviewdata.h" +#include "xnnodebreadthfirstiterator.h" +#include "xntype.h" +#include "xnnodepluginif.h" +#include "xncomponentnodeimpl.h" +#include "xnproperty.h" +#include "xnappuiadapter.h" +#include "xnviewadapter.h" +#include "xnwidgetextensionadapter.h" +#include "xnscrollablecontroladapter.h" +#include "xnkeyeventdispatcher.h" +#include <aknlayoutscalable_avkon.cdl.h> +#include "xuikon_builds_cfg.hrh" +#include "xndomdocument.h" +#include "xndomnode.h" +#include "xneditmode.h" +#include "xnhittest.h" +#include "xnnode.h" +#include "xnpanic.h" +#include "xneffectmanager.h" + +#ifdef _XN_PERFORMANCE_TEST_ +#include "xntimemon.h" +#endif + +// CONSTANTS +const TInt KXnBorderThin = 1; +const TInt KXnBorderMedium = 3; +const TInt KXnBorderThick = 5; +const TInt KXnStackPriorityKeyEventDispatcher = 55; +const TInt KFocusGrowValue = 3; + +_LIT8( KBoxNodeName, "box" ); +_LIT8( KButtonNodeName, "button" ); +_LIT8( KWidgetNodeName, "widget" ); +_LIT8( KWidgetExtensionNodeName, "widgetextension" ); +_LIT8( KScrollableBoxNodeName, "scrollablebox" ); +_LIT8( KMenuBar, "menubar" ); +_LIT8( KPopUpNodeName, "popup" ); + +_LIT8( KPlugin, "plugin" ); + +// LOCAL CONSTANTS AND MACROS +static const TReal KIntConversionConstant = 0.5; +static const TReal KIntPercentageConstant = + static_cast< TReal >( 1 ) / static_cast< TReal >( 100 ); +static const TReal KInchesAsTwips = 1440; +static const TReal KCentimetersAsInches = static_cast< TReal >( 1 ) / 2.54; +static const TReal KCentimetersAsTwips = KCentimetersAsInches * KInchesAsTwips; +static const TReal KMillimetersAsInches = + KCentimetersAsInches / static_cast< TReal >( 10 ); +static const TReal KMillimetersAsTwips = KMillimetersAsInches * KInchesAsTwips; +static const TReal KPointsAsInches = + static_cast< TReal >( 1 ) / static_cast< TReal >( 72 ); +static const TReal KPointsAsTwips = KPointsAsInches * KInchesAsTwips; +static const TReal KPicasAsInches = + KPointsAsInches / static_cast< TReal >( 12 ); +static const TReal KPicasAsTwips = KPicasAsInches * KInchesAsTwips; + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +static TRect AddRect( const TRect& aOriginal, const TRect& aAdded ); +static TRect SubtractRect( const TRect& aOriginal, const TRect& aSubtracter ); +static TSize AutoStaticBTL( CXnNode& aNode, TInt aWidthToFit, + TInt aHeightToFit, RArray< TPtrC8 >& aAutoProperties, + TRect& aParentRect, CGraphicsDevice& aGraphicsDevice, + TReal aHorizontalUnitInPixels, TReal aVerticalUnitInPixels ); +static TSize AutoStaticLRL( CXnNode& aNode, TInt aWidthToFit, + TInt aHeightToFit, RArray< TPtrC8 >& aAutoProperties, + TRect& aParentRect, CGraphicsDevice& aGraphicsDevice, + TReal aHorizontalUnitInPixels, TReal aVerticalUnitInPixels ); +static TSize AutoStaticRLL( CXnNode& aNode, TInt aWidthToFit, + TInt aHeightToFit, RArray< TPtrC8 >& aAutoProperties, + TRect& aParentRect, CGraphicsDevice& aGraphicsDevice, + TReal aHorizontalUnitInPixels, TReal aVerticalUnitInPixels ); +static TSize AutoStaticTBL( CXnNode& aNode, TInt aWidthToFit, + TInt aHeightToFit, RArray< TPtrC8 >& aAutoProperties, + TRect& aParentRect, CGraphicsDevice& aGraphicsDevice, + TReal aHorizontalUnitInPixels, TReal aVerticalUnitInPixels ); +static void CalculateAbsolutePositionsL( CXnNode& aNode, + TRect& aParentRect, CGraphicsDevice& aGraphicsDevice, + TReal aHorizontalUnitInPixels, TReal aVerticalUnitInPixels ); +static void CalculateBorderL( CXnNode& aNode, + TRect& aParentRect, CGraphicsDevice& aGraphicsDevice, + TReal aHorizontalUnitInPixels, TReal aVerticalUnitInPixels ); +static void CalculateMarginL( CXnNode& aParent, CXnNode& aNode, + CXnNode* aPreviousSibling, const TDesC8& aParentBlockProgression, + const TDesC8& aParentDirection, TRect& aParentRect, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels, TInt& aColumnWidth, TInt& aColumnMargin ); +static void CalculatePaddingL( const TRect& aParentRect, CXnNode& aNode, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ); + +static void CalculateRectL( CXnNode& aNode, CXnNode& aParent, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ); + +static void CalculateRelativePositionsL( const TRect& aRect, CXnNode& aNode, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ); +static TSize CalculateSpaceUsedByChildrenL( RPointerArray< CXnNode >& aChildren, + CXnNode& aNode, const TDesC8& aParentBlockProgression, + const TDesC8& aParentDirection, CGraphicsDevice& aScreenDevice, + TReal aHorizontalUnitInPixels, TReal aVerticalUnitInPixels ); + +static TSize CalculateTotalDimensionsL( CXnNode& aNode, TBool aIgnoreAutoValues, + TBool aIgnoreMinSizes, TRect& aParentRect, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ); +static TBool CutOnePixelFromPercentChildNodeL( CXnNode& aNode, + const TDesC8& aParentBlockProgression ); +static void DetermineBorderWidthsL( CXnProperty* aBorderWidthProperty, + TInt& aBordervertical, TInt& aBorderhorizontal, + TRect& aParentRect, CGraphicsDevice& aGraphicsDevice, + TReal aHorizontalUnitInPixels, TReal aVerticalUnitInPixels ); +static TInt DisplayedChildrenCountL( CXnNode& aNode, + RPointerArray< CXnNode >* aDisplayedChildren = NULL ); +static CXnNode* DisplayedParentL( CXnNode& aNode ); +static CXnDomPropertyValue* DomPropertyValueFromProperty( + CXnProperty* aProperty ); +static void DropExceedingRectL( const TRect& aParentRect, CXnNode& aNode, + TBool aDropRelativeNode = EFalse ); +static TBool CalculateExceedingArea( CXnNode& aParent, CXnNode& aChild, + TInt& aLeftOffset, TInt& aRightOffset, TInt& aTopOffset, + TInt& aBottomOffset ); +static void AdjustRectsL( CXnNode& aNode, TInt aLeftOffset, TInt aRightOffset, + TInt aTopOffset, TInt aBottomOffset ); +static void ClearRects( CXnNode& aNode, TBool aRecurse = EFalse ); +static void FitChildrenIntoParentL( CXnNode& aNode, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ); +static TInt GetPositionL( CXnNode& aNode, + const TDesC8& aParentBlockProgression, const TDesC8& aParentDirection ); +static TInt HasNodeAutoValuesL( CXnNode& aNode ); +static TInt HasNodeHorizontalAutoValuesL( CXnNode& aNode ); +static TInt HasNodeVerticalAutoValuesL( CXnNode& aNode ); +static TBool HasNodeMinSizesL( CXnNode& aNode ); +static TBool HasNodeMaxSizesL( CXnNode& aNode ); +static TInt HorizontalPixelValueL( CXnProperty* aValue, TInt aReferenceValue, + CGraphicsDevice& aScreenDevice, TReal aHorizontalUnitInPixels ); +static TInt HorizontalValueToPixelsL( CXnDomPropertyValue* aValue, + TReal aReferenceValue, CGraphicsDevice& aScreenDevice, + TReal aHorizontalUnitInPixels ); +static void GrowToMinSizeL( CXnNode& aNode, TRect& aParentRect, + CGraphicsDevice& aScreenDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ); +static void ShrinkToMaxSizeL( CXnNode& aNode, TRect& aParentRect, + CGraphicsDevice& aScreenDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ); +static TBool IsAbsoluteL( CXnNode& aNode ); +static TBool IsLargerThanMaxSizeL( const TRect& aParentRect, CXnNode& aNode, + CGraphicsDevice& aScreenDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ); +static TBool IsNodeDisplayedL( CXnNode& aNode ); + +static TBool IsNodeTooltip( CXnNode& aNode ); +static TBool IsPropertyAutoL( CXnProperty& aProperty ); +static TBool IsPropertyNone( CXnProperty& aProperty ); +static TBool IsRelativeL( CXnNode& aNode ); +static TBool IsSmallerThanMinSizeL( const TRect& aParentRect, CXnNode& aNode, + CGraphicsDevice& aScreenDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ); +static TBool IsValuePercentageL( CXnProperty& aProperty ); +static TInt PercentageToPixelsL( TReal& aPercentage, TReal aReferenceValue ); +static void PlaceAreasL( CXnNode& aNode, + RPointerArray< CXnNode >& aLaidOutList, + TInt aLayoutPhase, CGraphicsDevice& aGraphicsDevice, + TReal aHorizontalUnitInPixels, TReal aVerticalUnitInPixels ); +static void PriorizeChildrenL( CXnNode& aNode ); +static void CalculateAutoPropertiesOfNodesL( + RPointerArray< CXnNode >* aAutoNodeArray, TInt& aWidthAutoCount, + TInt& aHeightAutoCount ); +static void ProcessAutoAreasL( CXnNode& aParentNode, + RPointerArray< CXnNode >* aArray, const TDesC8& aParentBlockProgression, + const TDesC8& aParentDirection, CGraphicsDevice& aGraphicsDevice, + TReal aHorizontalUnitInPixels, TReal aVerticalUnitInPixels ); +static void CalculateCollapseMarginsL( RPointerArray< CXnNode >& aChildren, + RArray< TInt >& aCollapsedMarginsWidth, + RArray< TInt >& aCollapsedMarginsHeight, + const TDesC8& aParentBlockProgression, + const TDesC8& aParentDirection ); +static TSize CalculateSpaceUsedByAutoChildrenL( + RPointerArray< CXnNode >& aAutoChildren, + RPointerArray< CXnNode >& aCalculatedAutoChildren, + CXnNode& aParent, + const TDesC8& aParentBlockProgression, + const TDesC8& aParentDirection, + CGraphicsDevice& aScreenDevice ); +static void MoveAutoAreaL( TRect& parentRect, + RPointerArray< CXnNode >& aChildren, + const TDesC8& aParentBlockProgression, + const TDesC8& aParentDirection ); +static TSize ScaleAutoAreaL( CXnNode& aNode, TInt aWidthToFit, + TInt aHeightToFit, const TDesC8& aParentBlockProgression, + const TDesC8& aParentDirection, TRect& aParentRect, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ); +static void FitAutoChildrenIntoParentL( RPointerArray< CXnNode >& aAutoChildren, + RPointerArray< CXnNode >& aCalculatedAutoChildren, CXnNode& aParent, + const TDesC8& aParentBlockProgression, const TDesC8& aParentDirection, + CGraphicsDevice& aGraphicsDevice ); +static TInt VerticalPixelValueL( CXnProperty* aValue, TInt aReferenceValue, + CGraphicsDevice& aScreenDevice, TReal aVerticalUnitInPixels ); +static TInt VerticalValueToPixelsL( CXnDomPropertyValue* aValue, + TReal aReferenceValue, CGraphicsDevice& aScreenDevice, + TReal aVerticalUnitInPixels ); +static TBool IsStringValueL( CXnProperty& aProperty ); +static TInt HorizontalUnitsToPixelsL( TReal aUnits, + TReal aHorizontalUnitInPixels ); +static TInt VerticalUnitsToPixelsL( TReal aUnits, TReal aVerticalUnitInPixels ); +static void ProcessAdaptiveAreasL( CXnNode& aParent, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ); + +static void CalculateAdaptiveSizeL( CXnNode& aNode, + const TDesC8& aParentBlockProgression, const TDesC8& aParentDirection, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ); + +static CXnNode* BuildTriggerNodeLC( CXnUiEngine& aUiEngine, + const TDesC8& aTriggerName ); +static void UpdateInternalUnits( TReal& aHorizontalUnitInPixels, + TReal& aVerticalUnitInPixels, TRect aRect ); +static CXnNode* BuildScreenDeviceChangeTriggerNodeLC( + 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, + CXnPointerArray& aArray, const TDesC8& aNamespace ); +static CXnNode* FindNodeByIdL( CXnNode* aRootNode, const TDesC8& aAreaId, + const TDesC8& aNamespace ); + +#ifdef _XN3_DEBUG_ +static void TraceTreeL( CXnNode* aRootNode ); +#endif + +// ============================= LOCAL FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// GrowIfNeeded() +// When a plugin is focused, the focus is a bit bigger than its control +// (this is a hack fix to get focus visible with WRT widgets). +// Therefore we need to check if focused node is a plugin, +// or focused node has same size with its plugin, and grow dirty rect accordingly. +// ----------------------------------------------------------------------------- +// +static void GrowIfNeeded(CXnNode* aNode, TRect& aRect) + { + CXnNode* focusedNode(NULL); + for( CXnNode* node = aNode; node; node = node->Parent() ) + { + if( node->IsStateSet( XnPropertyNames::style::common::KFocus ) ) + { + if( node->DomNode()->Name() == KPlugin ) + { + CXnControlAdapter* adapter( node->Control() ); + if(adapter) + { + aRect = adapter->Rect(); + aRect.Grow( KFocusGrowValue, KFocusGrowValue ); + } + break; + } + focusedNode = node; + } + else if( node->DomNode()->Name() == KPlugin ) + { + if( focusedNode && focusedNode->MarginRect() == node->Rect() ) + { + CXnControlAdapter* adapter( focusedNode->Control() ); + if(adapter) + { + aRect = adapter->Rect(); + aRect.Grow( KFocusGrowValue, KFocusGrowValue ); + } + } + break; + } + } + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +static TBool IsSrollableBox( CXnNode& aNode ) + { + if( aNode.Type()->Type() == KScrollableBoxNodeName ) + { + return ETrue; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// FindNodeByClassL() +// Finds recursively a node from current view by class +// ----------------------------------------------------------------------------- +// +static void FindNodeByClassL( CXnNode* aRootNode, const TDesC8& aClassId, + CXnPointerArray& aArray, const TDesC8& aNamespace ) + { + ASSERT( aRootNode ); + + if ( aNamespace != KNullDesC8 && aNamespace != aRootNode->Namespace() ) + { + // Recursed to wrong namespace + return; + } + + CXnProperty* prop( aRootNode->ClassL() ); + + if ( prop && prop->StringValue() == aClassId ) + { + // Correct id found + if ( aNamespace == KNullDesC8 ) + { + aArray.Container().AppendL( aRootNode ); + } + else if ( aNamespace == aRootNode->DomNode()->Namespace() ) + { + // Namespace is defined and this node is in that namespace + // -> this is perfect match + aArray.Container().AppendL( aRootNode ); + } + } + + // Recurse children + RPointerArray< CXnNode >& children( aRootNode->Children() ); + + for ( TInt i = 0; i < children.Count(); i++ ) + { + FindNodeByClassL( children[i], aClassId, aArray, aNamespace ); + } + } + +// ----------------------------------------------------------------------------- +// FindNodeByIdL() +// Finds recursively a node from current view by id +// ----------------------------------------------------------------------------- +// +static CXnNode* FindNodeByIdL( CXnNode* aRootNode, const TDesC8& aAreaId, + const TDesC8& aNamespace ) + { + ASSERT( aRootNode ); + + if ( aNamespace != KNullDesC8 && aNamespace != aRootNode->Namespace() ) + { + // Recursed to wrong namespace + return NULL; + } + + CXnProperty* prop( aRootNode->IdL() ); + + if ( prop && prop->StringValue() == aAreaId ) + { + // Correct id found + if ( aNamespace == KNullDesC8 ) + { + // No namespace defined, so this is the first found best match + return aRootNode; + } + else if ( aNamespace == aRootNode->DomNode()->Namespace() ) + { + // Namespace is defined and this node is in that namespace + // -> this is perfect match + return aRootNode; + } + } + + // No match found, recurse children + RPointerArray< CXnNode >& children( aRootNode->Children() ); + + for ( TInt i = 0; i < children.Count(); i++ ) + { + CXnNode* retval( FindNodeByIdL( children[i], aAreaId, aNamespace ) ); + + if ( retval ) + { + return retval; + } + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// AutoStaticVerticalBTL() +// Calculate properties set to AUTO when positioning is static, layout vertical +// and direction right-to-left +// ----------------------------------------------------------------------------- +// +static TSize AutoStaticBTL( CXnNode& aNode, TInt aWidthToFit, TInt aHeightToFit, + RArray< TPtrC8 >& aAutoProperties, TRect& aParentRect, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + // Static positioning, vertical, right to left + TBool horizontalMarginProcessed = EFalse; + TBool verticalMarginProcessed = EFalse; + TBool allVerticalValuesProcessed = EFalse; + TBool allHorizontalValuesProcessed = EFalse; + + CXnProperty* maxHeightProperty = aNode.MaxHeightL(); + CXnProperty* maxWidthProperty = aNode.MaxWidthL(); + CXnProperty* minHeightProperty = aNode.MinHeightL(); + CXnProperty* minWidthProperty = aNode.MinWidthL(); + + TRect contentRect( aNode.Rect() ); + TRect paddingRect( aNode.PaddingRect() ); + TRect borderRect( aNode.BorderRect() ); + TRect marginRect( aNode.MarginRect() ); + TRect normalFlowBorderRect( aNode.NormalFlowBorderRect() ); + + TSize size = CalculateTotalDimensionsL( aNode, EFalse, ETrue, aParentRect, + aGraphicsDevice, aHorizontalUnitInPixels, aVerticalUnitInPixels ); + + for ( TInt i = 0; i < aAutoProperties.Count(); i++ ) + { + // search for height property + const TDesC8& attributeName = aAutoProperties[i]; + if ( attributeName == XnPropertyNames::style::common::KHeight ) + { + // height was AUTO, all other vertical auto values are 0 + TInt newHeight = aHeightToFit - size.iHeight; + + // Calculate the difference so that it can be returned + TRect paddingRectDiff( SubtractRect( paddingRect, contentRect ) ); + TRect borderRectDiff( SubtractRect( borderRect, contentRect ) ); + TRect marginRectDiff( SubtractRect( marginRect, contentRect ) ); + TRect normalFlowBorderRectDiff( SubtractRect ( normalFlowBorderRect, + contentRect ) ); + + // grow height to fill the void + contentRect.SetHeight( newHeight ); + paddingRect = AddRect( contentRect, paddingRectDiff ); + borderRect = AddRect( contentRect, borderRectDiff ); + normalFlowBorderRect = AddRect( contentRect, + normalFlowBorderRectDiff ); + marginRect = AddRect( contentRect, marginRectDiff ); + + size = TSize( size.iWidth, aHeightToFit ); + } + } + + // if exactly one value is AUTO, value is computed to make equality true + if ( aAutoProperties.Count() == 1 ) + { + if ( !allHorizontalValuesProcessed ) + { + const TDesC8& attributeName = aAutoProperties[0]; + if ( attributeName == XnPropertyNames::style::common::KWidth ) + { + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // Calculate the difference so that it can be returned + TRect paddingRectDiff( SubtractRect( paddingRect, + contentRect ) ); + TRect borderRectDiff( SubtractRect( borderRect, + contentRect ) ); + TRect marginRectDiff( SubtractRect( marginRect, + contentRect ) ); + TRect normalFlowBorderRectDiff( SubtractRect( + normalFlowBorderRect, contentRect ) ); + + // grow width to fill the void + contentRect.SetWidth( remainingWidth ); + paddingRect = AddRect( contentRect, paddingRectDiff ); + borderRect = AddRect( contentRect, borderRectDiff ); + normalFlowBorderRect = AddRect( contentRect, + normalFlowBorderRectDiff ); + marginRect = AddRect( contentRect, marginRectDiff ); + + size = TSize( aWidthToFit, size.iHeight ); + } + + if ( attributeName == + XnPropertyNames::style::common::KMarginLeft ) + { + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + contentRect.Move( remainingWidth, 0 ); + borderRect.Move( remainingWidth, 0 ); + normalFlowBorderRect.Move( remainingWidth, 0 ); + marginRect.Resize( remainingWidth, 0 ); + paddingRect.Move( remainingWidth, 0 ); + size = TSize( size.iWidth + remainingWidth, size.iHeight ); + } + + if ( attributeName == XnPropertyNames::style::common::KMarginRight ) + { + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + marginRect.Resize( remainingWidth, 0 ); + size = TSize( size.iWidth + remainingWidth, size.iHeight ); + } + + if ( attributeName == XnPropertyNames::style::common::KMarginTop ) + { + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + marginRect.Resize( 0, remainingHeight ); + marginRect.Move( 0, -remainingHeight ); + size = TSize( size.iWidth, size.iHeight + remainingHeight ); + } + + if ( attributeName == + XnPropertyNames::style::common::KMarginBottom ) + { + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + marginRect.Resize( 0, remainingHeight ); + marginRect.Move( 0, -remainingHeight ); + paddingRect.Move( 0, -remainingHeight ); + borderRect.Move( 0, -remainingHeight ); + normalFlowBorderRect.Move( 0, -remainingHeight ); + contentRect.Move( 0, -remainingHeight ); + size = TSize( size.iWidth, size.iHeight + remainingHeight ); + } + } + } + else + { + for ( TInt i = 0; i < aAutoProperties.Count(); i++ ) + { + const TDesC8& attributeName = aAutoProperties[i]; + if ( attributeName == XnPropertyNames::style::common::KWidth ) + { + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // Calculate the difference so that it can be returned + TRect paddingRectDiff( SubtractRect( + paddingRect, contentRect ) ); + TRect borderRectDiff( SubtractRect( + borderRect, contentRect ) ); + TRect marginRectDiff( SubtractRect( + marginRect, contentRect ) ); + TRect normalFlowBorderRectDiff( SubtractRect( + normalFlowBorderRect, contentRect ) ); + + // grow width to fill the void + contentRect.SetWidth( remainingWidth ); + paddingRect = AddRect( contentRect, paddingRectDiff ); + borderRect = AddRect( contentRect, borderRectDiff ); + normalFlowBorderRect = AddRect( + contentRect, normalFlowBorderRectDiff ); + marginRect = AddRect( contentRect, marginRectDiff ); + + size = TSize( aWidthToFit, size.iHeight ); + } + + // several auto properties + if ( attributeName == XnPropertyNames::style::common::KMarginLeft ) + { + if ( !horizontalMarginProcessed ) + { + // is right margin also set to AUTO? + CXnProperty* rightMargin = aNode.MarginRightL(); + if ( rightMargin ) + { + if ( IsPropertyAutoL( *rightMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // move rect right to fill the void + contentRect.Move( ( remainingWidth / 2 ), 0 ); + marginRect.Resize( remainingWidth, 0 ); + borderRect.Move( ( remainingWidth / 2 ), 0 ); + normalFlowBorderRect.Move( ( + remainingWidth / 2 ), 0 ); + paddingRect.Move( remainingWidth / 2, 0 ); + horizontalMarginProcessed = ETrue; + size = TSize( size.iWidth + remainingWidth, + size.iHeight ); + } + else + { + // only left margin set to AUTO + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // move rect right to fill the void + contentRect.Move( ( remainingWidth ), 0 ); + marginRect.Resize( remainingWidth, 0 ); + borderRect.Move( remainingWidth, 0 ); + normalFlowBorderRect.Move( remainingWidth, 0 ); + paddingRect.Move( remainingWidth, 0 ); + horizontalMarginProcessed = ETrue; + size = TSize( size.iWidth + remainingWidth, + size.iHeight ); + } + } + } + } + if ( attributeName == XnPropertyNames::style::common::KMarginRight ) + { + if ( !horizontalMarginProcessed ) + { + // is left margin also set to AUTO? + CXnProperty* leftMargin = aNode.MarginLeftL(); + if ( leftMargin ) + { + if ( IsPropertyAutoL( *leftMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + contentRect.Move( remainingWidth / 2, 0 ); + marginRect.Resize( remainingWidth, 0 ); + borderRect.Move( ( remainingWidth / 2 ), 0 ); + normalFlowBorderRect.Move( ( + remainingWidth / 2 ), 0 ); + paddingRect.Move( remainingWidth / 2, 0 ); + horizontalMarginProcessed = ETrue; + size = TSize( size.iWidth + remainingWidth, + size.iHeight ); + } + else + { + // only right margin set to AUTO + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + marginRect.Resize( remainingWidth, 0 ); + horizontalMarginProcessed = ETrue; + size = TSize( size.iWidth + remainingWidth, + size.iHeight ); + } + } + } + } + if ( attributeName == XnPropertyNames::style::common::KMarginTop ) + { + if ( !verticalMarginProcessed && + !allVerticalValuesProcessed ) + { + // is bottom margin also set to AUTO? + CXnProperty* bottomMargin = aNode.MarginBottomL(); + if ( bottomMargin ) + { + if ( IsPropertyAutoL( *bottomMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + contentRect.Move( 0, remainingHeight / 2 ); + marginRect.Resize( 0, remainingHeight ); + borderRect.Move( 0, ( remainingHeight / 2 ) ); + normalFlowBorderRect.Move( + 0, ( remainingHeight / 2 ) ); + paddingRect.Move( 0, remainingHeight / 2 ); + verticalMarginProcessed = ETrue; + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + else + { + // only top margin set to AUTO + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + marginRect.Resize( 0, remainingHeight ); + marginRect.Move( 0, -remainingHeight ); + verticalMarginProcessed = ETrue; + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + } + } + } + if ( attributeName == + XnPropertyNames::style::common::KMarginBottom ) + { + if ( !verticalMarginProcessed && !allVerticalValuesProcessed ) + { + // is top margin also set to AUTO? + CXnProperty* topMargin = aNode.MarginTopL(); + if ( topMargin ) + { + if ( IsPropertyAutoL( *topMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + contentRect.Move( 0, -( remainingHeight / 2 ) ); + marginRect.Resize( 0, remainingHeight ); + marginRect.Move( 0, -remainingHeight ); + borderRect.Move( 0, -( remainingHeight / 2 ) ); + normalFlowBorderRect.Move( + 0, -( remainingHeight / 2 ) ); + paddingRect.Move( 0, -( remainingHeight / 2 ) ); + verticalMarginProcessed = ETrue; + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + else + { + // only bottom margin set to AUTO + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + contentRect.Move( 0, -remainingHeight ); + marginRect.Resize( 0, remainingHeight ); + marginRect.Move( 0, -remainingHeight ); + borderRect.Move( 0, -remainingHeight ); + normalFlowBorderRect.Move( + 0, -remainingHeight ); + paddingRect.Move( 0, -remainingHeight ); + verticalMarginProcessed = ETrue; + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + } + } + } + } + } + aNode.SetRect( contentRect ); + aNode.SetPaddingRect( paddingRect ); + aNode.SetBorderRect( borderRect ); + aNode.SetMarginRect( marginRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + return contentRect.Size(); + } + +// ----------------------------------------------------------------------------- +// AutoStaticLRL() +// Calculate properties set to AUTO when positioning is static, +// layout horizontal +// and direction left-to-right +// ----------------------------------------------------------------------------- +// +static TSize AutoStaticLRL( CXnNode& aNode, TInt aWidthToFit, TInt aHeightToFit, + RArray< TPtrC8 >& aAutoProperties, TRect& aParentRect, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + // Static positioning, horizontal, left to right + TBool horizontalMarginProcessed = EFalse; + TBool verticalMarginProcessed = EFalse; + TBool allVerticalValuesProcessed = EFalse; + TBool allHorizontalValuesProcessed = EFalse; + + CXnProperty* maxHeightProperty = aNode.MaxHeightL(); + CXnProperty* maxWidthProperty = aNode.MaxWidthL(); + CXnProperty* minHeightProperty = aNode.MinHeightL(); + CXnProperty* minWidthProperty = aNode.MinWidthL(); + + TRect contentRect = aNode.Rect(); + TRect paddingRect = aNode.PaddingRect(); + TRect borderRect = aNode.BorderRect(); + TRect marginRect = aNode.MarginRect(); + TRect normalFlowBorderRect = aNode.NormalFlowBorderRect(); + TSize size = CalculateTotalDimensionsL( aNode, EFalse, ETrue, aParentRect, + aGraphicsDevice, aHorizontalUnitInPixels, aVerticalUnitInPixels ); + + for ( TInt i = 0; i < aAutoProperties.Count(); i++ ) + { + // search for width property + const TDesC8& attributeName = aAutoProperties[i]; + if ( attributeName == XnPropertyNames::style::common::KWidth ) + { + // width was AUTO, all other vertical auto values are 0 + TInt newWidth = aWidthToFit - size.iWidth; + + // Calculate the difference so that it can be returned + TRect paddingRectDiff( SubtractRect( paddingRect, contentRect ) ); + TRect borderRectDiff( SubtractRect( borderRect, contentRect ) ); + TRect marginRectDiff( SubtractRect( marginRect, contentRect ) ); + TRect normalFlowBorderRectDiff( SubtractRect( normalFlowBorderRect, + contentRect ) ); + + // grow width to fill the void + contentRect.SetWidth( newWidth ); + paddingRect = AddRect( contentRect, paddingRectDiff ); + borderRect = AddRect( contentRect, borderRectDiff ); + normalFlowBorderRect = AddRect( + contentRect, normalFlowBorderRectDiff ); + marginRect = AddRect( contentRect, marginRectDiff ); + + size = TSize( aWidthToFit, size.iHeight ); + allHorizontalValuesProcessed = ETrue; + } + } + + // if exactly one value is AUTO, value is computed to make equality true + if ( aAutoProperties.Count() == 1 ) + { + if ( !allHorizontalValuesProcessed ) + { + const TDesC8& attributeName = aAutoProperties[0]; + if ( attributeName == XnPropertyNames::style::common::KHeight ) + { + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // Calculate the difference so that it can be returned + TRect paddingRectDiff( SubtractRect( + paddingRect, contentRect ) ); + TRect borderRectDiff( SubtractRect( + borderRect, contentRect ) ); + TRect marginRectDiff( SubtractRect( + marginRect, contentRect ) ); + TRect normalFlowBorderRectDiff( SubtractRect( + normalFlowBorderRect, contentRect ) ); + + // grow height to fill the void + contentRect.SetHeight( remainingHeight ); + paddingRect = AddRect( contentRect, paddingRectDiff ); + borderRect = AddRect( contentRect, borderRectDiff ); + normalFlowBorderRect = AddRect( + contentRect, normalFlowBorderRectDiff ); + marginRect = AddRect( contentRect, marginRectDiff ); + size = TSize( size.iWidth, aHeightToFit ); + } + + if ( attributeName == XnPropertyNames::style::common::KMarginLeft ) + { + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // move rect right to fill the void + contentRect.Move( remainingWidth, 0 ); + paddingRect.Move( remainingWidth, 0 ); + borderRect.Move( remainingWidth, 0 ); + normalFlowBorderRect.Move( remainingWidth, 0 ); + marginRect.Resize( remainingWidth, 0 ); + size = TSize( size.iWidth + remainingWidth, size.iHeight ); + } + + if ( attributeName == XnPropertyNames::style::common::KMarginRight ) + { + TInt remainingWidth = aWidthToFit - size.iWidth; + marginRect.Resize( remainingWidth, 0 ); + size = TSize( size.iWidth + remainingWidth, size.iHeight ); + } + + if ( attributeName == XnPropertyNames::style::common::KMarginTop ) + { + TInt remainingHeight = aHeightToFit - size.iHeight; + // move rect right to fill the void + contentRect.Move( 0, remainingHeight / 2 ); + paddingRect.Move( 0, remainingHeight / 2 ); + borderRect.Move( 0, remainingHeight / 2 ); + normalFlowBorderRect.Move( 0, remainingHeight / 2 ); + marginRect.Resize( 0, remainingHeight ); + size = TSize( size.iWidth, size.iHeight + remainingHeight ); + } + + if ( attributeName == + XnPropertyNames::style::common::KMarginBottom ) + { + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + marginRect.Resize( 0, remainingHeight ); + size = TSize( size.iWidth, size.iHeight + remainingHeight ); + } + } + } + else + { + for ( TInt i = 0; i < aAutoProperties.Count(); i++ ) + { + const TDesC8& attributeName = aAutoProperties[i]; + if ( attributeName == XnPropertyNames::style::common::KHeight ) + { + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // Calculate the difference so that it can be returned + TRect paddingRectDiff( SubtractRect( + paddingRect, contentRect ) ); + TRect borderRectDiff( SubtractRect( + borderRect, contentRect ) ); + TRect marginRectDiff( SubtractRect( + marginRect, contentRect ) ); + TRect normalFlowBorderRectDiff( SubtractRect( + normalFlowBorderRect, contentRect ) ); + + // grow height to fill the void + contentRect.SetHeight( remainingHeight ); + paddingRect = AddRect( contentRect, paddingRectDiff ); + borderRect = AddRect( contentRect, borderRectDiff ); + normalFlowBorderRect = AddRect( + contentRect, normalFlowBorderRectDiff ); + marginRect = AddRect( contentRect, marginRectDiff ); + size = TSize( size.iWidth, aHeightToFit ); + } + + // several auto properties + if ( attributeName == XnPropertyNames::style::common::KMarginLeft ) + { + if ( !horizontalMarginProcessed ) + { + // is right margin also set to AUTO? + CXnProperty* rightMargin = aNode.MarginRightL(); + if ( rightMargin ) + { + if ( IsPropertyAutoL( *rightMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // move rect right to fill the void + contentRect.Move( ( remainingWidth / 2 ), 0 ); + horizontalMarginProcessed = ETrue; + marginRect.Resize( ( remainingWidth ), 0 ); + borderRect.Move( ( remainingWidth / 2 ), 0 ); + normalFlowBorderRect.Move( ( + remainingWidth / 2 ), 0 ); + paddingRect.Move( ( remainingWidth / 2 ), 0 ); + size = TSize( size.iWidth + remainingWidth, + size.iHeight ); + } + else + { + // only left margin set to AUTO + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // move rect right to fill the void + contentRect.Move( remainingWidth, 0 ); + horizontalMarginProcessed = ETrue; + marginRect.Move( remainingWidth, 0 ); + borderRect.Move( remainingWidth, 0 ); + normalFlowBorderRect.Move( remainingWidth, 0 ); + paddingRect.Move( remainingWidth, 0 ); + size = TSize( size.iWidth + remainingWidth, + size.iHeight ); + } + } + } + } + + if ( attributeName == XnPropertyNames::style::common::KMarginRight ) + { + if ( !horizontalMarginProcessed ) + { + // is left margin also set to AUTO? + CXnProperty* leftMargin = aNode.MarginLeftL(); + if ( leftMargin ) + { + if ( IsPropertyAutoL( *leftMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // move rect right to fill the void + contentRect.Move( ( remainingWidth / 2 ), 0 ); + horizontalMarginProcessed = ETrue; + marginRect.Resize( ( remainingWidth ), 0 ); + borderRect.Move( ( remainingWidth / 2 ), 0 ); + normalFlowBorderRect.Move( ( + remainingWidth / 2 ), 0 ); + paddingRect.Move( ( remainingWidth / 2 ), 0 ); + size = TSize( size.iWidth + remainingWidth, + size.iHeight ); + } + else + { + // only right margin set to AUTO + horizontalMarginProcessed = ETrue; + } + } + } + } + if ( attributeName == XnPropertyNames::style::common::KMarginTop ) + { + if ( !verticalMarginProcessed && !allVerticalValuesProcessed ) + { + // is bottom margin also set to AUTO? + CXnProperty* bottomMargin = aNode.MarginBottomL(); + if ( bottomMargin ) + { + if ( IsPropertyAutoL( *bottomMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // move rect right to fill the void + contentRect.Move( 0, ( remainingHeight / 2 ) ); + verticalMarginProcessed = ETrue; + marginRect.Resize( 0, remainingHeight ); + borderRect.Move( 0, ( remainingHeight / 2 ) ); + normalFlowBorderRect.Move( + 0, ( remainingHeight / 2 ) ); + paddingRect.Move( 0, ( remainingHeight / 2 ) ); + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + else + { + // only top margin set to AUTO + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // move rect right to fill the void + contentRect.Move( 0, remainingHeight ); + verticalMarginProcessed = ETrue; + marginRect.Resize( 0, remainingHeight ); + borderRect.Move( 0, remainingHeight ); + normalFlowBorderRect.Move( 0, remainingHeight ); + paddingRect.Move( 0, remainingHeight ); + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + } + } + } + + if ( attributeName == + XnPropertyNames::style::common::KMarginBottom ) + { + if ( !verticalMarginProcessed && !allVerticalValuesProcessed ) + { + // is top margin also set to AUTO? + CXnProperty* topMargin = aNode.MarginTopL(); + if ( topMargin ) + { + if ( IsPropertyAutoL( *topMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // move rect right to fill the void + contentRect.Move( 0, remainingHeight / 2 ); + verticalMarginProcessed = ETrue; + marginRect.Resize( 0, remainingHeight ); + borderRect.Move( 0, remainingHeight / 2 ); + normalFlowBorderRect.Move( + 0, remainingHeight / 2 ); + paddingRect.Move( 0, remainingHeight / 2 ); + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + else + { + // only bottom margin set to AUTO + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + marginRect.Resize( 0, remainingHeight ); + verticalMarginProcessed = ETrue; + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + } + } + } + } + } + aNode.SetRect( contentRect ); + aNode.SetPaddingRect( paddingRect ); + aNode.SetBorderRect( borderRect ); + aNode.SetMarginRect( marginRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + return contentRect.Size(); + } + +// ----------------------------------------------------------------------------- +// AutoStaticRLL() +// Calculate properties set to AUTO when positioning is static, +// layout horizontal +// and direction right-to-left. +// ----------------------------------------------------------------------------- +// +static TSize AutoStaticRLL( CXnNode& aNode, TInt aWidthToFit, + TInt aHeightToFit, RArray< TPtrC8 >& aAutoProperties, TRect& aParentRect, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + // Static positioning, horizontal, right to left + TBool horizontalMarginProcessed = EFalse; + TBool verticalMarginProcessed = EFalse; + TBool allVerticalValuesProcessed = EFalse; + TBool allHorizontalValuesProcessed = EFalse; + + CXnProperty* maxHeightProperty = aNode.MaxHeightL(); + CXnProperty* maxWidthProperty = aNode.MaxWidthL(); + CXnProperty* minHeightProperty = aNode.MinHeightL(); + CXnProperty* minWidthProperty = aNode.MinWidthL(); + + TRect contentRect( aNode.Rect() ); + TRect paddingRect( aNode.PaddingRect() ); + TRect borderRect( aNode.BorderRect() ); + TRect marginRect( aNode.MarginRect() ); + TRect normalFlowBorderRect( aNode.NormalFlowBorderRect() ); + + TSize size = CalculateTotalDimensionsL( aNode, EFalse, ETrue, aParentRect, + aGraphicsDevice, aHorizontalUnitInPixels, aVerticalUnitInPixels ); + + for ( TInt i = 0; i < aAutoProperties.Count(); i++ ) + { + // search for height property + const TDesC8& attributeName = aAutoProperties[i]; + if ( attributeName == XnPropertyNames::style::common::KWidth ) + { + TInt newWidth = aWidthToFit - size.iWidth; + + // Calculate the difference so that it can be returned + TRect paddingRectDiff( SubtractRect( paddingRect, contentRect ) ); + TRect borderRectDiff( SubtractRect( borderRect, contentRect ) ); + TRect marginRectDiff( SubtractRect( marginRect, contentRect ) ); + TRect normalFlowBorderRectDiff( SubtractRect( normalFlowBorderRect, + contentRect ) ); + + // grow width to fill the void + contentRect.SetWidth( newWidth ); + paddingRect = AddRect( contentRect, paddingRectDiff ); + borderRect = AddRect( contentRect, borderRectDiff ); + normalFlowBorderRect = AddRect( contentRect, + normalFlowBorderRectDiff ); + marginRect = AddRect( contentRect, marginRectDiff ); + + size = TSize( aWidthToFit, size.iHeight ); + allHorizontalValuesProcessed = ETrue; + } + } + + // if exactly one value is AUTO, value is computed to make equality true + if ( aAutoProperties.Count() == 1 ) + { + if ( !allHorizontalValuesProcessed ) + { + const TDesC8& attributeName = aAutoProperties[0]; + if ( attributeName == XnPropertyNames::style::common::KHeight ) + { + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // Calculate the difference so that it can be returned + TRect paddingRectDiff( SubtractRect( + paddingRect, contentRect ) ); + TRect borderRectDiff( SubtractRect( borderRect, contentRect ) ); + TRect marginRectDiff( SubtractRect( marginRect, contentRect ) ); + TRect normalFlowBorderRectDiff( SubtractRect( + normalFlowBorderRect, contentRect ) ); + + // grow height to fill the void + contentRect.SetHeight( remainingHeight ); + paddingRect = AddRect( contentRect, paddingRectDiff ); + borderRect = AddRect( contentRect, borderRectDiff ); + normalFlowBorderRect = AddRect( contentRect, + normalFlowBorderRectDiff ); + marginRect = AddRect( contentRect, marginRectDiff ); + + size = TSize( size.iWidth, aHeightToFit ); + } + + if ( attributeName == XnPropertyNames::style::common::KMarginLeft ) + { + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // move rect right to fill the void + contentRect.Move( remainingWidth, 0 ); + paddingRect.Move( remainingWidth, 0 ); + borderRect.Move( remainingWidth, 0 ); + normalFlowBorderRect.Move( remainingWidth, 0 ); + marginRect.Resize( remainingWidth, 0 ); + marginRect.Move( -remainingWidth, 0 ); + size = TSize( size.iWidth + remainingWidth, size.iHeight ); + } + + if ( attributeName == XnPropertyNames::style::common::KMarginRight ) + { + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + contentRect.Move( -remainingWidth, 0 ); + paddingRect.Move( -remainingWidth, 0 ); + borderRect.Move( -remainingWidth, 0 ); + normalFlowBorderRect.Move( -remainingWidth, 0 ); + marginRect.Move( -remainingWidth, 0 ); + marginRect.Resize( remainingWidth, 0 ); + + size = TSize( size.iWidth + remainingWidth, size.iHeight ); + } + + if ( attributeName == XnPropertyNames::style::common::KMarginTop ) + { + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // move rect right to fill the void + contentRect.Move( 0, remainingHeight / 2 ); + paddingRect.Move( 0, remainingHeight / 2 ); + borderRect.Move( 0, remainingHeight / 2 ); + normalFlowBorderRect.Move( 0, remainingHeight / 2 ); + marginRect.Resize( 0, remainingHeight ); + size = TSize( size.iWidth, size.iHeight + remainingHeight ); + } + + if ( attributeName == + XnPropertyNames::style::common::KMarginBottom ) + { + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + marginRect.Resize( 0, remainingHeight ); + size = TSize( size.iWidth, size.iHeight + remainingHeight ); + } + } + } + else + { + for ( TInt i = 0; i < aAutoProperties.Count(); i++ ) + { + const TDesC8& attributeName = aAutoProperties[i]; + if ( attributeName == XnPropertyNames::style::common::KHeight ) + { + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // Calculate the difference so that it can be returned + TRect paddingRectDiff( SubtractRect( + paddingRect, contentRect ) ); + TRect borderRectDiff( SubtractRect( borderRect, contentRect ) ); + TRect marginRectDiff( SubtractRect( marginRect, contentRect ) ); + TRect normalFlowBorderRectDiff( SubtractRect( + normalFlowBorderRect, contentRect ) ); + + // grow height to fill the void + contentRect.SetHeight( remainingHeight ); + paddingRect = AddRect( contentRect, paddingRectDiff ); + borderRect = AddRect( contentRect, borderRectDiff ); + normalFlowBorderRect = AddRect( contentRect, + normalFlowBorderRectDiff ); + marginRect = AddRect( contentRect, marginRectDiff ); + + size = TSize( size.iWidth, size.iHeight + remainingHeight ); + } + + // several auto properties + if ( attributeName == XnPropertyNames::style::common::KMarginLeft ) + { + if ( !horizontalMarginProcessed ) + { + // is right margin also set to AUTO? + CXnProperty* rightMargin = aNode.MarginRightL(); + if ( rightMargin ) + { + if ( IsPropertyAutoL( *rightMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // move rect left + contentRect.Move( -( remainingWidth / 2 ), 0 ); + marginRect.Resize( remainingWidth, 0 ); + marginRect.Move( -remainingWidth, 0 ); + borderRect.Move( -( remainingWidth / 2 ), 0 ); + normalFlowBorderRect.Move( + -( remainingWidth / 2 ), 0 ); + paddingRect.Move( -( remainingWidth / 2 ), 0 ); + horizontalMarginProcessed = ETrue; + size = TSize( size.iWidth + remainingWidth, + size.iHeight ); + } + else + { + // only left margin set to AUTO + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // move rect left + contentRect.Move( ( remainingWidth ), 0 ); + marginRect.Resize( remainingWidth, 0 ); + marginRect.Move( remainingWidth, 0 ); + horizontalMarginProcessed = ETrue; + size = TSize( size.iWidth + remainingWidth, + size.iHeight ); + } + } + } + } + + if ( attributeName == XnPropertyNames::style::common::KMarginRight ) + { + if ( !horizontalMarginProcessed ) + { + // is left margin also set to AUTO? + CXnProperty* leftMargin = aNode.MarginLeftL(); + if ( leftMargin ) + { + if ( IsPropertyAutoL( *leftMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + contentRect.Move( -( remainingWidth / 2 ), 0 ); + marginRect.Resize( remainingWidth, 0 ); + marginRect.Move( -remainingWidth, 0 ); + borderRect.Move( -( remainingWidth / 2 ), 0 ); + normalFlowBorderRect.Move( + -( remainingWidth / 2 ), 0 ); + paddingRect.Move( -( remainingWidth / 2 ), 0 ); + horizontalMarginProcessed = ETrue; + size = TSize( size.iWidth + remainingWidth, + size.iHeight ); + } + else + { + // only right margin set to AUTO + TInt usedWidth = size.iWidth; + TInt remainingWidth = aWidthToFit - usedWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + contentRect.Move( -remainingWidth, 0 ); + marginRect.Resize( remainingWidth, 0 ); + marginRect.Move( -remainingWidth, 0 ); + borderRect.Move( -remainingWidth, 0 ); + normalFlowBorderRect.Move( -remainingWidth, 0 ); + paddingRect.Move( -remainingWidth, 0 ); + horizontalMarginProcessed = ETrue; + size = TSize( size.iWidth + remainingWidth, + size.iHeight ); + } + } + } + } + if ( attributeName == XnPropertyNames::style::common::KMarginTop ) + { + if ( !verticalMarginProcessed && !allVerticalValuesProcessed ) + { + // is bottom margin also set to AUTO? + CXnProperty* bottomMargin = aNode.MarginBottomL(); + if ( bottomMargin ) + { + if ( IsPropertyAutoL( *bottomMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + contentRect.Move( 0, ( remainingHeight / 2 ) ); + marginRect.Resize( 0, remainingHeight ); + borderRect.Move( 0, ( remainingHeight / 2 ) ); + normalFlowBorderRect.Move( + 0, ( remainingHeight / 2 ) ); + paddingRect.Move( 0, ( remainingHeight / 2 ) ); + verticalMarginProcessed = ETrue; + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + else + { + // only top margin set to AUTO + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + contentRect.Move( 0, remainingHeight ); + marginRect.Resize( 0, remainingHeight ); + borderRect.Move( 0, remainingHeight ); + normalFlowBorderRect.Move( 0, remainingHeight ); + paddingRect.Move( 0, remainingHeight ); + verticalMarginProcessed = ETrue; + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + } + } + } + + if ( attributeName == + XnPropertyNames::style::common::KMarginBottom ) + { + if ( !verticalMarginProcessed && !allVerticalValuesProcessed ) + { + // is top margin also set to AUTO? + CXnProperty* topMargin = aNode.MarginTopL(); + if ( topMargin ) + { + if ( IsPropertyAutoL( *topMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // move rect right to fill the void + contentRect.Move( 0, ( remainingHeight / 2 ) ); + marginRect.Resize( 0, remainingHeight ); + borderRect.Move( 0, ( remainingHeight / 2 ) ); + normalFlowBorderRect.Move( + 0, ( remainingHeight / 2 ) ); + paddingRect.Move( 0, ( remainingHeight / 2 ) ); + verticalMarginProcessed = ETrue; + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + else + { + // only bottom margin set to AUTO + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // move rect right to fill the void + marginRect.Resize( 0, remainingHeight ); + verticalMarginProcessed = ETrue; + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + } + } + } + } + } + aNode.SetRect( contentRect ); + aNode.SetPaddingRect( paddingRect ); + aNode.SetBorderRect( borderRect ); + aNode.SetMarginRect( marginRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + return contentRect.Size(); + } + +// ----------------------------------------------------------------------------- +// SubtractRect() +// Calculate the difference of two rectangles and return it as +// ----------------------------------------------------------------------------- +// +static TRect SubtractRect( const TRect& aOriginal, const TRect& aSubtracter ) + { + return TRect( aOriginal.iTl.iX - aSubtracter.iTl.iX, + aOriginal.iTl.iY - aSubtracter.iTl.iY, + aOriginal.iBr.iX - aSubtracter.iBr.iX, + aOriginal.iBr.iY - aSubtracter.iBr.iY ); + } + +// ----------------------------------------------------------------------------- +// AddRect() +// Add two rectangles together and return the result +// ----------------------------------------------------------------------------- +// +static TRect AddRect( const TRect& aOriginal, const TRect& aAdded ) + { + return TRect( aOriginal.iTl.iX + aAdded.iTl.iX, + aOriginal.iTl.iY + aAdded.iTl.iY, + aOriginal.iBr.iX + aAdded.iBr.iX, + aOriginal.iBr.iY + aAdded.iBr.iY ); + } + +// ----------------------------------------------------------------------------- +// AutoStaticTBL() +// Calculate properties set to AUTO when positioning is static, layout vertical +// and direction left-to-right +// ----------------------------------------------------------------------------- +// +static TSize AutoStaticTBL( CXnNode& aNode, TInt aWidthToFit, TInt aHeightToFit, + RArray< TPtrC8 >& aAutoProperties, TRect& aParentRect, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + // Static positioning, vertical, left to right + TBool horizontalMarginProcessed( EFalse ); + TBool verticalMarginProcessed( EFalse ); + TBool allVerticalValuesProcessed( EFalse ); + + TRect contentRect( aNode.Rect() ); + TRect paddingRect( aNode.PaddingRect() ); + TRect borderRect( aNode.BorderRect() ); + TRect marginRect( aNode.MarginRect() ); + TRect normalFlowBorderRect( aNode.NormalFlowBorderRect() ); + + TSize size( CalculateTotalDimensionsL( aNode, EFalse, ETrue, aParentRect, + aGraphicsDevice, aHorizontalUnitInPixels, aVerticalUnitInPixels ) ); + + for ( TInt i = 0; i < aAutoProperties.Count(); i++ ) + { + // search for height property + const TDesC8& attributeName = aAutoProperties[i]; + if ( attributeName == XnPropertyNames::style::common::KHeight ) + { + // Calculate the difference so that it can be returned + TRect paddingRectDiff( SubtractRect( paddingRect, contentRect ) ); + TRect borderRectDiff( SubtractRect( borderRect, contentRect ) ); + TRect marginRectDiff( SubtractRect( marginRect, contentRect ) ); + TRect normalFlowBorderRectDiff( SubtractRect( normalFlowBorderRect, + contentRect ) ); + + // grow height to fill the void + contentRect.SetHeight( aHeightToFit - size.iHeight ); + paddingRect = AddRect( contentRect, paddingRectDiff ); + borderRect = AddRect( contentRect, borderRectDiff ); + normalFlowBorderRect = AddRect( + contentRect, normalFlowBorderRectDiff ); + marginRect = AddRect( contentRect, marginRectDiff ); + size = TSize( size.iWidth, aHeightToFit ); + allVerticalValuesProcessed = ETrue; + } + } + + // if exactly one value is AUTO, value is computed to make equality true + if ( aAutoProperties.Count() == 1 ) + { + if ( !allVerticalValuesProcessed ) + { + const TDesC8& attributeName = aAutoProperties[0]; + if ( attributeName == XnPropertyNames::style::common::KWidth ) + { + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // Calculate the difference so that it can be returned + TRect paddingRectDiff( SubtractRect( + paddingRect, contentRect ) ); + TRect borderRectDiff( SubtractRect( borderRect, contentRect ) ); + TRect marginRectDiff( SubtractRect( marginRect, contentRect ) ); + TRect normalFlowBorderRectDiff( SubtractRect( + normalFlowBorderRect, contentRect ) ); + + // grow width to fill the void + contentRect.SetWidth( remainingWidth ); + paddingRect = AddRect( contentRect, paddingRectDiff ); + borderRect = AddRect( contentRect, borderRectDiff ); + normalFlowBorderRect = AddRect( contentRect, + normalFlowBorderRectDiff ); + marginRect = AddRect( contentRect, marginRectDiff ); + size = TSize( aWidthToFit, size.iHeight ); + } + + if ( attributeName == XnPropertyNames::style::common::KMarginLeft ) + { + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // move rect right to fill the void + contentRect.Move( remainingWidth, 0 ); + paddingRect.Move( remainingWidth, 0 ); + borderRect.Move( remainingWidth, 0 ); + normalFlowBorderRect.Move( remainingWidth, 0 ); + marginRect.Resize( remainingWidth, 0 ); + size = TSize( size.iWidth + remainingWidth, size.iHeight ); + } + + if ( attributeName == XnPropertyNames::style::common::KMarginRight ) + { + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + marginRect.Resize( remainingWidth, 0 ); + size = TSize( size.iWidth + remainingWidth, size.iHeight ); + } + + if ( attributeName == XnPropertyNames::style::common::KMarginTop ) + { + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // move rect right to fill the void + contentRect.Move( 0, remainingHeight / 2 ); + paddingRect.Move( 0, remainingHeight / 2 ); + borderRect.Move( 0, remainingHeight / 2 ); + normalFlowBorderRect.Move( 0, remainingHeight / 2 ); + marginRect.Resize( 0, remainingHeight ); + size = TSize( size.iWidth, size.iHeight + remainingHeight ); + } + + if ( attributeName == + XnPropertyNames::style::common::KMarginBottom ) + { + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // set margin rect + marginRect.Resize( 0, remainingHeight ); + size = TSize( size.iWidth, size.iHeight + remainingHeight ); + } + } + } + else + { + for ( TInt i = 0; i < aAutoProperties.Count(); i++ ) + { + const TDesC8& attributeName = aAutoProperties[i]; + if ( attributeName == XnPropertyNames::style::common::KWidth ) + { + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // Calculate the difference so that it can be returned + TRect paddingRectDiff( SubtractRect( + paddingRect, contentRect ) ); + TRect borderRectDiff( SubtractRect( borderRect, contentRect ) ); + TRect marginRectDiff( SubtractRect( marginRect, contentRect ) ); + TRect normalFlowBorderRectDiff( SubtractRect( + normalFlowBorderRect, contentRect ) ); + + // grow width to fill the void + contentRect.SetWidth( remainingWidth ); + paddingRect = AddRect( contentRect, paddingRectDiff ); + borderRect = AddRect( contentRect, borderRectDiff ); + normalFlowBorderRect = AddRect( contentRect, + normalFlowBorderRectDiff ); + marginRect = AddRect( contentRect, marginRectDiff ); + size = TSize( aWidthToFit, size.iHeight ); + } + + // several auto properties + if ( attributeName == XnPropertyNames::style::common::KMarginLeft ) + { + if ( !horizontalMarginProcessed ) + { + // is right margin also set to AUTO? + CXnProperty* rightMargin = aNode.MarginRightL(); + if ( rightMargin ) + { + if ( IsPropertyAutoL( *rightMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // move rect right to fill the void + contentRect.Move(( remainingWidth / 2 ), 0 ); + marginRect.Resize( remainingWidth, 0 ); + borderRect.Move( remainingWidth / 2, 0 ); + normalFlowBorderRect.Move( remainingWidth / 2, 0 ); + paddingRect.Move( remainingWidth / 2, 0 ); + horizontalMarginProcessed = ETrue; + size = TSize( size.iWidth + remainingWidth, + size.iHeight ); + } + else + { + // only left margin set to AUTO + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // move rect right to fill the void + contentRect.Move( remainingWidth, 0 ); + marginRect.Resize( remainingWidth, 0 ); + borderRect.Move( remainingWidth, 0 ); + normalFlowBorderRect.Move( remainingWidth, 0 ); + paddingRect.Move( remainingWidth, 0 ); + horizontalMarginProcessed = ETrue; + size = TSize( size.iWidth + remainingWidth, + size.iHeight ); + } + } + } + } + + if ( attributeName == XnPropertyNames::style::common::KMarginRight ) + { + if ( !horizontalMarginProcessed ) + { + // is left margin also set to AUTO? + CXnProperty* leftMargin = aNode.MarginLeftL(); + if ( leftMargin ) + { + if ( IsPropertyAutoL (*leftMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // move rect right to fill the void + contentRect.Move( remainingWidth / 2, 0 ); + marginRect.Resize( remainingWidth, 0 ); + borderRect.Move( remainingWidth / 2, 0 ); + normalFlowBorderRect.Move( remainingWidth / 2, 0 ); + paddingRect.Move( remainingWidth / 2, 0 ); + horizontalMarginProcessed = ETrue; + size = TSize( size.iWidth + remainingWidth, + size.iHeight ); + } + else + { + // only right margin set to AUTO + TInt remainingWidth = aWidthToFit - size.iWidth; + if ( remainingWidth < 0 ) + { + remainingWidth = 0; + } + // move rect right to fill the void + marginRect.Resize( remainingWidth, 0 ); + horizontalMarginProcessed = ETrue; + size = TSize( size.iWidth + remainingWidth, + size.iHeight ); + } + } + } + } + + if ( attributeName == XnPropertyNames::style::common::KMarginTop ) + { + if ( !verticalMarginProcessed && !allVerticalValuesProcessed ) + { + // is bottom margin also set to AUTO? + CXnProperty* bottomMargin = aNode.MarginBottomL(); + if ( bottomMargin ) + { + if ( IsPropertyAutoL( *bottomMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // move rect right to fill the void + contentRect.Move( 0, remainingHeight / 2 ); + marginRect.Resize( 0, remainingHeight ); + borderRect.Move( 0, remainingHeight / 2 ); + normalFlowBorderRect.Move( 0, remainingHeight / 2 ); + paddingRect.Move( 0, remainingHeight / 2 ); + verticalMarginProcessed = ETrue; + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + else + { + // only top margin set to AUTO + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // move rect right to fill the void + contentRect.Move( 0, remainingHeight ); + marginRect.Resize( 0, remainingHeight ); + borderRect.Move( 0, remainingHeight ); + normalFlowBorderRect.Move( 0, remainingHeight ); + paddingRect.Move( 0, remainingHeight ); + verticalMarginProcessed = ETrue; + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + } + } + } + + if ( attributeName == + XnPropertyNames::style::common::KMarginBottom ) + { + if ( !verticalMarginProcessed && !allVerticalValuesProcessed ) + { + // is top margin also set to AUTO? + CXnProperty* topMargin = aNode.MarginTopL(); + if ( topMargin ) + { + if ( IsPropertyAutoL( *topMargin ) ) + { + // both margins set to AUTO, values equal + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // move rect right to fill the void + TRect normalFlowBorderRect( + aNode.NormalFlowBorderRect() ); + contentRect.Move( 0, remainingHeight / 2 ); + marginRect.Resize( 0, remainingHeight ); + borderRect.Move( 0, remainingHeight / 2 ); + normalFlowBorderRect.Move( 0, remainingHeight / 2 ); + paddingRect.Move( 0, remainingHeight / 2 ); + verticalMarginProcessed = ETrue; + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + else + { + // only bottom margin set to AUTO + TInt remainingHeight = aHeightToFit - size.iHeight; + if ( remainingHeight < 0 ) + { + remainingHeight = 0; + } + // move rect right to fill the void + marginRect.Resize( 0, remainingHeight ); + verticalMarginProcessed = ETrue; + size = TSize( size.iWidth, + size.iHeight + remainingHeight ); + } + } + } + } + } + } + aNode.SetRect( contentRect ); + aNode.SetPaddingRect( paddingRect ); + aNode.SetBorderRect( borderRect ); + aNode.SetMarginRect( marginRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + return contentRect.Size(); + } + +// ----------------------------------------------------------------------------- +// CalculateAbsolutePositionsL() +// Move the rect by it's absolute positioning. +// ----------------------------------------------------------------------------- +// +static void CalculateAbsolutePositionsL( CXnNode& aNode, TRect& aParentRect, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + CXnProperty* topProperty = aNode.TopL(); + CXnProperty* bottomProperty = aNode.BottomL(); + CXnProperty* leftProperty = aNode.LeftL(); + CXnProperty* rightProperty = aNode.RightL(); + + TBool verticalValuesProcessed = EFalse; + TBool horizontalValuesProcessed = EFalse; + + TInt top = 0; + TInt bottom = 0; + TInt left = 0; + TInt right = 0; + + TRect contentRect( aNode.Rect() ); + TRect paddingRect( aNode.PaddingRect() ); + TRect borderRect( aNode.BorderRect() ); + TRect marginRect( aNode.MarginRect() ); + + if ( HasNodeAutoValuesL( aNode ) ) + { + CXnProperty* marginTopProperty = aNode.MarginTopL(); + CXnProperty* marginBottomProperty = aNode.MarginBottomL(); + CXnProperty* marginLeftProperty = aNode.MarginLeftL(); + CXnProperty* marginRightProperty = aNode.MarginRightL(); + CXnProperty* heightProperty = aNode.HeightL(); + CXnProperty* widthProperty = aNode.WidthL(); + CXnProperty* maxHeightProperty = aNode.MaxHeightL(); + CXnProperty* maxWidthProperty = aNode.MaxWidthL(); + CXnProperty* minHeightProperty = aNode.MinHeightL(); + CXnProperty* minWidthProperty = aNode.MinWidthL(); + + // move auto value node to it's parent's top left corner + TInt offsetx = 0; + TInt offsety = 0; + + offsetx = aParentRect.iTl.iX - marginRect.iTl.iX; + offsety = aParentRect.iTl.iY - marginRect.iTl.iY; + + contentRect.Move( offsetx, offsety ); + paddingRect.Move( offsetx, offsety ); + borderRect.Move( offsetx, offsety ); + marginRect.Move( offsetx, offsety ); + + // get values + if ( topProperty && !IsPropertyAutoL( *topProperty ) && + !IsPropertyNone( *topProperty ) ) + { + top = VerticalPixelValueL( topProperty, aParentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ); + } + if ( bottomProperty && !IsPropertyAutoL( *bottomProperty ) && + !IsPropertyNone( *bottomProperty ) ) + { + bottom = VerticalPixelValueL( bottomProperty, aParentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ); + } + if ( leftProperty && !IsPropertyAutoL( *leftProperty ) && + !IsPropertyNone( *leftProperty ) ) + { + left = HorizontalPixelValueL( leftProperty, aParentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ); + } + if ( rightProperty && !IsPropertyAutoL( *rightProperty ) && + !IsPropertyNone( *rightProperty ) ) + { + right = HorizontalPixelValueL( rightProperty, aParentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ); + } + // node has auto values + TSize spaceUsed( CalculateTotalDimensionsL( aNode, EFalse, EFalse, + aParentRect, aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ) ); + TInt heightToUse = + aParentRect.Height() - spaceUsed.iHeight - top - bottom; + TInt widthToUse = + aParentRect.Width() - spaceUsed.iWidth - left - right; + + if ( heightToUse < 0 ) + { + heightToUse = 0; + } + if ( widthToUse < 0 ) + { + widthToUse = 0; + } + // vertical auto values + // (margin top, margin bottom, height, top, bottom) + if ( IsPropertyAutoL( *heightProperty ) ) + { + contentRect.Resize( 0, heightToUse ); + paddingRect.Resize( 0, heightToUse ); + borderRect.Resize( 0, heightToUse ); + marginRect.Resize( 0, heightToUse ); + + if ( IsLargerThanMaxSizeL( aParentRect, aNode, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ) ) + { + if ( !IsPropertyNone( *maxHeightProperty ) ) + { + TInt maxheight = HorizontalPixelValueL( maxHeightProperty, + aParentRect.Height(), aGraphicsDevice, + aHorizontalUnitInPixels ); + if ( maxheight < contentRect.Height() ) + { + TInt excessheight = contentRect.Height() - maxheight; + contentRect.Resize( 0, -excessheight ); + paddingRect.Resize( 0, -excessheight ); + borderRect.Resize( 0, -excessheight ); + marginRect.Resize( 0, -excessheight ); + } + } + } + if ( IsSmallerThanMinSizeL( aParentRect, aNode, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ) ) + { + if ( !IsPropertyNone( *minHeightProperty ) ) + { + TInt minheight = HorizontalPixelValueL( minHeightProperty, + aParentRect.Height(), aGraphicsDevice, + aHorizontalUnitInPixels ); + if ( minheight > contentRect.Height() ) + { + TInt missingheight = minheight - contentRect.Height(); + contentRect.Resize( 0, missingheight ); + paddingRect.Resize( 0, missingheight ); + borderRect.Resize( 0, missingheight ); + marginRect.Resize( 0, missingheight ); + } + } + } + verticalValuesProcessed = ETrue; + } + + if ( !verticalValuesProcessed ) + { + if ( IsPropertyAutoL( *topProperty ) && + IsPropertyAutoL( *bottomProperty ) ) + { + // move the box down + contentRect.Move( 0, heightToUse / 2 ); + paddingRect.Move( 0, heightToUse / 2 ); + borderRect.Move( 0, heightToUse / 2 ); + marginRect.Move( 0, heightToUse / 2 ); + } + if ( IsPropertyAutoL( *topProperty ) && + !IsPropertyAutoL( *bottomProperty ) ) + { + // move the box down + contentRect.Move( 0, heightToUse ); + paddingRect.Move( 0, heightToUse ); + borderRect.Move( 0, heightToUse ); + marginRect.Move( 0, heightToUse ); + } + if ( IsPropertyAutoL( *marginTopProperty ) && + IsPropertyAutoL( *marginBottomProperty ) ) + { + // both margins auto, equal values + marginRect.Resize( 0, heightToUse ); + paddingRect.Move( 0, heightToUse / 2 ); + borderRect.Move( 0, heightToUse / 2 ); + contentRect.Move( 0, heightToUse / 2 ); + } + if ( !IsPropertyAutoL( *marginTopProperty ) && + IsPropertyAutoL( *marginBottomProperty ) ) + { + // only top margin auto + marginRect.Resize( 0, heightToUse ); + paddingRect.Move( 0, heightToUse ); + borderRect.Move( 0, heightToUse ); + contentRect.Move( 0, heightToUse ); + } + if ( IsPropertyAutoL( *marginTopProperty ) && + !IsPropertyAutoL( *marginBottomProperty ) ) + { + // only bottom margin auto + marginRect.Resize( 0, heightToUse ); + } + } + + // horizontal auto values + // (margin left, margin right, width) + if ( IsPropertyAutoL( *widthProperty ) ) + { + contentRect.Resize( widthToUse, 0 ); + paddingRect.Resize( widthToUse, 0 );; + borderRect.Resize( widthToUse, 0 ); + marginRect.Resize( widthToUse, 0 ); + if ( IsLargerThanMaxSizeL( aParentRect, aNode, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ) ) + { + if ( !IsPropertyNone( *maxWidthProperty ) ) + { + TInt maxwidth = HorizontalPixelValueL( maxWidthProperty, + aParentRect.Width(), aGraphicsDevice, + aHorizontalUnitInPixels ); + if ( maxwidth < contentRect.Width() ) + { + TInt excesswidth = contentRect.Width() - maxwidth; + contentRect.Resize( -excesswidth, 0 ); + paddingRect.Resize( -excesswidth, 0 ); + borderRect.Resize( -excesswidth, 0 ); + marginRect.Resize( -excesswidth, 0 ); + } + } + } + if ( IsSmallerThanMinSizeL( aParentRect, aNode, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ) ) + { + if ( !IsPropertyNone( *minWidthProperty ) ) + { + TInt minwidth = HorizontalPixelValueL( minWidthProperty, + aParentRect.Width(), aGraphicsDevice, + aHorizontalUnitInPixels ); + if ( minwidth > contentRect.Width() ) + { + TInt missingwidth = minwidth - contentRect.Width(); + contentRect.Resize( missingwidth, 0 ); + paddingRect.Resize( missingwidth, 0 ); + borderRect.Resize( missingwidth, 0 ); + marginRect.Resize( missingwidth, 0 ); + } + } + } + horizontalValuesProcessed = ETrue; + } + if ( !horizontalValuesProcessed ) + { + if ( IsPropertyAutoL( *leftProperty ) && + IsPropertyAutoL( *rightProperty ) ) + { + // move the box left + contentRect.Move( widthToUse / 2, 0 ); + paddingRect.Move( widthToUse / 2, 0 ); + borderRect.Move( widthToUse / 2, 0 ); + marginRect.Move( widthToUse / 2, 0 ); + } + if ( IsPropertyAutoL( *leftProperty ) && + !IsPropertyAutoL( *rightProperty ) ) + { + // move the box left + contentRect.Move( widthToUse, 0 ); + paddingRect.Move( widthToUse, 0 ); + borderRect.Move( widthToUse, 0 ); + marginRect.Move( widthToUse, 0 ); + } + if ( IsPropertyAutoL( *marginLeftProperty ) && + IsPropertyAutoL( *marginRightProperty ) ) + { + // both margins auto, equal values + marginRect.Resize( widthToUse, 0 ); + paddingRect.Move( widthToUse / 2, 0 ); + borderRect.Move( widthToUse / 2, 0 ); + contentRect.Move( widthToUse / 2, 0 ); + } + if ( !IsPropertyAutoL( *marginLeftProperty ) && + IsPropertyAutoL( *marginRightProperty ) ) + { + // only right margin auto + marginRect.Resize( widthToUse, 0 ); + paddingRect.Move( widthToUse, 0 ); + borderRect.Move( widthToUse, 0 ); + contentRect.Move( widthToUse, 0 ); + } + if ( IsPropertyAutoL( *marginLeftProperty ) && + !IsPropertyAutoL( *marginRightProperty ) ) + { + // only left margin auto + marginRect.Resize( widthToUse, 0 ); + } + } + } + + // Move the rect to desired position + if ( topProperty ) + { + if ( !IsPropertyAutoL( *topProperty ) && + !IsPropertyNone( *topProperty ) ) + { + TInt y = VerticalPixelValueL( topProperty, aParentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ); + contentRect.Move( 0, y ); + paddingRect.Move( 0, y ); + borderRect.Move( 0, y ); + marginRect.Move( 0, y ); + } + } + if ( leftProperty ) + { + if ( !IsPropertyAutoL( *leftProperty ) && + !IsPropertyNone( *leftProperty ) ) + { + TInt x = HorizontalPixelValueL( leftProperty, aParentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ); + contentRect.Move( x, 0 ); + paddingRect.Move( x, 0 ); + borderRect.Move( x, 0 ); + marginRect.Move( x, 0 ); + } + } + if ( bottomProperty ) + { + if ( !IsPropertyAutoL( *bottomProperty ) && + !IsPropertyNone( *bottomProperty ) ) + { + TInt py = VerticalPixelValueL( bottomProperty, + aParentRect.Height(), aGraphicsDevice, aVerticalUnitInPixels ); + contentRect.Move( 0, -py ); + paddingRect.Move( 0, -py ); + borderRect.Move( 0, -py ); + marginRect.Move( 0, -py ); + } + } + if ( rightProperty ) + { + if ( !IsPropertyAutoL( *rightProperty ) && + !IsPropertyNone( *rightProperty ) ) + { + TInt px = HorizontalPixelValueL( rightProperty, + aParentRect.Width(), aGraphicsDevice, aHorizontalUnitInPixels ); + contentRect.Move( -px, 0 ); + paddingRect.Move( -px, 0 ); + borderRect.Move( -px, 0 ); + marginRect.Move( -px, 0 ); + } + } + + aNode.SetRect( contentRect ); + aNode.SetPaddingRect( paddingRect ); + aNode.SetBorderRect( borderRect ); + aNode.SetMarginRect( marginRect ); + + DropExceedingRectL( aParentRect, aNode ); + } + +// ----------------------------------------------------------------------------- +// CalculateBorderL() +// Move the rect by adding the border. +// ----------------------------------------------------------------------------- +// +static void CalculateBorderL( CXnNode& aNode, TRect& aParentRect, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + TInt offsetx = 0; + TInt offsety = 0; + + TInt borderleft = 0; + TInt borderright = 0; + TInt bordertop = 0; + TInt borderbottom = 0; + + CXnProperty* commonBorderStyle = aNode.BorderStyleL(); + CXnProperty* borderImage = aNode.BorderImageL(); + CXnProperty* borderStyle = aNode.BorderLeftStyleL(); + CXnProperty* borderproperty = aNode.BorderLeftL(); + + // if border width is defined + CXnProperty* borderwidthproperty = aNode.BorderWidthL(); + if ( !borderproperty ) + { + borderproperty = borderwidthproperty; + } + + if ( borderwidthproperty && ( ( commonBorderStyle && + !IsPropertyNone( *commonBorderStyle ) ) || + ( borderImage && !IsPropertyNone( *borderImage ) ) ) ) + { + TInt bordervertical = 0; + TInt borderhorizontal = 0; + + DetermineBorderWidthsL( borderwidthproperty, bordervertical, + borderhorizontal, aParentRect, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + + borderleft = borderhorizontal; + borderright = borderhorizontal; + bordertop = bordervertical; + borderbottom = bordervertical; + } + + TInt ignore; + // use border width only if there is valid border style or border image + if ( borderproperty && ( ( borderStyle && + !IsPropertyNone( *borderStyle ) ) || + ( commonBorderStyle && !IsPropertyNone( *commonBorderStyle ) ) || + ( borderImage && !IsPropertyNone( *borderImage ) ) ) ) + { + DetermineBorderWidthsL( borderproperty, ignore, borderleft, + aParentRect, aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + } + borderStyle = aNode.BorderRightStyleL(); + borderproperty = aNode.BorderRightL(); + if ( !borderproperty ) + { + borderproperty = borderwidthproperty; + } + if ( borderproperty && ( ( borderStyle && + !IsPropertyNone( *borderStyle ) ) || + ( commonBorderStyle && !IsPropertyNone( *commonBorderStyle ) ) || + ( borderImage && !IsPropertyNone( *borderImage ) ) ) ) + { + DetermineBorderWidthsL( borderproperty, ignore, borderright, + aParentRect, aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + } + borderStyle = aNode.BorderTopStyleL(); + borderproperty = aNode.BorderTopL(); + if ( !borderproperty ) + { + borderproperty = borderwidthproperty; + } + if ( borderproperty && ( ( borderStyle && + !IsPropertyNone( *borderStyle ) ) || + ( commonBorderStyle && !IsPropertyNone( *commonBorderStyle ) ) || + ( borderImage && !IsPropertyNone( *borderImage ) ) ) ) + { + DetermineBorderWidthsL( borderproperty, bordertop, ignore, + aParentRect, aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + } + borderStyle = aNode.BorderBottomStyleL(); + borderproperty = aNode.BorderBottomL(); + if ( !borderproperty ) + { + borderproperty = borderwidthproperty; + } + if ( borderproperty && ( ( borderStyle && + !IsPropertyNone( *borderStyle ) ) || + ( commonBorderStyle && !IsPropertyNone( *commonBorderStyle ) ) || + ( borderImage && !IsPropertyNone( *borderImage ) ) ) ) + { + DetermineBorderWidthsL( borderproperty, borderbottom, ignore, + aParentRect, aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + } + + offsetx = borderleft; // move the client rect of the element this much right + offsety = bordertop; // move the client rect of the element this much down + + TRect newrect( aNode.Rect() ); + newrect.Move( offsetx, offsety ); + aNode.SetRect( newrect ); + // and move the padding rect also, Ari 5.8.2005 + TRect paddingrect = aNode.PaddingRect(); + TPoint origin( paddingrect.iTl ); + paddingrect.Move( offsetx, offsety ); + aNode.SetPaddingRect( paddingrect ); + + TRect borderrect( origin, TSize( + borderleft + borderright + paddingrect.Width(), + bordertop + borderbottom + paddingrect.Height() ) ); + TRect normalFlowBorderRect( origin, TSize( + borderleft + borderright + paddingrect.Width(), + bordertop + borderbottom + paddingrect.Height() ) ); + aNode.SetBorderRect( borderrect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + } + +// ----------------------------------------------------------------------------- +// CalculateAbsoluteMarginL() +// Place child areas to parent rect and calculate margins. +// ----------------------------------------------------------------------------- +// +static void CalculateAbsoluteMarginL( CXnNode& aParent, CXnNode& aNode, + CXnNode* aPreviousSibling, const TDesC8& aParentBlockProgression, + const TDesC8& aParentDirection, TRect& aParentRect, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + TInt previousPosition = 0; + CXnProperty* marginProperty = NULL; + TInt marginLeft = 0; + TInt marginRight = 0; + TInt marginTop = 0; + TInt marginBottom = 0; + + marginProperty = aNode.MarginLeftL(); + + if ( marginProperty ) + { + if ( !IsPropertyAutoL( *marginProperty ) ) + { + marginLeft = HorizontalPixelValueL( marginProperty, + aParentRect.Width(), aGraphicsDevice, aHorizontalUnitInPixels ); + } + } + + marginProperty = aNode.MarginRightL(); + + if ( marginProperty ) + { + if ( !IsPropertyAutoL( *marginProperty ) ) + { + marginRight = HorizontalPixelValueL( marginProperty, + aParentRect.Width(), aGraphicsDevice, aHorizontalUnitInPixels ); + } + } + + marginProperty = aNode.MarginTopL(); + + if ( marginProperty ) + { + if ( !IsPropertyAutoL( *marginProperty ) ) + { + marginTop = VerticalPixelValueL( marginProperty, + aParentRect.Height(), aGraphicsDevice, aVerticalUnitInPixels ); + } + } + + marginProperty = aNode.MarginBottomL(); + + if ( marginProperty ) + { + if ( !IsPropertyAutoL( *marginProperty ) ) + { + marginBottom = VerticalPixelValueL( marginProperty, + aParentRect.Height(), aGraphicsDevice, aVerticalUnitInPixels ); + } + } + + TInt offsetx = 0; + TInt offsety = 0; + + if ( &aParent == &aNode ) + { + aParentRect.Move( -aParentRect.iTl.iX, -aParentRect.iTl.iY ); + } + + // if all properties are defined and block progression is LR, margin right + // is ignored and replaced by remaining + // if block progression is RL, same thing to margin left + + // previous sibling was found, get it's margin and previous coordinate to + // define next child's position + previousPosition = ( aPreviousSibling != NULL ) ? + GetPositionL( *aPreviousSibling, aParentBlockProgression, + aParentDirection ) : 0; + + // Move the rect considering previous child + // Margins are collapsed, larger is used + if ( aParentDirection == XnPropertyNames::style::common::direction::KLTR ) + { + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KLR || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KRL ) + { + // offset to parent rect's top left corner + if ( !aPreviousSibling ) + { + offsetx = aParentRect.iTl.iX; + } + + offsety = aParentRect.iTl.iY + marginTop; + TInt prevMarginRight = 0; + + if ( aPreviousSibling ) + { + TRect previousMarginRect = aPreviousSibling->MarginRect(); + TRect previousBorderRect = aPreviousSibling->BorderRect(); + prevMarginRight = + previousMarginRect.iBr.iX - previousBorderRect.iBr.iX; + } + + if ( prevMarginRight > marginLeft ) + { + offsetx += previousPosition + prevMarginRight; + } + else + { + offsetx += previousPosition + marginLeft; + } + } + else // TB or BT + { + // offset to parent rect's top left corner + offsetx = aParentRect.iTl.iX + marginLeft; + + if ( !aPreviousSibling ) + { + offsety = aParentRect.iTl.iY; + } + + TInt prevMarginBottom = 0; + + if ( aPreviousSibling ) + { + TRect previousMarginRect = aPreviousSibling->MarginRect(); + TRect previousBorderRect = aPreviousSibling->BorderRect(); + prevMarginBottom = + previousMarginRect.iBr.iY - previousBorderRect.iBr.iY; + } + + if ( prevMarginBottom > marginTop ) + { + offsety += previousPosition + prevMarginBottom; + } + else + { + offsety += previousPosition + marginTop; + } + } + } + else // RTL + { + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KLR || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KRL ) + { + // offset to parent rect's top right corner + if ( !aPreviousSibling ) + { + offsetx = aParentRect.Width() - aNode.BorderRect().Width() + + aParentRect.iTl.iX; + } + else + { + offsetx = previousPosition - aNode.BorderRect().Width(); + } + + offsety = aParentRect.iTl.iY + marginTop; + + TInt prevMarginLeft = 0; + + if ( aPreviousSibling ) + { + TRect previousMarginRect = aPreviousSibling->MarginRect(); + TRect previousBorderRect = aPreviousSibling->BorderRect(); + prevMarginLeft = + previousBorderRect.iTl.iX - previousMarginRect.iTl.iX; + } + + if ( prevMarginLeft > marginRight ) + { + offsetx -= prevMarginLeft; + } + else + { + offsetx -= marginRight; + } + } + else // TB or BT + { + // offset to parent rect's bottom left corner + offsetx += aParentRect.iTl.iX + marginRight; + + if ( !aPreviousSibling ) + { + // start from bottom of parent rect + offsety = aParentRect.Height() - aNode.BorderRect().Height(); + } + else + { + offsety = previousPosition - aNode.BorderRect().Height(); + } + + TInt prevMarginTop = 0; + + if ( aPreviousSibling ) + { + TRect previousMarginRect = aPreviousSibling->MarginRect(); + TRect previousBorderRect = aPreviousSibling->BorderRect(); + prevMarginTop = + previousBorderRect.iTl.iY - previousMarginRect.iTl.iY; + } + + // collapse margins + if ( prevMarginTop > marginBottom ) + { + offsety -= prevMarginTop; + } + else + { + offsety -= marginBottom; + } + } + } + + TRect borderRect = TRect( aNode.BorderRect() ); + TRect normalFlowBorderRect = TRect( aNode.NormalFlowBorderRect() ); + // this is the top left corner of margin rect + TPoint origin( borderRect.iTl - TPoint( marginLeft, marginTop ) ); + + if ( &aParent != &aNode ) + { + // set content rect + TRect newRect( aNode.Rect() ); + newRect.Move( offsetx, offsety ); + aNode.SetRect( newRect ); + + // set padding rect + TRect paddingRect( aNode.PaddingRect() ); + paddingRect.Move( offsetx, offsety ); + aNode.SetPaddingRect( paddingRect ); + + // set border rect + borderRect.Move( offsetx, offsety ); + normalFlowBorderRect.Move( offsetx, offsety ); + // this is the top left corner of margin rect + origin = TPoint( borderRect.iTl - TPoint( marginLeft, marginTop ) ); + aNode.SetBorderRect( borderRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + } + + TRect marginRect( origin, + TSize( marginLeft + marginRight + borderRect.Width(), + marginTop + marginBottom + borderRect.Height() ) ); + + aNode.SetMarginRect( marginRect ); + + // Within this function, the rects are adjusted if the display-priority is 0 + // and margin rect exceeds parent's content rect. + DropExceedingRectL( aParentRect, aNode ); + + if( IsNodeTooltip( aNode ) || aNode.Type()->Type() == KWidgetExtensionNodeName || + aNode.Type()->Type() == KPopUpNodeName ) + { + // because tooltip has it's own window, move margin rect to 0,0 + // and all other rects as much up left + TRect marginRect = aNode.MarginRect(); + + TRect borderRect = aNode.BorderRect(); + TRect paddingRect = aNode.PaddingRect(); + TRect contentRect = aNode.Rect(); + TInt x = marginRect.iTl.iX; + TInt y = marginRect.iTl.iY; + marginRect.Move( -x, -y ); + + borderRect.Move( -x, -y ); + paddingRect.Move( -x, -y ); + contentRect.Move( -x, -y ); + + aNode.SetMarginRect( marginRect ); + + aNode.SetBorderRect( borderRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + aNode.SetPaddingRect( paddingRect ); + aNode.SetRect( contentRect ); + } + } + +// ----------------------------------------------------------------------------- +// CalculateAbsoluteMarginL() +// Place child areas to parent rect and calculate margins. +// ----------------------------------------------------------------------------- +// +static void CalculateMarginL( CXnNode& aParent, CXnNode& aNode, + CXnNode* aPreviousSibling, const TDesC8& aParentBlockProgression, + const TDesC8& aParentDirection, TRect& aParentRect, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels, TInt& aColumnWidth, TInt& aColumnMargin ) + { + if( aParent.Control() && aParent.Control()->OwnsWindow() ) + { + aParentRect = TRect( aParentRect.iTl - aParent.MarginRect().iTl, aParentRect.Size() ); + } + + CXnProperty* marginProperty = NULL; + TInt marginLeft = 0; + TInt marginRight = 0; + TInt marginTop = 0; + TInt marginBottom = 0; + + marginProperty = aNode.MarginLeftL(); + if ( marginProperty ) + { + if ( !IsPropertyAutoL( *marginProperty ) ) + { + marginLeft = HorizontalPixelValueL( + marginProperty, aParentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ); + } + } + + marginProperty = aNode.MarginRightL(); + if ( marginProperty ) + { + if ( !IsPropertyAutoL( *marginProperty ) ) + { + marginRight = HorizontalPixelValueL( + marginProperty, aParentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ); + } + } + + marginProperty = aNode.MarginTopL(); + if ( marginProperty ) + { + if ( !IsPropertyAutoL( *marginProperty ) ) + { + marginTop = VerticalPixelValueL( + marginProperty, aParentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ); + } + } + + marginProperty = aNode.MarginBottomL(); + if ( marginProperty ) + { + if ( !IsPropertyAutoL( *marginProperty ) ) + { + marginBottom = VerticalPixelValueL( + marginProperty, aParentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ); + } + } + + TInt offsetx = 0; + TInt offsety = 0; + + //What's this??? + if ( &aParent == &aNode ) + { + aParentRect.Move( -aParentRect.iTl.iX, -aParentRect.iTl.iY ); + } + + // Move the rect considering previous child + // Margins are collapsed, larger is used + if ( aParentDirection == XnPropertyNames::style::common::direction::KLTR ) + { + // LTR , TB + // ********* + // | 1 | 4 | + // | 2 | 5 | + // | 3 | 6 | + // ********* + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB ) + { + // First we need to know where to layout next sibling + // Try first under the previous sibling... + if ( aPreviousSibling ) + { + TRect previousMarginRect = aPreviousSibling->MarginRect(); + TRect previousBorderRect = aPreviousSibling->BorderRect(); + TBool layoutUnderPrevious( EFalse ); + TInt height = aNode.MarginRect().Height(); + TInt prevMarginBottom = + previousMarginRect.iBr.iY - previousBorderRect.iBr.iY; + if ( prevMarginBottom < marginTop ) + { + height -= prevMarginBottom; + } + else + { + height -= marginTop; + } + if(height <= aParentRect.iBr.iY - previousMarginRect.iBr.iY || IsSrollableBox(aNode)) + { + layoutUnderPrevious = ETrue; + } + + // ...then to the next column + if ( !layoutUnderPrevious ) + { + TInt width = + aNode.BorderRect().Width() + marginLeft + marginRight; + if ( aColumnMargin < marginLeft ) + { + width -= aColumnMargin; + } + else + { + width -= marginLeft; + } + if ( width + aColumnWidth <= aParentRect.Width() ) + { + offsety = aParentRect.iTl.iY + marginTop; + if ( aColumnMargin < marginLeft ) + { + offsetx = aParentRect.iTl.iX + aColumnWidth - + aColumnMargin + marginLeft; + } + else + { + offsetx = aParentRect.iTl.iX + aColumnWidth; + } + } + else + { + layoutUnderPrevious = ETrue; + } + } + if ( layoutUnderPrevious ) + { + offsetx = + aPreviousSibling->MarginRect().iTl.iX + marginLeft; + if ( prevMarginBottom > marginTop ) + { + // margin of this node is collapsed + offsety = previousMarginRect.iBr.iY; + } + else + { + // margin of the previous node is collapsed + offsety = previousBorderRect.iBr.iY + marginTop; + } + } + } + else + { + // offset to parent rect's top left corner + offsetx = aParentRect.iTl.iX + marginLeft; + offsety = aParentRect.iTl.iY + marginTop; + } + } + + // LTR , BT + // ********* + // | 3 | 6 | + // | 2 | 5 | + // | 1 | 4 | + // ********* + else if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KBT ) + { + // First we need to know where to layout next sibling + // Try first above the previous sibling... + if ( aPreviousSibling ) + { + TRect previousMarginRect = aPreviousSibling->MarginRect(); + TRect previousBorderRect = aPreviousSibling->BorderRect(); + TBool layoutAbovePrevious( EFalse ); + TInt height = + aNode.BorderRect().Height() + marginTop + marginBottom; + TInt prevMarginTop = + previousBorderRect.iTl.iY - previousMarginRect.iTl.iY; + if ( prevMarginTop < marginBottom ) + { + height -= prevMarginTop; + } + else + { + height -= marginBottom; + } + if ( height <= previousMarginRect.iTl.iY - aParentRect.iTl.iY ) + { + layoutAbovePrevious = ETrue; + } + + // ...then to the next column + if ( !layoutAbovePrevious ) + { + TInt width = + aNode.BorderRect().Width() + marginLeft + marginRight; + if ( aColumnMargin < marginLeft ) + { + width -= aColumnMargin; + } + else + { + width -= marginLeft; + } + if ( width + aColumnWidth <= aParentRect.Width() ) + { + offsety = aParentRect.iBr.iY - marginBottom - + aNode.BorderRect().Height(); + if ( aColumnMargin < marginLeft ) + { + offsetx = aParentRect.iTl.iX + aColumnWidth - + aColumnMargin + marginLeft; + } + else + { + offsetx = aParentRect.iTl.iX + aColumnWidth; + } + } + else + { + layoutAbovePrevious = ETrue; + } + } + if ( layoutAbovePrevious ) + { + offsetx = + aPreviousSibling->MarginRect().iTl.iX + marginLeft; + if ( prevMarginTop > marginBottom ) + { + // margin of this node is collapsed + offsety = previousMarginRect.iTl.iY - + aNode.BorderRect().Height(); + } + else + { + // margin of the previous node is collapsed + offsety = previousBorderRect.iTl.iY - marginBottom - + aNode.BorderRect().Height(); + } + } + } + else + { + offsetx = aParentRect.iTl.iX + marginLeft; + offsety = aParentRect.iBr.iY - marginBottom - + aNode.BorderRect().Height(); + } + } + + // LTR , LR + // ********* + // | 5 | 6 | + // | 3 | 4 | + // | 1 | 2 | + // ********* + else if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KLR ) + { + if ( aPreviousSibling ) + { + TRect previousMarginRect = aPreviousSibling->MarginRect(); + TRect previousBorderRect = aPreviousSibling->BorderRect(); + TBool layoutNextToPrevious( EFalse ); + TInt width = + aNode.BorderRect().Width() + marginRight + marginLeft; + TInt prevMarginRight = + previousMarginRect.iBr.iX - previousBorderRect.iBr.iX; + if ( prevMarginRight < marginLeft ) + { + width -= prevMarginRight; + } + else + { + width -= marginLeft; + } + if ( width <= aParentRect.iBr.iX - previousMarginRect.iBr.iX ) + { + layoutNextToPrevious = ETrue; + } + + if ( !layoutNextToPrevious ) + { + TInt height = aNode.BorderRect().Height() + marginTop + + marginBottom; + if ( aColumnMargin < marginBottom ) + { + height -= aColumnMargin; + } + else + { + height -= marginBottom; + } + if ( height + aColumnWidth <= aParentRect.Height() ) + { + offsetx = aParentRect.iTl.iX + marginLeft; + if ( aColumnMargin < marginTop ) + { + offsety = aParentRect.iBr.iY - aColumnWidth + + aColumnMargin - aNode.BorderRect().Height() - + marginBottom; + } + else + { + offsety = aParentRect.iBr.iY - aColumnWidth - + aNode.BorderRect().Height(); + } + } + else + { + layoutNextToPrevious = ETrue; + } + } + if ( layoutNextToPrevious ) + { + offsety = aPreviousSibling->MarginRect().iBr.iY - + aNode.BorderRect().Height() - marginBottom; + if ( prevMarginRight > marginLeft ) + { + // margin of this node is collapsed + offsetx = previousMarginRect.iBr.iX; + } + else + { + // margin of the previous node is collapsed + offsetx = previousBorderRect.iBr.iX + marginLeft; + } + } + } + else + { + offsetx = aParentRect.iTl.iX + marginLeft; + offsety = aParentRect.iBr.iY - aNode.BorderRect().Height() - + marginBottom; + } + } + + // LTR , RL + // ********* + // | 1 | 2 | + // | 3 | 4 | + // | 5 | 6 | + // ********* + + else if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KRL ) + { + if ( aPreviousSibling ) + { + TRect previousMarginRect = aPreviousSibling->MarginRect(); + TRect previousBorderRect = aPreviousSibling->BorderRect(); + TBool layoutNextToPrevious( EFalse ); + TInt width = + aNode.BorderRect().Width() + marginRight + marginLeft; + TInt prevMarginRight = + previousMarginRect.iBr.iX - previousBorderRect.iBr.iX; + if ( prevMarginRight < marginLeft ) + { + width -= prevMarginRight; + } + else + { + width -= marginLeft; + } + if ( width <= aParentRect.iBr.iX - previousMarginRect.iBr.iX ) + { + layoutNextToPrevious = ETrue; + } + + if ( !layoutNextToPrevious ) + { + TInt height = + aNode.BorderRect().Height() + marginTop + marginBottom; + if ( aColumnMargin < marginTop ) + { + height -= aColumnMargin; + } + else + { + height -= marginTop; + } + if ( height + aColumnWidth <= aParentRect.Height() ) + { + offsetx = aParentRect.iTl.iX + marginLeft; + if ( aColumnMargin < marginTop ) + { + offsety = aParentRect.iTl.iY + aColumnWidth - + aColumnMargin + marginTop; + } + else + { + offsety = aParentRect.iTl.iY + aColumnWidth; + } + } + else + { + layoutNextToPrevious = ETrue; + } + } + if ( layoutNextToPrevious ) + { + offsety = aPreviousSibling->MarginRect().iTl.iY + marginTop; + if ( prevMarginRight > marginLeft ) + { + // margin of this node is collapsed + offsetx = previousMarginRect.iBr.iX; + } + else + { + // margin of the previous node is collapsed + offsetx = previousBorderRect.iBr.iX + marginLeft; + } + } + } + else + { + offsetx = aParentRect.iTl.iX + marginLeft; + offsety = aParentRect.iTl.iY + marginTop; + } + } + } + + else + { + // RTL , TB + // ********* + // | 4 | 1 | + // | 5 | 2 | + // | 6 | 3 | + // ********* + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB ) + { + if ( aPreviousSibling ) + { + TRect previousMarginRect = aPreviousSibling->MarginRect(); + TRect previousBorderRect = aPreviousSibling->BorderRect(); + TBool layoutUnderPrevious( EFalse ); + TInt height = aNode.MarginRect().Height(); + TInt prevMarginBottom = + previousMarginRect.iBr.iY - previousBorderRect.iBr.iY; + if ( prevMarginBottom < marginTop ) + { + height -= prevMarginBottom; + } + else + { + height -= marginTop; + } + if ( height <= aParentRect.iBr.iY - previousMarginRect.iBr.iY ) + { + layoutUnderPrevious = ETrue; + } + + if ( !layoutUnderPrevious ) + { + TInt width = + aNode.BorderRect().Width() + marginLeft + marginRight; + if ( aColumnMargin < marginLeft ) + { + width -= aColumnMargin; + } + else + { + width -= marginLeft; + } + if ( width + aColumnWidth <= aParentRect.Width() ) + { + offsety = aParentRect.iTl.iY + marginTop; + if ( aColumnMargin < marginLeft ) + { + offsetx = aParentRect.iBr.iX - aColumnWidth + + aColumnMargin - marginRight - + aNode.BorderRect().Width(); + } + else + { + offsetx = aParentRect.iBr.iX - aColumnWidth - + aNode.BorderRect().Width(); + } + } + else + { + layoutUnderPrevious = ETrue; + } + } + if ( layoutUnderPrevious ) + { + offsetx = aPreviousSibling->MarginRect().iBr.iX - + marginRight - aNode.BorderRect().Width(); + if ( prevMarginBottom > marginTop ) + { + offsety = previousMarginRect.iBr.iY; + } + else + { + offsety = previousBorderRect.iBr.iY + marginTop; + } + } + } + else + { + offsetx = aParentRect.iBr.iX - marginRight - + aNode.BorderRect().Width(); + offsety = aParentRect.iTl.iY + marginTop; + } + } + + // RTL , BT + // ********* + // | 6 | 3 | + // | 5 | 2 | + // | 4 | 1 | + // ********* + else if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KBT ) + { + if ( aPreviousSibling ) + { + TRect previousMarginRect = aPreviousSibling->MarginRect(); + TRect previousBorderRect = aPreviousSibling->BorderRect(); + TBool layoutAbovePrevious( EFalse ); + TInt height = + aNode.BorderRect().Height() + marginTop + marginBottom; + TInt prevMarginTop = + previousBorderRect.iTl.iY - previousMarginRect.iTl.iY; + if ( prevMarginTop < marginBottom ) + { + height -= prevMarginTop; + } + else + { + height -= marginBottom; + } + if ( height <= previousMarginRect.iTl.iY - aParentRect.iTl.iY ) + { + layoutAbovePrevious = ETrue; + } + + if ( !layoutAbovePrevious ) + { + TInt width = + aNode.BorderRect().Width() + marginLeft + marginRight; + if ( aColumnMargin < marginRight ) + { + width -= aColumnMargin; + } + else + { + width -= marginRight; + } + if ( width + aColumnWidth <= aParentRect.Width() ) + { + offsety = aParentRect.iBr.iY - marginBottom - + aNode.BorderRect().Height(); + if ( aColumnMargin < marginLeft ) + { + offsetx = aParentRect.iBr.iX - aColumnWidth + + aColumnMargin - marginRight - + aNode.BorderRect().Width(); + } + else + { + offsetx = aParentRect.iBr.iX - aColumnWidth - + aNode.BorderRect().Width(); + } + } + else + { + layoutAbovePrevious = ETrue; + } + } + if ( layoutAbovePrevious ) + { + offsetx = aPreviousSibling->MarginRect().iBr.iX - + marginRight - aNode.BorderRect().Width(); + if ( prevMarginTop > marginBottom ) + { + // margin of this node is collapsed + offsety = previousMarginRect.iTl.iY - + aNode.BorderRect().Height(); + } + else + { + // margin of the previous node is collapsed + offsety = previousBorderRect.iTl.iY - marginBottom - + aNode.BorderRect().Height(); + } + } + } + else + { + offsetx = aParentRect.iBr.iX - marginRight - + aNode.BorderRect().Width(); + offsety = aParentRect.iBr.iY - marginBottom - + aNode.BorderRect().Height(); + } + } + + // RTL , LR + // ********* + // | 6 | 5 | + // | 4 | 3 | + // | 2 | 1 | + // ********* + else if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KLR ) + { + if ( aPreviousSibling ) + { + TRect previousMarginRect = aPreviousSibling->MarginRect(); + TRect previousBorderRect = aPreviousSibling->BorderRect(); + TBool layoutNextToPrevious( EFalse ); + TInt width = + aNode.BorderRect().Width() + marginRight + marginLeft; + TInt prevMarginLeft = + previousBorderRect.iTl.iX - previousMarginRect.iTl.iX; + if ( prevMarginLeft < marginRight ) + { + width -= prevMarginLeft; + } + else + { + width -= marginRight; + } + if ( width <= previousMarginRect.iTl.iX - aParentRect.iTl.iX ) + { + layoutNextToPrevious = ETrue; + } + + if ( !layoutNextToPrevious ) + { + TInt height = + aNode.BorderRect().Height() + marginTop + marginBottom; + if ( aColumnMargin < marginBottom ) + { + height -= aColumnMargin; + } + else + { + height -= marginBottom; + } + if ( height + aColumnWidth <= aParentRect.Height() ) + { + offsetx = aParentRect.iBr.iX - marginRight - + aNode.BorderRect().Width(); + if ( aColumnMargin < marginTop ) + { + offsety = aParentRect.iBr.iY - aColumnWidth + + aColumnMargin - aNode.BorderRect().Height() - + marginBottom; + } + else + { + offsety = aParentRect.iBr.iY - aColumnWidth - + aNode.BorderRect().Height(); + } + } + else + { + layoutNextToPrevious = ETrue; + } + } + if ( layoutNextToPrevious ) + { + offsety = aPreviousSibling->MarginRect().iBr.iY - + aNode.BorderRect().Height() - marginBottom; + if ( prevMarginLeft > marginRight ) + { + offsetx = previousMarginRect.iTl.iX - + aNode.BorderRect().Width(); + } + else + { + offsetx = previousBorderRect.iTl.iX - marginRight - + aNode.BorderRect().Width(); + } + } + } + else + { + offsetx = aParentRect.iBr.iX - marginRight - + aNode.BorderRect().Width(); + offsety = aParentRect.iBr.iY - marginBottom - + aNode.BorderRect().Height(); + } + } + + // RTL , RL + // ********* + // | 2 | 1 | + // | 4 | 3 | + // | 6 | 5 | + // ********* + else if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KRL ) + { + if ( aPreviousSibling ) + { + TRect previousMarginRect = aPreviousSibling->MarginRect(); + TRect previousBorderRect = aPreviousSibling->BorderRect(); + TBool layoutNextToPrevious( EFalse ); + TInt width = + aNode.BorderRect().Width() + marginRight + marginLeft; + TInt prevMarginLeft = + previousBorderRect.iTl.iX - previousMarginRect.iTl.iX; + if ( prevMarginLeft < marginRight ) + { + width -= prevMarginLeft; + } + else + { + width -= marginRight; + } + if ( width <= previousMarginRect.iTl.iX - aParentRect.iTl.iX ) + { + layoutNextToPrevious = ETrue; + } + if ( !layoutNextToPrevious ) + { + TInt height = + aNode.BorderRect().Height() + marginTop + marginBottom; + if ( aColumnMargin < marginTop ) + { + height -= aColumnMargin; + } + else + { + height -= marginTop; + } + if ( height + aColumnWidth <= aParentRect.Height() ) + { + offsetx = aParentRect.iBr.iX - marginRight - + aNode.BorderRect().Width(); + if ( aColumnMargin < marginTop ) + { + offsety = aParentRect.iTl.iY + aColumnWidth - + aColumnMargin + marginTop; + } + else + { + offsety = aParentRect.iTl.iY + aColumnWidth; + } + } + else + { + layoutNextToPrevious = ETrue; + } + } + if ( layoutNextToPrevious ) + { + offsety = aPreviousSibling->MarginRect().iTl.iY + marginTop; + if ( prevMarginLeft > marginRight ) + { + offsetx = previousMarginRect.iTl.iX - + aNode.BorderRect().Width(); + } + else + { + offsetx = previousBorderRect.iTl.iX - marginRight - + aNode.BorderRect().Width(); + } + } + } + else + { + offsetx = aParentRect.iBr.iX - marginRight - + aNode.BorderRect().Width(); + offsety = aParentRect.iTl.iY + marginTop; + } + } + } + + TRect borderRect = TRect( aNode.BorderRect() ); + TRect normalFlowBorderRect = TRect( aNode.NormalFlowBorderRect() ); + // this is the top left corner of margin rect + TPoint origin( borderRect.iTl - TPoint( marginLeft, marginTop ) ); + + if ( &aParent != &aNode ) + { + // set content rect + TRect newRect( aNode.Rect() ); + newRect.Move( offsetx, offsety ); + aNode.SetRect( newRect ); + + // set padding rect + TRect paddingRect( aNode.PaddingRect() ); + paddingRect.Move( offsetx, offsety ); + aNode.SetPaddingRect( paddingRect ); + + // set border rect + borderRect.Move( offsetx, offsety ); + normalFlowBorderRect.Move( offsetx, offsety ); + // this is the top left corner of margin rect + origin = TPoint( borderRect.iTl - TPoint( marginLeft, marginTop ) ); + aNode.SetBorderRect( borderRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + } + + TRect marginRect( origin, + TSize( marginLeft + marginRight + borderRect.Width(), + marginTop + marginBottom + borderRect.Height() ) ); + + aNode.SetMarginRect( marginRect ); + + // Within this function, the rects are adjusted if the display-priority is + // 0 and margin rect exceeds parent's content rect. + DropExceedingRectL( aParentRect, aNode ); + + // Update column width & column margin width according to block + // progression & direction. + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KRL ) + { + TInt newColumnWidth = marginRect.iBr.iY - aParentRect.iTl.iY; + if ( newColumnWidth > aColumnWidth ) + { + aColumnWidth = newColumnWidth; + aColumnMargin = marginRect.iBr.iY - borderRect.iBr.iY; + } + } + else if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KLR ) + { + TInt newColumnWidth = aParentRect.iBr.iY - marginRect.iTl.iY; + if ( newColumnWidth > aColumnWidth ) + { + aColumnWidth = newColumnWidth; + aColumnMargin = borderRect.iTl.iY - marginRect.iTl.iY; + } + } + else if ( aParentDirection == + XnPropertyNames::style::common::direction::KLTR ) + { + // same for tb and bt + TInt newColumnWidth = marginRect.iBr.iX - aParentRect.iTl.iX; + if ( newColumnWidth > aColumnWidth ) + { + aColumnWidth = newColumnWidth; + aColumnMargin = marginRect.iBr.iX - borderRect.iBr.iX; + } + } + else if ( aParentDirection == + XnPropertyNames::style::common::direction::KRTL ) + { + // same for tb and bt + TInt newColumnWidth = aParentRect.iBr.iX - marginRect.iTl.iX; + if ( newColumnWidth > aColumnWidth ) + { + aColumnWidth = newColumnWidth; + aColumnMargin = borderRect.iTl.iX - marginRect.iTl.iX; + } + } + + if ( IsNodeTooltip( aNode ) ) + { + // because tooltip has it's own window, move margin rect to 0,0 + // and all other rects as much up left + TRect marginRect = aNode.MarginRect(); + TRect borderRect = aNode.BorderRect(); + TRect paddingRect = aNode.PaddingRect(); + TRect contentRect = aNode.Rect(); + TInt x = marginRect.iTl.iX; + TInt y = marginRect.iTl.iY; + marginRect.Move( -x, -y ); + borderRect.Move( -x, -y ); + paddingRect.Move( -x, -y ); + contentRect.Move( -x, -y ); + aNode.SetMarginRect( marginRect ); + aNode.SetBorderRect( borderRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + aNode.SetPaddingRect( paddingRect ); + aNode.SetRect( contentRect ); + } + } + +// ----------------------------------------------------------------------------- +// CalculatePaddingL() +// Move the rect by adding the padding. +// ----------------------------------------------------------------------------- +// +static void CalculatePaddingL( const TRect& aParentRect, CXnNode& aNode, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + TInt offsetx = 0; + TInt offsety = 0; + + TInt paddingleft = 0; + TInt paddingright = 0; + TInt paddingtop = 0; + TInt paddingbottom = 0; + TRect parentRect = aParentRect; + + CXnProperty* paddingproperty = aNode.PaddingLeftL(); + + if ( paddingproperty ) + { + TRAPD( error, paddingleft = HorizontalPixelValueL( paddingproperty, + parentRect.Width(), aGraphicsDevice, aHorizontalUnitInPixels ) ); + + if ( error != KErrNone ) + { + paddingleft = 0; + } + } + + paddingproperty = aNode.PaddingRightL(); + + if ( paddingproperty ) + { + TRAPD( error, paddingright = HorizontalPixelValueL( paddingproperty, + parentRect.Width(), aGraphicsDevice, aHorizontalUnitInPixels ) ); + + if ( error != KErrNone ) + { + paddingright = 0; + } + } + + paddingproperty = aNode.PaddingTopL(); + + if ( paddingproperty ) + { + TRAPD( error, paddingtop = VerticalPixelValueL( paddingproperty, + parentRect.Height(), aGraphicsDevice, aVerticalUnitInPixels ) ); + + if ( error != KErrNone ) + { + paddingtop = 0; + } + } + + paddingproperty = aNode.PaddingBottomL(); + + if ( paddingproperty ) + { + TRAPD( error, paddingbottom = VerticalPixelValueL( paddingproperty, + parentRect.Height(), aGraphicsDevice, aVerticalUnitInPixels ) ); + + if ( error != KErrNone ) + { + paddingbottom = 0; + } + } + + // move the client rect of the element this much right + offsetx = paddingleft; + // move the client rect of the element this much down + offsety = paddingtop; + + TRect newrect( aNode.Rect() ); + TPoint origin( newrect.iTl ); + newrect.Move( offsetx, offsety ); + aNode.SetRect( newrect ); + + // set padding rect + TRect paddingrect( origin, TSize( paddingleft + paddingright + + newrect.Width(), paddingtop + paddingbottom + newrect.Height() ) ); + + aNode.SetPaddingRect( paddingrect ); + } + +// ----------------------------------------------------------------------------- +// CalculateRectL() +// Creates rect for CXnComponent. +// ----------------------------------------------------------------------------- +// +static void CalculateRectL( CXnNode& aNode, CXnNode& aParent, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + TInt width = 0; + TInt height = 0; + TRect parentRect = aParent.Rect(); + CXnProperty* widthproperty = aNode.WidthL(); + + if ( widthproperty ) + { + // if width is auto, it is set to 0 at this point and calculated later + if ( IsPropertyAutoL( *widthproperty ) ) + { + width = 0; + } + else + { + width = HorizontalPixelValueL( widthproperty, parentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ); + } + } + + CXnProperty* heightproperty = aNode.HeightL(); + + if ( heightproperty ) + { + // if height is auto, height is set to 0 at this point + // and calculated later + if ( IsPropertyAutoL( *heightproperty ) ) + { + height = 0; + } + else + { + height = VerticalPixelValueL( heightproperty, parentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ); + } + } + + // check that rect sizes are in max and min bounds + CXnProperty* maxheightproperty = aNode.MaxHeightL(); + CXnProperty* minheightproperty = aNode.MinHeightL(); + CXnProperty* maxwidthproperty = aNode.MaxWidthL(); + CXnProperty* minwidthproperty = aNode.MinWidthL(); + + if ( maxwidthproperty ) + { + if ( !IsPropertyNone( *maxwidthproperty ) ) + { + TInt maxwidth = HorizontalPixelValueL( + maxwidthproperty, parentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ); + + if ( width > maxwidth ) + { + width = maxwidth; + } + } + } + + if ( minwidthproperty ) + { + if ( !IsPropertyNone( *minwidthproperty ) ) + { + TInt minwidth = HorizontalPixelValueL( + minwidthproperty, parentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ); + + if ( width < minwidth ) + { + width = minwidth; + } + } + } + + if ( maxheightproperty ) + { + if ( !IsPropertyNone( *maxheightproperty ) ) + { + TInt maxheight = VerticalPixelValueL( + maxheightproperty, parentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ); + + if ( height > maxheight ) + { + height = maxheight; + } + } + } + + if ( minheightproperty ) + { + if ( !IsPropertyNone( *minheightproperty ) ) + { + TInt minheight = VerticalPixelValueL( + minheightproperty, parentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ); + + if ( height < minheight ) + { + height = minheight; + } + } + } + + if ( aNode.ViewNodeImpl() && height != 0 && width != 0 ) + { + TRect rect( 0, 0, width, height ); + TRect paddingrect( 0, 0, width, height ); + TRect borderrect( 0, 0, width, height ); + TRect normalFlowBorderRect( 0, 0, width, height ); + TRect marginrect( 0, 0, width, height ); + + aNode.SetRect( rect ); + aNode.SetPaddingRect( paddingrect ); + aNode.SetBorderRect( borderrect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + aNode.SetMarginRect( marginrect ); + } + else if ( !aNode.ViewNodeImpl() ) + { + TInt adaptive( aNode.IsAdaptive() ); + + if ( adaptive && ( IsNodeTooltip( aNode ) || IsAbsoluteL( aNode ) ) ) + { + CXnUiEngine* engine( aNode.UiEngine() ); + + TSize maxSize( engine->ClientRect().Size() ); + + if ( adaptive & XnAdaptive::EHeight ) + { + height = maxSize.iHeight; + } + if ( adaptive & XnAdaptive::EWidth ) + { + width = maxSize.iWidth; + } + } + + TRect rect( 0, 0, width, height ); + TRect paddingrect( 0, 0, width, height ); + TRect borderrect( 0, 0, width, height ); + TRect normalFlowBorderRect( 0, 0, width, height ); + TRect marginrect( 0, 0, width, height ); + + aNode.SetRect( rect ); + aNode.SetPaddingRect( paddingrect ); + aNode.SetBorderRect( borderrect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + aNode.SetMarginRect( marginrect ); + } + } + +// ----------------------------------------------------------------------------- +// CalculateRelativePositionL() +// Move the rect by it's relative position. +// ----------------------------------------------------------------------------- +// +static void CalculateRelativePositionsL( const TRect& aParentRect, + CXnNode& aNode, CGraphicsDevice& aGraphicsDevice, + TReal aHorizontalUnitInPixels, TReal aVerticalUnitInPixels ) + { + CXnProperty* top = aNode.TopL(); + CXnProperty* bottom = aNode.BottomL(); + CXnProperty* left = aNode.LeftL(); + CXnProperty* right = aNode.RightL(); + + // Move rect by offset + TRect newRect( aNode.Rect() ); + TRect paddingRect( aNode.PaddingRect() ); + TRect borderRect( aNode.BorderRect() ); + TRect marginRect( aNode.MarginRect() ); + + TRect parentRect = aParentRect; + + if ( top && !IsPropertyAutoL( *top ) ) + { + newRect.Move( 0, VerticalPixelValueL( top, parentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ) ); + paddingRect.Move( 0, VerticalPixelValueL( top, parentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ) ); + borderRect.Move( 0, VerticalPixelValueL( top, parentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ) ); + marginRect.Move( 0, VerticalPixelValueL( top, parentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ) ); + } + if ( bottom && !IsPropertyAutoL( *bottom ) ) + { + newRect.Move( 0, -VerticalPixelValueL( bottom, parentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ) ); + paddingRect.Move( 0, -VerticalPixelValueL( bottom, parentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ) ); + borderRect.Move( 0, -VerticalPixelValueL( bottom, parentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ) ); + marginRect.Move( 0, -VerticalPixelValueL( bottom, parentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ) ); + } + if ( left && !IsPropertyAutoL( *left ) ) + { + newRect.Move( HorizontalPixelValueL( left, parentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ), 0 ); + paddingRect.Move( HorizontalPixelValueL( left, parentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ), 0 ); + borderRect.Move( HorizontalPixelValueL( left, parentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ), 0 ); + marginRect.Move( HorizontalPixelValueL( left, parentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ), 0 ); + } + if ( right && !IsPropertyAutoL( *right ) ) + { + newRect.Move( -HorizontalPixelValueL( right, parentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ), 0 ); + paddingRect.Move( -HorizontalPixelValueL( right, parentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ), 0 ); + borderRect.Move( -HorizontalPixelValueL( right, parentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ), 0 ); + marginRect.Move( -HorizontalPixelValueL( right, parentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ), 0 ); + } + + aNode.SetRect( newRect ); + aNode.SetPaddingRect( paddingRect ); + aNode.SetBorderRect( borderRect ); + aNode.SetMarginRect( marginRect ); + + DropExceedingRectL( parentRect, aNode, ETrue ); + } + +// ----------------------------------------------------------------------------- +// CalculateSpaceUsedByChildrenL() +// Return space used by node's children. +// ----------------------------------------------------------------------------- +// +static TSize CalculateSpaceUsedByChildrenL( RPointerArray< CXnNode >& aChildren, + CXnNode& aNode, const TDesC8& aParentBlockProgression, + const TDesC8& aParentDirection, CGraphicsDevice& aScreenDevice, + TReal aHorizontalUnitInPixels, TReal aVerticalUnitInPixels ) + { + TInt usedSiblingHeight( 0 ); + TInt usedSiblingWidth( 0 ); + + TRect rect( aNode.Rect() ); + + TSize largestSize( 0, 0 ); + + for ( TInt i = 0; i < aChildren.Count(); i++ ) + { + CXnNode* node( aChildren[i] ); + + if ( IsNodeDisplayedL( *node ) && !node->IsDropped() && + !IsAbsoluteL( *node ) && !IsNodeTooltip( *node ) ) + { + TSize siblingSize = CalculateTotalDimensionsL( *node, ETrue, + EFalse, rect, aScreenDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + + if ( node->IsAdaptive() ) + { + RPointerArray< CXnNode >& children( node->Children() ); + + CXnProperty* blockProgressionProperty( + node->BlockProgressionL() ); + CXnProperty* directionProperty( node->DirectionL() ); + + const TDesC8* blockProgression( + &XnPropertyNames::style::common::block_progression::KTB() ); + const TDesC8* direction( + &XnPropertyNames::style::common::direction::KLTR() ); + + if ( directionProperty ) + { + direction = &directionProperty->StringValue(); + } + + if ( blockProgressionProperty ) + { + blockProgression = &blockProgressionProperty->StringValue(); + } + + siblingSize += CalculateSpaceUsedByChildrenL( children, aNode, + *blockProgression, *direction, + aScreenDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + } + + if ( siblingSize.iWidth > largestSize.iWidth ) + { + largestSize.iWidth = siblingSize.iWidth; + } + if ( siblingSize.iHeight > largestSize.iHeight ) + { + largestSize.iHeight = siblingSize.iHeight; + } + + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB ) + { + usedSiblingHeight += siblingSize.iHeight; + usedSiblingWidth = largestSize.iWidth; + } + + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KLR || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KRL ) + { + usedSiblingWidth += siblingSize.iWidth; + usedSiblingHeight = largestSize.iHeight; + } + + // collapse margins + if ( aChildren.Count() < i ) + { + CXnNode* next( aChildren[i + 1] ); + + if ( ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KLR || + aParentBlockProgression == + XnPropertyNames::style::common:: + block_progression::KRL ) && aParentDirection == + XnPropertyNames::style::common::direction::KLTR ) + { + TInt thisSiblingsRightMargin = + node->MarginRect().iBr.iX - node->BorderRect().iBr.iX; + TInt nextSiblingsLeftMargin = + next->BorderRect().iTl.iX - next->MarginRect().iTl.iX; + + if ( nextSiblingsLeftMargin > thisSiblingsRightMargin ) + { + usedSiblingWidth -= thisSiblingsRightMargin; + } + } + + if ( ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KRL || + aParentBlockProgression == + XnPropertyNames::style::common + ::block_progression::KLR ) && aParentDirection == + XnPropertyNames::style::common::direction::KRTL ) + { + TInt thisSiblingsLeftMargin = + node->MarginRect().iTl.iX - node->BorderRect().iTl.iX; + TInt nextSiblingsRightMargin = + next->BorderRect().iBr.iX - next->MarginRect().iBr.iX; + + if ( nextSiblingsRightMargin > thisSiblingsLeftMargin ) + { + usedSiblingWidth =- thisSiblingsLeftMargin; + } + } + + if ( ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB || + aParentBlockProgression == + XnPropertyNames::style::common:: + block_progression::KBT ) && aParentDirection == + XnPropertyNames::style::common::direction::KLTR ) + { + TInt thisSiblingsBottomMargin = + node->MarginRect().iBr.iY - node->BorderRect().iBr.iY; + TInt nextSiblingsTopMargin = + next->BorderRect().iTl.iY - next->MarginRect().iTl.iY; + + if ( nextSiblingsTopMargin > thisSiblingsBottomMargin ) + { + usedSiblingHeight -= thisSiblingsBottomMargin; + } + } + + if ( ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB || + aParentBlockProgression == + XnPropertyNames::style::common:: + block_progression::KBT ) && aParentDirection == + XnPropertyNames::style::common::direction::KRTL ) + { + TInt thisSiblingsTopMargin = + node->MarginRect().iTl.iY - node->BorderRect().iTl.iY; + TInt nextSiblingsBottomMargin = + next->BorderRect().iBr.iY - next->MarginRect().iBr.iY; + + if ( nextSiblingsBottomMargin > thisSiblingsTopMargin ) + { + usedSiblingHeight -= thisSiblingsTopMargin; + } + } + } + } + } + + return TSize( usedSiblingWidth, usedSiblingHeight ); + } + +// ----------------------------------------------------------------------------- +// CalculateTotalDimensionsL() +// Scale dimensions for areas that have properties set to AUTO. +// ----------------------------------------------------------------------------- +// +static TSize CalculateTotalDimensionsL( CXnNode& aNode, TBool aIgnoreAutoValues, + TBool aIgnoreMinSizes, TRect& aParentRect, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + // AUTO areas return their defined dimensions if not ignored + // if ignored, 0 is returned as area dimensions + CXnProperty* width( aNode.WidthL() ); + CXnProperty* height( aNode.HeightL() ); + TInt adaptive( aNode.IsAdaptive() ); + TBool autoNotFound( EFalse ); + + if ( adaptive ) + { + // Force to measure adaptive size + aIgnoreAutoValues = EFalse; + autoNotFound = ETrue; + } + if ( aIgnoreAutoValues ) + { + TInt horizontalAuto( HasNodeHorizontalAutoValuesL( aNode ) ); + TInt verticalAuto( HasNodeVerticalAutoValuesL( aNode ) ); + if ( horizontalAuto && verticalAuto ) + { + return TSize( 0, 0 ); + } + else if ( horizontalAuto ) + { + TInt h = VerticalPixelValueL( height, aParentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ); + return TSize( 0, h ); + } + else if ( verticalAuto ) + { + TInt w = HorizontalPixelValueL( width, aParentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ); + return TSize( w, 0 ); + } + autoNotFound = ETrue; + } + + TInt x( 0 ); + TInt y( 0 ); + + if ( !aIgnoreMinSizes ) + { + if ( !autoNotFound && HasNodeAutoValuesL( aNode ) ) + { + // if auto values, check minimum sizes + if ( height ) + { + if ( IsPropertyAutoL( *height ) ) + { + CXnProperty* minheight( aNode.MinHeightL() ); + if ( minheight ) + { + if ( !IsPropertyNone( *minheight ) ) + { + y += VerticalPixelValueL( minheight, + aParentRect.Height(), aGraphicsDevice, + aVerticalUnitInPixels ); + } + } + } + } + if ( width ) + { + if ( IsPropertyAutoL( *width ) ) + { + CXnProperty* minwidth( aNode.MinWidthL() ); + if ( minwidth ) + { + if ( !IsPropertyNone( *minwidth ) ) + { + x += HorizontalPixelValueL( minwidth, + aParentRect.Width(), aGraphicsDevice, + aHorizontalUnitInPixels ); + } + } + } + } + } + } + + CXnProperty* marginLeft = aNode.MarginLeftL(); + CXnProperty* marginRight = aNode.MarginRightL(); + CXnProperty* borderLeft = aNode.BorderLeftL(); + CXnProperty* borderRight = aNode.BorderRightL(); + CXnProperty* paddingLeft = aNode.PaddingLeftL(); + CXnProperty* paddingRight = aNode.PaddingRightL(); + CXnProperty* marginTop = aNode.MarginTopL(); + CXnProperty* marginBottom = aNode.MarginBottomL(); + CXnProperty* borderTop = aNode.BorderTopL(); + CXnProperty* borderBottom = aNode.BorderBottomL(); + CXnProperty* paddingTop = aNode.PaddingTopL(); + CXnProperty* paddingBottom = aNode.PaddingBottomL(); + CXnProperty* borderWidth = aNode.BorderWidthL(); + CXnProperty* borderStyle = aNode.BorderStyleL(); + CXnProperty* borderImage = aNode.BorderImageL(); + CXnProperty* borderLeftStyle = aNode.BorderLeftStyleL(); + CXnProperty* borderRightStyle = aNode.BorderRightStyleL(); + CXnProperty* borderTopStyle = aNode.BorderTopStyleL(); + CXnProperty* borderBottomStyle = aNode.BorderBottomStyleL(); + + TInt borderWidthValue( 0 ); + TInt borderHeightValue( 0 ); + TInt ignore; + + if ( marginLeft ) + { + if ( autoNotFound || !IsPropertyAutoL( *marginLeft ) ) + { + x += HorizontalPixelValueL( marginLeft, aParentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ); + } + } + if ( marginRight ) + { + if ( autoNotFound || !IsPropertyAutoL( *marginRight ) ) + { + x += HorizontalPixelValueL( marginRight, aParentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ); + } + } + if ( paddingLeft ) + { + TRAP_IGNORE( x += HorizontalPixelValueL( paddingLeft, + aParentRect.Width(), aGraphicsDevice, aHorizontalUnitInPixels ) ); + } + if ( paddingRight ) + { + TRAP_IGNORE( x += HorizontalPixelValueL( paddingRight, + aParentRect.Width(), aGraphicsDevice, aHorizontalUnitInPixels ) ); + } + if ( marginTop ) + { + if ( autoNotFound || !IsPropertyAutoL( *marginTop ) ) + { + y += VerticalPixelValueL( marginTop, aParentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ); + } + } + if ( marginBottom ) + { + if ( autoNotFound || !IsPropertyAutoL( *marginBottom ) ) + { + y += VerticalPixelValueL( marginBottom, aParentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ); + } + } + if ( paddingTop ) + { + TRAP_IGNORE( y += VerticalPixelValueL( paddingTop, + aParentRect.Height(), aGraphicsDevice, aVerticalUnitInPixels ) ); + } + if ( paddingBottom ) + { + TRAP_IGNORE( y += VerticalPixelValueL( paddingBottom, + aParentRect.Height(), aGraphicsDevice, aVerticalUnitInPixels ) ); + } + // is border image or border style defined? + // if not, borders are ignored + if ( borderWidth ) + { + if ( borderImage || borderStyle ) + { + DetermineBorderWidthsL( borderWidth, borderWidthValue, + borderHeightValue, aParentRect, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + x += ( borderWidthValue * 2 ); + y += ( borderHeightValue * 2 ); + } + } + if ( borderLeft ) + { + if ( borderImage || borderStyle || borderLeftStyle ) + { + x -= borderWidthValue; + TInt borderLeftValue( 0 ); + DetermineBorderWidthsL( borderLeft, ignore, borderLeftValue, + aParentRect, aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + x += borderLeftValue; + } + } + if ( borderRight ) + { + if ( borderImage || borderStyle || borderRightStyle ) + { + x -= borderWidthValue; + TInt borderRightValue( 0 ); + DetermineBorderWidthsL( borderRight, ignore, borderRightValue, + aParentRect, aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + x += borderRightValue; + } + } + if ( borderTop ) + { + if ( borderImage || borderStyle || borderTopStyle ) + { + y -= borderHeightValue; + TInt borderTopValue( 0 ); + DetermineBorderWidthsL( borderTop, borderTopValue, ignore, + aParentRect, aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + y += borderTopValue; + } + } + if ( borderBottom ) + { + if ( borderImage || borderStyle || borderBottomStyle ) + { + y -= borderHeightValue; + TInt borderBottomValue( 0 ); + DetermineBorderWidthsL( borderBottom, borderBottomValue, ignore, + aParentRect, aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + y += borderBottomValue; + } + } + + TInt maxHeight( 0 ); + TInt maxWidth( 0 ); + TInt minHeight( 0 ); + TInt minWidth( 0 ); + + if ( HasNodeMinSizesL( aNode ) ) + { + CXnProperty* heightproperty( aNode.HeightL() ); + CXnProperty* widthproperty( aNode.WidthL() ); + if ( heightproperty ) + { + CXnProperty* minheightproperty( aNode.MinHeightL() ); + if ( minheightproperty ) + { + if ( !IsPropertyNone( *minheightproperty ) ) + { + minHeight = VerticalPixelValueL( minheightproperty, + aParentRect.Height(), aGraphicsDevice, + aVerticalUnitInPixels ); + } + } + } + if ( widthproperty ) + { + CXnProperty* minwidthproperty( aNode.MinWidthL() ); + if ( minwidthproperty ) + { + if (!IsPropertyNone( *minwidthproperty ) ) + { + minWidth = HorizontalPixelValueL( minwidthproperty, + aParentRect.Width(), aGraphicsDevice, + aHorizontalUnitInPixels ); + } + } + } + } + if ( HasNodeMaxSizesL( aNode ) ) + { + CXnProperty* heightProperty( aNode.HeightL() ); + CXnProperty* widthProperty( aNode.WidthL() ); + if ( heightProperty ) + { + CXnProperty* maxHeightProperty( aNode.MaxHeightL() ); + if ( maxHeightProperty ) + { + if ( !IsPropertyNone( *maxHeightProperty ) ) + { + maxHeight = VerticalPixelValueL( maxHeightProperty, + aParentRect.Height(), aGraphicsDevice, + aVerticalUnitInPixels ); + } + } + } + if ( widthProperty ) + { + CXnProperty* maxWidthProperty( aNode.MaxWidthL() ); + if ( maxWidthProperty ) + { + if ( !IsPropertyNone( *maxWidthProperty ) ) + { + maxWidth = HorizontalPixelValueL( maxWidthProperty, + aParentRect.Width(), aGraphicsDevice, + aHorizontalUnitInPixels ); + } + } + } + } + if ( width && height ) + { + if ( ( adaptive & XnAdaptive::EWidth ) && + ( adaptive & XnAdaptive::EHeight ) ) + { + TSize available( aParentRect.Size() - TSize( x, y ) ); + if ( available.iWidth > 0 ) + { + if ( available.iWidth > maxWidth && maxWidth > 0 ) + { + available.iWidth = maxWidth; + } + } + if ( available.iHeight > 0 ) + { + if ( available.iHeight > maxHeight && maxHeight > 0 ) + { + available.iHeight = maxHeight; + } + } + TSize size( aNode.MeasureAdaptiveContentL( available ) ); + x += size.iWidth; + y += size.iHeight; + if ( minWidth > x ) + { + x = minWidth; + } + if ( minHeight > y ) + { + y = minHeight; + } + return TSize( x, y ); + } + } + if ( width ) + { + if ( adaptive & XnAdaptive::EWidth ) + { + TSize available( aParentRect.Size() - TSize( x, y ) ); + if ( available.iWidth > 0 ) + { + if ( available.iWidth > maxWidth && maxWidth > 0 ) + { + available.iWidth = maxWidth; + } + x += aNode.MeasureAdaptiveContentL( available ).iWidth; + if ( minWidth > x ) + { + x = minWidth; + } + } + } + else if ( autoNotFound || !IsPropertyAutoL( *width ) ) + { + x += HorizontalPixelValueL( width, aParentRect.Width(), + aGraphicsDevice, aHorizontalUnitInPixels ); + } + } + if ( height ) + { + if ( adaptive & XnAdaptive::EHeight ) + { + TSize available( aParentRect.Size() - TSize( x, y ) ); + if ( available.iHeight > 0 ) + { + if ( available.iHeight > maxHeight && maxHeight > 0 ) + { + available.iHeight = maxHeight; + } + y += aNode.MeasureAdaptiveContentL( available ).iHeight; + if ( minHeight > y ) + { + y = minHeight; + } + } + } + else if ( autoNotFound || !IsPropertyAutoL( *height ) ) + { + y += VerticalPixelValueL( height, aParentRect.Height(), + aGraphicsDevice, aVerticalUnitInPixels ); + } + } + return TSize( x, y ); + } + +// ----------------------------------------------------------------------------- +// CutOnePixelFromPercentChildNodeL() +// If node has a child node with percentace defined sizes, +// one pixel may be cut off from it to fix possible rounding problem. +// ----------------------------------------------------------------------------- +// +static TBool CutOnePixelFromPercentChildNodeL( CXnNode& aNode, + const TDesC8& aParentBlockProgression ) + { + RPointerArray< CXnNode >& children = aNode.Children(); + // find the last percent value node + // possible percent values: + // width + // height + // paddings + // margins + // borders + for ( TInt i = children.Count() -1; i < -1 ; --i ) + { + CXnNode* currentNode = children[i]; + + TInt x = 0; + TInt y = 0; + + CXnProperty* widthHeight; + CXnProperty* paddingTopLeft; + CXnProperty* paddingBottomRight; + CXnProperty* borderTopLeft; + CXnProperty* borderBottomRight; + CXnProperty* marginTopLeft; + CXnProperty* marginBottomRight; + + if ( ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KLR ) || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KRL ) + { + x = -1; + y = 0; + widthHeight = currentNode->WidthL(); + paddingTopLeft = currentNode->PaddingLeftL(); + paddingBottomRight = currentNode->PaddingRightL(); + borderTopLeft = currentNode->BorderLeftL(); + borderBottomRight = currentNode->BorderRightL(); + marginTopLeft = currentNode->MarginLeftL(); + marginBottomRight = currentNode->MarginRightL(); + } + else + { + y = -1; + x = 0; + widthHeight = currentNode->HeightL(); + paddingTopLeft = currentNode->PaddingTopL(); + paddingBottomRight = currentNode->PaddingBottomL(); + borderTopLeft = currentNode->BorderTopL(); + borderBottomRight = currentNode->BorderBottomL(); + marginTopLeft = currentNode->MarginTopL(); + marginBottomRight = currentNode->MarginBottomL(); + } + if ( widthHeight ) + { + if ( IsValuePercentageL( *widthHeight ) ) + { + // shrink width one pixel + TRect rect( currentNode->Rect() ); + rect.Resize( x, y ); + currentNode->SetRect( rect ); + TRect paddingRect( currentNode->PaddingRect() ); + paddingRect.Resize( x, y ); + currentNode->SetPaddingRect( paddingRect ); + TRect borderRect( currentNode->BorderRect() ); + borderRect.Resize( x, y ); + TRect marginRect( currentNode->MarginRect() ); + + marginRect.Resize( x, y ); + + currentNode->SetMarginRect( marginRect ); + + return ETrue; + } + } + if ( paddingTopLeft ) + { + if ( IsValuePercentageL( *paddingTopLeft ) ) + { + // shrink left padding one pixel + TRect rect( currentNode->Rect() ); + rect.Move( x, y ); + currentNode->SetRect( rect ); + TRect paddingRect( currentNode->PaddingRect() ); + paddingRect.Resize( x, y ); + currentNode->SetPaddingRect( paddingRect ); + TRect borderRect( currentNode->BorderRect() ); + TRect normalFlowBorderRect( + currentNode->NormalFlowBorderRect() ); + borderRect.Resize( x, y ); + normalFlowBorderRect.Resize( x, y ); + currentNode->SetBorderRect( borderRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + TRect marginRect( currentNode->MarginRect() ); + + marginRect.Resize( x, y ); + + currentNode->SetMarginRect( marginRect ); + + return ETrue; + } + } + if ( paddingBottomRight ) + { + if ( IsValuePercentageL( *paddingBottomRight ) ) + { + // shrink right padding one pixel + TRect paddingRect( currentNode->PaddingRect() ); + paddingRect.Resize( x, y ); + currentNode->SetPaddingRect( paddingRect ); + TRect borderRect( currentNode->BorderRect() ); + TRect normalFlowBorderRect( + currentNode->NormalFlowBorderRect() ); + borderRect.Resize( x, y ); + normalFlowBorderRect.Resize( x, y ); + currentNode->SetBorderRect( borderRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + TRect marginRect( currentNode->MarginRect() ); + + marginRect.Resize( x, y ); + + currentNode->SetMarginRect( marginRect ); + + return ETrue; + } + } + if ( borderTopLeft ) + { + if ( IsValuePercentageL( *borderTopLeft ) ) + { + TRect rect( currentNode->Rect() ); + rect.Move( x, y ); + currentNode->SetRect( rect ); + TRect paddingRect( currentNode->PaddingRect() ); + paddingRect.Move( x, y ); + currentNode->SetPaddingRect( paddingRect ); + TRect borderRect( currentNode->BorderRect() ); + TRect normalFlowBorderRect( + currentNode->NormalFlowBorderRect() ); + borderRect.Resize( x, y ); + normalFlowBorderRect.Resize( x, y ); + currentNode->SetBorderRect( borderRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + TRect marginRect( currentNode->MarginRect() ); + + marginRect.Resize( x, y ); + + currentNode->SetMarginRect( marginRect ); + + return ETrue; + } + } + if ( borderBottomRight ) + { + if ( IsValuePercentageL( *borderBottomRight ) ) + { + TRect borderRect( currentNode->BorderRect() ); + TRect normalFlowBorderRect( currentNode->BorderRect() ); + borderRect.Resize( x, y ); + normalFlowBorderRect.Resize( x, y ); + currentNode->SetBorderRect( borderRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + TRect marginRect( currentNode->MarginRect() ); + + marginRect.Resize( x, y ); + + currentNode->SetMarginRect( marginRect ); + + return ETrue; + } + } + if ( marginTopLeft ) + { + if ( IsValuePercentageL( *marginTopLeft ) ) + { + TRect rect( currentNode->Rect() ); + rect.Move( x, y ); + currentNode->SetRect( rect ); + TRect paddingRect( currentNode->PaddingRect() ); + paddingRect.Move( x, y ); + currentNode->SetPaddingRect( paddingRect ); + TRect borderRect( currentNode->BorderRect() ); + TRect normalFlowBorderRect( + currentNode->NormalFlowBorderRect() ); + borderRect.Move( x, y ); + normalFlowBorderRect.Move( x, y ); + currentNode->SetBorderRect( borderRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + TRect marginRect( currentNode->MarginRect() ); + + marginRect.Resize( x, y ); + + currentNode->SetMarginRect( marginRect ); + + return ETrue; + } + } + if ( marginBottomRight ) + { + if ( IsValuePercentageL( *marginBottomRight ) ) + { + TRect marginRect( currentNode->MarginRect() ); + + marginRect.Resize( x, y ); + + currentNode->SetMarginRect( marginRect ); + + return ETrue; + } + } + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// DetermineBorderWidthsL() +// Determine border widths. +// ----------------------------------------------------------------------------- +// +static void DetermineBorderWidthsL( CXnProperty* aBorderWidthProperty, + TInt& aBordervertical, TInt& aBorderhorizontal, TRect& aParentRect, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + CXnDomList& propertyValueList = + aBorderWidthProperty->Property()->PropertyValueList(); + for ( TInt i = propertyValueList.Length() - 1; i >= 0; --i ) + { + CXnDomPropertyValue* value = + static_cast< CXnDomPropertyValue* >( propertyValueList.Item( i ) ); + if ( value->PrimitiveValueType() == CXnDomPropertyValue::EString || + value->PrimitiveValueType() == CXnDomPropertyValue::EIdent ) + { + // border width was defined as string + const TDesC8& borderwidth = aBorderWidthProperty->StringValue(); + if ( borderwidth == + XnPropertyNames::style::common::border_width::KThin ) + { + aBordervertical = KXnBorderThin; + aBorderhorizontal = KXnBorderThin; + } + else if ( borderwidth == + XnPropertyNames::style::common::border_width::KMedium ) + { + aBordervertical = KXnBorderMedium; + aBorderhorizontal = KXnBorderMedium; + } + else + { + aBordervertical = KXnBorderThick; + aBorderhorizontal = KXnBorderThick; + } + } + else + { + // border width was defined as int + aBordervertical = VerticalPixelValueL( aBorderWidthProperty, + aParentRect.Height(), aGraphicsDevice, aVerticalUnitInPixels ); + aBorderhorizontal = HorizontalPixelValueL( aBorderWidthProperty, + aParentRect.Width(), aGraphicsDevice, aHorizontalUnitInPixels ); + } + } + } + +// ----------------------------------------------------------------------------- +// DisplayedChildrenCountL() +// Return number of node's displayed children. +// ----------------------------------------------------------------------------- +// +static TInt DisplayedChildrenCountL( CXnNode& aNode, + RPointerArray< CXnNode >* aDisplayedChildren ) + { + RPointerArray< CXnNode >& children = aNode.Children(); + TInt displayedCount( 0 ); + + for ( TInt i = 0; i < children.Count(); i++ ) + { + CXnNode* node( children[i] ); + if ( IsNodeDisplayedL( *node ) && !node->IsDropped() && + !IsAbsoluteL( *node ) && !IsNodeTooltip( *node ) ) + { + if ( aDisplayedChildren ) + { + aDisplayedChildren->AppendL( node ); + } + displayedCount++; + } + } + + return displayedCount; + } + +// ----------------------------------------------------------------------------- +// DisplayedParentL() +// Return node's displayed parent. +// ----------------------------------------------------------------------------- +// +static CXnNode* DisplayedParentL( CXnNode& aNode ) + { + if ( aNode.ViewNodeImpl() ) + { + return &aNode; + } + CXnNode* parent = aNode.Parent(); + return parent; + } + +// ----------------------------------------------------------------------------- +// DomPropertyValueFromProperty() +// Return DOM property value from property. +// ----------------------------------------------------------------------------- +// +static CXnDomPropertyValue* DomPropertyValueFromProperty( + CXnProperty* aProperty ) + { + if ( !aProperty ) + { + return NULL; + } + CXnDomProperty* domProperty = aProperty->Property(); + if ( !domProperty ) + { + return NULL; + } + return static_cast< + CXnDomPropertyValue* >( domProperty->PropertyValueList().Item( 0 ) ); + } + +// ----------------------------------------------------------------------------- +// DomPropertyValueFromProperty() +// Return DOM property value from property. +// ----------------------------------------------------------------------------- +// +static TBool IsChildOfScrollableControl( CXnNode& aNode ) + { + CXnNode* parent = &aNode; + while( parent ) + { + if( IsSrollableBox( *parent ) ) + { + return ETrue; + } + parent = parent->Parent(); + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// DropExceedingRectL() +// Drop node if node's margin rect exceeds it's parent's content rect. +// ----------------------------------------------------------------------------- +// +static void DropExceedingRectL( const TRect& aParentRect, CXnNode& aNode, + TBool aDropRelativeNode ) + { + if( IsChildOfScrollableControl( aNode ) ) + { + return; + } + + if ( IsNodeTooltip( aNode ) ) + { + // tooltip never dropped + return; + } + + CXnProperty* positionProp( aNode.PositionL() ); + + if ( positionProp ) + { + const TDesC8& value( positionProp->StringValue() ); + if ( value == XnPropertyNames::style::common::position::KFloating ) + { + // Don't change floating positioned box dimensions + return; + } + } + + TRect parentRect( aParentRect ); + TRect marginRect( aNode.MarginRect() ); + + // does the margin rect fit in its parent? + TInt parentLeft = parentRect.iTl.iX; + TInt parentRight = parentRect.iBr.iX; + TInt parentTop = parentRect.iTl.iY; + TInt parentBottom = parentRect.iBr.iY; + + TInt rectLeft = marginRect.iTl.iX; + TInt rectRight = marginRect.iBr.iX; + TInt rectTop = marginRect.iTl.iY; + TInt rectBottom = marginRect.iBr.iY; + + TInt priority = 0; + CXnProperty* priorityProperty = aNode.DisplayPriorityL(); + + if ( priorityProperty ) + { + TRAPD( error, priority = priorityProperty->FloatValueL() ); + if ( error != KErrNone ) + { + priority = 0; + } + } + + TInt leftOffset( 0 ); + TInt rightOffset( 0 ); + TInt topOffset( 0 ); + TInt bottomOffset( 0 ); + + if ( priority != 0 ) + { + TBool drop = CalculateExceedingArea( *aNode.Parent(), aNode, + leftOffset, rightOffset, topOffset, bottomOffset ); + if ( drop ) + { + aNode.UiEngine()->SetNodeDroppedL( aNode, XnNodeLayout::EDropped ); + } + } + // If display priority is 0 as much as possible must be shown, but + // parent's content rect must not be exceeded. + else + { + // This must not be done for tracster. It is a special component, + // which takes care + // of its final layout and therefore its children can exceed + // the parent's rect. + CXnNode* parent = aNode.Parent(); + + // If the node is relatively positioned, and this is not called from + // CalculateRelativePositionsL(), then must not be cropped!! + + // Default is static + const TDesC8* value( + &XnPropertyNames::style::common::position::KStatic() ); + + if ( positionProp && positionProp->StringValue() != KNullDesC8 ) + { + value = &positionProp->StringValue(); + } + if ( !aDropRelativeNode && + XnPropertyNames::style::common::position::KRelative() == *value ) + // relative nodes must not be adjusted, if this is not called + // from CalculateRelativePositionsL(). + { + return; + } + if ( rectLeft < parentLeft ) + { + leftOffset = parentLeft - rectLeft; + } + if ( rectRight > parentRight ) + { + rightOffset = rectRight - parentRight; + } + if ( rectTop < parentTop ) + { + topOffset = parentTop - rectTop; + } + if ( rectBottom > parentBottom ) + { + bottomOffset = rectBottom - parentBottom; + } + AdjustRectsL( aNode, leftOffset, rightOffset, topOffset, bottomOffset ); + } + } + +// ----------------------------------------------------------------------------- +// CalculateExceedingArea() +// Calculates how much a dropped node affects to the area of its parent +// that is content based node. +// Returns whether a child's margin rect exceeds its parents content +// rect or not. +// ----------------------------------------------------------------------------- +// +static TBool CalculateExceedingArea( CXnNode& aParent, CXnNode& aChild, + TInt& aLeftOffset, TInt& aRightOffset, TInt& aTopOffset, + TInt& aBottomOffset ) + { + TBool ret( EFalse ); + + TRect parentRect( aParent.Rect() ); + TInt parentLeft = parentRect.iTl.iX; + TInt parentRight = parentRect.iBr.iX; + TInt parentTop = parentRect.iTl.iY; + TInt parentBottom = parentRect.iBr.iY; + + TRect marginRect( aChild.MarginRect() ); + TInt rectLeft = marginRect.iTl.iX; + TInt rectRight = marginRect.iBr.iX; + TInt rectTop = marginRect.iTl.iY; + TInt rectBottom = marginRect.iBr.iY; + + TInt adaptive( aParent.IsAdaptive() ); + + if ( rectLeft < parentLeft ) + { + if ( adaptive & XnAdaptive::EWidth ) + { + aLeftOffset = rectRight - parentLeft; + if ( aLeftOffset < 0 ) + { + aLeftOffset = 0; + } + } + ret = ETrue; + } + if ( rectRight > parentRight ) + { + if ( adaptive & XnAdaptive::EWidth ) + { + aRightOffset = parentRight - rectLeft; + if ( aRightOffset < 0 ) + { + aRightOffset = 0; + } + } + ret = ETrue; + } + if ( rectTop < parentTop ) + { + if ( adaptive & XnAdaptive::EHeight ) + { + aTopOffset = rectBottom - parentTop; + if ( aTopOffset < 0 ) + { + aTopOffset = 0; + } + } + ret = ETrue; + } + if ( rectBottom > parentBottom ) + { + if ( adaptive & XnAdaptive::EHeight ) + { + aBottomOffset = parentBottom - rectTop; + if ( aBottomOffset < 0 ) + { + aBottomOffset = 0; + } + } + ret = ETrue; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// AdjustRectsL() +// Adjust all the rects according to the given offsets. +// ----------------------------------------------------------------------------- +// +static void AdjustRectsL( CXnNode& aNode, TInt aLeftOffset, TInt aRightOffset, + TInt aTopOffset, TInt aBottomOffset ) + { + if ( aLeftOffset || aRightOffset || aTopOffset || aBottomOffset ) + { +#ifdef _XN3_DEBUG_ + CXnProperty* id( aNode.IdL() ); + + if ( id ) + { + TBuf8< 256 > debug; + debug.Append( _L8( "Node id: " ) ); + debug.Append( id->StringValue() ); + debug.Append( _L8( "doesn't fit to parent and will be adjusted" ) ); + + RDebug::RawPrint( debug ); + } +#endif + + // Adjust margin rect + TRect marginRect( aNode.MarginRect() ); + TRect newRect = TRect( marginRect.iTl.iX + aLeftOffset, + marginRect.iTl.iY + aTopOffset, marginRect.iBr.iX - aRightOffset, + marginRect.iBr.iY - aBottomOffset ); + aNode.SetMarginRect( newRect ); + + // Adjust border rect + TRect borderRect( aNode.BorderRect() ); + newRect = TRect( borderRect.iTl.iX + aLeftOffset, + borderRect.iTl.iY + aTopOffset, borderRect.iBr.iX - aRightOffset, + borderRect.iBr.iY - aBottomOffset ); + aNode.SetBorderRect( newRect ); + + // Adjust normal flow border rect + TRect normalFlowBorderRect( aNode.NormalFlowBorderRect() ); + newRect = TRect( normalFlowBorderRect.iTl.iX + aLeftOffset, + normalFlowBorderRect.iTl.iY + aTopOffset, + normalFlowBorderRect.iBr.iX - aRightOffset, + normalFlowBorderRect.iBr.iY - aBottomOffset ); + aNode.SetNormalFlowBorderRect( newRect ); + + // Adjust padding rect + TRect paddingRect( aNode.PaddingRect() ); + newRect = TRect( paddingRect.iTl.iX + aLeftOffset, + paddingRect.iTl.iY + aTopOffset, paddingRect.iBr.iX - aRightOffset, + paddingRect.iBr.iY - aBottomOffset ); + aNode.SetPaddingRect( newRect ); + + // Adjust content rect + TRect contentRect( aNode.Rect() ); + newRect = TRect( contentRect.iTl.iX + aLeftOffset, + contentRect.iTl.iY + aTopOffset, contentRect.iBr.iX - aRightOffset, + contentRect.iBr.iY - aBottomOffset ); + aNode.SetRect( newRect ); + } + } + +// ----------------------------------------------------------------------------- +// ClearRects() +// Sets sizes of the rects to 0. +// ----------------------------------------------------------------------------- +// +static void ClearRects( CXnNode& aNode, TBool aRecurse ) + { + TRect empty; + + aNode.SetRect( empty ); + aNode.SetPaddingRect( empty ); + aNode.SetBorderRect( empty ); + aNode.SetNormalFlowBorderRect( empty ); + aNode.SetMarginRect( empty ); + + CCoeControl* control( aNode.Control() ); + + if ( control ) + { + control->SetRect( empty ); + } + + if ( aRecurse ) + { + RPointerArray< CXnNode >& children( aNode.Children() ); + for ( TInt i = 0; i < children.Count(); i++ ) + { + ClearRects( *children[i], aRecurse ); + } + } + } + +// ----------------------------------------------------------------------------- +// FitChildrenIntoParentL() +// Drop child nodes until they fit into the parent. Also, if node has +// a child node with percentace defined sizes, one pixel may be cut off from it +// to fix possible rounding problem. +// ----------------------------------------------------------------------------- +// +static void FitChildrenIntoParentL( CXnNode& aNode, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + if( IsSrollableBox( aNode ) ) + { + return; + } + RPointerArray< CXnNode >& children( aNode.Children() ); + + if ( children.Count() == 0 ) + { + return; + } + + CXnProperty* blockProgressionProperty( aNode.BlockProgressionL() ); + CXnProperty* directionProperty( aNode.DirectionL() ); + + const TDesC8* blockProgression = NULL; + + if ( !blockProgressionProperty ) + { + // using default + blockProgression = + &XnPropertyNames::style::common::block_progression::KTB(); + } + else + { + blockProgression = &blockProgressionProperty->StringValue(); + } + + const TDesC8* direction( NULL ); + + if ( !directionProperty ) + { + // use default + direction = &XnPropertyNames::style::common::direction::KLTR(); + } + else + { + direction = &directionProperty->StringValue(); + } + + TSize space = CalculateSpaceUsedByChildrenL( children, aNode, + *blockProgression, *direction, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + TSize parentSize( aNode.Rect().Size() ); + + while( ( ( parentSize.iHeight < space.iHeight ) && + ( parentSize.iHeight > 0 ) ) || + ( ( parentSize.iWidth < space.iWidth ) && + ( parentSize.iWidth > 0 ) ) ) + { + // if areas go over just one pixel, + // cut the pixel from a percent sized node + if ( ( parentSize.iHeight == space.iHeight - 1 ) || + ( parentSize.iWidth == space.iWidth - 1 ) ) + { + CutOnePixelFromPercentChildNodeL( aNode, *blockProgression ); + // Childs are now in parent size + return; + } + + TInt childCount( DisplayedChildrenCountL( aNode ) ); + + PriorizeChildrenL( aNode ); + + if ( DisplayedChildrenCountL( aNode ) == childCount ) + { + // cannot drop any more children, but they still don't fit + return; + } + + space = CalculateSpaceUsedByChildrenL( children, aNode, + *blockProgression, *direction, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + } + + return; + } + +// ----------------------------------------------------------------------------- +// GetPositionL() +// Return position coordinate of a CXnComponent. Returned position depends on +// given block progression. +// ----------------------------------------------------------------------------- +// +static TInt GetPositionL( CXnNode& aNode, const TDesC8& aParentBlockProgression, + const TDesC8& aParentDirection ) + { + TInt returnValue = 0; + if ( aParentDirection == XnPropertyNames::style::common::direction::KLTR ) + { + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KBT ) + { + returnValue = aNode.NormalFlowBorderRect().iBr.iY; + } + else // LR or RL + { + returnValue = aNode.NormalFlowBorderRect().iBr.iX; + } + } + else // RTL + { + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KBT ) + { + returnValue = aNode.NormalFlowBorderRect().iTl.iY; + } + else // LR or RL + { + returnValue = aNode.NormalFlowBorderRect().iTl.iX; + } + } + return returnValue; + } + +// ----------------------------------------------------------------------------- +// HasNodeAutoValues() +// Check if node has properties set to AUTO. +// ----------------------------------------------------------------------------- +// +static TInt HasNodeAutoValuesL( CXnNode& aNode ) + { + return HasNodeHorizontalAutoValuesL( aNode ) || + HasNodeVerticalAutoValuesL( aNode ); + } + +// ----------------------------------------------------------------------------- +// HasNodeHorizontalValues() +// Check if node has properties set to AUTO. +// ----------------------------------------------------------------------------- +// +static TInt HasNodeHorizontalAutoValuesL( CXnNode& aNode ) + { + TInt autoCount = 0; + + CXnProperty* width = aNode.WidthL(); + + if ( width ) + { + if ( IsPropertyAutoL( *width ) ) + { + autoCount++; + } + } + else + { + // width is auto as default + autoCount++; + } + + CXnProperty* marginleft = aNode.MarginLeftL(); + + if ( marginleft ) + { + if ( IsPropertyAutoL( *marginleft ) ) + { + autoCount++; + } + } + + CXnProperty* marginright = aNode.MarginRightL(); + + if ( marginright ) + { + if ( IsPropertyAutoL( *marginright ) ) + { + autoCount++; + } + } + + if ( !IsAbsoluteL( aNode ) && !IsRelativeL( aNode ) ) + { + return autoCount; + } + + CXnProperty* left = aNode.LeftL(); + + if ( left ) + { + if ( IsPropertyAutoL( *left ) ) + { + autoCount++; + } + } + + CXnProperty* right = aNode.RightL(); + + if ( right ) + { + if ( IsPropertyAutoL( *right ) ) + { + autoCount++; + } + } + + return autoCount; + } + +// ----------------------------------------------------------------------------- +// HasNodeVerticalAutoValues() +// Check if node has properties set to AUTO. +// ----------------------------------------------------------------------------- +// +static TInt HasNodeVerticalAutoValuesL( CXnNode& aNode ) + { + TInt autoCount = 0; + + CXnProperty* height = aNode.HeightL(); + + if ( height ) + { + if ( IsPropertyAutoL( *height ) ) + { + autoCount++; + } + } + else + { + // height is auto as default + autoCount++; + } + + CXnProperty* margintop = aNode.MarginTopL(); + + if ( margintop ) + { + if ( IsPropertyAutoL( *margintop ) ) + { + autoCount++; + } + } + + CXnProperty* marginbottom = aNode.MarginBottomL(); + + if ( marginbottom ) + { + if ( IsPropertyAutoL( *marginbottom ) ) + { + autoCount++; + } + } + + if ( !IsAbsoluteL( aNode ) && !IsRelativeL( aNode ) ) + { + return autoCount; + } + + CXnProperty* top = aNode.TopL(); + + if ( top ) + { + if ( IsPropertyAutoL( *top ) ) + { + autoCount++; + } + } + + CXnProperty* bottom = aNode.BottomL(); + + if ( bottom ) + { + if ( IsPropertyAutoL( *bottom ) ) + { + autoCount++; + } + } + + return autoCount; + } + +// ----------------------------------------------------------------------------- +// HasNodeMinSizesL() +// Check if node has minimum size values. +// ----------------------------------------------------------------------------- +// +static TBool HasNodeMinSizesL( CXnNode& aNode ) + { + CXnProperty* minWidth = aNode.MinWidthL(); + + if ( minWidth ) + { + if ( !IsPropertyNone( *minWidth ) ) + { + return ETrue; + } + } + + CXnProperty* minHeight = aNode.MinHeightL(); + + if ( minHeight ) + { + if ( !IsPropertyNone( *minHeight ) ) + { + return ETrue; + } + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// HasNodeMaxSizesL() +// Check if node has maximum size values. +// ----------------------------------------------------------------------------- +// +static TBool HasNodeMaxSizesL( CXnNode& aNode ) + { + CXnProperty* maxWidth = aNode.MaxWidthL(); + + if ( maxWidth ) + { + if ( !IsPropertyNone( *maxWidth ) ) + { + return ETrue; + } + } + + CXnProperty* maxHeight = aNode.MaxHeightL(); + + if ( maxHeight ) + { + if ( !IsPropertyNone( *maxHeight ) ) + { + return ETrue; + } + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// HorizontalCentimetersToPixelsL() +// Convert horizontal centimeter value to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt HorizontalCentimetersToPixelsL( TReal& aCentimeters, + CGraphicsDevice& aScreenDevice ) + { + TReal twips = aCentimeters * KCentimetersAsTwips; + TInt intTwips = static_cast< TInt >( twips + KIntConversionConstant ); + return aScreenDevice.HorizontalTwipsToPixels( intTwips ); + } + +// ----------------------------------------------------------------------------- +// HorizontalInchesToPixelsL() +// Convert horizontal inch value to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt HorizontalInchesToPixelsL( TReal& aInches, + CGraphicsDevice& aScreenDevice ) + { + TReal twips = aInches * KInchesAsTwips; + TInt intTwips = static_cast< TInt >( twips + KIntConversionConstant ); + return aScreenDevice.HorizontalTwipsToPixels( intTwips ); + } + +// ----------------------------------------------------------------------------- +// HorizontalMillimetersToPixelsL() +// Convert horizontal millimeter value to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt HorizontalMillimetersToPixelsL( TReal& aMillimeters, + CGraphicsDevice& aScreenDevice ) + { + TReal twips = aMillimeters * KMillimetersAsTwips; + TInt intTwips = static_cast< TInt >( twips + KIntConversionConstant ); + return aScreenDevice.HorizontalTwipsToPixels( intTwips ); + } + +// ----------------------------------------------------------------------------- +// HorizontalPicasToPixelsL() +// Convert horizontal pica value to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt HorizontalPicasToPixelsL( TReal& aPicas, + CGraphicsDevice& aScreenDevice ) + { + TReal twips = aPicas * KPicasAsTwips; + TInt intTwips = static_cast< TInt >( twips + KIntConversionConstant ); + return aScreenDevice.HorizontalTwipsToPixels( intTwips ); + } + +// ----------------------------------------------------------------------------- +// HorizontalPixelValueL() +// Convert horizontal property to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt HorizontalPixelValueL( CXnProperty* aValue, TInt aReferenceValue, + CGraphicsDevice& aScreenDevice, TReal aHorizontalUnitInPixels ) + { + return HorizontalValueToPixelsL( DomPropertyValueFromProperty( aValue ), + static_cast< TReal >( aReferenceValue ), aScreenDevice, + aHorizontalUnitInPixels ); + } + +// ----------------------------------------------------------------------------- +// HorizontalPointsToPixelsL() +// Convert horizontal point value to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt HorizontalPointsToPixelsL( TReal& aPoints, + CGraphicsDevice& aScreenDevice ) + { + TReal twips = aPoints * KPointsAsTwips; + TInt intTwips = static_cast< TInt >( twips + KIntConversionConstant ); + return aScreenDevice.HorizontalTwipsToPixels( intTwips ); + } + +// ----------------------------------------------------------------------------- +// HorizontalUnitsToPixelsL() +// Convert horizontal unit value to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt HorizontalUnitsToPixelsL( TReal aUnits, TReal aUnitInPixels ) + { + TInt pixels = aUnits * aUnitInPixels; + return pixels; + } + +// ----------------------------------------------------------------------------- +// VerticalUnitsToPixelsL() +// Convert vertical unit value to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt VerticalUnitsToPixelsL( TReal aUnits, TReal aUnitInPixels ) + { + TInt pixels = aUnits * aUnitInPixels; + return pixels; + } + +// ----------------------------------------------------------------------------- +// HorizontalValueToPixelsL() +// Convert horizontal property value to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt HorizontalValueToPixelsL( CXnDomPropertyValue* aValue, + TReal aReferenceValue, CGraphicsDevice& aScreenDevice, TReal aUnitInPixels ) + { + if ( !aValue ) + { + User::Leave( KXnErrHorizontalValueNULL ); + } + CXnDomPropertyValue::TPrimitiveValueType valueType = + aValue->PrimitiveValueType(); + // Handle error cases first, inherit is handled elsewhere, none returns 0 + switch ( valueType ) + { + case CXnDomPropertyValue::EUnknown: + case CXnDomPropertyValue::EEms: + case CXnDomPropertyValue::EExs: + case CXnDomPropertyValue::EDeg: + case CXnDomPropertyValue::ERad: + case CXnDomPropertyValue::EGrad: + case CXnDomPropertyValue::EMs: + case CXnDomPropertyValue::ES: + case CXnDomPropertyValue::EHz: + case CXnDomPropertyValue::EKHz: + case CXnDomPropertyValue::EDimension: + case CXnDomPropertyValue::EString: + case CXnDomPropertyValue::EUri: + case CXnDomPropertyValue::EIdent: + case CXnDomPropertyValue::EAttr: + case CXnDomPropertyValue::ECounter: + case CXnDomPropertyValue::ERect: + case CXnDomPropertyValue::ERgbColor: + case CXnDomPropertyValue::ERgbaColor: + case CXnDomPropertyValue::EFunction: + break; + default: + { + TReal value = aValue->FloatValueL(); + if ( valueType == CXnDomPropertyValue::ENumber || + valueType == CXnDomPropertyValue::EPx ) + { + return static_cast< TInt >( value ); + } + else if ( valueType == CXnDomPropertyValue::EPercentage ) + { + return PercentageToPixelsL( value, aReferenceValue ); + } + else if ( valueType == CXnDomPropertyValue::EIn ) + { + return HorizontalInchesToPixelsL( value, aScreenDevice ); + } + else if ( valueType == CXnDomPropertyValue::ECm ) + { + return HorizontalCentimetersToPixelsL( value, aScreenDevice ); + } + else if ( valueType == CXnDomPropertyValue::EMm ) + { + return HorizontalMillimetersToPixelsL( value, aScreenDevice ); + } + else if ( valueType == CXnDomPropertyValue::EPt ) + { + return HorizontalPointsToPixelsL( value, aScreenDevice ); + } + else if ( valueType == CXnDomPropertyValue::EPc ) + { + return HorizontalPicasToPixelsL( value, aScreenDevice ); + } + else if ( valueType == CXnDomPropertyValue::EUnitValue ) + { + return HorizontalUnitsToPixelsL( value, aUnitInPixels ); + } + } + break; + } + + return 0; + } + +// ----------------------------------------------------------------------------- +// IsAbsoluteL() +// Check if node's positioning is absolute. +// ----------------------------------------------------------------------------- +// +static TBool IsAbsoluteL( CXnNode& aNode ) + { + CXnProperty* prop( aNode.PositionL() ); + + if ( prop ) + { + const TDesC8& value( prop->StringValue() ); + if ( value == XnPropertyNames::style::common::position::KAbsolute || + value == XnPropertyNames::style::common::position::KFloating ) + { + return ETrue; + } + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// IsLargerThanMaxSizeL() +// Check if node rect size exceeds it's max sizes. +// ----------------------------------------------------------------------------- +// +static TBool IsLargerThanMaxSizeL( const TRect& aParentRect, CXnNode& aNode, + CGraphicsDevice& aScreenDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + TRect parentRect = aParentRect; + CXnProperty* heightProperty = aNode.HeightL(); + CXnProperty* widthProperty = aNode.WidthL(); + + if ( heightProperty ) + { + CXnProperty* maxHeightProperty = aNode.MaxHeightL(); + if ( maxHeightProperty ) + { + if ( !IsPropertyNone( *maxHeightProperty ) ) + { + TInt maxHeight = VerticalPixelValueL( maxHeightProperty, + parentRect.Height(), aScreenDevice, aVerticalUnitInPixels ); + TInt height = aNode.Rect().Height(); + if ( height > maxHeight ) + { + // height larger than max + return ETrue; + } + } + } + } + + if ( widthProperty ) + { + CXnProperty* maxWidthProperty = aNode.MaxWidthL(); + if ( maxWidthProperty ) + { + if ( !IsPropertyNone( *maxWidthProperty ) ) + { + TInt maxWidth = HorizontalPixelValueL( maxWidthProperty, + parentRect.Width(), aScreenDevice, aHorizontalUnitInPixels ); + TInt width = aNode.Rect().Width(); + if ( width > maxWidth ) + { + // width larger than max + return ETrue; + } + } + } + } + + // width and height within limits + return EFalse; + } + +// ----------------------------------------------------------------------------- +// IsNodeDisplayedL() +// Check if node is able to be displayed. +// ----------------------------------------------------------------------------- +// +static TBool IsNodeDisplayedL( CXnNode& aNode ) + { + if ( !aNode.IsLayoutCapable() ) + { + return EFalse; + } + + // Am I displayed? + CXnProperty* displayProp( aNode.DisplayL() ); + + if ( displayProp ) + { + const TDesC8& display( displayProp->StringValue() ); + + if ( display != XnPropertyNames::style::common::display::KBlock ) + { + return EFalse; + } + } + + CXnNode* parent( aNode.Parent() ); + + // Is my parent displayed? + for ( ; parent; parent = parent->Parent() ) + { + CXnProperty* displayProp( parent->DisplayL() ); + + if ( displayProp ) + { + const TDesC8& display( displayProp->StringValue() ); + + if ( display != XnPropertyNames::style::common::display::KBlock ) + { + return EFalse; + } + } + } + + return ETrue; + } + +// ----------------------------------------------------------------------------- +// IsNodeTooltip() +// Check if node is a tooltip. +// ----------------------------------------------------------------------------- +// +static TBool IsNodeTooltip( CXnNode& aNode ) + { + _LIT8( tooltip, "tooltip" ); + + if ( aNode.Type()->Type() == tooltip ) + { + return ETrue; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// IsPropertyAutoL() +// Check if property is set to AUTO. +// ----------------------------------------------------------------------------- +// +static TBool IsPropertyAutoL( CXnProperty& aProperty ) + { + if ( &aProperty ) + { + TBool returnValue; + TInt index = 0; + CXnDomProperty* domProperty = aProperty.Property(); + CXnDomPropertyValue* domPropertyValue = + static_cast< CXnDomPropertyValue* >( + domProperty->PropertyValueList().Item( index ) ); + returnValue = domPropertyValue->IsAutoIdent(); + if ( !returnValue ) + { + // if return value is string and not auto or none, + // return ETrue because auto is used as default value + if ( IsStringValueL( aProperty ) && !IsPropertyNone( aProperty ) ) + { + return ETrue; + } + } + return returnValue; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// IsPropertyNone() +// Check if property is set to NONE. +// ----------------------------------------------------------------------------- +// +static TBool IsPropertyNone( CXnProperty& aProperty ) + { + if ( &aProperty ) + { + TInt index = 0; + CXnDomProperty* domProperty = aProperty.Property(); + CXnDomPropertyValue* domPropertyValue = + static_cast< CXnDomPropertyValue* >( + domProperty->PropertyValueList().Item( index ) ); + return domPropertyValue->IsNoneIdent(); + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// IsRelativeL() +// Check if node's positioning is absolute. +// ----------------------------------------------------------------------------- +// +static TBool IsRelativeL( CXnNode& aNode ) + { + CXnProperty* positioningProperty = aNode.PositionL(); + if ( positioningProperty ) + { + const TDesC8& positioning = positioningProperty->StringValue(); + if ( positioning == XnPropertyNames::style::common::position::KRelative ) + { + return ETrue; + } + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// IsSmallerThanMinSizeL() +// Check if node rect size is smaller than it's min sizes. +// ----------------------------------------------------------------------------- +// +static TBool IsSmallerThanMinSizeL( const TRect& aParentRect, CXnNode& aNode, + CGraphicsDevice& aScreenDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + TRect parentRect = aParentRect; + CXnProperty* heightproperty = aNode.HeightL(); + CXnProperty* widthproperty = aNode.WidthL(); + + if ( heightproperty ) + { + CXnProperty* minheightproperty = aNode.MinHeightL(); + if ( minheightproperty ) + { + if ( !IsPropertyNone( *minheightproperty ) ) + { + TInt minheight = VerticalPixelValueL( minheightproperty, + parentRect.Height(), aScreenDevice, aVerticalUnitInPixels ); + TInt height = aNode.Rect().Height(); + if ( height < minheight ) + { + // height smaller than minimum + return ETrue; + } + } + } + } + if ( widthproperty ) + { + CXnProperty* minwidthproperty = aNode.MinWidthL(); + if ( minwidthproperty ) + { + if ( !IsPropertyNone( *minwidthproperty ) ) + { + TInt minwidth = HorizontalPixelValueL( minwidthproperty, + parentRect.Width(), aScreenDevice, aHorizontalUnitInPixels ); + TInt width = aNode.Rect().Width(); + if ( width < minwidth ) + { + // width smaller than minimum + return ETrue; + } + } + } + } + // width and height within limits + return EFalse; + } + +// ----------------------------------------------------------------------------- +// IsStringValueL() +// Check if property value is string. +// ----------------------------------------------------------------------------- +// +static TBool IsStringValueL( CXnProperty& aProperty ) + { + CXnDomList& propertyValueList = aProperty.Property()->PropertyValueList(); + CXnDomPropertyValue* value = + static_cast< CXnDomPropertyValue* >( propertyValueList.Item( 0 ) ); + if ( value->PrimitiveValueType() == CXnDomPropertyValue::EString || + value->PrimitiveValueType() == CXnDomPropertyValue::EIdent ) + { + return ETrue; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// IsValuePercentageL() +// Check if property value is percentage. +// ----------------------------------------------------------------------------- +// +static TBool IsValuePercentageL( CXnProperty& aProperty ) + { + CXnDomProperty* domProperty = aProperty.Property(); + CXnDomPropertyValue* domPropertyValue = static_cast< + CXnDomPropertyValue* >( domProperty->PropertyValueList().Item( 0 ) ); + if ( !domPropertyValue ) + { + User::Leave( KXnErrDomPropertyValueNULL ); + } + CXnDomPropertyValue::TPrimitiveValueType valueType = + domPropertyValue->PrimitiveValueType(); + if ( valueType == CXnDomPropertyValue::EPercentage ) + { + return ETrue; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// PercentageToPixelsL() +// Convert percentage value to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt PercentageToPixelsL( TReal& aPercentage, TReal aReferenceValue ) + { + TReal value = aReferenceValue * aPercentage * KIntPercentageConstant; + return static_cast< TInt >( value + KIntConversionConstant ); + } + +// ----------------------------------------------------------------------------- +// GetPreviousNodeL() +// ----------------------------------------------------------------------------- +// +static CXnNode* GetPreviousNodeL( CXnNode& aNode ) + { + CXnNode* returnValue = NULL; + CXnNode* parent = aNode.Parent(); + + if ( !parent ) + { + return returnValue; + } + + RPointerArray< CXnNode >& nodes = parent->Children(); + + for ( TInt currentIndex = 0; currentIndex < nodes.Count(); currentIndex++ ) + { + CXnNode* checkNode = nodes[currentIndex]; + if ( &aNode == checkNode && currentIndex > 0 ) + { + for ( TInt candidateIndex = + currentIndex - 1; candidateIndex >= 0; candidateIndex-- ) + { + checkNode = nodes[candidateIndex]; + if ( IsNodeDisplayedL( *checkNode ) && + !checkNode->IsDropped() && !IsAbsoluteL( *checkNode ) && + !IsNodeTooltip( *checkNode ) ) + { + returnValue = nodes[candidateIndex]; + break; + } + } + } + } + + return returnValue; + } + +// ----------------------------------------------------------------------------- +// PlaceAreasL() +// Move the area rects to their places. All positioning is done here. +// ----------------------------------------------------------------------------- +// +static void PlaceAreasL( CXnNode& aNode, RPointerArray< CXnNode >& aLaidOutList, + TInt aLayoutPhase, CGraphicsDevice& aGraphicsDevice, + TReal aHorizontalUnitInPixels, TReal aVerticalUnitInPixels ) + { + CXnNodeBreadthFirstIterator< CXnNode >* iterator = + CXnNodeBreadthFirstIterator< CXnNode >::NewL( aNode ); + CleanupStack::PushL( iterator ); + + RPointerArray< CXnNode > absoluteNodes; + CleanupClosePushL( absoluteNodes ); + + RPointerArray< CXnNode > relativeNodes; + CleanupClosePushL( relativeNodes ); + + RPointerArray< CXnNode > autoNodes; + CleanupClosePushL( autoNodes ); + + RPointerArray< CXnNode > adaptiveNodes; + CleanupClosePushL( adaptiveNodes ); + + CXnProperty* parentBlockProgressionProperty( NULL ); + CXnProperty* parentDirectionProperty( NULL ); + const TDesC8* parentBlockProgression( NULL ); + const TDesC8* parentDirection( NULL ); + + CXnUiEngine* engine( aNode.UiEngine() ); + TSize maxAvailableSize( engine->ClientRect().Size() ); + + // Start to go through the tree + CXnNode* previous( NULL ); + + CXnNode* parent( NULL ); + TInt columnWidth; + TInt columnMargin; + TRect parentRect; + +#ifdef _XN3_DEBUG_ + RDebug::Print( _L("Xuikon: Layout:") ); + TBuf8< 256 > debug; +#endif + + // Place areas according their parents and positioning + for( CXnNode* node = iterator->Value(); node; node = iterator->NextL() ) + { +#ifdef _XN3_DEBUG_ + debug = node->Type()->Type(); + CXnProperty* id( node->IdL() ); + if ( id ) + { + debug.Append( _L8( ", id: " ) ); + debug.Append( id->StringValue() ); + } +#endif + + if ( node->IsLaidOut() ) + { +#ifdef _XN3_DEBUG_ + debug.Append( _L8( ", already laidout" ) ); + RDebug::RawPrint( debug ); +#endif + + continue; + } + + if ( !IsNodeDisplayedL( *node ) || node->IsDropped() ) + { +#ifdef _XN3_DEBUG_ + debug.Append( _L8( ", not displayed or dropped" ) ); + RDebug::RawPrint( debug ); +#endif + continue; + } + +#ifdef _XN3_DEBUG_ + RDebug::RawPrint( debug ); +#endif + + switch ( aLayoutPhase ) + { + case XnLayoutPhase::ELayout: + if ( aLaidOutList.Find( node ) == KErrNotFound ) + { + aLaidOutList.AppendL( node ); + } + /* flow through */ + case XnLayoutPhase::EMeasure: + if ( node->ViewNodeImpl() ) + { + // check that view's children fit into it + FitChildrenIntoParentL( *node, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + continue; + } + engine->CheckAdaptiveContentL( *node, maxAvailableSize ); + if ( node->IsDropped() ) + { + // Adaptive content check dropped this node + continue; + } + break; + default: + // Should not happen + continue; + } + + if( node->Type()->Type() == KScrollableBoxNodeName ) + { + CXnScrollableControlAdapter* cntrl = node->ScrollableControl(); + if( cntrl ) + { + cntrl->ResetState(); + } + } + + CXnNode* tmpParent( DisplayedParentL( *node ) ); + + // Is parent changed? + if ( tmpParent != parent ) + { + columnWidth = 0; + columnMargin = 0; + if ( parent ) + { + // Process auto areas + ProcessAutoAreasL( *parent, &autoNodes, *parentBlockProgression, + *parentDirection, aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + autoNodes.Reset(); + // Pocess relative areas + for ( TInt i = 0; i < relativeNodes.Count(); i++ ) + { + CalculateRelativePositionsL( parentRect, *relativeNodes[i], + aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + } + relativeNodes.Reset(); + // Process absolute areas + for ( TInt i = 0; i < absoluteNodes.Count(); i++ ) + { + CalculatePaddingL( parentRect, *absoluteNodes[i], + aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + CalculateBorderL( *absoluteNodes[i], parentRect, + aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + CalculateAbsoluteMarginL( *parent, *absoluteNodes[i], NULL, + *parentBlockProgression, *parentDirection, parentRect, + aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + CalculateAbsolutePositionsL( *absoluteNodes[i], parentRect, + aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + } + absoluteNodes.Reset(); + previous = NULL; + } + // Get new parent properties + parent = tmpParent; + parentBlockProgressionProperty = parent->BlockProgressionL(); + parentDirectionProperty = parent->DirectionL(); + if ( !parentBlockProgressionProperty ) + { + // block progression default is tb + parentBlockProgression = + &XnPropertyNames::style::common::block_progression::KTB(); + } + else + { + parentBlockProgression = + &parentBlockProgressionProperty->StringValue(); + } + if ( !parentDirectionProperty ) + { + // direction default is ltr + parentDirection = + &XnPropertyNames::style::common::direction::KLTR(); + } + else + { + parentDirection = &parentDirectionProperty->StringValue(); + } + } + + parentRect = parent->Rect(); + + CalculateRectL( *node, *parent, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + + // Which positioning is used? + CXnProperty* positioningProp( node->PositionL() ); + // Static is the default + const TDesC8* positioning( + &XnPropertyNames::style::common::position::KStatic() ); + + if ( positioningProp ) + { + const TDesC8& value( positioningProp->StringValue() ); + if ( value != KNullDesC8 ) + { + positioning = &value; + } + } + // Adaptive nodes' _must_ be collected here + if ( node->IsAdaptive() && adaptiveNodes.Find( node ) == KErrNotFound ) + { + // Postpone adaptive area processing + adaptiveNodes.AppendL( node ); + } + // Tooltips are processed as absolute areas + TBool absolute( IsAbsoluteL( *node ) || IsNodeTooltip( *node ) ); + if ( !node->ViewNodeImpl() && HasNodeAutoValuesL( *node ) && !absolute ) + { + // if area has auto values, process it later + autoNodes.AppendL( node ); + } + if ( absolute ) + { + // Absolute positioning area found, take it out of normal flow + // Because of that, previous node is not set + // Absolute area is put to a array to be processed later + absoluteNodes.AppendL( node ); + continue; + } + // static or relative positioning + CalculatePaddingL( parentRect, *node, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + CalculateBorderL( *node, parentRect, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + previous = GetPreviousNodeL( *node ); + CalculateMarginL( *parent, *node, previous, *parentBlockProgression, + *parentDirection, parentRect, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels, columnWidth, + columnMargin ); + FitChildrenIntoParentL( *node, aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + if ( XnPropertyNames::style::common::position::KRelative() == + *positioning ) + { + // Relative positioning area found, add it's offset later + relativeNodes.AppendL( node ); + } + previous = node; + } + + if ( parent ) + { + // Are there auto nodes left? + ProcessAutoAreasL( *parent, &autoNodes, *parentBlockProgression, + *parentDirection, aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + // Are there relative nodes left? + for ( TInt i = 0; i < relativeNodes.Count(); i++ ) + { + CalculateRelativePositionsL( parentRect, *relativeNodes[i], + aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + } + // Are there absolute nodes left? + for ( TInt i = 0; i < absoluteNodes.Count(); i++ ) + { + CalculatePaddingL( parentRect, *absoluteNodes[i], aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + CalculateBorderL( *absoluteNodes[i], parentRect, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + CalculateAbsoluteMarginL( *parent, *absoluteNodes[i], NULL, + *parentBlockProgression, *parentDirection, parentRect, + aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + FitChildrenIntoParentL( *absoluteNodes[i], aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + CalculateAbsolutePositionsL( *absoluteNodes[i], parentRect, + aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + } + } + + for ( TInt i = 0; i < adaptiveNodes.Count(); i++ ) + { + // Fix parent size to its childs content size + ProcessAdaptiveAreasL( *adaptiveNodes[i], aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + } + + // close node arrays and destroy iterator + CleanupStack::PopAndDestroy( 5, iterator ); + } + +// ----------------------------------------------------------------------------- +// PriorizeChildrenL() +// Find a child node with highest priority value and drop all +// child nodes with highest priority. +// ----------------------------------------------------------------------------- +// +static void PriorizeChildrenL( CXnNode& aNode ) + { + RPointerArray< CXnNode >& children( aNode.Children() ); + + CXnNode* candidate( NULL ); + TInt highest( 0 ); + + // Find the highest priority value among the children + for ( TInt i = 0; i < children.Count(); i++ ) + { + CXnNode* node( children[i] ); + if ( IsNodeDisplayedL( *node ) && !node->IsDropped() && + !IsAbsoluteL( *node ) && !IsNodeTooltip( *node ) ) + { + CXnProperty* priorityProperty( node->DisplayPriorityL() ); + if ( priorityProperty ) + { + TInt priority( priorityProperty->FloatValueL() ); + if ( priority > highest ) + { + // highest found, set new top priority + highest = priority; + candidate = node; + } + } + } + } + if ( candidate ) + { + aNode.UiEngine()->SetNodeDroppedL( + *candidate, XnNodeLayout::EDropped ); + } + } + +// ----------------------------------------------------------------------------- +// CalculateAutoPropertiesOfNodesL() +// +// ----------------------------------------------------------------------------- +// +static void CalculateAutoPropertiesOfNodesL( + RPointerArray< CXnNode >* aAutoNodeArray, TInt& aWidthAutoCount, + TInt& aHeightAutoCount ) + { + aWidthAutoCount = 0; + aHeightAutoCount = 0; + + // calculate the number of auto properties in each direction + for ( TInt i = 0; i < aAutoNodeArray->Count(); ++i ) + { + CXnNode* tmp = ( *aAutoNodeArray )[i]; + if ( !tmp->IsDropped() ) + { + if ( HasNodeVerticalAutoValuesL( *tmp ) ) + { + ++aHeightAutoCount; + } + if ( HasNodeHorizontalAutoValuesL( *tmp ) ) + { + ++aWidthAutoCount; + } + } + } + if ( aWidthAutoCount == 0 ) + { + aWidthAutoCount = 1; + } + if ( aHeightAutoCount == 0 ) + { + aHeightAutoCount = 1; + } + } + +// ----------------------------------------------------------------------------- +// ProcessAutoAreasL() +// Process nodes with layout properties defined as auto. +// ----------------------------------------------------------------------------- +// +static void ProcessAutoAreasL( CXnNode& aParent, + RPointerArray< CXnNode >* aAutoNodeArray, + const TDesC8& aParentBlockProgression, const TDesC8& aParentDirection, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + TInt autoCount( aAutoNodeArray->Count() ); + + if ( autoCount == 0 ) + { + return; + } + + // Just to be sure, drop others first if needed + FitChildrenIntoParentL( aParent, aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + + TInt originalHeightAutoCount( 0 ); + TInt originalWidthAutoCount( 0 ); + + CalculateAutoPropertiesOfNodesL( aAutoNodeArray, originalWidthAutoCount, + originalHeightAutoCount ); + + TInt heightAutoCount( originalHeightAutoCount ); + TInt widthAutoCount( originalWidthAutoCount ); + + // calculate space to use (parent height and width - placed areas) + CXnNode* parent( &aParent ); + TRect parentRect( parent->Rect() ); + + if( parent->Control() && parent->Control()->OwnsWindow() ) + { + parentRect = TRect( parentRect.iTl - parent->MarginRect().iTl, parentRect.Size() ); + } + + TInt parentWidth( parentRect.Width() ); + TInt parentHeight( parentRect.Height() ); + + RPointerArray< CXnNode >& children( parent->Children() ); + + RPointerArray< CXnNode > layoutedAutoNodes; + CleanupClosePushL( layoutedAutoNodes ); + + TBool layoutedAutoNodesAdded( EFalse ); + TBool layoutingHeight( EFalse ); + TBool layoutingWidth( EFalse ); + + TInt displayedChildCount( DisplayedChildrenCountL( aParent ) ); + + do + { + layoutedAutoNodesAdded = EFalse; + + // count the size used by the non auto nodes and + // auto nodes which have been calculated + TSize calculatedAutosize = CalculateSpaceUsedByAutoChildrenL( + *aAutoNodeArray, layoutedAutoNodes, *parent, + aParentBlockProgression, aParentDirection, aGraphicsDevice ); + + TInt usedSiblingHeight( calculatedAutosize.iHeight ); + TInt usedSiblingWidth( calculatedAutosize.iWidth ); + + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KBT ) + { + // calculate space for each auto area + parentHeight = parentRect.Height() - usedSiblingHeight; + parentHeight = parentHeight / heightAutoCount; + layoutingHeight = ETrue; + } + else // assume that block progression is LR or RL + { + // calculate space for each auto area + parentWidth = parentRect.Width() - usedSiblingWidth; + parentWidth = parentWidth / widthAutoCount; + layoutingWidth = ETrue; + } + for ( TInt i = 0; i < autoCount; i++ ) + { + CXnNode* node( ( *aAutoNodeArray )[i] ); + if ( layoutedAutoNodes.Find( node ) != KErrNotFound ) + { + // The size has already been calculated and fixed + continue; + } + if ( node->IsDropped() ) + { + // The node is dropped, no need to recalculate + continue; + } + CXnProperty* heightProperty = node->HeightL(); + CXnProperty* widthProperty = node->WidthL(); + CXnProperty* marginLeft = node->MarginLeftL(); + CXnProperty* marginRight = node->MarginRightL(); + CXnProperty* marginTop = node->MarginTopL(); + CXnProperty* marginBottom = node->MarginBottomL(); + TInt freeHeight = parentHeight; + TInt freeWidth = parentWidth; + TBool verticalValuesAuto = IsPropertyAutoL( *heightProperty ) || + IsPropertyAutoL( *marginTop ) || + IsPropertyAutoL( *marginBottom ); + if ( !verticalValuesAuto == !heightProperty ) + { + verticalValuesAuto = ETrue; + } + TBool horizontalValuesAuto = IsPropertyAutoL( *widthProperty ) || + IsPropertyAutoL( *marginLeft ) || + IsPropertyAutoL( *marginRight ); + if ( !horizontalValuesAuto == !widthProperty ) + { + horizontalValuesAuto = ETrue; + } + TInt adaptive( node->IsAdaptive() ); + // I have childs share the available space between them + if ( adaptive & XnAdaptive::EHeight ) + { + // Give all available height to the adaptive node's children + freeHeight = parentRect.Height() - usedSiblingHeight; + } + if ( adaptive & XnAdaptive::EWidth ) + { + // Give all available width to the adaptive node's children + freeWidth = parentRect.Width() - usedSiblingWidth; + } + ScaleAutoAreaL( *node, freeWidth, freeHeight, + aParentBlockProgression, aParentDirection, + parentRect, aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + FitChildrenIntoParentL( *node, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + // handle autonodes which had auto width or height, + // but also min or max limit + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KBT ) + { + if ( IsPropertyAutoL( *heightProperty ) && + ( freeHeight != node->MarginRect().Height() ) ) + { + if ( layoutedAutoNodes.Find( node ) == KErrNotFound ) + { + // The height has been callculated already + // and it doesn't depend on the expected + // auto size anymore, mark the node as layouted + // and reduce the parent free size + layoutedAutoNodes.AppendL( node ); + heightAutoCount--; + layoutedAutoNodesAdded = ETrue; + } + } + } + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KLR || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KRL ) + { + if ( IsPropertyAutoL( *widthProperty ) && + ( freeWidth != node->MarginRect().Width() ) ) + { + if ( layoutedAutoNodes.Find ( node ) == KErrNotFound ) + { + // The width has been callculated already + // and it doesn't depend on the expected + // auto size anymore, mark the node as layouted + // and reduce the parent free size + layoutedAutoNodes.AppendL( node ); + widthAutoCount--; + layoutedAutoNodesAdded = ETrue; + } + } + } + } + + // drop areas if children don't fit + FitAutoChildrenIntoParentL( *aAutoNodeArray, layoutedAutoNodes, + *parent, aParentBlockProgression, aParentDirection, + aGraphicsDevice ); + + // if something was dropped, reset the layouted auto nodes array + TInt newDisplayedChildCount = DisplayedChildrenCountL( aParent ); + + if ( displayedChildCount != newDisplayedChildCount ) + { + // if nodes with auto values are dropped + // recalculate the auto counts + CalculateAutoPropertiesOfNodesL( aAutoNodeArray, + originalWidthAutoCount, originalHeightAutoCount ); + + // recalculate everything again because something was dropped + layoutedAutoNodes.Reset(); + displayedChildCount = newDisplayedChildCount; + heightAutoCount = originalHeightAutoCount; + widthAutoCount = originalWidthAutoCount; + layoutedAutoNodesAdded = ETrue; + } + + } + while( layoutedAutoNodesAdded && ( ( heightAutoCount && layoutingHeight ) || + ( widthAutoCount && layoutingWidth ) ) ); + + MoveAutoAreaL( parentRect, children, aParentBlockProgression, + aParentDirection ); + + CleanupStack::PopAndDestroy( &layoutedAutoNodes ); + } + +// ----------------------------------------------------------------------------- +// CalculateCollapseMarginsL() +// Return the amount the margins should be collapsed in two list. The list +// element contains the amount of margins collapsed in pixels to the previous +// layoutable, nondropped, static and nontooltip node. +// When calculating the movement of the node, this value should be decreased +// from the movement. +// When calculating the total size of the auto proerety nodes, this value +// should be decreased from the size taken. +// If the children list contains one of the above mentioned type of nodes, +// then the value for those are always 0. +// For example, if there are three children and the middle one has been +// dropped, the the returned list contains two elemnts, first is 0 and +// the second one is the amount of collapsed margins between the first and the +// last node. +// The caller is responsible of releasing the returned arrays. +// ----------------------------------------------------------------------------- +// +static void CalculateCollapseMarginsL( RPointerArray< CXnNode >& aChildren, + RArray< TInt >& aCollapsedMarginsWidth, + RArray< TInt >& aCollapsedMarginsHeight, + const TDesC8& aParentBlockProgression, + const TDesC8& aParentDirection ) + { + aCollapsedMarginsWidth.Reset(); + aCollapsedMarginsHeight.Reset(); + + // Find first node which needs to be taken into account + CXnNode* previousNode = NULL; + TInt startIndex = aChildren.Count(); + for ( TInt i = 0; !previousNode && i < aChildren.Count(); i++ ) + { + if ( IsNodeDisplayedL( *aChildren[i] ) && + !aChildren[i]->IsDropped() && + !IsAbsoluteL(*aChildren[i]) && + !IsNodeTooltip(*aChildren[i]) && + aChildren[i]->IsLayoutCapable()) + { + previousNode = aChildren[i]; + startIndex = aChildren.Find( previousNode ) + 1; + } + } + + // Add needed amount of collapsed margins as 0 + for ( TInt i = 1; i < startIndex; i++ ) + { + User::LeaveIfError( aCollapsedMarginsWidth.Append( 0 ) ); + User::LeaveIfError( aCollapsedMarginsHeight.Append( 0 ) ); + } + + // Calculate collapsed for the rest of the nodes, 0 if not needed + for ( TInt i = startIndex; i < aChildren.Count() && previousNode; i++ ) + { + CXnNode* node = aChildren[i]; + TInt collapsedWidth = 0; + TInt collapsedHeight = 0; + + if ( IsNodeDisplayedL( *node ) && + !node->IsDropped() && + !IsAbsoluteL( *node ) && + !IsNodeTooltip( *node ) && + node->IsLayoutCapable() ) + { + if ( ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KLR || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KRL ) && + aParentDirection == + XnPropertyNames::style::common::direction::KLTR ) + { + TInt previousRightMargin = Abs( previousNode-> + MarginRect().iBr.iX - previousNode->BorderRect().iBr.iX ); + TInt nodeLeftMargin = Abs( node->BorderRect().iTl.iX - + node->MarginRect().iTl.iX ); + + collapsedWidth = -( previousRightMargin > nodeLeftMargin ) ? + nodeLeftMargin : previousRightMargin; + } + + if ( ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KRL || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KLR ) && + aParentDirection == + XnPropertyNames::style::common::direction::KRTL ) + { + TInt previousLeftMargin = Abs( previousNode-> + MarginRect().iTl.iX - previousNode->BorderRect().iTl.iX ); + TInt nodeRightMargin = Abs( node->BorderRect().iBr.iX - + node->MarginRect().iBr.iX ); + + collapsedWidth = ( previousLeftMargin > nodeRightMargin ) ? + nodeRightMargin : previousLeftMargin; + } + + if ( ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KBT ) && + aParentDirection == + XnPropertyNames::style::common::direction::KLTR ) + { + TInt previousBottomMargin = Abs( previousNode-> + MarginRect().iBr.iY - previousNode->BorderRect().iBr.iY ); + TInt nodeTopMargin = Abs( node->BorderRect().iTl.iY - + node->MarginRect().iTl.iY ); + + collapsedHeight = ( previousBottomMargin > nodeTopMargin ) ? + nodeTopMargin : previousBottomMargin; + } + + if ( ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KBT ) && + aParentDirection == + XnPropertyNames::style::common::direction::KRTL ) + { + TInt previousTopMargin = Abs( previousNode->\ + MarginRect().iTl.iY - previousNode->BorderRect().iTl.iY ); + TInt nodeBottomMargin = Abs( node->BorderRect().iBr.iY - + node->MarginRect().iBr.iY ); + + collapsedHeight = -( ( previousTopMargin > nodeBottomMargin ) ? + nodeBottomMargin : previousTopMargin ); + } + } + User::LeaveIfError( aCollapsedMarginsWidth.Append( collapsedWidth ) ); + User::LeaveIfError( aCollapsedMarginsHeight.Append( collapsedHeight ) ); + previousNode = node; + } + } + +// ----------------------------------------------------------------------------- +// CalculateSpaceUsedByAutoChildrenL() +// Return space used by node's children including auto nodes which have +// been calculated. +// ----------------------------------------------------------------------------- +// +static TSize CalculateSpaceUsedByAutoChildrenL( + RPointerArray< CXnNode >& aAutoChildren, + RPointerArray< CXnNode >& aCalculatedAutoChildren, + CXnNode& aParent, const TDesC8& aParentBlockProgression, + const TDesC8& aParentDirection, CGraphicsDevice& /*aScreenDevice*/ ) + { + TInt usedSiblingHeight( 0 ); + TInt usedSiblingWidth( 0 ); + + TSize largestSize( 0, 0 ); + + // Calculate collapsed margins + RArray< TInt > collapsedMarginsWidth; + RArray< TInt > collapsedMarginsHeight; + + CleanupClosePushL( collapsedMarginsWidth ); + CleanupClosePushL( collapsedMarginsHeight ); + + RPointerArray< CXnNode >& children( aParent.Children() ); + + CalculateCollapseMarginsL( children, + collapsedMarginsWidth, + collapsedMarginsHeight, + aParentBlockProgression, + aParentDirection ); + + for ( TInt i = 0; i < children.Count(); i++ ) + { + CXnNode* node( children[i] ); + if ( IsNodeDisplayedL( *node ) && !node->IsDropped() && + !IsAbsoluteL( *node ) && !IsNodeTooltip( *node ) ) + { + // Calculate how much does the node takes space, + // 0 is used for auto nodes which have not been calculated + TSize siblingSize( node->MarginRect().Size() ); + if ( aAutoChildren.Find( node ) != KErrNotFound && + aCalculatedAutoChildren.Find( node ) == KErrNotFound ) + { + // Node is auto node and its values have not been fixed yet + // The node may have auto in either direction + // so that must be checked + if ( HasNodeVerticalAutoValuesL( *node ) ) + { + siblingSize.iHeight = 0; + } + if ( HasNodeHorizontalAutoValuesL( *node ) ) + { + siblingSize.iWidth = 0; + } + } + // Update the largets found node rect + if ( siblingSize.iWidth > largestSize.iWidth ) + { + largestSize.iWidth = siblingSize.iWidth; + } + if ( siblingSize.iHeight > largestSize.iHeight ) + { + largestSize.iHeight = siblingSize.iHeight; + } + // Add the used area + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KBT ) + { + usedSiblingHeight += siblingSize.iHeight; + usedSiblingWidth = largestSize.iWidth; + } + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KLR || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KRL ) + { + usedSiblingWidth += siblingSize.iWidth; + usedSiblingHeight = largestSize.iHeight; + } + // Find the children index from all children + TInt childrenIndex( children.Find( node ) ); + // No collapsing for just one node + if ( childrenIndex > 0 ) + { + // Take the collapsed margins into account + // (the value is 0 if not collapsed) + usedSiblingWidth -= collapsedMarginsWidth[childrenIndex - 1]; + usedSiblingHeight -= collapsedMarginsHeight[childrenIndex - 1]; + } + } + } + // Collapsed arrays + CleanupStack::PopAndDestroy( 2 ); + + return TSize( usedSiblingWidth, usedSiblingHeight ); + } + +// ----------------------------------------------------------------------------- +// MoveAutoAreaL() +// Move nodes after all auto properties have been handled. +// ----------------------------------------------------------------------------- +// +static void MoveAutoAreaL( TRect& parentRect, + RPointerArray< CXnNode >& aChildren, const TDesC8& aParentBlockProgression, + const TDesC8& aParentDirection ) + { + // Calculate collapsed margins + RArray< TInt > collapsedMarginsWidth; + RArray< TInt > collapsedMarginsHeight; + + CleanupClosePushL( collapsedMarginsWidth ); + CleanupClosePushL( collapsedMarginsHeight ); + + CalculateCollapseMarginsL( aChildren, collapsedMarginsWidth, + collapsedMarginsHeight, aParentBlockProgression, + aParentDirection ); + + CXnNode* previousNode( NULL ); + TInt startIndex( aChildren.Count() ); + + for ( TInt i = 0; !previousNode && i < aChildren.Count(); i++ ) + { + CXnNode* node( aChildren[i] ); + if ( IsNodeDisplayedL( *node ) && !node->IsDropped() && + !IsAbsoluteL (*node ) && !IsNodeTooltip( *node ) ) + { + previousNode = node; + startIndex = i + 1; + } + } + if ( !previousNode ) + { + // Collapsed arrays + CleanupStack::PopAndDestroy( 2 ); + return; + } + + // Which way are the boxes layouted? + // + // 1) ltr, tb: 2) ltr, bt: 3) ltr, rl: 4) ltr, lr: + // 1 4 3 6 1 2 3 4 5 6 + // 2 5 2 5 4 5 6 1 2 3 + // 3 6 1 4 + // + // 5) rtl, tb: 6) rtl, bt: 7) rtl, rl: 8) rtl, lr: + // 4 1 6 3 3 2 1 6 5 4 + // 5 2 5 2 6 5 4 3 2 1 + // 6 3 4 1 + // + + TInt layoutType( 0 ); + if ( aParentDirection == XnPropertyNames::style::common::direction::KLTR ) + { + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB ) + { + layoutType = 1; + } + else if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KBT ) + { + layoutType = 2; + } + else if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KRL ) + { + layoutType = 3; + } + else if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KLR ) + { + layoutType = 4; + } + } + else if ( aParentDirection == + XnPropertyNames::style::common::direction::KRTL ) + { + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB ) + { + layoutType = 5; + } + else if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KBT ) + { + layoutType = 6; + } + else if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KRL ) + { + layoutType = 7; + } + else if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KLR ) + { + layoutType = 8; + } + } + TRect previousContentRect( previousNode->Rect() ); + TRect previousPaddingRect( previousNode->PaddingRect() ); + TRect previousBorderRect( previousNode->BorderRect() ); + TRect previousMarginRect( previousNode->MarginRect() ); + TRect previousNormalFlowBorderRect( previousNode->NormalFlowBorderRect() ); + TInt widthToMove = 0; + TInt heightToMove = 0; + + // Move the first node to the correct place + switch ( layoutType ) + { + case 1: + { + // Top to parent top + heightToMove = parentRect.iTl.iY - previousMarginRect.iTl.iY; + } + break; + case 2: + { + // Bottom to parent bottom + heightToMove = parentRect.iBr.iY - previousMarginRect.iBr.iY; + } + break; + case 3: + { + // Left to parent left + widthToMove = parentRect.iTl.iX - previousMarginRect.iTl.iX; + } + break; + case 4: + { + heightToMove = parentRect.iBr.iY - previousMarginRect.iBr.iY; + widthToMove = parentRect.iTl.iX - previousMarginRect.iTl.iX; + } + break; + case 5: // flow through + case 7: + { + heightToMove = parentRect.iTl.iY - previousMarginRect.iTl.iY; + widthToMove = parentRect.iBr.iX - previousMarginRect.iBr.iX; + } + break; + case 6: // flow through + case 8: + { + heightToMove = parentRect.iBr.iY - previousMarginRect.iBr.iY; + widthToMove = parentRect.iBr.iX - previousMarginRect.iBr.iX; + } + break; + } + + // Move rects + previousContentRect.Move( widthToMove, heightToMove ); + previousPaddingRect.Move( widthToMove, heightToMove ); + previousBorderRect.Move( widthToMove, heightToMove ); + previousMarginRect.Move( widthToMove, heightToMove ); + previousNormalFlowBorderRect.Move( widthToMove, heightToMove ); + + // Set rects + previousNode->SetRect( previousContentRect ); + previousNode->SetPaddingRect( previousPaddingRect ); + previousNode->SetBorderRect( previousBorderRect ); + previousNode->SetMarginRect( previousMarginRect ); + previousNode->SetNormalFlowBorderRect( previousNormalFlowBorderRect ); + + for ( TInt i = startIndex; i < aChildren.Count() && previousNode; i++ ) + { + CXnNode* node( aChildren[i] ); + + if ( IsNodeDisplayedL( *node ) && !node->IsDropped() && + !IsAbsoluteL( *node ) && !IsNodeTooltip( *node ) ) + { + // Get rects + TRect contentRect( node->Rect() ); + TRect paddingRect( node->PaddingRect() ); + TRect borderRect( node->BorderRect() ); + TRect marginRect( node->MarginRect() ); + TRect normalFlowBorderRect( node->NormalFlowBorderRect() ); + previousMarginRect = previousNode->MarginRect(); + + widthToMove = 0; + heightToMove = 0; + + // Count movements + switch ( layoutType ) + { + case 1: + { + // Move node top to the previous bottom + heightToMove = previousMarginRect.iBr.iY - marginRect.iTl.iY; + heightToMove -= collapsedMarginsHeight[i - 1]; + } + break; + case 2: + { + // Move node bottom to the previous top + heightToMove = previousMarginRect.iTl.iY - marginRect.iBr.iY; + heightToMove += collapsedMarginsHeight[i - 1]; + } + break; + case 3: + { + // Move node left to the previous right + widthToMove = previousMarginRect.iBr.iX - marginRect.iTl.iX; + widthToMove -= collapsedMarginsWidth[i - 1]; + } + break; + case 4: + { + heightToMove = previousMarginRect.iTl.iY - marginRect.iTl.iY; + widthToMove = previousMarginRect.iBr.iX - marginRect.iTl.iX; + widthToMove -= collapsedMarginsWidth[i - 1]; + } + break; + case 5: + { + // Move node top to the previous bottom + heightToMove = previousMarginRect.iBr.iY - marginRect.iTl.iY; + heightToMove -= collapsedMarginsHeight[i - 1]; + widthToMove = previousMarginRect.iTl.iX - marginRect.iTl.iX; + } + break; + case 6: + { + // Move node bottom to the previous top + heightToMove = previousMarginRect.iTl.iY - marginRect.iBr.iY; + heightToMove += collapsedMarginsHeight[i - 1]; + widthToMove = previousMarginRect.iTl.iX - marginRect.iTl.iX; + } + break; + case 7: + { + // Move node left to the previous right + widthToMove = previousMarginRect.iTl.iX - marginRect.iBr.iX; + widthToMove += collapsedMarginsWidth[i - 1]; + } + break; + case 8: + { + heightToMove = previousMarginRect.iTl.iY - marginRect.iTl.iY; + widthToMove = previousMarginRect.iTl.iX - marginRect.iBr.iX; + widthToMove += collapsedMarginsWidth[i - 1]; + } + break; + } + + // Move rects + contentRect.Move( widthToMove, heightToMove ); + paddingRect.Move( widthToMove, heightToMove ); + borderRect.Move( widthToMove, heightToMove ); + marginRect.Move( widthToMove, heightToMove ); + normalFlowBorderRect.Move( widthToMove, heightToMove ); + + // Set rects + node->SetRect( contentRect ); + node->SetPaddingRect( paddingRect ); + node->SetBorderRect( borderRect ); + node->SetMarginRect( marginRect ); + node->SetNormalFlowBorderRect( normalFlowBorderRect ); + + previousNode = node; + } + } + + // Collapsed arrays + CleanupStack::PopAndDestroy( 2 ); + } + +// ----------------------------------------------------------------------------- +// ScaleAutoAreaL() +// Scale dimensions for areas that have properties set to AUTO. +// ----------------------------------------------------------------------------- +// +static TSize ScaleAutoAreaL( CXnNode& aNode, TInt aWidthToFit, + TInt aHeightToFit, const TDesC8& aParentBlockProgression, + const TDesC8& aParentDirection, TRect& aParentRect, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + // if only one value is auto, it is computed from equality + // if width is set to AUTO, all other values become 0 + // if both margin left and right are set to AUTO, their computed + // values are equal + TSize sizeOfAutoArea( 0, 0 ); + + RArray< TPtrC8 > autoArray; + CleanupClosePushL( autoArray ); + + CXnProperty* top = aNode.TopL(); + if ( IsPropertyAutoL( *top ) ) + { + TPtrC8 propertyName = top->Property()->Name(); + autoArray.Append( propertyName ); + } + CXnProperty* bottom = aNode.BottomL(); + if ( IsPropertyAutoL( *bottom ) ) + { + TPtrC8 propertyName = bottom->Property()->Name(); + autoArray.Append( propertyName ); + } + CXnProperty* left = aNode.LeftL(); + if ( IsPropertyAutoL( *left ) ) + { + TPtrC8 propertyName = left->Property()->Name(); + autoArray.Append( propertyName ); + } + CXnProperty* right = aNode.RightL(); + if ( IsPropertyAutoL( *right ) ) + { + TPtrC8 propertyName = right->Property()->Name(); + autoArray.Append( propertyName ); + } + CXnProperty* width = aNode.WidthL(); + if ( IsPropertyAutoL( *width ) ) + { + TPtrC8 propertyName = width->Property()->Name(); + autoArray.Append( propertyName ); + } + if ( !width ) + { + TPtrC8 propertyName = XnPropertyNames::style::common::KWidth(); + autoArray.Append( propertyName ); + } + CXnProperty* height = aNode.HeightL(); + if ( IsPropertyAutoL( *height ) ) + { + TPtrC8 propertyName = height->Property()->Name(); + autoArray.Append( propertyName ); + } + if ( !height ) + { + TPtrC8 propertyName = XnPropertyNames::style::common::KHeight(); + autoArray.Append( propertyName ); + } + CXnProperty* marginTop = aNode.MarginTopL(); + if ( IsPropertyAutoL( *marginTop ) ) + { + TPtrC8 propertyName = marginTop->Property()->Name(); + autoArray.Append( propertyName ); + } + CXnProperty* marginBottom = aNode.MarginBottomL(); + if ( IsPropertyAutoL( *marginBottom ) ) + { + TPtrC8 propertyName = marginBottom->Property()->Name(); + autoArray.Append( propertyName ); + } + CXnProperty* marginLeft = aNode.MarginLeftL(); + if ( IsPropertyAutoL( *marginLeft ) ) + { + TPtrC8 propertyName = marginLeft->Property()->Name(); + autoArray.Append( propertyName ); + } + CXnProperty* marginRight = aNode.MarginRightL(); + if ( IsPropertyAutoL( *marginRight ) ) + { + TPtrC8 propertyName = marginRight->Property()->Name(); + autoArray.Append( propertyName ); + } + + if ( aParentDirection == XnPropertyNames::style::common::direction::KLTR ) + { + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KBT ) + { + sizeOfAutoArea = TSize( AutoStaticTBL( aNode, aWidthToFit, + aHeightToFit, autoArray, aParentRect, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ) ); + } + else // block progression LR + { + sizeOfAutoArea = TSize( AutoStaticLRL( aNode, aWidthToFit, + aHeightToFit, autoArray, aParentRect, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ) ); + } + } + else // direction RTL + { + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KBT ) + { + sizeOfAutoArea = TSize( AutoStaticBTL( aNode, aWidthToFit, + aHeightToFit, autoArray, aParentRect, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ) ); + } + else // block progression RL + { + sizeOfAutoArea = TSize( AutoStaticRLL( aNode, aWidthToFit, + aHeightToFit, autoArray, aParentRect, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ) ); + } + } + + // if size not within min&max size limits, resize + // (min-size) + if ( HasNodeMinSizesL( aNode ) ) + { + if ( IsSmallerThanMinSizeL( aParentRect, aNode, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ) ) + { + GrowToMinSizeL( aNode, aParentRect, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + } + } + + if ( HasNodeMaxSizesL( aNode ) ) + { + if ( IsLargerThanMaxSizeL( aParentRect, aNode, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ) ) + { + ShrinkToMaxSizeL( aNode, aParentRect, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + } + } + + CleanupStack::PopAndDestroy( &autoArray ); + + // Return the context rect size because the min-max + // test might have changed the size of autoarea + return aNode.Rect().Size(); + } + +// ----------------------------------------------------------------------------- +// GrowToMinSizeL() +// +// ----------------------------------------------------------------------------- +// +static void GrowToMinSizeL( CXnNode& aNode, TRect& aParentRect, + CGraphicsDevice& aScreenDevice, + TReal aHorizontalUnitInPixels, TReal aVerticalUnitInPixels ) + { + // grow to min size + CXnProperty* minWidthProperty = aNode.MinWidthL(); + CXnProperty* minHeightProperty = aNode.MinHeightL(); + + TRect contentRect( aNode.Rect() ); + TRect paddingRect( aNode.PaddingRect() ); + TRect borderRect( aNode.BorderRect() ); + TRect normalFlowBorderRect( aNode.NormalFlowBorderRect() ); + TRect marginRect( aNode.MarginRect() ); + + if ( minWidthProperty ) + { + if ( !IsPropertyNone( *minWidthProperty ) ) + { + TInt minWidth = HorizontalPixelValueL( minWidthProperty, + aParentRect.Width(), aScreenDevice, aHorizontalUnitInPixels ); + if ( contentRect.Width() < minWidth ) + { + TInt widthToGrow = minWidth - contentRect.Width(); + contentRect.Resize( widthToGrow, 0 ); + paddingRect.Resize( widthToGrow, 0 ); + borderRect.Resize( widthToGrow, 0 ); + normalFlowBorderRect.Resize( widthToGrow, 0 ); + marginRect.Resize( widthToGrow, 0 ); + } + } + } + + if ( minHeightProperty ) + { + if ( !IsPropertyNone( *minHeightProperty ) ) + { + TInt minHeight = VerticalPixelValueL( minHeightProperty, + aParentRect.Height(), aScreenDevice, aVerticalUnitInPixels ); + if ( contentRect.Height() < minHeight ) + { + TInt heightToGrow = minHeight - contentRect.Height(); + contentRect.Resize( 0, heightToGrow ); + paddingRect.Resize( 0, heightToGrow ); + borderRect.Resize( 0, heightToGrow ); + normalFlowBorderRect.Resize( 0, heightToGrow ); + marginRect.Resize( 0, heightToGrow ); + } + } + } + + aNode.SetRect( contentRect ); + aNode.SetPaddingRect( paddingRect ); + aNode.SetBorderRect( borderRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + aNode.SetMarginRect( marginRect ); + } + +// ----------------------------------------------------------------------------- +// ShrinkToMaxSizeL() +// ----------------------------------------------------------------------------- +// +static void ShrinkToMaxSizeL( CXnNode& aNode, TRect& aParentRect, + CGraphicsDevice& aScreenDevice, + TReal aHorizontalUnitInPixels, TReal aVerticalUnitInPixels ) + { + // grow to min size + CXnProperty* maxWidthProperty = aNode.MaxWidthL(); + CXnProperty* maxHeightProperty = aNode.MaxHeightL(); + + TRect contentRect( aNode.Rect() ); + TRect paddingRect( aNode.PaddingRect() ); + TRect borderRect( aNode.BorderRect() ); + TRect normalFlowBorderRect( aNode.NormalFlowBorderRect() ); + TRect marginRect( aNode.MarginRect() ); + + if ( maxWidthProperty ) + { + if ( !IsPropertyNone( *maxWidthProperty ) ) + { + TInt maxWidth = HorizontalPixelValueL( maxWidthProperty, + aParentRect.Width(), aScreenDevice, aHorizontalUnitInPixels ); + if ( contentRect.Width() > maxWidth ) + { + TInt widthToShrink = contentRect.Width() - maxWidth; + contentRect.Resize( -widthToShrink, 0 ); + paddingRect.Resize( -widthToShrink, 0 ); + borderRect.Resize( -widthToShrink, 0 ); + normalFlowBorderRect.Resize( -widthToShrink, 0 ); + marginRect.Resize( -widthToShrink, 0 ); + } + } + } + + if ( maxHeightProperty ) + { + if ( !IsPropertyNone( *maxHeightProperty ) ) + { + TInt maxHeight = VerticalPixelValueL( maxHeightProperty, + aParentRect.Height(), aScreenDevice, aVerticalUnitInPixels ); + if ( contentRect.Height() > maxHeight ) + { + TInt heightToShrink = contentRect.Height() - maxHeight; + contentRect.Resize( 0, -heightToShrink ); + paddingRect.Resize( 0, -heightToShrink ); + borderRect.Resize( 0, -heightToShrink ); + normalFlowBorderRect.Resize( 0, -heightToShrink ); + marginRect.Resize( 0, -heightToShrink ); + } + } + } + + aNode.SetRect( contentRect ); + aNode.SetPaddingRect( paddingRect ); + aNode.SetBorderRect( borderRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + aNode.SetMarginRect( marginRect ); + } + +// ----------------------------------------------------------------------------- +// FitAutoChildrenIntoParentL() +// +// ----------------------------------------------------------------------------- +// +static void FitAutoChildrenIntoParentL( RPointerArray< CXnNode >& aAutoChildren, + RPointerArray< CXnNode >& aCalculatedAutoChildren, CXnNode& aParent, + const TDesC8& aParentBlockProgression, const TDesC8& aParentDirection, + CGraphicsDevice& aGraphicsDevice ) + { + if( IsSrollableBox( aParent ) ) + { + return; + } + + TSize space = CalculateSpaceUsedByAutoChildrenL( aAutoChildren, + aCalculatedAutoChildren, aParent, aParentBlockProgression, + aParentDirection, aGraphicsDevice ); + + TSize parentSize( aParent.Rect().Size() ); + + while( ( ( parentSize.iHeight < space.iHeight ) && + ( parentSize.iHeight > 0 ) ) || + ( ( parentSize.iWidth < space.iWidth ) && + ( parentSize.iWidth > 0 ) ) ) + { + // if areas go over just one pixel, cut the pixel + // from a percent sized node + if ( ( parentSize.iHeight == space.iHeight - 1 ) || + ( parentSize.iWidth == space.iWidth - 1 ) ) + { + CutOnePixelFromPercentChildNodeL( aParent, aParentBlockProgression ); + return; + } + + TInt childCount( DisplayedChildrenCountL( aParent ) ); + + PriorizeChildrenL( aParent ); + + if ( DisplayedChildrenCountL( aParent ) == childCount ) + { + // cannot drop any more children, but they still don't fit + return; + } + + space = CalculateSpaceUsedByAutoChildrenL( aAutoChildren, + aCalculatedAutoChildren, aParent, aParentBlockProgression, + aParentDirection, aGraphicsDevice ); + } + } + +// ----------------------------------------------------------------------------- +// VerticalCentimetersToPixelsL() +// Convert vertical centimeter value to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt VerticalCentimetersToPixelsL( TReal& aCentimeters, + CGraphicsDevice& aScreenDevice ) + { + TReal twips = aCentimeters * KCentimetersAsTwips; + TInt intTwips = static_cast< TInt >( twips + KIntConversionConstant ); + return aScreenDevice.VerticalTwipsToPixels( intTwips ); + } + +// ----------------------------------------------------------------------------- +// VerticalInchesToPixelsL() +// Convert vertical inch value to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt VerticalInchesToPixelsL( TReal& aInches, + CGraphicsDevice& aScreenDevice ) + { + TReal twips = aInches * KInchesAsTwips; + TInt intTwips = static_cast< TInt >( twips + KIntConversionConstant ); + return aScreenDevice.VerticalTwipsToPixels( intTwips ); + } + +// ----------------------------------------------------------------------------- +// VerticalMillimetersToPixelsL() +// Convert vertical millimeter value to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt VerticalMillimetersToPixelsL( TReal& aMillimeters, + CGraphicsDevice& aScreenDevice ) + { + TReal twips = aMillimeters * KMillimetersAsTwips; + TInt intTwips = static_cast< TInt >( twips + KIntConversionConstant ); + return aScreenDevice.VerticalTwipsToPixels( intTwips ); + } + +// ----------------------------------------------------------------------------- +// VerticalPicasToPixelsL() +// Convert vertical pica value to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt VerticalPicasToPixelsL( TReal& aPicas, + CGraphicsDevice& aScreenDevice ) + { + TReal twips = aPicas * KPicasAsTwips; + TInt intTwips = static_cast< TInt >( twips + KIntConversionConstant ); + return aScreenDevice.VerticalTwipsToPixels( intTwips ); + } + +// ----------------------------------------------------------------------------- +// VerticalPixelValueL() +// Convert vertical property to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt VerticalPixelValueL( CXnProperty* aValue, TInt aReferenceValue, + CGraphicsDevice& aScreenDevice, TReal aVerticalUnitInPixels ) + { + return VerticalValueToPixelsL( DomPropertyValueFromProperty( aValue ), + static_cast< TReal >( aReferenceValue ), aScreenDevice, + aVerticalUnitInPixels ); + } + +// ----------------------------------------------------------------------------- +// VerticalPointsToPixelsL() +// Convert vertical point value to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt VerticalPointsToPixelsL( TReal& aPoints, + CGraphicsDevice& aScreenDevice ) + { + TReal twips = aPoints * KPointsAsTwips; + TInt intTwips = static_cast< TInt >( twips + KIntConversionConstant ); + return aScreenDevice.VerticalTwipsToPixels( intTwips ); + } + +// ----------------------------------------------------------------------------- +// VerticalValueToPixelsL() +// Convert vertical property value to pixel value. +// ----------------------------------------------------------------------------- +// +static TInt VerticalValueToPixelsL( CXnDomPropertyValue* aValue, + TReal aReferenceValue, CGraphicsDevice& aScreenDevice, + TReal aVerticalUnitInPixels ) + { + if ( !aValue ) + { + User::Leave( KXnErrDomPropertyValueNULL ); + } + CXnDomPropertyValue::TPrimitiveValueType valueType = + aValue->PrimitiveValueType(); + // Handle error cases first, inherit is handled elsewhere, none returns 0 + switch ( valueType ) + { + case CXnDomPropertyValue::EUnknown: + case CXnDomPropertyValue::EEms: + case CXnDomPropertyValue::EExs: + case CXnDomPropertyValue::EDeg: + case CXnDomPropertyValue::ERad: + case CXnDomPropertyValue::EGrad: + case CXnDomPropertyValue::EMs: + case CXnDomPropertyValue::ES: + case CXnDomPropertyValue::EHz: + case CXnDomPropertyValue::EKHz: + case CXnDomPropertyValue::EDimension: + case CXnDomPropertyValue::EString: + case CXnDomPropertyValue::EUri: + case CXnDomPropertyValue::EIdent: + case CXnDomPropertyValue::EAttr: + case CXnDomPropertyValue::ECounter: + case CXnDomPropertyValue::ERect: + case CXnDomPropertyValue::ERgbColor: + case CXnDomPropertyValue::ERgbaColor: + case CXnDomPropertyValue::EFunction: + break; + default: + { + TReal value = aValue->FloatValueL(); + if ( valueType == CXnDomPropertyValue::ENumber || + valueType == CXnDomPropertyValue::EPx ) + { + return static_cast< TInt >( value ); + } + else if ( valueType == CXnDomPropertyValue::EPercentage ) + { + return PercentageToPixelsL( value, aReferenceValue ); + } + else if ( valueType == CXnDomPropertyValue::EIn ) + { + return VerticalInchesToPixelsL( value, aScreenDevice ); + } + else if ( valueType == CXnDomPropertyValue::ECm ) + { + return VerticalCentimetersToPixelsL( value, aScreenDevice ); + } + else if ( valueType == CXnDomPropertyValue::EMm ) + { + return VerticalMillimetersToPixelsL( value, aScreenDevice ); + } + else if ( valueType == CXnDomPropertyValue::EPt ) + { + return VerticalPointsToPixelsL( value, aScreenDevice ); + } + else if ( valueType == CXnDomPropertyValue::EPc ) + { + return VerticalPicasToPixelsL( value, aScreenDevice ); + } + else if ( valueType == CXnDomPropertyValue::EUnitValue ) + { + return VerticalUnitsToPixelsL( value, aVerticalUnitInPixels ); + } + } + break; + } + + return 0; + } + +// ----------------------------------------------------------------------------- +// ProcessAdaptiveAreasL() +// Process adaptive areas +// ----------------------------------------------------------------------------- +// +static void ProcessAdaptiveAreasL( CXnNode& aParent, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + CXnProperty* blockProgressionProperty( aParent.BlockProgressionL() ); + CXnProperty* directionProperty( aParent.DirectionL() ); + const TDesC8* blockProgression( + &XnPropertyNames::style::common::block_progression::KTB() ); + const TDesC8* direction( + &XnPropertyNames::style::common::direction::KLTR() ); + + if ( directionProperty ) + { + direction = &directionProperty->StringValue(); + } + + if ( blockProgressionProperty ) + { + blockProgression = &blockProgressionProperty->StringValue(); + } + + CalculateAdaptiveSizeL( aParent, *blockProgression, *direction, + aGraphicsDevice, aHorizontalUnitInPixels, aVerticalUnitInPixels ); + } + +// ----------------------------------------------------------------------------- +// CalculateAdaptiveSizeL() +// Fixes the adaptive node size to its layouted children size +// ----------------------------------------------------------------------------- +// +static void CalculateAdaptiveSizeL( CXnNode& aNode, + const TDesC8& aParentBlockProgression, const TDesC8& /*aParentDirection*/, + CGraphicsDevice& aGraphicsDevice, TReal aHorizontalUnitInPixels, + TReal aVerticalUnitInPixels ) + { + TInt adaptive( aNode.IsAdaptive() ); + CXnNode* parent( aNode.Parent() ); + + if ( !adaptive || !parent ) + { + return; + } + + TInt adaptiveHeight( 0 ); + TInt adaptiveWidth( 0 ); + + RPointerArray< CXnNode > children; + CleanupClosePushL( children ); + + TInt count( DisplayedChildrenCountL( aNode, &children ) ); + + TSize size; + + if ( count == 0 ) + { + TRect parentRect( parent->Rect() ); + if( parent->Control() && parent->Control()->OwnsWindow() ) + { + parentRect = TRect( parentRect.iTl - parent->MarginRect().iTl, parentRect.Size() ); + } + // I don't have any displayed childrens, fix my own size + size = CalculateTotalDimensionsL( aNode, ETrue, EFalse, + parentRect, aGraphicsDevice, aHorizontalUnitInPixels, + aVerticalUnitInPixels ); + adaptiveHeight = size.iHeight; + adaptiveWidth = size.iWidth; + } + else + { + TBool autoHeight( EFalse ); + TBool autoWidth( EFalse ); + TBool sizeKnown( EFalse ); + for ( TInt i = 0; i < children.Count(); i++ ) + { + CXnNode* node( children[i] ); + if ( !IsNodeDisplayedL( *node ) ) + { + continue; + } + CXnProperty* heightProperty( node->HeightL() ); + if ( !( node->IsAdaptive() & XnAdaptive::EHeight ) && + ( adaptive & XnAdaptive::EHeight ) && + IsPropertyAutoL( *heightProperty ) ) + { + adaptiveHeight = node->MarginRect().Size().iHeight; + autoHeight = ETrue; + if ( !( adaptive & XnAdaptive::EWidth ) ) + { + // Height is now known and width is not adaptive + // -> size is now known + sizeKnown = ETrue; + } + } + CXnProperty* widthProperty( node->WidthL() ); + if ( !( node->IsAdaptive() & XnAdaptive::EWidth ) && + ( adaptive & XnAdaptive::EWidth ) && + IsPropertyAutoL( *widthProperty ) ) + { + adaptiveWidth = node->MarginRect().Size().iWidth; + autoWidth = ETrue; + if ( !( adaptive & XnAdaptive::EHeight ) ) + { + // Width is now known and height is not adaptive + // -> size is now known + sizeKnown = ETrue; + } + } + if ( autoWidth && autoHeight ) + { + // Both auto -> size is now known + sizeKnown = ETrue; + } + if ( !sizeKnown ) + { + // Fix adaptive sized child's size first + ProcessAdaptiveAreasL( *node, aGraphicsDevice, + aHorizontalUnitInPixels, aVerticalUnitInPixels ); + TSize marginSize( node->MarginRect().Size() ); + if ( aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KTB || + aParentBlockProgression == + XnPropertyNames::style::common::block_progression::KBT ) + { + if ( !autoHeight && ( adaptive & XnAdaptive::EHeight ) ) + { + adaptiveHeight += marginSize.iHeight; + } + if ( !autoWidth && ( adaptive & XnAdaptive::EWidth ) ) + { + if ( marginSize.iWidth > adaptiveWidth ) + { + adaptiveWidth = marginSize.iWidth; + } + } + } + else if ( aParentBlockProgression == + XnPropertyNames::style::common:: + block_progression::KLR || aParentBlockProgression == + XnPropertyNames::style::common:: + block_progression::KRL ) + { + if ( !autoHeight && ( adaptive & XnAdaptive::EHeight ) ) + { + if ( marginSize.iHeight > adaptiveHeight ) + { + adaptiveHeight = marginSize.iHeight; + } + } + if ( !autoWidth && ( adaptive & XnAdaptive::EWidth ) ) + { + adaptiveWidth += marginSize.iWidth; + } + } + } + } + } + + TRect contentRect( aNode.Rect() ); + TRect paddingRect( aNode.PaddingRect() ); + TRect borderRect( aNode.BorderRect() ); + TRect marginRect( aNode.MarginRect() ); + TRect normalFlowBorderRect( aNode.NormalFlowBorderRect() ); + + TRect paddingRectDiff( SubtractRect( paddingRect, contentRect ) ); + TRect borderRectDiff( SubtractRect( borderRect, contentRect ) ); + TRect marginRectDiff( SubtractRect( marginRect, contentRect ) ); + TRect normalFlowBorderRectDiff( SubtractRect( + normalFlowBorderRect, contentRect ) ); + + TInt dy( 0 ); + TInt dx( 0 ); + + if ( adaptive & XnAdaptive::EHeight ) + { + if ( adaptiveHeight <= 0 ) + { + adaptiveHeight = 0; + } + dy = contentRect.Size().iHeight - adaptiveHeight; + } + if ( adaptive & XnAdaptive::EWidth ) + { + if ( adaptiveWidth <= 0 ) + { + adaptiveWidth = 0; + } + dx = contentRect.Size().iWidth - adaptiveWidth; + } + + contentRect.Resize( -dx, -dy ); + + paddingRect = AddRect( contentRect, paddingRectDiff ); + borderRect = AddRect( contentRect, borderRectDiff ); + marginRect = AddRect( contentRect, marginRectDiff ); + normalFlowBorderRect = AddRect( contentRect, normalFlowBorderRectDiff ); + + aNode.SetRect( contentRect ); + aNode.SetPaddingRect( paddingRect ); + aNode.SetBorderRect( borderRect ); + aNode.SetMarginRect( marginRect ); + aNode.SetNormalFlowBorderRect( normalFlowBorderRect ); + + aNode.FixAdaptiveSizeL( contentRect.Size() ); + + aNode.UiEngine()->CheckAdaptiveContentL( aNode, contentRect.Size() ); + + CleanupStack::PopAndDestroy( &children ); + } + +// ----------------------------------------------------------------------------- +// BuildTriggerNodeLC +// Builds a trigger node +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildTriggerNodeLC( CXnUiEngine& aUiEngine, + const TDesC8& aTriggerName ) + { + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + + CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger ); + CleanupStack::PushL( type ); + + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + + CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + + CleanupStack::PushL( nameValue ); + + nameValue->SetStringValueL( CXnDomPropertyValue::EString, aTriggerName ); + + CXnProperty* name = CXnProperty::NewL( + XnPropertyNames::action::trigger::KName, + nameValue, aUiEngine.ODT()->DomDocument().StringPool() ); + + CleanupStack::Pop( nameValue ); + + CleanupStack::PushL( name ); + + node->SetPropertyL( name ); + + CleanupStack::Pop( name ); + + //CleanupStack::Pop( node ); + + return node; + } + +// ----------------------------------------------------------------------------- +// UpdateInternalUnits +// Updates UiEngineImpl unit values +// ----------------------------------------------------------------------------- +// +static void UpdateInternalUnits( TReal& aHorizontalUnitInPixels, + TReal& aVerticalUnitInPixels, TRect aRect ) + { + TAknWindowComponentLayout referenceLayout = + AknLayoutScalable_Avkon::aid_value_unit2(); + TRect parent( aRect ); + + TAknLayoutRect rect; + + // TAknWindowLineLayout should go directly + //to LayoutRect/LayoutControl etc. methods + rect.LayoutRect( parent, referenceLayout.LayoutLine() ); + + TReal rectWidth = rect.Rect().Width(); + + if ( rectWidth == 0 ) + { + aHorizontalUnitInPixels = 0; + } + + aHorizontalUnitInPixels = rectWidth / 10; + + TReal rectHeight = rect.Rect().Height(); + + if ( rectHeight == 0 ) + { + aVerticalUnitInPixels = 0; + } + + aVerticalUnitInPixels = rectHeight / 10; + } + +// ----------------------------------------------------------------------------- +// BuildScreenDeviceChangeTriggerNodeLC +// Build trigger node for screen device change event +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildScreenDeviceChangeTriggerNodeLC( CXnUiEngine& aUiEngine ) + { + CXnDomStringPool& sp( aUiEngine.ODT()->DomDocument().StringPool() ); + + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + + CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger ); + CleanupStack::PushL( type ); + + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + + CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( sp ); + CleanupStack::PushL( nameValue ); + + nameValue->SetStringValueL( CXnDomPropertyValue::EString, + XnPropertyNames::action::trigger::name::KScreenDeviceChange ); + + CXnProperty* name = CXnProperty::NewL( + XnPropertyNames::action::trigger::KName, nameValue, sp ); + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + + node->SetPropertyL( name ); + CleanupStack::Pop( name ); + + CXnDomPropertyValue* reasonValue = CXnDomPropertyValue::NewL( sp ); + CleanupStack::PushL( reasonValue ); + + const TDesC8* reasonString( NULL ); + + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + reasonString = &XnPropertyNames::action::trigger::name:: + uidefinitionmodification::reason::KLandscape; + } + else + { + reasonString = &XnPropertyNames::action::trigger::name:: + uidefinitionmodification::reason::KPortrait; + } + + reasonValue->SetStringValueL( CXnDomPropertyValue::EString, *reasonString ); + + CXnProperty* reason = CXnProperty::NewL( XnPropertyNames::action::trigger:: + name::uidefinitionmodification::KReason, reasonValue, sp ); + + CleanupStack::Pop( reasonValue ); + + CleanupStack::PushL( reason ); + + node->SetPropertyL( reason ); + + CleanupStack::Pop( reason ); + + return node; + } + +// ----------------------------------------------------------------------------- +// FillFocusCandidatesL +// ----------------------------------------------------------------------------- +// +static void FillFocusCandidatesL( CXnNode* aParent, + RPointerArray< CXnNode >& aArray ) + { + RPointerArray< CXnNode >& children( aParent->Children() ); + + aArray.AppendL( aParent ); + + for ( TInt i = 0; i < children.Count(); i++ ) + { + FillFocusCandidatesL( children[i], aArray ); + } + } + +// ----------------------------------------------------------------------------- +// 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 +// ----------------------------------------------------------------------------- +// +static TBool SetAdaptivesL( CXnNode& aNode ) + { + TBool retval( EFalse ); + + // Check if the node is adaptive + if ( aNode.IsAdaptive( ETrue ) && IsNodeDisplayedL( aNode ) ) + { + retval = ETrue; + // Mark adaptive node to be measured + aNode.SetAdaptiveL( XnAdaptive::EMeasure ); + } + + RPointerArray< CXnNode >& children( aNode.Children() ); + + for ( TInt i = 0; i < children.Count(); i++ ) + { + TBool ret( SetAdaptivesL( *children[i] ) ); + if ( ret ) + { + retval = ret; + } + } + + return retval; + } + +#ifdef _XN3_DEBUG_ +// ----------------------------------------------------------------------------- +// TraceTreeL +// ----------------------------------------------------------------------------- +// +static void TraceTreeL( CXnNode* aRootNode ) + { + CXnDepthFirstTreeIterator< CXnNode >* iterator = + CXnDepthFirstTreeIterator< CXnNode >::NewL( *aRootNode ); + CleanupStack::PushL( iterator ); + + RDebug::Print( _L("Xuikon: UI tree:") ); + + TBuf8< 256 > debug; + + TInt level( 0 ); + + for( CXnNode* node = iterator->Value(); node; + node = iterator->NextL() ) + { + debug = _L8( "Xuikon: " ); + + level = iterator->Level(); + + for ( TInt i = 0; i < level; i++ ) + { + debug.Append( ' ' ); + } + + debug.Append( node->Type()->Type() ); + + CXnProperty* id( node->IdL() ); + + if ( id ) + { + debug.Append( _L8( ", id: " ) ); + debug.Append( id->StringValue() ); + } + + debug.AppendFormat( _L8( ", laidout: %d" ), node->IsLaidOut() ); + debug.AppendFormat( _L8( ", displayed: %d" ), + IsNodeDisplayedL( *node ) ); + + CCoeControl* control( node->Control() ); + + if ( control ) + { + TBool visible( control->IsVisible() ); + TRect rect( control->Rect() ); + TPoint tl( rect.iTl ); + TPoint br( rect.iBr ); + debug.AppendFormat( _L8( ", visible %d:" ), visible ); + debug.AppendFormat( + _L8( ", Tl: %d %d, Br: %d %d" ), tl.iX, tl.iY, br.iX, br.iY ); + } + else + { + debug.Append( _L8( ", no control" ) ); + } + RDebug::RawPrint( debug ); + } + + CleanupStack::PopAndDestroy( iterator ); + } +#endif + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::CXnUiEngineImpl() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnUiEngineImpl::CXnUiEngineImpl( CXnUiEngine& aUiEngine, + CXnAppUiAdapter& aAdapter ) + : iUiEngine( &aUiEngine ), iAppUiAdapter( aAdapter ), + iViewManager( aAdapter.ViewManager() ) + { + iAppUiAdapter.UiStateListener().AddObserver( *this ); + + iViewManager.AddObserver( *this ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +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. + // That is because we don't know the UI furniture yet. Units are + // needed in controls constructions + UpdateInternalUnits( + iHorizontalUnitInPixels, + iVerticalUnitInPixels, + iAppUiAdapter.ClientRect() ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnUiEngineImpl* CXnUiEngineImpl::NewL( CXnUiEngine& aUiEngine, + CXnAppUiAdapter& aAdapter ) + { + return new ( ELeave ) CXnUiEngineImpl( aUiEngine, aAdapter ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::~CXnUiEngineImpl() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +CXnUiEngineImpl::~CXnUiEngineImpl() + { + iAppUiAdapter.UiStateListener().RemoveObserver( *this ); + + iViewManager.RemoveObserver( *this ); + + delete iEditMode; + delete iHitTest; + + iFocusCandidateList.Reset(); + iRedrawRegions.ResetAndDestroy(); + iDirtyList.Reset(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::AppUiAdapter() +// ----------------------------------------------------------------------------- +// +CXnAppUiAdapter& CXnUiEngineImpl::AppUiAdapter() const + { + return iAppUiAdapter; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::LayoutUIL() +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::LayoutUIL( CXnNode* /*aNode*/ ) + { + if ( IsLayoutDisabled() ) + { + iLayoutControl |= XnLayoutControl::ELayoutUI; + return; + } + + iLayoutControl &= ~XnLayoutControl::ELayoutUI; + + if ( iDirtyList.Count() == 0 ) + { + // Nothing to do, layout is up-to-date + return; + } + + DisableRenderUiLC(); + CXnNode* candidate( StartLayoutFromL() ); + PrepareRunLayoutL(); + iDirtyList.Reset(); + + // Run layout until it is fully calculated + do + { + iLayoutPhase = RunLayoutL( candidate ); + } + while ( iLayoutPhase != XnLayoutPhase::ENone ); + + CXnNode* focused( FocusedNode() ); + + if ( focused && focused->IsDropped() ) + { + // The currently focused node is dropped, run losevisualization + CXnNode* loseVisualisation = + BuildTriggerNodeLC( *iUiEngine, + XnPropertyNames::action::trigger::name::KLoseVisualisation ); + + focused->ReportXuikonEventL( *loseVisualisation ); + CleanupStack::PopAndDestroy( loseVisualisation ); + + if ( FocusedNode() == focused ) + { + // Remove focus as losevisualization trigger didn't + // change focus from dropped node to another one + SetFocusedNodeL( NULL ); + } + } + + if ( !FocusedNode() && iAppUiAdapter.FocusShown() ) + { + // No focus, try if some of the focus candidates can be focused + RootNode()->RunFocusChangeL( iFocusCandidateList ); + } + + iFocusCandidateList.Reset(); + + iAppUiAdapter.EffectManager()->UiLayouted(); + + // Layout is now recalculated + CleanupStack::PopAndDestroy(); // anonymous + } + +// ----------------------------------------------------------------------------- +// PrepareRunLayoutL() +// Set dropped flags of all nodes in the tree to ENone. +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::PrepareRunLayoutL() + { + if ( iLayoutPhase == XnLayoutPhase::ENone ) + { + iLayoutPhase = XnLayoutPhase::ELayout; + + for ( TInt i = 0; i < iDirtyList.Count(); i++ ) + { + CXnNode* dirty( iDirtyList[i] ); + + // Clear dropped flags recursively + SetNodeDroppedL( *dirty, XnNodeLayout::ENone ); + + if ( SetAdaptivesL( *dirty ) ) + { + // Adaptive node causes measure phase + iLayoutPhase = XnLayoutPhase::EMeasure; + } + } + } + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::RunLayoutL() +// ----------------------------------------------------------------------------- +// +TInt CXnUiEngineImpl::RunLayoutL( CXnNode* aNode ) + { + TRect clientRect( ClientRect() ); + // Move it to 0, 0 + clientRect.Move( -clientRect.iTl.iX, -clientRect.iTl.iY ); + + RPointerArray< CXnNode > laidOutList; + CleanupClosePushL( laidOutList ); + + if ( IsNodeDisplayedL( *aNode ) ) + { + if ( aNode->ViewNodeImpl() && !aNode ->IsLaidOut() ) + { + aNode->SetMarginRect( clientRect ); + aNode->SetBorderRect( clientRect ); + aNode->SetNormalFlowBorderRect( clientRect ); + aNode->SetPaddingRect( clientRect ); + aNode->SetRect( clientRect ); + } + + // Put areas to place + PlaceAreasL( *aNode, laidOutList, iLayoutPhase, + *iCurrentGraphicsDevice, iHorizontalUnitInPixels, + iVerticalUnitInPixels ); + } + + TInt nextPhase; + + switch ( iLayoutPhase ) + { + case XnLayoutPhase::EMeasure: + nextPhase = XnLayoutPhase::ELayout; + break; + case XnLayoutPhase::ELayout: + // Layout is now calculated + iCurrentView->SetLaidOutL(); + iLayoutControl &= ~XnLayoutControl::EViewDirty; + // Check nodes which dimensions are changed + for ( TInt i = 0; i < laidOutList.Count(); i++ ) + { + CXnNode* node( laidOutList[i] ); + if( IsSrollableBox( *node ) && node->ScrollableControl() ) + { + node->ScrollableControl()->LayoutChangedL(); + } + if ( /*IsNodeTooltip( *node ) ||*/ !node->IsLaidOut() ) + { + continue; + } + CXnControlAdapter* adapter( node->Control() ); + if ( adapter ) + { + TRect rect; + + if ( node->ViewNodeImpl() ) + { + rect = ClientRect(); + + // Move it to 0, 0 + rect.Move( -rect.iTl.iX, -rect.iTl.iY ); + } + else + { + rect = node->BorderRect(); + } + if ( adapter->Rect() != rect ) + { + AddToRedrawListL( node, rect ); + + adapter->SetRect( rect ); + CXnProperty* prop = node->GetPropertyL( + XnPropertyNames::common::KSizeAware ); + if ( prop && prop->StringValue() == + XnPropertyNames::KTrue ) + { + CXnNode* sizeChanged = + BuildTriggerNodeLC( *iUiEngine, + XnPropertyNames::action::trigger::name:: + KSizeChanged ); + node->ReportXuikonEventL( *sizeChanged ); + CleanupStack::PopAndDestroy( sizeChanged ); + } + } + } + } + /* flow through */ + default: + nextPhase = XnLayoutPhase::ENone; + break; + } + CleanupStack::PopAndDestroy( &laidOutList ); + return nextPhase; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::RenderUIL() +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::RenderUIL( CXnNode* /*aNode*/ ) + { + if ( IsLayoutDisabled() ) + { + // Layout is not up-to-date + iLayoutControl |= XnLayoutControl::ERenderUI; + return; + } + +#ifdef _XN3_DEBUG_ + TraceTreeL(iCurrentView ); +#endif + + for( TInt i=0; i<iRedrawRegions.Count(); i++) + { + CCoeControl* control = iRedrawRegions[i]->iControl; + RRegion& redrawRegion = iRedrawRegions[i]->iRegion; + + if( redrawRegion.CheckError() ) + { + // Mark tree rendered + iCurrentView->SetRenderedL(); + // Error occured during dirty set, redraw whole window + control->DrawNow(); + } + else + { + if( !redrawRegion.IsEmpty() ) + { + // Mark tree rendered + iCurrentView->SetRenderedL(); + TInt count( redrawRegion.Count() ); + + if( count > 2 ) + { + // Make bounding rect over the dirty areas + TRect boundingRect( redrawRegion.BoundingRect() ); + + control->DrawNow( boundingRect ); + } + else + { + for( TInt i = 0; i < count; i++ ) + { + // Draw every dirty area separately + TRect redrawRect( redrawRegion[i] ); + + control->DrawNow( redrawRect ); + } + } + } + } + redrawRegion.Clear(); + } + + RefreshMenuL(); + + if ( iLayoutControl & XnLayoutControl::EFirstPassDraw ) + { + iViewManager.SetFirstPassDrawCompleteL(); + iLayoutControl &= ~XnLayoutControl::EFirstPassDraw; + } + + iLayoutControl &= ~XnLayoutControl::ERenderUI; + + iAppUiAdapter.EffectManager()->UiRendered(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::RootNode() +// ----------------------------------------------------------------------------- +// +CXnNode* CXnUiEngineImpl::RootNode() + { + return iViewManager.RootNode(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::ODT() +// ----------------------------------------------------------------------------- +// +CXnODT* CXnUiEngineImpl::ODT() + { + return iViewManager.ODT(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::FindNodeByIdL() +// ----------------------------------------------------------------------------- +// +CXnNode* CXnUiEngineImpl::FindNodeByIdL( const TDesC& aAreaId, + const TDesC& aNamespace ) + { + HBufC8* id = CnvUtfConverter::ConvertFromUnicodeToUtf8L( aAreaId ); + CleanupStack::PushL( id ); + + HBufC8* ns = CnvUtfConverter::ConvertFromUnicodeToUtf8L( aNamespace ); + CleanupStack::PushL( ns ); + + CXnNode* returnValue( FindNodeByIdL( *id, *ns ) ); + + CleanupStack::PopAndDestroy( ns ); + CleanupStack::PopAndDestroy( id ); + + return returnValue; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::FindNodeByIdL() +// ----------------------------------------------------------------------------- +// +CXnNode* CXnUiEngineImpl::FindNodeByIdL( const TDesC8& aAreaId, + const TDesC8& aNamespace ) + { + // Find the namespace where to start node id look-up + CXnPluginData* pluginData( + iViewManager.ActiveViewData().Plugin( aNamespace ) ); + + if ( !pluginData ) + { + return NULL; + } + + CXnNode* root( pluginData->Node()->LayoutNode() ); + + return ::FindNodeByIdL( root, aAreaId, aNamespace ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::FindNodeByClassL() +// ----------------------------------------------------------------------------- +// +CXnPointerArray* CXnUiEngineImpl::FindNodeByClassL( + const TDesC& aClassId, const TDesC& aNamespace ) + { + HBufC8* classId = CnvUtfConverter::ConvertFromUnicodeToUtf8L( aClassId ); + CleanupStack::PushL( classId ); + + HBufC8* ns = CnvUtfConverter::ConvertFromUnicodeToUtf8L( aNamespace ); + CleanupStack::PushL( ns ); + + CXnPointerArray* returnValue( FindNodeByClassL( *classId, *ns ) ); + + CleanupStack::PopAndDestroy( ns ); + CleanupStack::PopAndDestroy( classId ); + + return returnValue; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::FindNodeByClassL() +// ----------------------------------------------------------------------------- +// +CXnPointerArray* CXnUiEngineImpl::FindNodeByClassL( + const TDesC8& aClassId, const TDesC8& aNamespace ) + { + // Find the namespace where to start node class look-up + CXnPluginData* pluginData( + iViewManager.ActiveViewData().Plugin( aNamespace ) ); + + CXnPointerArray* array = CXnPointerArray::NewL(); + CleanupStack::PushL( array ); + + if ( pluginData ) + { + CXnNode* root( pluginData->Node()->LayoutNode() ); + ::FindNodeByClassL( root, aClassId, *array, aNamespace ); + } + + CleanupStack::Pop( array ); + + return array; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::Resources() +// ----------------------------------------------------------------------------- +// +CArrayPtrSeg< CXnResource >& CXnUiEngineImpl::Resources() + { + return iViewManager.Resources(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::SetFocusedNodeL() +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::SetFocusedNodeL( CXnNode* aFocusedNode, TInt aSource ) + { + iKeyEventDispatcher->SetNodeL( aFocusedNode, aSource ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngine::FocusedNode +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +CXnNode* CXnUiEngineImpl::FocusedNode() + { + return iKeyEventDispatcher->FocusedNode(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::IsEditMode +// Returns ETrue if the current mode is edit, otherwise EFalse. +// ----------------------------------------------------------------------------- +// +TBool CXnUiEngineImpl::IsEditMode() + { + return ( iEditMode->EditState() != CXnEditMode::ENone ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::NotifyViewActivatedL() +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::NotifyViewActivatedL( const CXnViewData& /*aViewData*/ ) + { + iCurrentView = iViewManager.ViewNode(); + + 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(); + + RPointerArray< CXnNode >& children( iCurrentView->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 == KXnMenuBar ) + { + iMenuNode = node; + XnMenuInterface::MXnMenuInterface* menuIf( NULL ); + XnComponentInterface::MakeInterfaceL( menuIf, node->AppIfL() ); + if ( menuIf ) + { + menuIf->SetObserver( *this ); + } + } + else if ( type == _L8("styluspopup") ) + { + iStylusPopupNode = node; + + static_cast< CXnPopupControlAdapter* > + ( node->Control() )->SetObserver( *this ); + } + } + + // Set menu node even if its NULL, to allow keyevent dispatcher + // to handle no softkeys + iKeyEventDispatcher->SetMenuNodeL( iMenuNode ); + + ReportScreenDeviceChangeL(); + + SetClientRectL( iAppUiAdapter.ClientRect(), EFalse ); + + RootNode()->SetDirtyL(); + iUiEngine->RenderUIL(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::NotifyWidgetAdditionL() +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::NotifyWidgetAdditionL( + const CXnPluginData& /*aPluginData*/ ) + { + iLayoutControl |= XnLayoutControl::EFirstPassDraw; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::DynInitMenuItemL() +// ----------------------------------------------------------------------------- +// +TBool CXnUiEngineImpl::DynInitMenuItemL( CXnNodeAppIf& aMenuItem, + CXnNodeAppIf* aPlugin ) + { + // dynamic menuitem types reserved for HS internal use, + // internal menuitems' origin must be in active view namespace + _LIT( KAddWidget, "hs_add_widget" ); + _LIT( KRemoveWidget, "hs_remove_widget" ); + _LIT( KAddView, "hs_add_view" ); + _LIT( KRemoveView, "hs_remove_view" ); + _LIT( KOnline, "hs_online" ); + _LIT( KOffline, "hs_offline" ); + + CXnProperty* prop( + aMenuItem.GetPropertyL( XnPropertyNames::menu::KItemType ) ); + + TBool retval( EFalse ); + + if( !prop ) + { + // No type defined, declaration error + return retval; + } + + CXnViewData& viewData( iViewManager.ActiveViewData() ); + + TInt viewAmount( iViewManager.ViewAmount() ); + + // Check if the menuitem is in view namespace + TBool internal( aMenuItem.Namespace() == ActiveView()->Namespace() ); + + HBufC* itemType( prop->StringValueL() ); + CleanupStack::PushL( itemType ); + + if ( internal ) + { + if ( *itemType == KAddWidget ) + { + if ( aPlugin ) + { + CXnPluginData& data( viewData.Plugin( &aPlugin->Node() ) ); + + if ( !data.Occupied() ) + { + retval = ETrue; + } + } + } + else if ( *itemType == KRemoveWidget ) + { + CXnNode* node( ( aPlugin ) ? &aPlugin->Node() : FocusedNode() ); + + if ( node ) + { + CXnPluginData& data( viewData.Plugin( node ) ); + + if ( data.Removable() && data.Occupied() ) + { + retval = ETrue; + } + } + } + else if ( *itemType == KAddView ) + { + // checks Max pages value - from RootData + if ( viewAmount < iViewManager.MaxPages() ) + { + retval = ETrue; + } + } + else if ( *itemType == KRemoveView ) + { + if ( viewData.Removable() && viewAmount > 1 ) + { + retval = ETrue; + } + } + else if ( *itemType == KOnline || *itemType == KOffline ) + { + retval = iAppUiAdapter.DynInitMenuItemL( *itemType ); + } + } + else + { + const TDesC8& ns( aMenuItem.Namespace() ); + + CXnPluginData* data( viewData.Plugin( ns ) ); + + if ( data ) + { + RPointerArray< CXnNode > nodes; + CleanupClosePushL( nodes ); + + data->ContentSourceNodesL( nodes ); + + RPointerArray< CXnNodeAppIf > list; + CleanupClosePushL( list ); + + for ( TInt i = 0; i < nodes.Count(); i++ ) + { + list.AppendL( &nodes[i]->AppIfL() ); + } + + retval = iAppUiAdapter.DynInitMenuItemL( *itemType, &list ); + + CleanupStack::PopAndDestroy( 2, &nodes ); // list + } + } + + CleanupStack::PopAndDestroy( itemType ); + + return retval; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::VerticalPixelValueL() +// ----------------------------------------------------------------------------- +// +TInt CXnUiEngineImpl::VerticalPixelValueL( + CXnProperty* aValue, TInt aReferenceValue ) + { + return ::VerticalPixelValueL( aValue, aReferenceValue, + *iCurrentGraphicsDevice, iVerticalUnitInPixels ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::HorizontalPixelValueL() +// ----------------------------------------------------------------------------- +// +TInt CXnUiEngineImpl::HorizontalPixelValueL( + CXnProperty* aValue, TInt aReferenceValue ) + { + return ::HorizontalPixelValueL( aValue, aReferenceValue, + *iCurrentGraphicsDevice, iHorizontalUnitInPixels ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::VerticalTwipValueL() +// ----------------------------------------------------------------------------- +// +TInt CXnUiEngineImpl::VerticalTwipValueL( CXnProperty* aValue, + TInt aReferenceValue ) + { + return iCurrentGraphicsDevice->VerticalPixelsToTwips( + VerticalPixelValueL( aValue, aReferenceValue ) ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::HorizontalTwipValueL() +// ----------------------------------------------------------------------------- +// +TInt CXnUiEngineImpl::HorizontalTwipValueL( CXnProperty* aValue, + TInt aReferenceValue ) + { + return iCurrentGraphicsDevice->HorizontalPixelsToTwips( + HorizontalPixelValueL( aValue, aReferenceValue ) ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::ViewManager() +// ----------------------------------------------------------------------------- +// +CXnViewManager* CXnUiEngineImpl::ViewManager() + { + return &iViewManager; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::ActiveView() +// ----------------------------------------------------------------------------- +// +CXnNode* CXnUiEngineImpl::ActiveView() + { + return iViewManager.ViewNode(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::RefreshMenuL +// Refresh current menu +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::RefreshMenuL() + { + if ( iLayoutControl & XnLayoutControl::ERefreshMenu ) + { + iKeyEventDispatcher->RefreshMenuL(); + iLayoutControl &= ~XnLayoutControl::ERefreshMenu; + } + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::AddDirtyNodeL +// Add a dirty node. This method must be called via CXnNode SetDirtyL +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::AddDirtyNodeL( CXnNode* aNode, TInt aLevel ) + { + CXnViewData& data( iViewManager.ActiveViewData() ); + + if ( !aNode || ( aNode != RootNode() && !data.Plugin( aNode->Namespace() ) ) ) + { + // No node, or node doesn't belong to active view namespace + return; + } + + if ( aNode->Type()->Type() == KMenuBar ) + { + iLayoutControl |= XnLayoutControl::ERefreshMenu; + return; + } + + if ( iLayoutControl & XnLayoutControl::EViewDirty ) + { + // nothing to do + return; + } + + if ( aLevel == XnDirtyLevel::ERender ) + { + if( aNode == RootNode() ) + { + TXnDirtyRegion* dirtyRegion = FindDirtyRegionL( *iCurrentView ); + if( dirtyRegion ) + { + dirtyRegion->iRegion.Clear(); + } + aNode = iCurrentView; + } + + // Add to redraw list + AddToRedrawListL( aNode ); + } + else + { + // Add to dirty list for relayout and redraw + AddToDirtyListL( aNode ); + } + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::ScreenDeviceSize +// Get the size of the current screen device +// ----------------------------------------------------------------------------- +// +TSize CXnUiEngineImpl::ScreenDeviceSize() const + { + if ( iCurrentGraphicsDevice ) + { + return iCurrentGraphicsDevice->SizeInPixels(); + } + + return TSize( 0, 0 ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::IsDialogDisplaying +// Whether the dialog is displaying or not. +// ----------------------------------------------------------------------------- +// +TBool CXnUiEngineImpl::IsDialogDisplaying() + { + return iAppUiAdapter.IsDisplayingControlBetweenPriorities( + ECoeStackPriorityDialog - 1, KXnStackPriorityKeyEventDispatcher - 1 ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::HandleResourceChangeL +// Handles a change to the control's resources of type aType +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::HandleResourceChangeL( TInt aType ) + { + if ( iMenuNode ) + { + CXnControlAdapter* adapter( iMenuNode->Control() ); + + if ( adapter ) + { + adapter->HandleResourceChange( aType ); + } + } + + 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 ); + + 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(); + } + else if ( aType == KAknsMessageSkinChange ) + { + // Force relayout + DisableRenderUiLC(); + + RootNode()->SetDirtyL(); + + for ( TInt i = 0; i < iControlAdapterList->Count(); i++ ) + { + CXnControlAdapter* adapter( ( *iControlAdapterList )[i] ); + adapter->SkinChanged(); + } + + ForceRenderUIL(); + + CleanupStack::PopAndDestroy(); + } + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::IsMenuDisplaying +// Checks whether the menu is displaying or not. +// ----------------------------------------------------------------------------- +// +TBool CXnUiEngineImpl::IsMenuDisplaying() + { + return iKeyEventDispatcher->IsMenuFocused(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::MenubarNode +// Returns menubar node +// ----------------------------------------------------------------------------- +// +CXnNode* CXnUiEngineImpl::MenuBarNode() const + { + return iMenuNode; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::StylusPopupNode +// Returns stylus popup node +// ----------------------------------------------------------------------------- +// +CXnNode* CXnUiEngineImpl::StylusPopupNode() const + { + return iStylusPopupNode; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::AddPassiveFocusedNode +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::AddPassiveFocusedNodeL( CXnNode* aNode ) + { + iKeyEventDispatcher->AddPassiveFocusedNodeL( aNode ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::RemovePassiveFocusedNode +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::RemovePassiveFocusedNodeL( CXnNode* aNode ) + { + iKeyEventDispatcher->RemovePassiveFocusedNodeL( aNode ); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::AddPassiveFocusedNode +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::ClearPassiveFocusedNodesL() + { + iKeyEventDispatcher->ClearPassiveFocusedNodesL(); + } + +// ----------------------------------------------------------------------------- +// SetNodeDroppedL() +// Sets node's dropped state +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::SetNodeDroppedL( CXnNode& aNode, TInt aDropped ) const + { + if ( aDropped != XnNodeLayout::ENone ) + { + CXnNode* parent( aNode.Parent() ); + TInt parentAdaptive( parent->IsAdaptive( ETrue ) ); + + if ( iLayoutPhase == XnLayoutPhase::EMeasure ) + { + if ( !parentAdaptive ) + { + // Only adaptive childs can be dropped during measure phase + return; + } + } + +#ifdef _XN3_DEBUG_ + CXnProperty* id( aNode.IdL() ); + + if ( id ) + { + TBuf8< 256 > debug; + debug.Append( _L8( "Node id: " ) ); + debug.Append( id->StringValue() ); + debug.Append( _L8( " will be set to dropped" ) ); + RDebug::RawPrint( debug ); + } +#endif + + // Node will be dropped + aNode.SetDropped( aDropped ); + + // Get ride of its rects + ClearRects( aNode ); + + if ( parentAdaptive ) + { + // Is there adaptive content left after dropping? + CheckAdaptiveContentL( *parent, parent->Rect().Size() ); + } + } + else + { + // Node is no more dropped + aNode.SetDropped( aDropped ); + } + } + +// ----------------------------------------------------------------------------- +// CheckAdaptiveContentL() +// Checks if node is adaptive, but doesn't have any content +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::CheckAdaptiveContentL( + CXnNode& aNode, TSize aAvailableSize ) const + { + TInt adaptive( aNode.IsAdaptive( ETrue ) ); + TBool isEmpty( EFalse ); + + if ( adaptive ) + { + if ( aAvailableSize == TSize::EUninitialized ) + { + // Use max available size + aAvailableSize = ScreenDeviceSize(); + } + + const TDesC8& name( aNode.Type()->Type() ); + + if ( name == KBoxNodeName || name == KButtonNodeName ) + { + RPointerArray< CXnNode > displayedChildren; + CleanupClosePushL( displayedChildren ); + + TInt displayedCount( DisplayedChildrenCountL( + aNode, &displayedChildren ) ); + + if ( displayedCount == 0 ) + { + isEmpty = ETrue; + } + else + { + for ( TInt i = 0; i < displayedChildren.Count(); i++ ) + { + CheckAdaptiveContentL( *displayedChildren[i], + aAvailableSize ); + } + + if ( DisplayedChildrenCountL( aNode ) == 0 ) + { + isEmpty = ETrue; + } + } + + CleanupStack::PopAndDestroy( &displayedChildren ); + } + + if ( isEmpty ) + { + // No content available, drop adaptive node + SetNodeDroppedL( aNode, XnNodeLayout::EDropped ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::AddFocusCandidateL +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::AddFocusCandidateL( CXnNode* aNode ) + { + if ( !aNode ) + { + return; + } + TInt index( iFocusCandidateList.Find( aNode ) ); + if ( index == KErrNotFound ) + { + iFocusCandidateList.AppendL( aNode ); + } + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::IsLayoutDisabled +// ----------------------------------------------------------------------------- +// +TBool CXnUiEngineImpl::IsLayoutDisabled() + { + if ( !iCurrentView ) + { + return ETrue; + } + + TBool retval( EFalse ); + if ( iDisableCount > 0 && + !( iLayoutControl & XnLayoutControl::EIgnoreState ) ) + { + retval = ETrue; + } + return retval; + } + +// ----------------------------------------------------------------------------- +// AddToRedrawListL +// Mark Control's appearance to be redrawn +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::AddToRedrawListL( CXnNode* aNode, TRect aRect ) + { + CXnControlAdapter* aAdapter( aNode->Control() ); + + if( !aAdapter ) + { + return; + } + + if( aRect != TRect::EUninitialized ) + { + // This is the new rect which will be set by layout algo + AddRedrawRectL( aRect, *aNode ); + } + + TRect rect( aAdapter->Rect() ); + + if( rect == TRect::EUninitialized ) + { + // Don't add uninitialized rect + return; + } + + /* + if( aNode->IsStateSet( XnPropertyNames::style::common::KFocus ) ) + { + const TDesC8& name( aNode->DomNode()->Name() ); + + if( name == KPlugin ) + { + rect.Grow( KFocusGrowValue, KFocusGrowValue ); + } + else + { + TRect marginRect( aNode->MarginRect() ); + + CXnNode* parent( aNode->Parent() ); + + for( ; parent; parent = parent->Parent() ) + { + if( parent->DomNode()->Name() == KPlugin ) + { + if( parent->Rect() == marginRect ) + { + rect.Grow( KFocusGrowValue, KFocusGrowValue ); + } + + break; + } + } + } + } + */ + GrowIfNeeded(aNode, rect); + AddRedrawRectL( rect, *aNode ); + } + +// ----------------------------------------------------------------------------- +// AddToDirtyListL +// Mark node to dirty list for relayout +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::AddToDirtyListL( CXnNode* aNode ) + { + CXnNode* nodeToRedrawList( aNode ); + CXnNode* nodeToDirtyList( aNode ); + + if ( aNode == RootNode() ) + { + // Force relayout and redraw from current view + iDirtyList.Reset(); + iDirtyList.AppendL( iCurrentView ); + TXnDirtyRegion* dirtyRegion = FindDirtyRegionL( *iCurrentView ); + if( dirtyRegion ) + { + dirtyRegion->iRegion.Clear(); + } + iLayoutControl |= XnLayoutControl::EViewDirty; + nodeToDirtyList = nodeToRedrawList = iCurrentView; + nodeToDirtyList->ClearRenderedAndLaidOut(); + + // Add to draw list for redraw + AddToRedrawListL( nodeToRedrawList ); + } + else + { + if ( !IsAbsoluteL( *aNode ) && !IsNodeTooltip( *aNode ) ) + { + // Check adaptives in normal flow + CXnNode* oldest( NULL ); + CXnNode* adaptive( aNode ); + + if ( !aNode->IsAdaptive( ETrue ) ) + { + adaptive = aNode->Parent(); + } + + for ( ; adaptive && adaptive->IsAdaptive( ETrue ); + adaptive = adaptive->Parent() ) + { + oldest = adaptive; + } + + // Now we have found the oldest adaptive node if present + if ( oldest ) + { + nodeToRedrawList = nodeToDirtyList = adaptive; + } + } + + RPointerArray< CXnNode > dirtyList; + CleanupClosePushL( dirtyList ); + TInt count( iDirtyList.Count() ); + TBool found; + + // first, check that aNode's children are not in the dirty array + for ( TInt i = 0; i < count; ++i ) + { + found = EFalse; + CXnNode* candidate( iDirtyList[i] ); + + for ( CXnNode* node = candidate->Parent(); node && !found; + node = node->Parent() ) + { + if ( nodeToDirtyList == node ) + { + found = ETrue; + } + } + + if ( !found ) + { + // Put candidate back to list as child is not found + dirtyList.AppendL( candidate ); + } + } + + found = EFalse; + + // second, check that aNode's parent is not in dirty array + for ( TInt i = 0; i < count && !found; ++i ) + { + CXnNode* candidate( iDirtyList[i] ); + + for ( CXnNode* node = nodeToDirtyList; node && !found; + node = node->Parent() ) + { + if ( node == candidate ) + { + found = ETrue; + } + } + } + + if ( !found && iDirtyList.Find( nodeToDirtyList ) == KErrNotFound ) + { + // Add node to dirty list as parent is neither found + dirtyList.AppendL( nodeToDirtyList ); + nodeToDirtyList->ClearRenderedAndLaidOut(); + + // Add to draw list for redraw + AddToRedrawListL( nodeToRedrawList ); + } + + // finally update the dirty list + iDirtyList.Reset(); + iDirtyList = dirtyList; + + CleanupStack::Pop( &dirtyList ); + } + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::SetClientRectL +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::SetClientRectL( TRect aRect, TBool aDrawNow ) + { + if ( iClientRect != aRect ) + { + iClientRect = aRect; + + UpdateInternalUnits( iHorizontalUnitInPixels, iVerticalUnitInPixels, + iClientRect ); + + iAppUiAdapter.ViewAdapter().BgControl().SetRect( aRect ); + + if ( aDrawNow ) + { + RootNode()->SetDirtyL(); + iUiEngine->RenderUIL(); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::ClientRect +// ----------------------------------------------------------------------------- +// +TRect CXnUiEngineImpl::ClientRect() const + { + return iClientRect; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::Editor +// ----------------------------------------------------------------------------- +// +CXnEditor* CXnUiEngineImpl::Editor()const + { + return &iViewManager.Editor(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::EditMode +// ----------------------------------------------------------------------------- +// +CXnEditMode* CXnUiEngineImpl::EditMode() + { + return iEditMode; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::StartLayoutFromL +// ----------------------------------------------------------------------------- +// +CXnNode* CXnUiEngineImpl::StartLayoutFromL() + { + if ( iLayoutControl & XnLayoutControl::EViewDirty ) + { + return iCurrentView; + } + + RPointerArray< CXnNode >parentArray; + CleanupClosePushL( parentArray ); + TInt dirtyCount = iDirtyList.Count(); + CXnNode* startNode( NULL ); + + for ( TInt dirtyIndex = 0; dirtyIndex < dirtyCount; dirtyIndex++ ) + { + startNode = iDirtyList[dirtyIndex]; + + for ( ;startNode && startNode != iCurrentView; ) + { + parentArray.Append( startNode->Parent() ); + startNode = startNode->Parent(); + } + } + + TInt parentCount = parentArray.Count(); + + for ( TInt parentIndex = 0; parentIndex < parentCount; parentIndex++ ) + { + TInt parentsFound = 0; + + for ( TInt checkIndex = 0; checkIndex < parentCount; checkIndex++ ) + { + if ( parentArray[parentIndex] == parentArray[checkIndex] ) + { + parentsFound++; + + if ( parentsFound == dirtyCount ) + { + startNode = parentArray[parentIndex]; + CleanupStack::PopAndDestroy( &parentArray ); + return startNode; + } + } + } + } + + CleanupStack::PopAndDestroy( &parentArray ); + + return iCurrentView; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::Plugins +// ----------------------------------------------------------------------------- +// +RPointerArray< CXnNode >* CXnUiEngineImpl::Plugins() + { + return &iViewManager.PluginNodes(); + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::ForceRenderUIL +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::ForceRenderUIL( TBool aLayoutOnly ) + { + iLayoutControl |= XnLayoutControl::EIgnoreState; + if ( aLayoutOnly ) + { + LayoutUIL(); + } + else + { + LayoutUIL(); + RenderUIL(); + } + iLayoutControl &= ~XnLayoutControl::EIgnoreState; + } + +// ----------------------------------------------------------------------------- +// 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 +// ----------------------------------------------------------------------------- +// +TInt CXnUiEngineImpl::GetThemeResource( const TDesC& aPath, RFile& aFile ) + { + TInt err = KErrNone; + + // parse file name and extension + TParsePtrC fileParser( aPath ); + TPtrC filepath = fileParser.DriveAndPath(); + + RFs session ( CCoeEnv::Static()->FsSession() ); + + // open resource file + session.SetSessionPath( filepath ); + session.ShareProtected(); + err = aFile.Open( session, aPath, EFileShareReadersOnly ); + if ( err != KErrNone ) + { + aFile.Close(); + } + + return err; + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::AnalyseAddedWidgetL +// ----------------------------------------------------------------------------- +// +TBool CXnUiEngineImpl::AnalyseAddedWidgetL( CXnNode& aNode ) + { + TBool retval( ETrue ); + + // Force layout to analyse added widget's dimensions + ForceRenderUIL( ETrue ); + + if ( aNode.IsAdaptive( ETrue ) ) + { + // If widget place holder (plugin in view.xml) is adaptive, then + // we need to verify that added widget will fit to available space + retval = EFalse; + + CXnNode* parent( aNode.Parent() ); + RPointerArray< CXnNode >& children( parent->Children() ); + CXnProperty* prop( parent->BlockProgressionL() ); + + const TDesC8* bp( + &XnPropertyNames::style::common::block_progression::KTB() ); + + if ( prop ) + { + bp = &prop->StringValue(); + } + + prop = parent->DirectionL(); + + const TDesC8* dir( + &XnPropertyNames::style::common::direction::KLTR() ); + + if ( prop ) + { + // use default + dir = &prop->StringValue(); + } + + TSize space( CalculateSpaceUsedByChildrenL( children, *parent, + *bp, *dir, *iCurrentGraphicsDevice, iHorizontalUnitInPixels, + iVerticalUnitInPixels ) ); + + TSize parentSize( parent->Rect().Size() ); + + if ( *bp == XnPropertyNames::style::common::block_progression::KTB || + *bp == XnPropertyNames::style::common::block_progression::KBT ) + { + if ( parentSize.iHeight >= space.iHeight ) + { + retval = ETrue; + } + } + else // LR / RL + { + if ( parentSize.iWidth >= space.iWidth ) + { + retval = ETrue; + } + } + } + + return retval; + } + + + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::NotifyWidgetRemovalL( ) +// Notify about widget removal +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::NotifyWidgetRemovalL( + const CXnPluginData& /*aPluginData*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::NotifyConfigureWidgetL( ) +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::NotifyConfigureWidgetL( + const CHsContentInfo& /*aContentInfo*/, CXnPluginData& /*aPluginData*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CXnUiEngineImpl::NotifyViewDeactivatedL +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::NotifyViewDeactivatedL( + const CXnViewData& /*aViewData*/ ) + { + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::DisableRenderUiLC() + { + CleanupStack::PushL( TCleanupItem( EnableRenderUi, this ) ); + + iDisableCount++; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +EXPORT_C /* static */ void CXnUiEngineImpl::EnableRenderUi( TAny* aAny ) + { + CXnUiEngineImpl* self = static_cast< CXnUiEngineImpl* >( aAny ); + + if ( self->iDisableCount > 0 ) + { + self->iDisableCount--; + + if ( self->iDisableCount == 0 ) + { + TRAP_IGNORE( + // Is menu refresh pending? + if ( ( self->iLayoutControl & XnLayoutControl::ERefreshMenu ) && + !self->IsMenuDisplaying() ) + { + // RefreshMenuL will reset the state flag + self->RefreshMenuL(); + } + + // Is layout pending? + if ( self->iLayoutControl & XnLayoutControl::ELayoutUI ) + { + self->LayoutUIL(); + } + + // Is render pending? + if ( self->iLayoutControl & XnLayoutControl::ERenderUI ) + { + self->RenderUIL(); + } + ); + } + } + } + + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CXnUiEngineImpl::ReportScreenDeviceChangeL() + { + CXnNode* trigger( BuildScreenDeviceChangeTriggerNodeLC( *iUiEngine ) ); + + // Notify current orientation to iCurrentView + iCurrentView->ReportXuikonEventL( *trigger ); + + // Notify also plugins + RPointerArray<CXnNode> plugins = *Plugins(); + for( TInt i=0; i<plugins.Count(); i++ ) + { + CXnNode* pluginNode = plugins[i]; + RPointerArray<CXnNode> pluginChildren = pluginNode->Children(); + for( TInt ii=0; ii<pluginChildren.Count(); ii++ ) + { + CXnDomNode* widgetNode = pluginChildren[ii]->DomNode(); + if( widgetNode && widgetNode->Name() == KWidgetNodeName ) + { + pluginChildren[ii]->ReportXuikonEventL( *trigger ); + } + } + } + + CleanupStack::PopAndDestroy(); // trigger + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +CCoeControl* CXnUiEngineImpl::WindowOwningControl( CXnNode& aNode ) + { + CXnNode* parent = &aNode; + while( parent ) + { + CXnControlAdapter* adapter = parent->Control(); + if( adapter ) + { + if( parent->ViewNodeImpl() && + adapter == iCurrentViewControlAdapter ) + { + return adapter; + } + else if( adapter->OwnsWindow() ) + { + if( !IsNodeTooltip( *parent ) ) + { + return adapter; + } + else + { + return NULL; + } + } + } + parent = parent->Parent(); + } + return NULL; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +TXnDirtyRegion* CXnUiEngineImpl::FindDirtyRegionL( CXnNode& aNode ) + { + CCoeControl* control = WindowOwningControl( aNode ); + if( !control ) + { + return NULL; + } + for( TInt i=0; i<iRedrawRegions.Count(); i++ ) + { + if( iRedrawRegions[i]->iControl == control ) + { + return iRedrawRegions[i]; + } + } + TXnDirtyRegion* region = new (ELeave) TXnDirtyRegion; + CleanupStack::PushL( region ); + region->iControl = control; + iRedrawRegions.AppendL( region ); + CleanupStack::Pop(); + return region; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +void CXnUiEngineImpl::AddRedrawRectL( TRect aRect, CXnNode& aNode ) + { + TXnDirtyRegion* dirtyReg = FindDirtyRegionL( aNode ); + if( dirtyReg ) + { + dirtyReg->iRegion.AddRect( aRect ); + dirtyReg->iRegion.Tidy(); + } + } + +// ----------------------------------------------------------------------------- +// SetEventDispatcher +// ----------------------------------------------------------------------------- +void CXnUiEngineImpl::SetEventDispatcher( CXnKeyEventDispatcher* aDispatcher ) + { + iKeyEventDispatcher = aDispatcher; + } + +// ----------------------------------------------------------------------------- +// NotifyStatusPaneSizeChanged +// ----------------------------------------------------------------------------- +void CXnUiEngineImpl::NotifyStatusPaneSizeChanged() + { + TRAP_IGNORE( iUiEngine->SetClientRectL( iAppUiAdapter.ClientRect() ) ); + } + +// ----------------------------------------------------------------------------- +// NotifyResourceChanged +// ----------------------------------------------------------------------------- +void CXnUiEngineImpl::NotifyResourceChanged( TInt aType ) + { + TRAP_IGNORE( HandleResourceChangeL( aType ) ); + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnuienginepluginif.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuienginepluginif.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,441 @@ +/* +* 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: Xuikon layout engine plugin interface +* +*/ + +// User includes +#include "xnuienginepluginif.h" +#include "xnuiengine.h" +#include "xnnode.h" +#include "xnnodepluginif.h" +#include "xnproperty.h" +#include "xnpointerarray.h" +#include "xnodt.h" +#include "xndomdocument.h" +#include "xneditmode.h" +#include "xneditor.h" +#include "xnviewdata.h" +#include "xndomnode.h" +#include "xnhittest.h" +#include "xnpanic.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::TXnUiEnginePluginIf +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +TXnUiEnginePluginIf::TXnUiEnginePluginIf( CXnUiEngine& aUiEngine ) + { + iUiEngine = &aUiEngine; + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::RootNode +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnNodePluginIf& TXnUiEnginePluginIf::RootNodeL() + { + CXnNode* node = iUiEngine->RootNode(); + return node->PluginIfL(); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::FindNodeByIdL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnNodePluginIf* TXnUiEnginePluginIf::FindNodeByIdL( + const TDesC& aNodeId, + const TDesC& aNamespace ) + { + CXnNode* node = iUiEngine->FindNodeByIdL( aNodeId, aNamespace ); + if ( !node ) + { + return NULL; + } + return &( node->PluginIfL() ); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::FindNodeByIdL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnNodePluginIf* TXnUiEnginePluginIf::FindNodeByIdL( + const TDesC8& aNodeId, + const TDesC8& aNamespace ) + { + CXnNode* node = iUiEngine->FindNodeByIdL( aNodeId, aNamespace ); + if ( !node ) + { + return NULL; + } + return &( node->PluginIfL() ); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::FindNodeByClassL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C RPointerArray< CXnNodePluginIf > TXnUiEnginePluginIf::FindNodeByClassL( + const TDesC& aClassId ) + { + CXnPointerArray* array = iUiEngine->FindNodeByClassL( aClassId ); + CleanupStack::PushL( array ); + RPointerArray< CXnNodePluginIf > interfaceArray; + // Push interfaceArray.Close() on cleanup stack to free the array buffer in + // case of a leave + CleanupClosePushL( interfaceArray ); + const TInt count = array->Container().Count(); + // Reserve the needed array buffer in one allocation to increase + // excution speed and decrease heap fragmentation + interfaceArray.ReserveL( count ); + for ( TInt i = 0; i < count; ++i ) + { + 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->PluginIfL() ) ); + } + CleanupStack::Pop( &interfaceArray ); + CleanupStack::PopAndDestroy( array ); + return interfaceArray; + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::RenderUIL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C void TXnUiEnginePluginIf::RenderUIL( CXnNodePluginIf* aNode ) + { + CXnNode* node = NULL; + if ( aNode ) + { + node = &( aNode->Node() ); + } + iUiEngine->RenderUIL( node ); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::Resources +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C CArrayPtrSeg< CXnResource >& TXnUiEnginePluginIf::Resources() + { + return iUiEngine->Resources(); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::FocusedNode +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnNodePluginIf* TXnUiEnginePluginIf::FocusedNodeL() + { + CXnNodePluginIf* ret = NULL; + if ( iUiEngine->FocusedNode() ) + { + ret = &( iUiEngine->FocusedNode()->PluginIfL() ); + } + return ret; + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::SetFocusedNode +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C void TXnUiEnginePluginIf::SetFocusedNode( + CXnNodePluginIf* aFocusedNode ) + { + CXnNode* node( NULL ); + + if ( aFocusedNode ) + { + node = &( aFocusedNode->Node() ); + } + + TRAP_IGNORE + ( + node->SetStateWithoutNotificationL( + XnPropertyNames::style::common::KFocus ); + ); + } + +// ----------------------------------------------------------------------------- +// 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 +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnDomStringPool& TXnUiEnginePluginIf::StringPool() + { + return iUiEngine->ODT()->DomDocument().StringPool(); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::VerticalPixelValueL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TXnUiEnginePluginIf::VerticalPixelValueL( + CXnProperty* aValue, TInt aReferenceValue ) + { + return iUiEngine->VerticalPixelValueL( aValue, aReferenceValue ); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::HorizontalPixelValueL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TXnUiEnginePluginIf::HorizontalPixelValueL( + CXnProperty* aValue, TInt aReferenceValue ) + { + return iUiEngine->HorizontalPixelValueL( aValue, aReferenceValue ); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::VerticalTwipValueL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TXnUiEnginePluginIf::VerticalTwipValueL( + CXnProperty* aValue, TInt aReferenceValue ) + { + return iUiEngine->VerticalTwipValueL( aValue, aReferenceValue ); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::HorizontalTwipValueL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TXnUiEnginePluginIf::HorizontalTwipValueL( + CXnProperty* aValue, TInt aReferenceValue ) + { + return iUiEngine->HorizontalTwipValueL( aValue, aReferenceValue ); + } + +// ----------------------------------------------------------------------------- +// 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 +// ----------------------------------------------------------------------------- +// +EXPORT_C TSize TXnUiEnginePluginIf::ScreenDeviceSize() + { + return iUiEngine->ScreenDeviceSize(); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::IsDialogDisplaying +// Checks whether the dialog is displaying or not. +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool TXnUiEnginePluginIf::IsDialogDisplaying() + { + return iUiEngine->IsDialogDisplaying(); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::AddDirtyNodeL +// Sets the given node dirty. +// ----------------------------------------------------------------------------- +// +EXPORT_C void TXnUiEnginePluginIf::AddDirtyNodeL( CXnNodePluginIf& aNode ) + { + aNode.SetDirtyL(); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::IsMenuDisplaying +// Checks whether the menu is displaying or not. +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool TXnUiEnginePluginIf::IsMenuDisplaying() + { + return iUiEngine->IsMenuDisplaying(); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::LayoutUIL +// Forwards the call to the ui engine implementation +// ----------------------------------------------------------------------------- +// +EXPORT_C void TXnUiEnginePluginIf::LayoutUIL( CXnNodePluginIf* aNode ) + { + CXnNode* node = NULL; + if ( aNode ) + { + node = &( aNode->Node() ); + } + iUiEngine->LayoutUIL( node ); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::EditState +// Checks wheter editmode is active or not +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TXnUiEnginePluginIf::EditMode() + { + return iUiEngine->EditMode()->EditState(); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::WidgetsVisible +// Checks widgets' visibility state +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool TXnUiEnginePluginIf::WidgetsVisible() const + { + return iUiEngine->Editor()->WidgetsVisible(); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::HitRegion +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnControlAdapter* TXnUiEnginePluginIf::HitRegion() const + { + return iUiEngine->HitTest().HitRegion(); + } + +// ----------------------------------------------------------------------------- +// TXnUiEnginePluginIf::DeactivateFocusedNodeL +// Deactivates focused node +// ----------------------------------------------------------------------------- +// +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( + CXnNodePluginIf* aNode ) + { + CXnViewManager* manager( iUiEngine->ViewManager() ); + + CXnNode* node( NULL ); + + if ( manager ) + { + CXnPluginData& pluginData( + manager->ActiveViewData().Plugin( &aNode->Node() ) ); + + CXnDomNode* domNode( pluginData.Owner() ); + + if ( domNode ) + { + node = domNode->LayoutNode(); + } + } + + if( !node ) + { + User::Leave( KErrNotFound ); + } + + return node->PluginIfL(); + } + +// ----------------------------------------------------------------------------- +// 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 +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void TXnUiEnginePluginIf::DisableRenderUiLC() + { + iUiEngine->DisableRenderUiLC(); + } + +// End of file + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnuistatelistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuistatelistener.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,331 @@ +/* +* 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: UI State Listener +* +*/ + +// System includes +#include <ctsydomainpskeys.h> + +// User includes +#include "xnappuiadapter.h" +#include "xnuistatelistener.h" + +// ============================ LOCAL FUNCTIONS ================================ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnUiStateListener::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnUiStateListener* CXnUiStateListener::NewL( CXnAppUiAdapter& aAdapter ) + { + CXnUiStateListener* self = CXnUiStateListener::NewLC( aAdapter ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnUiStateListener::NewLC() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnUiStateListener* CXnUiStateListener::NewLC( CXnAppUiAdapter& aAdapter ) + { + CXnUiStateListener* self = new( ELeave ) CXnUiStateListener( aAdapter ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnUiStateListener::CXnUiStateListener() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnUiStateListener::CXnUiStateListener( CXnAppUiAdapter& aAdapter ) + : iAppUiAdapter( aAdapter ), iLightStatus( CHWRMLight::ELightStatusUnknown ) + { + } + +// ----------------------------------------------------------------------------- +// CXnUiStateListener::~CXnUiStateListener() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +CXnUiStateListener::~CXnUiStateListener() + { + iUiStateObservers.Reset(); + iResourceChangeObservers.Reset(); + + iAppUiAdapter.StatusPane()->SetObserver( NULL ); + CCoeEnv::Static()->RemoveMessageMonitorObserver( *this ); + + delete iLightObserver; + delete iCallStateObserver; + } + +// ----------------------------------------------------------------------------- +// CXnUiStateListener::ConstructL() +// 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CXnUiStateListener::ConstructL() + { + iLightObserver = CHWRMLight::NewL( this ); + + iCallStateObserver = CXnPropertySubscriber::NewL( KPSUidCtsyCallInformation, + KCTsyCallState, *this ); + + iAppUiAdapter.StatusPane()->SetObserver( this ); + + CCoeEnv::Static()->AddMessageMonitorObserverL( *this ); + } + +// ----------------------------------------------------------------------------- +// CXnUiStateListener::AddObserver() +// Adds MXnUiStateObserver +// ----------------------------------------------------------------------------- +// +void CXnUiStateListener::AddObserver( const MXnUiStateObserver& aObserver ) + { + if ( iUiStateObservers.InsertInAddressOrder( &aObserver ) == KErrNone ) + { + MXnUiStateObserver& observer( + const_cast< MXnUiStateObserver & >( aObserver) ); + + if ( iForegroundStatus != MXnUiStateObserver::EUnknown ) + { + observer.NotifyForegroundChanged( iForegroundStatus ); + } + + observer.NotifyInCallStateChaged( iInCallState ); + observer.NotifyLightStatusChanged( + iLightStatus == CHWRMLight::ELightOn ? ETrue : EFalse ); + } + } + +// ----------------------------------------------------------------------------- +// CXnUiStateListener::RemoveObserver() +// Removes MXnUiStateObserver +// ----------------------------------------------------------------------------- +// +void CXnUiStateListener::RemoveObserver( const MXnUiStateObserver& aObserver ) + { + TInt index( iUiStateObservers.Find( &aObserver ) ); + + if ( index != KErrNotFound ) + { + iUiStateObservers.Remove( index ); + } + } + +// ----------------------------------------------------------------------------- +// CXnUiStateListener::AddObserver() +// Adds MXnUiResourceChangeObserver +// ----------------------------------------------------------------------------- +// +void CXnUiStateListener::AddObserver( + const MXnUiResourceChangeObserver& aObserver ) + { + iResourceChangeObservers.InsertInAddressOrder( &aObserver ); + } + +// ----------------------------------------------------------------------------- +// CXnUiStateListener::RemoveObserver() +// Removes MXnUiResourceChangeObserver +// ----------------------------------------------------------------------------- +// +void CXnUiStateListener::RemoveObserver( + const MXnUiResourceChangeObserver& aObserver ) + { + TInt index( iResourceChangeObservers.Find( &aObserver ) ); + + if ( index != KErrNotFound ) + { + iResourceChangeObservers.Remove( index ); + } + } + +// ----------------------------------------------------------------------------- +// CXnUiStateListener::HandleResourceChangeL() +// +// ----------------------------------------------------------------------------- +// +void CXnUiStateListener::HandleResourceChangeL( TInt aType ) + { + MXnUiStateObserver::TForegroundStatus status( iForegroundStatus ); + + if ( aType == KEikMessageFadeAllWindows ) + { + if ( iForegroundStatus != MXnUiStateObserver::EBackground ) + { + iForegroundStatus = MXnUiStateObserver::EPartialForeground; + } + } + else if ( aType == KEikMessageUnfadeWindows ) + { + if ( iForegroundType == KAknFullOrPartialForegroundGained ) + { + if ( iAppUiAdapter.IsPartialForeground() ) + { + iForegroundStatus = MXnUiStateObserver::EPartialForeground; + } + else + { + iForegroundStatus = MXnUiStateObserver::EForeground; + } + } + } + + if ( status != iForegroundStatus ) + { + for ( TInt i = 0; i < iUiStateObservers.Count(); i++ ) + { + iUiStateObservers[i]-> + NotifyForegroundChanged( iForegroundStatus ); + } + } + + for ( TInt i = 0; i < iResourceChangeObservers.Count(); i++ ) + { + iResourceChangeObservers[i]->NotifyResourceChanged( aType ); + } + } + +// ----------------------------------------------------------------------------- +// CXnUiStateListener::MonitorWsMessage() +// +// ----------------------------------------------------------------------------- +// +void CXnUiStateListener::MonitorWsMessage( const TWsEvent& aEvent ) + { + TInt type( aEvent.Type() ); + + MXnUiStateObserver::TForegroundStatus status( iForegroundStatus ); + + if ( type == KAknFullOrPartialForegroundGained ) + { + iForegroundType = type; + + if ( iAppUiAdapter.IsPartialForeground() ) + { + iForegroundStatus = MXnUiStateObserver::EPartialForeground; + } + else + { + iForegroundStatus = MXnUiStateObserver::EForeground; + } + } + else if ( type == KAknFullOrPartialForegroundLost ) + { + iForegroundType = type; + + iForegroundStatus = MXnUiStateObserver::EBackground; + } + else if ( type == EEventFocusLost ) + { + iForegroundStatus = MXnUiStateObserver::EBackground; + } + else if ( type == EEventFocusGained ) + { + if ( iForegroundType == KAknFullOrPartialForegroundGained ) + { + if ( iAppUiAdapter.IsPartialForeground() ) + { + iForegroundStatus = MXnUiStateObserver::EPartialForeground; + } + else + { + iForegroundStatus = MXnUiStateObserver::EForeground; + } + } + } + + if ( status != iForegroundStatus ) + { + for ( TInt i = 0; i < iUiStateObservers.Count(); i++ ) + { + iUiStateObservers[i]-> + NotifyForegroundChanged( iForegroundStatus ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnUiStateListener::HandleStatusPaneSizeChange() +// +// ----------------------------------------------------------------------------- +// +void CXnUiStateListener::HandleStatusPaneSizeChange() + { + for ( TInt i = 0; i < iResourceChangeObservers.Count(); i++ ) + { + iResourceChangeObservers[i]->NotifyStatusPaneSizeChanged(); + } + } + +// ----------------------------------------------------------------------------- +// CXnUiStateListener::LightStatusChanged() +// +// ----------------------------------------------------------------------------- +// +void CXnUiStateListener::LightStatusChanged( TInt aTarget, + CHWRMLight::TLightStatus aStatus ) + { + if ( aTarget == CHWRMLight::EPrimaryDisplay ) + { + if ( ( aStatus == CHWRMLight::ELightOn || + aStatus == CHWRMLight::ELightOff ) && + aStatus != iLightStatus ) + { + iLightStatus = aStatus; + + for ( TInt i = 0; i < iUiStateObservers.Count(); i++ ) + { + iUiStateObservers[i]-> + NotifyLightStatusChanged( + iLightStatus == CHWRMLight::ELightOn ? ETrue : EFalse ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// CXnUiStateListener::PropertyChangedL() +// +// ----------------------------------------------------------------------------- +// +void CXnUiStateListener::PropertyChangedL( const TUint32 aKey, + const TInt aValue ) + { + if ( aKey == KCTsyCallState ) + { + TBool active( aValue > EPSCTsyCallStateNone ); + + if( iInCallState != active ) + { + iInCallState = active; + + for ( TInt i = 0; i < iUiStateObservers.Count(); i++ ) + { + iUiStateObservers[i]->NotifyInCallStateChaged( iInCallState ); + } + } + } + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnutils.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1952 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Utility functions of Xuikon. +* +*/ + + +// System includes +#include <AknUtils.h> +#include <AknFontAccess.h> +#include <uri16.h> + +// User includes +#include "c_xnutils.h" +#include "xnproperty.h" +#include "xnnodepluginif.h" +#include "xnuienginepluginif.h" +#include "xndomlist.h" +#include "xnresource.h" +#include "xnnodebreadthfirstiterator.h" +#include "xncontroladapter.h" +#include "xncontroladapterimpl.h" +#include "xncomponent.h" +#include "xncomponentnodeimpl.h" + +// Constants +_LIT( KNormal, "normal" ); +_LIT( KPrimaryFont , "EAknLogicalFontPrimaryFont" ); +_LIT( KSecondaryFont , "EAknLogicalFontSecondaryFont" ); +_LIT( KTitleFont, "EAknLogicalFontTitleFont" ); +_LIT( KPrimarySmallFont , "EAknLogicalFontPrimarySmallFont" ); +_LIT( KDigitalFont , "EAknLogicalFontDigitalFont" ); + +_LIT( KXnCommonWhiteSpaceCharacters, " \n\t\r" ); +_LIT( KXnLineFeedTabCharacters, "\n\t\r" ); +_LIT( KXnTabCharacters, "\t\r" ); + +_LIT( KSkin, "skin(" ); + +namespace XnColorNames + { + _LIT8( Kaliceblue, "aliceblue" ); + _LIT8( Kantiquewhite, "antiquewhite" ); + _LIT8( Kaqua, "aqua" ); + _LIT8( Kaquamarine, "aquamarine" ); + _LIT8( Kazure, "azure" ); + _LIT8( Kbeige, "beige" ); + _LIT8( Kbisque, "bisque" ); + _LIT8( Kblack, "black" ); + _LIT8( Kblanchedalmond, "blanchedalmond" ); + _LIT8( Kblue, "blue" ); + _LIT8( Kblueviolet, "blueviolet" ); + _LIT8( Kbrown, "brown" ); + _LIT8( Kburlywood, "burlywood" ); + _LIT8( Kcadetblue, "cadetblue" ); + _LIT8( Kchartreuse, "chartreuse" ); + _LIT8( Kchocolate, "chocolate" ); + _LIT8( Kcoral, "coral" ); + _LIT8( Kcornflowerblue, "cornflowerblue" ); + _LIT8( Kcornsilk, "cornsilk" ); + _LIT8( Kcrimson, "crimson" ); + _LIT8( Kcyan, "cyan" ); + _LIT8( Kdarkblue, "darkblue" ); + _LIT8( Kdarkcyan, "darkcyan" ); + _LIT8( Kdarkgoldenrod, "darkgoldenrod" ); + _LIT8( Kdarkgray, "darkgray" ); + _LIT8( Kdarkgreen, "darkgreen" ); + _LIT8( Kdarkgrey, "darkgrey" ); + _LIT8( Kdarkkhaki, "darkkhaki" ); + _LIT8( Kdarkmagenta, "darkmagenta" ); + _LIT8( Kdarkolivegreen, "darkolivegreen" ); + _LIT8( Kdarkorange, "darkorange" ); + _LIT8( Kdarkorchid, "darkorchid" ); + _LIT8( Kdarkred, "darkred" ); + _LIT8( Kdarksalmon, "darksalmon" ); + _LIT8( Kdarkseagreen, "darkseagreen" ); + _LIT8( Kdarkslateblue, "darkslateblue" ); + _LIT8( Kdarkslategray, "darkslategray" ); + _LIT8( Kdarkslategrey, "darkslategrey" ); + _LIT8( Kdarkturquoise, "darkturquoise" ); + _LIT8( Kdarkviolet, "darkviolet" ); + _LIT8( Kdeeppink, "deeppink" ); + _LIT8( Kdeepskyblue, "deepskyblue" ); + _LIT8( Kdimgray, "dimgray" ); + _LIT8( Kdimgrey, "dimgrey" ); + _LIT8( Kdodgerblue, "dodgerblue" ); + _LIT8( Kfirebrick, "firebrick" ); + _LIT8( Kfloralwhite, "floralwhite" ); + _LIT8( Kforestgreen, "forestgreen" ); + _LIT8( Kfuchsia, "fuchsia" ); + _LIT8( Kgainsboro, "gainsboro" ); + _LIT8( Kghostwhite, "ghostwhite" ); + _LIT8( Kgold, "gold" ); + _LIT8( Kgoldenrod, "goldenrod" ); + _LIT8( Kgray, "gray" ); + _LIT8( Kgreen, "green" ); + _LIT8( Kgreenyellow, "greenyellow" ); + _LIT8( Kgrey, "grey" ); + _LIT8( Khoneydew, "honeydew" ); + _LIT8( Khotpink, "hotpink" ); + _LIT8( Kindianred, "indianred" ); + _LIT8( Kindigo, "indigo" ); + _LIT8( Kivory, "ivory" ); + _LIT8( Kkhaki, "khaki" ); + _LIT8( Klavender, "lavender" ); + _LIT8( Klavenderblush, "lavenderblush" ); + _LIT8( Klawngreen, "lawngreen" ); + _LIT8( Klemonchiffon, "lemonchiffon" ); + _LIT8( Klightblue, "lightblue" ); + _LIT8( Klightcoral, "lightcoral" ); + _LIT8( Klightcyan, "lightcyan" ); + _LIT8( Klightgoldenrodyellow, "lightgoldenrodyellow" ); + _LIT8( Klightgray, "lightgray" ); + _LIT8( Klightgreen, "lightgreen" ); + _LIT8( Klightgrey, "lightgrey" ); + _LIT8( Klightpink, "lightpink" ); + _LIT8( Klightsalmon, "lightsalmon" ); + _LIT8( Klightseagreen, "lightseagreen" ); + _LIT8( Klightskyblue, "lightskyblue" ); + _LIT8( Klightslategray, "lightslategray" ); + _LIT8( Klightslategrey, "lightslategrey" ); + _LIT8( Klightsteelblue, "lightsteelblue" ); + _LIT8( Klightyellow, "lightyellow" ); + _LIT8( Klime, "lime" ); + _LIT8( Klimegreen, "limegreen" ); + _LIT8( Klinen, "linen" ); + _LIT8( Kmagenta, "magenta" ); + _LIT8( Kmaroon, "maroon" ); + _LIT8( Kmediumaquamarine, "mediumaquamarine" ); + _LIT8( Kmediumblue, "mediumblue" ); + _LIT8( Kmediumorchid, "mediumorchid" ); + _LIT8( Kmediumpurple, "mediumpurple" ); + _LIT8( Kmediumseagreen, "mediumseagreen" ); + _LIT8( Kmediumslateblue, "mediumslateblue" ); + _LIT8( Kmediumspringgreen, "mediumspringgreen" ); + _LIT8( Kmediumturquoise, "mediumturquoise" ); + _LIT8( Kmediumvioletred, "mediumvioletred" ); + _LIT8( Kmidnightblue, "midnightblue" ); + _LIT8( Kmintcream, "mintcream" ); + _LIT8( Kmistyrose, "mistyrose" ); + _LIT8( Kmoccasin, "moccasin" ); + _LIT8( Knavajowhite, "navajowhite" ); + _LIT8( Knavy, "navy" ); + _LIT8( Koldlace, "oldlace" ); + _LIT8( Kolive, "olive" ); + _LIT8( Kolivedrab, "olivedrab" ); + _LIT8( Korange, "orange" ); + _LIT8( Korangered, "orangered" ); + _LIT8( Korchid, "orchid" ); + _LIT8( Kpalegoldenrod, "palegoldenrod" ); + _LIT8( Kpalegreen, "palegreen" ); + _LIT8( Kpaleturquoise, "paleturquoise" ); + _LIT8( Kpalevioletred, "palevioletred" ); + _LIT8( Kpapayawhip, "papayawhip" ); + _LIT8( Kpeachpuff, "peachpuff" ); + _LIT8( Kperu, "peru" ); + _LIT8( Kpink, "pink" ); + _LIT8( Kplum, "plum" ); + _LIT8( Kpowderblue, "powderblue" ); + _LIT8( Kpurple, "purple" ); + _LIT8( Kred, "red" ); + _LIT8( Krosybrown, "rosybrown" ); + _LIT8( Kroyalblue, "royalblue" ); + _LIT8( Ksaddlebrown, "saddlebrown" ); + _LIT8( Ksalmon, "salmon" ); + _LIT8( Ksandybrown, "sandybrown" ); + _LIT8( Kseagreen, "seagreen" ); + _LIT8( Kseashell, "seashell" ); + _LIT8( Ksienna, "sienna" ); + _LIT8( Ksilver, "silver" ); + _LIT8( Kskyblue, "skyblue" ); + _LIT8( Kslateblue, "slateblue" ); + _LIT8( Kslategray, "slategray" ); + _LIT8( Kslategrey, "slategrey" ); + _LIT8( Ksnow, "snow" ); + _LIT8( Kspringgreen, "springgreen" ); + _LIT8( Ksteelblue, "steelblue" ); + _LIT8( Ktan, "tan" ); + _LIT8( Kteal, "teal" ); + _LIT8( Kthistle, "thistle" ); + _LIT8( Ktomato, "tomato" ); + _LIT8( Kturquoise, "turquoise" ); + _LIT8( Kviolet, "violet" ); + _LIT8( Kwheat, "wheat" ); + _LIT8( Kwhite, "white" ); + _LIT8( Kwhitesmoke, "whitesmoke" ); + _LIT8( Kyellow, "yellow" ); + _LIT8( Kyellowgreen, "yellowgreen" ); + } + +namespace XnColorValues + { + const TInt Kaliceblue = 0xfff8f0; + const TInt Kantiquewhite = 0xd7ebfa; + const TInt Kaqua = 0xffff00; + const TInt Kaquamarine = 0xd4ff7f; + const TInt Kazure = 0xfffff0; + const TInt Kbeige = 0xdcf5f5; + const TInt Kbisque = 0xc4e4ff; + const TInt Kblack = 0x000000; + const TInt Kblanchedalmond = 0xcdebff; + const TInt Kblue = 0xff0000; + const TInt Kblueviolet = 0xe22b8a; + const TInt Kbrown = 0x2a2aa5; + const TInt Kburlywood = 0x87b8de; + const TInt Kcadetblue = 0xa09e5f; + const TInt Kchartreuse = 0x00ff7f; + const TInt Kchocolate = 0x1e69d2; + const TInt Kcoral = 0x507fff; + const TInt Kcornflowerblue = 0xed9564; + const TInt Kcornsilk = 0xdcf8ff; + const TInt Kcrimson = 0x3c14dc; + const TInt Kcyan = 0xffff00; + const TInt Kdarkblue = 0x8b0000; + const TInt Kdarkcyan = 0x8b8b00; + const TInt Kdarkgoldenrod = 0x0b86b8; + const TInt Kdarkgray = 0xa9a9a9; + const TInt Kdarkgreen = 0x006400; + const TInt Kdarkgrey = 0xa9a9a9; + const TInt Kdarkkhaki = 0x6bb7bd; + const TInt Kdarkmagenta = 0x8b008b; + const TInt Kdarkolivegreen = 0x2f6b55; + const TInt Kdarkorange = 0x008cff; + const TInt Kdarkorchid = 0xcc3299; + const TInt Kdarkred = 0x00008b; + const TInt Kdarksalmon = 0x7a96e9; + const TInt Kdarkseagreen = 0x8fbc8f; + const TInt Kdarkslateblue = 0x8b3d48; + const TInt Kdarkslategray = 0x4f4f2f; + const TInt Kdarkslategrey = 0x4f4f2f; + const TInt Kdarkturquoise = 0xd1ce00; + const TInt Kdarkviolet = 0xd30094; + const TInt Kdeeppink = 0x9314ff; + const TInt Kdeepskyblue = 0xffbf00; + const TInt Kdimgray = 0x696969; + const TInt Kdimgrey = 0x696969; + const TInt Kdodgerblue = 0xff901e; + const TInt Kfirebrick = 0x2222b2; + const TInt Kfloralwhite = 0xf0faff; + const TInt Kforestgreen = 0x228b22; + const TInt Kfuchsia = 0xff00ff; + const TInt Kgainsboro = 0xdcdcdc; + const TInt Kghostwhite = 0xfff8f8; + const TInt Kgold = 0x00d7ff; + const TInt Kgoldenrod = 0x20a5da; + const TInt Kgray = 0x808080; + const TInt Kgreen = 0x008000; + const TInt Kgreenyellow = 0x2fffad; + const TInt Kgrey = 0x808080; + const TInt Khoneydew = 0xf0fff0; + const TInt Khotpink = 0xb469ff; + const TInt Kindianred = 0x5c5ccd; + const TInt Kindigo = 0x82004b; + const TInt Kivory = 0xf0ffff; + const TInt Kkhaki = 0x8ce6f0; + const TInt Klavender = 0xfae6e6; + const TInt Klavenderblush = 0xf5f0ff; + const TInt Klawngreen = 0x00fc7c; + const TInt Klemonchiffon = 0xcdfaff; + const TInt Klightblue = 0xe6d8ad; + const TInt Klightcoral = 0x8080f0; + const TInt Klightcyan = 0xffffe0; + const TInt Klightgoldenrodyellow = 0xd2fafa; + const TInt Klightgray = 0xd3d3d3; + const TInt Klightgreen = 0x90ee90; + const TInt Klightgrey = 0xd3d3d3; + const TInt Klightpink = 0xc1b6ff; + const TInt Klightsalmon = 0x7aa0ff; + const TInt Klightseagreen = 0xaab220; + const TInt Klightskyblue = 0xface87; + const TInt Klightslategray = 0x998877; + const TInt Klightslategrey = 0x998877; + const TInt Klightsteelblue = 0xdec4b0; + const TInt Klightyellow = 0xe0ffff; + const TInt Klime = 0x00ff00; + const TInt Klimegreen = 0x32cd32; + const TInt Klinen = 0xe6f0fa; + const TInt Kmagenta = 0xff00ff; + const TInt Kmaroon = 0x000080; + const TInt Kmediumaquamarine = 0xaacd66; + const TInt Kmediumblue = 0xcd0000; + const TInt Kmediumorchid = 0xd355ba; + const TInt Kmediumpurple = 0xdb7093; + const TInt Kmediumseagreen = 0x71b33c; + const TInt Kmediumslateblue = 0xee687b; + const TInt Kmediumspringgreen = 0x9afa00; + const TInt Kmediumturquoise = 0xccd148; + const TInt Kmediumvioletred = 0x8515c7; + const TInt Kmidnightblue = 0x701919; + const TInt Kmintcream = 0xfafff5; + const TInt Kmistyrose = 0xe1e4ff; + const TInt Kmoccasin = 0xb5e4ff; + const TInt Knavajowhite = 0xaddeff; + const TInt Knavy = 0x800000; + const TInt Koldlace = 0xe6f5fd; + const TInt Kolive = 0x008080; + const TInt Kolivedrab = 0x238e6b; + const TInt Korange = 0x00a5ff; + const TInt Korangered = 0x0045ff; + const TInt Korchid = 0xd670da; + const TInt Kpalegoldenrod = 0xaae8ee; + const TInt Kpalegreen = 0x98fb98; + const TInt Kpaleturquoise = 0xeeeeaf; + const TInt Kpalevioletred = 0x9370db; + const TInt Kpapayawhip = 0xd5efff; + const TInt Kpeachpuff = 0xb9daff; + const TInt Kperu = 0x3f85cd; + const TInt Kpink = 0xcbc0ff; + const TInt Kplum = 0xdda0dd; + const TInt Kpowderblue = 0xe6e0b0; + const TInt Kpurple = 0x800080; + const TInt Kred = 0x0000ff; + const TInt Krosybrown = 0x8f8fbc; + const TInt Kroyalblue = 0xe16941; + const TInt Ksaddlebrown = 0x13458b; + const TInt Ksalmon = 0x7280fa; + const TInt Ksandybrown = 0x60a4f4; + const TInt Kseagreen = 0x578b2e; + const TInt Kseashell = 0xeef5ff; + const TInt Ksienna = 0x2d52a0; + const TInt Ksilver = 0xc0c0c0; + const TInt Kskyblue = 0xebce87; + const TInt Kslateblue = 0xcd5a6a; + const TInt Kslategray = 0x908070; + const TInt Kslategrey = 0x908070; + const TInt Ksnow = 0xfafaff; + const TInt Kspringgreen = 0x7fff00; + const TInt Ksteelblue = 0xb48246; + const TInt Ktan = 0x8cb4d2; + const TInt Kteal = 0x808000; + const TInt Kthistle = 0xd8bfd8; + const TInt Ktomato = 0x4763ff; + const TInt Kturquoise = 0xd0e040; + const TInt Kviolet = 0xee82ee; + const TInt Kwheat = 0xb3def5; + const TInt Kwhite = 0xffffff; + const TInt Kwhitesmoke = 0xf5f5f5; + const TInt Kyellow = 0x00ffff; + const TInt Kyellowgreen = 0x32cd9a; + } + +// ======== LOCAL FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// MatchColor +// ----------------------------------------------------------------------------- +// +static TBool MatchColor( const TDesC8& aColorName, TRgb& aValue ) + { + // Following local macro is used to generate large if-table. + #define E( name ) else if ( aColorName == XnColorNames::name ) \ + { \ + aValue = TRgb( XnColorValues::name ); \ + return ETrue; \ + } + + if ( EFalse ) + { + } + E( Kaliceblue ) + E( Kantiquewhite ) + E( Kaqua ) + E( Kaquamarine ) + E( Kazure ) + E( Kbeige ) + E( Kbisque ) + E( Kblack ) + E( Kblanchedalmond ) + E( Kblue ) + E( Kblueviolet ) + E( Kbrown ) + E( Kburlywood ) + E( Kcadetblue ) + E( Kchartreuse ) + E( Kchocolate ) + E( Kcoral ) + E( Kcornflowerblue ) + E( Kcornsilk ) + E( Kcrimson ) + E( Kcyan ) + E( Kdarkblue ) + E( Kdarkcyan ) + E( Kdarkgoldenrod ) + E( Kdarkgray ) + E( Kdarkgreen ) + E( Kdarkgrey ) + E( Kdarkkhaki ) + E( Kdarkmagenta ) + E( Kdarkolivegreen ) + E( Kdarkorange ) + E( Kdarkorchid ) + E( Kdarkred ) + E( Kdarksalmon ) + E( Kdarkseagreen ) + E( Kdarkslateblue ) + E( Kdarkslategray ) + E( Kdarkslategrey ) + E( Kdarkturquoise ) + E( Kdarkviolet ) + E( Kdeeppink ) + E( Kdeepskyblue ) + E( Kdimgray ) + E( Kdimgrey ) + E( Kdodgerblue ) + E( Kfirebrick ) + E( Kfloralwhite ) + E( Kforestgreen ) + E( Kfuchsia ) + E( Kgainsboro ) + E( Kghostwhite ) + E( Kgold ) + E( Kgoldenrod ) + E( Kgray ) + E( Kgreen ) + E( Kgreenyellow ) + E( Kgrey ) + E( Khoneydew ) + E( Khotpink ) + E( Kindianred ) + E( Kindigo ) + E( Kivory ) + E( Kkhaki ) + E( Klavender ) + E( Klavenderblush ) + E( Klawngreen ) + E( Klemonchiffon ) + E( Klightblue ) + E( Klightcoral ) + E( Klightcyan ) + E( Klightgoldenrodyellow ) + E( Klightgray ) + E( Klightgreen ) + E( Klightgrey ) + E( Klightpink ) + E( Klightsalmon ) + E( Klightseagreen ) + E( Klightskyblue ) + E( Klightslategray ) + E( Klightslategrey ) + E( Klightsteelblue ) + E( Klightyellow ) + E( Klime ) + E( Klimegreen ) + E( Klinen ) + E( Kmagenta ) + E( Kmaroon ) + E( Kmediumaquamarine ) + E( Kmediumblue ) + E( Kmediumorchid ) + E( Kmediumpurple ) + E( Kmediumseagreen ) + E( Kmediumslateblue ) + E( Kmediumspringgreen ) + E( Kmediumturquoise ) + E( Kmediumvioletred ) + E( Kmidnightblue ) + E( Kmintcream ) + E( Kmistyrose ) + E( Kmoccasin ) + E( Knavajowhite ) + E( Knavy ) + E( Koldlace ) + E( Kolive ) + E( Kolivedrab ) + E( Korange ) + E( Korangered ) + E( Korchid ) + E( Kpalegoldenrod ) + E( Kpalegreen ) + E( Kpaleturquoise ) + E( Kpalevioletred ) + E( Kpapayawhip ) + E( Kpeachpuff ) + E( Kperu ) + E( Kpink ) + E( Kplum ) + E( Kpowderblue ) + E( Kpurple ) + E( Kred ) + E( Krosybrown ) + E( Kroyalblue ) + E( Ksaddlebrown ) + E( Ksalmon ) + E( Ksandybrown ) + E( Kseagreen ) + E( Kseashell ) + E( Ksienna ) + E( Ksilver ) + E( Kskyblue ) + E( Kslateblue ) + E( Kslategray ) + E( Kslategrey ) + E( Ksnow ) + E( Kspringgreen ) + E( Ksteelblue ) + E( Ktan ) + E( Kteal ) + E( Kthistle ) + E( Ktomato ) + E( Kturquoise ) + E( Kviolet ) + E( Kwheat ) + E( Kwhite ) + E( Kwhitesmoke ) + E( Kyellow ) + E( Kyellowgreen ) + else + { + return EFalse; + } + #undef E + return EFalse; + } + +// ----------------------------------------------------------------------------- +// FindResource +// Locates a resource from the resource list +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnResource* CXnUtils::FindResource( + CArrayPtrSeg< CXnResource >& aArray, + const TDesC& aResourceFileName, + TInt& aBitmapIndex ) + { + if ( aResourceFileName == KNullDesC ) + { + return NULL; + } + + TUriParser parser; + parser.Parse( aResourceFileName ); + + TPtrC uriWithoutFragment; + parser.UriWithoutFragment( uriWithoutFragment ); + + const TDesC& fragment( parser.Extract( EUriFragment ) ); + + TLex lex( fragment ); + lex.Val( aBitmapIndex ); + + for ( TInt i = aArray.Count() - 1; i >= 0; --i ) + { + CXnResource* res( aArray.At( i ) ); + + const TDesC& resId( res->ResourceId() ); + + if ( resId.FindF( uriWithoutFragment ) != KErrNotFound ) + { + return res; + } + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// DecimalFromHexChar +// ----------------------------------------------------------------------------- +// +static TBool DecimalFromHexChar( TChar aChar, TInt& aValue ) + { + switch ( aChar ) + { + case 'a': + case 'A': + aValue = 10; + return ETrue; + case 'b': + case 'B': + aValue = 11; + return ETrue; + case 'c': + case 'C': + aValue = 12; + return ETrue; + case 'd': + case 'D': + aValue = 13; + return ETrue; + case 'e': + case 'E': + aValue = 14; + return ETrue; + case 'f': + case 'F': + aValue = 15; + return ETrue; + case '0': + aValue = 0; + return ETrue; + case '1': + aValue = 1; + return ETrue; + case '2': + aValue = 2; + return ETrue; + case '3': + aValue = 3; + return ETrue; + case '4': + aValue = 4; + return ETrue; + case '5': + aValue = 5; + return ETrue; + case '6': + aValue = 6; + return ETrue; + case '7': + aValue = 7; + return ETrue; + case '8': + aValue = 8; + return ETrue; + case '9': + aValue = 9; + return ETrue; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// NumericOrHexValue +// ----------------------------------------------------------------------------- +// +static TInt NumericOrHexValue( TReal& aValue, TLex8& aData ) + { + TBool isHex = EFalse; + TInt hexIndex = 0; + TPtrC8 data = aData.Remainder(); + TInt separatorIndex = 0; + if ( ( hexIndex = data.LocateF( '#' ) ) != KErrNotFound && + ( ( separatorIndex = data.LocateF( ',' ) ) != KErrNotFound || + ( separatorIndex = data.LocateF( ')' ) ) != KErrNotFound ) && + ( separatorIndex > hexIndex ) ) + { + isHex = ETrue; + } + if ( !isHex ) + { + return aData.Val( aValue ); + } + else + { + TChar character = aData.Get(); + if ( character == 0 ) + { + return KErrGeneral; + } + character = aData.Get(); + if ( character == 0 ) + { + return KErrGeneral; + } + TChar secondCharacter = aData.Get(); + if ( secondCharacter == 0 ) + { + return KErrGeneral; + } + TInt val; + TInt secondVal; + if ( DecimalFromHexChar( character, val ) && + DecimalFromHexChar( secondCharacter, secondVal ) ) + { + aValue = 16 * val + secondVal; + return KErrNone; + } + } + return KErrGeneral; + } + +// ----------------------------------------------------------------------------- +// DecimalValueOrPercentage +// ----------------------------------------------------------------------------- +// +static TInt DecimalValueOrPercentage( TInt& aValue, TLex8& aData ) + { + TBool isPercentage = EFalse; + TInt separatorIndex = 0; + TInt percentageIndex = 0; + TPtrC8 data = aData.Remainder(); + if ( ( percentageIndex = data.LocateF( '%' ) ) != KErrNotFound && + ( ( separatorIndex = data.LocateF( ',' ) ) != KErrNotFound || + ( separatorIndex = data.LocateF( ')' ) ) != KErrNotFound ) && + ( separatorIndex > percentageIndex ) ) + { + isPercentage = ETrue; + } + TReal tmp; + TInt error = NumericOrHexValue( tmp, aData ); + if ( error != KErrNone ) + { + return error; + } + if ( !isPercentage ) + { + aValue = static_cast< TInt >( tmp ); + } + else + { + aValue = static_cast< TInt >( ( tmp / 100.0 ) * 255.0 ); + } + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// GetRgbValueFromColorName +// ----------------------------------------------------------------------------- +// +static TBool GetRgbValueFromColorName( TRgb& aValue, const TDesC8& aData ) + { + return MatchColor( aData, aValue ); + } + +// ----------------------------------------------------------------------------- +// GetRgbValueFromDecimalValues +// ----------------------------------------------------------------------------- +// +static TBool GetRgbValueFromDecimalValues( TRgb& aValue, const TDesC8& aData ) + { + TLex8 lex( aData ); + TInt red; + TInt green; + TInt blue; + lex.SkipSpace(); + TInt error = DecimalValueOrPercentage( red, lex ); + if ( error != KErrNone ) + { + return EFalse; + } + lex.SkipSpace(); + while ( lex.Peek() == ',' || lex.Peek() == '%' ) + { + lex.Get(); + lex.SkipSpace(); + } + error = DecimalValueOrPercentage( green, lex ); + if ( error != KErrNone ) + { + return EFalse; + } + lex.SkipSpace(); + while ( lex.Peek() == ',' || lex.Peek() == '%' ) + { + lex.Get(); + lex.SkipSpace(); + } + error = DecimalValueOrPercentage( blue, lex ); + if ( error != KErrNone ) + { + return EFalse; + } + aValue.SetRed( red ); + aValue.SetGreen( green ); + aValue.SetBlue( blue ); + return ETrue; + } + +// ----------------------------------------------------------------------------- +// GetRgbValueFromRgbFunction +// ----------------------------------------------------------------------------- +// +static TBool GetRgbValueFromRgbFunction( TRgb& aValue, const TDesC8& aData ) + { + TInt functionNameIndex = 0; + TInt openingParenthesisIndex = 0; + TInt closingParenthesisIndex = 0; + if ( ( functionNameIndex = aData.FindF( _L8( "rgb" ) ) ) != KErrNotFound && + ( openingParenthesisIndex = aData.FindF( _L8( "(" ) ) ) != KErrNotFound && + ( openingParenthesisIndex > functionNameIndex ) && + ( closingParenthesisIndex = aData.FindF( _L8( ")" ) ) ) != KErrNotFound && + ( closingParenthesisIndex > openingParenthesisIndex ) ) + { + TPtrC8 functionString = aData.Mid( + openingParenthesisIndex + 1, + closingParenthesisIndex - openingParenthesisIndex ); + return GetRgbValueFromDecimalValues( aValue, functionString ); + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// GetRgbValueFromHslFunction +// ----------------------------------------------------------------------------- +// +static TBool GetRgbValueFromHslFunction( TRgb& aValue, const TDesC8& aData ) + { + TInt functionNameIndex = 0; + TInt openingParenthesisIndex = 0; + TInt closingParenthesisIndex = 0; + if ( ( functionNameIndex = aData.FindF( _L8( "hsl" ) ) ) != KErrNotFound && + ( openingParenthesisIndex = aData.FindF( _L8( "(" ) ) ) != KErrNotFound && + ( openingParenthesisIndex > functionNameIndex ) && + ( closingParenthesisIndex = aData.FindF( _L8( ")" ) ) ) != KErrNotFound && + ( closingParenthesisIndex > openingParenthesisIndex ) ) + { + TPtrC8 functionString = aData.Mid( + openingParenthesisIndex + 1, + closingParenthesisIndex - openingParenthesisIndex ); + TRgb rgb; + TBool success = GetRgbValueFromDecimalValues( rgb, functionString ); + + TLex8 lex( functionString ); + TInt red; + TInt green; + TInt blue; + lex.SkipSpace(); + TReal tmp; + + TInt error = NumericOrHexValue( tmp, lex ); + if ( error != KErrNone ) + { + return EFalse; + } + red = static_cast< TInt >( tmp ); + lex.SkipSpace(); + while ( lex.Peek() == ',' || lex.Peek() == '%' ) + { + lex.Get(); + lex.SkipSpace(); + } + error = NumericOrHexValue( tmp, lex ); + if ( error != KErrNone ) + { + return EFalse; + } + green = static_cast< TInt >( tmp ); + lex.SkipSpace(); + while ( lex.Peek() == ',' || lex.Peek() == '%' ) + { + lex.Get(); + lex.SkipSpace(); + } + error = NumericOrHexValue( tmp, lex ); + if ( error != KErrNone ) + { + return EFalse; + } + blue = static_cast< TInt >( tmp ); + + if ( success ) + { + aValue = CXnUtils::ConvertHslToRgb( red, green, blue ); + } + return success; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// GetRgbValueFromHexValue +// ----------------------------------------------------------------------------- +// +static TBool GetRgbValueFromHexValue( TRgb& aValue, const TDesC8& aData ) + { + TBool isHex = EFalse; + if ( aData.LocateF( '#' ) != KErrNotFound ) + { + isHex = ETrue; + } + if ( !isHex ) + { + return EFalse; + } + else + { + TInt length = aData.Length(); + TLex8 lex( aData ); + lex.SkipSpace(); + if ( lex.Get() == 0 ) + { + return EFalse; + } + TInt values[3]; + TBool flags[3] = { EFalse, EFalse, EFalse }; + TChar chars[6] = { 0, 0, 0, 0, 0, 0 }; + for ( TInt i = 5; i >= 0; --i ) + { + TChar character = lex.Get(); + if ( character == 0 ) + { + break; + } + chars[i] = character; + if ( length == 4 ) + { + i--; + chars[i] = character; + } + } + + for ( TInt i = 5, j = 0; ( i >= 0 ) && ( j < 3 ); --i ) + { + if ( chars[i] == 0 ) + { + continue; + } + if ( i % 2 ) + { + TInt secondVal = 0; + TInt val = 0; + TChar secondCharacter = chars[i]; + --i; + TChar character = chars[i]; + if ( DecimalFromHexChar( character, val ) && + DecimalFromHexChar( secondCharacter, secondVal ) ) + { + values[j] = val + 16 * secondVal; + flags[j] = ETrue; + ++j; + } + else + { + break; + } + } + else + { + TInt val = 0; + TChar character = chars[i]; + if ( DecimalFromHexChar( character, val ) ) + { + values[j] = val; + flags[j] = ETrue; + ++j; + } + else + { + break; + } + } + } + if ( flags[2] && flags[1] && flags[0] ) + { + aValue.SetRed( values[0] ); + aValue.SetGreen( values[1] ); + aValue.SetBlue( values[2] ); + return ETrue; + } + else if ( flags[1] && flags[0] ) + { + aValue.SetRed( 0 ); + aValue.SetGreen( values[0] ); + aValue.SetBlue( values[1] ); + return ETrue; + } + else if ( flags[0] ) + { + aValue.SetRed( 0 ); + aValue.SetGreen( 0 ); + aValue.SetBlue( values[0] ); + return ETrue; + } + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// Finds out AVKON font ID from fontname +// ----------------------------------------------------------------------------- +// +static TInt AvkonFontId( const TDesC& aFontName ) + { + TInt fontId( KErrNotFound ); + if ( aFontName == KPrimaryFont ) + { + fontId = KAknFontCategoryPrimary; + } + else if ( aFontName == KSecondaryFont ) + { + fontId = KAknFontCategorySecondary; + } + else if ( aFontName == KTitleFont ) + { + fontId = KAknFontCategoryTitle; + } + else if ( aFontName == KPrimarySmallFont ) + { + fontId = KAknFontCategoryPrimarySmall; + } + else if ( aFontName == KDigitalFont ) + { + fontId = KAknFontCategoryDigital; + } + return fontId; + } + +// ----------------------------------------------------------------------------- +// TRgb CXnUtils::ConvertHslToRgb( TInt aHue, TInt aSaturation, +// TInt aLightness ) +// Perform the HSL to RGB conversion according to +// the rules defined in the CSS3 color module specification: +// http://www.w3.org/TR/2003/CR-css3-color-20030514/#hsl-color +// ----------------------------------------------------------------------------- +// +EXPORT_C TRgb CXnUtils::ConvertHslToRgb( + TInt aHue, TInt aSaturation, TInt aLightness ) + { + TRgb rgb( 0, 0, 0 ); + TReal h( aHue ); + h /= 360; + TReal s( aSaturation ); + s /= 100; + TReal l( aLightness ); + l /= 100; + + if ( 0 == aSaturation ) + { + rgb.SetRed( TInt( l * 255 ) ); + rgb.SetGreen( TInt( l * 255 ) ); + rgb.SetBlue( TInt( l * 255 ) ); + } + else + { + TReal m1( 0 ); + TReal m2( 0 ); + + // l<=0.5: PUT l*(s+1) IN m2 + if ( aLightness < 0.5 ) + { + m2 = l * ( s + 1.0 ); + } + // PUT l+s-l*s IN m2 + else + { + m2 = l + s - ( l * s ); + } + + // PUT l*2-m2 IN m1 + m1 = l * 2.0 - m2; + + TReal helperH( h ); + TReal helperM1( m1 ); + TReal helperM2( m2 ); + + // calculate Red + helperH = h + ( 1.0 / 3.0 ); + + // IF h<0: PUT h+1 IN h + if ( helperH < 0 ) + { + helperH += 1.0; + } + + // IF h>1: PUT h-1 IN h + else if ( helperH > 1 ) + { + helperH -= 1.0; + } + else + { + } + + TReal val( 0 ); + + // IF h*6<1: RETURN m1+(m2-m1)*h*6 + if ( ( helperH * 6 ) < 1 ) + { + val = ( 255 * ( helperM1 + ( helperM2 - helperM1 ) * helperH * 6.0 ) ); + } + + // IF h*2<1: RETURN m2 ) + else if ( ( helperH * 2.0 ) < 1.0 ) + { + val = ( 255.0 * helperM2 ); + } + + // IF h*3<2: RETURN m1+(m2-m1)*(2/3-h)*6 + else if ( ( helperH * 3.0 ) < 2.0 ) + { + val = ( 255.0 * ( helperM1 + ( helperM2 - helperM1 ) * + ( 2.0 / 3.0 - helperH ) * 6.0 ) ); + } + else + { + val = 255.0 * helperM1; + } + TInt tmpVal = TInt( val + 0.5 ); + rgb.SetRed( ( tmpVal >= 0 ) ? tmpVal : -tmpVal ); + + // calculate Green + // PUT hue.to.rgb(m1, m2, h ) IN g + helperH = h; + helperM1 = m1; + helperM2 = m2; + + // IF h<0: PUT h+1 IN h + if ( helperH < 0 ) + { + helperH += 1.0; + } + + // IF h>1: PUT h-1 IN h + else if ( helperH > 1 ) + { + helperH -= 1.0; + } + else + { + } + + // IF h*6<1: RETURN m1+(m2-m1)*h*6 + if ( ( helperH * 6 ) < 1 ) + { + val = ( 255.0 * ( helperM1 + ( helperM2 - helperM1 ) * helperH * 6.0 ) ); + } + + // IF h*2<1: RETURN m2 + else if ( ( helperH * 2 ) < 1 ) + { + val = ( 255.0 * helperM2 ); + } + + // IF h*3<2: RETURN m1+(m2-m1)*(2/3-h)*6 + else if ( ( helperH * 3 ) < 2 ) + { + val = ( 255.0 * ( helperM1 + ( helperM2 - helperM1 ) * + ( 2.0 / 3.0 - helperH ) * 6.0 ) ); + } + else + { + val = 255.0 * helperM1; + } + + tmpVal = TInt( val + 0.5 ); + rgb.SetGreen( ( tmpVal >= 0 ) ? tmpVal : tmpVal ); + + // calculate Blue + // PUT hue.to.rgb(m1, m2, h-1/3) IN b + helperH = h - ( 1.0 / 3.0 ); + helperM1 = m1; + helperM2 = m2; + + // IF h<0: PUT h+1 IN h + if ( helperH < 0 ) + { + helperH += 1.0; + } + + // IF h>1: PUT h-1 IN h + else if ( helperH > 1 ) + { + helperH -= 1.0; + } + else + { + } + + // IF h*6<1: RETURN m1+(m2-m1)*h*6 + if ( ( helperH * 6 ) < 1 ) + { + val = ( 255.0 * ( helperM1 + ( helperM2 - helperM1 ) * helperH * 6.0 ) ); + } + + // IF h*2<1: RETURN m2 + else if ( ( helperH * 2 ) < 1 ) + { + val = ( 255.0 * helperM2 ); + } + + // IF h*3<2: RETURN m1+(m2-m1)*(2/3-h)*6 + else if ( ( helperH * 3 ) < 2 ) + { + val = ( 255.0 * ( helperM1 + ( helperM2 - helperM1 ) * + ( 2.0 / 3.0 - helperH ) * 6.0 ) ); + } + else + { + val = 255.0 * helperM1; + } + + tmpVal = TInt( val + 0.5 ); + rgb.SetBlue( ( tmpVal >= 0 ) ? tmpVal : -tmpVal ); + } + return rgb; + } + +// ----------------------------------------------------------------------------- +// GetRgbValue +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CXnUtils::GetRgbValue( TRgb& aValue, const TDesC8& aData ) + { + return GetRgbValueFromRgbFunction( aValue, aData ) || + GetRgbValueFromHslFunction( aValue, aData ) || + GetRgbValueFromHexValue( aValue, aData ) || + GetRgbValueFromColorName( aValue, aData ); + } + +// ----------------------------------------------------------------------------- +// Retrieves the string property of the node. +// ----------------------------------------------------------------------------- +// +const TDesC8& GetStringProperty( + CXnNodePluginIf& aNode, + const TDesC8& aProperty ) + { + CXnProperty* prop( NULL ); + TRAP_IGNORE( prop = aNode.GetPropertyL( aProperty ) ); + if ( prop ) + { + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( + prop->Property()->PropertyValueList().Item( 0 ) ); + if ( CXnDomPropertyValue::EIdent == value->PrimitiveValueType() || + CXnDomPropertyValue::EString == value->PrimitiveValueType() ) + { + return prop->StringValue(); + } + } + return KNullDesC8; + } + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// Creates the font according to node information. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnUtils::CreateFontL( + CXnNodePluginIf& aNode, + CFont*& aFont, + TInt& aReleaseFont ) + { + // Get the font properties from node + TFontSpec fontspec; + + //Font name + const TDesC8& fontNameS = GetStringProperty( + aNode, XnPropertyNames::appearance::common::KFontFamily ); + HBufC* fontName = HBufC::NewLC( fontNameS.Length() ); + TPtr namePtr = fontName->Des(); + namePtr.Copy( fontNameS ); // 8-bit to 16-bit + StripQuotes( fontName ); + TInt fLenght = fontName->Length(); + TInt avkonFId = AvkonFontId( *fontName ); + + //let's see if normal font needed + CCoeEnv* coeEnv = CEikonEnv::Static(); + if ( *fontName == KNormal || + !fLenght || + ( KErrNotFound == avkonFId && fLenght > 24 ) ) + { + aFont = const_cast< CFont* >( coeEnv->NormalFont() ); + aReleaseFont = EFalse; + CleanupStack::PopAndDestroy( fontName ); + return; + } + + //Font size in pixels + CXnProperty* fontSizeProp = aNode.GetPropertyL( + XnPropertyNames::appearance::common::KFontSize ); + TInt fontSizeInPixels( aNode.Rect().Height() );//default font size + + if ( fontSizeProp ) + { //font size from node if needed. If leaves uses default. + TRAP_IGNORE( fontSizeInPixels = aNode.UiEngineL()->VerticalPixelValueL( + fontSizeProp, aNode.Rect().Height()) ); + } + + //Font stroke + const TDesC8& fontStroke = GetStringProperty( + aNode, XnPropertyNames::appearance::common::KFontWeight ); + if ( fontStroke == XnPropertyNames::appearance::common::fontweight::KBold ) + { + fontspec.iFontStyle.SetStrokeWeight( EStrokeWeightBold ); + } + + //Font posture + const TDesC8& fontPosture = GetStringProperty( + aNode, XnPropertyNames::appearance::common::KFontStyle ); + if ( fontPosture == XnPropertyNames::appearance::common::fontstyle::KItalic ) + { + fontspec.iFontStyle.SetPosture( EPostureItalic ); + } + + //Font effects + CXnProperty* textEffectsProp = aNode.GetPropertyL( + XnPropertyNames::appearance::common::KTextEffects ); + if ( textEffectsProp ) + { + CBitmapDevice* dev = coeEnv->ScreenDevice(); + fontspec.iHeight = fontSizeInPixels; + + CXnDomList& propertyValueList = + textEffectsProp->Property()->PropertyValueList(); + TInt valueCount = propertyValueList.Length(); + TUint32 effectsFlag( 0 ); + + for ( TInt i = 0; i < valueCount; ++i ) + { + CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >( + propertyValueList.Item( i ) ); + + if ( value->StringValueL() == + XnPropertyNames::appearance::common::fonteffects::KEffectsAlgorithmicbold ) + { + effectsFlag |= FontEffect::EAlgorithmicBold; + } + if ( value->StringValueL() == + XnPropertyNames::appearance::common::fonteffects::KEffectsDropshadow ) + { + effectsFlag |= FontEffect::EDropShadow; + } + if ( value->StringValueL() == + XnPropertyNames::appearance::common::fonteffects::KEffectsOutline ) + { + effectsFlag |= FontEffect::EOutline; + } + if ( value->StringValueL() == + XnPropertyNames::appearance::common::fonteffects::KEffectsEmbossed ) + { + effectsFlag |= FontEffect::EEmbossed; + } + if ( value->StringValueL() == + XnPropertyNames::appearance::common::fonteffects::KEffectsEngraved ) + { + effectsFlag |= FontEffect::EEngraved; + } + if ( value->StringValueL() == + XnPropertyNames::appearance::common::fonteffects::KEffectsSoftedge ) + { + effectsFlag |= FontEffect::ESoftEdge; + } + } + // Must be antialiased for effects to work + fontspec.iFontStyle.SetBitmapType( EAntiAliasedGlyphBitmap ); + fontspec.iFontStyle.SetEffects( effectsFlag ); + User::LeaveIfError( dev->GetNearestFontToDesignHeightInPixels( + aFont, fontspec ) ); + aReleaseFont = ETrue; + } + else + { + CreateFontL( *fontName, fontSizeInPixels, + fontspec.iFontStyle, aFont, aReleaseFont ); + } + + CleanupStack::PopAndDestroy( fontName ); + } + +// ----------------------------------------------------------------------------- +// Creates the font according to given information. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnUtils::CreateFontL( + const TDesC& aFontName, + TInt aFontSizeInPixels, + TFontStyle aFontStyle, + CFont*& aFont, + TInt& aReleaseFont ) + { + CCoeEnv* coeEnv = CEikonEnv::Static(); + if ( aFontName == KNormal || !aFontName.Length() ) + { + aFont = const_cast< CFont* >( coeEnv->NormalFont() ); + aReleaseFont = EFalse; + } + else + { + //Avkon font id used + TInt fontId = AvkonFontId( aFontName ); + if ( fontId != KErrNotFound ) + { + fontId += ( ( aFontSizeInPixels & 0x3ff ) << 21 ) + + ( ( aFontStyle.StrokeWeight() & 0x1 ) << 4 ) + + ( ( aFontStyle.Posture() & 0x1 ) << 5 ) + 0x80000000; + aFont = const_cast< CFont* >( AknLayoutUtils::FontFromId( fontId )); + aReleaseFont = EFalse; + } + else + { + //Get font + CBitmapDevice* dev = coeEnv->ScreenDevice(); + TInt fontSizeInTwips = dev->VerticalPixelsToTwips( aFontSizeInPixels ); + aFont = AknFontAccess::GetFont( + *dev, aFontStyle, fontSizeInTwips, aFontName ); + if ( !aFont ) + { + aFont = AknFontAccess::GetClosestFont( *dev, aFontStyle, + fontSizeInTwips, aFontName ); + } + aReleaseFont = ETrue; + } + } + } + +// ----------------------------------------------------------------------------- +// Collapses white spaces from the string. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnUtils::CollapseWhiteSpace( + CXnNodePluginIf& aNode, + TDes &aDes ) + { + const TDesC8& value = GetStringProperty( aNode, + XnPropertyNames::appearance::common::KWhiteSpaceCollapse ); + + //Collapse -default + if ( value == XnPropertyNames::appearance::common::whitespace::KCollapse || + !value.Length() ) + { + TInt src = 0; + TInt srclength = aDes.Length(); + while ( src < srclength ) + { + TChar c = aDes[src]; + if ( KXnLineFeedTabCharacters().LocateF( c ) != KErrNotFound ) + { + aDes[src] = KSpaceChar; + } + ++src; + } + aDes.TrimAll(); + } + //Preserve breaks + else if ( value == + XnPropertyNames::appearance::common::whitespace::KPreserveBreaks ) + { + TInt src = 0; + TInt srclength = aDes.Length(); + while ( src < srclength ) + { + TChar c = aDes[src]; + if ( KXnTabCharacters().LocateF( c ) != KErrNotFound ) + { + aDes[src] = KSpaceChar; + } + ++src; + } + aDes.TrimAll(); + } + //discard + else if ( value == XnPropertyNames::appearance::common::whitespace::KDiscard ) + { + TInt target = 0; + TInt src = 0; + TInt srclength = aDes.Length(); + while ( src < srclength ) + { + aDes[target] = aDes[src]; + TChar c = aDes[src]; + if ( KXnCommonWhiteSpaceCharacters().LocateF( c ) == KErrNotFound ) + { + ++target; + } + ++src; + } + aDes.SetLength( target ); + } + //Preserve + //Do nothing. + } + +// ----------------------------------------------------------------------------- +// Resolve TextAlignment property. +// ----------------------------------------------------------------------------- +// +EXPORT_C TGulAlignmentValue CXnUtils::TextAlignment( CXnNodePluginIf& aNode ) + { + TInt value; + + const TDesC8& alignment = GetStringProperty( aNode, + XnPropertyNames::appearance::common::KTextAlign ); + + if ( alignment == + XnPropertyNames::appearance::common::textalign::KAlignLeft ) + { + value = EHLeft; + } + else if ( alignment == + XnPropertyNames::appearance::common::textalign::KAlignRight ) + { + value = EHRight; + } + else if ( alignment == + XnPropertyNames::appearance::common::textalign::KAlignCenter ) + { + value = EHCenter; + } + else if ( alignment == + XnPropertyNames::appearance::common::textalign::KAlignJustify ) + { + //We don't have EJustify + value = EHCenter; + } + else + { + if ( AknLayoutUtils::LayoutMirrored() ) + { + value = EHRight; + } + else + { + value = EHLeft; + } + } + + const TDesC8& valignment = GetStringProperty( aNode, + XnPropertyNames::appearance::common::KS60TextVAlign ); + + if ( valignment == + XnPropertyNames::appearance::common::textvalign::KAlignTop ) + { + value |= EVTop; + } + else if ( valignment == + XnPropertyNames::appearance::common::textvalign::KAlignBottom ) + { + value |= EVBottom; + } + else + { + value |= EVCenter; + } + + return ( TGulAlignmentValue )value; + } + +// ----------------------------------------------------------------------------- +// ScaleBitmapL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnUtils::ScaleBitmapL( + const TRect& aTrgRect, + CFbsBitmap* aTrgBitmap, + CFbsBitmap* aSrcBitmap ) + { + CXnUtils::ScaleBitmapExtL( aTrgRect, aTrgBitmap, aSrcBitmap, EFalse ); + } + +// ----------------------------------------------------------------------------- +// Strips the " and ' quotes from the string. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnUtils::StripQuotes( HBufC*& aString ) + { + TInt pos1 = aString->Locate( '\"' ); + TInt pos2 = aString->Locate( '\'' ); + // check, if the first character is " or ' + if ( pos1 == 0 || pos2 == 0 ) + { + TInt len = aString->Length() - 2; + TPtr ptr = aString->Des(); + TPtrC16 newString( aString->Mid( 1, len ).Ptr(), len ); + ptr = newString; + } + } + +// ----------------------------------------------------------------------------- +// Resolves skin id (major+minor) and index from SKIN() declaration. +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CXnUtils::ResolveSkinItemIDL( + const TDesC& aSkinId, + TAknsItemID& aItemID, + TInt& aIndex ) + { + HBufC* str = aSkinId.AllocL(); + TPtr ptrSkin = str->Des(); + ptrSkin.TrimAll(); + TInt pos( ptrSkin.FindF( KSkin ) ); + if ( KErrNotFound != pos ) + { + TInt majorID( 0 ); + TInt minorID( 0 ); + pos += KSkin().Length(); + TPtr ptr = ptrSkin.MidTPtr( pos, ( ptrSkin.Length() - pos - 1 ) ); + ptr.TrimAll(); + TInt offset( ptr.Locate( KSpaceChar ) ); + if ( KErrNotFound != offset ) + { + TLex lex( ptr.Left( offset ) ); + lex.SkipSpace(); + lex.Val( majorID ); // ok until this. + + TInt offset2( ptr.LocateReverse( KSpaceChar ) ); + if ( offset2 == 0 || offset2 == offset ) + { + lex.Assign( ptr.Mid( offset ) ); + lex.SkipSpace(); + lex.Val( minorID ); + } + else + { + TPtrC ptrDebug = ptr.Mid( offset + 1, offset2 - offset - 1 ); + lex.Assign( ptr.Mid( offset + 1, offset2 - offset -1 ) ); + lex.Val( minorID ); + + TPtrC ptrDebug2 = ptr.Mid( offset2 + 1, ptr.Length() - offset2 - 1 ); + lex.Assign( ptr.Mid( offset2 + 1, ptr.Length() - offset2 - 1 ) ); + lex.Val( aIndex ); + } + aItemID.Set( majorID, minorID ); + delete str; + return ETrue; + } + } + delete str; + return EFalse; + } + +// ----------------------------------------------------------------------------- +// Propagates powersave mode to adapters +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CXnUtils::HandlePowerSaveModeL( + CXnNode* aNode, + TBool aEnter, + TInt aEvent ) + { + + CXnNodeBreadthFirstIterator< CXnNode >* iterator = + CXnNodeBreadthFirstIterator< CXnNode >::NewL( *aNode ); + + CleanupStack::PushL( iterator ); + + for ( CXnNode* currentNode = iterator->Value(); currentNode; currentNode = iterator->NextL() ) + { + if ( !currentNode->ComponentNodeImpl() ) + { + continue; + } + + CXnComponent* component = currentNode->ComponentNodeImpl()->Component(); + + if ( !component ) + { + continue; + } + + CXnControlAdapter* adapter = component->ControlAdapter(); + + if ( !adapter ) + { + continue; + } + + if ( aEnter ) + { + adapter->EnterPowerSaveModeL( + ( CXnControlAdapter::TModeEvent ) aEvent ); + } + else + { + adapter->ExitPowerSaveModeL( + ( CXnControlAdapter::TModeEvent ) aEvent ); + } + } + + CleanupStack::PopAndDestroy( iterator ); + + return aEnter; + } + +// ----------------------------------------------------------------------------- +// Resolves skin id (major+minor) from SKIN() declaration. +// ----------------------------------------------------------------------------- +// +TBool CXnUtils::ResolveSkinItemIDL( const TDesC& aSkinId, TAknsItemID& aItemID ) + { + HBufC* str = aSkinId.AllocL(); + TPtr ptrSkin = str->Des(); + ptrSkin.TrimAll(); + TInt pos( ptrSkin.FindF( KSkin )); + if ( KErrNotFound != pos ) + { + TInt majorID( 0 ); + TInt minorID( 0 ); + pos += KSkin().Length(); + TPtr ptr = ptrSkin.MidTPtr( pos, ( ptrSkin.Length() - pos - 1 ) ); + ptr.TrimAll(); + TInt offset( ptr.Locate( KSpaceChar ) ); + if ( KErrNotFound != offset ) + { + TLex lex( ptr.Left( offset ) ); + lex.SkipSpace(); + lex.Val( majorID ); + lex.Assign( ptr.Mid( offset ) ); + lex.SkipSpace(); + lex.Val( minorID ); + aItemID.Set( majorID, minorID ); + delete str; + return ETrue; + } + } + delete str; + return EFalse; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +TBool CXnUtils::DoesScaleBitmapUseFallBack( CFbsBitmap* aSrcBitmap ) + { + if ( !aSrcBitmap ) + { + return EFalse; + } + + TDisplayMode displayMode = aSrcBitmap->DisplayMode(); + TBool fallbackOnly = EFalse; + + switch ( displayMode ) + { + case EGray2: + case EGray4: + case EGray16: + case EColor16: + case EColor16M: + case ERgb: + case EColor16MA: + fallbackOnly = ETrue; + break; + case EGray256: + case EColor4K: + case EColor64K: + case EColor256: + case EColor16MU: + // These are the supported modes + break; + default: + fallbackOnly = ETrue; + } + + return fallbackOnly; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CXnUtils::ScaleBitmapExtL( const TRect& aTrgRect, CFbsBitmap* aTrgBitmap, + CFbsBitmap* aSrcBitmap, TBool aForceFallBack ) + { + if ( !aSrcBitmap ) User::Leave( KErrArgument ); + if ( !aTrgBitmap ) User::Leave( KErrArgument ); + if ( aSrcBitmap->DisplayMode() != aTrgBitmap->DisplayMode() ) + { + User::Leave( KErrArgument ); + } + + TSize trgBitmapSize = aTrgBitmap->SizeInPixels(); + + // calculate the valid drawing area + TRect drawRect = aTrgRect; + drawRect.Intersection( TRect( TPoint( 0, 0 ), trgBitmapSize ) ); + + if( drawRect.IsEmpty() || aSrcBitmap->SizeInPixels().iHeight <= 0 || + aSrcBitmap->SizeInPixels().iWidth <= 0 ) + { + return; + } + + TSize srcSize = aSrcBitmap->SizeInPixels(); + + TBool srcTemporary = EFalse; + if ( aSrcBitmap->IsRomBitmap() ) + { + srcTemporary = ETrue; + } + + TDisplayMode displayMode = aSrcBitmap->DisplayMode(); + TBool fallbackOnly = + aForceFallBack || + DoesScaleBitmapUseFallBack( aSrcBitmap ); + + if ( fallbackOnly ) + { + CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL( aTrgBitmap ); + CleanupStack::PushL( dev ); + CFbsBitGc* gc = NULL; + User::LeaveIfError( dev->CreateContext( gc ) ); + CleanupStack::PushL( gc ); + + // write alpha information if it exists + if ( aSrcBitmap->DisplayMode() == EColor16MA ) + { + gc->SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); + } + + // aTrgRect is used because DrawBitmap handles clipping automatically + gc->DrawBitmap( aTrgRect, aSrcBitmap ); + CleanupStack::PopAndDestroy( 2 ); // dev, gc + return; + } + + // Heap lock for FBServ large chunk to prevent background + // compression of aSrcBitmap after if IsCompressedInRAM returns EFalse + aSrcBitmap->LockHeapLC( ETrue ); // fbsheaplock + TBool fbsHeapLock = ETrue; + if ( aSrcBitmap->IsCompressedInRAM() ) + { + srcTemporary = ETrue; + } + + CFbsBitmap* realSource = aSrcBitmap; + if ( srcTemporary ) + { + CleanupStack::PopAndDestroy(); // fbsheaplock + fbsHeapLock = EFalse; + + realSource = new ( ELeave ) CFbsBitmap(); + CleanupStack::PushL( realSource ); + User::LeaveIfError( + realSource->Create( srcSize, aSrcBitmap->DisplayMode() ) ); + CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL( realSource ); + CleanupStack::PushL( dev ); + CFbsBitGc* gc = NULL; + User::LeaveIfError( dev->CreateContext( gc ) ); + CleanupStack::PushL( gc ); + gc->BitBlt( TPoint( 0, 0 ), aSrcBitmap ); + CleanupStack::PopAndDestroy( 2 ); // dev, gc + } + + if ( !fbsHeapLock ) + { + // Heap lock for FBServ large chunk is only needed with large bitmaps. + if ( realSource->IsLargeBitmap() || aTrgBitmap->IsLargeBitmap() ) + { + aTrgBitmap->LockHeapLC( ETrue ); // fbsheaplock + } + else + { + CleanupStack::PushL( ( TAny* )NULL ); + } + } + + TUint32* srcAddress = realSource->DataAddress(); + TUint32* trgAddress = aTrgBitmap->DataAddress(); + + const TInt xSkip = ( srcSize.iWidth << 8 ) / aTrgRect.Width(); + const TInt ySkip = ( srcSize.iHeight << 8 ) / aTrgRect.Height(); + + const TInt drawWidth = drawRect.Width(); + const TInt drawHeight = drawRect.Height(); + + TRect offsetRect( aTrgRect.iTl, drawRect.iTl ); + const TInt yPosOffset = ySkip * offsetRect.Height(); + const TInt xPosOffset = xSkip * offsetRect.Width(); + + if ( ( displayMode == EGray256 ) || ( displayMode == EColor256 ) ) + { + TInt srcScanLen8 = CFbsBitmap::ScanLineLength( + srcSize.iWidth, displayMode ); + TInt trgScanLen8 = CFbsBitmap::ScanLineLength( + trgBitmapSize.iWidth, displayMode ); + + TUint8* trgAddress8 = reinterpret_cast< TUint8* >( trgAddress ); + + TInt yPos = yPosOffset; + // skip left and top margins in the beginning + trgAddress8 += trgScanLen8 * drawRect.iTl.iY + drawRect.iTl.iX; + + for ( TInt y = 0; y < drawHeight; y++ ) + { + TUint8* srcAddress8 = reinterpret_cast< TUint8* >( srcAddress ) + + ( srcScanLen8 * ( yPos >> 8 ) ); + + TInt xPos = xPosOffset; + for ( TInt x = 0; x < drawWidth; x++ ) + { + *( trgAddress8++ ) = srcAddress8[xPos >> 8]; + xPos += xSkip; + } + + yPos += ySkip; + + trgAddress8 += trgScanLen8 - drawWidth; + } + } + else if ( displayMode == EColor4K || displayMode == EColor64K ) + { + TInt srcScanLen16 = CFbsBitmap::ScanLineLength( + srcSize.iWidth, displayMode ) /2; + TInt trgScanLen16 = CFbsBitmap::ScanLineLength( + trgBitmapSize.iWidth, displayMode ) /2; + + TUint16* trgAddress16 = reinterpret_cast< TUint16* >( trgAddress ); + + TInt yPos = yPosOffset; + // skip left and top margins in the beginning + trgAddress16 += trgScanLen16 * drawRect.iTl.iY + drawRect.iTl.iX; + + for ( TInt y = 0; y < drawHeight; y++ ) + { + TUint16* srcAddress16 = reinterpret_cast< TUint16* >( srcAddress ) + + ( srcScanLen16 * ( yPos >> 8 ) ); + + TInt xPos = xPosOffset; + for ( TInt x = 0; x < drawWidth; x++ ) + { + *( trgAddress16++ ) = srcAddress16[xPos >> 8]; + xPos += xSkip; + } + + yPos += ySkip; + + trgAddress16 += trgScanLen16 - drawWidth; + } + } + else if ( displayMode == EColor16MU ) + { + TInt srcScanLen32 = CFbsBitmap::ScanLineLength( + srcSize.iWidth, displayMode ) /4; + TInt trgScanLen32 = CFbsBitmap::ScanLineLength( + trgBitmapSize.iWidth, displayMode ) /4; + + TUint32* trgAddress32 = reinterpret_cast< TUint32* >( trgAddress ); + + TInt yPos = yPosOffset; + // skip left and top margins in the beginning + trgAddress32 += trgScanLen32 * drawRect.iTl.iY + drawRect.iTl.iX; + + for ( TInt y = 0; y < drawHeight; y++ ) + { + TUint32* srcAddress32 = reinterpret_cast< TUint32* >( srcAddress ) + + ( srcScanLen32 * ( yPos >> 8 ) ); + + TInt xPos = xPosOffset; + for ( TInt x = 0; x < drawWidth; x++ ) + { + *( trgAddress32++ ) = srcAddress32[xPos >> 8]; + xPos += xSkip; + } + + yPos += ySkip; + + trgAddress32 += trgScanLen32 - drawWidth; + } + } + else + { + User::Leave( KErrUnknown ); + } + + CleanupStack::PopAndDestroy(); // fbsheaplock + + if ( srcTemporary ) + { + CleanupStack::PopAndDestroy(); // realSource + } + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,654 @@ +/* +* 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: Xuikon view adapter source file +* +*/ + +// System includes +#include <aknViewAppUi.h> +#include <eikbtgpc.h> + +// User includes +#include "xnappuiadapter.h" +#include "xnviewmanager.h" +#include "xnviewdata.h" +#include "xnuiengine.h" + +#include "xnkeyeventdispatcher.h" +#include "xncontroladapter.h" + +#include "xndomdocument.h" +#include "xndomnode.h" +#include "xndomlist.h" +#include "xnodt.h" +#include "xnproperty.h" +#include "xnnodeimpl.h" +#include "xnnode.h" +#include "xntype.h" +#include "xnbgcontrol.h" +#include "xnfocuscontrol.h" + +#include "xnviewadapter.h" +#include "xnmenu.h" + +// Constants +const TUid KXmlViewUid = { 1 }; + +// Data types +enum + { + EIsActivated, + EIsInCall, + EIsLightsOn, + EIsForeground, + EIsControlsAwake, + EIsDestructionRunning + }; + +// ============================= LOCAL FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// BuildTriggerL +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildTriggerL( + CXnUiEngine& aUiEngine, + const TDesC8& aTriggerName ) + { + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger ); + CleanupStack::PushL( type ); + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + + CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::PushL( nameValue ); + nameValue->SetStringValueL( CXnDomPropertyValue::EString, aTriggerName ); + CXnProperty* name = CXnProperty::NewL( + XnPropertyNames::action::trigger::KName, + nameValue, + aUiEngine.ODT()->DomDocument().StringPool() ); + CleanupStack::Pop( nameValue ); + CleanupStack::PushL( name ); + node->SetPropertyL( name ); + CleanupStack::Pop( 2, node ); // name + + return node; + } + +// ----------------------------------------------------------------------------- +// BuildActivateTriggerL +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildActivateTriggerL( CXnUiEngine& aUiEngine ) + { + return BuildTriggerL( + aUiEngine, XnPropertyNames::action::trigger::name::KViewActivate ); + } + +// ----------------------------------------------------------------------------- +// BuildDeactivateTriggerL +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildDeactivateTriggerL( CXnUiEngine& aUiEngine ) + { + return BuildTriggerL( + aUiEngine, XnPropertyNames::action::trigger::name::KViewDeactivate ); + } + +// ----------------------------------------------------------------------------- +// BuildEditStateTriggerL +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildEditStateTriggerL( CXnUiEngine& aUiEngine ) + { + CXnDomStringPool& sp( aUiEngine.ODT()->DomDocument().StringPool() ); + + CXnProperty* value = CXnProperty::NewL( + XnPropertyNames::action::KValue, + KNullDesC8, CXnDomPropertyValue::EString, sp ); + CleanupStack::PushL( value ); + + CXnNode* trigger( BuildTriggerL( + aUiEngine, XnPropertyNames::action::trigger::name::KEditMode ) ); + CleanupStack::PushL( trigger ); + + trigger->SetPropertyL( value ); + CleanupStack::Pop( 2, value ); // trigger + + return trigger; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::CXnViewAdapter +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnViewAdapter::CXnViewAdapter( CXnAppUiAdapter& aAdapter ) + : iAppUiAdapter( aAdapter ) + { + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::~CXnViewAdapter +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnViewAdapter::~CXnViewAdapter() + { + delete iActivate; + delete iDeactivate; + delete iEditState; + delete iBgControl; + delete iFocusControl; + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::NewL +// 2nd phase construction. +// ----------------------------------------------------------------------------- +// +CXnViewAdapter* CXnViewAdapter::NewL( CXnAppUiAdapter& aAdapter ) + { + CXnViewAdapter* self = new ( ELeave ) CXnViewAdapter( aAdapter ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::ConstructL +// 2nd phase construction. +// ----------------------------------------------------------------------------- +// +void CXnViewAdapter::ConstructL() + { + BaseConstructL(); + + // Base class CAknViewAppUi takes ownership of iViewAdapter + iAppUiAdapter.AddViewL( this ); + + iBgControl = CXnBgControl::NewL(); + iBgControl->SetMopParent( this ); + + iFocusControl = CXnFocusControl::NewL( iAppUiAdapter ); + + iEventDispatcher = + CXnKeyEventDispatcher::NewL( iAppUiAdapter.UiEngine() ); + + iAppUiAdapter.UiEngine().SetEventDispatcher( iEventDispatcher ); + + iAppUiAdapter.UiStateListener().AddObserver( *this ); + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::ReloadUiL +// Called when application UI is reloaded +// ----------------------------------------------------------------------------- +// +void CXnViewAdapter::ReloadUiL() + { + DeactivateContainerL(); + + iAppUiAdapter.RemoveFromStack( iEventDispatcher ); + + delete iEventDispatcher; + iEventDispatcher = NULL; + + delete iActivate; + iActivate = NULL; + + delete iDeactivate; + iDeactivate = NULL; + + delete iEditState; + iEditState = NULL; + + iEventDispatcher = CXnKeyEventDispatcher::NewL( iAppUiAdapter.UiEngine() ); + + iAppUiAdapter.UiEngine().SetEventDispatcher( iEventDispatcher ); + + if ( iFlags.IsSet( EIsActivated ) ) + { + iAppUiAdapter.AddToStackL( *this, iEventDispatcher ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::PrepareDestroy +// Sets view to be destroyed +// ----------------------------------------------------------------------------- +// +void CXnViewAdapter::PrepareDestroy() + { + iAppUiAdapter.UiStateListener().RemoveObserver( *this ); + + TRAP_IGNORE( DeactivateContainerL() ); + + iAppUiAdapter.RemoveFromStack( iEventDispatcher ); + delete iEventDispatcher; + iEventDispatcher = NULL; + + iContainer = NULL; + + iFlags.Set( EIsDestructionRunning ); + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::EventDispatcher +// Get event dispatcher +// ----------------------------------------------------------------------------- +// +CXnKeyEventDispatcher* CXnViewAdapter::EventDispatcher() const + { + return iEventDispatcher; + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::BgControl +// Returns bg control. +// ----------------------------------------------------------------------------- +// +CCoeControl& CXnViewAdapter::BgControl() const + { + return *iBgControl; + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::BgControl +// Returns focus control. +// ----------------------------------------------------------------------------- +// +CXnFocusControl& CXnViewAdapter::FocusControl() const + { + return *iFocusControl; + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::Id +// Returns view uid. +// ----------------------------------------------------------------------------- +// +TUid CXnViewAdapter::Id() const + { + return KXmlViewUid; + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::DoActivateL +// Activates view. +// ----------------------------------------------------------------------------- +// +void CXnViewAdapter::DoActivateL( const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + if ( iFlags.IsSet( EIsDestructionRunning ) ) + { + return; + } + + iFlags.Set( EIsActivated ); + + iAppUiAdapter.AddToStackL( *this, iEventDispatcher ); + + CEikButtonGroupContainer* bgc( iAppUiAdapter.Cba() ); + + if ( bgc ) + { + // EventDispatcher will handle sotkey keyevents + CEikCba* cba( + static_cast< CEikCba* >( bgc->ButtonGroup() ) ); + + iAppUiAdapter.RemoveFromStack( cba ); + } + + iBgControl->MakeVisible( ETrue ); + + // Set the active container + ActivateContainerL( iAppUiAdapter.ViewManager().ActiveViewData() ); + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::DoDeactivate +// Deactivates view. +// ----------------------------------------------------------------------------- +// +void CXnViewAdapter::DoDeactivate() + { + if ( iFlags.IsSet( EIsDestructionRunning ) ) + { + return; + } + + iAppUiAdapter.RemoveFromStack( iEventDispatcher ); + + TRAP_IGNORE( DeactivateContainerL() ); + + iBgControl->MakeVisible( EFalse ); + iFocusControl->MakeVisible( EFalse ); + + iFlags.Clear( EIsActivated ); + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::ActivateContainerL +// Activates container +// ----------------------------------------------------------------------------- +// +void CXnViewAdapter::ActivateContainerL( CXnViewData& aContainer, + TBool aEnterEditState ) + { + if ( iContainer == &aContainer ) + { + return; + } + + // Deactivate previous + DeactivateContainerL(); + + if ( iFlags.IsClear( EIsActivated ) ) + { + // Some other view than this in this appui is currently active, + // postpone container activation + return; + } + + // Update + iContainer = &aContainer; + + // Disable layout and redraw until container activation is done + iAppUiAdapter.UiEngine().DisableRenderUiLC(); + + // Try exit controls from powersave mode + ChangeControlsStateL( ETrue ); + + if ( !iActivate ) + { + iActivate = BuildActivateTriggerL( iAppUiAdapter.UiEngine() ); + } + + CXnNode* node( aContainer.Node()->LayoutNode() ); + + node->ReportXuikonEventL( *iActivate ); + + if ( iFlags.IsSet( EIsInCall ) ) + { + iFlags.Clear( EIsInCall ); + + // This container is in-call state + NotifyInCallStateChaged( ETrue ); + } + + iAppUiAdapter.ViewManager().NotifyContainerChangedL( aContainer ); + + if ( !iEditState ) + { + iEditState = BuildEditStateTriggerL( iAppUiAdapter.UiEngine() ); + } + + CXnProperty* prop( iEditState->GetPropertyL( + XnPropertyNames::action::KValue ) ); + + if ( aEnterEditState || iAppUiAdapter.UiEngine().IsEditMode() ) + { + static_cast< CXnDomPropertyValue* >( + prop->Property()->PropertyValueList().Item( 0 ) ) + ->SetStringValueL( CXnDomPropertyValue::EString, + XnPropertyNames::action::trigger::name::editmode::KEnter() ); + } + else + { + static_cast< CXnDomPropertyValue* >( + prop->Property()->PropertyValueList().Item( 0 ) ) + ->SetStringValueL( CXnDomPropertyValue::EString, + XnPropertyNames::action::trigger::name::editmode::KExit() ); + } + + node->ReportXuikonEventL( *iEditState ); + + CXnControlAdapter* adapter( node->Control() ); + + iBgControl->SetCompoundControl( adapter ); + + iAppUiAdapter.UiEngine().RenderUIL(); + + CleanupStack::PopAndDestroy(); // DisableRenderUiLC + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::DeactivateContainerL +// Deactivates current container +// ----------------------------------------------------------------------------- +// +void CXnViewAdapter::DeactivateContainerL() + { + if ( !iContainer ) + { + return; + } + + // Run controls to powersave mode + ChangeControlsStateL( EFalse ); + + if ( !iDeactivate ) + { + iDeactivate = BuildDeactivateTriggerL( iAppUiAdapter.UiEngine() ); + } + + CXnNode* node( iContainer->Node()->LayoutNode() ); + + node->ReportXuikonEventL( *iDeactivate ); + + iBgControl->SetCompoundControl( NULL ); + + iContainer = NULL; + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::NotifyForegroundChanged +// +// ----------------------------------------------------------------------------- +// +void CXnViewAdapter::NotifyForegroundChanged( + MXnUiStateObserver::TForegroundStatus aStatus ) + { + if ( aStatus == MXnUiStateObserver::EPartialForeground || + aStatus == MXnUiStateObserver::EBackground ) + { + iFlags.Clear( EIsForeground ); + + iFocusControl->MakeVisible( EFalse ); + + TRAP_IGNORE( ChangeControlsStateL( EFalse ) ); + } + else + { + iFlags.Set( EIsForeground ); + + TRAP_IGNORE( ChangeControlsStateL( ETrue ) ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::NotifyLightStatusChanged +// +// ----------------------------------------------------------------------------- +// +void CXnViewAdapter::NotifyLightStatusChanged( TBool aLightsOn ) + { + if ( aLightsOn ) + { + iFlags.Set( EIsLightsOn ); + + TRAP_IGNORE( ChangeControlsStateL( ETrue ) ); + } + else + { + iFlags.Clear( EIsLightsOn ); + + TRAP_IGNORE( ChangeControlsStateL( EFalse ) ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::NotifyInCallStateChaged +// +// ----------------------------------------------------------------------------- +// +void CXnViewAdapter::NotifyInCallStateChaged( TBool aInCall ) + { + if ( !iContainer ) + { + return; + } + + TBool incallNow( iFlags.IsSet( EIsInCall ) ? ETrue : EFalse ); + + if ( incallNow == aInCall ) + { + return; + } + + if ( aInCall ) + { + iFlags.Set( EIsInCall ); + } + else + { + iFlags.Clear( EIsInCall ); + } + + TRAP_IGNORE( UpdateRskByModeL() ); + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::ChangeControlsStateL +// +// ----------------------------------------------------------------------------- +// +void CXnViewAdapter::ChangeControlsStateL( TBool aAwake ) + { + if ( !iContainer ) + { + return; + } + + TBool awakeNow( iFlags.IsSet( EIsControlsAwake ) ? ETrue : EFalse ); + + if ( aAwake == awakeNow ) + { + // No change in the state + return; + } + + TBool changeState( EFalse ); + + if ( aAwake ) + { + if ( iFlags.IsSet( EIsForeground ) && iFlags.IsSet( EIsLightsOn ) ) + { + iFlags.Set( EIsControlsAwake ); + changeState = ETrue; + } + } + else + { + iFlags.Clear( EIsControlsAwake ); + changeState = ETrue; + } + + if( changeState ) + { + RPointerArray< CXnControlAdapter > controls; + CleanupClosePushL( controls ); + + iContainer->ControlsL( controls ); + + for ( TInt i = 0; i < controls.Count(); i++ ) + { + if ( aAwake ) + { + controls[i]->ExitPowerSaveModeL(); + } + else + { + controls[i]->EnterPowerSaveModeL(); + } + } + + CleanupStack::PopAndDestroy( &controls ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewAdapter::UpdateRskByModeL() +// +// ----------------------------------------------------------------------------- +// +void CXnViewAdapter::UpdateRskByModeL() + { + CXnNode* menubar( iAppUiAdapter.UiEngine().MenuBarNode() ); + + if( menubar ) + { + const TDesC8* state( NULL ); + + if( iAppUiAdapter.UiEngine().IsEditMode() ) + { + state = &XnPropertyNames::softkey::mode::KModeEdit; + } + else if( iFlags.IsSet( EIsInCall ) ) + { + state = &XnPropertyNames::softkey::mode::KModeCallActive; + } + else + { + state = &XnPropertyNames::softkey::mode::KModeCallInactive; + } + + XnMenuInterface::MXnMenuInterface* menuIf( NULL ); + XnComponentInterface::MakeInterfaceL( menuIf, menubar->AppIfL() ); + + RPointerArray<CXnNode>& childrens( menubar->Children() ); + + for( TInt i=0; i < childrens.Count(); i++ ) + { + CXnNode* node = childrens[i]; + + if( node && node->Type()->Type() == XnPropertyNames::softkey::KNodeName ) + { + CXnProperty* mode = node->GetPropertyL( XnPropertyNames::softkey::KModeAttribute ); + CXnProperty* type = node->GetPropertyL( XnPropertyNames::softkey::KTypeAttribute ); + + if( ( mode && *state == mode->StringValue() ) && + ( type && type->StringValue().Compare( XnPropertyNames::softkey::type::KRight ) == 0 ) ) + { + menuIf->SetSoftKeyL( &node->PluginIfL() , XnMenuInterface::MXnMenuInterface::ERight ); + node->SetDirtyL( XnDirtyLevel::ERender ); + } + } + } + } + } + + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnviewdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewdata.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,460 @@ +/* +* 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 view data info +* +*/ + +// System includes +#include <babitflags.h> + +// User includes +#include "xncomposer.h" +#include "xnodtparser.h" +#include "xnviewmanager.h" +#include "xnviewdata.h" +#include "xncontroladapter.h" +#include "xndomnode.h" +#include "xnnode.h" +#include "xnoomsyshandler.h" + +// Constants +_LIT8( KStateConfirmed, "Confirmed" ); +_LIT8( KStateError, "Error" ); +_LIT8( KLockingStatusLocked, "locked" ); + +// ============================ LOCAL FUNCTIONS ================================ + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CXnViewData::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnViewData* CXnViewData::NewL( CXnPluginData& aParent ) + { + CXnViewData* self = CXnViewData::NewLC( aParent ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnViewData::NewLC() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnViewData* CXnViewData::NewLC( CXnPluginData& aParent ) + { + CXnViewData* self = new ( ELeave ) CXnViewData( aParent ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnViewData::CXnViewData() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnViewData::CXnViewData( CXnPluginData& aParent ) + : CXnPluginData( aParent ) + { + // By default view data is removable + iFlags.Set( EIsRemovable ); + } + +// ----------------------------------------------------------------------------- +// CXnViewData::~CXnViewData() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +CXnViewData::~CXnViewData() + { + Destroy(); + } + +// ----------------------------------------------------------------------------- +// CXnViewData::ConstructL() +// 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CXnViewData::ConstructL() + { + CXnPluginData::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// CXnViewData::SetActiveL() +// +// ----------------------------------------------------------------------------- +// +void CXnViewData::SetActiveL( TBool aActive ) + { + TBool active( Active() ); + + if ( active == aActive || !Occupied() ) + { + return; + } + + if ( aActive ) + { + iFlags.Clear( EIsInitial ); + + iFlags.Set( EIsActive ); + + LoadDataPluginsL(); + } + else + { + DestroyDataPluginsL(); + + iFlags.Clear( EIsActive ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewData::LoadL() + +// ----------------------------------------------------------------------------- +// +void CXnViewData::LoadL() + { + if ( Occupied() || PluginState().CompareF( KStateError ) == 0 ) + { + return; + } + + if ( !CXnOomSysHandler::HeapAvailable( VIEW_MIN_MEM ) ) + { + ViewManager().OomSysHandler().HandlePotentialOomL(); + return; + } + + TRAPD( error, + + if( iManager.Composer().ComposeViewL( *this ) == KErrNone ) + { + iManager.Parser().LoadViewL( *this ); + } + ); + + if ( error || !Occupied() ) + { + if( error == KErrNoMemory ) + { + ViewManager().OomSysHandler().HandlePotentialOomL(); + } + + // 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 + for ( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + if ( iPluginsData[i]->PluginId() != KNullDesC8 ) + { + iPluginsData[i]->LoadL(); + } + } + + if ( Active() ) + { + LoadDataPluginsL(); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnViewData::Destroy() + +// ----------------------------------------------------------------------------- +// +void CXnViewData::Destroy() + { + if ( Occupied() ) + { + TRAP_IGNORE( DestroyDataPluginsL() ); + + iManager.Parser().DestroyView( *this ); + } + + Flush(); + } + +// ----------------------------------------------------------------------------- +// CXnViewData::Plugin() +// Finds plugin or view data based on node +// ----------------------------------------------------------------------------- +// +CXnPluginData& CXnViewData::Plugin( CXnNode* aNode ) + { + if ( aNode->ViewNodeImpl() ) + { + // Reached view, return self + if ( Node()->LayoutNode() == aNode ) + { + return *this; + } + } + + for ( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + if ( iPluginsData[i]->Owner()->LayoutNode() == aNode ) + { + return *iPluginsData[i]; + } + } + + // Not found, try parent + CXnNode* parent( aNode->Parent() ); + + return Plugin( parent ); + } + +// ----------------------------------------------------------------------------- +// CXnViewData::Plugin() +// Finds plugin or view data based on namespace +// ----------------------------------------------------------------------------- +// +CXnPluginData* CXnViewData::Plugin( const TDesC8& aNamespace ) + { + if ( aNamespace == KNullDesC8 ) + { + // No namespace, return self for global access + return this; + } + + CXnDomNode* view( Node() ); + + if ( view && view->LayoutNode()->Namespace() == aNamespace ) + { + return this; + } + + for ( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + CXnDomNode* widget( iPluginsData[i]->Node() ); + + if ( widget && widget->LayoutNode()->Namespace() == aNamespace ) + { + return iPluginsData[i]; + } + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnViewData::ViewNode() +// Returns this view data's view node +// ----------------------------------------------------------------------------- +// +CXnNode* CXnViewData::ViewNode() const + { + return iNode->LayoutNode(); + } + +// ----------------------------------------------------------------------------- +// CXnViewData::ResourcesL() +// Gets this view data's resources +// ----------------------------------------------------------------------------- +// +void CXnViewData::ResourcesL( CArrayPtrSeg< CXnResource >& aList ) const + { + // Get my resources + CXnPluginData::ResourcesL( aList ); + + for ( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + // And resources which my plugin holds + iPluginsData[i]->ResourcesL( aList ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewData::ControlsL() +// Gets this view data's controls +// ----------------------------------------------------------------------------- +// +void CXnViewData::ControlsL( RPointerArray< CXnControlAdapter >& aList ) const + { + // Get my controls + CXnPluginData::ControlsL( aList ); + + for ( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + // And controls which my plugin holds + iPluginsData[i]->ControlsL( aList ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewData::PluginNodesL() +// Gets this view data's appearance nodes +// ----------------------------------------------------------------------------- +// +void CXnViewData::AppearanceNodesL( RPointerArray< CXnNode >& aList ) const + { + // Get my appearance nodes + CXnPluginData::AppearanceNodesL( aList ); + + for ( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + // And appearance nodes which my plugin holds + iPluginsData[i]->AppearanceNodesL( aList ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewData::InitialFocusNodesL() +// Gets this view data's initial focus nodes +// ----------------------------------------------------------------------------- +// +void CXnViewData::InitialFocusNodesL( RPointerArray< CXnNode >& aList ) const + { + // Offer widgets initial focus nodes by default first + for ( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + // And appearance nodes which my plugin holds + iPluginsData[i]->InitialFocusNodesL( aList ); + } + + // Get my initial focus nodes + CXnPluginData::InitialFocusNodesL( aList ); + } + +// ----------------------------------------------------------------------------- +// CXnViewData::ContentSourceNodesL() +// Gets this view data's content source nodes +// ----------------------------------------------------------------------------- +// +void CXnViewData::ContentSourceNodesL( RPointerArray< CXnNode >& aList ) const + { + // Get my data provider nodes + CXnPluginData::ContentSourceNodesL( aList ); + + for ( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + // And appearance nodes which my plugin holds + iPluginsData[i]->ContentSourceNodesL( aList ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewData::PluginNodesL() +// Gets this view data's plugin nodes +// ----------------------------------------------------------------------------- +// +void CXnViewData::PluginNodesL( RPointerArray< CXnNode >& aList ) const + { + for ( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + // And controls which my plugin holds + aList.AppendL( iPluginsData[i]->Owner()->LayoutNode() ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewData::LoadDataPluginsL +// Loads data plugins associated to the plugin +// ----------------------------------------------------------------------------- +// +void CXnViewData::LoadDataPluginsL() + { + if( Occupied() && Active() ) + { + // Load own plugins first, and after that data plugins for widgets + CXnPluginData::LoadDataPluginsL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::DataPluginsLoadCompletedL +// Indicates that all data plugins are loaded +// ----------------------------------------------------------------------------- +// +void CXnViewData::DataPluginsLoadCompletedL( TInt aStatus ) + { + if ( aStatus == KErrNone ) + { + for( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + iPluginsData[i]->LoadDataPluginsL(); + } + } + + CXnPluginData::DataPluginsLoadCompletedL( aStatus ); + } + +// ----------------------------------------------------------------------------- +// CXnViewData::DestroyDataPluginsL +// Remove data plugins associated to the plugin +// ----------------------------------------------------------------------------- +// +void CXnViewData::DestroyDataPluginsL() + { + CXnPluginData::DestroyDataPluginsL(); + + for( TInt i = 0; i < iPluginsData.Count(); i++ ) + { + iPluginsData[i]->DestroyDataPluginsL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnPluginData::DataPluginsLoaded() +// ----------------------------------------------------------------------------- +// +TBool CXnViewData::DataPluginsLoaded() const + { + TBool loaded( CXnPluginData::DataPluginsLoaded() ); + + for( TInt i = 0; loaded && i < iPluginsData.Count(); i++ ) + { + CXnPluginData* plugin( iPluginsData[i] ); + + if( plugin->Occupied() ) + { + loaded = plugin->DataPluginsLoaded(); + } + } + + return loaded; + } + +// ----------------------------------------------------------------------------- +// 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 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1719 @@ +/* +* 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: View Manager +* +*/ + +// System includes +#include <AknUtils.h> +#include <AknsWallpaperUtils.h> +#include <AknSkinsInternalCRKeys.h> +#include <StringLoader.h> +#include <xnuiengine.rsg> +#include <aknnotewrappers.h> + +#if 0 // MSK icon change +#include <AknsConstants.h> +#include <avkon.mbg> +#endif // MSK icon change + +// User includes +#include "xnapplication.h" +#include "xnuiengine.h" +#include "xnproperty.h" +#include "xndomnode.h" +#include "xndomlist.h" +#include "xnnode.h" +#include "xncomposer.h" +#include "xneditor.h" +#include "xnrootdata.h" +#include "xnviewdata.h" +#include "xnappuiadapter.h" +#include "xncontroladapter.h" +#include "xnviewnodeimpl.h" +#include "xnviewadapter.h" +#include "xnodt.h" +#include "xndomdocument.h" +#include "xntype.h" +#include "xntext.h" +#include "xnpanic.h" +#include "xnmenu.h" +#include "xnmenuadapter.h" +#include "xncomponentnodeimpl.h" +#include "xnnodepluginif.h" +#include "xnoomsyshandler.h" + +// Constants +_LIT8( KEmptyWidgetUid, "0x2001f47f" ); +_LIT8( KViewSwitcherText, "switcher_text" ); +_LIT8( KStateError, "Error" ); +_LIT8( KMax, "max" ); + +_LIT8( KTemplateViewUID, "0x20026f50" ); + +enum + { + EFirstPassDrawComplete, + EDataPluginsComplete, + EViewIsValid, + }; + +const TInt KMinPages = 1; + + +#if 0 // MSK icon change + +const TInt KIconIds[] = { + EMbmAvkonQgnQgn_home_page_11, + EMbmAvkonQgnQgn_home_page_21, + EMbmAvkonQgnQgn_home_page_22, + EMbmAvkonQgnQgn_home_page_31, + EMbmAvkonQgnQgn_home_page_32, + EMbmAvkonQgnQgn_home_page_33, + EMbmAvkonQgnQgn_home_page_41, + EMbmAvkonQgnQgn_home_page_42, + EMbmAvkonQgnQgn_home_page_43, + EMbmAvkonQgnQgn_home_page_44, + EMbmAvkonQgnQgn_home_page_51, + EMbmAvkonQgnQgn_home_page_52, + EMbmAvkonQgnQgn_home_page_53, + EMbmAvkonQgnQgn_home_page_54, + EMbmAvkonQgnQgn_home_page_55, + EMbmAvkonQgnQgn_home_page_61, + EMbmAvkonQgnQgn_home_page_62, + EMbmAvkonQgnQgn_home_page_63, + EMbmAvkonQgnQgn_home_page_64, + EMbmAvkonQgnQgn_home_page_65, + EMbmAvkonQgnQgn_home_page_66 + }; + +const TInt KMaskIds[] = { + EMbmAvkonQgnQgn_home_page_11_mask, + EMbmAvkonQgnQgn_home_page_21_mask, + EMbmAvkonQgnQgn_home_page_22_mask, + EMbmAvkonQgnQgn_home_page_31_mask, + EMbmAvkonQgnQgn_home_page_32_mask, + EMbmAvkonQgnQgn_home_page_33_mask, + EMbmAvkonQgnQgn_home_page_41_mask, + EMbmAvkonQgnQgn_home_page_42_mask, + EMbmAvkonQgnQgn_home_page_43_mask, + EMbmAvkonQgnQgn_home_page_44_mask, + EMbmAvkonQgnQgn_home_page_51_mask, + EMbmAvkonQgnQgn_home_page_52_mask, + EMbmAvkonQgnQgn_home_page_53_mask, + EMbmAvkonQgnQgn_home_page_54_mask, + EMbmAvkonQgnQgn_home_page_55_mask, + EMbmAvkonQgnQgn_home_page_61_mask, + EMbmAvkonQgnQgn_home_page_62_mask, + EMbmAvkonQgnQgn_home_page_63_mask, + EMbmAvkonQgnQgn_home_page_64_mask, + EMbmAvkonQgnQgn_home_page_65_mask, + EMbmAvkonQgnQgn_home_page_66_mask + }; + +const TAknsItemID KSkinIds[] = { + KAknsIIDQgnHomePage11, + KAknsIIDQgnHomePage21, + KAknsIIDQgnHomePage22, + KAknsIIDQgnHomePage31, + KAknsIIDQgnHomePage32, + KAknsIIDQgnHomePage33, + KAknsIIDQgnHomePage41, + KAknsIIDQgnHomePage42, + KAknsIIDQgnHomePage43, + KAknsIIDQgnHomePage44, + KAknsIIDQgnHomePage51, + KAknsIIDQgnHomePage52, + KAknsIIDQgnHomePage53, + KAknsIIDQgnHomePage54, + KAknsIIDQgnHomePage55, + KAknsIIDQgnHomePage61, + KAknsIIDQgnHomePage62, + KAknsIIDQgnHomePage63, + KAknsIIDQgnHomePage64, + KAknsIIDQgnHomePage65, + KAknsIIDQgnHomePage66 + }; + +#endif // MSK icon change + + +// ============================ LOCAL FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// BuildTriggerL +// Builds a trigger node +// ----------------------------------------------------------------------------- +// +static CXnNode* BuildTriggerL( CXnUiEngine& aUiEngine, + const TDesC8& aStringValue ) + { + CXnNode* node = CXnNode::NewL(); + CleanupStack::PushL( node ); + + CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger ); + CleanupStack::PushL( type ); + + CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); + CleanupStack::Pop( type ); + + node->SetImpl( impl ); + node->SetUiEngine( aUiEngine ); + + CXnDomStringPool& sp( aUiEngine.ODT()->DomDocument().StringPool() ); + + CXnProperty* name = CXnProperty::NewL( + XnPropertyNames::action::trigger::KName, aStringValue, + CXnDomPropertyValue::EString, sp ); + + CleanupStack::PushL( name ); + node->SetPropertyL( name ); + CleanupStack::Pop( name ); + + CXnProperty* value = CXnProperty::NewL( + XnPropertyNames::action::KValue, + KNullDesC8, CXnDomPropertyValue::EString, sp ); + + CleanupStack::PushL( value ); + node->SetPropertyL( value ); + CleanupStack::Pop( value ); + + CleanupStack::Pop( node ); + + return node; + } + +// ----------------------------------------------------------------------------- +// 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 + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnViewManager::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnViewManager* CXnViewManager::NewL( CXnAppUiAdapter& aAdapter ) + { + CXnViewManager* self = CXnViewManager::NewLC( aAdapter ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::NewLC() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnViewManager* CXnViewManager::NewLC( CXnAppUiAdapter& aAdapter ) + { + CXnViewManager* self = new( ELeave ) CXnViewManager( aAdapter ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::CXnViewManager() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnViewManager::CXnViewManager( CXnAppUiAdapter& aAdapter ) + : iAppUiAdapter( aAdapter ), + iApplicationUid( iAppUiAdapter.Application()->AppDllUid() ) + { + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::~CXnViewManager() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +CXnViewManager::~CXnViewManager() + { + iObservers.Reset(); + + delete iRootData; + + delete iWidgetAmountTrigger; + + if ( iResources ) + { + iResources->Reset(); + } + + delete iResources; + + iControls.Reset(); + iAppearanceNodes.Reset(); + + iFailedPlugins.Reset(); + + delete iComposer; + delete iEditor; + delete iOomSysHandler; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ConstructL() +// 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CXnViewManager::ConstructL() + { + iOomSysHandler = CXnOomSysHandler::NewL(); + + // Create resource list + iResources = new ( ELeave ) CArrayPtrSeg< CXnResource > ( 16 ); + + const TInt KMaxUidLength( 10 ); + _LIT8( KUint, "%u" ); + + TBuf8< KMaxUidLength > uid; + uid.Format( KUint, iApplicationUid.iUid ); + + iEditor = CXnEditor::NewL( *this, uid ); + + iHspsWrapper = &iEditor->HspsWrapper(); + + iComposer = CXnComposer::NewL( *iHspsWrapper ); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::LoadUiL() +// Loads the application UI and initial view +// ----------------------------------------------------------------------------- +// +void CXnViewManager::LoadUiL() + { + iUiEngine->DisableRenderUiLC(); + + // Load application root configuration + iRootData = CXnRootData::NewL( *this, iApplicationUid ); + + // Load root configuration and initial view. + iRootData->LoadL(); + + CleanupStack::PopAndDestroy(); // DisableRenderUiLC(); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ReloadUiL() +// Reloads the application UI and initial ivew +// ----------------------------------------------------------------------------- +void CXnViewManager::ReloadUiL() + { +#ifdef _XN_PERFORMANCE_TEST_ + RDebug::Print( _L( "CXnViewManager::ReloadUiL() - start" ) ); +#endif //_XN_PERFORMANCE_TEST_ + + NotifyViewDeactivatedL( ActiveViewData() ); + + delete iWidgetAmountTrigger; + iWidgetAmountTrigger = NULL; + + // Destroy active view data + ActiveViewData().Destroy(); + + // Schedule application configuration destroyal + iRootData->Destroy(); + iRootData = NULL; + + iFlags.ClearAll(); + + User::Heap().Compress(); + + LoadUiL(); + + // Activate first view from the new configuration + iAppUiAdapter.ViewAdapter().ActivateContainerL( ActiveViewData() ); + +#ifdef _XN_PERFORMANCE_TEST_ + RDebug::Print( _L( "CXnViewManager::ReloadUiL() - end" ) ); +#endif //_XN_PERFORMANCE_TEST_ + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::LoadWidgetToPluginL() +// ----------------------------------------------------------------------------- +// +TInt CXnViewManager::LoadWidgetToPluginL( CHsContentInfo& aContentInfo, + CXnPluginData& aPluginData ) + { + // Plugin must not have widget when about to add + if ( aPluginData.Occupied() ) + { + return KErrAlreadyExists; + } + + CXnViewData& viewData( + static_cast< CXnViewData& >( *aPluginData.Parent() ) ); + + TBool emptyInUse( viewData.UseEmptyWidget() ); + + // By default widget is added to active view configuration + const TDesC8& configurationId( viewData.ConfigurationId() ); + + TInt retval( KErrGeneral ); + + if ( emptyInUse && aPluginData.Empty() ) + { + retval = iHspsWrapper->ReplacePluginL( + aPluginData.PluginId(), aContentInfo.Uid() ); + + if( retval == KErrDiskFull ) + { + ShowDiskFullMessageL(); + } + } + else + { + TInt index( viewData.PluginData().Find( &aPluginData ) ); + + CAddPluginResult* result = iHspsWrapper->AddPluginL( + configurationId, aContentInfo.Uid(), index ); + + CleanupStack::PushL( result ); + + retval = result->Status(); + if ( retval == KErrNone ) + { + aPluginData.SetPluginIdL( result->PluginId() ); + } + else if( retval == KErrDiskFull ) + { + ShowDiskFullMessageL(); + } + + CleanupStack::PopAndDestroy( result ); + } + + if ( retval == KErrNone ) + { + iUiEngine->DisableRenderUiLC(); + + NotifyConfigureWidgetL( aContentInfo, aPluginData ); + + aPluginData.LoadL(); + + UpdateCachesL(); + + NotifyWidgetAdditionL( aPluginData ); + + // Report widget amount in the view + ReportWidgetAmountL( viewData ); + + CleanupStack::PopAndDestroy(); // DisableRenderUiLC + } + + return retval; + } + +// ----------------------------------------------------------------------------- +// 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() ) + { + // Plugin must have widget when about to remove + return KErrNotFound; + } + + CXnViewData& viewData( + static_cast< CXnViewData& >( *aPluginData.Parent() ) ); + + TBool emptyInUse( viewData.UseEmptyWidget() ); + + TInt retval( KErrGeneral ); + + // Save temporary + TBuf8< 32 > id( aPluginData.PluginId() ); + + if ( emptyInUse ) + { + retval = iHspsWrapper->ReplacePluginL( + aPluginData.PluginId(), KEmptyWidgetUid ); + } + else + { + retval = iHspsWrapper->RemovePluginL( aPluginData.PluginId() ); + } + + if ( retval == KErrNone ) + { + TBool active( aPluginData.Active() ); + + iUiEngine->DisableRenderUiLC(); + + NotifyWidgetRemovalL( aPluginData ); + + aPluginData.Destroy(); + + if ( emptyInUse ) + { + // Write id back for for later usage + aPluginData.SetEmptyL( id ); + } + else + { + // Reorder plugindata array + RPointerArray< CXnPluginData >& plugins( viewData.PluginData() ); + + TInt index( plugins.Find( &aPluginData ) ); + + plugins.Remove( index ); + plugins.Insert( &aPluginData, plugins.Count() - 1 ); + } + + UpdateCachesL(); + + // Report widget amount in the view + ReportWidgetAmountL( viewData ); + + if ( active ) + { + iUiEngine->RenderUIL(); + SetOnlineStateL( iAppUiAdapter, ActiveViewData() ); + } + + CleanupStack::PopAndDestroy(); // DisableRenderUiLC + } + + return retval; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ReplaceWidgetToPluginL +// ----------------------------------------------------------------------------- +// +TInt CXnViewManager::ReplaceWidgetToPluginL( CHsContentInfo& aContentInfo, + CXnPluginData& aPluginData, TBool aUseHsps ) + { + TInt ret = KErrNone; + + // if aUseHsps is false, the plugin was already replaced by + // another process + if( aUseHsps ) + { + ret = iHspsWrapper->ReplacePluginL( aPluginData.PluginId(), + aContentInfo.Uid() ); + } + + if ( ret == KErrNone ) + { + iUiEngine->DisableRenderUiLC(); + + NotifyWidgetRemovalL( aPluginData ); + + TBuf8< 32 > id( aPluginData.PluginId() ); + TBuf8< 32 > uid( aContentInfo.Uid() ); + + aPluginData.Destroy(); + + UpdateCachesL(); + aPluginData.SetPluginIdL( id ); + + NotifyConfigureWidgetL( aContentInfo, aPluginData ); + + aPluginData.LoadL(); + + UpdateCachesL(); + + // notify addition if not replaced with empty widget + // NotifyWidgetAdditionL will call RenderUIL() + if( uid != KEmptyWidgetUid ) + { + NotifyWidgetAdditionL( aPluginData ); + } + else + { + if( aPluginData.Active() ) + { + iUiEngine->RenderUIL(); + } + } + + CleanupStack::PopAndDestroy(); // DisableRenderUiLC + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ODT() +// Get the ODT +// ----------------------------------------------------------------------------- +// +CXnODT* CXnViewManager::ODT() const + { + return iRootData->ODT(); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::RootNode() +// Finds the root node +// ----------------------------------------------------------------------------- +// +CXnNode* CXnViewManager::RootNode() const + { + return iRootData->RootNode(); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ViewNode() +// Finds the view node from active view data +// ----------------------------------------------------------------------------- +// +CXnNode* CXnViewManager::ViewNode() const + { + return ActiveViewData().ViewNode(); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::Parser() +// Gets ODT parser +// ----------------------------------------------------------------------------- +// +CXnODTParser& CXnViewManager::Parser() const + { + return iRootData->Parser(); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::EcomHandler() +// Gets Ecom handler +// ----------------------------------------------------------------------------- +// +CXnEcomHandler& CXnViewManager::EcomHandler() const + { + return iRootData->EcomHandler(); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::Controls() +// Finds the controls from active view data +// ----------------------------------------------------------------------------- +// +const RPointerArray< CXnControlAdapter >& CXnViewManager::Controls() const + { + return iControls; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::PluginNodes() +// Finds the plugin nodes from active view data +// ----------------------------------------------------------------------------- +// +RPointerArray< CXnNode >& CXnViewManager::PluginNodes() const + { + // These must be fetched from layout tree to get correct order of plugins + CXnViewData& activeViewData( ActiveViewData() ); + + // Get first plugin data + CXnPluginData* pluginData( activeViewData.PluginData()[0] ); + CXnNode* parent( pluginData->Owner()->LayoutNode()->Parent() ); + + // This assumes that the parent has only "plugin" nodes as its children + RPointerArray< CXnNode >& children( parent->Children() ); + + return children; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::PluginDataL() +// +// ----------------------------------------------------------------------------- +// +void CXnViewManager::PluginDataL( RPointerArray< CXnPluginData >& aList, + TBool aGlobal ) const + { + if ( aGlobal ) + { + RPointerArray< CXnPluginData >& views( iRootData->PluginData() ); + + for ( TInt i = 0; i < views.Count(); i++ ) + { + RPointerArray< CXnPluginData >& plugins( views[i]->PluginData() ); + + for ( TInt j = 0; j < plugins.Count(); j++ ) + { + aList.AppendL( plugins[ j ] ); + } + } + } + else + { + RPointerArray< CXnPluginData >& + plugins( ActiveViewData().PluginData() ); + + for ( TInt j = 0; j < plugins.Count(); j++ ) + { + aList.AppendL( plugins[ j ] ); + } + } + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::Resources() +// Finds the resources from the active view data +// ----------------------------------------------------------------------------- +// +CArrayPtrSeg< CXnResource >& CXnViewManager::Resources() const + { + return *iResources; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::AppearanceNodes() +// ----------------------------------------------------------------------------- +// +RPointerArray< CXnNode >& CXnViewManager::AppearanceNodes() const + { + return iAppearanceNodes; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ViewData() +// Finds a view data based on a view node +// ----------------------------------------------------------------------------- +// +CXnViewData* CXnViewManager::ViewData( CXnNode& aNode ) const + { + if ( !aNode.ViewNodeImpl() ) + { + return NULL; + } + + RPointerArray< CXnPluginData >& views( iRootData->PluginData() ); + + for ( TInt i = 0; i < views.Count(); i++ ) + { + if ( views[i]->Occupied() ) + { + if ( views[i]->Node()->LayoutNode() == &aNode ) + { + return static_cast< CXnViewData* >( views[ i ] ); + } + } + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ActiveAppData() +// Gets the active app data +// ----------------------------------------------------------------------------- +// +CXnRootData& CXnViewManager::ActiveAppData() const + { + return *iRootData; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ActiveViewData() +// Gets the active view data +// ----------------------------------------------------------------------------- +// +CXnViewData& CXnViewManager::ActiveViewData() const + { + return iRootData->ActiveViewData(); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::PreviousViewData() +// Gets the previous view data +// ----------------------------------------------------------------------------- +// +CXnViewData& CXnViewManager::PreviousViewData() const + { + return iRootData->PreviousViewData(); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::NextViewData() +// Gets the next view data +// ----------------------------------------------------------------------------- +// +CXnViewData& CXnViewManager::NextViewData() const + { + return iRootData->NextViewData(); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ActivateNextViewL() +// Activates the next view +// ----------------------------------------------------------------------------- +// +void CXnViewManager::ActivateNextViewL() + { + CXnViewData& current( ActiveViewData() ); + CXnViewData& next( NextViewData() ); + + if ( !next.Occupied() ) + { + next.LoadL(); + } + + // Activate view + if ( next.Occupied() ) + { + iAppUiAdapter.ViewAdapter().ActivateContainerL( next ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ActivatePreviousViewL() +// Activates the previous view +// ----------------------------------------------------------------------------- +// +void CXnViewManager::ActivatePreviousViewL() + { + CXnViewData& current( ActiveViewData() ); + CXnViewData& prev( PreviousViewData() ); + + if ( !prev.Occupied() ) + { + prev.LoadL(); + } + + // Activate view + if ( prev.Occupied() ) + { + iAppUiAdapter.ViewAdapter().ActivateContainerL( prev ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::AddViewL() +// Adds a new view based on info +// ----------------------------------------------------------------------------- +// +TInt CXnViewManager::AddViewL( CHsContentInfo& aInfo ) + { + if ( iRootData->PluginData().Count() >= iRootData->MaxPages() ) + { + return KErrGeneral; + } + + // Add new view (template view) to hsps + CAddPluginResult* result = iHspsWrapper->AddPluginL( + iRootData->ConfigurationId(), aInfo.Uid(), + ViewIndex() + 1 ); + CleanupStack::PushL( result ); + + TInt retval( result->Status() ); + + if( retval == KErrDiskFull ) + { + ShowDiskFullMessageL(); + } + else if ( retval == KErrNone ) + { + // Create new view + CXnViewData* newView = CXnViewData::NewLC( *iRootData ); + + newView->SetPluginIdL( result->PluginId() ); + + newView->SetOwner( iRootData->Node() ); + + newView->LoadL(); + + if ( newView->Occupied() ) + { + // Load succeed, add the new view behind the current view + RPointerArray< CXnPluginData >& views( iRootData->PluginData() ); + + TInt index( views.Find( &ActiveViewData() ) ); + + views.InsertL( newView, index + 1 ); + + // Root data owns the new view now + CleanupStack::Pop( newView ); + + // Inform observers about added view + NotifyViewAdditionL( *newView ); + + UpdatePageManagementInformationL(); + + iUiEngine->RenderUIL(); + } + else + { + // creation failed, remove it from hsps + iHspsWrapper->RemovePluginL( result->PluginId() ); + + // ... and destroy it + CleanupStack::PopAndDestroy( newView ); + + retval = KErrGeneral; + + } + } + + CleanupStack::PopAndDestroy( result ); + + return retval; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::AddViewL() +// Adds a new view +// ----------------------------------------------------------------------------- +// +void CXnViewManager::AddViewL() + { + if ( iRootData->PluginData().Count() >= iRootData->MaxPages() ) + { + HBufC* msg( StringLoader::LoadLC( + R_QTN_HS_MAX_AMOUNT_OF_PAGES_NOTE ) ); + + CAknErrorNote* note = new ( ELeave ) CAknErrorNote; + CleanupStack::PushL( note ); + + note->ExecuteLD( *msg ); + + CleanupStack::Pop( note ); + CleanupStack::PopAndDestroy( msg ); + + return; + } + + // Add new view (template view) to hsps + CAddPluginResult* result = iHspsWrapper->AddPluginL( + iRootData->ConfigurationId(), KTemplateViewUID, + ViewIndex() + 1 ); + CleanupStack::PushL( result ); + + TInt status( result->Status() ); + + if( status == KErrDiskFull ) + { + ShowDiskFullMessageL(); + } + else if ( status == KErrNone ) + { + // Create new view + CXnViewData* newView = CXnViewData::NewLC( *iRootData ); + + newView->SetPluginIdL( result->PluginId() ); + + newView->SetOwner( iRootData->Node() ); + + newView->LoadL(); + + if ( newView->Occupied() ) + { + // Load succeed, add the new view behind the current view + RPointerArray< CXnPluginData >& views( iRootData->PluginData() ); + + TInt index( views.Find( &ActiveViewData() ) ); + + views.InsertL( newView, index + 1 ); + + // Root data owns the new view now + CleanupStack::Pop( newView ); + + // Activate view + iAppUiAdapter.ViewAdapter().ActivateContainerL( *newView, ETrue ); + + // Inform observers about added view + NotifyViewAdditionL( *newView ); + } + else + { + // creation failed, remove it from hsps + iHspsWrapper->RemovePluginL( result->PluginId() ); + + // ... and destroy it + CleanupStack::PopAndDestroy( newView ); + } + } + + CleanupStack::PopAndDestroy( result ); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::RemoveViewL() +// Removes view based info +// ----------------------------------------------------------------------------- +// +TInt CXnViewManager::RemoveViewL( const CHsContentInfo& aInfo ) + { + TInt retval( KErrGeneral ); + + if ( iRootData->PluginData().Count() <= 1 ) + { + // Only one page left, not allowed to remove + return retval; + } + + RPointerArray< CXnPluginData >& views( iRootData->PluginData() ); + + for ( TInt i = 0; i < views.Count(); i++ ) + { + CXnViewData* view( static_cast< CXnViewData* >( views[i] ) ); + + if ( view->PluginId() == aInfo.PluginId() ) + { + if ( !view->Removable() ) + { + return retval; + } + + if ( view->Active() ) + { + // Activate the next view, or first if in the last view + CXnViewData& next( NextViewData() ); + iAppUiAdapter.ViewAdapter().ActivateContainerL( next ); + } + + retval = iHspsWrapper->RemovePluginL( view->PluginId() ); + + // Notify observers of view list change + NotifyViewRemovalL( *view ); + + iRootData->DestroyViewData( view ); + + // Need to update after view is removed + UpdatePageManagementInformationL(); + + break; + } + } + + return retval; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::RemoveViewL() +// Removes active view if more than one view. +// ----------------------------------------------------------------------------- +// +void CXnViewManager::RemoveViewL() + { + if ( iRootData->PluginData().Count() <= 1 || + !ActiveViewData().Removable() ) + { + // Only one page left, this should not happen, + // or active view is not removable + return; + } + + RPointerArray< CXnPluginData >& views( iRootData->PluginData() ); + + TInt index( views.Find( &ActiveViewData() ) ); + + CAknQueryDialog* query = CAknQueryDialog::NewL(); + query->PrepareLC( R_YES_NO_HS_REMOVE_VIEW ); + + HBufC* queryText( StringLoader::LoadLC( R_QTN_HS_DELETE_PAGE ) ); + + query->SetPromptL( queryText->Des() ); + + CleanupStack::PopAndDestroy( queryText ); + + if ( query->RunLD() ) + { + // Activate the next view, or first if in the last view + CXnViewData& next( NextViewData() ); + + iAppUiAdapter.ViewAdapter().ActivateContainerL( next ); + + CXnViewData* view( static_cast< CXnViewData* >( views[ index ] ) ); + + // Remove plugin from HSPS + iHspsWrapper->RemovePluginL( view->PluginId() ); + + // Notify observers of view list change + NotifyViewRemovalL( *view ); + + iRootData->DestroyViewData( view ); + + // Need to update after view is removed + UpdatePageManagementInformationL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::AddObserver() +// ----------------------------------------------------------------------------- +// +void CXnViewManager::AddObserver( const MXnViewObserver& aObserver ) + { + TInt index( iObservers.Find( &aObserver ) ); + + if ( index == KErrNotFound ) + { + iObservers.Append( &aObserver ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::RemoveObserver() +// ----------------------------------------------------------------------------- +// +void CXnViewManager::RemoveObserver( const MXnViewObserver& aObserver ) + { + TInt index( iObservers.Find( &aObserver ) ); + + if ( index != KErrNotFound ) + { + iObservers.Remove( index ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ActivateAppL() +// Activates application configuration +// ----------------------------------------------------------------------------- +TInt CXnViewManager::ActivateAppL( const TDesC8& aPluginUid ) + { + if ( aPluginUid == KNullDesC8 ) + { + return KErrArgument; + } + + if ( iRootData->PluginUid().Compare( aPluginUid ) == 0 ) + { + // Nothing to do + return KErrNone; + } + + return iHspsWrapper->SetAppConfigurationL( aPluginUid ); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ActivateViewL() +// Activates view +// ----------------------------------------------------------------------------- +TInt CXnViewManager::ActivateViewL( const TDesC8& aPluginId ) + { + if ( aPluginId == KNullDesC8 ) + { + return KErrArgument; + } + + CXnViewData& current( ActiveViewData() ); + + if ( current.PluginId() == aPluginId ) + { + // Nothing to do + return KErrNone; + } + + TInt retval( KErrNotFound ); + + RPointerArray< CXnPluginData >& views( iRootData->PluginData() ); + + for ( TInt i = 0; i < views.Count(); i++ ) + { + CXnViewData* view( static_cast< CXnViewData* >( views[ i ] ) ); + + if( view->Occupied() && view->PluginId() == aPluginId ) + { + iAppUiAdapter.ViewAdapter().ActivateContainerL( *view ); + + retval = KErrNone; + + break; + } + } + + return retval; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ViewAmount() +// Gets current view amount +// ----------------------------------------------------------------------------- +TInt CXnViewManager::ViewAmount() const + { + return iRootData->PluginData().Count(); + } + + +// ----------------------------------------------------------------------------- +// CXnViewManager::ViewIndex() +// Gets index of current view +// ----------------------------------------------------------------------------- +TInt CXnViewManager::ViewIndex() const + { + TInt index( KErrNotFound ); + CXnViewData* view = &( ActiveViewData() ); + RPointerArray< CXnPluginData >& views( iRootData->PluginData() ); + index = views.Find( view ); + return index; + } + +// ----------------------------------------------------------------------------- +// 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() ); + + // Cache update is needed after view activation + UpdateCachesL(); + } + else + { + // Activate first view + aViewToActivate.SetActiveL( ETrue ); + + // Cache update is needed after view activation + UpdateCachesL(); + } + + NotifyViewActivatedL( aViewToActivate ); + UpdatePageManagementInformationL(); + +#ifdef _XN_PERFORMANCE_TEST_ + RDebug::Print( _L( "CXnViewManager::NotifyContainerChangedL - end" ) ); +#endif //_XN_PERFORMANCE_TEST_ + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::NotifyViewActivatedL() +// Notifies view is activated +// ----------------------------------------------------------------------------- +// +void CXnViewManager::NotifyViewActivatedL( const CXnViewData& aViewData ) + { + // Report widget amount in the view + ReportWidgetAmountL( aViewData ); + + for ( TInt i = 0; i < iObservers.Count(); i++ ) + { + iObservers[i]->NotifyViewActivatedL( aViewData ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::NotifyViewDeactivatedL() +// Notifies view is deactivated +// ----------------------------------------------------------------------------- +// +void CXnViewManager::NotifyViewDeactivatedL( const CXnViewData& aViewData ) + { + for ( TInt i = 0; i < iObservers.Count(); i++ ) + { + iObservers[i]->NotifyViewDeactivatedL( aViewData ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::NotifyViewAdditionL() +// Notifies view is added +// ----------------------------------------------------------------------------- +// +void CXnViewManager::NotifyViewAdditionL( const CXnViewData& aViewData ) + { + for ( TInt i = 0; i < iObservers.Count(); i++ ) + { + iObservers[i]->NotifyViewAdditionL( aViewData ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::NotifyViewRemovalL() +// Notifies view is removed +// ----------------------------------------------------------------------------- +// +void CXnViewManager::NotifyViewRemovalL( const CXnViewData& aViewData ) + { + for ( TInt i = 0; i < iObservers.Count(); i++ ) + { + iObservers[i]->NotifyViewRemovalL( aViewData ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::NotifyConfigureWidgetL() +// Notifies to configure widget +// ----------------------------------------------------------------------------- +// +void CXnViewManager::NotifyConfigureWidgetL( const CHsContentInfo& aContentInfo, + CXnPluginData& aPluginData ) + { + for ( TInt i = 0; i < iObservers.Count(); i++ ) + { + iObservers[i]->NotifyConfigureWidgetL( aContentInfo, aPluginData ); + } + + if ( aPluginData.Active() ) + { + // Active view configuration is about to change + InvalidateActiveView(); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::NotifyWidgetAdditionL() +// Notifys widget is added +// ----------------------------------------------------------------------------- +// +void CXnViewManager::NotifyWidgetAdditionL( const CXnPluginData& aPluginData ) + { + for ( TInt i = 0; i < iObservers.Count(); i++ ) + { + iObservers[i]->NotifyWidgetAdditionL( aPluginData ); + } + + if ( aPluginData.Active() ) + { + // Update UI appearance after active view configuration is changed + iUiEngine->RenderUIL(); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::NotifyWidgetRemovalL() +// Notifys widget is removed +// ----------------------------------------------------------------------------- +// +void CXnViewManager::NotifyWidgetRemovalL( const CXnPluginData& aPluginData ) + { + // This loop is intend to go from "count - 1 to 0", because CXnEditor is + // the first registered observer and it must be notified as the last one + for ( TInt i = iObservers.Count() - 1; i >= 0 ; i-- ) + { + iObservers[i]->NotifyWidgetRemovalL( aPluginData ); + } + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::UpdateCachesL() +// ----------------------------------------------------------------------------- +// +void CXnViewManager::UpdateCachesL() + { + CXnViewData& activeViewData( ActiveViewData() ); + iControls.Reset(); + activeViewData.ControlsL( iControls ); + iAppearanceNodes.Reset(); + activeViewData.AppearanceNodesL( iAppearanceNodes ); + iResources->Reset(); + activeViewData.ResourcesL( *iResources ); + } + +// ----------------------------------------------------------------------------- +// 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() +// ----------------------------------------------------------------------------- +// +void CXnViewManager::ReportWidgetAmountL( const CXnViewData& aViewData ) + { + CXnNode* node( aViewData.ViewNode() ); + + if ( !iWidgetAmountTrigger ) + { + iWidgetAmountTrigger = BuildTriggerL( *iUiEngine, + XnPropertyNames::action::trigger::name::KWidgetAmount ); + } + + RPointerArray< CXnPluginData >& plugins( aViewData.PluginData() ); + TInt max( plugins.Count() ); + TInt count( 0 ); + + for ( TInt i = 0; i < plugins.Count(); i++ ) + { + CXnPluginData* plugin( plugins[i] ); + + if ( plugin->Occupied() ) + { + if( plugin->Removable() ) + { + count++; + } + else + { + // non-removable widget consumes max amount + max--; + } + } + } + + CXnProperty* prop( + iWidgetAmountTrigger->GetPropertyL( XnPropertyNames::action::KValue ) ); + + if ( prop ) + { + if ( count == max ) + { + // All plugins occupied, report max widget amount reached + _LIT8( KMax, "max" ); + + static_cast< CXnDomPropertyValue* >( + prop->Property()->PropertyValueList().Item( 0 ) ) + ->SetStringValueL( CXnDomPropertyValue::EString, KMax() ); + } + else + { + // Report number of widgets + TBuf8< 8 > value; + + value.AppendNum( count ); + + static_cast< CXnDomPropertyValue* >( + prop->Property()->PropertyValueList().Item( 0 ) ) + ->SetStringValueL( CXnDomPropertyValue::EString, value ); + } + } + + node->ReportXuikonEventL( *iWidgetAmountTrigger ); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::ShowOperationFailedMessageL +// ----------------------------------------------------------------------------- +// +void CXnViewManager::ShowDiskFullMessageL() const + { + HBufC* msg( StringLoader::LoadLC( R_QTN_HS_OPERATION_FAILED_NO_DISK ) ); + + CAknErrorNote* note = new ( ELeave ) CAknErrorNote; + CleanupStack::PushL( note ); + + note->ExecuteLD( *msg ); + + CleanupStack::Pop( note ); + CleanupStack::PopAndDestroy( msg ); + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::OOMSysHandler +// ----------------------------------------------------------------------------- +// +CXnOomSysHandler& CXnViewManager::OomSysHandler() const + { + return *iOomSysHandler; + } + +// ----------------------------------------------------------------------------- +// CXnViewManager::UpdateViewSwitcherInformationL() +// ----------------------------------------------------------------------------- +// +void CXnViewManager::UpdatePageManagementInformationL() + { + // Update MSK info + // Obtain menu bar + CXnNode* menuBar( iUiEngine->MenuBarNode() ); + + if ( menuBar ) + { + // Get object implementing MXnMenuInterface + XnMenuInterface::MXnMenuInterface* menuIf( NULL ); + XnComponentInterface::MakeInterfaceL( menuIf, menuBar->AppIfL() ); + + if ( menuIf ) + { +#if 0 // MSK icon change + // Get count of views in array and index of actual view + TInt count( ViewAmount() ); + TInt current( ViewIndex() + 1 ); + + // Update MSK icon + TInt index = ResolveIconIndex( count, current ); + menuIf->SetSoftKeyImageL( KSkinIds[index], + AknIconUtils::AvkonIconFileName(), + KIconIds[index], + KMaskIds[index], + XnMenuInterface::MXnMenuInterface::ECenter, + ETrue ); + +#else // MSK icon change + // Get array of views + RPointerArray< CXnPluginData >& views( iRootData->PluginData() ); + // Get count of views in array and index of actual view + TInt count( views.Count() ); + TInt actual( views.Find( &ActiveViewData() ) + 1 ); + + // Construct a text info + _LIT( KSeparator, "/" ); + TBuf< 32 >info( KNullDesC ); + + if ( AknLayoutUtils::LayoutMirrored() ) + { + info.AppendNum( actual ); + info.Append( KSeparator ); + info.AppendNum( count ); + } + else + { + info.AppendNum( actual ); + info.Append( KSeparator ); + info.AppendNum( count ); + } + + AknTextUtils::LanguageSpecificNumberConversion( info ); + + // Update info + menuIf->SetSoftKeyTextL( info, + XnMenuInterface::MXnMenuInterface::ECenter ); +#endif // MSK icon change + } + } + } + +// ----------------------------------------------------------------------------- +// 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(); + } + + +#if 0 // MSK icon change + + +// ----------------------------------------------------------------------------- +// CXnViewManager::ResolveIconIndex +// +// ----------------------------------------------------------------------------- +TInt CXnViewManager::ResolveIconIndex( TInt aPageCount, TInt aPageNum ) const + { + TInt iconCount( 0 ); + + // Calculate total amount of icons. Each page has a aPage amount of icons. + for ( TInt i( aPageCount ); 0 < i; i-- ) + { + iconCount += i; + } + + TInt index( iconCount - aPageCount + aPageNum - 1 ); + + return index; + } + +#endif // MSK icon change +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnviewnodeimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewnodeimpl.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View node implementaton +* +*/ + +// User includes +#include "xnviewnodeimpl.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnViewNodeImpl::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnViewNodeImpl* CXnViewNodeImpl::NewL( CXnType* aType ) + { + CXnViewNodeImpl* self = new( ELeave ) CXnViewNodeImpl; + CleanupStack::PushL( self ); + self->ConstructL( aType ); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnViewNodeImpl::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnViewNodeImpl::ConstructL( CXnType* aType ) + { + CXnNodeImpl::ConstructL( aType ); + } + +// ----------------------------------------------------------------------------- +// CXnViewNodeImpl::CXnViewNodeImpl() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnViewNodeImpl::CXnViewNodeImpl() + { + } + +// ----------------------------------------------------------------------------- +// CXnViewNodeImpl::~CXnViewNodeImpl() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +CXnViewNodeImpl::~CXnViewNodeImpl() + { + } + +// End of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnviewsnodeimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewsnodeimpl.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,93 @@ +/* +* 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: Implementation of views node +* +*/ + +// INCLUDES + +// USER INCLUDES +#include "xnviewsnodeimpl.h" +#include "xncomponent.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnViewsNodeImpl::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnViewsNodeImpl* CXnViewsNodeImpl::NewL( CXnType* aType ) + { + CXnViewsNodeImpl* self = new( ELeave ) CXnViewsNodeImpl; + CleanupStack::PushL( self ); + self->ConstructL( aType ); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnViewsNodeImpl::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnViewsNodeImpl::ConstructL( CXnType* aType ) + { + CXnNodeImpl::ConstructL( aType ); + } + +// ----------------------------------------------------------------------------- +// CXnViewsNodeImpl::CXnViewsNodeImpl() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnViewsNodeImpl::CXnViewsNodeImpl() + { + } + +// ----------------------------------------------------------------------------- +// CXnViewsNodeImpl::~CXnViewsNodeImpl() +// C++ default destructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnViewsNodeImpl::~CXnViewsNodeImpl() + { + delete iComponent; + } + +// ----------------------------------------------------------------------------- +// CXnViewsNodeImpl::Component() +// Returns the component associated with the views-node. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnComponent* CXnViewsNodeImpl::Component() + { + return iComponent; + } + +// ----------------------------------------------------------------------------- +// CXnViewsNodeImpl::Component() +// Associates given component with the views-node. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnViewsNodeImpl::SetComponent( CXnComponent* aComponent ) + { + if ( iComponent != NULL ) + { + return; + } + iComponent = aComponent; + } diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnwallpapercontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnwallpapercontainer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,120 @@ +/* +* 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: Wallpaper view's container. +* +*/ + + + +// INCLUDE FILES +#include "xnwallpapercontainer.h" + +// SYSTEM INCLUDE FILES +#include <aknappui.h> +#include <AknsSkinInstance.h> +#include <AknUtils.h> +#include <AknsUtils.h> +#include <AknsDrawUtils.h> + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// C++ default constructor. +// ----------------------------------------------------------------------------- +// +CXnWallpaperContainer::CXnWallpaperContainer() + { + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnWallpaperContainer* CXnWallpaperContainer::NewL() + { + CXnWallpaperContainer* self = new (ELeave) CXnWallpaperContainer(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CXnWallpaperContainer::ConstructL() + { + CreateWindowL(); + TRect rect = iAvkonAppUi->ClientRect(); + iBgContext = CAknsBasicBackgroundControlContext::NewL( + KAknsIIDQsnBgScreen, rect, EFalse ); + SetRect( rect ); + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnWallpaperContainer::~CXnWallpaperContainer() + { + if ( iBgContext ) + { + delete iBgContext; + iBgContext = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CXnWallpaperContainer::Draw +// ----------------------------------------------------------------------------- +// +void CXnWallpaperContainer::Draw( const TRect& aRect ) const + { + CWindowGc& gc = SystemGc(); + + // draw background skin. + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsDrawUtils::Background( skin, iBgContext, this, gc, aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnWallpaperContainer::SizeChanged +// ----------------------------------------------------------------------------- +// +void CXnWallpaperContainer::SizeChanged() + { + if ( iBgContext ) + { + iBgContext->SetRect(Rect()); + TRect rect = Rect(); + } + } + +// ----------------------------------------------------------------------------- +// CXnWallpaperContainer::HandleResourceChange +// ----------------------------------------------------------------------------- +// +void CXnWallpaperContainer::HandleResourceChange(TInt aType) + { + TRect rect; + if ( aType == KEikDynamicLayoutVariantSwitch ) + { + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect); + SetRect(rect); + } + CCoeControl::HandleResourceChange(aType); + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,160 @@ +/* +* 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: Wallpaper view. +* +*/ + + +// INCLUDE FILES +#include "xnwallpaperview.h" +#include "xnwallpapercontainer.h" +#include "xnuiengine.h" +#include "xneditor.h" + +// SYSTEM INCLUDE FILES +#include <aknappui.h> +#include <eikbtgpc.h> +#include <avkon.rsg> +#include <AknsWallpaperUtils.h> +#include <MGFetch.h> + +_LIT8( KMulti, "multi" ); +const TInt KFileArrayGranularity = 6; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// C++ default constructor. +// ----------------------------------------------------------------------------- +// +CXnWallpaperView::CXnWallpaperView( CXnUiEngine& aEngine ) : + iEngine( aEngine ) + { + } + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CXnWallpaperView::ConstructL() + { + BaseConstructL(); + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnWallpaperView* CXnWallpaperView::NewL( CXnUiEngine& aEngine ) + { + CXnWallpaperView* self = new (ELeave) CXnWallpaperView( aEngine ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnWallpaperView::~CXnWallpaperView() + { + if ( iContainer ) + { + delete iContainer; + iContainer = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CXnWallpaperView::Id +// ----------------------------------------------------------------------------- +// +TUid CXnWallpaperView::Id() const + { + return KWallpaperViewUid; + } + +// ----------------------------------------------------------------------------- +// CXnWallpaperView::DoActivateL +// ----------------------------------------------------------------------------- +// +void CXnWallpaperView::DoActivateL( + const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + iAvkonAppUi->StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL ); + iAvkonAppUi->StatusPane()->DrawNow(); + if ( !iContainer ) + { + iContainer = CXnWallpaperContainer::NewL(); + iAvkonAppUi->AddToStackL( *this, iContainer ); + iContainer->ActivateL(); + iContainer->DrawNow(); + } + + CDesCArrayFlat* files = + new (ELeave) CDesCArrayFlat( KFileArrayGranularity ); + CleanupStack::PushL( files ); + TBool selected = EFalse; + + TBool multiple=EFalse; + if( aCustomMessage == KMulti ) + { + multiple = ETrue; + } + TRAPD( err, selected = MGFetch::RunL( *files, EImageFile, multiple ) ); + if ( err == KErrNone && + selected && + files->MdcaCount() > 0 ) + { + // set wallpaper. + if( files->MdcaCount() == 1 ) + { + AknsWallpaperUtils::SetIdleWallpaper( + files->MdcaPoint( 0 ), + NULL ); + } + //set slideshow + else + { + AknsWallpaperUtils::SetSlidesetWallpaper( + *files, + NULL ); + } + } + + CleanupStack::PopAndDestroy( files ); + + iAvkonAppUi->ActivateViewL( aPrevViewId ); + + } + +// ----------------------------------------------------------------------------- +// CXnWallpaperView::DoActivateL +// ----------------------------------------------------------------------------- +// +void CXnWallpaperView::DoDeactivate() + { + if ( iContainer ) + { + iAvkonAppUi->RemoveFromStack( iContainer ); + delete iContainer; + iContainer = NULL; + } + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiengine/src/xnwidgetextensionadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnwidgetextensionadapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,526 @@ +/* +* 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: +* +*/ + + +#include <e32base.h> +#include <e32const.h> +#include <coecntrl.h> +#include <coemain.h> + +#include <AknUtils.h> + +#include "xnwidgetextensionadapter.h" +#include "xncontroladapter.h" + +#include "xncomponentnodeimpl.h" +#include "xncomponent.h" + +#include "xnuiengine.h" +#include "xnhittest.h" + +#include "xnnode.h" +#include "xnnodepluginif.h" +#include "xnviewnodeimpl.h" +#include "xnnodepluginif.h" +#include "xndomdocument.h" +#include "xnproperty.h" +#include "xnodt.h" +#include "xntype.h" +#include "xndomnode.h" +#include "xndomstringpool.h" + +#include "xnappuiadapter.h" +#include "xnviewmanager.h" +#include "xnviewdata.h" +#include "xnplugindata.h" + + +_LIT8( KPopUpText, "popup" ); +_LIT8( KPositionHint, "_s60-position-hint" ); +_LIT8( KWidgetNodeName, "widget" ); +_LIT8( KParentIdName, "parentid" ); +_LIT8( KDisplay, "display" ); +_LIT8( KNone, "none" ); +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::NewL +// Two-phased constructor. Can leave. +// ----------------------------------------------------------------------------- +// +CXnWidgetExtensionAdapter* CXnWidgetExtensionAdapter::NewL( + CXnNodePluginIf& aNode ) + { + CXnWidgetExtensionAdapter* self = + new ( ELeave ) CXnWidgetExtensionAdapter( aNode ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::~CXnWidgetExtensionAdapter +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnWidgetExtensionAdapter::~CXnWidgetExtensionAdapter() + { + } + +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::CXnWidgetExtensionAdapter +// C++ default constructor. Must not leave. +// ----------------------------------------------------------------------------- +// +CXnWidgetExtensionAdapter::CXnWidgetExtensionAdapter( CXnNodePluginIf& aNode ) + : iNode( aNode ), iPositionHint( ENone ) + { + } + +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::ConstructL +// 2nd phase constructor. Can leave. +// ----------------------------------------------------------------------------- +// +void CXnWidgetExtensionAdapter::ConstructL() + { + 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(); + const TDesC8& type = typeInfo->Type(); + + if ( type == KPopUpText ) + { + // popup element does not capture pointer events + SetPointerCapture( ETrue ); + } + else + { + // widget extension node + SetPointerCapture( ETrue ); + if ( Window().SetTransparencyAlphaChannel() == KErrNone ) + { + Window().SetBackgroundColor( ~0 ); + } + } + iUiEngine = iNode.Node().UiEngine(); + CXnControlAdapter::ConstructL( iNode ); + EnableDragEvents(); + + iAppUiAdapter = static_cast< CXnAppUiAdapter* >( iAvkonAppUi ); + + } + +// ----------------------------------------------------------------------------- +// CXnWidgetExtensionAdapter::MakeVisible +// +// ----------------------------------------------------------------------------- +// +void CXnWidgetExtensionAdapter::MakeVisible( TBool aVisible ) + { + + TBool visible( IsVisible() ? ETrue : EFalse ); + if ( visible == aVisible ) + { + return; + } + + CXnPluginData& plugin( + iAppUiAdapter->ViewManager().ActiveViewData().Plugin( &iNode.Node() ) ); + + plugin.SetIsDisplayingPopup( aVisible, &iNode.Node() ); + + if ( aVisible ) + { + + CXnType* typeInfo = iNode.Node().Type(); + const TDesC8& type = typeInfo->Type(); + + if ( type == KPopUpText ) + { + // read position-hint property and set-up its variable + CXnProperty* positionHintProp = NULL; + TRAP_IGNORE( positionHintProp = iNode.Node().GetPropertyL( KPositionHint ) ); + + if ( positionHintProp ) + { + const TDesC8& displayHintVal = positionHintProp->StringValue(); + + if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KAboveLeft ) + { + iPositionHint = EAboveLeft; + } + else if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KAboveRight ) + { + iPositionHint = EAboveRight; + } + else if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KBelowLeft ) + { + iPositionHint = EBelowLeft; + } + else if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KBelowRight ) + { + iPositionHint = EBelowRight; + } + else if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KRight ) + { + iPositionHint = ERight; + } + else if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KLeft ) + { + iPositionHint = ELeft; + } + else + { + // if the value if of unknown type, use default one + if ( AknLayoutUtils::LayoutMirrored() ) + { + iPositionHint = EAboveRight; + } + else + { + iPositionHint = EAboveLeft; + } + } + + if ( iPositionHint != ENone ) + { + // the popup is going visible and position-hind is available + // calculate its position + CalculatePosition(); + } + } + } + DrawableWindow()->FadeBehind( ETrue ); + } + else + { + DrawableWindow()->FadeBehind( EFalse ); + } + 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() ) ); + + TRect clientRect = + static_cast<CEikAppUi&> ( *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 ); + } + +// ----------------------------------------------------------------------------- +// CalculatePosition +// This is used only for popup element with position hint +// ----------------------------------------------------------------------------- +void CXnWidgetExtensionAdapter::CalculatePosition() + { + + // widget's rectangle + TRect controlRect; + + // get popup's window size + TRect popupRect = this->Rect(); + + TRect clientRect = static_cast<CEikAppUi&>( *iAppUiAdapter ).ClientRect(); + + // get entire screen except control pane + TRect contentRect( 0, 0, clientRect.iBr.iX, clientRect.iBr.iY ); + + // resulting rectangle + TRect rect; + + TPoint offset( clientRect.iTl ); + + // parent widget's rectangle ( first predecesscor which is "widget" ) + CXnNode* parent = iNode.Node().Parent(); + + while ( parent ) + { + const TDesC8& type( parent->DomNode()->Name() ); + if ( type == KWidgetNodeName ) + { + break; + } + parent = parent->Parent(); + } + + // if predecesscor widget was not found, use parent's rectangle + if ( parent == NULL ) + { + controlRect = iNode.Node().Parent()->Rect(); + } + else + { + controlRect = parent->BorderRect(); + } + + // calculate available space for placing the popup + TInt spaceAbove = controlRect.iTl.iY + offset.iY; + TInt spaceBelow = contentRect.iBr.iY - controlRect.iBr.iY - offset.iY; + TInt spaceLeft = controlRect.iTl.iX + offset.iX; + TInt spaceRight = contentRect.iBr.iX - controlRect.iBr.iX - offset.iX; + + switch ( iPositionHint ) + { + + case EAboveLeft: + + // if this position does not fit the screen, + // and if below left is more suitable, use it + if ( spaceAbove < popupRect.Height() && spaceBelow > spaceAbove ) + { + rect = TRect( TPoint( controlRect.iTl.iX, controlRect.iBr.iY ), + TPoint( controlRect.iTl.iX + popupRect.Width(), controlRect.iBr.iY + popupRect.Height() ) ); + } + 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 ) ); + + } + break; + + case EAboveRight: + + // if this position does not fit the screen, + // and if below right is more suitable, use it + if ( spaceAbove < popupRect.Height() && spaceBelow > spaceAbove ) + { + rect = TRect( TPoint( controlRect.iBr.iX - popupRect.Width(), controlRect.iBr.iY ), + TPoint( controlRect.iBr.iX, controlRect.iBr.iY + popupRect.Height() ) ); + } + else + { + // use the above-right position + rect = TRect( TPoint( controlRect.iBr.iX - popupRect.Width(), controlRect.iTl.iY - popupRect.Height() ), + TPoint( controlRect.iBr.iX, controlRect.iTl.iY ) ); + } + break; + + case EBelowLeft: + + // if this position does not fit the screen, + // and if above left is more suitable, use it + if ( spaceBelow < popupRect.Height() && spaceBelow < spaceAbove ) + { + rect = TRect( TPoint( controlRect.iTl.iX, controlRect.iTl.iY - popupRect.Height() ), + TPoint( controlRect.iTl.iX + popupRect.Width(), 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() ) ); + } + break; + + case EBelowRight: + + // if this position does not fit the screen, + // and if above right is more suitable, use it + if ( spaceBelow < popupRect.Height() && spaceBelow < spaceAbove ) + { + rect = TRect( TPoint( controlRect.iBr.iX - popupRect.Width(), controlRect.iTl.iY - popupRect.Height() ), + 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() ) ); + } + break; + + case ERight: + + // if this position does not fit the screen, + // and if left or above-left is more suitable, use it + if ( spaceRight < popupRect.Width() ) + { + // use the left position if the space is big enough + if ( spaceLeft >= popupRect.Width() ) + { + // use left position + rect = TRect( TPoint( controlRect.iTl.iX - popupRect.Width(), controlRect.iTl.iY ), + TPoint( controlRect.iTl.iX, controlRect.iTl.iY + popupRect.Height() ) ); + } + else if ( spaceAbove >= popupRect.Height() ) + { + // use the above-right position + rect = TRect( TPoint( controlRect.iBr.iX - popupRect.Width(), controlRect.iTl.iY - popupRect.Height() ), + 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() ) ); + } + } + 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() ) ); + } + + break; + + case ELeft: + + // if this position does not fit the screen, + // and if right is more suitable, use it + if ( spaceLeft < popupRect.Width() ) + { + // use the right position, if it the space is big enough + if ( spaceRight >= popupRect.Width() ) + { + rect = TRect( TPoint( controlRect.iBr.iX, controlRect.iTl.iY ), + TPoint( controlRect.iBr.iX + popupRect.Width(), controlRect.iTl.iY + popupRect.Height() ) ); + } + else if ( spaceAbove >= popupRect.Height() ) + { + // 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 ) ); + } + 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() ) ); + } + } + 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() ) ); + } + break; + default: + break; + } + + rect.Move( offset ); + + // if the popup rectangle exceeds the borders of content rectangle, move it. + if ( rect.iTl.iY < contentRect.iTl.iY ) + { + rect.Move( 0, contentRect.iTl.iY - rect.iTl.iY ); + } + if ( rect.iTl.iX < contentRect.iTl.iX ) + { + rect.Move( contentRect.iTl.iX - rect.iTl.iX, 0 ); + } + if ( rect.iBr.iY > contentRect.iBr.iY ) + { + rect.Move( 0, contentRect.iBr.iY - rect.iBr.iY ); + } + if ( rect.iBr.iX > contentRect.iBr.iX ) + { + rect.Move( contentRect.iBr.iX - rect.iBr.iX, 0 ); + } + this->SetRect( rect ); + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiresource/bwins/xn3resourceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiresource/bwins/xn3resourceu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,26 @@ +EXPORTS + ?CacheType@CXnResource@@QBE?AW4TXnCacheType@@XZ @ 1 NONAME ; enum TXnCacheType CXnResource::CacheType(void) const + ?CloneL@CXnResource@@QAEPAV1@XZ @ 2 NONAME ; class CXnResource * CXnResource::CloneL(void) + ?ExternalizeL@CXnResource@@QBEXAAVRWriteStream@@@Z @ 3 NONAME ; void CXnResource::ExternalizeL(class RWriteStream &) const + ?FileName@CXnResource@@QBEABVTDesC16@@XZ @ 4 NONAME ; class TDesC16 const & CXnResource::FileName(void) const + ?GetDataStreamLength@CXnResource@@QBEHXZ @ 5 NONAME ; int CXnResource::GetDataStreamLength(void) const + ?InternalizeL@CXnResource@@QAEXAAVRReadStream@@@Z @ 6 NONAME ; void CXnResource::InternalizeL(class RReadStream &) + ?LockingPolicy@CXnResource@@QBE?AW4TXnLockingPolicy@@XZ @ 7 NONAME ; enum TXnLockingPolicy CXnResource::LockingPolicy(void) const + ?MimeType@CXnResource@@QBE?AVTDataType@@XZ @ 8 NONAME ; class TDataType CXnResource::MimeType(void) const + ?NameSpace@CXnResource@@QBEABVTDesC16@@XZ @ 9 NONAME ; class TDesC16 const & CXnResource::NameSpace(void) const + ?NewL@CXnResource@@SAPAV1@XZ @ 10 NONAME ; class CXnResource * CXnResource::NewL(void) + ?NewLC@CXnResource@@SAPAV1@AAVRReadStream@@@Z @ 11 NONAME ; class CXnResource * CXnResource::NewLC(class RReadStream &) + ?Offset@CXnResource@@QBEIXZ @ 12 NONAME ; unsigned int CXnResource::Offset(void) const + ?ReadStream@CXnResource@@QAEAAVRBufReadStream@@I@Z @ 13 NONAME ; class RBufReadStream & CXnResource::ReadStream(unsigned int) + ?ResourceId@CXnResource@@QBEABVTDesC16@@XZ @ 14 NONAME ; class TDesC16 const & CXnResource::ResourceId(void) const + ?ResourceType@CXnResource@@QBE?AW4TXnResourceType@@XZ @ 15 NONAME ; enum TXnResourceType CXnResource::ResourceType(void) const + ?SetCacheType@CXnResource@@QAEXW4TXnCacheType@@@Z @ 16 NONAME ; void CXnResource::SetCacheType(enum TXnCacheType) + ?SetFileNameL@CXnResource@@QAEXABVTDesC16@@@Z @ 17 NONAME ; void CXnResource::SetFileNameL(class TDesC16 const &) + ?SetLockingPolicy@CXnResource@@QAEXW4TXnLockingPolicy@@@Z @ 18 NONAME ; void CXnResource::SetLockingPolicy(enum TXnLockingPolicy) + ?SetMimeTypeL@CXnResource@@QAEXVTDataType@@@Z @ 19 NONAME ; void CXnResource::SetMimeTypeL(class TDataType) + ?SetNameSpaceL@CXnResource@@QAEXABVTDesC16@@@Z @ 20 NONAME ; void CXnResource::SetNameSpaceL(class TDesC16 const &) + ?SetOffset@CXnResource@@QAEXI@Z @ 21 NONAME ; void CXnResource::SetOffset(unsigned int) + ?SetResourceIdL@CXnResource@@QAEXABVTDesC16@@@Z @ 22 NONAME ; void CXnResource::SetResourceIdL(class TDesC16 const &) + ?SetResourceType@CXnResource@@QAEXW4TXnResourceType@@@Z @ 23 NONAME ; void CXnResource::SetResourceType(enum TXnResourceType) + ?WriteStream@CXnResource@@QAEAAVRBufWriteStream@@I@Z @ 24 NONAME ; class RBufWriteStream & CXnResource::WriteStream(unsigned int) + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiresource/eabi/xn3resourceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiresource/eabi/xn3resourceu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +EXPORTS + _ZN11CXnResource10ReadStreamEj @ 1 NONAME + _ZN11CXnResource11WriteStreamEj @ 2 NONAME + _ZN11CXnResource12InternalizeLER11RReadStream @ 3 NONAME + _ZN11CXnResource12SetCacheTypeE12TXnCacheType @ 4 NONAME + _ZN11CXnResource12SetFileNameLERK7TDesC16 @ 5 NONAME + _ZN11CXnResource12SetMimeTypeLE9TDataType @ 6 NONAME + _ZN11CXnResource13SetNameSpaceLERK7TDesC16 @ 7 NONAME + _ZN11CXnResource14SetResourceIdLERK7TDesC16 @ 8 NONAME + _ZN11CXnResource15SetResourceTypeE15TXnResourceType @ 9 NONAME + _ZN11CXnResource16SetLockingPolicyE16TXnLockingPolicy @ 10 NONAME + _ZN11CXnResource4NewLEv @ 11 NONAME + _ZN11CXnResource5NewLCER11RReadStream @ 12 NONAME + _ZN11CXnResource6CloneLEv @ 13 NONAME + _ZN11CXnResource9SetOffsetEj @ 14 NONAME + _ZNK11CXnResource10ResourceIdEv @ 15 NONAME + _ZNK11CXnResource12ExternalizeLER12RWriteStream @ 16 NONAME + _ZNK11CXnResource12ResourceTypeEv @ 17 NONAME + _ZNK11CXnResource13LockingPolicyEv @ 18 NONAME + _ZNK11CXnResource19GetDataStreamLengthEv @ 19 NONAME + _ZNK11CXnResource6OffsetEv @ 20 NONAME + _ZNK11CXnResource8FileNameEv @ 21 NONAME + _ZNK11CXnResource8MimeTypeEv @ 22 NONAME + _ZNK11CXnResource9CacheTypeEv @ 23 NONAME + _ZNK11CXnResource9NameSpaceEv @ 24 NONAME + _ZTI11CXnResource @ 25 NONAME ; #<TI># + _ZTV11CXnResource @ 26 NONAME ; #<VT># + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiresource/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiresource/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,71 @@ +/* +* 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: ?Description +* +*/ + + +#include <platform_paths.hrh> + +PRJ_PLATFORMS +//DEFAULT +ARMV5 WINSCW +// specify the platforms your component needs to be built for here +// defaults to WINS MARM so you can ignore this if you just build these + + +PRJ_EXPORTS +// Specify the source file followed by its destination here +// copy will be used to copy the source file to its destination +// If there's no destination then the source file will be copied +// to the same name in /epoc32/include +// Example: +/* +/agnmodel/inc/AGMCOMON.H +*/ + +//Exporting new system headers: + +PRJ_MMPFILES +// Specify the .mmp files required for building the important component +// releasables. +xnresource.mmp + +// Specify "tidy" if the component you need to build doesn't need to be +// released. Specify "ignore" if the MMP file exists but should be +// ignored. +// Example: +/* +/agnmodel/group/agnmodel.mmp +#if defined(MARM) +/agnmodel/group/agsvexe.mmp +#endif +*/ + +PRJ_TESTMMPFILES +// specify the .mmp files required for building any test programs here +// Example: +/* +/agnmodel/agtest/T_ATTEND.MMP manual +*/ + +PRJ_TESTEXPORTS +// specify the files to be copied from the source directories to the releasables' +// directories for use with test programs. +// Example: +/* +/agnmodel/inc/agmcomontest.h /epoc32/include/agmcomontest.h +*/ + +// End of File \ No newline at end of file diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiresource/group/xnresource.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiresource/group/xnresource.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +/* +* 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: Project definition for XnResult +* +*/ + + +#include <platform_paths.hrh> + +TARGET xn3resource.dll +TARGETTYPE dll + +VENDORID VID_DEFAULT + +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src +SOURCE xnresource.cpp + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY apmime.lib // MIME-library +LIBRARY bafl.lib +LIBRARY charconv.lib +LANG SC diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/uiresource/src/xnresource.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiresource/src/xnresource.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,415 @@ +/* +* 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: Resource definition of Xuikon Application Theme Management Services. +* See XnResource.h. +* +* +*/ + + +#include "xnresource.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnResource::CXnResource() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnResource::CXnResource() + { + } + +// ----------------------------------------------------------------------------- +// CXnResource::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnResource::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnResource::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnResource* CXnResource::NewL() + { + CXnResource* self = new( ELeave ) CXnResource; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CXnResource::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnResource* CXnResource::NewLC( RReadStream& aStream ) + { + CXnResource* resource = CXnResource::NewL(); + CleanupStack::PushL( resource ); + resource->InternalizeL( aStream ); + return resource; + } + + +// ----------------------------------------------------------------------------- +// CXnResource::CloneL() +// Returns an exact copy of this CXnResource object. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnResource* CXnResource::CloneL() + { + CXnResource* clone = CXnResource::NewL(); + CleanupStack::PushL( clone ); + clone->SetLockingPolicy( iLockingPolicy ); + clone->SetCacheType( iCacheType ); + clone->SetResourceType( iResourceType ); + + clone->SetResourceIdL( *iResourceID ); + clone->SetNameSpaceL( *iNameSpace ); + clone->SetFileNameL( *iFileName ); + clone->SetMimeTypeL( iMimeType ); + + CleanupStack::Pop( clone ); + return clone; + } + +// Destructor +CXnResource::~CXnResource() + { + iWriteStream.Close(); + iReadStream.Close(); + delete iResourceID; + delete iNameSpace; + delete iFileName; + } + + +// ----------------------------------------------------------------------------- +// CXnResource::ExternalizeL(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnResource::ExternalizeL( RWriteStream& aStream ) const + { + aStream.WriteUint32L( iLockingPolicy ); + aStream.WriteUint32L( iCacheType ); + aStream.WriteUint32L( iResourceType ); + + if ( iResourceID ) + { + aStream << *iResourceID; + } + else + { + aStream << KNullDesC; + } + + if ( iNameSpace ) + { + aStream << *iNameSpace; + } + else + { + aStream << KNullDesC; + } + + if ( iFileName ) + { + aStream << *iFileName; + } + else + { + aStream << KNullDesC; + } + + + iMimeType.ExternalizeL(aStream); + + // replacement of unimplemented buffer size + TInt size = 0; + aStream.WriteUint32L( size ); + + aStream.WriteUint32L( iOffset ); + } + +// ----------------------------------------------------------------------------- +// CXnResource::InternalizeL(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnResource::InternalizeL( RReadStream& aStream ) + { + iLockingPolicy = (TXnLockingPolicy)aStream.ReadUint32L(); + iCacheType = (TXnCacheType)aStream.ReadUint32L(); + iResourceType = (TXnResourceType)aStream.ReadUint32L(); + + delete iResourceID; + iResourceID = NULL; + iResourceID = HBufC::NewL(aStream, KMaxFileName ); + + delete iNameSpace; + iNameSpace = NULL; + iNameSpace = HBufC::NewL(aStream, KMaxFileName ); + + delete iFileName; + iFileName = NULL; + iFileName = HBufC::NewL(aStream, KMaxFileName ); + + + iMimeType.InternalizeL(aStream); + + TInt size = aStream.ReadUint32L(); + iOffset = aStream.ReadUint32L(); + } + +// ----------------------------------------------------------------------------- +// CXnResource::SetLockingPolicy(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnResource::SetLockingPolicy( TXnLockingPolicy aLockingPolicy ) + { + iLockingPolicy = aLockingPolicy; + } + +// ----------------------------------------------------------------------------- +// CXnResource::LockingPolicy(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TXnLockingPolicy CXnResource::LockingPolicy() const + { + return iLockingPolicy; + } + +// ----------------------------------------------------------------------------- +// CXnResource::SetCacheType(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnResource::SetCacheType( TXnCacheType aCacheType ) + { + iCacheType = aCacheType; + } + +// ----------------------------------------------------------------------------- +// CXnResource::CacheType() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TXnCacheType CXnResource::CacheType() const + { + return iCacheType; + } + +// ----------------------------------------------------------------------------- +// CXnResource::SetResourceType(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnResource::SetResourceType( TXnResourceType aResourceType ) + { + iResourceType = aResourceType; + } + +// ----------------------------------------------------------------------------- +// CXnResource::ResourceType(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TXnResourceType CXnResource::ResourceType() const + { + return iResourceType; + } + + +// ----------------------------------------------------------------------------- +// CXnResource::SetResourceIdL(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnResource::SetResourceIdL( const TDesC& aResourceId ) + { + delete iResourceID; + iResourceID = NULL; + iResourceID = aResourceId.AllocL(); + } + +// ----------------------------------------------------------------------------- +// CXnResource::ResourceId(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CXnResource::ResourceId() const + { + if ( iResourceID ) + { + return *iResourceID; + } + else + { + return KNullDesC; + } + } + +// ----------------------------------------------------------------------------- +// CXnResource::SetNameSpaceL(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnResource::SetNameSpaceL( const TDesC& aNameSpace ) + { + delete iNameSpace; + iNameSpace = NULL; + iNameSpace = aNameSpace.AllocL(); + } + +// ----------------------------------------------------------------------------- +// CXnResource::NameSpace(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CXnResource::NameSpace() const + { + if ( iNameSpace ) + { + return *iNameSpace; + } + else + { + return KNullDesC; + } + } + +// ----------------------------------------------------------------------------- +// CXnResource::SetFileNameL(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnResource::SetFileNameL( const TDesC& aFileName ) + { + delete iFileName; + iFileName = NULL; + iFileName = aFileName.AllocL(); + } + +// ----------------------------------------------------------------------------- +// CXnResource::FileName(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CXnResource::FileName() const + { + if ( iFileName ) + { + return *iFileName; + } + else + { + return KNullDesC; + } + } + + +// ----------------------------------------------------------------------------- +// CXnResource::SetMimeTypeL(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnResource::SetMimeTypeL( const TDataType aDataType ) + { + iMimeType = aDataType; + } + +// ----------------------------------------------------------------------------- +// CXnResource::MimeType(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TDataType CXnResource::MimeType() const + { + return iMimeType; + } + +// ----------------------------------------------------------------------------- +// CXnResource::WriteStream(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C RBufWriteStream& CXnResource::WriteStream( TUint aOffset ) + { + iWriteStream.Open( *iBuffer, aOffset ); + return iWriteStream; + } + +// ----------------------------------------------------------------------------- +// CXnResource::ReadStream(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C RBufReadStream& CXnResource::ReadStream(TUint aOffset ) + { + // constructing read stream on buffer + iReadStream.Open( *iBuffer, aOffset ); + return iReadStream; + } + +// ----------------------------------------------------------------------------- +// CXnResource::SetOffset(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnResource::SetOffset( TUint aOffset ) + { + iOffset = aOffset; + } + + +// ----------------------------------------------------------------------------- +// CXnResource::Offset(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CXnResource::Offset() const + { + return iOffset; + } + +// ----------------------------------------------------------------------------- +// CXnResource::GetDataStreamLength(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CXnResource::GetDataStreamLength() const + { + TInt len = sizeof( iLockingPolicy ); + len += sizeof(iCacheType); + len += sizeof(iResourceType); + len += iResourceID->Size(); + len += iNameSpace->Size(); + len += iFileName->Size(); + len += sizeof(iMimeType); + len += sizeof(iOffset); + return len; + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/bwins/xn3utilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/bwins/xn3utilsu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,25 @@ +EXPORTS + ?Container@CXnPointerArray@@QAEAAV?$RPointerArray@VCBase@@@@XZ @ 1 NONAME ; class RPointerArray<class CBase> & CXnPointerArray::Container(void) + ??0TTracer@@QAE@XZ @ 2 NONAME ; TTracer::TTracer(void) + ?Find@CXnMap@@QBEPAVCBase@@AAV2@AAVMXnComparator@@@Z @ 3 NONAME ; class CBase * CXnMap::Find(class CBase &, class MXnComparator &) const + ?Equals@MXnComparator@@UAEHAAVCBase@@0@Z @ 4 NONAME ; int MXnComparator::Equals(class CBase &, class CBase &) + ??0CXnType@@IAE@XZ @ 5 NONAME ; CXnType::CXnType(void) + ?Get@CXnMap@@QBEPAVCBase@@AAV2@@Z @ 6 NONAME ; class CBase * CXnMap::Get(class CBase &) const + ?Container@CXnMap@@QAEAAV?$RPointerArray@VCBase@@@@XZ @ 7 NONAME ; class RPointerArray<class CBase> & CXnMap::Container(void) + ?Container@CXnPointerArrayWithOwnership@@QAEAAV?$RPointerArray@VCBase@@@@XZ @ 8 NONAME ; class RPointerArray<class CBase> & CXnPointerArrayWithOwnership::Container(void) + ?NewL@CXnPointerArrayWithOwnership@@SAPAV1@XZ @ 9 NONAME ; class CXnPointerArrayWithOwnership * CXnPointerArrayWithOwnership::NewL(void) + ?NewL@CXnMap@@SAPAV1@PAVMXnComparator@@@Z @ 10 NONAME ; class CXnMap * CXnMap::NewL(class MXnComparator *) + ?NewL@CXnPointerArray@@SAPAV1@XZ @ 11 NONAME ; class CXnPointerArray * CXnPointerArray::NewL(void) + ?NewL@CXnArray@@SAPAV1@XZ @ 12 NONAME ; class CXnArray * CXnArray::NewL(void) + ?NewL@CXnEcomHandler@@SAPAV1@XZ @ 13 NONAME ; class CXnEcomHandler * CXnEcomHandler::NewL(void) + ?PutL@CXnMap@@QAEXPAVCBase@@@Z @ 14 NONAME ; void CXnMap::PutL(class CBase *) + ?PluginsL@CXnEcomHandler@@QAEXVTUid@@ABVTDesC8@@AAVCXnArray@@@Z @ 15 NONAME ; void CXnEcomHandler::PluginsL(class TUid, class TDesC8 const &, class CXnArray &) + ??1TTracer@@QAE@XZ @ 16 NONAME ; TTracer::~TTracer(void) + ?Print@TTracer@@SAXVTPtrC16@@@Z @ 17 NONAME ; void TTracer::Print(class TPtrC16) + ?NewL@CXnType@@SAPAV1@ABVTDesC8@@@Z @ 18 NONAME ; class CXnType * CXnType::NewL(class TDesC8 const &) + ?Container@CXnArray@@QAEAAV?$RArray@PAX@@XZ @ 19 NONAME ; class RArray<void *> & CXnArray::Container(void) + ?ConstructL@CXnType@@IAEXABVTDesC8@@@Z @ 20 NONAME ; void CXnType::ConstructL(class TDesC8 const &) + ??1CXnType@@UAE@XZ @ 21 NONAME ; CXnType::~CXnType(void) + ??0TTracer@@QAE@VTPtrC16@@@Z @ 22 NONAME ; TTracer::TTracer(class TPtrC16) + ?Type@CXnType@@QAEABVTDesC8@@XZ @ 23 NONAME ; class TDesC8 const & CXnType::Type(void) + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/eabi/xn3utilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/eabi/xn3utilsu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +EXPORTS + _ZN13MXnComparator6EqualsER5CBaseS1_ @ 1 NONAME + _ZN14CXnEcomHandler4NewLEv @ 2 NONAME + _ZN14CXnEcomHandler8PluginsLE4TUidRK6TDesC8R8CXnArray @ 3 NONAME + _ZN15CXnPointerArray4NewLEv @ 4 NONAME + _ZN15CXnPointerArray9ContainerEv @ 5 NONAME + _ZN28CXnPointerArrayWithOwnership4NewLEv @ 6 NONAME + _ZN28CXnPointerArrayWithOwnership9ContainerEv @ 7 NONAME + _ZN6CXnMap4NewLEP13MXnComparator @ 8 NONAME + _ZN6CXnMap4PutLEP5CBase @ 9 NONAME + _ZN6CXnMap9ContainerEv @ 10 NONAME + _ZN7CXnType10ConstructLERK6TDesC8 @ 11 NONAME + _ZN7CXnType4NewLERK6TDesC8 @ 12 NONAME + _ZN7CXnType4TypeEv @ 13 NONAME + _ZN7CXnTypeC1Ev @ 14 NONAME + _ZN7CXnTypeC2Ev @ 15 NONAME + _ZN7CXnTypeD0Ev @ 16 NONAME + _ZN7CXnTypeD1Ev @ 17 NONAME + _ZN7CXnTypeD2Ev @ 18 NONAME + _ZN7TTracer5PrintE7TPtrC16 @ 19 NONAME + _ZN7TTracerC1E7TPtrC16 @ 20 NONAME + _ZN7TTracerC1Ev @ 21 NONAME + _ZN7TTracerC2E7TPtrC16 @ 22 NONAME + _ZN7TTracerC2Ev @ 23 NONAME + _ZN7TTracerD1Ev @ 24 NONAME + _ZN7TTracerD2Ev @ 25 NONAME + _ZN8CXnArray4NewLEv @ 26 NONAME + _ZN8CXnArray9ContainerEv @ 27 NONAME + _ZNK6CXnMap3GetER5CBase @ 28 NONAME + _ZNK6CXnMap4FindER5CBaseR13MXnComparator @ 29 NONAME + _ZTI14CXnEcomHandler @ 30 NONAME ; #<TI># + _ZTI15CXnPointerArray @ 31 NONAME ; #<TI># + _ZTI28CXnPointerArrayWithOwnership @ 32 NONAME ; #<TI># + _ZTI6CXnMap @ 33 NONAME ; #<TI># + _ZTI7CXnType @ 34 NONAME ; #<TI># + _ZTI8CXnArray @ 35 NONAME ; #<TI># + _ZTV14CXnEcomHandler @ 36 NONAME ; #<VT># + _ZTV15CXnPointerArray @ 37 NONAME ; #<VT># + _ZTV28CXnPointerArrayWithOwnership @ 38 NONAME ; #<VT># + _ZTV6CXnMap @ 39 NONAME ; #<VT># + _ZTV7CXnType @ 40 NONAME ; #<VT># + _ZTV8CXnArray @ 41 NONAME ; #<VT># + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,29 @@ +/* +* 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: Building information file +* +*/ + + +#include <platform_paths.hrh> + +PRJ_PLATFORMS +ARMV5 WINSCW + + +PRJ_EXPORTS + +PRJ_MMPFILES + +xnutils.mmp diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/group/xnutils.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/group/xnutils.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,60 @@ +/* +* 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: +* +*/ + + +#include <platform_paths.hrh> +#include <platform/mw/aisystemuids.hrh> + +TARGET xn3utils.dll +TARGETTYPE DLL +UID 0x1000008d AI3_UID_UTILS + +VENDORID VID_DEFAULT +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src +SOURCE xnutils.cpp +SOURCE xncomparator.cpp +SOURCE xntype.cpp +SOURCE xnpointerarraywithownership.cpp +SOURCE xnpointerarray.cpp +SOURCE xnarray.cpp +SOURCE xnecomhandler.cpp +SOURCE xnmap.cpp +SOURCE tracer.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../uiengine/inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY bafl.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY egul.lib +LIBRARY fbscli.lib +LIBRARY efsrv.lib +LIBRARY ecom.lib +LIBRARY charconv.lib +LIBRARY flogger.lib + +LANG SC + + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/inc/xnlibraryloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/inc/xnlibraryloader.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,178 @@ +/* +* 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: Loads polymorphic dlls +* +*/ + + + +#ifndef CXNLIBRARYLOADER_H +#define CXNLIBRARYLOADER_H + +// INCLUDES +#include <e32base.h> + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +class CXnPathRepository; +class RFs; +class CXnArray; +class RXnClientRequest; + +// CLASS DECLARATION + +/** +* Locates files from a set of defined paths +* @lib ?library +* @since Series 60 3.1 +*/ +class CXnLibraryLoader : public CBase + { + public: // Constructors and destructor + struct CLibraryItem; + + /** + * Two-phased constructor. + * @param aRFs File server session + */ + IMPORT_C static CXnLibraryLoader* NewL(); + + /** + * DEPRECATED + * Two-phased constructor. + * @param aPathRepository Path repository for handling multiple directories + * @param aRFs File server session + */ + IMPORT_C static CXnLibraryLoader* NewL(CXnPathRepository& aPathRepository, RFs& aRFs); + + /** + * Destructor. + */ + virtual ~CXnLibraryLoader(); + + public: // New functions + /** + * Load libraries by wildcard + * @since Series 60 3.1 + * @param aWildCard Wildcard to search + */ + IMPORT_C void LoadL(const TDesC& aWildCard); + + /** + * Load libraries given by Definition Engine + * @since Series 60 3.1 + * @param aXnClient Client interface to Definition Engine + * @param aAppUid Uid of the current application + */ + IMPORT_C void LoadL(RXnClientRequest& aXnClient, const TUid& aAppUid); + /** + * Get pointers to library functions + * @since Series 60 3.1 + */ + IMPORT_C void Functions(CXnArray& aFunctions) const; + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // New functions + + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CXnLibraryLoader(); + + /** + * 2nd phase constructor. + * @param aRFs File server session + */ + void ConstructL(); + + /** + * DEPRECATED + * 2nd phase constructor. + * @param aPathRepository Path repository for handling multiple directories + * @param aRFs File server session + */ + void ConstructL(CXnPathRepository& aPathRepository, RFs& aRFs); + + /** + * Add a library + * @param aItem Library to add + * @since Series 60 3.1 + */ + TInt AddItem(CLibraryItem* aItem); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + // Path repository, not owned by the loader + CXnPathRepository* iPathRepository; + // array of libraries + RPointerArray<CLibraryItem> iLibraries; + // file server session + RFs* iRFs; + }; + +#endif // CXnLIBRARYLOADER_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/inc/xnpathrepository.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/inc/xnpathrepository.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,149 @@ +/* +* 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: Locates files from a set of defined paths +* +*/ + + + +#ifndef CXNPATHREPOSITORY_H +#define CXNPATHREPOSITORY_H + +// INCLUDES +#include <e32base.h> + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +class RFs; +// CLASS DECLARATION + +/** +* Locates files from a set of defined paths +* @lib ?library +* @since Series 60 3.1 +*/ +class CXnPathRepository : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aRFs File server session + */ + IMPORT_C static CXnPathRepository* NewL(RFs& aRFs); + + /** + * Destructor. + */ + virtual ~CXnPathRepository(); + + public: // New functions + /** + * Add a search path + * @since Series 60 3.1 + * @param aPath Path to add + * @exception KXnErrAddPathFailed Adding path to repository failed. + */ + IMPORT_C void AddPathL(const TDesC& aPath); + /** + * Locate a file and build a full path to the file. The path search order is last-in-first-out, the last added path is searched first. + * @since Series 60 3.1 + * @param aFileName Name of the file to locate + * @return Full path of the file. Caller must delete the allocated pointer. + */ + IMPORT_C HBufC* FindFileL(const TDesC& aFileName); + /** + * Get paths stored in the repository. Ownership is not transferred. The paths are ordered first-in-first-out, the last added path is last in the array. + * @since Series 60 3.1 + * @return Paths in the repository + */ + IMPORT_C RPointerArray<HBufC>& Paths(); + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // New functions + + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CXnPathRepository(); + + /** + * 2nd phase constructor. + * @param aRFs File server session + */ + void ConstructL(RFs& aRFs); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + // search paths to use + RPointerArray<HBufC> iPaths; + // File server session + RFs* iRFs; + }; + +#endif // CXnPATHREPOSITORY_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/inc/xnpointerarraywithownership.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/inc/xnpointerarraywithownership.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,143 @@ +/* +* 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: Heap-allocated pointer array which owns its objects +* +*/ + + + +#ifndef CXNPOINTERARRAYWITHOWNERSHIP_H +#define CXNPOINTERARRAYWITHOWNERSHIP_H + +// INCLUDES +#include <e32base.h> + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +// CLASS DECLARATION + +/** +* Heap-allocated pointer array which owns its objects +* @since Series 60 3.1 +*/ +class CXnPointerArrayWithOwnership : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CXnPointerArrayWithOwnership* NewL(); + + /** + * Destructor. + */ + virtual ~CXnPointerArrayWithOwnership(); + + public: // New functions + + /** + * Get the underlying container + * @since Series 60 3.1 + * @return Underlying container + */ + + IMPORT_C RPointerArray<CBase>& Container(); + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // New functions + + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CXnPointerArrayWithOwnership(); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + // ?one_line_short_description_of_data + //?data_declaration; + // Reserved pointer for future extension + //TAny* iReserved; + // Internal container + RPointerArray<CBase> iContainer; + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + + }; + +#endif // CXnPointerARRAYWITHOWNERSHIP_H + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/src/tracer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/src/tracer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,181 @@ +/* +* 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 "tracer.h" + +#ifdef __WINS__ +// Yes, I know this does not compile for Arm, but at least we can use it in Wins +static TInt ii; +#endif + +#ifdef FILE_LOGGING_SUPPORT +_LIT(KTracerLogFilePath, "c:\\logs\\xn3trace.log"); +#endif + +EXPORT_C TTracer::TTracer() +{ +#ifdef FILE_LOGGING_SUPPORT + RFs fs; + TInt err(fs.Connect()); + if (KErrNone == err) + { + RFile file; + file.Replace(fs, KTracerLogFilePath, EFileWrite); + file.Close(); + fs.Close(); + } +#endif + +#ifdef __WINS__ + ii = 0; +#endif +} + +EXPORT_C TTracer::TTracer(TPtrC aString) +{ +#ifdef FILE_LOGGING_SUPPORT + TInt err (iFs.Connect()); + if (KErrNone == err) + { + RFile file; + err (file.Open(iFs, KTracerLogFilePath, EFileWrite)); + if (KErrNone == err) + { + TFileText tfile; + tfile.Set(file); +#endif + + TBuf<255> str=_L(""); + TTime currentTime; // set current time to now + currentTime.HomeTime(); + TBuf<25> strCurTime; + TRAP_IGNORE( currentTime.FormatL(strCurTime, _L("%H:%T:%S:%*C3 ")) ); + + str.Copy(strCurTime); + +#ifdef __WINS__ + for(int i=0;i<ii;i++) + { + str.Append(_L(" ")); + } +#else + str.Append(_L(" ")); +#endif + + iString = aString; + str.Append(_L("Enter: ")); + str.Append(iString); + +#ifdef FILE_LOGGING_SUPPORT + str.Append(_L("\r")); // carriage return + tfile.Seek(ESeekEnd); + tfile.Write(str); + } + file.Close(); + } +#endif + +#ifdef __WINS__ + ii++; +#endif +} + + +EXPORT_C TTracer::~TTracer() +{ +#ifdef __WINS__ + if(ii > 0) + { + --ii; +#endif + +#ifdef FILE_LOGGING_SUPPORT + RFile file; + TInt err (file.Open(iFs, KTracerLogFilePath, EFileWrite)); + if (KErrNone == err) + { + TFileText tfile; + tfile.Set(file); +#endif + + TBuf<255> str=_L(""); + TTime currentTime; // set current time to now + currentTime.HomeTime(); + TBuf<25> strCurTime; + TRAP_IGNORE( currentTime.FormatL(strCurTime, _L("%H:%T:%S:%*C3 ")) ); + + str.Copy(strCurTime); + +#ifdef __WINS__ + for(int i=0;i<ii;i++) + { + str.Append(_L(" ")); + } +#else + str.Append(_L(" ")); +#endif + str.Append(_L("Leave: ")); + str.Append(iString); + +#ifdef FILE_LOGGING_SUPPORT + str.Append(_L("\r")); // carriage return + tfile.Seek(ESeekEnd); + tfile.Write(str); + } + file.Close(); + iFs.Close(); +#endif +#ifdef __WINS__ + } +#endif +} + +EXPORT_C void TTracer::Print(TPtrC aString) +{ +#ifdef FILE_LOGGING_SUPPORT + RFs fs; + TInt err(fs.Connect()); + if (KErrNone == err) + { + RFile file; + TInt err(file.Open(fs, KTracerLogFilePath, EFileWrite)); + if (KErrNone == err) + { + TFileText tfile; + tfile.Set(file); +#endif + TBuf<255> str=_L(""); + TTime currentTime; // set current time to now + currentTime.HomeTime(); + TBuf<25> strCurTime; + TRAP_IGNORE( currentTime.FormatL(strCurTime, _L("%H:%T:%S:%*C3 ")) ); + + str.Copy(strCurTime); + + str.Append(_L(" ")); + str.Append(aString); +#ifdef FILE_LOGGING_SUPPORT + str.Append(_L("\r")); // carriage return + tfile.Seek(ESeekEnd); + tfile.Write(str); + } + file.Close(); + fs.Close(); + } +#endif +} + diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/src/xnarray.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/src/xnarray.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,144 @@ +/* +* 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: Heap-allocated array +* +*/ + + + +// INCLUDE FILES +#include "xnarray.h" +#include "xnpanic.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +//?type ?function_name( +// ?arg_type arg, // ?description +// ?arg_type arg) // ?description +// { + +// ?code // ?comment + + // ?comment +// ?code +// } + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnArray::CXnArray +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnArray::CXnArray() + { + } + +// ----------------------------------------------------------------------------- +// CXnArray::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnArray::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnArray::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnArray* CXnArray::NewL() + { + CXnArray* self = new( ELeave ) CXnArray; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// Destructor +CXnArray::~CXnArray() + { + iContainer.Reset(); + } +// ----------------------------------------------------------------------------- +// CXnArray::Container +// Get the underlying container +// ----------------------------------------------------------------------------- +EXPORT_C RArray<TAny*>& CXnArray::Container() + { + return iContainer; + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// ?function_name implements... +// ?implementation_description. +// Returns: ?value_1: ?description +// ?value_n: ?description +// ?description +// ----------------------------------------------------------------------------- +// +//?type ?function_name( +// ?arg_type arg, // ?description +// ?arg_type arg ) // ?description +// { + +// ?code + +// } + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/src/xncomparator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/src/xncomparator.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,33 @@ +/* +* 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: Compares two objects for equality. +* +*/ + +// INCLUDE FILES +#include "xncomparator.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// MXnComparator::Equals +// Compares two objects +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool MXnComparator::Equals(CBase& /*aItem1*/, CBase& /*aItem2*/) + { + return EFalse; + } + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/src/xnecomhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/src/xnecomhandler.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,265 @@ +/* +* 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: Handles ecom plugins +* +*/ + + + +// INCLUDE FILES +#include "xnecomhandler.h" +#include "xnpanic.h" +#include "xnarray.h" +#include "xnpointerarraywithownership.h" +#include <utf.h> +#include <ecom/ecom.h> +#include <ecom/implementationinformation.h> +#include <f32file.h> + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +/** +* A struct used for holding an implementation pointer and notifying ecom of implementation destruction +* @since Series 90 2.0 +*/ +struct CXnEcomHandler::CEcomItem : public CBase + { + CEcomItem(TUid aInterfaceUid, CBase* aPluginImpl, TUid aDestructorId) : iInterfaceUid(aInterfaceUid), iPluginImpl(aPluginImpl), iDestructorId(aDestructorId) + { + } + // plugin interface id + TUid iInterfaceUid; + // plugin implementation pointer + CBase* iPluginImpl; + // ecom destructor id + TUid iDestructorId; + // plugin type + HBufC8* iType; + // destructor + ~CEcomItem() + { + delete iPluginImpl; + delete iType; + REComSession::DestroyedImplementation(iDestructorId); + } + }; + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +//?type ?function_name( +// ?arg_type arg, // ?description +// ?arg_type arg) // ?description +// { + +// ?code // ?comment + + // ?comment +// ?code +// } + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnEcomHandler::CXnEcomHandler +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnEcomHandler::CXnEcomHandler() + { + } + +// ----------------------------------------------------------------------------- +// CXnEcomHandler::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnEcomHandler::ConstructL() + { + } + + +// ----------------------------------------------------------------------------- +// CXnEcomHandler::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnEcomHandler* CXnEcomHandler::NewL() + { + CXnEcomHandler* self = new( ELeave ) CXnEcomHandler; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// Destructor +CXnEcomHandler::~CXnEcomHandler() + { + iPlugins.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// CXnEcomHandler::PluginsL +// Get pointers to plugins +// ----------------------------------------------------------------------------- +EXPORT_C void CXnEcomHandler::PluginsL(TUid aInterfaceUid, const TDesC8& aType, CXnArray& aFunctions) + { + TBool cached = EFalse; + for (TInt i = iPlugins.Count() - 1 ; i >= 0; --i) + { + CEcomItem* tmp = iPlugins[i]; + if (tmp->iInterfaceUid == aInterfaceUid + && *(tmp->iType) == aType) + { + cached = ETrue; + if(aFunctions.Container().Append(tmp->iPluginImpl) != KErrNone) + { + User::Leave(KXnErrAppendingPluginFailed); + } + } + } + if (cached) + { + return; + } + HBufC8* defaultData = aType.AllocL(); + CleanupStack::PushL(defaultData); + TEComResolverParams resolverParams; + resolverParams.SetDataType(*defaultData); + RImplInfoPtrArray implInfoArray; + CXnPointerArrayWithOwnership* safeArray = CXnPointerArrayWithOwnership::NewL(); + CleanupStack::PushL(safeArray); + REComSession::ListImplementationsL(aInterfaceUid, resolverParams, implInfoArray); +// REComSession::ListImplementationsL(aInterfaceUid, implInfoArray); + TInt count = implInfoArray.Count(); + for (TInt i = implInfoArray.Count() - 1; i >= 0; --i) + { + CImplementationInformation* impl = implInfoArray[i]; + (safeArray->Container()).Insert(impl, 0); + } + if ((safeArray->Container()).Count() != count) + { + (safeArray->Container()).Reset(); + implInfoArray.ResetAndDestroy(); + User::Leave(KErrNoMemory); + } + implInfoArray.Reset(); + for (TInt i = safeArray->Container().Count() - 1; i >= 0; --i) + { + CImplementationInformation* impl = static_cast<CImplementationInformation*>(safeArray->Container()[i]); + TUid dtorIdKey; + CBase* plugin = (CBase*) REComSession::CreateImplementationL(impl->ImplementationUid(), dtorIdKey); + CleanupStack::PushL(plugin); + CEcomItem* tmp = new (ELeave) CEcomItem(aInterfaceUid, plugin, dtorIdKey); + CleanupStack::PushL(tmp); + tmp->iType = aType.AllocL(); + //tmp->iType = impl->DataType().AllocL(); + if(iPlugins.Append(tmp) != KErrNone) + { + User::Leave(KXnErrAppendingPluginFailedAgain); + } + CleanupStack::Pop(tmp); + CleanupStack::Pop(plugin); + } + for (TInt i = iPlugins.Count() - 1 ; i >= 0; --i) + { + CEcomItem* tmp = iPlugins[i]; + if (tmp->iInterfaceUid == aInterfaceUid + && *(tmp->iType) == aType) + { + cached = ETrue; + if(aFunctions.Container().Append(tmp->iPluginImpl) != KErrNone) + { + User::Leave(KXnErrAppendingPluginImplFailed); + } + } + } + CleanupStack::PopAndDestroy(safeArray); + CleanupStack::PopAndDestroy(defaultData); + } + +// ----------------------------------------------------------------------------- +// ?classname::?member_function +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +//?type ?classname::?member_function( +// ?arg_type arg, +// ?arg_type arg ) +// { + +// ?code + +// } + + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// ?function_name implements... +// ?implementation_description. +// Returns: ?value_1: ?description +// ?value_n: ?description +// ?description +// ----------------------------------------------------------------------------- +// +//?type ?function_name( +// ?arg_type arg, // ?description +// ?arg_type arg ) // ?description +// { + +// ?code + +// } + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/src/xnmap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/src/xnmap.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -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: Associative container. +* +*/ + + + +// INCLUDE FILES +#include "xnmap.h" +#include "xncomparator.h" +#include "xnpanic.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +//?type ?function_name( +// ?arg_type arg, // ?description +// ?arg_type arg) // ?description +// { + +// ?code // ?comment + + // ?comment +// ?code +// } + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnMap::CXnMap +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnMap::CXnMap() : iContainer(4) + { + } + +// ----------------------------------------------------------------------------- +// CXnMap::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnMap::ConstructL(MXnComparator* aComparatorFunctor) + { + iComparator = aComparatorFunctor; + } + +// ----------------------------------------------------------------------------- +// CXnMap::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnMap* CXnMap::NewL(MXnComparator* aComparatorFunctor) + { + CXnMap* self = new( ELeave ) CXnMap; + + CleanupStack::PushL( self ); + self->ConstructL(aComparatorFunctor); + CleanupStack::Pop(); + + return self; + } + + +// Destructor +CXnMap::~CXnMap() + { + delete iComparator; + iContainer.ResetAndDestroy(); + } +// ----------------------------------------------------------------------------- +// CXnMap::PutL +// Finds an equal object in the map. If found, destroys it and +// replaces it +// with the object given as a parameter. If not found, inserts +// the parameter object to the map. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnMap::PutL(CBase* aObject) + { + CBase* tmp = Get(*aObject); + if (tmp == aObject) + { + // object already in the map, do nothing + return; + } + if (tmp != NULL) + { + // if an equal object is already in the map, replace it + TInt index = iContainer.Find(tmp); + // add new object + TInt error = iContainer.Append(aObject); + if (error != KErrNone) + { + User::Leave(KXnErrAppendingMapItemFailed_1); + } + // remove old object + delete tmp; + iContainer.Remove(index); + return; + } + // object is not in the map, insert it + TInt err = iContainer.Append(aObject); + if (err != KErrNone) + { + User::Leave(KXnErrAppendingMapItemFailed_2); + } + } +// ----------------------------------------------------------------------------- +// CXnMap::Get +// Finds an object that is equal to the parameter. If found, +// returns the object. If not found, returns NULL. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C CBase* CXnMap::Get(CBase& aObject) const + { + TUint containerCount = iContainer.Count(); + CBase* returnValue = NULL; + for (TUint i = 0; i < containerCount; ++i) + { + CBase* tmp = iContainer[i]; + if (iComparator->Equals(aObject, *tmp)) + { + returnValue = tmp; + break; + } + } + return returnValue; + } + +// ----------------------------------------------------------------------------- +// CXnMap::Find +// Finds an object that is equal to the parameter. If found, +// returns the object. If not found, returns NULL. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C CBase* CXnMap::Find(CBase& aObject, MXnComparator& aComparator) const + { + TUint containerCount = iContainer.Count(); + CBase* returnValue = NULL; + for (TUint i = 0; i < containerCount; ++i) + { + CBase* tmp = iContainer[i]; + if (aComparator.Equals(aObject, *tmp)) + { + returnValue = tmp; + break; + } + } + return returnValue; + } + + +// ----------------------------------------------------------------------------- +// CXnMap::Container +// Gets access to the underlying container +// ----------------------------------------------------------------------------- +EXPORT_C RPointerArray<CBase>& CXnMap::Container() + { + return iContainer; + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// ?function_name implements... +// ?implementation_description. +// Returns: ?value_1: ?description +// ?value_n: ?description +// ?description +// ----------------------------------------------------------------------------- +// +//?type ?function_name( +// ?arg_type arg, // ?description +// ?arg_type arg ) // ?description +// { + +// ?code + +// } + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/src/xnpointerarray.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/src/xnpointerarray.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,144 @@ +/* +* 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: Heap-allocated pointer array +* +*/ + + + +// INCLUDE FILES +#include "xnpointerarray.h" +#include "xnpanic.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +//?type ?function_name( +// ?arg_type arg, // ?description +// ?arg_type arg) // ?description +// { + +// ?code // ?comment + + // ?comment +// ?code +// } + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnPointerArray::CXnPointerArray +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnPointerArray::CXnPointerArray() + { + } + +// ----------------------------------------------------------------------------- +// CXnPointerArray::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnPointerArray::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnPointerArray::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnPointerArray* CXnPointerArray::NewL() + { + CXnPointerArray* self = new( ELeave ) CXnPointerArray; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// Destructor +CXnPointerArray::~CXnPointerArray() + { + iContainer.Reset(); + } +// ----------------------------------------------------------------------------- +// CXnPointerArray::Container +// Get the underlying container +// ----------------------------------------------------------------------------- +EXPORT_C RPointerArray<CBase>& CXnPointerArray::Container() + { + return iContainer; + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// ?function_name implements... +// ?implementation_description. +// Returns: ?value_1: ?description +// ?value_n: ?description +// ?description +// ----------------------------------------------------------------------------- +// +//?type ?function_name( +// ?arg_type arg, // ?description +// ?arg_type arg ) // ?description +// { + +// ?code + +// } + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/src/xnpointerarraywithownership.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/src/xnpointerarraywithownership.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,144 @@ +/* +* 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: Heap-allocated pointer array which owns its objects +* +*/ + + + +// INCLUDE FILES +#include "xnpointerarraywithownership.h" +#include "xnpanic.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +//?type ?function_name( +// ?arg_type arg, // ?description +// ?arg_type arg) // ?description +// { + +// ?code // ?comment + + // ?comment +// ?code +// } + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnPointerArrayWithOwnership::CXnPointerArrayWithOwnership +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnPointerArrayWithOwnership::CXnPointerArrayWithOwnership() + { + } + +// ----------------------------------------------------------------------------- +// CXnPointerArrayWithOwnership::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnPointerArrayWithOwnership::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnPointerArrayWithOwnership::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnPointerArrayWithOwnership* CXnPointerArrayWithOwnership::NewL() + { + CXnPointerArrayWithOwnership* self = new( ELeave ) CXnPointerArrayWithOwnership; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// Destructor +CXnPointerArrayWithOwnership::~CXnPointerArrayWithOwnership() + { + iContainer.ResetAndDestroy(); + } +// ----------------------------------------------------------------------------- +// CXnPointerArrayWithOwnership::Container +// Get the underlying container +// ----------------------------------------------------------------------------- +EXPORT_C RPointerArray<CBase>& CXnPointerArrayWithOwnership::Container() + { + return iContainer; + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// ?function_name implements... +// ?implementation_description. +// Returns: ?value_1: ?description +// ?value_n: ?description +// ?description +// ----------------------------------------------------------------------------- +// +//?type ?function_name( +// ?arg_type arg, // ?description +// ?arg_type arg ) // ?description +// { + +// ?code + +// } + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/src/xntype.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/src/xntype.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,146 @@ +/* +* 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: Type object used for RTTI. +* +*/ + + + +// INCLUDE FILES +#include "xntype.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +//?type ?function_name( +// ?arg_type arg, // ?description +// ?arg_type arg) // ?description +// { + +// ?code // ?comment + + // ?comment +// ?code +// } + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnType::CXnType +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnType::CXnType() + { + } + +// ----------------------------------------------------------------------------- +// CXnType::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnType::ConstructL(const TDesC8& aType) + { + iType = &aType; + } + +// ----------------------------------------------------------------------------- +// CXnType::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CXnType* CXnType::NewL(const TDesC8& aType) + { + CXnType* self = new( ELeave ) CXnType; + + CleanupStack::PushL( self ); + self->ConstructL(aType); + CleanupStack::Pop(); + + return self; + } + + +// Destructor +EXPORT_C CXnType::~CXnType() + { +// delete iType; + } + +// ----------------------------------------------------------------------------- +// CXnType::Type +// Get the type identifier +// ----------------------------------------------------------------------------- +EXPORT_C const TDesC8& CXnType::Type() + { + return *iType; + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// ?function_name implements... +// ?implementation_description. +// Returns: ?value_1: ?description +// ?value_n: ?description +// ?description +// ----------------------------------------------------------------------------- +// +//?type ?function_name( +// ?arg_type arg, // ?description +// ?arg_type arg ) // ?description +// { + +// ?code + +// } + + +// End of File diff -r 000000000000 -r f72a12da539e idlehomescreen/xmluirendering/utils/src/xnutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/utils/src/xnutils.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,33 @@ +/* +* 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: DLL entry point +* +*/ + + +#include <e32base.h> +// ----------------------------------------------------------------------------- +// E32Dll implements the Symbian OS dll entry point +// Needed for EKA1 kernel only +// ----------------------------------------------------------------------------- +// +#ifndef EKA2 +GLDEF_C TInt E32Dll( + TDllReason) // ?description + { + + return KErrNone; + + } +#endif diff -r 000000000000 -r f72a12da539e layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/layers.sysdef.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,25 @@ +<?xml version="1.0"?> +<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [ + <!ENTITY layer_real_source_path "sf/app/homescreen" > +]> + +<SystemDefinition name="homescreen" schema="1.4.0"> + <systemModel> + + + <layer name="app_layer"> + <module name="homescreen"> + <unit unitID="hs.homescreen" mrp="" bldFile="&layer_real_source_path;/group" name="homescreen" /> + </module> + </layer> + + <layer name="unit_test_layer"> + <module name="homescreen_unit_tests"> + <unit unitID="hsdo.wmunit.test" mrp="" bldFile="&layer_real_source_path;/widgetmanager/tsrc/wmunittest/group" name="wmunit.test" /> + </module> + </layer> + + </systemModel> +</SystemDefinition> + + diff -r 000000000000 -r f72a12da539e menufw/cenrep/keys_matrix.xls Binary file menufw/cenrep/keys_matrix.xls has changed diff -r 000000000000 -r f72a12da539e menufw/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project menufw +* +*/ + + +#include <platform_paths.hrh> + +#include "../hierarchynavigator/group/bld.inf" +#include "../menufwui/group/bld.inf" +#include "../menusuites/group/bld.inf" + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// ../rom/menufw_stub.iby CORE_APP_LAYER_IBY_EXPORT_PATH(menufw_stub.iby) + +PRJ_MMPFILES +#ifdef _MATRIX_MENU_INCLUDE_TEST_CONTENT +#include "../sis/internal/tsrc/iad_testing/group/bld.inf" +#endif + +PRJ_EXTENSIONS +#ifndef _MATRIX_MENU_INCLUDE_TEST_CONTENT +START EXTENSION app-services/buildstubsis +OPTION SISNAME menufw_stub +OPTION SRCDIR ../sis +END +#endif \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project hierarchynavigator +* +*/ + + +#include <platform_paths.hrh> + +#include "../hnutilities/group/bld.inf" +#include "../hnpresentationmodel/group/bld.inf" +#include "../hnmetadatamodel/group/bld.inf" +#include "../hnengine/group/bld.inf" + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/hierarchynavigator.iby CORE_APP_LAYER_IBY_EXPORT_PATH(hierarchynavigator.iby) diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/bwins/hnengineu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/bwins/hnengineu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,9 @@ +EXPORTS + ?HandleRequestL@CHnEngine@@UAEXABVCLiwGenericParamList@@PAV2@@Z @ 1 NONAME ; void CHnEngine::HandleRequestL(class CLiwGenericParamList const &, class CLiwGenericParamList *) + ?InitializeL@CHnEngine@@UAEHAAVCLiwGenericParamList@@@Z @ 2 NONAME ; int CHnEngine::InitializeL(class CLiwGenericParamList &) + ?LoadSuitesFromUriL@CHnEngine@@UAEXABVTDesC8@@@Z @ 3 NONAME ; void CHnEngine::LoadSuitesFromUriL(class TDesC8 const &) + ?NewL@CHnEngine@@SAPAV1@AAVMHnControllerInterface@@@Z @ 4 NONAME ; class CHnEngine * CHnEngine::NewL(class MHnControllerInterface &) + ?NewLC@CHnEngine@@SAPAV1@AAVMHnControllerInterface@@@Z @ 5 NONAME ; class CHnEngine * CHnEngine::NewLC(class MHnControllerInterface &) + ?ResetModelsL@CHnEngine@@UAEXXZ @ 6 NONAME ; void CHnEngine::ResetModelsL(void) + ?TriggerHnEventL@CHnEngine@@UAEHHHPAVCLiwGenericParamList@@@Z @ 7 NONAME ; int CHnEngine::TriggerHnEventL(int, int, class CLiwGenericParamList *) + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/eabi/hnengineu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/eabi/hnengineu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,10 @@ +EXPORTS + _ZN9CHnEngine11InitializeLER20CLiwGenericParamList @ 1 NONAME + _ZN9CHnEngine12ResetModelsLEv @ 2 NONAME + _ZN9CHnEngine14HandleRequestLERK20CLiwGenericParamListPS0_ @ 3 NONAME + _ZN9CHnEngine15TriggerHnEventLEiiP20CLiwGenericParamList @ 4 NONAME + _ZN9CHnEngine18LoadSuitesFromUriLERK6TDesC8 @ 5 NONAME + _ZN9CHnEngine4NewLER22MHnControllerInterface @ 6 NONAME + _ZN9CHnEngine5NewLCER22MHnControllerInterface @ 7 NONAME + _ZThn8_N9CHnEngine15TriggerHnEventLEiiP20CLiwGenericParamList @ 8 NONAME ; #<thunk># + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project hnengine +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/hncontrollerinterface.h |../../../inc/hncontrollerinterface.h +../inc/hnengine.h |../../../inc/hnengine.h +../inc/hninterface.h |../../../inc/hninterface.h +../inc/hninstallnotifier.h |../../../inc/hninstallnotifier.h +../inc/hneventgenerator.h |../../../inc/hneventgenerator.h +../inc/menudebug.h |../../../inc/menudebug.h + + +PRJ_MMPFILES +hnengine.mmp + +PRJ_TESTMMPFILES +#ifdef _MATRIX_MENU_INCLUDE_TEST_CONTENT +#include "../internal/test/group/bld.inf" +#endif diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/group/hnengine.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/group/hnengine.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project hierarchy navigator engine +* +*/ + + +#include <platform_paths.hrh> +#include <data_caging_paths.hrh> + +TARGET hnengine.dll +TARGETTYPE dll + +UID 0x1000008d 0x2000F8C5 + +CAPABILITY CAP_GENERAL_DLL + + + +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE hnengine.cpp +SOURCE hninstallnotifier.cpp + +USERINCLUDE ../inc + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE ../../../inc + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY efsrv.lib +LIBRARY hnmetadatamodel.lib +LIBRARY hnpresentationmodel.lib +LIBRARY liwservicehandler.lib +LIBRARY xmlenginedom.lib +LIBRARY inetprotutil.lib // for parsing message URI +LIBRARY hnutilities.lib +LIBRARY centralrepository.lib +LIBRARY eikcoctl.lib +LIBRARY HWRMLightClient.lib +LIBRARY avkon.lib + +LIBRARY eikcore.lib // for error info notes +LIBRARY cone.lib // for error info notes +LIBRARY apgrfx.lib +#ifdef _MATRIX_MENU_TRACE_PERFORMANCE +LIBRARY flogger.lib +#else +DEBUGLIBRARY flogger.lib +#endif + + + +// End of file + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/inc/hncontrollerinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/inc/hncontrollerinterface.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef HNCONTROLLERINTERFACE_H +#define HNCONTROLLERINTERFACE_H + +#include "hnsuiteobserver.h" + +class CLiwGenericParamList; + +/** + * @ingroup group_hnengine + * User interface refresh type + */ +enum THnUiRefreshType + { + ERefreshSuite, + ERefreshToolbar, + EStartEditMode, + EStopEditMode, + EZoomLarge, + EZoomSmall, + EZoomNormal, + EForegroundGain, + EBackgroundGain, + ELightOn, + ELightOff, + ERemoveLiwObjects + }; + + +/** + * @ingroup group_hnengine + * UI refresh observer. The implementing class can be notified about the ui being refreshed. + * + * @lib hnengine + * @since S60 v3.2 + */ +class MHnControllerInterface : public MHnSuiteObserver + { +public: + + /** + * Called when the ui needs to be refreshed, + * for a reason indicated in aRefreshType. + * + * @since S60 v3.2 + * @param aRefreshType Defines reason for refresh. + */ + virtual void NotifyUiRefreshL( const THnUiRefreshType aRefreshType ) = 0; + + /** + * Trigger appropriate action on suite model. + * + * @param aCustomSuiteEvent Event that is associated + * with the lifecycle of a suite + * @param aModel Suite model on that custom event should be performed. + */ + virtual void HandleSuiteEventL ( THnCustomSuiteEvent aCustomSuiteEvent, + CHnSuiteModel *aModel ) = 0; + + /** + * Whenever an action for extension manager occurs it invokes + * this method to execute one, passing the information needed + * by extension manager about the action as a parameters. + * + * @param aUid UID of the ECom plugin's. + * @param aCommand Command which has to be executed on the plugin. + * Request to the Service. + * @param aEventParamList List of the event parameters needed to + * execute action. Extention Manager is its owner. + * @return Number representing error code. + */ + virtual TInt ExecuteExtensionActionL( const TUid aUid , const TDesC& aCommand, + CLiwGenericParamList* aEventParamList ) = 0; + }; + +#endif //HNCONTROLLERINTERFACE_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/inc/hndatachangenotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/inc/hndatachangenotifier.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef C_HNDATACHANGENOTIFIER_H +#define C_HNDATACHANGENOTIFIER_H + +#include "hndatachangeobserver.h" + + +/** + * @ingroup group_hnengine + * Data change notifier interface. + * + * @lib hnengine + * @since S60 v5.0 + */ +class MHnDataChangeNotifier + { + public: + + /** + * Subscribes observer. + * + * @since S60 v5.0 + * @param aObserv Observer to HNEngine. + */ + virtual void SubscribeL( CHnDataChangeObserver* aObserv ) = 0; + }; + + +#endif // C_HNDATACHANGENOTIFIER_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/inc/hndatachangeobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/inc/hndatachangeobserver.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef C_HNDATACHANGEOBSERVER_H +#define C_HNDATACHANGEOBSERVER_H + +class CHnItemId; + +/** + * @ingroup group_hnengine + * Data change observer interface. It is used to notify the implementing class that something in the database has been changed. + * + * @lib hnengine + * @since S60 v5.0 + */ +NONSHARABLE_CLASS(CHnDataChangeObserver) : public CBase + { + public: + + /** + * DataChangeL is called when sth in database was changed. + * @since S60 v5.0 + * @param aItemIds Array with ItemIds of changed entries. + */ + virtual void DataChangedL( RPointerArray< CHnItemId >& aItemIds ) = 0; + }; + + +#endif // C_HNDATACHANGEOBSERVER_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/inc/hnengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/inc/hnengine.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,473 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNENGINE_H +#define C_HNENGINE_H + +#include <e32base.h> +#include <eikenv.h> +#include <hwrmlight.h> + +#include "hnglobals.h" +#include "hninterface.h" +#include "hnmdmodel.h" +#include "hninstallnotifier.h" + +class CHnMdModel; +class CHnSuiteModelContainer; +class MHnControllerInterface; +class MHnSuiteObserver; + +/** + * @ingroup group_hnengine + * Hierarchy Navigator engine - used by Multimedia Menu + * to fetch data models. The most commonly used exported method is TriggerHnEventL, + * which offers event execution for the framework. This functionality is implemented + * through the MHnEventGenerator interface. The class owns the meta data model ( CHnMdModel ) + * and suite container ( CHnSuiteModelContainer ) to manage them. The engine manages + * the model by processing model events ( HandleModelEventL ) or reseting the models + * ( ResetModelsL ). + * + * @lib hnengine + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CHnEngine ) : public CHnInterface, + public MHnMdModelEventObserver, + public MHnInstallNotifierCallback, + public MHWRMLightObserver + { +public: + /** + * Standard factory method. + * + * @since S60 v5.0 + * @param aController Controller handler. + * @return Fully constructed object. + */ + IMPORT_C static CHnEngine* NewL( MHnControllerInterface& aController ); + + /** + * Standard factory method. + * + * @since S60 v5.0 + * @param aController Controller handler. + * @return Fully constructed object. + */ + IMPORT_C static CHnEngine* NewLC( MHnControllerInterface& aController ); + + /** + * Standard C++ destructor. + * + * @since S60 v5.0 + */ + ~CHnEngine(); + + // from CHnInterface + + /** + * Fetches and constructs data structres, needed by Multimedia + * Menu to display suites. + * + * @since S60 v5.0 + * @return Filled suite model object from the stack. + */ + CHnSuiteModel* GetLastSuiteModelL(); + + /** + * Fetches and constructs data structres, needed by Multimedia + * Menu to display suites. + * + * @since S60 v5.0 + * @return Filled suite model object from the stack. + */ + CHnSuiteModel* GetParentSuiteModelL(); + + /** + * Get count of suite models on the stack. + * + * @since S60 v5.0 + * @return Count of suite models on the stack. + */ + virtual TInt GetSuiteModelsCountL(); + + /** + * Checks if suite model is loaded. + * + * @since S60 v5.0 + * @return ETrue if suite model is loaded, otherwise EFalse. + */ + TBool SuiteModelLoadedL( TInt aId ); + + /** + * Loads suite hierarchy specified in URI. + * + * @since S60 v5.0 + * @param aUri The URI contained suite(s) to load. + */ + IMPORT_C void LoadSuitesFromUriL( const TDesC8& aUri ); + +public: + // from MHnMdModelEventObserver + + /** + * Handle model event. + * + * @since S60 v5.0 + * @param aEventName Event's name to perform. + * @param aParams Event specific parameters used to perform action. + */ + TInt HandleModelEventL( const TDesC& aEventName, CLiwGenericParamList& aParams ); + + // from CHnInterface + + /** + * Handle back event. + * + * @since S60 v5.0 + * @param aGenre Suite given by the name genre. + * @param aIterations Number of iterations. + * @return Status code. + */ + TInt HandleBackEventL( const TDesC& aGenre, + TInt aIterations = KModelCountForRoot ); + + // from MHNMulModelInstallNotifierCallback + + /** + * InstallChangeL is called when the subscribed key has been changed. + * + * @since S60 v5.0 + * @param aStatus Status of the installation event. + */ + virtual void InstallChangeL( TInt aStatus ); + + + /** + * Loads default root suite + * + * @since S60 v5.0 + * @param aSuiteParams Suite parameters. + * @return Status error code. + */ + IMPORT_C TInt InitializeL( CLiwGenericParamList& aSuiteParams ); + + // from MHnEventGenerator + + /** + * Triggers an event inside hierarchy navigator. + * + * Used by UI to notify hierarchy navigator of its events, + * as well as for hierarchy navigator components to notify + * the module of certain events (such as OnSuiteLoaded etc). + * + * @since S60 v5.0 + * @param aHnEventId Internal id of an event (Event names are + * mapped to ids). + * @param aRecipientId The id of the recipient item. + * @param aEventParameters Event specific parameter. + * @return Status code. + */ + IMPORT_C TInt TriggerHnEventL( const TInt aHnEventId, + const TInt aRecipientId, CLiwGenericParamList* aEventParameters = NULL ); + + /** + * Splits the source descriptor by a separatos + * + * @since S60 v5.0 + * @param aSource Source descriptor intended to split. + * @param aSeparator Separator used to split. + * @return Array of descriptors. + */ + RPointerArray< HBufC8 > SplitL( const TDesC8& aSource, + const TDesC8& aSeparator ); + + /** + * Generate param list according to query param. + * + * @param aUriQuery Descriptor consist of param(s) to split + * @param aUriFragment Descriptor containing an uri fragment. + * @param aSuiteName The suite's name. + * @return Filled generic param list. + */ + CLiwGenericParamList* UriQueryToLiwListLC( const TDesC8& aUriQuery, + const TDesC8& aUriFragment, const TDesC8& aSuiteName ); + + /** + * Resets MD Model and Suite Container. + * + * @since S60 v5.0 + */ + IMPORT_C void ResetModelsL(); + + // from MHnEditModeInterface + + /** + * Sets edit mode. + * + * @since S60 v5.0 + * @param aEditMode Set edit mode member to false/true. + */ + void SetEditModeL( TBool aEditMode ); + + /** + * Enables to issue a request to Hn engine. + * + * @since S60 v5.0 + * @param aParam Input Parameters. + * @param aOutput Target list for output. + */ + IMPORT_C void HandleRequestL( const CLiwGenericParamList& aParam, + CLiwGenericParamList* aOutput = NULL); + + // from MHWRMLightObserver + /** + * Called when the device light status changes. + * Note that if the light status for certain target changes + * very rapidly, some state transitions might be missed. + * It is however guaranteed that latest state is always obtained. + * + * @param aTarget Indicates target(s) the new status applies to. + * @param aStatus Indicates light request status. + */ + virtual void LightStatusChanged(TInt aTarget, + CHWRMLight::TLightStatus aStatus); + +private: + /** + * Default constructor. + * + * @since S60 v5.0 + * @param aController Controller handler. + */ + CHnEngine( MHnControllerInterface& aController ); + + /** + * Standard 2nd phase constructor. + * + * @since S60 v5.0 + */ + void ConstructL(); + + /** + * Handle new suite loaded event. + * + * @since S60 v5.0 + * @param aParams Event specific parameters. + * @return Status code. + */ + TInt HandleNewSuiteLoadedEventL( CLiwGenericParamList& aParams ); + + /** + * Handle open suit event. + * + * @since S60 v5.0 + * @param aParams Event specific parameters that hold liw packed filter. + * @return Status code. + */ + TInt HandleReevaluateEventL( CLiwGenericParamList& aParams ); + + /** + * Handles widget change. + * + * @since S60 v5.0 + * @param aParams Event specific parameters consist of target widget type. + * @return Status code. + */ + TInt HandleWidgetChangeL( CLiwGenericParamList& aParams ); + + /** + * Handles SetFocus event. + * + * @since S60 v5.0 + * @param aParams Event specific parameters consist of target widget type. + * @return Status code. + */ + TInt HandleSetFocusEventL( const CLiwGenericParamList& aParams ); + + /** + * Handles MoveFocusBeforeDelete event. + * + * @since S60 v5.0 + * @param aParams Event specific parameters consist of target widget type. + * @return Status code. + */ + TInt HandleMoveFocusBeforeDeleteEventL( + const CLiwGenericParamList& aParams ); + + /** + * Handles RefreshIcons event. + * + * @since S60 v5.0 + * @param aParams Event specific parameters (ignored) + * @return Status code. + */ + TInt HandleRefreshIconsEventL( const CLiwGenericParamList& aParams ); + + /** + * Handles DisableActionsForItem event. + * + * @since S60 v5.0 + * @param aParams Event specific parameters - contains custom item id + * @return Status code. + */ + TInt HandleDisableActionsForItemL( const CLiwGenericParamList& aParams ); + + /** + * Store widget type to repository. + * + * @since S60 v5.0 + * @param aSuiteName Suite name to that set widget type. + * @param aType Widget type to store in repository. + * @return Status code. + */ + TInt HandleWidgetChangeL( const TDesC& aSuiteName, + THnSuiteWidgetType aType ); + + + /** + * Parse URI path component containing Suites to be loaded. + * + * @since S60 v5.0 + * @param aUriPath Descriptor URI path which consist of suites' names. + * @param aOutput Array on output containes parsed suite names. + */ + void ParseSuiteUriPathL( const TDesC8& aUriPath, + CDesC8ArrayFlat& aOutput ); + + + /** + * Checks if only root configuration is loaded. + * Used to decide if reloading models is needed. + * + * @since S60 v5.0 + * @return Return ETrue if only root configuration is loaded + * otherwise EFalse. + */ + TBool IsOnlyRootConfLoaded(); + + /** + * Resets loaded resources. + * + * @since S60 5.0 + */ + void ResetLocalization(); + + /** + * Loads suite with given suite name with parameters + * from uri query. + * + * @since S60 5.0 + * @param aSuiteName Name of the suite to load. + * @param aUriQuery Descriptor containig parsed part of the uri. + * @param aUriFragment Descriptor containig parsed part (fragment) of the uri. + * @return Error code when loading suite. + */ + TInt LoadSuiteFromUriL( const TDesC8& aSuiteName, + const TDesC8& aUriQuery, const TDesC8& aUriFragment ); + + /** + * Reads highlight position from uri fragment + * and sets it on the suite model. + * + * @since S60 5.0 + * @param aUriFragment Descriptor containig parsed part of the uri. + */ + void HighlightPlacementFromUriL( const TDesC8& aUriFragment ); + + + /** + * Loads folder and sets focus through CR. + * + * @since S60 v5.0 + */ + void LoadFromCrL( const TDesC8& aUri ); + + /** + * Handles loading suite from uri if suites names' are the same. + * + * @param aNextExists ETrue if the next suite's name exists in uri. + * @param aUri The URI's parameters passed to the suite. + */ + void HandleTheSameSuitesL( TBool aNextExists, const TDesC8& aParams ); + + /** + * Checks if suites have the same names. + * + * @param aLastSuiteName The last suite's name on the stack. + * @param aFirstSuiteName The first suite's name in uri. + * @return ETrue if names are equal + */ + TBool SuitesAreTheSameL( const TDesC& aLastSuiteName, const TDesC8& aFirstSuiteName ); + + /** + * Decides whether to hide menu depending on current state and uri parameters + * + * @param aUri The Uri to parse for exit procedure. + * @return ETrue If exit was consumed. + */ + TBool HandleActionL( const TDesC8& aUri ); + + /** + * Loads suites from uri. + * + * @param aUri The uri to parse + */ + void LoadSuitesL( const TDesC8& aUri ); + +private: // data + + /** + * Own - Meta data model. + */ + CHnMdModel* iMetaDataModel; + + /** + * Own - Suite container. + */ + CHnSuiteModelContainer* iSuiteContainer; + + /** + * Not own. + * EikonEnv for displaying popup messages. + */ + CEikonEnv* iEEnv; + + /** + * Not own - Suite observer. + */ + MHnControllerInterface& iControllerInterface; + + /** + * Installation observer. + * Own. + */ + CHnInstallNotifier* iInstObserver; + + /** + * Edit mode + */ + TBool iEditMode; + + /** + * Light status observer + */ + CHWRMLight* iLight; + }; + +#endif //C_HNENGINE_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/inc/hneventgenerator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/inc/hneventgenerator.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef HNEVENTGENERATOR_H_ +#define HNEVENTGENERATOR_H_ + +#include <e32def.h> + +class CLiwGenericParamList; +/** + * @ingroup group_hnengine + * Hierarchy navigator event generator. + * + * This class is an interface for event triggering in hierarchy navigator. + * Events being triggered may be e.g. SuiteLoaded, ItemFocus, etc. + * It also mediates in events being passed from the UI. + * + * @lib hnengine + * @since S60 5.0 + */ +class MHnEventGenerator + { + public: + + /** + * Method is invoked whenever any component wants to trigger an event + * inside hierarchy navigator. + * + * @since S60 5.0 + * @param aHnEventId Event type id to trigger. + * @param aRecipientId The id of the recipient item which the event concerns. + * @param aEventParameters Event specific parameters used to perform action. + * @return Status code. + */ + virtual TInt TriggerHnEventL( const TInt aHnEventId, const TInt aRecipientId, + CLiwGenericParamList* aEventParameters = NULL ) = 0; + }; + + +#endif // HNEVENTGENERATOR_H_ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/inc/hninstallnotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/inc/hninstallnotifier.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,177 @@ +/* +* Copyright (c) 2007-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: Sis package installation event listener +* +*/ + + + +#ifndef HNINSTALLNOTIFIER_H +#define HNINSTALLNOTIFIER_H + +#include <e32base.h> +#include <e32property.h> + +/** + * @ingroup group_hnengine + * Interface for observing Sis installation events. + * + * @lib hnengine + * @since S60 S60 v3.1 + */ +class MHnInstallNotifierCallback + { + +public: + /** + * @ingroup group_hnengine + * Enum defining the purpouse of the installation event. + */ + enum TInstOp + { + EInstOpNone = 0x00, + EInstOpInstall = 0x01, + EInstOpUninstall = 0x02, + EInstOpRestore = 0x04 + }; + + /** + * @ i ngroup group_hnengine + * Enum defining the exit status of the installation event. + */ +/* enum TInstOpStatus + { + EInstOpStatusNone = 0x0000, + EInstOpStatusSuccess = 0x0100, + EInstOpStatusAborted = 0x0200 + };*/ + + /** + * InstallChangeL is called when the subscribed key has been changed. + * + * @param aStatus Status of the installation event. + */ + virtual void InstallChangeL( TInt aStatus ) = 0; + + }; + + +/** + * @ingroup group_hnengine + * Central Repository notifier. + * + * @lib hnengine + * @since S60 S60 v3.1 + */ +NONSHARABLE_CLASS( CHnInstallNotifier ) : public CActive + { + +public: + + /** + * Creates an instance of CHnMulModelInstallNotifier implementation. + * + * @since S60 v5.0 + * + * @param aCallback Reference to notifier interface. + * @param aCategory Package uid. + * @param aKey Key for central repository. + * @return Fully constructed object. + */ + static CHnInstallNotifier* NewL( + MHnInstallNotifierCallback* aCallback, + TUid aCategory, + TUint aKey ); + + /** + * Default destructor. + * + * @since S60 v5.0 + */ + virtual ~CHnInstallNotifier(); + + +private: + /** + * Constructor. + * + * @since S60 v5.0 + * + * @param aCallback Reference to notifier interface. + * @param aCategory Package uid. + * @param aKey Key for central repository. + */ + CHnInstallNotifier( + MHnInstallNotifierCallback* aCallback, + TUid aCategory, + TUint aKey ); + + /** + * Symbian 2nd phase constructor. + * + * @since S60 v5.0 + */ + void ConstructL(); + + /** + * From CActive. Implements cancellation of an outstanding request. + * + * @since S60 v5.0 + */ + void DoCancel(); + + /** + * From CActive. Handles an active object's request completion event. + * + * @since S60 v5.0 + */ + void RunL(); + + /** + * From CActive. + * + * @since S60 v5.0 + * @param aError The leave code. + * @return Status code. + */ + TInt RunError( TInt aError ); + + +private: + /** + * User side interface to Publish & Subscribe. + */ + RProperty iProperty; + + /** + * Interface for notifying changes in SWI. + * Not own. + */ + MHnInstallNotifierCallback* iCallback; + + /** + * Category uid. + */ + TUid iCategory; + + /** + * Key identifier. + */ + TUint iKey; + + }; + +#endif // HNINSTALLNOTIFIER_H + +// End of File diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/inc/hninterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/inc/hninterface.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,146 @@ +/* +* 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: Interface for Hierarchy Navigator +* +*/ + + + +#ifndef C_HNINTERFACE_H +#define C_HNINTERFACE_H + +#include "hneventgenerator.h" + +class CHnSuiteModel; +class CLiwGenericParamList; + +/** + * @ingroup group_hnengine + * An interface for edit mode. Used by hierarchy navigator to track edit mode state status change. + * + * @lib hnengine + * @since S60 v5.0 + */ +class MHnEditModeInterface + { +public: + /** + * Sets edit mode. + * + * @since S60 v5.0 + * @param aEditMode Parametr sets edit mode to EFlase/Etrue. + */ + virtual void SetEditModeL( TBool aEditMode ) = 0; + }; + +/** + * @ingroup group_hnengine + * Interface for Multimedia Menu to use Hierarchy Navigator engine. The functionality of this interface are + * suite model event issues like loading a model, counting the models currently loaded or loading the root + * suite. + * + * @lib hnengine + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CHnInterface ) : public CBase, + public MHnEditModeInterface, + public MHnEventGenerator + { +public: + + /** + * Fetches and constructs data structres, needed by Multimedia + * Menu to display suites. + * + * @since S60 v5.0 + * @return Return last loaded suite model on the stack. + */ + virtual CHnSuiteModel* GetLastSuiteModelL() = 0; + + /** + * Fetches and constructs data structres, needed by Multimedia + * Menu to display suites. + * + * @since S60 v5.0 + * @return Return last loaded suite model on the stack. + */ + virtual CHnSuiteModel* GetParentSuiteModelL() = 0; + + /** + * Get count of suite models on the stack. + * + * @since S60 v5.0 + * @return Count of suite models on the stack. + */ + virtual TInt GetSuiteModelsCountL() = 0; + + /** + * Checks if suite model is loaded. + * + * @since S60 v5.0 + * @return ETrue if suite model is loaded, otherwise EFalse. + */ + virtual TBool SuiteModelLoadedL( TInt aId ) = 0; + + /** + * Handles back event coming from the UI. + * + * @since S60 v5.0 + * @param aGenre Suite's name given by genre name on + * which perform back event. + * @param aIterations Number of iterations. + * @return Status code. + */ + virtual TInt HandleBackEventL( const TDesC& aGenre, + TInt aIterations = KModelCountForRoot ) = 0; + + /** + * Loads suite hierarchy specified in URI. + * + * @since S60 v5.0 + * @param aUri The URI path consist of suite's name(s) to load to the stack. + */ + virtual void LoadSuitesFromUriL( const TDesC8& aUri ) = 0; + + /** + * Resets MD Model and Suite Container. + * + * @since S60 v5.0 + */ + virtual void ResetModelsL() = 0; + + /** + * Loads default root suite + * + * @since S60 v5.0 + * @param aSuiteParams Suite parameters. + * @return Status error code. + */ + virtual TInt InitializeL( CLiwGenericParamList& aSuiteParams ) = 0; + + /** + * Enables to issue a request to Hn engine. + * + * @since S60 v5.0 + * @param aParam Input Parameters. + * @param aOutput Target list for output. + */ + virtual void HandleRequestL( const CLiwGenericParamList& aParam, + CLiwGenericParamList* aOutput = NULL ) = 0; + + }; + +#endif // C_HNINTERFACE_H + + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/inc/hnserviceglobals.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/inc/hnserviceglobals.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2007-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: ?Description +* +*/ + + + +#ifndef C_HNSERVICEGLOBALS_H +#define C_HNSERVICEGLOBALS_H + + + +//// model event-related params +_LIT8( KNewSuiteParamNameEn, "suite_name" ); + + +#endif // C_HNSERVICEGLOBALS_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/inc/menudebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/inc/menudebug.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,204 @@ +/* +* Copyright (c) 2007-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: debug macro definitions +* +*/ + + +#ifndef MENUDEBUG_H +#define MENUDEBUG_H + +// INCLUDES +#include <e32std.h> +#include <flogger.h> + +// Maximum formatted size resulting from a single DEBUG* call +#ifndef MAX_DEBUG_STRING_LENGTH +#define MAX_DEBUG_STRING_LENGTH 4096 +#endif + +#ifdef _MATRIX_MENU_TRACE_PERFORMANCE +_LIT( KPerformanceLogDir, "menu" ); +_LIT( KPerformanceLogFile, "performance.txt" ); +#endif + +#ifdef _DEBUG +#include "mymenudebug.h" + +// Load correct mymenudebug.h from module inc directory, +// define your application-specific configuration like this: +// ---------------------------------------------------------- +// Debug file - debug output is disabled if the parent dir does not exist +// _LIT(KDebugDirName, "menu"); +// _LIT(KDebugFileName, "hnengine.txt"); + +// Replace the current debug file - if not defined appends to the file +#ifndef APPEND_TO_DEBUG_FILE +#define REPLACE_DEBUG_FILE +#endif + + +/** + * @param aData + */ +static void DoOutput(TDesC8& aData); + +static void DebugStringNarrowL(const char* aFmt, ...) + { + VA_LIST args; + VA_START(args, aFmt); + + TPtrC8 fmt(reinterpret_cast<const unsigned char *>(aFmt)); + HBufC8* buf = HBufC8::NewLC(MAX_DEBUG_STRING_LENGTH); + buf->Des().FormatList(fmt, args); + buf->Des().Append('\n'); + DoOutput(*buf); + CleanupStack::PopAndDestroy(buf); + + VA_END(args); + } + +static void DebugStringWideL(const char* aFmt, ...) + { + VA_LIST args; + VA_START(args, aFmt); + + TPtrC8 fmt(reinterpret_cast<const unsigned char *>(aFmt)); + HBufC* fmt16 = HBufC::NewLC(fmt.Length()); + fmt16->Des().Copy(fmt); + HBufC* buf = HBufC::NewLC(MAX_DEBUG_STRING_LENGTH); + buf->Des().FormatList(*fmt16, args); + buf->Des().Append('\n'); + HBufC8* buf8 = HBufC8::NewLC(buf->Length()); + buf8->Des().Copy(*buf); + DoOutput(*buf8); + CleanupStack::PopAndDestroy(3); // fmt16, buf, buf8 + + VA_END(args); + } + +static void DebugBufferL(const TDesC8& aBuf) + { + DebugStringNarrowL("\"%S\"", &aBuf); + } + +static void DebugBufferL(const TDesC& aBuf) + { + DebugStringWideL("\"%S\"", &aBuf); + } + +static void DebugTimeL(const TTime& aTime) + { + TBuf<64> dateTimeString; + _LIT(KDateString, "%E%D%X%N%Y %1 %2 %3"); + aTime.FormatL(dateTimeString, KDateString); + DebugBufferL(dateTimeString); + _LIT(KTimeString, "%-B%:0%J%:1%T%:2%S%.%*C4%:3%+B"); + aTime.FormatL(dateTimeString, KTimeString); + DebugBufferL(dateTimeString); + } + + +static void DoOutput(TDesC8& aData) + { + RFileLogger::Write(KDebugDirName, + KDebugFileName, + EFileLoggingModeAppend, + aData); + } +#endif + +#ifdef _MATRIX_MENU_TRACE_PERFORMANCE + +static void DoOutputPerf(TDesC8& aData) + { + RFileLogger::Write(KPerformanceLogDir, + KPerformanceLogFile, + EFileLoggingModeAppend, + aData); + } + +static void DebugStringNarrowPerfL(const char* aFmt, ...) + { + VA_LIST args; + VA_START(args, aFmt); + + TPtrC8 fmt(reinterpret_cast<const unsigned char *>(aFmt)); + HBufC8* buf = HBufC8::NewLC(MAX_DEBUG_STRING_LENGTH); + buf->Des().FormatList(fmt, args); + buf->Des().Append('\n'); + + TTime timestamp; + timestamp.HomeTime(); + + TBuf<64> dateTimeString; + TBuf8<64> dateTimeString8; + + _LIT(KTimeString, "%:0%J%:1%T%:2%S%.%*C4%:3"); + timestamp.FormatL(dateTimeString, KTimeString); + dateTimeString8.Copy( dateTimeString ); + buf->Des().Insert( 0, _L8(" -> ") ); + buf->Des().Insert( 0, dateTimeString8 ); + + DoOutputPerf(*buf); + CleanupStack::PopAndDestroy(buf); + + VA_END(args); + } +#endif + +// MACROS +// If you output one or more narrow descriptors by using '%S', +// use DEBUGSTRING8 +// else if you output one or more unicode descriptors by using '%S', +// use DEBUGSTRING16 +// else +// use DEBUGSTRING +// +// Narrow and unicode cannot be mixed in a single DEBUGSTRINGx call. + +#ifdef _DEBUG +#define DEBUGINIT() DebugInit() +#define DEBUGINITSUSPENDED() DebugInit(ETrue) +#define DEBUGENABLE() SetDebugEnabled(ETrue) +#define DEBUGDISABLE() SetDebugEnabled(EFalse) +#define DEBUGSUSPEND() SetDebugSuspended(ETrue) +#define DEBUGCONTINUE() SetDebugSuspended(EFalse) +#define DEBUG(x) TRAP_IGNORE( DebugStringNarrowL x ) +#define DEBUG8(x) TRAP_IGNORE( DebugStringNarrowL x ) +#define DEBUG16(x) TRAP_IGNORE( DebugStringWideL x ) +#define DEBUGBUFFER(x) TRAP_IGNORE( DebugBufferL x ) +#define DEBUGTIME(x) TRAP_IGNORE( DebugTimeL x ) +#else +#define DEBUGINIT() +#define DEBUGINITSUSPENDED() +#define DEBUGENABLE() +#define DEBUGDISABLE() +#define DEBUGSUSPEND() +#define DEBUGCONTINUE() +#define DEBUG(x) +#define DEBUG8(x) +#define DEBUG16(x) +#define DEBUGBUFFER(x) +#define DEBUGTIME(x) +#endif + +#ifdef _MATRIX_MENU_TRACE_PERFORMANCE +#define MMPERF(x) TRAP_IGNORE( DebugStringNarrowPerfL x ) +#else +#define MMPERF(x) +#endif + +#endif // MENUDEBUG_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/inc/mymenudebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/inc/mymenudebug.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2007-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: debug constants definitions +* +*/ + + +#ifndef MYMENUDEBUG_H +#define MYMENUDEBUG_H + +#define APPEND_TO_DEBUG_FILE + +_LIT(KDebugDirName, "menu"); +_LIT(KDebugFileName, "hnengine.txt"); + +#endif // MYMENUDEBUG_H + +// End of File diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/src/hnengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/src/hnengine.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1319 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <uri8.h> +#include <mmf/common/mmfcontrollerpluginresolver.h> +#include <sacls.h> +#include <apgtask.h> +#include <centralrepository.h> +#include <AknUtils.h> + +#include "hnengine.h" +#include "hnconvutils.h" +#include "hncontrollerinterface.h" +#include "hnfilter.h" +#include "hnsuitemodelcontainer.h" +#include "hnsuitemodel.h" +#include "hnserviceglobals.h" +#include "hnglobals.h" +#include "hnmdsuite.h" +#include "hnitemid.h" +#include "hnliwutils.h" +#include "hnrepositorymanager.h" +#include "menudebug.h" +#include "hnrepositorymanager.h" +#include "hnsuiteobserver.h" +#include "hnmdbasekey.h" +#include "hnitemsorder.h" + +_LIT8( KAnd8, "&" ); +_LIT8( KEquals8, "=" ); + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnEngine::ConstructL() + { + iEEnv = CEikonEnv::Static(); + iSuiteContainer = CHnSuiteModelContainer::NewL( *this , iControllerInterface ); + iMetaDataModel = CHnMdModel::NewL( this, iSuiteContainer ); + iLight = CHWRMLight::NewL(this); + iInstObserver = CHnInstallNotifier::NewL( this, + KUidSystemCategory, KSAUidSoftwareInstallKeyValue ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnEngine* CHnEngine::NewL( MHnControllerInterface& aController ) + { + CHnEngine* self = CHnEngine::NewLC( aController ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnEngine* CHnEngine::NewLC( MHnControllerInterface& aController ) + { + CHnEngine* self = new( ELeave ) CHnEngine( aController ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnEngine::CHnEngine( MHnControllerInterface& aController ): + iControllerInterface( aController ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnEngine::~CHnEngine() + { + delete iInstObserver; + delete iLight; + if( iSuiteContainer ) + { + iSuiteContainer->RemoveLiwObjects(); + } + delete iMetaDataModel; + delete iSuiteContainer; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnEngine::GetSuiteModelsCountL() + { + return iSuiteContainer->GetSuiteModelCount(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnEngine::SuiteModelLoadedL( TInt aId ) + { + TBool ret( EFalse ); + TInt count( iSuiteContainer->GetSuiteModelCount() ); + for( int i=0; i<count; i++ ) + { + CHnSuiteModel* suite = iSuiteContainer->GetSuiteModel( i ); + if( suite->GetItemsOrder()->GetSuiteId() == aId ) + { + ret = ETrue; + break; + } + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnSuiteModel* CHnEngine::GetLastSuiteModelL() + { + return iSuiteContainer->GetLastSuiteModel(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnSuiteModel* CHnEngine::GetParentSuiteModelL() + { + return iSuiteContainer->GetParentSuiteModel(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnEngine::TriggerHnEventL( const TInt aHnEventId, + const TInt aRecipientId, CLiwGenericParamList* aEventParameters ) + { + TInt ret = iSuiteContainer->OfferHnEventL( aHnEventId, aRecipientId, + aEventParameters); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnEngine::HighlightPlacementFromUriL( const TDesC8& aUriFragment ) + { + TLex8 lexFrag( aUriFragment ); + TInt highLight( 0 ); + if( !( lexFrag.Val( highLight ) ) ) + { + iSuiteContainer->GetLastSuiteModel()->SetSuiteHighlightL( highLight ); + iControllerInterface.HandleSuiteEventL( ESuiteHighlightChanged, + iSuiteContainer->GetLastSuiteModel() ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnEngine::LoadSuiteFromUriL( const TDesC8& aSuiteName, + const TDesC8& aUriQuery, const TDesC8& aUriFragment ) + { + TInt error( KErrNone ); + + if( !( aSuiteName.Compare( KRoot8 ) ) ) + { + CLiwGenericParamList* uriParams = + UriQueryToLiwListLC( aUriQuery, aUriFragment, aSuiteName ); + CLiwGenericParamList* params = CLiwGenericParamList::NewLC(); + params->AppendL( iMetaDataModel->GetSuiteParameters( 0 ) ); + params->AppendL( *uriParams ); + ResetModelsL(); + iMetaDataModel->QueueForeground( CHnMdModel::EWhenAnySuiteIsEvaluated ); + error = InitializeL( *params ); + CleanupStack::PopAndDestroy( params ); + CleanupStack::PopAndDestroy( uriParams ); + } + else + { + CLiwGenericParamList* params = + UriQueryToLiwListLC( aUriQuery, aUriFragment, aSuiteName ); + + HBufC* suiteName = HnConvUtils::Str8ToStrLC( aSuiteName ); + params->AppendL( TLiwGenericParam( KNewSuiteParamNameEn, + TLiwVariant( *suiteName ) ) ); + + error = HandleNewSuiteLoadedEventL( *params ); + + CleanupStack::PopAndDestroy( suiteName ); + CleanupStack::PopAndDestroy( params ); + } + + return error; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnEngine::SuitesAreTheSameL( const TDesC& aLastSuiteName, + const TDesC8& aFirstSuiteName ) + { + RBuf8 lastSuiteName; + CleanupClosePushL( lastSuiteName ); + lastSuiteName.CreateL( aLastSuiteName.Length() ); + lastSuiteName.Copy( aLastSuiteName ); + TBool suitesAreTheSame( !lastSuiteName.Compare( aFirstSuiteName ) ); + CleanupStack::PopAndDestroy( &lastSuiteName ); + return suitesAreTheSame; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnEngine::HandleTheSameSuitesL( TBool aNextExists, const TDesC8& aParams ) + { + RBuf exitMode; + CleanupClosePushL( exitMode ); + CLiwGenericParamList* params = UriQueryToLiwListLC( aParams, KNullDesC8, KNullDesC8 ); + HnLiwUtils::GetStringL( *params, KExitModeParams, exitMode ); + + if ( !exitMode.Compare( KExitModeHide ) ) + { + // set parameters + iSuiteContainer->GetLastSuiteModel()->SetExitMode( EExitModeHide ); + } + + CleanupStack::PopAndDestroy( params ); + CleanupStack::PopAndDestroy( &exitMode ); + + if ( !aNextExists ) + { + // refresh if necessary + iControllerInterface.NotifyUiRefreshL( ERefreshSuite ); + } + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnEngine::LoadSuitesFromUriL( const TDesC8& aUri ) + { + DEBUG(("_MM_:CHnEngine::LoadSuitesFromUriL IN")); + DEBUG8(("_MM_:\tURI: %S",&aUri)); + + TBool consumed(EFalse); + + if ( aUri.Find( KSetFocusWithPref ) != KErrNotFound ) + { + LoadFromCrL( aUri ); + consumed = ETrue; + } + + if ( !consumed ) + { + consumed = HandleActionL( aUri ); + } + + if ( !consumed ) + { + LoadSuitesL( aUri ); + } + + DEBUG(("_MM_:CHnEngine::LoadSuitesFromUriL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnEngine::HandleModelEventL( const TDesC& aEventName, + CLiwGenericParamList& aParams ) + { + TInt ret(KErrNotFound); + + if ( aEventName == KNewSuiteLoadedMdEvent ) + { + // This handles new suite creation, putting its visual model + // onto the stack eventually. + ret = HandleNewSuiteLoadedEventL( aParams ); + } + else if ( aEventName == KBackMdEvent ) + { + const TDesC& suiteName = iSuiteContainer->GetLastSuiteModel()->SuiteName(); + ret = HandleBackEventL( suiteName ); + } + else if (aEventName == KReevaluateMdEvent ) + { + // This event triggers reevaluate on the model. + // aParams holds liw packed filter. + ret = HandleReevaluateEventL( aParams ); + } + else if (aEventName == KSwitchWidgetMdEvent ) + { + // Widget change is requested. + ret = HandleWidgetChangeL( aParams ); + } + else if (aEventName == KRefreshUiMdEvent ) + { + // Refresh of the whole of the UI is refreshed + iControllerInterface.NotifyUiRefreshL( ERefreshSuite ); + ret = KErrNone; + } + else if (aEventName == KRefreshToolbarMdEvent ) + { + // Just the toolbar in UI is refreshed + iControllerInterface.NotifyUiRefreshL( ERefreshToolbar ); + ret = KErrNone; + } + else if (aEventName == KStartEditModeMdEvent ) + { + // Starting edit mode + iControllerInterface.NotifyUiRefreshL( EStartEditMode ); + ret = KErrNone; + } + else if (aEventName == KStopEditModeMdEvent ) + { + // Stopping edit mode + iControllerInterface.NotifyUiRefreshL( EStopEditMode ); + ret = KErrNone; + } + else if (aEventName == KSetFocusEvent ) + { + // SetFocus + ret = HandleSetFocusEventL( aParams ); + } + else if (aEventName == KZoomLarge ) + { + // Stopping edit mode + iControllerInterface.NotifyUiRefreshL( EZoomLarge ); + ret = KErrNone; + } + else if (aEventName == KZoomSmall) + { + // Stopping edit mode + iControllerInterface.NotifyUiRefreshL( EZoomSmall ); + ret = KErrNone; + } + else if (aEventName == KZoomNormal ) + { + // Stopping edit mode + iControllerInterface.NotifyUiRefreshL( EZoomNormal ); + ret = KErrNone; + } + else if (aEventName == KAppGainForeground ) + { + //force matrix gain foreground + DEBUG(("_MM_:CHnEngine::HandleModelEventL EForegroundGain")); + iControllerInterface.NotifyUiRefreshL( EForegroundGain ); + ret = KErrNone; + } + else if (aEventName == KAppGainBackground ) + { + //force matrix gain background + DEBUG(("_MM_:CHnEngine::HandleModelEventL EBackgroundGain")); + iControllerInterface.NotifyUiRefreshL( EBackgroundGain ); + ret = KErrNone; + } + + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnEngine::HandleWidgetChangeL( + CLiwGenericParamList& aParams ) + { + THnSuiteWidgetType type = EChangeWidget; + TInt pos( 0 ); + const TLiwGenericParam* param = NULL; + param = aParams.FindFirst( pos, KWidgetTypeAttrName8 ); + if ( pos != KErrNotFound ) + { + TPtrC widgetType( KNullDesC ); + param->Value().Get( widgetType ); + if ( widgetType.Compare( KWidgetTypeList ) == 0 ) + type = EListWidget; + else if ( widgetType.Compare( KWidgetTypeGrid ) == 0 ) + type = EGridWidget; + else if ( widgetType.Compare( KWidgetTypeCoverFlow ) == 0 ) + type = ECoverFlowWidget; + } + + CHnSuiteModel* model = iSuiteContainer->GetLastSuiteModel(); + return HandleWidgetChangeL( model->SuiteName(), type ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnEngine::HandleWidgetChangeL( const TDesC& aSuiteName, + THnSuiteWidgetType aType ) + { + DEBUG(("_MM_:CMatrixMenuAppUi::HandleWidgetChangeL IN")); + TInt ret( KErrGeneral ); + + CHnRepositoryManager* rep = CHnRepositoryManager::NewLC(); + THnSuiteWidgetType type( EUnspecified ); + TInt err( rep->ReadSuiteWidgetTypeL( aSuiteName, type ) ); + + if( ( !err || err == KErrNotFound ) && type != EUnspecified ) + { + ret = rep->StoreSuiteWidgetTypeL( aSuiteName, aType ); + } + CleanupStack::PopAndDestroy( rep ); + DEBUG(("_MM_:CMatrixMenuAppUi::HandleWidgetChangeL OUT")); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnEngine::HandleReevaluateEventL( + CLiwGenericParamList& aParams ) + { + TInt ret(KErrNone); + // Paths to retrieve filter values + _LIT8( KGenreGlobalPath, "filter:genre"); + _LIT8( KIdGlobalPath, "filter:id"); + _LIT8( KGenrePath, "filter:[%d]/genre"); + _LIT8( KItemPath, "filter:[%d]/item"); + + CHnFilter* filter = CHnFilter::NewLC(); + + TLiwGenericParam param; + param.PushL(); + aParams.AtL(0, param); + ASSERT( !param.Name().Compare( KFilterElementItem8 ) ); + + TLiwVariant suiteIdVariant; + suiteIdVariant.PushL(); + TLiwVariant genreVariant; + genreVariant.PushL(); + TInt idFound = + HnLiwUtils::GetVariantL( aParams, KIdGlobalPath(), suiteIdVariant ); + TInt found = + HnLiwUtils::GetVariantL(aParams, KGenreGlobalPath(), genreVariant ); + if (idFound != KErrNotFound) + { + filter->SetSuiteId( suiteIdVariant.AsTInt32() ); + filter->SetEvaluateSuiteL( ETrue ); + } + else if (found != KErrNotFound && found != KErrBadDescriptor) + { + filter->SetSuiteNameL( genreVariant.AsDes() ); + filter->SetEvaluateSuiteL( ETrue ); + } + else + { + filter->SetEvaluateSuiteL( EFalse ); + // For each entry in the fitler list.... + for ( int i=0; i< param.Value().AsList()->Count(); i++ ) + { + RBuf8 path; + CleanupClosePushL( path ); + path.CreateL( KGenrePath().Length() ); + path.Format( KGenrePath, i ); + TLiwVariant genreVariant; + HnLiwUtils::GetVariantL(aParams, path, genreVariant ); + path.Close(); + path.CreateL( KItemPath().Length() ); + path.Format( KItemPath, i ); + TLiwVariant itemVariant; + HnLiwUtils::GetVariantL(aParams, path, itemVariant ); + CleanupStack::PopAndDestroy( &path ); + + TPtrC suiteName; + TPtrC itemId; + genreVariant.Get(suiteName); + itemVariant.Get(itemId); + + CHnItemId* itemIdObject = CHnItemId::NewLC(suiteName, itemId); + filter->AppendItemIdL( itemIdObject ); + CleanupStack::Pop( itemIdObject ); + + genreVariant.Reset(); + itemVariant.Reset(); + } + } + CleanupStack::PopAndDestroy( &genreVariant ); + CleanupStack::PopAndDestroy( &suiteIdVariant ); + CleanupStack::PopAndDestroy( ¶m ); + iMetaDataModel->EvaluateL( *filter ); + CleanupStack::PopAndDestroy( filter ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnEngine::HandleBackEventL( const TDesC& aGenre, TInt aIterations ) + { + return iMetaDataModel->HandleBackEventL( + iSuiteContainer, aGenre, aIterations ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnEngine::HandleNewSuiteLoadedEventL( + CLiwGenericParamList& aParams ) + { + DEBUG(("_MM_:CHnEngine::HandleNewSuiteLoadedEventL IN")); + TInt err( KErrNone ); + const TLiwGenericParam* param = + aParams.FindFirst( err, KNewSuiteParamNameEn ); + if( err != KErrNotFound ) + { + TPtrC genre; + param->Value().Get( genre ); + DEBUG16(("_MM_:\tSuite genre name: %S",&genre)); + // load and evaluate the suite + err = iMetaDataModel->LoadSuiteL( genre, &aParams ); + if ( !err ) + { + GetLastSuiteModelL()->RegisterSuiteObserverL( &iControllerInterface, EPriorityNull ); + CHnFilter* filter = CHnFilter::NewLC(); + filter->SetSuiteNameL( genre ); + filter->SetEvaluateSuiteL( ETrue ); + if ( iEditMode ) + { + iMetaDataModel->SetModeL( EMdModeEdit ); + } + else + { + iMetaDataModel->SetModeL( EMdModeNormal ); + } + + TRAP( err, iMetaDataModel->EvaluateL( *filter ) ); + + CleanupStack::PopAndDestroy( filter ); + if ( err ) + { + iMetaDataModel->DeleteLastSuite(); + iSuiteContainer->PopSuiteModelL( genre ); + } + } + else + { + // show error note to User + HBufC* message( NULL ); + switch ( err ) + { + case KErrPathNotFound : + { + message = KDebugNoteDirNotFound().AllocL(); + } + break; + case KErrNotFound : + { + message = KDebugNoteFileNotFound().AllocL(); + } + break; + default : + { + message = HBufC::NewL( KDebugNoteOtherError().Length() + + KMaxLength ); + message->Des().AppendFormat( KDebugNoteOtherError, err ); + } + break; + } + iEEnv->AlertWin( *message ); + delete message; + } + } + DEBUG(("_MM_:\tReturned error code: %d",err)); + DEBUG(("_MM_:CHnEngine::HandleNewSuiteLoadedEventL OUT")); + + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnEngine::HandleSetFocusEventL( const CLiwGenericParamList& aParams ) + { + // Triggering event in hierarchy navigator, specifying + // that suite given by the name genre has been + DEBUG(("_MM_:CHnEngine::HandleSetFocusEventL IN")); + + TInt posSuite( 0 ); + TInt posItem( 0 ); + TInt64 suiteCustomId( KErrNotFound ); + TInt64 itemCustomId( KErrNotFound ); + + // Get suite's and item's custom ids. + const TLiwGenericParam* paramSuiteId = aParams.FindFirst( posSuite, KSuiteCustomId8 ); + const TLiwGenericParam* paramItemId = aParams.FindFirst( posItem, KItemCustomId8 ); + + + if ( posSuite >= 0 && posItem >= 0 ) + { + suiteCustomId = paramSuiteId->Value().AsTInt64(); + itemCustomId = paramItemId->Value().AsTInt64(); + + // Get matching suite. + CHnSuiteModel* suiteModel = iSuiteContainer->GetMatchingSuiteModel( suiteCustomId ); + + if ( suiteModel ) + { + // If suite is not null, then find matching item model. + TInt index( KErrNotFound ); + CHnItemModel* itemModel = suiteModel->GetMatchingItemModelL( itemCustomId, index ); + + if ( itemModel ) + { + // If itemModel is not null then set highlight and set highligh + // on matching item. + suiteModel->SetSuiteHighlightL( index ); + iControllerInterface.HandleSuiteEventL( ESuiteHighlightChanged, suiteModel ); + } + else + { + suiteModel->QueueFocus( itemCustomId ); + } + } + } + + DEBUG(("_MM_:CHnEngine::HandleSetFocusEventL OUT")); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnEngine::HandleMoveFocusBeforeDeleteEventL( + const CLiwGenericParamList& /* aParams */ ) + { + // Triggering event in hierarchy navigator, specifying + // that suite given by the name genre has been + DEBUG(("_MM_:CHnEngine::HandleMoveFocusBeforeDeleteEventL IN")); + + TInt currentHighlight( GetLastSuiteModelL()->GetSuiteHighlight() ); + TInt itemsCount( GetLastSuiteModelL()->GetItemModelsCount() ); + + TInt shift( 0 ); + if( AknLayoutUtils::PenEnabled() && iEditMode ) + { + // add empty item + shift = 1; + } + if( currentHighlight == itemsCount - shift - 1 ) + { + GetLastSuiteModelL()->SetSuiteHighlightL( currentHighlight - 1 ); + } + else + { + GetLastSuiteModelL()->SetSuiteHighlightL( currentHighlight + 1 ); + } + iControllerInterface.HandleSuiteEventL( + ESuiteHighlightChanged, GetLastSuiteModelL() ); + + DEBUG(("_MM_:CHnEngine::HandleMoveFocusBeforeDeleteEventL OUT")); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnEngine::HandleRefreshIconsEventL( const CLiwGenericParamList& /* aParams */ ) + { + iMetaDataModel->EvaluateL(); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnEngine::HandleDisableActionsForItemL( const CLiwGenericParamList& aParams ) + { + TInt pos( 0 ); + aParams.FindFirst( pos, KItemCustomId8 ); + if ( pos != KErrNotFound ) + { + TInt itemCustomId = aParams[pos].Value().AsTInt32(); + TInt itemId = 0; + CHnItemModel* itemModel = + iSuiteContainer->GetLastSuiteModel()->GetMatchingItemModelL( + itemCustomId, itemId ); + if ( itemModel ) + { + itemModel->DeleteAllActionModels(); + } + } + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnEngine::InstallChangeL( TInt aStatus ) + { + switch ( aStatus) + { + case EInstOpNone: + { + iMetaDataModel->HandleSisInstallationEventL( iSuiteContainer ); + break; + } + case EInstOpInstall: + case EInstOpUninstall: + { + iMetaDataModel->ReleaseLocalization(); + break; + } + } + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnEngine::InitializeL( CLiwGenericParamList& aParam ) + { + DEBUG(("_MM_:CMatrixMenuAppUi::InitializeL IN")); + User::LeaveIfError( HandleNewSuiteLoadedEventL( aParam ) ); + DEBUG(("_MM_:CMatrixMenuAppUi::InitializeL OUT")); + // This is an interface method so some value has to be returned. + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnEngine::ParseSuiteUriPathL( const TDesC8& aUriPath, + CDesC8ArrayFlat& aOutput ) + { + DEBUG(("_MM_:CHnEngine::ParseSuiteUriPathL IN")); + DEBUG(("_MM_:\tURI path: %S",&aUriPath)); + if ( aUriPath.Length() ) + { + // copy the path so we can freely trim already parsed chunks + RBuf8 buf( aUriPath.AllocL() ); + CleanupClosePushL( buf ); + + // get rid of the initial slash + if ( buf[0] == KSlash8()[0] ) + { + buf.Delete( 0, 1 ); + DEBUG(("_MM_:\tDeleted leading slash")); + } + + // get the first chunk + TInt slashPos = buf.Find( KSlash8 ); + TPtrC8 chunkPtr; + if ( slashPos != KErrNotFound ) + { + chunkPtr.Set( buf.Left( slashPos ) ); + } + else + { + // no slash - one chunk path + chunkPtr.Set( buf ); + } + + while ( chunkPtr.Length() ) + { + aOutput.AppendL( chunkPtr ); + DEBUG8(( "_MM_:\t\tParsed segment: %S", &chunkPtr )); + + // get rid of the parsed chunk and get a new one + if ( slashPos != KErrNotFound ) + { + // also remove the trailing slash + buf.Delete( 0, chunkPtr.Length() + 1 ); + slashPos = buf.Find( KSlash8 ); + if ( slashPos != KErrNotFound ) + { + chunkPtr.Set( buf.Left( slashPos ) ); + } + else + { + // last chunk + chunkPtr.Set( buf ); + } + } + else + { + // no slashes found, this was the last one + break; + } + } + + CleanupStack::PopAndDestroy( &buf ); + } + DEBUG(("_MM_:CHnEngine::ParseSuiteUriPathL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnEngine::ResetModelsL() + { + MMPERF(("CHnEngine::ResetModelsL - START")); + + iControllerInterface.NotifyUiRefreshL( ERemoveLiwObjects ); + + if( iSuiteContainer ) + { + iSuiteContainer->RemoveLiwObjects(); + } + delete iMetaDataModel; + iMetaDataModel = NULL; + delete iSuiteContainer; + iSuiteContainer = NULL; + + iSuiteContainer = CHnSuiteModelContainer::NewL( *this , iControllerInterface ); + MMPERF(("CHnEngine::ResetModelsL - suite container ready")); + + iMetaDataModel = CHnMdModel::NewL( this, iSuiteContainer ); + + MMPERF(("CHnEngine::ResetModelsL - DONE")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CLiwGenericParamList* CHnEngine::UriQueryToLiwListLC( + const TDesC8& aUriQuery, const TDesC8& aUriFragment, const TDesC8& aSuiteName ) + { + CLiwGenericParamList* list = CLiwGenericParamList::NewLC(); + + CLiwDefaultMap* map = CLiwDefaultMap::NewL(); + map->PushL(); + + RPointerArray< HBufC8 > params = SplitL( aUriQuery, KAnd8 ); + + for( TInt i = 0; i < params.Count(); i++ ) + { + RPointerArray< HBufC8 > paramValue = SplitL( *params[ i ], KEquals8 ); + CleanupResetAndDestroyPushL( paramValue ); + ASSERT( paramValue.Count() == 2 ); + map->InsertL( *paramValue[ 0 ], TLiwVariant( *paramValue[ 1 ] ) ); + CleanupStack::PopAndDestroy( ¶mValue ); + } + + if ( aUriFragment.Length() > 0 && aSuiteName.Length() > 0 ) + { + map->InsertL( KUriHighlight, TLiwVariant( aUriFragment ) ); + map->InsertL( KUriHighlightSuite, TLiwVariant( aSuiteName ) ); + } + + list->AppendL( TLiwGenericParam( KParams8, TLiwVariant( map ))); + + params.ResetAndDestroy(); + CleanupStack::PopAndDestroy( map ); + + return list; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +RPointerArray< HBufC8 > CHnEngine::SplitL( const TDesC8& aSource, + const TDesC8& aSeparator ) + { + RPointerArray< HBufC8 > tokens; + CleanupResetAndDestroyPushL( tokens ); + + if ( aSource.Length() > 0 && aSeparator.Length() > 0 ) + { + TPtrC8 tmpSource = aSource; + + TPtrC8 token( KNullDesC8 ); + + while( ETrue ) + { + TInt length = tmpSource.Find( aSeparator ); + + if ( length >= 0 ) + { + token.Set( tmpSource.Mid( 0, length ) ); + tokens.AppendL( token.AllocL() ); + tmpSource.Set( tmpSource.Mid( length + 1 ) ); + } + else + { + token.Set( tmpSource ); + tokens.AppendL( token.AllocL() ); + break; + } + } + } + CleanupStack::Pop( &tokens ); + return tokens; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnEngine::SetEditModeL( TBool aEditMode ) + { + iEditMode = aEditMode; + if ( aEditMode ) + { + iMetaDataModel->SetModeL( EMdModeEdit ); + } + else + { + iMetaDataModel->SetModeL( EMdModeNormal ); + } + //The suite on top of the stack is probably displayed. + //Switching to edit mode has some dramatic ui impact, + //thus when parts of the suite will get displayed + //it may look awkward thus the suite on top of the stack + //is marked as uninitialized, therefore ui will be able to + //react only to the ready suite model. + if (AknLayoutUtils::PenEnabled() || (!AknLayoutUtils::PenEnabled() && iEditMode)) + { + GetLastSuiteModelL()->GetItemsOrder()->MarkSuiteUninitialized(); + iMetaDataModel->EvaluateL(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnEngine::IsOnlyRootConfLoaded() + { + return ( iSuiteContainer && + iSuiteContainer->GetSuiteModelCount() == KModelCountForRoot ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// + +EXPORT_C void CHnEngine::HandleRequestL( const CLiwGenericParamList& aParam, + CLiwGenericParamList* /*aOutput*/ ) + { + TInt pos( 0 ); + aParam.FindFirst( pos, KHnRequest ); + if (pos != KErrNotFound) + { + TPtrC8 command = aParam[pos].Value().AsData(); + if( command == KSetFocus ) + { + HandleSetFocusEventL( aParam ); + } + else if( command == KMoveFocusBeforeDelete ) + { + HandleMoveFocusBeforeDeleteEventL( aParam ); + } + else if( command == KRefreshIcons ) + { + HandleRefreshIconsEventL( aParam ); + } + else if (command == KEvaluateMdModel) + { + GetLastSuiteModelL()->GetItemsOrder()->MarkSuiteUninitialized(); + iMetaDataModel->EvaluateL(); + } + else if ( command == KDisableActionsForItem ) + { + HandleDisableActionsForItemL( aParam ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnEngine::LoadFromCrL( const TDesC8& aUri ) + { + HBufC8* uriBuf = HBufC8::NewLC( aUri.Length() ); + uriBuf->Des().Copy( aUri ); + + TUriParser8 parser; + parser.Parse( *uriBuf ); + User::LeaveIfError( parser.IsSchemeValid() ? KErrNone : KErrPathNotFound ); + + const TDesC8& query = parser.Extract( EUriQuery ); + RPointerArray< HBufC8 > params = SplitL( query, HnLogicalRelations::KLogicalAnd8); + + TBuf8<KApaMaxAppGroupName + KTimeStampBufferLength + KUidStringLength + 2> item; + + for( TInt i = 0; i < params.Count(); i++ ) + { + RPointerArray< HBufC8 > paramValue = SplitL( *params[ i ], HnLogicalRelations::KLogicalEqual8 ); + CleanupResetAndDestroyPushL( paramValue ); + ASSERT( paramValue.Count() == 2 ); + + if ( !paramValue[0]->Compare(KMcsAppGroupName8) ) + { + TBuf8<KApaMaxAppGroupName> appgrname; + if( paramValue[1]->Length()<=KApaMaxAppGroupName ) + { + appgrname.Append( *paramValue[1] ); + } + + //get current time + TTime currentTime; + currentTime.HomeTime(); + TDateTime date(currentTime.DateTime()); + item.Format(KCRepTimeFormat, &appgrname , date.Year(), date.Month(), + date.Day(), date.Hour(), date.Minute(), date.Second(), date.MicroSecond()); + } + else if ( !paramValue[0]->Compare( KKeyTypeUid ) ) + { + item.Append( KComma8 ); + if( paramValue[1]->Length()<=KUidStringLength ) + { + item.Append( *paramValue[1] ); + } + } + CleanupStack::PopAndDestroy( ¶mValue ); + } + + TBuf<KApaMaxAppGroupName + KTimeStampBufferLength + KUidStringLength + 2> item1; + item1.Copy(item); + CRepository *cenRep = CRepository::NewLC( KCRUidMenu ); + cenRep->Set(KMenuShowFolder, item1); + CleanupStack::PopAndDestroy( cenRep ); + + params.ResetAndDestroy(); + CleanupStack::PopAndDestroy( uriBuf ); + + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnEngine::LightStatusChanged(TInt aTarget, + CHWRMLight::TLightStatus aStatus) + { + DEBUG(("_Mm_:CHnEngine::LightStatusChanged: target %d, status %d - IN", aTarget, aStatus)); + if (CHWRMLight::EPrimaryDisplay == aTarget + || CHWRMLight::EPrimaryDisplayAndKeyboard == aTarget) + { + switch (aStatus) + { + case CHWRMLight::ELightOn: + { + TRAP_IGNORE( iControllerInterface.NotifyUiRefreshL(ELightOn) ); + break; + } + case CHWRMLight::ELightOff: + { + TRAP_IGNORE( iControllerInterface.NotifyUiRefreshL(ELightOff) ); + break; + } + } + } + DEBUG(("_Mm_:CMmAppUi::LightStatusChanged - OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnEngine::HandleActionL( const TDesC8& aUri ) + { + TBool exitActionConsumed(EFalse); + + HBufC8* uriBuf = HBufC8::NewLC( aUri.Length() ); + uriBuf->Des().Copy( aUri ); + + TUriParser8 parser; + parser.Parse( *uriBuf ); + User::LeaveIfError( parser.IsSchemeValid() ? KErrNone : KErrPathNotFound ); + + const TDesC8& host8 = parser.Extract( EUriHost ); + const TDesC8& query = parser.Extract( EUriQuery ); + + RBuf action; + CleanupClosePushL( action ); + CLiwGenericParamList* paramsUri = UriQueryToLiwListLC( query, KNullDesC8, KNullDesC8 ); + HnLiwUtils::GetStringL( *paramsUri, KActionParams, action ); + + if ( !action.Compare( KActionExit ) ) + { + RBuf host; + host.CreateL( host8.Length() ); + CleanupClosePushL( host ); + host.Copy(host8); + CHnSuiteModel* suiteModel = iSuiteContainer->GetSuiteModel( host ); + TBool exitHideHostNotFound( ETrue ); + if( suiteModel && suiteModel->ExitMode() == EExitModeHide ) + { + exitHideHostNotFound = EFalse; + } + + if ( exitHideHostNotFound ) + { + //send to foreground + CLiwGenericParamList* pl = CLiwGenericParamList::NewL(); + CleanupStack::PushL( pl ); + HandleModelEventL( KAppGainForeground, *pl ); + CleanupStack::PopAndDestroy( pl ); + } + else + { + //send to background + CLiwGenericParamList* pl = CLiwGenericParamList::NewL(); + CleanupStack::PushL( pl ); + HandleModelEventL( KAppGainBackground, *pl ); + CleanupStack::PopAndDestroy( pl ); + } + + if ( exitHideHostNotFound && iSuiteContainer->GetLastSuiteModel() == suiteModel ) + { + HandleBackEventL( host, 1 ); + } + else + { + //reset to root + CLiwGenericParamList* params = CLiwGenericParamList::NewLC(); + params->AppendL( iMetaDataModel->GetSuiteParameters( 0 ) ); + ResetModelsL(); + InitializeL( *params ); + CleanupStack::PopAndDestroy( params ); + } + + CleanupStack::PopAndDestroy( &host ); + exitActionConsumed = ETrue; + } + + CleanupStack::PopAndDestroy( paramsUri ); + CleanupStack::PopAndDestroy( &action ); + CleanupStack::PopAndDestroy( uriBuf ); + return exitActionConsumed; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnEngine::LoadSuitesL( const TDesC8& aUri ) + { + TBool sendToForeground(EFalse); + HBufC8* uriBuf = HBufC8::NewLC( aUri.Length() ); + uriBuf->Des().Copy( aUri ); + + TUriParser8 parser; + parser.Parse( *uriBuf ); + User::LeaveIfError( parser.IsSchemeValid() ? KErrNone : KErrPathNotFound ); + + CDesC8ArrayFlat* suiteNameArray = new( ELeave ) CDesC8ArrayFlat( KDefaultGranularity ) ; + CleanupStack::PushL( suiteNameArray ); + + const TDesC8& host = parser.Extract( EUriHost ); + RBuf8 host8; + CleanupClosePushL( host8 ); + if (host.Compare( KNullDesC8 )) + { + host8.CreateL( host ); + host8.LowerCase(); + suiteNameArray->AppendL( host8 ); + DEBUG8(( "_MM_:\tURI host part: %S", &host8 )); + } + + const TDesC8& path = parser.Extract( EUriPath ); + if (path.Compare( KNullDesC8 )) + { + HBufC8* path8 = HBufC8::NewLC( path.Length() ); + path8->Des().Copy( path ); + path8->Des().LowerCase(); + ParseSuiteUriPathL( *path8, *suiteNameArray ); + CleanupStack::PopAndDestroy( path8 ); + } + + TBool suiteExists( EFalse ); + iMetaDataModel->IgnoreEvaluations( ETrue ); + iMetaDataModel->QueueForeground( CHnMdModel::EWhenAnySuiteIsEvaluated ); + + if( host8.Length() == 0 || ( host8.Length() > 0 && + !iMetaDataModel->SuiteModelExistsL( host8 ) ) ) + { + suiteNameArray->Reset(); + suiteNameArray->AppendL( KRoot8 ); + } + + for( TInt i = 0; i < suiteNameArray->Count(); ++i ) + { + suiteExists = iMetaDataModel->SuiteModelExistsL( + ( *suiteNameArray )[i] ); + TBool nextExists = i < suiteNameArray->Count() - 1 && + iMetaDataModel->SuiteModelExistsL( ( *suiteNameArray )[i + 1] ); + TBool isLast = ( i == ( suiteNameArray->Count() - 1 ) ); + + TBool turnOnEvaluation = ( suiteExists && ( !nextExists || isLast ) ); + if( turnOnEvaluation || !suiteExists ) + { + iMetaDataModel->IgnoreEvaluations( EFalse ); + } + + TInt err( KErrNone ); + + // Ignore loading new suite if the last suite in model is the same + // as first one in the uri. + if ( i == 0 ) + { + if ( SuitesAreTheSameL( iMetaDataModel->GetLastSuite()->SuiteName(), (*suiteNameArray)[i] ) ) + { + HandleTheSameSuitesL( nextExists, parser.Extract( EUriQuery ) ); + sendToForeground = ETrue; + continue; + } + } + + if( suiteExists ) + { + if (!nextExists) + { + // Tricky: queue foreground so that if the suite is evaluated synchronously + // the foreground will be gained. + iMetaDataModel->QueueForeground( CHnMdModel::EWhenAnySuiteIsEvaluated ); + } + err = LoadSuiteFromUriL( + ( *suiteNameArray )[i], parser.Extract( EUriQuery ), parser.Extract( EUriFragment ) ); + if ( KErrNone == err && !nextExists && iMetaDataModel->IsForegroundQueued() ) + { + // Tricky: if foreground is still queued it means that the suite is evaluated + // asynchronously. Override the previos foreground queue setting with one + // that will be effective only if the last loaded suite is evaluated. + iMetaDataModel->QueueForeground( CHnMdModel::EWhenCurrentTopSuiteIsEvaluated ); + } + if ( err != KErrNone ) + { + sendToForeground = ETrue; + } + } + + if( !suiteExists || err != KErrNone || !nextExists ) + { + CHnFilter* filter = CHnFilter::NewLC(); + + filter->SetSuiteId( + iSuiteContainer->GetLastSuiteModel()->CustomId() ); + + filter->SetEvaluateSuiteL( ETrue ); + iMetaDataModel->IgnoreEvaluations( EFalse ); + + TRAPD( err, iMetaDataModel->EvaluateL( *filter ) ); + + CleanupStack::PopAndDestroy( filter ); + if( err ) + { + iMetaDataModel->DeleteLastSuite(); + iSuiteContainer->PopSuiteModelL( + HnConvUtils::Str8ToStr( ( *suiteNameArray )[i] )->Des() ); + sendToForeground = ETrue; + } + break; + } + } + + // set highlight only when path is valid! + if( suiteExists ) + { + HighlightPlacementFromUriL( parser.Extract( EUriFragment ) ); + } + + CleanupStack::PopAndDestroy( &host8 ); + CleanupStack::PopAndDestroy( suiteNameArray ); + CleanupStack::PopAndDestroy( uriBuf ); + +// send to foreground + if ( sendToForeground ) + { + CLiwGenericParamList* pl = CLiwGenericParamList::NewL(); + CleanupStack::PushL( pl ); + HandleModelEventL( KAppGainForeground, *pl ); + CleanupStack::PopAndDestroy( pl ); + iMetaDataModel->QueueForeground( CHnMdModel::ENever ); + } + + } + +// End of file diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnengine/src/hninstallnotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnengine/src/hninstallnotifier.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2007-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: Sis package installation event listener +* +*/ + + +#include <sacls.h> +#include "hninstallnotifier.h" + +// ============================ MEMBER FUNCTIONS ============================= + +// ----------------------------------------------------------------------------- +// CHnMulModelInstallNotifier::CHnMulModelInstallNotifier +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CHnInstallNotifier::CHnInstallNotifier( + MHnInstallNotifierCallback* aCallback, + TUid aCategory, + TUint aKey ) : CActive( EPriorityNormal ) + { + CActiveScheduler::Add( this ); + + iCallback = aCallback; + iCategory = aCategory; + iKey = aKey; + // Prepare automatically + TInt err = iProperty.Attach( iCategory, iKey ); + SetActive(); + iStatus = KRequestPending; + iProperty.Subscribe( iStatus ); + } + +// ----------------------------------------------------------------------------- +// CHnMulModelInstallNotifier::ConstructL +// S2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CHnInstallNotifier::ConstructL() + { + + } + +// --------------------------------------------------------------------------- +// CHnMulModelInstallNotifier::NewL +// --------------------------------------------------------------------------- +// +CHnInstallNotifier* CHnInstallNotifier:: + NewL( MHnInstallNotifierCallback* aCallback, + TUid aCategory, + TUint aKey ) + { + CHnInstallNotifier* self = + new (ELeave) CHnInstallNotifier( aCallback, + aCategory, + aKey ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// --------------------------------------------------------------------------- +// CHnMulModelInstallNotifier::~CHnMulModelInstallNotifier +// --------------------------------------------------------------------------- +// +CHnInstallNotifier::~CHnInstallNotifier() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// CHnMulModelInstallNotifier::DoCancel +// --------------------------------------------------------------------------- +// +void CHnInstallNotifier::DoCancel() + { + iProperty.Cancel(); + } + +// --------------------------------------------------------------------------- +// CHnMulModelInstallNotifier::RunError +// --------------------------------------------------------------------------- +// +TInt CHnInstallNotifier::RunError( TInt /*aError*/ ) + { + // No need to do anything + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CHnMulModelInstallNotifier::RunL +// --------------------------------------------------------------------------- +// +void CHnInstallNotifier::RunL() + { + // Re-issue request before notifying + SetActive(); + iStatus = KRequestPending; + iProperty.Subscribe( iStatus ); + + TInt status; + User::LeaveIfError( iProperty.Get( KUidSystemCategory, + KSAUidSoftwareInstallKeyValue,status )); + + iCallback->InstallChangeL( status ); + } +// End of File diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/bwins/hnmetadatamodelu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/bwins/hnmetadatamodelu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,53 @@ +EXPORTS + ?SetSuiteNameL@CHnFilter@@QAEXABVTDesC16@@@Z @ 1 NONAME ; void CHnFilter::SetSuiteNameL(class TDesC16 const &) + ?Id@CHnMdEvent@@QBEHXZ @ 2 NONAME ; int CHnMdEvent::Id(void) const + ?NewLC@CHnItemId@@SAPAV1@ABVTDesC16@@0@Z @ 3 NONAME ; class CHnItemId * CHnItemId::NewLC(class TDesC16 const &, class TDesC16 const &) + ?GetAlternativeWidgetNumber@CHnMdSuite@@QAEHXZ @ 4 NONAME ; int CHnMdSuite::GetAlternativeWidgetNumber(void) + ?GetSuiteParameters@CHnMdSuite@@QAEAAVCLiwGenericParamList@@XZ @ 5 NONAME ; class CLiwGenericParamList & CHnMdSuite::GetSuiteParameters(void) + ?ReloadLocalizationL@CHnMdModel@@QAEXXZ @ 6 NONAME ; void CHnMdModel::ReloadLocalizationL(void) + ?QueueForeground@CHnMdModel@@QAEXW4TForegroundGainTriggeringEvent@1@@Z @ 7 NONAME ; void CHnMdModel::QueueForeground(enum CHnMdModel::TForegroundGainTriggeringEvent) + ?ReadFileL@HnUtils@@SAPAVHBufC8@@ABVTDesC16@@@Z @ 8 NONAME ; class HBufC8 * HnUtils::ReadFileL(class TDesC16 const &) + ?GetModelL@CHnXmlModelProvider@@QAEHABVTDesC16@@AAVRXmlEngDocument@@@Z @ 9 NONAME ; int CHnXmlModelProvider::GetModelL(class TDesC16 const &, class RXmlEngDocument &) + ?GetLastSuite@CHnMdModel@@QAEPAVCHnMdSuite@@XZ @ 10 NONAME ; class CHnMdSuite * CHnMdModel::GetLastSuite(void) + ?GetColumnTextColumnCount@HnUtils@@SAHABVTDesC8@@VTChar@@@Z @ 11 NONAME ; int HnUtils::GetColumnTextColumnCount(class TDesC8 const &, class TChar) + ?SetSuiteParametersL@CHnMdSuite@@QAEXAAVCLiwGenericParamList@@@Z @ 12 NONAME ; void CHnMdSuite::SetSuiteParametersL(class CLiwGenericParamList &) + ?NewLC@CHnXmlModelProvider@@SAPAV1@XZ @ 13 NONAME ; class CHnXmlModelProvider * CHnXmlModelProvider::NewLC(void) + ?NewLC@CHnMdModel@@SAPAV1@PAVMHnMdModelEventObserver@@PAVCHnSuiteModelContainer@@@Z @ 14 NONAME ; class CHnMdModel * CHnMdModel::NewLC(class MHnMdModelEventObserver *, class CHnSuiteModelContainer *) + ?IsForegroundQueued@CHnMdModel@@QBEHXZ @ 15 NONAME ; int CHnMdModel::IsForegroundQueued(void) const + ?NewL@CHnXmlModelProvider@@SAPAV1@XZ @ 16 NONAME ; class CHnXmlModelProvider * CHnXmlModelProvider::NewL(void) + ?SetModeL@CHnMdModel@@QAEXW4TMdMode@@@Z @ 17 NONAME ; void CHnMdModel::SetModeL(enum TMdMode) + ?AppendItemIdL@CHnFilter@@QAEXPAVCHnItemId@@@Z @ 18 NONAME ; void CHnFilter::AppendItemIdL(class CHnItemId *) + ?HandleSisInstallationEventL@CHnMdModel@@QAEXPAVCHnSuiteModelContainer@@@Z @ 19 NONAME ; void CHnMdModel::HandleSisInstallationEventL(class CHnSuiteModelContainer *) + ?ReadFileLC@HnUtils@@SAPAVHBufC8@@ABVTDesC16@@@Z @ 20 NONAME ; class HBufC8 * HnUtils::ReadFileLC(class TDesC16 const &) + ?LoadSuiteL@CHnMdModel@@QAEHABVTDesC16@@PAVCLiwGenericParamList@@@Z @ 21 NONAME ; int CHnMdModel::LoadSuiteL(class TDesC16 const &, class CLiwGenericParamList *) + ?SuiteModelExistsL@CHnMdModel@@QAEHABVTDesC8@@@Z @ 22 NONAME ; int CHnMdModel::SuiteModelExistsL(class TDesC8 const &) + ?HandleBackEventL@CHnMdModel@@QAEHPAVCHnSuiteModelContainer@@ABVTDesC16@@H@Z @ 23 NONAME ; int CHnMdModel::HandleBackEventL(class CHnSuiteModelContainer *, class TDesC16 const &, int) + ?SuiteName@CHnItemId@@QBEABVTDesC16@@XZ @ 24 NONAME ; class TDesC16 const & CHnItemId::SuiteName(void) const + ?Template@CHnMdItem@@QAEAAVTDesC8@@XZ @ 25 NONAME ; class TDesC8 & CHnMdItem::Template(void) + ?SetAttributeL@HnUtils@@SAXABVTXmlEngElement@@AAVRBuf8@@@Z @ 26 NONAME ; void HnUtils::SetAttributeL(class TXmlEngElement const &, class RBuf8 &) + ?ReleaseLocalization@CHnMdModel@@QAEXXZ @ 27 NONAME ; void CHnMdModel::ReleaseLocalization(void) + ?DeleteLastSuite@CHnMdModel@@QAEXXZ @ 28 NONAME ; void CHnMdModel::DeleteLastSuite(void) + ?NewLC@CHnFilter@@SAPAV1@XZ @ 29 NONAME ; class CHnFilter * CHnFilter::NewLC(void) + ?EvaluateL@CHnMdModel@@QAEXXZ @ 30 NONAME ; void CHnMdModel::EvaluateL(void) + ?SetAttributeL@HnUtils@@SAXABVTXmlEngElement@@ABVTDesC8@@AAVRBuf8@@@Z @ 31 NONAME ; void HnUtils::SetAttributeL(class TXmlEngElement const &, class TDesC8 const &, class RBuf8 &) + ?Compare@CHnItemId@@QBEHABV1@@Z @ 32 NONAME ; int CHnItemId::Compare(class CHnItemId const &) const + ?LocateFileLC@HnUtils@@SAPAVHBufC16@@ABVTDesC16@@@Z @ 33 NONAME ; class HBufC16 * HnUtils::LocateFileLC(class TDesC16 const &) + ?Uid@CHnMdItem@@QAEAAVTDesC8@@XZ @ 34 NONAME ; class TDesC8 & CHnMdItem::Uid(void) + ?SetEvaluateSuiteL@CHnFilter@@QAEXH@Z @ 35 NONAME ; void CHnFilter::SetEvaluateSuiteL(int) + ?GetColumnTextLC@HnUtils@@SAPAVHBufC8@@HABVTDesC8@@VTChar@@@Z @ 36 NONAME ; class HBufC8 * HnUtils::GetColumnTextLC(int, class TDesC8 const &, class TChar) + ?LocateNearestLanguageFileLC@HnUtils@@SAPAVHBufC16@@ABVTDesC16@@@Z @ 37 NONAME ; class HBufC16 * HnUtils::LocateNearestLanguageFileLC(class TDesC16 const &) + ?SetSuiteId@CHnFilter@@QAEXH@Z @ 38 NONAME ; void CHnFilter::SetSuiteId(int) + ?NewL@CHnFilter@@SAPAV1@XZ @ 39 NONAME ; class CHnFilter * CHnFilter::NewL(void) + ?SuiteName@CHnMdSuite@@QAEABVTDesC16@@XZ @ 40 NONAME ; class TDesC16 const & CHnMdSuite::SuiteName(void) + ?UpdateL@CHnItemId@@QAEXABV1@@Z @ 41 NONAME ; void CHnItemId::UpdateL(class CHnItemId const &) + ?Type@CHnMdItem@@QAEAAVTDesC8@@XZ @ 42 NONAME ; class TDesC8 & CHnMdItem::Type(void) + ?ReloadModelL@CHnXmlModelProvider@@QAEXXZ @ 43 NONAME ; void CHnXmlModelProvider::ReloadModelL(void) + ??1CHnXmlModelProvider@@UAE@XZ @ 44 NONAME ; CHnXmlModelProvider::~CHnXmlModelProvider(void) + ?NewL@CHnItemId@@SAPAV1@ABVTDesC16@@0@Z @ 45 NONAME ; class CHnItemId * CHnItemId::NewL(class TDesC16 const &, class TDesC16 const &) + ?Id@CHnItemId@@QBEABVTDesC16@@XZ @ 46 NONAME ; class TDesC16 const & CHnItemId::Id(void) const + ?EvaluateL@CHnMdModel@@QAEXAAVCHnFilter@@@Z @ 47 NONAME ; void CHnMdModel::EvaluateL(class CHnFilter &) + ?NewL@CHnMdModel@@SAPAV1@PAVMHnMdModelEventObserver@@PAVCHnSuiteModelContainer@@@Z @ 48 NONAME ; class CHnMdModel * CHnMdModel::NewL(class MHnMdModelEventObserver *, class CHnSuiteModelContainer *) + ?GetSuiteParameters@CHnMdModel@@QAEAAVCLiwGenericParamList@@H@Z @ 49 NONAME ; class CLiwGenericParamList & CHnMdModel::GetSuiteParameters(int) + ?IgnoreEvaluations@CHnMdModel@@QAEXH@Z @ 50 NONAME ; void CHnMdModel::IgnoreEvaluations(int) + ?GetCurrentUriL@CHnMdModel@@QAEXAAVTDes16@@@Z @ 51 NONAME ; void CHnMdModel::GetCurrentUriL(class TDes16 &) + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/eabi/hnmetadatamodelu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/eabi/hnmetadatamodelu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,54 @@ +EXPORTS + _ZN10CHnMdModel10LoadSuiteLERK7TDesC16P20CLiwGenericParamList @ 1 NONAME + _ZN10CHnMdModel12GetLastSuiteEv @ 2 NONAME + _ZN10CHnMdModel14GetCurrentUriLER6TDes16 @ 3 NONAME + _ZN10CHnMdModel15DeleteLastSuiteEv @ 4 NONAME + _ZN10CHnMdModel15QueueForegroundENS_30TForegroundGainTriggeringEventE @ 5 NONAME + _ZN10CHnMdModel16HandleBackEventLEP22CHnSuiteModelContainerRK7TDesC16i @ 6 NONAME + _ZN10CHnMdModel17IgnoreEvaluationsEi @ 7 NONAME + _ZN10CHnMdModel17SuiteModelExistsLERK6TDesC8 @ 8 NONAME + _ZN10CHnMdModel18GetSuiteParametersEi @ 9 NONAME + _ZN10CHnMdModel19ReleaseLocalizationEv @ 10 NONAME + _ZN10CHnMdModel19ReloadLocalizationLEv @ 11 NONAME + _ZN10CHnMdModel27HandleSisInstallationEventLEP22CHnSuiteModelContainer @ 12 NONAME + _ZN10CHnMdModel4NewLEP23MHnMdModelEventObserverP22CHnSuiteModelContainer @ 13 NONAME + _ZN10CHnMdModel5NewLCEP23MHnMdModelEventObserverP22CHnSuiteModelContainer @ 14 NONAME + _ZN10CHnMdModel8SetModeLE7TMdMode @ 15 NONAME + _ZN10CHnMdModel9EvaluateLER9CHnFilter @ 16 NONAME + _ZN10CHnMdModel9EvaluateLEv @ 17 NONAME + _ZN10CHnMdSuite18GetSuiteParametersEv @ 18 NONAME + _ZN10CHnMdSuite19SetSuiteParametersLER20CLiwGenericParamList @ 19 NONAME + _ZN10CHnMdSuite26GetAlternativeWidgetNumberEv @ 20 NONAME + _ZN10CHnMdSuite9SuiteNameEv @ 21 NONAME + _ZN19CHnXmlModelProvider12ReloadModelLEv @ 22 NONAME + _ZN19CHnXmlModelProvider4NewLEv @ 23 NONAME + _ZN19CHnXmlModelProvider5NewLCEv @ 24 NONAME + _ZN19CHnXmlModelProvider9GetModelLERK7TDesC16R15RXmlEngDocument @ 25 NONAME + _ZN19CHnXmlModelProviderD0Ev @ 26 NONAME + _ZN19CHnXmlModelProviderD1Ev @ 27 NONAME + _ZN19CHnXmlModelProviderD2Ev @ 28 NONAME + _ZN7HnUtils10ReadFileLCERK7TDesC16 @ 29 NONAME + _ZN7HnUtils12LocateFileLCERK7TDesC16 @ 30 NONAME + _ZN7HnUtils13SetAttributeLERK14TXmlEngElementR5RBuf8 @ 31 NONAME + _ZN7HnUtils13SetAttributeLERK14TXmlEngElementRK6TDesC8R5RBuf8 @ 32 NONAME + _ZN7HnUtils15GetColumnTextLCEiRK6TDesC85TChar @ 33 NONAME + _ZN7HnUtils24GetColumnTextColumnCountERK6TDesC85TChar @ 34 NONAME + _ZN7HnUtils27LocateNearestLanguageFileLCERK7TDesC16 @ 35 NONAME + _ZN7HnUtils9ReadFileLERK7TDesC16 @ 36 NONAME + _ZN9CHnFilter10SetSuiteIdEi @ 37 NONAME + _ZN9CHnFilter13AppendItemIdLEP9CHnItemId @ 38 NONAME + _ZN9CHnFilter13SetSuiteNameLERK7TDesC16 @ 39 NONAME + _ZN9CHnFilter17SetEvaluateSuiteLEi @ 40 NONAME + _ZN9CHnFilter4NewLEv @ 41 NONAME + _ZN9CHnFilter5NewLCEv @ 42 NONAME + _ZN9CHnItemId4NewLERK7TDesC16S2_ @ 43 NONAME + _ZN9CHnItemId5NewLCERK7TDesC16S2_ @ 44 NONAME + _ZN9CHnItemId7UpdateLERKS_ @ 45 NONAME + _ZN9CHnMdItem3UidEv @ 46 NONAME + _ZN9CHnMdItem4TypeEv @ 47 NONAME + _ZN9CHnMdItem8TemplateEv @ 48 NONAME + _ZNK10CHnMdModel18IsForegroundQueuedEv @ 49 NONAME + _ZNK9CHnItemId2IdEv @ 50 NONAME + _ZNK9CHnItemId7CompareERKS_ @ 51 NONAME + _ZNK9CHnItemId9SuiteNameEv @ 52 NONAME + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project hnmetadatamodel +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/hnmdmodel.h |../../../inc/hnmdmodel.h +../inc/hnfilter.h |../../../inc/hnfilter.h +../inc/hnitemid.h |../../../inc/hnitemid.h +../inc/hnutils.h |../../../inc/hnutils.h +../inc/hnglobals.h |../../../inc/hnglobals.h +../inc/hnhelper.inl |../../../inc/hnhelper.inl +../inc/hnqueryresultcollector.h |../../../inc/hnqueryresultcollector.h +../inc/hnmdsuite.h |../../../inc/hnmdsuite.h +../inc/hnmdvaluebase.h |../../../inc/hnmdvaluebase.h + +PRJ_MMPFILES +hnmetadatamodel.mmp + +PRJ_TESTMMPFILES +#ifdef _MATRIX_MENU_INCLUDE_TEST_CONTENT +#include "../internal/test/group/bld.inf" +#endif diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/group/hnmetadatamodel.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/group/hnmetadatamodel.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,120 @@ +/* +* 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: Project definition file for project hierarchy navigator meta data model +* +*/ + + +#include <platform_paths.hrh> +#include <data_caging_paths.hrh> + +TARGET hnmetadatamodel.dll +TARGETTYPE dll + +UID 0x1000008d 0x2000F8C7 + +CAPABILITY CAP_GENERAL_DLL + + +VENDORID VID_DEFAULT + +SOURCEPATH ../src + +SOURCE hnmdaction.cpp +SOURCE hnmditem.cpp +SOURCE hnmdevent.cpp +SOURCE hnmdeventmapping.cpp +SOURCE hnmdeventmappingelement.cpp +SOURCE hnmdquery.cpp +SOURCE hnmdsuite.cpp +SOURCE hnmdvaluebase.cpp +SOURCE hnmdvalueimage.cpp +SOURCE hnmdvaluetext.cpp +SOURCE hnmduimapping.cpp +SOURCE hnmduimappingelement.cpp +SOURCE hnmdmenuitem.cpp +SOURCE hnmdmodel.cpp +SOURCE hnutils.cpp +SOURCE hnmdlocalizationelement.cpp +SOURCE hnmdlocalization.cpp +SOURCE hnmdqueries.cpp +SOURCE hnstringhandler.cpp +SOURCE hnfilter.cpp +SOURCE hnitemid.cpp +SOURCE hnxmlmodelprovider.cpp +SOURCE hnmdnotifyrequest.cpp +SOURCE hnmdnotifyrequests.cpp +SOURCE hnmdbutton.cpp +SOURCE hnmdtoolbar.cpp +SOURCE hnrepositoryobserver.cpp +SOURCE hnmdservicecommand.cpp +SOURCE hnmdservice.cpp +SOURCE hnsimplecondition.cpp +SOURCE hncomplexcondition.cpp +SOURCE hnconditionfactory.cpp +SOURCE hnsimpleconditionequal.cpp +SOURCE hnsimpleconditiondifferent.cpp +SOURCE hnsimpleconditionsmaller.cpp +SOURCE hnqueryresultcollector.cpp +SOURCE hnsimpleconditiongreater.cpp +SOURCE hnsimpleconditionhas.cpp +SOURCE hnsimpleconditionhasnot.cpp +SOURCE hnxmlmodelcache.cpp +SOURCE hnxmlsuitefilesreg.cpp +SOURCE hnbitmapidcache.cpp + +USERINCLUDE ../inc +//USERINCLUDE ../../../inc + +SYSTEMINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY estor.lib +LIBRARY euser.lib +LIBRARY XmlEngineDOM.lib +LIBRARY bafl.lib +LIBRARY efsrv.lib +LIBRARY cone.lib //for CCoeEnv +LIBRARY CommonEngine.lib //for String Loader +LIBRARY mmextensionmanager.lib +LIBRARY liwservicehandler.lib //LIW Framework +LIBRARY hnpresentationmodel.lib +LIBRARY aknicon.lib +LIBRARY XCFW.lib +LIBRARY libpthread.lib +LIBRARY aknskins.lib +LIBRARY aknskinsrv.lib +LIBRARY aknswallpaperutils.lib +LIBRARY CentralRepository.lib +LIBRARY hnutilities.lib +LIBRARY mediaclientimage.lib +LIBRARY fbscli.lib +LIBRARY egul.lib +LIBRARY cenrepnotifhandler.lib +LIBRARY bitgdi.lib +LIBRARY ws32.lib +LIBRARY gdi.lib +LIBRARY sysutil.lib + +#ifdef _MATRIX_MENU_TRACE_PERFORMANCE +LIBRARY flogger.lib +#else +DEBUGLIBRARY flogger.lib +#endif + + + +// End of file + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnbitmapidcache.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnbitmapidcache.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2007-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: +* Version : %version: 3 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef HNXMLMODELCACHE_H_ +#define HNXMLMODELCACHE_H_ + +#include <e32base.h> +#include <e32hashtab.h> +#include <xmlengdom.h> +#include <bautils.h> + + +/** + * Bitmaps and masks ids cache. + * + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnBitmapIdCache ) : public CBase + { + +private: + + /** + * Default constructor. + * + * @since S60 5.0 + */ + CHnBitmapIdCache(); + + /** + * Standard second phase constructor. + * + * @since S60 5.0 + */ + void ConstructL(); + +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + */ + static CHnBitmapIdCache* NewLC(); + + /** + * Two-phase constructor. + * + * + */ + static CHnBitmapIdCache* NewL(); + + /** + * Adds a new entry into the cache. + * @param aKey A key identifying a pair: key - value. + * @param aValue A value. + * + * @since S60 5.0 + */ + TInt AddL( const TDesC8& aKey, TInt aValue ); + + /** + * Checks if the cache contains an entry identifies by a given key. + * + * @param aSuiteName The name of the suite to be checked. + * @return ETrue if a suite of a given name is stored in the cache, + * otherwise - EFalse. + * + * @since S60 5.0 + */ + TBool ExistsL( const TDesC8& aKey ); + + /** + * Gets an integer value by a given name. + * + * @param aSuiteName The name corresponding to the xml document to be + * retrieved from the cache. + * @param aDocument The reference to the xml document. + * + * @since S60 5.0 + */ + void GetL( const TDesC8& aKey, TInt& aValue ); + + /** + * Resets the cache - removes all stored xml documents. + * + * @since S60 5.0 + */ + void Reset(); + + /** + * Standard C++ virtual destructor. + * + * @since S60 5.0 + */ + virtual ~CHnBitmapIdCache(); + +private: + + /** + * The hash map storing pairs: and an integer value. + * + * @since S60 5.0 + */ + RHashMap< HBufC8*, TInt > iEntries; + + }; + +#endif /*HNXMLMODELCACHE_H_*/ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hncomplexcondition.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hncomplexcondition.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNCOMPLEXCONDITION_H +#define C_HNCOMPLEXCONDITION_H + +#include <e32base.h> +#include <e32hashtab.h> +#include <xmlengelement.h> + +#include "hnconditioninterface.h" + +class CLiwGenericParamList; + +/** + * Complex condition. + * + * This class is designed to support complex conditions in the xml configuration. + * + * @lib hnmetadatamodel + * @since S60 v3.2 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnComplexCondition) : public CHnConditionInterface + { +public: + + + /** + * Standard factory function. + * + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnComplexCondition* NewL( TDesC8 & aElement ); + + /** + * Standard C++ Destructor + */ + ~CHnComplexCondition(); + + /** + * Returns result. + * + * @since S60 v3.2 + * @param aQueryResults Results of query. + * @param aPos Position in the list. + * @return True if condition of true, otherwise false. + */ + TBool ResultL( const CLiwGenericParamList& aQueryResults, TInt aPos ); + +protected: + + /** + * Standard C++ Constructor + */ + CHnComplexCondition(); + + /** + * Standard symbian second phase constructor. + * + * @param aElement Xml element. + */ + void ConstructL( TDesC8 & aElement ); + + /** + * Prepares the condition for processng. + * Removes excessive white characters and + * superfluous parentheses + * + * @param aConditionString Condition string. + */ + TBool CheckForOrOnTheSameLevelL( TDesC8 & aConditionString ); + +protected: // data + + /** + * Logical operation between conditions. + */ + TOperator iOperation; + + /** + * Own - left side of the condition. + */ + CHnConditionInterface* iLeftCondition; + + /** + * Own - right side of the condition. + */ + CHnConditionInterface* iRightCondition; + + }; + +#endif // C_HNCOMPLEXCONDITION_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnconditionfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnconditionfactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNCONDITIONFACTORY_H +#define C_HNCONDITIONFACTORY_H + +#include <e32def.h> +#include <e32base.h> +#include <e32hashtab.h> +#include <xmlengelement.h> + +class CHnConditionInterface; + +/** + * Condition factory. + * + * The purpose of this class is the creation of different types of the condition objects. + * + * @lib hnmetadatamodel + * @since S60 v3.2 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(HnConditionFactory) + { +public: + + /** + * Standard factory function. + * + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnConditionInterface* NewL( TXmlEngAttr aElement ); + + /** + * Standard factory function. + * + * @param aElement Xml element + * @return Fully constructed object. + */ + static CHnConditionInterface* NewLC( TXmlEngAttr aElement ); + + /** + * Standard factory function. + * + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnConditionInterface* NewL( TDesC8 & aElement ); + + /** + * Standard factory function. + * + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnConditionInterface* NewLC( TDesC8 & aElement ); + +private: + + /** + * Prepares the condition for processng. + * Removes excessive white characters and + * superfluous parentheses + * + * @param aConditionString Condition string. + */ + static void TrimConditionL( RBuf8 & aConditionString ); + + /** + * Check condition's brace integrity. + * + * @param aConditionString Condition string. + * @return Error code. + */ + static TInt CheckBraceIntegrityL( TDesC8 & aConditionString ); + + /** + * Constructs condition appropriate to its properties. + * + * @param aConditionString Condition string. + * @return A pointer to the condition's interface. + */ + static CHnConditionInterface* ConstructConditionL( TDesC8 & aConditionString ); + + }; + +#endif // C_HNCONDITIONFACTORY_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnconditioninterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnconditioninterface.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNCONDITIONINTERFACE_H +#define C_HNCONDITIONINTERFACE_H + +#include <e32base.h> + +class CLiwGenericParamList; + +enum TOperator + { + EOpeningBrace = '(', + EClosingBrace = ')', + ELogicalAnd = '&', + ELogicalOr = '|', + ESpace = ' ' + }; + +/** + * Condition Interface + * + * This class is an interface for conditions. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnConditionInterface ) : public CBase + { + +public: + /** + * Returns result. + * + * @since S60 v3.2 + * @param aQueryResults Results of query. + * @param aPos position the list. + * @return True if condition is true, otherwise false. + */ + virtual TBool ResultL( const CLiwGenericParamList& aQueryResults, TInt aPos = 0 ) = 0; + + }; + +#endif // C_HNCONDITIONINTERFACE_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnfilter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnfilter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,224 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef C_HNFILTER_H +#define C_HNFILTER_H + + +#include <e32base.h> + +class CHnItemId; + +/** + * Evaluation Filter + * + * This class is a filter which is used during evaluation. + * Due to the content of this filter the appropriate actions are taken. + * + * @lib hnmetadatamodel + * @since S60 v3.2 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnFilter ) : public CBase + { +public: + /** + * Standard factory method. + * + * since S60 v5.0 + * @return Filer object. + */ + IMPORT_C static CHnFilter* NewL(); + + /** + * Standard factory method. + * + * since S60 v5.0 + * @return Filter object. + */ + IMPORT_C static CHnFilter* NewLC(); + + /** + * standard destructor + */ + ~CHnFilter(); + +public: + + /** + * Returns iGenre + * + * @since S60 v5.0 + * @return Suite's name. + */ + const TDesC& SuiteName() const; + + /** + * Checks if has item ids. + * + * @since S60 v5.0 + * @return True if a filter has item ids. + */ + TBool HasItemIds() const; + + /** + * Checks if has genre + * + * @since S60 v5.0 + * @return True if suite has name. + */ + TBool HasSuiteName() const; + + /** + * Resets iterator. + * + * @since S60 v5.0 + */ + void ResetIterator(); + + /** + * Gets next item id. + * + * @since S60 v5.0 + * @return Next item id. + */ + const CHnItemId* GetNextItemId() const; + + /** + * Checks if has next item id. + * + * @since S60 v5.0 + * @return True if there is next item id. + */ + TBool HasNextItemId(); + + /** + * Resets genre. + * + * @since S60 v5.0 + */ + void ResetSuiteName(); + + /** + * Resets item ids + * + * @since S60 v5.0 + */ + void ResetItemIds(); + + /** + * Set genre. + * + * @since S60 v5.0 + * @param aGenre Suite's name. + */ + IMPORT_C void SetSuiteNameL( const TDesC& aGenre ); + + /** + * Append item id. + * NOTE: This class takes the ownership of the given CHnItemId. + * + * @since S60 v5.0 + * @param iItemId Item id. + */ + IMPORT_C void AppendItemIdL( CHnItemId* iItemId ); + + /** + * Marks suites for evaluation. + * + * @since S60 v5.0 + * @param aEvaluate ValueL of the flag + */ + IMPORT_C void SetEvaluateSuiteL( TBool aEvaluate ); + + /** + * Checks if the suite(s) should be evalauted. + * + * @since S60 v5.0 + */ + TBool IsEvaluateSuite(); + + /** + * Set suite id. + * + * @since S60 v5.0 + * @param aSuiteId Suite's id. + */ + IMPORT_C void SetSuiteId( const TInt aSuiteId ); + + /** + * Returns iSuiteId + * + * @since S60 v5.0 + * @return Suite's id. + */ + TInt SuiteId() const; + + /** + * Checks if has suite id + * + * @since S60 v5.0 + * @return True if suite has id. + */ + TBool HasSuiteId() const; + +private: + + /** + * standard constructor + */ + CHnFilter(); + + /** + * EPOC default constructor for performing 2nd stage construction + */ + void ConstructL(); + + +private: // data + + /** + * Suite's genre/name. + */ + RBuf iGenre; + + /** + * Items' ids. + */ + RPointerArray< CHnItemId > iItemIds; + + /** + * Flag determines if the suites should also be evaluated. + * If set to false, just items are evaluated. + * By default it is set to true. + */ + TBool iEvaluateSuite; + + /** + * Current index of item id -> for iterator support + */ + mutable TInt iIter; + + /** + * Suite Id + */ + TInt iSuiteId; + + }; + +#endif //C_HNFILTER_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnglobals.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnglobals.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,623 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef C_HNGLOBALS_H +#define C_HNGLOBALS_H + +#include <f32file.h> + +/** + * Default size for svg icons. + */ +const TInt KDefaultSvgIconSize = 60; + +/** + * Maximum size for icons loaded from files containing + * raster graphics, such as png, jpg. This does not + * apply to MIF and MBM files. + */ +const TInt KMaxIconBitmapSize = 240; + +/** + * Maximun integer character length + */ +const TInt KMaxLength = 12; + +/** + * Single character length. + */ +const TInt KSingleChar( 1 ); + +/** + * Default datagranularity. + */ +const TInt KDefaultGranularity( 8 ); + +/** + * Max digit number. + */ +const TInt KMaxDigitNumber( 10 ); + +/** + * A number of cached suites. + */ +const TInt KXmlModelCacheMaxLength( 10 ); + +/** + * Used to check if root suite loaded for display. + */ +const TInt KModelCountForRoot( 1 ); + +/** + * KErrNoMemory code from MenuService + */ +const TInt KSErrNoMemory = 1007; +/** + * Logical relations namespace + */ +namespace HnLogicalRelations + { + /** + * Greater. + */ + _LIT8( KLogicalGreater8, ">" ); + + /** + * Less. + */ + _LIT8( KLogicalLess8, "<" ); + + /** + * Equals. + */ + _LIT8( KLogicalEqual8, "=" ); + + /** + * Different. + */ + _LIT8( KLogicalDifferent8, "!=" ); + + /** + * And. + */ + _LIT8( KLogicalAnd8, "&" ); + + /** + * Or. + */ + _LIT8( KLogicalOr8, "|" ); + + /** + * Nas. + */ + _LIT8( KLogicalHas8, "HAS" ); + + /** + * Has not. + */ + _LIT8( KLogicalHasNot8, "HASNOT" ); + } + +/** + * Event namespace + */ +namespace HnEvent + { + /** + * Event data. + */ + _LIT8( KEventArgNamespace8, "event_data"); + + /** + * Dropped before custom id. + */ + _LIT8( KDroppedBefore8, "dropped_before_custom_id" ); + + /** + * Dragged custom id. + */ + _LIT8( KDragged8, "dragged_custom_id" ); + + /** + * Highlight offset. + */ + _LIT8( KHighlightOffset8, "highlight_offset" ); + + } + + +_LIT8( KMm8, "mm" ); +_LIT8( KContentElementName8, "content" ); +_LIT8( KSuiteElementName8, "suite" ); +_LIT8( KItemElementName8, "item" ); +_LIT8( KActionElementName8, "action" ); +_LIT8( KEventElementName8, "event" ); +_LIT8( KMenuItemElementName8, "menuitem" ); +_LIT8( KMenuItemSpecificElementName8, "menuitem_specific" ); +_LIT8( KLocalizationElementName8, "localization" ); +_LIT8( KNotifyRequestElementName8, "notify_request" ); +_LIT8( KMenuButton8, "button" ); +_LIT8( KMiddleSoftKey8, "msk" ); +_LIT8( KMenuToolbar8, "toolbar" ); + +_LIT8 ( KName8, "name" ); + +_LIT8( KQueryElementItem8, "query" ); +_LIT8( KConstructorElementItem8 , "constructor" ); +_LIT8( KCommandElementItem8 , "command" ); +_LIT8( KOutputElementItem8 , "output" ); +_LIT8( KImageElementItem8, "image" ); +_LIT8( KTextElementItem8, "text" ); +_LIT8( KIdAttrName8, "id" ); +_LIT8( KFolderAttrName8, "folder" ); + + +_LIT8( KCommandModeAsync8, "async" ); +_LIT8( KCommandNameAttr8, "name" ); +_LIT8( KCommandModeAttr8, "mode" ); + +_LIT8( KContentTypeElementItem8, "contenttype" ); +_LIT8( KFilterElementItem8, "filter" ); +_LIT8( KKeyElementItem8, "key" ); + +_LIT8( KKeyAttrName8, "key" ); +_LIT8( KTypeAttrName8, "type" ); +_LIT8( KValueAttrName8, "value" ); +_LIT8( KEventAttrName8, "event" ); +_LIT8( KPositionAttrName8, "position" ); +_LIT8( KMenuConditionAttrName8, "condition" ); +_LIT8( KIndexAttrName8, "index" ); +_LIT8( KMenuDimmAttrName8, "dimm" ); +_LIT8( KGenreAttrName8, "genre" ); +_LIT8( KTitleAttrName8, "title" ); +_LIT8( KEmptyTextAttrName8, "emptytext" ); +_LIT8( KNameAttrName8, "name" ); +_LIT8( KWidgetAttrName8, "widget" ); +_LIT8( KCountAttrName8, "count" ); +_LIT8( KTemplateAttrName8, "template" ); +_LIT8( KTemplateEmpty8, "empty" ); +_LIT8( KWidgetTypeAttrName8, "type" ); +_LIT8( KItemIdAttrName8, "id" ); +_LIT8( KNameSpaceAttrName8, "namespace" ); +_LIT8( KServiceAttrName8, "service" ); +_LIT8( KAliasAttrName8, "alias" ); +_LIT8( KParams8, "params"); + +_LIT8( KEditModeItem8, "edit_mode"); +_LIT8( KInterfaceAttrName8, "interface" ); + +_LIT8 ( KKeyTypeString, "string" ); +_LIT8 ( KKeyTypeString8, "string8" ); +_LIT8 ( KKeyTypeString16, "string16" ); +_LIT8 ( KKeyTypeInteger, "integer" ); +_LIT8 ( KKeyTypeInteger64, "integer64" ); +_LIT8 ( KKeyTypeUInteger, "uinteger" ); +_LIT8 ( KKeyTypeUid , "uid" ); +_LIT8 ( KKeyTypeBoolean, "boolean" ); +_LIT8 ( KKeyTypeMap, "map" ); +_LIT8 ( KKeyTypeList, "list" ); +_LIT8 ( KIdsList, "item_ids" ); + +_LIT8 ( KAction, "action"); +_LIT8 ( KActionRemove, "remove"); +_LIT8 ( KIdParam, "id" ); +_LIT8 ( KMenuApplication8, "menu:application" ); +_LIT ( KMenuApplication, "menu:application" ); +_LIT8 ( KMenuParentFolder8, "custom:parent_folder" ); +_LIT ( KMenuParentFolder, "custom:parent_folder" ); +_LIT8 ( KMenuFolder8, "menu:folder" ); +_LIT ( KMenuFolder, "menu:folder" ); +_LIT8 ( KMenuSuite8, "menu:suite" ); +_LIT ( KMenuSuite, "menu:suite" ); +_LIT8 ( KId8, "id" ); +_LIT8 ( KUid8, "uid" ); +_LIT8 ( KMcsTitleName8, "title_name" ); +_LIT8 ( KMcsAppGroupName8, "applicationgroup_name" ); +_LIT8 ( KMcsShortName8, "short_name" ); +_LIT8 ( KMcsLongName8, "long_name" ); +_LIT8 ( KMatrixMenuData, "matrixmenudata" ); +_LIT8 ( KServiceContentName, "ContentName" ); +_LIT8 ( KType8, "type" ); +_LIT8( KIdPath8, "ReturnValue:[$index]/id" ); +_LIT8( KTypePath8, "ReturnValue:[$index]/type" ); +_LIT8( KTitleNamePath8, "ReturnValue:[$index]/title_name" ); +_LIT8( KAppGroupNamePath8, "ReturnValue:[$index]/applicationgroup_name" ); +_LIT8( KLongNamePath8, "ReturnValue:[$index]/long_name" ); +_LIT8( KShortNamePath8, "ReturnValue:[$index]/short_name" ); +_LIT8( KDeleteLockedPath8, "ReturnValue:[$index]/delete_locked" ); +_LIT8( KParentIdPath8, "ReturnValue:[$index]/parent_id" ); +_LIT8( KChildrenCountPath8, "ReturnValue/[$index]/children_count" ); +_LIT8( KMcsTemplateTypePath8, "ReturnValue/[$index]/template" ); +_LIT8( KMcsWidgetTypePath8, "ReturnValue/[$index]/widget_type" ); + +_LIT8( KWidgetTypePath8, "params:widget_type" ); +_LIT8( KTemplatePath8, "params:template" ); +_LIT( KTemplatePath, "params:template" ); +_LIT( KWidgetTypePath, "params:widget_type" ); +_LIT8( KReturnValue8, "ReturnValue" ); +_LIT8( KErrorCode8, "ErrorCode" ); +_LIT8( KParentFolderId8, "parent_folder_id" ); +_LIT8( KTmpParentFolderId8, "tmp_parent_folder_id" ); + +_LIT( KCommandDeleteDialog, "MMDeleteDialogs" ); + +_LIT8 ( KSourceAttrName8, "source" ); + +_LIT( KColon, ":" ); +_LIT8( KColon8, ":" ); +_LIT( KBslash, "\\" ); +_LIT( KSlash, "/" ); +_LIT8( KSlash8, "/" ); +_LIT( KOpenBracket, "(" ); +_LIT( KCloseBracket, ")" ); +_LIT8( KOpenSquareBracket, "[" ); +_LIT8( KCloseSquareBracket, "]" ); +_LIT8( KHexPrefix8, "0x" ); +_LIT( KHexPrefix16, "0x" ); +_LIT( KPipe, "|" ); +_LIT( KBlank, ""); + +_LIT( KResourceSeparator, " = " ); +_LIT( KComma, "," ); +_LIT8( KComma8, "," ); + +_LIT( KRsg, ".rsg"); +_LIT( KMbg, ".mbg"); +_LIT( KRscPath, ":\\resource\\apps\\"); + +_LIT( KPrefMm, "mm://" ); +_LIT8( KRootWithPref, "mm://root" ); +_LIT8( KSetFocusWithPref, "mm://!setfocus" ); +_LIT8( KCRepTimeFormat, "%S,%04d%02d%02d:%02d%02d%02d.%06d" ); + +// images +_LIT8( KSkinIdMajor8, "skinid_major" ); +_LIT8( KSkinIdMinor8, "skinid_minor" ); +_LIT8( KBitmapId8, "bitmap_id" ); +_LIT8( KMaskId8, "mask_id" ); +_LIT8( KAppUid8, "application_uid" ); +_LIT8( KBitmap8, "bitmap" ); +_LIT8( KMask8, "mask" ); +_LIT8( KMifFile8, "mif_file" ); + +_LIT( KSvgFileExtension, ".svg" ); + +// texts +_LIT8( KResourceAttrName8, "resource"); +_LIT8( KFile8, "file" ); + +// services + +_LIT8( KServiceMultimediaMenu, "MultimediaMenu"); +_LIT8( KServiceOpenSuite, "OpenSuite"); +_LIT8( KServiceStartEditMode, "StartEditMode"); +_LIT8( KServiceStopEditMode, "StopEditMode"); +_LIT8( KServiceSwitchWidget, "SwitchWidget"); +_LIT8( KServiceBack, "Back"); +_LIT8( KSetFocus, "SetFocus"); +_LIT8( KMoveFocusBeforeDelete, "MoveFocusBeforeDelete"); +_LIT8( KRefreshIcons, "RefreshIcons" ); +_LIT8( KEvaluateMdModel, "EvaluateMdModel" ); +_LIT8( KDisableActionsForItem, "DisableActionsForItem" ); + +_LIT( KSuiteName, "suite_name" ); +_LIT8( KSuiteName8, "suite_name" ); + +// +_LIT8 ( KHnRequest, "KHnRequest" ); +// widget types +_LIT8 ( KSuite8, "suite" ); +_LIT ( KFolderSuite, "foldersuite" ); +_LIT8 ( KWidgetType8, "type" ); +_LIT8 ( KAllowedTypes8, "allowed_types" ); +_LIT8 ( KWidgetTypeList8, "list" ); +_LIT8 ( KWidgetTypeCoverFlow8, "coverflow" ); +_LIT8 ( KWidgetTypeGrid8, "grid" ); + +_LIT( KWidgetTypeList, "list" ); +_LIT( KWidgetTypeCoverFlow, "coverflow" ); +_LIT( KWidgetTypeGrid, "grid" ); + +_LIT( KStringFalse, "FALSE" ); +_LIT( KStringTrue, "TRUE" ); + +_LIT8( KStringFalse8, "FALSE" ); +_LIT8( KStringTrue8, "TRUE" ); + +_LIT( KSuitesDir, "import\\suites\\" ); +_LIT( KXmlExt, ".xml" ); +_LIT( Kbackslash, "\\" ); + +_LIT( KSuiteDefFileName, "suite.xml" ); +_LIT( KTitle, "mul_title" ); +_LIT8( KTitle8, "mul_title" ); +_LIT8( KTemplate8, "mul_template" ); + +_LIT8( KTitleName8, "suite" ); +_LIT8( KItemName8, "item" ); +_LIT8( KGenreName8, "genre" ); +_LIT8( KLocalizationName8, "localization" ); + +_LIT8( KEventName8, "event" ); +_LIT8( KMenuItemName8, "menuitem" ); +_LIT( KMenuItemName, "menuitem" ); +_LIT8( KMenuItemSpecificName8, "menuitem_specific" ); +_LIT( KMenuItemSpecificName, "menuitem_specific" ); + +_LIT( KRoot, "root" ); +_LIT8( KRoot8, "root" ); +_LIT( KExtension, ".r" ); // rsc, r01, r02, etc. +_LIT( KExtensionRsc, ".rsc" ); + + +_LIT8( KHexStart8, "0x"); +_LIT( KDrive , "C:"); +_LIT( KEntriesSuffix, "suites\\"); + +_LIT8( KMoveLocked8, "move_locked" ); +_LIT8( KRemoveLocked8, "remove_locked" ); +_LIT8( KRunning8, "running" ); +_LIT8( KDrmProtection8, "drm_protection" ); +_LIT8( KItemType8, "type" ); +_LIT8( KCustomId8, "custom_id" ); +_LIT8( KItemCustomId8, "item_custom_id" ); +_LIT8( KIndexShift8, "index_shift" ); +_LIT8( KSuiteCustomId8, "suite_custom_id" ); +_LIT8( KItemTypeUnknown8, "unknown" ); +_LIT8( KItemTypeFolder8, "folder" ); +_LIT8( KItemUid8, "uid" ); + +_LIT8( KMenuDrmUnknown8, "unknown" ); +_LIT( KMenuDrmRightsExpired, "expired" ); + + +//From hnmodel.h +// model events +_LIT( KNewSuiteLoadedMdEvent, "new_suite_loaded"); +_LIT( KOpenSuiteMdEvent, "open_suite" ); +_LIT( KReevaluateMdEvent, "reevaluate_model" ); +_LIT( KSwitchWidgetMdEvent, "switch_widget" ); +_LIT( KStartEditModeMdEvent, "start_edit_mode" ); +_LIT( KStopEditModeMdEvent, "stop_edit_mode" ); +_LIT( KZoomLarge, "zoom_large" ); +_LIT( KZoomNormal, "zoom_normal" ); +_LIT( KZoomSmall, "zoom_small" ); +_LIT( KAppGainForeground, "gain_foreground" ); +_LIT( KAppGainBackground, "gain_background" ); +_LIT( KSetFocusEvent, "set_focus" ); +_LIT( KRefreshUiMdEvent, "refresh_ui" ); +_LIT( KRefreshToolbarMdEvent, "refresh_toolbar" ); +_LIT( KBackMdEvent, "back" ); +_LIT( KResetToRoot, "reset_to_root"); + +// model event-related params + +_LIT8( KParentId8, "parent_id" ); +_LIT8( KDefaultParentId8, "1" ); +_LIT( KDefaultParentId, "1" ); +_LIT8( KDefaultCount8, "1" ); + +_LIT( KMatrixPanic, "Matrix Error" ); + +// debug strings +#ifdef _DEBUG + +_LIT( KEventMapLogFile, "c:\\logs\\menu\\event_ids.txt" ); +_LIT( KSuiteLoadingLogFile, "c:\\logs\\menu" ); + +#endif// _DEBUG + +// info notes for notifying lack of configuration files +_LIT( KDebugNoteDirNotFound, + "Directory containing suite configuration not found!" ); +_LIT( KDebugNoteFileNotFound, + "File containing suite configuration not found!" ); +_LIT( KDebugNoteOtherError, + "Loading suite configuration returned error: %d" ); + +_LIT8( KStar8, "*" ); + + +_LIT( KKeyEmpty, "key:empty" ); +_LIT( KKeySelect, "key:select" ); +_LIT( KKeySelect2, "key:select2" ); +_LIT( KKeySelect3, "key:select3" ); +_LIT( KKeyCall, "key:call" ); +_LIT( KKeyClear, "key:clear" ); +_LIT( KKeyMove, "key:move" ); +_LIT( KKeyMoveInto, "key:move_into" ); +_LIT( KOnSuiteLoad, "suite:load" ); +_LIT( KOnSuiteUnLoad, "suite:unload" ); +_LIT( KOnFocusGain, "item:focus" ); +_LIT( KOnFocusLost, "item:unfocus" ); + +_LIT8( KIndexWithBrackets8, "[$index]"); +_LIT8( KIndex8, "$index" ); +_LIT( KIndex, "$index" ); +_LIT8( KCount, "/[$count]" ); + + +/** EActiveSpaceActionKeyEmpty */ +const TInt KKeyIdEmpty = 0; + +/** EActiveSpaceActionKeySelect */ +const TInt KKeyIdSelect = 1; + +/** EActiveSpaceActionKeySelect2 */ +const TInt KKeyIdSelect2 = 2; + +/** EActiveSpaceActionKeySelect3 */ +const TInt KKeyIdSelect3 = 3; + +/** EActiveSpaceActionKeyCall */ +const TInt KKeyIdCall = 4; + +const TInt KKeyIdClear = 6; + +const TInt KIdSuiteLoad = 7; + +const TInt KIdSuiteUnLoad = 8; + +const TInt KIdFocusGain = 9; + +const TInt KIdFocusLost = 10; + +const TInt KKeyIdMove = 11; + +const TInt KKeyIdMoveInto = 12; + +const TInt KKeyIdMoveHighlight = 13; + + +const TInt KCustomKeyOffset = 7000; + +// for XML model provider + +const TInt KHnDefaultGranularity = 5; + +/** Central Repository Uid for Matrix Menu */ +static const TUid KMatrixRepositoryUid = { 0x20012474 }; + +/** + * Following characters are not allowed in the names + */ +const TUint KNotAllowedChars[] = {'<', '>', '\\', '/', '"', '|', ':', '*', '?'}; + +/** Central Repository Uid for Appshell (needed to detect folder change) */ +static const TUid KCRUidMenu = {0x101f8847}; + +const TInt KRootId = 1 ; + +const TUint32 KMenuShowFolder = 0x0000000c; + +const TInt KTimeStampBufferLength = 25; + +const TInt KUidStringLength = 10; + +const TInt KTimeStampCutOff = 5; + +/** + * Order in which drives are searched for suites. + */ +const TInt KDriveSearchOrder[] = { EDriveY, EDriveX, EDriveW, EDriveV, EDriveU, + EDriveT, EDriveS, EDriveR, EDriveQ, EDriveP, EDriveO, EDriveN, EDriveM, + EDriveL, EDriveK, EDriveJ, EDriveI, EDriveH, EDriveG, EDriveF, EDriveE, + EDriveD, EDriveC, EDriveB, EDriveA, EDriveZ }; + +/** + * Type of the widget which displays Suite data + * + * @since S60 v5.0 + */ +enum THnSuiteWidgetType + { + EUnspecified = 0x00, + EGridWidget = 0x01, + EListWidget = 0x02, + ECoverFlowWidget = 0x04, + EChangeWidget = 0x05 + }; + +/** + * Service Mode + */ +enum TServiceMode + { + EServiceModeUndefined = 0, + EServiceModeSynchronous, + EServiceModeAsynchronous + }; + +/** + * Image source + */ +enum TImageSource + { + EImageSourceUndefined = 0, + EImageSourceFile, + EImageSourceResource, + EImageSourceApplicationUid, + EImageSourceLiw + }; + +/** + * Custom item ids. + */ +enum TCustomId + { + ECustomIdFirstItem = -2, + ECustomIdLastItem = -3 + }; + +/** + * Suite's exit mode + */ +enum TExitMode + { + EExitModeNormal = 0, + EExitModeHide + }; + +/** + * Type of change in items number + */ +enum TItemsChangeType { + EItemsAdded = 0, + EItemsRemoved +}; + +_LIT8( KExitModeParams, "params:exit" ); +_LIT8( KActionParams, "params:action" ); +_LIT( KExitModeHide, "hide" ); +_LIT( KActionExit, "exit" ); + +/* + * MCS + */ +_LIT8(KMCSDataSourceInterface8, "IDataSource"); +_LIT8(KMCSMenuContentInterface8, "IMenuContent"); +_LIT8(KMCSService8, "Service.MenuContent"); +// Search and Result Types +_LIT8(KRecursiveSearch8, "recursive_search"); +_LIT8(KFlatResult8, "flat_result"); +_LIT8(KParentOnly8, "parent_only"); +_LIT8(KIncludeParent8, "include_parent"); +// GetList Parameters +_LIT8(KInData8, "InData"); +_LIT8(KFilter8, "Filter"); +// Command Names +_LIT8(KCmdAdd8, "Add"); +_LIT8(KCmdDelete8, "Delete"); +_LIT8(KCmdExecuteAction8, "ExecuteAction"); +_LIT8(KCmdGetList8, "GetList"); +_LIT8(KCmdOrganize8, "Organize"); +// Flags +_LIT8(KDeleteLocked8, "delete_locked"); +_LIT8(KHidden8, "hidden"); +_LIT8(KMissing8, "missing"); +// Organize Parameters +_LIT8(KFolderId8, "folder_id"); +_LIT8(KBeforeItemId8, "before_item_id"); + +_LIT8( KUriHighlight, "uri_highlight" ); +_LIT8( KParamsUriHighlight, "params:uri_highlight" ); + +_LIT8( KUriHighlightSuite, "uri_highlight_suite" ); +_LIT8( KParamsUriHighlightSuite, "params:uri_highlight_suite" ); + +#endif // C_HNGLOBALS_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnhelper.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnhelper.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef HNHELPER_H +#define HNHELPER_H + +#include <e32hashtab.h> + +/** + * Creates hash. + * + * @param aBuf Descriptor. + * @return Hash. + */ +inline TUint32 HBuf16Hash( HBufC16* const & aBuf ) + { + return DefaultHash::Des16(*aBuf); + } + +/** + * Creates hash. + * + * @param aBuf Descriptor. + * @return Hash. + */ +inline TUint32 TDesC16Hash( const TDesC16* const & aBuf ) + { + return DefaultHash::Des16(*aBuf); + } + +/** + * Checks for indentity. + * + * @param aL Descriptor. + * @param aR Descriptor. + * @return Bool. + */ +inline TBool HBuf16Ident( HBufC16* const & aL, HBufC16* const & aR ) + { + return DefaultIdentity::Des16(*aL, *aR); + } + +/** + * Checks for indentity. + * + * @param aL Descriptor. + * @param aR Descriptor. + * @return Bool. + */ +inline TBool TDesC16Ident( const TDesC16* const & aL, const TDesC16* const & aR ) + { + return DefaultIdentity::Des16(*aL, *aR); + } + +/** + * Destroys both key and value object of a hashmap. + */ +template <class TKey, class TValue> +void DestroyMapKeyAndValue( RHashMap< TKey*, TValue* > & aHashMap ) + { + THashMapIter< TKey*, TValue* > iter( aHashMap ); + while ( iter.NextKey() ) + { + delete *(iter.CurrentKey()); + delete *(iter.CurrentValue()); + } + } + +/** + * Destroys just value object of a hashmap. + */ +template <class TKey, class TValue> +void DestroyMapValue( RHashMap< TKey*, TValue* > & aHashMap ) + { + THashMapIter< TKey*, TValue* > iter( aHashMap ); + while ( iter.NextKey() ) + { + delete *(iter.CurrentValue()); + } + } + +#endif /* HNHELPER_H */ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnitemid.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnitemid.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HN_ITEM_FILTER_H +#define C_HN_ITEM_FILTER_H + + +#include <e32base.h> +#include <s32file.h> +#include <s32mem.h> + + +/** + * Item Id. + * + * This class represtnets the id of the item. + * It comprises a file name in which the item was defined + * and the numerical identifier. + * + * @lib hnmetadatamodel + * @since S60 v3.2 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnItemId) : + public CBase + { +public: + /** + * Standard factory method. + * + * since S60 v5.0 + * @param aFile File name. + * @param aID Item's numerical identifier. + * @return Fully constructed object. + */ + IMPORT_C static CHnItemId* NewL( const TDesC& aFile, + const TDesC& aID ); + + /** + * Standard factory method. + * + * since S60 v5.0 + * @param aFile File name. + * @param aID Item's numerical identifier. + * @return Fully constructed object. + */ + IMPORT_C static CHnItemId* NewLC(const TDesC& aFile, + const TDesC& aID ); + + /** + * Standard factory method. + * + * since S60 v5.0 + * @param aItemId Item id. + * @return Fully constructed object. + */ + IMPORT_C void UpdateL(const CHnItemId & aItemId ); + + /** + * Default destructor + */ + ~CHnItemId(); + + /** + * Get suite name. + * + * @return Suite's name. + */ + IMPORT_C const TDesC& SuiteName() const; + + /** + * Returns Id. + * + * @return Textual identifier. + */ + IMPORT_C const TDesC& Id() const; + + /** + * Compares fileName to filter. + * + * @param aItemId Item id. + * @return True if aItemId is equal to current item id (this). + */ + IMPORT_C TBool Compare( const CHnItemId& aItemId ) const; + +private: + + /** + * default constructor + */ + CHnItemId(); + + /** + * EPOC default constructor for performing 2nd stage construction + * + * @param aFile File name. + * @param aID Textual identifier of an item. + */ + void ConstructL( const TDesC& aFile, const TDesC& aID ); + +private: // data + + /** + * Own - Filename. + */ + RBuf iSuiteName; + + /** + * Own - Id. + */ + RBuf iId; + + }; + +#endif //C_HN_ITEM_FILTER_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdaction.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDACTION_H +#define C_HNMDACTION_H + +#include <e32base.h> +#include <xmlengdom.h> + +class CLiwGenericParamList; +class CLiwDefaultMap; +class TLiwVariant; +class CHnMdBaseKey; +class CHnMdServiceCommand; +class CHnActionModel; +class CHnMdService; +class CHnConditionInterface; + +/** + * Action. + * + * This is the class that represents the action. Actions are used + * to invoke different functions or methods from services, plugins + * or internally defined in the Matrix Menu. + * + * @lib hnmetadatamodel + * @since S60 v5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdAction) : public CBase + { +public: + + /** + * Standard factory method. + * + * since S60 v5.0 + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnMdAction* NewL( TXmlEngElement aElement ); + + /** + * Standard factory method. + * + * since S60 v5.0 + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnMdAction* NewLC( TXmlEngElement aElement ); + + /** + * standard destructor + */ + virtual ~CHnMdAction(); + + /** + * Evaluates action model based on the instance of meta data action. + * + * @since S60 5.0 + * @param aActionModel Visual model af an action. + * @param aQueriesResultsList Query results. + * @param aPos Position in the query. + * @return Error code. + */ + TInt EvaluateL( CHnActionModel* aActionModel, + const CLiwGenericParamList& aQueriesResultsList, + TInt aPos = 0); + /** + * Checks if the menu item is valid. + * + * @since S60 5.0 + * @param aQueryResults Query results in the form of the CLiwGenericParamList object. + * @param aPos Position in the query. + * @return True if valid, otherwise false. + */ + TBool IsValidL( const CLiwGenericParamList& aQueryResults, + TInt aPos = 0 ); + +private: + + /** + * Default constructor. + */ + CHnMdAction(); + + /** + * EPOC default constructor for performing 2nd stage construction. + * + * @param aElement Xml element. + */ + void ConstructL( TXmlEngElement aElement ); + + /** + * Sets interface. + * @param aAttr Xml attribute. + */ + void SetConditionL( TXmlEngAttr aAttr ); + + +private: // data + + /** + * Own - Condition. + */ + CHnConditionInterface* iCondition; + + /** + * Own. + */ + CHnMdService* iService; + + }; + +#endif // C_HNMMACTION_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdbutton.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdbutton.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,174 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef HNMDBUTTON_H_ +#define HNMDBUTTON_H_ + +#include <e32base.h> + +struct THnMdCommonPointers; +class CHnCondition; +class CLiwGenericParamList; +class CGulIcon; +class CHnMdValueImage; +class CHnMdValueText; +class TXmlEngElement; +class CHnConditionInterface; +class CHnAttributeBase; + +/** + * Toolbar button. + * + * This class represents the toolbar button. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnMdButton ) : public CBase + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @param aCmnPtrs Common pointers. + * @return Constructed object. + */ + static CHnMdButton* NewLC( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Standard C++ virtual destructor. + * + * @since S60 5.0 + */ + ~CHnMdButton( ); + + /** + * Checks if the button should be added. + * + * @since S60 5.0 + * @param aQueryResults Query results in the form of a CLiwGenericParamList. + * @param aPos Position of the record in the above results. + * @return True if valid. + */ + TBool ValidateToAddL( const CLiwGenericParamList& aQueryResults, + TInt aPos = 0 ); + + /** + * Checks if the button should be added. + * + * @since S60 5.0 + * @param aQueryResults Query results in the form of a CLiwGenericParamList. + * @param aPos Position of the record in the above results. + * @return True if valid. + */ + TBool ValidateToDimmL( const CLiwGenericParamList& aQueryResults, + TInt aPos = 0 ); + + /** + * Gets the id for event generated by this button. + * + * @return Event Id. + */ + TInt GetEventId() const; + + /** + * Gets the index of button. + * + * @return Index. + */ + TInt GetIndex() const; + + /** + * Evaluates button text. + * + * @param aQueryResults Results from service. + * @param aPos Position of item, needed for parsing the path to query. + * @return Button text + */ + const TPtrC EvaluateButtonTextL( + const CLiwGenericParamList& aQueryResults, TInt aPos = 0 ); + + /** + * Evaluates and returns an icon for the button. + * + * @param aQueriesResultsList Results from service. + * @param aPos Position of item. + * @return bit map + */ +// CGulIcon* EvaluateIconL( const CLiwGenericParamList& aQueriesResultsList, +// TInt aPos ) const; + CHnAttributeBase* EvaluateIconL( const CLiwGenericParamList& aQueriesResultsList, + TInt aPos ) const; +private: + /** + * Standard C++ constructor. + * + * @since S60 5.0 + */ + CHnMdButton(); + + /** + * Standard symbian 2nd pahse constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @param aCmnPtrs Common pointers. + */ + void ConstructL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + +private: // data + + /** + * Own - Help text string handler. + */ + CHnMdValueText* iButtonText; + + /** + * Index. + */ + TInt iIndex; + + /** + * Event element. + */ + TInt iEventId; + + /** + * Own - Condition - if passed, button is added to toolbar. + */ + CHnConditionInterface* iConditionAdd; + + /** + * Own - Condition - if passed, button is dimmed. + */ + CHnConditionInterface* iConditionDimm; + + /** + * Own - Keeps icon for button. + */ + CHnMdValueImage* iIcon; + + }; + +#endif // HNMDBUTTON_H_ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdevent.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdevent.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef C_HNMDEVENT_H +#define C_HNMDEVENT_H + +#include <e32base.h> + +/** + * Event. + * + * An object of this class represents an event (identified + * by id). + * + * @lib hnmetadatamodel + * @since S60 v5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdEvent) : public CBase + { +public: + + /** + * Standard factory method. + * + * since S60 v5.0 + * @param aId Identifier. + * @return Fully constructed object. + */ + static CHnMdEvent* NewL( const TInt aId ); + + /** + * Standard factory method. + * + * since S60 v5.0 + * @param aId Identifier. + * @return Fully constructed object. + */ + + static CHnMdEvent* NewLC( const TInt aId ); + + /** + * Standard destructor. + */ + virtual ~CHnMdEvent(); + + /** + * Returns Id. + * + * since S60 v5.0 + * @return iId Identifier of the event. + */ + IMPORT_C TInt Id() const; + + /** + * Sets Id. + * + * @param aId Identifier. + */ + void SetId( TInt aId ); + +private: + + /** + * Standard constructor. + */ + CHnMdEvent(); + + /** + * EPOC default constructor for performing 2nd stage construction. + * + * @param aId Identifier. + */ + void ConstructL( const TInt aId ); + +private: // data + + /** + * Event's identifier. + */ + TInt iId; + + }; + +#endif // C_HNMMEVENT_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdeventmapping.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdeventmapping.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDEVENTMAPPING_H +#define C_HNMDEVENTMAPPING_H + +#include <e32base.h> +#include <e32hashtab.h> +#include <xmlengdom.h> + +#include "hnmdmodel.h" + +class CHnMdEventMappingElement; +class CHnMdItem; +class CHnMdAction; +struct THnMdCommonPointers; +class CHnActionModel; +class CHnItemModel; +class CHnSuiteModel; + +/** + * Event Mapping. + * + * This class is to store event mapping elements defined + * in one suite. + * + * @lib hnmetadatamodel + * @since S60 v5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdEventMapping) : public CBase + { +public: + + /** + * Standard factory method. + * + * since S60 v5.0 + * @param aElement Xml element. + * @param aCmnPtrs Common pointers container. + * @return Fully constructed object. + */ + static CHnMdEventMapping* NewL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Standard factory method. + * + * since S60 v5.0 + * @param aElement Xml element. + * @param aCmnPtrs Common pointers container. + * @return Fully constructed object. + */ + static CHnMdEventMapping* NewLC( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Fills actions models container with evaluated actions. + * + * since S60 v5.0 + * @param aActions Actions container to be filled with actions models. + * @param aQueriesResultsList Query results. + * @param aPos Position in the query. + */ + void FillActionsL( RHashMap< TInt, CArrayPtr<CHnActionModel>* >& aActions, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos = 0 ); + + /** + * Standard destructor. + */ + virtual ~CHnMdEventMapping(); + + /** + * Gets list of actions correspondig to given event id. + * + * @param aEventId Event's identifier. + * @return Actions list corresponding to the event. + */ + RPointerArray< CHnMdAction > GetActionsForEventId( TInt aEventId ); + + /** + * Gets events ids. + * + * @param aIds Array to be filled with events ids. + */ + void GetEventIdsL( RArray< TInt >& aIds ) const; + +private: + + /** + * Gets action by event id. + * + * @return A number of actions. + */ + TInt Count() const; + + /** + * Gets action by event id. + * + * @param aActions Actions container to which action model will be added. + * @param aActionModel An evaluated action model. + * @param aEventId An event id. + */ + void AddActionL( + RHashMap<TInt,CArrayPtr<CHnActionModel> *> & aActions, + CHnActionModel *& aActionModel, TInt aEventId ); + + /** + * default constructot + */ + CHnMdEventMapping(); + + /** + * EPOC default constructor for performing 2nd stage construction. + * + * @param aElement Xml element. + * @param aCmnPtrs Common pointers container. + */ + void ConstructL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + +private: // data + + /** + * Mappings. + */ + RPointerArray<CHnMdEventMappingElement> iMappings; + + /** + * Common pointers. + * Not own. + */ + THnMdCommonPointers* iCmnPtrs; + + }; + +#endif // C_HNMMEVENTMAPPING_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdeventmappingelement.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdeventmappingelement.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDEVENTMAPPINGELEMENT_H +#define C_HNMDEVENTMAPPINGELEMENT_H + +#include <e32base.h> +#include <xmlengdom.h> + +#include "hnglobals.h" + +class CHnMdItem; +class CHnMdAction; +class CHnMdEvent; +struct THnMdCommonPointers; + +/** + * Event Mapping Element. + * + * This class is used to bind key events (or different events) + * with specific actions. + + * + * @lib hierarchynavigatorengine + * @since S60 v5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdEventMappingElement) : public CBase + { +public: + /** + * Standard factory method. + * + * since S60 v5.0 + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnMdEventMappingElement* NewL( TXmlEngElement aElement ); + + /** + * Standard factory method. + * + * since S60 v5.0 + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnMdEventMappingElement* NewLC( TXmlEngElement aElement ); + + /** + * Default destructor. + */ + virtual ~CHnMdEventMappingElement(); + + /** + * Returns actions. + * + * @return A list of actions stored in an object of this class. + */ + RPointerArray<CHnMdAction>& Actions(); + + /** + * Returns events. + * + * @return A list of events stored in the object of this class. + */ + const RPointerArray<CHnMdEvent>& Events() const; + + +private: + + /** + * Standard constructor. + */ + CHnMdEventMappingElement(); + + /** + * EPOC default constructor for performing 2nd stage construction. + * + * @param aElement Xml element. + */ + void ConstructL( TXmlEngElement aElement ); + + /** + * Adds an event to the list of events. + * + * @param aEvent A pointer to the event object. + */ + void AddEventL( CHnMdEvent* aEvent ); + + /** + * Sets events on the base of the xml element. + * + * @param aElement Xml element. + */ + void SetEventsL( TXmlEngElement aElement ); + + /** + * Sets actions on the base of the xml element. + * + * @param aElement Xml element. + */ + void SetActionsL( TXmlEngElement aElement ); + +private: // data + + /** + * Own - Events. + */ + RPointerArray<CHnMdEvent> iEvents; + + /** + * Own - Actions. + */ + RPointerArray<CHnMdAction> iActions; + + }; + +#endif // C_HNMEVENTMAPPINGELEMENT_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmditem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmditem.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,635 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDITEM_H +#define C_HNMDITEM_H + +#include <e32base.h> + +#include "hnmdmodel.h" +#include "hnmdeventmapping.h" +#include "hnqueryresultcollector.h" + +class CHnMdQuery; +class CHnMdButton; +class CHnMdQueries; +class CHnMdNotifyRequests; +class CHnSuiteModel; +class CLiwGenericParamList; +class CLiwDefaultMap; +class THnIdGenerator; +class CHnFilter; +class CHnMdUiMapping; +class CHnMdMenuItem; +class CHnItemId; +class CHnMdSuite; +class CHnXmlModelProvider; +class CHnItemModel; +class CHnMenuItemModel; +class CHnActionModel; +class CHnMdToolbar; +struct THnMdCommonPointers; +class CHnConditionInterface; + +/** + * Item. + * + * This is the item's class. Each item (or items' group - + * the count attribute has a value greater then 1) is represented + * by an object of the CHnMdItem class. + * + * This class comprises different classes which are responsible for + * conditions, queries, notifications (refreshing), etc. + * + * @lib hnmetadatamodel + * @since S60 v5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdItem) : public CBase, + public MHnQueryResultCollectorNotification + { +public: + + /** + * Standard factory method. + * + * since S60 v5.0 + * @param aElement Xml element. + * @param aCmnPtrs Common pointers container. + * @return Fully constructed object. + */ + static CHnMdItem* NewL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Standard factory method. + * + * since S60 v5.0 + * @param aElement Xml element. + * @param aCmnPtrs Common pointers container. + * @return Fully constructed object. + */ + static CHnMdItem* NewLC( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Default destructor. + */ + virtual ~CHnMdItem(); + + /** + * Updates an item. + * + * @param aGraphicalList A graphical list. + * @param aId Item's identifier. + * @param aResultMap A results map. + * @return An error code. + */ + void UpdateItemL( CHnSuiteModel* aGraphicalList, TInt aId, + RHashMap< HBufC*, CLiwGenericParamList*>& aResultMap ); + /** + * Compares entries. + * + * @param aSearchCriteria Search critieria item id. + * @return True if this item matches aSearchCriteria. + */ + TBool CompareItems( CHnItemId* aSearchCriteria ); + + /** + * Evaluates an item. + * + * @since S60 v3.2 + * @param aSuiteModel A suite's model. + * @param aParamList Paramters of the evaluation. + * @param aItemPosition A position of an item in the aParamList. + */ + void EvaluateItemL( CHnSuiteModel & aSuiteModel, + CLiwGenericParamList& aParamList, + TInt aItemPosition ); + + /** + * Marks according to filter which item should be evaluated. + * + * @since S60 5.0 + * @param aFilter Filter. + */ + void MarkEvaluationL( CHnFilter& aFilter ); + + /** + * Sets template. + * + * @param aOption Option - an identifier of alternative template bo be set. + */ + void SetAlternativeTemplateL( TInt aOption ); + + /** + * Sets edit mode version of the item. + * + * @param aEditModeItem Edit mode item. + * @return Meta data model of the edit mode version. + */ + void SetAlternativeModeItem(CHnMdItem* aEditModeItem); + + /** + * Sets edit mode version of the item. + * Transfers ownership. + * + * @return Meta data model of the edit mode version. + */ + CHnMdItem* TakeAlternativeModeItem(); + + /** + * Checks if mode version of the item is present. + * + * @return True if an item has an alternative model to be set. + */ + TBool HasAlternativeModeItem() const; + + /** + * Template property getter. + * + * @return The name of the template. + */ + IMPORT_C TDesC8& Template(); + + /** + * Type property getter. + * + * @return Type of an item. + */ + IMPORT_C TDesC8& Type(); + + /** + * Type property getter. + * + * @return Type of an item. + */ + IMPORT_C TDesC8& Uid(); + + // from queries collector + /** + * Triggered when results have been collected. + * + * @param aResults Results. + */ + virtual void ResultsCollectedL( CLiwGenericParamList* aResults ); + +private: + + /** + * Sets edit mode item. + * + * @param aElement Xml element. + */ + void SetEditModeItemL( TXmlEngElement aElement ); + + /** + * Sets count. + * + * @param aElement Xml element. + */ + void SetCountL( TXmlEngElement aElement ); + + /** + * Sets template. + * + * @param aAttr Xml attribute. + */ + void SetTemplateL( TXmlEngAttr aAttr ); + + /** + * Sets queries. + * + * @param aElement Xml element. + */ + void SetQueriesL( TXmlEngElement aElement ); + + /** + * Sets item id. + * + * @param aItemElement Xml element. + */ + void SetItemIdL( TXmlEngElement aItemElement ); + + /** + * Sets item id. + * + * @param aAttrFileName Xml attribute - file name. + * @param aId Xml attribute - item's identifier. + */ + void SetItemId2L( TXmlEngAttr aAttrFileName, TXmlEngAttr aId ); + + /** + * Evaluates item. + * + * @param aSuiteModel A model of the suite. + * @param aItemId Item's id. + * @param aParamList Parameters of the evaluation in the form of the CLiwGenericParamList. + * @param aItemPosition A position of the record of the parameters list. + * @return Error code. + */ + TInt EvaluateItemL( CHnSuiteModel & aSuiteModel, + const CHnItemId* aItemId, CLiwGenericParamList& aParamList, + TInt aItemPosition ); + + /** + * Evaluates item. + * + * @param aSuiteModel A model of the suite. + * @param aParamList Parameters of the evaluation in the form of the CLiwGenericParamList. + * @param aItemPosition A position of the record of the parameters list. + */ + void EvaluateItemItselfL( CHnSuiteModel & aSuiteModel, + CLiwGenericParamList& aParamList, TInt aItemPosition ); + + /** + * Sets template attribute on item model. + * + * @param aItemModel Item's model. + */ + void SetTemplateL( CHnItemModel* aItemModel ); + + /** + * Mode. + * + * @returns Mode of an item, e.g. normal / edit mode. + */ + TMdMode Mode(); + + /** + * Retrieves values from outputs containing the [$index] string. + * + * @param aValues Array containing found strings. + * @param aElement The xml element. + * @return Number of found strings. + */ + TInt GetIndexValuesFromOutputsL( RPointerArray<HBufC8> &aValues, TXmlEngElement aElement ); + +private: + + /** + * Standard constructor. + */ + CHnMdItem(); + + /** + * EPOC default constructor for performing 2nd stage construction. + * + * @param aElement Xml element. + * @param aCmnPtrs Common pointers containter. + */ + void ConstructL( TXmlEngElement aElement,THnMdCommonPointers* aCmnPtrs ); + + /** + * Fills item model with data. + * + * @param aItemModel Model to be filled. + * @param aQueriesResultsList Parameters of in the form of the CLiwGenericParamList. + * @param aPosition A position of the record in the parameters list. + * @return True if filling finihed with success. + */ + TBool FillItemModelL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aQueriesResultsList, + TInt aPosition ); + + /** + * Fills item model with menu items created from meta data model. + * + * @param aItemModel Model to be filled. + * @param aQueriesResultsList Parameters of in the form of the CLiwGenericParamList. + * @param aPos A position of the record in the parameters list. + */ + void FillItemModelWithMenuItemsL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos = 0 ); + + /** + * Fills item model with toolbar created from meta data model. + * + * @param aItemModel Model to be filled. + * @param aQueriesResultsList Parameters of in the form of the CLiwGenericParamList. + * @param aPos A position of the record in the parameters list. + */ + void FillItemModelWithToolbarL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos = 0 ); + + /** + * Fills item model with MSK created from meta data model. + * + * @param aItemModel Model to be filled. + * @param aQueriesResultsList Parameters of in the form of the CLiwGenericParamList. + * @param aPos A position of the record in the parameters list. + */ + void FillItemModelWithMiddleSoftKeyL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos = 0 ); + + /** + * Fills menu model with data from mdmenuitem. + * + * @param aSuiteModel Suite's model. + * @param aItemId Item's identifier. + * @param aQueriesResultsList Queries results in form of the CLiwGenericParamList. + * @param aItemModelNumber Item's model number. + * @param aItemPos Position of an item in the queries results list. + * @return KErrNone if an item was successfully added. + */ + TInt AddItemL( CHnSuiteModel & aSuiteModel, TInt aItemId, + const CLiwGenericParamList& aQueriesResultsList, + TInt aItemModelNumber, + TInt aItemPos ); + + /** + * Fills menu model with data from mdmenuitem. + * + * @param aSuiteModel Suite's model. + * @param aItemId Item's identifier. + * @param aQueriesResultsList Queries results in form of the CLiwGenericParamList. + * @param aItemPos Position of an item in the queries results list. + * @return KErrNone if an item was successfully updated. + */ + TInt UpdateItemL( CHnSuiteModel & aSuiteModel, TInt aItemId, + const CLiwGenericParamList& aQueriesResultsList, TInt aItemPos ); + + /** + * Fills menu model with data from mdmenuitem. + * + * @param aSuiteModel Suite's model. + * @param aId Items identifier. + */ + void RemoveItemL( CHnSuiteModel & aSuiteModel, TInt aId ); + + /** + * Sets move/remove locked attribute. + * + * @param aElement Xml item element. + */ + void SetAttributesL( TXmlEngElement aElement ); + + /** + * Sets item type string. + * + * @param aElement Xml item element. + */ + void SetTypeL( TXmlEngElement aElement ); + + /** + * Sets uid string. + * + * @param aElement Xml item element. + */ + void SetUidL( TXmlEngElement aElement ); + + /** + * Sets delete / move locked attributes. + * + * @param aItemModel Model to be filled. + * @param aQueriesResultsList Parameters of in the form of the CLiwGenericParamList. + * @param aPos A position of the record in the parameters list. + */ + void SetDeleteMoveAttributesL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos ); + + + /** + * Sets custom id. + * + * @param aElement Xml item element. + */ + void SetCustomIdL( TXmlEngElement aElement ); + + /** + * Sets middle soft key. + * + * @param aElement Xml item element. + * @param aCmnPtrs Common pointers. + */ + void SetMiddleSoftKeyL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Checks if an item is valid (the condition returns true). + * + * @param aQueryResults Query results. + * @param aPos Position of the item in the results list. + * @return ETrue or EFalse dependeing on whether the item is valid. + */ + TBool IsValidL( const CLiwGenericParamList& aQueryResults, TInt aPos ); + + /** + * Sets the evaluated remove lock to the item model. + * + * @param aQueryResults Query results. + * @param aPos Position of the item in the results list. + * @param aItemModel Item model to set custom id on. + */ + void SetRemoveLockedL( const CLiwGenericParamList& aQueryResults, + TInt aPos, CHnItemModel* aItemModel ); + + /** + * Sets the evaluated move lock to the item model. + * + * @param aQueryResults Query results. + * @param aPos Position of the item in the results list. + * @param aItemModel Item model to set custom id on. + */ + void SetMoveLockedL( const CLiwGenericParamList& aQueryResults, + TInt aPos, CHnItemModel* aItemModel ); + + /** + * Sets the evaluated type to the item model. + * + * @param aQueryResults Query results. + * @param aPos Position of the item in the results list. + * @param aItemModel Item model to set custom id on. + */ + void SetTypeL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aQueryResults, TInt aPos ); + + /** + * Sets the uid to the item model. + * + * @param aQueryResults Query results. + * @param aPos Position of the item in the results list. + * @param aItemModel Item model to set custom id on. + */ + void SetUidL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aQueryResults, TInt aPos ); + + /** + * Sets custom id. + * + * @param aItemModel Model to be filled. + * @param aParams Parameters of in the form of the CLiwGenericParamList. + * @param aPos A position of the record in the parameters list. + */ + void SetCustomIdL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aParams, TInt aPos ); + + /** + * Returns the maximum possible number of items. + * + * @return Maximum number of items. + */ + TInt GetItemsMaxCountL(); + +private: // data + + /** + * Own - edit mode version of the item. + * However TakeAlternativeModeItem transfers ownership. + */ + CHnMdItem *iAlternativeModeItem; + + /** + * Count. + */ + RBuf8 iCount8; + + /** + * Template. + */ + RBuf8 iTemplate; + + /** + * Own - List of allowable widget types. + */ + CDesC8Array * iAllowableTemplate; + + /** + * Item id. + */ + CHnItemId* iItemId; + + /** + * Queries. + */ + CHnMdQueries* iQueries; + + /** + * Notify Requests. + */ + CHnMdNotifyRequests* iNotifyRequests; + + /** + * Event mapping. + */ + CHnMdEventMapping* iEventMapping; + + /** + * UI mapping. + */ + CHnMdUiMapping* iUiMapping; + + /** + * Menu item. + */ + CHnMdMenuItem* iMenu; + + /** + * Toolbar. + */ + CHnMdToolbar* iToolbar; + + /** + * Middle soft key button. + */ + CHnMdButton* iMsk; + + /** + * Delete locked indicator + */ + RBuf8 iRemoveLocked8; + + /** + * MoveLocked indicator. + */ + RBuf8 iMoveLocked8; + + /** + * Type of an item. + */ + RBuf8 iType8; + + /** + * Uid of the item. + */ + RBuf8 iUid8; + + /** + * Custom identifier. + */ + RBuf8 iCustomId8; + + /** + * Common pointers. + */ + THnMdCommonPointers* iCmnPtrs; + + /** + * Mode. + */ + TMdMode iMode; + + /** + * Query results list. + * Own - queries results. + */ + CLiwGenericParamList* iQueriesResultsList; + + /** + * Query collector. + * Own. + */ + CHnQueryResultCollector* iQc; + + /** + * Suite model. + * Not own - suite model. + */ + CHnSuiteModel* iSuiteModel; + + /** + * Position of item. + * Own - item's positions. + */ + TInt iItemPosition; + + /** + * Own - condition. + */ + CHnConditionInterface* iCondition; + + /** + * Running indicator. + */ + RBuf8 iRunning8; + + /** + * DRM protection indicator. + */ + RBuf8 iDrmProtection8; + +public: + /** + * Marks if evaulation should take place. + */ + TBool iEvaluationNeeded; + + }; + +#endif // C_HNMMITEM_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdlocalization.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdlocalization.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,215 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDLOCALIZATION_H +#define C_HNMDLOCALIZATION_H + + +#include <e32base.h> +#include <xmlengelement.h> + +class CHnMdLocalizationElement; +class CCoeEnv; + +/** + * Localization. + * + * This class is designed to support localization. + * + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdLocalization) : public CBase + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @return Fully constructed object. + */ + static CHnMdLocalization* NewL(); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @return Fully constructed object. + */ + static CHnMdLocalization* NewLC(); + + /** + * Standard C++ virtual destructor. + * + * @since S60 5.0 + */ + virtual ~CHnMdLocalization(); + + /** + * Appends localizations. + * + * @since S60 5.0 + * @param aElement Xml element. + */ + void AppendLocalizationsL( TXmlEngElement aElement ); + + /** + * Gets element by name. + * + * @since S60 5.0 + * @param aNamespace Namespace. + * @return Localization element. + */ + const CHnMdLocalizationElement* ElementByNamespace( + const TDesC& aNamespace ) const; + + /** + * Loads resource. + * Resources can be defined in formats + * @code <namespace>:<id> @endcode + * Namespaces can be defined by localization elements, + * but can also point to rsg file. + * Id can be rsg constants, but it can be also numbers. + * + * @since S60 5.0 + * @param aResourceName Resource name. + * @param aDesParams descriptor parameters to format %U, %0U. + * @param aIntParams integer parameters to format %N, %0N.* + * @return Descriptor. + */ + HBufC* LoadL( const TDesC& aResourceName, + const CDesC16Array* aDesParams, + const CArrayFix<TInt>* aIntParams ); + + /** + * Realeses loaded resources. + * + * @since S60 5.0 + */ + void ReleaseResourceFiles(); + /** + * Reloads realesed resources. + * + * @since S60 5.0 + */ + void ReloadResourceFilesL(); + +private: + + /** + * Standard C++ constructor. + * + * @since S60 5.0 + */ + CHnMdLocalization(); + + /** + * Standard symbian 2nd pahse constructor. + * + * @since S60 5.0 + */ + void ConstructL(); + + /** + * Appends element the list of localization elements, it also checks for duplicates + * if it is RSC file it load the file in CoeEnv + * + * @param aElement element to add, ownership is taken + * if element with the same namespace exists element is ignored + * + * @since S60 5.0 + */ + void AppendElementL( CHnMdLocalizationElement* aElement ); + + /** + * Check extension of file and decide it is a resource file + * + * @param aFilename file name to check + * @return ETrue if it is rsc file, else EFalse + */ + TBool IsResourceFile( const TDesC& aFilename ); + + /** + * Formats text. + * + * @since S60 5.0 + * @param aTextToFormat A text to format. + * @param aDesParams Parameters of the text to be formated. + * @param aIntParams Integer parameters of the text to be formated. + */ + HBufC* FormatTextL( const TDesC& aTextToFormat, + const CDesC16Array* aDesParams, + const CArrayFix<TInt>* aIntParams ); + + /** + * Checks whether the localization element identified by a namespace is + * duplicated. + * + * @param aNamespace Namespace. + */ + TBool IsDuplicateL( TDesC8& aNamespace ); + + /** + * Checks whether the localization element identified by a namespace is + * duplicated. + * + * @param aNamespace Namespace. + */ + TBool IsDuplicateL( TDesC& aNamespace ); + + /** + * Checks whether the localization element identified by a namespace is + * internal. + * + * @param aName Name. + */ + TBool IsInternalL( const TDesC& aName ); + +private: // data + + /** + * CoeEnv. + * Not own. + */ + CCoeEnv* iCoeEnv; + + /** + * Own - Dynamic offset. + */ + RArray< TInt > iDynamicOffset; + + /** + * Own - Dynamic localization. + */ + RPointerArray<CHnMdLocalizationElement> iDynamicLocalization; + + /** + * Own - Internal offset. + */ + RArray< TInt > iInternalOffset; + + /** + * Own - Internal localization. + */ + RPointerArray<CHnMdLocalizationElement> iInternalLocalization; + + }; + +#endif // C_HNMMLOCALIZATION_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdlocalizationelement.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdlocalizationelement.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,227 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDLOCALIZATIONELEMENT_H +#define C_HNMDLOCALIZATIONELEMENT_H + + +#include <e32base.h> +#include <e32hashtab.h> //RHashMap +#include <xmlengelement.h> +#include <xmlengnodelist.h> + + +/** + * Localization Element. + * + * This is the localization element which is wrapped by the localization + * class. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdLocalizationElement) : public CBase + { + /** + * State of element - used for caching purpose + */ + enum TLocalizationElementStates { + EInitialized = 1, + EWholeFileCached = 2, + EUsedItemsCached = 4 + }; +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @return Fully constructed element. + */ + static CHnMdLocalizationElement* NewL( TXmlEngElement aElement ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aNamespace namespace + * @param aSource source + * @return Fully constructed element. + */ + static CHnMdLocalizationElement* NewL( const TDesC& aNamespace, + const TDesC& aSource); + + /** + * Standard C++ virtal destructor. + * + * @since S60 5.0 + */ + virtual ~CHnMdLocalizationElement(); + + /** + * Gets namespace. + * + * @since S60 5.0 + * @return Namespace. + */ + const TDesC& Namespace() const; + + /** + * Gets source. + * + * @since S60 5.0 + * @return Source. + */ + const TDesC& Source() const; + + /** + * Gets source path. + * + * @since S60 5.0 + * @return Source. + */ + HBufC* SourcePath() const; + + /** + * Returns true if path to source exists. + * + * @since S60 5.0 + * @return Does path to source exist. + */ + TBool SourceExists() const; + + /** + * Reloads the resource file path. + * + * @since S60 5.0 + */ + void LocateLanguageFileL(); + + /** + * Gets resource id from corresponsing rsg if exist + * Inside it implemented caching mechanism + * If file is small (<KWholeFileReadLimit) cache all entries, + * otherwise it caches only used resources. + * + * @since S60 5.0 + * @param aResourceName Resource name. + * @return Resource id if exist. + */ + const TInt& FindResourceIdL( HBufC8* aResourceName ); + +private: + + /** + * Standard C++ constructor. + * + * @since S60 5.0 + */ + CHnMdLocalizationElement(); + + /** + * Standard symbian 2nd pahse constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + */ + void ConstructL( TXmlEngElement aElement ); + + /** + * Standard symbian 2nd pahse constructor. + * + * @since S60 5.0 + * @param aNamespace namespace + * @param aSource source + */ + void ConstructL( const TDesC& aNamespace, const TDesC& aSource); + + /** + * Sets namespace + * + * @since S60 5.0 + * @param aNamespace Namespace. + */ + void SetNamespaceL( TXmlEngAttr aNamespace ); + + /** + * Sets source. + * + * @since S60 5.0 + * @param aSource Xml attribute. + */ + void SetSourceL( TXmlEngAttr aSource ); + + /** + * Read corresponding rsg file return content. + * + * @since S60 5.0 + * @return Descriptor with file content. + */ + HBufC8* ReadRsgContentLC( ); + + /** + * Parse content of corresponding rsg file and + * fill in maping to internal map for all resource listed in content. + * + * @since S60 5.0 + * @param aContent Descriptor with content. + */ + void ParseRsgContentL( const TDesC8& aContent ); + + /** + * Parse content of corresponding rsg file and + * fill in maping to internal map only requested resource + * + * @since S60 5.0 + * @param aContent Descriptor with content. + * @param aResourceName Requested resource name. + */ + void ParseRsgContentL( const TDesC8& aContent, const TDesC8& aResourceName ); + +private: // data + + /** + * Namespace. + */ + RBuf iNamespace; + + /** + * Source. + */ + RBuf iSource; + + /** + * Source path. + */ + HBufC* iSourcePath; + + /** + * Mapping between resource name and resource id. + */ + RHashMap< HBufC8*, TInt> iResourceIDs; + + /** + * State of element. + */ + TInt iState; + }; + +#endif // C_HNMMLOCALIZATIONELEMENT_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdmenuitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdmenuitem.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,193 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDMENUITEM_H +#define C_HNMDMENUITEM_H + +#include <e32hashtab.h> +#include <e32base.h> +#include <xmlengelement.h> + +struct THnMdCommonPointers; +class CHnCondition; +class CLiwGenericParamList; +class CHnMenuItemModel; +class CHnConditionInterface; + +/** + * Menu Item. + * + * This class represents items in the Options menu. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdMenuItem) : public CBase + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @param aCmnPtrs Common pointers. + * @return Fully constructed object. + */ + static CHnMdMenuItem* NewL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @param aCmnPtrs Common pointers. + * @return Fully constructed object. + */ + static CHnMdMenuItem* NewLC( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Standard C++ virtual destructor. + * + * @since S60 5.0 + */ + ~CHnMdMenuItem( ); + + /** + * Gets position. + * + * @since S60 5.0 + * @param aMenuModel Menu model. + * @param aQueriesResultsList Queries results list. + * @param aPos Position of the record in the results list. + */ + void EvaluateL( CHnMenuItemModel* aMenuModel, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos ); + +public: + // from MHnMdMenuItemBase + + /** + * Gets the menu item's name + * + * @return Name of menu item. + */ + const TDesC& NameL(); + + /** + * Checks if the menu item is valid. + * + * @since S60 5.0 + * @param aQueryResults Query results. + * @param aPos Position. + * @return True if a condition is satisfied. + */ + TBool IsValidL( const CLiwGenericParamList& aQueryResults, + TInt aPos = 0 ); + +private: + + /** + * Standard C++ constructor. + * + * @since S60 5.0 + */ + CHnMdMenuItem(); + + /** + * Standard symbian 2nd pahse constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @param aCmnPtrs Common pointers. + */ + void ConstructL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Creates children. + * + * @since S60 5.0 + * @param aElement Xml element. + * @param aCmnPtrs Common pointers. + */ + void CreateChildrenL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Appends child item. + * + * @since S60 5.0 + * @param aMenuItem Menu item. + */ + void AppendChildItemL( CHnMdMenuItem* aMenuItem ); + + /** + * Creates properties. + * + * @since S60 5.0 + * @param aElement Xml element. + * @param aCmnPtrs Common pointers. + */ + void CreatePropertiesL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + +private: // data + + /** + * Own - Name. + */ + RBuf iName; + + /** + * Position. + */ + TInt iPosition; + + /** + * Event element. + */ + TInt iEvent; + + /** + * Own - Children pointer array. + */ + RPointerArray<CHnMdMenuItem> iChildren; + + /** + * Own - Name value cache. + */ + RBuf iNameValueCache; + + /** + * Own - Condition. + */ + CHnConditionInterface* iCondition; + + /** + * Is menu item "item specific". + */ + TBool iSpecific; + + }; + +#endif // C_HNMULMENUITEM_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdmodel.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,579 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDMODEL_H +#define C_HNMDMODEL_H + +#include <e32base.h> +#include <xmlengelement.h> +#include <liwgenericparam.h> +#include <eikenv.h> +#include "hnglobals.h" + +class CHnMdLocalization; +class CHnSuiteModelContainer; +class CHnFilter; +class THnIdGenerator; +class CHnMdSuite; +class CHnMdModel; +class CHnItemId; +class MHnSuiteObserver; +class CHnXmlModelProvider; +class CHnMdModel; +class MHnMdModelEventObserver; +class CHnSuiteModel; +class CHnRepositoryObserver; +class MHnEditModeInterface; +class CHnBitmapIdCache; + +/** + * Type of the property. + * + * @ingroup group_hnmetadatamodel + */ +enum TPropertyType + { + EUndefined = 0, + EGenre, + EVisualItemCount + }; + +/** + * Mode type. + * + * @ingroup group_hnmetadatamodel + */ +enum TMdMode + { + EMdModeNormal = 0, + EMdModeEdit + }; + +/** + * Common pointers. + * + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +struct THnMdCommonPointers + { + /** + * Not own - Localization. + */ + CHnMdLocalization* iLocalization; + + /** + * Not own - Query generator. + */ + THnIdGenerator* iIdGenerator; + + /** + * Not own - Suite model container. + */ + CHnSuiteModelContainer* iContainer; + + /** + * Not own - Meta data model. + */ + CHnMdModel* iModel; + + /** + * Not own - Xml model provider. + */ + CHnXmlModelProvider* iXmlModelProvider; + + /** + * Not own - Cache for bitmap and mask ids. + */ + CHnBitmapIdCache* iBitmapIdCache; + + /** + * Not own - Model event observer. + */ + MHnMdModelEventObserver* iModelEventObserver; + + /** + * Not own - Edit mode interface. + */ + MHnEditModeInterface* iEditModeInterface; + + /** + * Not own - Handler to file server session; + */ + RFs& iFs; + + /** + * Gets static pointer from TLS. + */ + static THnMdCommonPointers* Static() {return (THnMdCommonPointers*)Dll::Tls(); } + + /** + * Sets pointer to TLS. + * + * @param aCmnPtrs Pointer to set + */ + static void SetStatic( THnMdCommonPointers* aCmnPtrs ) { Dll::SetTls(aCmnPtrs); } + + private: + + // only model can create it + friend class CHnMdModel; + + /** + * Standard C++ consturctor. + */ + THnMdCommonPointers() : iFs( CEikonEnv::Static()->FsSession() ) + { + iLocalization = NULL; + iIdGenerator = NULL; + iContainer = NULL; + iModel = NULL; + iXmlModelProvider = NULL; + iModelEventObserver = NULL; + iEditModeInterface = NULL; + } + + /** + * Copy constructor declared as private to disallow copying. + * + * @param aCmnPtrs Pointer to set. + */ + THnMdCommonPointers( const THnMdCommonPointers& aCmnPtrs ):iFs( aCmnPtrs.iFs ) { } + + /** + * Assignment operator + */ + THnMdCommonPointers& operator=( const THnMdCommonPointers& ){return *this;} + }; + +/** + * Id generator. + * + * @lib ?library + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +struct THnIdGenerator + { + /** + * Standatrd C++ constructor. + */ + THnIdGenerator() + { + iId = 0; + } + + /** + * Gets next id. + * @return Next id. + */ + TInt GetNextId() + { + return iId++; + } + private: + + /** + * Copy constructor declared as private to disallow copying. + * @param aGenerator Id generator; + */ + THnIdGenerator(const THnIdGenerator& aGenerator); + + /** + * Assignment operator. + */ + THnIdGenerator& operator=(const THnIdGenerator&); + + /** + * Id + */ + TInt iId; + }; + +/** + * Model event observer. + * + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +class MHnMdModelEventObserver + { + public: + + /** + * Handles modlde event. + * + * @since S60 5.0 + * @param aEventName Event name. + * @param aParams Parameters. + */ + virtual TInt HandleModelEventL( const TDesC& aEventName, + CLiwGenericParamList& aParams ) = 0; + }; + +/** + * Meta data model + * + * This is the main class of the Meta Data Model component. + * + * This class is the entry point for building the meta data model + * and for evaluation. + * + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnMdModel ) : public CBase + { +public: + enum TForegroundGainTriggeringEvent + { + EWhenAnySuiteIsEvaluated, + EWhenCurrentTopSuiteIsEvaluated, + ENever + }; +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aModelObserver Model observer. + * @param aSuiteModelContainer Suite model container. + * @return Fully constructed object. + */ + IMPORT_C static CHnMdModel* NewL( MHnMdModelEventObserver* aModelObserver, + CHnSuiteModelContainer * aSuiteModelContainer ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aModelObserver Model observer. + * @param aSuiteModelContainer Suite model container. + * @return Fully constructed object. + */ + IMPORT_C static CHnMdModel* NewLC( MHnMdModelEventObserver* aModelObserver, + CHnSuiteModelContainer * aSuiteModelContainer ); + + /** + * Standard C++ virtual destructor. + * + * @since S60 5.0 + */ + virtual ~CHnMdModel(); + + /** + * Evaluates the model. Takes filter as a parameter. + * + * @since S60 5.0 + * @param aFilter Filter. + */ + IMPORT_C void EvaluateL( CHnFilter& aFilter ); + + /** + * Manages evaluation lock. + * + * @param aLock Locks evaluation if set to ETrue. + * @param aEvaluate Runs evaluation if aEvaluate == ETrue. + */ + IMPORT_C void SetEvaluationLockL( TBool aLock, TBool aEvaluate = ETrue ); + + /** + * Evaluates the model. + * + * @since S60 5.0 + */ + IMPORT_C void EvaluateL(); + + /** + * Switches between edit mode and normal mode + * + * @since S60 5.0 + * @param aMode Suite model container. + */ + IMPORT_C void SetModeL( TMdMode aMode ); + + + /** + * Gets suite's meta data model. + * + * @since S60 5.0 + * @return Suite meta data model. + */ + IMPORT_C CHnMdSuite* GetLastSuite(); + + /** + * Gets suite's meta data model. + * + * @since S60 5.0 + * @param aPosition Position of the suite in the stack. + * @return Suite meta data model. + */ + CHnMdSuite* GetSuite( TInt aPosition ); + + /** + * Gets suite's parameters.. + * + * @since S60 5.0 + * @param aPosition Position of the suite in the stack, + * from which gets parameters. + * @return Suite meta data model. + */ + IMPORT_C CLiwGenericParamList& GetSuiteParameters( TInt aPosition ); + + + /** + * Handles back event. + * + * @since S60 v3.2 + * @param aMulContainer Suite model container. + * @param aGenre Name of the suite. + * @param aIterations Number of iterations. + * @return Error code. + */ + IMPORT_C TInt HandleBackEventL( CHnSuiteModelContainer* aMulContainer, + const TDesC& aGenre, TInt aIterations = KModelCountForRoot ); + + /** + * Handles sis installation event. + * + * @since S60 v3.2 + * @param aMulContainer Suite model container. + */ + IMPORT_C void HandleSisInstallationEventL( + CHnSuiteModelContainer* aMulContainer ); + + /** + * Loads a suite from xml data. + * + * @since S60 v5.0 + * @param aGenre Name of the suite. + * @param aSuiteParams Suite parameters. + * @return Error code. + */ + IMPORT_C TInt LoadSuiteL( const TDesC& aGenre, CLiwGenericParamList* aSuiteParams = NULL ); + + /** + * Check if suite model exists. + * + * @since S60 5.0 + * @param aSuiteModel Suite model name. + * @return ETrue if suite model exists, otherwise EFalse. + */ + IMPORT_C TBool SuiteModelExistsL( const TDesC8& aSuiteModel ); + + /** + * Gets suite's meta data model. + * + * @since S60 5.0 + * @param aUri Current ui. + * @return Suite meta data model. + */ + IMPORT_C void GetCurrentUriL( TDes& aUri ); + + /** + * Deletes last loaded suite model from data model. + * + * @since S60 5.0 + */ + IMPORT_C void DeleteLastSuite(); + + + /** + * Realeses localization files. + * + * @since S60 5.0 + */ + IMPORT_C void ReleaseLocalization(); + + /** + * Reloads localization. + * + * @since S60 5.0 + */ + IMPORT_C void ReloadLocalizationL(); + + /** + * Informs metadatamodel to ignore evaluations or + * to performing evaluations, according to the + * given parameter. + * + * @since S60 5.0 + * @param aIgnore Metadatamodel ignores evaluations when set to ETrue. + */ + IMPORT_C void IgnoreEvaluations( TBool aIgnore ); + + /** + * Request that menu goes to foreground when evaluation completes. + * + * Default behavior is not to go to foreground when evaluation + * completes. A change of this behavior requested with this method is + * only effective until the menu is sent to foreground (once). Then the + * default behavior is assumed again. + * Subsequent calls override previous changes. + * + * @since S60 5.0 + * @param aWhen Determines when the foreground should be gained. + * Possible values are defined in the + * TForegroundGainTriggeringEvent enum. The value ENever + * simply means not to bring menu to foreground. + */ + IMPORT_C void QueueForeground( TForegroundGainTriggeringEvent aWhen ); + + /** + * Is there a queue for foreground gain. + * + * @since S60 5.0 + * @return should foreground be gained after evaluation. + */ + IMPORT_C TBool IsForegroundQueued() const; + + /** + * Notifies this metadata model that suite evaluation has completed. + * + * @param aJustEvaluatedSuite pointer to the suite whose evaluation + * has completed + */ + void SuiteModelReadyToShowL( CHnSuiteModel* aJustEvaluatedSuite ); + + /** + * Causes all of the loades suites except for the suite at the bottom + * of the stack to be reloaded from their corresponding xml file + * definitions. + * + * @since S60 5.0 + * @param aIgnore aModelContainer Model container object. + */ + void ReloadStackSuitesL( CHnSuiteModelContainer* aModelContainer ); + + /** + * Counts number of loaded suites. + * + * @since S60 5.0 + * @return Number of loaded suites + */ + TInt LoadedSuitesCount(); + + /** + * Evaluates the suite model on top of the stack. + * + * @since S60 5.0 + */ + void EvaluateTopSuiteL(); + +private: + + /** + * Standard C++ constructor. + * + * @since S60 5.0 + */ + CHnMdModel( ); + + /** + * Standard symbian 2nd pahse constructor. + * + * @since S60 5.0 + * @param aModelObserver Model observer. + * @param aSuiteModelContainer Model container. + */ + void ConstructL( MHnMdModelEventObserver* aModelObserver, + CHnSuiteModelContainer * aSuiteModelContainer ); + +private: // data + + /** + * Id generator. + */ + THnIdGenerator iIdGenerator; + + /** + * Own - Localization. + */ + CHnMdLocalization* iLocalization; + + /** + * Own - Xml model provider. + */ + CHnXmlModelProvider* iXmlModelProvider; + + /** + * Own - bitmap and mask ids cache. + */ + CHnBitmapIdCache* iBitmapIdCache; + + /** + * Not Own - Event observer. + */ + MHnMdModelEventObserver* iModelEventObserver; + + /** + * Stores pointers to common objects in the system + * This object is shared throut the whole system. + */ + THnMdCommonPointers iCmnPtrs; + + /** + * Stores information about mode. + */ + TMdMode iMode; + + /** + * Loaded Suites stack. + * Object and content owned. + */ + RPointerArray<CHnMdSuite> iLoadedSuites; + + /** + * Repository widget type observer. + */ + CHnRepositoryObserver* iRepositoryWidgetTypeObserver; + + /** + * Repository folder change observer. + */ + CHnRepositoryObserver* iRepositoryShowFolderObserver; + + /** + * Repository folder change observer. + */ + CHnRepositoryObserver* iRepositoryZoomObserver; + + /** + * When set, forces metadatamodel to skip evaluations. + */ + TBool iIgnoreEvaluations; + + /** + * Queues foreground gain action. + */ + TBool iForegroundQueued; + + /** + * Not own - pointer to the suite model that must be evaluated + * before matrix menu can be brought to foreground. + * + * When NULL, then any suite evaluation brings menu to foreground. + * It is only meaningful when iForegroundQueued is ETrue. + */ + CHnSuiteModel* iForegroundTriggeringSuite; + + }; + +#endif // C_HNMDMODEL_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdnotifyrequest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdnotifyrequest.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,160 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef HNMDREQUESTNOTIFY_ +#define HNMDREQUESTNOTIFY_ + +#include <e32base.h> +#include <xmlengelement.h> +#include <liwcommon.h> + +#include "hnmdbasekey.h" +#include "hnmdservice.h" +#include "hnitemid.h" + + +class CHnServiceHandler; +class CHnMdServiceCommand; +struct THnMdCommonPointers; + +/** + * Notify Request. + * + * This class is responsible for managing notifications coming from + * services and refreshing content of the view. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnMdNotifyRequest ): + public CBase, + public MLiwNotifyCallback + { +public: + + /** + * Two-phased constructor. + * Constructs an object from xml element. + * + * @since S60 5.0 + * @param aElement A XML element holding information. + * @param aItemId Item id. + * @param aCmnPtrs Common pointers structure. + * @return Fully constructed notify request. + */ + static CHnMdNotifyRequest* NewL( TXmlEngElement aElement, + const CHnItemId & aItemId, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Two-phased constructor. + * Constructs an object from xml element. + * + * @since S60 5.0 + * @param aElement A XML element holding information. + * @param aItemId Item id. + * @param aCmnPtrs Common pointers structure. + * @return Fully constructed notify request. + */ + static CHnMdNotifyRequest* NewLC( TXmlEngElement aElement, + const CHnItemId & aItemId, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Virtual C++ destructor. + */ + virtual ~CHnMdNotifyRequest(); + + /** + * Requests notification from the service, which was set up + * in the configuration. + * + * @param aParams Parameters list. + * @param aCmdOptions Command options. + */ + void RequestNotifyL( CLiwGenericParamList& aParams, + TInt aCmdOptions = 0 ); + + /** + * Method is invoked when the notifucation occurs. + * It is called as a callback by the service which want to + * notify change. + * + * @see MLiwNotifyCallback::HandleNotifyL + * @param aCmdId Command id. + * @param aEventId Event id. + * @param aEventParamList Event parameters list. + * @param aInParamList Input parameters list. + * + * @return error code + */ + TInt HandleNotifyL( TInt aCmdId, TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& aInParamList ); + + +private: + + /** + * Gets command object. + * + * @since S60 5.0 + * @return Service command. + */ + const CHnMdServiceCommand& GetService() const; + + /** + * Second phase constructor. + * @param aElement A XML element holding information. + * @param aItemId Item's id. + */ + void ConstructL( TXmlEngElement aElement, + const CHnItemId & aItemId ); + + /** + * Standard C++ constructor. + * @param aCmnPtrs Common pointers structure. + */ + CHnMdNotifyRequest(THnMdCommonPointers* aCmnPtrs); + +private: + + /** + * Own - Associated item id. + */ + CHnItemId* iItemId; + + /** + * Not own - Common pointers. + */ + THnMdCommonPointers* iCmnPtrs; + + /** + * Own - Service Handler + */ + CHnMdService* iService; + + /** + * Own - Service Handler + */ + CHnServiceHandler* iSh; + + }; + +#endif // HNMDREQUESTNOTIFY_ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdnotifyrequests.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdnotifyrequests.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,157 @@ +/* +* Copyright (c) 2007-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: represents the notification requests +* +*/ + + + +#ifndef C_HNMDREQUESTS_H +#define C_HNMDREQUESTS_H + +#include <e32base.h> +#include <xmlengelement.h> + +class CHnItemId; +class CHnMdNotifyRequest; +struct THnMdCommonPointers; + +/** + * Notify Requests. + * + * This class stores CHnMdNotifyRequest objects. + * + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdNotifyRequests) : public CBase + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Element. + * @param aItemId Item's identifier. + * @param aCmnPtrs Common pointers. + * @return Fully constructed object. + */ + static CHnMdNotifyRequests* NewL( TXmlEngElement aElement, + const CHnItemId & aItemId, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Element. + * @param aItemId Item's identifier. + * @param aCmnPtrs Common pointers. + * @return Fully constructed object. + */ + static CHnMdNotifyRequests* NewLC( TXmlEngElement aElement, + const CHnItemId & aItemId, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Standard C++ virtual destructor. + * + * @since S60 5.0 + */ + virtual ~CHnMdNotifyRequests(); + + /** + * Adds request. + * + * @since S60 5.0 + * @param aRequests Request parameters. + * @return Status code. + */ + TInt AddNotifyRequest( CHnMdNotifyRequest* aRequests ); + + /** + * Gets request. + * + * @since S60 5.0 + * @param aPosition Position of a query. + * @return Query. + */ + CHnMdNotifyRequest& NotifyRequest( TInt aPosition ) const; + + /** + * Gets number of requests. + * + * @since S60 5.0 + * @return Number of queries. + */ + TInt Count() const; + + /** + * Requests notifucation from all services. + * + * @since S60 5.0 + * @param aParams Parameters in a form of a CLiwGenericParamList object. + * @param aCmdOptions Command options. + */ + void SendAllRequestsL( CLiwGenericParamList& aParams, + TInt aCmdOptions = 0); + + /** + * Check if requests were sent. + * + * @return Returns true if requests were sent. + */ + TBool Sent(); + + +private: + + /** + * Standard C++ constructor. + * + * @since S60 5.0 + */ + CHnMdNotifyRequests(); + + /** + * Standard symbian 2nd phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @param aItemId Item's id. + * @param aCmnPtrs Common pointers container. + */ + void ConstructL( TXmlEngElement aElement, + const CHnItemId & aItemId, + THnMdCommonPointers* aCmnPtrs ); + +private: // data + + /** + * Own - Requests. + */ + RPointerArray<CHnMdNotifyRequest> iNotifyRequests; + + + /** + * Indicates if requests were sent. + */ + TBool iSent; + + }; + +#endif // C_HNMDREQUESTS_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdqueries.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdqueries.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDQUERIES_H +#define C_HNMDQUERIES_H + +#include <e32base.h> +#include <liwcommon.h> + +class CHnMdQuery; +class CLiwGenericParamList; + +/** + * Queries. + * + * This class stores CHnMdQuery objects. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdQueries) : public CBase + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnMdQueries* NewL( TXmlEngElement aElement ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnMdQueries* NewLC( TXmlEngElement aElement ); + + /** + * Standard C++ virtual destructor. + * + * @since S60 5.0 + */ + virtual ~CHnMdQueries(); + + /** + * Adds query. + * + * @since S60 5.0 + * @param aQuery Query. + * @return Status code. + */ + TInt AddQuery( CHnMdQuery* aQuery ); + + /** + * Gets query. + * + * @since S60 5.0 + * @param aPosition Position of a query. + * @return Query. + */ + CHnMdQuery& Query( TInt aPosition ) const; + + /** + * Gets number of queries. + * + * @since S60 5.0 + * @return Number of queries. + */ + TInt Count() const; + +private: + + /** + * Standard C++ constructor. + * + * @since S60 5.0 + */ + CHnMdQueries(); + + /** + * Standard symbian 2nd phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + */ + void ConstructL( TXmlEngElement aElement ); + +private: // data + + /** + * Own - Queries. + */ + RPointerArray<CHnMdQuery> iQueries; + + }; + +#endif // C_HNMMQUERIES_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdquery.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdquery.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,138 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDQUERY_H +#define C_HNMDQUERY_H + +#include <e32base.h> +#include <xmlengelement.h> + +#include "hnglobals.h" + +class CHnMdServiceCommand; +class CHnMdBaseKey; +class CLiwGenericParamList; +class CHnMdService; + +/** + * Query. + * + * This class represents the query. + * + * This class allows sending queries to different services. + * + * Queries are mostly used during evaluation. + * + * @lib hnmetadatamodel + * @since S60 5.0 *** for example, S60 v3.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdQuery) : public CBase + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @return Fully cosntructed object. + */ + static CHnMdQuery* NewL( TXmlEngElement aElement ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @return Fully cosntructed object. + */ + static CHnMdQuery* NewLC( TXmlEngElement aElement ); + + /** + * Standard C++ virtual destructor. + * + * @since S60 5.0 + */ + virtual ~CHnMdQuery(); + + /** + * Gets namespace. + * + * @since S60 5.0 + * @return Namespace. + */ + const TDesC& NameSpace() const; + + /** + * Gets namespace. + * + * @since S60 5.0 + * @return Service object. + */ + CHnMdService& GetService() const; + +private: + + /** + * Standard C++ constructor. + * + * @since S60 5.0 + */ + CHnMdQuery(); + + /** + * Standard symbian 2nd phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + */ + void ConstructL(TXmlEngElement aElement); + + /** + * Sets namespace. + * + * @since S60 5.0 + * @param aNameSpace Namespace descriptor. + */ + void SetNameSpaceL( const TDesC& aNameSpace ); + + /** + * Sets namespace. + * + * @since S60 5.0 + * @param aAttr Xml attribute. + */ + void SetNameSpaceL( TXmlEngAttr aAttr ); + +private: // data + + /** + * Own - Namespace. + */ + RBuf iNameSpace; + + /** + * Own - service object. + */ + CHnMdService* iService; + + }; + +#endif // C_HNMMQUERY_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdservice.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,222 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef C_HNMDSERVICE_H +#define C_HNMDSERVICE_H + +//#include <mnaiwservices.h> +#include <liwcommon.h> +#include <e32base.h> +#include <e32hashtab.h> +#include <xmlengelement.h> + +class CLiwServiceHandler; +class CHnMdQuery; +class CLiwGenericParamList; +class MLiwInterface; +class CLiwDefaultMap; +class CHnMdBaseKey; +class CHnMdServiceCommand; +class CHnServiceHandler; + +/** + * Service. + * + * This class is desinged to facilitate dealing with services. + * + * @lib hnmetadatamodel + * @since S60 5.0 *** for example, S60 v3.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdService) : public CBase + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @return Fully cosntructed object. + */ + static CHnMdService* NewL( TXmlEngElement aElement ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @return Fully cosntructed object. + */ + static CHnMdService* NewLC( TXmlEngElement aElement ); + + /** + * Standard C++ virtual destructor. + * + * @since S60 5.0 + */ + virtual ~CHnMdService(); + + /** + * Gets service. + * + * @since S60 5.0 + * @return Service name. + */ + const TDesC8& GetServiceName() const; + + /** + * Gets interface. + * + * @since S60 5.0 + * @return Interface name. + */ + const TDesC8& GetInterfaceName() const; + + /** + * Gets command. + * + * @since S60 5.0 + * @return Service command. + */ + const CHnMdServiceCommand& GetCommand() const; + + /** + * returns query results + * + * since S60 v5.0 + * @return Result of the query to the service. + */ + const CLiwGenericParamList& Output() const; + + /** + * Returns service query constructor. + * + * since S60 v5.0 + * @return A structure of the key objects. + */ + CHnMdBaseKey* GetConstructor() const; + + /** + * Reads the consturctor into the model + * + * since S60 v5.0 + * @param aElement Xml element. + * @return A structure of the key objects. + */ + void CHnMdService::SetConstructorL( TXmlEngElement aElement ); + + /** + * Evaluates constructor. + * + * @param aList Evaluation parameter. + * @param aPos Position of the record in the parameter's list. + * @return Evaluated generic parameters list. + */ + CLiwGenericParamList* EvaluateConstructorL( const CLiwGenericParamList& aList, + TInt aPos = 0); + + /** + * Evaluates constructor as key. + * + * @param aList Evaluation parameter. + * @param aPos Position of the record in the parameter's list. + * @return Evaluated key. + */ + CHnMdBaseKey* EvaluateConstructorAsKeyL( const CLiwGenericParamList& aList, + TInt aPos = 0); + /** + * Evaluates command. + * + * @param aList Evaluation parameter. + * @param aPos Position of the record in the parameter's list. + * @return Evaluated generic parameters list. + */ + CLiwGenericParamList* EvaluateCommandL( const CLiwGenericParamList& aList, + TInt aPos = 0); + + /** + * Evaluates command as key. + * + * @param aList Evaluation parameter. + * @param aPos Position of the record in the parameter's list. + * @return Evaluated key. + */ + CHnMdBaseKey* EvaluateCommandAsKeyL( const CLiwGenericParamList& aList, + TInt aPos = 0); + + +private: + + /** + * Sets interface. + * + * @param aAttr Xml attribute. + */ + void SetInterfaceL( TXmlEngAttr aAttr ); + + /** + * Sets service. + * + * @param aAttr Xml attribute. + */ + void SetServiceL( TXmlEngAttr aAttr ); + + /** + * Standard C++ constructor. + * + * @since S60 5.0 + */ + CHnMdService(); + + + /** + * Standard symbian 2nd phase contructor. + * + * @since S60 5.0 + * @param aElement Xml element. + */ + void ConstructL( TXmlEngElement aElement ); + +private: // data + + /** + * Own - Service. + */ + RBuf8 iServiceName; + + /** + * Own - Interface. + */ + RBuf8 iInterfaceName; + + /** + * Own - Service command. + */ + CHnMdServiceCommand* iServiceCommand; + + /** + * Stores input parameters (not data) of the service search method + * (ExecuteServiceCmdL). + * Own. + */ + CHnMdBaseKey* iConstructor; + + }; + +#endif // C_HNMDSERVICEHANDLER_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdservicecommand.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdservicecommand.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef C_HNMDSERVICECOMMAND_H +#define C_HNMDSERVICECOMMAND_H + +#include <e32base.h> + +#include "hnglobals.h" + +class TXmlEngElement; +class TXmlEngAttr; +class CHnMdBaseKey; + +/** + * Service Command. + * + * This class represents the service command. In general, the service command + * are parameters of the service queries. + * + * @lib hnmetadatamodel + * @since S60 5.0 *** for example, S60 v3.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnMdServiceCommand ) : public CBase +{ +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnMdServiceCommand* NewL( TXmlEngElement aElement ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnMdServiceCommand* NewLC( TXmlEngElement aElement ); + + /** + * Standard C++ virtual destructor. + */ + virtual ~CHnMdServiceCommand(); + + /** + * Returns command. + * + * @since S60 5.0 + * @return Command name. + */ + const TDesC8& GetCommandName() const; + + /** + * Returns data. + * + * @since S60 5.0 + * @return A list of keys. + */ + CHnMdBaseKey* GetCommandData() const; + + /** + * Returns service mode. + * + * @since S60 5.0 + * @return Command mode. + */ + TServiceMode GetCommandMode() const; + +private: + + /** + * Standard C++ constructor. + */ + CHnMdServiceCommand(); + + /** + * Standard symbian 2nd phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + */ + void ConstructL( TXmlEngElement aElement ); + + /** + * Sets command parameters. + * + * @param aElement Xml element. + */ + void SetCommandDataL( TXmlEngElement aElement ); + + /** + * Sets service name. + * + * @since S60 5.0 + * @param aAttr Xml attribute. + */ + void SetCommandNameL( TXmlEngAttr aAttr ); + + /** + * Sets service mode. + * + * @since S60 5.0 + * @param aAttr Xml attribute. + */ + void SetCommandModeL( TXmlEngAttr aAttr ); + + /** + * Removes redundant key. + * TO BE REMOVED. + * + * @param aElement Xml element. + * @return Xml element with removed redundant key. + */ + TXmlEngElement RemoveRedundantKeyL( TXmlEngElement aElement ); + +private: + + /** + * Service mode: synchronous / asynchronous + */ + TServiceMode iMode; + + /** + * Command name, own + */ + RBuf8 iName; + + /** + * Data - service parameters, own + */ + CHnMdBaseKey* iData; +}; + +#endif /*HNMDSERVICECOMMAND_H_*/ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdsuite.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdsuite.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,479 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef C_HNMDSUITE_H +#define C_HNMDSUITE_H + +#include <e32base.h> +#include <badesca.h> + +#include "hnmdmodel.h" +#include "hnsuitemodel.h" +#include "hnglobals.h" +#include "hnmdmodel.h" +#include "hnqueryresultcollector.h" + +class CHnSuiteModelContainer; +class CHnFilter; +class CHnMdItem; +class CHnMdLocalization; +class CHnItemId; +class CHnMdQueries; +class CHnMdEventMapping; + +/** + * Suite. + * + * This is the representation of the suite. The crucial member variable + * of this suite is the list of the items. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdSuite) : public CBase, + public MHnQueryResultCollectorNotification + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Element. + * @param aCmnPtrs Common pointers. + * @return Fully constructed object. + */ + static CHnMdSuite* NewL( TXmlEngElement aElement, THnMdCommonPointers* aCmnPtrs ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Element. + * @param aCmnPtrs Common pointers. + * @return Fully constructed object. + */ + static CHnMdSuite* NewLC( TXmlEngElement aElement, THnMdCommonPointers* aCmnPtrs ); + + /** + * Standard C++ virtual destructor. + */ + virtual ~CHnMdSuite(); + + /** + * Evaluates suite. + * + * @since S60 5.0 + * @param aSuiteModel Suite model. + * @return Status code. + */ + TInt EvaluateL( CHnSuiteModel & aSuiteModel ); + + /** + * Marks according to filter which item should be evaluated. + * + * @since S60 5.0 + * @param aFilter Filter. + * @param aSuiteModel Suite Model to get Custom Id + */ + void MarkEvaluationL( CHnFilter& aFilter, CHnSuiteModel& aSuiteModel ); + + /** + * Handles back event. + * + * @since S60 ?S60_version + * @param aMulContainer Suite model container. + * @param aGenre Suite's name. + * @return Error code. + */ + TInt HandleBackEventL( CHnSuiteModelContainer* aMulContainer, TDesC* aGenre ); + + /** + * Switches between edit mode and normal mode + * + * @since S60 5.0 + * @param aMode Mode, e.g. normal / edit. + */ + void SetModeL( TMdMode aMode ); + + /** + * Returns mode type. + * + * @return Mode type, e.g. normal / edit. + */ + TMdMode Mode(); + + /** + * Returns name of the suite. + * + * @since S60 v3.2 + * @return Name of the suite. + */ + IMPORT_C const TDesC& SuiteName(); + + /** + * Return suite parameters. + * + * @return Suite parameters. + */ + IMPORT_C CLiwGenericParamList& GetSuiteParameters(); + + /** + * Sets suite parameters. + * + * @param aParams Suite parameters. + */ + IMPORT_C void SetSuiteParametersL(CLiwGenericParamList& aParams); + + + /** + * Returns alternative widget number. + * + * @since S60 v5.0 + * @return Alternative widget number. + */ + IMPORT_C TInt GetAlternativeWidgetNumber(); + +private: + + /** + * Set genre. + * + * @since S60 5.0 + * @param aGenre Genre descriptor. + */ + void SetGenreL(const TDesC& aGenre); + + /** + * Set genre. + * + * @since S60 5.0 + * @param aAttr Xml attribute. + */ + void SetGenreL(TXmlEngAttr aAttr); + + /** + * Set template. + * + * @since S60 5.0 + * @param aTemplate Template descriptor. + */ + void SetTemplateL( const TDesC8& aTemplate ); + + /** + * Set template. + * + * @since S60 5.0 + * @param aTemplate Xml attribute. + */ + void SetTemplateL( TXmlEngAttr aTemplate ); + + /** + * Sets widget type. + * + * @since S60 5.0 + * @param aWidgetType Xml attribute. + */ + void SetWidgetTypeL( TXmlEngAttr aWidgetType ); + + /** + * Sets allowable widget types. + * + * @since S60 5.0 + * @param aWidgetType Contains widget types. + */ + void SetWidgetTypeL( TDesC8& aWidgetType ); + + /** + * Sets allowable widget types and store it in CR. + * + * @since S60 5.0 + * @param aWidgetType Widget type. + */ + void SaveWidgetTypeL( TDesC8& aWidgetType ); + + /** + * Sets title. + * + * @since S60 5.0 + * @param aTitle Xml attribute. + */ + void SetTitleL( TXmlEngAttr aTitle ); + + /** + * Sets empty text. + * + * @since S60 5.0 + * @param aEmptyText The text displayed for empty suite. + */ + void SetEmptyTextL( TXmlEngAttr aEmptyText ); + + /** + * Evaluate suite itself. + * + * @since S60 5.0 + * @param aSuiteModel Suite model. + */ + void EvaluateSuiteItselfL( CHnSuiteModel & aSuiteModel ); + + /** + * Creates items. + * + * @since S60 5.0 + * @param aEntries Xml element. + * @param aCmnPtrs Common pointers. + */ + void CreateItemsL(TXmlEngElement aEntries, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Gets direct child property. + * + * @since S60 5.0 + * @param iIndex Index. + * @param aPropertyType Property type. + * @param aResult Result variant. + * @return Status. + */ + TBool GetDirectChildProperty( TInt iIndex, + TPropertyType aPropertyType, + TLiwVariant& aResult ); + + /** + * Called when results have finished being collected. + * + * @param aResults The results. + */ + void ResultsCollectedL( CLiwGenericParamList* aResults ); + + /** + * Sets custom id using parameters. + * + * @param aSuiteModel Suite model. + * @param aParams Parameters used to set custom id. + * @param aPos Positions of the custom id in aParams. + */ + void SetCustomIdL( CHnSuiteModel* aSuiteModel, + const CLiwGenericParamList& aParams, TInt aPos ); + + /** + * Sets exit mode for a suite. + */ + void SetExitModeL(); + + +private: + + /** + * Standar C++ constructor. + * + * @since S60 5.0 + * @param aCmnPtrs Common pointers. + */ + CHnMdSuite( THnMdCommonPointers* aCmnPtrs ); + + /** + * Restores widget type for this suite from central repository. + * + * @return Error code. + */ + TInt ReadWidgetTypeL(); + + /** + * Saves widget type for this suite in central repository. + * + * @return Error code. + */ + TInt SaveWidgetTypeL() const; + + /** + * Checks if the widget type is stored in service + * and saves it in given descriptor. + * + * @param aParams Contains data from service. + * @param aWidgetType Widget type to be set. + * @return True if widget was set, False + * when no widget stored in service. + */ + TBool ReadWidgetTypeFromServiceL( CLiwGenericParamList& aParams, + RBuf8& aWidgetType ); + + /** + * Sets the appropriate widget flag for allowable widgets. + * + * @param aConfDes Configuration string. + */ + void DoSetWidgetTypeL( TDesC8 & aConfDes ); + + /** + * Sets the alternative template for widget switch. + * + * @param aOption Position of widget in xml configuration. + */ + void SetAlternativeTemplateL( TInt aOption ); + + /** + * Sets the alternative widget. + * + * @param aParams List of data from service. + */ + void SetAlternativeWidgetL( CLiwGenericParamList& aParams ); + + /** + * Sets the alternative template. + * + * @param aParams List of data from service. + */ + void SetAlternativeTemplateL( CLiwGenericParamList& aParams ); + + /** + * Standard symbian 2nd phase constructor. + * + * @since S60 5.0 + * @param element Xml element. + */ + void ConstructL( TXmlEngElement element ); + + /** + * Adds widget type to generic param list passed to + * items when evaluating the suite. + * + * The information about widget type can be retrieved + * using the following path: + * mm:/suite:type + * + * @param aParamList a param list into which the wigdet + * type is added. + * + */ + void AddInternalStateL( CLiwGenericParamList& aParamList ); + + + /** + * Sets custom identifier. + * + * @since S60 5.50 + * @param aElement Xml element. + */ + void SetCustomIdL( TXmlEngElement aElement ); + + /** + * Sets highlight according to parameters passed in uri. + */ + void SetUriBasedHighlightL(); + + + +private: // data + + /** + * Own - Suite name. + */ + RBuf iSuiteName; + + /** + * Own - Title + */ + RBuf8 iTitle; + + /** + * Own - Empty text + */ + RBuf8 iEmptyText; + + /** + * Own - Items. + */ + RPointerArray< CHnMdItem > iItems; + + /** + * Common pointers. + */ + THnMdCommonPointers* iCmnPtrs; + + /** + * Template. + */ + RBuf8 iTemplate; + + /** + * Allowable templates. + */ + CDesC8Array * iAllowableTemplate; + + /** + * Widget type. + */ + THnSuiteWidgetType iWidgetType; + + /** + * Widget type. + */ + RArray< THnSuiteWidgetType > iAllowableWidgetType; + + /** + * Allowed types - as string. + */ + RBuf8 iAllowedTypes; + + /** + * Event mapping + */ + CHnMdEventMapping* iEventMapping; + + /** + * Queries + */ + CHnMdQueries* iQueries; + + /** + * Cached evaluation parameters, i.e. params:folder_id, etc. + */ + CLiwGenericParamList* iSuiteParams; + + /** + * Stores information about mode. + */ + TMdMode iMode; + + /** + * Own. + */ + CHnQueryResultCollector* iQc; + + /** + * Suite model. + * Not Own + */ + CHnSuiteModel* iSuiteModel; + + /** + * Custom identifier. + */ + RBuf8 iCustomId8; + +public: + /** + * Marks if evaulation should take place. + */ + TBool iEvaluationNeeded; + + }; + +#endif // C_HNMMSUITE_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdtoolbar.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdtoolbar.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef HNMDTOOLBAR_H_ +#define HNMDTOOLBAR_H_ + +#include <e32base.h> +#include <xmlengelement.h> + +class CLiwGenericParamList; +class CHnMdButton; +struct THnMdCommonPointers; +class TXmlEngElement; +class CHnToolbarModel; + +/** + * Toolbar item. + * + * This is the class which represents the toolbar item. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ + +NONSHARABLE_CLASS( CHnMdToolbar ) : public CBase + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @param aCmnPtrs Common pointers. + * @return Constructed object. + */ + static CHnMdToolbar* NewLC( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @param aCmnPtrs Common pointers. + * @return Constructed object. + */ + static CHnMdToolbar* NewL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + + /** + * Standard C++ virtual destructor. + * + * @since S60 5.0 + */ + ~CHnMdToolbar( ); + + /** + * Standard C++ virtual destructor. + * + * @since S60 5.0 + * @param aToolbar Fills toolbar model with buttons. + * @param aQueryResults CLiwGenericParamList object. + * @param aPos Position of the record in the params list. + */ + void EvaluateL( CHnToolbarModel* aToolbar, + const CLiwGenericParamList& aQueryResults, + TInt aPos = 0 ); + +private: + + /** + * Standard C++ constructor. + * + * @since S60 5.0 + */ + CHnMdToolbar(); + + /** + * Standard symbian 2nd pahse constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @param aCmnPtrs Common pointers. + */ + void ConstructL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Creates buttons for toolbar. + * + * @since S60 5.0 + * @param aElement Xml element. + * @param aCmnPtrs Common pointers. + */ + void CreateButtonsL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + +private: // data + + /** + * Buttons for toolbar created from xml configuration. + * Own. + */ + RPointerArray< CHnMdButton > iButtons; + }; + +#endif /*HNMDTOOLBAR_H_*/ + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmduimapping.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmduimapping.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDUIMAPPING_H +#define C_HNMDUIMAPPING_H + +#include <e32base.h> +#include <xmlengdom.h> +#include <e32hashtab.h> + +#include "hnglobals.h" + +class CLiwDefaultMap; +struct THnMdCommonPointers; +class CHnMdUiMappingElement; +class CLiwGenericParamList; +class CHnItemModel; + +/** + * UI mapping. + * + * This class contains the list of CHnMdUiMappingElement objects. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdUiMapping) : public CBase + { +public: + + /** + * Two-phase constructor. + * + * @param aElement Xml element. + * @param aCmnPtrs Common pointers. + * @return Fully constructed object. + */ + static CHnMdUiMapping* NewL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Two-phase constructor. + * + * @param aElement Xml element. + * @param aCmnPtrs Common pointers. + * @return Fully constructed object. + */ + static CHnMdUiMapping* NewLC( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Standarc C++ virtual constructor. + */ + virtual ~CHnMdUiMapping(); + + /** + * Fills graphical item. + * + * @param aItemModel Item model. + * @param aQueriesResultsList Hash map with query results + * @param aPos Current item number + * @return True if an item was correctly filled. + */ + TBool FillGraphicalItemL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos ); + + /** + * Adds UI mapping element. + * + * @param aUiMappingElement UI mapping element. + */ + void AddUiMappingElementL( + CHnMdUiMappingElement *aUiMappingElement ); + +private: + + /** + * Standard C++ constructor. + */ + CHnMdUiMapping(); + + /** + * Standard symbian 2nd pahse constructor. + * + * @param aElement Xml element. + * @param aCmnPtrs Common pointers. + */ + void ConstructL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + +private: // data + + /** + * Mappings. + */ + RPointerArray<CHnMdUiMappingElement> iMappings; + + }; + +#endif // C_HNMMUIMAPPING_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmduimappingelement.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmduimappingelement.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,172 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDUIAPPINGELEMENT_H +#define C_HNMDUIAPPINGELEMENT_H + +#include <e32base.h> +#include <xmlengdom.h> +#include <e32hashtab.h> + +class CHnMdValueBase; +class CHnItemModel; +class CLiwGenericParamList; +class CHnConditionInterface; +struct THnMdCommonPointers; + +/** + * UI Mapping Element. + * + * This class is designed to support output attributes defined in the + * xml configuration. Most common case is when these attributes + * define the content of the items, e.g.: text, icons. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdUiMappingElement) : public CBase + { +public: + + /** + * Two-phase constructor. + * + * @param aElement Element. + * @param aCmnPtrs Common pointers. + * @return Fully constructed object. + */ + static CHnMdUiMappingElement* NewL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Two-phase constructor. + * + * @param aElement Element. + * @param aCmnPtrs Common pointers. + * @return Fully constructed object. + */ + static CHnMdUiMappingElement* NewLC( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Standard C++ virtual destructor. + */ + virtual ~CHnMdUiMappingElement(); + + /** + * Gets alias. + * + * @return Alias. + */ + const TDesC8& Alias() const; + + /** + * Fills graphical item. + * + * @param aItemModel Item's model. + * @param aQueriesResultsList Parameters used when filling. + * @param aPos Position of a record in a parameters list. + * @return True if filling was correctly finished. + */ + TBool FillGraphicalItemL( CHnItemModel* aItemModel , + const CLiwGenericParamList& aQueriesResultsList, TInt aPos ); + + /** + * Checks if the uimappingelement is valid. + * + * @since S60 5.0 + * @param aQueryResults Parameters used when validating. + * @param aPos Position of a record in a parameters list. + * @return True if condition was satisfied. + */ + TBool IsValidL( const CLiwGenericParamList& aQueryResults, TInt aPos ); + +private: + + /** + * Standard C++ constructor. + */ + CHnMdUiMappingElement(); + + /** + * Standard symbian 2nd phase constructor. + * + * @param aElement Element. + * @param aCmnPtrs Common pointers. + */ + void ConstructL( const TXmlEngElement& aElement , + THnMdCommonPointers* aCmnPtrs); + + /** + * Sets string handler. + * + * @param aName Name. + */ + void SetValueL( const TXmlEngAttr& aName); + + /** + * Sets type. + * + * @param aType Type. + */ + void SetTypeL( const TXmlEngAttr& aType ); + + /** + * Set alias. + * + * @param aName Name. + */ + void SetAliasL( const TXmlEngAttr& aName ); + + /** + * Set value. + * + * @param aElement Element. + * @param aCmnPtrs Common parameters. + */ + void SetValueL( const TXmlEngElement& aElement, + THnMdCommonPointers* aCmnPtrs ); + + +private: // data + + /** + * + * Alias. + */ + RBuf8 iAlias; + + /** + * ValueL. + */ + CHnMdValueBase* iValue; + + /** + * Not own - common pointers structure. + */ + THnMdCommonPointers* iCmnPtrs; + + /** + * Own - condition. + */ + CHnConditionInterface* iCondition; + }; + +#endif // C_HNMUIAPPINGELEMENT_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdvaluebase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdvaluebase.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef C_HNMDVALUEBASE_H +#define C_HNMDVALUEBASE_H + +#include <e32base.h> + +class CLiwGenericParamList; +struct THnMdCommonPointers; +class TXmlEngElement; +class CHnAttributeBase; + +enum THnMdValueType + { + EHnTextType, + EHnImageType + }; + +/** + * Value Base + * + * Based class used for output transformation. + * Specific classes based on information from XML make correct transformation + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdValueBase) : public CBase + { +public: + /** + * Create specific class based on parameter + * + * @param aElement XML element. + * @param aCmnPtrs Pointer to common pointer structure. + */ + static CHnMdValueBase* CreateL( const TXmlEngElement& aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Get value from spefic class + * + * @param aQueriesResultsList query results use for dynnamic data + * @param aPos position if data are in list format. + * @return A pointer to the CHnAttributeBase object. + */ + + virtual CHnAttributeBase* CreateAttributeL( + const CLiwGenericParamList* aQueriesResultsList, TInt aPos ) = 0; + + }; + +#endif /*C_HNMDVALUEBASE_H*/ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdvalueimage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdvalueimage.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,337 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef CHNMDIMAGE_H +#define CHNMDIMAGE_H + +#include <e32base.h> +#include <AknsItemID.h> +#include "hnmdvaluebase.h" +#include "hnglobals.h" + +class TXmlEngElement; +class CLiwGenericParamList; +struct THnMdCommonPointers; +class CGulIcon; +class CFbsBitmap; +class CHnAttributeBase; +class CHnAttributeImage; + +// CLASS DECLARATION + +/** + * Value Image. + * + * Specific class inherigint from CHnMdValue Base. This + * class is responsible for images. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdValueImage) : public CHnMdValueBase + { +public: + // Constructors and destructor + + /** + * Destructor. + */ + ~CHnMdValueImage(); + + /** + * Two-phased constructor. + * + * @param aElement XML element. + * @param aCmnPtrs pointer to common pointer structure. + * @return Object instance of meta data value image. + */ + static CHnMdValueImage* NewL( const TXmlEngElement& aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Two-phased constructor. + * + * @param aElement XML element. + * @param aCmnPtrs pointer to common pointer structure. + * @return Object instance of meta data value image. + */ + static CHnMdValueImage* NewLC( const TXmlEngElement& aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Evaluates image object changing references into values + * if possible. + * + * @param aList Parameters list used in evaluation. + * @param aPos Position of the corresponding record in a paramters list. + */ + void EvaluateL( CLiwGenericParamList* aList, TInt aPos ); + +// From CHnMdValueBase. + + /** + * Retruns path to the file or the id of the file. + * + * @param aQueriesResultsList Parameters list used when creating an attribute. + * @param aPos Position of the corresponding record in a paramters list. + * @return Attribute. + */ + CHnAttributeBase* CreateAttributeL( const CLiwGenericParamList* aQueriesResultsList, + TInt aPos ); + + /** + * Returns CGulIcon object. + * + * @param aQueriesResultsList Parameters list used when creating an attribute. + * @param aPos Position of the corresponding record in a paramters list. + * @return CGulIcon object. + */ +// CGulIcon* GetIconL( const CLiwGenericParamList* aQueriesResultsList = NULL, +// TInt aPos = 0 ); + + /** + * Returns variant containing bitmap. + * + * @param aPath Path to the bitmap file. + * @return Variant object. Ownership is transferred. + */ + TLiwVariant* BitmapFromLiwL( const TDesC8& aPath ); + + /** + * Returns bitmap. + * + * @return Variant containing bitmap object. + */ + TLiwVariant* BitmapL(); + + /** + * Returns mask. + * + * @return Variant containing bitmap object. + */ + TLiwVariant* MaskL(); + +private: + + /** + * Constructor for performing 1st stage construction + */ + CHnMdValueImage(); + + /** + * EPOC default constructor for performing 2nd stage construction + * @param aElement Xml element. + * @param aCmnPtrs Meta data common pointers. + */ + void ConstructL( const TXmlEngElement& aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Sets image source. + */ + void SetImageSourceL(); + + /** + * Searches for resource id in the given file using + * resource name. + * + * If not found return KErrNotFound + * + * @param aResourceFileContents contents of the file to search + * @param aResourceName name of the resource (string) + * @return KErrNotFound in case of error, otherwise id if the resource + */ + TInt GetResourceIdL( const TDesC8& aResourceFileContents, + const TDesC8& aResourceName ); + + /** + * File name getter. + * + * @return file name + */ + const TDesC8& FileName8(); + + /** + * Skin id getter. + * + * @return skin id. + */ + TAknsItemID SkinIdL(); + + /** + * Determines bitmap id and mask id in the MIF file. + * If bitmap id or/and mask id cannot be determined, KErrNotFound + * will be returned in aBitmapId or/and aMaskId. + * + * @param aBitmapId on successful execution will be set to bitmap id + * @param aMaskId on successful execution will be set to mask id + */ + void GetBitmapAndMaskIdL( TInt& aBitmapId, TInt& aMaskId ); + + /** + * Replaces file extension in a path to a file. + * Please note that the new extension must not be longer than the old one, + * or the method will leave. This means that this method cannot be applied + * to files without extension. + * + * @param aPath path to a file with extension + * @param aNewExt a new extension + * @return path to the same file as aPath but with extension replaced + */ + static HBufC* ReplaceFileExtensionLC( + const TDesC& aPath, const TDesC& aNewExt ); + + /** + * Application UID getter. + * + * @return application uid + */ + TUid ApplicationUidL(); + + /** + * Sets attribute data. + * + * @param aAttr Attribute data to be set. + */ + void SetAttributeDataL( CHnAttributeImage* aAttr ); + + /** + * Return Mif file name. + * + * @return Mif file name. + */ + HBufC* GetMifFileNameL(); + + /** + * Returns file name. + * + * @return File name. + */ + HBufC* GetFileNameSrcL(); + + /** + * Returns a path to the best matching mif file corresponding + * to the given file name. + * + * @param aFs a reference to the file server + * @param aFileName a name of the file to be localized + * @return a valid path to the mif file + * + */ + HBufC* FindMatchigMifFileL( const RFs& aFs, TDesC& aFileName ); + + /** + * Creates keys for caching bitmap and mask ids. + * + * @param aKeyBitmap A bitmap key name to be created. + * @param aBitmapIdBuf A bitmap id. + * @param aKeyMask A mask key to be created. + * @param aMaskIdBuf A mask id. + */ + void CHnMdValueImage::CreateKeysLC( RBuf8& aKeyBitmap, RBuf8& aBitmapIdBuf, + RBuf8& aKeyMask, RBuf8& aMaskIdBuf ); + + +private: // data + + /** + * Own - Skin id minor. + */ + RBuf8 iSkinIdMinor8; + + /** + * Own - Skin id major. + */ + RBuf8 iSkinIdMajor8; + + /** + * Own - File name. + */ + RBuf8 iFileNameSrc8; + + /** + * Own - Mif file name. + */ + RBuf8 iMifFile8; + + /** + * Own - File name. + */ + RBuf iFileName; + + /** + * Own - Bitmap id. + */ + RBuf8 iBitmapId8; + + /** + * Own - Mask id. + */ + RBuf8 iMaskId8; + + /** + * Own - Application uid. + */ + RBuf8 iApplicationUid8; + + /** + * Own - Bitmap. + */ + RBuf8 iBitmap8; + + /** + * Own - Mask; + */ + RBuf8 iMask8; + + /** + * Own - Image source. + */ + TImageSource iImageSource; + + /** + * A value contining path to the physical image + * or its id. + */ + RBuf iReturnValue; + + /** + * Common pointers. + */ + THnMdCommonPointers* iCmnPtrs; + + /** + * Parameters list. + */ + const CLiwGenericParamList* iParamList; + + /** + * Position of the corresponding record in parameters list. + */ + TInt iPos; + + /** + * Full path to the MIF file or NULL if there is no MIF file. + * Own. + */ + HBufC* iMifFileName; + + }; + +#endif // CHNMDIMAGE_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdvaluetext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdvaluetext.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,190 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef CHNMDTEXT_H +#define CHNMDTEXT_H + +#include <e32base.h> + +#include "hnmdvaluebase.h" +#include "hnglobals.h" + +class TXmlEngElement; +class CLiwGenericParamList; +struct THnMdCommonPointers; +class CDesC16Array; +class CDesC8Array; +class CArrayFix<TInt>; + +// CLASS DECLARATION + +/** + * Value Text + * + * Specific class inherigint from CHnMdValue Base. This + * class is responsible for texts: implements text handling in UI mapping phase + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdValueText) : public CHnMdValueBase + { +public: + + /** + * Two-phased constructor. + * + * @param aElement XML element. + * @param aCmnPtrs Common pointers. + */ + static CHnMdValueText* NewL( const TXmlEngElement& aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Destructor. + */ + ~CHnMdValueText(); + + /** + * From CHnMdValueBase. + * + * Retruns localized formatted text. + * + * @param aQueriesResultsList Parameters used when getting localized formatted text. + * @param aPos Position of the correspoing record in the parameters list. + * @param aValue Localized formatted text. + * @return Error code. + */ + TInt GetL( const CLiwGenericParamList* aQueriesResultsList, + TInt aPos, TPtrC& aValue ); + + /** + * Creates attribute. + * + * @param aQueriesResultsList Parameters used when creating an attribute. + * @param aPos Position of the correspoing record in the parameters list. + * @return Attribute object. + */ + CHnAttributeBase* CreateAttributeL( const CLiwGenericParamList* aQueriesResultsList, + TInt aPos ); + +private: + + /** + * Constructor for performing 1st stage construction + */ + CHnMdValueText(); + + /** + * EPOC default constructor for performing 2nd stage construction. + * + * @param aElement XML element. + * @param aCmnPtrs Common pointers. + */ + void ConstructL( const TXmlEngElement& aElement, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Fills list of parameters for text formating. + * + * @param aQueryList query results use for dynamic data. + * @param aPos position if data are in list format. + * @param aDesParams array of descriptor parameters to be filled . + * @param aNumericParams array of numeric parameters to be filled . + */ + void FillParamsL( const CLiwGenericParamList* aQueryList, TInt aPos, + CDesC16Array& aDesParams, CArrayFix<TInt>& aNumericParams); + + + /** + * Gets value from resource file + * + * @param aQueriesResultsList Query results use for dynamic data + * @param aPos Position if data are in list format + * @param aValue Return value + * @return Error code + */ + TInt GetFromResourceFileL( const CLiwGenericParamList* aQueriesResultsList, + TInt aPos, RBuf& aValue ); + + + /** + * Gets simple value. + * + * @param aQueriesResultsList Query results use for dynamic data. + * @param aPos Position if data are in list format. + * @param aValue Return value. + * @return Error code. + */ + TInt GetSimpleValueL( const CLiwGenericParamList* aQueriesResultsList, + TInt aPos, RBuf& aValue ); + +private: // data + /** + * Container of common pointers used in Hierarchy navigator + * Not own. + */ + THnMdCommonPointers* iCmnPtrs; + + /** + * Simple value, it can be unlocalized text, + * or text with localization namespace + * or path to query. + */ + RBuf8 iSimpleValue; + + /** + * Resource file name or path for query. + * Own. + */ + RBuf8 iResourceFile; + + /** + * Resource id value or path for query. + * Own. + */ + RBuf8 iResourceId; + + /** + * It is cached value that is returned to client of this class. + * Own. + */ + RBuf iCachedValue; + + /** + * Parameters list defined in XML, it should be path to query. + * Own. + */ + CDesC8Array* iParameters; + + /** + * Cached list of descriptor parameters used for formating. + * Own. + */ + CDesC16Array* iCachedDesParameters; + + /** + * Cached list of numeric parameters used for formating. + * Own. + */ + CArrayFix<TInt>* iCachedIntParameters; + + }; + +#endif // CHNMDTEXT_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnqueryresultcollector.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnqueryresultcollector.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,203 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNQUERYCOLLECTOR_H +#define C_HNQUERYCOLLECTOR_H + +#include <e32base.h> + +class CLiwGenericParamList; +class CHnMdQueries; +class CHnServiceHandler; +class CHnMdQuery; + +// CLASS DECLARATION +/** + * Query Results Collector - Callback Interface + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +class MHnQueryResultCollectorNotification + { +public: + + /** + * Callback function called after results are collected + * + * + * @since S60 5.0 + * @param aResults Results collected for the query. + */ + virtual void ResultsCollectedL( CLiwGenericParamList* aResults ) = 0; + }; + + +// CLASS DECLARATION +/** + * Query Results Collector. + * + * This class is responsible for collecting queries results. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnQueryResultCollector ): public CActive + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aQueries Queries to operate on. + * @param aParams Parameters. + * @return Fully constructed object. + */ + static CHnQueryResultCollector* NewL( const CHnMdQueries& aQueries , + const CLiwGenericParamList& aParams); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aQueries Queries to operate on. + * @param aParams Parameters. + * @return Fully constructed object. + */ + static CHnQueryResultCollector* NewLC( const CHnMdQueries& aQueries, + const CLiwGenericParamList& aParams ); + + /** + * Destructor. + */ + ~CHnQueryResultCollector(); + + /** + * Starts performing queries asynchronously. + * + * @since S60 5.0 + * @param aNotification callback interface - ResultCollectedL method calles + * when queries results collected. + */ + void StartAsynchL( MHnQueryResultCollectorNotification* aNotification ); + +protected: + // from CActive + /** + * Resets the current query results. + */ + void DoCancel(); + + /** + * Handles query result collection. + */ + void RunL(); + +private: + /** + * Standard C++ constructor. + * + * @param aQueries Queries for which results are to be executed. + * @param aParams Parameters for the queries. + */ + CHnQueryResultCollector( const CHnMdQueries& aQueries, + const CLiwGenericParamList& aParams ); + + /** + * Standard symbian 2nd phase constructor. + * + */ + void ConstructL(); + + /** + * Starts performing next query from a raw. + * + */ + void ExecQueryAsynchL(); + + /** + * Resets iterator and current results. + */ + void ResetL(); + + /** + * Check if there is another query waiting. + * + * @return ETrue if there is another query waiting. + */ + TBool NextQuery(); + + /** + * Removes items. + * + */ + void HandleQueryResultsL(); + + /** + * Executes query on Service Handler. + * + * @param aQuery Query to be executed. + */ + void ExecQueryL( CHnMdQuery& aQuery ); + +private: + + /** + * Queries. + * Not Own. + */ + const CHnMdQueries& iQueries; + + /** + * Own. + */ + CLiwGenericParamList* iResults; + + /** + * Not Own. + */ + const CLiwGenericParamList& iParams; + + /** + * Own. + */ + TInt iQueryIterator; + + /** + * Own. + */ + CLiwGenericParamList* iCurrentQueryResults; + + /** + * Not Own. + */ + MHnQueryResultCollectorNotification* iNotification; + + /** + * Service handler. + * Own. + */ + CHnServiceHandler* iSh; + + }; + +#endif // C_HNQUERYCOLLECTOR_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnrepositoryobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnrepositoryobserver.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,419 @@ +/* +* 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: factory settings for active space +* +*/ + + +#ifndef HNREPOSITORYOBSERVER_H_ +#define HNREPOSITORYOBSERVER_H_ + +#include <liwcommon.h> +#include <e32base.h> +#include <centralrepository.h> +#include <cenrepnotifyhandler.h> +#include "hnmdmodel.h" +#include "hnservicehandler.h" +#include "hnsuiteobserver.h" + +/** + * Repository Observer base class. + * + * It is used to be derived by repository observers. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnRepositoryObserver ): + public CBase, + public MCenRepNotifyHandlerCallback + { +public: + + /** + * Default C++ Destructor. + * + * @since S60 v5.0 + */ + virtual ~CHnRepositoryObserver(); + + +protected: + + /** + * Defautlt C++ Constructor. + * + * @param aCmnPtrs Common pointers. + * @since S60 v5.0 + */ + CHnRepositoryObserver( THnMdCommonPointers* aCmnPtrs ); + + + /** + * Defautlt C++ Constructor. + * + * @param aCmnPtrs Common pointers. + * @since S60 v5.0 + */ + CHnRepositoryObserver( THnMdCommonPointers* aCmnPtrs, TUint32 iId ); + + /** + * Second stage constructor. + * + * @since S60 v5.0 + */ + void ConstructL( const TUid aRepositoryUid ); + +protected: + + /** + * Own - Central Repository access class. + */ + CRepository *iRepository; + + /** + * Id of the CR entry to be watched. + */ + TUint32 iId; + + /** + * Common pointers. + */ + THnMdCommonPointers* iCmnPtrs; + + /** + * Own - Central repository notification handler. + */ + CCenRepNotifyHandler* iNotifyHandler; + + }; + +/** + * Widget Type Repository Observer. + * + * It is used to inform hierarchy navigator of changes in the suites repository. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnRepositoryWidgetTypeObserver ): public CHnRepositoryObserver + { +public: + + /** + * Default C++ Destructor. + * + * @since S60 v5.0 + */ + virtual ~CHnRepositoryWidgetTypeObserver(); + + /** + * Factory function. + * + * @param aCmnPtrs Common pointers. + * @return Repository Observer. + * @since S60 v5.0 + */ + static CHnRepositoryWidgetTypeObserver* NewL( THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid ); + + /** + * Factory function. + * + * @param aCmnPtrs Common pointers. + * @return Repository Observer. + * @since S60 v5.0 + */ + static CHnRepositoryWidgetTypeObserver* NewLC( THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid ); + + /** + * Change handler method. + * It is invoked whenever notifier detects a change in the CR. + * + * @param aId Id of the entry in CR. + * @since S60 v5.0 + */ + void HandleNotifyGeneric(TUint32 aId); + + /** + * Change handler method. + * It is invoked whenever notifier detects a change in the CR. + * + * @param aId Id of the entry in CR. + * @since S60 v5.0 + */ + void HandleNotifyGenericL(TUint32 aId); + +private: + + /** + * Defautlt C++ Constructor. + * + * @param aCmnPtrs Common pointers. + * @since S60 v5.0 + */ + CHnRepositoryWidgetTypeObserver( THnMdCommonPointers* aCmnPtrs ); + +private: + + /** + * Second stage constructor. + * + * @since S60 v5.0 + */ + void ConstructL( const TUid aRepositoryUid ); + +private: + + /** + * Array holding ids of widgets being switched. + * It is used to eliminate double refresh for such suites. + */ + RArray<TUint32> iWidgetSwitches; + + }; + + + +NONSHARABLE_CLASS( CHnRepositoryShowFolderObserver ): public CHnRepositoryObserver, + public MLiwNotifyCallback, + public MHnSuiteObserver + { +public: + + /** + * Default C++ Destructor. + * + * @since S60 v5.0 + */ + virtual ~CHnRepositoryShowFolderObserver(); + + /** + * Factory function. + * + * @param aCmnPtrs Common pointers. + * @return Repository Observer. + * @since S60 v5.0 + */ + static CHnRepositoryShowFolderObserver* NewL( + THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid, + const TUint32 aId); + + /** + * Factory function. + * + * @param aCmnPtrs Common pointers. + * @return Repository Observer. + * @since S60 v5.0 + */ + static CHnRepositoryShowFolderObserver* NewLC( + THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid, + const TUint32 aId); + + /** + * Change handler method. + * It is invoked whenever notifier detects a change in the CR. + * + * @param aId Id of the entry in CR. + * @since S60 v5.0 + */ + void HandleNotifyString(TUint32 aId, const TDesC16& aNewValue ); + + /** + * Change handler method. + * It is invoked whenever notifier detects a change in the CR. + * + * @param aId Id of the entry in CR. + * @since S60 v5.0 + */ + void HandleNotifyStringL(TUint32 aId, const TDesC16& aNewValue ); + + + /** + * From MLiwNotifyCallback + */ + TInt HandleNotifyL( + TInt aCmdId, + TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& aInParamList); + + /** + * From MHnSuiteObserver + */ + virtual void HandleSuiteEventL ( THnCustomSuiteEvent aCustomSuiteEvent, + CHnSuiteModel *aModel ); + + + +private: + + /** + * Defautlt C++ Constructor. + * + * @param aCmnPtrs Common pointers. + * @since S60 v5.0 + */ + CHnRepositoryShowFolderObserver( THnMdCommonPointers* aCmnPtrs, TUint32 iId ); + + /** + * Extracts the folder name from the CR key. + * + * @param aNewValue The CR key. + * @since S60 v5.0 + */ + void ExtractCRKeyShowFolderName( const TDesC& aNewValue ); + + /** + * Request get list for parent folder of an application. + * + * @param aFolderId A parent folder id + * @since S60 v5.0 + */ + void GetShowFolderL( TUint32 aFolderId ); + + /** + * Request get list for a folder with given application group name + * contained in iCRKeyFolderName. + * + * @since S60 v5.0 + */ + void GetShowFolderGroupNameL(); + +private: + /** + * Type of a flag describing the type of notification. + * APP_ID - MCS id is given + * APP_UID - Application UID is given + * SECOND_NOTIFY - handled notify caused by the second get list + */ + enum TNotifyType { EAPP_ID=1, EAPP_UID=2, ESECOND_NOTIFY=4 }; + +private: + + /** + * Second stage constructor. + * + * @since S60 v5.0 + */ + void ConstructL( const TUid aRepositoryUid ); + +private: + + /** + * Folder application group name. + */ + TBuf8<KApaMaxAppGroupName> iCRKeyFolderName; + + /** + * Mcs id for an application item in a folder with a given app group name. + */ + TBuf8<KUidStringLength> iCRKeyFolderItemUid; + + /** + * Own. + * Intance of the service handler. + */ + CHnServiceHandler* iServiceHandler; + + /** + * Flag describing the type of notification. + */ + TInt iNotifyType; + }; + + +NONSHARABLE_CLASS( CHnRepositoryZoomObserver ): public CHnRepositoryObserver + { +public: + + /** + * Default C++ Destructor. + * + * @since S60 v5.0 + */ + virtual ~CHnRepositoryZoomObserver(); + + /** + * Factory function. + * + * @param aCmnPtrs Common pointers. + * @return Repository Observer. + * @since S60 v5.0 + */ + static CHnRepositoryZoomObserver* NewL( + THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid, + const TUint32 aId); + + /** + * Factory function. + * + * @param aCmnPtrs Common pointers. + * @return Repository Observer. + * @since S60 v5.0 + */ + static CHnRepositoryZoomObserver* NewLC( + THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid, + const TUint32 aId); + + /** + * Change handler method. + * It is invoked whenever notifier detects a change in the CR. + * + * @param aId Id of the entry in CR. + * @since S60 v5.0 + */ + void HandleNotifyInt(TUint32 aId, TInt aNewValue ); + + /** + * Change handler method. + * It is invoked whenever notifier detects a change in the CR. + * + * @param aId Id of the entry in CR. + * @since S60 v5.0 + */ + void HandleNotifyIntL(TUint32 aId, TInt aNewValue ); + +private: + + /** + * Defautlt C++ Constructor. + * + * @param aCmnPtrs Common pointers. + * @since S60 v5.0 + */ + CHnRepositoryZoomObserver( THnMdCommonPointers* aCmnPtrs, TUint32 iId ); + +private: + + /** + * Second stage constructor. + * + * @since S60 v5.0 + */ + void ConstructL( const TUid aRepositoryUid ); + + /** + * Setup initial value of zoom at startup; + * + * @since S60 v5.0 + */ + void InitializeL(); + }; + +#endif /*HNREPOSITORYOBSERVER_H_*/ + +//End of file + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnsimplecondition.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnsimplecondition.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,228 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNSIMPLECONDITION_H +#define C_HNSIMPLECONDITION_H + +#include <e32base.h> +#include <e32hashtab.h> +#include <xmlengelement.h> +#include <liwgenericparam.h> +#include "hnglobals.h" +#include "hnconditioninterface.h" + +class CLiwGenericParamList; +class TLiwVariant; + +/** + * Simple Condition. + * + * The simple condition class. This is the base class for different + * condition classes, e.g. Greater, Has, HasNot conditions. + * + * @lib hierarchynavigatorengine + * @since S60 v3.2 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnSimpleCondition) : public CHnConditionInterface + { +public: + + /** + * Standard factory function. + * + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnSimpleCondition* NewL( TDesC8 & aElement ); + + /** + * Standard C++ Destructor + */ + ~CHnSimpleCondition(); + + /** + * Removes quotes. + * + * @since S60 v3.2 + * @param aValue String to remove quotes from. + */ + static void RemoveQuotes( RBuf8 & aValue ); + + /** + * Returns result. + * + * @since S60 v3.2 + * @param aQueryResults Results of query. + * @param aPos Position. + * @return True if condition is satisfied. + */ + TBool ResultL( const CLiwGenericParamList& aQueryResults, TInt aPos ); + + /** + * Returns result. + * + * @since S60 v3.2 + * @param aVarLeft Left variant. + * @param aVarRight Right variant. + * @return True if condition is satisfied. + */ + virtual TBool CheckCondition( TLiwVariant& aVarLeft, TLiwVariant& aVarRight ) = 0; + +protected: + + /** + * Standard C++ Constructor + */ + CHnSimpleCondition(); + + /** + * Standard symbian second phase constructor. + * + * @param aElement Xml element. + */ + void ConstructL( TDesC8 & aElement ); + + /** + * Gets positions. + * + * @param aBuffer Buffer. + * @return Position. + */ + virtual TInt GetPositionL( const TDesC8& aBuffer ) = 0; + + /** + * Gets length. + * + * @return Length of an operator. + */ + virtual TInt SignLength() = 0; + +private: + + + /** + * Checks if both combinations, if either of the pairs, has this + * sort of type configuration. + * + * @since S60 v3.2 + * @param aVarLeft Left variant. + * @param aVarRight Right variant. + * @param aType1 Variant type 1. + * @param aType2 Variant type 2. + */ + static TLiwVariant* CheckTypes( TLiwVariant* aVarLeft, TLiwVariant* aVarRight, + LIW::TVariantTypeId aType1, LIW::TVariantTypeId aType2 ); + + /** + * Normalizes to one sort of descriptor type. + * + * @since S60 v3.2 + * @param aVar Variant. + */ + static void NormalizeVariantTypeDesL( TLiwVariant* aVar ); + + /** + * Tries to match types of content. + * + * @since S60 v3.2 + * @param aVarLeft Left variant. + * @param aVarRight Right variant. + */ + static void NegotiateTypesL( TLiwVariant* aVarLeft, TLiwVariant* aVarRight ); + + /** + * If list is compared to a string, a decision is made, to substitute list a + * its Count() scalar. + * + * @since S60 v3.2 + * @param aVar Variant. + */ + static void NegotiateListL( TLiwVariant & aVar ); + + /** + * If map is compared to a string, a decision is made, to substitute list a + * its Count() scalar. + * + * @since S60 v3.2 + * @param aVar Variant. + */ + static void NegotiateMapL( TLiwVariant & aVar ); + + /** + * If tuint is compared to a string, a decision is made, to substitute + * it as tuint + * + * @since S60 v3.2 + * @param aVar Variant. + */ + static void NegotiateTUintL( TLiwVariant & aVar ); + + + /** + * + * @since S60 v3.2 + * @param aVar Variant. + */ + static void NegotiateTBoolL( TLiwVariant & aVar ); + + + /** + * If tuint is compared to a string, a decision is made, to substitute + * it as tin32 + * + * @since S60 v3.2 + * @param aVar Variant. + */ + static void NegotiateTInt32L( TLiwVariant & aVar ); + + /** + * If tuint is compared to a string, a decision is made, to substitute + * it as tin32 + * + * @since S60 v3.2 + * @param aVar Variant. + */ + static void NegotiateTInt64L( TLiwVariant & aVar ); + + /** + * Creates implementation of CHnMenuCondition. + * + * @param aElement Xml element. + * @return Instance of CHnMenuCondition. + */ + static CHnSimpleCondition* CreateImplementationL( TDesC8 & aElement ); + +protected: // data + + /** + * Own - Key. + */ + RBuf8 iReferenceRight; + + /** + * Own - Key. + */ + RBuf8 iReferenceLeft; + + }; + +#endif // C_HNSIMPLECONDITION_H + +//End of file diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnsimpleconditiondifferent.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnsimpleconditiondifferent.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNSIMPLECONDITIONDIFFERENT_H +#define C_HNSIMPLECONDITIONDIFFERENT_H + +#include "hnsimplecondition.h" + +/** + * Simple Condition Different. + * + * Class compares condition with criterium 'different'. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ + NONSHARABLE_CLASS( CHnSimpleConditionDifferent ) : public CHnSimpleCondition + { + /** + * Gets positions. From CHnMenuCondition + * + * @param aBuffer Buffer. + * @return Position. + */ + TInt GetPositionL( const TDesC8& aBuffer ); + + /** + * Returns result. From CHnMenuCondition + * + * @since S60 v3.2 + * @param aVarLeft Left Liv variant condition to compare. + * @param aVarRight Right Liv variant condition to compare. + * @return True if condition is satisfied. + */ + TBool CheckCondition( TLiwVariant& aVarLeft, TLiwVariant& aVarRight ); + + /** + * Gets length. From CHnMenuCondition + * + * @return Length of an operator. + */ + TInt SignLength(); + }; + +#endif // C_HNSIMPLECONDITIONDIFFERENT_H + +//End of file diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnsimpleconditionequal.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnsimpleconditionequal.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNSIMPLECONDITIONEQUAL_H +#define C_HNSIMPLECONDITIONEQUAL_H + +#include "hnsimplecondition.h" + +/** + * Simple Condition Equal. + * + * Class compares condition with criterium 'equal'. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnSimpleConditionEqual ) : public CHnSimpleCondition + { + /** + * Gets positions. From CHnMenuCondition. + * + * @param aBuffer Buffer. + * @return Position. + */ + TInt GetPositionL( const TDesC8& aBuffer ); + + /** + * Returns result. From CHnMenuCondition. + * + * @since S60 v3.2 + * @param aVarLeft Left Liv variant condition to compare. + * @param aVarRight Right Liv variant condition to compare. + * @return True if condition is satisfied. + */ + TBool CheckCondition( TLiwVariant& aVarLeft, TLiwVariant& aVarRight ); + + /** + * Gets length. From CHnMenuCondition. + * + * @return Length of an operator. + */ + TInt SignLength(); + }; + +#endif // C_HNSIMPLECONDITIONEQUAL_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnsimpleconditiongreater.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnsimpleconditiongreater.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNSIMPLECONDITIONGREATER_H +#define C_HNSIMPLECONDITIONGREATER_H + +#include "hnsimplecondition.h" + +/** + * Simple Condition Greater. + * + * Class compares condition with criterium 'greater'. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnSimpleConditionGreater ) : public CHnSimpleCondition + { + /** + * Gets positions. From CHnMenuCondition. + * + * @param aBuffer Buffer. + * @return Position. + */ + TInt GetPositionL( const TDesC8& aBuffer ); + + /** + * Returns result. From CHnMenuCondition. + * + * @since S60 v3.2 + * @param aVarLeft Left Liv variant condition to compare. + * @param aVarRight Right Liv variant condition to compare. + * @return True if condition is satisfied. + */ + TBool CheckCondition( TLiwVariant& aVarLeft, TLiwVariant& aVarRight ); + + /** + * Gets length. From CHnMenuCondition. + * + * @return Length of an operator. + */ + TInt SignLength(); + }; + +#endif // C_HNSIMPLECONDITIONGREATER_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnsimpleconditionhas.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnsimpleconditionhas.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef HNSIMPLECONDITIONHAS_H_ +#define HNSIMPLECONDITIONHAS_H_ + +#include "hnsimplecondition.h" + +/** + * Simple Condition Has. + * + * Class compares condition with criterium 'has'. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnSimpleConditionHas ) : public CHnSimpleCondition + { + /** + * Gets positions. From CHnMenuCondition. + * + * @param aBuffer Buffer. + * @return Position. + */ + TInt GetPositionL( const TDesC8& aBuffer ); + + /** + * Returns result. From CHnMenuCondition. + * + * @since S60 v3.2 + * @param aVarLeft Left Liv variant condition to compare. + * @param aVarRight Right Liv variant condition to compare. + * @return True if condition is satisfied. + */ + TBool CheckCondition( TLiwVariant& aVarLeft, TLiwVariant& aVarRight ); + + /** + * Gets length. From CHnMenuCondition. + * + * @return Length of an operator. + */ + TInt SignLength(); + }; + +#endif /*HNSIMPLECONDITIONHAS_H_*/ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnsimpleconditionhasnot.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnsimpleconditionhasnot.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef HNSIMPLECONDITIONHASNOT_H_ +#define HNSIMPLECONDITIONHASNOT_H_ + +#include "hnsimplecondition.h" + +/** + * Simple Condition Has Not. + * + * Class compares condition with criterium 'hasnot'. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnSimpleConditionHasNot ) : public CHnSimpleCondition + { + /** + * Gets positions. From CHnMenuCondition. + * + * @param aBuffer Buffer. + * @return Position. + */ + TInt GetPositionL( const TDesC8& aBuffer ); + + /** + * Returns result. From CHnMenuCondition. + * + * @since S60 v3.2 + * @param aVarLeft Left Liv variant condition to compare. + * @param aVarRight Right Liv variant condition to compare. + * @return True if condition is satisfied. + */ + TBool CheckCondition( TLiwVariant& aVarLeft, TLiwVariant& aVarRight ); + + /** + * Gets length. From CHnMenuCondition. + * + * @return Length of an operator. + */ + TInt SignLength(); + }; + +#endif /*HNSIMPLECONDITIONHASNOT_H_*/ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnsimpleconditionsmaller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnsimpleconditionsmaller.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNSIMPLECONDITIONSMALLER_H +#define C_HNSIMPLECONDITIONSMALLER_H + +#include "hnsimplecondition.h" + +/** + * Simple Condition Smaller. + * + * Class compares with criterium 'smaller'. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnSimpleConditionSmaller ) : public CHnSimpleCondition + { + /** + * Gets positions. From CHnMenuCondition. + * + * @param aBuffer Buffer. + * @return Position. + */ + TInt GetPositionL( const TDesC8& aBuffer ); + + /** + * Returns result. From CHnMenuCondition. + * + * @since S60 v3.2 + * @param aVarLeft Left Liv variant condition to compare. + * @param aVarRight Right Liv variant condition to compare. + * @return True if condition is satisfied. + */ + TBool CheckCondition( TLiwVariant& aVarLeft, TLiwVariant& aVarRight ); + + /** + * Gets length. From CHnMenuCondition. + * + * @return Length of an operator. + */ + TInt SignLength(); + }; + +#endif // C_HNSIMPLECONDITIONSMALLER_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnstringhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnstringhandler.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef HNSTRINGHANDLER_H +#define HNSTRINGHANDLER_H + +#include <e32base.h> + +class CDesC16Array; +struct THnMdCommonPointers; + +/** + * String Handler. + * + * Contains static methods for strings manipulation. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(HnStringHandler) + { +public: + /** + * Localize given string + * it is given in format + * @verbatim <namespace>:<id> @endverbatim + * namespace can be declared in XML + * it also accepts format myapp.rsc:MY_RESOURCE + * + * @param aDestination destiation where localized text is returned + * @param aSource string to localize + * @param aCmnPtrs common pointers, if not given, + * taken from THnMdCommonPointers::Static() + */ + static void LocaliseL( RBuf& aDestination, RBuf& aSource, + THnMdCommonPointers* aCmnPtrs ); + /** + * Localize given string + * it is given in format + * @verbatim <namespace>:<id> @endverbatim + * namespace can be declared in XML + * it also accepts format myapp.rsc:MY_RESOURCE + * It formats string based on parameters provided. + * + * @param aDestination destiation where localized text is returned + * @param aSource string to localize + * @param aDesParams list descriptor parameters to format %U, %0U + * @param aIntParams list integer parameters to format %N, %0N + * @param aCmnPtrs common pointers, if not given, + * taken from THnMdCommonPointers::Static() + */ + static void LocaliseL( RBuf& aDestination, RBuf& aSource, + CDesC16Array* aDesParams, + CArrayFix<TInt>* aIntParams, + THnMdCommonPointers* aCmnPtrs ); + + /** + * Compares strings ignoring character case. + * + * @param aLeft Base descriptor. + * @param aRight Descriptor to be compared with the base descriptor. + */ + static TInt CompareIgnoreCaseL( const TDesC& aLeft, const TDesC& aRight ); + + /** + * Compares strings ignoring character case. + * + * @param aLeft Base descriptor. + * @param aRight Descriptor to be compared with the base descriptor. + */ + static TInt CompareIgnoreCaseL( const TDesC8& aLeft, const TDesC8& aRight ); + }; + +#endif // HNSTRINGHANDLER_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnutils.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,133 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNUTILS_H +#define C_HNUTILS_H + +#include <e32base.h> + +class CHnMdLocalization; +class CHnMdBaseKey; +class CLiwGenericParamList; +class TLiwVariant; +class CHnSuiteModel; +class TXmlEngElement; + + +/** + * Utils + * + * Utility class. + * + * @lib hnmetadatamodel + * @since S60 3.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( HnUtils ) + { +public: + + /** + * Read file. + * + * @since S60 v3.0 + * @param aPath Path to a file. + * @return Buffer. + */ + IMPORT_C static HBufC8* ReadFileLC(const TDesC& aPath); + + /** + * Read file. + * + * @since S60 v3.0 + * @param aPath Path to a file. + * @return Buffer. + */ + IMPORT_C static HBufC8* ReadFileL(const TDesC& aPath); + + /** + * Locates file. + * + * @since S60 v3.0 + * @param aFile File name. + * @return File path. + */ + IMPORT_C static HBufC* LocateFileLC( const TDesC& aFile ); + + /** + * Locates nearest Language file. + * + * @since S60 v3.0 + * @param aFile File name. + * @return File path. + */ + IMPORT_C static HBufC* LocateNearestLanguageFileLC( const TDesC& aFile ); + + + + /** + * Sets given descriptor using xml element textual value. + * + * @since S60 v5.0 + * @param aElement Xml element. + * @param aAttribute Descriptor to be set using aElement. + */ + IMPORT_C static void SetAttributeL( const TXmlEngElement& aElement, + RBuf8& aAttribute ); + + /** + * Sets given descriptor using xml attribute. + * + * @since S60 v5.0 + * @param aElement Xml element from which the attribute will be retrieved + * by aAttributeName. + * @param aAttributeName The name of the attribute to be read from + * aElement. + * @param aAttribute A descriptor to be set using a value of the attribute + * from aElement. + */ + IMPORT_C static void SetAttributeL( const TXmlEngElement& aElement, + const TDesC8& aAttributeName, RBuf8& aAttribute ); + + /** + * Fetches given columns string. + * + * @since S60 v5.0 + * @param aColumn Which column to fetch. + * @param aSourceText Source texts. + * @param aColumnSeparator Character that separates columns. + */ + IMPORT_C static HBufC8 * GetColumnTextLC(TInt aColumn, const TDesC8 & aSourceText, + TChar aColumnSeparator = TChar('|')); + + /** + * Fetches number of columns. + * + * @since S60 v5.0 + * @param aSourceText Source texts. + * @param aColumnSeparator Character that separates columns. + */ + IMPORT_C static TInt GetColumnTextColumnCount(const TDesC8 & aSourceText, + TChar aColumnSeparator = TChar('|')); + +private: + }; + +#endif // C_HNUTILS_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnxmlmodelcache.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnxmlmodelcache.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,164 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef HNXMLMODELCACHE_H_ +#define HNXMLMODELCACHE_H_ + +#include <e32base.h> +#include <e32hashtab.h> +#include <xmlengdom.h> +#include <bautils.h> + + +/** + * Suites cache. + * + * This class is designed to support caching xml documents which contain + * suites definitions. + * + * The cache is directlty used by the xml model provider (CHnXmlModelProvider) + * and is transparent for other data model's classes. + * + * The cache has a maksimum capacity which is equal to KXmlModelCacheMaxLength. + * The cache works similarily to a shift register. When the maksimum size of + * the cache is exceeded then the last element in the cache is removed. + * On contrary, most often used xml documents are moved to the beggining + * of the cache. + * + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS( CHnXmlModelCache ) : public CBase + { + +private: + + /** + * Default constructor. + * + * @since S60 5.0 + */ + CHnXmlModelCache(); + + /** + * Standard second phase constructor. + * + * @since S60 5.0 + */ + void ConstructL(); + + /** + * Removes a xml document from the cache if the size of the cache + * is exceeded. + * + * @since S60 5.0 + */ + void RemoveUnused(); + + /** + * Moves the xml document (identified by a given name) to the top of the + * cache. + * + * @param aSuiteName A name of the xml document to be moved to the top + * of the cache. + * @since S60 5.0 + */ + void MoveToTopL( const TDesC & aSuiteName ); + +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + */ + static CHnXmlModelCache* NewLC(); + + /** + * Two-phase constructor. + * + * + */ + static CHnXmlModelCache* NewL(); + + /** + * Adds a new xml document into the cache. + * @param aSuiteName A name of the suite. + * @param aDocument A xml document to be added to the cache. + * + * @since S60 5.0 + */ + TInt AddL( const TDesC& aSuiteName, RXmlEngDocument& aDocument ); + + /** + * Checks if the xml document is stored in the cache. + * + * @param aSuiteName The name of the suite to be checked. + * @return ETrue if a suite of a given name is stored in the cache, + * otherwise - EFalse. + * + * @since S60 5.0 + */ + TBool IsCachedL( const TDesC& aSuiteName ); + + /** + * Gets a xml document by a given name. + * + * @param aSuiteName The name corresponding to the xml document to be + * retrieved from the cache. + * @param aDocument The reference to the xml document. + * + * @since S60 5.0 + */ + void GetL( const TDesC& aSuiteName, RXmlEngDocument& aDocument ); + + /** + * Resets the cache - removes all stored xml documents. + * + * @since S60 5.0 + */ + void Reset(); + + /** + * Standard C++ virtual destructor. + * + * @since S60 5.0 + */ + virtual ~CHnXmlModelCache(); + +private: + + /** + * The hash map storing pairs: name of the suite, corresponding xml + * document. + * + * @since S60 5.0 + */ + RHashMap< HBufC*, RXmlEngDocument > iDocuments; + + /** + * An auxilliary array storing the order of the xml document + * in the cache. + * + * @since S60 5.0 + */ + RPointerArray< HBufC > iOrder; + + }; + +#endif /*HNXMLMODELCACHE_H_*/ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnxmlmodelprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnxmlmodelprovider.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,313 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMULMODELPROVIDER_H +#define C_HNMULMODELPROVIDER_H + + +#include <xmlengdom.h> +#include <bautils.h> +#include <e32hashtab.h> + +class CHnXmlModelCache; + +/** + * Xml Model Provider + * + * Parses suites definitions in xml and makes changes in model. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnXmlModelProvider) : public CActive + { +public: + /** + * Standard factory method. + * + * @since S60 v5.0 + * @return Fully constructed object. + */ + IMPORT_C static CHnXmlModelProvider* NewL(); + + /** + * Standard factory method. + * + * @since S60 v5.0 + * @return Fully constructed object. + */ + IMPORT_C static CHnXmlModelProvider* NewLC(); + + /** + * Standard virtual destructor. + */ + IMPORT_C virtual ~CHnXmlModelProvider(); + + /** + * @see CAsctive::DoCancel + */ + void DoCancel(); + + /** + * Services the suite synchronization steps according to class iterator. + * + * @see CAsctive::RunL + */ + void RunL(); + +private: + + /** + * ReadFileLC reads file. + * + * @since S60 v5.0 + * @param aPath Path to a file. + * @return Content of the file. + */ + HBufC8* ReadFileLC(const TDesC& aPath); + + /** + * Parses a document. + * + * @since S60 v5.0 + * @param aDoc A document to be parsed. + * @return Xml document. + */ + RXmlEngDocument ParseDocL( const TDesC8& aDoc ); + + + /** + * Builds root of xml model from suite definition. + * + * @since S60 v5.0 + * @param aSuiteName Suite name. + * @param aXmlDoc XLM model of the suite. + * @return Error code. + */ + TInt CollectSuiteL( const TDesC& aSuiteName, RXmlEngDocument& aXmlDoc ); + + /** + * appends items to suite in model, + * + * @since S60 v5.0 + * @param aSuiteName Name of suite to append items to. + * @param aXmlDoc XLM model of the suite. + */ + void CollectItemsL(const TDesC& aSuiteName, RXmlEngDocument& aXmlDoc ); + + /** + * Copies suites and items definitions to working dir. + * + * @since S60 v5.0 + * @return Error code. + */ + TBool SynchronizeSuitesL(); + + /** + * Creates model from suite definition. + * + * @since S60 v5.0 + * @param aStr Name of suite. + * @param aXmlDoc XML model of the suite. + */ + void CreateModelL( const TDesC& aStr, RXmlEngDocument& aXmlDoc ); + + /** + * Changes event names to ids. + * + * @since S60 v5.0 + * @param aElement Xml element. + */ + void ChangeEventNamesToIdsL( TXmlEngElement& aElement ); + + /** + * Changes event names to items in all the children. + * + * @see ChangeEventNamesToIdsL + * @since S60 v5.0 + * @param aElement Xml element. + */ + void ChangeEventsToIdsInChildrenL( + TXmlEngElement & aElement ); + +#ifdef _DEBUG + /** + * Logs event mapping. + * + * @since S60 v5.0 + * @param aEventMap Event map. + */ + void LogEventMapping( const RHashMap<HBufC*, TInt>& aEventMap ); +#endif + +public: + + /** + * Parses a document. + * + * @param aPath Path to a file. + * @return RXmlEngDocument. + */ + RXmlEngDocument ParseFileL( const TDesC& aPath ); + + /** + * Resets cached models. + */ + void ResetCache(); + + /** + * Reparses a document. + */ + IMPORT_C void ReloadModelL(); + + /** + * Parses a document - searching proper suite. + * + * @param aStr Name of the model. + * @param aXmlDoc A reference to document of RXmlEngDocument class; + * @return Error code. KErrNone if model found. + */ + IMPORT_C TInt GetModelL( const TDesC& aStr, RXmlEngDocument& aXmlDoc ); + + /** + * Parses a document. + * + * @param aEventName Event name. + * @return Event id. + */ + TInt GetNewEventId( HBufC* aEventName ); + + /** + * Check if suite exists. + * + * @since S60 5.0 + * @param aSuite Suite name. + * @return ETrue if suite exists, otherwise EFalse. + */ + TBool SuiteExistsL( const TDesC& aSuite ); + +private: + + /** + * Invoked after asynchronous synchronization is finished. + */ + void SynchronizationFinishedL(); + + /** + * Sets up normal path to suites. + * + * @param aPath Path to be searched for suites. + */ + void SearchPathForSuitesL( const TDesC& aPath ); + + /** + * Sets up normal path to suites. + */ + void SetupSuitePathL(); + + /** + * Sets up fail sage path to suites. + */ + void SetupFailSafeSuitePathL(); + + /** + * Standard C++ constructor. + */ + CHnXmlModelProvider(); + + /** + * Standard symbian 2nd phase constructor. + */ + void ConstructL(); + + /** + * Finds drive letter where suite definition is. + * + * @since S60 v5.0 + * @return Error code + */ + void CheckDrivesL(); + + +#ifdef _DEBUG +private: + void LogSuiteModel( const TDesC& aName, + RXmlEngDocument& aDoc ); +#endif // _DEBUG + +private: // data + + /** + * Xml DOM implementation. + */ + RXmlEngDOMImplementation iDomImpl; + + /** + * Xml DOM parser. + */ + RXmlEngDOMParser iDomParser; + + /** + * File server session + */ + RFs iFs; + + /** + * File manager + */ + CFileMan* iFileMan; + + /** + * List containing names of suites (suite name is same as dir name) + * that should be installed from all drives + */ + RHashSet< HBufC* > iInstSuites; + + /** + * Event map. + */ + RHashMap< HBufC*, TInt > iEventMap; + + /** + * Main path. + */ + RBuf iPath; + + /** + * Cached suites. + */ + CHnXmlModelCache* iCache; + + /** + * Own. Iterator used in synchronisation. + * Indicates next suite name to be synchronised. + */ + THashSetIter<HBufC*>* iSuiteSetIterator; + + /** + * ETrue if suite files on the c: drive were updated during the + * last synchronization. New suite files also count as updated. + * EFalse if the last synchronization did not alter any files + * on the c: drive. + */ + TBool iSuiteFilesUpdated; + + }; +#endif // C_HNMULMODELPROVIDER_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnxmlsuitefilesreg.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnxmlsuitefilesreg.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,160 @@ +/* +* Copyright (c) 2007-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: +* Version : %version: 2 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + + +#ifndef C_HNXMLSUITEFILESREG_H +#define C_HNXMLSUITEFILESREG_H + +#include <bautils.h> +#include <e32hashtab.h> + +/** + * Structure binding file information together. + * All of this information is essential when synchronising suite files. + */ +NONSHARABLE_STRUCT(THnFileInfo) + { + TBuf< KMaxFileName > iFileName; + TBuf< KMaxPath > iFilePath; + TTime iLastModified; + TInt iSize; + }; + +/** + * Registry of suite definition files. + * + * Keeps track of the suite files' sync. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnXmlSuiteFilesReg) : public CBase + { +public: + /** + * Standard factory method. + * + * @since S60 v5.0 + * @return Fully constructed object. + */ + static TBool SynchronizeL( RFs & aFs, const TDesC &aSuiteName ); + + /** + * Standard virtual destructor. + */ + virtual ~CHnXmlSuiteFilesReg(); + +private: + + /** + * Standard C++ constructor. + */ + CHnXmlSuiteFilesReg( RFs & aFs ); + + /** + * Standard symbian 2nd phase constructor. + */ + void ConstructL( const TDesC &aSuiteName ); + + /** + * Destroys suite file maps. + */ + void DestroySuiteFilesMaps(); + + /** + * Returns the valid suite import dir. + * + * @param aDriveNumber Number of the drive for which to create path. + * @return Path. + */ + HBufC* GetSuiteImportDirL( TInt aDriveNumber ) const; + + /** + * Searches all the drives for import files for this particular suite. + */ + void SearchDrivesForSuiteFilesL(); + + /** + * Processes suite import dir. + * + * @param aSuitePath Path of the suite import. + */ + void SearchDirForSuiteFilesL( const TDesC& aSuitePath ); + + /** + * Adds a file to the suite map. The logics in the methods always prefers + * the newer files over the older. If a file by the same name already exists + * with a newer date file will not be added. + * + * @param aDir Directory of the new file. + * @param aFile New file entry. + */ + void AddSuiteFileToMapL( const TDesC& aDir, const TEntry& aFile ); + + /** + * Calculates the current size of the dir in the installation.\ + * + * @return Size in bytes. + */ + TInt CalculateCurrentSuiteSizeL(); + + /** + * Calculates the size of the data to be synchronised. + * + * @return Size in bytes. + */ + TInt CalculateSynchronizationSuiteSize(); + + /** + * Synchronizes the suite files. + */ + TBool SynchronizeSuiteFilesL(); + + /** + * Constructs the valid installation path. + * + * @return The installation path. + */ + HBufC* GetSuiteInstallPathL(); + +private: + + /** + * Name of the suite (suite folder). + */ + RBuf iSuiteName; + + /** + * File server session reference + */ + RFs &iFs; + + /** + * File manager + */ + CFileMan* iFileMan; + + /** + * Hashmap containing paths to the suite files. + */ + RHashMap< const TDesC*, THnFileInfo* > iSuiteFiles; + + }; +#endif // C_HNXMLSUITEFILESREG_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/mymenudebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/mymenudebug.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2007-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: debug constants definitions +* +*/ + + +#ifndef MYMENUDEBUG_H +#define MYMENUDEBUG_H + +// MACROS +#define APPEND_TO_DEBUG_FILE + +// CONSTANTS +_LIT(KDebugDirName, "menu"); +_LIT(KDebugFileName, "hnmetadatamodel.txt"); + +#endif // MYMENUDEBUG_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnbitmapidcache.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnbitmapidcache.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,149 @@ +/* +* Copyright (c) 2007-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: +* Version : %version: 3 % << Don't touch! Updated by Synergy at check-out. +* +*/ + +#include "hnbitmapidcache.h" +#include "hnglobals.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TUint32 HBufC8HashCache( HBufC8* const & aBuf ) + { + return DefaultHash::Des8(*aBuf); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool HBufC8IdentCache( HBufC8* const & aL, HBufC8* const & aR ) + { + return DefaultIdentity::Des8(*aL, *aR); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnBitmapIdCache::CHnBitmapIdCache() : iEntries( &HBufC8HashCache, + &HBufC8IdentCache ) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnBitmapIdCache::ConstructL() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnBitmapIdCache::AddL( const TDesC8& aKey, TInt aValue ) + { + HBufC8* key = aKey.AllocL(); + iEntries.InsertL( key, aValue ); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnBitmapIdCache::ExistsL( const TDesC8& aKey ) + { + HBufC8* buf = aKey.AllocLC(); + TInt* value = iEntries.Find( buf ); + CleanupStack::PopAndDestroy( buf ); + + if ( value ) + return ETrue; + else + return EFalse; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnBitmapIdCache::GetL( const TDesC8& aKey, TInt& value ) + { + HBufC8* buf = aKey.AllocLC(); + const TInt* res = iEntries.Find( buf ); + + if ( res ) + { + value = *res; + } + + CleanupStack::PopAndDestroy( buf ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnBitmapIdCache* CHnBitmapIdCache::NewLC() + { + CHnBitmapIdCache* self = new (ELeave) CHnBitmapIdCache(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnBitmapIdCache* CHnBitmapIdCache::NewL() + { + CHnBitmapIdCache* self = CHnBitmapIdCache::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnBitmapIdCache::Reset() + { + THashMapIter<HBufC8*, TInt> iter( iEntries ); + while ( HBufC8* const * ptr = iter.NextKey() ) + { + TInt* value = iter.CurrentValue(); + delete *ptr; + } + iEntries.Close(); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnBitmapIdCache::~CHnBitmapIdCache() + { + Reset(); + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hncomplexcondition.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hncomplexcondition.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,162 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <liwservicehandler.h> + +#include "hncomplexcondition.h" +#include "hnliwutils.h" +#include "hnglobals.h" +#include "hnconditionfactory.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnComplexCondition* CHnComplexCondition::NewL( TDesC8 & aElement ) + { + CHnComplexCondition* self = new (ELeave) CHnComplexCondition(); + CleanupStack::PushL( self ); + self->ConstructL( aElement ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnComplexCondition::CHnComplexCondition() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnComplexCondition::~CHnComplexCondition() + { + delete iRightCondition; + delete iLeftCondition; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnComplexCondition::CheckForOrOnTheSameLevelL( TDesC8 & aConditionString ) + { + TBool ret = EFalse; + TLex8 lexer( aConditionString ); + TInt lookForClosingBrace( 0 ); + while ( !lexer.Eos() ) + { + switch ( TUint( lexer.Get() ) ) + { + case EOpeningBrace : + lookForClosingBrace++; + break; + case EClosingBrace : + lookForClosingBrace--; + ret = EFalse; + lexer.Inc( lexer.Remainder().Length() ); + break; + case ELogicalOr: + if (lookForClosingBrace == 0) + { + ret = ETrue; + } + break; + } + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnComplexCondition::ConstructL( TDesC8 & aElement ) + { + TLex8 lexer( aElement ); + TInt lookForClosingBrace( 0 ); + while ( !lexer.Eos() ) + { + TChar character = lexer.Get(); + switch ( TUint( character ) ) + { + case EOpeningBrace : + lookForClosingBrace++; + break; + case EClosingBrace : + lookForClosingBrace--; + User::LeaveIfError( lookForClosingBrace ); + break; + case ELogicalAnd: + { + TPtrC8 remainder = lexer.Remainder(); + if ( CheckForOrOnTheSameLevelL( remainder ) ) + { + break; + } + } + case ELogicalOr: + if (lookForClosingBrace == 0) + { + iOperation = (TOperator) TUint(character); + TPtrC8 rightSide = lexer.Remainder(); + iRightCondition = HnConditionFactory::NewL( rightSide ); + lexer.UnGet(); + TPtrC8 leftSide = lexer.MarkedToken(); + iLeftCondition = HnConditionFactory::NewL( leftSide ); + lexer.Inc( lexer.Remainder().Length() ); + } + break; + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnComplexCondition::ResultL( const CLiwGenericParamList& aQueryResults, + TInt aPos ) + { + TBool ret = false; + + if ( iOperation == ELogicalAnd ) + { + ret = iLeftCondition->ResultL(aQueryResults, aPos) && + iRightCondition->ResultL(aQueryResults, aPos); + } + else if ( iOperation == ELogicalOr ) + { + ret = iLeftCondition->ResultL(aQueryResults, aPos) || + iRightCondition->ResultL(aQueryResults, aPos); + } + else + { + User::Leave(KErrNotFound); + } + + return ret; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnconditionfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnconditionfactory.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,166 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnconditionfactory.h" +#include "hnsimplecondition.h" +#include "hncomplexcondition.h" +#include "hnglobals.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnConditionInterface* HnConditionFactory::NewL( TXmlEngAttr aElement ) + { + CHnConditionInterface* self = HnConditionFactory::NewLC( aElement ); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnConditionInterface* HnConditionFactory::NewLC( TXmlEngAttr aElement ) + { + TPtrC8 condition = aElement.Value(); + CHnConditionInterface* self = ConstructConditionL( condition ); + CleanupStack::PushL( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnConditionInterface* HnConditionFactory::NewL( TDesC8 & aElement ) + { + CHnConditionInterface* self = HnConditionFactory::NewLC( aElement ); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnConditionInterface* HnConditionFactory::NewLC( TDesC8 & aElement ) + { + CHnConditionInterface* self = HnConditionFactory::ConstructConditionL( aElement ); + CleanupStack::PushL( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HnConditionFactory::TrimConditionL( RBuf8 & aConditionString ) + { + TBool ret; + do + { + ret = EFalse; + aConditionString.TrimAll(); + TInt conditionLastIndex = aConditionString.Length()-1; + if (aConditionString[0] == EOpeningBrace + && aConditionString[conditionLastIndex] == EClosingBrace ) + { + aConditionString[0] = ESpace; + aConditionString[conditionLastIndex] = ESpace; + + ret = ETrue; + + if ( CheckBraceIntegrityL( aConditionString ) ) + { + aConditionString[0] = EOpeningBrace; + aConditionString[conditionLastIndex] = EClosingBrace; + ret = EFalse; + } + } + } + while (ret); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool HnConditionFactory::CheckBraceIntegrityL( TDesC8 & aConditionString ) + { + TInt ret(KErrNone); + TLex8 lexer( aConditionString ); + TInt lookForClosingBrace( 0 ); + while ( !lexer.Eos() ) + { + switch ( TUint( lexer.Get() ) ) + { + case EOpeningBrace : + lookForClosingBrace++; + break; + case EClosingBrace : + lookForClosingBrace--; + if (lookForClosingBrace < 0) + { + ret = KErrGeneral; + lexer.Inc( lexer.Remainder().Length() ); + } + break; + } + } + + if (lookForClosingBrace > 0) + { + ret = KErrGeneral; + } + + return ret; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnConditionInterface* HnConditionFactory::ConstructConditionL( + TDesC8 & aConditionString ) + { + RBuf8 condition; + CleanupClosePushL( condition ); + condition.CreateL( aConditionString ); + HnConditionFactory::TrimConditionL( condition ); + User::LeaveIfError( HnConditionFactory::CheckBraceIntegrityL(condition) ); + + CHnConditionInterface* ret = NULL; + + if ( aConditionString.Find( HnLogicalRelations::KLogicalAnd8 ) == KErrNotFound + && aConditionString.Find( HnLogicalRelations::KLogicalOr8 ) == KErrNotFound ) + { + ret = CHnSimpleCondition::NewL( condition ); + } + else + { + ret = CHnComplexCondition::NewL( condition ); + } + + CleanupStack::PopAndDestroy( &condition ); + return ret; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnfilter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnfilter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,210 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnfilter.h" +#include "hnitemid.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnFilter::ConstructL( ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnFilter* CHnFilter::NewL( ) + { + CHnFilter* self = CHnFilter::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnFilter* CHnFilter::NewLC( ) + { + CHnFilter* self = new( ELeave ) CHnFilter(); + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnFilter::CHnFilter() + { + iEvaluateSuite = ETrue; + iSuiteId = KErrNotFound; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnFilter::~CHnFilter() + { + ResetSuiteName(); + ResetItemIds(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnFilter::SetEvaluateSuiteL( TBool aEvaluate ) + { + iEvaluateSuite = aEvaluate; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnFilter::IsEvaluateSuite() + { + return iEvaluateSuite; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// + const TDesC& CHnFilter::SuiteName() const + { + return iGenre; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnFilter::HasItemIds() const + { + return iItemIds.Count(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnFilter::ResetIterator() + { + iIter = 0; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const CHnItemId* CHnFilter::GetNextItemId() const + { + ASSERT( iIter < iItemIds.Count() ); + return iItemIds[ iIter++ ]; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnFilter::HasNextItemId() + { + return ( iIter < iItemIds.Count() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnFilter::ResetSuiteName() + { + iGenre.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnFilter::ResetItemIds() + { + iItemIds.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnFilter::SetSuiteNameL( const TDesC& aGenre ) + { + ResetSuiteName(); + iGenre.CreateL( aGenre ); + iGenre.LowerCase(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnFilter::AppendItemIdL( CHnItemId* iItemId ) + { + iItemIds.AppendL( iItemId ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnFilter::HasSuiteName() const + { + return iGenre.Length(); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnFilter::SetSuiteId( const TInt aSuiteId ) + { + iSuiteId = aSuiteId; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnFilter::SuiteId() const + { + return iSuiteId; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnFilter::HasSuiteId() const + { + return (iSuiteId == KErrNotFound) ? EFalse : ETrue; + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnitemid.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnitemid.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnitemid.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnItemId::ConstructL( const TDesC& aFile, + const TDesC& aID ) + { + iSuiteName.CreateL( aFile ); + iSuiteName.LowerCase(); + iId.CreateL( aID ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemId::UpdateL(const CHnItemId & aItemId ) + { + iSuiteName.Close(); + iId.Close(); + + iSuiteName.CreateL( aItemId.SuiteName() ); + iSuiteName.LowerCase(); + iId.CreateL( aItemId.Id() ); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnItemId* CHnItemId::NewL( const TDesC& aFile, + const TDesC& aID ) + { + CHnItemId* self = CHnItemId::NewLC( aFile, aID ); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnItemId* CHnItemId::NewLC(const TDesC& aFile, + const TDesC& aID ) + { + CHnItemId* self = new( ELeave ) CHnItemId(); + CleanupStack::PushL( self ); + self->ConstructL( aFile, aID ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnItemId::CHnItemId() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnItemId::~CHnItemId() + { + iSuiteName.Close(); + iId.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CHnItemId::SuiteName() const + { + return iSuiteName; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CHnItemId::Id() const + { + return iId; + } + + // --------------------------------------------------------------------------- + // + // --------------------------------------------------------------------------- + // +EXPORT_C TBool CHnItemId::Compare( const CHnItemId& aFilter ) const + { + TBool result( EFalse ); + if( !iSuiteName.Compare( aFilter.SuiteName() ) && + !iId.Compare( aFilter.Id() ) ) + { + result = ETrue; + } + return result; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdaction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdaction.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,133 @@ +/* +* Copyright (c) 2007-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: action model +* +*/ + + +#include <liwcommon.h> + +#include "hnmdaction.h" +#include "hnmdkeyfactory.h" +#include "hnmdbasekey.h" +#include "hnconditionfactory.h" +#include "hnmdservicecommand.h" +#include "hnactionmodel.h" +#include "hnmdservice.h" +#include "hnconditioninterface.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdAction::ConstructL( TXmlEngElement aElement ) + { + ASSERT( aElement.Name() == KActionElementName8 ); + + iService = CHnMdService::NewL( aElement ); + + if( aElement.AttributeValueL( KMenuConditionAttrName8 ).Length() ) + { + SetConditionL( aElement.AttributeNodeL( KMenuConditionAttrName8 ) ); + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdAction* CHnMdAction::NewL( TXmlEngElement aElement ) + { + CHnMdAction* self = CHnMdAction::NewLC( aElement ); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdAction* CHnMdAction::NewLC( TXmlEngElement aElement ) + { + CHnMdAction* self = new( ELeave ) CHnMdAction; + CleanupStack::PushL( self ); + self->ConstructL( aElement ); + return self; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdAction::CHnMdAction() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdAction::~CHnMdAction() + { + delete iService; + delete iCondition; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdAction::SetConditionL( TXmlEngAttr aAttr ) + { + iCondition = HnConditionFactory::NewL( aAttr ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdAction::EvaluateL( CHnActionModel* aActionModel, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos) + { + TInt ret( KErrNone ); + + aActionModel->SetServiceL( iService->GetServiceName() ); + aActionModel->SetInterfaceL( iService->GetInterfaceName() ); + aActionModel->SetCommandNameL( iService->GetCommand().GetCommandName() ); + aActionModel->SetServiceModeL( iService->GetCommand().GetCommandMode() ); + aActionModel->SetConstructorL( + iService->EvaluateConstructorAsKeyL( aQueriesResultsList, aPos ) ); + aActionModel->SetCommand( + iService->EvaluateCommandAsKeyL( aQueriesResultsList, aPos ) ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdAction::IsValidL( const CLiwGenericParamList& aQueryResults, + TInt aPos ) + { + TBool ret( EFalse ); + if( !iCondition || iCondition->ResultL( aQueryResults, aPos ) ) + { + ret = ETrue; + } + return ret; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdbutton.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdbutton.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,213 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <e32base.h> +#include <e32cmn.h> +#include <xmlengelement.h> +#include <gulicon.h> +#include <xmlengnodelist.h> +#include <liwcommon.h> + +#include "hnmdbutton.h" +#include "hnmdkeyfactory.h" +#include "hnconditioninterface.h" +#include "hnconditionfactory.h" +#include "hnmdvalueimage.h" +#include "hnmdvaluetext.h" +#include "hnglobals.h" +#include "hnattributebase.h" +#include "hnattributeimage.h" +#include "hnattributebase.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdButton* CHnMdButton::NewLC( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + CHnMdButton* self = new( ELeave ) CHnMdButton; + CleanupStack::PushL( self ); + self->ConstructL( aElement, aCmnPtrs ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdButton::~CHnMdButton( ) + { + delete iButtonText; + delete iConditionDimm; + delete iConditionAdd; + delete iIcon; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdButton::ValidateToAddL( const CLiwGenericParamList& aQueryResults, + TInt aPos ) + { + TBool ret( EFalse ); + if( !iConditionAdd || iConditionAdd->ResultL( aQueryResults, aPos ) ) + { + ret = ETrue; + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdButton::ValidateToDimmL( + const CLiwGenericParamList& aQueryResults, TInt aPos ) + { + TBool ret( EFalse ); + if( iConditionDimm ) + { + ret = iConditionDimm->ResultL( aQueryResults, aPos ); + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdButton::GetEventId() const + { + return iEventId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdButton::GetIndex() const + { + return iIndex; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TPtrC CHnMdButton::EvaluateButtonTextL( + const CLiwGenericParamList& aQueryResults, TInt aPos ) + { + if( !iButtonText ) + { + return KNullDesC(); + } + + TPtrC value; + iButtonText->GetL( &aQueryResults, aPos, value ); + return value; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttributeBase* CHnMdButton::EvaluateIconL( + const CLiwGenericParamList& aQueriesResultsList , TInt aPos ) const + { + //CGulIcon* icon = NULL; + CHnAttributeBase* iconAttribute = NULL; + if( iIcon ) + { + iconAttribute = + iIcon->CreateAttributeL( &aQueriesResultsList, aPos ); + } + return iconAttribute; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdButton::CHnMdButton() : iIndex( KErrNone ) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdButton::ConstructL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + // index + if( aElement.HasAttributeL( KIndexAttrName8 ) ) + { + TPtrC8 index = aElement.AttributeValueL( KIndexAttrName8 ); + TLex8 lexIndex( index ); + User::LeaveIfError( lexIndex.Val( iIndex ) ); + } + + // event + if( aElement.HasAttributeL( KEventAttrName8 ) ) + { + TPtrC8 event = aElement.AttributeValueL( KEventAttrName8 ); + TLex8 lex( event ); + User::LeaveIfError( lex.Val( iEventId ) ); + } + + // condition + if( aElement.HasAttributeL( KMenuConditionAttrName8 ) ) + { + iConditionAdd = HnConditionFactory::NewL( + aElement.AttributeNodeL( KMenuConditionAttrName8 ) ); + } + + // dimmed + if( aElement.HasAttributeL( KMenuDimmAttrName8 ) ) + { + iConditionDimm = HnConditionFactory::NewL( + aElement.AttributeNodeL( KMenuDimmAttrName8 ) ); + } + + // help text + RXmlEngNodeList< TXmlEngElement > children; + CleanupClosePushL( children ); + aElement.GetChildElements( children ); + TInt count = children.Count(); + + for ( TInt i = 0; i < count; i++ ) + { + TXmlEngElement child = children.Next(); + if ( !child.Name().Compare( KTextElementItem8 ) ) + { + iButtonText = CHnMdValueText::NewL( child, aCmnPtrs ); + } + else if( !child.Name().Compare( KImageElementItem8 ) ) + { + iIcon = CHnMdValueImage::NewL( child, aCmnPtrs ); + } + } + + CleanupStack::PopAndDestroy( &children ); + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdevent.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdevent.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnmdevent.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdEvent::Id() const + { + return iId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdEvent::SetId( TInt aId ) + { + iId = aId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdEvent* CHnMdEvent::NewL( const TInt aId ) + { + CHnMdEvent* self = CHnMdEvent::NewLC( aId ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdEvent* CHnMdEvent::NewLC( const TInt aId ) + { + CHnMdEvent* self = new( ELeave ) CHnMdEvent; + CleanupStack::PushL( self ); + self->ConstructL( aId ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdEvent::ConstructL( const TInt aId ) + { + SetId( aId ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdEvent::CHnMdEvent() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdEvent::~CHnMdEvent() + { + + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdeventmapping.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdeventmapping.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,231 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnmdeventmapping.h" +#include "hnmdeventmappingelement.h" +#include "hnmdevent.h" +#include "hneventhandler.h" +#include "hnsuitemodel.h" +#include "hnitemmodel.h" +#include "hnmdaction.h" +#include "hnactionmodel.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +RPointerArray<CHnMdAction> CHnMdEventMapping::GetActionsForEventId( + TInt aEventId ) + { + RPointerArray<CHnMdAction> emptyActions; + CHnMdEventMappingElement* eventMappingElement = NULL; + TBool eventIdFound( EFalse ); + + TInt mappingCount( Count() ); + + for ( TInt i = 0; i < mappingCount; i++ ) + { + CHnMdEventMappingElement* eme = iMappings[i]; + + RPointerArray<CHnMdEvent> events = eme->Events(); + + TInt actionsCount = events.Count(); + + for ( TInt j = 0; j < actionsCount; j++ ) + { + CHnMdEvent* event = events[ j ]; + + if (event->Id() == aEventId ) + { + eventIdFound = ETrue; + break; + } + } + if ( eventIdFound ) + { + eventMappingElement = eme; + break; + } + } + + if ( eventIdFound ) + return eventMappingElement->Actions(); + else + return emptyActions; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdEventMapping::ConstructL( TXmlEngElement aElement, THnMdCommonPointers* aCmnPtrs ) + { + // construction... + iCmnPtrs = aCmnPtrs; + + RXmlEngNodeList< TXmlEngElement > children; + CleanupClosePushL(children); + + aElement.GetChildElements(children); + TInt amount = children.Count(); + + for (TInt i(0);i<amount;i++) + { + TXmlEngElement child = children.Next(); + if ( !child.Name().Compare( KEventElementName8 ) ) + { + CHnMdEventMappingElement* eme = + CHnMdEventMappingElement::NewL( child ); + CleanupStack::PushL( eme ); + iMappings.AppendL( eme ); + CleanupStack::Pop( eme ); + } + } + + CleanupStack::PopAndDestroy( &children ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdEventMapping* CHnMdEventMapping::NewL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + CHnMdEventMapping* self = CHnMdEventMapping::NewLC( aElement, + aCmnPtrs ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdEventMapping::Count() const + { + return iMappings.Count(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdEventMapping* CHnMdEventMapping::NewLC( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + CHnMdEventMapping* self = new( ELeave ) CHnMdEventMapping; + CleanupStack::PushL( self ); + self->ConstructL( aElement, aCmnPtrs ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdEventMapping::CHnMdEventMapping() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdEventMapping::~CHnMdEventMapping() + { + iMappings.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdEventMapping::AddActionL( + RHashMap<TInt,CArrayPtr<CHnActionModel> *> & aActions, + CHnActionModel *& aActionModel, TInt aEventId ) + { + CArrayPtr<CHnActionModel>** actionsContainer = aActions.Find( aEventId ); + if ( !actionsContainer ) + { + CArrayPtr<CHnActionModel>* newActionsContainer = new( + ELeave ) CArrayPtrFlat<CHnActionModel>( KDefaultGranularity ); + CleanupStack::PushL( newActionsContainer ); + aActions.InsertL( aEventId, newActionsContainer ); + actionsContainer = &newActionsContainer; + CleanupStack::Pop( newActionsContainer ); + } + ( *actionsContainer )->AppendL( aActionModel ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdEventMapping::FillActionsL( + RHashMap< TInt, CArrayPtr<CHnActionModel>* >& aActions, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos ) + { + RArray< TInt > eventIds; + CleanupClosePushL( eventIds ); + GetEventIdsL( eventIds ); + + for ( TInt i( 0 ); i < eventIds.Count(); i++ ) + { + RPointerArray< CHnMdAction > actions = GetActionsForEventId( + eventIds[ i ] ); + for ( TInt j( 0 ); j < actions.Count(); j++ ) + { + if ( !actions[ j ] || !actions[ j ]->IsValidL( + aQueriesResultsList, aPos ) ) + { + continue; + } + CHnActionModel* actionModel = CHnActionModel::NewL(); + CleanupStack::PushL( actionModel ); + actions[ j ]->EvaluateL( actionModel, aQueriesResultsList, aPos ); + AddActionL( aActions, actionModel, eventIds[ i ] ); + CleanupStack::Pop( actionModel ); + } + } + CleanupStack::PopAndDestroy( &eventIds ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdEventMapping::GetEventIdsL( RArray< TInt >& aIds ) const + { + TInt mappingCount = Count(); + + for( TInt i = 0; i < mappingCount; i++ ) + { + CHnMdEventMappingElement* eme = iMappings[ i ]; + const RPointerArray< CHnMdEvent >& events = eme->Events(); + TInt eventsCount = events.Count(); + for ( TInt j = 0; j < eventsCount; j++ ) + { + CHnMdEvent* event = events[ j ]; + aIds.AppendL( event->Id() ); + } + } + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdeventmappingelement.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdeventmappingelement.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,184 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnmdeventmappingelement.h" +#include "hnmdaction.h" +#include "hnmdevent.h" +#include "hnconvutils.h" +#include "hnglobals.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdEventMappingElement::ConstructL( TXmlEngElement aElement ) + { + TPtrC8 n = aElement.Name(); + + //ASSERT( aElement.Name() == KEventElementName8 ); + //ASSERT( aElement.Prefix() == KNameSpacePrefix8 ); + ASSERT( aElement.HasAttributeL( KEventAttrName8 ) ); + ASSERT( aElement.HasChildNodes() ); + + SetEventsL( aElement ); + SetActionsL( aElement ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +RPointerArray<CHnMdAction>& CHnMdEventMappingElement::Actions() + { + return iActions; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const RPointerArray<CHnMdEvent>& CHnMdEventMappingElement::Events() const + { + return iEvents; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdEventMappingElement::SetActionsL( TXmlEngElement aElement ) + { + // retrieve action + RXmlEngNodeList< TXmlEngElement > actions; + CleanupClosePushL( actions ); + aElement.GetChildElements( actions ); + TInt count = actions.Count(); + for( TInt i( 0 ); i < count; i++ ) + { + TXmlEngElement element = actions.Next(); + if(!element.Name().Compare( KActionElementName8 ) ) + { + CHnMdAction* action = CHnMdAction::NewL( element ); + CleanupStack::PushL( action ); + iActions.AppendL( action ); + CleanupStack::Pop( action ); + } + } + CleanupStack::PopAndDestroy( &actions ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdEventMappingElement::SetEventsL( TXmlEngElement aElement ) + { + // parsing events + TPtrC8 events(aElement.AttributeValueL( KEventAttrName8 )); + + TLex8 lex( events ); + TChar ch; + + TInt length( events.Length() ); + TInt cnt = 0; + while( ch = lex.Get() != 0 ) + { + cnt++; + while ( ( ch = lex.Peek() ) != '|' && cnt < length) + { + lex.Inc(); + cnt++; + } + + // retrieve event id + RBuf8 eventId; + eventId.CreateL( lex.MarkedToken() ); + + TLex8 lexEventId( eventId ); + TInt id = -1; + lexEventId.Val( id ); + + CHnMdEvent *event = CHnMdEvent::NewL( + id ); + + AddEventL( event ); + eventId.Close(); + + lex.Inc(); + cnt++; + lex.Mark(); + if (cnt >= length) + break; + } + } + +// --------------------------------------------------------------------------- +// Takes ownership of an event! +// --------------------------------------------------------------------------- +// +void CHnMdEventMappingElement::AddEventL( CHnMdEvent* aEvent ) +{ + iEvents.AppendL( aEvent ); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdEventMappingElement* CHnMdEventMappingElement::NewL( + TXmlEngElement aElement ) + { + CHnMdEventMappingElement* self = + CHnMdEventMappingElement::NewLC( aElement ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdEventMappingElement* CHnMdEventMappingElement::NewLC( + TXmlEngElement aElement ) + { + CHnMdEventMappingElement* self = new( ELeave ) CHnMdEventMappingElement; + CleanupStack::PushL( self ); + self->ConstructL( aElement ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdEventMappingElement::CHnMdEventMappingElement() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdEventMappingElement::~CHnMdEventMappingElement() + { + iEvents.ResetAndDestroy(); + iActions.ResetAndDestroy(); + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmditem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmditem.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1078 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <liwservicehandler.h> +#include "hnmdquery.h" +#include "hnmdqueries.h" +#include "hnconditioninterface.h" +#include "hnmdmenuitem.h" +#include "hnbuttonmodel.h" +#include "hnmdbutton.h" +#include "hnmdeventmapping.h" +#include "hnmduimapping.h" +#include "hnitemid.h" +#include "hnmdlocalization.h" +#include "hnmdsuite.h" +#include "hnxmlmodelprovider.h" +#include "hnmdaction.h" +#include "hnfilter.h" +#include "hnmdtoolbar.h" +#include "hnmdnotifyrequests.h" +#include "hnmditem.h" +#include "hninterface.h" +#include "hnconditionfactory.h" +#include "hnattributetext.h" +#include "hnsuitemodelcontainer.h" +#include "hnmenuitemmodel.h" +#include "hnitemsorder.h" +#include "hnactionmodel.h" +#include "hnitemmodel.h" +#include "hntoolbarmodel.h" +#include "hnconvutils.h" +#include "hnutils.h" +#include "hnmdbasekey.h" +#include "hnmdservicecommand.h" +#include "hnliwutils.h" +#include "hnstringhandler.h" +#include "hnglobals.h" +#include "menudebug.h" + +using namespace LIW; + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::ConstructL(TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs) + { + ASSERT( !aElement.Name().Compare( KItemElementName8 ) + || !aElement.Name().Compare( KEditModeItem8 ) ); + + iCmnPtrs = aCmnPtrs; + + // set count + SetCountL( aElement ); + + // set template + SetTemplateL( aElement.AttributeNodeL( KTemplateAttrName8 ) ); + + // set condition + if( aElement.AttributeValueL( KMenuConditionAttrName8 ).Length() ) + { + iCondition = HnConditionFactory::NewL( + aElement.AttributeNodeL( KMenuConditionAttrName8 ) ); + } + + //set item id + SetItemIdL( aElement ); + + // sets the alternative layout for edit mode + SetEditModeItemL( aElement ); + + // sets move_locked and delete_locked attributes + SetAttributesL( aElement ); + + // sets type of the item + SetTypeL( aElement ); + + // sets uid of the item + SetUidL( aElement ); + + // sets custom id + SetCustomIdL( aElement ); + + // sets msk + SetMiddleSoftKeyL( aElement, aCmnPtrs ); + + //set queries + iQueries = CHnMdQueries::NewL( aElement ); + + //set notify requests + iNotifyRequests = CHnMdNotifyRequests::NewL( aElement, *iItemId, + iCmnPtrs ); + + //set event mapping + iEventMapping = CHnMdEventMapping::NewL( aElement, iCmnPtrs ); + + //set ui mapping + iUiMapping = CHnMdUiMapping::NewL( aElement, iCmnPtrs ); + + //set menu items + iMenu = CHnMdMenuItem::NewL( aElement, iCmnPtrs ); + + //set toolabr element + iToolbar = CHnMdToolbar::NewL( aElement, iCmnPtrs ); + + iQueriesResultsList = CLiwGenericParamList::NewL(); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetAlternativeModeItem(CHnMdItem* aAlternativeModeItem) + { + iAlternativeModeItem = aAlternativeModeItem; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdItem* CHnMdItem::TakeAlternativeModeItem() + { + CHnMdItem * ret = iAlternativeModeItem; + iAlternativeModeItem = NULL; + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdItem::HasAlternativeModeItem() const + { + return (iAlternativeModeItem != NULL) ? ETrue : EFalse; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetEditModeItemL( TXmlEngElement aElement ) + { + RXmlEngNodeList< TXmlEngElement> children; + CleanupClosePushL ( children ); + aElement.GetChildElements ( children ); + + TInt count = children.Count(); + for (TInt j = 0; j < count ; j++ ) + { + TXmlEngElement item = children.Next(); + + if ( !item.Name().Compare( KEditModeItem8 ) ) + { + iAlternativeModeItem = CHnMdItem::NewL( item, iCmnPtrs ); + iAlternativeModeItem->iItemId->UpdateL( *iItemId ); + break; + } + } + CleanupStack::PopAndDestroy ( &children ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdItem* CHnMdItem::NewL(TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs) + { + CHnMdItem* self = CHnMdItem::NewLC(aElement, aCmnPtrs); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdItem* CHnMdItem::NewLC(TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs) + { + CHnMdItem* self = new( ELeave ) CHnMdItem; + CleanupStack::PushL( self ); + self->ConstructL(aElement, aCmnPtrs); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdItem::CHnMdItem() : iAlternativeModeItem(NULL), iAllowableTemplate(NULL) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdItem::~CHnMdItem() + { + if ( iNotifyRequests ) + { + CLiwGenericParamList* empty = NULL; + TRAP_IGNORE( iNotifyRequests->SendAllRequestsL( *empty, KLiwOptCancel ) ); + } + + delete iNotifyRequests; + delete iAlternativeModeItem; + delete iAllowableTemplate; + iTemplate.Close(); + delete iMenu; + delete iQueries; + delete iEventMapping; + delete iUiMapping; + delete iItemId; + delete iToolbar; + iRemoveLocked8.Close(); + iRunning8.Close(); + iDrmProtection8.Close(); + iMoveLocked8.Close(); + iType8.Close(); + iUid8.Close(); + iCustomId8.Close(); + iCount8.Close(); + delete iQueriesResultsList; + delete iQc; + delete iCondition; + delete iMsk; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::EvaluateItemItselfL(CHnSuiteModel & aSuiteModel, + CLiwGenericParamList& aParams, TInt aItemPosition ) + { + + DEBUG16(("_MM_: CHnMdItem::EvaluateItemL IN")); + iSuiteModel = &aSuiteModel; + + if ( !iNotifyRequests->Sent() ) + { + iNotifyRequests->SendAllRequestsL( aParams ); + } + + iItemPosition = aItemPosition; + + //allocate memory for new results + iQueriesResultsList->Reset(); + iQueriesResultsList->AppendL( aParams ); + + //delete old query collector and create new one + //currently running evaluations will be cancelled + delete iQc; + iQc = NULL; + iQc = CHnQueryResultCollector::NewL( *iQueries , aParams ); + iQc->StartAsynchL( this ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdItem::AddItemL( CHnSuiteModel& aSuiteModel, TInt aItemId, + const CLiwGenericParamList& aQueriesResultsList, TInt aItemModelNumber, + TInt aItemPos ) + { + TInt err( KErrNone ); + CHnItemModel* itemModel = CHnItemModel::NewL(); + CleanupStack::PushL( itemModel ); + + TBool result = FillItemModelL( itemModel, aQueriesResultsList, aItemPos ); + + if ( result ) + { + if ( !itemModel->GetTemplate().Compare( KTemplateEmpty8 ) ) + { + CHnItemModel* empty = aSuiteModel.GetItemModel( aSuiteModel.IdByIndex( -1 ) ); + // empty has been already added + if ( empty ) + { + err = KErrAlreadyExists; + } + } + } + else + { + err = KErrGeneral; + } + + if( KErrNone == err ) + { + aSuiteModel.AddItemL( aItemId, itemModel, aItemModelNumber, aItemPos ); + CleanupStack::Pop( itemModel ); + } + else + { + CleanupStack::PopAndDestroy( itemModel ); + itemModel = NULL; + } + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdItem::UpdateItemL( CHnSuiteModel & aSuiteModel, TInt aItemId, + const CLiwGenericParamList& aQueriesResultsList, TInt aItemPos ) + { + TBool result = ETrue; + CHnItemModel* itemModel = aSuiteModel.GetItemModel( aItemId ); + itemModel->ClearAttributesL(); + result = FillItemModelL( itemModel, aQueriesResultsList, aItemPos ); + if( result ) + { + aSuiteModel.UpdateItemTemplateL( aItemId ); + } + return result ? KErrNone : KErrGeneral; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::RemoveItemL( CHnSuiteModel & aSuiteModel, TInt aId ) + { + //TInt id = iIds[ aPosition ]; + //iIds.Remove( aPosition ); + aSuiteModel.RemoveItemL( aId ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::EvaluateItemL( CHnSuiteModel & aSuiteModel, + CLiwGenericParamList& aParamList, + TInt aItemPosition ) + { + if( iEvaluationNeeded ) + { + EvaluateItemItselfL( aSuiteModel, aParamList, aItemPosition ); + iEvaluationNeeded = EFalse; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::MarkEvaluationL( CHnFilter& aFilter ) + { + if( aFilter.HasItemIds() ) + { + aFilter.ResetIterator(); + while( aFilter.HasNextItemId() && !iEvaluationNeeded ) + { + const CHnItemId* item = aFilter.GetNextItemId(); + if( iItemId->Compare( *item ) ) + { + iEvaluationNeeded = ETrue; + } + } + } + else + { + iEvaluationNeeded = ETrue; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdItem::EvaluateItemL( CHnSuiteModel & aSuiteModel, + const CHnItemId* aItemId, CLiwGenericParamList& aParamList, + TInt aItemPosition ) + { + DEBUG(("_MM_: CHnMdItem::EvaluateItemL IN")); //TO CHANGE LATER (id : %S)", iItemId->Id())); + TInt result( KErrNotFound ); + if( iItemId->Compare( *aItemId ) ) + { + EvaluateItemItselfL( aSuiteModel, aParamList, aItemPosition ); + result = KErrNone; + } + DEBUG(("_MM_: CHnMdItem::EvaluateItemL OUT")); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdItem::GetIndexValuesFromOutputsL( RPointerArray < HBufC8 > &aValues, + TXmlEngElement aElement ) + { + RXmlEngNodeList < TXmlEngElement > children; + CleanupClosePushL( children ); + aElement.GetChildElements( children ); + TInt amount = children.Count(); + + TPtrC8 n = aElement.Name(); + + for( TInt j( 0 ); j < amount; j++ ) + { + TXmlEngElement item = children.Next(); + + if ( !item.Name().Compare( KOutputElementItem8 ) ) + { + if ( item.HasAttributeL( KValueAttrName8 ) && + item.AttributeValueL( KValueAttrName8 ).Find( KIndex8 ) >= 0 && + item.HasAttributeL( KAliasAttrName8 ) && + !item.AttributeValueL( KAliasAttrName8 ).Compare( KTitle8 ) ) + { + TInt pos = item.AttributeValueL( KValueAttrName8 ).Find( KIndexWithBrackets8 ) - 1; + TInt siz = KCount().Length(); + TInt len = pos + siz; + TInt len0 = item.AttributeValueL( KValueAttrName8 ).Length() + KCount().Length(); + + HBufC8* buf = HBufC8::NewL( len0 ); + buf->Des().Copy( item.AttributeValueL( KValueAttrName8 ) ); + buf->Des().Replace( pos, siz, KCount() ); + buf->Des().SetLength( len ); + aValues.Append( buf ); + } + } + } + + CleanupStack::PopAndDestroy( &children ); + return aValues.Count(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetCountL( TXmlEngElement aElement ) + { + TXmlEngAttr aAttr = aElement.AttributeNodeL( KCountAttrName8 ); + iCount8.Close(); + iCount8.CreateL( aAttr.Value() ); + + // replace "*" + if ( !iCount8.Compare( KStar8 ) ) + { + RPointerArray<HBufC8> values; + CleanupClosePushL( values ); + if( GetIndexValuesFromOutputsL( values, aElement ) > 0 ) + { + for( TInt i = 0; i < values.Count(); i++ ) + { + HBufC8* buf = values[i]; + iCount8.Close(); + iCount8.CreateL( buf->Length() ); + iCount8.Copy( *buf ); + } + } + else + { + iCount8.Close(); + iCount8.CreateL( KDefaultCount8().Length() ); + iCount8.Copy( KDefaultCount8 ); + } + values.ResetAndDestroy(); + CleanupStack::PopAndDestroy( &values ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetTemplateL( TXmlEngAttr aAttr ) + { + iAllowableTemplate = new ( ELeave ) CDesC8ArrayFlat( 3 ); + + for (int i = 0; i < HnUtils::GetColumnTextColumnCount(aAttr.Value()); i++) + { + HBufC8* templateBuf = HnUtils::GetColumnTextLC( i, aAttr.Value() ); + templateBuf->Des().Trim(); + iAllowableTemplate->AppendL( *templateBuf ); + CleanupStack::PopAndDestroy(templateBuf); + } + + if (iAllowableTemplate->Count() > 0 ) + { + const TDesC8 & val = (*iAllowableTemplate)[0]; + iTemplate.Close(); + iTemplate.CreateL( val.Length() + 1 ); + iTemplate.Copy( val ); + } + else + iTemplate.CreateL( KNullDesC8() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetTemplateL( CHnItemModel* aItemModel ) + { + ASSERT( aItemModel ); + CHnAttributeText* templateAttr = CHnAttributeText::NewL(); + templateAttr->SetNameL( KTemplate8 ); + templateAttr->SetValueL( iTemplate ); + aItemModel->SetAttributeL( templateAttr ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetAlternativeTemplateL( TInt aOption ) + { + if ( !iTemplate.Compare( KTemplateEmpty8 ) ) + { + return; + } + iTemplate.Close(); + if (aOption >=0 && aOption < iAllowableTemplate->Count()) + { + const TDesC8 & val = (*iAllowableTemplate)[aOption]; + iTemplate.CreateL( val.Length() + 1 ); + iTemplate.Copy( val ); + } + else + { + iTemplate.CreateL( KNullDesC8() ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetItemIdL( TXmlEngElement aItemElement ) + { + HBufC* suiteName = HnConvUtils::Str8ToStrLC( + aItemElement.AttributeNodeL( KSuiteElementName8 ).Value() ); + HBufC* itemId = HnConvUtils::Str8ToStrLC( + aItemElement.AttributeNodeL( KItemIdAttrName8 ).Value() ); + + iItemId = CHnItemId::NewL( *suiteName, *itemId ); + + CleanupStack::PopAndDestroy( itemId ); + CleanupStack::PopAndDestroy( suiteName ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetDeleteMoveAttributesL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos ) + { + aItemModel->ClearFlags(); + TLiwVariant moveLocked; + moveLocked.PushL(); + HnLiwUtils::GetVariantL( aQueriesResultsList, iMoveLocked8, aPos, moveLocked ); + if ( moveLocked == TLiwVariant( (TBool) ETrue ) ) + { + aItemModel->SetFlag( EItemFlagMoveLocked ); + } + CleanupStack::PopAndDestroy( &moveLocked ); + + TLiwVariant deleteLocked; + deleteLocked.PushL(); + HnLiwUtils::GetVariantL( aQueriesResultsList, iRemoveLocked8, aPos, deleteLocked ); + if ( deleteLocked == TLiwVariant( (TBool) ETrue ) ) + { + aItemModel->SetFlag( EItemFlagRemoveLocked ); + } + CleanupStack::PopAndDestroy( &deleteLocked ); + + TLiwVariant running; + running.PushL(); + HnLiwUtils::GetVariantL( aQueriesResultsList, iRunning8, aPos, running ); + if ( running == TLiwVariant( (TBool) ETrue ) ) + { + aItemModel->SetFlag( EItemFlagRunning ); + } + CleanupStack::PopAndDestroy( &running ); + + TLiwVariant drm; + drm.PushL(); + HnLiwUtils::GetVariantL( aQueriesResultsList, iDrmProtection8, aPos, drm ); + TPtrC drmRights; + drm.Get( drmRights ); + if ( !drmRights.Compare( KMenuDrmRightsExpired ) ) + { + aItemModel->SetFlag( EItemFlagDrmExpired ); + } + CleanupStack::PopAndDestroy( &drm ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetTypeL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos ) + { + RBuf8 type; + CleanupClosePushL( type ); + HnLiwUtils::GetStringL( aQueriesResultsList, iType8, aPos, type ); + aItemModel->SetType( type ); + CleanupStack::PopAndDestroy( &type ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetUidL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos ) + { + RBuf8 uid; + CleanupClosePushL( uid ); + HnLiwUtils::GetStringL( aQueriesResultsList, iUid8, aPos, uid ); + aItemModel->SetItemUidL( uid ); + CleanupStack::PopAndDestroy( &uid ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetCustomIdL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aParams, TInt aPos ) + { + TInt64 customId( KErrNotFound ); + if ( KErrNone == HnLiwUtils::GetInt64L( + aParams, iCustomId8, aPos, customId ) ) + { + aItemModel->SetCustomId( customId ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdItem::FillItemModelL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos ) + { + TBool result( EFalse ); + + // set template for item + SetTemplateL( aItemModel ); + + // set delete/move locked attributes + SetDeleteMoveAttributesL( aItemModel, aQueriesResultsList, aPos ); + + // set type of an item + SetTypeL( aItemModel, aQueriesResultsList, aPos ); + + // set uid of an item + SetUidL( aItemModel, aQueriesResultsList, aPos ); + + // set custom id + SetCustomIdL( aItemModel, aQueriesResultsList, aPos ); + + // fills mul item + TRAP_IGNORE( result = iUiMapping->FillGraphicalItemL( + aItemModel, aQueriesResultsList, aPos ) ); + + if ( result ) + { + // fills item model + FillItemModelWithMenuItemsL( aItemModel, aQueriesResultsList, aPos ); + FillItemModelWithToolbarL( aItemModel, aQueriesResultsList, aPos ); + FillItemModelWithMiddleSoftKeyL( aItemModel, aQueriesResultsList, + aPos ); + + aItemModel->DeleteAllActionModels(); + iEventMapping->FillActionsL( aItemModel->GetActions(), + aQueriesResultsList, aPos ); + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::FillItemModelWithMenuItemsL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos ) + { + CHnMenuItemModel* menu = CHnMenuItemModel::NewL( KMenuItemName() ); + CleanupStack::PushL( menu ); + iMenu->EvaluateL( menu, aQueriesResultsList, aPos ); + aItemModel->SetMenuItemModel( menu ); + CleanupStack::Pop( menu ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::FillItemModelWithToolbarL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos ) + { + CHnToolbarModel* toolbar = CHnToolbarModel::NewLC(); + iToolbar->EvaluateL( toolbar, aQueriesResultsList, aPos ); + aItemModel->SetToolbarModel( toolbar ); + CleanupStack::Pop( toolbar ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::FillItemModelWithMiddleSoftKeyL( CHnItemModel* aItemModel, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos ) + { + if ( iMsk ) + { + CHnButtonModel* msk = CHnButtonModel::NewLC( iMsk->GetIndex() ); + const TDesC& helpText = iMsk->EvaluateButtonTextL( + aQueriesResultsList, aPos ); + msk->SetHelpTextL( helpText ); + aItemModel->SetMiddleSoftKey( msk ); + CleanupStack::Pop( msk ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdItem::IsValidL( const CLiwGenericParamList& aQueryResults, + TInt aPos ) + { + TBool ret( EFalse ); + if( !iCondition || iCondition->ResultL( aQueryResults, aPos ) ) + { + ret = ETrue; + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// + +TBool CHnMdItem::CompareItems( CHnItemId* aSearchCriteria ) + { + return iItemId->Compare( *aSearchCriteria ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetAttributesL( TXmlEngElement aElement ) + { + iMoveLocked8.Close(); + iRemoveLocked8.Close(); + iRunning8.Close(); + iDrmProtection8.Close(); + + if ( aElement.HasAttributeL( KMoveLocked8 ) ) + { + TPtrC8 av = aElement.AttributeValueL( KMoveLocked8 ); + iMoveLocked8.CreateL( av ); + } + else + { + iMoveLocked8.CreateL( KStringFalse8 ); + } + + if ( aElement.HasAttributeL( KRemoveLocked8 ) ) + { + TPtrC8 av = aElement.AttributeValueL( KRemoveLocked8 ); + iRemoveLocked8.CreateL( av ); + } + else + { + iRemoveLocked8.CreateL( KStringFalse8 ); + } + + if ( aElement.HasAttributeL( KRunning8 ) ) + { + TPtrC8 av = aElement.AttributeValueL( KRunning8 ); + iRunning8.CreateL( av ); + } + else + { + iRunning8.CreateL( KStringFalse8 ); + } + + if ( aElement.HasAttributeL( KDrmProtection8 ) ) + { + TPtrC8 av = aElement.AttributeValueL( KDrmProtection8 ); + iDrmProtection8.CreateL( av ); + } + else + { + iDrmProtection8.CreateL( KMenuDrmUnknown8 ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetTypeL( TXmlEngElement aElement ) + { + iType8.Close(); + + if ( aElement.HasAttributeL( KItemType8 ) ) + { + TPtrC8 av = aElement.AttributeValueL( KItemType8 ); + iType8.CreateL( av ); + } + else + { + iType8.CreateL( KItemTypeUnknown8 ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetUidL( TXmlEngElement aElement ) + { + iUid8.Close(); + + if ( aElement.HasAttributeL( KItemUid8 ) ) + { + TPtrC8 av = aElement.AttributeValueL( KItemUid8 ); + iUid8.CreateL( av ); + } + else + { + iUid8.CreateL( TUid::Null().Name().Length() ); + iUid8.Append( TUid::Null().Name() ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetCustomIdL( TXmlEngElement aElement ) + { + iCustomId8.Close(); + + if ( aElement.HasAttributeL( KCustomId8 ) ) + { + TPtrC8 av = aElement.AttributeValueL( KCustomId8 ); + iCustomId8.CreateL( av ); + } + else + { + iCustomId8.CreateL( KItemTypeUnknown8 ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::SetMiddleSoftKeyL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + RXmlEngNodeList< TXmlEngElement> children; + CleanupClosePushL ( children ); + aElement.GetChildElements ( children ); + TInt count = children.Count(); + for (TInt i = 0; i < count; i++ ) + { + TXmlEngElement item = children.Next(); + + if ( !item.Name().Compare( KMiddleSoftKey8 ) ) + { + iMsk = CHnMdButton::NewLC( item, aCmnPtrs ); + CleanupStack::Pop( iMsk ); + break; + } + } + CleanupStack::PopAndDestroy( &children ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TDesC8& CHnMdItem::Template() + { + return iTemplate; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TDesC8& CHnMdItem::Type() + { + return iType8; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TDesC8& CHnMdItem::Uid() + { + return iUid8; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdItem::GetItemsMaxCountL() + { + TInt ret( KErrNotFound ); + + // check if iCount8 equals "*" + if ( !iCount8.Compare( KStar8() ) ) + { + ret = KErrUnknown; + } + // check if iCount8 is a number + else if ( HnConvUtils::Str8ToInt( iCount8, ret ) >= 0 ) + { + ; // ret contains a number + } + // try to retrieve number of items from given paths + else + { + TInt columnsCount( HnUtils::GetColumnTextColumnCount( iCount8 ) ); + for (int i = 0; i < columnsCount; i++) + { + HBufC8* tmpCountBuf = HnUtils::GetColumnTextLC( i, iCount8 ); + TInt pos = tmpCountBuf->Des().Find( KCount() ); + + if ( pos >= 0 ) + { + tmpCountBuf->Des().Replace( pos, KCount().Length(), KNullDesC8 ); + TLiwVariant variant; + variant.PushL(); + HnLiwUtils::GetVariantL( *iQueriesResultsList, *tmpCountBuf, variant ); + + const CLiwList* list = variant.AsList(); + CLiwIterable* iterable = variant.AsIterable(); + TInt count = KErrNotFound; + if ( list ) + { + count = list->Count(); + } + else if ( iterable ) + { + count = HnLiwUtils::GetIterableItemCountL( *iterable ); + } + + if ( count != KErrNotFound ) + { + if ( ( i == 0 ) || ( ( i > 0 ) && ( count < ret ) ) ) + { + ret = count; + } + } + CleanupStack::PopAndDestroy( &variant ); + } + + CleanupStack::PopAndDestroy( tmpCountBuf ); + } + } + + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdItem::ResultsCollectedL( CLiwGenericParamList* aResults ) + { + iQueriesResultsList->AppendL( *aResults ); + + RArray< TInt > ids; + CleanupClosePushL( ids ); + iSuiteModel->GetItemsOrder()->GetIdsForL( iItemPosition, ids ); + TInt startCount = ids.Count(); + TInt visibleItemsBeforeEvaluation = iSuiteModel->GetItemsOrder()->Count(); + TInt id( 0 ); + + TBool result = ETrue; + TInt itemCounter = 0; + + TInt maxCount( GetItemsMaxCountL() ); + + for ( TInt i(0); result; i++, itemCounter++) + { + result = ( maxCount != KErrUnknown ) ? i < maxCount && result : result; + + if ( !result ) + { + continue; + } + + id = (ids.Count() > 0 && i < ids.Count()) ? ids[itemCounter] + : KErrNotFound; + + if( id == KErrNotFound ) + { + id = iCmnPtrs->iIdGenerator->GetNextId(); + TInt err = AddItemL( *iSuiteModel, id, *iQueriesResultsList, + iItemPosition, itemCounter ); + if ( KErrAlreadyExists == err ) + { + // update empty item which is identified by "-1" + TInt err = UpdateItemL( *iSuiteModel, iSuiteModel->IdByIndex(-1), *iQueriesResultsList, i ); + result = ( KErrNone == err ) ? ETrue : EFalse; + } + else if ( KErrNone != err ) + { + result = EFalse; + } + } + else + { + TInt err = UpdateItemL( *iSuiteModel, id, *iQueriesResultsList, i ); + result = ( KErrNone == err ) ? ETrue : EFalse; + } + + if ( !IsValidL( *iQueriesResultsList, i ) ) + { + RemoveItemL( *iSuiteModel, id ); + itemCounter--; + continue; + } + } + + for( TInt it(startCount - 1); it >= itemCounter -1 && it >= 0; it-- ) + { + RemoveItemL( *iSuiteModel, ids[it] ); + } + + CleanupStack::PopAndDestroy( &ids ); + iSuiteModel->RefreshMulModelL( visibleItemsBeforeEvaluation ); + TBool observersNotified = + iSuiteModel->ItemEvaluationFinishedL( iItemPosition ); + if ( observersNotified ) + { + iCmnPtrs->iModel->SuiteModelReadyToShowL( iSuiteModel ); + } + + DEBUG(("_MM_: CHnMdItem::ResultsCollectedL OUT")); + } + +// End of file diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdlocalization.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdlocalization.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,476 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <coemain.h> +#include <bautils.h> +#include <StringLoader.h> + +#include "hnmdlocalization.h" +#include "hnmdlocalizationelement.h" +#include "hnglobals.h" +#include "hnconvutils.h" +#include "hnutils.h" + +// ======== MEMBER FUNCTIONS ======== + +/** Max param count */ +static const TInt KMaxParamsCount( 10 ); +const TInt KFileExtensionLength( 4 ); + +_LIT(KLocalizationOneDes, "%U"); +_LIT(KLocalizationMoreDes, "%?U"); +_LIT(KLocalizationOneInt, "%N"); +_LIT(KLocalizationMoreInt, "%?N"); + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdLocalization::ConstructL() + { + iCoeEnv = CCoeEnv::Static(); + ASSERT( iCoeEnv ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdLocalization* CHnMdLocalization::NewL() + { + CHnMdLocalization* self = CHnMdLocalization::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdLocalization* CHnMdLocalization::NewLC() + { + CHnMdLocalization* self = new( ELeave ) CHnMdLocalization; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdLocalization::AppendLocalizationsL( TXmlEngElement aElement ) + { + RXmlEngNodeList< TXmlEngElement > children; + CleanupClosePushL( children ); + aElement.GetChildElements( children ); + + RPointerArray<CHnMdLocalizationElement> tempArray; + CleanupClosePushL( tempArray ); + TInt count = children.Count(); + for ( TInt i( 0 ); i < count; i++ ) + { + TXmlEngElement child = children.Next(); + + if ( !child.Name().Compare( KLocalizationElementName8 ) ) + { + RBuf8 namespac; + CleanupClosePushL( namespac ); + if ( child.HasAttributeL( KNameSpaceAttrName8 ) ) + { + HnUtils::SetAttributeL( child, KNameSpaceAttrName8, namespac ); + if ( !IsDuplicateL( namespac ) ) + { + CHnMdLocalizationElement* element = + CHnMdLocalizationElement::NewL( child ); + + AppendElementL( element ); // ownership transfered + } + } + CleanupStack::PopAndDestroy( &namespac ); + } + } + + CleanupStack::PopAndDestroy( &tempArray ); + CleanupStack::PopAndDestroy( &children ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const CHnMdLocalizationElement* CHnMdLocalization::ElementByNamespace( + const TDesC& aNamespace ) const + { + TInt count = iInternalLocalization.Count(); + const CHnMdLocalizationElement* element = NULL; + + for ( TInt i = 0; i < count; i++ ) + { + const CHnMdLocalizationElement* tmp = iInternalLocalization[i]; + if ( !tmp->Namespace().Compare( aNamespace) ) + { + element = tmp; + break; + } + } + if( !element ) + { + count = iDynamicLocalization.Count(); + + for ( TInt i = 0; i < count; i++ ) + { + const CHnMdLocalizationElement* tmp = iDynamicLocalization[i]; + if ( !tmp->Namespace().Compare( aNamespace) ) + { + element = tmp; + break; + } + } + } + + return element; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdLocalization::CHnMdLocalization() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdLocalization::~CHnMdLocalization() + { + iDynamicLocalization.ResetAndDestroy(); + for( TInt i( 0 ); i < iDynamicOffset.Count(); i++ ) + { + iCoeEnv->DeleteResourceFile( iDynamicOffset[i] ); + } + iDynamicOffset.Close(); + + iInternalLocalization.ResetAndDestroy(); + for( TInt i( 0 ); i < iInternalOffset.Count(); i++ ) + { + iCoeEnv->DeleteResourceFile( iInternalOffset[i] ); + } + iInternalOffset.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdLocalization::ReloadResourceFilesL() + { + for( TInt i( 0 ); i < iDynamicLocalization.Count(); i++ ) + { + iDynamicLocalization[i]->LocateLanguageFileL(); + if( iDynamicLocalization[i]->SourcePath() ) + { + TInt offset( 0 ); + TRAPD( err, offset = iCoeEnv->AddResourceFileL( + *(iDynamicLocalization[i]->SourcePath()) ) ); + if ( !err ) + { + iDynamicOffset.AppendL( offset ); + } + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdLocalization::ReleaseResourceFiles() + { + iDynamicLocalization.ResetAndDestroy(); + for( TInt i( 0 ); i < iDynamicOffset.Count(); i++ ) + { + iCoeEnv->DeleteResourceFile( iDynamicOffset[i] ); + } + iDynamicOffset.Reset(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdLocalization::AppendElementL( CHnMdLocalizationElement* aElement ) + { + if( IsInternalL( aElement->Source() ) ) + { + iInternalLocalization.AppendL( aElement ); + if( IsResourceFile (aElement->Source()) ) + { + TInt offset( 0 ); + TRAPD( err, offset = iCoeEnv->AddResourceFileL( *(aElement->SourcePath()) ) ); + if ( !err ) + { + iInternalOffset.AppendL( offset ); + } + } + } + else + { + iDynamicLocalization.AppendL( aElement ); + if( IsResourceFile (aElement->Source()) ) + { + TInt offset( 0 ); + TRAPD( err, offset = iCoeEnv->AddResourceFileL( *(aElement->SourcePath()) ) ); + if ( !err ) + { + iDynamicOffset.AppendL( offset ); + } + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdLocalization::IsDuplicateL( TDesC8& aNamespace ) + { + HBufC* namespac = HnConvUtils::Str8ToStrLC( aNamespace ); + TBool isDuplicate( IsDuplicateL( *namespac ) ); + CleanupStack::PopAndDestroy( namespac ); + return isDuplicate; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdLocalization::IsDuplicateL( TDesC& aNamespace ) + { + TBool isDuplicate( EFalse ); + + if ( ElementByNamespace( aNamespace ) != NULL ) + { + isDuplicate = ETrue; + } + + return isDuplicate; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdLocalization::IsInternalL( const TDesC& aName ) + { + TBool isInternal( EFalse ); + _LIT( KDot, "." ); + + TInt offset( aName.Find( KDot ) ); + if( offset != KErrNotFound ) + { + if( aName.Left( offset ).Compare( KFolderSuite ) == KErrNone ) + { + isInternal = ETrue; + } + } + + return isInternal; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdLocalization::IsResourceFile( const TDesC& aFileName ) + { + TInt pos = aFileName.Find( KExtension ); + if( aFileName.Right( KFileExtensionLength ).Compare( KExtensionRsc ) ) + { + TBuf<2> tail; + tail.Copy(aFileName.Right(2)); + for (TInt i = 0; i < tail.Length(); i++ ) + { + TChar c = tail[i]; + if ( !c.IsDigit() ) + { + pos = KErrNotFound; + break; + } + } + } + return pos == ( aFileName.Length() - KFileExtensionLength ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HBufC* CHnMdLocalization::LoadL( const TDesC& aResourceName, + const CDesC16Array* aDesParams, const CArrayFix<TInt>* aIntParams ) + { + TInt position = aResourceName.Locate(':'); + HBufC* res = NULL; + if( position!= KErrNotFound ) + { + TPtrC resourceName = aResourceName.Mid(position + 1); + TPtrC locName = aResourceName.Left(position); + + const CHnMdLocalizationElement* localization = + ElementByNamespace( locName ); + // if there is not namaspace defined, check may it is file in format + // myapp.rsc:id + if (!localization && !IsDuplicateL( locName ) && IsResourceFile( locName )) + { + // let's try to add namespace + CHnMdLocalizationElement* element = + CHnMdLocalizationElement::NewL( locName, locName); + AppendElementL(element); // ownership transfered + localization = ElementByNamespace( locName ); + } + + if( localization && IsResourceFile( localization->Source() ) && localization->SourceExists() ) + { + HBufC8* resourceName8 = HBufC8::NewLC(resourceName.Length()); + resourceName8->Des().Copy(resourceName); + TInt resourceId (KErrNotFound); + TRAPD(err, resourceId = + const_cast<CHnMdLocalizationElement*>(localization)->FindResourceIdL(resourceName8) ); + if ( err != KErrNone ) // maybe it was only number + { + err = HnConvUtils::Str8ToInt(*resourceName8, resourceId); + } + User::LeaveIfError(err); + if ( iCoeEnv->IsResourceAvailableL( resourceId ) ) + { + res = iCoeEnv->AllocReadResourceL( resourceId ); + } + + CleanupStack::PopAndDestroy( resourceName8 ); + } + } + + if (!res) // it mean that we dont have localization item for it + { + res = aResourceName.AllocL(); + } + if ((aDesParams && aDesParams->Count()) || + (aIntParams && aIntParams->Count())) + { + CleanupStack::PushL(res); + HBufC* formatted = FormatTextL(*res, aDesParams, aIntParams); + CleanupStack::PopAndDestroy(res); + res = formatted; + } + + return res; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HBufC* CHnMdLocalization::FormatTextL( const TDesC& aTextToFormat, + const CDesC16Array* aDesParams, const CArrayFix<TInt>* aIntParams ) + { + HBufC* res = aTextToFormat.AllocL(); + TInt noParams(0); + + if (aDesParams) + noParams += aDesParams->Count(); + if (aIntParams) + noParams += aIntParams->Count(); + + if (noParams > KMaxParamsCount) + User::Leave( KErrNotSupported ); + + // let's check if we have descriptors to format + if( aDesParams && aDesParams->Count() ) + { + // if we have only one we match to %U + if (aDesParams->Count() == 1) + { + if ( res->FindC(KLocalizationOneDes) != KErrNotFound ) + { + TPtrC16 param = aDesParams->MdcaPoint(0); + HBufC* dest = HBufC::NewL( res->Length() + + param.Length() * KMaxParamsCount ); + TPtr destDes(dest->Des()); + StringLoader::Format( destDes, *res, -1, param ); + delete res; + res = dest; + } + } + // and we match for format %(index)U + TBufC<3> descformat(KLocalizationMoreDes); + TInt desIndexUsed(0); + for (TInt i = 0; i < noParams && desIndexUsed < aDesParams->Count(); i++) + { + descformat.Des()[1] = '0'+ i; // replace index infromation + if ( res->FindC( descformat ) != KErrNotFound ) + { + + TPtrC16 param = aDesParams->MdcaPoint(desIndexUsed++); + HBufC* dest = HBufC::NewL( res->Length() + + param.Length() * KMaxParamsCount ); + TPtr destDes(dest->Des()); + StringLoader::Format( destDes, *res, i, param ); + delete res; + res = dest; + } + } + } + // let's check if we have numbers to format + if( aIntParams && aIntParams->Count() ) + { + // if we have only one we match to %N + if (aIntParams->Count() == 1) + { + if ( res->FindC(KLocalizationOneInt) != KErrNotFound ) + { + HBufC* dest = HBufC::NewL( res->Length() + + sizeof(TInt) * KMaxParamsCount ); + TPtr destDes(dest->Des()); + StringLoader::Format( destDes, *res, -1, aIntParams->At(0) ); + delete res; + res = dest; + } + } + // and we match for format %(index)N + TBufC<3> format(KLocalizationMoreInt); + TInt numberUsed(0); + for (TInt i = 0; i < noParams && numberUsed < aIntParams->Count(); i++) + { + format.Des()[1] = '0'+ i; + if ( res->FindC(format) != KErrNotFound ) + { + HBufC* dest = HBufC::NewL( res->Length() + + sizeof(TInt)* KMaxParamsCount ); + TPtr destDes(dest->Des()); + StringLoader::Format( destDes, *res, i, aIntParams->At(numberUsed++) ); + delete res; + res = dest; + } + } + } + return res; + } + + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdlocalizationelement.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdlocalizationelement.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,344 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <f32file.h> +#include "hnmdlocalizationelement.h" +#include "hnglobals.h" +#include "hnconvutils.h" +#include "hnutils.h" + +const TText8 KSPChar = ' '; +const TText8 KNLChar = '\n'; +const TInt KWholeFileReadLimit = 1024; + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TUint32 HBufC8Hash( HBufC8* const & aBuf ) + { + return DefaultHash::Des8(*aBuf); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool HBufC8Ident( HBufC8* const & aL, HBufC8* const & aR ) + { + return DefaultIdentity::Des8(*aL, *aR); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdLocalizationElement::ConstructL( const TDesC& aNamespace, + const TDesC& aSource ) + { + iNamespace.CreateL( aNamespace ); + iSource.CreateL( aSource ); + iSource.LowerCase(); + LocateLanguageFileL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdLocalizationElement::ConstructL( TXmlEngElement aElement ) + { + ASSERT( aElement.HasAttributeL( KNameSpaceAttrName8 ) ); + + SetNamespaceL( aElement.AttributeNodeL( KNameSpaceAttrName8 ) ); + SetSourceL( aElement.AttributeNodeL( KSourceAttrName8 ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdLocalizationElement::SetNamespaceL( TXmlEngAttr aNamespace ) + { + HBufC* namespac = HnConvUtils::Str8ToStrLC( aNamespace.Value() ); + + iNamespace.Close(); + iNamespace.CreateL( *namespac ); + + CleanupStack::PopAndDestroy( namespac ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdLocalizationElement::SetSourceL( TXmlEngAttr aSource ) + { + HBufC* source = HnConvUtils::Str8ToStrLC( aSource.Value() ); + iSource.Close(); + iSource.CreateL( *source ); + iSource.LowerCase(); + LocateLanguageFileL(); + CleanupStack::PopAndDestroy( source ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdLocalizationElement* CHnMdLocalizationElement::NewL( + TXmlEngElement aElement ) + { + CHnMdLocalizationElement* self = new( ELeave ) CHnMdLocalizationElement; + CleanupStack::PushL( self ); + self->ConstructL( aElement ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdLocalizationElement* CHnMdLocalizationElement::NewL(const TDesC& aNamespace, + const TDesC& aSource) + { + CHnMdLocalizationElement* self = new( ELeave ) CHnMdLocalizationElement; + CleanupStack::PushL( self ); + self->ConstructL( aNamespace, aSource ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdLocalizationElement::CHnMdLocalizationElement(): + iResourceIDs( &HBufC8Hash, &HBufC8Ident ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdLocalizationElement::~CHnMdLocalizationElement() + { + iNamespace.Close(); + iSource.Close(); + delete iSourcePath; + THashMapIter<HBufC8*, TInt> iter( iResourceIDs ); + while ( HBufC8* const * ptr = iter.NextKey() ) + { + delete *ptr; + } + iResourceIDs.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC& CHnMdLocalizationElement::Namespace() const + { + return iNamespace; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC& CHnMdLocalizationElement::Source() const + { + return iSource; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HBufC* CHnMdLocalizationElement::SourcePath() const + { + return iSourcePath; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdLocalizationElement::SourceExists() const + { + if ( iSourcePath ) + { + return iSourcePath->Compare(KNullDesC) != 0; + } + else + { + return EFalse; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdLocalizationElement::LocateLanguageFileL() + { + delete iSourcePath; + iSourcePath = NULL; + iSourcePath = HnUtils::LocateNearestLanguageFileLC( iSource ); + CleanupStack::Pop( iSourcePath ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TInt& CHnMdLocalizationElement::FindResourceIdL( HBufC8* aResourceName ) + { + if ( iState&EInitialized ) + { + // check if we have it in cache + TInt* result = iResourceIDs.Find(aResourceName); + if (result) + { + return *result; + } + else if (iState&EWholeFileCached) // all should be in cache + { + User::Leave(KErrNotFound); + } + } + + if (!(iState&EInitialized) || iState&EUsedItemsCached ) + { + // set initialized here, as we could have problem with file read + // i.e. file is missing, but we dont want to go here next time + iState |= EInitialized; + HBufC8* rsgContent = ReadRsgContentLC( ); + if (rsgContent->Length() < KWholeFileReadLimit) + { + iState |= EWholeFileCached; + ParseRsgContentL(*rsgContent); + } + else + { + iState |= EUsedItemsCached; + ParseRsgContentL(*rsgContent, *aResourceName); + } + //cleanup + CleanupStack::PopAndDestroy(rsgContent); + } + + return iResourceIDs.FindL(aResourceName); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HBufC8* CHnMdLocalizationElement::ReadRsgContentLC( ) + { + HBufC8* result(NULL); + if ( iSourcePath->Compare( KNullDesC ) ) + { + HBufC* fPath = iSourcePath->AllocLC(); + // change extension to rsg + TInt extPos = fPath->LocateReverse(KExtDelimiter); + fPath->Des().Replace(extPos, fPath->Length() - extPos, KRsg); + result = HnUtils::ReadFileLC(*fPath); + CleanupStack::Pop(result); + CleanupStack::PopAndDestroy(fPath); + CleanupStack::PushL(result); + } + else + { + result = KNullDesC8().AllocLC(); + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdLocalizationElement::ParseRsgContentL( const TDesC8& aContent ) + { + TPtrC8 content(aContent); + TInt posEoL(-1); + // iterate over each line + while ((posEoL = content.Locate(KNLChar)) > 0) + { + TPtrC8 line = content.Left( posEoL - 1 ); + TInt firstSpace = line.Locate(KSPChar); + TInt lastSpace = line.LocateReverse(KSPChar); + // resource name + TPtrC8 rname = line.Mid(firstSpace, lastSpace - firstSpace); + // resource id + TPtrC8 rid = line.Right( line.Length() - lastSpace - 1 ); + // trim resource name + HBufC8* rnameTrimmed = rname.AllocLC(); + rnameTrimmed->Des().Trim(); + // parse numer and insert to map + TInt id(0); + User::LeaveIfError( HnConvUtils::Str8ToInt(rid, id) ); + User::LeaveIfError( iResourceIDs.Insert(rnameTrimmed->AllocL(), id) ); + CleanupStack::PopAndDestroy(rnameTrimmed); + // start search from next line + content.Set(content.Mid( posEoL + 1 )); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdLocalizationElement::ParseRsgContentL( const TDesC8& aContent, + const TDesC8& aResourceName ) + { + TPtrC8 content(aContent); + + HBufC8* resourceName = HBufC8::NewLC( aResourceName.Length() + + 2 /* extra spaces */ ); + // add extra space to make sure that we find the right one + resourceName->Des().Append(KSPChar); + resourceName->Des().Append(aResourceName); + resourceName->Des().Append(KSPChar); + + TInt position = content.Find(*resourceName); + User::LeaveIfError(position); // we can not find resource + TPtrC8 contentAfterMid = content.Mid( position + + resourceName->Length()); + + TInt posResId = contentAfterMid.Locate(KNLChar); + User::LeaveIfError(posResId); // we can not find resource + TPtrC8 rid = contentAfterMid.Left(posResId - 1); + + HBufC8* ridTrimmed = rid.AllocLC(); + ridTrimmed->Des().Trim(); + // trim also resource name + resourceName->Des().Trim(); + + TInt id(0); + User::LeaveIfError( HnConvUtils::Str8ToInt( *ridTrimmed, id) ); + User::LeaveIfError( iResourceIDs.Insert( resourceName->AllocL(), id) ); + // clean up + CleanupStack::PopAndDestroy(ridTrimmed); + CleanupStack::PopAndDestroy(resourceName); + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdmenuitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdmenuitem.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,214 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnmdmenuitem.h" +#include "hnglobals.h" +#include "hnconvutils.h" +#include "hnstringhandler.h" +#include "hnconditioninterface.h" +#include "hnmdeventmappingelement.h" +#include "hnmdevent.h" +#include "hnmenuitemmodel.h" +#include "hnconditionfactory.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdMenuItem::AppendChildItemL( CHnMdMenuItem* aMenuItem ) + { + iChildren.AppendL( aMenuItem ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdMenuItem::EvaluateL( CHnMenuItemModel* aMenuModel, + const CLiwGenericParamList& aQueriesResultsList, TInt aPos ) + { + for ( TInt i( 0 ); i < iChildren.Count(); i++ ) + { + CHnMdMenuItem* mdMenu = iChildren[ i ]; + if ( mdMenu->IsValidL( aQueriesResultsList, aPos ) ) + { + CHnMenuItemModel* menu = CHnMenuItemModel::NewL( mdMenu->NameL() ); + mdMenu->EvaluateL( menu, aQueriesResultsList, aPos ); + aMenuModel->AppendChildMenuL( menu ); + } + } + aMenuModel->SetCommand( iEvent ); + aMenuModel->SetPosition( iPosition ); + aMenuModel->SetItemSpecific( iSpecific ); + } + +// --------------------------------------------------------------------------- +// ConstructL takes as an argument an item xml element. It iterates through +// item elements in order to find menuitems. +// --------------------------------------------------------------------------- +// +void CHnMdMenuItem::CreatePropertiesL( TXmlEngElement aElement, + THnMdCommonPointers* /* aCmnPtrs */ ) + { + iSpecific = !aElement.Name().Compare( KMenuItemSpecificElementName8 ); + + // name + HBufC* name = HnConvUtils::Str8ToStrLC( + aElement.AttributeValueL( KName8 ) ); + iName.Assign(name); + CleanupStack::Pop( name ); + + // position + TPtrC8 pos = aElement.AttributeValueL( KPositionAttrName8 ); + TLex8 lexPosition ( pos ); + User::LeaveIfError( lexPosition.Val( iPosition ) ); + + // event + if( aElement.AttributeValueL( KEventAttrName8 ).Length() && + !aElement.HasChildNodes() ) + { // there might not be the event attribute - submenues + TPtrC8 event = aElement.AttributeValueL( KEventAttrName8 ); + TLex8 lex( event ); + User::LeaveIfError( lex.Val( iEvent ) ); + } + + // condition + if( aElement.AttributeValueL( KMenuConditionAttrName8 ).Length() ) + { + iCondition = HnConditionFactory::NewL( + aElement.AttributeNodeL( KMenuConditionAttrName8 ) ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdMenuItem::CreateChildrenL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + RXmlEngNodeList< TXmlEngElement > children; + CleanupClosePushL( children ); + aElement.GetChildElements( children ); + TInt count = children.Count(); + + for ( TInt i = 0; i < count; i++ ) + { + TXmlEngElement child = children.Next(); + if ( !child.Name().Compare( KMenuItemElementName8 ) + || !child.Name().Compare( KMenuItemSpecificElementName8 ) ) + { + AppendChildItemL( CHnMdMenuItem::NewL( child, aCmnPtrs ) ); + } + } + CleanupStack::PopAndDestroy( &children ); + } + +// --------------------------------------------------------------------------- +// ConstructL takes as an argument an item xml element. It iterates through +// item elements in order to find menuitems. +// --------------------------------------------------------------------------- +// +void CHnMdMenuItem::ConstructL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + if ( !aElement.Name().Compare( KMenuItemElementName8 ) + || !aElement.Name().Compare( KMenuItemSpecificElementName8 ) ) + { // this is an ordinary menu item + CreatePropertiesL( aElement, aCmnPtrs ); + CreateChildrenL( aElement, aCmnPtrs ); // in case there are subitems + } + else + { // this is the root level + CreateChildrenL( aElement, aCmnPtrs ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdMenuItem* CHnMdMenuItem::NewL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + CHnMdMenuItem* self = CHnMdMenuItem::NewLC( aElement, aCmnPtrs ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdMenuItem* CHnMdMenuItem::NewLC( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + CHnMdMenuItem* self = new( ELeave ) CHnMdMenuItem; + CleanupStack::PushL( self ); + self->ConstructL( aElement, aCmnPtrs ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdMenuItem::CHnMdMenuItem() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdMenuItem::~CHnMdMenuItem() + { + iName.Close(); + iChildren.ResetAndDestroy(); + iNameValueCache.Close(); + delete iCondition; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC& CHnMdMenuItem::NameL() + { + iNameValueCache.Close(); + HnStringHandler::LocaliseL( iNameValueCache, iName, NULL /*common params*/); + return iNameValueCache; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdMenuItem::IsValidL( const CLiwGenericParamList& aQueryResults, + TInt aPos ) + { + TBool ret( EFalse ); + if( !iCondition || iCondition->ResultL( aQueryResults, aPos ) ) + { + ret = ETrue; + } + return ret; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdmodel.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,511 @@ +/* +* Copyright (c) 2007-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: +* +*/ + +#include <mmf/common/mmfcontrollerpluginresolver.h> +#include <AvkonInternalCRKeys.h> + +#include "hnmdmodel.h" +#include "hnmdsuite.h" +#include "hnrepositoryobserver.h" +#include "hnfilter.h" +#include "hnglobals.h" +#include "hneventhandler.h" +#include "hnmdlocalization.h" +#include "hnxmlmodelprovider.h" +#include "hnsuitemodelcontainer.h" +#include "hnitemsorder.h" +#include "hninterface.h" +#include "menudebug.h" +#include "hnconvutils.h" +#include "hnbitmapidcache.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdModel::ConstructL( MHnMdModelEventObserver *aModelObserver, + CHnSuiteModelContainer * aSuiteModelContainer ) + { + MMPERF(("CHnMetaDataModel::ConstructL - START")); + MMPERF(("CHnMetaDataModel::ConstructL - query handler ready")); + iLocalization = CHnMdLocalization::NewL(); + MMPERF(("CHnMetaDataModel::ConstructL - localization ready")); + iXmlModelProvider = CHnXmlModelProvider::NewL(); + MMPERF(("CHnMetaDataModel::ConstructL - bitmap and mask ids cache ready")); + iBitmapIdCache = CHnBitmapIdCache::NewL(); + MMPERF(("CHnMetaDataModel::ConstructL - model privider ready")); + iXmlModelProvider->ReloadModelL(); + MMPERF(("CHnMetaDataModel::ConstructL - model reloaded")); + + iCmnPtrs.iLocalization = iLocalization; + iCmnPtrs.iIdGenerator = &iIdGenerator; + iCmnPtrs.iModel = this; + iCmnPtrs.iXmlModelProvider = iXmlModelProvider; + iCmnPtrs.iContainer = aSuiteModelContainer; + iCmnPtrs.iModelEventObserver = aModelObserver; + iCmnPtrs.iBitmapIdCache = iBitmapIdCache; + + THnMdCommonPointers::SetStatic(&iCmnPtrs); + + iMode = EMdModeNormal; + iRepositoryWidgetTypeObserver = CHnRepositoryWidgetTypeObserver::NewL( &iCmnPtrs, KMatrixRepositoryUid ); + iRepositoryShowFolderObserver = CHnRepositoryShowFolderObserver::NewL( &iCmnPtrs, KCRUidMenu, KMenuShowFolder ); + iRepositoryZoomObserver = CHnRepositoryZoomObserver::NewL( &iCmnPtrs, KCRUidAvkon, KAknGlobalUiZoom ); + MMPERF(("CHnMetaDataModel::ConstructL - rep. observer ready")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnMdModel* CHnMdModel::NewL( + MHnMdModelEventObserver* aModelObserver, + CHnSuiteModelContainer * aSuiteModelContainer ) + { + CHnMdModel* self = CHnMdModel::NewLC( aModelObserver, + aSuiteModelContainer ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnMdModel* CHnMdModel::NewLC( + MHnMdModelEventObserver* aModelObserver, + CHnSuiteModelContainer * aSuiteModelContainer ) + { + CHnMdModel* self = new( ELeave ) CHnMdModel(); + CleanupStack::PushL( self ); + self->ConstructL( aModelObserver, aSuiteModelContainer ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdModel::CHnMdModel() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdModel::~CHnMdModel() + { + delete iRepositoryWidgetTypeObserver; + delete iRepositoryShowFolderObserver; + delete iRepositoryZoomObserver; + iLoadedSuites.ResetAndDestroy(); + delete iXmlModelProvider; + delete iLocalization; + delete iBitmapIdCache; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnMdModel::HandleBackEventL( + CHnSuiteModelContainer* aMulContainer, + const TDesC& aSuiteName, + TInt aIterations ) + { + TInt ret( KErrNotFound ); +#ifdef _DEBUG + // check if genres match + CHnMdSuite* lastMdModel = GetLastSuite(); + ASSERT( !lastMdModel->SuiteName().Compare( aSuiteName ) ); +#endif + + TInt countDown( aIterations ); + CHnSuiteModel* current = NULL; + while( ( current = aMulContainer->GetParentSuiteModel() ) != NULL && + countDown > 0 ) + { + current = aMulContainer->GetLastSuiteModel(); + // pop the suite model + aMulContainer->PopSuiteModelL( current->SuiteName() ); + + // remove the suite that we are leaving + DeleteLastSuite(); + countDown--; + } + + current = aMulContainer->GetLastSuiteModel(); + current->GetItemsOrder()->MarkSuiteUninitialized(); + CHnFilter* filter = CHnFilter::NewLC(); + filter->SetSuiteNameL( current->SuiteName() ); + filter->SetSuiteId( current->CustomId() ); + GetLastSuite()->MarkEvaluationL( *filter, *current); + CleanupStack::PopAndDestroy( filter ); + //Evaluate suite at the top (if needed) + EvaluateTopSuiteL(); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMdModel::HandleSisInstallationEventL( + CHnSuiteModelContainer* /*aModelContainer*/ ) + { + iXmlModelProvider->ReloadModelL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdModel::ReloadStackSuitesL( CHnSuiteModelContainer* aModelContainer ) + { + RPointerArray< CLiwGenericParamList > paramsArray; + CleanupResetAndDestroyPushL( paramsArray ); + + TBool rootDisplayed( iLoadedSuites.Count() == 1 ); + while( iLoadedSuites.Count() > 0 ) + { + // break loop to leave root suite on the stack + if( ( iLoadedSuites.Count() == 1 && paramsArray.Count() > 0 ) + || rootDisplayed ) + { + break; + } + + CHnMdSuite* suite = GetLastSuite(); + if( iXmlModelProvider->SuiteExistsL( suite->SuiteName() ) ) + { + CLiwGenericParamList* suiteParams = CLiwGenericParamList::NewL(); + CleanupStack::PushL( suiteParams ); + suiteParams->AppendL( suite->GetSuiteParameters() ); + paramsArray.Append( suiteParams ); + CleanupStack::Pop( suiteParams ); + } + aModelContainer->PopSuiteModelL( suite->SuiteName() ); + DeleteLastSuite(); + } + + TInt err( KErrNone ); + CHnFilter* filter = CHnFilter::NewLC(); + filter->SetEvaluateSuiteL( ETrue ); + + SetModeL( iMode ); + + for( TInt i( paramsArray.Count() - 1 ); i >= 0 && !err; i-- ) + { + CLiwGenericParamList* suiteParams = CLiwGenericParamList::NewL(); + CleanupStack::PushL(suiteParams); + suiteParams->AppendL( *(paramsArray[ i ])); + TInt pos( 0 ); + const TLiwGenericParam* param = suiteParams->FindFirst( pos, KSuiteName8 ); + if ( param && pos >= 0) + { + TPtrC suiteName; + param->Value().Get( suiteName ); + err = LoadSuiteL( suiteName, suiteParams ); + } + CleanupStack::PopAndDestroy( suiteParams ); + + GetLastSuite()->SetModeL( iMode ); + GetLastSuite()->MarkEvaluationL( + *filter, *iCmnPtrs.iContainer->GetLastSuiteModel() ); + GetLastSuite()->EvaluateL( *iCmnPtrs.iContainer->GetLastSuiteModel() ); + } + + CleanupStack::PopAndDestroy( filter ); + CleanupStack::PopAndDestroy( ¶msArray ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMdModel::DeleteLastSuite() + { + CHnMdSuite* tmpPtr = GetLastSuite(); + iLoadedSuites.Remove( iLoadedSuites.Count() - 1 ); + delete tmpPtr; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMdModel::ReleaseLocalization() + { + iLocalization->ReleaseResourceFiles(); + iXmlModelProvider->ResetCache(); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMdModel::ReloadLocalizationL() + { + iLocalization->ReloadResourceFilesL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMdModel::EvaluateL() + { + CHnFilter* empty = CHnFilter::NewLC(); + EvaluateL( *empty ); + CleanupStack::PopAndDestroy( empty ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMdModel::SetModeL( TMdMode aMode ) + { + iMode = aMode; + for ( TInt i( 0 ); i < iLoadedSuites.Count(); i++ ) + { + CHnMdSuite* suite = iLoadedSuites[i]; + ASSERT( suite != NULL ); + suite->SetModeL( aMode ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnMdSuite* CHnMdModel::GetLastSuite() + { + return (iLoadedSuites.Count()>0) + ? iLoadedSuites[ iLoadedSuites.Count()-1 ] + : NULL; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMdModel::IgnoreEvaluations( TBool aIgnore ) + { + iIgnoreEvaluations = aIgnore; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMdModel::QueueForeground( + TForegroundGainTriggeringEvent aWhen ) + { + switch ( aWhen ) + { + case EWhenAnySuiteIsEvaluated: + iForegroundQueued = ETrue; + iForegroundTriggeringSuite = NULL; + break; + case EWhenCurrentTopSuiteIsEvaluated: + iForegroundQueued = ETrue; + iForegroundTriggeringSuite = iCmnPtrs.iContainer->GetLastSuiteModel(); + break; + case ENever: + iForegroundQueued = EFalse; + iForegroundTriggeringSuite = NULL; + break; + default: + ASSERT( 0 ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnMdModel::IsForegroundQueued() const + { + return iForegroundQueued; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdModel::SuiteModelReadyToShowL( CHnSuiteModel* aJustEvaluatedSuite ) + { + if ( !aJustEvaluatedSuite ) + { + User::Leave( KErrArgument ); + } + + if ( IsForegroundQueued() && ( !iForegroundTriggeringSuite || + iForegroundTriggeringSuite == aJustEvaluatedSuite ) ) + { + CLiwGenericParamList* pl = CLiwGenericParamList::NewL(); + CleanupStack::PushL( pl ); + iCmnPtrs.iModelEventObserver->HandleModelEventL( KAppGainForeground, *pl ); + CleanupStack::PopAndDestroy( pl ); + QueueForeground( ENever ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdSuite* CHnMdModel::GetSuite( TInt aPosition ) + { + return ( (aPosition >= 0) && (aPosition < iLoadedSuites.Count()) ) + ? iLoadedSuites[ aPosition ] + : NULL; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CLiwGenericParamList& CHnMdModel::GetSuiteParameters( TInt aPosition ) + { + return GetSuite( aPosition )->GetSuiteParameters(); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMdModel::EvaluateL( CHnFilter& aFilter ) + { + for ( TInt i = iLoadedSuites.Count() - 1; i >= 0; i-- ) + { + iLoadedSuites[i]->MarkEvaluationL( aFilter, *iCmnPtrs.iContainer->GetSuiteModel(i) ); + if( i == iLoadedSuites.Count() - 1 && !iIgnoreEvaluations ) + { + iLoadedSuites[i]->EvaluateL( *iCmnPtrs.iContainer->GetSuiteModel(i) ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnMdModel::LoadSuiteL( const TDesC& aGenre, + CLiwGenericParamList* aSuiteParams ) + { + TInt err( KErrNone ); + + RXmlEngDocument xmlDoc; + // Xml model provider takes ownership of xmlDoc. + TRAP( err, iXmlModelProvider->GetModelL( aGenre, xmlDoc ) ); + + TXmlEngElement element; + if ( !err ) + { + element = xmlDoc.DocumentElement().AsElement(); + if ( element.Name() != KContentElementName8 ) + { + err = KErrCorrupt; + } + } + + if ( !err ) + { + CHnMdSuite* newSuite = CHnMdSuite::NewLC( element, &iCmnPtrs ); + + if (aSuiteParams) + { + newSuite->SetSuiteParametersL( *aSuiteParams ); + } + + TInt pos( 0 ); + newSuite->GetSuiteParameters().FindFirst( pos, KSuiteName8); + if ( pos == KErrNotFound ) + { + newSuite->GetSuiteParameters().AppendL( + TLiwGenericParam(KSuiteName8, TLiwVariant( aGenre ) ) ); + } + + iCmnPtrs.iContainer->PushNewSuiteModelL( newSuite->SuiteName() ); + iCmnPtrs.iContainer->GetLastSuiteModel()->GetItemsOrder()-> + SetSuiteId( iCmnPtrs.iIdGenerator->GetNextId() ); + + CleanupStack::Pop( newSuite ); + iLoadedSuites.AppendL( newSuite ); + } + else + { + MMPERF(("CHnMdModel::LoadSuiteL - Error TRAPPED!")); + } + + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnMdModel::SuiteModelExistsL( const TDesC8& aSuiteModel ) + { + TBool res( EFalse ); + HBufC* suiteName = HnConvUtils::Str8ToStrLC( aSuiteModel ); + res = iXmlModelProvider->SuiteExistsL( *suiteName ) || + aSuiteModel.Compare( KRoot8 ) == KErrNone ; + CleanupStack::PopAndDestroy( suiteName ); + return res; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMdModel::GetCurrentUriL( TDes& aUri ) + { + iXmlModelProvider->ReloadModelL(); + + aUri.Append( KPrefMm ); + for( TInt i(0); i < iLoadedSuites.Count(); i++ ) + { + aUri.Append( iLoadedSuites[ i ]->SuiteName() ); + aUri.Append( KSlash ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdModel::EvaluateTopSuiteL() + { + if ( !iIgnoreEvaluations ) + { + TInt topItem = iLoadedSuites.Count() - 1; + iLoadedSuites[topItem]->EvaluateL( *iCmnPtrs.iContainer->GetSuiteModel(topItem) ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdModel::LoadedSuitesCount() + { + return iLoadedSuites.Count(); + } + + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdnotifyrequest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdnotifyrequest.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <xmlengelement.h> +#include <xmlengdom.h> + +#include "hnmdbasekey.h" +#include "hnmdmodel.h" +#include "hnservicehandler.h" +#include "hnmdservicecommand.h" +#include "hnitemid.h" +#include "hnmdnotifyrequest.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdNotifyRequest* CHnMdNotifyRequest::NewL( TXmlEngElement aElement, + const CHnItemId & aItemId, THnMdCommonPointers* aCmnPtrs ) + + { + CHnMdNotifyRequest* self = CHnMdNotifyRequest::NewLC(aElement, + aItemId, aCmnPtrs ); + CleanupStack::Pop(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdNotifyRequest* CHnMdNotifyRequest::NewLC( TXmlEngElement aElement, + const CHnItemId & aItemId, THnMdCommonPointers* aCmnPtrs ) + { + CHnMdNotifyRequest* self = new (ELeave) CHnMdNotifyRequest( aCmnPtrs ); + CleanupStack::PushL(self); + self->ConstructL( aElement, aItemId ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdNotifyRequest::~CHnMdNotifyRequest() + { + delete iItemId; + delete iService; + delete iSh; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdNotifyRequest::ConstructL( TXmlEngElement aElement, + const CHnItemId & aItemId ) + { + ASSERT(aElement.Name() == KNotifyRequestElementName8 ); + + iItemId = CHnItemId::NewL( aItemId.SuiteName(), aItemId.Id() ); + iService = CHnMdService::NewL( aElement ); + iSh = NULL; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdNotifyRequest::CHnMdNotifyRequest(THnMdCommonPointers* aCmnPtrs) + : iCmnPtrs(aCmnPtrs) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdNotifyRequest::RequestNotifyL( CLiwGenericParamList& aParams, + TInt aCmdOptions ) + { + if ( iSh == NULL ) + { + CLiwGenericParamList* constructor = + iService->EvaluateConstructorL( aParams ); + CleanupStack::PushL(constructor); + CLiwGenericParamList* command = iService->EvaluateCommandL( aParams ); + CleanupStack::PushL( command ); + + // Create service + iSh = CHnServiceHandler::NewL( + iService->GetServiceName(), + iService->GetInterfaceName(), + iService->GetCommand().GetCommandName(), + EServiceModeAsynchronous, + constructor, + command ); + + CleanupStack::Pop( command ); + CleanupStack::Pop( constructor ); + } + iSh->ExecuteL( this, aCmdOptions ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdNotifyRequest::HandleNotifyL( TInt /* aCmdId */, TInt aEventId , + CLiwGenericParamList& /* aEventParamList */, + const CLiwGenericParamList& /* aInParamList */) + { + TInt err( KErrNone ); + + if ( aEventId == KLiwEventInProgress ) + { + //Filling in variant structure. + CLiwGenericParamList* inParam = CLiwGenericParamList::NewL(); + CleanupStack::PushL( inParam ); + + CLiwDefaultMap* map = CLiwDefaultMap::NewLC(); + + map->InsertL( KGenreName8, TLiwVariant(iItemId->SuiteName()) ); + map->InsertL( KItemName8, TLiwVariant(iItemId->Id()) ); + + CLiwDefaultList* list = CLiwDefaultList::NewLC(); + + list->AppendL( TLiwVariant( map ) ); + inParam->AppendL(TLiwGenericParam( KFilterElementItem8, TLiwVariant(list))); + CleanupStack::PopAndDestroy( list ); + CleanupStack::PopAndDestroy( map ); + + iCmnPtrs->iModelEventObserver->HandleModelEventL( KReevaluateMdEvent, *inParam ); + + CleanupStack::PopAndDestroy( inParam ); + } + + return err; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdnotifyrequests.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdnotifyrequests.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2007-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: represents the notification request +* +*/ + + +#include <e32base.h> +#include <xmlengdom.h> +#include <hnglobals.h> + +#include "hnmdnotifyrequest.h" +#include "hnmdnotifyrequests.h" + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdNotifyRequests::ConstructL( TXmlEngElement aElement, + const CHnItemId & aItemId, + THnMdCommonPointers* aCmnPtrs ) + { + iSent = EFalse; + RXmlEngNodeList< TXmlEngElement > entries; + CleanupClosePushL( entries ); + aElement.GetChildElements( entries ); + + TInt entriesAmount = entries.Count(); + + for (TInt j = 0; j < entriesAmount; j++ ) + { + TXmlEngElement item = entries.Next(); + + if ( !item.Name().Compare( KNotifyRequestElementName8 ) ) + { + CHnMdNotifyRequest *request = CHnMdNotifyRequest::NewL( + item, aItemId, aCmnPtrs ); + AddNotifyRequest( request ); + } + } + + CleanupStack::PopAndDestroy( &entries ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdNotifyRequests::SendAllRequestsL( CLiwGenericParamList& aParams, + TInt aCmdOptions ) + { + for (int i=0; i<Count(); i++) + { + NotifyRequest(i).RequestNotifyL( aParams, aCmdOptions ); + } + iSent = ETrue; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdNotifyRequests::AddNotifyRequest( CHnMdNotifyRequest* aNotifyRequest ) + { + return iNotifyRequests.Append( aNotifyRequest ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdNotifyRequest& CHnMdNotifyRequests::NotifyRequest( + TInt aPosition ) const + { + ASSERT( aPosition >=0 && aPosition < iNotifyRequests.Count() ); + return *iNotifyRequests[aPosition]; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdNotifyRequests::Count() const + { + return iNotifyRequests.Count(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdNotifyRequests* CHnMdNotifyRequests::NewL( + TXmlEngElement aElement, const CHnItemId & aItemId, + THnMdCommonPointers* aCmnPtrs ) + { + CHnMdNotifyRequests* self = CHnMdNotifyRequests::NewLC( + aElement, aItemId, aCmnPtrs); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdNotifyRequests* CHnMdNotifyRequests::NewLC( + TXmlEngElement aElement, const CHnItemId & aItemId, + THnMdCommonPointers* aCmnPtrs ) + { + CHnMdNotifyRequests* self = new( ELeave ) CHnMdNotifyRequests(); + CleanupStack::PushL( self ); + self->ConstructL( aElement, aItemId, aCmnPtrs ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdNotifyRequests::CHnMdNotifyRequests() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdNotifyRequests::~CHnMdNotifyRequests() + { + iNotifyRequests.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdNotifyRequests::Sent() + { + return iSent; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdqueries.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdqueries.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + + +#include <xmlengdom.h> +#include "hnmdqueries.h" +#include "hnmdquery.h" +#include "hnglobals.h" +#include "hnmdmodel.h" +#include "hnconvutils.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdQueries::ConstructL( TXmlEngElement aElement ) + { + // construction... + RXmlEngNodeList< TXmlEngElement > entries; + CleanupClosePushL( entries ); + aElement.GetChildElements( entries ); + + TInt entriesAmount = entries.Count(); + + for (TInt j = 0; j < entriesAmount; j++ ) + { + TXmlEngElement item = entries.Next(); + + if ( !item.Name().Compare( KQueryElementItem8 ) ) + { + CHnMdQuery *query = CHnMdQuery::NewL( item ); + AddQuery( query ); + } + } + CleanupStack::PopAndDestroy( &entries ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdQueries::AddQuery( CHnMdQuery* aQuery ) + { + return iQueries.Append( aQuery ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdQuery& CHnMdQueries::Query( TInt aPosition ) const + { + ASSERT( aPosition >=0 && aPosition < iQueries.Count() ); + return *iQueries[aPosition]; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdQueries::Count() const + { + return iQueries.Count(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdQueries* CHnMdQueries::NewL( TXmlEngElement aElement ) + { + CHnMdQueries* self = CHnMdQueries::NewLC( aElement ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdQueries* CHnMdQueries::NewLC( TXmlEngElement aElement ) + { + CHnMdQueries* self = new( ELeave ) CHnMdQueries(); + CleanupStack::PushL( self ); + self->ConstructL( aElement ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdQueries::CHnMdQueries() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdQueries::~CHnMdQueries() + { + iQueries.ResetAndDestroy(); + } + + + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdquery.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdquery.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <xmlengdom.h> +// for CleanupResetAndDestroyPushL +#include <mmf/common/mmfcontrollerpluginresolver.h> + +#include "hnmdkeyfactory.h" +#include "hnmdbasekey.h" +#include "hnmdquery.h" +#include "hnconvutils.h" +#include "hnmdservicecommand.h" +#include "hnmdservice.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdQuery::ConstructL( TXmlEngElement aElement ) + { + ASSERT( aElement.Name() == KQueryElementItem8 ); + + SetNameSpaceL( aElement.AttributeNodeL( KNameSpaceAttrName8 ) ); + iService = CHnMdService::NewL( aElement ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdQuery* CHnMdQuery::NewL( TXmlEngElement aElement ) + { + CHnMdQuery* self = CHnMdQuery::NewLC( aElement ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdQuery* CHnMdQuery::NewLC( TXmlEngElement aElement ) + { + CHnMdQuery* self = new( ELeave ) CHnMdQuery(); + CleanupStack::PushL( self ); + self->ConstructL( aElement ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdQuery::CHnMdQuery() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdQuery::~CHnMdQuery() + { + iNameSpace.Close(); + delete iService; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC& CHnMdQuery::NameSpace() const + { + return iNameSpace; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdQuery::SetNameSpaceL( const TDesC& aNameSpace ) + { + iNameSpace.Close(); + iNameSpace.CreateL(aNameSpace); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdQuery::SetNameSpaceL( TXmlEngAttr aAttr ) + { + HBufC* nspace = HnConvUtils::Str8ToStrLC( aAttr.Value() ); + SetNameSpaceL( *nspace ); + + // clean up + CleanupStack::PopAndDestroy( nspace ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdService& CHnMdQuery::GetService() const + { + return *iService; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdservice.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,265 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <xmlengdom.h> +#include <liwservicehandler.h> +#include <mmf/common/mmfcontrollerpluginresolver.h> + +#include "hnmdservice.h" +#include "hnmdservicecommand.h" +#include "hnliwutils.h" +#include "hnglobals.h" +#include "hnmdbasekey.h" +#include "hnmdkeyfactory.h" +#include "hnservicehandler.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdService::ConstructL( TXmlEngElement aElement ) + { + SetInterfaceL( aElement.AttributeNodeL( KInterfaceAttrName8 ) ); + SetServiceL( aElement.AttributeNodeL( KServiceAttrName8 ) ); + SetConstructorL( aElement ); + iServiceCommand = CHnMdServiceCommand::NewL( aElement ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdService* CHnMdService::NewL( TXmlEngElement aElement ) + { + CHnMdService* self = CHnMdService::NewLC( aElement ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdService* CHnMdService::NewLC( TXmlEngElement aElement ) + { + CHnMdService* self = new( ELeave ) CHnMdService(); + CleanupStack::PushL( self ); + self->ConstructL( aElement ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdService::CHnMdService() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdService::~CHnMdService() + { + iServiceName.Close(); + iInterfaceName.Close(); + delete iConstructor; + delete iServiceCommand; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC8& CHnMdService::GetServiceName() const + { + return iServiceName; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC8& CHnMdService::GetInterfaceName() const + { + return iInterfaceName; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const CHnMdServiceCommand& CHnMdService::GetCommand() const + { + return *iServiceCommand; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey* CHnMdService::GetConstructor() const + { + return iConstructor; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdService::SetConstructorL( TXmlEngElement aElement ) + { + iConstructor = HnMdKeyFactory::CreateL( KConstructorElementItem8(), KKeyTypeList(), + KNullDesC8() ); + RXmlEngNodeList< TXmlEngElement > elements; + CleanupClosePushL( elements ); + aElement.GetChildElements( elements ); + + TInt elementsCount = elements.Count(); + + for (TInt i =0; i < elementsCount; i++ ) + { + TXmlEngElement dataElement = elements.Next(); + + if ( !dataElement.Name().Compare( KConstructorElementItem8 ) ) + { + RXmlEngNodeList< TXmlEngElement > keys; + CleanupClosePushL( keys ); + dataElement.GetChildElements( keys ); + + for (TInt j = 0; j < keys.Count(); j++ ) + { + TXmlEngElement keyElement = keys.Next(); + if ( !keyElement.Name().Compare( KKeyElementItem8 ) ) + { + CHnMdBaseKey *key = HnMdKeyFactory::CreateL( keyElement ); + CleanupStack::PushL( key ); + iConstructor->AddSubKeyL( key ); + CleanupStack::Pop( key ); + } + } + CleanupStack::PopAndDestroy( &keys ); + } + } + CleanupStack::PopAndDestroy( &elements ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdService::SetInterfaceL( TXmlEngAttr aAttr ) + { + iInterfaceName.Close(); + iInterfaceName.CreateL( aAttr.Value() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdService::SetServiceL( TXmlEngAttr aAttr ) + { + iServiceName.Close(); + iServiceName.CreateL( aAttr.Value() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CLiwGenericParamList* CHnMdService::EvaluateConstructorL( + const CLiwGenericParamList& aList, + TInt aPos) + { + CHnMdBaseKey* evalKeys = EvaluateConstructorAsKeyL( aList, aPos ); + CleanupStack::PushL( evalKeys ); + CLiwGenericParamList* ret = CLiwGenericParamList::NewL(); + CleanupStack::PushL( ret ); + if ( evalKeys ) + { + evalKeys->ToGenericParamListL( *ret ); + } + CleanupStack::Pop( ret ); + CleanupStack::PopAndDestroy( evalKeys ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey* CHnMdService::EvaluateConstructorAsKeyL( + const CLiwGenericParamList& aList, + TInt aPos) + { + CHnMdBaseKey* consKeys = GetConstructor(); + CHnMdBaseKey* evalKeys = NULL; + if (consKeys) + { + evalKeys = consKeys->EvaluateLC( aList, aPos ); + CleanupStack::Pop( evalKeys ); + } + return evalKeys; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CLiwGenericParamList* CHnMdService::EvaluateCommandL( + const CLiwGenericParamList& aList, + TInt aPos + ) + { + CHnMdBaseKey* evalKeys = EvaluateCommandAsKeyL( aList, aPos ); + CleanupStack::PushL( evalKeys ); + CLiwGenericParamList* ret = CLiwGenericParamList::NewL(); + CleanupStack::PushL( ret ); + if ( evalKeys ) + { + evalKeys->ToGenericParamListL( *ret ); + } + CleanupStack::Pop( ret ); + CleanupStack::PopAndDestroy( evalKeys ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey* CHnMdService::EvaluateCommandAsKeyL( + const CLiwGenericParamList& aList, + TInt aPos + ) + { + CHnMdBaseKey* keys = iServiceCommand->GetCommandData(); + CHnMdBaseKey* evalKeys = NULL; + if (keys) + { + evalKeys = keys->EvaluateLC( aList, aPos ); + CleanupStack::Pop( evalKeys ); + + } + return evalKeys; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdservicecommand.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdservicecommand.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,207 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <xmlengdom.h> + +#include "hnmdkeyfactory.h" +#include "hnmdbasekey.h" +#include "hnmdservicecommand.h" + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdServiceCommand* CHnMdServiceCommand::NewL( + TXmlEngElement aElement ) + { + CHnMdServiceCommand* self = CHnMdServiceCommand::NewLC(aElement); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdServiceCommand* CHnMdServiceCommand::NewLC( + TXmlEngElement aElement ) + { + CHnMdServiceCommand* self = new( ELeave ) CHnMdServiceCommand; + CleanupStack::PushL( self ); + self->ConstructL( aElement ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TXmlEngElement CHnMdServiceCommand::RemoveRedundantKeyL( TXmlEngElement aElement ) + { + TXmlEngElement ret = aElement; + + RXmlEngNodeList< TXmlEngElement > elements; + CleanupClosePushL( elements ); + aElement.GetChildElements( elements ); + + TInt elementsCount = elements.Count(); + if (elementsCount == 1) + { + TXmlEngElement dataElement = elements.Next(); + RXmlEngNodeList< TXmlEngAttr > nodeList; + CleanupClosePushL( nodeList ); + dataElement.GetAttributes(nodeList); + if (! dataElement.Name().Compare( KKeyElementItem8 ) && nodeList.Count() == 0) + { + ret = dataElement; + } + CleanupStack::PopAndDestroy( &nodeList ); + } + + CleanupStack::PopAndDestroy( &elements ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdServiceCommand::ConstructL( TXmlEngElement aElement ) + { + iData = HnMdKeyFactory::CreateL( KCommandElementItem8(), KKeyTypeList(), + KNullDesC8() ); + + RXmlEngNodeList< TXmlEngElement > elements; + CleanupClosePushL( elements ); + aElement.GetChildElements( elements ); + + TInt elementsCount = elements.Count(); + + for (TInt i =0; i < elementsCount; i++ ) + { + TXmlEngElement dataElement = elements.Next(); + + if ( !dataElement.Name().Compare( KCommandElementItem8 ) ) + { + SetCommandNameL( dataElement.AttributeNodeL( KCommandNameAttr8 ) ); + SetCommandModeL( dataElement.AttributeNodeL( KCommandModeAttr8 ) ); + + SetCommandDataL( RemoveRedundantKeyL( dataElement ) ); + break; + } + } + CleanupStack::PopAndDestroy( &elements ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdServiceCommand::CHnMdServiceCommand() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdServiceCommand::~CHnMdServiceCommand() + { + delete iData; + iName.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC8& CHnMdServiceCommand::GetCommandName() const + { + return iName; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdServiceCommand::SetCommandNameL( TXmlEngAttr aAttr ) + { + iName.Close(); + iName.CreateL( aAttr.Value() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey* CHnMdServiceCommand::GetCommandData() const + { + return iData; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdServiceCommand::SetCommandDataL( TXmlEngElement aElement ) + { + + RXmlEngNodeList< TXmlEngElement > keys; + CleanupClosePushL( keys ); + aElement.GetChildElements( keys ); + + TInt count = keys.Count(); + for (TInt j = 0; j < count; j++ ) + { + TXmlEngElement keyElement = keys.Next(); + if ( !keyElement.Name().Compare( KKeyElementItem8 ) ) + { + CHnMdBaseKey *key = HnMdKeyFactory::CreateL( keyElement ); + CleanupStack::PushL( key ); + iData->AddSubKeyL(key); + CleanupStack::Pop( key ); + } + } + CleanupStack::PopAndDestroy( &keys ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TServiceMode CHnMdServiceCommand::GetCommandMode() const + { + return iMode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdServiceCommand::SetCommandModeL( TXmlEngAttr aAttr ) + { + iMode = EServiceModeSynchronous; + + if ( !aAttr.Value().Compare( KCommandModeAsync8 ) ) + { + iMode = EServiceModeAsynchronous; + } + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdsuite.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdsuite.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,881 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <mmf/common/mmfcontrollerpluginresolver.h> + +#include "hnmdsuite.h" +#include "hnmditem.h" +#include "hnmdmodel.h" +#include "hnstringhandler.h" +#include "hnsuitemodelcontainer.h" +#include "hnitemsorder.h" +#include "hnconvutils.h" +#include "hnliwutils.h" +#include "hnutils.h" +#include "hnfilter.h" +#include "menudebug.h" +#include "hnactionmodel.h" +#include "hnmdaction.h" +#include "hnmdservicecommand.h" +#include "hnmdlocalization.h" +#include "hnmdqueries.h" +#include "hnmdquery.h" +#include "hnrepositorymanager.h" +#include "hnmdbasekey.h" +#include "hninterface.h" +#include "hnservicehandler.h" +#include "hnmdeventmapping.h" + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CLiwGenericParamList& CHnMdSuite::GetSuiteParameters() + { + return *iSuiteParams; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMdSuite::SetSuiteParametersL(CLiwGenericParamList& aParams) + { + iSuiteParams->Reset(); + iSuiteParams->AppendL( aParams ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::ConstructL( TXmlEngElement aElement ) + { + DEBUG(("_MM_: CHnMdSuite::ConstructL IN")); + + // append localization elements + iCmnPtrs->iLocalization->AppendLocalizationsL( aElement ); + + RXmlEngNodeList<TXmlEngElement> elements; + CleanupClosePushL( elements ); + aElement.GetChildElements( elements ); + + // suite element was found + TBool suiteFound( EFalse ); + + // one suite per file + TXmlEngElement suiteElement; + while ( elements.HasNext() ) + { + suiteElement = elements.Next(); + if ( !suiteElement.Name().Compare( KSuiteElementName8 ) ) + { + suiteFound = ETrue; + break; + } + } + + if ( suiteFound ) + { + // set event mapping + iEventMapping = CHnMdEventMapping::NewL( suiteElement, iCmnPtrs ); + + // set genre + SetGenreL( suiteElement.AttributeNodeL( KGenreAttrName8 ) ); + + // set widget type + // widget needs to be set before template will be set + SetWidgetTypeL( suiteElement.AttributeNodeL( KWidgetTypeAttrName8 ) ); + + // set template + SetTemplateL( suiteElement.AttributeNodeL( KTemplateAttrName8 ) ); + + // set name + SetTitleL( suiteElement.AttributeNodeL( KTitleAttrName8 ) ); + + // set empty text + SetEmptyTextL( suiteElement.AttributeNodeL( KEmptyTextAttrName8 ) ); + + // set custom identifier + SetCustomIdL( suiteElement ); + + // set entries + CreateItemsL( suiteElement, iCmnPtrs ); + + // set queries + iQueries = CHnMdQueries::NewL( suiteElement ); + + // set cached parameters + iSuiteParams = CLiwGenericParamList::NewL(); + } + else + { + // definiotion of the suite was not found! + DEBUG(("_MM_: CHnMdSuite::ConstructL Suite definition not found!")); + User::Leave( KErrNotFound ); + } + + CleanupStack::PopAndDestroy( &elements ); + DEBUG(("_MM_: CHnMdSuite::ConstructL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdSuite* CHnMdSuite::NewL(TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs) + { + CHnMdSuite* self = CHnMdSuite::NewLC( aElement, aCmnPtrs ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdSuite* CHnMdSuite::NewLC(TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs) + { + CHnMdSuite* self = new( ELeave ) CHnMdSuite( aCmnPtrs ); + CleanupStack::PushL( self ); + self->ConstructL( aElement ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdSuite::CHnMdSuite( THnMdCommonPointers* aCmnPtrs ) + : iCmnPtrs( aCmnPtrs ), iAllowableTemplate(NULL) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdSuite::~CHnMdSuite() + { + iAllowableWidgetType.Close(); + delete iAllowableTemplate; + delete iEventMapping; + iSuiteName.Close(); + iItems.ResetAndDestroy(); + iTemplate.Close(); + iTitle.Close(); + iEmptyText.Close(); + iCustomId8.Close(); + delete iQueries; + delete iSuiteParams; + iAllowedTypes.Close(); + delete iQc; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdSuite::EvaluateL( CHnSuiteModel & aSuiteModel ) + { + MMPERF(("CHnMdSuite::EvaluateL - START")); + aSuiteModel.GetItemsOrder()->DefineModelItemCountL( iItems.Count() ); + if( iEvaluationNeeded ) + { + EvaluateSuiteItselfL( aSuiteModel ); + MMPERF(("CHnMdSuite::EvaluateL - suite evaluated")); + iEvaluationNeeded = EFalse; + } + for( TInt i( 0 ); i < iItems.Count(); i++ ) + { + CHnMdItem * item = iItems[i]; + item->SetAlternativeTemplateL( GetAlternativeWidgetNumber() ); + item->EvaluateItemL( aSuiteModel, GetSuiteParameters(), i ); + } + + MMPERF(("CHnMdSuite::EvaluateL - items evaluated - DONE")); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::MarkEvaluationL( CHnFilter& aFilter, CHnSuiteModel& aSuiteModel ) + { + if (aFilter.HasSuiteId()) + { + if (aSuiteModel.CustomId() == aFilter.SuiteId() ) + { + if ( aFilter.IsEvaluateSuite() ) + { + iEvaluationNeeded = ETrue; + } + for (TInt item(0); item < iItems.Count(); item++) + { + iItems[item]->MarkEvaluationL( aFilter ); + } + } + else + { + for (TInt itemIter(0); itemIter < iItems.Count(); itemIter++) + { + RArray< TInt > ids; + CleanupClosePushL( ids ); + aSuiteModel.GetItemsOrder()->GetIdsForL( itemIter, ids); + for (TInt idsIter(0); idsIter < ids.Count(); idsIter++) + { + if (aFilter.SuiteId() == ids[idsIter]) + { + iItems[itemIter]->MarkEvaluationL( aFilter ); + if (aFilter.IsEvaluateSuite()) + { + iEvaluationNeeded = ETrue; + } + } + } + CleanupStack::PopAndDestroy( &ids ); + } + } + } + else if( aFilter.HasSuiteName() ) + { + if( !SuiteName().Compare( aFilter.SuiteName()) ) + { + if ( aFilter.IsEvaluateSuite() ) + { + iEvaluationNeeded = ETrue; + } + for( TInt i( 0 ); i < iItems.Count(); i++ ) + { + iItems[i]->MarkEvaluationL( aFilter ); + } + } + } + else + { + if( aFilter.IsEvaluateSuite() ) + { + iEvaluationNeeded = ETrue; + } + for( TInt i( 0 ); i < iItems.Count(); i++ ) + { + iItems[i]->MarkEvaluationL( aFilter ); + } + } + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::CreateItemsL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + ASSERT( aElement.Name() == KSuiteElementName8 ); + + // construction... + RXmlEngNodeList< TXmlEngElement > elements; + CleanupClosePushL( elements ); + aElement.GetChildElements( elements ); + + TInt elementsCount = elements.Count(); + + for (TInt j = 0; j < elementsCount; j++ ) + { + TXmlEngElement element = elements.Next(); + if ( !element.Name().Compare( KItemElementName8 ) ) + { + CHnMdItem *item = CHnMdItem::NewL( element, aCmnPtrs ); + CleanupStack::PushL( item ); + iItems.AppendL( item ); + CleanupStack::Pop( item ); + } + } + CleanupStack::PopAndDestroy( &elements ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetGenreL(const TDesC& aGenre) + { + iSuiteName.Close(); + iSuiteName.CreateL( aGenre ); + iSuiteName.LowerCase(); + DEBUG16(("\t_MM_: suite attribute (genre): %S", &aGenre )); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetGenreL(TXmlEngAttr aGenre) + { + HBufC* genre = HnConvUtils::Str8ToStrLC( aGenre.Value() ); + SetGenreL(*genre); + // clean up + CleanupStack::PopAndDestroy(genre); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetTemplateL( TXmlEngAttr aTemplate ) + { + SetTemplateL( aTemplate.Value() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetTemplateL( const TDesC8& aTemplate ) + { + delete iAllowableTemplate; + iAllowableTemplate = NULL; + iAllowableTemplate = new ( ELeave ) CDesC8ArrayFlat( 3 ); + + for (int i = 0; i < HnUtils::GetColumnTextColumnCount( aTemplate ); i++) + { + HBufC8* templateBuf = HnUtils::GetColumnTextLC( i, aTemplate ); + templateBuf->Des().Trim(); + iAllowableTemplate->AppendL( *templateBuf ); + CleanupStack::PopAndDestroy(templateBuf); + } + SetAlternativeTemplateL( GetAlternativeWidgetNumber() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::AddInternalStateL( CLiwGenericParamList& aParamList ) + { + TLiwGenericParam param; + param.PushL(); + + CLiwDefaultMap* suiteMap = CLiwDefaultMap::NewL(); + suiteMap->PushL(); + + TLiwVariant suiteWidgetTypeVariant; + suiteWidgetTypeVariant.PushL(); + + CLiwDefaultMap* widgetTypeMap = CLiwDefaultMap::NewL(); + widgetTypeMap->PushL(); + + if ( iWidgetType == EGridWidget ) + { + widgetTypeMap->InsertL( KWidgetType8(), KWidgetTypeGrid8() ); + } + else if ( iWidgetType == EListWidget ) + { + widgetTypeMap->InsertL( KWidgetType8(), KWidgetTypeList8() ); + } + else if ( iWidgetType == ECoverFlowWidget ) + { + widgetTypeMap->InsertL( KWidgetType8(), KWidgetTypeCoverFlow8() ); + } + + widgetTypeMap->InsertL( KAllowedTypes8(), iAllowedTypes ); + + suiteWidgetTypeVariant.Set( widgetTypeMap ); + + // add suite widget type + suiteMap->InsertL( KSuite8(), suiteWidgetTypeVariant ); + aParamList.Remove( KMm8 ); + + // set internal state + param.SetNameAndValueL( KMm8, TLiwVariant( suiteMap ) ); + aParamList.AppendL( param ); + + CleanupStack::PopAndDestroy( widgetTypeMap ); + CleanupStack::PopAndDestroy( &suiteWidgetTypeVariant ); + CleanupStack::PopAndDestroy( suiteMap ); + CleanupStack::PopAndDestroy( ¶m ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::DoSetWidgetTypeL( TDesC8 & aConfDes ) + { + if ( !aConfDes.Compare( KWidgetTypeGrid8 )) + { + iAllowableWidgetType.AppendL( EGridWidget ); + } + else if ( !aConfDes.Compare( KWidgetTypeList8 ) ) + { + iAllowableWidgetType.AppendL( EListWidget ); + } + else if ( !aConfDes.Compare( KWidgetTypeCoverFlow8 ) ) + { + iAllowableWidgetType.AppendL( ECoverFlowWidget ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnMdSuite::GetAlternativeWidgetNumber() + { + return iAllowableWidgetType.Find( iWidgetType ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetAlternativeTemplateL( TInt aOption ) + { + iTemplate.Close(); + if (aOption >= 0 && aOption < iAllowableTemplate->Count()) + { + const TDesC8 & val = (*iAllowableTemplate)[aOption]; + iTemplate.CreateL(val.Length()); + iTemplate.Copy(val); + iTemplate.Trim(); + } + else + { + iTemplate.CreateL( KNullDesC8() ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetAlternativeTemplateL( CLiwGenericParamList& aParams ) + { + RBuf8 logicalTemplate; + logicalTemplate.CleanupClosePushL(); + if ( KErrNone == HnLiwUtils::GetStringL( + aParams, KTemplatePath8, logicalTemplate ) && + KErrNone != logicalTemplate.Compare( KTemplatePath8 ) && + logicalTemplate.Length() ) + { + SetTemplateL( logicalTemplate ); + } + else + { + SetAlternativeTemplateL( GetAlternativeWidgetNumber() ); + } + CleanupStack::PopAndDestroy( &logicalTemplate ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdSuite::ReadWidgetTypeFromServiceL( CLiwGenericParamList& aParams, + RBuf8& aWidgetType ) + { + return + HnLiwUtils::GetStringL( aParams, KWidgetTypePath8, aWidgetType ) == KErrNone + && aWidgetType.Compare( KWidgetTypePath8 ) != KErrNone + && aWidgetType.Length(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetAlternativeWidgetL( CLiwGenericParamList& aParams ) + { + RBuf8 widget; + widget.CleanupClosePushL(); + if ( ReadWidgetTypeFromServiceL( aParams, widget ) ) + { + iAllowableWidgetType.Reset(); + SetWidgetTypeL( widget ); + } + else + { + ReadWidgetTypeL(); + } + CleanupStack::PopAndDestroy( &widget ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetWidgetTypeL( TXmlEngAttr aWidgetType ) + { + TPtrC8 widgetType = aWidgetType.Value(); + DEBUG8(("\t_MM_: suite attribute (widget type): %S", &widgetType)); + + SaveWidgetTypeL( widgetType ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetWidgetTypeL(TDesC8& aWidgetType) + { + iAllowedTypes.Close(); + iAllowedTypes.CreateL(aWidgetType); + const TInt columnCount(HnUtils::GetColumnTextColumnCount(aWidgetType)); + for (TInt i = 0; i < columnCount; i++) + { + HBufC8* type = HnUtils::GetColumnTextLC(i, aWidgetType); + type->Des().Trim(); + DoSetWidgetTypeL(*type); + CleanupStack::PopAndDestroy(type); + } + if (iAllowableWidgetType.Count() <= 0) + { + User::Leave(KErrCorrupt); + } + iWidgetType = iAllowableWidgetType[0]; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SaveWidgetTypeL( TDesC8& aWidgetType ) + { + SetWidgetTypeL( aWidgetType ); + CHnRepositoryManager* repMan = CHnRepositoryManager::NewLC(); + + if ( iAllowableWidgetType.Count() > 0 ) + { + THnSuiteWidgetType crWidgetType( EUnspecified ); + TInt err( repMan->ReadSuiteWidgetTypeL( iSuiteName, crWidgetType ) ); + if( !err || err == KErrNotFound ) + { + TInt found = iAllowableWidgetType.Find( crWidgetType ); + if ( crWidgetType != EUnspecified && found != KErrNotFound ) + { + iWidgetType = crWidgetType; + } + else + { + err = repMan->StoreSuiteWidgetTypeL( iSuiteName, iWidgetType ); + } + } + } + + CleanupStack::PopAndDestroy( repMan ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetModeL( TMdMode aMode ) + { + if ( iMode != aMode ) + { + for( TInt i( 0 ); i < iItems.Count() ; i++ ) + { + if( iItems[i]->HasAlternativeModeItem() ) + { + CHnMdItem * currentItem = iItems[i]; + CHnMdItem * newItem = currentItem->TakeAlternativeModeItem(); + newItem->SetAlternativeModeItem( currentItem ); + iItems.InsertL( newItem, i ); + iItems.Remove( i+1 ); + } + } + iMode = aMode; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TMdMode CHnMdSuite::Mode() + { + return iMode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetTitleL( TXmlEngAttr aTitle ) + { + iTitle.Close(); + iTitle.CreateL( aTitle.Value().Length() ); + iTitle.Copy( aTitle.Value() ); + DEBUG8(("\t_MM_: suite attribute (name): %S", &iTitle)); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetEmptyTextL( TXmlEngAttr aEmptyText ) + { + iEmptyText.Close(); + iEmptyText.CreateL( aEmptyText.Value().Length() ); + iEmptyText.Copy( aEmptyText.Value() ); + DEBUG8(("\t_MM_: suite attribute (name): %S", &iEmptyText)); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +// +void CHnMdSuite::EvaluateSuiteItselfL( CHnSuiteModel & aSuiteModel ) + { + + DEBUG(("_MM_: CHnMdSuite::EvaluateSuiteItselfL IN")); + iSuiteModel = &aSuiteModel; + //delete old query collector and create new one + //currently running evaluations will be cancelled + delete iQc; + iQc = NULL; + iQc = CHnQueryResultCollector::NewL( *iQueries, GetSuiteParameters() ); + iQc->StartAsynchL( this ); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CHnMdSuite::SuiteName() + { + return iSuiteName; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdSuite::SaveWidgetTypeL() const + { + CHnRepositoryManager *repManager = CHnRepositoryManager::NewLC(); + DEBUG8(("\t_MM_: Saving '%S' widget type to CR: %d", &iSuiteName, iWidgetType)); + TInt ret( repManager->StoreSuiteWidgetTypeL( iSuiteName, iWidgetType ) ); + CleanupStack::PopAndDestroy(repManager); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdSuite::ReadWidgetTypeL() + { + TInt ret = KErrNone; + + if (iAllowableWidgetType.Count() <= 1) + { + DEBUG8(("\t_MM_: Suite '%S' is allowed to have just one widget: %d ", &iSuiteName, iWidgetType)); + return ret; + } + + CHnRepositoryManager* repManager = CHnRepositoryManager::NewLC(); + THnSuiteWidgetType widgetType( EUnspecified ); + TInt err( repManager->ReadSuiteWidgetTypeL( iSuiteName, widgetType ) ); + if( ( !err || err == KErrNotFound ) && widgetType != EUnspecified ) + { + if ( widgetType == EChangeWidget ) + { + ASSERT( iAllowableWidgetType.Find( iWidgetType ) >= 0 ); + TInt index = (iAllowableWidgetType.Find( iWidgetType ) + 1) + % iAllowableWidgetType.Count(); + iWidgetType = iAllowableWidgetType[index]; + DEBUG8(("\t_MM_: Suite '%S' widget change invoked: %d", &iSuiteName, widgetType)); + SaveWidgetTypeL(); + } + else if ( iAllowableWidgetType.Find( widgetType ) != KErrNotFound ) + { + DEBUG8(("\t_MM_: Suite '%S' sets widget: %d from CR", &iSuiteName, widgetType)); + iWidgetType = widgetType; + } + } + CleanupStack::PopAndDestroy( repManager ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::ResultsCollectedL( CLiwGenericParamList* aResults ) + { + CLiwGenericParamList* queriesResultsList = CLiwGenericParamList::NewLC(); + queriesResultsList->AppendL( *aResults ); + queriesResultsList->AppendL( GetSuiteParameters() ); + + RBuf title; + CleanupClosePushL( title ); + HnLiwUtils::GetStringL( *queriesResultsList, iTitle, title ); + + RBuf suiteTitle; + CleanupClosePushL( suiteTitle ); + HnStringHandler::LocaliseL( suiteTitle, title, iCmnPtrs ); + + DEBUG16( ( "\t_MM_: SetTitleL: %S", &suiteTitle ) ); + iSuiteModel->SetTitleL( suiteTitle ); + + CleanupStack::PopAndDestroy( &suiteTitle ); + CleanupStack::PopAndDestroy( &title ); + + RBuf emptyText; + CleanupClosePushL( emptyText ); + HnLiwUtils::GetStringL( *queriesResultsList, iEmptyText, emptyText ); + + RBuf emptyTextLoc; + CleanupClosePushL( emptyTextLoc ); + HnStringHandler::LocaliseL( emptyTextLoc, emptyText, iCmnPtrs ); + + DEBUG16(("\t_MM_: SetEmptyTestL: %S", &emptyTextLoc)); + iSuiteModel->SetEmptyTextL( emptyTextLoc ); + + CleanupStack::PopAndDestroy( &emptyTextLoc ); + CleanupStack::PopAndDestroy( &emptyText ); + + // set widget type + SetAlternativeWidgetL( *queriesResultsList ); + iSuiteModel->SetWidgetType( iWidgetType ); + + // set custom id + SetCustomIdL( iSuiteModel, *queriesResultsList, 0 ); + + // set exit mode + SetExitModeL(); + + // set template + SetAlternativeTemplateL( *queriesResultsList ); + iSuiteModel->SetTemplateL( iTemplate ); + + // add widget type to aParams + AddInternalStateL( GetSuiteParameters() ); + DEBUG(("\t_MM_: WidgetType: %d", iSuiteModel->WidgetType())); + + // evaluate actions + iEventMapping->FillActionsL( iSuiteModel->GetActions(), + *queriesResultsList ); + + CleanupStack::PopAndDestroy( queriesResultsList ); + + iSuiteModel->RefreshMulModelL( iSuiteModel->GetItemsOrder()->Count() ); + TBool observersNotified = iSuiteModel->SuiteEvaluationFinishedL(); + if ( observersNotified ) + { + iCmnPtrs->iModel->SuiteModelReadyToShowL( iSuiteModel ); + } + + // set uri based highlight + SetUriBasedHighlightL(); + + //DEBUG16(("\t\t_MM_: SetTemplate: ")); + DEBUG(("_MM_: CHnMdSuite::ResultsCollectedL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetUriBasedHighlightL() + { + RBuf tmp; + CleanupClosePushL( tmp ); + HnLiwUtils::GetStringL( *iSuiteParams, KParamsUriHighlightSuite, tmp ); + + if ( !tmp.Compare( this->iSuiteName ) ) + { + tmp.Close(); + HnLiwUtils::GetStringL( *iSuiteParams, KParamsUriHighlight, tmp ); + + TLex lexFrag( tmp ); + TInt highLight( 0 ); + if( !( lexFrag.Val( highLight ) ) ) + { + iSuiteModel->SetSuiteHighlightL( highLight ); + } + } + + CleanupStack::PopAndDestroy( &tmp ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetCustomIdL( TXmlEngElement aElement ) + { + iCustomId8.Close(); + + if ( aElement.HasAttributeL( KCustomId8 ) ) + { + TPtrC8 av = aElement.AttributeValueL( KCustomId8 ); + iCustomId8.CreateL( av ); + } + else + { + iCustomId8.CreateL( KItemTypeUnknown8 ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetCustomIdL( CHnSuiteModel* aSuiteModel, + const CLiwGenericParamList& aParams, TInt aPos ) + { + TInt64 customId( KErrNotFound ); + if ( KErrNone == HnLiwUtils::GetInt64L( + aParams, iCustomId8, aPos, customId ) ) + { + aSuiteModel->SetCustomId( customId ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdSuite::SetExitModeL() + { + RBuf exitMode; + CleanupClosePushL( exitMode ); + HnLiwUtils::GetStringL( *iSuiteParams, KExitModeParams, exitMode ); + + if ( !exitMode.Compare( KExitModeHide ) ) + { + iSuiteModel->SetExitMode( EExitModeHide ); + } + else + { + iSuiteModel->SetExitMode( EExitModeNormal ); + } + + CleanupStack::PopAndDestroy( &exitMode ); + } + + +// End of file diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdtoolbar.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdtoolbar.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,162 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <xmlengelement.h> +#include <xmlengnodelist.h> + +#include "hnmdtoolbar.h" +#include "hnmdbutton.h" +#include "hnconvutils.h" +#include "hnglobals.h" +#include "hntoolbarmodel.h" +#include "hnbuttonmodel.h" +#include "hnattributebase.h" + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdToolbar* CHnMdToolbar::NewLC( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + CHnMdToolbar* self = new( ELeave ) CHnMdToolbar; + CleanupStack::PushL( self ); + self->ConstructL( aElement, aCmnPtrs ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdToolbar* CHnMdToolbar::NewL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + CHnMdToolbar* self = CHnMdToolbar::NewLC( aElement, aCmnPtrs ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdToolbar::EvaluateL( CHnToolbarModel* aToolbar, + const CLiwGenericParamList& aQueryResults, + TInt aPos ) + { + TInt buttonCount = iButtons.Count(); + for( TInt i( 0 ); i < buttonCount; i++ ) + { + if( iButtons[ i ]->ValidateToAddL( aQueryResults, aPos ) && + aToolbar->GetButton( iButtons[ i ]->GetIndex() ) == NULL ) + { + CHnButtonModel* button = CHnButtonModel::NewLC( + iButtons[ i ]->GetIndex() ); + + const TDesC& helpText = iButtons[ i ]->EvaluateButtonTextL( aQueryResults, aPos ); + button->SetHelpTextL( helpText ); + + button->SetEventId( iButtons[ i ]->GetEventId() ); + button->SetDimmed( + iButtons[ i ]->ValidateToDimmL( aQueryResults, aPos ) ); + + CHnAttributeBase* attributeImage = iButtons[ i ]->EvaluateIconL( aQueryResults, aPos ); + button->SetIcon( attributeImage ); + + aToolbar->AddButtonL( button ); + CleanupStack::Pop( button ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdToolbar::~CHnMdToolbar( ) + { + iButtons.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdToolbar::CHnMdToolbar() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdToolbar::ConstructL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + TXmlEngElement toolbarElement; + if ( aElement.Name().Compare( KMenuToolbar8 ) != 0 ) + { + RXmlEngNodeList< TXmlEngElement > children; + CleanupClosePushL( children ); + aElement.GetChildElements( children ); + TInt count = children.Count(); + + for ( TInt i = 0; i < count; i++ ) + { + TXmlEngElement child = children.Next(); + if ( !child.Name().Compare( KMenuToolbar8 ) ) + { + CreateButtonsL( child, aCmnPtrs ); + } + } + CleanupStack::PopAndDestroy( &children ); + } + + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdToolbar::CreateButtonsL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + RXmlEngNodeList< TXmlEngElement > children; + CleanupClosePushL( children ); + aElement.GetChildElements( children ); + TInt count = children.Count(); + + for ( TInt i = 0; i < count; i++ ) + { + TXmlEngElement child = children.Next(); + if ( !child.Name().Compare( KMenuButton8 ) ) + { + CHnMdButton* button = CHnMdButton::NewLC( child, aCmnPtrs ); + iButtons.AppendL( button ); + CleanupStack::Pop( button ); + } + } + CleanupStack::PopAndDestroy( &children ); + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmduimapping.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmduimapping.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,148 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <liwservicehandler.h> +#include <e32hashtab.h> + +#include "menudebug.h" +#include "hnmduimapping.h" +#include "hnmduimappingelement.h" +#include "hnutils.h" +#include "hnglobals.h" +#include "hnitemmodel.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdUiMapping::ConstructL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + RXmlEngNodeList< TXmlEngElement > children; + CleanupClosePushL(children); + aElement.GetChildElements(children); + TInt amount = children.Count(); + + TPtrC8 n = aElement.Name(); + + for (TInt j = 0; j < amount; j++ ) + { + TXmlEngElement item = children.Next(); + + if ( !item.Name().Compare( KOutputElementItem8 ) ) + { + CHnMdUiMappingElement *element = + CHnMdUiMappingElement::NewL( item , aCmnPtrs ); + this->AddUiMappingElementL( element ); + } + } + CleanupStack::PopAndDestroy( &children ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdUiMapping::AddUiMappingElementL( + CHnMdUiMappingElement *aUiMappingElement ) + { + iMappings.AppendL( aUiMappingElement ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUiMapping* CHnMdUiMapping::NewL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + CHnMdUiMapping* self = CHnMdUiMapping::NewLC( aElement, aCmnPtrs ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUiMapping* CHnMdUiMapping::NewLC( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + CHnMdUiMapping* self = new( ELeave ) CHnMdUiMapping; + CleanupStack::PushL( self ); + self->ConstructL( aElement, aCmnPtrs ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUiMapping::CHnMdUiMapping() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUiMapping::~CHnMdUiMapping() + { + iMappings.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdUiMapping::FillGraphicalItemL( CHnItemModel* aItemModel , + const CLiwGenericParamList& aQueriesResultsList, TInt aPos ) + { + RPointerArray< TDesC8 > aliases; + CleanupClosePushL( aliases ); + + TBool ret( ETrue ); + for ( TInt i(0); i < iMappings.Count(); i++ ) + { + CHnMdUiMappingElement* uiElem = iMappings[ i ]; + ASSERT( uiElem ); + TBool alreadyFilled( EFalse ); + const TDesC8* alias = &uiElem->Alias(); + for( TInt index( 0 ); index < aliases.Count(); index++ ) + { + if ( !aliases[ index ]->Compare( *alias ) ) + { + alreadyFilled = ETrue; + } + } + if ( !alreadyFilled && uiElem->IsValidL( aQueriesResultsList, aPos ) ) + { + aliases.AppendL( alias ); + ret = uiElem->FillGraphicalItemL( aItemModel, aQueriesResultsList, aPos ); + if ( !ret ) + { + break; + } + } + } + CleanupStack::PopAndDestroy( &aliases ); + return ret; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmduimappingelement.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmduimappingelement.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,193 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnmduimappingelement.h" +#include "hnmdkeyfactory.h" +#include "hnmdbasekey.h" +#include "hnconvutils.h" +#include "menudebug.h" +#include "hnitemmodel.h" +#include "bautils.h" +#include "hnglobals.h" +#include "hnmdvaluebase.h" +#include "hnmdmodel.h" +#include "hninterface.h" +#include "hnconditioninterface.h" +#include "hnattributebase.h" +#include "hnattributeimage.h" +#include "hnconditionfactory.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdUiMappingElement::ConstructL( const TXmlEngElement& aElement, + THnMdCommonPointers* aCmnPtrs ) + { + ASSERT( !aElement.Name().Compare( KOutputElementItem8 ) ); + + // set alias + SetAliasL( aElement.AttributeNodeL( KAliasAttrName8 ) ); + + // set condition + if( aElement.AttributeValueL( KMenuConditionAttrName8 ).Length() ) + { + iCondition = HnConditionFactory::NewL( + aElement.AttributeNodeL( KMenuConditionAttrName8 ) ); + } + + // common pointers + iCmnPtrs = aCmnPtrs; + + if ( aElement.IsSimpleTextContents() == EFalse && + aElement.HasChildNodes() ) + { + // get child element from output and pass to set value + RXmlEngNodeList< TXmlEngElement > childElements; + CleanupClosePushL( childElements ); + aElement.GetChildElements( childElements ); + TXmlEngElement childElement = childElements.Next(); + // it could be text/image node + SetValueL( childElement, aCmnPtrs ); + CleanupStack::PopAndDestroy( &childElements ); + } + else + { + // handle output node + SetValueL( aElement, aCmnPtrs ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC8& CHnMdUiMappingElement::Alias() const + { + return iAlias; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdUiMappingElement::SetAliasL( const TXmlEngAttr& aName ) + { + iAlias.Close(); + iAlias.CreateL( aName.Value() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdUiMappingElement::SetValueL( const TXmlEngElement& aValue, + THnMdCommonPointers* aCmnPtrs ) + { + delete iValue; + iValue = NULL; + iValue = CHnMdValueBase::CreateL( aValue, aCmnPtrs ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUiMappingElement* CHnMdUiMappingElement::NewL( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + CHnMdUiMappingElement* self = CHnMdUiMappingElement::NewLC( aElement, + aCmnPtrs ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUiMappingElement* CHnMdUiMappingElement::NewLC( TXmlEngElement aElement, + THnMdCommonPointers* aCmnPtrs ) + { + CHnMdUiMappingElement* self = new( ELeave ) CHnMdUiMappingElement; + CleanupStack::PushL( self ); + self->ConstructL( aElement, aCmnPtrs ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUiMappingElement::CHnMdUiMappingElement() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUiMappingElement::~CHnMdUiMappingElement() + { + iAlias.Close(); + delete iValue; + delete iCondition; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdUiMappingElement::FillGraphicalItemL( CHnItemModel* aItemModel , + const CLiwGenericParamList& aQueriesResultsList, TInt aPos ) + { + TBool ret = EFalse; + CHnAttributeBase* attr = iValue->CreateAttributeL( + &aQueriesResultsList, aPos ); + + if( attr ) + { + CleanupStack::PushL( attr ); + attr->SetNameL( iAlias ); + aItemModel->SetAttributeL( attr ); + CleanupStack::Pop( attr ); + ret = ETrue; + } + + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdUiMappingElement::IsValidL( + const CLiwGenericParamList& aQueryResults, TInt aPos ) + { + TBool ret( EFalse ); + + if( !iCondition || iCondition->ResultL( aQueryResults, aPos ) ) + { + ret = ETrue; + } + + return ret; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdvaluebase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdvaluebase.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2007-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: +* +*/ + +#include <xmlengdom.h> +#include <liwservicehandler.h> + +#include "hnmdvaluebase.h" +#include "hnmdvalueimage.h" +#include "hnmdvaluetext.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdValueBase* CHnMdValueBase::CreateL( + const TXmlEngElement& aElement, THnMdCommonPointers* aCmnPtrs ) + { + CHnMdValueBase* ret( NULL ); + + // check the child element name + if ( !aElement.Name().Compare( KImageElementItem8 ) ) + { + ret = CHnMdValueImage::NewL( aElement, aCmnPtrs); + } + else if ( !aElement.Name().Compare( KTextElementItem8 ) ) + { + ret = CHnMdValueText::NewL(aElement, aCmnPtrs); + } + else if ( !aElement.Name().Compare( KOutputElementItem8 ) ) + { + // now we have two options, element value, or attribute + // text will hande it + ret = CHnMdValueText::NewL(aElement, aCmnPtrs); + } + else + { + User::Leave( KErrNotSupported ); + } + return ret; + } + + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdvalueimage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdvalueimage.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,618 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <xmlengdom.h> +#include <bautils.h> +#include <liwcommon.h> +#include <AknsSkinInstance.h> +#include <AknsDrawUtils.h> +#include <gulicon.h> + +#include "hnmdvalueimage.h" +#include "hnglobals.h" +#include "hnmdmodel.h" +#include "AknsUtils.h" +#include "hnconvutils.h" +#include "hnliwutils.h" +#include "hnutils.h" +#include "bitdev.h" +#include "hnattributebase.h" +#include "hnattributeimage.h" +#include "menudebug.h" +#include "hnbitmapidcache.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdValueImage* CHnMdValueImage::NewLC( + const TXmlEngElement& aElement, THnMdCommonPointers* aCmnPtrs ) + { + CHnMdValueImage* self = + new (ELeave)CHnMdValueImage(); + CleanupStack::PushL(self); + self->ConstructL( aElement, aCmnPtrs ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdValueImage* CHnMdValueImage::NewL( + const TXmlEngElement& aElement, THnMdCommonPointers* aCmnPtrs ) + { + CHnMdValueImage* self = + CHnMdValueImage::NewLC( aElement, aCmnPtrs ); + CleanupStack::Pop(); // self; + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdValueImage::ConstructL( const TXmlEngElement& aElement, + THnMdCommonPointers* aCmnPtrs ) + { + iCmnPtrs = aCmnPtrs; + iPos = 0; + + HnUtils::SetAttributeL( aElement, KFile8, iFileNameSrc8 ); + if ( iFileNameSrc8.Length( ) == 0 ) + { + HnUtils::SetAttributeL( aElement, iFileNameSrc8 ); + } + HnUtils::SetAttributeL( aElement, KSkinIdMinor8, iSkinIdMinor8 ); + HnUtils::SetAttributeL( aElement, KSkinIdMajor8, iSkinIdMajor8 ); + HnUtils::SetAttributeL( aElement, KBitmapId8, iBitmapId8 ); + HnUtils::SetAttributeL( aElement, KMaskId8, iMaskId8 ); + HnUtils::SetAttributeL( aElement, KMifFile8, iMifFile8 ); + HnUtils::SetAttributeL( aElement, KAppUid8, iApplicationUid8 ); + HnUtils::SetAttributeL( aElement, KBitmap8, iBitmap8 ); + HnUtils::SetAttributeL( aElement, KMask8, iMask8 ); + + iMifFileName = GetMifFileNameL(); + } + +// --------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +TInt CHnMdValueImage::GetResourceIdL( const TDesC8& aResourceFileContents, + const TDesC8& aResourceName ) + { + HBufC8* resourceWithSeparator = + HBufC8::NewLC( aResourceName.Length() + KResourceSeparator().Length() ); + resourceWithSeparator->Des().Append( aResourceName ); + resourceWithSeparator->Des().Append( KResourceSeparator() ); + + TInt position = aResourceFileContents.Find( *resourceWithSeparator ); + + TInt id( KErrNotFound ); + + if ( position >= 0 ) + { + TPtrC8 contentAfterMid = aResourceFileContents.Mid( + position + resourceWithSeparator->Length() ); + + TChar comma( KComma()[0] ); + TInt posEnd = contentAfterMid.Locate( comma ); + + if ( posEnd >= 0 ) + { + + TPtrC8 resourceId = contentAfterMid.Left( posEnd ); + + HBufC8* resourceTrimmed = resourceId.AllocL(); + resourceTrimmed->Des().Trim(); + + // GET ICON ID + HnConvUtils::Str8ToInt( *resourceTrimmed, id ); + + delete resourceTrimmed; + } + } + + //cleanup + CleanupStack::PopAndDestroy( resourceWithSeparator ); + + return id; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdValueImage::SetImageSourceL() + { + if ( iBitmapId8.Length() > 0 && iMaskId8.Length() > 0 && + iMifFile8.Length() > 0 ) + { + iImageSource = EImageSourceResource; + // check if file exists + if ( !iMifFileName || + !BaflUtils::FileExists( iCmnPtrs->iFs, *iMifFileName ) ) + { + iImageSource = EImageSourceUndefined; + } + } + else if ( iFileNameSrc8.Length() > 0 ) + { + iImageSource = EImageSourceFile; + // check if file exists + HBufC* fn = GetFileNameSrcL(); + CleanupStack::PushL( fn ); + if ( EFalse == BaflUtils::FileExists( iCmnPtrs->iFs, *fn ) ) + { + iImageSource = EImageSourceUndefined; + } + CleanupStack::PopAndDestroy( fn ); + } + else if ( iBitmap8.Length() > 0 && iMask8.Length() > 0 ) + { + iImageSource = EImageSourceLiw; + } + else if ( iApplicationUid8.Length() > 0 ) + { + iImageSource = EImageSourceApplicationUid; + } + else + { + iImageSource = EImageSourceUndefined; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdValueImage::CHnMdValueImage() + { + // No implementation required + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdValueImage::~CHnMdValueImage() + { + iFileNameSrc8.Close(); + //iFileName.Close(); + iBitmap8.Close(); + iMask8.Close(); + iSkinIdMinor8.Close(); + iSkinIdMajor8.Close(); + iBitmapId8.Close(); + iMaskId8.Close(); + iApplicationUid8.Close(); + iMifFile8.Close(); + iReturnValue.Close(); + delete iMifFileName; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttributeBase* CHnMdValueImage::CreateAttributeL( + const CLiwGenericParamList* aParamList, + TInt aPos ) + { + iParamList = aParamList; + iPos = aPos; + CHnAttributeImage* attr = CHnAttributeImage::NewLC(); + SetAttributeDataL( attr ); + CleanupStack::Pop( attr ); + return attr; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdValueImage::SetAttributeDataL( CHnAttributeImage* aAttr ) + { + TInt bitmapId = 0; + TInt maskId = 0; + delete iMifFileName; + iMifFileName = NULL; + iMifFileName = GetMifFileNameL(); + GetBitmapAndMaskIdL( bitmapId, maskId ); + + if ( iMifFileName ) + { + aAttr->SetMifFile( iMifFileName->AllocL() ); + } + else + { + aAttr->SetMifFile( NULL ); + } + aAttr->SetSkinId( SkinIdL() ); + aAttr->SetBitmapId( bitmapId ); + aAttr->SetMaskId( maskId ); + aAttr->SetApplicationUid( ApplicationUidL() ); + aAttr->SetBitmap( BitmapL() ); + aAttr->SetMask( MaskL() ); + aAttr->SetFileNameSrc( GetFileNameSrcL() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HBufC* CHnMdValueImage::GetFileNameSrcL() + { + RBuf tmpBuf; + CleanupClosePushL( tmpBuf ); + + HnLiwUtils::GetStringL( *iParamList, iFileNameSrc8, iPos, tmpBuf ); + HBufC* ret = tmpBuf.AllocL(); + CleanupStack::PopAndDestroy( &tmpBuf ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HBufC* CHnMdValueImage::FindMatchigMifFileL( const RFs& aFs, TDesC& aFileName ) + { + DEBUG16(("_MM_: CHnMdValueImage::FindMatchigMifFileL IN")); + + // whole path to the mif file was not specified + TDriveList driveList; + HBufC* ret = NULL; + + if ( KErrNone == aFs.DriveList( driveList ) ) + { + TInt driveNumber( EDriveY ); // start with drive Y + do // iterates through drives: Y, X, W, ..., C, B, A, Z + { + if ( driveList[ driveNumber ] ) + { + ret = HBufC::NewLC( + 1 + KRscPath().Length() + // 1 - drive letter len. + aFileName.Length() ); + TPtr ptr( ret->Des() ); + TChar driveLetter; + aFs.DriveToChar( driveNumber, driveLetter ); + ptr.Append( driveLetter ); + ptr.Append( KRscPath ); + ptr.Append( aFileName ); + + if ( BaflUtils::FileExists( aFs, *ret ) ) + { + // break if file was found + CleanupStack::Pop( ret ); + break; + } + else + { + CleanupStack::PopAndDestroy( ret ); + ret = NULL; + } + } + /* The below formula is created so that the loop itarates + through drives in the following order: + Y, X, W, ..., D, C, B, A, Z. + Drive Y is most important. */ + ( --driveNumber >= 0 ) ? driveNumber %= KMaxDrives : + driveNumber = EDriveZ; + } + while( EDriveY != driveNumber ); + } + DEBUG16(("_MM_: CHnMdValueImage::FindMatchigMifFileL OUT")); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HBufC* CHnMdValueImage::GetMifFileNameL() + { + DEBUG16(("_MM_: CHnMdValueImage::GetMifFileNameL IN")); + HBufC* ret = NULL; + RBuf tmpBuf; + CleanupClosePushL( tmpBuf ); + + TInt errCode = HnLiwUtils::GetStringL( *iParamList, iMifFile8, iPos, tmpBuf ); + if ( !BaflUtils::FileExists( iCmnPtrs->iFs, tmpBuf ) && tmpBuf.Length() ) + { + // fileName was retrieved but corresponding file was not found + ret = FindMatchigMifFileL( iCmnPtrs->iFs, tmpBuf ); + } + else if ( tmpBuf.Length() ) + { + // return fileName as it is + ret = tmpBuf.AllocL(); + } + + // clean up + CleanupStack::PopAndDestroy( &tmpBuf ); + + DEBUG16(("_MM_: CHnMdValueImage::GetMifFileNameL OUT")); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TAknsItemID CHnMdValueImage::SkinIdL() + { + TAknsItemID retItemId( KAknsIIDNone ); + + TInt skinIdMinor( KErrNotFound ); + TInt skinIdMajor( KErrNotFound ); + + RBuf8 bufMajor; + RBuf8 bufMinor; + CleanupClosePushL(bufMinor); + CleanupClosePushL(bufMajor); + + HnLiwUtils::GetStringL( *iParamList, iSkinIdMajor8, iPos, bufMajor ); + HnLiwUtils::GetStringL( *iParamList, iSkinIdMinor8, iPos, bufMinor ); + + if ( KErrNone == HnConvUtils::Str8ToInt( bufMinor, skinIdMinor) && + KErrNone == HnConvUtils::Str8ToInt( bufMajor, skinIdMajor) ) + { + retItemId.Set( skinIdMajor, skinIdMinor ); + } + + CleanupStack::PopAndDestroy(&bufMajor); + CleanupStack::PopAndDestroy(&bufMinor); + return retItemId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdValueImage::GetBitmapAndMaskIdL( TInt& aBitmapId, TInt& aMaskId ) + { + aBitmapId = KErrNotFound; + aMaskId = KErrNotFound; + + RBuf8 bitmapIdBuf; + CleanupClosePushL( bitmapIdBuf ); + RBuf8 maskIdBuf; + CleanupClosePushL( maskIdBuf ); + + HnLiwUtils::GetStringL( *iParamList, iBitmapId8, iPos, bitmapIdBuf ); + HnLiwUtils::GetStringL( *iParamList, iMaskId8, iPos, maskIdBuf ); + TBool bitmapIdLookupNeeded = + HnConvUtils::Str8ToInt( bitmapIdBuf, aBitmapId ) != KErrNone; + TBool maskIdLookupNeeded = + HnConvUtils::Str8ToInt( maskIdBuf, aMaskId ) != KErrNone; + + // if bitmap and mas ids are stored in mbg file + if ( ( bitmapIdLookupNeeded || maskIdLookupNeeded ) && iMifFileName ) + { + // look up in cache + RBuf8 keyBitmap; + RBuf8 keyMask; + CreateKeysLC( keyBitmap, bitmapIdBuf, keyMask, maskIdBuf ); + + iCmnPtrs->iBitmapIdCache->GetL( keyBitmap, aBitmapId ); + iCmnPtrs->iBitmapIdCache->GetL( keyMask, aMaskId ); + + // if not found in cache read ids from mbg file + if ( aBitmapId == KErrNotFound || aMaskId == KErrNotFound ) + { + HBufC* path = ReplaceFileExtensionLC( *iMifFileName, KMbg() ); + HBufC8* fileContents = NULL; + TRAPD( readFileErr, fileContents = HnUtils::ReadFileL( *path ) ); + if ( !readFileErr && fileContents ) + { + CleanupStack::PushL( fileContents ); + if ( bitmapIdLookupNeeded ) + { + aBitmapId = GetResourceIdL( *fileContents, bitmapIdBuf ); + iCmnPtrs->iBitmapIdCache->AddL( keyBitmap, aBitmapId ); + } + if ( maskIdLookupNeeded ) + { + aMaskId = GetResourceIdL( *fileContents, maskIdBuf ); + iCmnPtrs->iBitmapIdCache->AddL( keyMask, aMaskId ); + } + CleanupStack::PopAndDestroy( fileContents ); + } + CleanupStack::PopAndDestroy( path ); + } + CleanupStack::PopAndDestroy( &keyMask ); + CleanupStack::PopAndDestroy( &keyBitmap ); + } + + CleanupStack::PopAndDestroy( &maskIdBuf ); + CleanupStack::PopAndDestroy( &bitmapIdBuf ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HBufC* CHnMdValueImage::ReplaceFileExtensionLC( + const TDesC& aPath, const TDesC& aNewExt ) + { + HBufC* newPath = HBufC::NewLC( aPath.Length() ); + newPath->Des().Copy( aPath ); + TInt extPos = newPath->LocateReverse( '.' ); + User::LeaveIfError( extPos ); + newPath->Des().Replace( extPos, newPath->Length() - extPos, aNewExt ); + return newPath; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TUid CHnMdValueImage::ApplicationUidL() + { + TUid uid; + TUint result( 0 ); + + RBuf8 buf; + CleanupClosePushL(buf); + HnLiwUtils::GetStringL( *iParamList, iApplicationUid8, iPos, buf ); + + if( buf.Length() ) + { + TLex8 lex( buf ); + if( !buf.Find( KHexPrefix8 ) ) + { + lex.Inc( KHexPrefix8().Length() ); + lex.Mark(); + } + lex.Val( result, EHex ); + } + uid.iUid = result; + + CleanupStack::PopAndDestroy(&buf); + return uid; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TLiwVariant* CHnMdValueImage::BitmapFromLiwL( const TDesC8& aPath ) + { + TLiwVariant* ret = new( ELeave ) TLiwVariant; + TInt err( KErrNone ); + TInt check( KErrNone ); + TRAP( err, check = HnLiwUtils::GetVariantL( *iParamList, aPath, iPos, *ret ) ); + if( err != KErrNone || check != KErrNone ) + { + ret->Reset(); + delete ret; + ret = NULL; + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TLiwVariant* CHnMdValueImage::BitmapL() + { + TLiwVariant* ret = NULL; + if( iBitmap8.Length() ) + { + ret = BitmapFromLiwL( iBitmap8 ); + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TLiwVariant* CHnMdValueImage::MaskL() + { + TLiwVariant* ret = NULL; + if( iMask8.Length() ) + { + ret = BitmapFromLiwL( iMask8 ); + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdValueImage::CreateKeysLC( RBuf8& aKeyBitmap, RBuf8& aBitmapIdBuf, + RBuf8& aKeyMask, RBuf8& aMaskIdBuf ) + { + CleanupClosePushL( aKeyBitmap ); + CleanupClosePushL( aKeyMask ); + aKeyBitmap.CreateL( iMifFile8.Length() + aBitmapIdBuf.Length() ); + aKeyBitmap.Copy( iMifFile8 ); + aKeyBitmap.Append( aBitmapIdBuf ); + aKeyMask.CreateL( iMifFile8.Length() + aMaskIdBuf.Length() ); + aKeyMask.Copy( iMifFile8 ); + aKeyMask.Append( aMaskIdBuf ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +//CGulIcon* CHnMdValueImage::GetIconL( +// const CLiwGenericParamList* aQueriesResultsList, TInt aPos ) +// { +// CGulIcon* gulIcon = NULL; +// +// iParamList = aQueriesResultsList; +// iPos = aPos; +// +// // only to set iImageSource, to be optimized +// SetImageSourceL(); +// +// TSize defaultSize( KDefaultIconSize, KDefaultIconSize ); +// +// CFbsBitmap* bitmap = NULL; +// CFbsBitmap* mask = NULL; +// +// MAknsSkinInstance* skin = AknsUtils::SkinInstance(); +// +// switch( iImageSource ) +// { +// case EImageSourceResource: +// { +// TInt bitmapId = 0; +// TInt maskId = 0; +// GetBitmapAndMaskIdL(bitmapId, maskId); +// if ( iMifFileName && bitmapId != KErrNotFound ) +// { +// AknsUtils::CreateIconL( +// skin, SkinIdL(), bitmap, mask, +// *iMifFileName, bitmapId, maskId ); +// } +// } +// break; +// default: +// { +// User::Panic( KMatrixPanic , 1 ); +// } +// } +// +// if ( EImageSourceUndefined != iImageSource ) +// { +// if ( EImageSourceFile != iImageSource ) +// { +// gulIcon = CGulIcon::NewL( bitmap, mask ); +// AknIconUtils::SetSize( mask, defaultSize ); +// AknIconUtils::SetSize( bitmap, defaultSize ); +// } +// else +// { +// gulIcon = CGulIcon::NewL( bitmap ); +// AknIconUtils::SetSize( bitmap, defaultSize ); +// } +// } +// +// return gulIcon; +// } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnmdvaluetext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdvaluetext.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,292 @@ +/* +* Copyright (c) 2007-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: +* +*/ + +#include <xmlengdom.h> +#include <liwservicehandler.h> +#include <hnmdbasekey.h> +#include <hnconvutils.h> + +#include "hnmdvaluetext.h" +#include "hnglobals.h" +#include "hnmdmodel.h" +#include "hnliwutils.h" +#include "hnutils.h" +#include "hnstringhandler.h" +#include "hnattributetext.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdValueText* CHnMdValueText::NewL( + const TXmlEngElement& aElement, THnMdCommonPointers* aCmnPtrs ) + { + CHnMdValueText* self = + new (ELeave)CHnMdValueText(); + CleanupStack::PushL(self); + self->ConstructL( aElement, aCmnPtrs ); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdValueText::ConstructL( const TXmlEngElement& aElement, + THnMdCommonPointers* aCmnPtrs ) + { + iCmnPtrs = aCmnPtrs; + + if ( !aElement.Name().Compare( KTextElementItem8 ) ) + { + // handle text node + HnUtils::SetAttributeL( aElement, KResourceAttrName8 , iResourceFile ); + HnUtils::SetAttributeL( aElement, KIdAttrName8 , iResourceId ); + HnUtils::SetAttributeL( aElement, KValueAttrName8 , iSimpleValue); + + if ( aElement.HasChildNodes() ) + { + iParameters = new(ELeave)CDesC8ArraySeg(1); + iCachedDesParameters = new(ELeave)CDesC16ArraySeg(1); + iCachedIntParameters = new(ELeave)CArrayFixSeg<TInt>(1); + // get child element from output and pass to set value + RXmlEngNodeList< TXmlEngElement > childElements; + CleanupClosePushL( childElements ); + aElement.GetChildElements( childElements ); + TInt amount = childElements.Count(); + + for (TInt i(0); i<amount; i++) + { + TXmlEngElement child = childElements.Next(); + RBuf8 tmp; + CleanupClosePushL(tmp); + HnUtils::SetAttributeL( child, KValueAttrName8 , tmp); + if (tmp.Length() > 0) + { + iParameters->AppendL( tmp ); + } + CleanupStack::PopAndDestroy( &tmp ); + } + CleanupStack::PopAndDestroy( &childElements ); + } + } + else + { + // it can accept element that have text define in element node + // or value attribute + if ( iSimpleValue.Length() == 0 ) + { + HnUtils::SetAttributeL( aElement, KValueAttrName8 , iSimpleValue ); + } + HnUtils::SetAttributeL(aElement, iSimpleValue); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdValueText::CHnMdValueText() + { + // No implementation required + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdValueText::~CHnMdValueText() + { + iSimpleValue.Close(); + iResourceFile.Close(); + iResourceId.Close(); + iCachedValue.Close(); + delete iParameters; + delete iCachedDesParameters; + delete iCachedIntParameters; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdValueText::FillParamsL( const CLiwGenericParamList* aQueryList, + TInt aPos, + CDesC16Array& aDesParams, + CArrayFix<TInt>& aNumericParams) + { + if (iParameters) + { + // remove old values + aDesParams.Reset(); + aNumericParams.Reset(); + + for (TInt i(0); i < iParameters->Count(); i++) + { + TLiwVariant value; + CleanupStack::PushL( + TCleanupItem( TLiwVariant::VariantCleanup , &value) ); + + HnLiwUtils::GetVariantL( *aQueryList, + iParameters->MdcaPoint(i), + aPos, + value ); + + if ( value.TypeId() == LIW::EVariantTypeTInt32 ) + { + aNumericParams.AppendL( value.AsTInt32() ); + } + else if ( value.TypeId() == LIW::EVariantTypeTUint ) + { + aNumericParams.AppendL( value.AsTUint() ); + } + else if ( value.TypeId() == LIW::EVariantTypeTBool ) + { + aNumericParams.AppendL( value.AsTBool() ); + } + else if ( value.TypeId() == LIW::EVariantTypeTTime ) + { + // PW add time formating + } + else if ( value.TypeId() != LIW::EVariantTypeNull ) + { + RBuf vbuf; + CleanupClosePushL(vbuf); + HnLiwUtils::VariantToStringL( value, vbuf ); + aDesParams.AppendL(vbuf); + CleanupStack::PopAndDestroy(&vbuf); + } + CleanupStack::PopAndDestroy(&value); + } + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdValueText::GetFromResourceFileL( + const CLiwGenericParamList* aParamList, TInt aPos, RBuf& aValue ) + { + TInt retFile(KErrNotFound); + TInt retId(KErrNotFound); + RBuf resourceFile; + RBuf resourceId; + + CleanupClosePushL(resourceFile); + CleanupClosePushL(resourceId); + + retFile = HnLiwUtils::GetStringL( *aParamList, iResourceFile, aPos, resourceFile ); + retId = HnLiwUtils::GetStringL( *aParamList, iResourceId, aPos, resourceId ); + if ( retFile != KErrBadDescriptor && retId != KErrBadDescriptor ) + { + RBuf resourceName; + CleanupClosePushL(resourceName); + resourceName.CreateL( resourceFile.Length()+ 1 + resourceId.Length() ); + // concatenate resource file with id, localization understands it + resourceName.Append(resourceFile); + resourceName.Append(KColon); + resourceName.Append(resourceId); + + FillParamsL( aParamList, aPos, *iCachedDesParameters, + *iCachedIntParameters); + + HnStringHandler::LocaliseL( aValue, resourceName, + iCachedDesParameters, iCachedIntParameters, iCmnPtrs ); + + CleanupStack::PopAndDestroy(&resourceName); + } + + CleanupStack::PopAndDestroy(&resourceId); + CleanupStack::PopAndDestroy(&resourceFile); + + return (retFile != KErrNone) ? retFile : retId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdValueText::GetSimpleValueL( + const CLiwGenericParamList* aParamList, TInt aPos, RBuf& /*aValue*/ ) + { + TInt ret(KErrNotFound); + RBuf vbuf; + CleanupClosePushL(vbuf); + + ret = HnLiwUtils::GetStringL( *aParamList, iSimpleValue, aPos, vbuf ); + if ( ret != KErrNotFound ) + { + FillParamsL( aParamList, aPos, *iCachedDesParameters, + *iCachedIntParameters); + + HnStringHandler::LocaliseL( iCachedValue, vbuf, iCachedDesParameters, + iCachedIntParameters, iCmnPtrs ); + } + CleanupStack::PopAndDestroy(&vbuf); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnMdValueText::GetL( + const CLiwGenericParamList* aParamList, TInt aPos, + TPtrC& aValue ) + { + TInt ret(KErrNone); + iCachedValue.Close(); + // first let's check resource file and id + if (iResourceFile.Length() > 0 && iResourceId.Length() > 0) + { + ret = GetFromResourceFileL(aParamList, aPos, iCachedValue); + } + // if still cached value is empty, let's try with simple value + if (iSimpleValue.Length() > 0 && iCachedValue.Length() == 0 ) + { + ret = GetSimpleValueL(aParamList, aPos, iCachedValue); + } + + aValue.Set(iCachedValue); + return ret; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttributeBase* CHnMdValueText::CreateAttributeL( + const CLiwGenericParamList* aQueriesResultsList, + TInt aPos ) + { + CHnAttributeText* attr = 0; + TPtrC val; + if( GetL(aQueriesResultsList, aPos, val) != KErrNotFound ) + { + attr = CHnAttributeText::NewLC(); + HBufC8* bufVal( HnConvUtils::StrToStr8LC( val ) ); + attr->SetValueL( *bufVal ); + + // clean up + CleanupStack::PopAndDestroy( bufVal ); + CleanupStack::Pop( attr ); + } + return attr; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnqueryresultcollector.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnqueryresultcollector.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,234 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <liwservicehandler.h> + +#include "hnqueryresultcollector.h" +#include "hnmdquery.h" +#include "hnmdqueries.h" +#include "hnconvutils.h" +#include "hnservicehandler.h" +#include "hnmdservice.h" +#include "hnmdservicecommand.h" + +using namespace LIW; + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnQueryResultCollector* CHnQueryResultCollector::NewL( + const CHnMdQueries& aQueries , const CLiwGenericParamList& aParams ) + { + CHnQueryResultCollector* self = NewLC( aQueries , aParams ); + CleanupStack::Pop( self ); + return self; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnQueryResultCollector* CHnQueryResultCollector::NewLC( + const CHnMdQueries& aQueries , const CLiwGenericParamList& aParams ) + { + CHnQueryResultCollector* self = + new ( ELeave ) CHnQueryResultCollector( aQueries , aParams ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnQueryResultCollector::CHnQueryResultCollector( + const CHnMdQueries& aQueries , + const CLiwGenericParamList& aParams) : CActive ( EPriorityStandard ), + iQueries( aQueries ), + iParams( aParams ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnQueryResultCollector::~CHnQueryResultCollector() + { + Cancel(); + delete iResults; + delete iCurrentQueryResults; + delete iSh; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnQueryResultCollector::ConstructL() + { + iResults = CLiwGenericParamList::NewL(); + iCurrentQueryResults = CLiwGenericParamList::NewL(); + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnQueryResultCollector::StartAsynchL( + MHnQueryResultCollectorNotification* aNotification ) + { + __ASSERT_DEBUG( aNotification , User::Panic( KMatrixPanic , 0) ); + iNotification = aNotification; + ResetL(); + if( iQueryIterator < iQueries.Count()) + { + ExecQueryAsynchL(); + } + else + { + iNotification->ResultsCollectedL( iResults ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnQueryResultCollector::ResetL() + { + iQueryIterator = 0; + iCurrentQueryResults->Reset(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnQueryResultCollector::DoCancel() + { + iCurrentQueryResults->Reset(); + delete iSh; + iSh = NULL; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnQueryResultCollector::NextQuery() + { + iQueryIterator++; + return iQueryIterator < iQueries.Count(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnQueryResultCollector::HandleQueryResultsL() + { + HBufC8* name8 = HnConvUtils::StrToStr8FastLC( + iQueries.Query( iQueryIterator ).NameSpace() ); + CLiwDefaultMap* map = CLiwDefaultMap::NewL(); + map->PushL(); + + TLiwGenericParam param; + param.PushL(); + for (TInt i = 0; i < iCurrentQueryResults->Count(); i++) + { + iCurrentQueryResults->AtL(i, param); + map->InsertL( param.Name(), param.Value() ); + param.Reset(); + } + + param.SetNameAndValueL( *name8, TLiwVariant( map) ); + iResults->AppendL(param); + + CleanupStack::PopAndDestroy( ¶m); + CleanupStack::PopAndDestroy( map); + CleanupStack::PopAndDestroy(name8); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnQueryResultCollector::RunL() + { + if ( !iStatus.Int() ) + { + HandleQueryResultsL(); + } + + if( NextQuery() ) + { + ExecQueryAsynchL(); + } + else + { + iNotification->ResultsCollectedL( iResults ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnQueryResultCollector::ExecQueryAsynchL() + { + __ASSERT_DEBUG( iQueryIterator < iQueries.Count() , + User::Panic( KMatrixPanic , 0) ); + //cancel any running evaulations + Cancel(); + ExecQueryL( iQueries.Query( iQueryIterator ) ); + SetActive(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnQueryResultCollector::ExecQueryL( CHnMdQuery& aQuery ) + { + CLiwGenericParamList* constructor + = aQuery.GetService().EvaluateConstructorL( iParams ); + CleanupStack::PushL( constructor ); + CLiwGenericParamList* command + = aQuery.GetService().EvaluateCommandL( iParams ); + CleanupStack::PushL( command ); + + delete iSh; + iSh = NULL; + iSh = CHnServiceHandler::NewL( + aQuery.GetService().GetServiceName(), + aQuery.GetService().GetInterfaceName(), + aQuery.GetService().GetCommand().GetCommandName(), + aQuery.GetService().GetCommand().GetCommandMode(), + constructor, + command ); + + CleanupStack::Pop( command ); + CleanupStack::Pop( constructor ); + + iSh->ExecuteL( *iCurrentQueryResults, iStatus ); + } + + + +// End of file diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnrepositoryobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnrepositoryobserver.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,913 @@ +/* +* 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: factory settings for active space +* +*/ + + +#include <centralrepository.h> +#include <menudebug.h> +#include <apadef.h> +#include <AknDef.hrh> +#include "hnrepositoryobserver.h" +#include "hnglobals.h" +#include "hnsuitemodelcontainer.h" +#include "hnsuitemodel.h" +#include "hnmdsuite.h" +#include "hnitemsorder.h" +#include "hnliwutils.h" +#include "hnmdbasekey.h" +#include "hnmdkeyfactory.h" +#include "hnconvutils.h" +#include "hnsuiteobserver.h" +#include "hnmdmodel.h" + +class CHnServiceHandler; +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryObserver::ConstructL( const TUid aRepositoryUid ) + { + iRepository = CRepository::NewL( aRepositoryUid ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryObserver::CHnRepositoryObserver( THnMdCommonPointers* aCmnPtrs ) + : iCmnPtrs(aCmnPtrs) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryObserver::CHnRepositoryObserver( THnMdCommonPointers* aCmnPtrs, TUint32 aId ) +: iId( aId ), iCmnPtrs(aCmnPtrs) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryObserver::~CHnRepositoryObserver() + { + if (iNotifyHandler) + iNotifyHandler->StopListening(); + delete iNotifyHandler; + delete iRepository; + } + + +// class CHnRepositoryWidgetTypeObserver +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryWidgetTypeObserver * CHnRepositoryWidgetTypeObserver::NewL( + THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid ) + { + CHnRepositoryWidgetTypeObserver * self = CHnRepositoryWidgetTypeObserver::NewLC( aCmnPtrs, aRepositoryUid ); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryWidgetTypeObserver * CHnRepositoryWidgetTypeObserver::NewLC( + THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid ) + { + CHnRepositoryWidgetTypeObserver * self = new (ELeave) CHnRepositoryWidgetTypeObserver( aCmnPtrs ); + CleanupStack::PushL(self); + self->ConstructL( aRepositoryUid ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryWidgetTypeObserver::ConstructL( const TUid aRepositoryUid ) + { + CHnRepositoryObserver::ConstructL( aRepositoryUid ); + iNotifyHandler = CCenRepNotifyHandler::NewL(*this, *iRepository ); + iNotifyHandler->StartListeningL(); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryWidgetTypeObserver::CHnRepositoryWidgetTypeObserver( THnMdCommonPointers* aCmnPtrs ) + : CHnRepositoryObserver( aCmnPtrs ) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryWidgetTypeObserver::~CHnRepositoryWidgetTypeObserver() + { + iWidgetSwitches.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryWidgetTypeObserver::HandleNotifyGeneric(TUint32 aId) + { + TRAP_IGNORE( HandleNotifyGenericL(aId) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryWidgetTypeObserver::HandleNotifyGenericL(TUint32 aId) + { + DEBUG(("_MM_:CHnRepositoryObserver::HandleNotifyGeneric IN")); + DEBUG(("\tID: %d",aId)); + THnSuiteWidgetType suiteState( EUnspecified ); + + iRepository->Get( aId, (int &) suiteState); + TInt id = iWidgetSwitches.Find(aId); + + if ( suiteState == EChangeWidget ) + { + iWidgetSwitches.AppendL(aId); + } + else if ( id != KErrNotFound ) + { + iWidgetSwitches.Remove(id); + return; + } + + CHnSuiteModel* lastSuiteModel = iCmnPtrs->iContainer->GetLastSuiteModel(); + TBuf <NCentralRepositoryConstants::KMaxUnicodeStringLength> suiteName; + if ( iRepository->Get( aId - 1, suiteName ) == KErrNone && lastSuiteModel + && lastSuiteModel->WidgetType() != suiteState ) + { + DEBUG16(("\t\tSuite Name: %S",&suiteName)); + lastSuiteModel->GetItemsOrder()->MarkSuiteUninitialized(); + + TInt32 suiteId = lastSuiteModel->CustomId(); + + CLiwGenericParamList* inParam = CLiwGenericParamList::NewL(); + CleanupStack::PushL( inParam ); + + CLiwDefaultMap* map = CLiwDefaultMap::NewLC(); + + map->InsertL( KGenreName8, TLiwVariant(suiteName) ); + map->InsertL( KId8, TLiwVariant(suiteId) ); + inParam->AppendL(TLiwGenericParam( KFilterElementItem8, TLiwVariant(map) )); + CleanupStack::PopAndDestroy( map ); + + iCmnPtrs->iModelEventObserver->HandleModelEventL( KReevaluateMdEvent, *inParam ); + + CleanupStack::PopAndDestroy( inParam ); + } + DEBUG(("_MM_:CHnRepositoryObserver::HandleNotifyGeneric OUT")); + } + + +// class CHnRepositoryShowFolderObserver +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryShowFolderObserver * CHnRepositoryShowFolderObserver::NewL( + THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid, const TUint32 aId ) + { + CHnRepositoryShowFolderObserver * self = CHnRepositoryShowFolderObserver::NewLC( aCmnPtrs, aRepositoryUid, aId ); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryShowFolderObserver * CHnRepositoryShowFolderObserver::NewLC( + THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid, const TUint32 aId ) + { + CHnRepositoryShowFolderObserver * self = new (ELeave) CHnRepositoryShowFolderObserver( aCmnPtrs, aId ); + CleanupStack::PushL(self); + self->ConstructL( aRepositoryUid ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryShowFolderObserver::ConstructL( const TUid aRepositoryUid ) + { + CHnRepositoryObserver::ConstructL( aRepositoryUid ); + TInt ret = iRepository->Create( iId, KBlank ); + iNotifyHandler = CCenRepNotifyHandler::NewL( + *this, *iRepository, + CCenRepNotifyHandler::EStringKey, iId ); + iNotifyHandler->StartListeningL(); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryShowFolderObserver::CHnRepositoryShowFolderObserver( THnMdCommonPointers* aCmnPtrs, TUint32 aId ) + : CHnRepositoryObserver( aCmnPtrs, aId ) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryShowFolderObserver::~CHnRepositoryShowFolderObserver() + { + delete iServiceHandler; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryShowFolderObserver::HandleNotifyString(TUint32 aId, const TDesC16& aNewValue ) + { + TRAP_IGNORE( HandleNotifyStringL(aId, aNewValue) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryShowFolderObserver::HandleNotifyStringL(TUint32 aId, const TDesC16& aNewValue) + { + DEBUG(("_MM_:CHnRepositoryShowFolderObserver::HandleNotifyStringL IN")); + DEBUG(("\tID: %d : %S", aId, &aNewValue)); + + //++Show Folder + if( aId == iId && aNewValue.Length()) + { + iNotifyType = 0; + ExtractCRKeyShowFolderName( aNewValue ); + + // iCRKeyFolderItemUid can contain mcs id or uid + // in case of uid it will be replaced whith id in HandleNotifyL callback + if( iCRKeyFolderItemUid.Length()>0 ) + { + if( iCRKeyFolderItemUid.FindF( KHexPrefix8 )==0 ) + { + iNotifyType |= EAPP_UID; + } + else + { + iNotifyType |= EAPP_ID; + } + } + + CHnMdBaseKey* inDataKey = HnMdKeyFactory::CreateL( + KInData8, KKeyTypeMap, KDefaultParentId8 ); + CleanupStack::PushL( inDataKey ); + + CHnMdBaseKey* filter( NULL ); + HBufC8* id( NULL ); + if ( iCRKeyFolderName.Length()>0 && !( iNotifyType & EAPP_UID ) ) + { + // app group name is known + // id is optional + id = HnConvUtils::NumToStr8LC( KRootId ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KType8, KKeyTypeString, KMenuFolder8 ) ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KIdParam, KKeyTypeInteger, *id ) ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KRecursiveSearch8, KKeyTypeBoolean, KStringTrue8 ) ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KFlatResult8, KKeyTypeBoolean, KStringTrue8 ) ); + + filter = HnMdKeyFactory::CreateL( + KFilter8, KKeyTypeMap, KStringTrue8 ); + CleanupStack::PushL( filter ); + filter->AddSubKeyL( HnMdKeyFactory::CreateL( KMcsAppGroupName8, KKeyTypeString, iCRKeyFolderName ) ); + filter->AddSubKeyL( HnMdKeyFactory::CreateL( KType8, KKeyTypeString, KMenuFolder8 ) ); + filter->AddSubKeyL( HnMdKeyFactory::CreateL( KHidden8, KKeyTypeBoolean, KStringFalse8 ) ); + } + else if( iNotifyType & EAPP_ID ) + { + // no app group name, id is known + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KType8, KKeyTypeString, KMenuApplication8 ) ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KIdParam, KKeyTypeInteger, iCRKeyFolderItemUid ) ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KParentOnly8, KKeyTypeBoolean, KStringTrue8 ) ); + } + else if( iNotifyType & EAPP_UID ) + { + // uid is known + // app group name is optional + id = HnConvUtils::NumToStr8LC( KRootId ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KType8, KKeyTypeString, KMenuFolder8 ) ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KIdParam, KKeyTypeInteger, *id ) ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KRecursiveSearch8, KKeyTypeBoolean, KStringTrue8 ) ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KFlatResult8, KKeyTypeBoolean, KStringTrue8 ) ); + + filter = HnMdKeyFactory::CreateL( + KFilter8, KKeyTypeMap, KStringTrue8 ); + CleanupStack::PushL( filter ); + filter->AddSubKeyL( HnMdKeyFactory::CreateL( KUid8, KKeyTypeInteger, iCRKeyFolderItemUid ) ); + filter->AddSubKeyL( HnMdKeyFactory::CreateL( KType8, KKeyTypeString, KMenuApplication8 ) ); + filter->AddSubKeyL( HnMdKeyFactory::CreateL( KHidden8, KKeyTypeBoolean, KStringFalse8 ) ); + } + else + { + // No app group name, no uid. Search for root. + id = HnConvUtils::NumToStr8LC( KRootId ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KType8, KKeyTypeString, KMenuFolder8 ) ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KIdParam, KKeyTypeInteger, *id ) ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KParentOnly8, KKeyTypeBoolean, KStringTrue8 ) ); + } + + RPointerArray< CHnMdBaseKey > data; + CleanupClosePushL( data ); + data.AppendL( inDataKey ); + if ( filter ) + { + data.AppendL( filter ); + } + + CHnMdBaseKey* serviceData = HnMdKeyFactory::CreateL( + KServiceContentName, KKeyTypeString, KMatrixMenuData ); + CleanupStack::PushL( serviceData ); + + RPointerArray< CHnMdBaseKey> constructor; + CleanupClosePushL( constructor ); + constructor.AppendL( serviceData ); + CLiwGenericParamList* constructorLiw = CLiwGenericParamList::NewLC(); + CLiwGenericParamList* commandLiw = CLiwGenericParamList::NewLC(); + HnLiwUtils::SetGenericParamListL( constructor, *constructorLiw ); + HnLiwUtils::SetGenericParamListL( data, *commandLiw ); + + TBuf8< KMaxLength > interface( KMCSDataSourceInterface8 ); + + delete iServiceHandler; + iServiceHandler = NULL; + iServiceHandler = CHnServiceHandler::NewL( + KMCSService8, interface, KCmdGetList8, + EServiceModeAsynchronous, constructorLiw, commandLiw ); + + CleanupStack::Pop( commandLiw ); + CleanupStack::Pop( constructorLiw ); + + iServiceHandler->ExecuteL( this ); + + CleanupStack::PopAndDestroy( &constructor ); + CleanupStack::PopAndDestroy( serviceData ); + CleanupStack::PopAndDestroy( &data ); + if( filter ) + { + CleanupStack::PopAndDestroy( filter ); + } + if( id ) + { + CleanupStack::PopAndDestroy( id ); + } + CleanupStack::PopAndDestroy( inDataKey ); + } + + DEBUG(("_MM_:CHnRepositoryShowFolderObserver::HandleNotifyStringL OUT")); + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryShowFolderObserver::ExtractCRKeyShowFolderName( const TDesC& aNewValue ) + { + DEBUG(( "_MM_:CHnRepositoryShowFolderObserver::ExtractCRKeyShowFolderName IN" )); + iCRKeyFolderName.Copy( KBlank ); + iCRKeyFolderItemUid.Copy( KBlank ); + + int keyValueLength = aNewValue.Length(); + if( keyValueLength ) + { + TApaAppGroupName folder; + TBuf<KTimeStampBufferLength + KUidStringLength + 1> tempBuf; + TBuf<KTimeStampBufferLength> timeStamp; + + TInt ret = aNewValue.Find( KComma ); + if( (ret == KErrNotFound )|| ( ret == ( keyValueLength-1 ) ) ) + { + DEBUG(( "_MM_:CHnRepositoryShowFolderObserver::ExtractCRKeyShowFolderName (bad CR key value input) OUT" )); + return; //bad CR key value input + } + if( ret>KApaMaxAppGroupName ) + { + return; + } + folder.Copy(aNewValue.Left(ret)); + if( aNewValue.Length()-ret > tempBuf.MaxLength() ) + { + return; + } + tempBuf.Copy(aNewValue.Mid( ret + 1 ) ); + + TInt posUid = tempBuf.Find( KComma ); + if ( KErrNotFound != posUid ) + { + if( posUid>KTimeStampBufferLength ) + { + return; + } + timeStamp.Copy( tempBuf.Left(posUid) ); + if( tempBuf.Length()-(posUid+1) > KUidStringLength ) + { + return; + } + iCRKeyFolderItemUid.Copy( tempBuf.Mid( posUid + 1 ) ); + } + else + { + if( tempBuf.Length()>KTimeStampBufferLength ) + { + return; + } + timeStamp.Copy( tempBuf ); + } + + TTime currentTime; + currentTime.HomeTime(); + TTimeIntervalSeconds interval; + + TTime timeStampTime; + ret = timeStampTime.Set(timeStamp); + + if(ret == KErrGeneral ) + { + DEBUG(( "_MM_:CHnRepositoryShowFolderObserver::ExtractCRKeyShowFolderName (bad timestamp) OUT" )); + return; // bad time stamp value + } + + ret = currentTime.SecondsFrom( timeStampTime, interval ); + + if( interval.Int() < 0 ) + {//negative timestamp is set ahead of current time...! + DEBUG(( "_MM_:CHnRepositoryShowFolderObserver::ExtractCRKeyShowFolderName (negative interval) OUT" )); + return; + } + + if(( interval.Int()) > KTimeStampCutOff ) + {//positive timestamp but more than 5 seconds + DEBUG(( "_MM_:CHnRepositoryShowFolderObserver::ExtractCRKeyShowFolderName (more than 5 seconds) OUT" )); + return; + } + else + { + iCRKeyFolderName.Copy(folder); + } + } + DEBUG(( "_MM_:CHnRepositoryShowFolderObserver::ExtractCRKeyShowFolderName OUT" )); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryShowFolderObserver::GetShowFolderL( TUint32 aFolderId ) + { + + CHnMdBaseKey* inDataKey = HnMdKeyFactory::CreateL( + KInData8, KKeyTypeMap, KDefaultParentId8 ); + CleanupStack::PushL( inDataKey ); + HBufC8* id = HnConvUtils::NumToStr8LC( aFolderId ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KType8, KKeyTypeString, KMenuFolder8 ) ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KIdParam, KKeyTypeInteger, *id ) ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KParentOnly8, KKeyTypeBoolean, KStringTrue8 ) ); + + RPointerArray< CHnMdBaseKey > data; + CleanupClosePushL( data ); + data.Append( inDataKey ); + + CHnMdBaseKey* serviceData = HnMdKeyFactory::CreateL( + KServiceContentName, KKeyTypeString, KMatrixMenuData ); + CleanupStack::PushL( serviceData ); + + RPointerArray< CHnMdBaseKey> constructor; + CleanupClosePushL( constructor ); + constructor.Append( serviceData ); + CLiwGenericParamList* constructorLiw = CLiwGenericParamList::NewLC(); + CLiwGenericParamList* commandLiw = CLiwGenericParamList::NewLC(); + HnLiwUtils::SetGenericParamListL( constructor, *constructorLiw ); + HnLiwUtils::SetGenericParamListL( data, *commandLiw ); + + TBuf8< KMaxLength > interface( KMCSDataSourceInterface8 ); + + delete iServiceHandler; + iServiceHandler = NULL; + iServiceHandler = CHnServiceHandler::NewL( + KMCSService8, interface, KCmdGetList8, + EServiceModeAsynchronous, constructorLiw, commandLiw ); + + CleanupStack::Pop( commandLiw ); + CleanupStack::Pop( constructorLiw ); + + iServiceHandler->ExecuteL( this ); + + CleanupStack::PopAndDestroy( &constructor ); + CleanupStack::PopAndDestroy( serviceData ); + CleanupStack::PopAndDestroy( &data ); + CleanupStack::PopAndDestroy( id ); + CleanupStack::PopAndDestroy( inDataKey ); + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryShowFolderObserver::GetShowFolderGroupNameL() + { + + CHnMdBaseKey* inDataKey = HnMdKeyFactory::CreateL( + KInData8, KKeyTypeMap, KDefaultParentId8 ); + CleanupStack::PushL( inDataKey ); + HBufC8* id = HnConvUtils::NumToStr8LC( KRootId ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KType8, KKeyTypeString, KMenuFolder8 ) ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KIdParam, KKeyTypeInteger, *id ) ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KRecursiveSearch8, KKeyTypeBoolean, KStringTrue8 ) ); + inDataKey->AddSubKeyL( HnMdKeyFactory::CreateL( KFlatResult8, KKeyTypeBoolean, KStringTrue8 ) ); + + CHnMdBaseKey* filter = HnMdKeyFactory::CreateL( + KFilter8, KKeyTypeMap, KStringTrue8 ); + CleanupStack::PushL( filter ); + filter->AddSubKeyL( HnMdKeyFactory::CreateL( KMcsAppGroupName8, KKeyTypeString, iCRKeyFolderName ) ); + filter->AddSubKeyL( HnMdKeyFactory::CreateL( KType8, KKeyTypeString, KMenuFolder8 ) ); + filter->AddSubKeyL( HnMdKeyFactory::CreateL( KHidden8, KKeyTypeBoolean, KStringFalse8 ) ); + + RPointerArray< CHnMdBaseKey > data; + CleanupClosePushL( data ); + data.AppendL( inDataKey ); + if ( filter ) + { + data.AppendL( filter ); + } + + CHnMdBaseKey* serviceData = HnMdKeyFactory::CreateL( + KServiceContentName, KKeyTypeString, KMatrixMenuData ); + CleanupStack::PushL( serviceData ); + + RPointerArray< CHnMdBaseKey> constructor; + CleanupClosePushL( constructor ); + constructor.Append( serviceData ); + CLiwGenericParamList* constructorLiw = CLiwGenericParamList::NewLC(); + CLiwGenericParamList* commandLiw = CLiwGenericParamList::NewLC(); + HnLiwUtils::SetGenericParamListL( constructor, *constructorLiw ); + HnLiwUtils::SetGenericParamListL( data, *commandLiw ); + + TBuf8< KMaxLength > interface( KMCSDataSourceInterface8 ); + + delete iServiceHandler; + iServiceHandler = NULL; + iServiceHandler = CHnServiceHandler::NewL( + KMCSService8, interface, KCmdGetList8, + EServiceModeAsynchronous, constructorLiw, commandLiw ); + + CleanupStack::Pop( commandLiw ); + CleanupStack::Pop( constructorLiw ); + + iServiceHandler->ExecuteL( this ); + + CleanupStack::PopAndDestroy( &constructor ); + CleanupStack::PopAndDestroy( serviceData ); + CleanupStack::PopAndDestroy( &data ); + CleanupStack::PopAndDestroy( filter ); + CleanupStack::PopAndDestroy( id ); + CleanupStack::PopAndDestroy( inDataKey ); + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnRepositoryShowFolderObserver::HandleNotifyL( + TInt /*aCmdId*/, + TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/) + { + DEBUG(("_MM_:CHnRepositoryShowFolderObserver::HandleNotifyL IN")); + if( aEventId == KLiwEventCanceled ) + { + return KErrNotFound; + } + else + { + TInt pos( 0 ); + const TLiwGenericParam* first = aEventParamList.FindFirst( pos, KReturnValue8() ); + if( pos==KErrNotFound ) + { + return KErrNotFound; + } + + TInt count = first->Value().AsList()->Count(); + if( !( iNotifyType & ESECOND_NOTIFY ) ) //first notify + { + if( iCRKeyFolderName.Length()==0 ) + { + // no app group name + // it must be found using parent id + if ( count == 0 ) + { + return KErrNotFound; + } + iNotifyType |= ESECOND_NOTIFY; + TLiwVariant varId; varId.PushL(); + TLiwVariant varParentId; varParentId.PushL(); + + HnLiwUtils::GetVariantL( aEventParamList, KIdPath8, 0, varId ); + HnLiwUtils::GetVariantL( aEventParamList, KParentIdPath8, 0, varParentId ); + + TInt32 id( 0 ); + TInt32 parentId( 0 ); + varId.Get( id ); + iCRKeyFolderItemUid.Num( id ); + varParentId.Get( parentId ); + + CleanupStack::PopAndDestroy( &varParentId ); + CleanupStack::PopAndDestroy( &varId ); + + GetShowFolderL( parentId ); + return KErrNone; + } + else + { + // app group name is known + if( iNotifyType & EAPP_UID ) + { + // first get list was used to found id for app item + iNotifyType |= ESECOND_NOTIFY; + if ( count ) + { + // uid was given, id is found + // and replaces uid + TLiwVariant varId; varId.PushL(); + HnLiwUtils::GetVariantL( aEventParamList, KIdPath8, 0, varId ); + TInt32 id( 0 ); + varId.Get( id ); + iCRKeyFolderItemUid.Num( id ); + CleanupStack::PopAndDestroy( &varId ); + } + GetShowFolderGroupNameL(); + return KErrNone; + } + else + { + // intentionally empty + // no uid was given so only one get list is needed + } + } + } + if ( count == 0 ) + { + return KErrNotFound; + } + + TLiwVariant varId; varId.PushL(); + TLiwVariant varAppGroupName; varAppGroupName.PushL(); + TLiwVariant varSuiteName; varSuiteName.PushL(); + TLiwVariant varChildrenCount; varChildrenCount.PushL(); + + HnLiwUtils::GetVariantL( aEventParamList, KIdPath8, 0, varId ); + HnLiwUtils::GetVariantL( aEventParamList, KAppGroupNamePath8, 0, varAppGroupName ); + HnLiwUtils::GetVariantL( aEventParamList, KTitleNamePath8, 0, varSuiteName ); + HnLiwUtils::GetVariantL( aEventParamList, KChildrenCountPath8, 0, varChildrenCount ); + + CLiwGenericParamList* paramList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( paramList ); + + CLiwDefaultMap* map = CLiwDefaultMap::NewLC(); + + paramList->AppendL( TLiwGenericParam( KSuiteName8, + TLiwVariant( KFolderSuite ) ) ); + + map->InsertL( KSuiteName8, varSuiteName ); + map->InsertL( KFolderId8, varId ); + map->InsertL( KRemoveLocked8, TLiwVariant( KStringFalse8 ) ); + map->InsertL( KParentFolderId8, varId ); + map->InsertL( KTmpParentFolderId8, varId ); + map->InsertL( KMcsAppGroupName8, varAppGroupName ); + + paramList->AppendL( TLiwGenericParam( KParams8, TLiwVariant( map ) ) ); + + CleanupStack::PopAndDestroy( map ); + + while ( iCmnPtrs->iModel->LoadedSuitesCount() > 1 ) + { + CHnMdSuite* suite = iCmnPtrs->iModel->GetLastSuite(); + iCmnPtrs->iContainer->PopSuiteModelL( suite->SuiteName() ); + iCmnPtrs->iModel->DeleteLastSuite(); + } + + if ( iCmnPtrs->iContainer->GetLastSuiteModel()->CustomId() != varId.AsTInt64() ) + { + iCmnPtrs->iModelEventObserver->HandleModelEventL( KNewSuiteLoadedMdEvent, *paramList ); + iCmnPtrs->iContainer->GetLastSuiteModel()->RegisterSuiteObserverL( this ); + iCmnPtrs->iModel->QueueForeground( CHnMdModel::EWhenCurrentTopSuiteIsEvaluated ); + } + else + { + iCmnPtrs->iContainer->GetLastSuiteModel()->NotifyObserversL( ESuiteModelInitialized ); + TLex8 lex( iCRKeyFolderItemUid ); + TInt64 id (0); + TInt err = lex.Val( id ); + TLiwVariant varItemCustomId; varItemCustomId.PushL(); + varItemCustomId.Set( id ); + TLiwVariant varId; varId.PushL(); + varId.Set( iCmnPtrs->iContainer->GetLastSuiteModel()->CustomId() ); + CLiwGenericParamList* pl = CLiwGenericParamList::NewL(); + CleanupStack::PushL( pl ); + pl->AppendL( TLiwGenericParam( KSuiteCustomId8, varId ) ); + pl->AppendL( TLiwGenericParam( KItemCustomId8, varItemCustomId ) ); + iCmnPtrs->iModelEventObserver->HandleModelEventL( KSetFocusEvent, *pl ); + iCmnPtrs->iModelEventObserver->HandleModelEventL( KAppGainForeground, *pl ); + CleanupStack::PopAndDestroy( pl ); + CleanupStack::PopAndDestroy( &varId ); + CleanupStack::PopAndDestroy( &varItemCustomId ); + + iCRKeyFolderItemUid.Copy( KBlank ); + } + + iNotifyType = 0; + iCRKeyFolderName.Copy( KBlank ); + iRepository->Set( iId, KBlank ); + + CleanupStack::PopAndDestroy( paramList ); + CleanupStack::PopAndDestroy( &varChildrenCount ); + CleanupStack::PopAndDestroy( &varSuiteName ); + CleanupStack::PopAndDestroy( &varAppGroupName ); + CleanupStack::PopAndDestroy( &varId ); + } + + DEBUG(("_MM_:CHnRepositoryShowFolderObserver::HandleNotifyL OUT")); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryShowFolderObserver::HandleSuiteEventL ( THnCustomSuiteEvent aCustomSuiteEvent, + CHnSuiteModel *aModel ) + { + + if ( aCustomSuiteEvent == ESuiteModelInitialized && iCRKeyFolderItemUid.Length() > 0 ) + { + if (iCRKeyFolderItemUid.Length() > 0 ) + { + TLex8 lex( iCRKeyFolderItemUid ); + TInt64 id (0); + TInt err = lex.Val( id ); + TInt focus( KErrNotFound ); + // If suite is not null, then find matching item model. + CHnItemModel* itemModel = aModel->GetMatchingItemModelL( id, focus ); + aModel->SetSuiteHighlightL( focus ); + } + iCRKeyFolderItemUid.Copy( KBlank ); + aModel->UnregisterSuiteObserver( this ); + CLiwGenericParamList* pl = CLiwGenericParamList::NewL(); + CleanupStack::PushL( pl ); + iCmnPtrs->iModelEventObserver->HandleModelEventL( KAppGainForeground, *pl ); + CleanupStack::PopAndDestroy( pl ); + } + } + + +// class CHnRepositoryZoomObserver +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryZoomObserver * CHnRepositoryZoomObserver::NewL( + THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid, const TUint32 aId ) + { + CHnRepositoryZoomObserver * self = CHnRepositoryZoomObserver::NewLC( aCmnPtrs, aRepositoryUid, aId ); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryZoomObserver * CHnRepositoryZoomObserver::NewLC( + THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid, const TUint32 aId ) + { + CHnRepositoryZoomObserver * self = new (ELeave) CHnRepositoryZoomObserver( aCmnPtrs, aId ); + CleanupStack::PushL(self); + self->ConstructL( aRepositoryUid ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryZoomObserver::ConstructL( const TUid aRepositoryUid ) + { + CHnRepositoryObserver::ConstructL( aRepositoryUid ); + iNotifyHandler = CCenRepNotifyHandler::NewL( + *this, *iRepository, + CCenRepNotifyHandler::EIntKey, iId ); + InitializeL(); + iNotifyHandler->StartListeningL(); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryZoomObserver::CHnRepositoryZoomObserver( THnMdCommonPointers* aCmnPtrs, TUint32 aId ) + : CHnRepositoryObserver( aCmnPtrs, aId ) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryZoomObserver::~CHnRepositoryZoomObserver() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryZoomObserver::HandleNotifyInt(TUint32 aId, TInt aNewValue ) + { + TRAP_IGNORE( HandleNotifyIntL(aId, aNewValue) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryZoomObserver::HandleNotifyIntL(TUint32 aId, TInt aNewValue ) + { + DEBUG(("_MM_:CHnRepositoryZoomObserver::HandleNotifyStringL IN")); + DEBUG(("\tID: %d : %d", aId, aNewValue)); + + CLiwGenericParamList* paramList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( paramList ); + + if ( (TAknUiZoom)aNewValue == EAknUiZoomLarge ) + { + iCmnPtrs->iModelEventObserver->HandleModelEventL( KZoomLarge, *paramList ); + } + else if ( (TAknUiZoom)aNewValue == EAknUiZoomSmall ) + { + iCmnPtrs->iModelEventObserver->HandleModelEventL( KZoomSmall, *paramList ); + } + else + { + iCmnPtrs->iModelEventObserver->HandleModelEventL( KZoomNormal, *paramList ); + } + + CleanupStack::PopAndDestroy( paramList ); + DEBUG(("_MM_:CHnRepositoryZoomObserver::HandleNotifyStringL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryZoomObserver::InitializeL() + { + TInt value(0); + iRepository->Get( iId, value); + HandleNotifyIntL( iId, value ); + } +// End of File diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnsimplecondition.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnsimplecondition.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,397 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <liwservicehandler.h> +#include <liwvariant.h> + +#include "hnsimplecondition.h" +#include "hnsimpleconditionequal.h" +#include "hnsimpleconditiondifferent.h" +#include "hnsimpleconditiongreater.h" +#include "hnsimpleconditionhas.h" +#include "hnsimpleconditionhasnot.h" +#include "hnsimpleconditionsmaller.h" +#include "hnliwutils.h" +#include "hnglobals.h" +#include "hnconvutils.h" +#include "hnstringhandler.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnSimpleCondition* CHnSimpleCondition::NewL( TDesC8 & aElement ) + { + CHnSimpleCondition* self = CHnSimpleCondition::CreateImplementationL( aElement ); + CleanupStack::PushL(self); + self->ConstructL( aElement ); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnSimpleCondition* CHnSimpleCondition::CreateImplementationL( + TDesC8 & aElement ) + { + TPtrC8 buffer = aElement; + CHnSimpleCondition* ret = NULL; + if ( buffer.Find( HnLogicalRelations::KLogicalGreater8 )!= KErrNotFound ) + { + ret = new( ELeave ) CHnSimpleConditionGreater(); + } + else if ( buffer.Find( HnLogicalRelations::KLogicalDifferent8 ) != + KErrNotFound ) + { + ret = new( ELeave ) CHnSimpleConditionDifferent(); + } + else if ( buffer.Find( HnLogicalRelations::KLogicalEqual8 ) != + KErrNotFound ) + { + ret = new( ELeave ) CHnSimpleConditionEqual(); + } + else if ( buffer.Find( HnLogicalRelations::KLogicalLess8 )!= + KErrNotFound ) + { + ret = new( ELeave ) CHnSimpleConditionSmaller(); + } + else if ( buffer.Find( HnLogicalRelations::KLogicalHas8 )!= + KErrNotFound ) + { + ret = new( ELeave ) CHnSimpleConditionHas(); + } + else if ( buffer.Find( HnLogicalRelations::KLogicalHasNot8 )!= + KErrNotFound ) + { + ret = new( ELeave ) CHnSimpleConditionHasNot(); + } + else + { + User::Leave( KErrGeneral ); + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnSimpleCondition::CHnSimpleCondition() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnSimpleCondition::~CHnSimpleCondition() + { + iReferenceRight.Close(); + iReferenceLeft.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSimpleCondition::RemoveQuotes( RBuf8 & aValue ) + { + TInt quoPos = aValue.Locate('\''); + if( quoPos == 0 ) + { + aValue.Delete( 0 , 1 ); + aValue.Delete( aValue.Length() - 1, 1 ); + } + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSimpleCondition::ConstructL( TDesC8 & aElement ) + { + TPtrC8 buffer = aElement; + TInt pos = GetPositionL( buffer ); + ASSERT( pos ); + + RBuf8 tempbuf; + CleanupClosePushL( tempbuf ); + tempbuf.CreateL( buffer.Right( buffer.Length() - pos - SignLength() ) ); + iReferenceRight.Close(); + iReferenceRight.CreateL( tempbuf ); + iReferenceRight.Trim(); + CHnSimpleCondition::RemoveQuotes( iReferenceRight ); + + tempbuf.Close(); + tempbuf.CreateL( buffer.Left( pos ) ); + + iReferenceLeft.Close(); + iReferenceLeft.CreateL( tempbuf ); + iReferenceLeft.Trim(); + CHnSimpleCondition::RemoveQuotes( iReferenceLeft ); + + CleanupStack::PopAndDestroy( &tempbuf ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSimpleCondition::NormalizeVariantTypeDesL( TLiwVariant* aVar ) + { + if( aVar->TypeId() == LIW::EVariantTypeDesC8 ) + { + TPtrC8 left; + aVar->Get( left ); + HBufC * data = HnConvUtils::Str8ToStrFastLC( left ); + aVar->SetL( TLiwVariant( data ) ); + CleanupStack::PopAndDestroy( data ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TLiwVariant* CHnSimpleCondition::CheckTypes( TLiwVariant* aVarLeft, + TLiwVariant* aVarRight, LIW::TVariantTypeId aType1, + LIW::TVariantTypeId aType2 ) + { + LIW::TVariantTypeId varLeftId = aVarLeft->TypeId(); + LIW::TVariantTypeId varRightId = aVarRight->TypeId(); + + if (varLeftId == aType1 && varRightId == aType2) + { + return aVarLeft; + } + else if (varLeftId == aType2 && varRightId == aType1) + { + return aVarRight; + } + + return NULL; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSimpleCondition::NegotiateListL( TLiwVariant & aVar ) + { + ASSERT( aVar.TypeId() == LIW::EVariantTypeList ); + + CLiwList* temp = CLiwDefaultList::NewL(); + temp->PushL(); + aVar.Get( *temp ); + aVar.SetL( TLiwVariant( TInt32(temp->Count()) ) ); + CleanupStack::PopAndDestroy( temp ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSimpleCondition::NegotiateMapL( TLiwVariant & aVar ) + { + ASSERT( aVar.TypeId() == LIW::EVariantTypeMap ); + + CLiwDefaultMap* temp = CLiwDefaultMap::NewL(); + temp->PushL(); + aVar.Get( *temp ); + aVar.SetL( TLiwVariant( TInt32(temp->Count()) ) ); + CleanupStack::PopAndDestroy( temp ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSimpleCondition::NegotiateTUintL( TLiwVariant & aVar ) + { + ASSERT ( aVar.TypeId() == LIW::EVariantTypeDesC ); + + TPtrC temp; + TUint integer; + + aVar.Get(temp); + TLex val( temp ); + val.Val(integer); + aVar.Set( integer ); + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSimpleCondition::NegotiateTBoolL( TLiwVariant & aVar ) + { + ASSERT( aVar.TypeId() == LIW::EVariantTypeDesC ); + + TPtrC ptr; + aVar.Get( ptr ); + + if ( !HnStringHandler::CompareIgnoreCaseL( ptr, KStringTrue ) ) + { + aVar.Set( ETrue ); + } + else + { + aVar.Set( EFalse ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSimpleCondition::NegotiateTInt32L( TLiwVariant & aVar ) + { + ASSERT( aVar.TypeId() == LIW::EVariantTypeDesC + || aVar.TypeId() == LIW::EVariantTypeTUint ); + + if ( aVar.TypeId() == LIW::EVariantTypeDesC ) + { + TPtrC temp; + TInt32 integer; + + aVar.Get(temp); + TLex val( temp ); + val.Val(integer); + aVar.Set( integer ); + } + else if ( aVar.TypeId() == LIW::EVariantTypeTUint ) + { + TUint unsignedValue( 0U ); + aVar.Get( unsignedValue ); + if( unsignedValue <= static_cast<TUint>( KMaxTInt32 ) ) + { + aVar.Set( static_cast<TInt32>( unsignedValue ) ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSimpleCondition::NegotiateTInt64L( TLiwVariant & aVar ) + { + ASSERT(aVar.TypeId() == LIW::EVariantTypeDesC ); + + TPtrC temp; + TInt64 integer; + + aVar.Get(temp); + TLex val( temp ); + val.Val(integer); + aVar.Set( integer ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSimpleCondition::NegotiateTypesL( TLiwVariant* aVarLeft, + TLiwVariant* aVarRight ) + { + NormalizeVariantTypeDesL( aVarLeft ); + NormalizeVariantTypeDesL( aVarRight ); + + if (aVarLeft->TypeId() != aVarRight->TypeId()) + { + TLiwVariant* chosen( NULL ); + + chosen = CheckTypes( aVarLeft, aVarRight, LIW::EVariantTypeList, LIW::EVariantTypeDesC ); + if ( chosen ) + { + NegotiateListL( *chosen ); + return; + } + chosen = CheckTypes( aVarLeft, aVarRight, LIW::EVariantTypeMap, LIW::EVariantTypeDesC ); + if ( chosen ) + { + NegotiateMapL( *chosen ); + return; + } + chosen = CheckTypes( aVarLeft, aVarRight, LIW::EVariantTypeDesC, LIW::EVariantTypeTInt32 ); + if ( chosen ) + { + NegotiateTInt32L( *chosen ); + return; + } + chosen = CheckTypes( aVarLeft, aVarRight, LIW::EVariantTypeDesC, LIW::EVariantTypeTUint ); + if ( chosen ) + { + NegotiateTUintL( *chosen ); + return; + } + chosen = CheckTypes( aVarLeft, aVarRight, LIW::EVariantTypeDesC, LIW::EVariantTypeTInt64 ); + if ( chosen ) + { + NegotiateTInt64L( *chosen ); + return; + } + chosen = CheckTypes( aVarLeft, aVarRight, LIW::EVariantTypeDesC, LIW::EVariantTypeTBool ); + if ( chosen ) + { + NegotiateTBoolL( *chosen ); + return; + } + chosen = CheckTypes( aVarLeft, aVarRight, LIW::EVariantTypeTUint, LIW::EVariantTypeTInt32 ); + if ( chosen ) + { + NegotiateTInt32L( *chosen ); + return; + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnSimpleCondition::ResultL( const CLiwGenericParamList& aQueryResults, + TInt aPos ) + { + TBool ret( EFalse ); + + TLiwVariant varLeft; + varLeft.PushL(); + TInt err1 = HnLiwUtils::GetVariantL( aQueryResults, iReferenceLeft, aPos, varLeft ); + + TLiwVariant varRight; + varRight.PushL(); + TInt err2 = HnLiwUtils::GetVariantL( aQueryResults, iReferenceRight, aPos , varRight ); + + if ( err1 == KErrNone && err2 == KErrNone ) + { + NegotiateTypesL( &varLeft, &varRight); + ret = CheckCondition( varLeft, varRight ); + } + + CleanupStack::PopAndDestroy( &varRight ); + CleanupStack::PopAndDestroy( &varLeft ); + + return ret; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnsimpleconditiondifferent.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnsimpleconditiondifferent.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnsimplecondition.h" +#include "hnsimpleconditiondifferent.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnSimpleConditionDifferent::CheckCondition(TLiwVariant& aVarLeft, + TLiwVariant& aVarRight ) + { + return (aVarLeft != aVarRight); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnSimpleConditionDifferent::GetPositionL( const TDesC8& aBuffer ) + { + return aBuffer.Find( HnLogicalRelations::KLogicalDifferent8 ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnSimpleConditionDifferent::SignLength() + { + return HnLogicalRelations::KLogicalDifferent8().Length(); + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnsimpleconditionequal.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnsimpleconditionequal.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnsimplecondition.h" +#include "hnsimpleconditionequal.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnSimpleConditionEqual::CheckCondition( TLiwVariant& aVarLeft, + TLiwVariant& aVarRight ) + { + return (aVarLeft == aVarRight); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnSimpleConditionEqual::GetPositionL( const TDesC8& aBuffer ) + { + return aBuffer.Find( HnLogicalRelations::KLogicalEqual8 ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnSimpleConditionEqual::SignLength() + { + return HnLogicalRelations::KLogicalEqual8().Length(); + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnsimpleconditiongreater.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnsimpleconditiongreater.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnsimplecondition.h" +#include "hnsimpleconditiongreater.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnSimpleConditionGreater::CheckCondition( TLiwVariant& aVarLeft, + TLiwVariant& aVarRight ) + { + TBool ret = EFalse; + + LIW::TVariantTypeId varLId = aVarLeft.TypeId(); + LIW::TVariantTypeId varRId = aVarRight.TypeId(); + + if (varLId == varRId) + { + if( varLId == LIW::EVariantTypeTInt32 ) + { + ret = (aVarLeft.AsTInt32() > aVarRight.AsTInt32()); + } + else if( varLId == LIW::EVariantTypeTInt64 ) + { + ret = (aVarLeft.AsTInt64() > aVarRight.AsTInt64()); + } + else if( varLId == LIW::EVariantTypeTUint ) + { + ret = (aVarLeft.AsTUint() > aVarRight.AsTUint() ); + } + else if( varLId == LIW::EVariantTypeDesC ) + { + ret = ( aVarLeft.AsDes().Compare( aVarRight.AsDes()) > 0 ); + } + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnSimpleConditionGreater::GetPositionL( const TDesC8& aBuffer ) + { + return aBuffer.Find( HnLogicalRelations::KLogicalGreater8 ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnSimpleConditionGreater::SignLength() + { + return HnLogicalRelations::KLogicalGreater8().Length(); + } + + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnsimpleconditionhas.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnsimpleconditionhas.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnsimplecondition.h" +#include "hnsimpleconditionhas.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnSimpleConditionHas::CheckCondition( TLiwVariant& aVarLeft, + TLiwVariant& aVarRight ) + { + TBool ret = EFalse; + + LIW::TVariantTypeId varLId = aVarLeft.TypeId(); + LIW::TVariantTypeId varRId = aVarRight.TypeId(); + + if (varLId == varRId) + { + if( varLId == LIW::EVariantTypeDesC ) + { + TPtrC left = aVarLeft.AsDes(); + TPtrC right = aVarRight.AsDes(); + + if ( KErrNotFound != left.Find( right ) ) + { + ret = ETrue; + } + } + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnSimpleConditionHas::GetPositionL( const TDesC8& aBuffer ) + { + return aBuffer.Find( HnLogicalRelations::KLogicalHas8 ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnSimpleConditionHas::SignLength() + { + return HnLogicalRelations::KLogicalHas8().Length(); + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnsimpleconditionhasnot.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnsimpleconditionhasnot.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnsimplecondition.h" +#include "hnsimpleconditionhasnot.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnSimpleConditionHasNot::CheckCondition( TLiwVariant& aVarLeft, + TLiwVariant& aVarRight ) + { + TBool ret = EFalse; + + LIW::TVariantTypeId varLId = aVarLeft.TypeId(); + LIW::TVariantTypeId varRId = aVarRight.TypeId(); + + if (varLId == varRId) + { + if( varLId == LIW::EVariantTypeDesC ) + { + TPtrC left = aVarLeft.AsDes(); + TPtrC right = aVarRight.AsDes(); + + if ( KErrNotFound != left.Find( right ) ) + { + ret = ETrue; + } + } + } + return !ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnSimpleConditionHasNot::GetPositionL( const TDesC8& aBuffer ) + { + return aBuffer.Find( HnLogicalRelations::KLogicalHasNot8 ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnSimpleConditionHasNot::SignLength() + { + return HnLogicalRelations::KLogicalHasNot8().Length(); + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnsimpleconditionsmaller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnsimpleconditionsmaller.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnsimplecondition.h" +#include "hnsimpleconditionsmaller.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnSimpleConditionSmaller::CheckCondition( TLiwVariant& aVarLeft, + TLiwVariant& aVarRight ) + { + TBool ret = EFalse; + + LIW::TVariantTypeId varLId = aVarLeft.TypeId(); + LIW::TVariantTypeId varRId = aVarRight.TypeId(); + + if (varLId == varRId) + { + if( varLId == LIW::EVariantTypeTInt32 ) + { + ret = (aVarLeft.AsTInt32() < aVarRight.AsTInt32()); + } + else if( varLId == LIW::EVariantTypeTInt64 ) + { + ret = (aVarLeft.AsTInt64() < aVarRight.AsTInt64()); + } + else if( varLId == LIW::EVariantTypeTUint ) + { + ret = (aVarLeft.AsTUint() < aVarRight.AsTUint() ); + } + else if( varLId == LIW::EVariantTypeDesC ) + { + ret = ( aVarLeft.AsDes().Compare( aVarRight.AsDes()) < 0 ); + } + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnSimpleConditionSmaller::GetPositionL( const TDesC8& aBuffer ) + { + return aBuffer.Find( HnLogicalRelations::KLogicalLess8 ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnSimpleConditionSmaller::SignLength() + { + return HnLogicalRelations::KLogicalLess8().Length(); + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnstringhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnstringhandler.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnstringhandler.h" +#include "hnmdmodel.h" +#include "hnutils.h" +#include "hnmdlocalization.h" + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HnStringHandler::LocaliseL( RBuf& aDestination, RBuf& aSource, + THnMdCommonPointers* aCmnPtrs ) + { + HnStringHandler::LocaliseL( aDestination, aSource, NULL, NULL, aCmnPtrs); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HnStringHandler::LocaliseL( RBuf& aDestination, + RBuf& aSource, + CDesC16Array* aDesParams, + CArrayFix<TInt>* aIntParams, + THnMdCommonPointers* aCmnPtrs ) + { + CHnMdLocalization* localization(NULL); + if (aCmnPtrs) + { + localization = aCmnPtrs->iLocalization; + } + else + { + localization = THnMdCommonPointers::Static()->iLocalization; + } + + HBufC* buf = localization->LoadL( aSource, aDesParams, aIntParams ); + aDestination.Assign( buf); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt HnStringHandler::CompareIgnoreCaseL( const TDesC8& aLeft, + const TDesC8& aRight ) + { + TInt res( KErrGeneral ); + + RBuf8 left; + CleanupClosePushL( left ); + left.CreateL( aLeft.Length() ); + left.CopyUC( aLeft ); + + RBuf8 right; + CleanupClosePushL( right ); + right.CreateL( aRight.Length() ); + right.CopyUC( aRight ); + + res = left.Compare( right ); + + CleanupStack::PopAndDestroy( &left ); + CleanupStack::PopAndDestroy( &right ); + return res; + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt HnStringHandler::CompareIgnoreCaseL( const TDesC& aLeft, + const TDesC& aRight ) + { + TInt res( KErrGeneral ); + + RBuf left; + CleanupClosePushL( left ); + left.CreateL( aLeft.Length() ); + left.CopyUC( aLeft ); + + RBuf right; + CleanupClosePushL( right ); + right.CreateL( aRight.Length() ); + right.CopyUC( aRight ); + + res = left.Compare( right ); + + CleanupStack::PopAndDestroy( &right ); + CleanupStack::PopAndDestroy( &left ); + + return res; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnutils.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,247 @@ +/* +* Copyright (c) 2007-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: + * +*/ + + +#include <bautils.h> +//#include <mnaiwservices.h> +#include <liwservicehandler.h> +#include <e32hashtab.h> +#include <eikenv.h> + + +#include "hnutils.h" +#include "hnliwutils.h" +#include "hnmdservicecommand.h" +#include "hnservicehandler.h" +#include "hnglobals.h" +#include "hnmdbasekey.h" +#include "menudebug.h" +#include "hnconvutils.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HBufC8* HnUtils::ReadFileLC(const TDesC& aPath) + { + RFs& fs = CEikonEnv::Static()->FsSession(); + + RFile file; + User::LeaveIfError( file.Open(fs, aPath, EFileRead) ); + CleanupClosePushL( file ); + + TInt fileSize(0); + User::LeaveIfError( file.Size( fileSize ) ); + HBufC8* buf = HBufC8::NewLC( fileSize ); + TPtr8 bufPtr( buf->Des() ); + User::LeaveIfError( file.Read( bufPtr ) ); + + // clean up + CleanupStack::Pop(buf); + CleanupStack::PopAndDestroy(&file); + CleanupStack::PushL(buf); + + return buf; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HBufC8* HnUtils::ReadFileL( const TDesC& aPath ) + { + HBufC8* buf = ReadFileLC( aPath ); + CleanupStack::Pop( buf ); + return buf; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HBufC* HnUtils::LocateFileLC( const TDesC& aFile ) + { + HBufC* filePath = HBufC::NewLC(KMaxName); + RFs& fs = CEikonEnv::Static()->FsSession(); + + TDriveList driveList; + TChar driveLetter; + TInt driveNumber=EDriveY; + User::LeaveIfError(fs.DriveList(driveList)); + for(; driveNumber>=EDriveA-1; driveNumber-- ) + { + if (driveNumber==EDriveA-1) + driveNumber = EDriveZ; + if (driveList[driveNumber]) + { + User::LeaveIfError(fs.DriveToChar(driveNumber, driveLetter)); + filePath->Des().Zero(); + filePath->Des().Append(driveLetter); + filePath->Des().Append(KRscPath); + filePath->Des().Append(aFile); + + if (BaflUtils::FileExists(fs,*filePath)) + { + return filePath; + } + } + if (driveNumber == EDriveZ) + break; + } + + User::Leave(KErrNotFound); + return filePath; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HBufC* HnUtils::LocateNearestLanguageFileLC( const TDesC& aFile ) + { + _LIT( KExtRSC, ".r"); + if (aFile.Find( KExtRSC ) == (aFile.Length() - 4) ) + { + HBufC* filePath = HBufC::NewLC(KMaxName); + RFs& fs = CEikonEnv::Static()->FsSession(); + TDriveList driveList; + TChar driveLetter; + TInt driveNumber=EDriveY; + User::LeaveIfError(fs.DriveList(driveList)); + TFileName file; + for(; driveNumber>=EDriveA-1; driveNumber-- ) + { + if (driveNumber==EDriveA-1) + driveNumber = EDriveZ; + if (driveList[driveNumber]) + { + User::LeaveIfError(fs.DriveToChar(driveNumber, driveLetter)); + filePath->Des().Zero(); + filePath->Des().Append(driveLetter); + filePath->Des().Append(KRscPath); + filePath->Des().Append(aFile); + + file = *filePath; + BaflUtils::NearestLanguageFile( fs, file); + if( BaflUtils::FileExists( fs, file)) + { + CleanupStack::PopAndDestroy(filePath); + return file.AllocLC(); + } + } + if (driveNumber == EDriveZ) + break; + } + CleanupStack::PopAndDestroy(filePath); + } + return KNullDesC().AllocLC(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void HnUtils::SetAttributeL( const TXmlEngElement& aElement, + RBuf8& aAttribute ) + { + TPtrC8 v = aElement.Value(); + + if ( v.Length()> 0 ) + { + HBufC8* trimmed = v.AllocLC(); + trimmed->Des().Trim(); + aAttribute.Close(); + aAttribute.CreateL( trimmed->Length() ); + aAttribute.Copy( *trimmed ); + CleanupStack::PopAndDestroy( trimmed ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void HnUtils::SetAttributeL( const TXmlEngElement& aElement, + const TDesC8& aAttributeName, RBuf8& aValue8 ) + { + if ( aElement.HasAttributeL( aAttributeName ) ) + { + TPtrC8 value8 = + aElement.AttributeNodeL( aAttributeName ).Value(); + + aValue8.Close(); + aValue8.CreateL( value8.Length() ); + aValue8.Copy( value8 ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HBufC8 * HnUtils::GetColumnTextLC( TInt aColumn, + const TDesC8 & aSourceText, TChar aColumnSeparator ) + { + HBufC8 * ret = NULL; + TLex8 processedText ( aSourceText ); + + TInt column( 0 ); + processedText.Mark(); + + while ( !processedText.Eos() ) + { + if ( processedText.Get() == aColumnSeparator ) + { + if ( column == aColumn ) + { + processedText.UnGet(); + break; + } + processedText.Mark(); + column++; + } + } + + if ( aColumn <= column ) + { + ret = processedText.MarkedToken().AllocLC(); + } + + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt HnUtils::GetColumnTextColumnCount( + const TDesC8 & aSourceText, TChar aColumnSeparator ) + { + TInt ret(1); + TLex8 processedText(aSourceText); + while ( !processedText.Eos() ) + { + if (processedText.Get() == aColumnSeparator) + { + ret++; + } + } + return ret; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnxmlmodelcache.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnxmlmodelcache.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,204 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnxmlmodelcache.h" +#include "hnglobals.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TUint32 HBufCHashCache( HBufC* const & aBuf ) + { + return DefaultHash::Des16(*aBuf); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool HBufCIdentCache( HBufC* const & aL, HBufC* const & aR ) + { + return DefaultIdentity::Des16(*aL, *aR); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnXmlModelCache::CHnXmlModelCache() : iDocuments( &HBufCHashCache, + &HBufCIdentCache ) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelCache::ConstructL() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelCache::RemoveUnused() + { + // remove unnecessary (oldest and unused) xml cached documents + if(iDocuments.Count() > KXmlModelCacheMaxLength) + { + HBufC *suiteToRemove = iOrder[0]; + RXmlEngDocument* document = iDocuments.Find( suiteToRemove ); + document->Close(); + iDocuments.Remove(suiteToRemove); + iOrder.Remove(0); + delete suiteToRemove; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnXmlModelCache::AddL( const TDesC& aSuiteName, RXmlEngDocument& aDocument ) + { + HBufC* key = aSuiteName.AllocLC(); + iDocuments.InsertL( key, aDocument ); + CleanupStack::Pop( key ); + iOrder.AppendL( key ); + RemoveUnused(); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnXmlModelCache::IsCachedL( const TDesC& aSuiteName ) + { + HBufC* buf = aSuiteName.AllocLC(); + const RXmlEngDocument* res = iDocuments.Find( buf ); + CleanupStack::PopAndDestroy( buf ); + + if ( res ) + return ETrue; + else + return EFalse; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelCache::MoveToTopL( const TDesC & aSuiteName ) + { + TInt pos( KErrNotFound ); + + for ( TInt i(0); i < iOrder.Count(); i++ ) + { + if ( !iOrder[i]->Compare( aSuiteName ) ) + { + pos = i; + break; + } + } + + // if document was found and is not the latest in the array + if ( pos != KErrNotFound && ( pos != iOrder.Count() - 1 ) ) + { + HBufC *tmp = iOrder[ pos ]; + iOrder.Remove( pos ); + iOrder.AppendL( tmp ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelCache::GetL( const TDesC& aSuiteName, + RXmlEngDocument& aDocument ) + { + HBufC* buf = aSuiteName.AllocLC(); + const RXmlEngDocument* res = iDocuments.Find( buf ); + + MoveToTopL( aSuiteName ); + + if ( res ) + { + aDocument = *res; + } + + CleanupStack::PopAndDestroy( buf ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnXmlModelCache* CHnXmlModelCache::NewLC() + { + CHnXmlModelCache* self = new (ELeave) CHnXmlModelCache(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnXmlModelCache* CHnXmlModelCache::NewL() + { + CHnXmlModelCache* self = CHnXmlModelCache::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelCache::Reset() + { + THashMapIter<HBufC*, RXmlEngDocument> iter( iDocuments ); + while ( HBufC* const * ptr = iter.NextKey() ) + { + RXmlEngDocument* currentDocument = iter.CurrentValue(); + currentDocument->Close(); + delete *ptr; + } + iDocuments.Close(); + // Names have already been destroyed when destroying iDocuments so + // it is not necessay to destroy elements of the iOrder array. + iOrder.Close(); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnXmlModelCache::~CHnXmlModelCache() + { + Reset(); + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnxmlmodelprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnxmlmodelprovider.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,881 @@ +/* +* Copyright (c) 2007-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: +* +*/ + +#include <sysutil.h> +#include "hnxmlmodelprovider.h" +#include "hnxmlmodelcache.h" +#include "hnxmlsuitefilesreg.h" +#include "hnglobals.h" +#include "hnconvutils.h" +#include "menudebug.h" +#include "hnhelper.inl" +#include "hnmdmodel.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelProvider::ConstructL() + { + iDomImpl.OpenL(); + User::LeaveIfError(iDomParser.Open(iDomImpl)); + User::LeaveIfError(iFs.Connect()); + iFileMan = CFileMan::NewL(iFs); + + iPath.CreateL(KMaxPath); + User::LeaveIfError(iFs.PrivatePath(iPath)); + iPath.Insert(0, KDrive); + iPath.Append(KEntriesSuffix); + iCache = CHnXmlModelCache::NewL(); + + CActiveScheduler::Add( this); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelProvider::DoCancel() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelProvider::SynchronizationFinishedL() + { + ResetCache(); + THnMdCommonPointers &cmnPtr = *THnMdCommonPointers::Static(); + CHnMdModel* model = cmnPtr.iModel; + if ( iSuiteFilesUpdated ) + { + model->ReloadStackSuitesL( cmnPtr.iContainer ); + } + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelProvider::RunL() + { + if ( !iSuiteSetIterator ) + { + CheckDrivesL(); + iSuiteSetIterator = new ( ELeave ) THashSetIter<HBufC*>( iInstSuites ); + iSuiteSetIterator->Reset(); + iStatus = KRequestPending; + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + } + else if ( iSuiteSetIterator->Next() ) + { + TBool filesUpdated = CHnXmlSuiteFilesReg::SynchronizeL( + iFs, **(iSuiteSetIterator->Current()) ); + iSuiteFilesUpdated = ( iSuiteFilesUpdated || filesUpdated ); + iStatus = KRequestPending; + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + } + else + { + delete iSuiteSetIterator; + iSuiteSetIterator = NULL; + SynchronizationFinishedL(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnXmlModelProvider* CHnXmlModelProvider::NewL() + { + CHnXmlModelProvider* self = CHnXmlModelProvider::NewLC(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnXmlModelProvider* CHnXmlModelProvider::NewLC() + { + CHnXmlModelProvider* self = new (ELeave) CHnXmlModelProvider; + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnXmlModelProvider::CHnXmlModelProvider() : + CActive( EPriorityLow ), + iInstSuites(&HBuf16Hash, &HBuf16Ident), + iEventMap(&HBuf16Hash, &HBuf16Ident), + iSuiteSetIterator( NULL ) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnXmlModelProvider::~CHnXmlModelProvider() + { + Cancel(); + + delete iSuiteSetIterator; + delete iCache; + iDomParser.Close(); + iDomImpl.Close(); + delete iFileMan; + iFs.Close(); + iPath.Close(); + + // clean up eventmap + THashMapIter<HBufC*, TInt> iter(iEventMap); + while (HBufC* const * ptr = iter.NextKey()) + { + delete *ptr; + } + iEventMap.Close(); + + THashSetIter<HBufC*> iterSuites(iInstSuites); + while ( iterSuites.Next()) + { + delete *iterSuites.Current(); + } + iInstSuites.Close(); + + } + +#ifdef _DEBUG +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelProvider::LogEventMapping( + const RHashMap<HBufC*, TInt>& aEventMap) + { + DEBUG(("\t_MM_: CHnXmlModelProvider::LogEventMapping IN")); + RFs fs; + if ( !fs.Connect() ) + { + RFile logFile; + if ( !logFile.Replace( fs, KEventMapLogFile, EFileWrite ) ) + { + // first line + TBuf8<256> buf1; + buf1.Append( _L8("EventName") ); + buf1.Append( _L8("\t") ); + buf1.Append( _L8("EventId") ); + buf1.Append( _L8("\n") ); + logFile.Write( 0, buf1 ); + THashMapIter<HBufC*, TInt> iter( aEventMap ); + while ( HBufC* const * ptr = iter.NextKey() ) + { + TInt *v = iter.CurrentValue(); + TBuf8<256> buf2; + buf2.Append( (*ptr)->Des() ); + buf2.Append( _L8("\t") ); + buf2.AppendNum( *v ); + buf2.Append( _L8("\n") ); + TInt size ( 0 ); + logFile.Size( size ); + logFile.Write( size, buf2 ); + } + logFile.Close(); + } + fs.Close(); + } + DEBUG(("\t_MM_: CHnXmlModelProvider::LogEventMapping OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelProvider::LogSuiteModel( const TDesC& aName, + RXmlEngDocument& aDoc ) + { + DEBUG(("\t_MM_: CHnXmlModelProvider::LogSuiteModel IN")); + TBuf8<256> buf1; + TFileName logFileName; + logFileName.Copy( KSuiteLoadingLogFile ); + logFileName.Append( Kbackslash ); + logFileName.Append( aName ); + logFileName.Append( KXmlExt ); + TRAP_IGNORE( aDoc.SaveL( logFileName, aDoc.DocumentElement() ) ); + DEBUG(("\t_MM_: CHnXmlModelProvider::LogSuiteModel OUT")); + } +#endif + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +RXmlEngDocument CHnXmlModelProvider::ParseFileL( const TDesC& aPath ) + { + RBuf8 doc( ReadFileLC( aPath ) ); + CleanupClosePushL(doc); + + RXmlEngDocument xmlDoc; + CleanupClosePushL( xmlDoc ); + xmlDoc = ParseDocL(doc); + CleanupStack::Pop( &xmlDoc ); + + // clean up + CleanupStack::PopAndDestroy( &doc ); + + return xmlDoc; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +RXmlEngDocument CHnXmlModelProvider::ParseDocL( const TDesC8& aDoc ) + { + RXmlEngDocument doc; + CleanupClosePushL( doc ); + doc = iDomParser.ParseL( aDoc ); + CleanupStack::Pop( &doc ); + return doc; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HBufC8* CHnXmlModelProvider::ReadFileLC(const TDesC& aPath) + { + RFile file; + User::LeaveIfError( file.Open(iFs, aPath, EFileRead) ); + CleanupClosePushL( file ); + + TInt fileSize(0); + User::LeaveIfError( file.Size( fileSize ) ); + HBufC8* buf = HBufC8::NewLC( fileSize ); + TPtr8 bufPtr( buf->Des() ); + User::LeaveIfError( file.Read( bufPtr ) ); + + // clean up + CleanupStack::Pop(buf); + CleanupStack::PopAndDestroy(&file); + + return buf; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelProvider::ChangeEventsToIdsInChildrenL( + TXmlEngElement & aElement) + { + RXmlEngNodeList<TXmlEngElement> children; + CleanupClosePushL(children); + aElement.GetChildElements(children); + TInt amount = children.Count(); + for (TInt i(0); i < amount; i++) + { + TXmlEngElement child = children.Next(); + TPtrC8 childName = child.Name(); + + if (!childName.Compare(KEventName8) || !childName.Compare( + KMenuItemName8) ||!childName.Compare( KMenuItemSpecificName8 ) + || !child.Name().Compare(KMenuToolbar8)) + { + ChangeEventNamesToIdsL(child); + } + else if (!childName.Compare(KEditModeItem8)) + { + ChangeEventsToIdsInChildrenL(child); + } + } + + CleanupStack::PopAndDestroy(&children); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnXmlModelProvider::CollectSuiteL(const TDesC& aSuiteName, + RXmlEngDocument& aXmlDoc) + { + TInt err(KErrNotFound); + TBuf<KMaxPath> filePath; + TBuf<KMaxPath> KsuitePath; + KsuitePath.Zero(); + KsuitePath.Copy(iPath); + KsuitePath.Append(aSuiteName); + KsuitePath.Append(Kbackslash); + + filePath.Zero(); + filePath.Copy(KsuitePath); + filePath.Append(KSuiteDefFileName); + + RXmlEngDocument suiteDoc; + CleanupClosePushL(suiteDoc); + + suiteDoc = ParseFileL(filePath); + + // one suite per file + RXmlEngNodeList<TXmlEngElement> elements; + suiteDoc.DocumentElement().GetChildElements( elements ); + TXmlEngElement suiteElement; + while ( elements.HasNext() ) + { + suiteElement = elements.Next(); + TPtrC8 t = suiteElement.Name(); + if ( !suiteElement.Name().Compare( KSuiteElementName8 ) ) + { + ChangeEventsToIdsInChildrenL( suiteElement.AsElement() ); + break; + } + } + + aXmlDoc.OpenL( iDomImpl, suiteDoc.DocumentElement() ); + err = KErrNone; + + CleanupStack::PopAndDestroy( &suiteDoc ); + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnXmlModelProvider::SuiteExistsL( const TDesC& aSuite ) + { + TBuf<KMaxPath> filePath; + TBuf<KMaxPath> KsuitePath; + KsuitePath.Zero(); + KsuitePath.Copy( iPath ); + KsuitePath.Append( aSuite ); + KsuitePath.Append( Kbackslash ); + + filePath.Zero(); + filePath.Copy( KsuitePath ); + filePath.Append( KSuiteDefFileName ); + + return BaflUtils::FileExists( iFs, filePath ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelProvider::CollectItemsL( const TDesC& aSuiteName, + RXmlEngDocument& aXmlDoc ) + { + TBuf<KMaxPath> filePath; + TBuf<KMaxPath> KsuitePath; + KsuitePath.Zero(); + KsuitePath.Copy( iPath ); + KsuitePath.Append( aSuiteName ); + KsuitePath.Append( Kbackslash ); + CDir* fileList; + iFs.GetDir( KsuitePath, KEntryAttMaskSupported, ESortByName, fileList); + CleanupStack::PushL(fileList); + + //for each file with entries definitions + for( TInt i(0); i<fileList->Count(); i++ ) + { + TPtrC fileName = (*fileList)[i].iName; + + if(!fileName.Compare(KSuiteDefFileName)) + continue; + + filePath.Zero(); + filePath.Copy(KsuitePath); + filePath.Append(fileName); + + RXmlEngDocument itemDoc; + CleanupClosePushL( itemDoc ); + + TInt err( KErrNone ); + TRAP( err , itemDoc = ParseFileL(filePath) ); + if( !err ) + { + RXmlEngNodeList< TXmlEngElement > children; + CleanupClosePushL(children); + itemDoc.DocumentElement().GetChildElements(children); + + TPtrC8 itemGenre = + itemDoc.DocumentElement().AttributeNodeL(KGenreName8).Value(); + + TInt amount = children.Count(); + for( TInt i(0); i<amount; i++ ) + { + TXmlEngElement child = children.Next(); + TPtrC8 tempChildName = child.Name(); + // append localizations to root + if (!child.Name().Compare(KLocalizationName8)) + { + aXmlDoc.DocumentElement().AsElement().AppendChildL(child); + child.ReconcileNamespacesL(); + } + // append itmes to proper suite + else if (!child.Name().Compare(KItemName8) ) + { + // go througs item's children to change event names to ids + ChangeEventsToIdsInChildrenL(child); + + // edit_mode item + RXmlEngNodeList< TXmlEngElement > editModeItems; + CleanupClosePushL( editModeItems ); + child.GetChildElements( editModeItems ); + TInt count = editModeItems.Count(); + for ( TInt ic( 0 ); ic < count; ic++ ) + { + TXmlEngElement editModeItem = editModeItems.Next(); + if ( !editModeItem.Name().Compare( KEditModeItem8 )) + { + editModeItem.AddNewAttributeL(KSuiteElementName8, + itemGenre); + } + } + CleanupStack::PopAndDestroy(&editModeItems); + // edit_mode items - end + + RXmlEngNodeList<TXmlEngElement> suites; + CleanupClosePushL(suites); + aXmlDoc.DocumentElement().GetChildElements(suites); + TInt amountSuites = suites.Count(); + for (TInt i(0); i < amountSuites; i++) + { + TXmlEngElement childSuite = suites.Next(); + TPtrC8 tempName = child.Name(); + //find suite + if (!childSuite.Name().Compare(KTitleName8)) + { + TPtrC8 suiteGenre = childSuite.AttributeNodeL( + KGenreName8).Value(); + + //find proper suite to append item + if (!suiteGenre.Compare(itemGenre)) + { + child.AddNewAttributeL(KSuiteElementName8, + itemGenre); + childSuite.AppendChildL(child); + } + } + } + aXmlDoc.DocumentElement().ReconcileNamespacesL(); + CleanupStack::PopAndDestroy( &suites ); + } + } + CleanupStack::PopAndDestroy( &children ); + } + CleanupStack::PopAndDestroy( &itemDoc ); + } + + CleanupStack::PopAndDestroy(fileList); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnXmlModelProvider::GetNewEventId( HBufC* aEventName ) + { + TInt res( KErrGeneral ); + + if ( !aEventName->Compare( KKeyEmpty ) ) + { + res = KKeyIdEmpty; + } + else if ( !aEventName->Compare( KKeySelect ) ) + { + res = KKeyIdSelect; + } + else if ( !aEventName->Compare( KKeySelect2 ) ) + { + res = KKeyIdSelect2; + } + else if ( !aEventName->Compare( KKeySelect3 ) ) + { + res = KKeyIdSelect3; + } + else if ( !aEventName->Compare( KKeyCall ) ) + { + res = KKeyIdCall; + } + else if ( !aEventName->Compare( KKeyClear ) ) + { + res = KKeyIdClear; + } + else if ( !aEventName->Compare( KKeyMove ) ) + { + res = KKeyIdMove; + } + else if ( !aEventName->Compare( KKeyMoveInto ) ) + { + res = KKeyIdMoveInto; + } + else if ( !aEventName->Compare( KOnSuiteLoad ) ) + { + res = KIdSuiteLoad; + } + else if ( !aEventName->Compare( KOnSuiteUnLoad ) ) + { + res = KIdSuiteUnLoad; + } + else if ( !aEventName->Compare( KOnFocusGain ) ) + { + res = KIdFocusGain; + } + else if ( !aEventName->Compare( KOnFocusLost ) ) + { + res = KIdFocusLost; + } + else + { + THashMapIter<HBufC*, TInt> iter( iEventMap ); + res = KCustomKeyOffset; + + while ( TInt const * v = iter.NextValue() ) + { + if ( v != NULL && *v >= KCustomKeyOffset ) + { + res++; + } + } + } + + return res; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelProvider::ChangeEventNamesToIdsL( TXmlEngElement& aElement ) + { + if ( aElement.HasChildNodes() && ( !aElement.Name().Compare( KMenuItemName8 ) + || !aElement.Name().Compare( KMenuToolbar8 ) ) ) + { + + RXmlEngNodeList< TXmlEngElement > children; + CleanupClosePushL(children); + aElement.GetChildElements(children); + TInt count( children.Count() ); + for( TInt i( 0 ); i < count; i++ ) + { + TXmlEngElement element = children.Next(); + if ( !element.Name().Compare( KMenuItemName8 ) || + !element.Name().Compare( KMenuItemSpecificName8 ) || + !element.Name().Compare( KMenuButton8 ) ) + { + ChangeEventNamesToIdsL( element ); + } + } + CleanupStack::PopAndDestroy( &children ); + } + else if( aElement.AttributeValueL( KEventAttrName8 ).Length() ) + { + TBool bufferEmpty ( ETrue ); + TBuf8<KMaxPath> newEventIds; + + // loop through all event names + + // parsing events + HBufC* events = HnConvUtils::Str8ToStrLC( + aElement.AttributeValueL( KEventName8 ) ); + + TLex lex( events->Ptr() ); + TChar ch; + + TInt length( events->Length() ); + TInt cnt = 0; + while( ch = lex.Get() != 0 ) + { + cnt++; + while ( ( ch = lex.Peek() ) != '|' && cnt < length) + { + lex.Inc(); + cnt++; + } + + // iEventMap takes ownership of "en" + HBufC* en = HBufC::NewL( lex.MarkedToken().Length() ); + en->Des().Copy( lex.MarkedToken() ); + + TInt* resFind = iEventMap.Find( en ); + TInt res = -1; + if ( resFind == NULL ) + { + TInt newId( GetNewEventId( en ) ); + iEventMap.Insert( en, newId ); + res = newId; + } + else + { + res = *resFind; + delete en; + } + + if ( bufferEmpty ) + { + newEventIds.AppendNum( res ); + bufferEmpty = EFalse; + } + else + { + newEventIds.Append(KPipe); + newEventIds.AppendNum(res); + } + + lex.Inc(); + cnt++; + lex.Mark(); + if (cnt >= length) + break; + } + + TXmlEngAttr att = aElement.AttributeNodeL( KEventName8 ); + att.SetValueL( newEventIds ); + aElement.SetAttributeNodeL( att ); + + CleanupStack::PopAndDestroy( events ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnXmlModelProvider::SynchronizeSuitesL() + { + MMPERF(("CHnXmlModelProvider::SynchronizeSuitesL - START")); + iSuiteFilesUpdated = EFalse; + TBool refresh( EFalse ); + + if (IsActive()) + { + Cancel(); + } + + delete iSuiteSetIterator; + iSuiteSetIterator = NULL; + + iStatus = KRequestPending; + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + + MMPERF(("CHnXmlModelProvider::SynchronizeSuitesL - DONE")); + return refresh; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelProvider::ResetCache() + { + iCache->Reset(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelProvider::SetupSuitePathL() + { + iPath.Close(); + iPath.CreateL(KMaxPath); + User::LeaveIfError(iFs.PrivatePath(iPath)); + TChar drive; + TBuf<1> driveLetter; + + iFs.DriveToChar( EDriveC, drive ); + iPath.Insert(0, KColon ); + driveLetter.Append( drive ); + iPath.Insert(0, driveLetter ); + iPath.Append(KEntriesSuffix); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelProvider::SetupFailSafeSuitePathL() + { + iPath.Close(); + iPath.CreateL(KMaxPath); + User::LeaveIfError(iFs.PrivatePath(iPath)); + TChar drive; + TBuf<1> driveLetter; + + iFs.DriveToChar( EDriveZ, drive ); + iPath.Insert(0, KColon ); + driveLetter.Append( drive ); + iPath.Insert(0, driveLetter ); + iPath.Append(KSuitesDir); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnXmlModelProvider::ReloadModelL() + { + SynchronizeSuitesL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelProvider::CreateModelL(const TDesC& aSuiteName, + RXmlEngDocument& aXmlDoc ) + { + MMPERF( ( "CHnXmlModelProvider::CreateModelL IN") ); + MMPERF( ( " Suite name: %S", &aSuiteName ) ); + + TBool suiteCollected = EFalse; + + SetupSuitePathL(); + TRAPD( failSafeErr, suiteCollected = CollectSuiteL( aSuiteName, aXmlDoc )); + if (failSafeErr) + { + SetupFailSafeSuitePathL(); + suiteCollected = CollectSuiteL( aSuiteName, aXmlDoc ); + } + + if ( !suiteCollected ) + { + MMPERF(("CHnXmlModelProvider::CreateModelL - suite collected")); + CollectItemsL( aSuiteName, aXmlDoc ); + MMPERF(("CHnXmlModelProvider::CreateModelL - items collected")); + } + MMPERF( ( "CHnXmlModelProvider::CreateModelL OUT") ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnXmlModelProvider::GetModelL( + const TDesC& aSuiteName, RXmlEngDocument& aXmlDoc ) + { + if ( !iCache->IsCachedL( aSuiteName ) ) + { + RXmlEngDocument newXmlDoc; + CleanupClosePushL( newXmlDoc ); + + CreateModelL( aSuiteName, newXmlDoc ); + + #ifdef _DEBUG + DEBUG(("_MM_:CHnXmlModelProvider::GetModelL _DEBUG IN")); + LogEventMapping( iEventMap ); + LogSuiteModel( aSuiteName, newXmlDoc ); + DEBUG(("_MM_:CHnXmlModelProvider::GetModelL _DEBUG OUT")); + #endif + + // cache takes ownership of the suite name and the document + iCache->AddL( aSuiteName, newXmlDoc ); + + CleanupStack::Pop( &newXmlDoc ); + } + + iCache->GetL( aSuiteName, aXmlDoc ); + + return KErrNone; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelProvider::SearchPathForSuitesL( const TDesC& aPath ) + { + CDir* fileList = NULL; + iFs.GetDir( aPath, KEntryAttMaskSupported, ESortByName, fileList ); + if ( fileList ) + { + CleanupStack::PushL( fileList ); + for( TInt i( 0 ); i < fileList->Count(); i++ ) + { + if ( (*fileList)[ i ].IsDir() ) + { + HBufC* suiteName = (*fileList)[i].iName.AllocLC(); + if ( !iInstSuites.Find(suiteName) ) + { + iInstSuites.InsertL( suiteName ); + CleanupStack::Pop(suiteName); + } + else + { + CleanupStack::PopAndDestroy(suiteName); + } + } + } + CleanupStack::PopAndDestroy( fileList ); + } + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlModelProvider::CheckDrivesL() + { + TDriveList driveList; + User::LeaveIfError( iFs.DriveList( driveList ) ); + + TFixedArray< TInt, KMaxDrives > driveSearchOrder( KDriveSearchOrder, KMaxDrives ); + for(TInt iterator(0); iterator < driveSearchOrder.Count(); iterator++ ) + { + if ( driveList[ driveSearchOrder[ iterator ] ] ) + { + TBuf<KMaxPath> filePath; + + TChar driveLetter; + User::LeaveIfError( iFs.DriveToChar( driveSearchOrder[ iterator ], driveLetter ) ); + + TBuf< KSingleChar > driveLetterConst; + driveLetterConst.Append( driveLetter ); + User::LeaveIfError( iFs.PrivatePath( filePath ) ); + filePath.Insert( 0, driveLetterConst ); + filePath.Insert( 1, KColon ); + filePath.Append( KSuitesDir ); + + SearchPathForSuitesL( filePath ); + } + } + + SearchPathForSuitesL( iPath ); + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/src/hnxmlsuitefilesreg.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnxmlsuitefilesreg.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,290 @@ +/* +* Copyright (c) 2007-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: +* Version : %version: 9 % << Don't touch! Updated by Synergy at check-out. +* +*/ + +#include <sysutil.h> +#include "hnxmlsuitefilesreg.h" +#include "hnglobals.h" +#include "hnconvutils.h" +#include "menudebug.h" +#include "hnhelper.inl" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnXmlSuiteFilesReg::SynchronizeL( RFs & aFs, const TDesC &aSuiteName ) + { + CHnXmlSuiteFilesReg* self = new (ELeave) CHnXmlSuiteFilesReg( aFs ); + CleanupStack::PushL(self); + self->ConstructL( aSuiteName ); + TBool ret = self->SynchronizeSuiteFilesL(); + CleanupStack::PopAndDestroy( self ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnXmlSuiteFilesReg::~CHnXmlSuiteFilesReg() + { + iSuiteName.Close(); + DestroySuiteFilesMaps(); + delete iFileMan; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnXmlSuiteFilesReg::CHnXmlSuiteFilesReg( RFs & aFs ) : iFs(aFs), + iSuiteFiles(&TDesC16Hash, &TDesC16Ident) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HBufC* CHnXmlSuiteFilesReg::GetSuiteInstallPathL() + { + TBuf<KMaxPath> installPath; + User::LeaveIfError( iFs.PrivatePath(installPath) ); + TChar drive; + TBuf<1> driveLetter; + iFs.DriveToChar( EDriveC, drive ); + installPath.Insert(0, KColon ); + driveLetter.Append( drive ); + installPath.Insert(0, driveLetter ); + installPath.Append(KEntriesSuffix); + installPath.Append( iSuiteName ); + installPath.Append( Kbackslash ); + return installPath.AllocL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlSuiteFilesReg::ConstructL( const TDesC &aSuiteName ) + { + iSuiteName.CreateL( aSuiteName ); + iFileMan = CFileMan::NewL(iFs); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlSuiteFilesReg::DestroySuiteFilesMaps() + { + DestroyMapValue( iSuiteFiles ); + iSuiteFiles.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HBufC* CHnXmlSuiteFilesReg::GetSuiteImportDirL( TInt aDriveNumber ) const + { + TBuf<KMaxPath> outputDir; + + TChar driveLetter; + User::LeaveIfError( iFs.DriveToChar( aDriveNumber, driveLetter ) ); + + TBuf< KSingleChar > driveLetterConst; + driveLetterConst.Append( driveLetter ); + + User::LeaveIfError( iFs.PrivatePath( outputDir ) ); + + outputDir.Insert( 0, driveLetterConst ); + outputDir.Insert( 1, KColon ); + outputDir.Append( KSuitesDir ); + outputDir.Append( iSuiteName ); + outputDir.Append( Kbackslash ); + + return outputDir.AllocL(); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlSuiteFilesReg::SearchDrivesForSuiteFilesL() + { + DestroySuiteFilesMaps(); + + TDriveList driveList; + User::LeaveIfError( iFs.DriveList( driveList ) ); + TFixedArray< TInt, KMaxDrives > driveSearchOrder( KDriveSearchOrder, KMaxDrives ); + + for(TInt iterator(0); iterator < driveSearchOrder.Count(); iterator++ ) + { + if ( driveList[ driveSearchOrder[ iterator ] ] ) + { + RBuf filePath( GetSuiteImportDirL( driveSearchOrder[ iterator ] ) ); + CleanupClosePushL( filePath ); + SearchDirForSuiteFilesL(filePath); + CleanupStack::PopAndDestroy( &filePath ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlSuiteFilesReg::SearchDirForSuiteFilesL( const TDesC& aSuitePath ) + { + CDir* fileList = NULL; + if (!iFs.GetDir( aSuitePath, KEntryAttMaskSupported, ESortByName, fileList )) + { + CleanupStack::PushL( fileList ); + for( TInt i( 0 ); i < fileList->Count(); i++ ) + { + if (! (*fileList)[i].IsDir() ) + { + AddSuiteFileToMapL( aSuitePath, (*fileList)[i] ); + } + } + CleanupStack::PopAndDestroy( fileList ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnXmlSuiteFilesReg::AddSuiteFileToMapL( const TDesC& aDir, const TEntry& aFile ) + { + THnFileInfo fileInfo = { aFile.iName, aDir, aFile.iModified, aFile.iSize }; + fileInfo.iFilePath.Append( aFile.iName ); + + THnFileInfo** existingFileInfo = iSuiteFiles.Find( &aFile.iName ); + + TInt newFileDrive( KErrNotFound ); + iFs.CharToDrive( fileInfo.iFilePath[0], newFileDrive ); + + TBool newerThanExisting( EFalse ); + TInt existingFileDrive( KErrNotFound ); + if ( existingFileInfo ) + { + iFs.CharToDrive( (*existingFileInfo)->iFilePath[0], existingFileDrive); + newerThanExisting = + (*existingFileInfo)->iLastModified < fileInfo.iLastModified && + newFileDrive != EDriveZ; + } + + if ( !existingFileInfo || newerThanExisting || existingFileDrive == EDriveZ ) + { + if( existingFileInfo ) + { + iSuiteFiles.Remove( &aFile.iName ); + } + THnFileInfo* fileInfoPointer = new (ELeave) THnFileInfo( fileInfo ); + iSuiteFiles.InsertL( &fileInfo.iFileName, fileInfoPointer ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnXmlSuiteFilesReg::CalculateCurrentSuiteSizeL() + { + RBuf suiteInstallDir( GetSuiteInstallPathL() ); + CleanupClosePushL( suiteInstallDir ); + CDir* suiteFileList; + iFs.GetDir( suiteInstallDir, KEntryAttMaskSupported, ESortByName, suiteFileList); + CleanupStack::PushL(suiteFileList); + + TInt suiteSize(0); + for( TInt i(0); suiteFileList && i< suiteFileList->Count(); i++ ) + { + suiteSize+= (*suiteFileList)[i].iSize; + } + CleanupStack::PopAndDestroy( suiteFileList ); + CleanupStack::PopAndDestroy( &suiteInstallDir ); + return suiteSize; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnXmlSuiteFilesReg::CalculateSynchronizationSuiteSize() + { + TInt retSize( 0 ); + + THashMapIter< const TDesC*, THnFileInfo* > iter( iSuiteFiles ); + + while ( iter.NextKey() ) + { + const THnFileInfo& fileInfo = **(iter.CurrentValue()); + retSize += fileInfo.iSize; + } + + return retSize; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnXmlSuiteFilesReg::SynchronizeSuiteFilesL() + { + TBool ret( EFalse ); + SearchDrivesForSuiteFilesL(); + + TInt spaceNeeded = CalculateSynchronizationSuiteSize() - + CalculateCurrentSuiteSizeL(); + + RBuf suiteInstallationDir( GetSuiteInstallPathL() ); + CleanupClosePushL( suiteInstallationDir ); + iFileMan->RmDir( suiteInstallationDir ); + if( iSuiteFiles.Count() && ( spaceNeeded < 0 || !SysUtil::DiskSpaceBelowCriticalLevelL( + &iFs, spaceNeeded , EDriveC ) ) ) + { + THashMapIter< const TDesC*, THnFileInfo* > iter( iSuiteFiles ); + iFs.MkDirAll( suiteInstallationDir ); + while( iter.NextKey() ) + { + const THnFileInfo& fileInfo = **(iter.CurrentValue()); + TBuf<KMaxPath> filePath( suiteInstallationDir ); + filePath.Append( fileInfo.iFileName ); + if( filePath.Compare( fileInfo.iFilePath ) ) + { + if( BaflUtils::FileExists( iFs, filePath ) ) + { + iFs.SetAtt( filePath, NULL, KEntryAttReadOnly ); + iFs.Delete( filePath ); + } + iFileMan->Copy( + fileInfo.iFilePath, + filePath, CFileMan::EOverWrite ); + ret = ETrue; + } + } + } + CleanupStack::PopAndDestroy( &suiteInstallationDir ); + return ret; + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/bwins/hnpresentationmodelu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/bwins/hnpresentationmodelu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,188 @@ +EXPORTS + ?GetMiddleSoftKey@CHnItemModel@@QAEPAVCHnButtonModel@@XZ @ 1 NONAME ; class CHnButtonModel * CHnItemModel::GetMiddleSoftKey(void) + ?GetMatchingItemModelL@CHnSuiteModel@@QAEPAVCHnItemModel@@_JAAH@Z @ 2 NONAME ; class CHnItemModel * CHnSuiteModel::GetMatchingItemModelL(long long, int &) + ?NewLC@CHnAttrImgProvSvgImage@@SAPAV1@ABVTDesC16@@@Z @ 3 NONAME ; class CHnAttrImgProvSvgImage * CHnAttrImgProvSvgImage::NewLC(class TDesC16 const &) + ?GetRootSuite@CHnSuitesStack@@QAEPAVCHnSuiteModel@@XZ @ 4 NONAME ; class CHnSuiteModel * CHnSuitesStack::GetRootSuite(void) + ??1CHnButtonModel@@UAE@XZ @ 5 NONAME ; CHnButtonModel::~CHnButtonModel(void) + ?Value@CHnAttributeBase@@UAEABVTDesC8@@XZ @ 6 NONAME ; class TDesC8 const & CHnAttributeBase::Value(void) + ?SetDimmed@CHnButtonModel@@QAEXH@Z @ 7 NONAME ; void CHnButtonModel::SetDimmed(int) + ?GetModelItemCount@CHnItemsOrder@@QAEHXZ @ 8 NONAME ; int CHnItemsOrder::GetModelItemCount(void) + ?SetEmptyTextL@CHnSuiteModel@@QAEXABVTDesC16@@@Z @ 9 NONAME ; void CHnSuiteModel::SetEmptyTextL(class TDesC16 const &) + ?IsActive@CHnSuiteModel@@QAEHXZ @ 10 NONAME ; int CHnSuiteModel::IsActive(void) + ?Get@CHnSuitesStack@@QAEPAVCHnSuiteModel@@H@Z @ 11 NONAME ; class CHnSuiteModel * CHnSuitesStack::Get(int) + ?SetActiveL@CHnSuiteModel@@QAEXH@Z @ 12 NONAME ; void CHnSuiteModel::SetActiveL(int) + ?IsItemMoveLocked@CHnSuiteModel@@QAEHH@Z @ 13 NONAME ; int CHnSuiteModel::IsItemMoveLocked(int) + ?NewL@CHnAttributeImage@@SAPAV1@XZ @ 14 NONAME ; class CHnAttributeImage * CHnAttributeImage::NewL(void) + ?CommandName@CHnActionModel@@QBEABVTDesC8@@XZ @ 15 NONAME ; class TDesC8 const & CHnActionModel::CommandName(void) const + ?SetServiceL@CHnActionModel@@QAEXABVTDesC8@@@Z @ 16 NONAME ; void CHnActionModel::SetServiceL(class TDesC8 const &) + ?SetBitmap@CHnAttributeImage@@QAEXPAVTLiwVariant@@@Z @ 17 NONAME ; void CHnAttributeImage::SetBitmap(class TLiwVariant *) + ?SetTemplateL@CHnSuiteModel@@QAEXABVTDesC8@@@Z @ 18 NONAME ; void CHnSuiteModel::SetTemplateL(class TDesC8 const &) + ?UpdateItemTemplateL@CHnSuiteModel@@QAEXH@Z @ 19 NONAME ; void CHnSuiteModel::UpdateItemTemplateL(int) + ?SuiteEvaluated@CHnItemsOrder@@QAEXXZ @ 20 NONAME ; void CHnItemsOrder::SuiteEvaluated(void) + ?Name@CHnAttributeBase@@QBEABVTDesC8@@XZ @ 21 NONAME ; class TDesC8 const & CHnAttributeBase::Name(void) const + ?SetCustomId@CHnItemModel@@QAEX_J@Z @ 22 NONAME ; void CHnItemModel::SetCustomId(long long) + ?CustomId@CHnItemModel@@QAE_JXZ @ 23 NONAME ; long long CHnItemModel::CustomId(void) + ??1CHnSuiteModel@@UAE@XZ @ 24 NONAME ; CHnSuiteModel::~CHnSuiteModel(void) + ?GetActions@CHnItemModel@@QAEPAV?$CArrayPtr@VCHnActionModel@@@@H@Z @ 25 NONAME ; class CArrayPtr<class CHnActionModel> * CHnItemModel::GetActions(int) + ?SetGulIcon@CHnIconHolder@@QAEXPAVCGulIcon@@@Z @ 26 NONAME ; void CHnIconHolder::SetGulIcon(class CGulIcon *) + ?SetValueL@CHnAttributeText@@QAEXABVTDesC8@@@Z @ 27 NONAME ; void CHnAttributeText::SetValueL(class TDesC8 const &) + ?GetItemIdAt@CHnItemsOrder@@QAEHHH@Z @ 28 NONAME ; int CHnItemsOrder::GetItemIdAt(int, int) + ?ClearAttributesL@CHnItemModel@@QAEXXZ @ 29 NONAME ; void CHnItemModel::ClearAttributesL(void) + ?NewLC@CHnAttrImgProvFileImage@@SAPAV1@ABVTDesC16@@@Z @ 30 NONAME ; class CHnAttrImgProvFileImage * CHnAttrImgProvFileImage::NewLC(class TDesC16 const &) + ?ExitMode@CHnSuiteModel@@QAE?AW4TExitMode@@XZ @ 31 NONAME ; enum TExitMode CHnSuiteModel::ExitMode(void) + ?ServiceMode@CHnActionModel@@QBE?AW4TServiceMode@@XZ @ 32 NONAME ; enum TServiceMode CHnActionModel::ServiceMode(void) const + ?GetIcon@CHnButtonModel@@QBEPAVCGulIcon@@XZ @ 33 NONAME ; class CGulIcon * CHnButtonModel::GetIcon(void) const + ?GetSuiteHighlight@CHnSuiteModel@@QAEHXZ @ 34 NONAME ; int CHnSuiteModel::GetSuiteHighlight(void) + ?PopSuiteModelL@CHnSuiteModelContainer@@QAEPAVCHnSuiteModel@@ABVTDesC16@@@Z @ 35 NONAME ; class CHnSuiteModel * CHnSuiteModelContainer::PopSuiteModelL(class TDesC16 const &) + ?NewL@CHnSuiteModelContainer@@SAPAV1@AAVMHnMdModelEventObserver@@AAVMHnControllerInterface@@@Z @ 36 NONAME ; class CHnSuiteModelContainer * CHnSuiteModelContainer::NewL(class MHnMdModelEventObserver &, class MHnControllerInterface &) + ?CommandLC@CHnActionModel@@QBEPAVCLiwGenericParamList@@XZ @ 37 NONAME ; class CLiwGenericParamList * CHnActionModel::CommandLC(void) const + ?InsertItemIdToL@CHnItemsOrder@@QAEXHHH@Z @ 38 NONAME ; void CHnItemsOrder::InsertItemIdToL(int, int, int) + ?SetBitmapId@CHnAttributeImage@@QAEXH@Z @ 39 NONAME ; void CHnAttributeImage::SetBitmapId(int) + ?RefreshMulModelL@CHnSuiteModel@@QAEXH@Z @ 40 NONAME ; void CHnSuiteModel::RefreshMulModelL(int) + ?UnregisterSuiteObserver@CHnSuiteModel@@QAEXPAVMHnSuiteObserver@@@Z @ 41 NONAME ; void CHnSuiteModel::UnregisterSuiteObserver(class MHnSuiteObserver *) + ?SetApplicationUid@CHnAttributeImage@@QAEXVTUid@@@Z @ 42 NONAME ; void CHnAttributeImage::SetApplicationUid(class TUid) + ?GetGulIcon@CHnIconHolder@@QBEPAVCGulIcon@@XZ @ 43 NONAME ; class CGulIcon * CHnIconHolder::GetGulIcon(void) const + ?Command@CHnMenuItemModel@@QAEHXZ @ 44 NONAME ; int CHnMenuItemModel::Command(void) + ?GetButton@CHnToolbarModel@@QBEPBVCHnButtonModel@@H@Z @ 45 NONAME ; class CHnButtonModel const * CHnToolbarModel::GetButton(int) const + ?SetNameL@CHnAttributeBase@@QAEXABVTDesC8@@@Z @ 46 NONAME ; void CHnAttributeBase::SetNameL(class TDesC8 const &) + ?GetSuiteModel@CHnSuiteModelContainer@@QAEPAVCHnSuiteModel@@ABVTDesC16@@@Z @ 47 NONAME ; class CHnSuiteModel * CHnSuiteModelContainer::GetSuiteModel(class TDesC16 const &) + ?SetFileNameSrc@CHnAttributeImage@@QAEXPAVHBufC16@@@Z @ 48 NONAME ; void CHnAttributeImage::SetFileNameSrc(class HBufC16 *) + ?PushL@CHnSuitesStack@@QAEHPAVCHnSuiteModel@@@Z @ 49 NONAME ; int CHnSuitesStack::PushL(class CHnSuiteModel *) + ?OfferHnEventL@CHnSuiteModelContainer@@QAEHHHPAVCLiwGenericParamList@@@Z @ 50 NONAME ; int CHnSuiteModelContainer::OfferHnEventL(int, int, class CLiwGenericParamList *) + ?RemoveLiwObjects@CHnSuiteModelContainer@@QAEXXZ @ 51 NONAME ; void CHnSuiteModelContainer::RemoveLiwObjects(void) + ?HasButtons@CHnToolbarModel@@QBEHXZ @ 52 NONAME ; int CHnToolbarModel::HasButtons(void) const + ?GetItemUid@CHnItemModel@@QAE?AVTUid@@XZ @ 53 NONAME ; class TUid CHnItemModel::GetItemUid(void) + ?AddItemL@CHnSuiteModel@@QAEXHPAVCHnItemModel@@HH@Z @ 54 NONAME ; void CHnSuiteModel::AddItemL(int, class CHnItemModel *, int, int) + ?GetDimmed@CHnButtonModel@@QBEHXZ @ 55 NONAME ; int CHnButtonModel::GetDimmed(void) const + ?GetItemsOrder@CHnSuiteModel@@QAEPAVCHnItemsOrder@@XZ @ 56 NONAME ; class CHnItemsOrder * CHnSuiteModel::GetItemsOrder(void) + ?PushNewSuiteModelL@CHnSuiteModelContainer@@QAEXABVTDesC16@@@Z @ 57 NONAME ; void CHnSuiteModelContainer::PushNewSuiteModelL(class TDesC16 const &) + ?Interface@CHnActionModel@@QBEABVTDesC8@@XZ @ 58 NONAME ; class TDesC8 const & CHnActionModel::Interface(void) const + ?GetAttribute@CHnItemModel@@QAEPAVCHnAttributeBase@@ABVTDesC8@@@Z @ 59 NONAME ; class CHnAttributeBase * CHnItemModel::GetAttribute(class TDesC8 const &) + ?SetInterfaceL@CHnActionModel@@QAEXABVTDesC8@@@Z @ 60 NONAME ; void CHnActionModel::SetInterfaceL(class TDesC8 const &) + ?HasNext@CHnMenuItemModel@@UAEHXZ @ 61 NONAME ; int CHnMenuItemModel::HasNext(void) + ?Type@CHnAttributeBase@@QAE?AW4TAttributeType@@XZ @ 62 NONAME ; enum TAttributeType CHnAttributeBase::Type(void) + ?RegisterSuiteObserverL@CHnSuiteModel@@QAEXPAVMHnSuiteObserver@@W4TThreadPriority@@@Z @ 63 NONAME ; void CHnSuiteModel::RegisterSuiteObserverL(class MHnSuiteObserver *, enum TThreadPriority) + ?GetItemModelsCount@CHnSuiteModel@@QAEHXZ @ 64 NONAME ; int CHnSuiteModel::GetItemModelsCount(void) + ?SetToolbarModel@CHnItemModel@@QAEXPAVCHnToolbarModel@@@Z @ 65 NONAME ; void CHnItemModel::SetToolbarModel(class CHnToolbarModel *) + ?SetServiceModeL@CHnActionModel@@QAEXW4TServiceMode@@@Z @ 66 NONAME ; void CHnActionModel::SetServiceModeL(enum TServiceMode) + ?SetMenuItemModel@CHnItemModel@@QAEXPAVCHnMenuItemModel@@@Z @ 67 NONAME ; void CHnItemModel::SetMenuItemModel(class CHnMenuItemModel *) + ?SetHelpTextL@CHnButtonModel@@QAEXABVTDesC16@@@Z @ 68 NONAME ; void CHnButtonModel::SetHelpTextL(class TDesC16 const &) + ?NewLC@CHnButtonModel@@SAPAV1@H@Z @ 69 NONAME ; class CHnButtonModel * CHnButtonModel::NewLC(int) + ??ACHnItemsOrder@@QAEHH@Z @ 70 NONAME ; int CHnItemsOrder::operator[](int) + ?ClearFlags@CHnItemModel@@QAEXXZ @ 71 NONAME ; void CHnItemModel::ClearFlags(void) + ?GetToolbarModel@CHnItemModel@@QBEPBVCHnToolbarModel@@XZ @ 72 NONAME ; class CHnToolbarModel const * CHnItemModel::GetToolbarModel(void) const + ?GetActions@CHnSuiteModel@@QAEPAV?$CArrayPtr@VCHnActionModel@@@@H@Z @ 73 NONAME ; class CArrayPtr<class CHnActionModel> * CHnSuiteModel::GetActions(int) + ?WidgetType@CHnSuiteModel@@QBEHXZ @ 74 NONAME ; int CHnSuiteModel::WidgetType(void) const + ?Reset@CHnMenuItemModel@@UAEXXZ @ 75 NONAME ; void CHnMenuItemModel::Reset(void) + ?SetItemIdAtL@CHnItemsOrder@@QAEXHH@Z @ 76 NONAME ; void CHnItemsOrder::SetItemIdAtL(int, int) + ?GetIcon@CHnAttributeBase@@UAEPAVCGulIcon@@PAVTSize@@@Z @ 77 NONAME ; class CGulIcon * CHnAttributeBase::GetIcon(class TSize *) + ?GetMatchingSuiteModel@CHnSuiteModelContainer@@QAEPAVCHnSuiteModel@@_J@Z @ 78 NONAME ; class CHnSuiteModel * CHnSuiteModelContainer::GetMatchingSuiteModel(long long) + ?NewL@CHnSuiteModel@@SAPAV1@AAVCHnEventHandler@@ABVTDesC16@@@Z @ 79 NONAME ; class CHnSuiteModel * CHnSuiteModel::NewL(class CHnEventHandler &, class TDesC16 const &) + ?NewL@CHnAttrImgProvLiwImage@@SAPAV1@AAPAVTLiwVariant@@0@Z @ 80 NONAME ; class CHnAttrImgProvLiwImage * CHnAttrImgProvLiwImage::NewL(class TLiwVariant * &, class TLiwVariant * &) + ?CustomId@CHnSuiteModel@@QAE_JXZ @ 81 NONAME ; long long CHnSuiteModel::CustomId(void) + ?Count@CHnItemsOrder@@QAEHXZ @ 82 NONAME ; int CHnItemsOrder::Count(void) + ?Position@CHnMenuItemModel@@QAEHXZ @ 83 NONAME ; int CHnMenuItemModel::Position(void) + ?IsEmpty@CHnSuitesStack@@QAEHXZ @ 84 NONAME ; int CHnSuitesStack::IsEmpty(void) + ?GetItemPosition@CHnItemsOrder@@QAEHH@Z @ 85 NONAME ; int CHnItemsOrder::GetItemPosition(int) + ?GetSuiteId@CHnItemsOrder@@QBEHXZ @ 86 NONAME ; int CHnItemsOrder::GetSuiteId(void) const + ?AppendChildMenuL@CHnMenuItemModel@@QAEXPAV1@@Z @ 87 NONAME ; void CHnMenuItemModel::AppendChildMenuL(class CHnMenuItemModel *) + ?NewLC@CHnToolbarModel@@SAPAV1@XZ @ 88 NONAME ; class CHnToolbarModel * CHnToolbarModel::NewLC(void) + ?GetSuiteModel@CHnSuiteModelContainer@@QAEPAVCHnSuiteModel@@H@Z @ 89 NONAME ; class CHnSuiteModel * CHnSuiteModelContainer::GetSuiteModel(int) + ?SetTitleL@CHnSuiteModel@@QAEXABVTDesC16@@@Z @ 90 NONAME ; void CHnSuiteModel::SetTitleL(class TDesC16 const &) + ?GetItemModel@CHnSuiteModel@@QAEPAVCHnItemModel@@H@Z @ 91 NONAME ; class CHnItemModel * CHnSuiteModel::GetItemModel(int) + ?GetMenuStructureL@CHnSuiteModel@@QAEPAVMHnMenuItemModelIterator@@H@Z @ 92 NONAME ; class MHnMenuItemModelIterator * CHnSuiteModel::GetMenuStructureL(int) + ?RemoveAllItems@CHnSuiteModel@@QAEXXZ @ 93 NONAME ; void CHnSuiteModel::RemoveAllItems(void) + ?SetPosition@CHnMenuItemModel@@QAEXH@Z @ 94 NONAME ; void CHnMenuItemModel::SetPosition(int) + ?Service@CHnActionModel@@QBEABVTDesC8@@XZ @ 95 NONAME ; class TDesC8 const & CHnActionModel::Service(void) const + ?SetFlag@CHnItemModel@@QAEXH@Z @ 96 NONAME ; void CHnItemModel::SetFlag(int) + ?ConstructorLC@CHnActionModel@@QAEPAVCLiwGenericParamList@@XZ @ 97 NONAME ; class CLiwGenericParamList * CHnActionModel::ConstructorLC(void) + ?SetExitMode@CHnSuiteModel@@QAEXW4TExitMode@@@Z @ 98 NONAME ; void CHnSuiteModel::SetExitMode(enum TExitMode) + ?SetSuiteId@CHnItemsOrder@@QAEXH@Z @ 99 NONAME ; void CHnItemsOrder::SetSuiteId(int) + ?NewL@CHnItemsOrder@@SAPAV1@XZ @ 100 NONAME ; class CHnItemsOrder * CHnItemsOrder::NewL(void) + ?NewL@CHnItemModel@@SAPAV1@XZ @ 101 NONAME ; class CHnItemModel * CHnItemModel::NewL(void) + ?SetCommand@CHnMenuItemModel@@QAEXH@Z @ 102 NONAME ; void CHnMenuItemModel::SetCommand(int) + ?Title@CHnSuiteModel@@QBEABVTDesC16@@XZ @ 103 NONAME ; class TDesC16 const & CHnSuiteModel::Title(void) const + ?GetParentSuiteModel@CHnSuiteModelContainer@@QAEPAVCHnSuiteModel@@XZ @ 104 NONAME ; class CHnSuiteModel * CHnSuiteModelContainer::GetParentSuiteModel(void) + ?GetIcon@CHnAttributeImage@@UAEPAVCGulIcon@@PAVTSize@@@Z @ 105 NONAME ; class CGulIcon * CHnAttributeImage::GetIcon(class TSize *) + ?RemoveItemId@CHnItemsOrder@@QAEXH@Z @ 106 NONAME ; void CHnItemsOrder::RemoveItemId(int) + ?ExecuteActionL@CHnEventHandler@@QAEHPAVCHnActionModel@@@Z @ 107 NONAME ; int CHnEventHandler::ExecuteActionL(class CHnActionModel *) + ?IsDrmExpired@CHnItemModel@@QAEHXZ @ 108 NONAME ; int CHnItemModel::IsDrmExpired(void) + ?Count@CHnSuitesStack@@QAEHXZ @ 109 NONAME ; int CHnSuitesStack::Count(void) + ?SetGulIcon@CHnExtBmpIconHolder@@QAEXPAVCGulIcon@@PAVCLiwBitmapBuffer@@1@Z @ 110 NONAME ; void CHnExtBmpIconHolder::SetGulIcon(class CGulIcon *, class CLiwBitmapBuffer *, class CLiwBitmapBuffer *) + ?GetLast@CHnSuitesStack@@QAEPAVCHnSuiteModel@@XZ @ 111 NONAME ; class CHnSuiteModel * CHnSuitesStack::GetLast(void) + ?NewLC@CHnAttrImgProvAppImage@@SAPAV1@VTUid@@@Z @ 112 NONAME ; class CHnAttrImgProvAppImage * CHnAttrImgProvAppImage::NewLC(class TUid) + ?SetMiddleSoftKey@CHnItemModel@@QAEXPAVCHnButtonModel@@@Z @ 113 NONAME ; void CHnItemModel::SetMiddleSoftKey(class CHnButtonModel *) + ?NewL@CHnSuitesStack@@SAPAV1@AAVMHnControllerInterface@@@Z @ 114 NONAME ; class CHnSuitesStack * CHnSuitesStack::NewL(class MHnControllerInterface &) + ?GetEventId@CHnButtonModel@@QBEHXZ @ 115 NONAME ; int CHnButtonModel::GetEventId(void) const + ?GetItemType@CHnSuiteModel@@QAE?AW4TMcsItemType@@H@Z @ 116 NONAME ; enum TMcsItemType CHnSuiteModel::GetItemType(int) + ?IsSuiteReadyToShow@CHnItemsOrder@@QAEHXZ @ 117 NONAME ; int CHnItemsOrder::IsSuiteReadyToShow(void) + ?EmptyText@CHnSuiteModel@@QBEABVTDesC16@@XZ @ 118 NONAME ; class TDesC16 const & CHnSuiteModel::EmptyText(void) const + ?GetItemIdAt@CHnItemsOrder@@QAEHH@Z @ 119 NONAME ; int CHnItemsOrder::GetItemIdAt(int) + ?GetMenuStructure@CHnMenuItemModel@@QAEPAVMHnMenuItemModelIterator@@XZ @ 120 NONAME ; class MHnMenuItemModelIterator * CHnMenuItemModel::GetMenuStructure(void) + ?NewL@CHnAttrImgProvFileImage@@SAPAV1@ABVTDesC16@@@Z @ 121 NONAME ; class CHnAttrImgProvFileImage * CHnAttrImgProvFileImage::NewL(class TDesC16 const &) + ?MarkSuiteUninitialized@CHnItemsOrder@@QAEXXZ @ 122 NONAME ; void CHnItemsOrder::MarkSuiteUninitialized(void) + ?IsMoveLocked@CHnItemModel@@QAEHXZ @ 123 NONAME ; int CHnItemModel::IsMoveLocked(void) + ?SetMask@CHnAttributeImage@@QAEXPAVTLiwVariant@@@Z @ 124 NONAME ; void CHnAttributeImage::SetMask(class TLiwVariant *) + ?ItemEvaluated@CHnItemsOrder@@QAEXH@Z @ 125 NONAME ; void CHnItemsOrder::ItemEvaluated(int) + ??1CHnToolbarModel@@UAE@XZ @ 126 NONAME ; CHnToolbarModel::~CHnToolbarModel(void) + ?SuiteName@CHnSuiteModel@@QBEABVTDesC16@@XZ @ 127 NONAME ; class TDesC16 const & CHnSuiteModel::SuiteName(void) const + ?SetTemplateL@CHnItemModel@@QAEXABVTDesC8@@@Z @ 128 NONAME ; void CHnItemModel::SetTemplateL(class TDesC8 const &) + ?GetIndex@CHnButtonModel@@QBEHXZ @ 129 NONAME ; int CHnButtonModel::GetIndex(void) const + ?QueueFocus@CHnSuiteModel@@QAEXH@Z @ 130 NONAME ; void CHnSuiteModel::QueueFocus(int) + ?IsDeleteLocked@CHnItemModel@@QAEHXZ @ 131 NONAME ; int CHnItemModel::IsDeleteLocked(void) + ?SetConstructorL@CHnActionModel@@QAEXPAVCHnMdBaseKey@@@Z @ 132 NONAME ; void CHnActionModel::SetConstructorL(class CHnMdBaseKey *) + ?IdByIndex@CHnSuiteModel@@QAEHH@Z @ 133 NONAME ; int CHnSuiteModel::IdByIndex(int) + ?NewLC@CHnAttributeImage@@SAPAV1@XZ @ 134 NONAME ; class CHnAttributeImage * CHnAttributeImage::NewLC(void) + ?IsItemBetweenMoveLocked@CHnSuiteModel@@QAEHHH@Z @ 135 NONAME ; int CHnSuiteModel::IsItemBetweenMoveLocked(int, int) + ?SetMifFile@CHnAttributeImage@@QAEXPAVHBufC16@@@Z @ 136 NONAME ; void CHnAttributeImage::SetMifFile(class HBufC16 *) + ?GetSuiteModelCount@CHnSuiteModelContainer@@QBEHXZ @ 137 NONAME ; int CHnSuiteModelContainer::GetSuiteModelCount(void) const + ?HasToolbar@CHnSuiteModel@@QBEHXZ @ 138 NONAME ; int CHnSuiteModel::HasToolbar(void) const + ?SetAttributeL@CHnItemModel@@QAEXPAVCHnAttributeBase@@@Z @ 139 NONAME ; void CHnItemModel::SetAttributeL(class CHnAttributeBase *) + ?SetEventId@CHnButtonModel@@QAEXH@Z @ 140 NONAME ; void CHnButtonModel::SetEventId(int) + ?GetLastSuiteModel@CHnSuiteModelContainer@@QAEPAVCHnSuiteModel@@XZ @ 141 NONAME ; class CHnSuiteModel * CHnSuiteModelContainer::GetLastSuiteModel(void) + ?NewL@CHnAttrImgProvSvgImage@@SAPAV1@ABVTDesC16@@@Z @ 142 NONAME ; class CHnAttrImgProvSvgImage * CHnAttrImgProvSvgImage::NewL(class TDesC16 const &) + ?RemoveItemL@CHnSuiteModel@@QAEXH@Z @ 143 NONAME ; void CHnSuiteModel::RemoveItemL(int) + ?GetTemplate@CHnItemModel@@QAEABVTDesC8@@XZ @ 144 NONAME ; class TDesC8 const & CHnItemModel::GetTemplate(void) + ?SetMaskId@CHnAttributeImage@@QAEXH@Z @ 145 NONAME ; void CHnAttributeImage::SetMaskId(int) + ?GetActions@CHnSuiteModel@@QAEAAV?$RHashMap@HPAV?$CArrayPtr@VCHnActionModel@@@@@@XZ @ 146 NONAME ; class RHashMap<int, class CArrayPtr<class CHnActionModel> *> & CHnSuiteModel::GetActions(void) + ?GetItemType@CHnItemModel@@QAE?AW4TMcsItemType@@XZ @ 147 NONAME ; enum TMcsItemType CHnItemModel::GetItemType(void) + ?GetButtonText@CHnButtonModel@@QBEABVTDesC16@@XZ @ 148 NONAME ; class TDesC16 const & CHnButtonModel::GetButtonText(void) const + ?NewL@CHnAttributeText@@SAPAV1@XZ @ 149 NONAME ; class CHnAttributeText * CHnAttributeText::NewL(void) + ?GetNext@CHnMenuItemModel@@UAEPAV1@XZ @ 150 NONAME ; class CHnMenuItemModel * CHnMenuItemModel::GetNext(void) + ?DefineModelItemCountL@CHnItemsOrder@@QAEXH@Z @ 151 NONAME ; void CHnItemsOrder::DefineModelItemCountL(int) + ?SuiteEvaluationFinishedL@CHnSuiteModel@@QAEHXZ @ 152 NONAME ; int CHnSuiteModel::SuiteEvaluationFinishedL(void) + ?ItemEvaluationFinishedL@CHnSuiteModel@@QAEHH@Z @ 153 NONAME ; int CHnSuiteModel::ItemEvaluationFinishedL(int) + ?NewL@CHnMenuItemModel@@SAPAV1@ABVTDesC16@@@Z @ 154 NONAME ; class CHnMenuItemModel * CHnMenuItemModel::NewL(class TDesC16 const &) + ?ReorderItemsL@CHnSuiteModel@@QAEHHH@Z @ 155 NONAME ; int CHnSuiteModel::ReorderItemsL(int, int) + ?GetIdsForL@CHnItemsOrder@@QAEXHAAV?$RArray@H@@@Z @ 156 NONAME ; void CHnItemsOrder::GetIdsForL(int, class RArray<int> &) + ?NewLC@CHnAttrImgProvThemeMif@@SAPAV1@VTAknsItemID@@ABVTDesC16@@HH@Z @ 157 NONAME ; class CHnAttrImgProvThemeMif * CHnAttrImgProvThemeMif::NewLC(class TAknsItemID, class TDesC16 const &, int, int) + ?SetWidgetType@CHnSuiteModel@@QAEXW4THnSuiteWidgetType@@@Z @ 158 NONAME ; void CHnSuiteModel::SetWidgetType(enum THnSuiteWidgetType) + ?NotifyObserversL@CHnSuiteModel@@QAEXW4THnCustomSuiteEvent@@@Z @ 159 NONAME ; void CHnSuiteModel::NotifyObserversL(enum THnCustomSuiteEvent) + ?DeleteAllActionModels@CHnItemModel@@QAEXXZ @ 160 NONAME ; void CHnItemModel::DeleteAllActionModels(void) + ?SetSuiteHighlightL@CHnSuiteModel@@QAEXH@Z @ 161 NONAME ; void CHnSuiteModel::SetSuiteHighlightL(int) + ?SetCustomId@CHnSuiteModel@@QAEX_J@Z @ 162 NONAME ; void CHnSuiteModel::SetCustomId(long long) + ?SetCommandNameL@CHnActionModel@@QAEXABVTDesC8@@@Z @ 163 NONAME ; void CHnActionModel::SetCommandNameL(class TDesC8 const &) + ?NewLC@CHnItemsOrder@@SAPAV1@XZ @ 164 NONAME ; class CHnItemsOrder * CHnItemsOrder::NewLC(void) + ?SetCommand@CHnActionModel@@QAEXPAVCHnMdBaseKey@@@Z @ 165 NONAME ; void CHnActionModel::SetCommand(class CHnMdBaseKey *) + ?NewL@CHnAttrImgProvAppImage@@SAPAV1@VTUid@@@Z @ 166 NONAME ; class CHnAttrImgProvAppImage * CHnAttrImgProvAppImage::NewL(class TUid) + ?NewLC@CHnAttributeText@@SAPAV1@XZ @ 167 NONAME ; class CHnAttributeText * CHnAttributeText::NewLC(void) + ?NewLC@CHnSuiteModelContainer@@SAPAV1@AAVMHnMdModelEventObserver@@AAVMHnControllerInterface@@@Z @ 168 NONAME ; class CHnSuiteModelContainer * CHnSuiteModelContainer::NewLC(class MHnMdModelEventObserver &, class MHnControllerInterface &) + ?IsRunning@CHnItemModel@@QAEHXZ @ 169 NONAME ; int CHnItemModel::IsRunning(void) + ?NewL@CHnActionModel@@SAPAV1@XZ @ 170 NONAME ; class CHnActionModel * CHnActionModel::NewL(void) + ?AddButtonL@CHnToolbarModel@@QAEXPAVCHnButtonModel@@@Z @ 171 NONAME ; void CHnToolbarModel::AddButtonL(class CHnButtonModel *) + ?SetItemUidL@CHnItemModel@@QAEXABVTDesC8@@@Z @ 172 NONAME ; void CHnItemModel::SetItemUidL(class TDesC8 const &) + ?SetType@CHnItemModel@@QAEXABVTDesC8@@@Z @ 173 NONAME ; void CHnItemModel::SetType(class TDesC8 const &) + ?SetSkinId@CHnAttributeImage@@QAEXVTAknsItemID@@@Z @ 174 NONAME ; void CHnAttributeImage::SetSkinId(class TAknsItemID) + ?NameL@CHnMenuItemModel@@QAEABVTDesC16@@XZ @ 175 NONAME ; class TDesC16 const & CHnMenuItemModel::NameL(void) + ?PopL@CHnSuitesStack@@QAEPAVCHnSuiteModel@@XZ @ 176 NONAME ; class CHnSuiteModel * CHnSuitesStack::PopL(void) + ?SetVisibleL@CHnSuiteModel@@QAEXH@Z @ 177 NONAME ; void CHnSuiteModel::SetVisibleL(int) + ?SetIcon@CHnButtonModel@@QAEXPAVCHnAttributeBase@@@Z @ 178 NONAME ; void CHnButtonModel::SetIcon(class CHnAttributeBase *) + ?NewL@CHnAttrImgProvThemeMif@@SAPAV1@VTAknsItemID@@ABVTDesC16@@HH@Z @ 179 NONAME ; class CHnAttrImgProvThemeMif * CHnAttrImgProvThemeMif::NewL(class TAknsItemID, class TDesC16 const &, int, int) + ?NewLC@CHnAttrImgProvLiwImage@@SAPAV1@AAPAVTLiwVariant@@0@Z @ 180 NONAME ; class CHnAttrImgProvLiwImage * CHnAttrImgProvLiwImage::NewLC(class TLiwVariant * &, class TLiwVariant * &) + ?GetTemplate@CHnSuiteModel@@QBEABVTDesC8@@XZ @ 181 NONAME ; class TDesC8 const & CHnSuiteModel::GetTemplate(void) const + ?GetActions@CHnItemModel@@QAEAAV?$RHashMap@HPAV?$CArrayPtr@VCHnActionModel@@@@@@XZ @ 182 NONAME ; class RHashMap<int, class CArrayPtr<class CHnActionModel> *> & CHnItemModel::GetActions(void) + ?SetItemSpecific@CHnMenuItemModel@@QAEXH@Z @ 183 NONAME ; void CHnMenuItemModel::SetItemSpecific(int) + ?HasNextSpecific@CHnMenuItemModel@@UAEHXZ @ 184 NONAME ; int CHnMenuItemModel::HasNextSpecific(void) + ?GetNextSpecific@CHnMenuItemModel@@UAEPAV1@XZ @ 185 NONAME ; class CHnMenuItemModel * CHnMenuItemModel::GetNextSpecific(void) + ?IsItemSpecific@CHnMenuItemModel@@QAEHXZ @ 186 NONAME ; int CHnMenuItemModel::IsItemSpecific(void) + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/eabi/hnpresentationmodelu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/eabi/hnpresentationmodelu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,201 @@ +EXPORTS + _ZN12CHnItemModel10ClearFlagsEv @ 1 NONAME + _ZN12CHnItemModel10GetActionsEi @ 2 NONAME + _ZN12CHnItemModel10GetActionsEv @ 3 NONAME + _ZN12CHnItemModel10GetItemUidEv @ 4 NONAME + _ZN12CHnItemModel11GetItemTypeEv @ 5 NONAME + _ZN12CHnItemModel11GetTemplateEv @ 6 NONAME + _ZN12CHnItemModel11SetCustomIdEx @ 7 NONAME + _ZN12CHnItemModel11SetItemUidLERK6TDesC8 @ 8 NONAME + _ZN12CHnItemModel12GetAttributeERK6TDesC8 @ 9 NONAME + _ZN12CHnItemModel12IsDrmExpiredEv @ 10 NONAME + _ZN12CHnItemModel12IsMoveLockedEv @ 11 NONAME + _ZN12CHnItemModel12SetTemplateLERK6TDesC8 @ 12 NONAME + _ZN12CHnItemModel13SetAttributeLEP16CHnAttributeBase @ 13 NONAME + _ZN12CHnItemModel14IsDeleteLockedEv @ 14 NONAME + _ZN12CHnItemModel15SetToolbarModelEP15CHnToolbarModel @ 15 NONAME + _ZN12CHnItemModel16ClearAttributesLEv @ 16 NONAME + _ZN12CHnItemModel16GetMiddleSoftKeyEv @ 17 NONAME + _ZN12CHnItemModel16SetMenuItemModelEP16CHnMenuItemModel @ 18 NONAME + _ZN12CHnItemModel16SetMiddleSoftKeyEP14CHnButtonModel @ 19 NONAME + _ZN12CHnItemModel21DeleteAllActionModelsEv @ 20 NONAME + _ZN12CHnItemModel4NewLEv @ 21 NONAME + _ZN12CHnItemModel7SetFlagEi @ 22 NONAME + _ZN12CHnItemModel7SetTypeERK6TDesC8 @ 23 NONAME + _ZN12CHnItemModel8CustomIdEv @ 24 NONAME + _ZN12CHnItemModel9IsRunningEv @ 25 NONAME + _ZN13CHnIconHolder10SetGulIconEP8CGulIcon @ 26 NONAME + _ZN13CHnItemsOrder10GetIdsForLEiR6RArrayIiE @ 27 NONAME + _ZN13CHnItemsOrder10SetSuiteIdEi @ 28 NONAME + _ZN13CHnItemsOrder11GetItemIdAtEi @ 29 NONAME + _ZN13CHnItemsOrder11GetItemIdAtEii @ 30 NONAME + _ZN13CHnItemsOrder12RemoveItemIdEi @ 31 NONAME + _ZN13CHnItemsOrder12SetItemIdAtLEii @ 32 NONAME + _ZN13CHnItemsOrder13ItemEvaluatedEi @ 33 NONAME + _ZN13CHnItemsOrder14SuiteEvaluatedEv @ 34 NONAME + _ZN13CHnItemsOrder15GetItemPositionEi @ 35 NONAME + _ZN13CHnItemsOrder15InsertItemIdToLEiii @ 36 NONAME + _ZN13CHnItemsOrder17GetModelItemCountEv @ 37 NONAME + _ZN13CHnItemsOrder18IsSuiteReadyToShowEv @ 38 NONAME + _ZN13CHnItemsOrder21DefineModelItemCountLEi @ 39 NONAME + _ZN13CHnItemsOrder22MarkSuiteUninitializedEv @ 40 NONAME + _ZN13CHnItemsOrder4NewLEv @ 41 NONAME + _ZN13CHnItemsOrder5CountEv @ 42 NONAME + _ZN13CHnItemsOrder5NewLCEv @ 43 NONAME + _ZN13CHnItemsOrderixEi @ 44 NONAME + _ZN13CHnSuiteModel10GetActionsEi @ 45 NONAME + _ZN13CHnSuiteModel10GetActionsEv @ 46 NONAME + _ZN13CHnSuiteModel10QueueFocusEi @ 47 NONAME + _ZN13CHnSuiteModel10SetActiveLEi @ 48 NONAME + _ZN13CHnSuiteModel11GetItemTypeEi @ 49 NONAME + _ZN13CHnSuiteModel11RemoveItemLEi @ 50 NONAME + _ZN13CHnSuiteModel11SetCustomIdEx @ 51 NONAME + _ZN13CHnSuiteModel11SetExitModeE9TExitMode @ 52 NONAME + _ZN13CHnSuiteModel11SetVisibleLEi @ 53 NONAME + _ZN13CHnSuiteModel12GetItemModelEi @ 54 NONAME + _ZN13CHnSuiteModel12SetTemplateLERK6TDesC8 @ 55 NONAME + _ZN13CHnSuiteModel13GetItemsOrderEv @ 56 NONAME + _ZN13CHnSuiteModel13ReorderItemsLEii @ 57 NONAME + _ZN13CHnSuiteModel13SetEmptyTextLERK7TDesC16 @ 58 NONAME + _ZN13CHnSuiteModel13SetWidgetTypeE18THnSuiteWidgetType @ 59 NONAME + _ZN13CHnSuiteModel14RemoveAllItemsEv @ 60 NONAME + _ZN13CHnSuiteModel16IsItemMoveLockedEi @ 61 NONAME + _ZN13CHnSuiteModel16NotifyObserversLE19THnCustomSuiteEvent @ 62 NONAME + _ZN13CHnSuiteModel16RefreshMulModelLEi @ 63 NONAME + _ZN13CHnSuiteModel17GetMenuStructureLEi @ 64 NONAME + _ZN13CHnSuiteModel17GetSuiteHighlightEv @ 65 NONAME + _ZN13CHnSuiteModel18GetItemModelsCountEv @ 66 NONAME + _ZN13CHnSuiteModel18SetSuiteHighlightLEi @ 67 NONAME + _ZN13CHnSuiteModel19UpdateItemTemplateLEi @ 68 NONAME + _ZN13CHnSuiteModel21GetMatchingItemModelLExRi @ 69 NONAME + _ZN13CHnSuiteModel22RegisterSuiteObserverLEP16MHnSuiteObserver15TThreadPriority @ 70 NONAME + _ZN13CHnSuiteModel23IsItemBetweenMoveLockedEii @ 71 NONAME + _ZN13CHnSuiteModel23ItemEvaluationFinishedLEi @ 72 NONAME + _ZN13CHnSuiteModel23UnregisterSuiteObserverEP16MHnSuiteObserver @ 73 NONAME + _ZN13CHnSuiteModel24SuiteEvaluationFinishedLEv @ 74 NONAME + _ZN13CHnSuiteModel4NewLER15CHnEventHandlerRK7TDesC16 @ 75 NONAME + _ZN13CHnSuiteModel8AddItemLEiP12CHnItemModelii @ 76 NONAME + _ZN13CHnSuiteModel8CustomIdEv @ 77 NONAME + _ZN13CHnSuiteModel8ExitModeEv @ 78 NONAME + _ZN13CHnSuiteModel8IsActiveEv @ 79 NONAME + _ZN13CHnSuiteModel9IdByIndexEi @ 80 NONAME + _ZN13CHnSuiteModel9SetTitleLERK7TDesC16 @ 81 NONAME + _ZN13CHnSuiteModelD0Ev @ 82 NONAME + _ZN13CHnSuiteModelD1Ev @ 83 NONAME + _ZN13CHnSuiteModelD2Ev @ 84 NONAME + _ZN14CHnActionModel10SetCommandEP12CHnMdBaseKey @ 85 NONAME + _ZN14CHnActionModel11SetServiceLERK6TDesC8 @ 86 NONAME + _ZN14CHnActionModel13ConstructorLCEv @ 87 NONAME + _ZN14CHnActionModel13SetInterfaceLERK6TDesC8 @ 88 NONAME + _ZN14CHnActionModel15SetCommandNameLERK6TDesC8 @ 89 NONAME + _ZN14CHnActionModel15SetConstructorLEP12CHnMdBaseKey @ 90 NONAME + _ZN14CHnActionModel15SetServiceModeLE12TServiceMode @ 91 NONAME + _ZN14CHnActionModel4NewLEv @ 92 NONAME + _ZN14CHnButtonModel10SetEventIdEi @ 93 NONAME + _ZN14CHnButtonModel12SetHelpTextLERK7TDesC16 @ 94 NONAME + _ZN14CHnButtonModel5NewLCEi @ 95 NONAME + _ZN14CHnButtonModel7SetIconEP16CHnAttributeBase @ 96 NONAME + _ZN14CHnButtonModel9SetDimmedEi @ 97 NONAME + _ZN14CHnButtonModelD0Ev @ 98 NONAME + _ZN14CHnButtonModelD1Ev @ 99 NONAME + _ZN14CHnButtonModelD2Ev @ 100 NONAME + _ZN14CHnSuitesStack12GetRootSuiteEv @ 101 NONAME + _ZN14CHnSuitesStack3GetEi @ 102 NONAME + _ZN14CHnSuitesStack4NewLER22MHnControllerInterface @ 103 NONAME + _ZN14CHnSuitesStack4PopLEv @ 104 NONAME + _ZN14CHnSuitesStack5CountEv @ 105 NONAME + _ZN14CHnSuitesStack5PushLEP13CHnSuiteModel @ 106 NONAME + _ZN14CHnSuitesStack7GetLastEv @ 107 NONAME + _ZN14CHnSuitesStack7IsEmptyEv @ 108 NONAME + _ZN15CHnEventHandler14ExecuteActionLEP14CHnActionModel @ 109 NONAME + _ZN15CHnToolbarModel10AddButtonLEP14CHnButtonModel @ 110 NONAME + _ZN15CHnToolbarModel5NewLCEv @ 111 NONAME + _ZN15CHnToolbarModelD0Ev @ 112 NONAME + _ZN15CHnToolbarModelD1Ev @ 113 NONAME + _ZN15CHnToolbarModelD2Ev @ 114 NONAME + _ZN16CHnAttributeBase4TypeEv @ 115 NONAME + _ZN16CHnAttributeBase5ValueEv @ 116 NONAME + _ZN16CHnAttributeBase7GetIconEP5TSize @ 117 NONAME + _ZN16CHnAttributeBase8SetNameLERK6TDesC8 @ 118 NONAME + _ZN16CHnAttributeText4NewLEv @ 119 NONAME + _ZN16CHnAttributeText5NewLCEv @ 120 NONAME + _ZN16CHnAttributeText9SetValueLERK6TDesC8 @ 121 NONAME + _ZN16CHnMenuItemModel10SetCommandEi @ 122 NONAME + _ZN16CHnMenuItemModel11SetPositionEi @ 123 NONAME + _ZN16CHnMenuItemModel16AppendChildMenuLEPS_ @ 124 NONAME + _ZN16CHnMenuItemModel16GetMenuStructureEv @ 125 NONAME + _ZN16CHnMenuItemModel4NewLERK7TDesC16 @ 126 NONAME + _ZN16CHnMenuItemModel5NameLEv @ 127 NONAME + _ZN16CHnMenuItemModel5ResetEv @ 128 NONAME + _ZN16CHnMenuItemModel7CommandEv @ 129 NONAME + _ZN16CHnMenuItemModel7GetNextEv @ 130 NONAME + _ZN16CHnMenuItemModel7HasNextEv @ 131 NONAME + _ZN16CHnMenuItemModel8PositionEv @ 132 NONAME + _ZN17CHnAttributeImage10SetMifFileEP7HBufC16 @ 133 NONAME + _ZN17CHnAttributeImage11SetBitmapIdEi @ 134 NONAME + _ZN17CHnAttributeImage14SetFileNameSrcEP7HBufC16 @ 135 NONAME + _ZN17CHnAttributeImage17SetApplicationUidE4TUid @ 136 NONAME + _ZN17CHnAttributeImage4NewLEv @ 137 NONAME + _ZN17CHnAttributeImage5NewLCEv @ 138 NONAME + _ZN17CHnAttributeImage7GetIconEP5TSize @ 139 NONAME + _ZN17CHnAttributeImage7SetMaskEP11TLiwVariant @ 140 NONAME + _ZN17CHnAttributeImage9SetBitmapEP11TLiwVariant @ 141 NONAME + _ZN17CHnAttributeImage9SetMaskIdEi @ 142 NONAME + _ZN17CHnAttributeImage9SetSkinIdE11TAknsItemID @ 143 NONAME + _ZN19CHnExtBmpIconHolder10SetGulIconEP8CGulIconP16CLiwBitmapBufferS3_ @ 144 NONAME + _ZN22CHnAttrImgProvAppImage4NewLE4TUid @ 145 NONAME + _ZN22CHnAttrImgProvAppImage5NewLCE4TUid @ 146 NONAME + _ZN22CHnAttrImgProvLiwImage4NewLERP11TLiwVariantS2_ @ 147 NONAME + _ZN22CHnAttrImgProvLiwImage5NewLCERP11TLiwVariantS2_ @ 148 NONAME + _ZN22CHnAttrImgProvSvgImage4NewLERK7TDesC16 @ 149 NONAME + _ZN22CHnAttrImgProvSvgImage5NewLCERK7TDesC16 @ 150 NONAME + _ZN22CHnAttrImgProvThemeMif4NewLE11TAknsItemIDRK7TDesC16ii @ 151 NONAME + _ZN22CHnAttrImgProvThemeMif5NewLCE11TAknsItemIDRK7TDesC16ii @ 152 NONAME + _ZN22CHnSuiteModelContainer13GetSuiteModelERK7TDesC16 @ 153 NONAME + _ZN22CHnSuiteModelContainer13GetSuiteModelEi @ 154 NONAME + _ZN22CHnSuiteModelContainer13OfferHnEventLEiiP20CLiwGenericParamList @ 155 NONAME + _ZN22CHnSuiteModelContainer14PopSuiteModelLERK7TDesC16 @ 156 NONAME + _ZN22CHnSuiteModelContainer16RemoveLiwObjectsEv @ 157 NONAME + _ZN22CHnSuiteModelContainer17GetLastSuiteModelEv @ 158 NONAME + _ZN22CHnSuiteModelContainer18PushNewSuiteModelLERK7TDesC16 @ 159 NONAME + _ZN22CHnSuiteModelContainer19GetParentSuiteModelEv @ 160 NONAME + _ZN22CHnSuiteModelContainer21GetMatchingSuiteModelEx @ 161 NONAME + _ZN22CHnSuiteModelContainer4NewLER23MHnMdModelEventObserverR22MHnControllerInterface @ 162 NONAME + _ZN22CHnSuiteModelContainer5NewLCER23MHnMdModelEventObserverR22MHnControllerInterface @ 163 NONAME + _ZN23CHnAttrImgProvFileImage4NewLERK7TDesC16 @ 164 NONAME + _ZN23CHnAttrImgProvFileImage5NewLCERK7TDesC16 @ 165 NONAME + _ZNK12CHnItemModel15GetToolbarModelEv @ 166 NONAME + _ZNK13CHnIconHolder10GetGulIconEv @ 167 NONAME + _ZNK13CHnItemsOrder10GetSuiteIdEv @ 168 NONAME + _ZNK13CHnSuiteModel10HasToolbarEv @ 169 NONAME + _ZNK13CHnSuiteModel10WidgetTypeEv @ 170 NONAME + _ZNK13CHnSuiteModel11GetTemplateEv @ 171 NONAME + _ZNK13CHnSuiteModel5TitleEv @ 172 NONAME + _ZNK13CHnSuiteModel9EmptyTextEv @ 173 NONAME + _ZNK13CHnSuiteModel9SuiteNameEv @ 174 NONAME + _ZNK14CHnActionModel11CommandNameEv @ 175 NONAME + _ZNK14CHnActionModel11ServiceModeEv @ 176 NONAME + _ZNK14CHnActionModel7ServiceEv @ 177 NONAME + _ZNK14CHnActionModel9CommandLCEv @ 178 NONAME + _ZNK14CHnActionModel9InterfaceEv @ 179 NONAME + _ZNK14CHnButtonModel10GetEventIdEv @ 180 NONAME + _ZNK14CHnButtonModel13GetButtonTextEv @ 181 NONAME + _ZNK14CHnButtonModel7GetIconEv @ 182 NONAME + _ZNK14CHnButtonModel8GetIndexEv @ 183 NONAME + _ZNK14CHnButtonModel9GetDimmedEv @ 184 NONAME + _ZNK15CHnToolbarModel10HasButtonsEv @ 185 NONAME + _ZNK15CHnToolbarModel9GetButtonEi @ 186 NONAME + _ZNK16CHnAttributeBase4NameEv @ 187 NONAME + _ZNK22CHnSuiteModelContainer18GetSuiteModelCountEv @ 188 NONAME + _ZTI19CHnExtBmpIconHolder @ 189 NONAME + _ZTV19CHnExtBmpIconHolder @ 190 NONAME + _ZThn4_N16CHnMenuItemModel5ResetEv @ 191 NONAME + _ZThn4_N16CHnMenuItemModel7GetNextEv @ 192 NONAME + _ZThn4_N16CHnMenuItemModel7HasNextEv @ 193 NONAME + _ZN16CHnMenuItemModel15GetNextSpecificEv @ 194 NONAME + _ZN16CHnMenuItemModel15HasNextSpecificEv @ 195 NONAME + _ZN16CHnMenuItemModel15SetItemSpecificEi @ 196 NONAME + _ZThn4_N16CHnMenuItemModel15GetNextSpecificEv @ 197 NONAME + _ZThn4_N16CHnMenuItemModel15HasNextSpecificEv @ 198 NONAME + _ZN16CHnMenuItemModel14IsItemSpecificEv @ 199 NONAME + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project hnpresentationmodel +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/hnsuitemodelcontainer.h |../../../inc/hnsuitemodelcontainer.h +../inc/hnsuitemodel.h |../../../inc/hnsuitemodel.h +../inc/hnitemmodel.h |../../../inc/hnitemmodel.h +../inc/hnmenuitemmodel.h |../../../inc/hnmenuitemmodel.h +../inc/hnactionmodel.h |../../../inc/hnactionmodel.h +../inc/hntoolbarmodel.h |../../../inc/hntoolbarmodel.h +../inc/hnbuttonmodel.h |../../../inc/hnbuttonmodel.h +../inc/hnattributetext.h |../../../inc/hnattributetext.h +../inc/hnattributeimage.h |../../../inc/hnattributeimage.h +../inc/hneventhandler.h |../../../inc/hneventhandler.h +../inc/hnattributebase.h |../../../inc/hnattributebase.h +../inc/hnsuiteobserver.h |../../../inc/hnsuiteobserver.h +../inc/hnitemsorder.h |../../../inc/hnitemsorder.h +../inc/hniconholder.h |../../../inc/hniconholder.h +../inc/hnextbmpiconholder.h |../../../inc/hnextbmpiconholder.h + +PRJ_MMPFILES +hnpresentationmodel.mmp + +PRJ_TESTMMPFILES +#ifdef _MATRIX_MENU_INCLUDE_TEST_CONTENT +#include "../internal/test/group/bld.inf" +#endif diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/group/hnpresentationmodel.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/group/hnpresentationmodel.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project hierarchy navigator presentation model +* +*/ + + +#include <platform_paths.hrh> + +TARGET hnpresentationmodel.dll +TARGETTYPE dll + +UID 0x1000008d 0x2000F8C6 + +CAPABILITY CAP_GENERAL_DLL + + +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE hnsuitemodelcontainer.cpp +SOURCE hnsuitemodel.cpp +SOURCE hnsuitesstack.cpp +SOURCE hnitemmodel.cpp +SOURCE hnmenuitemmodel.cpp +SOURCE hnactionmodel.cpp +SOURCE hntoolbarmodel.cpp +SOURCE hnbuttonmodel.cpp +SOURCE hnattributebase.cpp +SOURCE hnattributeimage.cpp +SOURCE hnattrimgprovider.cpp +SOURCE hnattrimgprovthememif.cpp +SOURCE hnattrimgprovemptyimage.cpp +SOURCE hnattrimgprovappimage.cpp +SOURCE hnattrimgprovfileimage.cpp +SOURCE hnattrimgprovliwimage.cpp +SOURCE hnattributetext.cpp +SOURCE hneventhandler.cpp +SOURCE hnitemsorder.cpp +SOURCE hnattrimgprovsvgimage.cpp +SOURCE hnitemfocushandler.cpp +SOURCE hniconholder.cpp +SOURCE hnextbmpiconholder.cpp + +USERINCLUDE ../inc + +SYSTEMINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY hnutilities.lib +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY libpthread.lib +LIBRARY egul.lib +LIBRARY liwservicehandler.lib //LIW Framework +LIBRARY mmextensionmanager.lib +LIBRARY aknskins.lib +LIBRARY aknskinsrv.lib +LIBRARY aknicon.lib +LIBRARY efsrv.lib +LIBRARY fbscli.lib +LIBRARY mediaclientimage.lib +LIBRARY imageconversion.lib +LIBRARY cone.lib +LIBRARY estor.lib +LIBRARY svgengine.lib +LIBRARY gdi.lib + +#ifdef _MATRIX_MENU_TRACE_PERFORMANCE +LIBRARY flogger.lib +#else +DEBUGLIBRARY flogger.lib +#endif + + + +// End of file diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnactionmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnactionmodel.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,251 @@ +/* +* Copyright (c) 2007-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: action presentation model +* +*/ + + +#ifndef HNACTIONMODEL_H_ +#define HNACTIONMODEL_H_ + +#include <e32base.h> +#include <e32hashtab.h> +#include <liwservicehandler.h> +#include "hnglobals.h" + + +class MLiwNotifyCallback; +class CLiwGenericParamList; +class CHnMdServiceCommand; +class CHnEventHandler; +class CHnMdBaseKey; +struct THnMdCommonPointers; + +/** + * Action model class. + * + * The class represents an evaluated action, with concrete values. + * It is constructed from the data contained in the CHnMdAction, + * during evaluation. The afore mentioned process, replaces any + * configurable data with specific information fetched form services + * or other sources. Such setup action, may be executed by means + * of its methods. However, a reference to an instance of CHnEventHandler + * has to be provided. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @see CHnMdAction + * @see CHnEventHandler + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnActionModel ) : public CBase + { + +public: + + /** + * Two-phased constructor. + * + * @since S60 5.0 + */ + IMPORT_C static CHnActionModel* NewL(); + + /** + * Virtual Destructor. + * + * @since S60 5.0 + */ + ~CHnActionModel(); + + /** + * Concretizes the key values. + * + * @since S60 5.0 + * @param aActionModel The action model to be concretized. + * @param aGenericParamList The list of parameters. + * @return Concretized instance of action model. + * + */ + CHnActionModel* ConcretizeL( const CHnActionModel & aActionModel, + CLiwGenericParamList* aGenericParamList ); + + /** + * Returns service constructor parameters + * as a CLiwGenericParamList. The list contains + * keys evaluated from the XML configuration. + * + * @since S60 5.0 + * @return Constructor parameters. + * + */ + IMPORT_C CLiwGenericParamList* ConstructorLC(); + + /** + * Returns the service name. + * + * @since S60 5.0 + * @return Service name. + */ + IMPORT_C const TDesC8& Service() const; + + /** + * Returns service command content as + * a CLiwGenericParamList. The list contains + * keys evaluated from the XML configuration. + * + * @since S60 5.0 + * @return Command element. + */ + IMPORT_C CLiwGenericParamList* CommandLC() const; + + /** + * Returns interface name. + * + * @since S60 5.0 + * @return Interface name. + */ + IMPORT_C const TDesC8& Interface() const; + + /** + * Sets constructor parameters. + * Method takes copy of items from the array. + * + * @since S60 5.0 + * @param aData Constructor parameters. + */ + IMPORT_C void SetConstructorL( CHnMdBaseKey* aData ); + + /** + * Sets the service name. + * + * @since S60 5.0 + * @param aService Service name. + */ + IMPORT_C void SetServiceL( const TDesC8& aService ); + + /** + * Sets the service command parameters. + * + * @since S60 5.0 + * @param aCommand Command parameters. + */ + IMPORT_C void SetCommand( CHnMdBaseKey* aCommand ); + + /** + * Sets interface name. + * + * @since S60 5.0 + * @param aInterface Interface name. + */ + IMPORT_C void SetInterfaceL( const TDesC8& aInterface ); + + /** + * Sets service command name. + * + * @since S60 5.0 + * @param aCommandName Name of the service command. + */ + IMPORT_C void SetCommandNameL( const TDesC8& aCommandName ); + + + /** + * Sets the mode in which the service command + * should operate. + * + * @since S60 5.0 + * @param aMode Mode in which command operates. + */ + IMPORT_C void SetServiceModeL( TServiceMode aMode ); + + /** + * Returns command name. + * + * @since S60 5.0 + * @return Command name. + */ + IMPORT_C const TDesC8& CommandName() const; + + + /** + * Returns service mode in which the action operates. + * + * @since S60 5.0 + * @return Service mode. + */ + IMPORT_C TServiceMode ServiceMode() const; + + /** + * Executes the action. + * + * @since S60 5.0 + * @param aEventHandler A reference to an instance of event handler + * @param aExecutionParams A pointer to the parameters to the event. + * @return Error code of the event execution. + */ + TInt ExecuteL( CHnEventHandler & aEventHandler, + CLiwGenericParamList *aExecutionParams ); + +private: + + /** + * Second phase constructor. + * + * @since S60 5.0 + */ + void ConstructL(); + + /** + * Default constructor. + * + * @since S60 5.0 + */ + CHnActionModel(); + +private: // data + + /** + * Service name. + */ + RBuf8 iService; + + /** + * Interface name. + */ + RBuf8 iInterface; + + /** + * Command name. + */ + RBuf8 iCommandName; + + /** + * Service mode. + */ + TServiceMode iMode; + + /** + * Command parameters. + * Own. + */ + CHnMdBaseKey* iCommand; + + /** + * Constructor parameters. + * Own. + */ + CHnMdBaseKey* iConstructor; + + }; + +#endif /*HNACTIONMODEL_H_*/ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnattributebase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnattributebase.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,144 @@ +/* +* Copyright (c) 2007-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: abstract base class for attribute models +* +*/ + + +#ifndef C_HNATTRIBUTEBASE_H +#define C_HNATTRIBUTEBASE_H + +#include <e32base.h> +#include "hniconholder.h" + +class CGulIcon; + +/** + * Attribute type. Indicates the text or image attribute. + */ +enum TAttributeType + { + ETextAttribute, + EImageAttribute + }; + +/** + * Attribute base (abstract) class. + * + * Base class for attributes providing common functionality + * and defining required abstract methods for the interface. + * Attributes are used to logically mediate visual properties, + * such as icons, texts, templates, etc., from the xml to the + * presentation layer. Atributes are used eg., to retrieve content + * of such visual items in the widget library (mmwidgets), + * for display purposes. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnAttributeBase ) : public CBase + { +public: + + /** + * Standard destructor. + * + * @since S60 5.0 + */ + ~CHnAttributeBase(); + + /** + * Sets the attribute name. + * + * @since S60 5.0 + * @param aName Name of the attribute + */ + IMPORT_C void SetNameL( const TDesC8& aName ); + + /** + * Gets the name of the attribute. + * + * @since S60 5.0 + * @return Attribute name. + */ + IMPORT_C const TDesC8& Name() const; + + /** + * Gets the value of the attribute. + * + * @since S60 5.0 + * @return Attribute's value. + */ + IMPORT_C virtual const TDesC8& Value(); + + /** + * Gets icon, packed in CGulIcon. + * + * @see CGulIcon + * @since S60 5.0 + * @return Icon as a poitner to CGulIcon. + */ + IMPORT_C virtual CGulIcon* GetIcon( TSize* aDesiredIconSize + = NULL ); + + /** + * Gets icon holder, which owns the same icon that GetIcon returns. + * + * Icon holder should be used when the icon from model needs to + * be stored. Please see @c CHnIconHolder description for more + * details on how to store icons. + * + * @param aDesiredIconSize Desired size of the icon contained in + * the returned icon holder. + * @return An icon holder. You can call GetGulIcon on it to get the + * actual icon (may return NULL). + */ + virtual CHnIconHolder* GetIconHolder( TSize* aDesiredIconSize ); + + /** + * Gets attributes's type. + * + * @since S60 5.0 + * @return Attribute's type. + */ + IMPORT_C TAttributeType Type(); + + /** + * Removes all LIW objects owned by this object. + * + * LIW objects owned by non-LIW objects that are owned by + * this object are also removed. + * @since S60 5.0 + */ + virtual void RemoveLiwObjects(); + +protected: // data + + /** + * Attribute type. + */ + TAttributeType iAttributeType; + +private: // data + + /** + * Attribute name. + */ + RBuf8 iName; + + }; + +#endif // C_HNATTRIBUTEBASE_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnattributeimage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnattributeimage.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,285 @@ +/* +* Copyright (c) 2007-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: image attribute model +* +*/ + + +#ifndef C_HNATTRIBUTEIMAGE_H +#define C_HNATTRIBUTEIMAGE_H + +#include <AknsSkinInstance.h> +#include "hnattributebase.h" + +class CFbsBitmap; +class CHnAttrImgProvider; +class CGulIcon; +class TLiwVariant; + +/** + * Image attribute. + * + * Class defining behaviour of the CHnAttributeBase interface + * to support images. The model is responsible for creation + * of the image, appropriately, depending on the source + * of the image. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnAttributeImage ) : public CHnAttributeBase +{ +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @return Fully constructed object. + */ + IMPORT_C static CHnAttributeImage* NewL(); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @return Fully constructed object. + */ + IMPORT_C static CHnAttributeImage* NewLC(); + + + /** + * Standard C++ virtual destructor. + * @since S60 5.0 + */ + ~CHnAttributeImage(); + + /** + * Sets skin id. + * + * @since S60 5.0 + * @param aSkinId Skind id. + */ + IMPORT_C void SetSkinId ( TAknsItemID aSkinId ); + + /** + * Sets file name source. + * Takes ownership of the buffer. Therefore the buffer must not be NULL. + * + * @since S60 5.0 + * @param aFileNameSrc A source filename, as a heap buffer pointer. + */ + IMPORT_C void SetFileNameSrc ( HBufC* aFileNameSrc ); + + /** + * Sets mif file. + * Takes ownership of the buffer. Therefore the buffer must not be NULL. + * + * @since S60 5.0 + * @param aMifFile Mif filename as a heap buffer pointer. + */ + IMPORT_C void SetMifFile ( HBufC* aMifFile ); + + /** + * Sets bitmap id. + * + * @since S60 5.0 + * @param aBitmapId Bitmap id. + */ + IMPORT_C void SetBitmapId ( TInt aBitmapId ); + + /** + * Sets mask id. + * + * @since S60 5.0 + * @param aMaskId Mask id. + */ + IMPORT_C void SetMaskId ( TInt aMaskId ); + + /** + * Sets application uid. + * + * @since S60 5.0 + * @param aApplicationUid Application uid. + */ + IMPORT_C void SetApplicationUid( TUid aApplicationUid); + + /** + * Sets bitmap. + * Takes ownership. + * + * @since S60 5.0 + * @param aBitmap Pointer to a bitmap. + */ + IMPORT_C void SetBitmap ( TLiwVariant* aBitmap ); + + /** + * Sets mask. + * Takes ownership. + * + * @since S60 5.0 + * @param aMask Pointer to a mask. + */ + IMPORT_C void SetMask ( TLiwVariant* aMask ); + + /** + * Gets icon, packed in CGulIcon. + * + * @see CGulIcon + * @since S60 5.0 + * @return Icon as a poitner to CGulIcon. + */ + IMPORT_C CGulIcon* GetIcon( TSize* aDesiredIconSize ); + + /** + * Please see the description in the base class @c CHnAttributeBase. + */ + CHnIconHolder* GetIconHolder( TSize* aDesiredIconSize ); + + /** + * Removes all LIW objects owned by this object. + * + * LIW objects owned by non-LIW objects that are owned by + * this object are also removed. + * @since S60 5.0 + */ + void RemoveLiwObjects(); + +private: + + /** + * Standard C++ constructor. + * + * @since S60 5.0 + */ + CHnAttributeImage(); + + /** + * Standard symbian 2nd phase constructor. + * + * @since S60 5.0 + */ + void ConstructL(); + + /** + * Method is used to prepare the image provider, + * if the icon is being fetched for the first time. + * Image providers are created appropriately depending on + * the image source, and they are responsible for providing + * bitmaps. + * + * @since S60 5.0 + * @return Error code when provider cannot be created. + */ + TInt Prepare(); + + /** + * Method is used to prepare the image provider. + * Image providers are created appropriately depending on + * the image source, and they are responsible for providing + * bitmaps. + * + * @since S60 5.0 + */ + void PrepareProviderL(); + + /** + * Returns true if the attribute loaded a mif icon. + * + * @since S60 5.0 + * @return True if image was loaded from mif. + */ + TBool IsThemeMif(); + + /** + * Returns true if the attribute is loaded from application uid. + * + * @since S60 5.0 + * @return True if image was loaded from application uid. + */ + TBool IsApplicationImage(); + + /** + * Returns true if the attribute is loaded from image file. + * + * @since S60 5.0 + * @return True if image was loaded from image file. + */ + TBool IsFileImageL(); + + /** + * Returns true if the attribute is loaded from liw buffer. + * + * @since S60 5.0 + * @return True if image was loaded from liw buffer. + */ + TBool IsLiwImage(); + +private: + + /** + * Skin id. + */ + TAknsItemID iSkinId; + + /** + * Mif file name. + */ + RBuf iMifFile; + + /** + * Bitmap id. + */ + TInt iBitmapId; + + /** + * Mask id. + */ + TInt iMaskId; + + /** + * Image source file name. + */ + RBuf iFileNameSrc; + + /** + * Application uid to fetch the image from. + */ + TUid iApplicationUid; + + /** + * Bitmap from Liw Buffer. + * Own. + */ + TLiwVariant* iBitmap; + + /** + * Mask from Liw Buffer. + * Own. + */ + TLiwVariant* iMask; + + /** + * Hn image provider + * Own. + */ + CHnAttrImgProvider* iAttrImgProvider; + + }; + +#endif // C_HNATTRIBUTEIMAGE_H + + + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnattributetext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnattributetext.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,107 @@ +/* +* Copyright (c) 2007-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: text attribute model +* +*/ + + +#ifndef C_HNATTRIBUTETEXT_H +#define C_HNATTRIBUTETEXT_H + +#include "hnattributebase.h" + +/** + * Image attribute. + * + * Class defining behaviour of the CHnAttributeBase interface + * to support text. The model is responsible for creation + * of the text, appropriately, depending on the definition in the + * xml. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnAttributeText ) : public CHnAttributeBase + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @return Fully constructed object. + */ + IMPORT_C static CHnAttributeText* NewL(); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @return Fully constructed object. + */ + IMPORT_C static CHnAttributeText* NewLC(); + + + /** + * Standard C++ virtual destructor. + */ + ~CHnAttributeText(); + + /** + * Sets the attribute value. + * + * @since S60 5.0 + * @param aValue A reference to a descriptor. + */ + IMPORT_C void SetValueL ( const TDesC8& aValue ); + +// From base class CHnAttributeBase +public: + + /** + * Returns the value of the attribute. + * + * @since S60 5.0 + * @return Value of the attribute. + */ + const TDesC8& Value( ); + +private: + + /** + * Standard C++ constructor. + * + * @since S60 5.0 + */ + CHnAttributeText(); + + /** + * Standard symbian 2nd phase constructor. + * + * @since S60 5.0 + */ + void ConstructL(); + +private: + + /** + * Attribute value. + */ + RBuf8 iValue; + + }; + +#endif // C_HNATTRIBUTETEXT_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnattrimgprovappimage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnattrimgprovappimage.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2007-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: image provider for application uid +* +*/ + + +#ifndef HNATTRIMGPROVAPPIMAGE_H_ +#define HNATTRIMGPROVAPPIMAGE_H_ + +#include <AknUtils.h> +#include "hnattrimgprovider.h" +#include "hnglobals.h" + +/** + * Image provider class for application uid. + * + * Image provider specialization that loads the image + * based on the application uid. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnAttrImgProvAppImage ) : public CHnAttrImgProvider + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aApplicationUid Application uid. + * @return Fully constructed object. + */ + IMPORT_C static CHnAttrImgProvAppImage* NewL( TUid aApplicationUid ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aApplicationUid Application uid. + * @return Fully constructed object. + */ + IMPORT_C static CHnAttrImgProvAppImage* NewLC( TUid aApplicationUid ); + + /** + * Virtual destructor. + * + * @since S60 5.0 + */ + virtual ~CHnAttrImgProvAppImage(); + +// from base class CHnAttrImgProvider +public: + + /** + * Returns value. + * + * @since S60 5.0 + * @return Value. + */ + const TDesC8& Value( ); + + /** + * This method should create a bitmap and its mask, + * by retrieving it form the application by a given uid (passed + * in the constructor) + * + * @param aId Parameter not used. + * @param aBitmap Output pointer to a bitmap. + * @param aMaskBitmap Output pointer to a mask. + * @since S60 5.0 + */ + void ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, + CFbsBitmap*& aMaskBitmap); + +private: + + /** + * Default constructor. + */ + CHnAttrImgProvAppImage(); + + /** + * Standard symbian 2nd phase constructor. + * + * @since S60 5.0 + * @param aApplicationUid Application uid. + */ + void ConstructL( TUid aApplicationUid ); + +private: // data + + /** + * Value + */ + TBuf8<KMaxLength> iValue; + + /** + * Application UID + */ + TUid iApplicationUid; + }; + +#endif // HNATTRIMGPROVAPPIMAGE_H_ + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnattrimgprovemptyimage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnattrimgprovemptyimage.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2007-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: image provider for empty image +* +*/ + + + +#ifndef C_HNATTRIMAGEPROVEMPTY_H +#define C_HNATTRIMAGEPROVEMPTY_H + +#include "hnattrimgprovider.h" + + +/** + * Image provider class for empty image. + * Image provider specialization that loads empty icon. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnAttrImgProvEmptyImage ) : public CHnAttrImgProvider + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @return Fully constructed object + */ + static CHnAttrImgProvEmptyImage* NewL(); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @return Fully constructed object + */ + static CHnAttrImgProvEmptyImage* NewLC(); + + /** + * Standard destructor. + * + * @since S60 5.0 + */ + virtual ~CHnAttrImgProvEmptyImage(); + +// from base class CHnAttrImgProvider +public: + + /** + * Value property getter. + * + * @since S60 5.0 + * @return value + */ + const TDesC8& Value( ); + +private: + + /** + * Defualt constructor. + * + * @since S60 5.0 + */ + CHnAttrImgProvEmptyImage(); + + /** + * Standard symbian 2nd phase constructor. + * + * @since S60 5.0 + */ + void ConstructL( ); + +private: // data + + /** + * Empty value. + */ + TBuf8<1> iEmptyVal; + }; + + +#endif // C_HNATTRIMGPROVEMPTY_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnattrimgprovfileimage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnattrimgprovfileimage.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2007-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: image provider for image file +* +*/ + + +#ifndef HNATTRIMGPROVFILEIMAGE_H_ +#define HNATTRIMGPROVFILEIMAGE_H_ + +#include "hnattrimgprovider.h" + +class CImageDecoder; + +/** + * Image provider class for empty image. + * Image provider specialization that loads image + * from an image file path. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnAttrImgProvFileImage ) : public CHnAttrImgProvider + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aFileName Image file name. + * @return Fully constructed object. + */ + IMPORT_C static CHnAttrImgProvFileImage* NewL( const TDesC& aFileName ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aFileName Image file name. + * @return Fully constructed object. + */ + IMPORT_C static CHnAttrImgProvFileImage* NewLC( const TDesC& aFileName ); + + /** + * Virtual destructor. + * + * @since S60 5.0 + */ + virtual ~CHnAttrImgProvFileImage(); + +// from base class CHnAttrImgProvider +public: + + /** + * Returns value. + * + * @return Value. + * @since S60 5.0 + */ + const TDesC8& Value(); + +private: + + /** + * Defualt constructor. + * + * @since S60 5.0 + */ + CHnAttrImgProvFileImage(); + + /** + * Standard symbian 2nd phase constructor. + * + * @since S60 5.0 + * @param aFileName Image file name. + */ + void ConstructL( const TDesC& aFileName ); + + /** + * Determines optimal size for a bitmap to store an image from file. + * + * The bitmap whose size is determindd by this method is supposed to + * be passed to CImageDecoder::Convert method. + * The size will be chosen so that the following two requirements are + * satisfied: + * 1. Bitmap size does not exceed the initial bitmap size passed in + * aBitmapSize. + * 2. CImageDecoder::Convert fills the whole bitmap with image data + * (there will be no empty space in the bitmap). + * Please note that the information about the size of the image in the + * file is accessible through the aImageDec object. + * @param aImageDec reference to a CImageDecoder object + * @param aBitmapSize maximal bitmap size, optimal bitmap size after + * execution + */ + void CorrectBitmapSize( CImageDecoder& aImageDec, TSize& aBitmapSize ); + +private: // data + + /** + * Value + */ + RBuf8 iValue; + + }; + +#endif // HNATTRIMGPROVFILEIMAGE_H_ + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnattrimgprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnattrimgprovider.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2007-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: base class for all image providers +* +*/ + + + +#ifndef C_HNATTRIMGPROVIDER_H +#define C_HNATTRIMGPROVIDER_H + +#include <e32base.h> +#include <gulicon.h> +#include <AknUtils.h> +#include "SVGRequestObserver.h" +#include "hniconholder.h" + + +/** + * Allows for removing an item from a cleanup stack without using + * CleanupStack::Pop(). + * This is useful when an item must be removed from the cleanup stack + * but it is not possible to use Pop() because some other items have + * been pushed onto cleanup stack after that item. + */ +NONSHARABLE_CLASS( TDismissableCleaner ) + { +public: + /** + * Constructor. + * + * @param aToBeDeletedOnLeave pointer to a memory to be freed on leave. + */ + TDismissableCleaner( TAny* aToBeDeletedOnLeave ); + + /** + * The Close method - to be called during the cleanup process. + * It simply deletes the object passed as parameter to constructor + * unless Dismiss() has been called. + */ + void Close(); + + /** + * Dismiss the deletion. + * Call this method to prevent the memory freeing on leave. + * This is an equivalent of removing item from cleanup stack with Pop(). + */ + void Dismiss(); +private: + /** + * Pointer to memory to be deleted on leave. + * Not own. + */ + TAny* mToBeDeletedOnLeave; + }; + +/** + * Image provider class interface. + * Interface for attribute image classes. Provides methods + * for obtainnig values and icons. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnAttrImgProvider ) : public CBase + { + +public: + + /** + * Standard destructor. + * + * @since S60 5.0 + */ + ~CHnAttrImgProvider(); + + /** + * Gets icon. + * + * @since S60 5.0 + * @param aDesiredSize Desired size of the icon. + * @return Icon as a CGulIcon pointer. + */ + virtual CGulIcon* GetIcon( TSize* aDesiredIconSize ); + + /** + * Gets icon holder which contains the icon that GetIcon returns. + * + * @param aDesiredSize Desired size of the icon. + * @return icon hoder that contains the icon (may return NULL). + */ + virtual CHnIconHolder* GetIconHolder( TSize* aDesiredIconSize ); + + /** + * Removes all LIW objects owned by this object. + * + * LIW objects owned by non-LIW objects that are owned by + * this object are also removed. + * @since S60 5.0 + */ + virtual void RemoveLiwObjects(); + +protected: + + /** + * Standard constructor. + * + * @since S60 5.0 + */ + CHnAttrImgProvider(); + + /** + * Creates icon. + * + * @since S60 5.0 + * @param aBitmap bitmap + * @param aMask mask + */ + void CreateIconL( CFbsBitmap* aBitmap, CFbsBitmap* aMask ); + + +protected: + + /** + * Icon holder - the object that owns the CGulIcon that this + * provider creates. + * Co-own(CHnIconHolder is ref-counted). + */ + CHnIconHolder* iIconHolder; + + }; + + +#endif // C_HNATTRIMGPROVIDER_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnattrimgprovliwimage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnattrimgprovliwimage.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2007-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: image provider for liw buffer +* +*/ + + +#ifndef HNATTRIMGPROVLIWIMAGE_H_ +#define HNATTRIMGPROVLIWIMAGE_H_ + +#include <AknUtils.h> +#include "hnattrimgprovider.h" +#include "hnglobals.h" + +class TLiwVariant; +class CLiwBitmapBuffer; + +/** + * Image provider class for empty image. + * Image provider specialization that loads image + * froma an liw buffer. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnAttrImgProvLiwImage ) : public CHnAttrImgProvider + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aBitmap Pointer to bitmap. + * @param aMaskBitmap Poitner to mask. + * @return Fully constructed object. + */ + IMPORT_C static CHnAttrImgProvLiwImage* NewL( TLiwVariant*& aBitmap, + TLiwVariant*& aMaskBitmap ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aBitmap Pointer to bitmap. + * @param aMaskBitmap Poitner to mask. + * @return Fully constructed object. + */ + IMPORT_C static CHnAttrImgProvLiwImage* NewLC( TLiwVariant*& aBitmap, + TLiwVariant*& aMaskBitmap ); + + /** + * Virtual destructor. + * + * @since S60 5.0 + */ + virtual ~CHnAttrImgProvLiwImage(); + + /** + * Removes all LIW objects owned by this object. + * + * LIW objects owned by non-LIW objects that are owned by + * this object are also removed. + * @since S60 5.0 + */ + virtual void RemoveLiwObjects(); + +// from base class CHnAttrImgProvider +public: + + /** + * Returns the value. + * + * @since S60 5.0 + * @return Value + */ + const TDesC8& Value(); + +private: + + /** + * Defualt constructor. + * + * @since S60 5.0 + */ + CHnAttrImgProvLiwImage(); + + /** + * Standard 2nd pahse symbian constructor. + * + * @since S60 5.0 + * @param aBitmap Pointer to bitmap. + * @param aMaskBitmap Poitner to mask. + */ + void ConstructL( TLiwVariant*& aBitmap, TLiwVariant*& aMaskBitmap ); + + /** + * Creates icon whose bitmaps are owned externally by CLiwBitmapBuffer objects. + * + * @param aBitmap Primary icon bitmap. + * @param aMask Icon mask. + * @param aExtBmp Buffer that owns the primary bitmap of the icon. + * @param aExtMask Buffer that owns the mask. + */ + void CreateExtIconL( CFbsBitmap* aBitmap, CFbsBitmap* aMask, + CLiwBitmapBuffer* aExtBmp, CLiwBitmapBuffer* aExtMask ); + + /** + * Creates Bitmap from variant which can be a handle or a descriptor. + * + * @since S60 5.0 + * @param aVariant Contains bitmap. + * @return Bitmap. + */ + CFbsBitmap* CreateBitmapFromVariantL( const TLiwVariant& aVariant ); + + /** + * Retrieves bitmap handle from a TLiwVariant object. + * The reason why such function is needed is that bitmap handle can be + * stored in many integer types. + * + * @param aVariant a variant from which to extract the handle + * @param aHandle will contain the handle on successful execution + * @return KErrNone if handle extracted successfully, KErrNotFound if + * the variant did not contain anything that can be cast to + * integer. + */ + TInt ExtractBitmapHandleFromVariant( const TLiwVariant& aVariant, + TInt& aHandle ); + +private: // data + + /** + * Value. + */ + TBuf8<KMaxLength> iValue; + + }; + +#endif // HNATTRIMGPROVLIWIMAGE_H_ + + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnattrimgprovsvgimage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnattrimgprovsvgimage.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,167 @@ +/* +* Copyright (c) 2007-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: image provider for image file +* +*/ + + +#ifndef HNATTRIMGPROVSVGIMAGE_H_ +#define HNATTRIMGPROVSVGIMAGE_H_ + +#include "hnattrimgprovider.h" + +class CSvgEngineInterfaceImpl; + +/** + * Image provider class for empty image. + * Image provider specialization that loads image + * from an image file path. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnAttrImgProvSvgImage ): + public CHnAttrImgProvider, + public MSvgRequestObserver + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aFileName Image file name. + * @return Fully constructed object. + */ + IMPORT_C static CHnAttrImgProvSvgImage* NewL( const TDesC& aFileName ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aFileName Image file name. + * @return Fully constructed object. + */ + IMPORT_C static CHnAttrImgProvSvgImage* NewLC( const TDesC& aFileName ); + + /** + * Virtual destructor. + * + * @since S60 5.0 + */ + virtual ~CHnAttrImgProvSvgImage(); + + /** + * Gets icon. + * + * @since S60 5.0 + * @param aDesiredSize Desired size of the icon. + * @return Icon as a CGulIcon pointer. + */ + CGulIcon* GetIcon( TSize *aDesiredIconSize ); + + /** + * Gets icon holder which contains the icon that GetIcon returns. + * + * @param aDesiredSize Desired size of the icon. + * @return icon hoder that contains the icon (may return NULL). + */ + CHnIconHolder* GetIconHolder( TSize* aDesiredIconSize ); + + +private: + + /** + * Renders the icon. + * + * @since S60 5.0 + * @param aDesiredSize Desired size of the icon. + * @return Error code. + */ + TInt RenderIcon( TSize aDesiredIconSize ); + + /** + * Defualt constructor. + * + * @since S60 5.0 + */ + CHnAttrImgProvSvgImage(); + + /** + * Standard symbian 2nd phase constructor. + * + * @since S60 5.0 + * @param aFileName Image file name. + */ + void ConstructL( const TDesC& aFileName ); + +public : //from MSvgRequestObserver + + /** + * @see MSvgRequestObserver:UpdateScreen + */ + void UpdateScreen(); + + /** + * @see MSvgRequestObserver:MSvgRequestObserver + */ + TBool ScriptCall( const TDesC& aScript, CSvgElementImpl* aCallerElement ); + + /** + * @see MSvgRequestObserver:FetchImage + */ + TInt FetchImage( const TDesC& aUri, RFs& aSession, RFile& aFileHandle ); + + /** + * @see MSvgRequestObserver:FetchFont + */ + TInt FetchFont( const TDesC& aUri, RFs& aSession, RFile& aFileHandle ); + + /** + * @see MSvgRequestObserver:UpdatePresentation + */ + void UpdatePresentation(const TInt32& aNoOfAnimation); + +private: // data + + /** + * Bitmap. Not Own. GulIcon takes ownership. + */ + CFbsBitmap* iBitmap; + + /** + * Mask. Not Own. GulIcon takes ownership. + */ + CFbsBitmap* iMask; + + /** + * Mask. Own. Dummy for the engine. + */ + CFbsBitmap* iDummyBitmap; + + /** + * SVG Engine instance + */ + CSvgEngineInterfaceImpl* iSvgEngine; + + /** + * Handle to the svg dom tree. + */ + TInt iHandle; + + }; + +#endif // HNATTRIMGPROVSVGIMAGE_H_ + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnattrimgprovthememif.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnattrimgprovthememif.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2007-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: image provider for mif file +* +*/ + + + +#ifndef C_HNATTRIMGPROVTHEMEMIF_H +#define C_HNATTRIMGPROVTHEMEMIF_H + +#include "hnattrimgprovider.h" +#include "hnglobals.h" + +/** + * Image provider class for empty image. + * Image provider specialization that loads image + * froma an image file path. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnAttrImgProvThemeMif ) : public CHnAttrImgProvider + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aSkinId Skin id + * @param aFile File name + * @param aBitmapId Bitmap id + * @param aMaskId Mask id + * @return Fully constructed object. + */ + IMPORT_C static CHnAttrImgProvThemeMif* NewL( TAknsItemID aSkinId, + const TDesC& aFile, TInt aBitmapId, TInt aMaskId ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aSkinId Skin id + * @param aFile File name + * @param aBitmapId Bitmap id + * @param aMaskId Mask id + * @return Fully constructed object. + */ + IMPORT_C static CHnAttrImgProvThemeMif* NewLC( TAknsItemID aSkinId, + const TDesC& aFile, TInt aBitmapId, TInt aMaskId ); + + /** + * Virtual destructor. + * + * @since S60 5.0 + */ + virtual ~CHnAttrImgProvThemeMif(); + +// from base class CHnAttrImgProvider +public: + + /** + * Returns the value. + * + * @since S60 5.0 + * @return Value + */ + const TDesC8& Value( ); + + /** + * This method should create a bitmap and its mask, + * by retrieving it form the application by a given uid (passed + * in the constructor) + * + * @param aId Parameter not used. + * @param aBitmap Output pointer to a bitmap. + * @param aMaskBitmap Output pointer to a mask. + */ + void ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, + CFbsBitmap*& aMaskBitmap); + + +private: + + /** + * Default constructor. + * + * @since S60 5.0 + */ + CHnAttrImgProvThemeMif(); + + /** + * Standard 2nd pahse symbian constructor. + * + * @since S60 5.0 + * @param aSkinId Skin id + * @param aFile File name + * @param aBitmapId Bitmap id + * @param aMaskId Mask id + */ + void ConstructL( TAknsItemID aSkinId, + const TDesC& aFile, TInt aBitmapId, TInt aMaskId ); + + /** + * Checks if mask id and bitmap id are in the range of mif file ids. + * + * @since S60 5.0 + * @return ETrue if ids are in the range of mif file ids. Else return EFalse. + */ + TBool ValidateIconIds(); + +private: // data + + /** + * Value. + */ + TBuf8<KMaxLength> iValue; + + /** + * Skin id. + */ + TAknsItemID iSkinId; + + /** + * File name. + */ + TPtrC iFile; + + /** + * Bitmap id. + */ + TInt iBitmapId; + + /** + * Mask id. + */ + TInt iMaskId; + + }; + + +#endif // C_HNATTRIMGPROVTHEMEMIF_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnbuttonmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnbuttonmodel.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,192 @@ +/* +* Copyright (c) 2007-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: toolbar button model +* +*/ + + +#ifndef C_HNBUTTONMODEL_H +#define C_HNBUTTONMODEL_H + +#include <e32base.h> + +class CGulIcon; +class CHnAttributeBase; + +/** + * Button model class. + * + * Class represent a toolbar button. It contains all of the + * information essential to displaying a button in the + * presentationlayer. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnButtonModel ) : public CBase + { +public: + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aIndex Button index in the toolbar. + */ + IMPORT_C static CHnButtonModel* NewLC( TInt aIndex ); + + /** + * Virtual Destructor. + * + * @since S60 5.0 + */ + IMPORT_C ~CHnButtonModel(); + + /** + * Gets icon model. + * + * @since S60 5.0 + * @return Icon for button, NULL if not exist + */ + IMPORT_C CGulIcon* GetIcon() const; + + /** + * Sets icon for button model. + * + * @since S60 5.0 + * @param aIcon Icon for button, transfers ownership + */ + IMPORT_C void SetIcon( CHnAttributeBase* aAttribute ); + + /** + * Gets tooltip for button model. + * + * @since S60 5.0 + * @return Help text corresponding to button mdoel + */ + IMPORT_C const TDesC& GetButtonText() const; + + /** + * Sets help text for button model. + * + * @since S60 5.0 + * @param aToolTip Text to display + */ + IMPORT_C void SetHelpTextL( const TDesC& aToolTip ); + + /** + * Gets dimmed. + * + * @since S60 5.0 + * @return iDimmed + */ + IMPORT_C TBool GetDimmed() const; + + /** + * Sets dimmed + * + * @since S60 5.0 + * @param aDimmed Sets button state to dimmed + */ + IMPORT_C void SetDimmed( TBool aDimmed ); + + /** + * Gets index of button model. + * + * @since S60 5.0 + * @return Index + */ + IMPORT_C TInt GetIndex() const; + + /** + * Gets command for button model. + * + * @since S60 5.0 + * @return Event id + */ + IMPORT_C TInt GetEventId() const; + + /** + * Sets command for button model. + * + * @since S60 5.0 + * @param aEventId Id of event to invoke when button pressed + */ + IMPORT_C void SetEventId( TInt aEventId ); + + /** + * Removes all LIW objects owned by this object. + * + * LIW objects owned by non-LIW objects that are owned by + * this object are also removed. + * @since S60 5.0 + */ + void RemoveLiwObjects(); + +private: + + /** + * Default constructor. + * + * @since S60 5.0 + * @param aIndex Index of the button, being created. + */ + CHnButtonModel( TInt aIndex ); + + /** + * Second phase constructor. + * + * @since S60 5.0 + */ + void ConstructL(); + +private: // data + + /** + * Index of button, indicates the position on the toolbar. + * Values: 0, 1, 2 applicable. + */ + TInt iIndex; + + /** + * Event Id. + */ + TInt iEventId; + + /** + * Text to be displayed as help for button. + * Own + */ + RBuf iToolTip; + + /** + * Indicates if button should be dimmed. + */ + TBool iDimmed; + + /** + * Icon displayed on the button. + * Own + */ + //CGulIcon* iIcon; + + /** + * Own - icon attribute; + */ + CHnAttributeBase* iIconAttribute; + + }; + +#endif // C_HNBUTTONMODEL_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hneventhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hneventhandler.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,190 @@ +/* +* Copyright (c) 2007-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: event handler class +* +*/ + + +#ifndef C_HNEVENTHANDLER_H +#define C_HNEVENTHANDLER_H + +#include <liwcommon.h> + +class CHnMetaDataModel; +class CHnMdAction; +class MLiwInterface; +class CLiwServiceHandler; +class CLiwGenericParamList; +class CHnMdBaseKey; +class TLiwVariant; +class CHnMdItem; +class CHnActionModel; +class MHnMdModelEventObserver; +class CHnServiceHandler; +class MHnControllerInterface; + +/** + * Event handler class. + * + * Event Handler is designed to handle events. + * It reveives an event id from the UI, + * mapps this event into an appropriate action, + * and runs this action. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS(CHnEventHandler) : public CBase, public MLiwNotifyCallback +{ +public: // Constructors and destructor + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aModelObserver Model event observer. + * @param aController Interface enabling to issues request to Hn engine. + * @return Fully constructed object. + */ + static CHnEventHandler* NewL( MHnMdModelEventObserver& aModelObserver, + MHnControllerInterface& aController ); + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aModelObserver Model event observer. + * @param aController Interface enabling to issues request to Hn engine. + * @return Fully constructed object. + */ + static CHnEventHandler* NewLC( MHnMdModelEventObserver& aModelObserver, + MHnControllerInterface& aController); + + /** + * Destructor. + * + * @since S60 5.0 + */ + ~CHnEventHandler(); + + /** + * Executes the action that was found in the Model. + * + * @since S60 v3.2 + * @see CHnActionModel + * @param aActionModel A pointer to the object of the CHnActionModel class. + * @return Error code. KErrNone in case of a correct execution (even if + given action was not found). KErrNotFound in case of incorrect + action parameters. + */ + IMPORT_C TInt ExecuteActionL( CHnActionModel* aActionModel ); + +private: + + /** + * Constructor for performing 1st stage construction + * + * @since S60 5.0 + * @param aModelObserver A model event observer reference. + * @param aController A HH controller reference. + */ + CHnEventHandler( MHnMdModelEventObserver& aModelObserver, + MHnControllerInterface& aController ); + + /** + * EPOC default constructor for performing 2nd stage construction + * + * @since S60 5.0 + */ + void ConstructL(); + + /** + * Notifies UI about actions that can be passed back to the UI, + * i.e. openning nested suites, widget change. + * + * @since S60 5.0 + * @param aActionModel Model of the action. + * @return Error code + */ + TInt ExecuteInternalActionL( CHnActionModel* aActionModel ); + + /** + * Executes action from Extension Manager. + * + * @since S60 v5.0 + * @param aActionModel Model of the action. + * @return Error code + */ + TInt ExecuteExtensionManagerActionL( CHnActionModel* aActionModel ); + + /** + * Uses default mechanism to execute an action. + * + * @since S60 v5.0 + * @param aActionModel Model of the action. + * @return Error code + */ + TInt ExecuteStandardActionL( CHnActionModel* aActionModel ); + + /** + * Extracts extension uid from the action. + * + * @since S60 v5.0 + * @param aInterface Interface to invoke action on. + * @param aUid The resulting UID. + * @return Error code + */ + TInt ExtractUidFromActionL( const TDesC8& aInterface, TUid& aUid ); + + +// from MLiwNotifyCallback +public : + + /** + * Handles notification. + * + * @param aCmdId The Id of the command triggered. + * @param aEventId The Id of the event. + * @param aEventParamList Parameters to event. + * @param aInParamList Input parameter list. + * + * @return Error code. + */ + TInt HandleNotifyL( TInt aCmdId, TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& aInParamList ); + +private: // data + + /** + * Not own. + * Reference to HnEngine - Event observer. + */ + MHnMdModelEventObserver& iEventObserver; + + /** + * Own. + */ + CHnServiceHandler* iServiceHandler; + + /** + * Not own. + * Reference to App UI - Event observer. + */ + MHnControllerInterface& iControllerInterface; + +}; + +#endif // C_HNEVENTHANDLER_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnextbmpiconholder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnextbmpiconholder.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,70 @@ +/* +* 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 MMEXTBMPICONHOLDER_H +#define MMEXTBMPICONHOLDER_H + +#include "hniconholder.h" + +class CLiwBitmapBuffer; + +/** + * This is an extended version of @c CHnIconHolder which holds a CGulIcon that does + * not own the bitmaps and CLiwBitmapBuffer objects that do. + * + * Such class was needed because some of the bitmaps for icons are obtained from + * CLiwBitmapBuffer objects and there is no way to transfer ownership of that + * bitmaps from them. It is not possible to make copies of that bitmaps either, + * because some of them are not CFbsBitmaps but CAknBitmaps. + */ +class CHnExtBmpIconHolder: public CHnIconHolder + { +public: + /** + * Sets the icon to be stored in this icon holder along with the bitmap buffers. + * This method should be called only once. If you want to store another icon + * simply call Close() on this icon holder and then create a new icon holder + * to store the new icon. + * + * @param aGulIcon Icon to store in this icon holder. + * @param aBmpBuffer The buffer that owns the primary bitmap. + * @param aMaskBuffer The buffer that owns the mask bitmap. + */ + IMPORT_C void SetGulIcon( CGulIcon* aGulIcon, CLiwBitmapBuffer* aBmpBuffer, CLiwBitmapBuffer* aMaskBuffer ); + + /** + * Standard C++ virtual destructor. + */ + virtual ~CHnExtBmpIconHolder(); + +private: // data + + /** + * Liw bitmap buffer that owns the primary bitmap for the icon. + * Co-owns (CLiwBitmapBuffer are ref-counted). + */ + CLiwBitmapBuffer* iBmpBuffer; + + /** + * Liw bitmap buffer that owns the mask bitmap for the icon. + * Co-owns (CLiwBitmapBuffer are ref-counted). + */ + CLiwBitmapBuffer* iMaskBuffer; + }; + +#endif // MMEXTBMPICONHOLDER_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hniconholder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hniconholder.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,69 @@ +/* +* 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 MMICONHOLDER_H +#define MMICONHOLDER_H + +#include <e32base.h> + +class CGulIcon; + +/** + * A ref-counted icon holder that can be useful if you want to store + * an icon from the model for an unspecified period of time. + * By getting the icon holder instead of the icon you can share ownership + * over the icon by calling Open() on the icon holder. Then Close() must + * be called when the icon is no longer needed, otherwise a memory leak + * will occur. + */ +NONSHARABLE_CLASS( CHnIconHolder ): public CObject + { +public: + /** + * Sets the icon to be stored in this icon holder. + * This method should be called only once. If you want to store another icon + * simply call Close() on this icon holder and then create a new icon holder + * to store the new icon. + * + * @param aGulIcon Icon to store in this icon holder. + */ + IMPORT_C void SetGulIcon( CGulIcon* aGulIcon ); + + /** + * Returns the icon held by this icon holder. + * + * @return Icon held by this object (NULL value possible). + */ + IMPORT_C CGulIcon* GetGulIcon() const; + + /** + * Standard C++ destructor. + */ + ~CHnIconHolder(); + +private: // data + + /** + * A CGulIcon object owned by this icon holder. + * Can possibly be NULL. + * Own. + */ + CGulIcon* iGulIcon; + }; + +#endif // MMICONHOLDER_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnitemfocushandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnitemfocushandler.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,232 @@ +/* +* 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: Application UI class +* Version : %version: 2 % << Don't touch! Updated by Synergy at check-out. +*/ +#ifndef HNITEMFOCUSHANDLER_H +#define HNITEMFOCUSHANDLER_H + +#include <e32base.h> +#include <e32std.h> + +class CHnSuiteModel; + +/** + * Class representing the focus item to be queued. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +class TFocusQueueItem + { +public: + + /** + * Constructor. Sets the trigger time on construction. + * + * @since S60 v5.0 + * @param aItemId Index of the item in the suite model. + */ + TFocusQueueItem( TInt aItemId, TInt aEventId ); + + /** + * Fetches the focus item trigger time. + * + * @since S60 v5.0 + * @return Time when the event was triggered. + */ + TTime TriggerTime(); + + /** + * Fetches the focus/unfocus item id. + * + * @since S60 v5.0 + * @return Suite model item id of the focused/unfocused item. + */ + TInt ItemId(); + + /** + * Fetches the focus/unfocus item id. + * + * @since S60 v5.0 + * @return Suite model item id of the focused/unfocused item. + */ + TInt EventId(); + + /** + * Compares queued items by triggered time. + * + * @since S60 v5.0 + * @param aItem1 First item to compare. + * @param aItem2 Second item to compare. + * @return 1 if aItem1 was triggered earlier than aItem2. + * -1 if aItem1 was triggered later than aItem2. + * 0 if aItem1 was triggered at the same time as aItem2. + */ + static TInt CompareByTriggerTime( const TFocusQueueItem& aItem1, + const TFocusQueueItem& aItem2 ); + /** + * Compares queued items by triggered time. + * + * @since S60 v5.0 + * @param aItem1 First item to compare. + * @param aItem2 Second item to compare. + * @return ETrue if aItem1 is equal to aItem2 regarding the item id. + * EFalse if aItem1 is not equal to aItem2 regarding the item id. + */ + static TBool CompareByItemId( const TFocusQueueItem& aItem1, + const TFocusQueueItem& aItem2 ); + +private: + + /** + * Item id. + * Own. + */ + TInt iItemId; + + /** + * Trigger time. + * Own. + */ + TTime iTriggerTime; + + /** + * Event type. + */ + TInt iEventId; + + }; + +/** + * Item focus handler class. + * + * This is an active object which handles focus/unfocus event triggering. + * This class causes focus/unfocus events to be run without performance impact + * on the UI. The focus/unfocus events are queued. If incoming events logically + * cancel the queued events, the appropriate events are removed from the queue. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnItemFocusHandler ) : public CActive + { +public: + + /** + * Virtual Destructor. + * + * @since S60 5.0 + */ + ~CHnItemFocusHandler(); + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aSuiteModel The suite model for which focus events are handled. + */ + static CHnItemFocusHandler* NewL( CHnSuiteModel* aSuiteModel ); + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aSuiteModel The suite model for which focus events are handled. + */ + static CHnItemFocusHandler* NewLC( CHnSuiteModel* aSuiteModel ); + +public: + + /** + * Called to initiate item focus action handling. + * + * @since S60 v5.0 + * @param aEventId The type of event. Can be KIdFocusGain or KIdFocusLost. Otherwise focus actions are not triggered. + * @param aItemId Index of the item in the suite model. + */ + void SetFocusL( TInt aEventId, TBool aItemId ); + +private: + + /** + * C++ default constructor. + * + * @since S60 v5.0 + */ + CHnItemFocusHandler(); + + /** + * Second-phase constructor. + * + * @since S60 v5.0 + * @param aSuiteModel The suite model for which focus events are handled. + */ + void ConstructL( CHnSuiteModel* aSuiteModel ); + +private: + + /** + * Handles completion. In fact the request is completed immediately after activating the object. + * This method calls focus/unfocus action events. + * + * @since S60 v5.0 + */ + void RunL(); + + /** + * Run when request is cancelled. + */ + void DoCancel(); + + /** + * Overriden to handle leaves from RunL(). Default implementation causes + * the active scheduler to panic. + * + * @since S60 v5.0 + * @param aError The Error code. + * @return Id The eroor code. + */ + TInt RunError(TInt aError); + + /** + * Removes duplicated items. E.g. if a request to focus an item has been triggered + * when there is still a request to unfocus that item pending in the queue. Then the unfocus + * event will be removed from the queue and the event and only the focus event is triggered. + * + * @since S60 v5.0 + * @param aFocusItem The item to be compared. + * @param aEventId focus or unfocus event. + */ + void RemoveDuplicatedItem( const TFocusQueueItem& aFocusItem ); + +private: + + /** + * The suite model for which focus events are handled. + * Not own. + */ + CHnSuiteModel* iSuiteModel; + + /** + * Focus Queue. + * Own. + */ + RArray<TFocusQueueItem> iFocusQueue; + + }; + +#endif // HNITEMFOCUSHANDLER_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnitemmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnitemmodel.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,392 @@ +/* +* Copyright (c) 2007-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: item presentation model +* +*/ + + +#ifndef HNITEMMODEL_H_ +#define HNITEMMODEL_H_ + +#include <e32base.h> +#include <e32hashtab.h> + +class CHnMenuItemModel; +class MHnMenuItemModelIterator; +class CHnActionModel; +class CHnToolbarModel; +class CHnEventHandler; +class CHnAttributeBase; +class CLiwGenericParamList; +class CHnButtonModel; + +/** + * Item flag. Used to indicate if item is move locked, + * remove locked or runs. + */ +enum TItemFlag + { + EItemFlagDefault = 0, + EItemFlagRemoveLocked = 1, + EItemFlagMoveLocked = 2, + EItemFlagRunning = 4, + EItemFlagDrmExpired = 8 + }; + +/** + * Service item type. Type of the item in service. + */ +enum TMcsItemType + { + EItemTypeUnknown = 0, + EItemTypeFolder, + EItemTypeSuite, + EItemTypeApplication, + EItemTypeParentFolder, + }; + +/** + * Item presentation model class. + * + * Instance of this class represents item visible + * on the screen. A single CHnMdItem may lead to + * creation of multiple CHnItemModel instances. + * + * @see CHnMdItem + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnItemModel ) : public CBase + { + +public: + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @return Fully constructed object. + */ + IMPORT_C static CHnItemModel* NewL(); + + /** + * Virtual Destructor. + * + * @since S60 5.0 + */ + ~CHnItemModel(); + + /** + * Sets menu item model. + * + * @since S60 5.0 + * @param aMenu visual model for menu item, transfers ownership. + */ + IMPORT_C void SetMenuItemModel( CHnMenuItemModel* aMenu ); + + /** + * Gets menu item model. + * + * @since S60 5.0 + * @return menu item structure + */ + MHnMenuItemModelIterator* GetMenuStructure(); + + /** + * Gets actions models. + * + * @param aId Event id + * @return Array of actions models corresponding to event id + */ + IMPORT_C CArrayPtr<CHnActionModel>* GetActions( TInt aId ); + + /** + * Gets actions models. + * + * @return List of all actions for every event. + */ + IMPORT_C RHashMap< TInt, CArrayPtr<CHnActionModel>* >& GetActions(); + + /** + * Gets toolbar model. + * + * @since S60 5.0 + * @return Toolbar model for item, NULL if not exist + */ + IMPORT_C const CHnToolbarModel* GetToolbarModel() const; + + /** + * Sets toolbar model. + * + * @since S60 5.0 + * @param aToolbar Toolbar model for item, transfers ownership + */ + IMPORT_C void SetToolbarModel( CHnToolbarModel* aToolbar ); + + /** + * event handling + * + * @since S60 5.0 + * @param aEventHandler An instance of event handler. + * @param aEventId Event id. + * @param aEventParameters Parameters of that event + * @return Error code + */ + TInt OfferHnEventL( CHnEventHandler & aEventHandler, + const TInt aEventId, CLiwGenericParamList* aEventParameters ); + + /** + * Sets attribute. + * + * @since S60 5.0 + * @param aAttr Attribute name + */ + IMPORT_C void SetAttributeL( CHnAttributeBase* aAttr ); + + /** + * Gets attribute. + * + * @since S60 5.0 + * @param aAttribute Attribute name. + * @return Attribute instance. + */ + IMPORT_C CHnAttributeBase* GetAttribute( const TDesC8 & aAttribute ); + + /** + * Clears attributes. + * + * @since S60 5.0 + */ + IMPORT_C void ClearAttributesL(); + + /** + * Gets template name. + * + * @since S60 5.0 + * @return Template name + */ + IMPORT_C const TDesC8& GetTemplate(); + + /** + * Sets middle soft key. + * + * @since S60 5.0 + * @param aMsk Msk model for item. + */ + IMPORT_C void SetMiddleSoftKey( CHnButtonModel* aMsk ); + + /** + * Gets middle soft key. + * + * @since S60 5.0 + * @return Msk model for item. + */ + IMPORT_C CHnButtonModel* GetMiddleSoftKey(); + + /** + * Sets template. + * + * @since S60 5.0 + * @param aTemplate Template name. + */ + IMPORT_C void SetTemplateL( const TDesC8& aTemplate ); + + /** + * Sets item's flag. + * + * @since S60 5.0 + * @param aFlag A flag to be set. + */ + IMPORT_C void SetFlag( TInt aFlag ); + + /** + * Removes all flags of the item. + * + * @since S60 5.0 + */ + IMPORT_C void ClearFlags(); + + /** + * Returns true if deleting the item is locked. + * + * @since S60 5.0 + * @return True if deleting the item is forbidden, otherwise - false + */ + IMPORT_C TBool IsDeleteLocked(); + + /** + * Returns true if moving the item is locked. + * + * @since S60 5.0 + * @return True if moving the item is forbidden, otherwise - false + */ + IMPORT_C TBool IsMoveLocked(); + + /** + * Returns true if the item is running. + * + * @since S60 5.0 + * @return True if the item is running, otherwise - false. + */ + IMPORT_C TBool IsRunning(); + + /** + * Returns true if the item drm rights are expired. + * + * @since S60 5.0 + * @return True if the item drm rights are expired, otherwise - false. + */ + IMPORT_C TBool IsDrmExpired(); + + /** + * Sets type of the item. + * + * @since S60 5.0 + * @param aType type + */ + IMPORT_C void SetType( const TDesC8& aType ); + + /** + * Sets custom id. + * + * @since S60 5.0 + * @param aCustomId Custom id. + */ + IMPORT_C void SetCustomId( TInt64 aCustomId ); + + /** + * Returns custom id. + * + * @since S60 5.0 + * @return Custom id. + */ + IMPORT_C TInt64 CustomId(); + + /** + * Returns the type of the item. + * + * @since S60 5.0 + * @return Item type. + */ + IMPORT_C TMcsItemType GetItemType(); + + /** + * Returns the uid of the item. + * + * @since S60 5.0 + * @return Item uid. + */ + IMPORT_C TUid GetItemUid(); + + /** + * Sets uid of the item. + * + * @since S60 5.0 + * @param Item uid. + */ + IMPORT_C void SetItemUidL( const TDesC8& aUid ); + + /** + * Deletes all action models. + * + * @since S60 5.0 + */ + IMPORT_C void DeleteAllActionModels(); + + /** + * Removes all LIW objects owned by this object. + * + * LIW objects owned by non-LIW objects that are owned by + * this object are also removed. + * @since S60 5.0 + */ + void RemoveLiwObjects(); + +private: + + /** + * Default constructor. + */ + CHnItemModel(); + + /** + * Second phase constructor. + */ + void ConstructL(); + +private: // data + + /** + * Template. + */ + RBuf8 iTemplate; + + /** + * Menu item structure + * Own + */ + CHnMenuItemModel* iMenuModel; + + /** + * Model for toolbar + * Own + */ + CHnToolbarModel* iToolbarModel; + + /** + * Actions corresponding to events + * event id <=> array of actions models + */ + RHashMap< TInt, CArrayPtr<CHnActionModel>* > iActions; + + /** + * Visual item model (Aakash) + */ + TBool iEditable; + + /** + * Attributes. + */ + RPointerArray<CHnAttributeBase> iAttrs; + + /** + * Flags. + */ + TInt iFlags; + + /** + * Type of an item. + */ + TMcsItemType iType; + + /** + * Uid of the item. + */ + TUid iUid; + + /** + * Custom Id. + */ + TInt64 iCustomId; + + /** + * Middel soft key model + * Own + */ + CHnButtonModel* iMskModel; + + }; + +#endif // HNITEMMODEL_H_ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnitemsorder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnitemsorder.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,275 @@ +/* +* Copyright (c) 2007-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: items order manager class +* +*/ + + +#ifndef HNITEMSORDER_H_ +#define HNITEMSORDER_H_ + +#include <e32base.h> +#include <e32cmn.h> + +/** + * Items order manager. + * + * Instances of this class control order of the items + * displayed within a suite. The keep and manage the + * complex relation between CHnMdItem, and consequenltly + * created CHnItemModels. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnItemsOrder ) : public CBase + { + +public: + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @return Fully constructed object. + */ + IMPORT_C static CHnItemsOrder* NewL(); + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @return Fully constructed object. + */ + IMPORT_C static CHnItemsOrder* NewLC(); + + /** + * Standard destructor. + * + * @since S60 5.0 + */ + ~CHnItemsOrder(); + + /** + * @since S60 5.0 + * @param aId Suite id, should be generated by IdGenrator + */ + IMPORT_C void SetSuiteId( TInt aId ); + + /** + * @since S60 5.0 + * @return id of the associated suite + */ + IMPORT_C TInt GetSuiteId() const; + + /** + * Removes item with given id. + * + * @since S60 5.0 + * @param aId id of the item to be removed + */ + IMPORT_C void RemoveItemId( TInt aId ); + + /** + * Insert an item referred to by an aId, to a suite. + * It is indicated that this item has been produced from + * CHnMdItem at index aDataModelItem. Evaluation indicates also + * that this item is produced on the index aIndex in that particular + * CHnMdItem. + * + * @since S60 5.0 + * @param aDataModelItem Index of CHnMdItem instance in the CHnMdSuite. + * @param aIndex Position in that CHnMdItem instance + * @param aId Id of the item model. + */ + IMPORT_C void InsertItemIdToL( TInt aDataModelItem, TInt aIndex, TInt aId ); + + /** + * Gets the item id at position aIndex, relative to the beginning + * of the items generated from CHnMdItem at index aDataModelItem + * + * @since S60 5.0 + * @param aDataModelItem Index of CHnMdItem instance in the CHnMdSuite. + * @param aIndex Position in that CHnMdItem instance. + */ + IMPORT_C TInt GetItemIdAt( TInt aDataModelItem, TInt aIndex ); + + /** + * Gets item id at specified position. + * + * @since S60 5.0 + * @param aPosition Position in the suite model. + * @return Item id + */ + IMPORT_C TInt GetItemIdAt( TInt aPosition ); + + /** + * Sets item id at given position. + * + * @since S60 5.0 + * @param aPosition Position in the suite model + * @param aId Item id + */ + IMPORT_C void SetItemIdAtL( TInt aPosition, TInt aId ); + + /** + * Gets item position. + * + * @since S60 5.0 + * @param aId Item id + * @return Item position. + */ + IMPORT_C TInt GetItemPosition( TInt aId ); + + /** + * Count property getter. + * + * @since S60 5.0 + * @return Count + */ + IMPORT_C TInt Count(); + + /** + * Informs the class of the count of CHnMdItem instances + * in the suite. + * + * @since S60 5.0 + * @param aItemCounts Number of CHnMdItems in the suite. + */ + IMPORT_C void DefineModelItemCountL( TInt aItemCounts ); + + /** + * Gets the count of CHnMdItem instances + * in the suite. + * + * @since S60 5.0 + */ + IMPORT_C TInt GetModelItemCount(); + + /** + * Gets the ids for a particular CHnMdItem instance. + * + * @since S60 5.0 + * @param aDataModelItem Index of the CHnMdItem instance + * @param aIds Array of ids. + */ + IMPORT_C void GetIdsForL( TInt aDataModelItem, + RArray< TInt >& aIds ); + + /** + * Operator to access id at a particular position in the suite. + * + * @since S60 5.0 + * @param aPosition Position in the suite. + */ + IMPORT_C TInt operator[]( TInt aPosition ); + + /** + * Informs the instance of the class that the associated suite + * has been evaluated. + * + * @since S60 5.0 + */ + IMPORT_C void SuiteEvaluated(); + + /** + * Informs the instance of the class that the associated item + * has been evaluated. + * + * @since S60 5.0 + * @param aIndex Item of the model that has been evaluated. + */ + IMPORT_C void ItemEvaluated( TInt aIndex ); + + /** + * Determined if the suite is ready to be shown. + * + * @since S60 5.0 + * @return Value determinig if associated suite is ready to show. + */ + IMPORT_C TBool IsSuiteReadyToShow(); + + /** + * Marks suite as uninitialized. + * + */ + IMPORT_C void MarkSuiteUninitialized(); + +private: + + /** + * Default constructor. + * + * @since S60 5.0 + */ + CHnItemsOrder(); + + /** + * Stnadard 2nd stage symbian constructor. + * + * @since S60 5.0 + */ + void ConstructL(); + + /** + * @since S60 5.0 + * @param aDataModelItem data model item + * @return start index + */ + TInt CountStartIndexFor( TInt aDataModelItem ); + + /** + * @since S60 5.0 + * @param aIndex index + * @return model number + */ + TInt CountModelNumberFor( TInt aIndex ); + +private: // data + + /** + * Unique id for the associated suite. + * Should be generated via IdGenerator mechanism. + */ + TInt iSuiteId; + + /** + * Indicates if the associated suite has been initialized + * with the first evaluation. + */ + TBool iSuiteEvaluated; + + /** + * Array of values indication if each of associated CHnMdItems + * has been initialized with first evaluation. + */ + RArray<TBool> iItemsEvaluated; + + /** + * Items order counts + * Holds the counts of CHnItemModels, for each of CHnMdItems + */ + RArray<TInt> iItemsOrderCounts; + + /** + * Complex items order. + * Hold the order of CHnItemModels in a suite associated with the + * instance of this class. + */ + RArray<TInt> iComplexItemsOrder; + + }; + +#endif // HNITEMSORDER_H_ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnmenuitemmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnmenuitemmodel.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,261 @@ +/* +* 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: menu item presentation model +* +*/ + + +#ifndef HNMENUITEMMODEL_H_ +#define HNMENUITEMMODEL_H_ + +#include <e32base.h> + +class CHnMenuItemModel; + +/** + * Menu item model iterator. + * + * Used to iterate on menu items structure. Provides basic + * iterator interface. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +class MHnMenuItemModelIterator + { +public: + + /** + * Checks whether there is at least one more element. + * + * @since S60 5.0 + * @return ETrue if there is a next item, otherwise EFalse. + */ + virtual TBool HasNext() = 0; + + /** + * Gets the next item and move the cursor to the next item. + * + * @since S60 5.0 + * @return A pointer to the element or NULL if there are no more elements. + */ + virtual CHnMenuItemModel* GetNext() = 0; + + /** + * Checks whether there is at least one more element (item specific). + * + * @since S60 5.0 + * @return ETrue if there is a next item, otherwise EFalse. + */ + virtual TBool HasNextSpecific() = 0; + + /** + * Gets the next menu item ( specific for the item + * - e.g. Applications folder item ) + * and move the cursor to the next menu item. + * + * @since S60 5.0 + * @return A pointer to the element or NULL if there are no more elements. + */ + virtual CHnMenuItemModel* GetNextSpecific() = 0; + + /** + * Resets the iterator. + * + * @since S60 5.0 + */ + virtual void Reset() = 0; + + }; + +/** + * Menu item model class. + * + * Represents menu item. Contains all data needed to display and + * use menu item properly. Implemented as tree structure. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnMenuItemModel ): + public CBase, + public MHnMenuItemModelIterator + { +public: + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aName Name for menu item + */ + IMPORT_C static CHnMenuItemModel* NewL( const TDesC& aName ); + + /** + * Virtual Destructor. + * + * @since S60 5.0 + */ + ~CHnMenuItemModel(); + + /** + * Gets menu item model. + * + * @since S60 5.0 + * @return Menu item structure + */ + IMPORT_C MHnMenuItemModelIterator* GetMenuStructure(); + + /** + * @see MHnMenuItemModelIterator. + */ + IMPORT_C virtual TBool HasNext(); + + /** + * @see MHnMenuItemModelIterator. + */ + IMPORT_C virtual CHnMenuItemModel* GetNext(); + + /** + * @see MHnMenuItemModelIterator. + */ + IMPORT_C virtual TBool HasNextSpecific(); + + /** + * @see MHnMenuItemModelIterator. + */ + IMPORT_C virtual CHnMenuItemModel* GetNextSpecific(); + + /** + * @see MHnMenuItemModelIterator. + */ + IMPORT_C virtual void Reset(); + + /** + * Gets name. + * + * @since S60 5.0 + * @return Name of the menu. + */ + IMPORT_C const TDesC& NameL(); + + /** + * Gets command id. + * + * @since S60 5.0 + * @return Command id. + */ + IMPORT_C TInt Command(); + + /** + * Sets command id. + * + * @since S60 5.0 + * @param aCommandId Command id from data model. + */ + IMPORT_C void SetCommand( TInt aCommandId ); + + /** + * Gets menu item position. + * + * @since S60 5.0 + * @return Position of item in menu. + */ + IMPORT_C TInt Position(); + + /** + * Sets menu item position. + * + * @since S60 5.0 + * @param aPosition Position of item in menu. + */ + IMPORT_C void SetPosition( TInt aPosition ); + + /** + * Sets menu item specific flag. + * + * @since S60 5.0 + * @param aItemSpecific Is menu element item specific. + */ + IMPORT_C void SetItemSpecific( TBool aItemSpecific ); + + /** + * Appends child item. + * + * @since S60 5.0 + * @param aMenuModel Menu item model. + */ + IMPORT_C void AppendChildMenuL( CHnMenuItemModel* aMenuModel ); + + /** + * Tells if menu item is item specific. + * + * @since S60 5.0 + * @return ETrue if menu item is item specific. + */ + IMPORT_C TBool IsItemSpecific(); + +private: + + /** + * Default constructor. + * + * @since S60 5.0 + */ + CHnMenuItemModel(); + + /** + * Second phase constructor. + * + * @since S60 5.0 + * @param aName Name for menu item + */ + void ConstructL( const TDesC& aName ); + +private: // data + + /** + * Name value cache. + */ + RBuf iName; + + /** + * Command Id. + */ + TInt iCommand; + + /** + * Position. + */ + TInt iPosition; + + /** + * Next child. + */ + TInt iNextMenu; + + /** + * Children pointer array. + */ + RPointerArray< CHnMenuItemModel > iChildren; + + /** + * Is menu item item specific. + */ + TBool iItemSpecific; + }; + +#endif // HNMENUITEMMODEL_H_ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnsuitemodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnsuitemodel.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,598 @@ +/* +* Copyright (c) 2007-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: suite presentation model +* +*/ + + +#ifndef C_HNSUITEMODEL_H +#define C_HNSUITEMODEL_H + +#include <e32base.h> +#include <e32hashtab.h> +#include "hnsuiteobserver.h" +#include "hnglobals.h" +#include "hnitemmodel.h" + +class CHnSuiteModelContainer; +class CHnItemModel; +class MHnMenuItemModelIterator; +class CHnActionModel; +class CHnEventHandler; +class MHnSuiteObserver; +class CHnItemsOrder; +class CHnItemFocusHandler; + +/** + * Suite model class. + * + * Represents suite. Evaluated from CHnMdSuite class, contains + * all data from services and xml configuration. It is used to fill data + * displayed on the screen. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnSuiteModel ) : public CBase + { + +public: + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aEventHandler Event handler. + * @param aGenreName Suite genre identifier. + */ + IMPORT_C static CHnSuiteModel* NewL( CHnEventHandler& aEventHandler, + const TDesC& aGenreName ); + + /** + * Virtual Destructor. + * + * @since S60 5.0 + */ + IMPORT_C ~CHnSuiteModel(); + + /** + * Return Suite's genre name. + * Used for identifying the Suite. + * + * @since S60 v5.0 + * @return The genre name. + */ + IMPORT_C const TDesC& SuiteName() const; + + /** + * Return Suite's name + * This should be displayed in Status Pane + * + * @since S60 v5.0 + * @return the name + */ + IMPORT_C const TDesC& Title() const; + + /** + * Sets the Suite's name + * + * @since S60 v5.0 + * @param aName the name + */ + IMPORT_C void SetTitleL( const TDesC& aName ); + + /** + * Return Suite's empty text + * + * @since S60 v5.0 + * @return empty text if defined o + */ + IMPORT_C const TDesC& EmptyText() const; + + /** + * Sets the Suite's empty text + * + * @since S60 v5.0 + * @param aName the name + */ + IMPORT_C void SetEmptyTextL( const TDesC& aName ); + + /** + * Notifies all of the observers. + * + * @since S60 v5.0 + * @param aEventType Event to be pushed to all observers. + */ + IMPORT_C void NotifyObserversL( THnCustomSuiteEvent aEventType ); + + /** + * Method used to indicate that item evaluation has finished. + * + * @since S60 v5.0 + * @param aModelItemNumber Index of the item model. + * @return True if observers were notified. + */ + IMPORT_C TBool ItemEvaluationFinishedL( TInt aModelItemNumber ); + + /** + * Method used to indicate that item evaluation has finished. + * + * @since S60 v5.0 + */ + IMPORT_C TBool SuiteEvaluationFinishedL(); + + /** + * Return Suite's Widget type + * + * @since S60 v5.0 + * @return the Widget type or EUnspecified if not set + */ + IMPORT_C TInt WidgetType() const; + + /** + * Sets the Suite's Widget type + * Also sets the correct template to the Widget Model + * + * @since S60 v5.0 + * @param aWidgetType Suite's Widget type + */ + IMPORT_C void SetWidgetType( THnSuiteWidgetType aWidgetType ); + + /** + * Gets menu structure for certain model + * + * @since S60 v5.0 + * @param aItemId Id of the item model + * @return Pointer to menu model + */ + IMPORT_C MHnMenuItemModelIterator* GetMenuStructureL( TInt aItemId ); + + /** + * Adds item both to Aakash model and Matrix model. + * + * @since S60 v5.0 + * @param aItemModel Item model. + * @param aId Item id + * @param aItemModelNumber Index of data model that creates the item. + * @param aItemModelPosition Position in the particular data model + */ + IMPORT_C void AddItemL( TInt aId, CHnItemModel* aItemModel, + TInt aItemModelNumber, TInt aItemModelPosition ); + + /** + * Updates item template with template from suite model. + * + * @since S60 v5.0 + * @param aId Id of the item to update template + */ + IMPORT_C void UpdateItemTemplateL( TInt aId ); + + /** + * Updates item in Aakash model. + * + * @since S60 v5.0 + * @param aPreviousItemCount Previous number of items in the suite. + */ + IMPORT_C void RefreshMulModelL( TInt aPreviousItemCount = 0 ); + + /** + * Sets template for suite. + * + * @since S60 v5.0 + * @param aValue template of the suite + */ + IMPORT_C void SetTemplateL( const TDesC8& aValue ); + + /** + * Gets template. + * + * @since S60 v5.0 + * @return template of the suite + */ + IMPORT_C const TDesC8& GetTemplate() const; + + /** + * Remove model by id both from Aakash model and Matrix model. + * + * @since S60 v5.0 + * @param aId Id of the item to remove + */ + IMPORT_C void RemoveItemL( TInt aId ); + + /** + * Removes all items from the suite model. + * + * @since S60 v5.0 + */ + IMPORT_C void RemoveAllItems(); + + /** + * Gets item model id by its position in Aakash model. + * + * @since S60 v5.0 + * @param aIndex Index of visual item in Aakash model + * @return Id of the item model for input parameter + */ + IMPORT_C TInt IdByIndex( TInt aIndex ); + + /** + * Gets item model count. + * + * @since S60 v5.0 + * @return Count of item models. + */ + IMPORT_C TInt GetItemModelsCount(); + + /** + * Gets actions models. + * + * @return List of all actions for every event. + */ + IMPORT_C RHashMap< TInt, CArrayPtr<CHnActionModel>* >& GetActions(); + + /** + * Gets actions models. + * + * @param aId Event id + * @return Array of actions models corresponding to event id + */ + IMPORT_C CArrayPtr<CHnActionModel>* GetActions( TInt aId ); + + /** + * Gets item model. + * + * @param aId Item model id + * @return Item model corresponding to id, if not found returns NULL + */ + IMPORT_C CHnItemModel* GetItemModel( TInt aId ); + + /** + * Returns visibility of toolbar for suite + * + * @return TRUE if visible, otherwise FALSE + */ + IMPORT_C TBool HasToolbar() const; + + /** + * Registers suite observer. + * + * @param aObserver observer + * @param aPriority priority + */ + IMPORT_C void RegisterSuiteObserverL( MHnSuiteObserver* aObserver, + TThreadPriority aPriority = EPriorityNormal); + + /** + * Unregisters suite observer + * + * @param aObserver observer + */ + IMPORT_C void UnregisterSuiteObserver( MHnSuiteObserver* aObserver); + + /** + * Checks if one of items between aIndexStart and + * aIndexEnd is move-locked + * + * @param aIndexStart starting item + * @param aIndexEnd ending item + * @return true if one of the preceeding items is locked + */ + IMPORT_C TBool IsItemBetweenMoveLocked( TInt aIndexStart, + TInt aIndexEnd ); + + /** + * Handles event. + * + * @since S60 5.0 + * @param aEventId Event id. + * @param aRecipientId Recipient Id. + * @param aEventParameters Parameters to event. + * @return Status code. + */ + TInt OfferHnEventL( + const TInt aEventId, const TInt aRecipientId, + CLiwGenericParamList* aEventParameters ); + + /** + * Reorders item. + * + * @param aFromIndex Index of the item to move. + * @param aToIndex Index of the item to shift to. + */ + IMPORT_C TInt ReorderItemsL( TInt aFromIndex, TInt aToIndex ); + + /** + * Returns items order object. + * + * @return items order object from suite model + */ + IMPORT_C CHnItemsOrder* GetItemsOrder(); + +public: + + /** + * Returns true if an item is move locked. + * + * @param aIndex item's index + * @return true if an item is move-locked otherwise false + */ + IMPORT_C TBool IsItemMoveLocked( TInt aIndex ); + + /** + * Returns type of an item. + * + * @param aIndex an item's index + * @return item's type + */ + IMPORT_C TMcsItemType GetItemType( TInt aIndex ); + + /** + * Returns highlighted item's id. + * + * @since S60 v5.0 + * @return highlighted item's id + */ + IMPORT_C TInt GetSuiteHighlight(); + + /** + * Set highlighted item's id. + * + * @since S60 v5.0 + * @param aHighLight sets highlighted item's id + */ + IMPORT_C void SetSuiteHighlightL( TInt aHighLight ); + + /** + * Add items index to focus queue. Item will be highlighted/focused + * during evaluation. + * + * @since S60 v5.0 + * @param aCustomId Custom Id of an item which will be highlighted + */ + IMPORT_C void QueueFocus( TInt aCustomId ); + + /** + * Sets suite's custom id. + * + * @since S60 v5.0 + * @param aCustomId Custom identifier to be set. + */ + IMPORT_C void SetCustomId( TInt64 aCustomId ); + + /** + * Returns custom identifier of the suite. + * + * @since S60 v5.0 + * @return Custom identifier of the suite. + */ + IMPORT_C TInt64 CustomId(); + + /** + * Activates highlight handling. + * Used for highlight events for items. + * + * @since S60 v5.0 + * @param aActive ETrue if active. + */ + IMPORT_C void SetActiveL( TBool aActive ); + + /** + * Returns the state of the suite. + * + * @since S60 v5.0 + * @return ETrue if active. + */ + IMPORT_C TBool IsActive(); + + /** + * Notifies the model that the suite is visible. + * Used for highlight events for items. + * + * @since S60 v5.0 + * @param aVisible ETrue if visible. + */ + IMPORT_C void SetVisibleL( TBool aVisible ); + + /** + * Returns item model matching given criteria. + * + * @param aCustomId Item's custom id. + * @param aIndex + * @return Item model matching given custom_id, otherwise null. + */ + IMPORT_C CHnItemModel* GetMatchingItemModelL( TInt64 aCustomId, TInt& aIndex ); + + /** + * Returns the suite's exit mode flag. + */ + IMPORT_C TExitMode ExitMode(); + + /** + * Sets the exid mode. + */ + IMPORT_C void SetExitMode( TExitMode aExitMode ); + + /** + * Removes all LIW objects owned by this object. + * + * LIW objects owned by non-LIW objects that are owned by + * this object are also removed. + * @since S60 5.0 + */ + void RemoveLiwObjects(); + +private: + + /** + * Struct holding highlight information. + * iWidgetIndex - index of the visible item in the UI widget. + * iItemId - presentation model ID of the item. + * iCustomId - custom ID from data provider. + * + * @since S60 v5.0 + */ + struct TSuiteHighlight + { + /** Widget index. */ + TInt iWidgetIndex; + /** Item Id. */ + TInt iItemId; + /** Custom Id. */ + TInt64 iCustomId; + }; + + /** + * C++ default constructor. + * + * @since S60 v5.0 + * @param aEventHandler Event handler. + */ + CHnSuiteModel( CHnEventHandler& aEventHandler ); + + /** + * Standard symbian 2nd phase constructor. + * + * @since S60 v5.0 + * @param aGenreName Genre name for model + */ + void ConstructL( const TDesC& aGenreName ); + + /** + * Launches the appropriate action if allowed. + * Used for highlight events for items. + * + * @since S60 v5.0 + * @param aItemId ID of the item. + * @param aFocused ETrue if focused. + */ + void HandleItemFocusL( TInt aItemId, TBool aFocused ); + + /** + * Set highlight on item. + * + * @since S60 v5.0 + * @param aCustomId Custom id of the item. + */ + void SetSuiteHighlightByCustomIdL( TInt64 aCustomId ); + +private: + + /** + * Genre name. + * Own. + */ + HBufC* iSuiteName; + + /** + * Suite name. + * Own. + */ + HBufC* iTitle; + + /** + * Suite empty text + * Own. + */ + HBufC* iEmptyText; + + /** + * Suite Widget type + */ + THnSuiteWidgetType iWidgetType; + + /** + * Template. + */ + RBuf8 iTemplate; + + /** + * Holds models evaluated from CHnMdItem objects + */ + RHashMap< TInt, CHnItemModel* > iItemsModels; + + /** + * Holds positions of item ids and suite id. + * Own. + */ + CHnItemsOrder* iItemsOrder; + + /** + * Actions corresponding to events + * event id <=> array of actions models + */ + RHashMap< TInt, CArrayPtr<CHnActionModel>* > iActions; + + /** + * Id of "empty" item + */ + TInt iEmptyItemId; + + /** + * Suite observers. + * Not own. + */ + RPointerArray<MHnSuiteObserver> iSuiteObservers; + + /** + * Observer priorities array. + */ + RArray<TThreadPriority> iObserverPriorities; + + /** + * Stores IDs of currently higlighted item. + */ + TSuiteHighlight iSuiteHighlight; + + /** + * Focus queue. + */ + TInt iFocusQueue; + + /** + * Custom id. + */ + TInt64 iCustomId; + + /** + * Event Handler from Suite Container. + * Used for executing item focused/unfocused events. + * + * Not Own. + */ + CHnEventHandler& iEventHandler; + + /** + * Indicates if the suite is active. + * Used for handling highlight events for items. + */ + TBool iIsActive; + + /** + * Indicates if the suite is visible. + * Used for handling highlight events for items. + */ + TBool iIsVisible; + + /** + * Exit mode. + */ + TExitMode iExitMode; + /** + * Active Focus Handler. + */ + CHnItemFocusHandler* iItemFocusHandler; + }; + +#endif // C_HNSUITEMODEL_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnsuitemodelcontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnsuitemodelcontainer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,212 @@ +/* +* Copyright (c) 2007-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: suite presentation models container +* +*/ + + +#ifndef C_HNSUITEMODELCONTAINER_H +#define C_HNSUITEMODELCONTAINER_H + +#include <e32base.h> + +class MHnMdModelEventObserver; +class CHnSuitesStack; +class CHnEventHandler; +class CHnSuiteModel; +class CLiwGenericParamList; +class MHnControllerInterface; +class CLiwGenericParamList; + +/** + * Predefined offsets. + */ +enum THighlightOffset + { + EOffsetPrevious = -1, + EOffsetNone = 0, + EOffsetNext = 1 + }; + +/** + * Suite Model Container class. + * It manages the presentation models, and manages their position on the + * presentation stack. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnSuiteModelContainer ) : public CBase + { +public: + + /** + * Two-phased constructors. + * + * @since S60 5.0 + * @param aModelObserver Interface of the model event observer. + * @param aController Interface enabling to issues request to Hn engine. + */ + IMPORT_C static CHnSuiteModelContainer* NewL( + MHnMdModelEventObserver& aModelObserver, + MHnControllerInterface& aController ); + + /** + * Two-phased constructors. + * + * @since S60 5.0 + * @param aModelObserver Interface of the model event observer. + * @param aController Interface enabling to issues request to Hn engine. + */ + IMPORT_C static CHnSuiteModelContainer* NewLC( + MHnMdModelEventObserver& aModelObserver, + MHnControllerInterface& aController ); + + /** + * Virtual Destructor. + * + * @since S60 5.0 + */ + ~CHnSuiteModelContainer(); + + /** + * Pushes a new swuite model to the stack, + * by the name of aGenre + * + * @since S60 v5.0 + * @param aGenre Name of the suite. + * @return the Suite Model + */ + IMPORT_C void PushNewSuiteModelL( const TDesC& aGenre ); + + /** + * Fetches a Suite Model for the supplied genre name + * "root" name reserved for root grid + * + * @since S60 v5.0 + * @param aGenre genre name + * @return the Suite Model + */ + IMPORT_C CHnSuiteModel* GetSuiteModel( const TDesC& aGenre ); + + /** + * Pops the last Suite Model from the internal Suites Stack + * and retruns in turn the element which remains as the last + * after the change. + * + * @since S60 v5.0 + * @param aGenre Name of the suite which is expected to be at the top + * @return Suite Model which remains as the last. + */ + IMPORT_C CHnSuiteModel* PopSuiteModelL( const TDesC& aGenre ); + + /** + * Fetches the count of suites stored in the container. + * + * @since S60 v5.0 + * @return Suite count + */ + IMPORT_C TInt GetSuiteModelCount() const; + + /** + * Fetches the last suite model from the container. + * + * @since S60 5.0 + * @return Requested, last suite model. + */ + CHnSuiteModel* GetLastSuiteModel(); + + /** + * Fetches parent suite model from the container. + * + * @since S60 5.0 + * @return Requested, last suite model. + */ + CHnSuiteModel* GetParentSuiteModel(); + + /** + * Fetches the last suite model from the container. + * + * @since S60 5.0 + * @param aPosition Position of the model in the stack. + * @return Requested suite model. + */ + CHnSuiteModel* GetSuiteModel( TInt aPosition ); + + /** + * Handles event. + * + * @since S60 5.0 + * @param aEventId Event id. + * @param aRecipientId Recipient id. + * @param aEventParameters Parameters to an event. + * @return Status code. + */ + IMPORT_C TInt OfferHnEventL( const TInt aEventId, + const TInt aRecipientId, CLiwGenericParamList* aEventParameters = NULL ); + + /** + * Returns CHnSuiteModel matching given criteria (custom_id). + * + * @param aCustomId Suite's custom identifier. + * @return Pointer to the suite model or null if model not found. + */ + IMPORT_C CHnSuiteModel* GetMatchingSuiteModel( TInt64 aCustomId ); + + /** + * Removes all LIW objects owned by this object. + * + * LIW objects owned by non-LIW objects that are owned by + * this object are also removed. + * @since S60 5.0 + */ + IMPORT_C void RemoveLiwObjects(); + +private: + + /** + * Standard C++ Constructor. + * + * @since S60 5.0 + */ + CHnSuiteModelContainer( ); + + /** + * Symbian 2nd phase constructor. + * + * @since S60 5.0 + * @param aModelObserver Interface of the model event observer. + * @param aController Interface enabling to issues request to Hn engine. + */ + void ConstructL( MHnMdModelEventObserver& aModelObserver, + MHnControllerInterface& aController ); + +private: // data + + /** + * Event handler. + * Not own. + */ + CHnEventHandler* iEventHandler; + + /** + * Suites stack + * Own + */ + CHnSuitesStack* iSuitesStack; + + }; + +#endif //C_HNSUITEMODELCONTAINER_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnsuiteobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnsuiteobserver.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2007-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: suite observer interface +* +*/ + + + +#ifndef HNSUITEOBSERVER_H +#define HNSUITEOBSERVER_H + +#include <e32def.h> + +/** + * Definition of events that are associated + * with the lifecycle of a suite + */ +enum THnCustomSuiteEvent + { + ESuitePushedToStack, + ESuitePoppedFromStack, + ESuiteModelInitialized, + ESuiteModelDestroyed, + ESuiteItemsAdded, + ESuiteItemsRemoved, + ESuiteItemsUpdated, + ESuiteHighlightChanged + }; + +class CHnSuiteModel; + +/** + * Suite observer interface class. + * + * Interface, for observers of suite events. Suite + * May inform its observers about different situation it encoutners. + * e.g. suite informs all about its initialization, its deletion, + * about updates of items. + * This interface is also used by the suite container stack to inform + * all interested classes of new suite being pushed or popped from the stack. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +class MHnSuiteObserver + { + +public: + + /** + * Whenever an event occurs, and suite wants to notify observers, + * it invokes this method on all of its own observers, passing the information + * about the particular event as a parameter. + * + * @param aCustomSuiteEvent Type of evetn + * @param aModel Suite presentation model that is notifying. + */ + virtual void HandleSuiteEventL ( THnCustomSuiteEvent aCustomSuiteEvent, + CHnSuiteModel *aModel ) = 0; + + }; + + +#endif // HNSUITEOBSERVER_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hnsuitesstack.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnsuitesstack.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,149 @@ +/* +* Copyright (c) 2007-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: suite stack +* +*/ + + +#ifndef C_HNSUITESSTACK_H +#define C_HNSUITESSTACK_H + +#include <e32base.h> + +class CHnSuiteModel; +class MHnControllerInterface; + +/** + * Class implements Suites stack. + * Suite stack is used to keep visual models of suites + * in the order they have been opened. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnSuitesStack ): public CBase + { + +public: + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aControllerInterface A HN controller inteface. + * @return Fully constructed object. + */ + IMPORT_C static CHnSuitesStack* NewL( MHnControllerInterface& aControllerInterface ); + + /** + * Virtual Destructor. + * + * @since S60 5.0 + */ + ~CHnSuitesStack(); + + /** + * Pushes a Suite Model onto the stack. + * + * @since S60 v5.0 + * @param aSuiteModel Model to be pushed to stack. + * @return Quantity of models in the stack after insert. + */ + IMPORT_C TInt PushL( CHnSuiteModel* aSuiteModel ); + + /** + * Pops the last Suite Model from the top of the stack. + * Ownership is transfered to the code that invokes it. + * + * @since S60 v5.0 + * @return Suite Model object, ownership is transfered to + * invoking code. + */ + IMPORT_C CHnSuiteModel* PopL(); + + /** + * Gets the last Suite Model, from the top of the stack. + * + * @since S60 v5.0 + * @return Suite Model at the top of the stack. + */ + IMPORT_C CHnSuiteModel* GetLast(); + + /** + * Gets the stack, from a certain position in the stack. + * Index 0, refers to the lowest Suite Model. + * + * @since S60 v5.0 + * @param aPositon Position to fetch model from. + * @return Suite Model form a certain posiotion. + */ + IMPORT_C CHnSuiteModel* Get( TInt aPositon ); + + /** + * Gets the Suite Model from the bottom of the stack. + * + * @since S60 v5.0 + * @return Suite Model from the bottom of the stack. + */ + IMPORT_C CHnSuiteModel* GetRootSuite(); + + /** + * Checks if the stack is empty. + * + * @since S60 v5.0 + * @return Bollean value. + */ + IMPORT_C TBool IsEmpty(); + + /** + * Gets the size of the stack. + * + * @since S60 v5.0 + * @return Number of Suite Models in the stack. + */ + IMPORT_C TInt Count(); + +private: + + /** + * Constructor. + * + * @since S60 v5.0 + * @param aControllerInterface Reference to App Ui - event observer + */ + CHnSuitesStack( MHnControllerInterface& aControllerInterface ); + + /** + * Second pahse constructor. + * + * @since S60 v5.0 + */ + void ConstructL( ); + +private: + + /** + * Suites stack + */ + RPointerArray< CHnSuiteModel > iStack; + + /** + * Reference to App Ui - event observer + */ + MHnControllerInterface& iControllerInterface; + + }; + +#endif // C_HNSUITESSSTACK_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/hntoolbarmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hntoolbarmodel.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2007-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: toolbar presentation model +* +*/ + + +#ifndef HNTOOLBARMODEL_H_ +#define HNTOOLBARMODEL_H_ + +#include <e32base.h> +#include <e32cmn.h> + +class CHnButtonModel; + +/** + * Toolbar model class. + * + * Toolbar represents toolbar class from meta data model. Contains buttons. + * UI layer can fetch the data from toolbar model to display it on screen. + * + * @lib hnpresentationmodel + * @since S60 5.0 + * @ingroup group_hnpresentationmodel + */ +NONSHARABLE_CLASS( CHnToolbarModel ) : public CBase + { +public: + + /** + * Two-phased constructor. + * + * @since S60 5.0 + */ + IMPORT_C static CHnToolbarModel* NewLC(); + + /** + * Virtual Destructor. + * + * @since S60 5.0 + */ + IMPORT_C ~CHnToolbarModel(); + + /** + * Adds toolbar button. + * + * @since S60 5.0 + * @param aButton Toolbar button to add + */ + IMPORT_C void AddButtonL( CHnButtonModel* aButton ); + + /** + * Gets toolbar button model. + * + * @since S60 5.0 + * @param aIndex Index of toolbar button + * @return Toolbar button model for item, NULL if not exist + */ + IMPORT_C const CHnButtonModel* GetButton( TInt aIndex ) const; + + /** + * Informs if toolbar has any buttons. + * + * @since S60 5.0 + * @return true if has, false if doesn't + */ + IMPORT_C TBool HasButtons() const; + + /** + * Removes all LIW objects owned by this object. + * + * LIW objects owned by non-LIW objects that are owned by + * this object are also removed. + * @since S60 5.0 + */ + void RemoveLiwObjects(); + +private: + + /** + * Default constructor. + * + * @param aMaxCount Maximal number of buttons in the toolbar. + * @since S60 5.0 + */ + CHnToolbarModel( TInt aMaxCount = 3); + + /** + * Second phase constructor. + * + * @since S60 5.0 + */ + void ConstructL(); + +private: // data + + /** + * Buttons for toolbar. Max 3 buttons. + */ + RPointerArray< CHnButtonModel > iButtons; + +private: // constants + + /** + * Max button count. + */ + const TInt KMaxButtonCount; + }; + + +#endif // HNTOOLBARMODEL_H_ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/inc/mymenudebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/mymenudebug.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007-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: debug constants definitions +* +*/ + + +#ifndef MYMENUDEBUG_H +#define MYMENUDEBUG_H + +#define APPEND_TO_DEBUG_FILE + +_LIT(KDebugDirName, "menu"); +_LIT(KDebugFileName, "hnpresentationmodel.txt"); + +#endif // MYMENUDEBUG_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnactionmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnactionmodel.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,269 @@ +/* +* Copyright (c) 2007-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: action presentation model +* +*/ + + +#include <liwcommon.h> +#include "hnsuitemodelcontainer.h" +#include "hnactionmodel.h" +#include "hnmdbasekey.h" +#include "hnmdmodel.h" +#include "hneventhandler.h" +#include "hnhelper.inl" + +using namespace LIW; + +// ============================ MEMBER FUNCTIONS ============================= + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnActionModel* CHnActionModel::NewL() + { + CHnActionModel* self = new( ELeave ) CHnActionModel(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnActionModel::~CHnActionModel() + { + delete iConstructor; + delete iCommand; + + iService.Close(); + iInterface.Close(); + iCommandName.Close(); + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnActionModel::ConstructL() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +EXPORT_C CLiwGenericParamList* CHnActionModel::ConstructorLC() + { + CLiwGenericParamList* constructor = CLiwGenericParamList::NewL(); + CleanupStack::PushL( constructor ); + if ( iConstructor ) + { + iConstructor->ToGenericParamListL( *constructor ); + } + return constructor; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CHnActionModel::Service() const + { + return iService; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CLiwGenericParamList* CHnActionModel::CommandLC() const + { + CLiwGenericParamList* command = CLiwGenericParamList::NewL(); + CleanupStack::PushL( command ); + if ( iCommand ) + { + iCommand->ToGenericParamListL( *command ); + } + return command; + } + + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CHnActionModel::Interface() const + { + return iInterface; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnActionModel::SetConstructorL( CHnMdBaseKey* aData ) + { + delete iConstructor; + iConstructor = aData; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnActionModel::SetServiceL( const TDesC8& aSrevice ) + { + iService.Close(); + iService.CreateL( aSrevice ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnActionModel::SetCommand( CHnMdBaseKey* aCommand ) + { + delete iCommand; + iCommand = aCommand; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnActionModel::SetInterfaceL( const TDesC8& aInterface ) + { + iInterface.Close(); + iInterface.CreateL( aInterface ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnActionModel::SetCommandNameL( const TDesC8& aCommandName ) + { + iCommandName.Close(); + iCommandName.CreateL( aCommandName ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnActionModel::SetServiceModeL( const TServiceMode aMode ) + { + iMode = aMode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CHnActionModel::CommandName() const +{ + return iCommandName; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TServiceMode CHnActionModel::ServiceMode() const +{ + return iMode; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnActionModel::CHnActionModel() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnActionModel* CHnActionModel::ConcretizeL( const CHnActionModel & aActionModel, + CLiwGenericParamList* aGenericParamList ) + { + CHnActionModel* newInstance = CHnActionModel::NewL(); + CleanupStack::PushL( newInstance ); + + newInstance->iService.CreateL( aActionModel.Service() ); + newInstance->iInterface.CreateL( aActionModel.Interface() ); + newInstance->iCommandName.CreateL( aActionModel.CommandName() ); + newInstance->iMode = aActionModel.iMode; + + if ( aActionModel.iCommand ) + { + if ( aGenericParamList ) + { + newInstance->iCommand = aActionModel.iCommand->EvaluateLC( *aGenericParamList ); + } + else + { + newInstance->iCommand = aActionModel.iCommand->CopyLC(); + } + CleanupStack::Pop( newInstance->iCommand ); + } + + if ( aActionModel.iConstructor ) + { + if ( aGenericParamList ) + { + newInstance->iConstructor = aActionModel.iConstructor->EvaluateLC( *aGenericParamList ); + } + else + { + newInstance->iConstructor = aActionModel.iConstructor->CopyLC(); + } + CleanupStack::Pop( newInstance->iConstructor ); + } + + CleanupStack::Pop( newInstance ); + return newInstance; + } + +// --------------------------------------------------------------------------- +// +// ------------------ --------------------------------------------------------- +// +TInt CHnActionModel::ExecuteL( CHnEventHandler & aEventHandler, + CLiwGenericParamList *aExecutionParams ) +{ + CHnActionModel* actionModel = ConcretizeL( *this, aExecutionParams ); + CleanupStack::PushL( actionModel ); + TRAPD( err, aEventHandler.ExecuteActionL( actionModel ) ); + // forward KErrNoMemory error to most outer TRAP. + if ( KErrNoMemory == err || KErrDiskFull == err ) + { + User::Leave( err ); + } + CleanupStack::PopAndDestroy( actionModel ); + return err; +} + + + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnattributebase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnattributebase.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2007-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: abstract base class for attribute models. +* +*/ + + +#include "hnattributebase.h" + +// ============================ MEMBER FUNCTIONS ============================= + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnAttributeBase::SetNameL( const TDesC8& aName ) + { + iName.Close(); + iName.CreateL( aName.Length() + 1 ); + iName.Copy( aName ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CHnAttributeBase::Name( ) const + { + return iName; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttributeBase::~CHnAttributeBase( ) + { + iName.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TAttributeType CHnAttributeBase::Type() + { + return iAttributeType; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttributeBase::RemoveLiwObjects() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CHnAttributeBase::Value() + { + // The descendant should override this if such functionality is provided. + // if that functionality is not provided, generally it means that this + // should not be invoked this assert in debug. + ASSERT(EFalse); + return KNullDesC8; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CGulIcon* CHnAttributeBase::GetIcon( TSize* /*aDesiredIconSize*/ ) + { + // The descendant should override this if such functionality is provided. + // if that functionality is not provided, generally it means that this + // should not be invoked this assert in debug. + ASSERT(EFalse); + return NULL; + } + +CHnIconHolder* CHnAttributeBase::GetIconHolder( TSize* /*aDesiredIconSize*/ ) + { + // The descendant should override this just like the other methods. + ASSERT( EFalse ); + return NULL; + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnattributeimage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnattributeimage.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,330 @@ +/* +* Copyright (c) 2007-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: image attribute model + * +*/ + + +#include <bautils.h> +#include <f32file.h> +#include <liwcommon.h> + +#include "hnglobals.h" +#include "hnattributeimage.h" +#include "hnattrimgprovider.h" +#include "hnattrimgprovthememif.h" +#include "hnattrimgprovappimage.h" +#include "hnattrimgprovfileimage.h" +#include "hnattrimgprovliwimage.h" +#include "hnattrimgprovemptyimage.h" +#include "hnattrimgprovsvgimage.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttributeImage::CHnAttributeImage() + { + iSkinId = KAknsIIDNone; + iAttributeType = EImageAttribute; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttributeImage::~CHnAttributeImage() + { + iFileNameSrc.Close(); + iMifFile.Close(); + RemoveLiwObjects(); + delete iAttrImgProvider; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnAttributeImage* CHnAttributeImage::NewL() + { + CHnAttributeImage* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnAttributeImage* CHnAttributeImage::NewLC() + { + CHnAttributeImage* self = new ( ELeave ) CHnAttributeImage; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttributeImage::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnAttributeImage::SetSkinId(TAknsItemID aSkinId) + { + iSkinId = aSkinId ; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnAttributeImage::SetFileNameSrc(HBufC* aFileNameSrc) + { + iFileNameSrc.Assign( aFileNameSrc ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnAttributeImage::SetMifFile(HBufC* aMifFile) + { + iMifFile.Assign( aMifFile ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnAttributeImage::SetBitmapId(TInt aBitmapId) + { + iBitmapId = aBitmapId ; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnAttributeImage::SetMaskId(TInt aMaskId) + { + iMaskId = aMaskId ; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnAttributeImage::SetApplicationUid(TUid aApplicationUid) + { + iApplicationUid = aApplicationUid ; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnAttributeImage::SetBitmap( TLiwVariant* aBitmap ) + { + iBitmap = aBitmap ; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnAttributeImage::SetMask( TLiwVariant* aMask ) + { + iMask = aMask ; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnAttributeImage::Prepare() + { + TInt error = KErrNone; + if( !iAttrImgProvider ) + { + TRAP( error, PrepareProviderL() ); + } + return error; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttributeImage::PrepareProviderL() + { + ASSERT( !iAttrImgProvider ); + if ( IsThemeMif() ) + { + iAttrImgProvider = CHnAttrImgProvThemeMif::NewL( iSkinId, iMifFile, + iBitmapId, iMaskId ); + } + else if ( IsApplicationImage() ) + { + iAttrImgProvider = CHnAttrImgProvAppImage::NewL( iApplicationUid ); + } + else if ( IsFileImageL() ) + { + if ( iFileNameSrc.Find( KSvgFileExtension() ) != KErrNotFound ) + { + iAttrImgProvider = CHnAttrImgProvSvgImage::NewL( iFileNameSrc ); + } + else + { + iAttrImgProvider = CHnAttrImgProvFileImage::NewL( iFileNameSrc ); + } + } + else if ( IsLiwImage() ) + { + iAttrImgProvider = CHnAttrImgProvLiwImage::NewL( iBitmap, iMask ); + } + // if strin couldn't be resolved then provide empty one + else + { + iAttrImgProvider = CHnAttrImgProvEmptyImage::NewL(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnAttributeImage::IsThemeMif() + { + if( iSkinId != KAknsIIDNone ) + { + return ETrue; + } + if( iMifFile.Length() && iBitmapId && iMaskId ) + { + return ETrue; + } + return EFalse; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnAttributeImage::IsApplicationImage() + { + TBool ret( EFalse ); + if ( iApplicationUid.iUid != 0 ) + { + ret = ETrue; + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnAttributeImage::IsFileImageL() + { + TBool ret( EFalse ); + if ( iFileNameSrc.Length() > 0 ) + { + RFs& fs = CEikonEnv::Static()->FsSession(); + + if ( BaflUtils::FileExists( fs, iFileNameSrc ) ) + { + ret = ETrue; + } + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnAttributeImage::IsLiwImage() + { + TBool ret( EFalse ); + if ( iBitmap ) + { + ret = ETrue; + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CGulIcon* CHnAttributeImage::GetIcon( TSize* aDesiredIconSize ) + { + if ( Prepare() == KErrNone ) + { + return iAttrImgProvider->GetIcon( aDesiredIconSize ); + } + else + { + return NULL; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnIconHolder* CHnAttributeImage::GetIconHolder( TSize* aDesiredIconSize ) +{ + CHnIconHolder* iconHolder = NULL; + if ( Prepare() == KErrNone ) + { + iconHolder = iAttrImgProvider->GetIconHolder( aDesiredIconSize ); + } + return iconHolder; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttributeImage::RemoveLiwObjects() + { + if ( iAttrImgProvider ) + { + iAttrImgProvider->RemoveLiwObjects(); + } + + if( iBitmap ) + { + iBitmap->Reset(); + delete iBitmap; + iBitmap = NULL; + } + + if( iMask ) + { + iMask->Reset(); + delete iMask; + iMask = NULL; + } + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnattributetext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnattributetext.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2007-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: text attribute model +* +*/ + + +#include "hnattributetext.h" + + +// ============================ MEMBER FUNCTIONS ============================= + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttributeText::CHnAttributeText() + { + iAttributeType = ETextAttribute; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttributeText::~CHnAttributeText() + { + iValue.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnAttributeText* CHnAttributeText::NewL() + { + CHnAttributeText* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnAttributeText* CHnAttributeText::NewLC() + { + CHnAttributeText* self = new ( ELeave ) CHnAttributeText; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttributeText::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnAttributeText::SetValueL ( const TDesC8& aValue ) + { + iValue.Close(); + iValue.CreateL( aValue.Length() + 1 ); + iValue.Copy( aValue ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC8& CHnAttributeText::Value( ) + { + return iValue; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnattrimgprovappimage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnattrimgprovappimage.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2007-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: image provider for application uid +* +*/ + + +#include <AknsSkinInstance.h> +#include <AknsUtils.h> +#include <avkon.mbg> +#include "hnglobals.h" +#include "hnattrimgprovappimage.h" + +// ============================ MEMBER FUNCTIONS ============================= + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvAppImage::CHnAttrImgProvAppImage( ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttrImgProvAppImage::ConstructL( TUid aApplicationUid ) + { + iApplicationUid = aApplicationUid; + + CFbsBitmap* bitmap; + CFbsBitmap* mask; + ProvideBitmapL( NULL, bitmap, mask ); + CreateIconL( bitmap, mask ); + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnAttrImgProvAppImage* CHnAttrImgProvAppImage::NewL( + TUid aApplicationUid ) + { + CHnAttrImgProvAppImage* self = NewLC( aApplicationUid ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnAttrImgProvAppImage* CHnAttrImgProvAppImage::NewLC( + TUid aApplicationUid ) + { + CHnAttrImgProvAppImage* self = new( ELeave ) CHnAttrImgProvAppImage; + CleanupStack::PushL( self ); + self->ConstructL( aApplicationUid ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvAppImage::~CHnAttrImgProvAppImage() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC8& CHnAttrImgProvAppImage::Value( ) + { + return iValue; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttrImgProvAppImage::ProvideBitmapL( TInt /*aId*/, CFbsBitmap*& aBitmap, + CFbsBitmap*& aMaskBitmap ) + { + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + TInt err( KErrNone ); + TRAP( err, + { + AknsUtils::CreateAppIconLC( skin, iApplicationUid, + EAknsAppIconTypeContext, aBitmap, aMaskBitmap ); + CleanupStack::Pop( 2 ); // for trap + } + ); + + if( err != KErrNone ) + { + // If icon is not created, try to create default application icon + TRAP( err, + { + AknsUtils::CreateIconLC( skin, + KAknsIIDQgnMenuUnknownLst, aBitmap, aMaskBitmap, + AknIconUtils::AvkonIconFileName(), + EMbmAvkonQgn_menu_unknown_lst, + EMbmAvkonQgn_menu_unknown_lst_mask ); + CleanupStack::Pop( 2 ); // for trap + } + ); + } + } + + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnattrimgprovemptyimage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnattrimgprovemptyimage.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2007-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: image provider for empty image +* +*/ + + +#include <AknsSkinInstance.h> +#include <AknsUtils.h> +#include "hnattrimgprovemptyimage.h" + +// ============================ MEMBER FUNCTIONS ============================= + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttrImgProvEmptyImage::ConstructL( ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvEmptyImage* CHnAttrImgProvEmptyImage::NewL( ) + { + CHnAttrImgProvEmptyImage* self = NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvEmptyImage* CHnAttrImgProvEmptyImage::NewLC( ) + { + CHnAttrImgProvEmptyImage* self = new( ELeave ) CHnAttrImgProvEmptyImage; + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvEmptyImage::CHnAttrImgProvEmptyImage() +{ +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvEmptyImage::~CHnAttrImgProvEmptyImage() +{ +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC8& CHnAttrImgProvEmptyImage::Value( ) + { + return iEmptyVal; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnattrimgprovfileimage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnattrimgprovfileimage.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2007-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: image provider for image file +* +*/ + + +#include <AknsSkinInstance.h> +#include <AknsUtils.h> +#include "hnconvutils.h" +#include "hnglobals.h" +#include "hnattrimgprovfileimage.h" +#include "imageconversion.h" + +// ============================ MEMBER FUNCTIONS ============================= + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvFileImage::CHnAttrImgProvFileImage() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttrImgProvFileImage::CorrectBitmapSize( + CImageDecoder& aImageDec, TSize& aBitmapSize ) + { + const TFrameInfo& frameInfo = aImageDec.FrameInfo(); + TSize imageSize = frameInfo.iOverallSizeInPixels; + if ( imageSize.iWidth && imageSize.iHeight ) + { + if ( imageSize.iWidth <= aBitmapSize.iWidth + && imageSize.iHeight <= aBitmapSize.iHeight) + { + aBitmapSize = imageSize; + } + else + { + TInt reductionFactor = aImageDec.ReductionFactor( + imageSize, aBitmapSize ); + TInt err = aImageDec.ReducedSize( + imageSize, reductionFactor, aBitmapSize ); + ASSERT( KErrNone == err ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttrImgProvFileImage::ConstructL( const TDesC& aFileName ) + { + TSize bitmapSize( KMaxIconBitmapSize, KMaxIconBitmapSize ); + + HBufC8* buf = HnConvUtils::StrToStr8LC( aFileName ); + iValue.CreateL( aFileName.Length() + 1 ); + iValue.Copy( *buf ); + CleanupStack::PopAndDestroy( buf ); + + CImageDecoder* imageDec = CImageDecoder::FileNewL(CEikonEnv::Static()->FsSession(), + aFileName, CImageDecoder::EOptionAlwaysThread); + CleanupStack::PushL( imageDec ); + + CFbsBitmap* bitmap = new (ELeave) CFbsBitmap(); + TDismissableCleaner bitmapCleaner( bitmap ); + CleanupClosePushL( bitmapCleaner ); + CFbsBitmap* mask = new (ELeave) CFbsBitmap(); + CleanupStack::PushL( mask ); + + CorrectBitmapSize( *imageDec, bitmapSize ); + User::LeaveIfError( bitmap->Create( bitmapSize, EColor64K ) ); + User::LeaveIfError( mask->Create( bitmapSize, EGray256 ) ); + TRequestStatus status = KRequestPending; + imageDec->Convert( &status, *bitmap, *mask ); + User::WaitForRequest( status ); + + CleanupStack::Pop( mask ); + CFbsBitmap* avkonishMask = AknIconUtils::CreateIconL( mask ); + mask = NULL; + CleanupStack::PushL( avkonishMask ); + + bitmapCleaner.Dismiss(); + CFbsBitmap* avkonishBitmap = AknIconUtils::CreateIconL( bitmap ); + bitmap = NULL; + CleanupStack::PushL( avkonishBitmap ); + + CreateIconL( avkonishBitmap, avkonishMask ); + CleanupStack::Pop( avkonishBitmap ); + CleanupStack::Pop( avkonishMask ); + + CleanupStack::PopAndDestroy( &bitmapCleaner ); + CleanupStack::PopAndDestroy( imageDec ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnAttrImgProvFileImage* CHnAttrImgProvFileImage::NewL( + const TDesC& aFileName ) + { + CHnAttrImgProvFileImage* self = NewLC( aFileName ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnAttrImgProvFileImage* CHnAttrImgProvFileImage::NewLC( + const TDesC& aFileName ) + { + CHnAttrImgProvFileImage* self = new( ELeave ) CHnAttrImgProvFileImage; + CleanupStack::PushL( self ); + self->ConstructL( aFileName ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvFileImage::~CHnAttrImgProvFileImage() + { + iValue.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC8& CHnAttrImgProvFileImage::Value() + { + return iValue; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnattrimgprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnattrimgprovider.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2007-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: base class for all image providers +* +*/ + + +#include <AknsSkinInstance.h> +#include <AknIconUtils.h> +#include <AknsUtils.h> +#include "hnattrimgprovider.h" + +// ============================ MEMBER FUNCTIONS ============================= + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TDismissableCleaner::TDismissableCleaner( TAny* aToBeDeletedOnLeave ) + : mToBeDeletedOnLeave( aToBeDeletedOnLeave ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void TDismissableCleaner::Close() + { + delete mToBeDeletedOnLeave; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void TDismissableCleaner::Dismiss() + { + mToBeDeletedOnLeave = NULL; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvider::CHnAttrImgProvider() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvider::~CHnAttrImgProvider() + { + if ( iIconHolder ) + { + iIconHolder->Close(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttrImgProvider::CreateIconL( CFbsBitmap* aBitmap, + CFbsBitmap* aMaskBitmap ) + { + CGulIcon* newIcon = CGulIcon::NewL( aBitmap, aMaskBitmap ); + CleanupStack::PushL( newIcon ); + CHnIconHolder *newIconHolder = new (ELeave) CHnIconHolder(); + newIconHolder->SetGulIcon( newIcon ); + CleanupStack::Pop( newIcon ); + + if ( iIconHolder ) + { + iIconHolder->Close(); + } + iIconHolder = newIconHolder; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CGulIcon* CHnAttrImgProvider::GetIcon( TSize* /*aDesiredIconSize*/ ) + { + return iIconHolder ? iIconHolder->GetGulIcon() : NULL; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnIconHolder* CHnAttrImgProvider::GetIconHolder( TSize* /*aDesiredIconSize*/ ) + { + return iIconHolder; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttrImgProvider::RemoveLiwObjects() + { + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnattrimgprovliwimage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnattrimgprovliwimage.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,241 @@ +/* +* Copyright (c) 2007-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: image provider for liw buffer +* +*/ + + +#include <fbs.h> +#include <AknsSkinInstance.h> +#include <AknsUtils.h> +#include <liwcommon.h> +#include <liwbufferextension.h> +#include <s32mem.h> +#include "hnattrimgprovliwimage.h" +#include "hnextbmpiconholder.h" + +// ============================ MEMBER FUNCTIONS ============================= + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvLiwImage::CHnAttrImgProvLiwImage() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttrImgProvLiwImage::ConstructL( TLiwVariant*& aBitmap, + TLiwVariant*& aMaskBitmap ) + { + ASSERT( aBitmap ); + CFbsBitmap* mask = NULL; + CFbsBitmap* bitmap = CreateBitmapFromVariantL( *aBitmap ); + if ( bitmap ) + { + if( aMaskBitmap ) + { + mask = CreateBitmapFromVariantL( *aMaskBitmap ); + } + CreateIconL( bitmap, mask ); + } + else if ( aBitmap->TypeId() == LIW::EVariantTypeBuffer ) + { + CLiwBitmapBuffer* bmpBuff = + static_cast<CLiwBitmapBuffer*>( aBitmap->AsBuffer() ); + CLiwBitmapBuffer* maskBuff = + static_cast<CLiwBitmapBuffer*>( + aMaskBitmap ? aMaskBitmap->AsBuffer() : NULL ); + if ( bmpBuff ) + { + bitmap = bmpBuff->AsBitmap(); + } + if ( maskBuff ) + { + mask = maskBuff->AsBitmap(); + } + if ( bitmap ) + { + CreateExtIconL( bitmap, mask, bmpBuff, maskBuff ); + } + } + if ( !bitmap ) + { + //No point to keep variant as bitmap was not created + aBitmap->Reset(); + delete aBitmap; + aBitmap = NULL; + } + if ( aMaskBitmap && !mask ) + { + //No point to keep variant as bitmap was not created + aMaskBitmap->Reset(); + delete aMaskBitmap; + aMaskBitmap = NULL; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttrImgProvLiwImage::CreateExtIconL( CFbsBitmap* aBitmap, + CFbsBitmap* aMask, CLiwBitmapBuffer* aExtBmp, + CLiwBitmapBuffer* aExtMask ) + { + // the condition in the assertion below means: if you provide aMask then + // you must also provide aExtMask + __ASSERT_DEBUG( aBitmap && aExtBmp && ( !aMask || aExtMask ), + User::Invariant() ); + + CGulIcon* newIcon = CGulIcon::NewL( aBitmap, aMask ); + CleanupStack::PushL( newIcon ); + newIcon->SetBitmapsOwnedExternally( ETrue ); + CHnExtBmpIconHolder *newIconHolder = new (ELeave) CHnExtBmpIconHolder(); + newIconHolder->SetGulIcon( newIcon , aExtBmp, aExtMask ); + CleanupStack::Pop( newIcon ); + + if ( iIconHolder ) + { + iIconHolder->Close(); + } + iIconHolder = newIconHolder; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnAttrImgProvLiwImage* CHnAttrImgProvLiwImage::NewL( + TLiwVariant*& aBitmap, TLiwVariant*& aMaskBitmap ) + { + CHnAttrImgProvLiwImage* self = NewLC( aBitmap, aMaskBitmap ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnAttrImgProvLiwImage* CHnAttrImgProvLiwImage::NewLC( + TLiwVariant*& aBitmap, TLiwVariant*& aMaskBitmap ) + { + CHnAttrImgProvLiwImage* self = new( ELeave ) CHnAttrImgProvLiwImage; + CleanupStack::PushL( self ); + self->ConstructL( aBitmap, aMaskBitmap ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvLiwImage::~CHnAttrImgProvLiwImage() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttrImgProvLiwImage::RemoveLiwObjects() + { + if ( iIconHolder ) + { + iIconHolder->Close(); + iIconHolder = NULL; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC8& CHnAttrImgProvLiwImage::Value( ) + { + return iValue; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CFbsBitmap* CHnAttrImgProvLiwImage::CreateBitmapFromVariantL( + const TLiwVariant& aVariant ) + { + CFbsBitmap* bitmap( NULL ); + TInt handle = 0; + + if ( ExtractBitmapHandleFromVariant( aVariant, handle ) == KErrNone ) + { + CFbsBitmap* tempBitmap = new( ELeave ) CFbsBitmap; + if ( tempBitmap->Duplicate( handle ) == KErrNone ) + { + bitmap = tempBitmap; + } + else + { + delete tempBitmap; + } + } + else if ( aVariant.TypeId() == LIW::EVariantTypeDesC8 ) + { + CFbsBitmap* tempBitmap = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( tempBitmap ); + TPtrC8 buf = aVariant.AsData(); + RDesReadStream stream( buf ); + CleanupClosePushL( stream ); + tempBitmap->InternalizeL( stream ); + CleanupStack::PopAndDestroy( &stream ); + CleanupStack::Pop( tempBitmap ); + bitmap = tempBitmap; + } + return bitmap; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnAttrImgProvLiwImage::ExtractBitmapHandleFromVariant( + const TLiwVariant& aVariant, TInt& aHandle ) + { + TInt err = KErrNone; + switch ( aVariant.TypeId() ) + { + case LIW::EVariantTypeTInt32: + aHandle = static_cast<TInt>( aVariant.AsTInt32() ); + break; + case LIW::EVariantTypeTUint: + aHandle = static_cast<TInt>( aVariant.AsTUint() ); + break; + case LIW::EVariantTypeTInt64: + aHandle = static_cast<TInt>( aVariant.AsTInt64() ); + break; + case LIW::EVariantTypeTBool: + // Putting a TInt into a TLiwVariant will result in the variant + // storing a TBool variable. CFbsBitmap::Handle() returns TInt, so + // we can assume that the TBool stored in aVariant is in fact TInt. + aHandle = static_cast<TInt>( aVariant.AsTBool() ); + break; + default: + err = KErrNotFound; + } + return err; + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnattrimgprovsvgimage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnattrimgprovsvgimage.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,200 @@ +/* +* Copyright (c) 2007-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: image provider for image file +* +*/ + + +#include <AknsSkinInstance.h> +#include <AknsUtils.h> +#include "hnconvutils.h" +#include "hnglobals.h" +#include "hnattrimgprovsvgimage.h" +#include "SVGEngineInterfaceImpl.h" + +// ============================ MEMBER FUNCTIONS ============================= + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvSvgImage::CHnAttrImgProvSvgImage() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttrImgProvSvgImage::ConstructL( const TDesC& aFileName ) + { + iBitmap = new (ELeave) CFbsBitmap(); + iMask = new (ELeave) CFbsBitmap(); + TFontSpec fontSpec; + + iDummyBitmap = new( ELeave ) CFbsBitmap; + User::LeaveIfError( iDummyBitmap->Create( TSize( 0, 0 ), EGray2 ) ); + + + iSvgEngine = CSvgEngineInterfaceImpl::NewL( iDummyBitmap, this, fontSpec ); + iSvgEngine->SetBackgroundColor( 0 ); + iSvgEngine->SetDRMMode( EFalse ); + + User::LeaveIfError( iSvgEngine->PrepareDom( aFileName, iHandle )->SystemErrorCode() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnAttrImgProvSvgImage::RenderIcon( TSize aDesiredIconSize ) + { + TInt err = iBitmap->Create( aDesiredIconSize, EColor64K ); + if ( err == KErrNone ) + { + err = iMask->Create( aDesiredIconSize, EGray256 ); + } + if ( err == KErrNone ) + { + iSvgEngine->UseDom( iHandle, iBitmap, iMask ); + iSvgEngine->SetPreserveAspectRatio( NULL, ESvgPreserveAspectRatio_XmidYmid, + ESvgMeetOrSlice_Meet, ETrue); + iSvgEngine->Start(); + } + return err; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvSvgImage::~CHnAttrImgProvSvgImage() + { + if ( iSvgEngine ) + { + iSvgEngine->UseDom( iHandle, NULL, NULL ); + iSvgEngine->DeleteDom( iHandle ); + } + delete iDummyBitmap; + delete iSvgEngine; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnAttrImgProvSvgImage* CHnAttrImgProvSvgImage::NewL( + const TDesC& aFileName ) + { + CHnAttrImgProvSvgImage* self = NewLC( aFileName ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnAttrImgProvSvgImage* CHnAttrImgProvSvgImage::NewLC( + const TDesC& aFileName ) + { + CHnAttrImgProvSvgImage* self = new( ELeave ) CHnAttrImgProvSvgImage; + CleanupStack::PushL( self ); + self->ConstructL( aFileName ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CGulIcon* CHnAttrImgProvSvgImage::GetIcon( TSize* aDesiredIconSize ) + { + TInt err = KErrNone; + if ( !iIconHolder || !iIconHolder->GetGulIcon() ) + { + TSize targetSize = aDesiredIconSize ? + *aDesiredIconSize : TSize( KDefaultSvgIconSize, KDefaultSvgIconSize ); + err = RenderIcon( targetSize ); + if ( err == KErrNone ) + { + TRAP( err, CreateIconL( iBitmap, iMask ) ); + } + } + else if ( aDesiredIconSize && iBitmap->SizeInPixels() != *aDesiredIconSize ) + { + err = RenderIcon( *aDesiredIconSize ); + } + + return ( !err && iIconHolder ? iIconHolder->GetGulIcon() : NULL ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnIconHolder* CHnAttrImgProvSvgImage::GetIconHolder( TSize* aDesiredIconSize ) + { + GetIcon( aDesiredIconSize ); + return iIconHolder; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttrImgProvSvgImage::UpdateScreen() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnAttrImgProvSvgImage::ScriptCall( const TDesC& /* aScript */, + CSvgElementImpl* /* aCallerElement */ ) + { + return EFalse; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnAttrImgProvSvgImage::FetchImage( const TDesC& /* aUri */, + RFs& /* aSession */, RFile& /* aFileHandle */ ) + { + return KErrNotSupported; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnAttrImgProvSvgImage::FetchFont( const TDesC& /* aUri */, + RFs& /* aSession */, RFile& /* aFileHandle */ ) + { + return KErrNotSupported; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttrImgProvSvgImage::UpdatePresentation( + const TInt32& /*aNoOfAnimation*/ ) + { + + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnattrimgprovthememif.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnattrimgprovthememif.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2007-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: image provider for mif file +* +*/ + + +#include <AknsSkinInstance.h> +#include <AknsUtils.h> +#include <mifconvdefs.h> +#include "hnattrimgprovthememif.h" + + +// ============================ MEMBER FUNCTIONS ============================= + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvThemeMif::CHnAttrImgProvThemeMif( ) + { + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttrImgProvThemeMif::ConstructL( TAknsItemID aSkinId, + const TDesC& aFile, TInt aBitmapId, TInt aMaskId ) + { + iSkinId = aSkinId; + iFile.Set( aFile ); + iBitmapId = aBitmapId; + iMaskId = aMaskId; + + CFbsBitmap* bitmap; + CFbsBitmap* mask; + if ( ValidateIconIds() ) + { + ProvideBitmapL( NULL, bitmap, mask ); + CreateIconL( bitmap, mask ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnAttrImgProvThemeMif* CHnAttrImgProvThemeMif::NewL( + TAknsItemID aSkinId, const TDesC& aFile, + TInt aBitmapId, TInt aMaskId ) + { + CHnAttrImgProvThemeMif* self = NewLC( aSkinId, aFile, + aBitmapId, aMaskId ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnAttrImgProvThemeMif::ValidateIconIds() + { + return ((iSkinId.iMajor != KErrNotFound && iSkinId.iMinor != KErrNotFound) + || (iBitmapId >= KMifIdFirst && iMaskId >= KMifIdFirst)); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnAttrImgProvThemeMif* CHnAttrImgProvThemeMif::NewLC( + TAknsItemID aSkinId, const TDesC& aFile, + TInt aBitmapId, TInt aMaskId ) + { + CHnAttrImgProvThemeMif* self = new( ELeave ) CHnAttrImgProvThemeMif; + CleanupStack::PushL( self ); + self->ConstructL( aSkinId, aFile, aBitmapId, aMaskId ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnAttrImgProvThemeMif::~CHnAttrImgProvThemeMif() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC8& CHnAttrImgProvThemeMif::Value( ) + { + return iValue; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnAttrImgProvThemeMif::ProvideBitmapL( TInt /*aId*/, CFbsBitmap*& aBitmap, + CFbsBitmap*& aMaskBitmap ) + { + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsUtils::CreateIconL( skin, iSkinId, aBitmap, aMaskBitmap, + iFile, iBitmapId, iMaskId ); + } + + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnbuttonmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnbuttonmodel.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,168 @@ +/* +* Copyright (c) 2007-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: toolbar button model +* +*/ + + +#include "hnbuttonmodel.h" +#include "gulicon.h" +#include "hnattributeimage.h" +#include "hnattributebase.h" + +// ============================ MEMBER FUNCTIONS ============================= + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnButtonModel* CHnButtonModel::NewLC( TInt aIndex ) + { + CHnButtonModel* self = new( ELeave ) CHnButtonModel( aIndex ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnButtonModel::~CHnButtonModel() + { + iToolTip.Close(); + //delete iIcon; + delete iIconAttribute; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CGulIcon* CHnButtonModel::GetIcon() const + { + CGulIcon* icon = NULL; + + if ( iIconAttribute ) + { + icon = iIconAttribute->GetIcon(); + } + + return icon; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnButtonModel::SetIcon( CHnAttributeBase* aAttribute ) + { + delete iIconAttribute; + iIconAttribute = NULL; + iIconAttribute = aAttribute; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CHnButtonModel::GetButtonText() const + { + return iToolTip; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnButtonModel::SetHelpTextL( const TDesC& aToolTip ) + { + iToolTip.Close(); + iToolTip.CreateL( aToolTip ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnButtonModel::GetDimmed() const + { + return iDimmed; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnButtonModel::SetDimmed( TBool aDimmed ) + { + iDimmed = aDimmed; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnButtonModel::GetIndex() const + { + return iIndex; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnButtonModel::GetEventId() const + { + return iEventId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnButtonModel::SetEventId( TInt aEventId ) + { + iEventId = aEventId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnButtonModel::RemoveLiwObjects() + { + iIconAttribute->RemoveLiwObjects(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnButtonModel::CHnButtonModel( TInt aIndex ) + { + iIndex = aIndex; + iDimmed = EFalse; + iEventId = KErrNotFound; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnButtonModel::ConstructL() + { + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hneventhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hneventhandler.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,230 @@ +/* +* Copyright (c) 2007-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: event handler class +* +*/ + + +#include <liwservicehandler.h> +#include "hneventhandler.h" +#include "hnmdmodel.h" +#include "hnglobals.h" +#include "hnconvutils.h" +#include "hnliwutils.h" +#include "hnmdbasekey.h" +#include "hncontrollerinterface.h" +#include "hnactionmodel.h" +#include "hnservicehandler.h" +#include "menudebug.h" + +// ============================ MEMBER FUNCTIONS ============================= + + +// --------------------------------------------------------------------------- +// Safe constructor. Initializes refrerece to the Meta Data Model in which +// the event-to-action mappings are stored. +// --------------------------------------------------------------------------- +// +CHnEventHandler::CHnEventHandler( MHnMdModelEventObserver& aModelObserver, + MHnControllerInterface& aController ): + iEventObserver( aModelObserver), iControllerInterface( aController ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnEventHandler::~CHnEventHandler() + { + delete iServiceHandler; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnEventHandler* CHnEventHandler::NewLC( + MHnMdModelEventObserver& aModelObserver, + MHnControllerInterface& aController ) + { + CHnEventHandler* self = + new (ELeave)CHnEventHandler( aModelObserver, aController ); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnEventHandler* CHnEventHandler::NewL( + MHnMdModelEventObserver& aModelObserver, + MHnControllerInterface& aController ) + { + CHnEventHandler* self=CHnEventHandler::NewLC( aModelObserver, + aController ); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnEventHandler::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// + +TInt CHnEventHandler::ExecuteStandardActionL( CHnActionModel* aActionModel ) + { + delete iServiceHandler; + iServiceHandler = NULL; + iServiceHandler = CHnServiceHandler::NewL( + aActionModel->Service(), + aActionModel->Interface(), + aActionModel->CommandName(), + aActionModel->ServiceMode(), + aActionModel->ConstructorLC(), + aActionModel->CommandLC() ); + + CleanupStack::Pop( 2 ); + TInt res = iServiceHandler->ExecuteL( this, 0 ); + return res; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +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 ) + { + TInt ret(KErrNotFound); + CLiwGenericParamList* params = aActionModel->CommandLC(); + if ( aActionModel->CommandName() == KServiceOpenSuite ) + { + ret = iEventObserver.HandleModelEventL( KNewSuiteLoadedMdEvent(), + *params ); + } + else if ( aActionModel->CommandName() == KServiceSwitchWidget ) + { + ret = iEventObserver.HandleModelEventL( KSwitchWidgetMdEvent(), + *params ); + } + else if ( aActionModel->CommandName() == KServiceStartEditMode ) + { + ret = iEventObserver.HandleModelEventL( KStartEditModeMdEvent(), + *params ); + } + else if ( aActionModel->CommandName() == KServiceStopEditMode ) + { + ret = iEventObserver.HandleModelEventL( KStopEditModeMdEvent(), + *params ); + } + else if ( aActionModel->CommandName() == KServiceBack ) + { + ret = iEventObserver.HandleModelEventL( KBackMdEvent(), + *params ); + } + else if ( aActionModel->CommandName() == KSetFocus ) + { + ret = iEventObserver.HandleModelEventL( KSetFocusEvent(), + *params ); + } + + CleanupStack::PopAndDestroy( params ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnEventHandler::ExecuteExtensionManagerActionL( + CHnActionModel* aActionModel ) + { + 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 ); + 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 ) + { + err = ExecuteInternalActionL( aActionModel ); + } + else + { + err = ExecuteExtensionManagerActionL( aActionModel ); + } + } + else + { + err = ExecuteStandardActionL( aActionModel ); + } + + return err; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +TInt CHnEventHandler::HandleNotifyL( TInt /*aCmdId*/, TInt /*aEventId*/, + CLiwGenericParamList& /*aEventParamList*/, + const CLiwGenericParamList& /*aInParamList*/ ) + { + return KErrNone; + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnextbmpiconholder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnextbmpiconholder.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include <gulicon.h> +#include <liwbufferextension.h> +#include "hnextbmpiconholder.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnExtBmpIconHolder::SetGulIcon( CGulIcon* aGulIcon, + CLiwBitmapBuffer* aBmpBuffer, CLiwBitmapBuffer* aMaskBuffer ) + { + __ASSERT_DEBUG( aGulIcon && aBmpBuffer, User::Invariant() ); + + if ( aGulIcon ) + { + __ASSERT_DEBUG( aGulIcon->BitmapsOwnedExternally(), User::Invariant() ); + CHnIconHolder::SetGulIcon( aGulIcon ); + aGulIcon->SetBitmapsOwnedExternally( ETrue ); + if ( aBmpBuffer ) + { + iBmpBuffer = aBmpBuffer; + iBmpBuffer->IncRef(); + } + if ( aMaskBuffer ) + { + iMaskBuffer = aMaskBuffer; + iMaskBuffer->IncRef(); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnExtBmpIconHolder::~CHnExtBmpIconHolder() + { + if ( iBmpBuffer ) + { + iBmpBuffer->DecRef(); + } + if ( iMaskBuffer ) + { + iMaskBuffer->DecRef(); + } + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hniconholder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hniconholder.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include <gulicon.h> +#include "hniconholder.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnIconHolder::SetGulIcon( CGulIcon* aGulIcon ) + { + ASSERT( !iGulIcon ); // icon may be set only once + iGulIcon = aGulIcon; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CGulIcon* CHnIconHolder::GetGulIcon() const + { + return iGulIcon; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnIconHolder::~CHnIconHolder() + { + delete iGulIcon; + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnitemfocushandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnitemfocushandler.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,230 @@ +/* +* 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: Application UI class +* Version : %version: 3 % << Don't touch! Updated by Synergy at check-out. +*/ + + +#include "hnitemfocushandler.h" +#include "hnglobals.h" +#include "hnsuitemodel.h" + +// --------------------------------------------------------------------------- +// TFocusQueueItem::TFocusQueueItem( TInt aItemId, TInt aEventId ) +// --------------------------------------------------------------------------- +// +TFocusQueueItem::TFocusQueueItem( TInt aItemId, TInt aEventId ): + iItemId( aItemId ), iEventId( aEventId ) + { + iTriggerTime.HomeTime(); + } + +// --------------------------------------------------------------------------- +// TFocusQueueItem::TriggerTime() +// --------------------------------------------------------------------------- +// +TTime TFocusQueueItem::TriggerTime() + { + return iTriggerTime; + } + +// --------------------------------------------------------------------------- +// TFocusQueueItem::ItemId() +// --------------------------------------------------------------------------- +// +TInt TFocusQueueItem::ItemId() + { + return iItemId; + } + +// --------------------------------------------------------------------------- +// TFocusQueueItem::EventId() +// --------------------------------------------------------------------------- +// +TInt TFocusQueueItem::EventId() + { + return iEventId; + } + +// --------------------------------------------------------------------------- +// TFocusQueueItem::CompareByTriggerTime( const TFocusQueueItem& aItem1, +// const TFocusQueueItem& aItem2 ) +// --------------------------------------------------------------------------- +// +TInt TFocusQueueItem::CompareByTriggerTime( const TFocusQueueItem& aItem1, + const TFocusQueueItem& aItem2 ) + { + if ( aItem1.iTriggerTime < aItem2.iTriggerTime ) + { + return -1; + } + else + { + return 1; + } + } + +// --------------------------------------------------------------------------- +// TFocusQueueItem::CompareByItemId( const TFocusQueueItem& aItem1, +// const TFocusQueueItem& aItem2 ) +// --------------------------------------------------------------------------- +// +TBool TFocusQueueItem::CompareByItemId( const TFocusQueueItem& aItem1, + const TFocusQueueItem& aItem2 ) + { + return aItem1.iItemId == aItem2.iItemId; + } + +// --------------------------------------------------------------------------- +// CHnItemFocusHandler::CHnItemFocusHandler() +// --------------------------------------------------------------------------- +// +CHnItemFocusHandler::CHnItemFocusHandler() : + CActive(EPriorityLow) // Standard priority + { + } + +// --------------------------------------------------------------------------- +// CHnItemFocusHandler* CHnItemFocusHandler::NewLC() +// --------------------------------------------------------------------------- +// +CHnItemFocusHandler* CHnItemFocusHandler::NewLC( CHnSuiteModel* aSuiteModel ) + { + CHnItemFocusHandler* self = new (ELeave) CHnItemFocusHandler(); + CleanupStack::PushL(self); + self->ConstructL( aSuiteModel ); + return self; + } + +// --------------------------------------------------------------------------- +// CHnItemFocusHandler* CHnItemFocusHandler::NewL() +// --------------------------------------------------------------------------- +// +CHnItemFocusHandler* CHnItemFocusHandler::NewL( CHnSuiteModel* aSuiteModel ) + { + CHnItemFocusHandler* self = CHnItemFocusHandler::NewLC( aSuiteModel ); + CleanupStack::Pop(); // self; + return self; + } + +// --------------------------------------------------------------------------- +// CHnItemFocusHandler::ConstructL() +// --------------------------------------------------------------------------- +// +void CHnItemFocusHandler::ConstructL( CHnSuiteModel* aSuiteModel ) + { + CActiveScheduler::Add( this); // Add to scheduler + iSuiteModel = aSuiteModel; + } + +// --------------------------------------------------------------------------- +// CHnItemFocusHandler::~CHnItemFocusHandler( +// --------------------------------------------------------------------------- +// +CHnItemFocusHandler::~CHnItemFocusHandler() + { + Cancel(); // Cancel any request, if outstanding + +// handle all pending unfocus events synchronously. + for(TInt i = 0; i < iFocusQueue.Count(); i++ ) + { + if ( KIdFocusLost == iFocusQueue[i].EventId() ) + { + if( iSuiteModel ) + { + TRAP_IGNORE( iSuiteModel->OfferHnEventL( + KIdFocusLost, iFocusQueue[i].ItemId(), NULL ) ); + } + } + } + iFocusQueue.Reset(); + } + +// --------------------------------------------------------------------------- +// CHnItemFocusHandler::DoCancel() +// --------------------------------------------------------------------------- +// +void CHnItemFocusHandler::DoCancel() + { +// TRequestStatus* status = &iStatus; +// User::RequestComplete( status, KErrCancel); + } + +// --------------------------------------------------------------------------- +// CHnItemFocusHandler::StartL(TTimeIntervalMicroSeconds32 aDelay) +// --------------------------------------------------------------------------- +// +void CHnItemFocusHandler::SetFocusL( TInt aEventId, TBool aItemId ) + { + TLinearOrder<TFocusQueueItem> byTriggerTime( + TFocusQueueItem::CompareByTriggerTime ); + TFocusQueueItem focusItem(aItemId, aEventId); + RemoveDuplicatedItem( focusItem ); + iFocusQueue.InsertInOrderL( focusItem, byTriggerTime ); + if ( !IsActive() ) + { + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + } + } + +// --------------------------------------------------------------------------- +// CHnItemFocusHandler::RunL() +// --------------------------------------------------------------------------- +// +void CHnItemFocusHandler::RunL() + { + TRAP_IGNORE( iSuiteModel->OfferHnEventL( + iFocusQueue[0].EventId(), iFocusQueue[0].ItemId() , NULL ) ); + iFocusQueue.Remove(0); + + if ( iFocusQueue.Count() > 0) + { + SetActive(); // Tell scheduler a request is active + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + } + } + +// --------------------------------------------------------------------------- +// CHnItemFocusHandler::RunError(TInt aError) +// --------------------------------------------------------------------------- +// +TInt CHnItemFocusHandler::RunError(TInt aError) + { + return aError; + } + +// --------------------------------------------------------------------------- +// RemoveDuplicatedItem( const TFocusQueueItem& aFocusItem ) +// --------------------------------------------------------------------------- +// +void CHnItemFocusHandler::RemoveDuplicatedItem( const TFocusQueueItem& aFocusItem ) + { + if ( iFocusQueue.Count() != 0 ) + { + TIdentityRelation< TFocusQueueItem > byItemId( + TFocusQueueItem::CompareByItemId ); + TInt itemPosition; + itemPosition = iFocusQueue.Find( aFocusItem, byItemId ); + if ( KErrNotFound != itemPosition ) + { + iFocusQueue.Remove( itemPosition ); + } + } + } + +// End of file + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnitemmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnitemmodel.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,463 @@ +/* +* Copyright (c) 2007-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: item presentation model +* +*/ + + +#include <liwservicehandler.h> +#include "hnitemmodel.h" +#include "hnmenuitemmodel.h" +#include "hnactionmodel.h" +#include "hntoolbarmodel.h" +#include "hnattributebase.h" +#include "hnattributetext.h" +#include "hnbuttonmodel.h" +#include "hnglobals.h" +#include "hnconvutils.h" + +// ============================ MEMBER FUNCTIONS ============================= + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnItemModel* CHnItemModel::NewL() + { + CHnItemModel* self = new( ELeave ) CHnItemModel(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnItemModel::~CHnItemModel() + { + iTemplate.Close(); + delete iMenuModel; + delete iToolbarModel; + delete iMskModel; + DeleteAllActionModels(); + iAttrs.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemModel::DeleteAllActionModels() + { + THashMapIter< TInt, CArrayPtr<CHnActionModel>* > iterator( iActions ); + while( iterator.NextKey() ) + { + CArrayPtr<CHnActionModel>** actions = iterator.CurrentValue(); + (*actions)->ResetAndDestroy(); + delete *actions; + iterator.RemoveCurrent(); + } + iActions.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnItemModel::RemoveLiwObjects() + { + if ( iToolbarModel ) + { + iToolbarModel->RemoveLiwObjects(); + } + + for( TInt i = 0; i < iAttrs.Count(); ++i ) + { + iAttrs[i]->RemoveLiwObjects(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnItemModel::OfferHnEventL( CHnEventHandler & aEventHandler, + const TInt aEventId, CLiwGenericParamList* aEventParameters ) + { + TInt err = KErrNotFound; + CArrayPtr<CHnActionModel>* actions = GetActions( aEventId ); + if ( actions ) + { + TInt actionsCount = actions->Count(); + for( TInt i = 0; i < actionsCount; i++ ) + { + ASSERT( actions->At( i ) ); + err = actions->At( i )->ExecuteL( aEventHandler, aEventParameters ); + if ( err != KErrNone ) + { + break; + } + } + } + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnItemModel::CHnItemModel() : + iActions( &DefaultHash::Integer, &DefaultIdentity::Integer ), + iEditable( EFalse ), + iCustomId( KErrNotFound ), + iMskModel( NULL ) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnItemModel::ConstructL() + { + iUid = TUid::Null(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemModel::SetMenuItemModel( CHnMenuItemModel* aMenu ) + { + ASSERT( aMenu ); + delete iMenuModel; + iMenuModel = aMenu; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +MHnMenuItemModelIterator* CHnItemModel::GetMenuStructure() + { + if( iMenuModel ) + return iMenuModel->GetMenuStructure(); + else + return 0; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemModel::SetMiddleSoftKey( CHnButtonModel* aMsk ) + { + delete iMskModel; + iMskModel = aMsk; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnButtonModel* CHnItemModel::GetMiddleSoftKey() + { + return iMskModel; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C RHashMap< TInt, CArrayPtr<CHnActionModel>* >& + CHnItemModel::GetActions() + { + return iActions; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CArrayPtr<CHnActionModel>* CHnItemModel::GetActions( TInt aId ) + { + CArrayPtr<CHnActionModel>** ret = iActions.Find( aId ); + if( ret ) + { + return *ret; + } + return NULL; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const CHnToolbarModel* CHnItemModel::GetToolbarModel() const + { + return iToolbarModel; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemModel::SetToolbarModel( CHnToolbarModel* aToolbar ) + { + delete iToolbarModel; + iToolbarModel = NULL; + iToolbarModel = aToolbar; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CHnItemModel::GetTemplate() + { + CHnAttributeBase* templateAttr = GetAttribute( KTemplate8() ); + if ( templateAttr ) + { + return templateAttr->Value(); + } + return KNullDesC8(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemModel::SetTemplateL( const TDesC8& aTemplate ) + { + CHnAttributeText* templateAttr = CHnAttributeText::NewL(); + templateAttr->SetNameL( KTemplate8 ); + templateAttr->SetValueL( aTemplate ); + SetAttributeL( templateAttr ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemModel::SetAttributeL( CHnAttributeBase* aAttr ) + { + for( TInt i( 0 ); i < iAttrs.Count(); i++ ) + { + if( iAttrs[i]->Name() == aAttr->Name() ) + { + delete iAttrs[i]; + iAttrs.Remove(i); + break; + } + } + iAttrs.AppendL( aAttr ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemModel::ClearAttributesL() + { + iAttrs.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnAttributeBase* CHnItemModel::GetAttribute( const TDesC8 & aMulAttribute ) + { + CHnAttributeBase* attr = NULL; + for( TInt i( 0 ); i < iAttrs.Count(); i++ ) + { + if( ! iAttrs[i]->Name().Compare( aMulAttribute ) ) + { + attr = iAttrs[i]; + break; + } + } + return attr; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnItemModel::IsDeleteLocked() + { + TBool res = EFalse; + if ( iFlags & EItemFlagRemoveLocked ) + { + res = ETrue; + } + return res; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnItemModel::IsMoveLocked() + { + TBool res = EFalse; + if ( iFlags & EItemFlagMoveLocked ) + { + res = ETrue; + } + return res; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnItemModel::IsDrmExpired() + { + TBool res = EFalse; + if ( iFlags & EItemFlagDrmExpired ) + { + res = ETrue; + } + return res; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnItemModel::IsRunning() + { + TBool res = EFalse; + if ( iFlags & EItemFlagRunning ) + { + res = ETrue; + } + return res; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemModel::SetFlag( TInt aFlag ) + { + if ( ( iFlags & aFlag ) == 0 ) + { + iFlags |= aFlag; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemModel::ClearFlags() + { + iFlags = 0; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemModel::SetType( const TDesC8& aType ) + { + if ( !aType.Compare( KMenuFolder8 ) ) + { + iType = EItemTypeFolder; + } + else if ( !aType.Compare( KMenuSuite8 ) ) + { + iType = EItemTypeSuite; + } + else if ( !aType.Compare( KMenuApplication8 ) ) + { + iType = EItemTypeApplication; + } + else if ( !aType.Compare( KMenuParentFolder8 ) ) + { + iType = EItemTypeParentFolder; + } + else + { + iType = EItemTypeUnknown; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemModel::SetCustomId( TInt64 aCustomId ) + { + iCustomId = aCustomId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt64 CHnItemModel::CustomId() + { + return iCustomId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TMcsItemType CHnItemModel::GetItemType() + { + return iType; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TUid CHnItemModel::GetItemUid() + { + return iUid; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemModel::SetItemUidL( const TDesC8& aUid ) + { + TUint uint( KErrNone ); + HBufC* str = HnConvUtils::Str8ToStr( aUid ); + CleanupStack::PushL( str ); + + TInt position( str->Find( KHexPrefix16 ) ); + TPtrC string( *str ); + TRadix radix( EDecimal ); + if ( position == 0 ) + { + radix = EHex; + string.Set( str->Mid( KHexPrefix16().Length() ) ); + } + + TLex( string ).Val( uint, radix ); + CleanupStack::PopAndDestroy( str ); + + iUid = TUid::Uid( uint ); + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnitemsorder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnitemsorder.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,329 @@ +/* +* Copyright (c) 2007-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: items order manager class +* +*/ + + +#include "hnitemsorder.h" + +// ============================ MEMBER FUNCTIONS ============================= + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnItemsOrder* CHnItemsOrder::NewL() + { + CHnItemsOrder* self = NewLC(); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemsOrder::MarkSuiteUninitialized() + { + for (TInt i(0); i < iItemsEvaluated.Count(); i++) + { + iItemsEvaluated[i] = EFalse; + } + + iSuiteEvaluated = EFalse; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnItemsOrder* CHnItemsOrder::NewLC() + { + CHnItemsOrder* self = new( ELeave ) CHnItemsOrder(); + CleanupStack::PushL( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnItemsOrder::~CHnItemsOrder() + { + iItemsOrderCounts.Reset(); + iComplexItemsOrder.Reset(); + iItemsEvaluated.Reset(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemsOrder::SetSuiteId( TInt aId ) + { + iSuiteId = aId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnItemsOrder::GetSuiteId() const + { + return iSuiteId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemsOrder::RemoveItemId( TInt aId ) + { + TInt position = iComplexItemsOrder.Find( aId ); + if (position != KErrNotFound) + { + TInt modelNumber = CountModelNumberFor( position ); + --iItemsOrderCounts[ modelNumber ] ; + iComplexItemsOrder.Remove( position ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemsOrder::InsertItemIdToL( TInt aDataModelItem, + TInt aIndex, TInt aId ) + { + TInt position = CountStartIndexFor( aDataModelItem ) + aIndex; + if (position < iComplexItemsOrder.Count() ) + { + iComplexItemsOrder.InsertL( aId, position ); + } + else + { + iComplexItemsOrder.AppendL( aId ); + } + + TInt modelsCount = iItemsOrderCounts.Count(); + if (modelsCount <= aDataModelItem) + { + for (TInt i(modelsCount); i <= aDataModelItem; i++) + { + iItemsOrderCounts.AppendL( 0 ); + } + } + ++iItemsOrderCounts[ aDataModelItem ] ; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnItemsOrder::GetItemIdAt( TInt aDataModelItem, TInt aIndex ) + { + TInt globalItemPosition = CountStartIndexFor( aDataModelItem ) + aIndex; + return (iComplexItemsOrder.Count() > globalItemPosition) + ? iComplexItemsOrder[globalItemPosition] : KErrNotFound; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnItemsOrder::GetItemIdAt( TInt aPosition ) + { + return (iComplexItemsOrder.Count() > aPosition) + ? iComplexItemsOrder[aPosition] : KErrNotFound; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemsOrder::GetIdsForL( TInt aDataModelItem, + RArray< TInt >& aIds ) + { + if ( CountStartIndexFor( aDataModelItem ) == KErrNotFound + || iItemsOrderCounts.Count() <= aDataModelItem ) + { + return; + } + + TInt startIndex = CountStartIndexFor( aDataModelItem ); + + for ( TInt i = 0; + i < iItemsOrderCounts[ aDataModelItem ]; i++ ) + { + aIds.AppendL( iComplexItemsOrder[ startIndex + i ] ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemsOrder::SetItemIdAtL( TInt aPosition, TInt aId ) + { + if ( aPosition >= iComplexItemsOrder.Count() ) + { + iComplexItemsOrder.AppendL( aId ); + } + else + { + iComplexItemsOrder[ aPosition ] = aId; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemsOrder::DefineModelItemCountL( TInt aItemCounts ) + { + // Don't update this information on a initialized suitemodel. + if (iItemsEvaluated.Count() == 0 && !iSuiteEvaluated) + { + iSuiteEvaluated = EFalse; + for (TInt i(0); i < aItemCounts; i++) + { + iItemsOrderCounts.AppendL( 0 ); + iItemsEvaluated.AppendL(EFalse); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemsOrder::SuiteEvaluated() + { + iSuiteEvaluated = ETrue; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnItemsOrder::ItemEvaluated( TInt aIndex ) + { + iItemsEvaluated[aIndex] = ETrue; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnItemsOrder::IsSuiteReadyToShow() + { + TBool ready = ETrue; + for (TInt i(0); ready && i < iItemsEvaluated.Count(); i++) + { + ready = iItemsEvaluated[i]; + } + + return ready && iSuiteEvaluated; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnItemsOrder::GetModelItemCount( ) + { + return iItemsOrderCounts.Count(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnItemsOrder::operator[]( TInt aPosition ) + { + return GetItemIdAt( aPosition ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnItemsOrder::GetItemPosition( TInt aId ) + { + return iComplexItemsOrder.Find( aId ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnItemsOrder::CountStartIndexFor( TInt aDataModelItem ) + { + TInt startIndex( 0 ); + for( TInt i = 0; i < aDataModelItem && i < iItemsOrderCounts.Count(); i++ ) + { + startIndex += iItemsOrderCounts[ i ]; + } + return startIndex; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnItemsOrder::CountModelNumberFor( TInt aIndex ) + { + TInt modelNumber( 0 ); + TInt countLow( 0 ); + TInt countHigh( 0 ); + for( ; modelNumber < iItemsOrderCounts.Count(); modelNumber++ ) + { + countHigh += iItemsOrderCounts[ modelNumber ]; + if ( aIndex >= countLow && aIndex < countHigh ) + { + break; + } + countLow = countHigh; + } + return modelNumber; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnItemsOrder::Count() + { + return iComplexItemsOrder.Count(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnItemsOrder::CHnItemsOrder() : iSuiteId( KErrNotFound ) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnItemsOrder::ConstructL() + { + + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnmenuitemmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnmenuitemmodel.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,222 @@ +/* +* Copyright (c) 2007-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: menu item presentation model +* +*/ + + +#include "hnmenuitemmodel.h" + +// ============================ MEMBER FUNCTIONS ============================= + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnMenuItemModel* CHnMenuItemModel:: NewL( const TDesC& aName ) + { + CHnMenuItemModel* self = new( ELeave ) CHnMenuItemModel(); + CleanupStack::PushL( self ); + self->ConstructL( aName ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMenuItemModel::~CHnMenuItemModel() + { + iName.Close(); + iChildren.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnMenuItemModel::HasNext() + { + TBool ret = ETrue; + if( iNextMenu >= iChildren.Count() ) + { + ret = EFalse; + Reset(); + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnMenuItemModel* CHnMenuItemModel::GetNext() + { + ASSERT( iNextMenu < iChildren.Count() ); + CHnMenuItemModel* ret = iChildren[ iNextMenu ]; + iNextMenu++; + return ret; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnMenuItemModel::HasNextSpecific() + { + TBool hasNext = EFalse; + if ( iNextMenu >= iChildren.Count() ) + { + Reset(); + } + else if ( iChildren[iNextMenu]->IsItemSpecific() ) + { + hasNext = ETrue; + } + else + { + iNextMenu++; + hasNext = HasNextSpecific(); + } + return hasNext; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnMenuItemModel* CHnMenuItemModel::GetNextSpecific() + { + ASSERT( iNextMenu < iChildren.Count() ); + ASSERT( iChildren[iNextMenu]->IsItemSpecific() ); + CHnMenuItemModel* nextSpecific = iChildren[ iNextMenu ]; + iNextMenu++; + return nextSpecific; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMenuItemModel::Reset() + { + iNextMenu = 0; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMenuItemModel::AppendChildMenuL( CHnMenuItemModel* aMenuModel ) + { + ASSERT( aMenuModel ); + iChildren.AppendL( aMenuModel ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMenuItemModel::CHnMenuItemModel() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMenuItemModel::ConstructL( const TDesC& aName ) + { + ASSERT( aName.Length() ); + iItemSpecific = EFalse; + iName.CreateL( aName ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CHnMenuItemModel::NameL() + { + return iName; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnMenuItemModel::Command() + { + return iCommand; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMenuItemModel::SetCommand( TInt aCommandId ) + { + iCommand = aCommandId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnMenuItemModel::Position() + { + return iPosition; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMenuItemModel::SetPosition( TInt aPosition ) + { + iPosition = aPosition; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMenuItemModel::SetItemSpecific( TBool aItemSpecific ) + { + iItemSpecific = aItemSpecific; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnMenuItemModel::IsItemSpecific() + { + return iItemSpecific; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C MHnMenuItemModelIterator* CHnMenuItemModel::GetMenuStructure() + { + return this; + } + + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnsuitemodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnsuitemodel.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,987 @@ +/* +* 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: suite presentation model +* +*/ + + +#include <e32cmn.h> +#include "hnsuitemodel.h" +#include "hnsuitemodelcontainer.h" +#include "hnitemmodel.h" +#include "hnmenuitemmodel.h" +#include "hnactionmodel.h" +#include "hntoolbarmodel.h" +#include "menudebug.h" +#include "hnglobals.h" +#include "hnsuiteobserver.h" +#include "hnattributebase.h" +#include "hnattributetext.h" +#include "hnitemsorder.h" +#include "hneventhandler.h" +#include "hnitemfocushandler.h" + +// ============================ MEMBER FUNCTIONS ============================= + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnSuiteModel* CHnSuiteModel::NewL( CHnEventHandler& aEventHandler, + const TDesC& aGenreName ) + { + CHnSuiteModel* self = new (ELeave) CHnSuiteModel( aEventHandler ); + CleanupStack::PushL( self ); + self->ConstructL( aGenreName ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSuiteModel::ConstructL( const TDesC& aSuiteName ) + { + ASSERT( aSuiteName.Length() ); + iSuiteName = aSuiteName.AllocL(); + iTemplate.CreateL( KNullDesC8() ); + iItemsOrder = CHnItemsOrder::NewL(); + iExitMode = EExitModeNormal; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnSuiteModel::~CHnSuiteModel() + { + for (TInt i(0) ; i < iSuiteObservers.Count(); i++) + { + TRAP_IGNORE( iSuiteObservers[i]->HandleSuiteEventL( ESuiteModelDestroyed, this ) ); + } + + if ( iIsVisible && iIsActive ) + { + TRAP_IGNORE( HandleItemFocusL( iSuiteHighlight.iItemId, EFalse ) ); + } + delete iItemFocusHandler; + TRAP_IGNORE( OfferHnEventL( KIdSuiteUnLoad, + GetItemsOrder()->GetSuiteId(), NULL ) ); + + DEBUG16(("\t_Mm_:KIdSuiteUnLoad - %S",iSuiteName)); + + iSuiteObservers.Close(); + iObserverPriorities.Close(); + DEBUG16(("\t_MM_: CHnSuiteModel destructor: %S",iSuiteName)); + iTemplate.Close(); + delete iTitle; + delete iEmptyText; + delete iSuiteName; + + THashMapIter< TInt ,CHnItemModel* > modelIter( iItemsModels ); + while( modelIter.NextKey() ) + { + const TInt* key = modelIter.CurrentKey(); + iItemsOrder->RemoveItemId( *key ); + CHnItemModel** model = modelIter.CurrentValue(); + delete *model; + modelIter.RemoveCurrent(); + } + iItemsModels.Close(); + + THashMapIter< TInt, CArrayPtr<CHnActionModel>* > actionIter( iActions ); + while( actionIter.NextKey() ) + { + CArrayPtr<CHnActionModel>** actions = actionIter.CurrentValue(); + (*actions)->ResetAndDestroy(); + delete *actions; + actionIter.RemoveCurrent(); + } + iActions.Close(); + delete iItemsOrder; + DEBUG16(("\t_MM_: CHnSuiteModel destructor OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnSuiteModel::CHnSuiteModel( CHnEventHandler& aEventHandler ) : + iItemsModels( &DefaultHash::Integer, &DefaultIdentity::Integer ), + iActions( &DefaultHash::Integer, &DefaultIdentity::Integer ), + iEmptyItemId( KErrNotFound ), + iFocusQueue( KErrNotFound ), + iCustomId( KErrNotFound ), + iEventHandler( aEventHandler ) + { + iSuiteHighlight.iWidgetIndex = KErrNotFound; + iSuiteHighlight.iItemId = KErrNotFound; + iSuiteHighlight.iCustomId = KErrNotFound; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CHnSuiteModel::OfferHnEventL( + const TInt aEventId, const TInt aRecipientId, + CLiwGenericParamList* aEventParameters ) + { + TInt err( KErrNotFound ); + + CArrayPtr<CHnActionModel>* actions = GetActions( aEventId ); + + if ( aRecipientId != KErrNotFound ) + { + CHnItemModel** itemModel = iItemsModels.Find( aRecipientId ); + if ( itemModel && *itemModel ) + { + err = (*itemModel)->OfferHnEventL( iEventHandler, aEventId, + aEventParameters); + } + } + + if ( err != KErrNone && actions) + { + for( TInt i = 0; i < actions->Count(); i++ ) + { + ASSERT( actions->At( i ) ); + err = actions->At( i )->ExecuteL( iEventHandler, aEventParameters ); + if ( err != KErrNone ) + { + break; + } + } + } + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnSuiteModel::ItemEvaluationFinishedL( TInt aModelItemNumber ) + { + TBool observersNotified( EFalse ); + TBool alreadyNotified = iItemsOrder->IsSuiteReadyToShow(); + iItemsOrder->ItemEvaluated( aModelItemNumber ); + if ( iItemsOrder->IsSuiteReadyToShow() && !alreadyNotified ) + { + TRAP_IGNORE( OfferHnEventL( KIdSuiteLoad, + GetItemsOrder()->GetSuiteId(), NULL ) ); + DEBUG16(("\t_Mm_:KIdSuiteLoad - %S",iSuiteName)); + NotifyObserversL( ESuiteModelInitialized ); + observersNotified = ETrue; + } + return observersNotified; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnSuiteModel::SuiteEvaluationFinishedL( ) + { + TBool observersNotified( EFalse ); + TBool alreadyNotified = iItemsOrder->IsSuiteReadyToShow(); + iItemsOrder->SuiteEvaluated(); + if ( iItemsOrder->IsSuiteReadyToShow() && !alreadyNotified ) + { + TRAP_IGNORE( OfferHnEventL( KIdSuiteLoad, + GetItemsOrder()->GetSuiteId(), NULL ) ); + DEBUG16(("\t_Mm_:KIdSuiteLoad - %S",iSuiteName)); + NotifyObserversL( ESuiteModelInitialized ); + observersNotified = ETrue; + } + return observersNotified; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnSuiteModel::GetItemModelsCount() + { + return iItemsModels.Count(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CHnSuiteModel::SuiteName() const + { + return *iSuiteName; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CHnSuiteModel::Title() const + { + if ( iTitle ) + { + return *iTitle; + } + else + { + return KNullDesC(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::SetTitleL( const TDesC& aName ) + { + delete iTitle; + iTitle = NULL; + iTitle = aName.AllocL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CHnSuiteModel::EmptyText() const + { + if ( iEmptyText ) + { + return *iEmptyText; + } + else + { + return KNullDesC(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::SetEmptyTextL( const TDesC& aName ) + { + delete iEmptyText; + iEmptyText = NULL; + iEmptyText = aName.AllocL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnSuiteModel::WidgetType() const + { + //Following check is necessary because suite can be + //during evalutation -> UI Widgets can try to get and process templates + //what causes problems. Only when suite is fully evaluated and + //ready to be shown it returns widget type. + THnSuiteWidgetType ret( EUnspecified ); + if ( iItemsOrder->IsSuiteReadyToShow() ) + { + ret = iWidgetType; + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::SetWidgetType( THnSuiteWidgetType aWidgetType ) + { + iWidgetType = aWidgetType; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C MHnMenuItemModelIterator* CHnSuiteModel::GetMenuStructureL( + TInt aItemId ) + { + if (aItemId == KErrNotFound) + { + // this could be used in future for empty item + return NULL; + } + return iItemsModels.FindL( aItemId )->GetMenuStructure(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::AddItemL( TInt aId, CHnItemModel* aItemModel, + TInt aItemModelNumber, TInt aItemModelPosition ) + { + DEBUG16(("_MM_: CHnSuiteModel::AddItemL IN")); + ASSERT( aItemModel ); + + TInt highlightedItem( iSuiteHighlight.iCustomId ); + iItemsModels.InsertL( aId, aItemModel ); + + // "empty" item should not be added to ordering table + if ( !aItemModel->GetTemplate().Compare( KTemplateEmpty8 ) ) + { + // store id of empty item + iEmptyItemId = aId; + } + else + { + iItemsOrder->InsertItemIdToL( aItemModelNumber, aItemModelPosition, aId ); + DEBUG16(("_MM_: Adding at index: model no. %D item no. %D, id: %D", aItemModelNumber, aItemModelPosition, aId)); + + // focus queue + if ( ( iFocusQueue >= 0 ) && ( iFocusQueue == aItemModel->CustomId() ) ) + { + SetSuiteHighlightL( iItemsOrder->Count() - 1 ); + iFocusQueue = KErrGeneral ; + } + else if( aItemModel->CustomId() != KErrNotFound ) + { + SetSuiteHighlightByCustomIdL( highlightedItem ); + } + } + + DEBUG16(("_MM_: CHnSuiteModel::AddItemL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CHnSuiteModel::GetTemplate() const + { + //Following check is necessary because suite can be + //during evalutation -> UI Widgets can try to get and process templates + //what causes problems. Only when suite is fully evaluated and + //ready to be shown it returns templates. + if ( iItemsOrder->IsSuiteReadyToShow() ) + { + return iTemplate; + } + return KNullDesC8; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::SetTemplateL( const TDesC8& aValue ) + { + if( aValue.Compare( iTemplate ) ) + { + iTemplate.Close(); + iTemplate.CreateL( aValue.Length() + 1); + iTemplate.Copy( aValue ); + const char* templateChar = reinterpret_cast<const char* >( + iTemplate.PtrZ() ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::NotifyObserversL( THnCustomSuiteEvent aEventType ) + { + RPointerArray<MHnSuiteObserver> observerFreezedArray; + CleanupClosePushL( observerFreezedArray ); + + for (TInt i(0); i < iSuiteObservers.Count(); i++) + { + observerFreezedArray.AppendL( iSuiteObservers[i] ); + } + + for (TInt i(0); i < observerFreezedArray.Count(); i++) + { + observerFreezedArray[i]->HandleSuiteEventL( aEventType, this ); + } + + CleanupStack::PopAndDestroy( &observerFreezedArray ); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::RefreshMulModelL( TInt aPreviousItemCount ) + { + if (iItemsOrder->IsSuiteReadyToShow()) + { + TInt modelcount = iItemsOrder->Count(); + if ( aPreviousItemCount < modelcount ) + { + NotifyObserversL(ESuiteItemsAdded); + } + else if ( aPreviousItemCount > modelcount ) + { + NotifyObserversL(ESuiteItemsRemoved); + } + else + { + NotifyObserversL(ESuiteItemsUpdated); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::UpdateItemTemplateL( TInt aId ) + { + TInt position = iItemsOrder->GetItemPosition( aId ); + if( position != KErrNotFound ) + { + CHnItemModel** model = iItemsModels.Find( aId ); + if (model && !(*model)->GetTemplate().Compare( KNullDesC8() ) ) + { + (*model)->SetTemplateL( GetTemplate() ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::RegisterSuiteObserverL( MHnSuiteObserver* aObserver, + TThreadPriority aPriority ) + { + TInt i(0); + TInt posFound = iSuiteObservers.Find( aObserver ); + if ( posFound != KErrNotFound ) + { + iObserverPriorities.Remove( posFound ); + iSuiteObservers.Remove( posFound ); + } + + for (; i < iObserverPriorities.Count(); i++) + { + if (aPriority > iObserverPriorities[i]) + { + break; + } + } + + iObserverPriorities.InsertL( aPriority , i ); + iSuiteObservers.InsertL( aObserver, i ); + + if ( iItemsOrder->IsSuiteReadyToShow() && posFound == KErrNotFound ) + { + aObserver->HandleSuiteEventL( ESuiteModelInitialized, this ); + } + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::UnregisterSuiteObserver( MHnSuiteObserver* aObserver) + { + TInt index = iSuiteObservers.Find( aObserver ); + if (index != KErrNotFound) + { + iSuiteObservers.Remove( index ); + iObserverPriorities.Remove( index ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::RemoveItemL( TInt aId ) + { + TInt highlightedItem( KErrNotFound ); + CHnItemModel* modelToRemove = GetItemModel( aId ); + if( modelToRemove ) + { + if( modelToRemove->CustomId() != KErrNotFound ) + { + if (modelToRemove->CustomId() != iSuiteHighlight.iCustomId ) + { + highlightedItem = iSuiteHighlight.iCustomId; + } + else + { +// set the highlight to the item before the removed item. + TInt newWidgetIndex = iItemsOrder->Count() - 2; + if( newWidgetIndex < 0 ) + { + newWidgetIndex = 0; + } + SetSuiteHighlightL( newWidgetIndex ); + } + } + delete modelToRemove; + iItemsModels.Remove( aId ); + } + iItemsOrder->RemoveItemId( aId ); + SetSuiteHighlightByCustomIdL( highlightedItem ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::RemoveAllItems() + { + THashMapIter< TInt ,CHnItemModel* > iterator( iItemsModels ); + while( iterator.NextKey() ) + { + CHnItemModel** model = iterator.CurrentValue(); + delete *model; + iterator.RemoveCurrent(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C RHashMap< TInt, CArrayPtr<CHnActionModel>* >& + CHnSuiteModel::GetActions() + { + return iActions; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CArrayPtr<CHnActionModel>* CHnSuiteModel::GetActions( TInt aId ) + { + CArrayPtr<CHnActionModel>** ret = iActions.Find( aId ); + if( ret ) + { + return *ret; + } + return NULL; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnItemModel* CHnSuiteModel::GetItemModel( TInt aId ) + { + TRAP_IGNORE( UpdateItemTemplateL( aId ) ); + + CHnItemModel** model = iItemsModels.Find( aId ); + return ( model ) ? *model : NULL; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnSuiteModel::HasToolbar() const + { + TBool hasToolbar = EFalse; + THashMapIter< TInt ,CHnItemModel* > modelIter( iItemsModels ); + while( modelIter.NextKey() ) + { + CHnItemModel** model = modelIter.CurrentValue(); + const CHnToolbarModel * toolbarModel = ( *model )->GetToolbarModel(); + hasToolbar = (toolbarModel) ? toolbarModel->HasButtons() : EFalse; + if( hasToolbar ) + { + break; + } + } + return hasToolbar; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnSuiteModel::IdByIndex( TInt aIndex ) + { + TInt result(KErrNotFound); + + if (aIndex < 0) + { + result = iEmptyItemId; + } + else + { + result = iItemsOrder->GetItemIdAt( aIndex ); + } + + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnSuiteModel::IsItemMoveLocked( TInt aIndex ) + { + TInt ret( EFalse ); + + if (aIndex >= 0) + { + CHnItemModel** itemModel = iItemsModels.Find( + iItemsOrder->GetItemIdAt( aIndex ) ); + + if ( !itemModel || (*itemModel)->IsMoveLocked() ) + { + ret = ETrue; + } + } + + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TMcsItemType CHnSuiteModel::GetItemType( TInt aIndex ) + { + TMcsItemType type = EItemTypeUnknown; + + CHnItemModel** itemModel = iItemsModels.Find( + iItemsOrder->GetItemIdAt( aIndex ) ); + + if ( itemModel ) + { + type = (*itemModel)->GetItemType(); + } + + return type; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnSuiteModel::GetSuiteHighlight() + { + return iSuiteHighlight.iWidgetIndex; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::SetSuiteHighlightL( TInt aHighLight ) + { + DEBUG(("_MM_:CHnSuiteModel::SetSuiteHighlight - IN")); + DEBUG(("\t_MM_:aHighLight: %d",aHighLight)); + + TInt newItemId( IdByIndex( aHighLight ) ); + CHnItemModel* itemModel( GetItemModel( newItemId ) ); + TInt64 newCustomId( KErrNotFound ); + if ( itemModel ) + { + newCustomId = itemModel->CustomId(); + } + + if ( ( newCustomId != iSuiteHighlight.iCustomId || + newItemId != iSuiteHighlight.iItemId ) && ( iIsActive && iIsVisible ) ) + { + HandleItemFocusL( iSuiteHighlight.iItemId, EFalse ); + HandleItemFocusL( newItemId, ETrue ); + } + + iSuiteHighlight.iCustomId = newCustomId; + iSuiteHighlight.iItemId = newItemId; + iSuiteHighlight.iWidgetIndex = aHighLight; + + DEBUG(("_MM_:CHnSuiteModel::SetSuiteHighlight - OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSuiteModel::SetSuiteHighlightByCustomIdL( TInt64 aCustomId ) + { + DEBUG(("_MM_:CHnSuiteModel::SetSuiteHighlightByCustomIdL - IN")); + DEBUG(("\t_MM_:aHighLight: %d",aCustomId)); + + if( aCustomId != KErrNotFound ) + { + THashMapIter< TInt ,CHnItemModel* > modelIter( iItemsModels ); + while( modelIter.NextKey() ) + { + const TInt* id = modelIter.CurrentKey(); + CHnItemModel** model = modelIter.CurrentValue(); + if( (*model)->CustomId() == aCustomId ) + { + if( *id != KErrNotFound ) + { + TInt itemIndex( iItemsOrder->GetItemPosition( *id ) ); + if( itemIndex != KErrNotFound ) + { + SetSuiteHighlightL( itemIndex ); + } + } + break; + } + } + } + + DEBUG(("_MM_:CHnSuiteModel::SetSuiteHighlightByCustomIdL - OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnSuiteModel::IsItemBetweenMoveLocked( TInt aIndexStart, TInt aIndexEnd ) + { + if ( aIndexEnd < KErrNone || aIndexStart < KErrNone ) + { + return ETrue; + } + if ( aIndexEnd >= iItemsOrder->Count() ) + { + aIndexEnd = iItemsOrder->Count() - 1; + } + + TInt start( ( aIndexStart > aIndexEnd ) ? aIndexEnd : aIndexStart ); + TInt end( ( aIndexStart > aIndexEnd ) ? aIndexStart : aIndexEnd ); + + TInt ret( EFalse ); + + for ( TInt index = start; index <= end; index++ ) + { + CHnItemModel** itemModel = iItemsModels.Find( + iItemsOrder->GetItemIdAt( index ) ); + if ( !itemModel || (*itemModel)->IsMoveLocked() ) + { + ret = ETrue; + break; + } + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnSuiteModel::ReorderItemsL( TInt aFromIndex, TInt aToIndex ) + { + DEBUG( ("_MM_: CHnSuiteModel::ReorderItems - IN" ) ); + + TInt operation ( (aFromIndex < aToIndex) ? 1 : -1 ); + TInt realFromId = iItemsOrder->GetItemIdAt(aFromIndex); + for ( int i = aFromIndex ; (operation == 1 && i < aToIndex) + || (operation == -1 && i > aToIndex) ; i = i + operation ) + { + if ( (i+operation < 0) || (i+operation >= GetItemModelsCount()) ) + break; + + iItemsOrder->SetItemIdAtL(i, iItemsOrder->GetItemIdAt(i+operation)); + } + + iItemsOrder->SetItemIdAtL(aToIndex, realFromId); + + // recalculate current active item + SetSuiteHighlightL( GetSuiteHighlight() ); + + DEBUG( ("_MM_: CHnSuiteModel::ReorderItems - OUT" ) ); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnItemsOrder* CHnSuiteModel::GetItemsOrder() + { + return iItemsOrder; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::QueueFocus( TInt aCustomId ) + { + iFocusQueue = aCustomId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::SetCustomId( TInt64 aCustomId ) + { + iCustomId = aCustomId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt64 CHnSuiteModel::CustomId() + { + return iCustomId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::SetActiveL( TBool aActive ) + { + DEBUG16(("_MM_:CHnSuiteModel::SetActiveL %S - IN",iSuiteName)); + DEBUG(("\t_MM_:aActive: %d",aActive)); + DEBUG(("\t_MM_:iIsActive: %d",iIsActive)); + + if ( aActive != iIsActive ) + { + iIsActive = aActive; + if ( iIsVisible ) + { + HandleItemFocusL( iSuiteHighlight.iItemId, aActive ); + } + } + + DEBUG(("_MM_:CHnSuiteModel::SetActiveL - OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnSuiteModel::IsActive() + { + return iIsActive; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::SetVisibleL( TBool aVisible ) + { + DEBUG16(("_MM_:CHnSuiteModel::SetVisible %S - IN",iSuiteName)); + DEBUG(("\t_MM_:aVisible: %d",aVisible)); + DEBUG(("\t_MM_:iIsVisible: %d",iIsVisible)); + + if ( aVisible != iIsVisible ) + { + iIsVisible = aVisible; + if ( iIsActive ) + { + HandleItemFocusL( iSuiteHighlight.iItemId, aVisible ); + } + } + + DEBUG(("_MM_:CHnSuiteModel::SetVisible - OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSuiteModel::HandleItemFocusL( TInt aItemId, TBool aFocused ) + { + DEBUG16(("_MM_:CHnSuiteModel::HandleItemFocusL %S - IN",iSuiteName)); + DEBUG(("\t_MM_:aItemIndex: %d",aItemId)); + DEBUG(("\t_MM_:aFocused: %d",aFocused)); + + if ( aItemId >= 0 ) + { + if ( !iItemFocusHandler ) + { + iItemFocusHandler = CHnItemFocusHandler::NewL( this ); + } + TInt eventId = aFocused ? KIdFocusGain : KIdFocusLost; + iItemFocusHandler->SetFocusL( eventId, aItemId ); +// TRAP_IGNORE( OfferHnEventL( eventId, aItemId, NULL ) ); + } + + DEBUG(("_MM_:CHnSuiteModel::HandleItemFocusL - OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnItemModel* CHnSuiteModel::GetMatchingItemModelL( TInt64 aCustomId, + TInt& aIndex ) + { + CHnItemModel* itemModel( NULL ); + + // check suiteCustomId + if ( aCustomId >= 0 ) + { + for ( TInt i( 0 ); i < GetItemModelsCount(); i++ ) + { + TInt itemModelId = IdByIndex( i ); + CHnItemModel* tmpItemModel = GetItemModel( itemModelId ); + + if ( tmpItemModel && + tmpItemModel->CustomId() == aCustomId ) + { + aIndex = i; + itemModel = tmpItemModel; + break; + } + } + } + + return itemModel; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModel::SetExitMode( TExitMode aExitMode ) + { + iExitMode = aExitMode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSuiteModel::RemoveLiwObjects() + { + for ( TInt i = 0; i < GetItemModelsCount(); ++i ) + { + CHnItemModel* itemModel = GetItemModel( IdByIndex( i ) ); + if ( itemModel ) + { + itemModel->RemoveLiwObjects(); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TExitMode CHnSuiteModel::ExitMode() + { + return iExitMode; + } + + +// End of file diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnsuitemodelcontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnsuitemodelcontainer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,263 @@ +/* +* Copyright (c) 2007-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: suite presentation models container +* +*/ + + +#include "hnsuitesstack.h" +#include "hneventhandler.h" +#include "hnmdmodel.h" +#include "hnsuitemodel.h" +#include "hnsuitemodelcontainer.h" +#include "hnglobals.h" +#include "hncontrollerinterface.h" + +const TInt KParentSuiteDistance( 2 ); + +// ============================ MEMBER FUNCTIONS ============================= + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSuiteModelContainer::ConstructL( + MHnMdModelEventObserver& aModelObserver, + MHnControllerInterface& aController ) + { + iSuitesStack = CHnSuitesStack::NewL( aController ); + iEventHandler = CHnEventHandler::NewL( aModelObserver , aController ); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnSuiteModelContainer* CHnSuiteModelContainer::NewL( + MHnMdModelEventObserver& aModelObserver, + MHnControllerInterface& aController ) + { + CHnSuiteModelContainer* self = CHnSuiteModelContainer::NewLC( + aModelObserver , aController ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnSuiteModelContainer* CHnSuiteModelContainer::NewLC( + MHnMdModelEventObserver& aModelObserver, + MHnControllerInterface& aController ) + { + CHnSuiteModelContainer* self = new( ELeave ) CHnSuiteModelContainer(); + CleanupStack::PushL( self ); + self->ConstructL( aModelObserver, aController ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnSuiteModelContainer::CHnSuiteModelContainer() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnSuiteModelContainer::~CHnSuiteModelContainer() + { + delete iSuitesStack; + delete iEventHandler; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnSuiteModel* CHnSuiteModelContainer::PopSuiteModelL( + const TDesC& aSuiteName ) + { + CHnSuiteModel* suiteModel = iSuitesStack->PopL(); + + if ( suiteModel && + suiteModel->SuiteName().Compare( aSuiteName ) ) + { + User::LeaveIfError( KErrNotFound ); + } + + delete suiteModel; + suiteModel = iSuitesStack->GetLast(); + return suiteModel; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnSuiteModelContainer::OfferHnEventL( const TInt aEventId, + const TInt aRecipientId, CLiwGenericParamList* aEventParameters ) + { + CHnSuiteModel* lastSuiteModel = GetLastSuiteModel(); + TInt err = KErrNotFound; + + if( aEventId == KKeyIdMoveHighlight ) + { + for( int i( 0 ); i<GetSuiteModelCount(); i++ ) + { + CHnSuiteModel* model = GetSuiteModel( i ); + TBool isRoot( model->CustomId() == KRootId ); + if( model && !isRoot ) + { + model->SetSuiteHighlightL( model->GetSuiteHighlight() + aRecipientId ); + } + } + } + else + { + if ( lastSuiteModel ) + { + err = lastSuiteModel->OfferHnEventL( aEventId, + aRecipientId, aEventParameters ); + } + } + + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModelContainer::PushNewSuiteModelL( + const TDesC& aGenre ) + { + CHnSuiteModel* retModel = NULL; + retModel = CHnSuiteModel::NewL( *iEventHandler, aGenre ); + iSuitesStack->PushL( retModel ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnSuiteModel* CHnSuiteModelContainer::GetSuiteModel( + const TDesC& aSuiteName ) + { + ASSERT( aSuiteName.Length() ); + + TInt count( iSuitesStack->Count() ); + CHnSuiteModel* retModel = NULL; + + for (TInt i = iSuitesStack->Count() - 1; i >= 0; i-- ) + { + retModel = iSuitesStack->Get( i ); + if ( retModel && !retModel->SuiteName().Compare( aSuiteName ) ) + { + break; + } + else + { + retModel = NULL; + } + } + + return retModel; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnSuiteModelContainer::GetSuiteModelCount() const + { + return iSuitesStack->Count(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnSuiteModel* CHnSuiteModelContainer::GetLastSuiteModel() + { + return iSuitesStack->GetLast(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnSuiteModel* CHnSuiteModelContainer::GetParentSuiteModel() + { + CHnSuiteModel* model = NULL; + if( iSuitesStack->Count() > 1 ) + { + model = iSuitesStack->Get( + iSuitesStack->Count() - KParentSuiteDistance ); + } + return model; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnSuiteModel* CHnSuiteModelContainer::GetSuiteModel(TInt aPosition) + { + return iSuitesStack->Get( aPosition ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnSuiteModel* CHnSuiteModelContainer::GetMatchingSuiteModel( + TInt64 aCustomId ) + { + CHnSuiteModel* suiteModel( NULL ); + + if ( aCustomId >= 0 ) + { + for( TInt i( 0 ); i < GetSuiteModelCount(); i++ ) + { + CHnSuiteModel* tmpSuiteModel( GetSuiteModel( i ) ); + + // compare suiteCustomIds + if ( tmpSuiteModel && ( tmpSuiteModel->CustomId() == aCustomId ) ) + { + suiteModel = tmpSuiteModel; + break; + } + } + } + + return suiteModel; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnSuiteModelContainer::RemoveLiwObjects() + { + for( TInt i = 0; i < GetSuiteModelCount(); ++i ) + { + GetSuiteModel( i )->RemoveLiwObjects(); + } + } + +// End of file diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hnsuitesstack.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnsuitesstack.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,151 @@ +/* +* Copyright (c) 2007-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: suite stack +* +*/ + + +#include "hnsuitemodel.h" +#include "hnsuitesstack.h" +#include "hnsuitemodelcontainer.h" +#include "hncontrollerinterface.h" + + +// ============================ MEMBER FUNCTIONS ============================= + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnSuitesStack* CHnSuitesStack::NewL( MHnControllerInterface& aControllerInterface ) + { + CHnSuitesStack* self = new (ELeave) CHnSuitesStack( aControllerInterface ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnSuitesStack::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnSuitesStack::~CHnSuitesStack() + { + iStack.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnSuitesStack::CHnSuitesStack( MHnControllerInterface& aControllerInterface ): + iControllerInterface( aControllerInterface ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnSuitesStack::PushL( CHnSuiteModel* aSuiteModel ) + { + iStack.AppendL( aSuiteModel ); + iControllerInterface.HandleSuiteEventL( ESuitePushedToStack, aSuiteModel ); + return iStack.Count(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnSuiteModel* CHnSuitesStack::PopL() + { + CHnSuiteModel* retSuite = NULL; + TInt pos = iStack.Count() - 1; + if ( pos >= 0 ) + { + retSuite = iStack[ pos ]; + iStack.Remove( pos ); + } + iControllerInterface.HandleSuiteEventL( ESuitePoppedFromStack, retSuite ); + + return retSuite; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnSuiteModel* CHnSuitesStack::GetLast() + { + return ( iStack.Count() > 0 ) ? iStack[ iStack.Count() - 1 ] : NULL; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnSuiteModel* CHnSuitesStack::Get( TInt aPosition ) + { + ASSERT( aPosition >= 0 ); + ASSERT( aPosition < iStack.Count() ); + + return iStack[ aPosition ]; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnSuitesStack::IsEmpty() + { + return ( iStack.Count() > 0 ) ? EFalse : ETrue; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnSuiteModel* CHnSuitesStack::GetRootSuite() + { + CHnSuiteModel* retSuite = NULL; + + if ( iStack.Count() > 0 ) + { + retSuite = iStack[ 0 ]; + } + + return retSuite; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnSuitesStack::Count() + { + return iStack.Count(); + } +//End of file. diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnpresentationmodel/src/hntoolbarmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hntoolbarmodel.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2007-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: toolbar presentation model +* +*/ + + +#include "hntoolbarmodel.h" +#include "hnbuttonmodel.h" + +// ============================ MEMBER FUNCTIONS ============================= + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnToolbarModel* CHnToolbarModel::NewLC() + { + CHnToolbarModel* self = new( ELeave ) CHnToolbarModel(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnToolbarModel::~CHnToolbarModel() + { + iButtons.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnToolbarModel::AddButtonL( CHnButtonModel* aButton ) + { + if( iButtons.Count() <= KMaxButtonCount ) + { + iButtons.AppendL( aButton ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const CHnButtonModel* CHnToolbarModel::GetButton( TInt aIndex ) const + { + CHnButtonModel* button = NULL; + for( TInt i( 0 ); i < iButtons.Count(); i++ ) + { + if( iButtons[ i ]->GetIndex() == aIndex ) + { + button = iButtons[ i ]; + } + } + return button; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHnToolbarModel::HasButtons() const + { + TBool hasButtons = EFalse; + if( iButtons.Count() != 0 ) + { + hasButtons = ETrue; + } + return hasButtons; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnToolbarModel::RemoveLiwObjects() + { + for( TInt i( 0 ); i < iButtons.Count(); i++ ) + { + iButtons[i]->RemoveLiwObjects(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnToolbarModel::CHnToolbarModel( TInt aMaxCount ) : + KMaxButtonCount( aMaxCount ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnToolbarModel::ConstructL() + { + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/bwins/hnutilitiesu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/bwins/hnutilitiesu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +EXPORTS + ?ExecuteL@CHnServiceHandler@@QAEHPAVMLiwNotifyCallback@@H@Z @ 1 NONAME ; int CHnServiceHandler::ExecuteL(class MLiwNotifyCallback *, int) + ?GetStringL@HnLiwUtils@@SAHABVCLiwGenericParamList@@ABVTDesC8@@AAVRBuf8@@@Z @ 2 NONAME ; int HnLiwUtils::GetStringL(class CLiwGenericParamList const &, class TDesC8 const &, class RBuf8 &) + ?NewLC@CHnRepositoryManager@@SAPAV1@XZ @ 3 NONAME ; class CHnRepositoryManager * CHnRepositoryManager::NewLC(void) + ?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<class CHnMdBaseKey> 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 &) + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/data/20012474.txt Binary file menufw/hierarchynavigator/hnutilities/data/20012474.txt has changed diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/data/20012474_newMenuFw.txt Binary file menufw/hierarchynavigator/hnutilities/data/20012474_newMenuFw.txt has changed diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/eabi/hnutilitiesu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/eabi/hnutilitiesu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,48 @@ +EXPORTS + _ZN10HnLiwUtils10GetStringLERK20CLiwGenericParamListRK6TDesC8R5RBuf8 @ 1 NONAME + _ZN10HnLiwUtils10GetStringLERK20CLiwGenericParamListRK6TDesC8R6RBuf16 @ 2 NONAME + _ZN10HnLiwUtils10GetStringLERK20CLiwGenericParamListRK6TDesC8iR5RBuf8 @ 3 NONAME + _ZN10HnLiwUtils10GetStringLERK20CLiwGenericParamListRK6TDesC8iR6RBuf16 @ 4 NONAME + _ZN10HnLiwUtils11GetVariantLERK20CLiwGenericParamListRK6TDesC8R11TLiwVariant @ 5 NONAME + _ZN10HnLiwUtils11GetVariantLERK20CLiwGenericParamListRK6TDesC8iR11TLiwVariant @ 6 NONAME + _ZN10HnLiwUtils16VariantToStringLER11TLiwVariantR5RBuf8 @ 7 NONAME + _ZN10HnLiwUtils16VariantToStringLER11TLiwVariantR6RBuf16 @ 8 NONAME + _ZN10HnLiwUtils20SetGenericParamListLERK13RPointerArrayI12CHnMdBaseKeyER20CLiwGenericParamList @ 9 NONAME + _ZN10HnLiwUtils21GetIterableItemCountLER12CLiwIterable @ 10 NONAME + _ZN10HnLiwUtils9GetInt64LERK20CLiwGenericParamListRK6TDesC8iRx @ 11 NONAME + _ZN11HnConvUtils10Str8ToUintERK6TDesC8Rj @ 12 NONAME + _ZN11HnConvUtils10StrToStr8LERK7TDesC16 @ 13 NONAME + _ZN11HnConvUtils11NumToStr8LCERKi @ 14 NONAME + _ZN11HnConvUtils11Str8ToStrLCERK6TDesC8 @ 15 NONAME + _ZN11HnConvUtils11StrToStr8LCERK7TDesC16 @ 16 NONAME + _ZN11HnConvUtils8StrToIntERK7TDesC16Ri @ 17 NONAME + _ZN11HnConvUtils8StrToIntERK7TDesC16Rl @ 18 NONAME + _ZN11HnConvUtils9Str8ToIntERK6TDesC8Ri @ 19 NONAME + _ZN11HnConvUtils9Str8ToIntERK6TDesC8Rl @ 20 NONAME + _ZN11HnConvUtils9Str8ToStrERK6TDesC8 @ 21 NONAME + _ZN12CHnMdBaseKey10AddSubKeyLEPS_ @ 22 NONAME + _ZN12CHnMdBaseKey10EvaluateLCERK20CLiwGenericParamListi @ 23 NONAME + _ZN14HnMdKeyFactory7CreateLE14TXmlEngElement @ 24 NONAME + _ZN14HnMdKeyFactory7CreateLERK6TDesC8S2_RK7TDesC16 @ 25 NONAME + _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 + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project hnutilities +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/hnrepositorymanager.h |../../../inc/hnrepositorymanager.h +../inc/hnconvutils.h |../../../inc/hnconvutils.h +../inc/hnconvutils.inl |../../../inc/hnconvutils.inl +../inc/hnliwutils.h |../../../inc/hnliwutils.h +../inc/hnmdbasekey.h |../../../inc/hnmdbasekey.h +../inc/hnmdkeyfactory.h |../../../inc/hnmdkeyfactory.h +../inc/hnservicehandler.h |../../../inc/hnservicehandler.h + +../data/20012474_newMenuFw.txt /epoc32/release/winscw/udeb/z/private/10202be9/20012474.txt +../data/20012474_newMenuFw.txt /epoc32/release/winscw/urel/z/private/10202be9/20012474.txt +../data/20012474_newMenuFw.txt /epoc32/data/z/private/10202be9/20012474.txt + +PRJ_MMPFILES +hnutilities.mmp + +PRJ_TESTMMPFILES +#ifdef _MATRIX_MENU_INCLUDE_TEST_CONTENT +#include "../internal/test/group/bld.inf" +#endif diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/group/hnutilities.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/group/hnutilities.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project hierarchy navigator utilities +* +*/ + + +#include <platform_paths.hrh> + +TARGET hnutilities.dll +TARGETTYPE dll + +UID 0x1000008d 0x2001843B + +CAPABILITY CAP_GENERAL_DLL + +VENDORID VID_DEFAULT + +SOURCEPATH ../src + +SOURCE hnrepositorymanager.cpp +// static utils +SOURCE hnconvutils.cpp +SOURCE hnliwutils.cpp +// keys +SOURCE hnmdbasekey.cpp +SOURCE hnmdbooleankey.cpp +SOURCE hnmdintegerkey.cpp +SOURCE hnmdlistkey.cpp +SOURCE hnmdmapkey.cpp +SOURCE hnmdstring16key.cpp +SOURCE hnmdstring8key.cpp +SOURCE hnmdundefkey.cpp +SOURCE hnmduidkey.cpp +SOURCE hnmdkeyfactory.cpp +// service handling +SOURCE hnservicehandler.cpp +SOURCE hnmduintegerkey.cpp hnmdinteger64key.cpp + +USERINCLUDE ../inc + +SYSTEMINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY estor.lib +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY efsrv.lib +LIBRARY CentralRepository.lib +LIBRARY charconv.lib // for CnvUtfConverter +LIBRARY liwservicehandler.lib // LIW Framework +LIBRARY XmlEngineDOM.lib // XML parser +LIBRARY commonengine.lib // StringLoader + +#ifdef _MATRIX_MENU_TRACE_PERFORMANCE +LIBRARY flogger.lib +#else +DEBUGLIBRARY flogger.lib +#endif + + +// End of file + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnconvutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnconvutils.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef HNCONVUTILS_H +#define HNCONVUTILS_H + +#include <e32base.h> + +/** + * Provides static methods for converting numbers to + * descriptors and vice versa. + * + * @lib hnutilities.lib + * @since S60 v5.0 + * @ingroup group_hnutilities + */ +NONSHARABLE_CLASS( HnConvUtils ) + { +public: + + /** + * Converts narrow string descriptor to default width string descriptor. + * + * @since S60 v5.0 + * @param aStr Narrow string descriptor. + * @return Default wide string descriptor. + */ + IMPORT_C static HBufC* Str8ToStr( const TDesC8& aStr ); + + /** + * Converts narrow string descriptor to default width string descriptor. + * Does not handle special characters. + * + * @since S60 v5.0 + * @param aStr Narrow string descriptor. + * @return Default wide string descriptor. + */ + static HBufC* Str8ToStrFastLC( const TDesC8& aStr ); + + /** + * Converts wide string descriptor to narrow string descriptor. + * Does not handle special characters. + * + * @since S60 v5.0 + * @param aStr Wide string descriptor input. + * @return Narrow string. + */ + static HBufC8* StrToStr8FastLC( const TDesC16& aStr ); + + /** + * Converts narrow string descriptor to default width string descriptor. + * Handles special characters. + * + * @since S60 v5.0 + * @param aStr Narrow string descriptor. + * @return Default wide string descriptor. + */ + IMPORT_C static HBufC* Str8ToStrLC( const TDesC8& aStr ); + + /** + * Converts wide string descriptor to narrow string descriptor. + * Handles special characters. + * + * @since S60 v5.0 + * @param aStr Wide string descriptor input. + * @return Narrow string. + */ + IMPORT_C static HBufC8* StrToStr8LC( const TDesC16& aStr ); + + /** + * Converts wide string descriptor to narrow string descriptor. + * + * @since S60 v5.0 + * @param aStr Wide string descriptor input. + * @return Narrow string. + */ + IMPORT_C static HBufC8* StrToStr8L( const TDesC16& aStr ); + + /** + * Converts integer to narrow string descriptor. + * + * @since S60 v5.0 + * @param aNum Number. + * @return Narrow string. + */ + IMPORT_C static HBufC8* NumToStr8LC( const TInt& aNum ); + + /** + * Converts narrow string descriptor to integer value. + * + * @since S60 v5.0 + * @param aValue Input descriptor. + * @param aResult Result integer. + * @return Error code. + */ + IMPORT_C static TInt Str8ToInt( const TDesC8& aValue, TInt& aResult ); + + /** + * Converts string descriptor to integer value. + * + * @since S60 v5.0 + * @param aValue Input descriptor. + * @param aResult Result integer. + * @return Error code. + */ + IMPORT_C static TInt StrToInt( const TDesC& aValue, TInt& aResult ); + + /** + * Converts narrow string descriptor to integer value. + * + * @since S60 v5.0 + * @param aValue Input descriptor. + * @param aResult Result integer. + * @return Error code. + */ + IMPORT_C static TInt Str8ToInt( const TDesC8& aValue, TInt32& aResult ); + + /** + * Converts narrow string descriptor to integer value. + * + * @since S60 v5.0 + * @param aValue Input descriptor. + * @param aResult Result integer. + * @return Error code. + */ + IMPORT_C static TInt StrToInt( const TDesC& aValue, TInt32& aResult ); + + /** + * Converts narrow string descriptor to integer value. + * + * @since S60 v5.0 + * @param aValue Input descriptor. + * @param aResult Result integer. + * @return Error code. + */ + IMPORT_C static TInt Str8ToUint( const TDesC8& aValue, TUint& aResult ); + }; + +#include "hnconvutils.inl" + +#endif // HNCONVUTILS_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnconvutils.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnconvutils.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +/* +* 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: +* +*/ + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +inline HBufC* HnConvUtils::Str8ToStrFastLC( const TDesC8& aStr ) + { + HBufC* ret = HBufC::NewLC( aStr.Length() ); + ret->Des().Copy( aStr ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +inline HBufC8* HnConvUtils::StrToStr8FastLC( const TDesC16& aStr ) + { + HBufC8* ret = HBufC8::NewLC( aStr.Length() ); + ret->Des().Copy( aStr ); + return ret; + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnliwutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnliwutils.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,268 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef HNLIWUTILS_H +#define HNLIWUTILS_H + +#include <e32base.h> +#include <e32hashtab.h> +#include <liwcommon.h> + + +class CHnMdBaseKey; +class CLiwGenericParamList; +class TLiwVariant; + +/** + * Provides static methods which handles operations + * like extracting data from and inserting data to + * LIW composite classes ( CLiwGenericParamList, TLiwVariant ). + * + * @lib hnutilities.lib + * @since S60 v5.0 + * @ingroup group_hnutilities + */ +NONSHARABLE_CLASS( HnLiwUtils ) + { +public: + /** + * Appends key-value pairs stored in aKeys to aInParam. + * Keys are appended in the same order as they occur in the aKeys array. + * Every key value is converted to a TLiwVariant before appending to the + * param list. + * + * @since S60 v5.0 + * @param aKeys Keys to append. + * @param aInParam Param list to be modified. + */ + IMPORT_C static void SetGenericParamListL( + const RPointerArray<CHnMdBaseKey> & aKeys, + CLiwGenericParamList& aInParam ); + + /** + * Creates a string representing a selected value from the param list. + * The aPath paramter is the path to the selected param list element. + * + * @since S60 v5.0 + * @param aParam Param list. + * @param aPath URI Path. + * @param aBuf Output buffer. + * @return Error code. + */ + IMPORT_C static TInt GetStringL( + const CLiwGenericParamList& aParam, + const TDesC8& aPath, + RBuf& aBuf ); + + /** + * Creates a string representing a selected value from the param list. + * The aPath paramter is the path to the selected param list element. + * + * @since S60 v5.0 + * @param aParam Param list. + * @param aPath URI Path. + * @param aBuf Output buffer. + * @return Error code. + */ + IMPORT_C static TInt GetStringL( + const CLiwGenericParamList& aParam, + const TDesC8& aPath, + RBuf8& aBuf ); + + /** + * Returns TInt64 value using the given path. + * + * @since S60 v5.0 + * @param aParam Param list. + * @param aPath URI Path. + * @param aPos Position. + * @param aRet Return TInt64 value. + * @return TInt64 value or KErrNotFound. + */ + IMPORT_C static TInt GetInt64L( const CLiwGenericParamList& aParam, + const TDesC8& aPath, TInt aPos, TInt64& aRet ); + + /** + * Creates a string representing a selected value from the param list. + * The aPath paramter is the path to the selected param list element. + * + * @since S60 v5.0 + * @param aParam Param list. + * @param aPath URI Path. + * @param aPos Position. + * @param aBuf Output buffer. + * @return Error code. + */ + IMPORT_C static TInt GetStringL( + const CLiwGenericParamList& aParam, + const TDesC8& aPath, + TInt aPos, + RBuf& aBuf ); + + /** + * Creates a string representing a selected value from the param list. + * The aPath paramter is the path to the selected param list element. + * + * @since S60 v5.0 + * @param aParam Param list. + * @param aPath URI Path. + * @param aPos Position. + * @param aBuf Output buffer. + * @return Error code. + */ + IMPORT_C static TInt GetStringL( + const CLiwGenericParamList& aParam, + const TDesC8& aPath, + TInt aPos, + RBuf8& aBuf ); + + /** + * Exctracts variant from param list. + * + * @since S60 v5.0 + * @param aParam Param list. + * @param aPath URI path. + * @param aPos Position. + * @param aRet Output buffer. + * @return Error code. + */ + IMPORT_C static TInt GetVariantL( + const CLiwGenericParamList& aParam, + const TDesC8& aPath, + TInt aPos, + TLiwVariant& aRet ); + + /** + * Exctracts variant from param list. + * + * @since S60 v5.0 + * @param aParam Param list. + * @param aPath URI path. + * @param aRet Output buffer. + * @return Error code. + */ + IMPORT_C static TInt GetVariantL( + const CLiwGenericParamList& aParam, + const TDesC8& aPath, + TLiwVariant& aRet ); + + /** + * Creates a string representation of a variant value. + * Supported variant types are: EVariantTypeDesC, + * EVariantTypeDesC8, EVariantTypeTUid, EVariantTypeTInt32, + * and EVariantTypeTUint. + * + * @since S60 v5.0 + * @param aVariant Source variant. + * @param aBuf Output buffer. + * @return EFalse if variant type is not supported. + */ + IMPORT_C static TBool VariantToStringL( TLiwVariant& aVariant, + RBuf& aBuf ); + + /** + * Creates a string representation of a variant value. + * Supported variant types are: EVariantTypeDesC, + * EVariantTypeDesC8, EVariantTypeTUid, EVariantTypeTInt32, + * and EVariantTypeTUint. + * + * @since S60 v5.0 + * @param aVariant Source variant. + * @param aBuf Output buffer. + * @return EFalse if variant type is not supported. + */ + IMPORT_C static TBool VariantToStringL( TLiwVariant& aVariant, + RBuf8& aBuf ); + + /** + * Gets total number of items held by an iterable. + * + * @param aIterable the iterable + * @return total number of items stored in aIterable + */ + IMPORT_C static TInt GetIterableItemCountL( CLiwIterable& aIterable ); + +private: + + /** + * Exctracts namespace from param list. + * + * @since S60 v5.0 + * @param aParam Param list. + * @param aNameSpace Namespace. + * @param aRet Output variant. + * @return Error code. + */ + static TInt ExtractNameSpaceL( const CLiwGenericParamList& aParam, + const TDesC8& aNameSpace, + TLiwVariant& aRet ); + + /** + * Process path for selecting elements separated by colon or slash. + * + * @since S60 v5.0 + * @param aPath Path. + * @param aPathParts Elements of the path. + */ + static void ParsePathL( const TDesC8& aPath, + RArray< TPtrC8 >& aPathParts ); + + /** + * Replaces the first occurence of the string "$index" with a number. + * On successful execution the string contained in aPath8 will have + * have the first occurence of the substring "$index" replaced by + * a string representation of the number given in aPos. + * + * @since S60 v5.0 + * @param aPath8 A path to the variant in the generic param list. + * @param aPos A position of the item in the group of items. + * @return Length of the new path, ending at the index object. + */ + static TInt ReplaceIndexL( RBuf8& aPath8, TInt aPos ); + + /** + * Extracts a number enclosed in square brackets from a string. + * The number is assumed to be non-negative (otherwise it would be + * impossible to determine if the function executed successfully). + * If the string contains more than one pair of square brackets, only + * the first pair is processed by this method. + * + * @since S60 v5.0 + * @param aPosition String containing the position number. + * @return Number extracted from string or error code on failure. + */ + static TInt GetPosition( const TDesC8& aPosition ); + + /** + * Uses iterator object to extract variant pointed by position. + * + * @since S60 v5.0 + * @param aIterable Iterator to use. + * @param aPos Position of the variant. + * @param aVariant Output variant. + * @return ETrue if variant found. + */ + static TBool GetIterableByPositionL( + CLiwIterable & aIterable, + TInt aPos, + TLiwVariant & aVariant ); + + }; + +#endif // HNLIWUTILS_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnmdbasekey.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnmdbasekey.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,277 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef C_HNMDBASEKEY_H +#define C_HNMDBASEKEY_H + +#include <e32base.h> +#include <e32hashtab.h> +#include <xmlengdom.h> + +class CLiwDefaultMap; +class CLiwGenericParamList; +class TLiwVariant; +class CHnMdBaseKey; + +/** + * Abstract Class representing keys used in XML configuration. + * These keys can become parameters for LIW requests for example. + * Deriving classes defines particular key types like integers or strings. + * + * @lib hierarchynavigatorengine + * @since S60 v5.0 + * @ingroup group_hnutilities + */ +NONSHARABLE_CLASS( CHnMdBaseKey ) : public CBase + { + friend class HnMdKeyFactory; + +public: + + /** + * Standard destructor. + */ + virtual ~CHnMdBaseKey(); + + /** + * Factory method. + * + * since S60 v5.0 + * @return Fully constructed object. + */ + virtual CHnMdBaseKey* CopyLC() = 0; + + /** + * Getter - key name. + * since S60 v5.0 + * + * @return Key name. + */ + const TDesC8& KeyName() const; + + /** + * Getter - key content. + * since S60 v5.0 + * + * @return Key content. + */ + virtual const TDesC& KeyContent() const; + + /** + * Getter - sub keys. + * + * @since S60 v5.0 + * @return Sub keys array. + */ + const RPointerArray<CHnMdBaseKey>& SubKeys() const; + + /** + * Getter - key content. + * + * @since S60 v5.0 + * @param aContent Output content. + */ + virtual void GetKeyContent( TInt& aContent ) const; + + /** + * Getter - key content. + * + * @since S60 v5.0 + * @param aContent Output content. + */ + virtual void GetKeyContent( TInt64& aContent ) const; + + /** + * Evaluates key - sets params. + * + * @since S60 v5.0 + * @param aParamList List of parameters. + * @param aPos Position of the item in the items group. + * + */ + IMPORT_C CHnMdBaseKey* EvaluateLC( + const CLiwGenericParamList& aParamList, + TInt aPos = 0 ); + + /** + * Change to variant. + * + * @since S60 v5.0 + * @param aRet Output variant. + * + */ + IMPORT_C virtual void ToVariantL( TLiwVariant& aRet ) const; + + /** + * Change to generic param list. + * + * @since S60 v5.0 + * @param aRet Output generic param list. + * + */ + IMPORT_C virtual void ToGenericParamListL( CLiwGenericParamList & aRet ) const; + + /** + * Adds a sub key. + * + * @since S60 v5.0 + * @param aKey New key. + */ + IMPORT_C void AddSubKeyL( CHnMdBaseKey* aKey ); + + +protected: + + /** + * Standard constructor. + * + * @since S60 v5.0 + */ + CHnMdBaseKey(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + * @param aElement XML DOM Element. + */ + void BaseConstructL( TXmlEngElement aElement ); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + * @param aKey Key. + */ + void BaseConstructL( const CHnMdBaseKey* aKey ); + + /** + * Sets key name. + * + * @since S60 v5.0 + * @param aName Name of new key. + */ + void SetKeyNameL( const TXmlEngAttr& aName ); + + /** + * Sets key content. + * + * @since S60 v5.0 + * @param aContent XML Attribute. + */ + void SetKeyContentL( const TXmlEngAttr& aContent ); + + /** + * Sets sub keys. + * + * @since S60 v5.0 + * @param aElement XML DOM Element. + */ + void SetSubKeysL( const TXmlEngElement& aElement ); + + /** + * Sets sub keys. + * + * @since S60 v5.0 + * @param aKey New key. + */ + void SetSubKeysL( const CHnMdBaseKey* aKey ); + + /** + * Sets value. + * + * @since S60 v5.0 + * @param aElement XML DOM Element. + */ + void SetValueL( const TXmlEngElement& aElement ); + + /** + * Sets value. + * + * @since S60 v5.0 + * @param aValue New value. + */ + void SetValueL( const TDesC8& aValue ); + + /** + * Sets value. + * + * @since S60 v5.0 + * @param aValue New value. + */ + void SetValueL( const TDesC& aValue ); + + /** + * Sets key or name. + * + * @since S60 v5.0 + * @param aElement XML DOM Element. + */ + void SetKeyOrNameL( const TXmlEngElement& aElement ); + + /** + * Sets key name. + * + * @since S60 v5.0 + * @param aName New key name. + */ + void SetKeyNameL( const TDesC8& aName ); + + /** + * Evaluates key - sets params. + * + * @since S60 v5.0 + * @param aParamList List of parameters. + * @param aPos Position in the param list. Default is 0. + */ + void DoEvaluateL( const CLiwGenericParamList& aParamList, + TInt aPos = 0 ); + + /** + * Evaluates the key value. + * + * @since S60 v5.0 + * @param aParamList List of parameters. + * @param aPos Position in the param list. Default is 0. + */ + virtual void EvaluateKeyValueL( const CLiwGenericParamList& aParamList, + TInt aPos = 0 ); + +protected: // data + + /** + * Key name (8-bit descriptor). + * Own. + */ + RBuf8 iKeyName; + + /** + * Key content. + * Own. + */ + RBuf iContent; + + /** + * Subkeys (i.e. to handle with actions). + * Own. + */ + RPointerArray<CHnMdBaseKey> iSubKeys; + + }; + +#endif // C_HNMDBASEKEY_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnmdbooleankey.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnmdbooleankey.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDBOOLEANKEY_H +#define C_HNMDBOOLEANKEY_H + +#include <e32base.h> + +#include "hnmdbasekey.h" + +/** + * Defines particular key type which is bool. + * + * @lib hierarchynavigatorengine + * @since S60 v5.0 + * @ingroup group_hnutilities + */ +NONSHARABLE_CLASS( CHnMdBooleanKey ) : public CHnMdBaseKey + { + friend class HnMdKeyFactory; + +public: + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdBooleanKey* NewL(); + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdBooleanKey* NewLC(); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdBooleanKey* NewL( const CHnMdBooleanKey* aKey ); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdBooleanKey* NewLC( const CHnMdBooleanKey* aKey ); + + /** + * Standard destructor. + */ + virtual ~CHnMdBooleanKey(); + + /** + * Gets key boolean value. + * + * @since S60 v5.0 + * @return Boolean value represented by the key. + */ + TBool GetBooleanValueL() const;//Only in CHnMdBooleanKey + +// from base class CHnMdBaseKey + + /** + * Factory method. + * + * since S60 v5.0 + * @return Fully constructed object. + */ + virtual CHnMdBaseKey* CopyLC(); + + /** + * Change to variant. + * + * @since S60 v5.0 + * @param aRet Output variant. + * + */ + virtual void ToVariantL( TLiwVariant& aRet ) const; + + +protected: + + /** + * Standard constructor. + * + * @since S60 v5.0 + */ + CHnMdBooleanKey(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + */ + void ConstructL(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + * @param aKey Reference key. + */ + void ConstructL( const CHnMdBooleanKey* aKey ); + + }; + +#endif // C_HNMDBOOLEANKEY_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnmdinteger64key.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnmdinteger64key.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDINTEGER64KEY_H +#define C_HNMDINTEGER64KEY_H + +#include <e32base.h> + +#include "hnmdbasekey.h" + +/** + * Defines particular key type which is 64-bit integer. + * + * @lib hierarchynavigatorengine + * @since S60 v5.0 + * @ingroup group_hnutilities + */ +NONSHARABLE_CLASS( CHnMdInteger64Key ) : public CHnMdBaseKey + { + friend class HnMdKeyFactory; + +public: + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdInteger64Key* NewL(); + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdInteger64Key* NewLC(); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdInteger64Key* NewL( const CHnMdInteger64Key* aKey ); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdInteger64Key* NewLC( const CHnMdInteger64Key* aKey ); + + /** + * Standard destructor. + */ + virtual ~CHnMdInteger64Key(); + +// from base class CHnMdBaseKey + + /** + * Factory method. + * + * since S60 v5.0 + * @return Fully constructed object. + */ + virtual CHnMdBaseKey* CopyLC(); + + /** + * Gets key content. + * + * @since S60 v5.0 + * @param aContent Output content. + */ + void GetKeyContent( TInt64& aContent ) const; + + /** + * Change to variant. + * + * @since S60 v5.0 + * @param aRet Output variant. + * + */ + virtual void ToVariantL( TLiwVariant& aRet ) const; + +protected: + + /** + * Standard constructor. + * + * @since S60 v5.0 + */ + CHnMdInteger64Key(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + */ + void ConstructL(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + * @param aKey Reference key. + */ + void ConstructL( const CHnMdInteger64Key* aKey ); + }; + +#endif // C_HNMDINTEGER64KEY_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnmdintegerkey.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnmdintegerkey.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef C_HNMDINTEGERKEY_H +#define C_HNMDINTEGERKEY_H + +#include <e32base.h> + +#include "hnmdbasekey.h" + + +/** + * Defines particular key type which is integer. + * + * @lib hierarchynavigatorengine + * @since S60 v5.0 + * @ingroup group_hnutilities + */ +NONSHARABLE_CLASS( CHnMdIntegerKey ) : public CHnMdBaseKey + { + friend class HnMdKeyFactory; + +public: + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdIntegerKey* NewL(); + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdIntegerKey* NewLC(); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdIntegerKey* NewL( const CHnMdIntegerKey* aKey ); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdIntegerKey* NewLC( const CHnMdIntegerKey* aKey ); + + /** + * Standard destructor. + */ + virtual ~CHnMdIntegerKey(); + +// from base class CHnMdBaseKey + + /** + * Factory method. + * + * since S60 v5.0 + * @return Fully constructed object. + */ + virtual CHnMdBaseKey* CopyLC(); + + /** + * Gets key content. + * + * @since S60 v5.0 + * @param aContent Output content. + */ + void GetKeyContent( TInt& aContent ) const; + + /** + * Change to variant. + * + * @since S60 v5.0 + * @param aRet Output variant. + * + */ + virtual void ToVariantL( TLiwVariant& aRet ) const; + +protected: + + /** + * Standard constructor. + * + * @since S60 v5.0 + */ + CHnMdIntegerKey(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + */ + void ConstructL(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + * @param aKey Reference key. + */ + void ConstructL( const CHnMdIntegerKey* aKey ); + }; + +#endif // C_HNMDINTEGERKEY_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnmdkeyfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnmdkeyfactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef HNMDKEYFACTORY_H +#define HNMDKEYFACTORY_H + +#include <e32base.h> +#include <xmlengdom.h> + +class CHnMdBaseKey; + +/** + * Provides static methods for creating particular key classes. + * + * @lib hnutilities.lib + * @since S60 v3.0 + * @ingroup group_hnutilities + */ +NONSHARABLE_CLASS( HnMdKeyFactory ) + { +public: + + /** + * Creates particular key type depending on XML element. + * Sets name and value of the key read also from XML. + * + * since S60 v5.0 + * @param aElement XML DOM Element. + * @return Pointer to created key. + */ + IMPORT_C static CHnMdBaseKey* CreateLC( TXmlEngElement aElement ); + + /** + * Creates particular key type depending on XML element. + * Sets name and value of the key read also from XML. + * + * since S60 v5.0 + * @param aElement XML DOM Element. + * @return Pointer to created key. + */ + IMPORT_C static CHnMdBaseKey* CreateL( TXmlEngElement aElement ); + + /** + * Creates particular key type depending on passed argument. + * Sets name and value of the key. + * + * since S60 v5.0 + * @param aName Key name. + * @param aType Key type. + * @param aValue Key value. + * @return Pointer to created key. + */ + IMPORT_C static CHnMdBaseKey* CreateL( + const TDesC8& aName, + const TDesC8& aType, + const TDesC8& aValue ); + + /** + * Creates particular key type depending on passed argument. + * Sets name and value of the key. + * + * since S60 v5.0 + * @param aName Key name. + * @param aType Key type. + * @param aValue Key value. + * @return Pointer to created key. + */ + IMPORT_C static CHnMdBaseKey* CreateL( + const TDesC8& aName, + const TDesC8& aType, + const TDesC& aValue ); + + private: + + /** + * Creates particular key type depending on passed argument. + * + * since S60 v5.0 + * @param aKeyType Key type. + * @return Pointer to created key. + */ + static CHnMdBaseKey* CreateL( const TDesC8& aKeyType ); + }; + +#endif // HNMDKEYFACTORY_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnmdlistkey.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnmdlistkey.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef C_HNMDLISTKEY_H +#define C_HNMDLISTKEY_H + +#include <liwcommon.h> +#include <e32base.h> + +#include "hnmdbasekey.h" + + +/** + * Defines particular key type which is LIW list. + * + * @lib hierarchynavigatorengine + * @since S60 v5.0 + * @ingroup group_hnutilities + */ +NONSHARABLE_CLASS( CHnMdListKey ) : public CHnMdBaseKey + { + friend class HnMdKeyFactory; + +public: + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdListKey* NewL(); + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdListKey* NewLC(); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdListKey* NewL( const CHnMdListKey* aKey ); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdListKey* NewLC( const CHnMdListKey* aKey ); + + /** + * Standard destructor. + */ + virtual ~CHnMdListKey(); + +// from base class CHnMdBaseKey + + /** + * Factory method. + * + * since S60 v5.0 + * @return Fully constructed object. + */ + virtual CHnMdBaseKey* CopyLC(); + + /** + * Change to variant. + * + * @since S60 v5.0 + * @param aRet Output variant. + */ + virtual void ToVariantL( TLiwVariant& aRet ) const; + +protected: + + /** + * Standard constructor. + * + * @since S60 v5.0 + */ + CHnMdListKey(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + */ + void ConstructL(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + * @param aKey Reference key. + */ + void ConstructL( const CHnMdListKey* aKey ); + +// from base class CHnMdBaseKey + + /** + * Evaluates the key value. + * + * @since S60 v5.0 + * @param aParamList List of parameters. + * @param aPos Position in the param list. Default is 0. + */ + void EvaluateKeyValueL( const CLiwGenericParamList& aParamList, + TInt aPos ); + +private: // data + + /** + * Own. Variant. + */ + TLiwVariant iVariantContent; + + }; + +#endif // C_HNMDLISTKEY_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnmdmapkey.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnmdmapkey.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDMAPKEY_H +#define C_HNMDMAPKEY_H + +#include <liwcommon.h> +#include <e32base.h> + +#include "hnmdbasekey.h" + +/** + * Defines particular key type which is LIW map. + * + * @lib hierarchynavigatorengine + * @since S60 v5.0 + * @ingroup group_hnutilities + */ +NONSHARABLE_CLASS( CHnMdMapKey ) : public CHnMdBaseKey + { + friend class HnMdKeyFactory; + +public: + + /** + * Standard factory method. + * + * @since S60 v5.0 + * @return Fully constructed object. + */ + static CHnMdMapKey* NewL(); + + /** + * Standard factory method. + * + * @since S60 v5.0 + * @return Fully constructed object. + */ + static CHnMdMapKey* NewLC(); + + /** + * Standard factory method. + * + * @since S60 v5.0 + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdMapKey* NewL( const CHnMdMapKey* aKey ); + + /** + * Standard factory method. + * + * @since S60 v5.0 + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdMapKey* NewLC( const CHnMdMapKey* aKey ); + + /** + * Factory method. + * + * since S60 v5.0 + * @return Fully constructed object. + */ + virtual CHnMdBaseKey* CopyLC(); + + /** + * Standard destructor. + * + * @since S60 v5.0 + */ + virtual ~CHnMdMapKey(); + + /** + * Change to variant. + * + * @since S60 v5.0 + * @param aRet Output variant. + */ + virtual void ToVariantL( TLiwVariant& aRet ) const; + +protected: + + /** + * Standard constructor. + * + * @since S60 v5.0 + */ + CHnMdMapKey(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + */ + void ConstructL(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + * @param aKey Reference key. + */ + void ConstructL( const CHnMdMapKey* aKey ); + + /** + * Evaluates the key value. + * + * @since S60 v5.0 + * @param aParamList List of parameters. + * @param aPos Position in the param list. Default is 0. + */ + void EvaluateKeyValueL( const CLiwGenericParamList& aParamList, + TInt aPos ); + +private: + + /** + * Variant. + */ + TLiwVariant iVariantContent; + + }; + +#endif // C_HNMDMAPKEY_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnmdstring16key.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnmdstring16key.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDSTRING16KEY_H +#define C_HNMDSTRING16KEY_H + +#include <e32base.h> + +#include "hnmdbasekey.h" + +/** + * Defines particular key type which is unicode string. + * + * @lib hierarchynavigatorengine + * @since S60 v5.0 + * @ingroup group_hnutilities + */ +NONSHARABLE_CLASS( CHnMdString16Key ) : public CHnMdBaseKey + { + friend class HnMdKeyFactory; + +public: + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdString16Key* NewL(); + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdString16Key* NewLC(); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdString16Key* NewL( const CHnMdString16Key* aKey ); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdString16Key* NewLC( const CHnMdString16Key* aKey ); + + /** + * Factory method. + * + * since S60 v5.0 + * @return Fully constructed object. + */ + virtual CHnMdBaseKey* CopyLC(); + + /** + * Standard destructor. + */ + virtual ~CHnMdString16Key(); + + /** + * Change to variant. + * + * @since S60 v5.0 + * @param aRet Output variant. + * + */ + virtual void ToVariantL( TLiwVariant& aRet ) const; + +protected: + + /** + * Standard constructor. + * + * @since S60 v5.0 + */ + CHnMdString16Key(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + */ + void ConstructL(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + * @param aKey Reference key. + */ + void ConstructL( const CHnMdString16Key* aKey ); + }; + +#endif // C_HNMDSTRING16KEY_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnmdstring8key.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnmdstring8key.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDSTRING8KEY_H +#define C_HNMDSTRING8KEY_H + +#include <e32base.h> + +#include "hnmdbasekey.h" + +/** + * Defines particular key type which is narrow string. + * + * @lib hierarchynavigatorengine + * @since S60 v5.0 + * @ingroup group_hnutilities + */ +NONSHARABLE_CLASS( CHnMdString8Key ) : public CHnMdBaseKey + { +public: + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdString8Key* NewL(); + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdString8Key* NewLC(); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdString8Key* NewL( const CHnMdString8Key* aKey ); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdString8Key* NewLC( const CHnMdString8Key* aKey ); + + /** + * Factory method. + * + * since S60 v5.0 + * @return Fully constructed object. + */ + virtual CHnMdBaseKey* CopyLC(); + + /** + * Standard destructor. + */ + virtual ~CHnMdString8Key(); + + /** + * Change to variant. + * + * @since S60 v5.0 + * @param aRet Output variant. + * + */ + virtual void ToVariantL( TLiwVariant& aRet ) const; + +protected: + friend class HnMdKeyFactory; + + /** + * Standard constructor. + * + * @since S60 v5.0 + */ + CHnMdString8Key(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + */ + void ConstructL(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + * @param aKey Reference key. + */ + void ConstructL( const CHnMdString8Key* aKey ); + }; + +#endif // C_HNMDSTRING8KEY_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnmduidkey.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnmduidkey.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef C_HNMDUIDKEY_H +#define C_HNMDUIDKEY_H + +#include <e32base.h> + +#include "hnmdbasekey.h" + +/** + * Defines particular key type which is UID. + * + * @lib hierarchynavigatorengine + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CHnMdUidKey ) : public CHnMdBaseKey + { +public: + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdUidKey* NewL(); + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdUidKey* NewLC(); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdUidKey* NewL( const CHnMdUidKey* aKey ); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdUidKey* NewLC( const CHnMdUidKey* aKey ); + + /** + * Factory method. + * + * since S60 v5.0 + * @return Fully constructed object. + */ + virtual CHnMdBaseKey* CopyLC(); + + /** + * Standard destructor. + */ + virtual ~CHnMdUidKey(); + + /** + * Gets key content. + * + * @since S60 v5.0 + * @param aContent Output content. + */ + void GetKeyContent( TInt& aContent ) const; + + /** + * Change to variant. + * + * @since S60 v5.0 + * @param aRet Output variant. + * + */ + virtual void ToVariantL( TLiwVariant& aRet ) const; + +protected: + friend class HnMdKeyFactory; + + /** + * Standard constructor. + * + * @since S60 v5.0 + */ + CHnMdUidKey(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + */ + void ConstructL(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + * @param aKey Reference key. + */ + void ConstructL( const CHnMdUidKey* aKey ); + }; + +#endif // C_HNMDUIDKEY_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnmduintegerkey.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnmduintegerkey.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef HNMDUINTEGERKEY_H_ +#define HNMDUINTEGERKEY_H_ + +#include <e32base.h> +#include "hnmdbasekey.h" + +/** + * Defines particular key type which is unsigned integer. + * + * @lib hierarchynavigatorengine + * @since S60 v5.0 + * @ingroup group_hnutilities + */ +NONSHARABLE_CLASS( CHnMdUIntegerKey ) : public CHnMdBaseKey + { + friend class HnMdKeyFactory; + +public: + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdUIntegerKey* NewL(); + + /** + * Standard factory method. + * + * @return Fully constructed object. + */ + static CHnMdUIntegerKey* NewLC(); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdUIntegerKey* NewL( const CHnMdUIntegerKey* aKey ); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdUIntegerKey* NewLC( const CHnMdUIntegerKey* aKey ); + + /** + * Factory method. + * + * since S60 v5.0 + * @return Fully constructed object. + */ + virtual CHnMdBaseKey* CopyLC(); + + /** + * Standard destructor. + */ + virtual ~CHnMdUIntegerKey(); + + /** + * Change to variant. + * + * @since S60 v5.0 + * @param aRet Output variant. + * + */ + virtual void ToVariantL( TLiwVariant& aRet ) const; + +protected: + + /** + * Standard constructor. + * + * @since S60 v5.0 + */ + CHnMdUIntegerKey(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + */ + void ConstructL(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + * @param aKey Reference key. + */ + void ConstructL( const CHnMdUIntegerKey* aKey ); + }; + +#endif // HNMDUINTEGERKEY_H_ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnmdundefkey.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnmdundefkey.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNMDUNDEFKEY_H +#define C_HNMDUNDEFKEY_H + +#include <e32base.h> + +#include "hnmdbasekey.h" + +/** + * Defines key which has undefined type. + * + * @lib hierarchynavigatorengine + * @since S60 v5.0 + * @ingroup group_hnutilities + */ +NONSHARABLE_CLASS( CHnMdUndefKey ) : public CHnMdBaseKey + { + friend class HnMdKeyFactory; + +public: + + /** + * Standard factory function. + * + * @return Fully constructed object. + */ + static CHnMdUndefKey* NewL(); + + /** + * Standard factory function. + * + * @return Fully constructed object. + */ + static CHnMdUndefKey* NewLC(); + + /** + * Standard factory method. + * + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdUndefKey* NewL( const CHnMdUndefKey* aKey ); + + /** + * Instance copy method. + * + * since S60 v5.0 + * @param aKey Reference key. + * @return Fully constructed object. + */ + static CHnMdUndefKey* NewLC( const CHnMdUndefKey* aKey ); + + /** + * Instance copy method. + * + * since S60 v5.0 + * @return Fully constructed object. + */ + virtual CHnMdBaseKey* CopyLC(); + + /** + * Standard destructor. + */ + virtual ~CHnMdUndefKey(); + +protected: + + /** + * Standard constructor. + * + * @since S60 v5.0 + */ + CHnMdUndefKey(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + */ + void ConstructL(); + + /** + * Symbian constructor for performing 2nd stage construction. + * + * @since S60 v5.0 + * @param aKey Reference key. + */ + void ConstructL( const CHnMdUndefKey* aKey ); + }; + +#endif // C_HNMDUNDEFKEY_H diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnrepositorymanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnrepositorymanager.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef HNREPOSITORYMANAGER_H_ +#define HNREPOSITORYMANAGER_H_ + +#include <e32base.h> +#include <centralrepository.h> + +#include "hnglobals.h" + +/** + * Class for managing operation on the central repository. + * It is used to store widget types of suites in the central repository. + * + * @since S60 v5.0 + * @ingroup group_hnutilities + */ +NONSHARABLE_CLASS( CHnRepositoryManager ) : public CBase + { + +public: + /** + * Factory method. + * + * @since S60 v5.0 + * @return Returns fully qualified object. + */ + IMPORT_C static CHnRepositoryManager * NewL(); + + /** + * Factory method. + * + * @since S60 v5.0 + * @return Returns fully qualified object. + */ + IMPORT_C static CHnRepositoryManager * NewLC(); + + /** + * Stores widget type in the repository. + * + * @since S60 v5.0 + * @param aSuiteName Name of the suite. + * @param aWidgetType Widget type to be stored. + * @return Error code. + */ + IMPORT_C TInt StoreSuiteWidgetTypeL( const TDesC & aSuiteName, + THnSuiteWidgetType aWidgetType ); + + /** + * Deletes all suite related information from the repository. + * + * @since S60 v5.0 + * @param aSuiteName Name of the suite. + * @return Error code. + */ + IMPORT_C TInt DeleteSuiteRelatedL( const TDesC & aSuiteName ); + + /** + * Read suite widget type from the repository. + * + * @since S60 v5.0 + * @param aSuiteName Name of the suite. + * @param aSuiteWidget Widget type. + * @return Error code. + */ + IMPORT_C TInt ReadSuiteWidgetTypeL( + const TDesC & aSuiteName, THnSuiteWidgetType& aSuiteWidget ); + + /** + * Standard C++ destructor. + * + * @since S60 v5.0 + */ + IMPORT_C ~CHnRepositoryManager(); + +private: + + /** + * Second phase symbian constructor. + * + * @since S60 v5.0 + */ + void ConstructL(); + + /** + * Standard C++ constructor. + * + * @since S60 v5.0 + */ + CHnRepositoryManager(); + +private: // data + + /** + * Widget type position. + */ + const TInt KWidgetTypePosition; + + /** + * Central Repository object. + * Own. + */ + CRepository *iRepository; + + }; + +#endif // HNREPOSITORYMANAGER_H_ diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/hnservicehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/hnservicehandler.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,259 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef C_HNMDSERVICEHANDLER_H +#define C_HNMDSERVICEHANDLER_H + +//#include <mnaiwservices.h> +#include <liwcommon.h> +#include <e32base.h> +#include <xmlengelement.h> + +#include "hnglobals.h" + +class CLiwServiceHandler; +class CHnMdQuery; +class CLiwGenericParamList; +class MLiwInterface; +class CLiwDefaultMap; +class CHnMdBaseKey; +class CHnMdServiceCommand; +class CHnServiceHandler; + +/** + * Class represeting request to LIW service. + * The request can be synchronous or asynchronous. + * + * @since S60 5.0 + * @ingroup group_hnutilities + */ +NONSHARABLE_CLASS(CHnServiceHandler) : public CBase, public MLiwNotifyCallback + { +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aService Service name. + * @param aInterface Interface name. + * @param aCommand Request to the Service. + * @param aMode Asynchronous or Synchronous Request. + * @param aConstructor Parameters used during Service construction. + * @param aServiceCommand Additional Parameters for the Request. + * @return Fully cosntructed object. + */ + IMPORT_C static CHnServiceHandler* NewL( + const TDesC8& aService, const TDesC8& aInterface, + const TDesC8& aCommand, TServiceMode aMode, + CLiwGenericParamList* aConstructor, + CLiwGenericParamList* aServiceCommand ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aService Service name. + * @param aInterface Interface name. + * @param aCommand Request to the Service. + * @param aMode Asynchronous or Synchronous Request. + * @param aConstructor Parameters used during Service construction. + * @param aServiceCommand Additional Parameters for the Request. + * @return Fully cosntructed object. + */ + IMPORT_C static CHnServiceHandler* NewLC( + const TDesC8& aService, const TDesC8& aInterface, + const TDesC8& aCommand, TServiceMode aMode, + CLiwGenericParamList* aConstructor, + CLiwGenericParamList* aServiceCommand ); + + /** + * Standard C++ virtual destructor. + * + * @since S60 5.0 + */ + IMPORT_C virtual ~CHnServiceHandler(); + + /** + * Executes the Request on the service. + * + * since S60 v5.0 + * @param aOutParamList Request outcome. + * @param aStatus Status for signalling when request completes. + * @return Error code. + */ + IMPORT_C TInt ExecuteL( CLiwGenericParamList& aOutParamList, TRequestStatus& aStatus ); + + /** + * Executes the query on the service, with external + * notification callback. + * + * since S60 v5.0 + * @param aCallback Notification callback. + * @param aCmdOptions Additional options for the Request. + * @return Error code. + */ + 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(); + +private: + + /** + * Standard C++ constructor. + * + * @since S60 5.0 + * @param aMode Synchronous or asynchronous. + */ + CHnServiceHandler( TServiceMode aMode ); + + + /** + * Standard symbian 2nd phase contructor. + * + * @since S60 5.0 + * @param aService Service name. + * @param aInterface Interface name. + * @param aCommandName Request to the Service. + * @param aConstructor Parameters used during Service construction. + * @param aServiceCommand Additional Parameters for the Request. + */ + void ConstructL( + const TDesC8& aService, const TDesC8& aInterface, + const TDesC8& aCommandName, + CLiwGenericParamList* aConstructor, + CLiwGenericParamList* aServiceCommand ); + + + /** + * Handles notifications caused by an asynchronous Request. + * + * @param aCmdId The service command associated to the event. + * @param aEventId Occured event, see LiwCommon.hrh. + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL. + * @return Error code for the callback. + */ + TInt HandleNotifyL( + TInt aCmdId, + TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& aInParamList); + + /** + * Creates interface. + * + * @param aConstructor constructor + * @return Error code. + */ + TInt SetServiceInterfaceL( CLiwGenericParamList* aConstructor ); + +private: // data + + /** + * Service name. + * Own. + */ + RBuf8 iServiceName; + + /** + * Interface name. + * Own. + */ + RBuf8 iInterfaceName; + + /** + * Command (Request) name. + * Own. + */ + RBuf8 iCommandName; + + /** + * Service mode. + */ + TServiceMode iMode; + + /** + * Stores input parameters (not data) of the service search method\ + * (ExecuteServiceCmdL). + * Own. + */ + CLiwGenericParamList* iConstructor; + + /** + * + * Own. + */ + CLiwGenericParamList* iCommand; + + /** + * Parameters for the Request. + * Own. + */ + CLiwGenericParamList* iInput; + + /** + * Request results from ExecuteL(); + * Own. + */ + CLiwGenericParamList* iOutputForAS; + + /** + * Request results from + * ExecuteL( CLiwGenericParamList& aOutParamList, TRequestStatus& aStatus ). + * Own. + */ + CLiwGenericParamList* iOutputForAO; + + /** + * 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 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/inc/mymenudebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/inc/mymenudebug.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2007-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: debug constants definitions +* +*/ + + +#ifndef MYMENUDEBUG_H +#define MYMENUDEBUG_H + +// MACROS +#define APPEND_TO_DEBUG_FILE + +// CONSTANTS +_LIT(KDebugDirName, "menu"); +_LIT(KDebugFileName, "hnutilities.txt"); + +#endif // MYMENUDEBUG_H + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnconvutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnconvutils.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,212 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <utf.h> +#include <e32std.h> + +#include "hnconvutils.h" +#include "hnglobals.h" + +// ======== MEMBER FUNCTIONS ======== + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HBufC* HnConvUtils::Str8ToStr( const TDesC8& aStr ) + { + HBufC* ret = HBufC::New( aStr.Length() ); + if (ret) + { + TPtr dest( ret->Des() ); + CnvUtfConverter::ConvertToUnicodeFromUtf8( dest, aStr ); + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HBufC* HnConvUtils::Str8ToStrLC( const TDesC8& aStr ) + { + HBufC* ret = HBufC::NewLC( aStr.Length() ); + TPtr dest( ret->Des() ); + CnvUtfConverter::ConvertToUnicodeFromUtf8( dest, aStr ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HBufC8* HnConvUtils::StrToStr8LC( const TDesC16& aStr ) + { + TInt length = aStr.Length(); + HBufC8* ret = HBufC8::NewL( length ); + TPtr8 dest( ret->Des() ); + TInt num = CnvUtfConverter::ConvertFromUnicodeToUtf8( dest, aStr ); + while( num != 0 ) + { + delete ret; + length += num; + ret = HBufC8::NewL( length ); + dest.Set( ret->Des() ); + num = CnvUtfConverter::ConvertFromUnicodeToUtf8( dest, aStr ); + } + CleanupStack::PushL(ret); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HBufC8* HnConvUtils::StrToStr8L( const TDesC16& aStr ) + { + HBufC8* buf = HnConvUtils::StrToStr8LC( aStr ); + CleanupStack::Pop( buf ); + return buf; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HBufC8* HnConvUtils::NumToStr8LC( const TInt& aNum ) + { + HBufC8* ret = HBufC8::NewLC( KMaxLength ); + ret->Des().AppendNum( aNum ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt HnConvUtils::Str8ToInt( const TDesC8& aValue, TInt& aResult ) + { + // if a string starts from '0x' then convert aStr from hex to int. + // else send aStr to the StrDec2Uint + TInt err( KErrNotFound ); + TInt position( aValue.Find( KHexStart8 ) ); + + TLex8 lexer( aValue ); + if ( position == 0 ) + { + // is hex, it it can only unsinged + lexer.SkipAndMark( KHexStart8().Length() ); + TUint tmp; + err = lexer.Val( tmp, EHex ); + aResult = tmp; + } + else + { + err = lexer.Val( aResult ); + } + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt HnConvUtils::StrToInt( const TDesC& aValue, TInt& aResult ) + { + TInt err( KErrNotFound ); + RBuf8 buf; + err = buf.Create( aValue.Length() ); + if ( KErrNone == err ) + { + buf.Copy( aValue ); + err = HnConvUtils::Str8ToInt( buf, aResult ); + } + buf.Close(); + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt HnConvUtils::Str8ToInt( const TDesC8& aValue, TInt32& aResult ) + { + // if a string starts from '0x' then convert aStr from hex to int. + // else send aStr to the StrDec2Uint + TInt err( KErrNotFound ); + TInt position( aValue.Find( KHexStart8 ) ); + + TLex8 lexer( aValue ); + if ( position == 0 ) + { + // is hex, it it can only unsinged + TUint32 tmp; + lexer.SkipAndMark( KHexStart8().Length() ); + err = lexer.Val( tmp, EHex ); + aResult = tmp; + } + else + { + err = lexer.Val( aResult ); + } + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt HnConvUtils::StrToInt( const TDesC& aValue, TInt32& aResult ) + { + TInt err( KErrNotFound ); + RBuf8 buf; + err = buf.Create( aValue.Length() ); + if ( KErrNone == err ) + { + buf.Copy( aValue ); + err = HnConvUtils::Str8ToInt( buf, aResult ); + } + buf.Close(); + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt HnConvUtils::Str8ToUint( const TDesC8& aValue, TUint& aResult ) + { + // if a string starts from '0x' then convert aStr from hex to int. + // else send aStr to the StrDec2Uint + TInt err( KErrNotFound ); + TInt position( aValue.Find( KHexStart8 ) ); + + TLex8 lexer( aValue ); + if ( position == 0 ) + { + // is hex + lexer.SkipAndMark( KHexStart8().Length() ); + err = lexer.Val( aResult, EHex ); + } + else + { + err = lexer.Val( aResult ); + } + return err; + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnliwutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnliwutils.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,579 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <mmf/common/mmfcontrollerpluginresolver.h> +#include <liwservicehandler.h> +#include <f32fsys.h> +#include "hnmdbasekey.h" +#include "hnglobals.h" +#include "hnliwutils.h" +#include "hnconvutils.h" + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void HnLiwUtils::SetGenericParamListL( + const RPointerArray<CHnMdBaseKey> & aKeys, + CLiwGenericParamList & aInParam ) + { + // for each key + for ( TInt i( 0 ); i < aKeys.Count(); i++ ) + { + CHnMdBaseKey* key = aKeys[i]; + const TDesC8& keyName = key->KeyName(); + TLiwVariant value; + value.PushL(); + key->ToVariantL( value ); + aInParam.AppendL( TLiwGenericParam( keyName, value ) ); + CleanupStack::PopAndDestroy( &value ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool HnLiwUtils::VariantToStringL( + TLiwVariant& aVariant, + RBuf& aBuf ) + { + TBool accepted( ETrue ); + switch ( aVariant.TypeId() ) + { + case LIW::EVariantTypeDesC: + { + aBuf.CreateL( aVariant.AsDes() ); + break; + } + case LIW::EVariantTypeDesC8: + { + HBufC* tmp = HnConvUtils::Str8ToStr( aVariant.AsData() ); + if ( !tmp ) + { + User::Leave( KErrNoMemory ); + } + aBuf.Assign( tmp ); + break; + } + case LIW::EVariantTypeTUid: + { + aBuf.CreateL( KMaxLength ); + aBuf.AppendNum( aVariant.AsTUid().iUid, EHex ); + break; + } + case LIW::EVariantTypeTInt32: + { + aBuf.CreateL( KMaxLength ); + aBuf.AppendNum( aVariant.AsTInt32() ); + break; + } + case LIW::EVariantTypeTInt64: + { + aBuf.CreateL( KMaxLength ); + aBuf.AppendNum( aVariant.AsTInt64() ); + break; + } + case LIW::EVariantTypeTUint: + { + aBuf.CreateL( KMaxLength ); + aBuf.AppendNum( aVariant.AsTUint() ); + break; + } + case LIW::EVariantTypeTBool: + { + aBuf.CreateL( KMaxLength ); + aBuf.AppendNum( aVariant.AsTBool() ); + break; + } + default: + { + accepted = EFalse; + } + } + return accepted; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool HnLiwUtils::VariantToStringL( + TLiwVariant& aVariant, + RBuf8& aBuf ) + { + TBool accepted( ETrue ); + switch ( aVariant.TypeId() ) + { + case LIW::EVariantTypeDesC: + { + aBuf.Assign( HnConvUtils::StrToStr8L( aVariant.AsDes() ) ); + break; + } + case LIW::EVariantTypeDesC8: + { + aBuf.CreateL( aVariant.AsData() ); + break; + } + case LIW::EVariantTypeTUid: + { + aBuf.CreateL( KMaxLength ); + aBuf.AppendNum( aVariant.AsTUid().iUid, EHex ); + break; + } + case LIW::EVariantTypeTInt32: + { + aBuf.CreateL( KMaxLength ); + aBuf.AppendNum( aVariant.AsTInt32() ); + break; + } + case LIW::EVariantTypeTInt64: + { + aBuf.CreateL( KMaxLength ); + aBuf.AppendNum( aVariant.AsTInt64() ); + break; + } + case LIW::EVariantTypeTUint: + { + aBuf.CreateL( KMaxLength ); + aBuf.AppendNum( aVariant.AsTUint() ); + break; + } + case LIW::EVariantTypeTBool: + { + aBuf.CreateL( KMaxLength ); + aBuf.AppendNum( aVariant.AsTBool() ); + break; + } + default: + { + accepted = EFalse; + } + } + return accepted; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt HnLiwUtils::GetIterableItemCountL( CLiwIterable& aIterable ) + { + TInt count = 0; + TLiwVariant variant; + variant.PushL(); + aIterable.Reset(); + while( aIterable.NextL(variant)) + { + ++count; + } + CleanupStack::PopAndDestroy( &variant ); + return count; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt HnLiwUtils::GetStringL( + const CLiwGenericParamList& aParam, + const TDesC8& aPath, + RBuf& aRet ) + { + TInt ret( KErrNone ); + TLiwVariant value; + value.PushL(); + + ret = GetVariantL( aParam, aPath, value ); + if ( ret == KErrNone && !VariantToStringL( value, aRet ) ) + { + ret = KErrBadDescriptor; + } + + CleanupStack::PopAndDestroy( &value ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt HnLiwUtils::GetStringL( + const CLiwGenericParamList& aParam, + const TDesC8& aPath, + RBuf8& aRet ) + { + TInt ret( KErrNone ); + TLiwVariant value; + value.PushL(); + + ret = GetVariantL( aParam, aPath, value ); + if ( ret == KErrNone && !VariantToStringL( value, aRet ) ) + { + ret = KErrBadDescriptor; + } + + CleanupStack::PopAndDestroy( &value ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt HnLiwUtils::GetStringL( const CLiwGenericParamList& aParam, + const TDesC8& aPath, TInt aPos, RBuf& aRet ) + { + TInt ret( KErrNone ); + TLiwVariant value; + value.PushL(); + + ret = GetVariantL( aParam, aPath, aPos, value ); + if ( ret == KErrNone && !VariantToStringL( value, aRet ) ) + { + ret = KErrBadDescriptor; + } + + CleanupStack::PopAndDestroy( &value ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt HnLiwUtils::GetStringL( const CLiwGenericParamList& aParam, + const TDesC8& aPath, TInt aPos, RBuf8& aRet ) + { + TInt ret( KErrNone ); + TLiwVariant value; + value.PushL(); + + ret = GetVariantL( aParam, aPath, aPos, value ); + if ( ret == KErrNone && !VariantToStringL( value, aRet ) ) + { + ret = KErrBadDescriptor; + } + + CleanupStack::PopAndDestroy( &value ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt HnLiwUtils::GetInt64L( const CLiwGenericParamList& aParam, + const TDesC8& aPath, TInt aPos, TInt64& aRet ) + { + RBuf8 buf; + TInt err = HnLiwUtils::GetStringL( aParam, aPath, aPos, buf ); + + if ( KErrNone == err ) + { + TInt64 value( KErrNotFound ); + TLex8 lex( buf ); + + if ( KErrNone == lex.Val( value ) ) + { + aRet = value; + err = KErrNone; + } + } + + buf.Close(); + + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt HnLiwUtils::GetVariantL( + const CLiwGenericParamList& aParam, + const TDesC8& aPath, + TInt aPos, + TLiwVariant& aRet ) + { + TInt ret( KErrNone ); + RBuf8 path; + CleanupClosePushL( path ); + path.CreateL( aPath ); + // replace index if exist in the path + HnLiwUtils::ReplaceIndexL( path, aPos ); + // fetch variant + ret = HnLiwUtils::GetVariantL( aParam, path, aRet ); + if ( ret == KErrNotFound ) + { + TInt colonFound( aPath.Find( KColon8 ) ); + if ( KErrNotFound != colonFound ) + { + /*TInt pos( 0 ); + TInt rest( aPos ); + while ( ( rest = rest / 10 ) != 0 ) + { + pos++; + }*/ + + path.SetLength( colonFound ); + TLiwVariant tempVariant; + tempVariant.PushL(); + if ( KErrNotFound != HnLiwUtils::GetVariantL( aParam, path, aRet ) ) + { + ret = KErrHidden; + } + else + { + ret = KErrNotFound; + } + CleanupStack::PopAndDestroy( &tempVariant ); + } + } + CleanupStack::PopAndDestroy( &path ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt HnLiwUtils::ExtractNameSpaceL( + const CLiwGenericParamList& aParam, + const TDesC8& aNameSpace, + TLiwVariant& aRet ) + { + TInt pos( 0 ); + const TLiwGenericParam* param; + + if ( &aParam != NULL ) + { + param = aParam.FindFirst( pos, aNameSpace ); + if ( pos >= 0 ) + { + aRet.SetL( param->Value() ); + } + } + else + { + pos = KErrNotFound; + } + + return pos; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt HnLiwUtils::GetVariantL( + const CLiwGenericParamList& aParam, + const TDesC8& aPath, + TLiwVariant& aRet ) + { + RArray< TPtrC8 > path; + CleanupClosePushL( path ); + TInt ret( KErrNone ); + TLiwVariant variant; + TLiwVariant lastVariant; + variant.PushL(); + lastVariant.PushL(); + + aRet.SetL( TLiwVariant( aPath ) ); + + ParsePathL( aPath, path ); + + if ( path.Count() > 0 + && ExtractNameSpaceL( aParam, path[0], lastVariant ) != KErrNotFound ) + { + TBool found( ETrue ); + for ( TInt i( 1 ); i < path.Count() && found; i++ ) + { + TPtrC8 name = path[ i ]; + LIW::TVariantTypeId typeId = lastVariant.TypeId(); + // LIW::Type ID 7 + if ( typeId == LIW::EVariantTypeList ) + { + TInt pos( GetPosition( name ) ); + found = (pos != KErrNotFound) ? lastVariant.AsList()->AtL( pos, variant ) : EFalse; + } + // LIW::Type ID 8 + else if ( typeId == LIW::EVariantTypeMap ) + { + found = lastVariant.AsMap()->FindL( name, variant ); + } + // LIW::Type ID 9 + else if ( typeId == LIW::EVariantTypeIterable ) + { + TInt pos( GetPosition( name ) ); + found = GetIterableByPositionL( *lastVariant.AsIterable(), pos, variant ); + } + lastVariant.SetL( variant ); + } + ret = found ? KErrNone : KErrNotFound; + //aRet.SetL( ( ret != KErrNotFound ) ? variant : TLiwVariant( aPath ) ); + if ( found == 0 ) + { + aRet.SetL( TLiwVariant( KNullDesC8 ) ); + } + else + { + aRet.SetL( variant ); + } + } + + CleanupStack::PopAndDestroy( &lastVariant ); + CleanupStack::PopAndDestroy( &variant ); + CleanupStack::PopAndDestroy( &path ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HnLiwUtils::ParsePathL( + const TDesC8& aPath, + RArray< TPtrC8 >& aPathParts ) + { + TChar ch; // token separator + + TInt colonPos = aPath.Find( KColon8 ); + + if ( colonPos > 0 ) + { + TLex8 lex( aPath ); + + while ( !lex.Eos() ) + { + ch = lex.Get(); + + // namespace + if ( ch == KColon()[0] ) + { + lex.UnGet(); + TPtrC8 nextToken = lex.MarkedToken(); + lex.SkipAndMark( 1 ); + aPathParts.AppendL( nextToken ); + } + // list or map + else if ( ch == KSlash()[0] ) + { + lex.UnGet(); + TPtrC8 nextToken = lex.MarkedToken(); + lex.SkipAndMark( 1 ); + aPathParts.AppendL( nextToken ); + } + // last token + else if ( lex.Eos() ) + { + TPtrC8 nextToken = lex.MarkedToken(); + aPathParts.AppendL( nextToken ); + break; + } + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool HnLiwUtils::GetIterableByPositionL( CLiwIterable & aIterable, TInt pos, + TLiwVariant & aVariant ) + { + TBool ret(EFalse); + if ( pos >= 0 ) + { + TInt counter = 0; + aIterable.Reset(); + ret = aIterable.NextL( aVariant ); + while ( ret ) + { + if (counter == pos) + { + break; + } + counter++; + ret = aIterable.NextL( aVariant ); + } + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt HnLiwUtils::GetPosition( const TDesC8& aPosition ) + { + TInt ret( KErrNotFound ); + TInt pos1 = aPosition.Find( KOpenSquareBracket ); + + if ( pos1 >= 0 ) + { + TInt pos2 = aPosition.Find( KCloseSquareBracket ); + // extract string number ( +1 a character after "[", + // -1 a character before "]" + TPtrC8 num = aPosition.Mid( pos1 + 1, pos2 - 1 ); + // extract number value + TLex8 lex( num ); + lex.Val( ret ); + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt HnLiwUtils::ReplaceIndexL( RBuf8& aPath8, TInt aPos ) + { + TInt ret(KErrNotFound); + TInt indexFound( aPath8.Find( KIndex8 ) ); + + if ( !aPath8.Compare( KIndexWithBrackets8 ) ) + { + aPath8.Close(); + aPath8.CreateL( KMaxLength ); + aPath8.AppendNum( aPos ); + ret = aPath8.Length(); + } + else if ( KErrNotFound != indexFound ) + { + RBuf8 indexNum; + CleanupClosePushL( indexNum ); + indexNum.CreateL( KMaxLength ); + indexNum.AppendNum( aPos ); + + TInt indexPos = ret = aPath8.Find( KIndex8 ); + TInt indexLength = KIndex().Length(); + + aPath8.Replace( indexPos, indexLength, indexNum ); + ret += indexNum.Length(); + + CleanupStack::PopAndDestroy( &indexNum ); + } + + return ret; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnmdbasekey.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnmdbasekey.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,339 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <liwservicehandler.h> + +#include "hnmdkeyfactory.h" +#include "hnconvutils.h" +#include "hnliwutils.h" +#include "hnglobals.h" +#include "hnmdbasekey.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBaseKey::SetKeyOrNameL( const TXmlEngElement& aElement ) + { + // set key or name + if ( !aElement.Name().Compare( KKeyElementItem8 ) ) + { + if ( aElement.HasAttributeL( KKeyAttrName8 ) ) + { + // key + SetKeyNameL( aElement.AttributeNodeL( KKeyAttrName8 ) ); + } + else if ( aElement.HasAttributeL( KNameAttrName8 ) ) + { + // name + SetKeyNameL( aElement.AttributeNodeL( KNameAttrName8 ) ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const RPointerArray<CHnMdBaseKey>& CHnMdBaseKey::SubKeys() const + { + return iSubKeys; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBaseKey::BaseConstructL( const CHnMdBaseKey* aKey ) + { + iKeyName.CreateL( aKey->KeyName() ); + iContent.CreateL( aKey->KeyContent() ); + SetSubKeysL( aKey ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBaseKey::BaseConstructL( TXmlEngElement aElement ) + { + ASSERT( !aElement.Name().Compare( KKeyElementItem8 ) + || !aElement.Name().Compare( KContentTypeElementItem8 ) ); + + SetKeyOrNameL( aElement ); + SetValueL( aElement ); + + if ( aElement.HasChildNodes() ) + { + SetSubKeysL( aElement ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBaseKey::SetValueL( const TXmlEngElement& aElement ) + { + if ( aElement.HasAttributeL( KValueAttrName8 ) ) + { + SetKeyContentL( aElement.AttributeNodeL( KValueAttrName8 ) ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBaseKey::SetValueL( const TDesC8& aValue ) + { + iContent.Close(); + iContent.CreateL( aValue.Length() ); + iContent.Copy( aValue ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBaseKey::SetValueL( const TDesC& aValue ) + { + iContent.Close(); + iContent.CreateL( aValue ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey::CHnMdBaseKey() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey::~CHnMdBaseKey() + { + iKeyName.Close(); + iContent.Close(); + iSubKeys.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC8& CHnMdBaseKey::KeyName() const + { + return iKeyName; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC& CHnMdBaseKey::KeyContent() const + { + return iContent; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBaseKey::GetKeyContent( TInt& /* aKeyContent */ ) const + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBaseKey::GetKeyContent( TInt64& /* aKeyContent */ ) const + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBaseKey::SetKeyNameL( const TXmlEngAttr& aName ) + { + iKeyName.Close(); + iKeyName.CreateL( aName.Value() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBaseKey::SetKeyNameL( const TDesC8& aName ) + { + iKeyName.Close(); + iKeyName.CreateL( aName ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBaseKey::SetSubKeysL( const TXmlEngElement& aElement ) + { + RXmlEngNodeList< TXmlEngElement > subkeys; + CleanupClosePushL( subkeys ); + aElement.GetChildElements( subkeys ); + + TInt subkeysAmount( subkeys.Count() ); + + for ( TInt j( 0 ); j < subkeysAmount; j++ ) + { + TXmlEngElement subkeyElement( subkeys.Next() ); + + if ( !subkeyElement.Name().Compare( KKeyElementItem8 ) ) + { + CHnMdBaseKey *subkey = HnMdKeyFactory::CreateL( subkeyElement ); + CleanupStack::PushL( subkey ); + AddSubKeyL( subkey ); + CleanupStack::Pop( subkey ); + } + } + CleanupStack::PopAndDestroy( &subkeys ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBaseKey::SetSubKeysL( const CHnMdBaseKey* aKey ) + { + const RPointerArray<CHnMdBaseKey>& subKeys = aKey->SubKeys(); + TInt count = subKeys.Count(); + for( TInt i( 0 ); i < count ; i++ ) + { + CHnMdBaseKey* subKey = subKeys[ i ]->CopyLC(); + AddSubKeyL( subKey ); + CleanupStack::Pop( subKey ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMdBaseKey::AddSubKeyL( CHnMdBaseKey* aKey ) + { + iSubKeys.AppendL( aKey ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBaseKey::SetKeyContentL( const TXmlEngAttr& aContent ) + { + HBufC* value = HnConvUtils::Str8ToStrLC( aContent.Value() ); + iContent.Close(); + iContent.Assign( value ); + // clean up + CleanupStack::Pop( value ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnMdBaseKey* CHnMdBaseKey::EvaluateLC( + const CLiwGenericParamList& aParamList, + TInt aPos ) + { + CHnMdBaseKey* copy = CopyLC(); + copy->DoEvaluateL( aParamList, aPos ); + return copy; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBaseKey::DoEvaluateL( + const CLiwGenericParamList& aParamList, + TInt aPos ) + { + EvaluateKeyValueL( aParamList, aPos ); + // evaluate subkeys + TInt count( iSubKeys.Count() ); + for( TInt i( 0 ); i < count; i++ ) + { + CHnMdBaseKey* key = iSubKeys[ i ]; + key->DoEvaluateL( aParamList, aPos ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBaseKey::EvaluateKeyValueL( + const CLiwGenericParamList& aParamList, + TInt aPos ) + { + HBufC8* tempContent = HnConvUtils::StrToStr8LC( iContent ); + RBuf tempResult; + CleanupClosePushL( tempResult ); + if ( HnLiwUtils::GetStringL( aParamList, *tempContent, aPos, tempResult ) + != KErrBadDescriptor ) + { + iContent.Swap( tempResult ); + } + CleanupStack::PopAndDestroy( &tempResult ); + CleanupStack::PopAndDestroy( tempContent ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// + +EXPORT_C void CHnMdBaseKey::ToVariantL( TLiwVariant& /* aRet */ ) const + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CHnMdBaseKey::ToGenericParamListL( CLiwGenericParamList & aRet ) const + { + + // for each key + for ( TInt i( 0 ); i < iSubKeys.Count(); i++ ) + { + CHnMdBaseKey* key = iSubKeys[i]; + const TDesC8& keyName = key->KeyName(); + TLiwVariant value; + value.PushL(); + key->ToVariantL( value ); + aRet.AppendL( TLiwGenericParam( keyName, value ) ); + CleanupStack::PopAndDestroy( &value ); + } + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnmdbooleankey.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnmdbooleankey.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,150 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <liwservicehandler.h> + +#include "hnglobals.h" +#include "hnmdbooleankey.h" + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBooleanKey* CHnMdBooleanKey::NewL() + { + CHnMdBooleanKey* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBooleanKey* CHnMdBooleanKey::NewLC() + { + CHnMdBooleanKey* self = new ( ELeave ) CHnMdBooleanKey(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBooleanKey* CHnMdBooleanKey::NewL( const CHnMdBooleanKey* aKey ) + { + CHnMdBooleanKey* self = NewLC( aKey ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBooleanKey* CHnMdBooleanKey::NewLC( const CHnMdBooleanKey* aKey ) + { + CHnMdBooleanKey* self = new ( ELeave ) CHnMdBooleanKey(); + CleanupStack::PushL( self ); + self->ConstructL( aKey ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey* CHnMdBooleanKey::CopyLC() + { + CHnMdBooleanKey* self = CHnMdBooleanKey::NewL( this ); + CleanupStack::PushL( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBooleanKey::~CHnMdBooleanKey() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CHnMdBooleanKey::GetBooleanValueL() const + { + TBool ret( EFalse ); + + if ( !iContent.Compare( KStringFalse ) ) + { + ret = EFalse; + } + else if ( !iContent.Compare( KStringTrue ) ) + { + ret = ETrue; + } + else + { + TLex lex( iContent ); + User::LeaveIfError( lex.Val( ret ) ); + } + + return ret; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBooleanKey::CHnMdBooleanKey() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBooleanKey::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBooleanKey::ConstructL( const CHnMdBooleanKey* aKey ) + { + BaseConstructL( aKey ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdBooleanKey::ToVariantL( TLiwVariant& aRet ) const + { + aRet.SetL( TLiwVariant( ( TBool ) ( GetBooleanValueL() ) ) ); + } +// End of file diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnmdinteger64key.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnmdinteger64key.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,157 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <liwservicehandler.h> + +#include "hnmdinteger64key.h" +#include "hnglobals.h" + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdInteger64Key* CHnMdInteger64Key::NewL() + { + CHnMdInteger64Key* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdInteger64Key* CHnMdInteger64Key::NewLC() + { + CHnMdInteger64Key* self = new ( ELeave ) CHnMdInteger64Key(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdInteger64Key* CHnMdInteger64Key::NewL( const CHnMdInteger64Key* aKey ) + { + CHnMdInteger64Key* self = NewLC( aKey ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdInteger64Key* CHnMdInteger64Key::NewLC( const CHnMdInteger64Key* aKey ) + { + CHnMdInteger64Key* self = new ( ELeave ) CHnMdInteger64Key(); + CleanupStack::PushL( self ); + self->ConstructL( aKey ); + return self; + } + +// --------------------------------------------------------------------------- +// From class CHnMdBaseKey +// --------------------------------------------------------------------------- +// +CHnMdBaseKey* CHnMdInteger64Key::CopyLC() + { + CHnMdInteger64Key* self = CHnMdInteger64Key::NewL( this ); + CleanupStack::PushL( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdInteger64Key::~CHnMdInteger64Key() + { + } + +// --------------------------------------------------------------------------- +// From class CHnMdBaseKey +// converts decimal or hexadecimal string into integer +// --------------------------------------------------------------------------- +// +void CHnMdInteger64Key::GetKeyContent( TInt64& aKeyContent ) const + { + TLex lex( iContent ); + TInt err( KErrNone ); + if ( !iContent.Find( KHexPrefix16 ) ) + { + // hexadecimal + TUint hex; + lex.Inc( KHexPrefix16().Length() ); + lex.Mark(); + err = lex.Val( hex, EHex ); + aKeyContent = hex; + } + else + { + // decimal + err = lex.Val( aKeyContent ); + } + + if ( err != KErrNone ) + { + aKeyContent = err; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdInteger64Key::CHnMdInteger64Key() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdInteger64Key::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdInteger64Key::ConstructL( const CHnMdInteger64Key* aKey ) + { + BaseConstructL( aKey ); + } + +// --------------------------------------------------------------------------- +// From class CHnMdBaseKey +// --------------------------------------------------------------------------- +// +void CHnMdInteger64Key::ToVariantL( TLiwVariant& aRet ) const + { + TInt64 decimalValue( KErrNotFound ); + GetKeyContent( decimalValue ); + aRet.SetL( TLiwVariant( ( TInt64 ) decimalValue ) ); + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnmdintegerkey.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnmdintegerkey.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <liwservicehandler.h> + +#include "hnmdintegerkey.h" +#include "hnglobals.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdIntegerKey* CHnMdIntegerKey::NewL() + { + CHnMdIntegerKey* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdIntegerKey* CHnMdIntegerKey::NewLC() + { + CHnMdIntegerKey* self = new ( ELeave ) CHnMdIntegerKey(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdIntegerKey* CHnMdIntegerKey::NewL( const CHnMdIntegerKey* aKey ) + { + CHnMdIntegerKey* self = NewLC( aKey ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdIntegerKey* CHnMdIntegerKey::NewLC( const CHnMdIntegerKey* aKey ) + { + CHnMdIntegerKey* self = new ( ELeave ) CHnMdIntegerKey(); + CleanupStack::PushL( self ); + self->ConstructL( aKey ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey* CHnMdIntegerKey::CopyLC() + { + CHnMdIntegerKey* self = CHnMdIntegerKey::NewL( this ); + CleanupStack::PushL( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdIntegerKey::~CHnMdIntegerKey() + { + } + +// --------------------------------------------------------------------------- +// converts decimal or hexadecimal string into integer +// --------------------------------------------------------------------------- +// +void CHnMdIntegerKey::GetKeyContent( TInt& aKeyContent ) const + { + TLex lex( iContent ); + TInt err( KErrNone ); + if ( !iContent.Find( KHexPrefix16 ) ) + { + // hexadecimal + TUint hex; + lex.Inc( KHexPrefix16().Length() ); + lex.Mark(); + err = lex.Val( hex, EHex ); + aKeyContent = hex; + } + else + { + // decimal + err = lex.Val( aKeyContent ); + } + + if ( err != KErrNone ) + { + aKeyContent = err; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdIntegerKey::CHnMdIntegerKey() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdIntegerKey::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdIntegerKey::ConstructL( const CHnMdIntegerKey* aKey ) + { + BaseConstructL( aKey ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdIntegerKey::ToVariantL( TLiwVariant& aRet ) const + { + TInt decimalValue( KErrNotFound ); + GetKeyContent( decimalValue ); + aRet.SetL( TLiwVariant( ( TInt32 ) decimalValue ) ); + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnmdkeyfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnmdkeyfactory.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,174 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include "hnmdbasekey.h" +#include "hnmdstring8key.h" +#include "hnmdintegerkey.h" +#include "hnmdinteger64key.h" +#include "hnmduintegerkey.h" +#include "hnmduidkey.h" +#include "hnmdbooleankey.h" +#include "hnmdstring16key.h" +#include "hnmdmapkey.h" +#include "hnmdlistkey.h" +#include "hnmdundefkey.h" +#include "hnglobals.h" +#include "hnmdkeyfactory.h" + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnMdBaseKey* HnMdKeyFactory::CreateLC( TXmlEngElement aElement ) + { + CHnMdBaseKey* self = NULL; + + // First we are testing if the key contains any + // runtime alterable parameters. If so, they have to be constructed + // differently +// if ( aElement.HasAttributeL( KValueAttrName8) && +// aElement.HasAttributeL( KTypeAttrName8 ) ) +// { +// TXmlEngAttr keyValue = aElement.AttributeNodeL( KValueAttrName8 ); +// TXmlEngAttr keyType = aElement.AttributeNodeL( KTypeAttrName8 ); +// if ( keyValue.Value().Find( HnEvent::KEventArgNamespace) +// != KErrNotFound) +// { +// self = CHnMdDynamicKey::NewL( keyType.Value() ); +// } +// } + + if ( aElement.HasAttributeL( KTypeAttrName8 ) ) + { + TXmlEngAttr type = aElement.AttributeNodeL( KTypeAttrName8 ); + const TPtrC8 &name = type.Value(); + self = HnMdKeyFactory::CreateL( name ); + } + else + { + self = CHnMdMapKey::NewL(); + } + + CleanupStack::PushL( self ); + self->BaseConstructL( aElement ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnMdBaseKey* HnMdKeyFactory::CreateL( TXmlEngElement aElement ) + { + CHnMdBaseKey* self = HnMdKeyFactory::CreateLC( aElement ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnMdBaseKey* HnMdKeyFactory::CreateL( + const TDesC8& aName, + const TDesC8& aType, + const TDesC8& aValue ) + { + CHnMdBaseKey* self = HnMdKeyFactory::CreateL( aType ); + CleanupStack::PushL( self ); + self->SetValueL( aValue ); + self->SetKeyNameL( aName ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnMdBaseKey* HnMdKeyFactory::CreateL( + const TDesC8& aName, + const TDesC8& aType, + const TDesC& aValue ) + { + CHnMdBaseKey* self = HnMdKeyFactory::CreateL( aType ); + CleanupStack::PushL( self ); + self->SetValueL( aValue ); + self->SetKeyNameL( aName ); + CleanupStack::Pop( self ); + return self; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey* HnMdKeyFactory::CreateL( const TDesC8& aType ) + { + CHnMdBaseKey* key = NULL; + + if ( !aType.Compare( KKeyTypeString ) ) + { + key = CHnMdString16Key::NewL(); //String + } + else if ( !aType.Compare( KKeyTypeString8 ) ) + { + key = CHnMdString8Key::NewL(); //String8 + } + else if ( !aType.Compare( KKeyTypeInteger ) ) + { + key = CHnMdIntegerKey::NewL(); //Integer + } + else if ( !aType.Compare( KKeyTypeInteger64 ) ) + { + key = CHnMdInteger64Key::NewL(); //Integer64 + } + else if ( !aType.Compare( KKeyTypeUInteger ) ) + { + key = CHnMdUIntegerKey::NewL(); //Unsigned Integer + } + else if ( !aType.Compare( KKeyTypeUid ) ) + { + key = CHnMdUidKey::NewL(); //Uid + } + else if ( !aType.Compare( KKeyTypeBoolean ) ) + { + key = CHnMdBooleanKey::NewL(); //Boolean + } + else if ( !aType.Compare( KKeyTypeString16 ) ) + { + key = CHnMdString16Key::NewL(); //String16 + } + else if ( !aType.Compare( KKeyTypeMap ) ) + { + key = CHnMdMapKey::NewL(); //Map + } + else if ( !aType.Compare( KKeyTypeList ) ) + { + key = CHnMdListKey::NewL(); //List + } + else + { + key = CHnMdUndefKey::NewL(); //Undefined + } + + return key; + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnmdlistkey.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnmdlistkey.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,171 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <liwservicehandler.h> +#include <liwcommon.h> + +#include "hnmdlistkey.h" +#include "hnconvutils.h" +#include "hnliwutils.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdListKey* CHnMdListKey::NewL() + { + CHnMdListKey* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdListKey* CHnMdListKey::NewLC() + { + CHnMdListKey* self = new ( ELeave ) CHnMdListKey(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdListKey* CHnMdListKey::NewL( const CHnMdListKey* aKey ) + { + CHnMdListKey* self = NewLC( aKey ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdListKey* CHnMdListKey::NewLC( const CHnMdListKey* aKey ) + { + CHnMdListKey* self = new ( ELeave ) CHnMdListKey(); + CleanupStack::PushL( self ); + self->ConstructL( aKey ); + return self; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey* CHnMdListKey::CopyLC() + { + CHnMdListKey* self = CHnMdListKey::NewL( this ); + CleanupStack::PushL( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdListKey::~CHnMdListKey() + { + iVariantContent.Reset(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdListKey::CHnMdListKey() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdListKey::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdListKey::ConstructL( const CHnMdListKey* aKey ) + { + BaseConstructL( aKey ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdListKey::ToVariantL( TLiwVariant& aRet ) const + { + if ( iVariantContent.TypeId() == LIW::EVariantTypeNull ) + { + CLiwDefaultList* list = CLiwDefaultList::NewL(); + list->PushL(); + + // handle children + for ( TInt i( 0 ); i < SubKeys().Count(); i++ ) + { + TLiwVariant variant; + variant.PushL(); + SubKeys()[ i ]->ToVariantL( variant ); + list->AppendL( variant ); + CleanupStack::Pop( &variant ); + variant.Reset(); + } + + aRet.SetL( TLiwVariant( list ) ); + CleanupStack::PopAndDestroy( list ); + } + else + { + aRet.SetL( iVariantContent ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdListKey::EvaluateKeyValueL( const CLiwGenericParamList& aParamList, + TInt aPos ) + { + HBufC8 *path8 = HnConvUtils::StrToStr8LC(iContent); + iVariantContent.Reset(); + + TLiwVariant variant; + if (HnLiwUtils::GetVariantL(aParamList, *path8, aPos, variant) == KErrNone + && variant.TypeId() == LIW::EVariantTypeList) + { + iVariantContent = variant; + } + else + { + variant.Reset(); + } + + CleanupStack::PopAndDestroy(path8); + } diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnmdmapkey.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnmdmapkey.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,170 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <liwservicehandler.h> + +#include "hnmdmapkey.h" +#include "hnconvutils.h" +#include "hnliwutils.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdMapKey* CHnMdMapKey::NewL() + { + CHnMdMapKey* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdMapKey* CHnMdMapKey::NewLC() + { + CHnMdMapKey* self = new ( ELeave ) CHnMdMapKey(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdMapKey* CHnMdMapKey::NewL( const CHnMdMapKey* aKey ) + { + CHnMdMapKey* self = NewLC( aKey ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdMapKey* CHnMdMapKey::NewLC( const CHnMdMapKey* aKey ) + { + CHnMdMapKey* self = new ( ELeave ) CHnMdMapKey(); + CleanupStack::PushL( self ); + self->ConstructL( aKey ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey* CHnMdMapKey::CopyLC() + { + CHnMdMapKey* self = CHnMdMapKey::NewL( this ); + CleanupStack::PushL( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdMapKey::~CHnMdMapKey() + { + iVariantContent.Reset(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdMapKey::CHnMdMapKey() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdMapKey::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdMapKey::ConstructL( const CHnMdMapKey* aKey ) + { + BaseConstructL( aKey ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdMapKey::ToVariantL( TLiwVariant& aRet ) const + { + if ( iVariantContent.TypeId() == LIW::EVariantTypeNull ) + { + CLiwDefaultMap* map = CLiwDefaultMap::NewL(); + map->PushL(); + + // handle children + for( TInt i( 0 ); i < SubKeys().Count(); i++ ) + { + TLiwVariant variant; + SubKeys()[ i ]->ToVariantL( variant ); + map->InsertL( SubKeys()[ i ]->KeyName(), variant ); + variant.Reset(); + } + + aRet.SetL( TLiwVariant( map ) ); + CleanupStack::PopAndDestroy( map ); + } + else + { + aRet.SetL(iVariantContent); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdMapKey::EvaluateKeyValueL( const CLiwGenericParamList& aParamList, + TInt aPos ) + { + HBufC8 *path8 = HnConvUtils::StrToStr8LC(iContent); + iVariantContent.Reset(); + + TLiwVariant variant; + if ( HnLiwUtils::GetVariantL(aParamList, *path8, aPos, variant) == KErrNone + && variant.TypeId() == LIW::EVariantTypeMap ) + { + iVariantContent = variant; + } + else + { + variant.Reset(); + } + + CleanupStack::PopAndDestroy(path8); + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnmdstring16key.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnmdstring16key.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <liwservicehandler.h> + +#include "hnmdstring16key.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdString16Key* CHnMdString16Key::NewL() + { + CHnMdString16Key* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdString16Key* CHnMdString16Key::NewLC() + { + CHnMdString16Key* self = new ( ELeave ) CHnMdString16Key(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdString16Key* CHnMdString16Key::NewL( const CHnMdString16Key* aKey ) + { + CHnMdString16Key* self = NewLC( aKey ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdString16Key* CHnMdString16Key::NewLC( const CHnMdString16Key* aKey ) + { + CHnMdString16Key* self = new ( ELeave ) CHnMdString16Key(); + CleanupStack::PushL( self ); + self->ConstructL( aKey ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey* CHnMdString16Key::CopyLC() + { + CHnMdString16Key* self = CHnMdString16Key::NewL( this ); + CleanupStack::PushL( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdString16Key::~CHnMdString16Key() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdString16Key::CHnMdString16Key() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdString16Key::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdString16Key::ConstructL( const CHnMdString16Key* aKey ) + { + BaseConstructL( aKey ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdString16Key::ToVariantL( TLiwVariant& aRet ) const + { + aRet.SetL( TLiwVariant( KeyContent() ) ); + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnmdstring8key.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnmdstring8key.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,132 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 <liwservicehandler.h> + +#include "hnconvutils.h" +#include "hnmdstring8key.h" + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdString8Key* CHnMdString8Key::NewL() + { + CHnMdString8Key* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdString8Key* CHnMdString8Key::NewLC() + { + CHnMdString8Key* self = new ( ELeave ) CHnMdString8Key(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdString8Key* CHnMdString8Key::NewL( const CHnMdString8Key* aKey ) + { + CHnMdString8Key* self = NewLC( aKey ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdString8Key* CHnMdString8Key::NewLC( const CHnMdString8Key* aKey ) + { + CHnMdString8Key* self = new ( ELeave ) CHnMdString8Key(); + CleanupStack::PushL( self ); + self->ConstructL( aKey ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey* CHnMdString8Key::CopyLC() + { + CHnMdString8Key* self = CHnMdString8Key::NewL( this ); + CleanupStack::PushL( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdString8Key::~CHnMdString8Key() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdString8Key::CHnMdString8Key() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdString8Key::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdString8Key::ConstructL( const CHnMdString8Key* aKey ) + { + BaseConstructL( aKey ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdString8Key::ToVariantL( TLiwVariant& aRet ) const + { + TLiwVariant ret; + HBufC8* keyVal8 = HnConvUtils::StrToStr8LC( KeyContent() ); + + aRet.SetL(TLiwVariant( *keyVal8) ); // crates a copy of the data + + // clean up + CleanupStack::PopAndDestroy(keyVal8); + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnmduidkey.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnmduidkey.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,150 @@ +/* +* Copyright (c) 2007-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: + * +*/ + + +#include <liwservicehandler.h> + +#include "hnmduidkey.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUidKey* CHnMdUidKey::NewL() + { + CHnMdUidKey* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUidKey* CHnMdUidKey::NewLC() + { + CHnMdUidKey* self = new ( ELeave ) CHnMdUidKey(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUidKey* CHnMdUidKey::NewL(const CHnMdUidKey* aKey) + { + CHnMdUidKey* self = NewLC(aKey); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUidKey* CHnMdUidKey::NewLC( const CHnMdUidKey* aKey ) + { + CHnMdUidKey* self = new ( ELeave ) CHnMdUidKey(); + CleanupStack::PushL( self ); + self->ConstructL( aKey ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey* CHnMdUidKey::CopyLC() + { + CHnMdUidKey* self = CHnMdUidKey::NewL( this); + CleanupStack::PushL( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUidKey::~CHnMdUidKey() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdUidKey::GetKeyContent( TInt& aKeyContent ) const + { + // converts hexadecimal string into integer + TLex lex( iContent ); + TUint a; + lex.Inc( 2 ); + lex.Mark(); + + TInt err = lex.Val( a, EHex ); + + if ( err == KErrNone ) + { + aKeyContent = a; + } + else + { + aKeyContent = err; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUidKey::CHnMdUidKey() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdUidKey::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdUidKey::ConstructL( const CHnMdUidKey* aKey ) + { + BaseConstructL( aKey ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdUidKey::ToVariantL( TLiwVariant& aRet ) const + { + TLiwVariant ret; + TInt intVal( KErrGeneral ); + GetKeyContent( intVal ); + aRet.SetL( TLiwVariant( TUid::Uid( intVal ) ) ); // creates a copy of the data + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnmduintegerkey.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnmduintegerkey.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <liwservicehandler.h> + +#include "hnmduintegerkey.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUIntegerKey* CHnMdUIntegerKey::NewL() + { + CHnMdUIntegerKey* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUIntegerKey* CHnMdUIntegerKey::NewLC() + { + CHnMdUIntegerKey* self = new ( ELeave ) CHnMdUIntegerKey(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUIntegerKey* CHnMdUIntegerKey::NewL( const CHnMdUIntegerKey* aKey ) + { + CHnMdUIntegerKey* self = NewLC( aKey ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUIntegerKey* CHnMdUIntegerKey::NewLC( const CHnMdUIntegerKey* aKey ) + { + CHnMdUIntegerKey* self = new ( ELeave ) CHnMdUIntegerKey(); + CleanupStack::PushL( self ); + self->ConstructL( aKey ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey* CHnMdUIntegerKey::CopyLC() + { + CHnMdUIntegerKey* self = CHnMdUIntegerKey::NewL( this ); + CleanupStack::PushL( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUIntegerKey::~CHnMdUIntegerKey() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUIntegerKey::CHnMdUIntegerKey() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdUIntegerKey::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdUIntegerKey::ConstructL( const CHnMdUIntegerKey* aKey ) + { + BaseConstructL( aKey ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdUIntegerKey::ToVariantL( TLiwVariant& aRet ) const + { + TLex lex( KeyContent() ); + TUint uIntVal( KErrNone ); + lex.Val( uIntVal ); + aRet.SetL( TLiwVariant( uIntVal ) ); // crates a copy of the data + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnmdundefkey.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnmdundefkey.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <liwservicehandler.h> + +#include "hnmdundefkey.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUndefKey* CHnMdUndefKey::NewL() + { + CHnMdUndefKey* self = NewLC(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUndefKey* CHnMdUndefKey::NewLC() + { + CHnMdUndefKey* self = new ( ELeave ) CHnMdUndefKey(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUndefKey* CHnMdUndefKey::NewL( const CHnMdUndefKey* aKey ) + { + CHnMdUndefKey* self = NewLC( aKey ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUndefKey* CHnMdUndefKey::NewLC( const CHnMdUndefKey* aKey ) + { + CHnMdUndefKey* self = new ( ELeave ) CHnMdUndefKey(); + CleanupStack::PushL(self); + self->ConstructL( aKey ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdBaseKey* CHnMdUndefKey::CopyLC() + { + CHnMdUndefKey* self = CHnMdUndefKey::NewL( this ); + CleanupStack::PushL( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUndefKey::~CHnMdUndefKey() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnMdUndefKey::CHnMdUndefKey() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdUndefKey::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnMdUndefKey::ConstructL( const CHnMdUndefKey* aKey ) + { + BaseConstructL( aKey ); + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnrepositorymanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnrepositorymanager.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,194 @@ +/* +* Copyright (c) 2007-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: +* +*/ + + +#include <menudebug.h> + +#include "hnrepositorymanager.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnRepositoryManager * CHnRepositoryManager::NewL() + { + CHnRepositoryManager * self = CHnRepositoryManager::NewLC(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnRepositoryManager * CHnRepositoryManager::NewLC() + { + CHnRepositoryManager * self = new (ELeave) CHnRepositoryManager(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnRepositoryManager::StoreSuiteWidgetTypeL( + const TDesC& aSuiteName, THnSuiteWidgetType aWidgetType ) + { + DEBUG(("_MM_:CHnRepositoryManager::StoreSuiteWidgetTypeL IN")); + DEBUG16(("_MM_:\taSuiteName: %S; aWidgetType: %d",&aSuiteName,aWidgetType)); + + TInt ret( KErrGeneral ); + + RArray< TUint32 > foundIds; + CleanupClosePushL( foundIds ); + + ret = iRepository->FindEqL( 0, 0, aSuiteName, foundIds ); + + // If there is more than one entry of suite genre in central repository + // it certainly means that it's a mistake. + ASSERT( foundIds.Count() <= 1 ); + + TInt keyId; + if ( foundIds.Count() == 1 ) + { + keyId = foundIds[ foundIds.Count() - 1 ]; + } + else + { + foundIds.Reset(); + ret = iRepository->FindL(0, 0, foundIds); + //Finding a free position to write + keyId = ( foundIds.Count() > 0 ) ? + foundIds[ foundIds.Count() - 1 ] + 1 : 0; + } + + DEBUG(("_MM_:\t\tkey ID: %d",keyId)); + + TInt stateType(aWidgetType); + if ( ( ret = iRepository->Set( keyId, aSuiteName ) ) == KErrNone ) + { + ret = iRepository->Set(keyId + KWidgetTypePosition, stateType); + } + + User::LeaveIfError( ret ); + + DEBUG(("_MM_:\treturn value: %d",ret)); + DEBUG(("_MM_:CHnRepositoryManager::StoreSuiteWidgetTypeL OUT")); + + CleanupStack::PopAndDestroy( &foundIds ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnRepositoryManager::DeleteSuiteRelatedL( const TDesC & aSuiteName ) + { + TInt ret( KErrNone ); + RArray< TUint32 > foundIds; + CleanupClosePushL( foundIds ); + + ret = iRepository->FindEqL( 0, 0, aSuiteName, foundIds ); + for (int i=0; i<foundIds.Count(); i++) + { + if( iRepository->Delete( foundIds[i] ) < 0 ) + { + ret = KErrGeneral; + } + if( iRepository->Delete( foundIds[i] + KWidgetTypePosition ) < 0 ) + { + ret = KErrGeneral; + } + } + + CleanupStack::PopAndDestroy( &foundIds ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnRepositoryManager::ReadSuiteWidgetTypeL( + const TDesC& aSuiteName, THnSuiteWidgetType& aSuiteWidget ) + { + TInt ret( KErrNone ); + RArray< TUint32 > foundIds; + CleanupClosePushL( foundIds ); + ret = iRepository->FindEqL( 0, 0, aSuiteName, foundIds ); + + // If there is more than one entry of suite genre in central repository + // it certainly means that it's a mistake. + ASSERT( foundIds.Count() <= 1 ); + if ( foundIds.Count() == 1 ) + { + THnSuiteWidgetType suiteState( EUnspecified ); + ret = iRepository->Get( foundIds[0] + KWidgetTypePosition, + (int &) suiteState); + if( !ret ) + { + switch( suiteState ) + { + case EGridWidget: + case EListWidget: + case ECoverFlowWidget: + case EChangeWidget: + case EUnspecified: + aSuiteWidget = suiteState; + break; + default: + ASSERT(false); + } + } + } + + CleanupStack::PopAndDestroy( &foundIds ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnRepositoryManager::~CHnRepositoryManager() + { + delete iRepository; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnRepositoryManager::ConstructL() + { + iRepository = CRepository::NewL( KMatrixRepositoryUid ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnRepositoryManager::CHnRepositoryManager() + : KWidgetTypePosition(1), iRepository(NULL) + { + } + diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnutilities/src/hnservicehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnutilities/src/hnservicehandler.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,282 @@ +/* +* Copyright (c) 2007-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: ?Description +* +*/ + + +#include <xmlengdom.h> +#include <liwservicehandler.h> + +#include "hnservicehandler.h" +#include "hnliwutils.h" +#include "hnglobals.h" +#include "hnmdbasekey.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnServiceHandler::ConstructL( + const TDesC8& aService, const TDesC8& aInterface, + const TDesC8& aCommand, + CLiwGenericParamList* aConstructor, + CLiwGenericParamList* aServiceCommand ) + { + iServiceName.CreateL( aService ); + iInterfaceName.CreateL( aInterface ); + iCommandName.CreateL( aCommand ); + + iServiceHandler = CLiwServiceHandler::NewL(); + iInput = CLiwGenericParamList::NewL(); + + iOutputForAS = CLiwGenericParamList::NewL(); + + iServiceInterface = NULL; + SetServiceInterfaceL( aConstructor ); + + // Please note that by setting these two member variables + // we take ownership of aConstructor and aServiceCommand. + // No leaving functions may be called in ConstructL from + // now on. + iConstructor = aConstructor; + iCommand = aServiceCommand; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnServiceHandler* CHnServiceHandler::NewL( + const TDesC8& aService, const TDesC8& aInterface, + const TDesC8& aCommand, TServiceMode aMode, + CLiwGenericParamList* aConstructor, + CLiwGenericParamList* aServiceCommand ) + { + CHnServiceHandler* self = CHnServiceHandler::NewLC( aService, aInterface, + aCommand, aMode, aConstructor, aServiceCommand ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnServiceHandler* CHnServiceHandler::NewLC( + const TDesC8& aService, const TDesC8& aInterface, + const TDesC8& aCommandName, TServiceMode aMode, + CLiwGenericParamList* aConstructor, + CLiwGenericParamList* aServiceCommand ) + { + CHnServiceHandler* self = new( ELeave ) CHnServiceHandler( aMode ); + CleanupStack::PushL( self ); + self->ConstructL( aService, aInterface, aCommandName, aConstructor, + aServiceCommand ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CHnServiceHandler::CHnServiceHandler( TServiceMode aMode ) : + iMode( aMode ) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CHnServiceHandler::~CHnServiceHandler() + { + + iServiceName.Close(); + iInterfaceName.Close(); + iCommandName.Close(); + + if ( iServiceInterface ) + { + iServiceInterface->Close(); + } + + delete iInput; + delete iConstructor; + delete iCommand; + delete iOutputForAS; + + if ( iServiceHandler ) + { + iServiceHandler->Reset(); + delete iServiceHandler; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnServiceHandler::ExecuteL( MLiwNotifyCallback* aCallback, + TInt aCmdOptions) + { + TInt err( KErrNotSupported ); + if( iServiceInterface ) + { + err = KErrNotSupported; + iOutputForAS->Reset(); + iInput->Reset(); + iInput->AppendL( *iCommand ); + switch( iMode ) + { + case EServiceModeAsynchronous: + { + __ASSERT_DEBUG( aCallback , User::Panic( KMatrixPanic , 0 ) ); + TRAP(err, iServiceInterface->ExecuteCmdL( + iCommandName, *iInput, *iOutputForAS, aCmdOptions, aCallback ) ); + } + break; + case EServiceModeSynchronous: + { + TRAP(err, iServiceInterface->ExecuteCmdL( + iCommandName, *iInput, *iOutputForAS, aCmdOptions, NULL ) ); + } + break; + } + } + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHnServiceHandler::ExecuteL( + CLiwGenericParamList& aOutParamList, TRequestStatus& aStatus ) + { + iClientStatus = &aStatus; + (*iClientStatus) = KRequestPending; + iOutputForAO = &aOutParamList; + + TInt err( KErrNotSupported ); + if( iServiceInterface ) + { + err = KErrNone; + iInput->Reset(); + iInput->AppendL( *iCommand ); + + switch (iMode) + { + case EServiceModeAsynchronous: + { + TRAP(err, iServiceInterface->ExecuteCmdL( + iCommandName, *iInput, *iOutputForAO, 0, this ) ); + if ( err != KErrNone ) + { + User::RequestComplete( iClientStatus, err ); + } + } + break; + case EServiceModeSynchronous: + { + TRAP(err, iServiceInterface->ExecuteCmdL( + iCommandName, *iInput, *iOutputForAO ) ); + User::RequestComplete( iClientStatus, KErrNone ); + } + break; + default: + break; + } + } + else + { + // KErrNone ensures that CHnQueryResultCollector::HandleQueryResultsL() + // is called, empty results are added to list, and + // CHnMdItem::ResultsCollectedL doesn't get confused + User::RequestComplete( iClientStatus, KErrNone ); + } + + return err; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +EXPORT_C TInt CHnServiceHandler::HandleNotifyL( + TInt /*aCmdId*/, + TInt /*aEventId*/, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/ ) + { + // reset + if( iOutputForAO ) + { + iOutputForAO->Reset(); + iOutputForAO->AppendL( aEventParamList ); + + TLiwGenericParam param; + TInt error(KErrNone); + param.PushL(); + for (TInt i = 0; i < aEventParamList.Count(); i++) + { + if ( param.Name().Compare( KErrorCode8 ) == 0 + && param.Value().AsTInt32() == KSErrNoMemory ) + { + error = KErrNoMemory; + break; + } + } + CleanupStack::PopAndDestroy(¶m); + User::RequestComplete( iClientStatus, error); + } + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +TInt CHnServiceHandler::SetServiceInterfaceL( + CLiwGenericParamList* aConstructor ) + { + CLiwGenericParamList& inParam = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParam = iServiceHandler->OutParamListL(); + + CLiwCriteriaItem* critItem = CLiwCriteriaItem::NewLC( KLiwCmdAsStr, + iInterfaceName, iServiceName ); + + critItem->SetServiceClass( TUid::Uid( KLiwClassBase ) ); + RCriteriaArray critArr; + CleanupClosePushL( critArr ); + critArr.AppendL( critItem ); + iServiceHandler->AttachL( critArr ); + inParam.AppendL( *aConstructor ); + iServiceHandler->ExecuteServiceCmdL( *critItem, inParam, outParam ); + CleanupStack::PopAndDestroy( &critArr ); + CleanupStack::PopAndDestroy( critItem ); + + TInt pos( KErrNone ); + outParam.FindFirst( pos, iInterfaceName ); + if ( pos != KErrNotFound ) + { + iServiceInterface = outParam[pos].Value().AsInterface(); + } + + return pos; + } + +// End of file diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/rom/hierarchynavigator.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/rom/hierarchynavigator.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: IBY file for the hierarchynavigator space subsystem +* +*/ + + +#ifndef HIERARCHYNAVIGATOR_IBY +#define HIERARCHYNAVIGATOR_IBY + +file=ABI_DIR\BUILD_DIR\hnengine.dll SHARED_LIB_DIR\hnengine.dll +file=ABI_DIR\BUILD_DIR\hnmetadatamodel.dll SHARED_LIB_DIR\hnmetadatamodel.dll +file=ABI_DIR\BUILD_DIR\hnpresentationmodel.dll SHARED_LIB_DIR\hnpresentationmodel.dll +file=ABI_DIR\BUILD_DIR\hnutilities.dll SHARED_LIB_DIR\hnutilities.dll + +data=DATAZ_\private\10202be9\20012474.txt private\10202be9\20012474.txt + +#endif // HIERARCHYNAVIGATOR_IBY + +// End of File \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,21 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project menufwui +* +*/ + + +#include "../mmextensions/group/bld.inf" +#include "../mmwidgets/group/bld.inf" +#include "../matrixmenu/group/bld.inf" diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/data/matrixmenu.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/data/matrixmenu.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,242 @@ +/* +* Copyright (c) 2007-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 definitions for project matrixmenu +* +*/ + + + +NAME MMEN // 4 letter ID + +// INCLUDES +#include <eikon.rh> +#include <avkon.rsg> +#include <avkon.rh> +#include <appinfo.rh> + +#ifdef LANGUAGE_SC + #include <sc/avkon.loc> + #include <sc/matrix_menu.loc> +#else + #include <avkon.loc> + #include <matrix_menu.loc> +#endif + +#include "mmgui.hrh" + + +// --------------------------------------------------------------------------- +// RSS_SIGNATURE +// --------------------------------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// --------------------------------------------------------------------------- +// r_default_document_name +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_default_document_name + { + buf=""; + } + +// --------------------------------------------------------------------------- +// EIK_APP_INFO +// --------------------------------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + menubar = r_main_menubar; + cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT; + } + +// --------------------------------------------------------------------------- +// r_global_toolbar +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_global_toolbar + { + flags = KAknToolbarFixed; + // define empty button set in order for the toolbar to be displayed properly, + // buttons will be updated at runtime + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = EMmToolbarControl1; + control = AVKON_BUTTON + { + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = EMmToolbarControl2; + control = AVKON_BUTTON + { + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = EMmToolbarControl3; + control = AVKON_BUTTON + { + }; + } + }; + } + +// --------------------------------------------------------------------------- +// r_main_menubar +// --------------------------------------------------------------------------- +// +RESOURCE MENU_BAR r_main_menubar + { + titles = + { + MENU_TITLE { menu_pane = r_main_menu_pane; } + }; + } + +// --------------------------------------------------------------------------- +// r_main_menu_pane +// --------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_main_menu_pane + { + items = + { + MENU_ITEM + { + command = EMmOptionsExit; + txt = qtn_options_exit; + } + }; + } + +//empty "placeholder" cascade menu panes +// --------------------------------------------------------------------------- +// r_cascade_menu_pane_1 +// --------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_cascade_menu_pane_1 + { + } + +// --------------------------------------------------------------------------- +// r_cascade_menu_pane_2 +// --------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_cascade_menu_pane_2 + { + } + +// --------------------------------------------------------------------------- +// r_cascade_menu_pane_3 +// --------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_cascade_menu_pane_3 + { + } + +// --------------------------------------------------------------------------- +// r_localisable_app_info +// --------------------------------------------------------------------------- +// +RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info + { + short_caption = qtn_menu_title; + caption_and_icon = + CAPTION_AND_ICON_INFO + { + caption = qtn_menu_title; + number_of_icons = 1; + icon_file = "\\resource\\apps\\matrixmenu.mif"; + }; + } + +//----------------------------------------------------------------------------- +// LOGICAL NAME STRINGS +//----------------------------------------------------------------------------- + +// from us spec + +RESOURCE TBUF r_menu_title { buf=qtn_menu_title; } +RESOURCE TBUF r_org_root_editing_title { buf=qtn_org_root_editing_title; } +RESOURCE TBUF r_org_folder_editing_title { buf=qtn_org_folder_editing_title; } +RESOURCE TBUF r_menu_open { buf=qtn_menu_open; } +RESOURCE TBUF r_menu_organize { buf=qtn_menu_organize; } +RESOURCE TBUF r_sub_options_org_move_to_folder { buf=qtn_sub_options_org_move_to_folder; } +RESOURCE TBUF r_menu_uninstall { buf=qtn_menu_uninstall; } +RESOURCE TBUF r_apps_note_item_already_stored { buf=qtn_apps_note_item_already_stored; } +RESOURCE TBUF r_apps_note_move_to_folder { buf=qtn_apps_note_move_to_folder; } +RESOURCE TBUF r_fldr_cannot_move_folder { buf=qtn_fldr_cannot_move_folder; } +RESOURCE TBUF r_fldr_cannot_delete_item { buf=qtn_fldr_cant_delete_folder; } +RESOURCE TBUF r_fldr_item_cannot_be_moved { buf=qtn_fldr_item_cannot_be_moved; } + +//----------------------------------------------------------------------------- +// Info dialog +//----------------------------------------------------------------------------- +RESOURCE DIALOG r_menu_info + { + flags = EAknWarningNoteFlags | EEikDialogFlagWait; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = AVKON_NOTE + { + layout = EGeneralLayout; + animation = R_QGN_NOTE_ERROR_ANIM; + }; + } + }; + } + +RESOURCE CBA r_menu_softkeys_options_bexit + { + buttons = + { + CBA_BUTTON {id=EAknSoftkeyOptions; txt = text_softkey_option;}, + CBA_BUTTON {id=EAknSoftkeyBack; txt = text_softkey_exit; } + }; + } + +RESOURCE CBA r_menu_softkeys_options_bexit__select + { + buttons = + { + CBA_BUTTON {id=EAknSoftkeyOptions; txt = text_softkey_option;}, + CBA_BUTTON {id=EAknSoftkeyBack; txt = text_softkey_exit; }, + AVKON_CBA_BUTTON{id=EAknSoftkeySelect; longpressid=0; txt= qtn_msk_select; } + }; + } + +RESOURCE CBA r_menu_softkeys_empty__empty + { + buttons = + { + CBA_BUTTON {id=EAknSoftkeyOptions; txt = " ";}, + CBA_BUTTON {id=EAknSoftkeyBack; txt = " "; } + }; + } + +// End of File diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/data/matrixmenu_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/data/matrixmenu_reg.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2007-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 definitions for project matrixmenu +* +*/ + + +#include "mmguiuid.hrh" +#include <appinfo.rh> +#include <matrixmenu.rsg> + +UID2 KUidAppRegistrationResourceFile +UID3 _MATRIX_UID3 + +RESOURCE APP_REGISTRATION_INFO + { + app_file="matrixmenu"; + localisable_resource_file = "\\resource\\apps\\matrixmenu"; + localisable_resource_id = R_LOCALISABLE_APP_INFO; + + embeddability=KAppNotEmbeddable; + newfile=KAppDoesNotSupportNewFile; + } diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/group/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/group/backup_registration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,4 @@ +<?xml version="1.0" standalone="yes"?> +<backup_registration> + <proxy_data_manager SID="0x10202BE9"/> +</backup_registration> \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project matrixmenu +* +*/ + + +#include <platform_paths.hrh> + +// Help exports +#include "../help/group/bld.inf" + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../loc/matrix_menu.loc APP_LAYER_LOC_EXPORT_PATH(matrix_menu.loc) +../rom/matrixmenu.iby CORE_APP_LAYER_IBY_EXPORT_PATH(matrixmenu.iby) +../rom/matrixmenu_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(matrixmenu_resources.iby) +../inc/mmactionrequest.h |../../../inc/mmactionrequest.h +../inc/mmguiconstants.h |../../../inc/mmguiconstants.h +../inc/mmguiuid.hrh |../../../inc/mmguiuid.hrh + +// backup registration +backup_registration.xml /epoc32/data/Z/private/101F4CD2/backup_registration.xml +backup_registration.xml /epoc32/release/winscw/udeb/Z/private/101F4CD2/backup_registration.xml +backup_registration.xml /epoc32/release/winscw/urel/Z/private/101F4CD2/backup_registration.xml + +PRJ_MMPFILES +matrixmenu.mmp + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv +OPTION TARGETFILE matrixmenu.mif +OPTION SOURCES -c8,8 qgn_menu_appsgrid +END + +#ifdef _MATRIX_MENU_INCLUDE_TEST_CONTENT +#include "../internal/test/group/bld.inf" +#endif diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/group/matrixmenu.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/group/matrixmenu.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2007-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: Project definition file for project matrixmenu +* +*/ + + + +#include <platform_paths.hrh> +#include <data_caging_paths.hrh> +#include "../inc/mmguiuid.hrh" + +epocheapsize 1800000 4500000 + +TARGET matrixmenu.exe +TARGETTYPE exe +UID 0x100039CE _MATRIX_UID3 + +CAPABILITY CAP_APPLICATION +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE mmgui.cpp +SOURCE mmapplication.cpp +SOURCE mmappui.cpp +SOURCE mmdocument.cpp +SOURCE mmpropertysubscriber.cpp +SOURCE mmnomemory.cpp +SOURCE mmappkeyhandler.cpp + +SOURCEPATH ../data + +START RESOURCE matrixmenu.rss +HEADER +TARGET matrixmenu.rsc +TARGETPATH APP_RESOURCE_DIR +LANGUAGE_IDS +END //RESOURCE + +START RESOURCE matrixmenu_reg.rss +DEPENDS matrixmenu.rsg +TARGET matrixmenu_reg.rsc +TARGETPATH /private/10003a3f/apps +END //RESOURCE + +USERINCLUDE ../inc +USERINCLUDE ../loc + +SYSTEMINCLUDE ../../../inc +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib + +LIBRARY apparc.lib +LIBRARY avkon.lib +LIBRARY apgrfx.lib // for TApaTask +LIBRARY eikcore.lib +LIBRARY eikcoctl.lib +LIBRARY cone.lib +LIBRARY fbscli.lib +LIBRARY egul.lib +LIBRARY gdi.lib +LIBRARY eikctl.lib +LIBRARY bafl.lib +LIBRARY ws32.lib + +LIBRARY commonengine.lib // for stringloader +LIBRARY cdlengine.lib // for Layout_Meta_Data +LIBRARY featmgr.lib +LIBRARY gfxtrans.lib // effects + +LIBRARY hnengine.lib +LIBRARY hnpresentationmodel.lib +LIBRARY mmwidgets.lib +LIBRARY hnutilities.lib +LIBRARY liwservicehandler.lib +LIBRARY mmextensionmanager.lib +LIBRARY aknskins.lib +LIBRARY aknskinsrv.lib +LIBRARY aknswallpaperutils.lib + +#ifdef _MATRIX_MENU_TRACE_PERFORMANCE +LIBRARY flogger.lib +#else +DEBUGLIBRARY flogger.lib +#endif + +// End of File diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/help/data/xhtml.zip Binary file menufw/menufwui/matrixmenu/help/data/xhtml.zip has changed diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/help/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/help/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - Initial contribution +* +* Contributors: +* +* +* Description: +* Export help related files. +* +*/ + +#include <platform_paths.hrh> +PRJ_EXPORTS +:zip ../data/xhtml.zip /epoc32/data/z/resource/ overwrite +:zip ../data/xhtml.zip /epoc32/winscw/c/resource/ overwrite + +../inc/app.hlp.hrh MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/app.hlp.hrh) +../rom/matrixmenuhelps_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(matrixmenuhelps_variant.iby) diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/help/inc/app.hlp.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/help/inc/app.hlp.hrh Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// +// app.hlp.hrh generated by CSXHelp Utilities. +// + +#ifndef __APP_HLP_HRH__ +#define __APP_HLP_HRH__ + +_LIT(KAPP_HLP_APP_SHELL, "APP_HLP_APP_SHELL"); // + +#endif \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/help/rom/matrixmenuhelps_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/help/rom/matrixmenuhelps_variant.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: IBY file for the matrix menu helps +* +*/ + +#ifndef __MATRIXMENUHELPS_VARIANT_IBY__ +#define __MATRIXMENUHELPS_VARIANT_IBY__ + +#if defined(FF_S60_HELPS_IN_USE) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101F4CD2\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x101F4CD2\contents.zip) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101F4CD2\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x101F4CD2\index.xml) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101F4CD2\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x101F4CD2\keywords.xml) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101F4CD2\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x101F4CD2\meta.xml) +#endif + +#endif \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/inc/mmactionrequest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/inc/mmactionrequest.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNENGINE_REQUEST_H +#define C_HNENGINE_REQUEST_H + +class CLiwGenericParamList; +/** + * @ingroup group_hnengine + * Hierarchy Navigator engine request. Implemented by the hierarchy navigator engine to handle + * incoming requests defined using the liw generic parameters list ( CLiwGenericParamList ). + * + * @lib hnengine + * @since S60 v3.2 + */ +class MMmActionRequest + { +public: + + /** + * Enables to issue a request to Hn engine. + * + * @since S60 v5.0 + * @param aParam Input Parameters. + * @param aOutput Target list for output. + */ + virtual void HandleRequestL( const CLiwGenericParamList& aParam, + CLiwGenericParamList* aOutput = NULL ) = 0; + + }; + +#endif //C_HNENGINE_REQUEST_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/inc/mmappkeyhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/inc/mmappkeyhandler.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Application key detecting helper class +* Version : %version: 2 % << Don't touch! Updated by Synergy at check-out. +* +*/ + +#ifndef CMMAPPKEYHANLDER_H +#define CMMAPPKEYHANDLER_H + +#include <e32base.h> // For CActive, link against: euser.lib +#include <w32std.h> + +/** + * @ingroup group_matrixmenu + * + * CMmAppkeyHandler is a helper class. It is a low priority active object. + * It is used to detect quick and frequent usage of the application key. + * To detect this state the IsActive() method should be invoked. If IsActive() returns + * ETrue, this means there is heavy processing which blocks the active object completion, + * which may indicate that appkey is being frequently pressed. + * + * @since S60 v5.0 + */ +class CMmAppkeyHandler : public CActive + { +public: + /** + * Cancel and destroy. + */ + ~CMmAppkeyHandler(); + + /** + * Two-phased constructor. + * @return instance of CMmAppkeyHandler. + */ + static CMmAppkeyHandler* NewL(); + + /** + * Two-phased constructor. + * @return instance of CMmAppkeyHandler. + */ + static CMmAppkeyHandler* NewLC(); + +public: + // New functions + + /** + * Function for making the initial request. + */ + void StartL(); + +private: + /** + * C++ constructor. + */ + CMmAppkeyHandler(); + + /** + * Second-phase constructor. + */ + void ConstructL(); + +private: + /** + * From CActive. + * Handle completion. + */ + void RunL(); + + /** + * How to cancel me. + * Left without implementation because the AO completes itself in StartL; + */ + void DoCancel(); + + /** + * Override to handle leaves from RunL(). Default implementation causes + * the active scheduler to panic. + * + * @param aError Error occurred; + * @return Error code. + */ + TInt RunError(TInt aError); + + }; + +#endif // CMMAPPKEYHANLDER_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/inc/mmapplication.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/inc/mmapplication.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Application class +* +*/ + + +#ifndef C_MMAPPLICATION_H +#define C_MMAPPLICATION_H + +// INCLUDES +#include <aknapp.h> + +/** + * @ingroup group_matrixmenu + * Matrix Menu Application. + * AVKON Application class. + * + * @since S60 v5.0 + */ +NONSHARABLE_CLASS(CMmApplication) : public CAknApplication + { + +public: + +// from base class CApaApplication + + /** + * From CApaApplication. + * Returns application's UID. + * + * @since S60 v5.0 + * @return Application's UID (KUidMatrixMenuApp). + */ + TUid AppDllUid() const; + +protected: + +// from base class CApaApplication + + /** + * From CApaApplication. + * Creates the Document. + * + * @since S60 v5.0 + * @return Instance of the Document. + */ + CApaDocument* CreateDocumentL(); + + }; + +#endif // C_MMAPPLICATION_H + +// End of File diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/inc/mmappui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/inc/mmappui.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1069 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Application UI class +* Version : %version: MM_83.1.2.1.23.1.18 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef C_MMAPPUI_H +#define C_MMAPPUI_H + +// INCLUDES +#include <gfxtranseffect/gfxtranseffect.h> // for transition effects +#include <akntranseffect.h> // for transition effects + +#include <e32hashtab.h> +#include <aknappui.h> +#include <akntoolbarobserver.h> +#include <eiklbo.h> +#include <hwrmdomainpskeys.h> //for flip change status +#include <AknsSrvClient.h> + +#include "hncontrollerinterface.h" +#include "mmwidgetobserver.h" +#include "hnsuiteobserver.h" +#include "mmactionrequest.h" +#include "mmpropertysubscriber.h" +#include "hnglobals.h" + + +// FORWARD DECLARATIONS + +class CHnInterface; +class CHnSuiteModel; +class MHnMenuItemModelIterator; +class CAknToolbar; +class CMmWidgetContainer; +class CMmListBoxContainer; +class CMmGridContainer; +class CMmHighlightManager; +class CLiwGenericParamList; +class CHnItemModel; +class CMMExtensionManager; +class CMmTemplateLibrary; +class CMmNoMemory; +class CMmAppkeyHandler; +class CAknStylusPopUpMenu; + +/** + * @ingroup group_matrixmenu + * Matrix Menu Application UI. + * Regular AVKON Application UI class, acts as controller for the application. + * <br>Implements: + * <ul> + * <li>MHnControllerInterface - for notifications about model changes.</li> + * <li>MAknToolbarObserver - to get notifications about toolbar events.</li> + * <li>MMmWidgetObserver - + * to get notifications about widget highlight changes.</li> + * </ul> + * + * @since S60 v5.0 + */ +NONSHARABLE_CLASS(CMmAppUi) : public CAknAppUi, + public MHnControllerInterface, + public MAknToolbarObserver, + public MMmWidgetObserver, + public MMmActionRequest, + public MMmPropertyChangeObserver, + public MAknsSkinChangeObserver + { + +public: + + /** + * 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(); + + /** + * Virtual Destructor. + * + * @since S60 v5.0 + */ + ~CMmAppUi(); + +// from base class CEikAppUi + + /** + * From CEikAppUi. + * Handles a change to the application's resources which + * are shared across the environment. This function calls + * CEikAppUi::HandleResourceChangeL except when aType is + * KEikDynamicLayoutVariantSwitch. + * + * @since S60 v5.0 + * @param aType The type of resources that have changed. + */ + void HandleResourceChangeL( TInt aType ); + + /** + * From CEikAppUi. + * Takes care of Command Line tail handling. + * + * @since S60 v5.0 + * @param aCommand Not used by this app. + * @param aDocumentName Not used by this app. + * @param aTail Command line tail. + */ + TBool ProcessCommandParametersL( TApaCommand aCommand, + TFileName& aDocumentName, + const TDesC8& aTail ); + + /** + * From CAknAppUi. + * This method is overriden to ignore certain commands in + * certain situations. For not ignored commands it simply + * calls the base class implementation. + * + * @param aCommand A command ID. + */ + void ProcessCommandL(TInt aCommand); + + /** + * From CEikAppUi. + * Takes care of Command Line tail handling. + * + * @since S60 v5.0 + * @param aUid UID of the message. + * @param aParams Message params. + */ + void ProcessMessageL( TUid aUid, const TDesC8& aParams ); + + /** + * From MCoeMessageObserver. + * Handles window server messages. + * + * @since S60 v5.0 + * @param aClientHandleOfTargetWindowGroup The window group that the message was sent to. + * @param aMessageUid The message UID. + * @param aMessageParameters The message parameters. + * @return Indicates whether the message was handled or not handled by the function. + */ + MCoeMessageObserver::TMessageResponse HandleMessageL( + TUint32 aClientHandleOfTargetWindowGroup, + TUid aMessageUid, + const TDesC8& aMessageParameters ); + + /** + * From MEikMenuObserver (CEikAppUi). + * Handles dynamic menu pane initialization. + * + * @since S60 v5.0 + * @param aResourceId Resource ID of the menu pane. + * @param aMenuPane The menu pane itself. + */ + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + +// from base class MHnControllerInterface + + /** + * From MHnControllerInterface. + * Notifies UI to start a refresh after content change. + * + * @since S60 v5.0 + * @param aRefreshType Type of refresh. + */ + void NotifyUiRefreshL( const THnUiRefreshType aRefreshType ); + +// from base class MHnSuiteObserver + + /** + * From MHnSuiteObserver. + * Trigger appropriate action on suite model. + * + * @since S60 v5.0 + * @param aCustomSuiteEvent Event to perform. + * @param aModel Suite model where aCustomSuiteEvent should be envoked. + */ + void HandleSuiteEventL( THnCustomSuiteEvent aCustomSuiteEvent, + CHnSuiteModel* aModel ); + +// from base class MEikListBoxObserver + + /** + * From MEikListBoxObserver. + * Handles list box events. + * + * This pure virtual function is invoked by CEikListBox to + * notify the observer of list box events. + * + * @since S60 v5.0 + * @param aListBox The originating list box. + * @param aEventType A code for the event. Further information + * may be obtained by accessing the list box itself. + */ + void HandleListBoxEventL( CEikListBox* aListBox, + MEikListBoxObserver::TListBoxEvent aEventType ); + +// from base class MMmLongTapObserver + + /** + * From MMmLongTapObserver. + * Handles long tap event reported by widget container. + * + * @since S60 v5.0 + * @param aPenEventLocation The relative to screen pen event location. + */ + void HandleLongTapEventL( const TPoint& aPenEventLocation ); + +// from base class MMmKeyEventObserver + + /** + * From MMmKeyEventObserver. + * Handles key press events. + * + * @since S60 v5.0 + * @param aKeyEvent Key event. + * @param aType Event type. + */ + TKeyResponse HandleKeyPressedL( const TKeyEvent &aKeyEvent, + TEventCode aType ); + +// from base class MMmDragAndDropObserver + + /** + * From MMmDragAndDropObserver. + * Handles the start of dragging of an item. + * + * @since S60 v5.0 + * @param aModelItemIndex Index of the dragged item. + */ + void HandleDragStartL( TInt aModelItemIndex ); + + /** + * From MMmDragAndDropObserver. + * Handles the event of dragging an item over a different one. + * Used to change presentation of folder icons to indicate drop into action. + * + * @since S60 v5.0 + * @param aModelItemIndex Index of the item. + */ + void HandleDragOverL( TInt aModelItemIndex ); + + /** + * From MMmDragAndDropObserver. + * Handles the stop of dragging of an item. + * + * @since S60 v5.0 + * @param aModelItemIndex Index of the dragged item. + */ + void HandleDragStopL( TInt aModelItemIndex ); + + /** + * From MMmDragAndDropObserver. + * Handles update of dragged item index. + * + * @since S60 v5.0 + * @param aModelItemIndex New dragged item index. + */ + void HandleDraggedIndexUpdatedL( TInt aModelItemIndex ); + +// from base class MAknToolbarObserver + + /** + * From MAknToolbarObserver. + * Handles toolbar events for a certain toolbar item. + * + * @since S60 v5.0 + * @param aCommand The command ID of some toolbar item. + */ + void OfferToolbarEventL( TInt aCommand ); + +// from base class MHnControllerInterface + /** + * From MHnControllerInterface. + * Execute extension manager action. + * + * @since S60 v5.0 + * @param aUid UID of the ECom plugin's. + * @param aCommand Command which has to be executed on the plugin. + * Request to the Service. + * @param aEventParamList List of the event parameters needed to + * execute action. Extention Manager is its owner. + * @return Number representing error code. + */ + TInt ExecuteExtensionActionL( const TUid aUid , const TDesC& aCommand, + CLiwGenericParamList* aEventParamList ); + +// from MMmPropertyChangeObserver + /** + * Called when property changed + * @since S60 v3.0 + */ + void PropertyChangedL(TInt aValue); + + /** + * Sets the zoom for the application. + */ + void SetZoom( TAknUiZoom aZoom ); + + /** + * Reloads cascade menu map. + */ + void ReloadCascadeMenuMapL(); + + + /** + * Called by the skin server when skin content is changed and the + * connected client wants to be informed. + * + * @since 2.0 + */ + void SkinContentChanged(); + + /** + * Called by the skin server to indicate that the current skin + * configuration has changed. + * + * @param aReason Reason code. + * + * @since 2.5 + */ + void SkinConfigurationChanged( + const TAknsSkinStatusConfigurationChangeReason aReason ); + + /** + * Called by the skin server to indicate that the available + * skin packages have changed. + * + * @param aReason Reason code. + * + * @since 2.5 + */ + void SkinPackageChanged( + const TAknsSkinStatusPackageChangeReason aReason ); + +private: + + /** + * Enum defining possible exit types for ExitMenuL method. + * + * @since S60 v5.0 + */ + enum TExitType + { + EExitReally, + EExitToIdle, + EExitToPhone + }; + + /** + * Enum defining possible exit types for ExitMenuL method. + * + * @since S60 v5.0 + */ + enum TExitKeyType + { + EExitKeyApplication, + EExitKeyRed + }; + + /** + * Defiens edit mode state. + * + * @since S60 v5.0 + */ + enum TEditModeStatus + { + ENoEditMode, + ETransitionToEditMode, + EEditMode, + ETransitionFromEditMode, + EFastTransitionFromEditMode + }; + + /** + * 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 + */ + 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. + */ + CMmWidgetContainer* GetAppropriateContainerToLoadL(); + + /** + * Submits an asynchronous service request to show user a message + * when Matrix Menu is out of memory. + * + * @since S60 v5.0 + */ + void HandleOutOfMemoryL(); + + /** + * Resets MM App UI to the initial state (most of the fields). + * + * @since S60 v5.0 + */ + void ResetToInitialStateL(); + + /** + * Refreshes menu pane if needed + */ + void HideMenuPaneIfVisibleL(); + +// 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. + * Handles Window Server events. + * + * @since S60 v5.0 + * @param aEvent Event to be handled. + * @param aDestination Destination control. + */ + 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(); + + /** + * Handles pen down events for an item. + * + * @since S60 v5.0 + * @param aIndex Item index. + */ + void HandleHighlightItemPenDownL( TInt aIndex ); + + /** + * Handles single click event on widget item. + * + * @since S60 v5.0 + * @param aIndex Clicked item index. + */ + void HandleHighlightItemSingleClickedL( TInt aIndex ); + + /** + * Handles drag event. + * + * @since S60 v5.0 + */ + void HandleEventDraggingActionedL(); + + /** + * Handles click (select) events for an item. + * + * @since S60 v5.0 + * @param aIndex Item index. + */ + void HandleHighlightItemDoubleClickedL( TInt aIndex ); + + /** + * Handles suite model initialized event. + * + * @param aModel Suite model that has been initialized. + * @since S60 v5.0 + */ + void HandleSuiteModelInitializedL( CHnSuiteModel* aModel ); + + /** + * Handles suite update events. + * + * @since S60 v5.0 + */ + void UpdateL(); + + /** + * Handles suite remove events. + * + * @since S60 v5.0 + */ + void RemoveL(); + + /** + * Handles suite insert events. + * + * @since S60 v5.0 + */ + void InsertL(); + + /** + * Handles the "Back" softkey event. + * + * @since S60 v5.0 + */ + void HandleBackCommandL(); + + /** + * Refreshes toolbar. + * + * @since S60 v5.0 + */ + void RefreshToolbarL(); + + /** + * Updates app's presentation to show desired suite content. + * + * @since S60 v5.0 + */ + void ShowSuiteL(); + + /** + * Creates new container for suite model. + * + * @since S60 v5.0 + * @param aSuiteModel Suite model to load. + * @param aContainerToLoad Target pointer for the new container. + * @return ETrue if operation is succesful, EFalse otherwise + */ + TBool CreateNewContainerL( CHnSuiteModel* aSuiteModel, + CMmWidgetContainer*& aContainerToLoad ); + + /** + * Forwards the passed event code to Hierarchy Navigator for handling. + * + * @since S60 v5.0 + * @param aEvent Event code. + */ + void ForwardEventToHNL( TInt aEvent ); + + /** + * Forwards the passed event code to Hierarchy Navigator for handling + * regarding the current suite's item referred to by itemid. + * + * @since S60 v5.0 + * @param aEvent Event code. + * @param aItemId Item ID. + * @param aEventParams Additional parameters. + */ + void ForwardEventToHNL( TInt aEvent, TInt aItemId, + CLiwGenericParamList* aEventParams = NULL ); + + /** + * Sets the Status Pane and CBA to indicate the current open suite. + * + * @param aReset Indicates if status pane should be reset. + * @since S60 v5.0 + */ + void RefreshUiPanesL( TBool aReset = EFalse ); + + /** + * Checks recieved messages and forwards to HN. + * + * @since S60 v5.0 + * @param aMessage The message. + */ + void HandleMessageL( const TDesC8& aMessage ); + + /** + * Gets the resource ID of the first free cascade menu pane container. + * Resource containers are defined in nsui.rss under + * r_main_menu_pane_cascade_* tags. + * + * @since @since S60 v5.0 + * @return The ID of the first available cascade manu pane resource + * container, or KErrNotFound if none available. + */ + TInt GetNextCascadeMenuResourceId(); + + /** + * Handles the update of current shown container. + * + * @since S60 v5.0 + * @param aWidgetContainer The widget container to be shown. + */ + void HandlePresentationChangeL( CMmWidgetContainer* aWidgetContainer ); + + /** + * Handles the switching of visible containers. + * + * @since S60 v5.0 + * @param aWidgetContainer The widget to switch to. + */ + void HandleWidgetChangeRefreshL( CMmWidgetContainer* aWidgetContainer ); + + /** + * Handles the refresh if no widget change occured. + * Just model on the stack changed. + * + * @since S60 v5.0 + */ + void HandleNoWidgetChangeRefreshL(); + + /** + * Shows or hides toolbar depending on context. + * + * @since S60 v5.0 + */ + void HandleToolbarVisibilityL(); + + /** + * Updates the toolbar content. + * + * @since S60 v5.0 + */ + void UpdateToolbarL(); + + /** + * Sets the Edit Mode. + * + * @since S60 v5.0 + * @param aIsEditMode ETrue if edit mode needs to be turned on. + */ + void SetEditModeL( TBool aIsEditMode ); + + /** + * Returns TAT/Kastor effect rectangle. + * + * @since S60 v5.0 + * @param aItemModel Model of the selected item. + * @param aItemId Item ID. + * @return Screen rect of the selected item. + */ + TRect GetKastorRectL( CHnItemModel* aItemModel, TInt aItemId ); + + /** + * Returns TAT/Kastor effect depends on selected item. + * + * @since S60 v5.0 + * @param aItemModel Model of the selected item. + * @return Effect id depends on item type and status. + */ + TInt GetKastorEffectL( CHnItemModel* aItemModel ); + + /** + * Handles exiting Matrix. + * + * @since S60 v5.0 + * @param aExitType type of exit. + */ + void ExitMatrix( TExitType aExitType ); + + /** + * Cleans up before exiting Matrix. + * Stops edit mode and resets to root. + * + * @param aExitKey Red key or application key. + * @since S60 v5.0 + */ + void CleanupForExitL( TExitKeyType aExitKey ); + + /** + * Manages bringing homescreen and relevant apps to foreground. + * + * @since S60 v5.0 + * @param aExitType type of exit. + */ + void ShowHomescreenL( TExitType aExitType ); + + /** + * Places the homescreen window underneath the menu window. + * + * This method puts the homescreen window just below the matrix menu + * window (assuming that matrix menu is running in the foreground) so + * that if matrix gets closed and disappears from the screen, then + * homescreen will be visible immediately. If it is impossible to do + * so (for any reason), this method will call ShowHomescreenL. + * + * @since S60 v5.0 + */ + void PrepareHomescreenForMatrixExitL(); + + /** + * Opens the desired application. + * Used in exiting Matrix. + * + * @since S60 v5.0 + * @param aUid UID of the app to open. + */ + void OpenAppL( const TUid aUid ); + + /** + * Loads default root suite + * + * @since S60 v5.0 + */ + void InitializeL(); + + /** + * Refreshes Cba according to current context. + * + * @since S60 v5.0 + */ + void RefreshCbaL(); + + /** + * MSK text. + * + * @since S60 v5.0 + */ + void SetMiddleSoftKeyL(); + + /** + * Starts fullscreen. + * @param aKastorEffect Id of the TAT/Kastor effect. + * + * @since S60 v5.0 + */ + void StartLayoutSwitchFullScreen( TInt aKastorEffect + = AknTransEffect::ELayoutSwitchStart); + + /** + * Ends fullscreen + * + * @since S60 v5.0 + */ + void EndFullScreen(); + + // From MMActionRequest + + /** + * Enables to issue a request to Hn engine. + * + * @since S60 v5.0 + * @param aParam Input Parameters. + * @param aOutput Target list for output. + */ + void HandleRequestL( const CLiwGenericParamList& aParam, + CLiwGenericParamList* aOutput = NULL ); + + /** + * Resets map of widget containers. + * + * @since S60 v5.0 + */ + void ResetContainerMap(); + + /** + * Resets map of widget container to root. + * + * @since S60 v5.0 + */ + void ResetContainerMapToRootL(); + + /** + * Called to retrive flip status. + * + * @since S60 v5.0 + * @return Is flip open. + */ + TBool FlipOpen(); + + /** + * Resets view to root. + * + * @return ETrue if view was not displaying root suite already, EFalse otherwise + */ + TBool ResetToRootL(); + + /** + * Refreshes icons after skin changing + */ + void RefreshIconsL(); + + /** + * Forward event to hierarchy navigator. + * + * @param aOffset Highlight offset. + */ + void HandleHighlightOffsetL( TInt aOffset ); + + /** + * Replaces ETransitionFromEditMode or EFastTransitionFromEditMode to ENoEditMode + */ + void ClearTransitionFromEditModeFlag(); + /** + * Method inherited from CEikAppUi to handle + * out of memory problem. + * + * @param aError KErrNoMemory is handled. + * @param aExtErr Not used. + * @param aErrorText Not used. + * @param aContextText Not used. + * @return EErrorNotHandled in order to display proper information. + */ + TErrorHandlerResponse HandleError( TInt aError, + const SExtendedError &aExtErr, + TDes &aErrorText, + TDes &aContextText ); + + /** + * Update widget data for number of items changed. + * + * @param aChange type of change. + */ + void HandleNumberOfItemsChangedL( TItemsChangeType aChange ); + + /** + * Sets the highlighted item in gui objects accordingly to what + * is stored in the model. The exact result of calling this + * method depends on @c iMakeHightlightedItemFullyVisible + * flag. + */ + void ApplyHighlightFromModelL(); + + /** + * Called when EFocusGained message is received by menu. + * Should be called only from HandleWsEvent. + */ + void HandleFocusGainedL(); + + /** + * Called when application is sent to foreground. + * Should be called only from HandleWsEvent. + */ + void HandleFullOrPartialForegroundGainedL(); + + /** + * Called when application is sent to background. + * Should be called only from HandleWsEvent. + */ + void HandleFullOrPartialForegroundLostL(); + + /** + * Called when EFocusLost message is received by menu. + * Should be called only from HandleWsEvent. + */ + void HandleFocusLostL(); + + /** + * Detects when options menu pops up and hides. + */ + void DetectOptionsMenuOpenDisplayChangeL(); + +private: // Data + + /** + * Grid's Container Widget. + * Own. + */ + //CMmWidgetContainer* iGridContainer; + + /** + * List's Container Widget. + * Own. + */ + //CMmWidgetContainer* iListboxContainer; + + /** + * Current visible Widget. + * Not own. + */ + CMmWidgetContainer* iCurrentContainer; + + /** + * Hash map containig widget containers, with corresponding + * suite id. + */ + RHashMap< TInt, CMmWidgetContainer* > iContainerMap; + + /** + * Array of container pointers, whose deletion should + * be delayed. + */ + RPointerArray< CMmWidgetContainer > iGarbage; + + /** + * Current suite model + * Not own. + */ + CHnSuiteModel* iCurrentSuiteModel; + + /** + * Hierarchy Navigator + * Own. + */ + CHnInterface* iHNInterface; + + /** + * Hash map for dynamic initialization of cascade menu panes. + * Contains item iterator pointers indexed with cascade pane resource IDs. + * MHnMdMenuItemIterator items not owned. + */ + RHashMap<TInt, MHnMenuItemModelIterator*> iCascadeMenuMap; + + /** + * Indicates the edit mode status. + */ + TEditModeStatus iEditModeStatus; + + /** + * Pointer to application's custom toolbar. + * Own. + */ + CAknToolbar* iToolbar; + + /** + * Index of dragged item. + */ + TInt iItemDragged; + + /** + * Model ID of the dragged item. + */ + TInt iIdDragged; + + /** + * Locks select events for highlight based scrolling. + */ + TBool iKeyClickLocked; + + /** + * Indicates if TAT/Kastor effect is started. + */ + TBool iIsKastorEffectStarted; + + /** + * Extension manager. + * Own. + */ + CMMExtensionManager* iMmExtManager; + + /** + * Sliding keyboard (flip) status + */ + EPSHWRMFlipStatus iKeyboardFlipStatus; + + /** + * Slider event subscriber + * own + */ + CMmPropertySubscriber* iSliderEventSubscriber; + + /** + * Current zoom; + */ + TAknUiZoom iZoom; + + /** + * Screen state. + */ + TBool iScreenOn; + + /** + * Skin change needed + */ + TBool iSkinChangeNeeded; + + /** + * Template library. + */ + CMmTemplateLibrary* iTemplateLibrary; + + /** + * Skin server session. + */ + RAknsSrvSession iSkinSrvSession; + + /** + * Skin change in progress + */ + TBool iSkinChangeInProgress; + + /** + * Widget container that contains only an empty listbox. + * It is displayed only when there is no other container that + * could be displayed. It is needed to avoid ugly flicker + * effects where homescreen becomes visible for a fraction of + * second. + */ + CMmWidgetContainer* iDummyContainer; + + /** + * A template library for iDummyContainer; + */ + CMmTemplateLibrary* iDummyTemplateLib; + + /** + * Out-of-memory condition handler. + */ + CMmNoMemory* iOutOfMemoryHandler; + + /** + * This flag is intended for indicating that the highlithted item must + * be fully visible. It is only used in two cases: + * 1. When an item has been drag-and-dropped into a folder (the item + * moved into the folder must be fully visible when the target suite + * is displayed). + * 2. When turning on edit mode (the item highlighted must be fully + * visible once edit mode is turned on). + */ + TBool iMakeHightlightedItemFullyVisible; + + /** + * An low priority active object used as a helper to detect frequent and + * quick appkey pressing. + * Owns. + */ + CMmAppkeyHandler* iAppkeyHandler; + + /** + * ETrue if Matrix menu has focus i.e. it is in foreground and is not eclipsed + * by any popup note that is not originating from Matrix menu. + */ + TBool iHasFocus; + + /** + * Own. + * Popup menu displayed after long tap. + */ + CAknStylusPopUpMenu* iPopupMenu; + + /** + * Application UI factory for this app UI object. + */ + MEikAppUiFactory* iAppUiFactory; + + /** + * ETrue if Options menu is open. + */ + TBool iOptionsMenuIsOpen; + + }; + +#endif // C_MMAPPUI_H + +// End of File + diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/inc/mmdocument.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/inc/mmdocument.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Application Document class +* +*/ + + +#ifndef C_MMDOCUMENT_H +#define C_MMDOCUMENT_H + +// INCLUDES +#include <AknDoc.h> + +// FORWARD DECLARATIONS +class CMmAppUi; +class CEikApplication; + +/** + * @ingroup group_matrixmenu + * Matrix Menu Application Document. + * AVKON Application Document class. + * + * @since S60 v5.0 + */ +NONSHARABLE_CLASS(CMmDocument) : public CAknDocument + { + +public: // Constructors and destructor + + /** + * Two-phased constructor. + * Construct a CMatrixMenuDocument for the AVKON application aApp + * using two phase construction, and return a pointer + * to the created object. + * + * @since S60 v5.0 + * @param aApp Application creating this document. + * @return A pointer to the created instance of CMmDocument. + */ + static CMmDocument* NewL( CEikApplication& aApp ); + + /** + * Two-phased constructor. + * Construct a CMatrixMenuDocument for the AVKON application aApp + * using two phase construction, and return a pointer + * to the created object. + * + * @since S60 v5.0 + * @param aApp Application creating this document. + * @return A pointer to the created instance of CMmDocument. + */ + static CMmDocument* NewLC( CEikApplication& aApp ); + + /** + * Virtual Destructor. + * + * @since S60 v5.0 + */ + virtual ~CMmDocument(); + +public: // Functions from base classes + + /** + * From CEikDocument, CreateAppUiL. + * Create a CMmAppUi object and return a pointer to it. + * The object returned is owned by the Uikon framework. + * + * @since S60 v5.0 + * @return Pointer to created instance of AppUi. + */ + CEikAppUi* CreateAppUiL(); + +private: // Constructors + + /** + * 2nd phase constructor. + * + * @since S60 v5.0 + */ + void ConstructL(); + + /** + * C++ default constructor. + * + * @since S60 v5.0 + * @param aApp Application creating this document. + */ + CMmDocument( CEikApplication& aApp ); + + }; + +#endif // C_MMDOCUMENT_H + +// End of File diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/inc/mmgui.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/inc/mmgui.hrh Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2007-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 headers for project matrixmenu +* +*/ + + +#ifndef MMGUI_HRH +#define MMGUI_HRH + +#include "mmguiuid.hrh" + +/** + * matrixmenu enumerate command codes. + * + * @since S60 v5.0 + */ +enum TMmOptionsMenuIds + { + EMmOptionsExit = 0x6001 // start value must not be 0 + }; + +/** + * Toolbar button control IDs. + * + * @since S60 v5.0 + */ +enum TMmToolbarControlIds + { + // zero based indices to bind button IDs to their positions on toolbar, + // now we can query HN for a button model using this enumeration + EMmToolbarControl1 = 0, + EMmToolbarControl2, + EMmToolbarControl3 + }; + +#endif // MMGUI_HRH diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/inc/mmguiconstants.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/inc/mmguiconstants.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2007-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: Constants for the matrixmenu +* +*/ + + +#ifndef MMGUICONSTANTS_H +#define MMGUICONSTANTS_H + +#include "mmguiuid.hrh" + +// UID for the application, +// this should correspond to the uid defined in the mmp file +const TUid KUidMatrixMenuApp = { _MATRIX_UID3 }; + +// fixed menu items position multiplier +const TInt KMenuPosMultiplier( 100 ); +// supported number of buttons in toolbar +const TInt KNumOfButtonsInToolbar( 3 ); + +// used for exiting Matrix +const TInt KPhoneAppUid( 0x100058B3 ); + +// EMHU-7KW9WM +const TInt KVideoCallAppUid( 0x101F8681 ); +// used for initializing Matrix +_LIT8( KParamSuiteName8, "suite_name" ); +_LIT ( KParamFolderSuite, "foldersuite" ); +_LIT8( KParamFolderId8, "folder_id" ); +_LIT8( KParamRemoveLocked8, "remove_locked" ); +const TInt32 KParamFolderId( 1 ); +_LIT8( KParamMoveLocked8, "move_locked" ); +_LIT ( KParamFalse, "false" ); + +#endif // MMGUICONSTANTS_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/inc/mmguiuid.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/inc/mmguiuid.hrh Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2007-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: UID of the application +* +*/ + + +#ifndef MMGUIUID_HRH +#define MMGUIUID_HRH + +#define _MATRIX_UID3 0x101F4CD2 + +#endif // MMGUIUID_HRH diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/inc/mmnomemory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/inc/mmnomemory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,72 @@ +/* +* 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: Subscribes properties from P&S +* +*/ + +#ifndef CMMNOMEMORY_H +#define CMMNOMEMORY_H + +#include <e32base.h> // For CActive, link against: euser.lib + +/** + + * An active object for generating a message. + * + * It generates an appropriate message for user + * when Matrix Menu is out of memory. + * + * @since S60 v5.0 + * @ingroup group_matrixmenu + */ +NONSHARABLE_CLASS( CMmNoMemory ) : public CActive + { +public: + ~CMmNoMemory(); + + static CMmNoMemory* NewL(); + + static CMmNoMemory* NewLC(); + +public: + // New functions + + /* + * Submit a service request. + * It completes on iStatus to generate an event. + */ + void Start(); + +private: + CMmNoMemory(); + + void ConstructL(); + +private: + // From CActive + + /** + * Handle completion. + * It leaves (KErrNoMemory) to generate an appropriate message. + */ + void RunL(); + + void DoCancel(); + + TInt RunError(TInt aError); + +private: + }; + +#endif // CMMNOMEMORY_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/inc/mmpropertysubscriber.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/inc/mmpropertysubscriber.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,85 @@ +/* +* 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: Subscribes properties from P&S + * +*/ + +#ifndef MMPROPERTYSUBSCRIBER_H +#define MMPROPERTYSUBSCRIBER_H + +#include <e32base.h> // For CActive, link against: euser.lib +#include <e32property.h> +// Observer for property change. Currently integer value supported +class MMmPropertyChangeObserver + { +public: + virtual void PropertyChangedL(TInt aValue)=0; + }; + +/** +* Subcribes property from P&S and listen property changes +* +* @lib xn3layoutengine.lib +* @since Series 60 5.0 +*/ +NONSHARABLE_CLASS( CMmPropertySubscriber ) : public CActive + { +public: + // Cancel and destroy + ~CMmPropertySubscriber(); + + /** + * Two-phased constructor. + * @param aUid P&S property category + * @param aKey P&S property key + * @param aObserver Given property change observer + */ + static CMmPropertySubscriber* NewL( + const TUid aUid, + const TUint32 aKey, + MMmPropertyChangeObserver& aObserver); + + /** + * Two-phased constructor. + * @param aUid P&S property category + * @param aKey P&S property key + * @param aObserver Given property change observer + */ + static CMmPropertySubscriber* NewLC( + const TUid aUid, + const TUint32 aKey, + MMmPropertyChangeObserver& aObserver); + +private: + // C++ constructor + CMmPropertySubscriber(MMmPropertyChangeObserver& aObserver); + + // Second-phase constructor + void ConstructL(const TUid aUid,const TUint32 aKey); + +private: // From CActive + // Handle completion + void RunL(); + + // How to cancel me + void DoCancel(); + +private: + //Observer for property changes + MMmPropertyChangeObserver& iPropertyChangeObserver; + // Property to listen + RProperty iProperty; + }; + +#endif // MMPROPERTYSUBSCRIBER_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/inc/mymenudebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/inc/mymenudebug.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2007-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: debug constants definitions +* +*/ + + +#ifndef MYMENUDEBUG_H +#define MYMENUDEBUG_H + +// MACROS +#define APPEND_TO_DEBUG_FILE + +// CONSTANTS +_LIT(KDebugDirName, "menu"); +_LIT(KDebugFileName, "matrixmenu.txt"); + +#endif // MYMENUDEBUG_H + +// End of File diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/loc/matrix_menu.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/loc/matrix_menu.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2007-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: Localization strings for project matrixmenu +* +*/ + + + +CHARACTER_SET UTF8 + +//d: Title of the main view (root suite). +//d: Displayed in Status Pane. +//l: title_pane_t2/opt9 +//r: 1.0 +#define qtn_menu_title "Menu" + +//d: Title of a root folder in Edit Mode. +//d: Displayed in Status Pane. +//l: title_pane_t2/opt9 +//r: 1.0 +#define qtn_org_root_editing_title "Organizing 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" + +//d: Label of the menu item. +//d: Opens selected item. +//l: list_single_pane_t1_cp2 +//r: 1.0 +#define qtn_menu_open "Open" + +//d: Label of the menu item. +//d: Displayed when we are in grid and list wiev is available. +//l: list_single_graphic_pane_t1_cp2 +//r: 1.0 +#define qtn_skins_list_appshell_list "Change to list" + +//d: Label of the menu item. +//d: Displayed when we are in list and grid wiev is available. +//l: list_single_graphic_pane_t1_cp2 +//r: 1.0 +#define qtn_skins_list_appshell_grid "Change to grid" + +//d: Label of the submenu item. +//d: Enables the item to be moved using rocker keys. +//l: list_single_popup_submenu_pane_t1 +//r: 1.0 +#define qtn_options_sub_org_move "Move" + +//d: Label of the submenu item. +//d: Opens "Move to folder" dialog. +//l: list_single_popup_submenu_pane_t1 +//r: 1.0 +#define qtn_options_sub_org_move_to_folder "Move to folder" + +//d: Label of the submenu item. +//d: Displays "New Folder" dialog. +//l: list_single_popup_submenu_pane_t1 +//r: 1.0 +#define qtn_options_sub_org_new_folder "New folder" + +//d: Label of the submenu item. +//d: Deletes an empty folder or uninstalls an application. +//l: list_single_popup_submenu_pane_t1 +//r: 1.0 +#define qtn_options_sub_delete "Delete" + +//d: Label of the submenu item. +//d: Renames an existing folder. +//l: list_single_popup_submenu_pane_t1 +//r: 1.0 +#define qtn_options_sub_rename "Rename" + +//d: Label of the menu item. +//d: Starts edit mode. +//l: list_single_pane_t1_cp2 +//r: 1.0 +#define qtn_menu_organize "Edit" + +//d: Label of the menu item. +//d: Opens "Move to folder" dialog in non-touch. +//l: list_single_pane_t1_cp2 +//r: 1.0 +#define qtn_sub_options_org_move_to_folder "Move to folder" + +//d: Label of the submenu item. +//d: Opens "Move to folder" dialog in touch Edit Mode. +//l: list_single_pane_t1_cp2 +//r: 1.0 +#define qtn_popup_options_move_to_folder "Move to folder" + +//d: Text of the message. +//d: Displayed if an item already stored in selected folder. +//l: popup_note_window +//r: 1.0 +#define qtn_apps_note_item_already_stored "Item already stored in selected folder" + +//d: Summary of the item moving. +//d: Displayed after successful move. +//d: %0U - name of the moved item, %1U - name of the destination folder. +//l: popup_note_window +//r: 1.0 +#define qtn_apps_note_move_to_folder "'%0U' moved to '%1U'" + +//d: Default text of the empty folder. +//d: Displayed when empty folder is open. +//l: main_list_empty_pane +//r: 1.0 +#define qtn_menu_empty_folder "Empty folder" + diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/rom/matrixmenu.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/rom/matrixmenu.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image description file for project matrixmenu +* +*/ + + +#ifndef MATRIXMENU_IBY +#define MATRIXMENU_IBY + +#include <data_caging_paths_for_iby.hrh> + +S60_APP_EXE( matrixmenu ) +data=DATAZ_\RESOURCE_FILES_DIR\apps\matrixmenu.mif RESOURCE_FILES_DIR\apps\matrixmenu.mif + +S60_UPGRADABLE_APP_REG_RSC ( matrixmenu ) + +// Backup registration +data=DATAZ_\private\101F4CD2\backup_registration.xml private\101F4CD2\backup_registration.xml + +#endif // MATRIXMENU_IBY diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/rom/matrixmenu_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/rom/matrixmenu_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image description file for project matrixmenu +* +*/ + + +#ifndef MATRIXMENURESOURCES_IBY +#define MATRIXMENURESOURCES_IBY + +#include <bldvariant.hrh> + +S60_APP_RESOURCE( matrixmenu ) + +#endif // MATRIXMENURESOURCES_IBY + +// End of File diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/src/mmappkeyhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/src/mmappkeyhandler.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,110 @@ +/* +* 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: Application UI class +* Version : %version: 2 % << Don't touch! Updated by Synergy at check-out. +* +*/ + +#include "mmappkeyhandler.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmAppkeyHandler::CMmAppkeyHandler() : + CActive(EPriorityIdle) // Standard priority + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmAppkeyHandler* CMmAppkeyHandler::NewLC() + { + CMmAppkeyHandler* self = new (ELeave) CMmAppkeyHandler(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmAppkeyHandler* CMmAppkeyHandler::NewL() + { + CMmAppkeyHandler* self = CMmAppkeyHandler::NewLC(); + CleanupStack::Pop(); // self; + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppkeyHandler::ConstructL() + { + CActiveScheduler::Add(this); // Add to scheduler + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmAppkeyHandler::~CMmAppkeyHandler() + { + Cancel(); // Cancel any request, if outstanding +// Delete instance variables if any + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppkeyHandler::DoCancel() + { +// no implementation. + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppkeyHandler::StartL() + { + Cancel(); //just in case + iStatus = KRequestPending; + SetActive(); // Tell scheduler a request is active + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppkeyHandler::RunL() + { +// do nothing + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmAppkeyHandler::RunError(TInt aError) + { + return aError; + } diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/src/mmapplication.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/src/mmapplication.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Application class +* +*/ + + +// INCLUDE FILES + +#include "mmgui.hrh" +#include "mmdocument.h" +#include "mmapplication.h" +#include "mmguiconstants.h" + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CApaDocument* CMmApplication::CreateDocumentL() + { + // Create a Matrix Menu document, and return a pointer to it + return ( static_cast<CApaDocument*> + ( CMmDocument::NewL( *this ) ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TUid CMmApplication::AppDllUid() const + { + // Return the UID for the Matrix Menu application + return KUidMatrixMenuApp; + } + +// End of File diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/src/mmappui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/src/mmappui.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,3130 @@ +/* +* 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: Application UI class +* Version : %version: MM_176.1.28.1.52 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_176.1.28.1.52 % << Don't touch! Updated by Synergy at check-out. +* +*/ + +#include <e32base.h> +#include <e32cmn.h> +#include <avkon.hrh> +#include <avkon.rsg> +#include <akntitle.h> +#include <eikmenub.h> +#include <akntoolbar.h> +#include <aknbutton.h> +#include <e32hashtab.h> +#include <layoutmetadata.cdl.h> +#include <gulicon.h> +#include <fbs.h> +#include <eikcmbut.h> +#include <hlplch.h> +#include <aknlists.h> +#include <StringLoader.h> +#include <activeidle2domainpskeys.h> +#include <UikonInternalPSKeys.h> +#include <e32property.h> +#include <AknTaskList.h> +#include <AknSgcc.h> // for transition effects +#include <featmgr.h> +#include <matrixmenu.rsg> +#include <akntabgrp.h> +#include <apgcli.h> +#include <hwrmdomainpskeys.h> //flip status enums +#include <AknDef.hrh> +#include <AknDlgShut.h> +#include <mmenuinternalPSkeys.h> +#include <aknstyluspopupmenu.h> //stylus popup for long tap event + +#include "mmgui.hrh" +#include "mmguiconstants.h" +#include "mmappui.h" +#include "menudebug.h" +#include "hnengine.h" +#include "hnglobals.h" +#include "hnsuitemodelcontainer.h" +#include "hnmenuitemmodel.h" +#include "hntoolbarmodel.h" +#include "hnbuttonmodel.h" +#include "hnitemmodel.h" +#include "hnconvutils.h" +#include "hnsuitemodel.h" +#include "hnmdbasekey.h" +#include "hnmdkeyfactory.h" +#include "mmwidgetcontainer.h" +#include "mmtemplatelibrary.h" +#include "mmextensionmanager.h" +#include "mmpropertysubscriber.h" +#include "hnitemsorder.h" + +#include "mmnomemory.h" +#include "mmappkeyhandler.h" + +enum TMenuTransEffectContext + { + EMenuOpenFolderEffect = 1001, + EMenuCloseFolderEffect = 1002 + }; + +// ============================ MEMBER FUNCTIONS ============================= + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::ConstructL() + { + DEBUG(("_Mm_:CMmAppUi::ConstructL IN")); + MMPERF(("Test Logger speed...")); + MMPERF(("Test Logger speed - DONE")); + MMPERF(("GO!")); + + //set matrix to be system app + iEikonEnv->SetSystem( ETrue ); + + TInt appUiFlags = AknLayoutUtils::PenEnabled() ? + EAknEnableSkin | EAknSingleClickCompatible : + EAknEnableSkin | EAknEnableMSK; + BaseConstructL( appUiFlags ); + iAppUiFactory = CEikonEnv::Static()->AppUiFactory( *this ); + ASSERT( iAppUiFactory ); + + FeatureManager::InitializeLibL(); + iIsKastorEffectStarted = EFalse; + StartLayoutSwitchFullScreen( AknTransEffect::EApplicationStart ); + + RefreshUiPanesL( ETrue ); + Cba()->MakeVisible( EFalse ); + StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL ); + + iDummyTemplateLib = CMmTemplateLibrary::NewL(); + iDummyContainer = CMmWidgetContainer::NewGridContainerL( ClientRect(), + this, iDummyTemplateLib ); + iDummyContainer->SetEmptyTextL( KNullDesC ); + AddToStackL( iDummyContainer, ECoeStackPriorityDefault, + ECoeStackFlagRefusesFocus | ECoeStackFlagRefusesAllKeys ); + iDummyContainer->MakeVisible( ETrue ); + iDummyContainer->DrawNow(); + + iHNInterface = CHnEngine::NewL( *this ); + iTemplateLibrary = CMmTemplateLibrary::NewL(); + InitializeL(); + + iMmExtManager = CMMExtensionManager::NewL( *this ); + + iKeyboardFlipStatus = EPSHWRMFlipStatusUninitialized; + iSliderEventSubscriber = CMmPropertySubscriber::NewL(KPSUidHWRM, + KHWRMFlipStatus, *this); + + iScreenOn = ETrue; + iSkinChangeNeeded = EFalse; + iSkinChangeInProgress = EFalse; + iHasFocus = ETrue; + + iSkinSrvSession.Connect(this); + iAppkeyHandler = CMmAppkeyHandler::NewL(); + iOptionsMenuIsOpen = EFalse; + + RProperty::Define( KMMenuPSCat, KMMenuLastViewKey, RProperty::EText ); + + MMPERF(("CMmAppUi::ConstructL - HN ready")); + DEBUG(("_Mm_:CMmAppUi::ConstructL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CMmAppUi::IsRootdisplayedL() + { + TBool ret( EFalse ); + if( iHNInterface && iHNInterface->GetSuiteModelsCountL() == KModelCountForRoot ) + { + ret = ETrue; + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmAppUi::CMmAppUi() + { + // No implementation required + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmAppUi::~CMmAppUi() + { + DEBUG(("_Mm_:CMmAppUi::~CMmAppUi IN")); + + delete iOutOfMemoryHandler; + if (iCurrentSuiteModel) + { + iCurrentSuiteModel->UnregisterSuiteObserver( this ); + } + delete iToolbar; + iCascadeMenuMap.Close(); + RemoveFromStack( iCurrentContainer ); + RemoveFromStack( iDummyContainer ); + iDummyContainer->MakeVisible( EFalse ); + delete iDummyContainer; + ResetContainerMap(); + iGarbage.ResetAndDestroy(); + delete iHNInterface; + FeatureManager::UnInitializeLib(); + delete iMmExtManager; + delete iSliderEventSubscriber; + delete iTemplateLibrary; + delete iDummyTemplateLib; + delete iAppkeyHandler; + delete iPopupMenu; + iSkinSrvSession.Close(); + + MMPERF(("Matrix closed")); + DEBUG(("_Mm_:CMmAppUi::~CMmAppUi OUT")); + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleResourceChangeL( TInt aType ) + { + CAknAppUi::HandleResourceChangeL( aType ); + + //we're interested in layout change events + //only if container is available + if ( aType == KEikDynamicLayoutVariantSwitch && + iCurrentContainer && iCurrentSuiteModel ) + { + MMPERF(("Layout change START")); + // Do not call StartLayoutSwitchFullScreen(), + // layout switch effect is started automatically + iIsKastorEffectStarted = ETrue; + TInt lastItemIndex = iCurrentContainer->NumberOfItems() - 1; + + TBool makeLastItemVisible = lastItemIndex >= 0 && + iCurrentContainer->ItemIsFullyVisible( lastItemIndex ); + + iCurrentContainer->SetRect( ClientRect() ); + iDummyContainer->SetRect( ClientRect() ); + + // This fixes a problem (view scrolled one row up) that occurs when + // switching from portrait to landscape orientation with scrollbar + // in bottom position. + if ( makeLastItemVisible ) + { + iCurrentContainer->Widget()->View()->SetTopItemIndex( + iCurrentContainer->Widget()->View()-> + CalcNewTopItemIndexSoItemIsVisible( lastItemIndex ) ); + } + + THashMapIter< TInt, CMmWidgetContainer* > iterator( iContainerMap ); + while( iterator.NextKey() ) + { + CMmWidgetContainer* container = *iterator.CurrentValue(); + if ( container != iCurrentContainer ) + { + container->SetRect( ClientRect() ); + container->HandleResourceChange( aType ); + } + } + ShowSuiteL(); + EndFullScreen(); + MMPERF(("Layout change END")); + } + + if ( aType == KEikMessageFadeAllWindows && iCurrentContainer ) + { + iCurrentContainer->SetIsFaded( ETrue ); + } + else if ( aType == KEikMessageUnfadeWindows && iCurrentContainer ) + { + iCurrentContainer->SetIsFaded( EFalse ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CMmAppUi::ProcessCommandParametersL( TApaCommand aCommand, + TFileName& aDocumentName, + const TDesC8& aTail ) + { + DEBUG(("_Mm_:CMmAppUi::ProcessCommandParametersL IN")); + DEBUG8(("\t_Mm_:tail: %S", &aTail)); + + if ( aTail.Length() ) + { + DEBUG(("\t_Mm_:call HandleMessageL")); + HandleMessageL( aTail ); + } + + TBool result = CEikAppUi::ProcessCommandParametersL( aCommand, + aDocumentName, + aTail ); + + MMPERF(("Matrix started and ready!")); + DEBUG(("_Mm_:CMmAppUi::ProcessCommandParametersL OUT")); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::ProcessCommandL(TInt aCommand) + { + TBool ignoreCommand = EFalse; + + // ignore options click in edit mode and intermediate states for non-touch + if ( aCommand == EAknSoftkeyOptions && iEditModeStatus != ENoEditMode && + !AknLayoutUtils::PenEnabled() ) + { + ignoreCommand = ETrue; + } + + // ignore keyselect for non-touch while in edit mode or stopping edit mode + if ( aCommand == KKeyIdSelect && !AknLayoutUtils::PenEnabled() && + ( iEditModeStatus == ETransitionFromEditMode || IsEditMode() ) ) + { + ignoreCommand = ETrue; + } + + if ( !ignoreCommand ) + { + CAknAppUi::ProcessCommandL( aCommand ); + } + + if (iCurrentContainer && iCurrentContainer == TopFocusedControl() ) + { + iCurrentContainer->HandleTopFocusL(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::ProcessMessageL( TUid /*aUid*/, const TDesC8& aParams ) + { + DEBUG(("_Mm_:CMmAppUi::ProcessMessageL IN")); + DEBUG8(("\t_Mm_:params: %S", &aParams)); + MMPERF(("APA Message Recieved")); + + // fix for the CR 417-35490 + // Handle empty message sends by AVKON after app key press or switch + // to Menu via task swapper. + if( !aParams.Compare( KNullDesC8 ) ) + { + if ( !iAppkeyHandler->IsActive() ) + { + CleanupForExitL( EExitKeyApplication ); + User::LeaveIfError( iCoeEnv->WsSession().SetWindowGroupOrdinalPosition( + CEikonEnv::Static()->RootWin().Identifier(), 0 ) ); + iAppkeyHandler->StartL(); + } + } + + // first refresh model, show afterwords + if ( aParams.Length() ) + { + DEBUG(("\t_Mm_:call HandleMessageL")); + HandleMessageL( aParams ); + } + + MMPERF(("APA Message Processed")); + DEBUG(("_Mm_:CMmAppUi::ProcessMessageL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +MCoeMessageObserver::TMessageResponse CMmAppUi::HandleMessageL( + TUint32 aClientHandleOfTargetWindowGroup, + TUid aMessageUid, + const TDesC8& aMessageParameters ) + { + if ( aMessageUid.iUid == KUidApaMessageSwitchOpenFileValue ) + { + ProcessMessageL( aMessageUid, aMessageParameters ); + return EMessageHandled; + } + else + { + return CAknAppUi::HandleMessageL( + aClientHandleOfTargetWindowGroup, + aMessageUid, + aMessageParameters ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleCommandL( TInt aCommand ) + { + DEBUG(("_Mm_:CMmAppUi::HandleCommandL IN")); + DEBUG(("\t_Mm_:aCommand: %d",aCommand)); + + // in case something has gone wrong + ClearTransitionFromEditModeFlag(); + + switch( aCommand ) + { + case EEikCmdExit: + { + DEBUG(("\t_Mm_:EEikCmdExit")); + // Simply exit + Exit(); + } + break; + + case EMmOptionsExit: + { + MMPERF(("Options->Exit pressed")); + DEBUG(("\t_Mm_:EMmOptionsExit")); + + //Check if it is a folder suite.If Yes really exit. + //Otherwise behave like LSK. + if( iCurrentSuiteModel && + iCurrentSuiteModel->SuiteName().Compare( KFolderSuite) ) + { + if( iCurrentSuiteModel->ExitMode() == EExitModeHide ) + { + // hide and reset menu + TApaTaskList taskList( iCoeEnv->WsSession() ); + TApaTask me = taskList.FindApp( KUidMatrixMenuApp ); + me.SendToBackground(); + CleanupForExitL( EExitKeyApplication ); + } + else + { + StartLayoutSwitchFullScreen( EMenuCloseFolderEffect ); + HandleBackCommandL(); + } + } + else + { + ExitMatrix( EExitReally ); + } + } + break; + + case EAknSoftkeyExit: + { + MMPERF(("SoftkeyExit pressed")); + DEBUG(("\t_Mm_:EAknSoftkeyExit")); + ExitMatrix( EExitToPhone ); + } + break; + + case EAknSoftkeyBack: + { + StartLayoutSwitchFullScreen( EMenuCloseFolderEffect ); + + if( iCurrentSuiteModel && iCurrentSuiteModel->ExitMode() == EExitModeHide ) + { + // hide and reset menu + TApaTaskList taskList( iCoeEnv->WsSession() ); + TApaTask me = taskList.FindApp( KUidMatrixMenuApp ); + me.SendToBackground(); + if ( iCurrentContainer ) + { + iCurrentContainer->MakeVisible( EFalse ); + } + iDummyContainer->MakeVisible( ETrue ); + RefreshCbaL(); + iDummyContainer->DrawNow(); + CleanupForExitL( EExitKeyApplication ); + } + else if( iCurrentSuiteModel ) + { + HandleBackCommandL(); + } + } + break; + + case EAknSoftkeyOk: + case EAknSoftkeyDone: + { + ASSERT( IsEditMode() ); + SetEditModeL( EFalse ); + } + break; + default: + { + ForwardEventToHNL( aCommand ); + } + break; + } + DEBUG(("_Mm_:CMmAppUi::HandleCommandL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleBackCommandL() + { + DEBUG(("_Mm_:CMmAppUi::HandleBackCommandL IN")); + MMPERF(("CMmAppUi::HandleBackCommandL - START")); + DEBUG16(("\t_Mm_:current genre: %S",&iCurrentSuiteModel->SuiteName())); + + iDummyContainer->MakeVisible( ETrue ); + RefreshUiPanesL( ETrue ); + iCurrentContainer->MakeVisible( EFalse ); + iDummyContainer->DrawNow(); + + iHNInterface->HandleBackEventL( iCurrentSuiteModel->SuiteName() ); + + MMPERF(("CMmAppUi::HandleBackCommandL - DONE")); + DEBUG(("_Mm_:CMmAppUi::HandleBackCommandL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmWidgetContainer* CMmAppUi::GetAppropriateContainerToLoadL() + { + CMmWidgetContainer* retContainer = NULL; + if ( iCurrentSuiteModel ) + { + TInt currentSuiteId = iCurrentSuiteModel->GetItemsOrder()->GetSuiteId(); + + CMmWidgetContainer** ret = iContainerMap.Find( currentSuiteId ); + retContainer = (ret) ? *ret : NULL; + + if ( ret && (*ret)->WidgetType() != iCurrentSuiteModel->WidgetType() ) + { + iMakeHightlightedItemFullyVisible = ETrue; + iGarbage.AppendL( *ret ); + iContainerMap.Remove( + iCurrentSuiteModel->GetItemsOrder()->GetSuiteId() ); + retContainer = NULL; + } + } + return retContainer; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::ShowSuiteL() + { + DEBUG(("_Mm_:CMmAppUi::ShowSuiteL IN")); +// DEBUG16(("\t_Mm_:current genre: %S", &iCurrentSuiteModel->SuiteName())); + + if ( iCurrentSuiteModel ) + { + CMmWidgetContainer* containerToLoad = GetAppropriateContainerToLoadL(); + TBool makeHandlePresentationChange( ETrue ); + + if (!containerToLoad) + { + makeHandlePresentationChange = CreateNewContainerL( + iCurrentSuiteModel, containerToLoad ); + } + + if( makeHandlePresentationChange ) + { + HandlePresentationChangeL( containerToLoad ); + } + } + + DEBUG(("_Mm_:CMmAppUi::ShowSuiteL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CMmAppUi::CreateNewContainerL( + CHnSuiteModel* aSuiteModel, CMmWidgetContainer*& aContainerToLoad ) + { + TRect rect = ClientRect(); + switch( aSuiteModel->WidgetType() ) + { + case ECoverFlowWidget : + case EGridWidget : + aContainerToLoad = CMmWidgetContainer::NewGridContainerL( + rect, this, iTemplateLibrary ); + break; + case EListWidget : + aContainerToLoad = CMmWidgetContainer::NewListBoxContainerL( + rect, this, iTemplateLibrary ); + break; + case EUnspecified: + default: + return EFalse; + } + aContainerToLoad->SetLongTapObserver(this); + aContainerToLoad->HandleItemAdditionL(); + iContainerMap.InsertL( + aSuiteModel->GetItemsOrder()->GetSuiteId(), + aContainerToLoad ); + return ETrue; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::ForwardEventToHNL( TInt aEvent, TInt aItemId, + CLiwGenericParamList* aEventParams ) + { + DEBUG(("\t_Mm_:event ID: %d for item ID %d", aEvent, aItemId)); + + TInt id = iCurrentSuiteModel->IdByIndex( aItemId ); + if ( id >= 0 ) + { + MMPERF(("Handling event %d for item %d - START",aEvent,aItemId)); + + if( aEvent == KKeyIdSelect ) + { + MMPERF(("This is a 'select' event")); + + TInt modelId = iCurrentSuiteModel->IdByIndex( aItemId ); + CHnItemModel* itemModel = + iCurrentSuiteModel->GetItemModel( modelId ); + TInt effect = GetKastorEffectL( itemModel ); + TRect rect = GetKastorRectL( itemModel, aItemId ); + TUid appUid = itemModel->GetItemType() == EItemTypeApplication ? + itemModel->GetItemUid() : KUidMatrixMenuApp; + + if (iScreenOn && IsForeground() && effect + != AknTransEffect::ENone) + { + DEBUG(("_MM_:CMmAppUi::ForwardEventToHNL Foreground")); + GfxTransEffect::BeginFullScreen( + effect, rect, + AknTransEffect::EParameterType, + AknTransEffect::GfxTransParam( appUid ) ); + } + } + + iHNInterface->TriggerHnEventL( aEvent, id, aEventParams ); + MMPERF(("Handling event - END")); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmAppUi::GetKastorEffectL( CHnItemModel* aItemModel ) + { + 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: + { + effect = EMenuCloseFolderEffect; + iIsKastorEffectStarted = ETrue; + break; + } + case EItemTypeFolder: + { + if (!(IsEditMode() && aItemModel->IsDeleteLocked())) + { + effect = EMenuOpenFolderEffect; + iIsKastorEffectStarted = ETrue; + } + break; + } + case EItemTypeUnknown: + default: + { + effect = AknTransEffect::ENone; + break; + } + } + return effect; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TRect CMmAppUi::GetKastorRectL( CHnItemModel* aItemModel, TInt aItemId ) + { + TRect rect = TRect(); + if( aItemModel->GetItemType() == EItemTypeApplication ) + { + rect = iCurrentContainer->GetItemRectL( aItemId ); + RRegion region; CleanupClosePushL( region ); + StatusPane()->GetShapeL( region, true, true ); + TInt statusPaneHeight = region.BoundingRect().Height(); + rect.iBr.iY += statusPaneHeight; + rect.iTl.iY += statusPaneHeight; + CleanupStack::PopAndDestroy( ®ion ); + } + return rect; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::ForwardEventToHNL( TInt aEvent ) + { + DEBUG(("_Mm_:CMmAppUi::ForwardEventToHNL IN")); + DEBUG(("\t_Mm_:event ID: %d", aEvent)); + + if ( iCurrentContainer ) + { + TBool idByContainer = iCurrentContainer->IsHighlightVisible() && + iCurrentContainer->GetSuiteModelL()->GetItemModelsCount() > 1; + TInt current = idByContainer ? + iCurrentContainer->GetHighlight() : KErrNotFound; + ForwardEventToHNL( aEvent, current ); + } + + DEBUG(("_Mm_:CMmAppUi::ForwardEventToHNL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::NotifyUiRefreshL( const THnUiRefreshType aRefreshType ) + { + DEBUG(("_Mm_:CMmAppUi::NotifyUiRefreshL IN")); + DEBUG(("\t_Mm_:refresh type: %d", aRefreshType)); + + switch (aRefreshType) + { + case ERefreshSuite: + TRAPD( err, ShowSuiteL() ); + if ( KErrNoMemory == err ) + { + HandleOutOfMemoryL(); + User::Leave( KErrNoMemory ); + } + break; + case ERefreshToolbar: + RefreshToolbarL(); + break; + case EStartEditMode: + SetEditModeL( ETrue ); + break; + case EStopEditMode: + SetEditModeL( EFalse ); + break; + case EZoomLarge: + SetZoom( EAknUiZoomLarge ); + break; + case EZoomSmall: + SetZoom( EAknUiZoomSmall ); + break; + case EZoomNormal: + SetZoom( EAknUiZoomNormal ); + break; + case EForegroundGain: + { + DEBUG(("_MM_:CMmAppUi::NotifyUiRefreshL Foreground")); + TApaTaskList taskList( iCoeEnv->WsSession() ); + TApaTask me = taskList.FindApp( KUidMatrixMenuApp ); + me.BringToForeground(); + } + break; + case EBackgroundGain: + { + DEBUG(("_MM_:CMmAppUi::NotifyUiRefreshL Foreground")); + TApaTaskList taskList( iCoeEnv->WsSession() ); + TApaTask me = taskList.FindApp( KUidMatrixMenuApp ); + me.SendToBackground(); + } + break; + case ELightOn: + { + DEBUG(("_Mm_:CMmAppUi::NotifyUiRefreshL - ELightOn")); + iScreenOn = ETrue; + if ( IsForeground() && iCurrentSuiteModel ) + { + iCurrentSuiteModel->SetVisibleL( ETrue ); + } + if ( iCurrentContainer ) + { + iCurrentContainer->HandleForegroundGainedL(); + } + } + break; + case ELightOff: + { + DEBUG(("_Mm_:CMmAppUi::NotifyUiRefreshL - ELightOff")); + iScreenOn = EFalse; + if (iCurrentContainer) + { + iCurrentContainer->HandleBackgroundGainedL(); + if (IsEditMode() && iCurrentContainer->IsDraggable()) + { + iCurrentContainer->CancelDragL(EFalse); + } + } + if (iCurrentSuiteModel) + { + iCurrentSuiteModel->SetVisibleL(EFalse); + } + if( iMmExtManager ) + { + iMmExtManager->ExecuteActionL(TUid::Null(), KCommandDeleteDialog, NULL ); + } + } + break; + case ERemoveLiwObjects: + { + THashMapIter< TInt, CMmWidgetContainer* > iterator( iContainerMap ); + while( iterator.NextKey() ) + { + CMmWidgetContainer** container = iterator.CurrentValue(); + (*container)->RemoveLiwObjects(); + } + } + break; + default: + ASSERT( false ); + } + DEBUG(("_Mm_:CMmAppUi::NotifyUiRefreshL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::RefreshToolbarL() + { + DEBUG(("_Mm_:CMmAppUi::RefreshToolbarL IN")); + HandleToolbarVisibilityL(); + UpdateToolbarL(); + DEBUG(("_Mm_:CMmAppUi::RefreshToolbarL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::RefreshUiPanesL( TBool aReset ) + { + // refresh status pane + CAknTitlePane* titlePane = + static_cast<CAknTitlePane*>( + StatusPane()->ControlL( + TUid::Uid( EEikStatusPaneUidTitle ) ) ); + + if( aReset ) + { + titlePane->SetTextL( KNullDesC ); + } + else + { + if ( IsEditMode() && iCurrentSuiteModel ) + { + HBufC* title = NULL; + if ( IsRootdisplayedL() ) + { + title = StringLoader::LoadLC( R_ORG_ROOT_EDITING_TITLE ); + } + else + { + title = StringLoader::LoadLC( + R_ORG_FOLDER_EDITING_TITLE, + iCurrentSuiteModel->Title() ); + } + ASSERT( title ); + titlePane->SetTextL( title->Des() ); + CleanupStack::PopAndDestroy( title ); + } + else if ( iCurrentSuiteModel && iCurrentContainer ) + { + // refresh status pane + titlePane->SetTextL( iCurrentSuiteModel->Title() ); + + // inform AVKON about current suite to allow proper handling + // of AppKey and FSW + RProperty::Set( KMMenuPSCat, KMMenuLastViewKey, iCurrentSuiteModel->SuiteName() ); + } + else + { + titlePane->SetTextL( KNullDesC ); + } + } + + RefreshCbaL(); + SetMiddleSoftKeyL(); + + StatusPane()->DrawNow(); + Cba()->DrawNow(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::RefreshCbaL() + { + if ( ( iDummyContainer && iDummyContainer->IsVisible() ) || + !iCurrentSuiteModel ) + { + // R_MENU_SOFTKEYS_EMPTY__EMPTY looks much better than + // R_AVKON_SOFTKEYS_EMPTY + Cba()->SetCommandSetL( R_MENU_SOFTKEYS_EMPTY__EMPTY ); + } + else + { + if ( IsEditMode() ) + { + Cba()->SetCommandSetL( AknLayoutUtils::PenEnabled() ? + R_AVKON_SOFTKEYS_OPTIONS_DONE : + R_AVKON_SOFTKEYS_OK_EMPTY__OK ); + } + else if ( IsRootdisplayedL() ) + { + Cba()->SetCommandSetL( AknLayoutUtils::PenEnabled() ? + R_AVKON_SOFTKEYS_OPTIONS_EXIT : + R_AVKON_SOFTKEYS_OPTIONS_EXIT__SELECT ); + } + else if ( iCurrentSuiteModel && + iCurrentSuiteModel->SuiteName().Compare(KParamFolderSuite) ) + { + Cba()->SetCommandSetL( AknLayoutUtils::PenEnabled() ? + R_MENU_SOFTKEYS_OPTIONS_BEXIT : + R_MENU_SOFTKEYS_OPTIONS_BEXIT__SELECT ); + } + else + { + Cba()->SetCommandSetL( AknLayoutUtils::PenEnabled() ? + R_AVKON_SOFTKEYS_OPTIONS_BACK : + R_AVKON_SOFTKEYS_OPTIONS_BACK__SELECT ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TKeyResponse CMmAppUi::HandleKeyPressedL( const TKeyEvent &aKeyEvent, + TEventCode aType ) + { + TKeyResponse resp = EKeyWasNotConsumed; + + // handling enter key - touch & non touch + if ( ( aKeyEvent.iScanCode == EStdKeyEnter || + aKeyEvent.iScanCode == EStdKeyNkpEnter || + aKeyEvent.iScanCode == EStdKeyDevice3 ) && aType == EEventKeyDown ) + { + if ( iCurrentContainer->IsHighlightVisible() ) + { + DEBUG(("_Mm_:CMmAppUi::HandleKeyPressedL - enter")); + ForwardEventToHNL( KKeyIdSelect ); + resp = EKeyWasConsumed; + } + } + + //handling enter key - non touch / edit mode + if ( ( aKeyEvent.iScanCode == EStdKeyEnter || + aKeyEvent.iScanCode == EStdKeyDevice3 ) && + aType == EEventKeyDown && + IsEditMode() && !Layout_Meta_Data::IsPenEnabled() ) + { + DEBUG(("_Mm_:CMmAppUi::HandleKeyPressedL - enter in edit mode")); + HandleCommandL( EAknSoftkeyOk ); + resp = EKeyWasConsumed; + } + + // handle the key exactly as container does (the same conditions) + if ( ( aKeyEvent.iRepeats > 0 && aType == EEventKey ) || + ( aKeyEvent.iRepeats == 0 && aType == EEventKeyUp ) ) + { + TBool navigationEvent = + aKeyEvent.iScanCode == EStdKeyRightArrow || + aKeyEvent.iScanCode == EStdKeyLeftArrow || + aKeyEvent.iScanCode == EStdKeyUpArrow || + aKeyEvent.iScanCode == EStdKeyDownArrow; + + if ( navigationEvent ) + { + DEBUG(("_Mm_:CMmAppUi::HandleKeyPressedL - navi event: %d", + aKeyEvent.iScanCode)); + MMPERF(("Rocker navigation - START")); + UpdateToolbarL(); + SetMiddleSoftKeyL(); + resp = EKeyWasConsumed; + MMPERF(("Rocker navigation - END")); + } + else if ( aKeyEvent.iScanCode == EStdKeyBackspace ) + { + // handle clear key event + DEBUG(("_Mm_:CMmAppUi::HandleKeyPressedL - clear key")); + ForwardEventToHNL( KKeyIdClear ); + resp = EKeyWasConsumed; + } + } + + if( aType == EEventUser ) + { + if ( aKeyEvent.iScanCode == EStdKeyNull && + iCurrentContainer->IsHighlightVisible() ) + { + DEBUG(("_Mm_:CMmAppUi::HandleKeyPressedL - User press -> forward key:select to HN")); + UpdateToolbarL(); + SetMiddleSoftKeyL(); + ForwardEventToHNL( KKeyIdSelect ); + resp = EKeyWasConsumed; + } + } + + return resp; + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +void CMmAppUi::HandleDragStartL( TInt aModelItemIndex ) + { + MMPERF(("CMmAppUi::HandleDragStartL - START")); + + if ( IsEditMode() ) + { + + TInt modelId = iCurrentSuiteModel->IdByIndex( aModelItemIndex ); + if (modelId != KErrNotFound) + { + CHnItemModel *itModel = iCurrentSuiteModel->GetItemModel( modelId ); + if (itModel->GetItemType() == EItemTypeParentFolder) + { + iCurrentContainer->CancelDragL( EFalse ); + } + else + { + iItemDragged = aModelItemIndex; + iIdDragged = iCurrentSuiteModel->IdByIndex( aModelItemIndex ); + } + } + } + MMPERF(("CMmAppUi::HandleDragStartL - STOP")); + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +void CMmAppUi::HandleDragOverL( TInt /* aModelItemIndex */ ) + { + MMPERF(("CMmAppUi::HandleDragOverL - START")); + + MMPERF(("CMmAppUi::HandleDragOverL - STOP")); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmAppUi::HandleDraggedIndexUpdatedL( TInt aModelItemIndex ) + { + MMPERF(("CMmAppUi::HandleDraggedIndexUpdatedL - START")); + iItemDragged = aModelItemIndex; + MMPERF(("CMmAppUi::HandleDraggedIndexUpdatedL - STOP")); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmAppUi::HandleDragStopL( TInt aModelItemIndex ) + { + MMPERF(("CMmAppUi::HandleDragStopL - START")); + 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; + + TBuf8< KMaxLength > beforeCustomId; + beforeCustomId.Num( KErrNotFound ); + if ( aModelItemIndex + 1 < iCurrentContainer->NumberOfItems() ) + { + beforeCustomId.Num( iCurrentSuiteModel->GetItemModel( + iCurrentSuiteModel->IdByIndex( aModelItemIndex + 1 ) )->CustomId() ); + } + + TBuf8< KMaxLength > draggedCustomId; + draggedCustomId.Num( KErrNotFound ); + CHnItemModel* draggedModel = iCurrentSuiteModel->GetItemModel( iIdDragged ); + if (draggedModel) + { + draggedCustomId.Num( iCurrentSuiteModel->GetItemModel( iIdDragged )->CustomId() ); + } + + CLiwGenericParamList* eventParameters = CLiwGenericParamList::NewL(); + CleanupStack::PushL( eventParameters ); + CHnMdBaseKey* tempKeys = HnMdKeyFactory::CreateL( + HnEvent::KEventArgNamespace8(), KKeyTypeMap(), KNullDesC8() ); + CleanupStack::PushL( tempKeys ); + + CHnMdBaseKey* baseKey = HnMdKeyFactory::CreateL( + HnEvent::KEventArgNamespace8(), KKeyTypeMap(), KNullDesC8() ); + CleanupStack::PushL( baseKey ); + baseKey->AddSubKeyL( HnMdKeyFactory::CreateL( HnEvent::KDroppedBefore8(), + KKeyTypeInteger(), beforeCustomId ) ); + baseKey->AddSubKeyL( HnMdKeyFactory::CreateL( HnEvent::KDragged8(), + KKeyTypeInteger(), draggedCustomId ) ); + CleanupStack::Pop( baseKey ); + tempKeys->AddSubKeyL( baseKey ); + + tempKeys->ToGenericParamListL( *eventParameters ); + CleanupStack::PopAndDestroy( tempKeys ); + + if ( iIdDragged != itemId + && isOverFolder && !isDeleteLocked) + { + iCurrentSuiteModel->RemoveItemL( iIdDragged ); + if ( iItemDragged < aModelItemIndex ) + { + // indices of all items after iItemDragged have been + // decreased when the dragged item got removed from the + // current suite; prevent highlighted item change + iCurrentSuiteModel->SetSuiteHighlightL( aModelItemIndex - 1 ); + iCurrentContainer->SetManualHighlightL( + iCurrentContainer->GetHighlight() - 1, EFalse ); + } + + iCurrentContainer->HandleItemRemovalL(); + iCurrentContainer->CancelDragL( EFalse ); + + if( typeCurr == EItemTypeParentFolder ) + { + StartLayoutSwitchFullScreen( EMenuCloseFolderEffect ); + } + else + { + StartLayoutSwitchFullScreen( EMenuOpenFolderEffect ); + } + iHNInterface->TriggerHnEventL( KKeyIdMoveInto, itemId, eventParameters ); + iMakeHightlightedItemFullyVisible = ETrue; + } + else if ( iIdDragged == itemId ) + { + iCurrentContainer->CancelDragL( ETrue ); + TBool result = iHNInterface->TriggerHnEventL( KKeyIdMove, 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); + } + } + else + { + iCurrentContainer->CancelDragL( ETrue ); + if (!AknLayoutUtils::PenEnabled()) + { + CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC(); + TLiwGenericParam command(KHnRequest, TLiwVariant( KEvaluateMdModel)); + paramList->AppendL(command); + HandleRequestL(*paramList); + CleanupStack::PopAndDestroy(paramList); + } + } + + CleanupStack::PopAndDestroy( eventParameters ); + } + MMPERF(("CMmAppUi::HandleDragStopL - STOP")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleEventDraggingActionedL() + { + SetMiddleSoftKeyL(); + UpdateToolbarL(); + iKeyClickLocked = ETrue; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleListBoxEventL( CEikListBox* /*aListBox*/, + MEikListBoxObserver::TListBoxEvent aEventType ) + { + DEBUG(("_Mm_:CMmAppUi::HandleListBoxEventL IN")); + DEBUG(("\t_Mm_: aEventType = %d", (TInt) aEventType ) ); + + TInt currentHighlight = iCurrentContainer->GetHighlight(); + + DEBUG(("\t_Mm_: CurrentHighlight = %d", currentHighlight ) ); + + if ( aEventType == MEikListBoxObserver::EEventItemDraggingActioned ) + { + DEBUG8(("\t_Mm_:CMmAppUi::HandleListBoxEventL EEventItemDraggingActioned")); + HandleEventDraggingActionedL(); + } + else if ( aEventType == MEikListBoxObserver::EEventPenDownOnItem ) + { + DEBUG(("\t_Mm_:CMmAppUi::HandleListBoxEventL EEventItemClicked")); + HandleHighlightItemPenDownL( iCurrentContainer->GetHighlight() ); + } + else if ( aEventType == MEikListBoxObserver::EEventItemDoubleClicked ) + { + DEBUG(("\t_Mm_:CMmAppUi::HandleListBoxEventL EEventItemDoubleClicked")); + HandleHighlightItemDoubleClickedL( iCurrentContainer->GetHighlight() ); + } + else if ( aEventType == MEikListBoxObserver::EEventItemSingleClicked ) + { + DEBUG(("\t_Mm_:CMmAppUi::HandleListBoxEventL EEventItemSingleClicked")); + HandleHighlightItemSingleClickedL( iCurrentContainer->Widget()->CurrentItemIndex() ); + } + else if ( aEventType == MEikListBoxObserver::EEventPanningStarted ) + { + iKeyClickLocked = ETrue; + } + + DEBUG(("_Mm_:CMmAppUi::HandleListBoxEventL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleLongTapEventL( const TPoint& aPenEventLocation ) + { + TBool popupMenuDisplayed(EFalse); + if (iPopupMenu) + { + delete iPopupMenu; + iPopupMenu = NULL; + } + iPopupMenu = CAknStylusPopUpMenu::NewL(this,aPenEventLocation); + + if ( AknLayoutUtils::LayoutMirrored() ) + { + iPopupMenu->SetPosition( aPenEventLocation, + CAknStylusPopUpMenu::EPositionTypeRightBottom ); + } + else + { + iPopupMenu->SetPosition( aPenEventLocation, + CAknStylusPopUpMenu::EPositionTypeLeftBottom ); + } + + 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(); + + 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<TInt> positionArray; + CleanupClosePushL( positionArray ); + RHashMap<TInt, CEikMenuPaneItem::SData> 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; + + positionArray.AppendL( childItem->Position() ); + menuItemMap.InsertL( childItem->Position(), childData ); + } + + 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 ); + } + + if (positionArray.Count()>0) + { + iPopupMenu->ShowMenu(); + popupMenuDisplayed = ETrue; + } + CleanupStack::PopAndDestroy( &menuItemMap ); + CleanupStack::PopAndDestroy( &positionArray ); + } + MMPERF(("CMmAppUi::DynInitMenuPaneL - STOP")); + } + + if ( !popupMenuDisplayed && iCurrentContainer + && iCurrentContainer == TopFocusedControl() ) + { + iCurrentContainer->HandleTopFocusL( EFalse ); + HandleHighlightItemSingleClickedL( + iCurrentContainer->Widget()->CurrentItemIndex() ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleHighlightItemDoubleClickedL( TInt aIndex ) + { + if ( iKeyClickLocked ) + return; + + if ( iCurrentSuiteModel->WidgetType() == EListWidget + && iCurrentContainer->GetPreviousHighlight() == aIndex ) + { + ForwardEventToHNL( KKeyIdSelect, aIndex ); + } + else if ( iCurrentSuiteModel->WidgetType() == EGridWidget && FlipOpen() ) + { + ForwardEventToHNL( KKeyIdSelect, aIndex ); + } + else if ( iCurrentSuiteModel->WidgetType() == EGridWidget + && IsEditMode() && iCurrentContainer->GetPreviousHighlight() == aIndex + && !iCurrentContainer->IsDraggable()) + { + ForwardEventToHNL( KKeyIdSelect, aIndex ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleHighlightItemPenDownL( TInt /* aIndex */ ) + { + DEBUG(("CMmAppUi::HandleHighlightItemPenDownL - IN")); + UpdateToolbarL(); + SetMiddleSoftKeyL(); + iKeyClickLocked = EFalse; + DEBUG(("CMmAppUi::HandleHighlightItemPenDownL - OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleHighlightItemSingleClickedL( TInt aIndex ) + { + if ( !iKeyClickLocked && !IsFaded() ) + { + ForwardEventToHNL( KKeyIdSelect, aIndex ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::ResetContainerMap() + { + THashMapIter< TInt, CMmWidgetContainer* > iterator( iContainerMap ); + while( iterator.NextKey() ) + { + CMmWidgetContainer** container = iterator.CurrentValue(); + delete *container; + iterator.RemoveCurrent(); + } + iContainerMap.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::ResetContainerMapToRootL() + { + TInt err( KErrNone ); + CHnSuiteModel* currentSuite = iHNInterface->GetLastSuiteModelL(); + + // there is a loaded suite configuration + if( currentSuite ) + { + TInt id( currentSuite->GetItemsOrder()->GetSuiteId() ); + TRAP( err, iCurrentContainer = iContainerMap.FindL( id ) ); + + // configuration loaded but there is no container + if( err != KErrNone ) + { + HandleSuiteModelInitializedL( currentSuite ); + } + else if( iContainerMap.Count() > 0 ) + { + THashMapIter< TInt, CMmWidgetContainer* > iterator( iContainerMap ); + while( iterator.NextKey() ) + { + CMmWidgetContainer** container = iterator.CurrentValue(); + if( iCurrentContainer != *container ) + { + RemoveFromStack( *container ); + iGarbage.AppendL( *container ); + iterator.RemoveCurrent(); + } + } + } + } + else + { + ResetContainerMap(); + InitializeL(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleMessageL( const TDesC8& aMessage ) + { + if ( IsEditMode() ) + { + SetEditModeL( EFalse ); + } + + if ( aMessage.Find( KRootWithPref ) != KErrNotFound ) + { + RemoveFromStack( iCurrentContainer ); + iDummyContainer->MakeVisible( ETrue ); + RefreshCbaL(); + iGarbage.ResetAndDestroy(); + ResetContainerMap(); + iCurrentSuiteModel = NULL; + iCurrentContainer = NULL; + } + + TRAPD( err, iHNInterface->LoadSuitesFromUriL( aMessage ) ); + + if ( err && iCurrentContainer && ( aMessage.Find( KSetFocusWithPref ) == KErrNotFound ) ) + { + HandleSuiteEventL( ESuiteModelInitialized, iHNInterface->GetLastSuiteModelL() ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + aMenuPane->EnableMarqueeL( ETrue ); + if( iCurrentSuiteModel == iHNInterface->GetLastSuiteModelL() ) + { + switch ( aResourceId ) + { + case R_MAIN_MENU_PANE: + { + MMPERF(("CMmAppUi::DynInitMenuPaneL - START")); + //fill the main menu structure, look for cascade menus + //reset the helper hash map + iCascadeMenuMap.Close(); + + MHnMenuItemModelIterator* menuIterator = NULL; + TBool ignoreItemSpecific( EFalse ); + if ( iCurrentSuiteModel ) + { + TInt itemId( KErrNotFound ); + TBool suiteModelHasItems = iCurrentContainer->GetSuiteModelL()->GetItemModelsCount() > 1; + 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 ); + } + menuIterator = iCurrentSuiteModel->GetMenuStructureL( itemId ); + } + + // check if there is a menu structure available + // for the specified item + if ( menuIterator ) + { + //create item sorting helper objects + RArray<TInt> positionArray; + CleanupClosePushL( positionArray ); + RHashMap<TInt, CEikMenuPaneItem::SData> menuItemMap; + CleanupClosePushL( menuItemMap ); + + //get original (rss defined) items positions + for ( TInt i = 0; i < aMenuPane->NumberOfItemsInPane(); ++i ) + { + //multiply to make space for suite defined entries + //first item has 100th conceptual position + positionArray.AppendL( ( i + 1 ) * KMenuPosMultiplier ); + //store items, position as the key + menuItemMap.InsertL( ( i + 1 ) * KMenuPosMultiplier, + aMenuPane-> + ItemData( aMenuPane->MenuItemCommandId( i ) ) ); + } + + //get custom menu items and their positions + while ( menuIterator->HasNext() ) + { + CHnMenuItemModel* menuItem = menuIterator->GetNext(); + if ( !menuItem->IsItemSpecific() || !ignoreItemSpecific ) + { + 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 ); + } + } + + aMenuPane->Reset(); + positionArray.Sort(); + + //add items in correct order + for ( TInt i = 0; i < positionArray.Count(); ++i ) + { + aMenuPane-> + AddMenuItemL( + ( menuItemMap.FindL( positionArray[i] ) ) ); + } + + CleanupStack::PopAndDestroy( &menuItemMap ); + CleanupStack::PopAndDestroy( &positionArray ); + } + MMPERF(("CMmAppUi::DynInitMenuPaneL - STOP")); + } + break; + + case R_CASCADE_MENU_PANE_1: + case R_CASCADE_MENU_PANE_2: + case R_CASCADE_MENU_PANE_3: + { + //realod cascade menu map + ReloadCascadeMenuMapL(); + //fill the cascade menu panes + MHnMenuItemModelIterator* childIteratorPtr = + iCascadeMenuMap.FindL( aResourceId ); + + // check if child iterator available + if ( childIteratorPtr ) + { + childIteratorPtr->Reset(); + + //create item sorting helper objects + RArray<TInt> positionArray; + CleanupClosePushL( positionArray ); + RHashMap<TInt, CEikMenuPaneItem::SData> menuItemMap; + CleanupClosePushL( menuItemMap ); + + while ( childIteratorPtr->HasNext() ) + { + CHnMenuItemModel* childItem = childIteratorPtr->GetNext(); + + 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.Sort(); + //add items in correct order + for ( TInt i = 0; i < positionArray.Count(); ++i ) + { + aMenuPane->AddMenuItemL( + ( menuItemMap.FindL( positionArray[i] ) ) ); + } + + CleanupStack::PopAndDestroy( &menuItemMap ); + CleanupStack::PopAndDestroy( &positionArray ); + } + } + break; + + default: + break; + } + } + else if( aResourceId == R_MAIN_MENU_PANE ) + { + aMenuPane->SetItemDimmed( EMmOptionsExit, ETrue ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::ReloadCascadeMenuMapL() + { + iCascadeMenuMap.Close(); + MHnMenuItemModelIterator* menuIterator = NULL; + if ( iCurrentSuiteModel ) + { + TBool idByContainer = iCurrentContainer->IsHighlightVisible() && + iCurrentContainer->GetSuiteModelL()->GetItemModelsCount() > 1; + TInt itemId = idByContainer ? + iCurrentSuiteModel->IdByIndex( iCurrentContainer->GetHighlight() ) : + iCurrentSuiteModel->IdByIndex( KErrNotFound ); + menuIterator = iCurrentSuiteModel->GetMenuStructureL( itemId ); + } + + if ( menuIterator ) + { + while ( menuIterator->HasNext() ) + { + CHnMenuItemModel* menuItem = menuIterator->GetNext(); + + MHnMenuItemModelIterator* childIterator = + menuItem->GetMenuStructure(); + if ( childIterator->HasNext() ) + { + TInt freeResource = GetNextCascadeMenuResourceId(); + if ( freeResource != KErrNotFound ) + { + iCascadeMenuMap.Insert( freeResource, childIterator ); + } + } + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmAppUi::GetNextCascadeMenuResourceId() + { + //if needed add additional placeholders in matrixmenu.rss + //next add additional cases in this method and the + //CMmAppUi::DynInitMenuPaneL + + TInt freeResource( KErrNotFound ); + switch ( iCascadeMenuMap.Count() ) + { + case 0: + { + freeResource = R_CASCADE_MENU_PANE_1; + } + break; + case 1: + { + freeResource = R_CASCADE_MENU_PANE_2; + } + break; + case 2: + { + freeResource = R_CASCADE_MENU_PANE_3; + } + break; + default: + break; + } + return freeResource; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleWidgetChangeRefreshL( + CMmWidgetContainer* aWidgetContainer ) + { + DEBUG(("_Mm_:CMmAppUi::HandleWidgetChangeRefreshL IN")); + + CMmWidgetContainer* previousContainer = iCurrentContainer; + if (previousContainer) + { + previousContainer->SetObserver(NULL); + RemoveFromStack(previousContainer); + } + + iCurrentContainer = aWidgetContainer; + iCurrentContainer->Widget()->View()->SetDisableRedraw(ETrue); + iDummyContainer->MakeVisible( ETrue ); + RefreshCbaL(); + iCurrentContainer->SetZoom( iZoom ); + iCurrentContainer->SetFlipOpenL( FlipOpen() ); + iCurrentContainer->SetEditModeL( IsEditMode() ); + iCurrentContainer->SetSuiteModelL( iCurrentSuiteModel ); + iCurrentContainer->HandleResourceChange( KAknsMessageSkinChange ); + iCurrentContainer->HandleResourceChange( KUidValueCoeColorSchemeChangeEvent ); + iCurrentContainer->SetEmptyTextL( iCurrentSuiteModel->EmptyText() ); + iCurrentContainer->SetHasFocusL( iHasFocus ); + iCurrentContainer->SetIsFaded( IsFaded() ); + iCurrentContainer->SetObserver( this ); + + if ( previousContainer && previousContainer->WidgetType() != iCurrentContainer->WidgetType() + && previousContainer->GetSuiteModelL() == iCurrentContainer->GetSuiteModelL() ) + { + iCurrentSuiteModel->SetSuiteHighlightL( KErrNotFound ); + } + + AddToStackL( iCurrentContainer ); + if ( previousContainer ) + { + previousContainer->MakeVisible( EFalse ); + } + + DEBUG(("_Mm_:CMmAppUi::HandleWidgetChangeRefreshL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleNoWidgetChangeRefreshL() + { + if ( iCurrentSuiteModel ) + { + iCurrentContainer->Widget()->View()->SetDisableRedraw(ETrue); + iCurrentContainer->SetZoom( iZoom ); + iCurrentContainer->SetFlipOpenL( FlipOpen() ); + iCurrentContainer->SetEditModeL( IsEditMode() ); + iCurrentContainer->SetSuiteModelL( iCurrentSuiteModel ); + iCurrentContainer->SetEmptyTextL( iCurrentSuiteModel->EmptyText() ); + iCurrentContainer->SetHasFocusL( iHasFocus ); + iCurrentContainer->SetIsFaded( IsFaded() ); + iCurrentContainer->SetObserver(this); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CMmAppUi::IsEditMode() + { + return (iEditModeStatus == EEditMode + || iEditModeStatus == ETransitionToEditMode); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandlePresentationChangeL( + CMmWidgetContainer* aWidgetContainer ) + { + DEBUG(("_Mm_:CMmAppUi::HandlePresentationChangeL IN")); + + if ( iToolbar && iToolbar->IsShown() ) + { + iToolbar->SetToolbarVisibility( EFalse ); + } + + if( iCurrentContainer != aWidgetContainer ) + { + if( iCurrentContainer && aWidgetContainer && + iCurrentContainer->WidgetType() != aWidgetContainer->WidgetType() ) + { + StartLayoutSwitchFullScreen(); + } + HandleWidgetChangeRefreshL( aWidgetContainer ); + } + else + { + HandleNoWidgetChangeRefreshL(); + } + + if( iCurrentContainer ) + { + iCurrentContainer->SetRect(ClientRect()); + iDummyContainer->SetRect(ClientRect()); + if( IsForeground() ) + { + // should be called before MakeVisible (and after SetRect or SetupLayout, + // so that default highlight is displayed correctly when zoomed) + ApplyHighlightFromModelL(); + + // There is defferences in code because behaviour in non-touch edit mode + // and non-touch edit mode is different. + if (!AknLayoutUtils::PenEnabled()) + { + // While starting non-touch edit mode we have to scroll view in case when + // higlighted item is placed on top/bottow row of view and there + // are more rows over/under one to show all needed indicator arrows. + // DrawNow() method caused jumping both scrollbar and view to old positions. + iCurrentContainer->MakeVisible(ETrue); + iCurrentContainer->Widget()->View()->SetDisableRedraw(EFalse); + iCurrentContainer->SetEditModeL(IsEditMode()); + iDummyContainer->MakeVisible(EFalse); + } + else + { + // For touch normal mode we have to redraw container in case + // we back "parent folder" which was edited in edit mode. + // Thanks to DrawNow() method we avoid drawing items's backdrop icons + // and switching between edit mode's and normal mode's views + iCurrentContainer->SetEditModeL(IsEditMode()); + iCurrentContainer->MakeVisible(ETrue); + + // cache widget position so that we can restore it after DrawNow(), which + // changes it for no apparent reason when using list view. + iCurrentContainer->CacheWidgetPosition(); + + // draw container before effects gets snapshot + iCurrentContainer->DrawNow(); + iCurrentContainer->Widget()->View()->SetDisableRedraw(EFalse); + iDummyContainer->MakeVisible(EFalse); + + // restore the correct widget position + iCurrentContainer->RestoreWidgetPosition(); + } + + // refresh changed items only + iCurrentContainer->DrawView(); + RefreshUiPanesL(); + RefreshToolbarL(); + } + else + { + iCurrentContainer->SetupWidgetLayoutL(); + iCurrentContainer->Widget()->View()->SetDisableRedraw( EFalse ); + ApplyHighlightFromModelL(); + } + } + + MMPERF(("CMmAppUi::HandlePresentationChangeL - model swapped")); + DEBUG(("_Mm_:CMmAppUi::HandlePresentationChangeL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::OfferToolbarEventL( TInt aCommand ) + { + TInt itemId = iCurrentSuiteModel->IdByIndex( iCurrentContainer->GetHighlight() ); + CHnItemModel* itemModel = iCurrentSuiteModel->GetItemModel( itemId ); + ASSERT( itemModel ); + const CHnToolbarModel* toolbarModel = itemModel->GetToolbarModel(); + ASSERT( toolbarModel ); + const CHnButtonModel* buttonModel = toolbarModel->GetButton( aCommand ); + ASSERT( buttonModel ); + + ForwardEventToHNL( buttonModel->GetEventId() ); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmAppUi::ExecuteExtensionActionL( const TUid aUid , const TDesC& aCommand, + CLiwGenericParamList* aEventParamList ) + { + return iMmExtManager->ExecuteActionL( aUid, aCommand, aEventParamList); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleToolbarVisibilityL() + { + TBool suiteModelHasToolbar = + iCurrentSuiteModel && iCurrentSuiteModel->HasToolbar(); + + if ( suiteModelHasToolbar ) + { + if ( iToolbar ) + { + // could have gotten hidden during view change + iToolbar->SetToolbarVisibility( ETrue ); + } + else + { + iToolbar = CAknToolbar::NewL( R_GLOBAL_TOOLBAR ); + iToolbar->SetToolbarObserver( this ); + iToolbar->SetToolbarVisibility( ETrue ); + + // substract the toolbar from display's visible area + TRect remainingArea( ClientRect() ); + if ( !Layout_Meta_Data::IsLandscapeOrientation() ) + remainingArea.Resize( 0, -iToolbar->Size().iHeight ); + iCurrentContainer->SetRect( remainingArea ); + } + } + else if ( !suiteModelHasToolbar && iToolbar ) + { + iToolbar->SetToolbarVisibility( EFalse ); + delete iToolbar; + iToolbar = NULL; + iCurrentContainer->SetRect( ClientRect() ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::UpdateToolbarL() + { + // drop toolbar handling if there should be none + if ( iToolbar && iCurrentSuiteModel->HasToolbar() ) + { + iToolbar->RemoveItem( EMmToolbarControl1 ); + iToolbar->RemoveItem( EMmToolbarControl2 ); + iToolbar->RemoveItem( EMmToolbarControl3 ); + + TInt itemId = iCurrentSuiteModel->IdByIndex( iCurrentContainer->Widget()->CurrentItemIndex() ); + CHnItemModel* itemModel = iCurrentSuiteModel->GetItemModel( itemId ); + if ( !itemModel ) + { + return; + } + const CHnToolbarModel* toolbarModel = itemModel->GetToolbarModel(); + + CAknButton* button( NULL ); + for ( TInt i = 0; i < KNumOfButtonsInToolbar; ++i ) + { + const CHnButtonModel* buttonModel = toolbarModel->GetButton( i ); + // get button icon and help text from model + if ( buttonModel ) + { + CGulIcon* originalIcon = buttonModel->GetIcon(); + CGulIcon* iconCopy( NULL ); + if ( originalIcon && originalIcon->Bitmap() ) + { + // create a copy of the icon if exists, + // CAknButton takes ownership of the icon but we + // want to reuse it, + // also duplicate bitmaps for proper scaling + CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; + CleanupStack::PushL( bitmap ); + bitmap->Duplicate( originalIcon->Bitmap()->Handle() ); + + CFbsBitmap* mask( NULL ); + if ( originalIcon->Mask() ) + { + mask = new (ELeave) CFbsBitmap; + CleanupStack::PushL( mask ); + mask->Duplicate( originalIcon->Mask()->Handle() ); + } + + iconCopy = CGulIcon::NewL( bitmap, mask ); + if ( mask ) + { + CleanupStack::Pop( mask ); + } + CleanupStack::Pop( bitmap ); + CleanupStack::PushL( iconCopy ); + } + button = CAknButton::NewL( iconCopy, + NULL, + NULL, + NULL, + KNullDesC, + buttonModel->GetButtonText(), + 0, + 0 ); + if ( iconCopy ) + { + CleanupStack::Pop( iconCopy ); + } + CleanupStack::PushL( button ); + button->SetDimmed( buttonModel->GetDimmed() ); + } + else + { + button = CAknButton::NewLC(); + } + iToolbar->AddItemL( button, + EAknCtButton, + EMmToolbarControl1 + i, + 0 ); + CleanupStack::Pop( button ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::SetEditModeL( TBool aIsEditMode ) + { + MMPERF(("CMmAppUi::SetEditModeL %d - START",aIsEditMode)); + if ( IsEditMode() != aIsEditMode && iCurrentSuiteModel ) + { + + // stops moving items. This must be called when leaving non-touch edit mode to save + // the current visible order of the items. In non-touch it is called only once when completing editing + + iHNInterface->SetEditModeL(aIsEditMode); + iCurrentContainer->StopMovingL(); + + if ( aIsEditMode ) + { + iEditModeStatus = ETransitionToEditMode; + } + else + { + if ( iEditModeStatus == ETransitionToEditMode ) + { + iEditModeStatus = EFastTransitionFromEditMode; + } + else + { + iEditModeStatus = ETransitionFromEditMode; + } + } + + HandleHighlightOffsetL( aIsEditMode ? EOffsetNext : EOffsetPrevious ); + iCurrentSuiteModel->SetSuiteHighlightL( + AdjustEditModeHighlightL( iCurrentSuiteModel->GetSuiteHighlight() ) ); + + // update the container at the end when highlight is proper, + // this will ensure correct focus/unfocus action handling + iCurrentContainer->CacheWidgetPosition(); + iCurrentContainer->SetEditModeL( IsEditMode() ); + + if ( iCurrentContainer->IsHighlightVisible() ) + { + iMakeHightlightedItemFullyVisible = ETrue; + } + + RefreshUiPanesL(); + + //disable redraw so that no redrawing events coming from window server cause redrawing until + //everything is ready to draw. Then iCurrentContainer->DrawNow in HandlePresentationChangeL is called + if (IsEditMode()) + { + iCurrentContainer->Widget()->View()->SetDisableRedraw(ETrue); + } + } + + MMPERF(("CMmAppUi::SetEditModeL - STOP")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* aDestination ) + { + DEBUG(("_Mm_:CMmAppUi::HandleWsEventL %d - IN", aEvent.Type())); + + if ( aEvent.Type() == KAknUidValueEndKeyCloseEvent ) + { + // return when the red key was pressed + MMPERF(("End key pressed")); + DEBUG(("_Mm_:CMmAppUi::HandleWsEventL - End key")); + ExitMatrix( EExitToIdle ); + return; + } + + TEventCode type = static_cast< TEventCode >( aEvent.Type() ); + + if ( ( type == EEventFocusLost || type == KAknFullOrPartialForegroundLost ) + && iCurrentContainer ) + { + iCurrentContainer->CacheWidgetPosition(); + } + + // base's HandleWsEventL needs to be called before foreground handling, + // otherwise the screen saver will be turned off + CAknAppUi::HandleWsEventL( aEvent, aDestination ); + + // refreshes toolbar when pen down event was invoked + if ( type == EEventPointer ) + { + if ( iCurrentSuiteModel ) + { + RefreshToolbarL(); + } + } + else if ( type == EEventFocusGained ) + { + HandleFocusGainedL(); + } + else if ( type == EEventFocusLost ) + { + HandleFocusLostL(); + } + else if ( type == KAknFullOrPartialForegroundGained ) + { + HandleFullOrPartialForegroundGainedL(); + } + else if( type == KAknFullOrPartialForegroundLost ) + { + HandleFullOrPartialForegroundLostL(); + } + + DetectOptionsMenuOpenDisplayChangeL(); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TErrorHandlerResponse CMmAppUi::HandleError(TInt aError, + const SExtendedError& /*aExtErr*/, + TDes& /*aErrorText*/, + TDes& /*aContextText*/ ) + { + if( aError == KErrNoMemory ) + { + TRAP_IGNORE( ResetToInitialStateL( ) ); + } + return EErrorNotHandled; + } + + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleSuiteEventL ( + THnCustomSuiteEvent aCustomSuiteEvent, CHnSuiteModel* aModel ) + { + + DEBUG(("_Mm_:CMmAppUi::HandleSuiteEventL %d - IN",aCustomSuiteEvent)); + switch ( aCustomSuiteEvent ) + { + case ESuitePushedToStack: + { + aModel->RegisterSuiteObserverL( this, EPriorityMuchLess ); + } + break; + case ESuitePoppedFromStack: + { + + } + break; + case ESuiteModelInitialized: + { + HandleSuiteModelInitializedL( aModel ); + } + break; + default: + break; + } + + if ( iCurrentSuiteModel == aModel ) + { + //We are interested in the following event + //only if they come from the current suite. + TBool redraw = (iScreenOn && IsForeground()) ? ETrue : EFalse; + switch (aCustomSuiteEvent) + { + case ESuiteModelDestroyed: + { + iCurrentContainer->PrepareForGarbage(); + iGarbage.AppendL(iCurrentContainer); + iContainerMap.Remove( + iCurrentSuiteModel->GetItemsOrder()->GetSuiteId()); + RemoveFromStack(iCurrentContainer); + iDummyContainer->MakeVisible( ETrue ); + iCurrentContainer->SetObserver(NULL); + iCurrentSuiteModel = NULL; + iCurrentContainer = NULL; + } + break; + case ESuiteItemsAdded: + { + //we need consistent view/state before item is added + //so draggind should be cancelled + if( IsEditMode() && iCurrentContainer->IsDraggable() ) + { + iCurrentContainer->CancelDragL( EFalse ); + iCurrentContainer->DrawNow(); + } + HandleNumberOfItemsChangedL( EItemsAdded ); + } + break; + case ESuiteItemsRemoved: + { + //we need consistent view/state before item is removed + //so draggind should be cancelled + if( IsEditMode() && iCurrentContainer->IsDraggable() ) + { + iCurrentContainer->CancelDragL( EFalse ); + iCurrentContainer->DrawNow(); + } + HandleNumberOfItemsChangedL( EItemsRemoved ); + } + break; + case ESuiteItemsUpdated: + { + ClearTransitionFromEditModeFlag(); + iCurrentContainer->DrawView(); + } + break; + case ESuiteHighlightChanged: + { + iCurrentContainer->SetManualHighlightL( + iCurrentSuiteModel->GetSuiteHighlight(), redraw ); + } + break; + default: + break; + } + } + DEBUG(("_Mm_:CMmAppUi::HandleSuiteEventL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::ClearTransitionFromEditModeFlag() + { + if ( iEditModeStatus == ETransitionFromEditMode || + iEditModeStatus == EFastTransitionFromEditMode ) + { + iEditModeStatus = ENoEditMode; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmAppUi::AdjustEditModeHighlightL( TInt aOriginalHighlight ) + { + if ( AknLayoutUtils::PenEnabled() ) + { + if ( !iCurrentContainer->IsHighlightVisible() + && iEditModeStatus == ETransitionToEditMode ) + { + aOriginalHighlight = KErrNotFound ; + } + } + return aOriginalHighlight; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleOutOfMemoryL() + { + if( !iOutOfMemoryHandler ) + { + iOutOfMemoryHandler = CMmNoMemory::NewL(); + } + iOutOfMemoryHandler->Start(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::ResetToInitialStateL() + { + iDummyContainer->MakeVisible( ETrue ); + iDummyContainer->DrawNow(); + RefreshCbaL(); + + if (iCurrentSuiteModel) + { + iCurrentSuiteModel->UnregisterSuiteObserver( this ); + } + RemoveFromStack( iCurrentContainer ); + ResetContainerMap(); + iGarbage.ResetAndDestroy(); + delete iHNInterface; + iHNInterface = NULL; + delete iMmExtManager; + iMmExtManager = NULL; + delete iSliderEventSubscriber; + iSliderEventSubscriber = NULL; + delete iTemplateLibrary; + iTemplateLibrary = NULL; + + iCurrentSuiteModel = NULL; + iCurrentContainer = NULL; + iContainerMap.Close(); + iEditModeStatus = ENoEditMode; + + GfxTransEffect::AbortFullScreen(); + iIsKastorEffectStarted = EFalse; + + RefreshUiPanesL(); + Cba()->MakeVisible( EFalse ); + StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL ); + + iHNInterface = CHnEngine::NewL( *this ); + iTemplateLibrary = CMmTemplateLibrary::NewL(); + InitializeL(); + + iMmExtManager = CMMExtensionManager::NewL( *this ); + + iKeyboardFlipStatus = EPSHWRMFlipStatusUninitialized; + + iScreenOn = ETrue; + iSkinChangeNeeded = EFalse; + iSkinChangeInProgress = EFalse; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleSuiteModelInitializedL( CHnSuiteModel* aModel ) + { + StatusPane()->MakeVisible( ETrue ); + Cba()->MakeVisible( ETrue ); + + if ( aModel == iHNInterface->GetLastSuiteModelL() ) + { + TBool showOpenFolderEffect(iCurrentSuiteModel + && (iCurrentSuiteModel->CustomId() != aModel->CustomId() + || iCurrentSuiteModel->WidgetType() + != aModel->WidgetType())); + if( showOpenFolderEffect ) + { + StartLayoutSwitchFullScreen( EMenuOpenFolderEffect ); + } + + if ( iCurrentSuiteModel ) + { + iCurrentSuiteModel->SetVisibleL( EFalse ); + DEBUG16(("\t\t_Mm_:SetVisible EFalse - %S", + &(iCurrentSuiteModel->SuiteName()))); + } + iCurrentSuiteModel = aModel; + ShowSuiteL(); + iGarbage.ResetAndDestroy(); + + if ( iEditModeStatus == ETransitionToEditMode ) + { + iEditModeStatus = EEditMode; + } + else if ( iEditModeStatus == ETransitionFromEditMode ) + { + iEditModeStatus = ENoEditMode; + } + + if (iScreenOn && IsForeground()) + { + iCurrentSuiteModel->SetVisibleL( ETrue ); + DEBUG16(("\t\t_Mm_:SetVisible ETrue - %S", + &(iCurrentSuiteModel->SuiteName()))); + } + + HideMenuPaneIfVisibleL(); + EndFullScreen(); + } + else + { + if( iHNInterface->SuiteModelLoadedL( + aModel->GetItemsOrder()->GetSuiteId() ) ) + { + CMmWidgetContainer* containerToLoad = NULL; + TBool created( CreateNewContainerL( aModel, containerToLoad ) ); + if( created ) + { + containerToLoad->Widget()->View()->SetDisableRedraw( ETrue ); + containerToLoad->SetFlipOpenL( FlipOpen() ); + containerToLoad->SetEditModeL( IsEditMode() ); + containerToLoad->SetSuiteModelL( aModel ); + containerToLoad->SetEmptyTextL( aModel->EmptyText() ); + containerToLoad->SetObserver( this ); + containerToLoad->SetRect( ClientRect() ); + containerToLoad->MakeVisible( EFalse ); + } + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HideMenuPaneIfVisibleL() + { + if ( iEikonEnv->AppUiFactory()->MenuBar()->IsDisplayed() ) + { + iEikonEnv->AppUiFactory()->MenuBar()->StopDisplayingMenuBar(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::ExitMatrix( TExitType aExitType ) + { + DEBUG(("_Mm_:CMmAppUi::ExitMatrix - IN")); + DEBUG(("\t_Mm_:Exit type: %d",aExitType)); + + if ( aExitType == EExitReally ) + { + // Calling PrepareHomescreenForMatrixExitL instead of ShowHomescreenL + // allows for avoiding a bug that would occur if appkey was pressed + // immediately after exiting the menu via Options->Exit. + // The bug would be that on pressing the appkey homescreen would be + // displayed and then the menu would appear again on the screen for + // a fraction of second causing an ugly and confusing flicker effect. + TRAP_IGNORE( PrepareHomescreenForMatrixExitL() ); +// ShowHomescreenL( aExitType ); + //if we got exit cmd from OS, let's really exit. + Exit(); + } + else + { + GfxTransEffect::AbortFullScreen(); + iIsKastorEffectStarted = EFalse; + StartLayoutSwitchFullScreen( AknTransEffect::EApplicationExit ); + + TRAP_IGNORE( ShowHomescreenL( aExitType ) ); + TRAP_IGNORE( CleanupForExitL( EExitKeyRed ) ); + } + + DEBUG(("_Mm_:CMmAppUi::ExitMatrix - OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::CleanupForExitL( TExitKeyType aExitKey ) + { + DEBUG(("_Mm_:CMmAppUi::CleanupForExitL - IN")); + + // closing all dialogs opened in ui extensions before exit + iMmExtManager->ExecuteActionL( TUid::Null(), KCommandDeleteDialog, NULL ); + if( IsDisplayingDialog() ) + { + AknDialogShutter::ShutDialogsL( *iEikonEnv ); + } + + if ( IsEditMode() && iCurrentContainer ) + { + DEBUG(("\t_Mm_:Edit Mode turned off")); + iCurrentContainer->CancelDragL( EFalse ); + SetEditModeL( EFalse ); + } + + // reset model - revert to root if current view is not a suite view + CHnSuiteModel* model = iHNInterface->GetLastSuiteModelL(); + if ( model && aExitKey == EExitKeyApplication ) + { + TBool topSuiteIsBeingEvaluated = + !model->GetItemsOrder()->IsSuiteReadyToShow(); + TBool topSuiteChanged = ResetToRootL(); + model = NULL; // ResetToRootL might have deleted the model + TBool presentationChangeExpected = topSuiteChanged || topSuiteIsBeingEvaluated; + + TBool mustDrawImmediately = + !presentationChangeExpected || !iDummyContainer->IsVisible(); + + if ( iCurrentContainer && mustDrawImmediately ) + { + DEBUG(("\t_Mm_:Top item index reset")); + iCurrentContainer->ResetWidgetPosition(); + iCurrentContainer->Widget()->UpdateScrollBarsL(); + iCurrentContainer->MakeVisible( ETrue ); + iCurrentContainer->DrawNow(); + } + } + + DEBUG(("_Mm_:CMmAppUi::CleanupForExitL - OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::ShowHomescreenL( TExitType aExitType ) + { + TInt appToShowUid(0); + TInt idleid(0); + if (aExitType == EExitToIdle) + { + User::LeaveIfError(RProperty::Get(KPSUidAiInformation, KActiveIdleUid, + appToShowUid)); + OpenAppL(TUid::Uid(appToShowUid)); + } + else if (KErrNone == RProperty::Get(KPSUidUikon, KUikVideoCallTopApp, + idleid)) + { + // Possible error code not relevant, as we have valid id anyway + if (idleid != KVideoCallAppUid) // idle or phone + { + OpenAppL(TUid::Uid(KPhoneAppUid)); + } + else + { + CreateActivateViewEventL(TVwsViewId(TUid::Uid(idleid), + TUid::Uid(idleid)), KNullUid, KNullDesC8()); + } + } + else + { + OpenAppL(TUid::Uid(KPhoneAppUid)); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::PrepareHomescreenForMatrixExitL() + { + TBool succeeded( EFalse ); + + CAknTaskList* taskList = CAknTaskList::NewL( iCoeEnv->WsSession() ); + TApaTask task = taskList->FindRootApp( TUid::Uid( KPhoneAppUid ) ); + delete taskList; + + if ( task.Exists() ) + { + succeeded = !iCoeEnv->WsSession().SetWindowGroupOrdinalPosition( + task.WgId(), 1 ); + } + + if( !succeeded ) + { + ShowHomescreenL( EExitReally ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::OpenAppL( const TUid aUid ) + { + DEBUG(("_Mm_:CMmAppUi::OpenAppL - IN")); + DEBUG(("\t_Mm_:aUid: 0x%x",aUid.iUid)); + + // Get the correct application data + CAknTaskList* taskList = CAknTaskList::NewL( iCoeEnv->WsSession() ); + TApaTask task = taskList->FindRootApp( aUid ); + delete taskList; + + if ( task.Exists() ) + { + CAknSgcClient::MoveApp( task.WgId(), ESgcMoveAppToForeground ); + } + else + { + // Task doesn't exist, launch a new instance of an application + TApaAppInfo appInfo; + TApaAppCapabilityBuf capabilityBuf; + RApaLsSession lsSession; + User::LeaveIfError( lsSession.Connect() ); + CleanupClosePushL( lsSession ); + User::LeaveIfError( lsSession.GetAppInfo( appInfo, aUid ) ); + User::LeaveIfError( + lsSession.GetAppCapability( capabilityBuf, aUid ) ); + + TApaAppCapability& caps = capabilityBuf(); + TFileName appName = appInfo.iFullName; + CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); + cmdLine->SetExecutableNameL( appName ); + + if ( caps.iLaunchInBackground ) + { + cmdLine->SetCommandL( EApaCommandBackground ); + } + else + { + cmdLine->SetCommandL( EApaCommandRun ); + } + + User::LeaveIfError( lsSession.StartApp( *cmdLine ) ); + + CleanupStack::PopAndDestroy( cmdLine ); + CleanupStack::PopAndDestroy( &lsSession ); + } + + DEBUG(("_Mm_:CMmAppUi::OpenAppL - OUT")); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::InitializeL() + { + DEBUG(("_MM_:CMmAppUi::InitializeL IN")); + CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC(); + CLiwDefaultMap* map = CLiwDefaultMap::NewLC(); + + HBufC* suiteName = StringLoader::LoadLC( R_MENU_TITLE ); + + paramList->AppendL( TLiwGenericParam( KParamSuiteName8, + TLiwVariant( KParamFolderSuite ) ) ); + map->InsertL( KParamSuiteName8, TLiwVariant( suiteName ) ); + map->InsertL( KParamFolderId8, TLiwVariant( KParamFolderId ) ); + map->InsertL( KParamRemoveLocked8, TLiwVariant( KParamFalse ) ); + map->InsertL( KParentFolderId8, TLiwVariant( KParamFolderId ) ); + map->InsertL( KTmpParentFolderId8, TLiwVariant( KParamFolderId ) ); + paramList->AppendL( TLiwGenericParam( KParams8, TLiwVariant( map ) ) ); + + iHNInterface->InitializeL( *paramList ); + + CleanupStack::PopAndDestroy( suiteName ); + CleanupStack::PopAndDestroy( map ); + CleanupStack::PopAndDestroy( paramList ); + DEBUG(("_MM_:CMmAppUi::InitializeL OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::SetMiddleSoftKeyL() + { + DEBUG(("_Mm_:CMmAppUi::SetMiddleSoftKeyL - IN")); + if ( iCurrentSuiteModel && !AknLayoutUtils::PenEnabled() && !IsEditMode() ) + { + 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 ); + + CHnButtonModel* mskModel = NULL; + + 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(); + } + } + DEBUG(("_Mm_:CMmAppUi::SetMiddleSoftKeyL - OUT")); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::StartLayoutSwitchFullScreen( TInt aKastorEffect ) + { + if( ( !iIsKastorEffectStarted && iScreenOn && IsForeground() ) || + aKastorEffect == AknTransEffect::EApplicationStart || + aKastorEffect == AknTransEffect::EApplicationExit ) + { + DEBUG(("_MM_:CMmAppUi::StartLayoutSwitchFullScreen Foreground")); + TUid uid1( KUidMatrixMenuApp ); + TUid uid2( KUidMatrixMenuApp ); + if ( aKastorEffect == AknTransEffect::EApplicationExit ) + { + uid2 = TUid::Null(); + } + + AknTransEffect::TParamBuffer params = AknTransEffect::GfxTransParam( + uid1, uid2, AknTransEffect::TParameter::EFlagNone ); + + GfxTransEffect::BeginFullScreen( aKastorEffect, TRect(), + AknTransEffect::EParameterType, params ); + + iIsKastorEffectStarted = ETrue; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::EndFullScreen() + { + if( iIsKastorEffectStarted && iScreenOn ) + { + DEBUG(("_MM_:CMmAppUi::EndFullScreen Foreground")); + GfxTransEffect::EndFullScreen(); + iIsKastorEffectStarted = EFalse; + } + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleRequestL( const CLiwGenericParamList& aParam, + CLiwGenericParamList* aOutput ) + { + iHNInterface->HandleRequestL( aParam, aOutput ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::PropertyChangedL(TInt aValue) + { + iKeyboardFlipStatus = (EPSHWRMFlipStatus)aValue; + + if ( iCurrentContainer ) + { + if( iKeyboardFlipStatus == EPSHWRMFlipOpen ) + { + TBool wasHighlightVisible = iCurrentContainer->IsHighlightVisible(); + iCurrentContainer->SetFlipOpenL( ETrue ); + if ( IsForeground() && !IsEditMode() && !wasHighlightVisible ) + { + iCurrentContainer->SetDefaultHighlightL( ETrue ); + } + } + else if( iKeyboardFlipStatus == EPSHWRMFlipClosed ) + { + iCurrentContainer->SetFlipOpenL( EFalse ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CMmAppUi::FlipOpen() + { + return iKeyboardFlipStatus == EPSHWRMFlipOpen; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::SetZoom( TAknUiZoom aZoom ) + { + if ( iZoom != aZoom) + { + if ( iCurrentContainer ) + { + iCurrentContainer->HandleZoomChanged( aZoom ); + } + } + iZoom = aZoom; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CMmAppUi::ResetToRootL() + { + TBool resetConsumed( EFalse ); + if( iHNInterface && iCurrentSuiteModel && + !IsRootdisplayedL() ) + { + RemoveFromStack( iCurrentContainer ); + iDummyContainer->MakeVisible( ETrue ); + iHNInterface->HandleBackEventL( + iCurrentSuiteModel->SuiteName(), + iHNInterface->GetSuiteModelsCountL() - 1 ); + ResetContainerMapToRootL(); + if( iCurrentContainer ) + { + iCurrentContainer->ResetWidgetPosition(); + iCurrentContainer->SetZoom( iZoom ); + AddToStackL( iCurrentContainer ); + } + RefreshUiPanesL( ETrue ); + resetConsumed = ETrue; + } + return resetConsumed; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::SkinContentChanged() + { + iSkinChangeNeeded = ETrue; + iSkinChangeInProgress = ETrue; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::SkinConfigurationChanged( + const TAknsSkinStatusConfigurationChangeReason aReason) + { + DEBUG(("_Mm_:CMmAppUi::SkinConfigurationChanged IN - aReason:%d iSkinChangeNeeded:%d iSkinChangeInProgress:%d", aReason, iSkinChangeNeeded, iSkinChangeInProgress)); + switch (aReason) + { + case EAknsSkinStatusConfigurationMerged:// = 1, + { + iSkinChangeNeeded = ETrue; + iSkinChangeInProgress = ETrue; + } + break; + case EAknsSkinStatusConfigurationDeployed:// = 2, + { + iSkinChangeInProgress = EFalse; + if (IsForeground()) + { + TRAPD( err, RefreshIconsL()); + if (!err) + { + iSkinChangeNeeded = ETrue; + } + } + } + break; + default: + { + + } + } + DEBUG(("_Mm_:CMmAppUi::SkinConfigurationChanged OUT - aReason:%d iSkinChangeNeeded:%d iSkinChangeInProgress:%d", aReason, iSkinChangeNeeded, iSkinChangeInProgress)); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::SkinPackageChanged(const TAknsSkinStatusPackageChangeReason /*aReason*/) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::RefreshIconsL() + { + iSkinChangeNeeded = EFalse; + CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC(); + TLiwGenericParam command(KHnRequest, TLiwVariant( KRefreshIcons)); + paramList->AppendL(command); + HandleRequestL(*paramList); + CleanupStack::PopAndDestroy(paramList); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleHighlightOffsetL( TInt aOffset ) + { + if( AknLayoutUtils::PenEnabled() ) + { + iHNInterface->TriggerHnEventL( KKeyIdMoveHighlight, aOffset, NULL ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleNumberOfItemsChangedL( TItemsChangeType aChange ) + { + iCurrentContainer->NumberOfItemsChangedL( aChange ); + TBool scrollConsumed( EFalse ); + scrollConsumed = + iCurrentContainer->ScrollToItemL( iCurrentSuiteModel->GetSuiteHighlight() ); + if ( !scrollConsumed || !AknLayoutUtils::PenEnabled() ) + { + iCurrentContainer->DrawNow(); + } + RefreshUiPanesL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::ApplyHighlightFromModelL() + { + if ( iCurrentSuiteModel && iCurrentContainer ) + { + TInt highlightedItemIndex = iCurrentSuiteModel->GetSuiteHighlight(); + iCurrentContainer->RestoreWidgetPosition(); + + iCurrentContainer->SetManualHighlightL( + highlightedItemIndex, EFalse ); + if ( iMakeHightlightedItemFullyVisible && + !iCurrentContainer->ItemIsFullyVisible( highlightedItemIndex ) ) + { + iCurrentContainer->ScrollToItemL( highlightedItemIndex ); + } + iCurrentContainer->CacheWidgetPosition(); + iMakeHightlightedItemFullyVisible = EFalse; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleFocusGainedL() + { + DEBUG(("_Mm_:CMmAppUi::HandleWsEventL " + "- EEventFocusGained")); + + 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 ( 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")); + + 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 + && !FlipOpen() && !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 ); + } + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +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(); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::HandleFullOrPartialForegroundLostL() + { + DEBUG(("_Mm_:CMmAppUi::HandleWsEventL " + "- KAknFullOrPartialForegroundLost")); + iMmExtManager->ExecuteActionL( + TUid::Null(), KCommandDeleteDialog, NULL ); + if ( iCurrentContainer ) + { + iCurrentContainer->HandleBackgroundGainedL(); + if ( !IsRootdisplayedL() || IsEditMode() || + iEditModeStatus == ETransitionFromEditMode ) + { + iDummyContainer->MakeVisible( ETrue ); + RefreshUiPanesL( ETrue ); + iCurrentContainer->MakeVisible( EFalse ); + iDummyContainer->DrawNow(); + } + if ( IsRootdisplayedL() ) + { + iCurrentContainer->RestoreWidgetPosition(); + iCurrentContainer->CacheWidgetPosition(); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmAppUi::DetectOptionsMenuOpenDisplayChangeL() + { + CEikMenuBar* menuBar = iAppUiFactory->MenuBar(); + TBool optionsMenuIsOpen = menuBar && menuBar->IsDisplayed(); + if ( !!iOptionsMenuIsOpen != !!optionsMenuIsOpen ) + { + iOptionsMenuIsOpen = optionsMenuIsOpen; + if ( iCurrentContainer ) + { + iCurrentContainer->HandleOptionsMenuVisibilityChangeL( + iOptionsMenuIsOpen ); + } + } + } + +// End of File diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/src/mmdocument.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/src/mmdocument.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Application Document class +* +*/ + + +// INCLUDE FILES +#include "mmappui.h" +#include "mmdocument.h" +#include <apgwgnam.h> + +// ============================ MEMBER FUNCTIONS =============================== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmDocument* CMmDocument::NewL( CEikApplication& aApp ) + { + CMmDocument* self = NewLC( aApp ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmDocument* CMmDocument::NewLC( CEikApplication& aApp ) + { + CMmDocument* self = + new ( ELeave ) CMmDocument( aApp ); + + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmDocument::ConstructL() + { + // No implementation required + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmDocument::CMmDocument( CEikApplication& aApp ) + : CAknDocument( aApp ) + { + // No implementation required + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmDocument::~CMmDocument() + { + // No implementation required + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CEikAppUi* CMmDocument::CreateAppUiL() + { + // Create the application user interface, and return a pointer to it + // the framework takes ownership of this object + return ( static_cast <CEikAppUi*> ( new ( ELeave ) CMmAppUi ) ); + } + +// End of File diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/src/mmgui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/src/mmgui.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Application startpoint +* +*/ + + +// INCLUDE FILES +#include <eikstart.h> +#include "mmapplication.h" + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +LOCAL_C CApaApplication* NewApplication() + { + return new CMmApplication; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +GLDEF_C TInt E32Main() + { + return EikStart::RunApplication( NewApplication ); + } diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/src/mmnomemory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/src/mmnomemory.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,106 @@ +/* +* 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: Subscribes properties from P&S +* +*/ + +#include "mmnomemory.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmNoMemory::CMmNoMemory() : + CActive( EPriorityIdle ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmNoMemory* CMmNoMemory::NewLC() + { + CMmNoMemory* self = new (ELeave) CMmNoMemory(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmNoMemory* CMmNoMemory::NewL() + { + CMmNoMemory* self = CMmNoMemory::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmNoMemory::ConstructL() + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmNoMemory::Start() + { + Cancel(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + SetActive(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmNoMemory::~CMmNoMemory() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmNoMemory::DoCancel() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmNoMemory::RunL() + { + User::Leave( KErrNoMemory ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmNoMemory::RunError(TInt aError) + { + return aError; + } diff -r 000000000000 -r f72a12da539e menufw/menufwui/matrixmenu/src/mmpropertysubscriber.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/matrixmenu/src/mmpropertysubscriber.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,97 @@ +/* +* 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: Subscribes properties from P&S + * +*/ + + +#include "mmpropertysubscriber.h" + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +CMmPropertySubscriber::CMmPropertySubscriber(MMmPropertyChangeObserver& aObserver) + : CActive( EPriorityStandard ), + iPropertyChangeObserver(aObserver) + { + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +CMmPropertySubscriber* CMmPropertySubscriber::NewLC( + const TUid aUid, + const TUint32 aKey, + MMmPropertyChangeObserver& aObserver) + { + CMmPropertySubscriber* self = new ( ELeave ) CMmPropertySubscriber(aObserver); + CleanupStack::PushL(self); + self->ConstructL(aUid,aKey); + return self; + } +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +CMmPropertySubscriber* CMmPropertySubscriber::NewL( + const TUid aUid, + const TUint32 aKey, + MMmPropertyChangeObserver& aObserver) + { + CMmPropertySubscriber* self = CMmPropertySubscriber::NewLC(aUid,aKey,aObserver); + CleanupStack::Pop(); // self; + return self; + } +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CMmPropertySubscriber::ConstructL( + const TUid aUid, + const TUint32 aKey) + { + User::LeaveIfError( iProperty.Attach( aUid, aKey ) ); + CActiveScheduler::Add( this); // Add to scheduler + // initial subscription and process current property value + RunL(); + } +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +CMmPropertySubscriber::~CMmPropertySubscriber() + { + Cancel(); // Cancel any request, if outstanding + iProperty.Close(); + } +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CMmPropertySubscriber::DoCancel() + { + iProperty.Close(); + } +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// +void CMmPropertySubscriber::RunL() + { + // resubscribe before processing new value to prevent missing updates + iProperty.Subscribe( iStatus ); + SetActive(); + + TInt intValue; + if( iProperty.Get( intValue ) != KErrNotFound ) + { + iPropertyChangeObserver.PropertyChangedL(intValue); + } + } + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project mmextensions +* +*/ + + +#include <platform_paths.hrh> + +#include "../mmextensionmanager/group/bld.inf" +#include "../mmfolderuiextension/group/bld.inf" + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/mmextensions.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mmextensions.iby) +../rom/mmextensions_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(mmextensions_resources.iby) diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmextensionmanager/BWINS/mmextensionmanageru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmextensionmanager/BWINS/mmextensionmanageru.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?NewL@CMMExtensionManager@@SAPAV1@AAVMMmActionRequest@@@Z @ 1 NONAME ; class CMMExtensionManager * CMMExtensionManager::NewL(class MMmActionRequest &) + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmextensionmanager/EABI/mmextensionmanageru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmextensionmanager/EABI/mmextensionmanageru.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + _ZN19CMMExtensionManager4NewLER16MMmActionRequest @ 1 NONAME + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmextensionmanager/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmextensionmanager/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project mmextensionmanager +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/mmextensionmanager.h |../../../../inc/mmextensionmanager.h +../inc/mmecomobserver.h |../../../../inc/mmecomobserver.h + +PRJ_MMPFILES +mmextensionmanager.mmp + +//PRJ_TESTMMPFILES +#ifdef _MATRIX_MENU_INCLUDE_TEST_CONTENT +#include "../internal/test/group/bld.inf" +#endif diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmextensionmanager/group/mmextensionmanager.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmextensionmanager/group/mmextensionmanager.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project extension manager +* +*/ + + +// To get the APP_LAYER_SYSTEMINCLUDE-definition +#include <platform_paths.hrh> +TARGET mmextensionmanager.dll +TARGETTYPE DLL +UID 0x1000008d 0x2000E57F +VENDORID VID_DEFAULT + +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src + +SOURCE mmextensionmanager.cpp +SOURCE mmecomobserver.cpp + + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ECom.lib + +DEBUGLIBRARY flogger.lib + +// End of File diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmextensionmanager/inc/mmdialogmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmextensionmanager/inc/mmdialogmanager.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,42 @@ +/* +* 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: Menu Framework extension plugin +* +*/ + +#ifndef MMDIALOGMANAGER_H +#define MMDIALOGMANAGER_H + +#include <AknQueryDialog.h> + +class MMmDialogManager + { +public: + /** + * Setter for dialog. + * @param aDialog Dialog instance. + * @return Result of the dialog. + */ + virtual void SetDialogL( CAknQueryDialog* aDialog ) = 0; + + /** + * Removes active dialog. + */ + virtual void RemoveDialogL() = 0; + }; + +#endif /* MMDIALOGMANAGER_H */ + +// end of file + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmextensionmanager/inc/mmecomobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmextensionmanager/inc/mmecomobserver.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,131 @@ +/* +* 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: Menu Framewrok ECom observer +* +*/ + +#ifndef C_ECOM_OBSERVER_H +#define C_ECOM_OBSERVER_H + +#include <e32base.h> // For CActive, link against: euser.lib +#include <e32std.h> // For RTimer, link against: euser.lib + +class REComSession; + +/** + * Class defining callback interface. + */ + +/** + * MHNEcomInstallNotifierCallback is an interface contains function + * executed when ECom plugin have changed. Interface is used by all + * ECom observer implementations. + * + * @since S60 5.0 + * @ingroup group_mmextensions + */ +class MHNEcomInstallNotifierCallback + { +public: + + /** + * Refreshes list of MultimediaMenu plugins implementations. + */ + virtual void EcomChangedL() = 0; + }; + +/** + * Class for observing ECom server + */ + +/** + * CMMEcomObserver is a class represents ECom plugin. Class is + * derived by all ECom plugin implemetations. Implementation + * contains basic functionality related with ECom mechanism and + * notification handling. + * + * @since S60 5.0 + * @ingroup group_mmextensions + */ +NONSHARABLE_CLASS( CMMEcomObserver ) : public CActive + { +public: + /** + * Cancel and destroy. + */ + ~CMMEcomObserver(); + + /** + * Two-phased constructor. + * @param aCallback Pointer to ECom plugin callback. + * @return Instance of the CMMEcomObserver class. + */ + static CMMEcomObserver* NewL( MHNEcomInstallNotifierCallback* aCallback ); + + /** + * Two-phased constructor. + * @param aCallback Pointer to ECom plugin callback. + * @return Instance of the CMMEcomObserver class. + */ + static CMMEcomObserver* NewLC( MHNEcomInstallNotifierCallback* aCallback ); + +private: + /** + * Default C++ constructor. + */ + CMMEcomObserver(); + + /** + * Second-phase constructor. + * @param aCallback Pointer to ECom plugin callback. + */ + void ConstructL( MHNEcomInstallNotifierCallback* aCallback ); + +private: + + /** + * From CActive. Handles completion. + */ + void RunL(); + + /** + * Cancels active object. + */ + void DoCancel(); + + /** + * Override to handle leaves from RunL(). Default implementation causes + * the active scheduler to panic. + * @param aError Currently error status. + * @return Error code. + */ + TInt RunError( TInt aError ); + +private: + + /** + * ECom handler + * Own. + */ + REComSession* iSession; + + /** + * Callback pointer. + * Not own. + */ + MHNEcomInstallNotifierCallback* iCallback; + + }; + +#endif // C_ECOM_OBSERVER_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmextensionmanager/inc/mmextensionmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmextensionmanager/inc/mmextensionmanager.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,137 @@ +/* +* 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: Menu Framewrok extension manager +* +*/ + + +#ifndef C_MM_EXTENSION_MANAGER_H +#define C_MM_EXTENSION_MANAGER_H + +// INCLUDES +#include "mmecomobserver.h" +#include <e32std.h> +#include <e32base.h> +#include <e32hashtab.h> + +class CMMExtensionPlugin; +class CLiwGenericParamList; +class MMmActionRequest; + +/** + * CMMExtensionManager is a class derived from MHNEcomInstallNotifierCallback. + * It is responsible for loading, keeping and managing all ECom plugin + * implementations. Additionaly, CMMExtensionManager receives command from UI + * and decides which plugin have to handle the event. + * + * @since S60 5.0 + * @ingroup group_mmextensions + */ +NONSHARABLE_CLASS( CMMExtensionManager ): + public CBase, + public MHNEcomInstallNotifierCallback + { +public: // Constructors and destructor + + /** + * Standard C++ Destructor. + */ + ~CMMExtensionManager(); + + /** + * Two-phased constructor. + * @return Instance of the CMMExtensionManager class. + * @param aActionRequest Interface enabling to issues request to App UI. + */ + IMPORT_C static CMMExtensionManager* NewL( MMmActionRequest& aActionRequest ); + + /** + * Two-phased constructor. + * @return Instance of the CMMExtensionManager class. + * @param aActionRequest Interface enabling to issues request to App UI. + */ + static CMMExtensionManager* NewLC( MMmActionRequest& aActionRequest ); + +public: + + /** Pure interface method. + * Representative of a method provided on the interface by + * the interface definer. + * @param aUid UID of the ECom plugin's. + * @param aCommand Command which has to be executed on the plugin. + * Request to the Service. + * @param aEventParamList List of the event parameters needed to + * execute action. Extention Manager is its owner. + * @return Number representing error code. + */ + virtual TInt ExecuteActionL( + const TUid aUid, + const TDesC& aCommand, + CLiwGenericParamList* aEventParamList ); + + /** + * Refreshes list of MultimediaMenu plugins implementations. + */ + void EcomChangedL(); + +private: + + /** + * Constructor for performing 1st stage construction. + * @param aActionRequest Interface enabling to issues request to App UI. + */ + CMMExtensionManager( MMmActionRequest& aActionRequest ); + + /** + * EPOC default constructor for performing 2nd stage construction. + * + */ + void ConstructL(); + + /** + * Loads MultimediaMenu plugins implementations. + */ + void LoadPluginsL( ); + + /** + * Gets ECom plugin implementation. + * @param aUid Id of the ECom plugin. + * @return ECom extension plugin. + */ + CMMExtensionPlugin* GetImplementationL( const TUid aUid ); + +private: + + /** + * Pointer to plugin map. + * Own. + */ + RHashMap< TInt32, CMMExtensionPlugin*> iPluginMap; + + /** + * Not Own. + * Reference to the App UI. + */ + MMmActionRequest& iActionRequest; + + /** + * Pointer to ECom observer. + * Own. + */ + CMMEcomObserver *iEcomObserver; +}; + +#endif // C_MM_EXTENSION_MANAGER_H + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmextensionmanager/inc/mmextensionplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmextensionmanager/inc/mmextensionplugin.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,91 @@ +/* +* 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: Menu Framework extension plugin +* +*/ + + +#ifndef C_MM_EXTENSION_PLUGIN_H_ +#define C_MM_EXTENSION_PLUGIN_H_ + +#include <e32base.h> +#include <ecom/ecom.h> +#include "mmextensionplugindef.h" + +class CLiwGenericParamList; + +/** + * CMMExtensionPlugin is a class representing ECom plugin. + * Class has virtual function responsible for executing + * command. It can also returns array of all implementations. + * Class is deriving by all ECom plugin implementations. + * + * @since S60 5.0 + * @ingroup group_mmextensions + */ +NONSHARABLE_CLASS( CMMExtensionPlugin ) : public CBase + { +public: + /** + * Instantiates an object of this type. + * @param aUid ECom plugin's UID. + * @param aParams The plugin's parameters. + * @return Instance of the CMMExtensionPlugin class. + */ + static CMMExtensionPlugin* NewL( TUid aUid , TAny* aParams ); + + /** + * Virtual C++ Destructor. + */ + virtual ~CMMExtensionPlugin(); + + /** + * Request a list of all available implementations which + * satisfy this given interface. + * @param aImplInfoArray ECom plugin implementations array. + */ + static void ListAllImplementationsL( RImplInfoPtrArray& aImplInfoArray ); + + /** + * Executes provided action. + * @param aCommand Command which has to be executed on the plugin. + * Request to the Service. + * @param aEventParamList Pointer to a list of the event parameters. + * Its ownership is held in extension manager, + * so if one wishes to use it in asynchronous operations + * then he needs to keep a copy of the data. + * @return Error code. + */ + virtual TInt ExecuteActionL( + const TDesC& aCommand, + CLiwGenericParamList* aEventParamList ) = 0; + +protected: + /** + * Default constructor. + */ + inline CMMExtensionPlugin(); + +private: + /** + * Unique instance identifier key. + */ + TUid iDtor_ID_Key; + }; + +#include "mmextensionplugin.inl" + +#endif /* C_MMEXTENSIONPLUGIN_H_ */ + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmextensionmanager/inc/mmextensionplugin.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmextensionmanager/inc/mmextensionplugin.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,62 @@ +/* +* 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: Inline functions for Menu Framewrok extension plugins + * +*/ + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline CMMExtensionPlugin::CMMExtensionPlugin() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline CMMExtensionPlugin::~CMMExtensionPlugin() + { + // Destroy any instance variables and then + // inform the framework that this specific + // instance of the interface has been destroyed. + REComSession::DestroyedImplementation( iDtor_ID_Key ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline CMMExtensionPlugin* CMMExtensionPlugin::NewL( TUid aUid , TAny* aParams ) + { + return REINTERPRET_CAST( CMMExtensionPlugin*, + REComSession::CreateImplementationL( aUid, + _FOFF( CMMExtensionPlugin, iDtor_ID_Key ) , aParams ) ) ; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void CMMExtensionPlugin::ListAllImplementationsL( + RImplInfoPtrArray& aImplInfoArray) + { + REComSession::ListImplementationsL( TUid::Uid( KCMMExtensionInterfaceUid ), + aImplInfoArray ); + } + +// End of File diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmextensionmanager/inc/mmextensionplugindef.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmextensionmanager/inc/mmextensionplugindef.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ +/* +* 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: Plugin definition + * +*/ + + + +#ifndef MM_PLUGINS_DEF_H_ +#define MM_PLUGINS_DEF_H_ + +const TInt32 KCMMExtensionInterfaceUid = {0x2000E581}; +const TInt32 KCMMExtContactsAddPlugin = {0x2000E582}; +const TInt32 KCMMExtContactsDefNumberPlugin = {0x2000E583}; +const TInt32 KCMMExtContactsThumbnailPlugin = {0x2000E584}; + +_LIT( KCMMExtContactsAddPluginName, "AddContact" ); +_LIT( KCMMExtContactsDefNumberPluginName, "ChangeDefaultNumber" ); +_LIT( KCMMExtContactsThumbnailPluginName, "ChangeThumbnail" ); + +#endif /*MM_PLUGINS_DEF_H_*/ + + +// End of file + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmextensionmanager/inc/mmextensionpluginuids.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmextensionmanager/inc/mmextensionpluginuids.hrh Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,29 @@ +/* +* 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: UIds definitions + * +*/ + + +#ifndef MM_PLUGIN_UIDS_HRH_ +#define MM_PLUGIN_UIDS_HRH_ + +#define KCMMExtensionPluginUid 0x2000E581 +#define KCMMExtContactsAddPluginUid 0x2000E582 +#define KCMMExtContactsDefNumberPluginUid 0x2000E583 +#define KCMMExtContactsThumbnailPluginUid 0x2000E584 + +#endif /*MM_PLUGIN_UIDS_HRH_*/ + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmextensionmanager/inc/mymenudebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmextensionmanager/inc/mymenudebug.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Debug constants definitions + * +*/ + + +#ifndef MYMENUDEBUG_H +#define MYMENUDEBUG_H + +// MACROS +#define APPEND_TO_DEBUG_FILE + +// CONSTANTS +_LIT( KDebugDirName, "menu" ); +_LIT( KDebugFileName, "mmextensionmeneger.txt" ); + +#endif // MYMENUDEBUG_H + +// End of File diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmextensionmanager/src/mmecomobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmextensionmanager/src/mmecomobserver.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,109 @@ +/* +* 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: Interface of the Ecom observer +* +*/ + +#include <ecom/ecom.h> +#include "mmecomobserver.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMMEcomObserver::CMMEcomObserver() : + CActive(EPriorityStandard) // Standard priority + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMMEcomObserver* CMMEcomObserver::NewLC( + MHNEcomInstallNotifierCallback* aCallback ) + { + CMMEcomObserver* self = new ( ELeave ) CMMEcomObserver(); + CleanupStack::PushL(self); + self->ConstructL( aCallback ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMMEcomObserver* CMMEcomObserver::NewL( + MHNEcomInstallNotifierCallback* aCallback ) + { + CMMEcomObserver* self = CMMEcomObserver::NewLC( aCallback ); + CleanupStack::Pop(); // self; + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMMEcomObserver::ConstructL( MHNEcomInstallNotifierCallback* aCallback ) + { + iCallback = aCallback; + iSession = &REComSession::OpenL(); + iSession->NotifyOnChange( iStatus ); + CActiveScheduler::Add( this ); + SetActive(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMMEcomObserver::~CMMEcomObserver() + { + Cancel(); // Cancel any request, if outstanding + if( iSession ) + { + iSession->Close(); + } + REComSession::FinalClose( ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMMEcomObserver::DoCancel() + { + iSession->CancelNotifyOnChange( iStatus ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMMEcomObserver::RunL() + { + iCallback->EcomChangedL(); + iSession->NotifyOnChange( iStatus ); + SetActive(); // Tell scheduler a request is active + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMMEcomObserver::RunError( TInt /*aError*/ ) + { + return KErrNone; + } diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmextensionmanager/src/mmextensionmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmextensionmanager/src/mmextensionmanager.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,199 @@ +/* +* 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: Menu Framework Extension Manager +* +*/ + +#include <mmf/common/mmfcontrollerpluginresolver.h> // for CleanupResetAndDestroyPushL + +#include "mmextensionplugin.h" +#include "mmextensionmanager.h" +#include "menudebug.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMMExtensionManager::CMMExtensionManager( MMmActionRequest& aActionRequest ): + iActionRequest( aActionRequest ) + { + // No implementation required + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMMExtensionManager::~CMMExtensionManager() + { + THashMapIter< TInt32, CMMExtensionPlugin* > iter( iPluginMap); + for (CMMExtensionPlugin* const* ptr = + ( CMMExtensionPlugin* const* ) iter.NextValue(); + ptr; ptr = ( CMMExtensionPlugin* const* ) iter.NextValue()) + { + delete (CMMExtensionPlugin*)(*ptr); + } + iPluginMap.Close (); + + + //delete iPluginNameMap + /*THashMapIter< HBufC*, TInt32 > iter1( iPluginNameMap ); + while ( HBufC*const* ptrHbuf = iter1.NextKey() ) + { + delete *ptrHbuf; + } + iPluginNameMap.Close();*/ + + delete iEcomObserver; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMMExtensionManager* CMMExtensionManager::NewLC( MMmActionRequest& aActionRequest ) + { + CMMExtensionManager* self = new (ELeave) CMMExtensionManager( aActionRequest ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CMMExtensionManager* CMMExtensionManager::NewL( + MMmActionRequest& aActionRequest ) + { + CMMExtensionManager* self = CMMExtensionManager::NewLC( aActionRequest ); + CleanupStack::Pop (); // self; + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMMExtensionManager::ConstructL() + { + iEcomObserver = CMMEcomObserver::NewL( this ); + LoadPluginsL(); + } + +// --------------------------------------------------------------------------- +// CASpaPluginManager::LoadPluginsL +// Load plugins implementations +// --------------------------------------------------------------------------- +// +void CMMExtensionManager::LoadPluginsL() + { + DEBUG16(("\t_MM_: CMMExtensionManager::LoadPluginsL()") ); + + // Read info about all implementations into infoArray + RImplInfoPtrArray infoArray; + + // Note that a special cleanup function is required to reset and destroy + // all items in the array, and then close it. + CleanupResetAndDestroyPushL( infoArray ); + CMMExtensionPlugin::ListAllImplementationsL( infoArray ); + + // Loop through each info for each implementation + // and create and use each in turn + CMMExtensionPlugin* plug; + for ( TInt i = 0; i < infoArray.Count(); i++ ) + { + // Slice off first sub-section in the data section + TUid current_plugin = infoArray[i]->ImplementationUid(); + plug = CMMExtensionPlugin::NewL( current_plugin , &iActionRequest ); + CleanupStack::PushL( plug ); + TInt32 key = current_plugin.iUid; + iPluginMap.InsertL( key, plug ); + CleanupStack::Pop( plug ); + plug = NULL; + } + CleanupStack::PopAndDestroy( &infoArray ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMMExtensionManager::ExecuteActionL( + const TUid aUid, + const TDesC& aCommand, + CLiwGenericParamList* aEventParamList ) + { + TInt result = KErrNotFound; + if( aUid.iUid != KNullUidValue ) + { + CMMExtensionPlugin* pluginInstance = GetImplementationL( aUid ); + if( pluginInstance ) + { + result = pluginInstance->ExecuteActionL( + aCommand, aEventParamList ); + } + } + else + { + THashMapIter<TInt32, CMMExtensionPlugin*> plugins( iPluginMap ); + CMMExtensionPlugin* const* plugin = NULL; + for( plugin = plugins.NextValue(); plugin; + plugin = plugins.NextValue() ) + { + (*plugin)->ExecuteActionL( aCommand, aEventParamList ); + } + result = KErrNone; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMMExtensionPlugin* CMMExtensionManager::GetImplementationL( + const TUid aUid ) + { + CMMExtensionPlugin* ret = NULL; + CMMExtensionPlugin **imp = NULL; + + TInt pluginId ( aUid.iUid ); + + imp = iPluginMap.Find( pluginId ); + if( imp ) + { + ret = *imp; + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMMExtensionManager::EcomChangedL() + { + THashMapIter< TInt32, CMMExtensionPlugin* > iter( iPluginMap ); + for (CMMExtensionPlugin* const* ptr = + ( CMMExtensionPlugin* const* ) iter.NextValue(); + ptr; ptr = ( CMMExtensionPlugin* const* ) iter.NextValue()) + { + delete (CMMExtensionPlugin*)(*ptr); + } + iPluginMap.Close(); + LoadPluginsL(); + } + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/data/mmfolderuiextensionplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/data/mmfolderuiextensionplugin.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for the browse folder UI extension plugin + * +*/ + + +#include <ecom/registryinfo.rh> +#include "mmextensionpluginuids.hrh" + +// --------------------------------------------------------------------------- +// theInfo +// Declares info for implementations +// --------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO theInfo + { + // UID for the DLL + dll_uid = 0x2001CB78; + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = KCMMExtensionPluginUid; + implementations = + { + // Info for CMmFolderUIExtPlugin + IMPLEMENTATION_INFO + { + implementation_uid = 0x2001CB79; + version_no = 1; + display_name = "Folder UI Extension Plugin"; + default_data = "Folder"; + opaque_data = ""; + } + }; + } + }; + } + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/data/mmfolderuiextplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/data/mmfolderuiextplugin.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,214 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for the browse folder UI extension plugin + * +*/ + + +NAME PPUP // 4 letter ID + +// INCLUDES +#include <eikon.rh> +#include <avkon.rsg> +#include <avkon.rh> + +#ifdef LANGUAGE_SC + #include <sc/avkon.loc> +#else + #include <avkon.loc> +#endif + +RESOURCE RSS_SIGNATURE { } + +RESOURCE TBUF { buf="AFUP"; } + +RESOURCE DIALOG r_menu_filename_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL; + items= + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control= AVKON_DATA_QUERY + { + layout = EDataLayout; + control = EDWIN + { + flags= EEikEdwinNoHorizScrolling | EEikEdwinResizable; + maxlength = 256; // KMaxFileName + }; + }; + } + }; + } + +RESOURCE DIALOG r_menu_wait_dialog + { + flags = EAknWaitNoteFlags; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control= AVKON_NOTE + { + layout = EWaitLayout; + singular_label = qtn_fldr_deleting_wait_note; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + }; + } + }; + } + + +RESOURCE DIALOG r_menu_edit_interruption_info + { + flags = EAknWarningNoteFlags | EEikDialogFlagWait; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = AVKON_NOTE + { + layout = EGeneralLayout; + animation = R_QGN_NOTE_ERROR_ANIM; + }; + } + }; + } + +RESOURCE DIALOG r_menu_edit_delete_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + animation = R_QGN_NOTE_QUERY_ANIM; + }; + } + }; + } + +RESOURCE DIALOG r_menu_edit_move_to_folder_select_cancel_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_SELECT_CANCEL; + items = + { + DLG_LINE + { + type = EAknCtListQueryControl; + id = EListQueryControl; + control = AVKON_LIST_QUERY_CONTROL + { + listtype = EAknCtSingleGraphicPopupMenuListBox; + listbox = LISTBOX + { + flags = EAknListBoxMenuList; + height = 3; + width = 10; + }; + heading = qtn_fldr_move_to_prmpt; + }; + } + }; + } + +RESOURCE DIALOG r_menu_edit_move_to_folder_select_back_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_SELECT_BACK; + items = + { + DLG_LINE + { + type = EAknCtListQueryControl; + id = EListQueryControl; + control = AVKON_LIST_QUERY_CONTROL + { + listtype = EAknCtSingleGraphicPopupMenuListBox; + listbox = LISTBOX + { + flags = EAknListBoxMenuList; + height = 3; + width = 10; + }; + heading = qtn_fldr_move_to_prmpt; + }; + } + }; + } + +RESOURCE DIALOG r_menu_edit_moving_complete_notification + { + flags = EAknWarningNoteFlags | EEikDialogFlagWait; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = AVKON_NOTE + { + layout = EGeneralLayout; + animation = R_QGN_NOTE_OK_ANIM; + }; + } + }; + } + +RESOURCE DIALOG r_menu_edit_moving_abort_notification + { + flags = EAknWarningNoteFlags | EEikDialogFlagWait; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = AVKON_NOTE + { + layout = EGeneralLayout; + animation = R_QGN_NOTE_ERROR_ANIM; + }; + } + }; + } + +RESOURCE TBUF r_menu_edit_root_folder { buf=qtn_fldr_root_level; } +RESOURCE TBUF r_menu_edit_default_folder_name { buf=qtn_fldr_name_default; } +RESOURCE TBUF r_menu_edit_folder_name { buf=qtn_fldr_name_prmpt; } +RESOURCE TBUF r_menu_edit_delete_query_text { buf=qtn_query_common_conf_delete; } +RESOURCE TBUF r_menu_edit_fldr_deleting_wait_note { buf=qtn_fldr_deleting_wait_note; } +RESOURCE TBUF r_menu_edit_fldr_bad_file_name { buf=qtn_fldr_bad_file_name; } +RESOURCE TBUF r_menu_edit_fldr_illegal_characters { buf=qtn_fldr_illegal_characters; } + +// end of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project mmfolderuiextensionplugin +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +mmfolderuiextensionplugin.mmp diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/group/mmfolderuiextensionplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/group/mmfolderuiextensionplugin.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,95 @@ +/* +* 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: Project definition file for project ui extension plugin +* +*/ + + +// To get the APP_LAYER_SYSTEMINCLUDE-definition +#include <platform_paths.hrh> +#include <data_caging_paths.hrh> + +TARGET mmfolderuiextensionplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x2001CB78 + +CAPABILITY CAP_ECOM_PLUGIN +LANG SC + +SOURCEPATH ../src +SOURCE mmproxy.cpp +SOURCE mmfolderuiextplugin.cpp +SOURCE mmfoldercommand.cpp +SOURCE mmfoldercommandadd.cpp +SOURCE mmfoldercommanddelete.cpp +SOURCE mmfoldercommandrename.cpp +SOURCE mmmovetofoldercommand.cpp +SOURCE mmpluginsharedresources.cpp + +USERINCLUDE ../inc +USERINCLUDE ../loc +USERINCLUDE ../../../../inc +USERINCLUDE ../../mmextensionmanager/inc + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../data +START RESOURCE mmfolderuiextensionplugin.rss +HEADER +TARGET mmfolderuiextensionplugin.rsc +TARGETPATH ECOM_RESOURCE_DIR +END + +SOURCEPATH ../data +START RESOURCE mmfolderuiextplugin.rss +HEADER +TARGET mmfolderuiextplugin.rsc +TARGETPATH APP_RESOURCE_DIR +LANGUAGE_IDS +END //RESOURCE + + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY liwservicehandler.lib // CLiwGenericParamList +LIBRARY avkon.lib // CAknListQueryDialog +LIBRARY bafl.lib // CDesCArrayFlat +LIBRARY eikdlg.lib // CEikDialog +LIBRARY commonengine.lib // StringLoader +LIBRARY hnmetadatamodel.lib +LIBRARY hnutilities.lib +LIBRARY eikcoctl.lib +LIBRARY aknicon.lib +LIBRARY egul.lib +LIBRARY cone.lib +LIBRARY favouritesengine.lib +LIBRARY commondialogs.lib +LIBRARY swinstcli.lib +LIBRARY sisregistryclient.lib +LIBRARY apgrfx.lib +LIBRARY ws32.lib +LIBRARY apparc.lib +LIBRARY widgetregistryclient.lib +LIBRARY featmgr.lib +LIBRARY mcsmenu.lib +LIBRARY estor.lib + +#ifdef _MATRIX_MENU_TRACE_PERFORMANCE +LIBRARY flogger.lib +#else +DEBUGLIBRARY flogger.lib +#endif + +// End of file + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmfoldercommand.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmfoldercommand.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,359 @@ +/* +* Copyright (c) 2007-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 of the folder command + * +*/ + + + +#ifndef MMFOLDERCOMMAND_H +#define MMFOLDERCOMMAND_H + +#include <e32base.h> +#include <liwcommon.h> +#include "mmdialogmanager.h" +#include "mcsmenusapi.h" + +class CMmPluginSharedResources; +class CHnMdBaseKey; +class CHnServiceHandler; +class CAknQueryDialog; +class MMmActionRequest; +class MMmDialogManager; + +/** + * Base class for folder operations + * @since S60 v5.0 + */ + +/** + * CMmFolderCommand is a class which all command classes derived from. + * It has a several common functions responsible for creating appropriate + * command instance, displaying dialogs, controlling command execution, + * getting data from resources, displaying dialogs and executing MCS queries. + * CMmFolderCommand is using only as a base class in inheritance. + * + * @lib mmfolderuiextensionplugin.lib + * @since S60 5.0 + * @ingroup group_mmfolderuiextensionplugin + */ +NONSHARABLE_CLASS( CMmFolderCommand ) : public CBase, + public MMmDialogManager, + public MLiwNotifyCallback + { + +protected: + + /** + * Current state of folder name validation. + */ + enum TValidation + { + EValidationOk = 0, + EValidationInvalid = 1, + EValidationNotAllowed = 2 + }; + +public: + + /** + * Factory Method which returns concrete class + * representing folder operation. + * @param aCommand Descriptor contains required command. + * @return If aCommand is supported, operations instance is returned. + */ + static CMmFolderCommand* FactoryL( const TDesC& aCommand ); + + /** + * Returns TInt value using the given path. + * + * @since S60 v5.0 + * @param aParam Param list. + * @param aPath URI Path. + * @return TInt value or KErrNotFound. + */ + TInt GetIntL( const CLiwGenericParamList& aParam, const TDesC8& aPath ); + + /** + * Returns string value using the given path. + * + * @since S60 v5.0 + * @param aParam Param list. + * @param aPath URI Path. + * @return String value or KNullDesC. + */ + TPtrC GetStringL( const CLiwGenericParamList& aParam, const TDesC8& aPath ); + + /** + * Returns bool value using the given path. + * + * @since S60 v5.0 + * @param aParam Param list. + * @param aPath URI Path. + * @return TBool value. + */ + TBool GetBoolL( const CLiwGenericParamList& aParam, const TDesC8& aPath ); + + /** + * Performs operation on folder. + * @param aEventParamList List of parameters for operations. + */ + virtual void ExecuteActionL( CLiwGenericParamList* aEventParamList ) = 0; + + /** + * Setter for App UI. + * @param aActionRequest Interface enabling to issues request to App UI. + */ + void SetRequestInterface( MMmActionRequest* aActionRequest ); + + /** + * Setter for shared resources. + * @param aActionRequest Interface enabling to issues request to App UI. + */ + void SetSharedResources( CMmPluginSharedResources* aResources ); + + /** + * Setter for dialog. + * @param aDialog Dialog instance. + * @return Result of the dialog. + */ + void SetDialogL( CAknQueryDialog* aDialog ); + + /** + * Removes active dialog. + */ + void RemoveDialogL(); + + /** + * Virtual C++ Destructor. + */ + virtual ~CMmFolderCommand(); + +protected: + + /** + * Base Plugin constructor + */ + void BaseConstructL(); + + /** + * Gets folder name. + * @param aFolderName Name of the folder. + * @return Modal dialog displaying result. + */ + TBool DoChangeNameL( RBuf& aFolderName, TInt aDefaultNameLength, + RBuf& aNumberInBracket, CLiwGenericParamList& aFoldersNames, + TLiwVariant& aVar, TInt aNumberToAppend = 0 ); + + /** + * Gets folder name. + * @param aFolderName Name of the folder. + * @return Modal dialog displaying result. + */ + void ChangeNameIfAlreadyExistsL( RBuf& aFolderName, + CLiwGenericParamList* aFoldersNames, TInt aNumberToAppend = 0 ); + + /** + * Gets list of the folders names. + * @param aFolderName Name of the folder. + */ + void GetFolderListL( TInt aItemId ); + + /** + * Gets list of the items names. + * @param aFolderName Name of the folder. + */ + void GetListL( TInt aItemId ); + + /** + * Gets folder name. + * @param aFolderName Name of the folder. + * @return Modal dialog displaying result. + */ + TBool GetFolderNameL( RBuf& aFolderName, + CLiwGenericParamList* aFoldersNames = 0 ); + + /** + * Displays notification contains reason of the deletion cancel. + * @param aFolderName Name of the folder. + */ + void DisplayErrorInfoL( const TDesC& aFolderName ); + + /** + * Executes query on MCS service. + * @param aQueryName Query name. + * @param aInputData Input data. + * @param aFilter Query filter. + * @param aCallback Interface handling query execution. + */ + void MCSQueryExecutionL( const TDesC8& aQueryName, + const CHnMdBaseKey* aInputData, + const CHnMdBaseKey* aFilter, + MLiwNotifyCallback* aCallback ); + + /** + * Add new key to existing key. + * @param aInDataKey An existing key. + * @param aKeyName Name of the new key. + * @param aKeyType Type of the new key. + * @param aKeyValue Value of the new key. + */ + void AddSubKeyL( CHnMdBaseKey* aInDataKey, + const TDesC8& aKeyName, + const TDesC8& aKeyType, + const TDesC8& aKeyValue ); + + /** + * Add new key to existing key. + * @param aInDataKey An existing key. + * @param aKeyName Name of the new key. + * @param aKeyType Type of the new key. + * @param aKeyValue Value of the new key. + */ + void AddSubKeyL( CHnMdBaseKey* aInDataKey, + const TDesC8& aKeyName, + const TDesC8& aKeyType, + const TDesC& aKeyValue ); + + /** + * Checks if folder name is valid and consists of allowed characters + * @param aFolderName Folder name to check + * @return Validation result. + */ + TInt FolderNameValidationL(RBuf& aFolderName, + CLiwGenericParamList* aFoldersNames = 0); + + /** + * Removes illegal character + * @param aFolderName Folder name to check + * @return Validation result. + */ + TInt IllegalCharacterRemoveL(RBuf& aFolderName, + CLiwGenericParamList* aFoldersNames = 0); + + /** + * Checks if folder name is valid + * @param aFolderName Folder name to check + * @return Validation result. + */ + TInt CheckValidFileNameL( const TDes& aFolderName ); + + /** + * Checks if folder name consists of allowed characters + * @param aFolderName Folder name to check + * @return Validation result. + */ + TInt CheckAllowedCharsL( const TDes& aFolderName ); + + /** + * Displays notification contains reason of the add folder/rename folder name cancel. + * @param aResourceId The numeric ID of the resource string to be read. + */ + void DisplayNameErrorInfoL( const TDesC& aMsg ); + +private: + + /** + * Prepare GetList input data for specified folder + * @param aItemId id of folder. + */ + void PrepareGetListInputL(TInt aItemId); + + /** + * Prepare GetList filter for folders + */ + void PrepareGetListFolderFilterL(); + + /** + * Prepare GetList filter for folders + */ + void PrepareGetListFilterL(); + + /** + * Insert Liw map to Liw list + * @param aList + * @param aKey + * @param aMap + */ + void InsertToLiwListL(CLiwGenericParamList* aList, + const TDesC8& aKey, const CLiwDefaultMap* aMap); + + /** + * Externalize GetList input list + */ + void ExternalizeInputListL(); + + /** + * Internalize GetList output list + */ + void InternalizeOutputListL(); + + +protected: + + /** + * Own. + * Intance of the service handler. + */ + CHnServiceHandler* iServiceHandler; + + + /** + * Not Own. + * Pointer to the App UI. + */ + MMmActionRequest* iActionRequest; + + /** + * Own. + * Pointer to active dialog. + */ + CAknQueryDialog* iDialog; + + /** + * Flag indicating wheather dialog can be displayed. + */ + TBool iLockDialog; + + /* + * MCS sesion. + * Own. + * */ + RMenuSapi iMcs; + + /** + * GetList input and output parameter lists. + * Own. + */ + CLiwGenericParamList* iGetListInParam; + CLiwGenericParamList* iGetListOutParam; + + /** + * GetList serialized input and output parameter lists. + * Own. + */ + RBuf8 iSerializedInputList; + RBuf8 iSerializedOutputList; + + /** + * Pointer to shared resources class. + * Not owned. + */ + CMmPluginSharedResources* iSharedResources; + + }; + +#endif /*MMFOLDERCOMMAND_H*/ + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmfoldercommandadd.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmfoldercommandadd.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2007-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: Add folder command + * +*/ + + + +#ifndef MMFOLDERCOMMANDADD_H +#define MMFOLDERCOMMANDADD_H + +#include <e32base.h> +#include "mmfoldercommand.h" + + +/** + * Class representing add folder operations + * @since S60 v5.0 + */ + +/** + * CMmFolderCommandAdd is a class inherits from CMmFolderCommand. + * It's responsible for handling command adding folder to MCS. Plugin supports + * MMCreateNewFolderCommand command. It displays query, get name and executes + * MCS query creating new folder. After successfully folder creation it send + * request to HN engine to set focus on added folder. + * + * @lib mmfolderuiextensionplugin.lib + * @since S60 5.0 + * @ingroup group_mmfolderuiextensionplugin + */ +NONSHARABLE_CLASS( CMmFolderCommandAdd ) : public CMmFolderCommand + { +public: + /** + * Instantiates an object of this type. + * @return Instance of the CMmFolderCommandAdd class. + */ + static CMmFolderCommandAdd* NewL(); + + /** + * Virtual C++ Destructor. + */ + ~CMmFolderCommandAdd(); + +private: + + /** + * Performs add folder operation. + * @param aEventParamList List of the event parameters. + */ + void ExecuteActionL( CLiwGenericParamList* aEventParamList ); + + /** + * Handles notifications caused by an asynchronous Execute*CmdL call + * or an event. + * @param aCmdId The service command associated to the event. + * @param aEventId Occured event, see LiwCommon.hrh. + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL. + * @return Error code for the callback. + */ + TInt HandleNotifyL( TInt aCmdId, TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& aInParamList ); + + /** + * Handle adding folder, caalled just after the GetList + */ + void ExecuteAddFolderL(); + + /** + * Creates folder in MCS. + * @param aFolder Folder name. + */ + void CreateFolderL( const TDesC& aFolder ); + + /** + * Default C++ constructor. + */ + CMmFolderCommandAdd(); + + /** + * Second phase Symbian constructor. + */ + void ConstructL(); + + +private: + + /** + * Id of the parent folder. + */ + TInt32 iParent; + + }; + +#endif /*MMFOLDERCOMMANDADD_H*/ + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmfoldercommanddelete.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmfoldercommanddelete.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,263 @@ +/* +* Copyright (c) 2007-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: Delete folder command +* + * +*/ + + + + +#ifndef MMFOLDERCOMMANDDELETE_H +#define MMFOLDERCOMMANDDELETE_H + +#include <e32base.h> +#include <AknProgressDialog.h> // for MProgressDialogCallback +#include "mmfoldercommand.h" + +class CAknWaitDialog; + +/** + * Class representing remove folder operations. + * @since S60 v5.0 + */ + +/** + * CMmFolderCommandDelete is a class inherits from CMmFolderCommand. + * It's responsible for handling command removing folder from MCS. Plugin + * supports MMDeleteFolderCommand command. It displays confirmation dialog, + * removes item from MCS and displays notification with operation summary. + * + * @lib mmfolderuiextensionplugin.lib + * @since S60 5.0 + * @ingroup group_mmfolderuiextensionplugin + */ +NONSHARABLE_CLASS( CMmFolderCommandDelete ): + public CMmFolderCommand, + public MProgressDialogCallback + { +public: + + /** + * Instantiates an object of this type. + * @return Instance of the CMmFolderCommandDelete class. + */ + static CMmFolderCommandDelete* NewL(); + + /** + * Virtual C++ Destructor. + */ + ~CMmFolderCommandDelete(); + +protected: + /** + * Performs add folder operation. + * @param aEventParamList Parameters for operations. + */ + void ExecuteActionL( CLiwGenericParamList* aEventParamList ); + + /** + * Handles notifications caused by an asynchronous Execute*CmdL call + * or an event. + * @param aCmdId The service command associated to the event. + * @param aEventId Occured event, see LiwCommon.hrh. + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL. + * @return Error code for the callback. + */ + TInt HandleNotifyL( TInt aCmdId, TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& aInParamList ); + + /** + * Default C++ constructor. + */ + CMmFolderCommandDelete(); + + /** + * Second phase Symbian constructor. + */ + void ConstructL(); + + /** + * Displays confirmation dialog. + * @param aFolderName Name of the folder. + */ + TBool DeleteQueryL( const TDesC& aFolderName ); + + /** + * Moves focus before delete. + */ + void MoveFocusBeforeDeleteL(); + + /** + * Starts wait dialog with progress bar. + * @param aLabel Wait dialog content. + */ + void StartWaitDialogL( const TDesC& aLabel ); + + /** + * Stops wait dialog with progress bar. + */ + void StopWaitDialogL(); + + /** + * Removes item from mcs. + * @param aId Id in MCS. + * @param aFolderName Name of the folder. + */ + void DeleteItemFromMcsL( TInt aId, const TDesC& aFolderName ); + + /** + * Starts uninstallation process. + * @param aId Id in MCS. + */ + void UninstallL( TInt aId ); + + /** + * Gets application package UID. + * @param aUid UID of the application. + * @return Application package UID. + */ + TUid GetSisPackageUidL( TUid aUid ); + + /** + * Checks wheather item is a midlet. + * @param aUid UID of the item. + * @return ETrue if item is a midlet, otherwise EFalse. + */ + TBool IsMidletL( TUid aUid ); + + +private: + + /** + * Callback method from MProgressDialogCallback interface. + * Gets called when a dialog is dismissed. + * @param aButtonId Id of the pushed button. + */ + void DialogDismissedL( TInt aButtonId ); + +protected: + + /** + * Own. + * Pointer to wait dialog. + */ + CAknWaitDialog* iWaitDialog; + }; + + +/** + * Class representing remove suite operations. + * @since S60 v5.0 + */ + +/** + * CMmFolderDeleteSuite is a class deriving from CMmFolderCommandDelete. + * It's responsible for handling command removing a suite from MCS. + * + * @since S60 5.0 + * @ingroup group_mmfolderuiextensionplugin + */ +NONSHARABLE_CLASS( CMmFolderDeleteSuite ) : public CMmFolderCommandDelete + { +public: + + /** + * Virtual C++ Destructor. + */ + ~CMmFolderDeleteSuite(); + + /** + * Instantiates an object of this type. + * @return Instance of the CMmFolderDeleteSuite class. + */ + static CMmFolderDeleteSuite* NewL(); + +private: + + /** + * Performs add folder operation. + * @param aEventParamList Parameters for operations. + */ + void ExecuteActionL( CLiwGenericParamList* aEventParamList ); + + /** + * Default C++ constructor. + */ + CMmFolderDeleteSuite(); + + /** + * Second phase Symbian constructor. + */ + void ConstructL(); + + }; + + +/** + * Class representing remove application operations. + * @since S60 v5.0 + */ + +/** + * CMmFolderDeleteApp is a class deriving from CMmFolderCommandDelete. + * It's responsible for handling command removing an application from MCS. + * + * @since S60 5.0 + * @ingroup group_mmfolderuiextensionplugin + */ +NONSHARABLE_CLASS( CMmFolderDeleteApp ) : public CMmFolderCommandDelete + { +public: + + /** + * Instantiates an object of this type. + * @return Instance of the CMmFolderDeleteApp class. + */ + static CMmFolderDeleteApp* NewL(); + + /** + * Virtual C++ Destructor. + */ + ~CMmFolderDeleteApp(); + + +private: + + /** + * Performs add folder operation. + * @param aEventParamList Parameters for operations. + */ + void ExecuteActionL( CLiwGenericParamList* aEventParamList ); + + /** + * Default C++ constructor. + */ + CMmFolderDeleteApp(); + + /** + * Second phase Symbian constructor. + */ + void ConstructL(); + + }; + + +#endif /*MMFOLDERCOMMANDDELETE_H*/ + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmfoldercommandrename.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmfoldercommandrename.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2007-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: Rename folder command + * +*/ + + + + +#ifndef MMFOLDERCOMMANDRENAME_H +#define MMFOLDERCOMMANDRENAME_H + +#include <e32base.h> +#include "mmfoldercommand.h" + +/** + * CMmFolderCommandRename is a class inherits from CMmFolderCommand. + * It's responsible for handling command renaming folder in MCS. Plugin supports + * MMRenameFolderCommand command. It displays query, get name and update item + * from MCS. + * + * @lib mmfolderuiextensionplugin.lib + * @since S60 5.0 + * @ingroup group_mmfolderuiextensionplugin + */ +NONSHARABLE_CLASS( CMmFolderCommandRename ) : public CMmFolderCommand + { +public: + + /** + * Instantiates an object of this type. + * @return Instance of the CMmFolderCommandRename class. + */ + static CMmFolderCommandRename* NewL(); + + /** + * Virtual C++ Destructor. + */ + ~CMmFolderCommandRename(); + +private: + + /** + * Performs rename folder operation. + * @param aEventParamList Parameters for operations. + */ + void ExecuteActionL( CLiwGenericParamList* aEventParamList ); + + /** + * Handles notifications caused by an asynchronous Execute*CmdL call + * or an event. + * @param aCmdId The service command associated to the event. + * @param aEventId Occured event, see LiwCommon.hrh. + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL. + * @return Error code for the callback. + */ + TInt HandleNotifyL( TInt aCmdId, TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& aInParamList ); + + /** + * Gets new name of the folder. + * @param aId Id of the item. + * @param aFolderName Reference to buffer contains folder name. + */ + void RenameFolderL( TInt aId, RBuf& aFolderName ); + + /** + * Default C++ constructor. + */ + CMmFolderCommandRename(); + + /** + * Second phase Symbian constructor. + */ + void ConstructL(); + +private: + + }; + +#endif /*MMFOLDERCOMMANDRENAME_H*/ + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmfolderuiextplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmfolderuiextplugin.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2007-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: Folder UI extension plugin + * +*/ + + + +#ifndef MMFOLDERUIEXTPLUGIN_H +#define MMFOLDERUIEXTPLUGIN_H + +#include <e32base.h> +#include <liwcommon.h> +#include "mmextensionplugin.h" + +class CMmPluginSharedResources; +class CMmFolderCommand; +class MMmActionRequest; + +/** + * CMmFolderUiExtPlugin is an Ecom plugin implementation responsible for + * executing operations on folders from MCS. Plugin receives command from UI, + * creates appropriate handler and starts command handling. + * + * CMmFolderUiExtPlugin implements CMMExtensionPlugin interface. The most + * important function is ExecuteActionL which receives parameters from + * extension manager. One of those parameters is command name. Plugin is + * supporting following commands: + * - MMCreateNewFolderCommand, + * - MMRenameFolderCommand, + * - MMDeleteFolderCommand, + * - MMDeleteAppCommand, + * - MMDeleteSuiteCommand. + * If function received other command it would return KErrNotSupported error + * code. + * + * UI extension plugin need to be declared and configured in xml file as part + * of mmenu:action tag, which is inside mmenu:event tag. Any data that should + * be passed to plugin have to be defined inside mmenu:data tag as mmenu:key + * tags. + * + * @lib mmfolderuiextensionplugin.lib + * @since S60 5.0 + * @ingroup group_mmfolderuiextensionplugin + */ +NONSHARABLE_CLASS( CMmFolderUiExtPlugin ) : public CMMExtensionPlugin + { +public: + + /** + * Instantiates an object of this type. + * @return Instance of the CMmFolderUiExtPlugin class. + * @param aActionRequest Interface enabling to issues request to App UI. + */ + static CMmFolderUiExtPlugin* NewL( MMmActionRequest& aActionRequest ); + + /** + * Virtual C++ Destructor. + */ + ~CMmFolderUiExtPlugin(); + + /** + * Executes provided action. + * Has to be implemented by each UI extension plugin. + * @param aEventParamList Event parameters. + * @param aCommand Command to be executed. + * @return Error code. + */ + TInt ExecuteActionL( const TDesC& aCommand, + CLiwGenericParamList* aEventParamList ); + +protected: + /** + * Default C++ constructor. + * @param aActionRequest Interface enabling to issues request to App UI. + */ + CMmFolderUiExtPlugin( MMmActionRequest& aActionRequest ); + + /** + * Second phase Symbian constructor. + */ + void ConstructL(); + +private: + /** + * Check wheather Menu is in foreground. + * @return ETrue if Menu is in foreground, otherwise EFalse; + */ + TBool IsMatrixInForegroundL(); + +private: + + /** + * Own. + * Pointer to the folder command. + */ + CMmFolderCommand* iCommand; + + /** + * Not Own. + * Reference to the App UI. + */ + MMmActionRequest& iActionRequest; + + /** + * Own. + * Shared resources used in plugins. + * Created during first command execution. + */ + CMmPluginSharedResources* iSharedResources; + + }; + +#endif /*MMFOLDERUIEXTPLUGIN_H*/ + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmfolderuiextpluginconstants.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmfolderuiextpluginconstants.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +/* +* 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: Contatns used by folder UI extension plugin + * +*/ + + +#ifndef MMFOLDERUIEXTPLUGINCONTANTS_H +#define MMFOLDERUIEXTPLUGINCONTANTS_H + +/** + * Constants used in add folder UI extension plugin. + * For XML configuration as well. + */ + +// implemantation UID +const TInt32 KCFolderUiExtPluginUid = { 0x2001CB79 }; + +// command names, also used in XML configuration +_LIT( KAddFolderCmd, "MMCreateNewFolderCommand" ); +_LIT( KRenameFolderCmd, "MMRenameFolderCommand" ); +_LIT( KDeleteFolderCmd, "MMDeleteFolderCommand" ); +_LIT( KDeleteAppCmd, "MMDeleteAppCommand" ); +_LIT( KDeleteSuiteCmd, "MMDeleteSuiteCommand" ); +_LIT( KMoveToFolderCmd, "MMMoveToFolderCommand" ); + + +#endif /*MMFOLDERUIEXTPLUGINCONTANTS_H*/ diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmmovetofoldercommand.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmmovetofoldercommand.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,255 @@ +/* +* Copyright (c) 2007-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: Add folder command + * +*/ + + + +#ifndef MMMOVETOFOLDERCOMMAND_H +#define MMMOVETOFOLDERCOMMAND_H + +#include <e32base.h> +#include "mmfoldercommand.h" + +class CMmFolder; + +/** + * CMmMoveToFolderCommand is a class inherits from CMmFolderCommand. + * It's responsible for handling command adding folder to MCS. Plugin supports + * MMCreateNewFolderCommand command. It displays query, get name and executes + * MCS query creating new folder. After successfully folder creation it send + * request to HN engine to set focus on added folder. + * + * @lib mmfolderuiextensionplugin.lib + * @since S60 5.0 + * @ingroup group_mmfolderuiextensionplugin + */ +NONSHARABLE_CLASS( CMmMoveToFolderCommand ) : public CMmFolderCommand + { +public: + /** + * Instantiates an object of this type. + * @return Instance of the CMmMoveToFolderCommand class. + */ + static CMmMoveToFolderCommand* NewL(); + + /** + * Virtual C++ Destructor. + */ + ~CMmMoveToFolderCommand(); + +private: + + /** + * Performs add folder operation. + * @param aEventParamList List of the event parameters. + */ + void ExecuteActionL( CLiwGenericParamList* aEventParamList ); + + /** + * Handles notifications caused by an asynchronous Execute*CmdL call + * or an event. + * @param aCmdId The service command associated to the event. + * @param aEventId Occured event, see LiwCommon.hrh. + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL. + * @return Error code for the callback. + */ + TInt HandleNotifyL( TInt aCmdId, TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& aInParamList ); + + /** + * Default C++ constructor. + */ + CMmMoveToFolderCommand(); + + /** + * Second phase Symbian constructor. + */ + void ConstructL(); + + /** + * Second phase Symbian constructor. + */ + CMmFolder* CurrentFolder(); + + /** + * Selects folder. + */ + void SelectFolderL( const RPointerArray< CMmFolder >& aFolderContent ); + + /** + * Moves item with given id to another folder. + * @param aId Id of an item to be moved. + * @param aFolderId Id of the target folder. + * If KErrNotFound than item moved in + * hierarchy is the current folder. + * @param aBeforeItemId Id of the item after which an item should be + * placed. If KErrNotFound than items are placed at the end of the + * folder. + */ + void MoveToFolderL( TInt aId, TInt aFolderId, + TInt aBeforeItemId = KErrNotFound ); + + + /** + * Gets index of the selected item. + * @param aItems Folder list. + * @param aCurrentFolderId Id of the current folder. + * @return Index of the selected item. + */ + TInt SelectFolderFromListL( CDesCArrayFlat* aItems, TBool aIsRoot ); + + /** + * Provides array contains folder icons. + * @return Array of icons. + */ + CArrayPtr<CGulIcon>* GetFolderIconsL(); + + /** + * Browses folder from list. + * @param aParentId Parent folder id. + * @param aMovingItemId Id of the moving item. + * @param aDestinationFolderId Id of the selected folder. + * @param aWidgetType Type of the current widget. + */ + void BrowseFolderL( TInt aParentId, TInt aMovingItemId, + TInt& aDestinationFolderId, const TDesC& aWidgetType ); + + /** + * Displays notification. + */ + void NotificationMovingCompleteL(); + + /** + * Displays notification. + */ + void NotificationItemAlreadyStoredL(); + + /** + * Gets default name of root folder. + * @param aIdentifier Identifier of resource. + * @return Descriptor from resource. + */ + HBufC* GetFromResourceLC( TInt aIdentifier ); + + /** + * Removes last folder from opened hierarchy + */ + void StepBackInHierarchy(); + + + /** + * Handles MoveToFolder operation + */ + void ExecuteMoveToFolderL(); + + /** + * Fill aFolderArray with folders from GetList output + */ + void GetFoldersL(RPointerArray<CMmFolder >& aFolderArray); + +private: + + /** + * Id of the parent folder. + */ + TInt32 iParentId; + + TInt iItemId; + + TBool iFlagLeave; + + RBuf iWidgetType; + + RBuf iItemName; + + RBuf iFolderName; + + RPointerArray< CMmFolder > iOpenedHierarchy; + + }; + + + +NONSHARABLE_CLASS( CMmFolder ) : public CBase + { +public: + /** + * Instantiates an object of this type. + * @return Instance of the CMmMoveToFolderCommand class. + */ + static CMmFolder* NewL(); + + /** + * Virtual C++ Destructor. + */ + ~CMmFolder(); + + /** + * Setter for the folder name. + * @param aName Name of the folder. + */ + void SetNameL( const TDesC& aName ); + + /** + * Getter for the folder name. + * @return Name of the item. + */ + const TDesC& Name() const; + + /** + * Setter for the folder id. + * @param aId Id of the folder. + */ + void SetId( TInt aId ); + + /** + * Getter for the folder id. + * @return Id of the folder. + */ + TInt Id(); + +private: + /** + * Default C++ constructor. + */ + CMmFolder(); + + /** + * Second phase Symbian constructor. + */ + void ConstructL(); + +private: + /** + * Own. + * Name of the folder. + */ + RBuf iName; + + /** + * Id of the folder. + */ + TInt iId; + + }; + +#endif /*MMMOVETOFOLDERCOMMAND_H*/ + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmpluginsharedresources.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/inc/mmpluginsharedresources.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2007-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: Holds plugins shared resources +* Version : %version: 2 % << Don't touch! Updated by Synergy at check-out. +* +*/ +#ifndef CMMPLUGINSHAREDRESOURCES_H_ +#define CMMPLUGINSHAREDRESOURCES_H_ + +class CMmPluginSharedResources : public CBase + { +public: + + /** + * Instantiates an object of this type. + * @return Instance of the CMmPluginSharedResources class. + */ + static CMmPluginSharedResources* NewL(); + + /** + * Second phase Symbian constructor. + */ + void ConstructL(); + + /** + * C++ Destructor. + */ + ~CMmPluginSharedResources(); + + /** + * Getter for resource file + * @return String file path. + */ + const TDesC& GetLanguageFilePath() { return *iLanguageFilePath; } + + /** + * Getter for R_MENU_EDIT_DEFAULT_FOLDER_NAME + * @return String loaded from resource. + */ + const TDesC& GetDefaultFolderName() { return *iDefFolderName; } + + /** + * Getter for R_MENU_EDIT_FOLDER_NAME + * @return String loaded from resource. + */ + const TDesC& GetEditFolderName() { return *iEditFolderName; } + + /** + * Getter for R_MENU_EDIT_FLDR_BAD_FILE_NAME + * @return String loaded from resource. + */ + const TDesC& GetMsgBadFileName() { return *iMsgBadFileName; } + + /** + * Getter for R_MENU_EDIT_FLDR_ILLEGAL_CHARACTERS + * @return String loaded from resource. + */ + const TDesC& GetMsgIllegalCharacters() { return *iMsgBadChar; } + + /** + * Getter for R_MENU_EDIT_ROOT_FOLDER + * @return String loaded from resource. + */ + const TDesC& GetRootFolder() { return *iRootFolder; } + + /** + * Getter for R_MENU_EDIT_FLDR_DELETING_WAIT_NOTE + * @return String loaded from resource. + */ + const TDesC& GetMsgFolderDeleting() { return *iDelWaitNote; } + +private: + /** + * Resources. Own. + */ + HBufC* iLanguageFilePath; + HBufC* iDefFolderName; + HBufC* iEditFolderName; + HBufC* iMsgBadFileName; + HBufC* iMsgBadChar; + HBufC* iRootFolder; + HBufC* iDelWaitNote; + + /** + * Resource offset. + */ + TInt iResourceOffset; + }; + +#endif /* CMMPLUGINSHAREDRESOURCES_H_ */ diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/src/mmfoldercommand.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/src/mmfoldercommand.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,682 @@ +/* +* Copyright (c) 2007-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 of the folder command + * +*/ + +#include <liwcommon.h> +#include <e32base.h> +#include <eikenv.h> +#include <StringLoader.h> +#include <AknQueryDialog.h> +#include <aknnotewrappers.h> +#include <s32mem.h> + +#include "mmfoldercommand.h" +#include "mmfoldercommandadd.h" +#include "mmfoldercommandrename.h" +#include "mmfoldercommanddelete.h" +#include "mmmovetofoldercommand.h" +#include "mmdialogmanager.h" +#include "hnliwutils.h" +#include "menudebug.h" +#include "hnutils.h" + +#include "hnmdbasekey.h" +#include "hnmdkeyfactory.h" +#include "menudebug.h" +#include "hnconvutils.h" +#include "hnservicehandler.h" +#include "mmfolderuiextpluginconstants.h" +#include "mmpluginsharedresources.h" + +#include <avkon.rsg> +#include <matrixmenu.rsg> +#include <mmfolderuiextplugin.rsg> + + +const TInt KCountNotAllowedChars = 9; +// Unicode character of sign obtained by press '0' key three times. Enter key. +const TUint16 KIllegalCharEnter = 0x21b2; +// Unicode line separator character obtained by pressing Shift + Enter keys +const TUint16 KIllegalCharLineSeparator = 0x2028; +// Space unicode character. +// Characters which ascii value is smaller than 32 are not allowed. +const TUint16 KSpace = ' '; //32; + +// ============================ MEMBER FUNCTIONS ============================= +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmFolderCommand::~CMmFolderCommand() + { + iSerializedInputList.Close(); + iSerializedOutputList.Close(); + delete iGetListOutParam; + delete iGetListInParam; + iMcs.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::BaseConstructL() + { + // Init MCS session + TBuf16<KMaxFileName> buf; + buf.Copy(KMatrixMenuData); + iMcs.OpenL(buf); + iGetListInParam = CLiwGenericParamList::NewL(); + iGetListOutParam = CLiwGenericParamList::NewL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::MCSQueryExecutionL( + const TDesC8& aQueryName, + const CHnMdBaseKey* aInputData, + const CHnMdBaseKey* aFilter, + MLiwNotifyCallback* aCallback ) + { + RPointerArray< CHnMdBaseKey > data; + CleanupClosePushL( data ); + data.AppendL( aInputData ); + if ( aFilter ) + { + data.AppendL( aFilter ); + } + + CHnMdBaseKey* serviceData = HnMdKeyFactory::CreateL( + KServiceContentName, KKeyTypeString, KMatrixMenuData ); + CleanupStack::PushL( serviceData ); + + RPointerArray< CHnMdBaseKey> constructor; + CleanupClosePushL( constructor ); + constructor.AppendL( serviceData ); + CLiwGenericParamList* constructorLiw = CLiwGenericParamList::NewLC(); + CLiwGenericParamList* commandLiw = CLiwGenericParamList::NewLC(); + HnLiwUtils::SetGenericParamListL( constructor, *constructorLiw ); + HnLiwUtils::SetGenericParamListL( data, *commandLiw ); + + TBuf8< KMaxLength > interface( KMCSDataSourceInterface8 ); + if ( !aQueryName.Compare( KCmdOrganize8 ) || + !aQueryName.Compare( KCmdExecuteAction8 ) ) + { + interface.Copy( KMCSMenuContentInterface8 ); + } + + delete iServiceHandler; + iServiceHandler = NULL; + iServiceHandler = CHnServiceHandler::NewL( + KMCSService8, interface, aQueryName, + EServiceModeAsynchronous, constructorLiw, commandLiw ); + + CleanupStack::Pop( commandLiw ); + CleanupStack::Pop( constructorLiw ); + + iServiceHandler->ExecuteL( aCallback , 0 ); + + CleanupStack::PopAndDestroy( &constructor ); + CleanupStack::PopAndDestroy( serviceData ); + CleanupStack::PopAndDestroy( &data ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmFolderCommand* CMmFolderCommand::FactoryL( const TDesC& aCommand ) + { + CMmFolderCommand* ret = NULL; + if( !aCommand.Compare( KAddFolderCmd ) ) + { + ret = CMmFolderCommandAdd::NewL(); + } + else if ( !aCommand.Compare( KRenameFolderCmd ) ) + { + ret = CMmFolderCommandRename::NewL(); + } + else if ( !aCommand.Compare( KDeleteFolderCmd ) ) + { + ret = CMmFolderCommandDelete::NewL(); + } + else if ( !aCommand.Compare( KDeleteAppCmd ) ) + { + ret = CMmFolderDeleteApp::NewL(); + } + else if ( !aCommand.Compare( KDeleteSuiteCmd ) ) + { + ret = CMmFolderDeleteSuite::NewL(); + } + else if ( !aCommand.Compare( KMoveToFolderCmd ) ) + { + ret = CMmMoveToFolderCommand::NewL(); + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CMmFolderCommand::DoChangeNameL( RBuf& aFolderName, + TInt aDefaultNameLength, RBuf& aNumberInBracket, + CLiwGenericParamList& aFoldersNames, TLiwVariant& aVar, + TInt aNumberToAppend ) + { + TBool nameChanged( EFalse ); + TInt position( KErrNone ); + TInt count = aFoldersNames.FindFirst( position, KReturnValue8() ) + ->Value().AsList()->Count(); + aNumberInBracket.Delete( KOpenBracket().Length(), + aNumberInBracket.Length() - KOpenBracket().Length() ); + + if ( aNumberToAppend < KMaxDigitNumber ) + { + aNumberInBracket.AppendNum( 0 ); + } + + for ( TInt i = 0; i < count; i++ ) + { + HnLiwUtils::GetVariantL( aFoldersNames, KLongNamePath8, i, aVar ); + TPtrC longName; + aVar.Get( longName ); + if ( !aFolderName.Compare( longName ) ) + { + aNumberInBracket.AppendNum( aNumberToAppend ); + aNumberInBracket.Append( KCloseBracket ); + aFolderName.Delete( aDefaultNameLength, + aFolderName.Length() - aDefaultNameLength ); + aFolderName.Append( aNumberInBracket ); + nameChanged = ETrue; + break; + } + } + return nameChanged; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::ChangeNameIfAlreadyExistsL( RBuf& aFolderName, + CLiwGenericParamList* aFoldersNames, TInt aNumberToAppend ) + { + if ( !aFoldersNames ) + { + return; + } + TLiwVariant var; + var.PushL(); + RBuf numberInBracket; + CleanupClosePushL(numberInBracket); + numberInBracket.CreateL( KMaxLength ); + numberInBracket.Append( KOpenBracket ); + numberInBracket.AppendNum( aNumberToAppend ); + numberInBracket.Append( KCloseBracket ); + TInt defaultNameLength = aFolderName.Length(); + + while( DoChangeNameL( aFolderName, defaultNameLength, numberInBracket, + *aFoldersNames, var, ++aNumberToAppend ) ) + ; + + CleanupStack::PopAndDestroy(&numberInBracket); + CleanupStack::PopAndDestroy( &var ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CMmFolderCommand::GetFolderNameL( RBuf& aFolderName, + CLiwGenericParamList* aFoldersNames ) + { + TBool res( EFalse ); + if( aFolderName.Length() == 0 ) + { + aFolderName.Append( iSharedResources->GetDefaultFolderName() ); + ChangeNameIfAlreadyExistsL( aFolderName, aFoldersNames ); + } + + CAknTextQueryDialog* dialog = + CAknTextQueryDialog::NewL( aFolderName, CAknQueryDialog::ENoTone ); + + dialog->PrepareLC( R_MENU_FILENAME_QUERY ); + dialog->SetPromptL( iSharedResources->GetEditFolderName() ); + + SetDialogL( dialog ); + res = dialog->RunLD(); + SetDialogL( NULL ); + + return res; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::GetFolderListL( TInt aItemId ) + { + // Prepare data for GetList + iGetListInParam->Reset(); + PrepareGetListInputL( aItemId ); + PrepareGetListFolderFilterL(); + ExternalizeInputListL(); + + // Get folders list from MCS + iMcs.GetListL( iSerializedInputList, iSerializedOutputList ); + InternalizeOutputListL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::GetListL( TInt aItemId ) + { + // Prepare data for GetList + iGetListInParam->Reset(); + PrepareGetListInputL( aItemId ); + PrepareGetListFilterL(); + ExternalizeInputListL(); + + // Get folders list from MCS + iMcs.GetListL( iSerializedInputList, iSerializedOutputList ); + InternalizeOutputListL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::DisplayErrorInfoL( const TDesC& aFolderName ) + { + CAknNoteDialog* dialog = new (ELeave) CAknNoteDialog( + CAknNoteDialog::EConfirmationTone, + CAknNoteDialog::ELongTimeout ); + HBufC* msg = StringLoader::LoadLC( + R_FLDR_CANNOT_DELETE_ITEM, aFolderName ); + dialog->SetTextL( msg->Des() ); + dialog->ExecuteDlgLD( R_MENU_EDIT_INTERRUPTION_INFO ); + + CleanupStack::PopAndDestroy( msg ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::SetRequestInterface( MMmActionRequest* aActionRequest ) + { + iActionRequest = aActionRequest; + } + +void CMmFolderCommand::SetSharedResources( CMmPluginSharedResources* aResources ) + { + iSharedResources = aResources; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::SetDialogL( CAknQueryDialog* aDialog ) + { + iDialog = aDialog; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::RemoveDialogL() + { + iLockDialog = ETrue; + if( iDialog ) + { + iDialog->HandleQueryEditorStateEventL( NULL, + MAknQueryControlObserver::EEmergencyCallAttempted, + MAknQueryControlObserver::EEditorEmpty ); + iDialog = NULL; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::AddSubKeyL( CHnMdBaseKey* aInDataKey, + const TDesC8& aKeyName, + const TDesC8& aKeyType, + const TDesC8& aKeyValue ) + { + CHnMdBaseKey* key = HnMdKeyFactory::CreateL( + aKeyName, aKeyType, aKeyValue ); + CleanupStack::PushL( key ); + aInDataKey->AddSubKeyL( key ); + CleanupStack::Pop( key ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::AddSubKeyL( CHnMdBaseKey* aInDataKey, + const TDesC8& aKeyName, + const TDesC8& aKeyType, + const TDesC& aKeyValue ) + { + CHnMdBaseKey* key = HnMdKeyFactory::CreateL( + aKeyName, aKeyType, aKeyValue ); + CleanupStack::PushL( key ); + aInDataKey->AddSubKeyL( key ); + CleanupStack::Pop( key ); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmFolderCommand::FolderNameValidationL(RBuf& aFolderName, + CLiwGenericParamList* aFoldersNames) + { + TValidation allowed(EValidationOk); + + allowed = (TValidation) IllegalCharacterRemoveL(aFolderName, aFoldersNames); + if (allowed != EValidationOk) + { + return allowed; + } + allowed = (TValidation) CheckValidFileNameL(aFolderName); + if (allowed != EValidationOk) + { + // qtn_fldr_bad_file_name + // data entry (for example data query New name: qtn_fldr_item_name_prmpt ) is opened + DisplayNameErrorInfoL(iSharedResources->GetMsgBadFileName()); + return allowed; + } + allowed = (TValidation) CheckAllowedCharsL(aFolderName); + if (allowed != EValidationOk) + { + // information note "Name cannot contain + // the characters < > \\ /"" |:*?" qtn_fldr_illegal_characters is displayed. + DisplayNameErrorInfoL(iSharedResources->GetMsgIllegalCharacters()); + } + return allowed; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmFolderCommand::IllegalCharacterRemoveL(RBuf& aFolderName, + CLiwGenericParamList* aFoldersNames) + { + TValidation allowed( EValidationOk ); + // illegal characters are removed + TInt pos( 0 ); + while ( pos < aFolderName.Length() ) + { + if ( aFolderName[pos] == KIllegalCharEnter || + aFolderName[pos] == KIllegalCharLineSeparator ) + { + aFolderName.Delete( pos, 1 ); + } + else + { + ++pos; + } + } + if (aFolderName.Length() == 0) + { + aFolderName.Append(iSharedResources->GetDefaultFolderName()); + ChangeNameIfAlreadyExistsL(aFolderName, aFoldersNames); + return allowed; + } + // only space character is not allowed + RBuf trimBuf; + CleanupClosePushL(trimBuf); + trimBuf.CreateL(aFolderName.Length()); + trimBuf.Copy(aFolderName); + trimBuf.Trim(); + if (!trimBuf.Length()) + { + allowed = EValidationInvalid; + } + CleanupStack::PopAndDestroy(&trimBuf); + + return allowed; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmFolderCommand::CheckValidFileNameL( const TDes& aFolderName ) + { + TValidation allowed(EValidationOk); + _LIT( KSingleDot, "."); + _LIT( KDoubleDot, ".."); + + if (!aFolderName.Compare( KSingleDot) || + !aFolderName.Compare( KDoubleDot ) || + aFolderName.Length() > KMaxFileName) + { + allowed = EValidationInvalid; + } + else + { + // characters with ascii value less than 32 + for (TInt index(0); index < aFolderName.Length(); index++) + { + if (aFolderName[index] < KSpace) + { + allowed = EValidationInvalid; + } + } + } + return allowed; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmFolderCommand::CheckAllowedCharsL( const TDes& aFolderName ) + { + TValidation allowed(EValidationOk); + + for (TInt index(0); index < aFolderName.Length(); index++) + { + for (TInt c(0); c < KCountNotAllowedChars; c++) + { + if (TChar( KNotAllowedChars[c] ) == aFolderName[index]) + { + allowed = EValidationNotAllowed; + } + } + } + + return allowed; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::DisplayNameErrorInfoL( const TDesC& aMsg ) + { + CAknNoteDialog* dialog = new (ELeave) CAknNoteDialog( + CAknNoteDialog::EConfirmationTone, + CAknNoteDialog::ELongTimeout ); + dialog->SetTextL( aMsg ); + dialog->ExecuteDlgLD( R_MENU_EDIT_MOVING_ABORT_NOTIFICATION ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::PrepareGetListInputL(TInt aItemId) + { + CLiwDefaultMap* inputMap = CLiwDefaultMap::NewLC(); + + // Specify GetList input data + inputMap->InsertL( KIdAttrName8, TLiwVariant( TInt32( aItemId ) ) ); // Item id + inputMap->InsertL( KRecursiveSearch8, TLiwVariant( TBool ( EFalse ) ) ); // Recursive Search + inputMap->InsertL( KFlatResult8, TLiwVariant ( TBool ( ETrue ) ) ); // Flat GetList + inputMap->InsertL( KParentOnly8, TLiwVariant ( TBool ( EFalse ) ) ); // Get children + + // Fill GetList input param list + InsertToLiwListL(iGetListInParam, KInData8, inputMap); + + CleanupStack::PopAndDestroy(inputMap); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::PrepareGetListFolderFilterL() + { + // Specify GetList filter + CLiwDefaultMap* folderFilter = CLiwDefaultMap::NewLC(); + folderFilter->InsertL( KTypeAttrName8, TLiwVariant( KMenuFolder ) ); // Folders + + folderFilter->InsertL( KHidden8, TLiwVariant( TBool(EFalse) ) ); // Not Hidden + folderFilter->InsertL( KDeleteLocked8, TLiwVariant( TBool(EFalse) ) ); // Not locked + + // Fill GetList input param list + InsertToLiwListL(iGetListInParam, KFilter8, folderFilter); + + CleanupStack::PopAndDestroy(folderFilter); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::PrepareGetListFilterL() + { + // Specify GetList filter + CLiwDefaultMap* folderFilter = CLiwDefaultMap::NewLC(); + + folderFilter->InsertL( KHidden8, TLiwVariant( TBool(EFalse) ) ); // Not Hidden + folderFilter->InsertL( KMissing8, TLiwVariant( TBool(EFalse) ) ); // Not Missing + + // Fill GetList input param list + InsertToLiwListL(iGetListInParam, KFilter8, folderFilter); + + CleanupStack::PopAndDestroy(folderFilter); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::InsertToLiwListL(CLiwGenericParamList* aList, + const TDesC8& aKey, const CLiwDefaultMap* aMap) + { + TLiwVariant liwVar; + liwVar.Set( aMap ); + liwVar.PushL(); + TLiwGenericParam livGenParam( aKey, liwVar ); + livGenParam.PushL(); + aList->AppendL ( livGenParam ); + CleanupStack::PopAndDestroy( &livGenParam ); + CleanupStack::PopAndDestroy( &liwVar ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::ExternalizeInputListL() + { + iSerializedInputList.Close(); + iSerializedOutputList.Close(); + iSerializedInputList.CreateL( iGetListInParam->Size() ); + RDesWriteStream datastrm( iSerializedInputList ); + CleanupClosePushL(datastrm); + iGetListInParam->ExternalizeL(datastrm); + datastrm.CommitL(); + CleanupStack::PopAndDestroy(&datastrm); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommand::InternalizeOutputListL() + { + iGetListOutParam->Reset(); + if (iSerializedOutputList.Size()) + { + RDesReadStream stream( iSerializedOutputList ); + CleanupClosePushL( stream ); + iGetListOutParam->InternalizeL( stream ) ; + CleanupStack::PopAndDestroy(&stream); + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmFolderCommand::GetIntL( + const CLiwGenericParamList& aParam, const TDesC8& aPath ) + { + TInt pos( 0 ); + const TLiwGenericParam* param = aParam.FindFirst( pos, aPath ); + if( pos != KErrNotFound && param ) + { + return param->Value().AsTInt32(); + } + return KErrNotFound; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TPtrC CMmFolderCommand::GetStringL( + const CLiwGenericParamList& aParam, const TDesC8& aPath ) + { + TInt pos( 0 ); + const TLiwGenericParam* param = aParam.FindFirst( pos, aPath ); + if( pos != KErrNotFound && param ) + { + return param->Value().AsDes(); + } + TPtrC ret( KNullDesC16 ); + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CMmFolderCommand::GetBoolL( + const CLiwGenericParamList& aParam, const TDesC8& aPath ) + { + TInt pos( 0 ); + const TLiwGenericParam* param = aParam.FindFirst( pos, aPath ); + if( pos != KErrNotFound && param ) + { + return param->Value().AsTBool(); + } + return EFalse; + } + +// end of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/src/mmfoldercommandadd.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/src/mmfoldercommandadd.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,189 @@ +/* +* Copyright (c) 2007-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: Add folder command + * Version : %version: 19.1.7 % << Don't touch! Updated by Synergy at check-out. + * +*/ + + +#include <liwcommon.h> + +#include "mmfoldercommandadd.h" +#include "hnglobals.h" +#include "menudebug.h" +#include "hnconvutils.h" + +#include "hnmdbasekey.h" +#include "hnmdkeyfactory.h" +#include "menudebug.h" +#include "mmactionrequest.h" +#include "hnservicehandler.h" + +_LIT8( KItemLock, "item_lock" ); + +// ============================ MEMBER FUNCTIONS ============================= + +// --------------------------------------------------------------------------- +// Symbian factory function. +// --------------------------------------------------------------------------- +// +CMmFolderCommandAdd* CMmFolderCommandAdd::NewL() + { + CMmFolderCommandAdd* self = new( ELeave ) CMmFolderCommandAdd(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// Symbian second phase constructor. +// --------------------------------------------------------------------------- +// +void CMmFolderCommandAdd::ConstructL() + { + BaseConstructL(); + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMmFolderCommandAdd::~CMmFolderCommandAdd() + { + delete iServiceHandler; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmFolderCommandAdd::CMmFolderCommandAdd() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmFolderCommandAdd::HandleNotifyL( TInt /*aCmdId*/, + TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/ ) + { + if( aEventId != KLiwEventCanceled ) + { + TInt pos( 0 ); + aEventParamList.FindFirst( pos, KIdAttrName8 ); + if (pos != KErrNotFound) + { + CLiwGenericParamList* list = CLiwGenericParamList::NewLC(); + TLiwGenericParam command( KHnRequest, TLiwVariant( KSetFocus ) ); + TLiwGenericParam dataId( + KItemCustomId8, aEventParamList[pos].Value() ); + TLiwGenericParam dataParentId( + KSuiteCustomId8, TLiwVariant( iParent ) ); + + list->AppendL( dataId ); + list->AppendL( dataParentId ); + list->AppendL( command ); + + iActionRequest->HandleRequestL( *list ); + CleanupStack::PopAndDestroy( list ); + } + MMPERF(("CFolderUiExtPlugin::AddFolderCommandL - END")); + } + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommandAdd::ExecuteAddFolderL() + { + MMPERF(("\t Show dialog - START")); + RBuf folder; + CleanupClosePushL( folder ); + folder.CreateL( KMaxFileName ); + + TInt changed( KErrNone); + TInt allowed( EValidationInvalid ); + do + { + changed = GetFolderNameL(folder, iGetListOutParam); + if (changed && folder.Length() > 0) + { + allowed = FolderNameValidationL(folder, iGetListOutParam); + } + } + while (allowed != EValidationOk && changed); + MMPERF(("\t Show Dialog - END")); + if (changed && allowed == EValidationOk) + { + MMPERF(("\t\t Create folder - START")); + CreateFolderL( folder ); + MMPERF(("\t\t Create folder - END")); + } + CleanupStack::PopAndDestroy( &folder ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommandAdd::ExecuteActionL( + CLiwGenericParamList* aEventParamList ) + { + MMPERF(("CFolderUiExtPlugin::AddFolderCommandL - START")); + ASSERT( aEventParamList ); + TBool lock = GetBoolL( *aEventParamList, KItemLock ); + if( !lock ) + { + iParent = GetIntL( *aEventParamList, KItemTypeFolder8 ); + GetFolderListL( iParent ); + ExecuteAddFolderL(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommandAdd::CreateFolderL( const TDesC& aFolder ) + + { + HBufC8* parentTemp = HnConvUtils::NumToStr8LC( iParent ); + + CHnMdBaseKey* inDataKey = HnMdKeyFactory::CreateL( + KInData8, KKeyTypeMap, KDefaultParentId ); + CleanupStack::PushL( inDataKey ); + + AddSubKeyL( inDataKey, KType8, KKeyTypeString, KMenuFolder8 ); + AddSubKeyL( inDataKey, KDeleteLocked8, KKeyTypeBoolean, KStringFalse8 ); + AddSubKeyL( inDataKey, KMcsAppGroupName8, KKeyTypeString, aFolder ); + AddSubKeyL( inDataKey, KMcsTitleName8, KKeyTypeString, aFolder ); + AddSubKeyL( inDataKey, KMcsShortName8, KKeyTypeString, aFolder ); + AddSubKeyL( inDataKey, KMcsLongName8, KKeyTypeString, aFolder ); + AddSubKeyL( inDataKey, KParentId8, KKeyTypeInteger, *parentTemp ); + + MCSQueryExecutionL( KCmdAdd8, inDataKey, NULL, this ); + + CleanupStack::PopAndDestroy( inDataKey ); + CleanupStack::PopAndDestroy( parentTemp ); + } + +// end of file + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/src/mmfoldercommanddelete.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/src/mmfoldercommanddelete.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,395 @@ +/* +* Copyright (c) 2007-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: Delete folder command + * +*/ + + +#include <liwcommon.h> +#include <e32base.h> +#include <eikenv.h> +#include <StringLoader.h> +#include <aknnotedialog.h> +#include <AknQueryDialog.h> +#include <AknWaitDialog.h> + +#include "mmfoldercommanddelete.h" +#include "mmdialogmanager.h" +#include "mmactionrequest.h" +#include "hnglobals.h" +#include "hnliwutils.h" +#include "menudebug.h" +#include "hnutils.h" + +#include "hnmdbasekey.h" +#include "hnmdkeyfactory.h" +#include "menudebug.h" +#include "hnconvutils.h" +#include "hnservicehandler.h" +#include "mmpluginsharedresources.h" + +#include <avkon.rsg> +#include <matrixmenu.rsg> +#include <mmfolderuiextplugin.rsg> + + +_LIT8( KChildrenCount8, "children_count" ); + +// ============================ MEMBER FUNCTIONS ============================= +// --------------------------------------------------------------------------- +// Symbian factory function. +// --------------------------------------------------------------------------- +// +CMmFolderCommandDelete* CMmFolderCommandDelete::NewL() + { + CMmFolderCommandDelete* self = new( ELeave ) CMmFolderCommandDelete(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// Symbian second phase constructor. +// --------------------------------------------------------------------------- +// +void CMmFolderCommandDelete::ConstructL() + { + BaseConstructL(); + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMmFolderCommandDelete::~CMmFolderCommandDelete() + { + delete iServiceHandler; + if( iWaitDialog ) + { + delete iWaitDialog; + } + } + +// --------------------------------------------------------------------------- +// Default C++ constructor. +// --------------------------------------------------------------------------- +// +CMmFolderCommandDelete::CMmFolderCommandDelete() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmFolderCommandDelete::HandleNotifyL( TInt /*aCmdId*/, + TInt aEventId, + CLiwGenericParamList& /* aEventParamList */, + const CLiwGenericParamList& /*aInParamList*/ ) + { + if( aEventId != KLiwEventCanceled ) + { + StopWaitDialogL(); + MMPERF(("CFolderUiExtPlugin::DeleteFolderCommandL - END")); + } + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommandDelete::ExecuteActionL( + CLiwGenericParamList* aEventParamList ) + { + MMPERF(("CFolderUiExtPlugin::DeleteFolderCommandL - START")); + TInt id = GetIntL( *aEventParamList, KIdAttrName8 ); + TPtrC currentName = GetStringL( *aEventParamList, KName8 ); + TInt32 childrenCount = GetIntL( *aEventParamList, KChildrenCount8 ); + + if( childrenCount == 0 ) + { + if( DeleteQueryL( currentName ) ) + { + DeleteItemFromMcsL( id, currentName ); + + CLiwGenericParamList* list = CLiwGenericParamList::NewLC(); + TLiwGenericParam command( KHnRequest, TLiwVariant( KDisableActionsForItem ) ); + TLiwGenericParam itemCustomId( + KItemCustomId8, TLiwVariant( static_cast<TInt32>( id ) ) ); + list->AppendL( itemCustomId ); + list->AppendL( command ); + iActionRequest->HandleRequestL( *list ); + CleanupStack::PopAndDestroy( list ); + } + } + else + { + DisplayErrorInfoL( currentName ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommandDelete::MoveFocusBeforeDeleteL() + { + CLiwGenericParamList* list = CLiwGenericParamList::NewLC(); + TLiwGenericParam command( KHnRequest, TLiwVariant( KMoveFocusBeforeDelete ) ); + + list->AppendL( command ); + + iActionRequest->HandleRequestL( *list ); + CleanupStack::PopAndDestroy( list ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommandDelete::StartWaitDialogL( const TDesC& aLabel ) + { + if( iWaitDialog ) + { + delete iWaitDialog; + iWaitDialog = NULL; + } + + // For the wait dialog + iWaitDialog = new (ELeave) CAknWaitDialog( + REINTERPRET_CAST( CEikDialog**, &iWaitDialog ) ); + iWaitDialog->SetCallback( this ); + iWaitDialog->SetTextL( aLabel ); + iWaitDialog->ExecuteLD( R_MENU_WAIT_DIALOG ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommandDelete::DialogDismissedL(TInt /*aButtonId*/) + { + // No implementation required. + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommandDelete::StopWaitDialogL() + { + if( iWaitDialog ) + { + iWaitDialog->ProcessFinishedL(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CMmFolderCommandDelete::DeleteQueryL( const TDesC& aFolderName ) + { + HBufC* msg = StringLoader::LoadLC( + R_MENU_EDIT_DELETE_QUERY_TEXT, aFolderName ); + CAknQueryDialog* dialog = CAknQueryDialog::NewL(); + SetDialogL( dialog ); + TBool result( dialog->ExecuteLD( R_MENU_EDIT_DELETE_QUERY, *msg ) ); + SetDialogL( NULL ); + CleanupStack::PopAndDestroy( msg ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommandDelete::DeleteItemFromMcsL( + TInt aId, const TDesC& aFolderName ) + { + MMPERF(("\t\t Delete folder - START")); + + GetListL( aId ); + TInt pos( 0 ); + TInt count( 0 ); + const TLiwGenericParam* res = + iGetListOutParam->FindFirst( pos, KReturnValue8() ); + if( pos != KErrNotFound && res ) + { + count = res->Value().AsList()->Count(); + } + + if( count == 0 ) + { + StartWaitDialogL( iSharedResources->GetMsgFolderDeleting() ); + CHnMdBaseKey* inDataKey = HnMdKeyFactory::CreateL( + KInData8, KKeyTypeMap, KDefaultParentId8 ); + CleanupStack::PushL( inDataKey ); + + HBufC8* id = HnConvUtils::NumToStr8LC( aId ); + AddSubKeyL( inDataKey, KIdParam, KKeyTypeInteger, *id ); + MCSQueryExecutionL( KCmdDelete8, inDataKey, NULL, this ); + + CleanupStack::PopAndDestroy( id ); + CleanupStack::PopAndDestroy( inDataKey ); + } + else + { + HBufC* message = StringLoader::LoadLC( + R_FLDR_CANNOT_DELETE_ITEM, aFolderName ); + CAknNoteDialog* dialog = new (ELeave) CAknNoteDialog( + CAknNoteDialog::EConfirmationTone, + CAknNoteDialog::ELongTimeout ); + dialog->SetTextL( message->Des() ); + dialog->ExecuteDlgLD( R_MENU_EDIT_MOVING_ABORT_NOTIFICATION ); + + CleanupStack::PopAndDestroy( message ); + } + + MMPERF(("\t\t Delete folder - END")); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommandDelete::UninstallL( TInt aId ) + { + MMPERF(("\t\t Delete folder - START")); + + CHnMdBaseKey* inDataKey = HnMdKeyFactory::CreateL( + KInData8, KKeyTypeMap, KDefaultParentId8 ); + CleanupStack::PushL( inDataKey ); + + HBufC8* id = HnConvUtils::NumToStr8LC( aId ); + AddSubKeyL( inDataKey, KIdParam, KKeyTypeInteger, *id ); + AddSubKeyL( inDataKey, KAction, KKeyTypeString8, KActionRemove ); + MCSQueryExecutionL( KCmdExecuteAction8, inDataKey, NULL, this ); + + CleanupStack::PopAndDestroy( id ); + CleanupStack::PopAndDestroy( inDataKey ); + + MMPERF(("\t\t Delete folder - END")); + } + + +// --------------------------------------------------------------------------- +// Symbian factory function. +// --------------------------------------------------------------------------- +// +CMmFolderDeleteSuite* CMmFolderDeleteSuite::NewL() + { + CMmFolderDeleteSuite* self = new( ELeave ) CMmFolderDeleteSuite(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// Symbian second phase constructor. +// --------------------------------------------------------------------------- +// +void CMmFolderDeleteSuite::ConstructL() + { + } + + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMmFolderDeleteSuite::~CMmFolderDeleteSuite() + { + } + +// --------------------------------------------------------------------------- +// Default C++ constructor. +// --------------------------------------------------------------------------- +// +CMmFolderDeleteSuite::CMmFolderDeleteSuite() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderDeleteSuite::ExecuteActionL( + CLiwGenericParamList* /* aEventParamList */ ) + { +// TPtrC currentName = GetStringL( *aEventParamList, KName8 ); + } + +// --------------------------------------------------------------------------- +// Symbian factory function. +// --------------------------------------------------------------------------- +// +CMmFolderDeleteApp* CMmFolderDeleteApp::NewL() + { + CMmFolderDeleteApp* self = new( ELeave ) CMmFolderDeleteApp(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// Symbian second phase constructor. +// --------------------------------------------------------------------------- +// +void CMmFolderDeleteApp::ConstructL() + { + + } + + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMmFolderDeleteApp::~CMmFolderDeleteApp() + { + + } + +// --------------------------------------------------------------------------- +// Default C++ constructor. +// --------------------------------------------------------------------------- +// +CMmFolderDeleteApp::CMmFolderDeleteApp() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderDeleteApp::ExecuteActionL( + CLiwGenericParamList* aEventParamList ) + { + MMPERF(("CMmFolderDeleteApp::DeleteAppCommandL - START")); + TInt id = GetIntL( *aEventParamList, KIdAttrName8 ); + UninstallL( id ); + } + +// end of file + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/src/mmfoldercommandrename.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/src/mmfoldercommandrename.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2007-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: Rename folder command + * +*/ + + + +#include <liwcommon.h> + +#include "mmfoldercommandrename.h" +#include "mmactionrequest.h" +#include "hnglobals.h" +#include "menudebug.h" +#include "hnconvutils.h" +#include "hnmdbasekey.h" +#include "hnmdkeyfactory.h" +#include "menudebug.h" +#include "hnservicehandler.h" + +// ============================ MEMBER FUNCTIONS ============================= + +// --------------------------------------------------------------------------- +// Symbian factory function. +// --------------------------------------------------------------------------- +// +CMmFolderCommandRename* CMmFolderCommandRename::NewL() + { + CMmFolderCommandRename* self = new( ELeave ) CMmFolderCommandRename(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// Symbian second phase constructor. +// --------------------------------------------------------------------------- +// +void CMmFolderCommandRename::ConstructL() + { + BaseConstructL(); + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMmFolderCommandRename::~CMmFolderCommandRename() + { + delete iServiceHandler; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmFolderCommandRename::CMmFolderCommandRename() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmFolderCommandRename::HandleNotifyL( TInt /*aCmdId*/, + TInt /*aEventId*/, + CLiwGenericParamList& /*aEventParamList*/, + const CLiwGenericParamList& /*aInParamList*/ ) + { + MMPERF(("CFolderUiExtPlugin::RenameFolderCommandL - END")); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommandRename::ExecuteActionL( + CLiwGenericParamList* aEventParamList ) + { + MMPERF(("CFolderUiExtPlugin::RenameFolderCommandL - START")); + TInt id = GetIntL( *aEventParamList, KIdAttrName8 ); + TPtrC currentName = GetStringL( *aEventParamList, KName8 ); + + RBuf folder; + CleanupClosePushL( folder ); + folder.CreateL( KMaxFileName ); + folder.Copy( currentName ); + + MMPERF(("\t Show dialog")); + TInt changed( KErrNone); + TInt allowed( EValidationInvalid ); + do + { + changed = GetFolderNameL( folder ); + if (changed && folder.Length() > 0) + { + allowed = FolderNameValidationL( folder ); + } + } + while (allowed != EValidationOk && changed); + + if( changed && allowed == EValidationOk ) + { + MMPERF(("\t\t Rename folder - START")); + RenameFolderL( id , folder ); + CLiwGenericParamList* list = CLiwGenericParamList::NewLC(); + TLiwGenericParam command( KHnRequest, TLiwVariant( KDisableActionsForItem ) ); + TLiwGenericParam itemCustomId( + KItemCustomId8, TLiwVariant( static_cast<TInt32>( id ) ) ); + list->AppendL( itemCustomId ); + list->AppendL( command ); + iActionRequest->HandleRequestL( *list ); + CleanupStack::PopAndDestroy( list ); + MMPERF(("\t\t Rename folder - END")); + } + + CleanupStack::PopAndDestroy( &folder ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolderCommandRename::RenameFolderL( TInt aId, RBuf& aFolderName ) + { + HBufC8* id = HnConvUtils::NumToStr8LC( aId ); + + CHnMdBaseKey* inDataKey = HnMdKeyFactory::CreateL( + KInData8, KKeyTypeMap, KDefaultParentId ); + CleanupStack::PushL( inDataKey ); + + AddSubKeyL( inDataKey, KIdParam, KKeyTypeInteger, *id ); + AddSubKeyL( inDataKey, KMcsTitleName8, KKeyTypeString, aFolderName ); + AddSubKeyL( inDataKey, KMcsShortName8, KKeyTypeString, aFolderName ); + AddSubKeyL( inDataKey, KMcsLongName8, KKeyTypeString, aFolderName ); + + MCSQueryExecutionL( KCmdAdd8, inDataKey, NULL, this ); + + CleanupStack::PopAndDestroy( inDataKey ); + CleanupStack::PopAndDestroy( id ); + } + +// end of file + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/src/mmfolderuiextplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/src/mmfolderuiextplugin.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,148 @@ +/* +* Copyright (c) 2007-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: Folder UI extension plugin + * +*/ + + + +#include <liwcommon.h> + +#include "mmpluginsharedresources.h" +#include "menudebug.h" +#include "mmfolderuiextplugin.h" +#include "mmfolderuiextpluginconstants.h" +#include "mmfoldercommand.h" +#include "hnglobals.h" +#include "mmguiconstants.h" +#include <apgwgnam.h> +#include <w32std.h> +#include <apgtask.h> +#include <AknQueryDialog.h> + +// ============================ MEMBER FUNCTIONS ============================= +// --------------------------------------------------------------------------- +// Symbian factory function. +// --------------------------------------------------------------------------- +// +CMmFolderUiExtPlugin* CMmFolderUiExtPlugin::NewL( + MMmActionRequest& aActionRequest ) + { + CMmFolderUiExtPlugin* self = + new( ELeave ) CMmFolderUiExtPlugin( aActionRequest ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Symbian second phase constructor. +// --------------------------------------------------------------------------- +// +void CMmFolderUiExtPlugin::ConstructL() + { + iSharedResources = NULL; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMmFolderUiExtPlugin::~CMmFolderUiExtPlugin() + { + delete iCommand; + iCommand = NULL; + delete iSharedResources; + iSharedResources = NULL; + } + + +// --------------------------------------------------------------------------- +// Default C++ constructor. +// --------------------------------------------------------------------------- +// +CMmFolderUiExtPlugin::CMmFolderUiExtPlugin( MMmActionRequest& aActionRequest ): + iActionRequest( aActionRequest ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmFolderUiExtPlugin::ExecuteActionL( const TDesC& aCommand, + CLiwGenericParamList* aEventParamList ) + { + TInt err = KErrNone; + DEBUG16( ( "\t_MM_: CMmFolderUiExtPlugin::ExecuteActionL(): %S", + &aCommand ) ); + + if( !aCommand.Compare( KCommandDeleteDialog ) && iCommand ) + { + iCommand->RemoveDialogL(); + } + else if( IsMatrixInForegroundL() ) + { + // Resources lazy initialization + if (!iSharedResources) + { + iSharedResources = CMmPluginSharedResources::NewL(); + } + + delete iCommand; + iCommand = NULL; + iCommand = CMmFolderCommand::FactoryL( aCommand ); + if( iCommand ) + { + iCommand->SetRequestInterface( &iActionRequest ); + iCommand->SetSharedResources( iSharedResources ); + iCommand->ExecuteActionL( aEventParamList ); + } + else + { + DEBUG16( ( "\t_MM_: Unsupported command: %S", &aCommand ) ); + err = KErrNotSupported; + } + } + + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CMmFolderUiExtPlugin::IsMatrixInForegroundL() + { + TBool res( EFalse ); + RWsSession wsSession; + User::LeaveIfError( wsSession.Connect() ); + CleanupClosePushL( wsSession ); + TApaTaskList taskList = TApaTaskList( wsSession ); + TApaTask foregroundTask = taskList.FindByPos( 0 ); + CApaWindowGroupName* wgName = + CApaWindowGroupName::NewLC( wsSession, foregroundTask.WgId() ); + if( wgName->AppUid() == KUidMatrixMenuApp ) + { + res = ETrue; + } + CleanupStack::PopAndDestroy( wgName ); + CleanupStack::PopAndDestroy( &wsSession ); + return res; + } + + +// end of file + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/src/mmmovetofoldercommand.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/src/mmmovetofoldercommand.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,637 @@ +/* +* Copyright (c) 2007-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: Add folder command + * +*/ + + +#include <liwcommon.h> + +#include "mmmovetofoldercommand.h" +#include "hnglobals.h" +#include "menudebug.h" +#include "hnconvutils.h" +#include "hnliwutils.h" +#include "hnutils.h" + +#include "hnmdbasekey.h" +#include "hnmdkeyfactory.h" +#include "menudebug.h" +#include "mmactionrequest.h" +#include "hnservicehandler.h" +#include "mmpluginsharedresources.h" + +#include <StringLoader.h> +#include <liwcommon.h> +#include <avkon.rsg> +#include <avkon.mbg> +#include <AknIconArray.h> +#include <AknIconUtils.h> +#include <aknnotedialog.h> +#include <mmf/common/mmfcontrollerpluginresolver.h> +#include <mmfolderuiextplugin.rsg> +#include <matrixmenu.rsg> + +_LIT( KFolderClosed, "0\t" ); +_LIT( KFolderOpened, "1\t" ); +const TInt KSoftkeyBack( 0 ); + +// ============================ MEMBER FUNCTIONS ============================= + +// --------------------------------------------------------------------------- +// Symbian factory function. +// --------------------------------------------------------------------------- +// +CMmMoveToFolderCommand* CMmMoveToFolderCommand::NewL() + { + CMmMoveToFolderCommand* self = new( ELeave ) CMmMoveToFolderCommand(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// Symbian second phase constructor. +// --------------------------------------------------------------------------- +// +void CMmMoveToFolderCommand::ConstructL() + { + BaseConstructL(); + iLockDialog = EFalse; + iFlagLeave = EFalse; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMmMoveToFolderCommand::~CMmMoveToFolderCommand() + { + iItemName.Close(); + iFolderName.Close(); + iWidgetType.Close(); + iOpenedHierarchy.ResetAndDestroy(); + iOpenedHierarchy.Close(); + delete iServiceHandler; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmMoveToFolderCommand::CMmMoveToFolderCommand() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmMoveToFolderCommand::HandleNotifyL( + TInt /*aCmdId*/, + TInt aEventId, + CLiwGenericParamList& /*aEventParamList*/, + const CLiwGenericParamList& /*aInParamList*/ ) + { + if (aEventId != KLiwEventCanceled) + { + NotificationMovingCompleteL(); + iItemName.Close(); + iFolderName.Close(); + } + return KErrNone; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmMoveToFolderCommand::ExecuteActionL( + CLiwGenericParamList* aEventParamList ) + { + + // + // Prepare move to folder operation + MMPERF(("CMmMoveToFolderCommand::ExecuteActionL - START")); + iItemId = GetIntL( *aEventParamList, KIdAttrName8 ); + iParentId = GetIntL( *aEventParamList, KFolderAttrName8 ); + TPtrC widget = GetStringL( *aEventParamList, KWidgetAttrName8 ); + TPtrC currentTempName = GetStringL( *aEventParamList, KName8 ); + + iItemName.Close(); + iItemName.CreateL( currentTempName ); + + iWidgetType.Close(); + iWidgetType.CreateL( widget ); + + CMmFolder* rootFolder = CMmFolder::NewL(); + CleanupStack::PushL( rootFolder ); + + rootFolder->SetNameL( iSharedResources->GetRootFolder()); + rootFolder->SetId( KRootId ); + iOpenedHierarchy.AppendL( rootFolder ); + CleanupStack::Pop( rootFolder ); + iLockDialog = EFalse; + + // Excute move to folder operation + TInt err( KErrNone ); + + // Get folder list form MCS + GetFolderListL( CurrentFolder()->Id() ); + + RPointerArray< CMmFolder > folders; + CleanupResetAndDestroyPushL( folders ); + + // Get folders from GetList output + GetFoldersL(folders); + + // if foler already exists, reopen options menu + do + { + TRAP( err, ExecuteMoveToFolderL()); + } + while ( err == KErrAlreadyExists && folders.Count() > 0 ); + + // if any different leave was trapped, pass it on + if ( err != KErrNone ) + { + User::Leave( err ); + } + + CleanupStack::PopAndDestroy( &folders ); + //MMPERF(("CFolderUiExtPlugin::AddFolderCommandL - END")); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmFolder* CMmMoveToFolderCommand::CurrentFolder() + { + ASSERT( iOpenedHierarchy.Count() > 0 ); + return iOpenedHierarchy[ iOpenedHierarchy.Count() - 1 ]; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmMoveToFolderCommand::MoveToFolderL( TInt aId, TInt aFolderId, + TInt aBeforeItemId ) + { + if( aFolderId != iParentId ) + { + CHnMdBaseKey* inDataKey = HnMdKeyFactory::CreateL( + KInData8, KKeyTypeMap, KDefaultParentId8 ); + CleanupStack::PushL( inDataKey ); + CHnMdBaseKey* listIds = HnMdKeyFactory::CreateL( + KIdsList, KKeyTypeList, KNullDesC8 ); + + HBufC8* id = HnConvUtils::NumToStr8LC( aId ); + AddSubKeyL( listIds, KIdParam, KKeyTypeBoolean, *id ); + CleanupStack::PopAndDestroy(); + + inDataKey->AddSubKeyL( listIds ); + HBufC8* folderId = HnConvUtils::NumToStr8LC( aFolderId ); + AddSubKeyL( inDataKey, KFolderId8, KKeyTypeBoolean, *folderId ); + CleanupStack::PopAndDestroy( folderId ); + + if( aBeforeItemId != KErrNotFound ) + { + HBufC8* itemId = HnConvUtils::NumToStr8LC( aBeforeItemId ); + AddSubKeyL( inDataKey, KBeforeItemId8, KKeyTypeBoolean, *itemId ); + CleanupStack::PopAndDestroy( itemId ); + } + MCSQueryExecutionL( KCmdOrganize8, inDataKey, NULL, this ); + iOpenedHierarchy.ResetAndDestroy(); + + CleanupStack::PopAndDestroy( inDataKey ); + CLiwGenericParamList* list = CLiwGenericParamList::NewLC(); + TLiwGenericParam command( KHnRequest, TLiwVariant( KDisableActionsForItem ) ); + TLiwGenericParam itemCustomId( + KItemCustomId8, TLiwVariant( static_cast<TInt32>( aId ) ) ); + list->AppendL( itemCustomId ); + list->AppendL( command ); + iActionRequest->HandleRequestL( *list ); + CleanupStack::PopAndDestroy( list ); + } + else + { + NotificationItemAlreadyStoredL(); + if( iOpenedHierarchy.Count() > 0 && !iLockDialog ) + { + if( CurrentFolder()->Id() == iParentId && iParentId != KRootId ) + { + StepBackInHierarchy(); + } + else if ( iParentId == KRootId ) + { + User::Leave( KErrAlreadyExists ); + } + } + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmMoveToFolderCommand::SelectFolderL( + const RPointerArray< CMmFolder >& aFolderContent ) + { + CDesCArrayFlat* folders = + new( ELeave )CDesCArrayFlat( aFolderContent.Count() + 1 ); + CleanupStack::PushL( folders ); + RBuf currentFolder; + CleanupClosePushL( currentFolder ); + currentFolder.CreateL( + KFolderOpened().Length() + CurrentFolder()->Name().Length() ); + currentFolder.Append( KFolderOpened ); + currentFolder.Append( CurrentFolder()->Name() ); + folders->AppendL( currentFolder ); + + for( int i( 0 ); i<aFolderContent.Count(); i++ ) + { + CMmFolder* folder = aFolderContent[ i ]; + RBuf name; + CleanupClosePushL( name ); + name.CreateL( KFolderClosed().Length() + folder->Name().Length() ); + name.Append( KFolderClosed ); + name.Append( folder->Name() ); + folders->AppendL( name ); + CleanupStack::PopAndDestroy( &name ); + } + + TInt selected( SelectFolderFromListL( + folders, CurrentFolder()->Id() == KRootId ) ); + + switch( selected ) + { + case EAknSoftkeyBack: + { + if( iOpenedHierarchy.Count() > 1 && !iLockDialog ) + { + StepBackInHierarchy(); + break; + } + } + case EAknSoftkeyExit: + { + iItemName.Close(); + iFolderName.Close(); + iOpenedHierarchy.ResetAndDestroy(); + break; + } + default: + { + if( selected > 0 ) + { + CMmFolder* folder = CMmFolder::NewL(); + CleanupStack::PushL( folder ); + folder->SetNameL( aFolderContent[ selected - 1 ]->Name() ); + folder->SetId( aFolderContent[ selected - 1 ]->Id() ); + iOpenedHierarchy.AppendL( folder ); + CleanupStack::Pop( folder ); + } + else + { + iFolderName.Close(); + iFolderName.CreateL( CurrentFolder()->Name() ); + MoveToFolderL( iItemId, CurrentFolder()->Id() ); + } + break; + } + } + + CleanupStack::PopAndDestroy( ¤tFolder ); + CleanupStack::PopAndDestroy( folders ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmMoveToFolderCommand::SelectFolderFromListL( + CDesCArrayFlat* aItems, TBool aIsRoot ) + { + TInt selected( KErrNotFound ); + + CAknListQueryDialog* dialog = + new ( ELeave ) CAknListQueryDialog( &selected ); + if( aIsRoot ) + { + dialog->PrepareLC( R_MENU_EDIT_MOVE_TO_FOLDER_SELECT_CANCEL_QUERY ); + } + else + { + dialog->PrepareLC( R_MENU_EDIT_MOVE_TO_FOLDER_SELECT_BACK_QUERY ); + } + dialog->SetItemTextArray( aItems ); + dialog->SetOwnershipType( ELbmDoesNotOwnItemArray ); + CArrayPtr<CGulIcon>* icons = GetFolderIconsL(); + dialog->SetIconArrayL( icons ); + dialog->ListBox()->SetCurrentItemIndexAndDraw( 0 ); + + if( !iLockDialog ) + { + SetDialogL( dialog ); + TInt softkey ( KErrNotFound ); + softkey = dialog->RunLD(); + SetDialogL( NULL ); + + if( softkey == KSoftkeyBack ) + { + selected = EAknSoftkeyBack; + } + else if( selected < 0 || + ( softkey != EAknSoftkeyOk && softkey != EAknSoftkeySelect ) ) + { + selected = EAknSoftkeyExit; + } + } + else + { + CleanupStack::PopAndDestroy( dialog ); + selected = EAknSoftkeyExit; + } + + return selected; + } + + +// --------------------------------------------------------------------------- +// Action resolving function. +// --------------------------------------------------------------------------- +// +CArrayPtr<CGulIcon>* CMmMoveToFolderCommand::GetFolderIconsL() + { + CArrayPtr<CGulIcon>* icons = new( ELeave )CAknIconArray( 10 ); + CleanupStack::PushL( icons ); + CFbsBitmap* folderClosed = NULL; + CFbsBitmap* folderClosedMask = NULL; + + AknIconUtils::CreateIconL( folderClosed, folderClosedMask, + AknIconUtils::AvkonIconFileName(), + EMbmAvkonQgn_prop_folder_small, + EMbmAvkonQgn_prop_folder_small_mask ); + CleanupStack::PushL( folderClosed ); + CleanupStack::PushL( folderClosedMask ); + icons->AppendL( CGulIcon::NewL( folderClosed, folderClosedMask ) ); + CleanupStack::Pop( 2 ); + + CFbsBitmap* folderOpened = NULL; + CFbsBitmap* folderOpenedMask = NULL; + AknIconUtils::CreateIconL( folderOpened, folderOpenedMask, + AknIconUtils::AvkonIconFileName(), + EMbmAvkonQgn_prop_folder_current, + EMbmAvkonQgn_prop_folder_current_mask ); + CleanupStack::PushL( folderOpened ); + CleanupStack::PushL( folderOpenedMask ); + icons->AppendL( CGulIcon::NewL( folderOpened, folderOpenedMask ) ); + CleanupStack::Pop( 3 ); + return icons; + } + + +// --------------------------------------------------------------------------- +// Action resolving function. +// --------------------------------------------------------------------------- +// +HBufC* CMmMoveToFolderCommand::GetFromResourceLC( TInt aIdentifier ) + { + HBufC* string = StringLoader::LoadLC( aIdentifier ); + return string; + } + + +// --------------------------------------------------------------------------- +// Action resolving function. +// --------------------------------------------------------------------------- +// +void CMmMoveToFolderCommand::NotificationMovingCompleteL() + { + CDesCArrayFlat* items = new(ELeave) CDesCArrayFlat( 1 ); + CleanupStack::PushL( items ); + items->AppendL( iItemName ); + items->AppendL( iFolderName ); + + HBufC* msg = StringLoader::LoadLC( R_APPS_NOTE_MOVE_TO_FOLDER, *items ); + CAknNoteDialog* dialog = new (ELeave) CAknNoteDialog( + CAknNoteDialog::EConfirmationTone, + CAknNoteDialog::ELongTimeout ); + dialog->SetTextL( msg->Des() ); + dialog->ExecuteDlgLD( R_MENU_EDIT_MOVING_COMPLETE_NOTIFICATION ); + + CleanupStack::PopAndDestroy( msg ); + CleanupStack::PopAndDestroy( items ); + } + + +// --------------------------------------------------------------------------- +// Action resolving function. +// --------------------------------------------------------------------------- +// +void CMmMoveToFolderCommand::NotificationItemAlreadyStoredL() + { + HBufC* message = StringLoader::LoadLC( R_APPS_NOTE_ITEM_ALREADY_STORED ); + CAknNoteDialog* dialog = new (ELeave) CAknNoteDialog( + CAknNoteDialog::EConfirmationTone, + CAknNoteDialog::ELongTimeout ); + dialog->SetTextL( message->Des() ); + dialog->ExecuteDlgLD( R_MENU_EDIT_MOVING_ABORT_NOTIFICATION ); + + CleanupStack::PopAndDestroy( message ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmMoveToFolderCommand::StepBackInHierarchy() + { + // Remove last folder from iOpenedHierarchy + CMmFolder* folder = CurrentFolder(); + iOpenedHierarchy.Remove( iOpenedHierarchy.Count() - 1 ); + delete folder; + } + + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmMoveToFolderCommand::ExecuteMoveToFolderL() + { + while (iOpenedHierarchy.Count() > 0) + { + // Get folder list form MCS + GetFolderListL( CurrentFolder()->Id() ); + + RPointerArray< CMmFolder > folders; + CleanupResetAndDestroyPushL( folders ); + + // Get folders from GetList output + GetFoldersL(folders); + + // Perform further folder selection or move operation + if( folders.Count() > 0 ) + { + SelectFolderL( folders ); + } + else + { + iFolderName.Close(); + iFolderName.CreateL( CurrentFolder()->Name() ); + MoveToFolderL( iItemId, CurrentFolder()->Id() ); + } + CleanupStack::PopAndDestroy( &folders ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmMoveToFolderCommand::GetFoldersL(RPointerArray<CMmFolder >& aFolderArray) + { + TInt pos( 0 ); + TInt count = iGetListOutParam->FindFirst( + pos, KReturnValue8() )->Value().AsList()->Count(); + TLiwVariant var; var.PushL(); + + // Get propper widget names depending from view type + // and append to aFolderArray + for( TInt i = 0; i < count; i++ ) + { + HnLiwUtils::GetVariantL( *iGetListOutParam, KIdPath8, i, var ); + TInt32 id; + var.Get( id ); + + if (id != iItemId) + { + CMmFolder* folder = CMmFolder::NewL(); + CleanupStack::PushL( folder ); + + folder->SetId( id ); + + TPtrC title; + if( !iWidgetType.Compare( KWidgetTypeList ) ) + { + HnLiwUtils::GetVariantL( + *iGetListOutParam, KLongNamePath8, i, var ); + } + else if( !iWidgetType.Compare( KWidgetTypeGrid ) ) + { + HnLiwUtils::GetVariantL( + *iGetListOutParam, KShortNamePath8, i, var ); + } + else + { + HnLiwUtils::GetVariantL( + *iGetListOutParam, KAppGroupNamePath8, i, var ); + } + var.Get( title ); + folder->SetNameL( title ); + aFolderArray.AppendL( folder ); + + CleanupStack::Pop( folder ); + } + } + CleanupStack::PopAndDestroy(&var); + } + +// --------------------------------------------------------------------------- +// Symbian factory function. +// --------------------------------------------------------------------------- +// +CMmFolder* CMmFolder::NewL() + { + CMmFolder* self = new( ELeave ) CMmFolder(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Symbian second phase constructor. +// --------------------------------------------------------------------------- +// +void CMmFolder::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMmFolder::~CMmFolder() + { + iName.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmFolder::CMmFolder() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolder::SetNameL( const TDesC& aName ) + { + iName.Close(); + iName.CreateL( aName ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC& CMmFolder::Name() const + { + return iName; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmFolder::SetId( TInt aId ) + { + iId = aId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmFolder::Id() + { + return iId; + } + +// end of file + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/src/mmpluginsharedresources.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/src/mmpluginsharedresources.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2007-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: Holds plugins shared resources +* +* Description: +* Version : %version: 3 % << Don't touch! Updated by Synergy at check-out. +* +*/ +#include <StringLoader.h> +#include "mmpluginsharedresources.h" +#include "hnutils.h" + +#include <mmfolderuiextplugin.rsg> + +_LIT( KResourceFile, "mmfolderuiextplugin.rsc" ); + +// ============================ MEMBER FUNCTIONS ============================= +// --------------------------------------------------------------------------- +// Symbian factory function. +// --------------------------------------------------------------------------- +// +CMmPluginSharedResources* CMmPluginSharedResources::NewL() + { + CMmPluginSharedResources* self = new( ELeave ) CMmPluginSharedResources(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Symbian second phase constructor. +// --------------------------------------------------------------------------- +// +void CMmPluginSharedResources::ConstructL() + { + // Init resources + iLanguageFilePath = HnUtils::LocateNearestLanguageFileLC( KResourceFile ); + CleanupStack::Pop(iLanguageFilePath); + iResourceOffset = CCoeEnv::Static()->AddResourceFileL( + iLanguageFilePath->Des() ); + + iDefFolderName = StringLoader::LoadLC( R_MENU_EDIT_DEFAULT_FOLDER_NAME ); + CleanupStack::Pop(iDefFolderName); + iEditFolderName = StringLoader::LoadLC( R_MENU_EDIT_FOLDER_NAME ); + CleanupStack::Pop(iEditFolderName); + iMsgBadFileName = StringLoader::LoadLC( R_MENU_EDIT_FLDR_BAD_FILE_NAME ); + CleanupStack::Pop(iMsgBadFileName); + iMsgBadChar = StringLoader::LoadLC(R_MENU_EDIT_FLDR_ILLEGAL_CHARACTERS); + CleanupStack::Pop(iMsgBadChar); + iRootFolder = StringLoader::LoadLC( R_MENU_EDIT_ROOT_FOLDER ); + CleanupStack::Pop(iRootFolder); + iDelWaitNote = StringLoader::LoadLC(R_MENU_EDIT_FLDR_DELETING_WAIT_NOTE); + CleanupStack::Pop(iDelWaitNote); + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMmPluginSharedResources::~CMmPluginSharedResources() + { + delete iDelWaitNote; + delete iRootFolder; + delete iMsgBadChar; + delete iMsgBadFileName; + delete iEditFolderName; + delete iDefFolderName; + delete iLanguageFilePath; + CCoeEnv::Static()->DeleteResourceFile( iResourceOffset ); + } diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/mmfolderuiextension/src/mmproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/mmfolderuiextension/src/mmproxy.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2007-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: Proxy for the folder UI extension plugin + * +*/ + + +#include <e32std.h> +#include <ecom/implementationproxy.h> + +#include "mmfolderuiextpluginconstants.h" +#include "mmfolderuiextplugin.h" + +// Map the implementation UIDs to implementation factory functions +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KCFolderUiExtPluginUid, CMmFolderUiExtPlugin::NewL ) + }; + +// Exported proxy for instantiation method resolution +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); + return ImplementationTable; + } + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/rom/mmextensions.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/rom/mmextensions.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: IBY file for the mmextensions space 3.0 subsystem + * +*/ + + +#ifndef MMEXTENSION_IBY +#define MMEXTENSION_IBY + +file=ABI_DIR\BUILD_DIR\mmextensionmanager.dll SHARED_LIB_DIR\mmextensionmanager.dll + +ECOM_PLUGIN(mmfolderuiextensionplugin.dll, mmfolderuiextensionplugin.rsc) + +#endif // MMEXTENSION_IBY + +// End of File \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmextensions/rom/mmextensions_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmextensions/rom/mmextensions_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,26 @@ +/* +* 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: IBY file for the mmextensions space 3.0 subsystem + * +*/ + + +#ifndef MMEXTENSION_RESOURCES_IBY +#define MMEXTENSION_RESOURCES_IBY + +data=\epoc32\data\z\resource\apps\mmfolderuiextplugin.rsc resource\apps\mmfolderuiextplugin.rsc + +#endif // MMEXTENSION_RESOURCES_IBY + +// End of File \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/bwins/mmwidgetsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/bwins/mmwidgetsu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,45 @@ +EXPORTS + ?SetHighlightVisibilityL@CMmWidgetContainer@@UAEXH@Z @ 1 NONAME ; void CMmWidgetContainer::SetHighlightVisibilityL(int) + ?SetDefaultHighlightL@CMmGridContainer@@UAEXH@Z @ 2 NONAME ; void CMmGridContainer::SetDefaultHighlightL(int) + ?HandleZoomChanged@CMmWidgetContainer@@QAEXW4TAknUiZoom@@@Z @ 3 NONAME ; void CMmWidgetContainer::HandleZoomChanged(enum TAknUiZoom) + ?PrepareForGarbage@CMmWidgetContainer@@QAEXXZ @ 4 NONAME ; void CMmWidgetContainer::PrepareForGarbage(void) + ?GetPreviousHighlight@CMmWidgetContainer@@UAEHXZ @ 5 NONAME ; int CMmWidgetContainer::GetPreviousHighlight(void) + ?HandleItemAdditionL@CMmWidgetContainer@@UAEXXZ @ 6 NONAME ; void CMmWidgetContainer::HandleItemAdditionL(void) + ?NewLC@CMmTemplateLibrary@@SAPAV1@XZ @ 7 NONAME ; class CMmTemplateLibrary * CMmTemplateLibrary::NewLC(void) + ?IsDraggable@CMmWidgetContainer@@QAEHXZ @ 8 NONAME ; int CMmWidgetContainer::IsDraggable(void) + ?HandleItemRemovalL@CMmWidgetContainer@@UAEXXZ @ 9 NONAME ; void CMmWidgetContainer::HandleItemRemovalL(void) + ?NumberOfItemsChangedL@CMmWidgetContainer@@QAEXW4TItemsChangeType@@@Z @ 10 NONAME ; void CMmWidgetContainer::NumberOfItemsChangedL(enum TItemsChangeType) + ?RestoreWidgetPosition@CMmWidgetContainer@@QAEXXZ @ 11 NONAME ; void CMmWidgetContainer::RestoreWidgetPosition(void) + ?NewL@CMmTemplateLibrary@@SAPAV1@XZ @ 12 NONAME ; class CMmTemplateLibrary * CMmTemplateLibrary::NewL(void) + ?NewL@CMmHighlightTimer@@SAPAV1@PAVCMmWidgetContainer@@@Z @ 13 NONAME ; class CMmHighlightTimer * CMmHighlightTimer::NewL(class CMmWidgetContainer *) + ?GetSuiteModelL@CMmWidgetContainer@@QAEPAVCHnSuiteModel@@XZ @ 14 NONAME ; class CHnSuiteModel * CMmWidgetContainer::GetSuiteModelL(void) + ?HandleForegroundGainedL@CMmWidgetContainer@@UAEXXZ @ 15 NONAME ; void CMmWidgetContainer::HandleForegroundGainedL(void) + ?CancelDragL@CMmWidgetContainer@@QAEXH@Z @ 16 NONAME ; void CMmWidgetContainer::CancelDragL(int) + ?SetManualHighlightL@CMmWidgetContainer@@UAEXHH@Z @ 17 NONAME ; void CMmWidgetContainer::SetManualHighlightL(int, int) + ?SetFlipOpenL@CMmWidgetContainer@@QAEXH@Z @ 18 NONAME ; void CMmWidgetContainer::SetFlipOpenL(int) + ?ItemIsFullyVisible@CMmWidgetContainer@@QAEHH@Z @ 19 NONAME ; int CMmWidgetContainer::ItemIsFullyVisible(int) + ?SetHasFocusL@CMmWidgetContainer@@QAEXH@Z @ 20 NONAME ; void CMmWidgetContainer::SetHasFocusL(int) + ?HandleTopFocusL@CMmWidgetContainer@@UAEXH@Z @ 21 NONAME ; void CMmWidgetContainer::HandleTopFocusL(int) + ?HandleOptionsMenuVisibilityChangeL@CMmWidgetContainer@@UAEXH@Z @ 22 NONAME ; void CMmWidgetContainer::HandleOptionsMenuVisibilityChangeL(int) + ?NewGridContainerL@CMmWidgetContainer@@SAPAV1@ABVTRect@@PAVMObjectProvider@@PAVCMmTemplateLibrary@@@Z @ 23 NONAME ; class CMmWidgetContainer * CMmWidgetContainer::NewGridContainerL(class TRect const &, class MObjectProvider *, class CMmTemplateLibrary *) + ?NumberOfItems@CMmWidgetContainer@@QAEHXZ @ 24 NONAME ; int CMmWidgetContainer::NumberOfItems(void) + ?WidgetType@CMmWidgetContainer@@UAE?AW4THnSuiteWidgetType@@XZ @ 25 NONAME ; enum THnSuiteWidgetType CMmWidgetContainer::WidgetType(void) + ?GetHighlight@CMmWidgetContainer@@UAEHXZ @ 26 NONAME ; int CMmWidgetContainer::GetHighlight(void) + ?ItemIconZoomL@CMmWidgetContainer@@QAEXH@Z @ 27 NONAME ; void CMmWidgetContainer::ItemIconZoomL(int) + ?ResetWidgetPosition@CMmWidgetContainer@@QAEXXZ @ 28 NONAME ; void CMmWidgetContainer::ResetWidgetPosition(void) + ?HandleBackgroundGainedL@CMmWidgetContainer@@UAEXXZ @ 29 NONAME ; void CMmWidgetContainer::HandleBackgroundGainedL(void) + ?CacheWidgetPosition@CMmWidgetContainer@@QAEXXZ @ 30 NONAME ; void CMmWidgetContainer::CacheWidgetPosition(void) + ?NewLC@CMmHighlightTimer@@SAPAV1@PAVCMmWidgetContainer@@@Z @ 31 NONAME ; class CMmHighlightTimer * CMmHighlightTimer::NewLC(class CMmWidgetContainer *) + ?SetEmptyTextL@CMmListBoxContainer@@UAEXABVTDesC16@@@Z @ 32 NONAME ; void CMmListBoxContainer::SetEmptyTextL(class TDesC16 const &) + ?SetObserver@CMmWidgetContainer@@UAEXPAVMMmWidgetObserver@@@Z @ 33 NONAME ; void CMmWidgetContainer::SetObserver(class MMmWidgetObserver *) + ?IsHighlightVisible@CMmWidgetContainer@@UAEHXZ @ 34 NONAME ; int CMmWidgetContainer::IsHighlightVisible(void) + ?GetItemRectL@CMmWidgetContainer@@QAE?AVTRect@@H@Z @ 35 NONAME ; class TRect CMmWidgetContainer::GetItemRectL(int) + ?SetZoom@CMmWidgetContainer@@QAEXW4TAknUiZoom@@@Z @ 36 NONAME ; void CMmWidgetContainer::SetZoom(enum TAknUiZoom) + ?SetIsFaded@CMmWidgetContainer@@QAEXH@Z @ 37 NONAME ; void CMmWidgetContainer::SetIsFaded(int) + ?NewListBoxContainerL@CMmWidgetContainer@@SAPAV1@ABVTRect@@PAVMObjectProvider@@PAVCMmTemplateLibrary@@@Z @ 38 NONAME ; class CMmWidgetContainer * CMmWidgetContainer::NewListBoxContainerL(class TRect const &, class MObjectProvider *, class CMmTemplateLibrary *) + ?StopMovingL@CMmWidgetContainer@@QAEXXZ @ 39 NONAME ; void CMmWidgetContainer::StopMovingL(void) + ?SetDefaultHighlightL@CMmListBoxContainer@@UAEXH@Z @ 40 NONAME ; void CMmListBoxContainer::SetDefaultHighlightL(int) + ?SetEmptyTextL@CMmGridContainer@@UAEXABVTDesC16@@@Z @ 41 NONAME ; void CMmGridContainer::SetEmptyTextL(class TDesC16 const &) + ?SetLongTapObserver@CMmWidgetContainer@@UAEXPAVMMmLongTapObserver@@@Z @ 42 NONAME ; void CMmWidgetContainer::SetLongTapObserver(class MMmLongTapObserver *) + ?ScrollToItemL@CMmWidgetContainer@@QAEHH@Z @ 43 NONAME ; int CMmWidgetContainer::ScrollToItemL(int) + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/grid/custom/akn_logical_template_1.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/grid/custom/akn_logical_template_1.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> +<orientation id ="portrait" width="360"> + + <element id="base"> + <layout id="mainlayout" positionx="0" positiony="0" width="360" height="525" /> + <layout id="grid" positionx="0" positiony="0" width="360" height="525" /> + <layout id="gridlayout" positionx="0" positiony="0" width="340" scrollwidth="20" height="525" row="6" col="3" /> + <layout id="bgimage" state="1" /> + </element> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="85" width="111" > + <imagevisual id="mul_icon" positionx="3" positiony="3" width="105" height="79" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="81" positiony="3" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="81" positiony="55" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_3" positionx="3" positiony="3" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_3" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + </element> + +</orientation> + +<orientation id ="landscape" width="502"> + + <element id="base"> + <layout id="mainlayout" positionx="0" positiony="0" width="502" height="299" /> + <layout id="grid" positionx="0" positiony="0" width="502" height="299" /> + <layout id="gridlayout" positionx="0" positiony="0" width="482" scrollwidth="20" height="299" row="3" col="4" /> + <layout id="bgimage" state="1" /> + </element> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="90" width="118" > + <imagevisual id="mul_icon" positionx="3" positiony="3" width="112" height="84" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="88" positiony="3" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="88" positiony="60" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_3" positionx="3" positiony="3" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_3" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/grid/custom/akn_logical_template_2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/grid/custom/akn_logical_template_2.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> +<orientation id ="portrait" width="360"> + <element id="base"> + <layout id="mainlayout" positionx="0" positiony="0" width="360" height="515" /> + <layout id="grid" positionx="0" positiony="0" width="360" height="515" /> + <layout id="gridlayout" positionx="0" positiony="0" width="340" scrollwidth="20" height="515" row="6" col="4" /> + <layout id="bgimage" state="1" /> + </element> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="85" width="85" > + + <imagevisual id="mul_icon" positionx="3" positiony="3" width="79" height="79" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <imagevisual id="mul_indicator_1" positionx="55" positiony="3" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <imagevisual id="mul_indicator_2" positionx="55" positiony="55" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + </layout> + </element> + + <element id ="highlight"> + </element> + +</orientation> + +<orientation id ="landscape" width="502"> + + <element id="base"> + <layout id="mainlayout" positionx="0" positiony="0" width="502" height="288" /> + <layout id="grid" positionx="0" positiony="0" width="502" height="288" /> + <layout id="gridlayout" positionx="0" positiony="0" width="482" scrollwidth="20" height="288" row="3" col="5" /> + <layout id="bgimage" state="1" /> + </element> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="96" width="96" > + + <imagevisual id="mul_icon" positionx="3" positiony="3" width="90" height="90" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <imagevisual id="mul_indicator_1" positionx="66" positiony="3" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <imagevisual id="mul_indicator_2" positionx="66" positiony="66" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + </layout> + </element> + + <element id ="highlight"> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/grid/custom/akn_logical_template_3.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/grid/custom/akn_logical_template_3.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" width="360"> + <element id="base"> + <layout id="mainlayout" positionx="0" positiony="0" width="360" height="462" /> + <layout id="grid" positionx="2" positiony="18" width="358" height="444" /> + <layout id="gridlayout" positionx="0" positiony="0" width="338" scrollwidth="20" height="444" row="4" col="3"/> + <layout id="bgimage" state="1" /> + </element> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" positionx="0" positiony="0" width="111" height="133" > + + <imagevisual id="mul_icon" positionx="8" positiony="8" width="95" height="95" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <imagevisual id="mul_indicator_1" positionx="80" positiony="15" width="24" height="24"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <imagevisual id="mul_indicator_2" positionx="80" positiony="39" width="24" height="24"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <textvisual id="mul_title" positionx="3" positiony="106" width="104" height="24"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_primarysmall" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="1" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + + <!-- For matrix Menu Swap mode visulisation--> + <imagevisual id="mul_icon_2" positionx="4" positiony="7" width="103" height="103" fitmode="off"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <!-- Matrix Menu Swap Mode Visulisation Ends here --> + + </layout> + </element> + + <element id ="highlight"> + </element> + <element id="mul_move_indicator"> + <layout id="anchor" name="anchor" positionx="-20" positiony="-20" width="131" height="130" > + + <!-- For matrix Menu Non Touch Edit mode move indicator--> + <imagevisual id="mul_move_indicator_frame" positionx="20" positiony="20" width="111" height="110" /> + <imagevisual id="mul_move_indicator_arrow_top" positionx="60" positiony="0" width="30" height="17" /> + <imagevisual id="mul_move_indicator_arrow_right" positionx="134" positiony="60" width="17" height="30" /> + <imagevisual id="mul_move_indicator_arrow_bottom" positionx="60" positiony="133" width="30" height="17" /> + <imagevisual id="mul_move_indicator_arrow_left" positionx="0" positiony="60" width="17" height="30" /> + + <!-- Matrix Menu Non Touch Edit mode move indicator Ends here--> + </layout> + </element> +</orientation> + +<orientation id ="landscape" width="502"> + <element id="base"> + <layout id="mainlayout" positionx="0" positiony="0" width="502" height="306" /> + <layout id="grid" positionx="7" positiony="6" width="475" height="300" /> + <layout id="gridlayout" positionx="0" positiony="0" width="455" scrollwidth="20" height="300" row="3" col="4"/> + <layout id="bgimage" state="1" /> + </element> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" positionx="0" positiony="0" width="120" height="102" > + + <imagevisual id="mul_icon" positionx="25" positiony="4" width="70" height="70" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <imagevisual id="mul_indicator_1" positionx="82" positiony="1" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <imagevisual id="mul_indicator_2" positionx="10" positiony="1" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <textvisual id="mul_title" positionx="5" positiony="77" width="110" height="21" horizontalalign="center" opacity="1"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_primarysmall" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="1" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <!-- For matrix Menu Swap mode visulisation--> + <imagevisual id="mul_icon_2" positionx="25" positiony="4" width="70" height="70" fitmode="off"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <!-- Matrix Menu Swap Mode Visulisation Ends here --> + + </layout> + </element> + + <element id ="highlight"> + + </element> +</orientation> + +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/grid/custom/akn_logical_template_4.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/grid/custom/akn_logical_template_4.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" width="360"> + + <element id="base" scrollbar="0" > + <!-- 0 here implies No scrollbar + 1 means scrollbar --> + <layout id="mainlayout" positionx="0" positiony="511" width="360" height="78" /> + <layout id="grid" positionx="14" positiony="9" width="330" height="60" /> + <layout id="gridlayout" positionx="0" positiony="0" width="330" scrollwidth="0" height="60" row="1" col="5" /> + <layout id="bgimage" state="0" /> + </element> + + <element id="nohighlight"> + <layout id="anchor" positionx="0" positiony="0" width="66" height="60" > + <imagevisual id="mul_icon" positionx="0" positiony="0" width="60" height="60" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + </element> + + </orientation> + + <orientation id ="landscape" width="502"> + + <element id="base" scrollbar="0"> + <!-- 0 here implies No scrollbar + 1 means scrollbar --> + <layout id="mainlayout" positionx="218" positiony="310" width="284" height="50" /> + <layout id="grid" positionx="0" positiony="2" width="284" height="40" /> + <layout id="gridlayout" positionx="0" positiony="0" width="284" scrollwidth = "0" height="40" row ="1" col="5"/> + <layout id="bgimage" state="0" /> + </element> + + + <element id="nohighlight"> + <layout id="anchor" positionx="0" positiony="0" width="58" height="46" > + <imagevisual id="mul_icon" positionx="0" positiony="0" width="40" height="40" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + </element> + </orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/grid/custom/akn_single_large_graphic_pane.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/grid/custom/akn_single_large_graphic_pane.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" width="360"> + <element id="base"> + <layout id="mainlayout" positionx="0" positiony="0" width="360" height="462" /> + <layout id="grid" positionx="2" positiony="18" width="358" height="444" /> + <layout id="gridlayout" positionx="0" positiony="0" width="338" scrollwidth="20" height="444" row="4" col="3"/> + <layout id="bgimage" state="1" /> + </element> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" positionx="0" positiony="0" width="111" height="110" > + + <imagevisual id="mul_icon" positionx="19" positiony="5" width="74" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <imagevisual id="mul_indicator_1" positionx="80" positiony="1" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <imagevisual id="mul_indicator_2" positionx="8" positiony="1" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <textvisual id="mul_title" positionx="6" positiony="86" width="100" height="21"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_primarysmall" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="1" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + + <!-- For matrix Menu Swap mode visulisation--> + <imagevisual id="mul_icon_2" positionx="19" positiony="5" width="74" height="74" fitmode="off"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <!-- Matrix Menu Swap Mode Visulisation Ends here --> + + </layout> + </element> + + <element id ="highlight"> + </element> + +</orientation> + +<orientation id ="landscape" width="502"> + <element id="base"> + <layout id="mainlayout" positionx="0" positiony="0" width="502" height="306" /> + <layout id="grid" positionx="7" positiony="6" width="475" height="300" /> + <layout id="gridlayout" positionx="0" positiony="0" width="455" scrollwidth="20" height="300" row="3" col="4"/> + <layout id="bgimage" state="1" /> + </element> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" positionx="0" positiony="0" width="120" height="102" > + + <imagevisual id="mul_icon" positionx="25" positiony="4" width="70" height="70" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <imagevisual id="mul_indicator_1" positionx="82" positiony="1" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <imagevisual id="mul_indicator_2" positionx="10" positiony="1" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <textvisual id="mul_title" positionx="5" positiony="77" width="110" height="21" horizontalalign="center" opacity="1"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_primarysmall" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="1" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <!-- For matrix Menu Swap mode visulisation--> + <imagevisual id="mul_icon_2" positionx="25" positiony="4" width="70" height="70" fitmode="off"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + + <!-- Matrix Menu Swap Mode Visulisation Ends here --> + + </layout> + </element> + + <element id ="highlight"> + + </element> + +</orientation> + +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/grid/lct/akn_logical_template_3.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/grid/lct/akn_logical_template_3.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="cell_hc_apps_pane" variety="3" variety_zoom="1"> + <textvisual id="mul_title" lct="cell_hc_apps_pane_t1" variety="0" variety_zoom="1"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + </textvisual> + <imagevisual id="mul_icon" lct="cell_hc_apps_pane_g1" variety="0" variety_zoom="1" halign="center" > + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + </imagevisual> + <imagevisual id="mul_indicator_1" lct="cell_hc_apps_pane_g2" variety="0" variety_zoom="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="cell_hc_apps_pane_g3" variety="0" variety_zoom="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + </imagevisual> + </layout> + </element> + + <element id="highlight"> + </element> +</orientation> + +<orientation id ="landscape" lct="uiaccel_main_aa_listscroll_pane" variety="0" > + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="cell_app_pane" variety="3" variety_zoom="3"> + <textvisual id="mul_title" lct="cell_app_pane_t1" variety="0" variety_zoom="0"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + </textvisual> + <imagevisual id="mul_icon" lct="cell_app_pane_g1" variety="0" variety_zoom="0" halign="center" > + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + </imagevisual> + <imagevisual id="mul_indicator_1" lct="cell_app_pane_g2" variety="0" variety_zoom="0"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_1.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_1.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,136 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" width="360"> + <element id="read"> + <layout id="anchor" name="anchor" width="340" height="55"> + <textvisual id="mul_title" positionx="10" positiony="13" width="263" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="7" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.5" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="300" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="273" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" width="340" height="55"> + <textvisual id="mul_title" positionx="10" positiony="13" width="263" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="300" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="273" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" width="340" height="55"> + <textvisual id="mul_title" positionx="10" positiony="13" width="263" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="300" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="273" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + </orientation> + + <orientation id ="landscape" width="502" > + + <element id="read"> + <layout id="anchor" name="anchor" width="482" height="55"> + <textvisual id="mul_title" positionx="10" positiony="13" width="392" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.5" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="440" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="413" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" width="482" height="55"> + <textvisual id="mul_title" positionx="10" positiony="13" width="392" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="440" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="413" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" width="482" height="55"> + <textvisual id="mul_title" positionx="10" positiony="13" width="340" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="440" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="413" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_10.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_10.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" width="360"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="88" width="340" > + <textvisual id="mul_title" positionx="10" positiony="10" width="318" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_input_text" positionx="10" positiony="51" width="308" height="27"> + <attributesetter name="text" targetvalue="mul_input_text" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" height="88" width="340" > + <textvisual id="mul_title" positionx="10" positiony="10" width="318" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <plaintexteditor id="mul_input_text" positionx="10" positiony="51" width="308" height="27"> + <attributesetter name="text" targetvalue="mul_input_text" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </plaintexteditor> + </layout> + </element> + +</orientation> + +<orientation id ="landscape" width="502"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="454" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_input_text" positionx="10" positiony="51" width="444" height="27"> + <attributesetter name="text" targetvalue="mul_input_text" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="454" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <plaintexteditor id="mul_input_text" positionx="10" positiony="51" width="444" height="27"> + <attributesetter name="text" targetvalue="mul_input_text" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </plaintexteditor> + </layout> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_11.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_11.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,181 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" width="360"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="88" width="340" > + <textvisual id="mul_title" positionx="10" positiony="10" width="163" noindicatorwidth="218" oneindicatorwidth="190" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="143" height="24" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="235" positiony="7" width="98" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="208" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="181" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <textvisual id="mul_n" positionx="156" positiony="56" width="44" height="24"> + <attributesetter name="text" targetvalue="mul_n" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_%" positionx="204" positiony="56" width="24" height="24"> + <attributesetter name="text" targetvalue="mul_%" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" height="88" width="340" > + <textvisual id="mul_title" positionx="10" positiony="10" width="163" noindicatorwidth="218" oneindicatorwidth="190" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="143" height="24" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="235" positiony="7" width="98" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="208" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="181" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <textvisual id="mul_n" positionx="156" positiony="56" width="44" height="24"> + <attributesetter name="text" targetvalue="mul_n" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_%" positionx="204" positiony="56" width="24" height="24"> + <attributesetter name="text" targetvalue="mul_%" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + </layout> + </element> + +</orientation> + +<orientation id ="landscape" width="502"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="308" noindicatorswidth="358" oneindicatorwidth="326" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="52" width="143" height="24" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="377" positiony="7" width="98" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="350" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="323" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <embeded id="mul_sliders" widgetname="mulsliderwidget" modelname="mulslidermodel" + template="logical_template_7" positionx="159" positiony="56" width="194" height="14"> + </embeded> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="308" noindicatorswidth="358" oneindicatorwidth="326" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="52" width="143" height="24" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="377" positiony="7" width="98" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="350" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="323" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <embeded id="mul_sliders" widgetname="mulsliderwidget" modelname="mulslidermodel" + template="logical_template_7" positionx="159" positiony="56" width="194" height="14"> + </embeded> + </layout> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_12.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_12.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + + <orientation id ="portrait" width="360"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="88" width="340" > + <imagevisual id="mul_icon" positionx="17" positiony="12" width="305" height="64" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + </element> + + </orientation> + + <orientation id ="landscape" width="502"> + + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="88" width="482"> + <imagevisual id="mul_icon" positionx="88" positiony="12" width="305" height="64" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + </element> + + </orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_13.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_13.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" width="360"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="88" width="340" > + <textvisual id="mul_title" positionx="10" positiony="10" width="187" noindicatorwidth="242" oneindicatorwidth="210" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_icon" positionx="259" positiony="7" width="74" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="232" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="205" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <embeded id="mul_sliders" widgetname="mulsliderwidget" modelname="mulslidermodel" + template="logical_template_8" positionx="10" positiony="56" width="242" height="14"> + </embeded> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" height="88" width="340" > + <textvisual id="mul_title" positionx="10" positiony="10" width="187" noindicatorwidth="242" oneindicatorwidth="210" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_icon" positionx="259" positiony="7" width="74" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="232" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="205" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <embeded id="mul_sliders" widgetname="mulsliderwidget" modelname="mulslidermodel" + template="logical_template_8" positionx="10" positiony="56" width="242" height="14"> + </embeded> + </layout> + </element> + +</orientation> + +<orientation id ="landscape" width="502"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="318" noindicatorswidth="382" oneindicatorwidth="350" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_icon" positionx="401" positiony="7" width="74" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="374" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="347" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <embeded id="mul_sliders" widgetname="mulsliderwidget" modelname="mulslidermodel" + template="logical_template_8" positionx="10" positiony="56" width="382" height="14"> + </embeded> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="318" noindicatorswidth="382" oneindicatorwidth="350" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_icon" positionx="401" positiony="7" width="74" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="374" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="347" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <embeded id="mul_sliders" widgetname="mulsliderwidget" modelname="mulslidermodel" + template="logical_template_8" positionx="10" positiony="56" width="382" height="14"> + </embeded> + </layout> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_2.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" width="360"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="55" width="340" > + <textvisual id="mul_title" positionx="10" positiony="13" width="263" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="300" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="273" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" height="88" width="340" > + <textvisual id="mul_title" positionx="10" positiony="10" width="263" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="318" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="300" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="273" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + </orientation> + + <orientation id ="landscape" width="502" > + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="55" width="482" > + <textvisual id="mul_title" positionx="10" positiony="13" width="392" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="440" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="413" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="392" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="454" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="440" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="413" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_3.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_3.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" width="360"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="55" width="340" > + <textvisual id="mul_title" positionx="10" positiony="13" width="263" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="300" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="273" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" height="88" width="340" > + <textvisual id="mul_title" positionx="10" positiony="10" width="187" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="242" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="259" positiony="7" width="74" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="232" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="205" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + </orientation> + + <orientation id ="landscape" width="502" > + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="55" width="482" > + <textvisual id="mul_title" positionx="10" positiony="13" width="392" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="440" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="413" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="318" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="382" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="401" positiony="7" width="74" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="374" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="347" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_4.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_4.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" width="360"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="55" width="340" > + <textvisual id="mul_title" positionx="10" positiony="13" width="263" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="300" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="273" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" height="88" width="340"> + <textvisual id="mul_title" positionx="10" positiony="10" width="163" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="218" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="235" positiony="7" width="98" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="208" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="181" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + +</orientation> + +<orientation id ="landscape" width="502" > + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="55" width="482" > + <textvisual id="mul_title" positionx="10" positiony="13" width="392" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="440" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="413" positiony="13" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="308" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="358" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="377" positiony="7" width="98" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="350" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="323" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_5.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_5.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,127 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" width="360"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="88" width="340" > + <textvisual id="mul_title" positionx="10" positiony="10" width="263" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="318" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="300" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="273" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" height="88" width="340" > + <textvisual id="mul_title" positionx="10" positiony="10" width="263" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="318" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="300" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="273" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + +</orientation> + +<orientation id ="landscape" width="502"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="395" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="454" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="440" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="413" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="395" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="454" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="440" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="413" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_6.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_6.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,143 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" width="360"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="88" width="340" > + <textvisual id="mul_title" positionx="10" positiony="10" width="187" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="242" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="259" positiony="7" width="74" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="232" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="205" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" height="88" width="340" > + <textvisual id="mul_title" positionx="10" positiony="10" width="187" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="242" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="259" positiony="7" width="74" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="232" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="205" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + +</orientation> + +<orientation id ="landscape" width="502"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="318" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="382" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="401" positiony="7" width="74" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="374" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="347" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="318" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="382" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="401" positiony="7" width="74" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="374" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="347" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_7.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_7.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,143 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> +<orientation id ="portrait" width="360"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="88" width="340" > + <textvisual id="mul_title" positionx="10" positiony="10" width="163" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="218" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="235" positiony="7" width="98" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="208" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="181" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + + <element id ="highlight"> + <layout id="anchor" name="anchor" height="88" width="340" > + <textvisual id="mul_title" positionx="10" positiony="10" width="163" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="218" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="235" positiony="7" width="98" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="208" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="181" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + +</orientation> + +<orientation id ="landscape" width="502"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="308" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="358" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="377" positiony="7" width="98" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="350" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="323" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="308" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="358" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="377" positiony="7" width="98" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="350" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="323" positiony="10" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + </orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_8.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/custom/akn_logical_template_8.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,127 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> +<orientation id ="portrait" width="360"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="55" width="340" > + <textvisual id="mul_title" positionx="10" positiony="13" width="312" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" height="88" width="340" > + <textvisual id="mul_title" positionx="10" positiony="10" width="237" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="237" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="254" positiony="7" width="74" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="299" positiony="7" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="254" positiony="7" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + </orientation> + + <orientation id ="landscape" width="502"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="55" width="482" > + <textvisual id="mul_title" positionx="10" positiony="13" width="452" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + </layout> + </element> + + + <element id ="highlight"> + <layout id = "anchor" name="anchor" height="88" width="482" > + <textvisual id="mul_title" positionx="10" positiony="10" width="211" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <textvisual id="mul_detail" positionx="10" positiony="50" width="211" height="27" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="style" targetvalue="qfn_secondary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.7" /> + </textvisual> + <imagevisual id="mul_icon" positionx="395" positiony="7" width="74" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_icon_2" positionx="315" positiony="7" width="74" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_icon_3" positionx="235" positiony="7" width="74" height="74" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon_3" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_1" positionx="442" positiony="7" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="395" positiony="7" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_3" positionx="362" positiony="7" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_3" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_4" positionx="315" positiony="7" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_4" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_5" positionx="282" positiony="7" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_5" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_6" positionx="235" positiony="7" width="27" height="27"> + <attributesetter name="imagepath" targetvalue="mul_indicator_6" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/custom/akn_single_large_graphic_pane.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/custom/akn_single_large_graphic_pane.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" width="360"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="53" width="334" > + <imagevisual id="mul_icon" positionx="10" positiony="4" width="64" height="46" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <textvisual id="mul_title" positionx="85" positiony="13" width="195" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_primary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="307" positiony="17" width="20" height="20"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="287" positiony="17" width="20" height="20"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" height="53" width="334" > + <imagevisual id="mul_icon" positionx="10" positiony="4" width="64" height="46" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <textvisual id="mul_title" positionx="85" positiony="13" width="195" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_primary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="307" positiony="17" width="20" height="20"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="287" positiony="17" width="20" height="20"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + </orientation> + + <orientation id ="landscape" width="502" > + + <element id="nohighlight"> + <layout id="anchor" name="anchor" height="53" width="476" > + <imagevisual id="mul_icon" positionx="26" positiony="4" width="64" height="46" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <textvisual id="mul_title" positionx="108" positiony="13" width="314" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_primary" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="449" positiony="17" width="20" height="20"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="429" positiony="17" width="20" height="20"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" height="53" width="476" > + <imagevisual id="mul_icon" positionx="26" positiony="4" width="64" height="46" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <textvisual id="mul_title" positionx="108" positiony="13" width="361" height="27"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="style" targetvalue="qfn_primary" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" positionx="449" positiony="17" width="20" height="20"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" positionx="429" positiony="17" width="20" height="20"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/lct/akn_list_single_hc_apps_pane.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/lct/akn_list_single_hc_apps_pane.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="list_single_hc_apps_pane" variety="0" > + <imagevisual id="mul_icon" lct="list_single_hc_apps_pane_g1" variety="0" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + </imagevisual> + <textvisual id="mul_title" lct="list_single_hc_apps_pane_t1" variety="0" > + <attributesetter name="text" targetvalue="mul_title" category="data" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="list_single_hc_apps_pane_g2" variety="0" > + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" lct="list_single_hc_apps_pane" variety="0" > + <imagevisual id="mul_icon" lct="list_single_hc_apps_pane_g1" variety="0" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + </imagevisual> + <textvisual id="mul_title" lct="list_single_hc_apps_pane_t1" variety="0"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="list_single_hc_apps_pane_g2" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + </imagevisual> + </layout> + </element> + +</orientation> + +<orientation id ="landscape"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="list_single_hc_apps_pane" variety="0" > + <imagevisual id="mul_icon" lct="list_single_hc_apps_pane_g1" variety="0" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + </imagevisual> + <textvisual id="mul_title" lct="list_single_hc_apps_pane_t1" variety="0" > + <attributesetter name="text" targetvalue="mul_title" category="data" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="list_single_hc_apps_pane_g2" variety="0" > + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" lct="list_single_hc_apps_pane" variety="0" > + <imagevisual id="mul_icon" lct="list_single_hc_apps_pane_g1" variety="0" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + </imagevisual> + <textvisual id="mul_title" lct="list_single_hc_apps_pane_t1" variety="0"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="list_single_hc_apps_pane_g2" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_1.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_1.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + <element id="read"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_single_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_single_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="7" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.5" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_single_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_single_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + </layout> + </element> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_single_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_single_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_single_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_single_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_single_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_single_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_single_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_single_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + </orientation> + + <orientation id ="landscape" lct="uiaccel_main_aa_listscroll_pane" variety="0" > + + <element id="read"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_single_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_single_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="0.5" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_single_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_single_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_single_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_single_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_single_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_single_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_single_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_single_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_single_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_single_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_12.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_12.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + + <orientation id ="portrait" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_gene_ad_pane" variety="0"> + <imagevisual id="mul_icon" lct="uiaccel_aalist_gene_ad_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" lct="uiaccel_aalist_gene_ad_pane" variety="0"> + <imagevisual id="mul_icon" lct="uiaccel_aalist_gene_ad_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + </orientation> + + <orientation id ="landscape" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_gene_ad_pane" variety="0"> + <imagevisual id="mul_icon" lct="uiaccel_aalist_gene_ad_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" lct="uiaccel_aalist_gene_ad_pane" variety="0"> + <imagevisual id="mul_icon" lct="uiaccel_aalist_gene_ad_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + </orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_2.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_single_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_single_pane_t1" variety="2" > + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_single_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_single_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" lct="uiaccel_aalist_double_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_double_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_pane_t2" variety="0" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + </orientation> + + <orientation id ="landscape" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_single_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_single_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_single_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_single_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" lct="uiaccel_aalist_double_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_pane_t2" variety="0" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_3.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_3.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_single_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_single_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_single_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_single_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="2" > + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="0" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_graphic_pane_g3" variety="2"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_graphic_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + </orientation> + + <orientation id ="landscape" lct="uiaccel_main_aa_listscroll_pane" variety="0" > + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_single_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_single_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_single_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_single_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="2" > + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="0" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_graphic_pane_g3" variety="2"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_graphic_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_4.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_4.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_single_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_single_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_single_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_single_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="5"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="5" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_graphic_pane_g2" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_graphic_pane_g3" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + +</orientation> + +<orientation id ="landscape" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_single_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_single_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_single_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_single_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="5"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="5" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_graphic_pane_g2" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_graphic_pane_g3" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_5.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_5.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_pane_t2" variety="2" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_pane_t2" variety="2" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + +</orientation> + +<orientation id ="landscape" width="502"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_pane_t2" variety="2" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_pane_t2" variety="2" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_pane_g1" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_6.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_6.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,135 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="0" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_graphic_pane_g3" variety="2"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_graphic_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="0" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_graphic_pane_g3" variety="2"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_graphic_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + +</orientation> + +<orientation id ="landscape" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="0" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_graphic_pane_g3" variety="2"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_graphic_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="2"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="0" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_graphic_pane_g3" variety="2"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_graphic_pane_g2" variety="1"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_6a.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_6a.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="0"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="0" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="0"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="0" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + +</orientation> + +<orientation id ="landscape" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="0"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="0" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="0"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="0" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_7.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_7.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> +<orientation id ="portrait" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="5"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="5" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_graphic_pane_g2" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_graphic_pane_g3" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + + <element id ="highlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="5"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="5" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_graphic_pane_g2" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_graphic_pane_g3" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + +</orientation> + +<orientation id ="landscape" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="5"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="5" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_graphic_pane_g2" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_graphic_pane_g3" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + <element id ="highlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0"> + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="5"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="5" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_1" lct="uiaccel_aalist_double_graphic_pane_g2" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + <imagevisual id="mul_indicator_2" lct="uiaccel_aalist_double_graphic_pane_g3" variety="3"> + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + </orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_8.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/lct/akn_logical_template_8.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> +<orientation id ="portrait" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_single_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_single_pane_t1" variety="0"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="0"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="0" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + + </orientation> + + <orientation id ="landscape" lct="uiaccel_main_aa_listscroll_pane" variety="0"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="uiaccel_aalist_single_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_single_pane_t1" variety="0"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="8" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + </layout> + </element> + + + <element id ="highlight"> + <layout id = "anchor" name="anchor" lct="uiaccel_aalist_double_graphic_pane" variety="0" > + <textvisual id="mul_title" lct="uiaccel_aalist_double_graphic_pane_t1" variety="7"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="100" /> + </textvisual> + <textvisual id="mul_detail" lct="uiaccel_aalist_double_graphic_pane_t2" variety="7" marquee="yes"> + <attributesetter name="text" targetvalue="mul_detail" category="data" /> + <attributesetter name="fontthemecolor" targetvalue="9" /> + <attributesetter name="horizontalalign" targetvalue="0" /> + <attributesetter name="verticalalign" targetvalue="0" /> + <attributesetter name="opacity" targetvalue="70" /> + </textvisual> + <imagevisual id="mul_icon" lct="uiaccel_aalist_double_graphic_pane_g1" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + + <imagevisual id="mul_icon_2" lct="uiaccel_aalist_double_graphic_pane_g6" variety="7"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + + <imagevisual id="mul_icon_3" lct="uiaccel_aalist_double_graphic_pane_g7" variety="7"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="100" /> + </imagevisual> + </layout> + </element> + +</orientation> +</dhuiml> diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/data/list/lct/akn_single_large_graphic_pane.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/data/list/lct/akn_single_large_graphic_pane.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dhuiml version="1.0" xmlns="http://www.series60.com/xml/dhuiml/1"> + +<orientation id ="portrait" width="360"> + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="list_single_large_graphic_pane" variety="0" > + <imagevisual id="mul_icon" lct="list_single_large_graphic_pane_g1" variety="0" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <textvisual id="mul_title" lct="list_single_large_graphic_pane_t1" variety="0" > + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="list_single_large_graphic_pane_g2_cp2" variety="0" > + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <!--missign second indicator in definition --> + <!--imagevisual id="mul_indicator_2" lct="" variety="" > + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual--> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" lct="list_single_large_graphic_pane" variety="0" > + <imagevisual id="mul_icon" lct="list_single_large_graphic_pane_g1" variety="0" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <textvisual id="mul_title" lct="list_single_large_graphic_pane_t1" variety="0"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="list_single_large_graphic_pane_g2_cp2" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <!--missign second indicator in definition --> + <!--imagevisual id="mul_indicator_2" lct="" variety="" > + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual--> + </layout> + </element> + +</orientation> + +<orientation id ="landscape" width="502" > + + <element id="nohighlight"> + <layout id="anchor" name="anchor" lct="list_single_large_graphic_pane" variety="0" > + <imagevisual id="mul_icon" lct="list_single_large_graphic_pane_g1" variety="0" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <textvisual id="mul_title" lct="list_single_large_graphic_pane_t1" variety="0" > + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="list_single_large_graphic_pane_g2_cp2" variety="0" > + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <!--missign second indicator in definition --> + <!--imagevisual id="mul_indicator_2" lct="" variety="" > + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual--> + </layout> + </element> + + <element id ="highlight"> + <layout id = "anchor" name="anchor" lct="list_single_large_graphic_pane" variety="0" > + <imagevisual id="mul_icon" lct="list_single_large_graphic_pane_g1" variety="0" fitmode="on"> + <attributesetter name="imagepath" targetvalue="mul_icon" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <textvisual id="mul_title" lct="list_single_large_graphic_pane_t1" variety="0"> + <attributesetter name="text" targetvalue="mul_title" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </textvisual> + <imagevisual id="mul_indicator_1" lct="list_single_large_graphic_pane_g2_cp2" variety="0"> + <attributesetter name="imagepath" targetvalue="mul_indicator_1" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual> + <!--missign second indicator in definition --> + <!--imagevisual id="mul_indicator_2" lct="" variety="" > + <attributesetter name="imagepath" targetvalue="mul_indicator_2" category="data" /> + <attributesetter name="opacity" targetvalue="1" /> + </imagevisual--> + </layout> + </element> + +</orientation> +</dhuiml> \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/eabi/mmwidgetsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/eabi/mmwidgetsu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,46 @@ +EXPORTS + _ZN16CMmGridContainer13SetEmptyTextLERK7TDesC16 @ 1 NONAME + _ZN16CMmGridContainer20SetDefaultHighlightLEi @ 2 NONAME + _ZN17CMmHighlightTimer4NewLEP18CMmWidgetContainer @ 3 NONAME + _ZN17CMmHighlightTimer5NewLCEP18CMmWidgetContainer @ 4 NONAME + _ZN18CMmTemplateLibrary4NewLEv @ 5 NONAME + _ZN18CMmTemplateLibrary5NewLCEv @ 6 NONAME + _ZN18CMmWidgetContainer10SetIsFadedEi @ 7 NONAME + _ZN18CMmWidgetContainer10WidgetTypeEv @ 8 NONAME + _ZN18CMmWidgetContainer11CancelDragLEi @ 9 NONAME + _ZN18CMmWidgetContainer11IsDraggableEv @ 10 NONAME + _ZN18CMmWidgetContainer11SetObserverEP17MMmWidgetObserver @ 11 NONAME + _ZN18CMmWidgetContainer11StopMovingLEv @ 12 NONAME + _ZN18CMmWidgetContainer12GetHighlightEv @ 13 NONAME + _ZN18CMmWidgetContainer12GetItemRectLEi @ 14 NONAME + _ZN18CMmWidgetContainer12SetFlipOpenLEi @ 15 NONAME + _ZN18CMmWidgetContainer12SetHasFocusLEi @ 16 NONAME + _ZN18CMmWidgetContainer13ItemIconZoomLEi @ 17 NONAME + _ZN18CMmWidgetContainer13NumberOfItemsEv @ 18 NONAME + _ZN18CMmWidgetContainer13ScrollToItemLEi @ 19 NONAME + _ZN18CMmWidgetContainer14GetSuiteModelLEv @ 20 NONAME + _ZN18CMmWidgetContainer15HandleTopFocusLEi @ 21 NONAME + _ZN18CMmWidgetContainer17HandleZoomChangedE10TAknUiZoom @ 22 NONAME + _ZN18CMmWidgetContainer17NewGridContainerLERK5TRectP15MObjectProviderP18CMmTemplateLibrary @ 23 NONAME + _ZN18CMmWidgetContainer17PrepareForGarbageEv @ 24 NONAME + _ZN18CMmWidgetContainer18HandleItemRemovalLEv @ 25 NONAME + _ZN18CMmWidgetContainer18IsHighlightVisibleEv @ 26 NONAME + _ZN18CMmWidgetContainer18ItemIsFullyVisibleEi @ 27 NONAME + _ZN18CMmWidgetContainer18SetLongTapObserverEP18MMmLongTapObserver @ 28 NONAME + _ZN18CMmWidgetContainer19CacheWidgetPositionEv @ 29 NONAME + _ZN18CMmWidgetContainer19HandleItemAdditionLEv @ 30 NONAME + _ZN18CMmWidgetContainer19ResetWidgetPositionEv @ 31 NONAME + _ZN18CMmWidgetContainer20GetPreviousHighlightEv @ 32 NONAME + _ZN18CMmWidgetContainer20NewListBoxContainerLERK5TRectP15MObjectProviderP18CMmTemplateLibrary @ 33 NONAME + _ZN18CMmWidgetContainer21NumberOfItemsChangedLE16TItemsChangeType @ 34 NONAME + _ZN18CMmWidgetContainer21RestoreWidgetPositionEv @ 35 NONAME + _ZN18CMmWidgetContainer23HandleBackgroundGainedLEv @ 36 NONAME + _ZN18CMmWidgetContainer23HandleForegroundGainedLEv @ 37 NONAME + _ZN18CMmWidgetContainer23SetHighlightVisibilityLEi @ 38 NONAME + _ZN18CMmWidgetContainer34HandleOptionsMenuVisibilityChangeLEi @ 39 NONAME + _ZN18CMmWidgetContainer7SetZoomE10TAknUiZoom @ 40 NONAME + _ZN19CMmListBoxContainer13SetEmptyTextLERK7TDesC16 @ 41 NONAME + _ZN19CMmListBoxContainer20SetDefaultHighlightLEi @ 42 NONAME + _ZThn52_N18CMmWidgetContainer23HandleBackgroundGainedLEv @ 43 NONAME + _ZThn52_N18CMmWidgetContainer23HandleForegroundGainedLEv @ 44 NONAME + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project mmwidgets +* Version : %version: 8.1.3.1.7 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#include <platform_paths.hrh> + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/mmwidgets.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mmwidgets.iby) + +// list exports +../data/list/custom/akn_single_large_graphic_pane.xml /epoc32/release/winscw/udeb/Z/resource/list/custom/akn_single_large_graphic_pane.xml +../data/list/custom/akn_single_large_graphic_pane.xml /epoc32/release/winscw/urel/Z/resource/list/custom/akn_single_large_graphic_pane.xml +../data/list/custom/akn_single_large_graphic_pane.xml /epoc32/data/z/resource/list/custom/akn_single_large_graphic_pane.xml + +../data/list/custom/akn_logical_template_1.xml /epoc32/release/winscw/udeb/Z/resource/list/custom/akn_logical_template_1.xml +../data/list/custom/akn_logical_template_1.xml /epoc32/release/winscw/urel/Z/resource/list/custom/akn_logical_template_1.xml +../data/list/custom/akn_logical_template_1.xml /epoc32/data/z/resource/list/custom/akn_logical_template_1.xml + +../data/list/custom/akn_logical_template_2.xml /epoc32/release/winscw/udeb/Z/resource/list/custom/akn_logical_template_2.xml +../data/list/custom/akn_logical_template_2.xml /epoc32/release/winscw/urel/Z/resource/list/custom/akn_logical_template_2.xml +../data/list/custom/akn_logical_template_2.xml /epoc32/data/z/resource/list/custom/akn_logical_template_2.xml + +../data/list/custom/akn_logical_template_3.xml /epoc32/release/winscw/udeb/Z/resource/list/custom/akn_logical_template_3.xml +../data/list/custom/akn_logical_template_3.xml /epoc32/release/winscw/urel/Z/resource/list/custom/akn_logical_template_3.xml +../data/list/custom/akn_logical_template_3.xml /epoc32/data/z/resource/list/custom/akn_logical_template_3.xml + +../data/list/custom/akn_logical_template_4.xml /epoc32/release/winscw/udeb/Z/resource/list/custom/akn_logical_template_4.xml +../data/list/custom/akn_logical_template_4.xml /epoc32/release/winscw/urel/Z/resource/list/custom/akn_logical_template_4.xml +../data/list/custom/akn_logical_template_4.xml /epoc32/data/z/resource/list/custom/akn_logical_template_4.xml + +../data/list/custom/akn_logical_template_5.xml /epoc32/release/winscw/udeb/Z/resource/list/custom/akn_logical_template_5.xml +../data/list/custom/akn_logical_template_5.xml /epoc32/release/winscw/urel/Z/resource/list/custom/akn_logical_template_5.xml +../data/list/custom/akn_logical_template_5.xml /epoc32/data/z/resource/list/custom/akn_logical_template_5.xml + +../data/list/custom/akn_logical_template_6.xml /epoc32/release/winscw/udeb/Z/resource/list/custom/akn_logical_template_6.xml +../data/list/custom/akn_logical_template_6.xml /epoc32/release/winscw/urel/Z/resource/list/custom/akn_logical_template_6.xml +../data/list/custom/akn_logical_template_6.xml /epoc32/data/z/resource/list/custom/akn_logical_template_6.xml + +../data/list/custom/akn_logical_template_7.xml /epoc32/release/winscw/udeb/Z/resource/list/custom/akn_logical_template_7.xml +../data/list/custom/akn_logical_template_7.xml /epoc32/release/winscw/urel/Z/resource/list/custom/akn_logical_template_7.xml +../data/list/custom/akn_logical_template_7.xml /epoc32/data/z/resource/list/custom/akn_logical_template_7.xml + +../data/list/custom/akn_logical_template_8.xml /epoc32/release/winscw/udeb/Z/resource/list/custom/akn_logical_template_8.xml +../data/list/custom/akn_logical_template_8.xml /epoc32/release/winscw/urel/Z/resource/list/custom/akn_logical_template_8.xml +../data/list/custom/akn_logical_template_8.xml /epoc32/data/z/resource/list/custom/akn_logical_template_8.xml + +../data/list/custom/akn_logical_template_10.xml /epoc32/release/winscw/udeb/Z/resource/list/custom/akn_logical_template_10.xml +../data/list/custom/akn_logical_template_10.xml /epoc32/release/winscw/urel/Z/resource/list/custom/akn_logical_template_10.xml +../data/list/custom/akn_logical_template_10.xml /epoc32/data/z/resource/list/custom/akn_logical_template_10.xml + +../data/list/custom/akn_logical_template_11.xml /epoc32/release/winscw/udeb/Z/resource/list/custom/akn_logical_template_11.xml +../data/list/custom/akn_logical_template_11.xml /epoc32/release/winscw/urel/Z/resource/list/custom/akn_logical_template_11.xml +../data/list/custom/akn_logical_template_11.xml /epoc32/data/z/resource/list/custom/akn_logical_template_11.xml + +../data/list/custom/akn_logical_template_12.xml /epoc32/release/winscw/udeb/Z/resource/list/custom/akn_logical_template_12.xml +../data/list/custom/akn_logical_template_12.xml /epoc32/release/winscw/urel/Z/resource/list/custom/akn_logical_template_12.xml +../data/list/custom/akn_logical_template_12.xml /epoc32/data/z/resource/list/custom/akn_logical_template_12.xml + +../data/list/custom/akn_logical_template_13.xml /epoc32/release/winscw/udeb/Z/resource/list/custom/akn_logical_template_13.xml +../data/list/custom/akn_logical_template_13.xml /epoc32/release/winscw/urel/Z/resource/list/custom/akn_logical_template_13.xml +../data/list/custom/akn_logical_template_13.xml /epoc32/data/z/resource/list/custom/akn_logical_template_13.xml + +// grid exports +../data/grid/custom/akn_single_large_graphic_pane.xml /epoc32/release/winscw/udeb/Z/resource/grid/custom/akn_single_large_graphic_pane.xml +../data/grid/custom/akn_single_large_graphic_pane.xml /epoc32/release/winscw/urel/Z/resource/grid/custom/akn_single_large_graphic_pane.xml +../data/grid/custom/akn_single_large_graphic_pane.xml /epoc32/data/z/resource/grid/custom/akn_single_large_graphic_pane.xml + +../data/grid/custom/akn_logical_template_1.xml /epoc32/release/winscw/udeb/Z/resource/grid/custom/akn_logical_template_1.xml +../data/grid/custom/akn_logical_template_1.xml /epoc32/release/winscw/urel/Z/resource/grid/custom/akn_logical_template_1.xml +../data/grid/custom/akn_logical_template_1.xml /epoc32/data/z/resource/grid/custom/akn_logical_template_1.xml + +../data/grid/custom/akn_logical_template_2.xml /epoc32/release/winscw/udeb/Z/resource/grid/custom/akn_logical_template_2.xml +../data/grid/custom/akn_logical_template_2.xml /epoc32/release/winscw/urel/Z/resource/grid/custom/akn_logical_template_2.xml +../data/grid/custom/akn_logical_template_2.xml /epoc32/data/z/resource/grid/custom/akn_logical_template_2.xml + +../data/grid/custom/akn_logical_template_3.xml /epoc32/release/winscw/udeb/Z/resource/grid/custom/akn_logical_template_3.xml +../data/grid/custom/akn_logical_template_3.xml /epoc32/release/winscw/urel/Z/resource/grid/custom/akn_logical_template_3.xml +../data/grid/custom/akn_logical_template_3.xml /epoc32/data/z/resource/grid/custom/akn_logical_template_3.xml + +../data/grid/custom/akn_logical_template_4.xml /epoc32/release/winscw/udeb/Z/resource/grid/custom/akn_logical_template_4.xml +../data/grid/custom/akn_logical_template_4.xml /epoc32/release/winscw/urel/Z/resource/grid/custom/akn_logical_template_4.xml +../data/grid/custom/akn_logical_template_4.xml /epoc32/data/z/resource/grid/custom/akn_logical_template_4.xml + +//lct exports +../data/list/lct/akn_list_single_hc_apps_pane.xml /epoc32/release/winscw/udeb/Z/resource/list/lct/akn_list_single_hc_apps_pane.xml +../data/list/lct/akn_list_single_hc_apps_pane.xml /epoc32/release/winscw/urel/Z/resource/list/lct/akn_list_single_hc_apps_pane.xml +../data/list/lct/akn_list_single_hc_apps_pane.xml /epoc32/data/z/resource/list/lct/akn_list_single_hc_apps_pane.xml + +../data/list/lct/akn_single_large_graphic_pane.xml /epoc32/release/winscw/udeb/Z/resource/list/lct/akn_single_large_graphic_pane.xml +../data/list/lct/akn_single_large_graphic_pane.xml /epoc32/release/winscw/urel/Z/resource/list/lct/akn_single_large_graphic_pane.xml +../data/list/lct/akn_single_large_graphic_pane.xml /epoc32/data/z/resource/list/lct/akn_single_large_graphic_pane.xml + +../data/list/lct/akn_logical_template_1.xml /epoc32/release/winscw/udeb/Z/resource/list/lct/akn_logical_template_1.xml +../data/list/lct/akn_logical_template_1.xml /epoc32/release/winscw/urel/Z/resource/list/lct/akn_logical_template_1.xml +../data/list/lct/akn_logical_template_1.xml /epoc32/data/z/resource/list/lct/akn_logical_template_1.xml + +../data/list/lct/akn_logical_template_2.xml /epoc32/release/winscw/udeb/Z/resource/list/lct/akn_logical_template_2.xml +../data/list/lct/akn_logical_template_2.xml /epoc32/release/winscw/urel/Z/resource/list/lct/akn_logical_template_2.xml +../data/list/lct/akn_logical_template_2.xml /epoc32/data/z/resource/list/lct/akn_logical_template_2.xml + +../data/list/lct/akn_logical_template_3.xml /epoc32/release/winscw/udeb/Z/resource/list/lct/akn_logical_template_3.xml +../data/list/lct/akn_logical_template_3.xml /epoc32/release/winscw/urel/Z/resource/list/lct/akn_logical_template_3.xml +../data/list/lct/akn_logical_template_3.xml /epoc32/data/z/resource/list/lct/akn_logical_template_3.xml + +../data/list/lct/akn_logical_template_4.xml /epoc32/release/winscw/udeb/Z/resource/list/lct/akn_logical_template_4.xml +../data/list/lct/akn_logical_template_4.xml /epoc32/release/winscw/urel/Z/resource/list/lct/akn_logical_template_4.xml +../data/list/lct/akn_logical_template_4.xml /epoc32/data/z/resource/list/lct/akn_logical_template_4.xml + +../data/list/lct/akn_logical_template_5.xml /epoc32/release/winscw/udeb/Z/resource/list/lct/akn_logical_template_5.xml +../data/list/lct/akn_logical_template_5.xml /epoc32/release/winscw/urel/Z/resource/list/lct/akn_logical_template_5.xml +../data/list/lct/akn_logical_template_5.xml /epoc32/data/z/resource/list/lct/akn_logical_template_5.xml + +../data/list/lct/akn_logical_template_6.xml /epoc32/release/winscw/udeb/Z/resource/list/lct/akn_logical_template_6.xml +../data/list/lct/akn_logical_template_6.xml /epoc32/release/winscw/urel/Z/resource/list/lct/akn_logical_template_6.xml +../data/list/lct/akn_logical_template_6.xml /epoc32/data/z/resource/list/lct/akn_logical_template_6.xml + +../data/list/lct/akn_logical_template_6a.xml /epoc32/release/winscw/udeb/Z/resource/list/lct/akn_logical_template_6a.xml +../data/list/lct/akn_logical_template_6a.xml /epoc32/release/winscw/urel/Z/resource/list/lct/akn_logical_template_6a.xml +../data/list/lct/akn_logical_template_6a.xml /epoc32/data/z/resource/list/lct/akn_logical_template_6a.xml + +../data/list/lct/akn_logical_template_7.xml /epoc32/release/winscw/udeb/Z/resource/list/lct/akn_logical_template_7.xml +../data/list/lct/akn_logical_template_7.xml /epoc32/release/winscw/urel/Z/resource/list/lct/akn_logical_template_7.xml +../data/list/lct/akn_logical_template_7.xml /epoc32/data/z/resource/list/lct/akn_logical_template_7.xml + +../data/list/lct/akn_logical_template_8.xml /epoc32/release/winscw/udeb/Z/resource/list/lct/akn_logical_template_8.xml +../data/list/lct/akn_logical_template_8.xml /epoc32/release/winscw/urel/Z/resource/list/lct/akn_logical_template_8.xml +../data/list/lct/akn_logical_template_8.xml /epoc32/data/z/resource/list/lct/akn_logical_template_8.xml + +../data/list/lct/akn_logical_template_12.xml /epoc32/release/winscw/udeb/Z/resource/list/lct/akn_logical_template_12.xml +../data/list/lct/akn_logical_template_12.xml /epoc32/release/winscw/urel/Z/resource/list/lct/akn_logical_template_12.xml +../data/list/lct/akn_logical_template_12.xml /epoc32/data/z/resource/list/lct/akn_logical_template_12.xml + +../data/grid/lct/akn_logical_template_3.xml /epoc32/release/winscw/udeb/Z/resource/grid/lct/akn_logical_template_3.xml +../data/grid/lct/akn_logical_template_3.xml /epoc32/release/winscw/urel/Z/resource/grid/lct/akn_logical_template_3.xml +../data/grid/lct/akn_logical_template_3.xml /epoc32/data/z/resource/grid/lct/akn_logical_template_3.xml + +../inc/mmdraganddropobserver.h |../../../inc/mmdraganddropobserver.h +../inc/mmlongtapobserver.h |../../../inc/mmlongtapobserver.h +../inc/mmkeyeventobserver.h |../../../inc/mmkeyeventobserver.h +../inc/mmwidgetobserver.h |../../../inc/mmwidgetobserver.h +../inc/mmwidgetcontainer.h |../../../inc/mmwidgetcontainer.h +../inc/mmvisibilityobserver.h |../../../inc/mmvisibilityobserver.h +../inc/mmtemplatelibrary.h |../../../inc/mmtemplatelibrary.h +../inc/mmwidgetsconstants.h |../../../inc/mmwidgetsconstants.h + +PRJ_MMPFILES +mmwidgets.mmp diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/group/mmwidgets.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/group/mmwidgets.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,102 @@ +/* +* 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: Project definition file for project multimedia menu widgets +* +*/ + + +#include <platform_paths.hrh> + +TARGET mmwidgets.dll +TARGETTYPE dll +UID 0x1000008d 0x2001E658 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE mmlistboxcontainer.cpp +SOURCE mmlistbox.cpp +SOURCE mmlistboxitemdrawer.cpp +SOURCE mmlistboxview.cpp +SOURCE mmtemplatelibrary.cpp +SOURCE mmgrid.cpp +SOURCE mmgridmodel.cpp +SOURCE mmgridview.cpp +SOURCE mmgridcontainer.cpp +SOURCE mmwidgetcontainer.cpp +SOURCE mmmarqueeadapter.cpp +SOURCE mmhighlighttimer.cpp +SOURCE mmfloatingitem.cpp +SOURCE mmdraweranimator.cpp +SOURCE mmlctutils.cpp +SOURCE mmlistboxmodel.cpp +SOURCE mmpostevaluationprocessor.cpp +SOURCE mmcacheforitem.cpp +SOURCE mmitemsdatacache.cpp + +USERINCLUDE ../inc +SYSTEMINCLUDE ../../../inc +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY apparc.lib +LIBRARY avkon.lib +LIBRARY apgrfx.lib // for TApaTask +LIBRARY eikcore.lib +LIBRARY eikcoctl.lib +LIBRARY cone.lib +LIBRARY cdlengine.lib // for Layout_Meta_Data +LIBRARY fbscli.lib +LIBRARY egul.lib + +LIBRARY hnengine.lib +LIBRARY hnpresentationmodel.lib +LIBRARY hnutilities.lib + +LIBRARY liwservicehandler.lib // for Back Stepping SAPI + +LIBRARY AknCapserverClient.lib // for fastswap activation +LIBRARY ws32.lib // for getting list of running applications +LIBRARY AknSkins.lib // for application icon fetching +LIBRARY aknicon.lib // for application icon fetching +LIBRARY gfxtrans.lib // effects +LIBRARY akntransitionutils.lib +LIBRARY commonengine.lib // for stringloader +LIBRARY gdi.lib +LIBRARY bafl.lib +LIBRARY eikctl.lib +LIBRARY fontutils.lib +LIBRARY XmlEngineDOM.lib +LIBRARY hnmetadatamodel.lib +#ifdef RD_UI_TRANSITION_EFFECTS_LIST +LIBRARY aknlistloadertfx.lib +#endif //RD_UI_TRANSITION_EFFECTS_LIST +LIBRARY hlplch.lib +LIBRARY AknLayout2.lib +LIBRARY AknLayout2Scalable.lib +LIBRARY BitmapTransforms.lib +LIBRARY bitgdi.lib +LIBRARY centralrepository.lib +LIBRARY touchfeedback.lib + +#ifdef _MATRIX_MENU_TRACE_PERFORMANCE +LIBRARY flogger.lib +#else +DEBUGLIBRARY flogger.lib +#endif + + + +// End of File diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmcacheforitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmcacheforitem.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,247 @@ +/* +* 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: +* Version : 2 << Don't touch! Updated by Synergy at check-out. +* +*/ + +#ifndef MMCACHEFORITEM_H +#define MMCACHEFORITEM_H + +#include <e32base.h> +#include <e32cmn.h> +#include "mmsubcellssetupcode.h" + +class CGulIcon; +class CHnIconHolder; +class CMmItemsDataCache; + +/** + * Stores cached information needed to draw a single item. + */ +NONSHARABLE_CLASS( CMmCacheForItem ): public CBase + { +public: + /** + * Creates a new instance of CMmCacheForItem object. + * The newly created object will be left on the cleanup stack. + * + * @param aParent The owner of the newly created object. + */ + static CMmCacheForItem* NewLC( CMmItemsDataCache& aParent ); + + /** + * Creates a new instance of CMmCacheForItem object. + * The newly created object will be left on the cleanup stack. + * + * @param aParent The owner of the newly created object. + */ + static CMmCacheForItem* NewL( CMmItemsDataCache& aParent ); + + /** + * Standard C++ virtual destructor. + */ + ~CMmCacheForItem(); + + /** + * Sets the subcell setup code that denoted valid subcell setup for this + * item. + * + * @param aSubcellsSetupCode Subcells setup code for this item. + */ + inline void SetSubcellsSetupCode( TMmSubcellsSetupCode aSubcellsSetupCode ); + + /** + * Returns the code of the subcells setup required by this item to be + * properly drawn using cached data. + */ + inline TMmSubcellsSetupCode GetSubcellsSetupCode() const; + + /** + * Returns information whether the data in this cache is valid. + * Invalid cache should never be used. + * + * @return ETrue if valid, EFalse otherwise. + */ + inline TBool IsValid() const; + + /** + * Marks this cache as valid or invalid. + * + * @param aValid (Self-explanatory). + */ + inline void SetValid( TBool aValid ); + + /** + * Returns information whether at the moment of updating this cache object + * the item was current (highlighted). + * + * @return ETrue if current, EFalse otherwise. + */ + inline TBool IsCurrent(); + + /** + * Sets the information whether the item was current (highlighted). + */ + inline void SetCurrent( TBool aCurrent ); + + /** + * Retrieves the cached item text. + * This is the complete string needed by AVKON methods to draw the item + * including tab characters and icon indices. + * + * @return Cached item text. + */ + inline const TDesC& GetItemText() const; + + /** + * Returns reference to the text buffer owned by this cache. + * This methods allows for updating the cached text. + * + * @return Reference to the text buffer owned by this cache. + */ + inline RBuf& GetItemTextForModifications(); + + /** + * Retrives cached template name. + * + * @return Cached template name. + */ + const TDesC8& GetTemplate() const; + + /** + * Sets template name for the item. + * + * @param aItemTemplate Template name. + */ + void SetTemplateL( const TDesC8& aItemTemplate ); + + /** + * Returns cached item size. + * + * @return Cached item size. + */ + inline TSize GetSize() const; + + /** + * Updates item size stored in the cache. + * + * @param aItemSize Item size. + */ + inline void SetSize( TSize aItemSize ); + + /** + * Produces icon list, which can be then passed as parameter to + * CEikFormattedCellListBoxData::SetIconArray. + * It is up to the caller to delete the returned array. However, + * the icons stored in the array must not be deleted. + */ + CArrayPtr<CGulIcon>* GetIconListL(); + + /** + * Appends an icon (specifically an icon holder) to the cached array of icon holders. + * The icon holder is then co-owned by this CMmCacheForItem object so that the + * icon contained in the icon holder can be safely stored. + * + * @param aIconHolder An icon holder (NULL value not allowed). + * @return Index of the just appended icon holder. + */ + TInt AppendIconL( CHnIconHolder* aIconHolder ); + + /** + * Clears the array of icon holders stored in this item cache. + * It ceases co-owning the icon holders and resets the array + * that stores them. + */ + void ClearIconArray(); + + /** + * Based on the information about how the item must be drawn (with + * hightlight or not) and what currect subcells setup it, this methods + * invalidates the cache for this item to prevent problems such as: + * * cache information for highlighted item being used for to draw + * the item without highlight or vice versa. + * * relying on cache and not performing the full subcells setup while + * the current subcells setup does not fit this particular item. + */ + void InvalidateIfCacheMayNotBeUsed( TBool aIsItemCurrent, + TMmSubcellsSetupCode aSubcellsSetupCode ); + +protected: + /** + * Stardard C++ constructor. + * + * @param aParent CMmItemsDataCache object owning this object. + */ + CMmCacheForItem( CMmItemsDataCache& aParent ); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + +protected: + /** + * Stores information whether this cache object is valid. + */ + TBool iIsValid; + + /** + * Stores information the item was highlighted at the moment + * of last cache update. + */ + TBool iIsCurrent; + + /** + * Stores subcells setup code that denotes the subcells setup + * needed to draw the item using the cached data. + */ + TMmSubcellsSetupCode iSubcellsSetupCode; + + /** + * Own. + * Stores the item text in the format that + * CFormattedCellListBoxData::Draw accepts. + * This text includes icon indices separated with tab characters. + */ + RBuf iItemText; + + /** + * Stores the item size. + */ + TSize iItemSize; + + /** + * Template identifier obtained from @c aParent using + * @c CMmItemsDataCache::GetTemplateIdentifierL. + */ + TInt iTemplateIdentifier; + + /** + * Own. + * The icon holders in the array are co-owned. + */ + RArray<CHnIconHolder*> iIconHolderList; + + /** + * Object that represents the whole data cache as opposed + * to single item cache represented by this object. + */ + CMmItemsDataCache& iParent; + + }; + +#include "mmcacheforitem.inl" + +#endif // MMCACHEFORITEM_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmcacheforitem.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmcacheforitem.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,110 @@ +/* +* 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: +* Version : 2 << Don't touch! Updated by Synergy at check-out. +* +*/ + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline TBool CMmCacheForItem::IsValid() const + { + return iIsValid; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void CMmCacheForItem::SetSubcellsSetupCode( TMmSubcellsSetupCode aSubcellsSetupCode ) + { + iSubcellsSetupCode = aSubcellsSetupCode; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline TMmSubcellsSetupCode CMmCacheForItem::GetSubcellsSetupCode() const + { + __ASSERT_DEBUG( iIsValid, User::Invariant() ); + return iSubcellsSetupCode; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void CMmCacheForItem::SetValid( TBool aValid ) + { + iIsValid = aValid; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline TBool CMmCacheForItem::IsCurrent() + { + return iIsCurrent; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void CMmCacheForItem::SetCurrent( TBool aCurrent ) + { + iIsCurrent = aCurrent; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline const TDesC& CMmCacheForItem::GetItemText() const + { + __ASSERT_DEBUG( iIsValid, User::Invariant() ); + return iItemText; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline RBuf& CMmCacheForItem::GetItemTextForModifications() + { + return iItemText; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline TSize CMmCacheForItem::GetSize() const + { + __ASSERT_DEBUG( iIsValid, User::Invariant() ); + return iItemSize; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void CMmCacheForItem::SetSize( TSize aItemSize ) + { + iItemSize = aItemSize; + } diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmdraganddropobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmdraganddropobserver.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,74 @@ +/* +* 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: receives key pressed notifications +* +*/ + + +#ifndef M_MMDRAGANDDROPOBSERVER_H +#define M_MMDRAGANDDROPOBSERVER_H + +/** + * Used by Multimedia Menu widgets to notify about dragging events. + * 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 + * of the drag. + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v3.0 + * @ingroup group_mmwidgets + */ +class MMmDragAndDropObserver + { +public: + /** + * Method is invoked on the observer, when the dragging starts. + * + * @since S60 v5.0 + * @param aModelItemIndex Index of item that has started dragging. + */ + virtual void HandleDragStartL( TInt aModelItemIndex ) = 0; + + /** + * Method is invoked on the observer, when highlight changes + * while dragging. + * + * @since S60 v5.0 + * @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. + * + * @since S60 v5.0 + * @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. + * + * @since S60 v5.0 + * @param aModelItemIndex Index of item on which the draging stops. + */ + virtual void HandleDraggedIndexUpdatedL( TInt aModelItemIndex ) = 0; + + }; + +#endif // M_MMDRAGANDDROPOBSERVER_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmdraweranimator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmdraweranimator.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,277 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CMmDrawerAnimator declaration +* Version : %version: MM_17.1.8 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef C_MMDRAWERANIMATOR_H +#define C_MMDRAWERANIMATOR_H + +#include <e32base.h> +#include <e32std.h> +#ifdef RD_UI_TRANSITION_EFFECTS_LIST +#include <aknlistloadertfx.h> +#include <aknlistboxtfxinternal.h> +#include <aknlistboxtfx.h> +#endif +class CMmListBoxItemDrawer; +class TMmFloatingItem; + +/** + * Zoom ratio when no zooming is performed. + */ +const TReal KNormalStateZoomRatio = 1.0f; + +/** + * Zoom ratio when zooming is performed. + */ +const TReal KZoomStateZoomRatio = 1.25f; + +/** + * Used by Multimedia Menu to draw Animated items. + * Drawer animator is an active object, that forces refreshes + * while floating items are available in the associated CListBoxItemDrawer. + * When no items are available the drawer ceases to redraw the screen. + * Active object becomes active when a new animation is triggered. + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v5.0 + * @see CListBoxItemDrawer + * @ingroup group_mmwidgets + */ +NONSHARABLE_CLASS( CMmDrawerAnimator ) : public CActive + { + +public: + /** + * Two-phased constructor. + * + * @since S60 v5.0 + * @param aDrawer Item drawer used to draw item. + */ + static CMmDrawerAnimator* NewL( CMmListBoxItemDrawer& aDrawer ); + + /** + * 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(); + + /** + * Animates transition of the dragged item. + * The animation starts in the current position of EDrag + * floating item, and end in the original place of dragging + * or destination place, if reorder occured. + * + * @since S60 v5.0 + */ + void AnimateDragItemTransitionL( ); + + /** + * Animates an item with index aItemFrom into position + * indexed by aItemTo. + * + * @since S60 v5.0 + * @param aItemFrom Which item should be animated. + * @param aItemTo Where to should the item be animated. + */ + void AnimateItemSwapL( TInt aItemFrom, TInt aItemTo ); + + /** + * Animates zooming of an item. + * + * @since S60 v3.0 + * @param aItemIndex Index of item to be zoomed. + * @param aZoomIn Is zooming in or out. + */ + void AnimateItemZoomL( TInt aItemIndex, TBool aZoomIn ); + + /** + * Checks if system is ready for new animation. + * + * @since S60 v5.0 + * @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 + * if floating items are available + * + * @since S60 v5.0 + * @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 + * dropped. + */ + void PrepareForGarbage(); + +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 + */ + void ConstructL(); + +private: // From CActive + + /** + * Draws next animation phase. + * + * @since S60 v3.0 + */ + void RunL(); + + /** + * Cancels animation timer. Stops animation. + * + * @since S60 v3.0 + */ + void DoCancel(); + + /** + * Handles error if error an error occured. + * + * @since S60 v3.0 + * @param aError Error code which occurred. + * @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. + */ + 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. + */ + TBool iPreparedForGarbage; + }; + +#endif // MMDRAWERANIMATOR_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmfloatingitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmfloatingitem.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,271 @@ +/* +* 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: floating item +* +*/ + + +#ifndef T_MMFLOATINGITEM_H +#define T_MMFLOATINGITEM_H + +#include <e32std.h> +#include <e32base.h> +#include "mmwidgetsconstants.h" + + +/** + * Floating item. + * + * This class describes a floating item element. Floating item is an extension + * to the way grid and list widgets are drawn. Since widgets are very restrictive, + * as to the place where na item is drawn (since in both grid and list each item + * has a pretty well defined place) there had to be a way to draw items off the + * standard place. Together with CMMDrawerAnimator, these classes support + * drawing of dragged item as well as other off place items such as animation + * frames. + * Floating items as such support the idea of animation, as each of the items + * are aware of the animation step, and may modify its own position, whenever + * requested. However a timer in this manner is needed, and this role is + * performed by CMMDrawerAnimator, which is aware of the redraw speed, and may + * control the state of all instances of TMMFloatingItem. + * It should be noted that both TMMFloatingItem and CMMDrawerAnimator doesn't + * handle item's drawing on it's own. These classes just control the logical + * state of floating items. All floating items are associated with the + * CMMListBoxItemDrawer in an array, and drawn whenever a Draw operation is + * performed on the widget, or any particular item, that is in any way overlapped + * by a floating item. + * + * @see CMMDrawerAnimator + * @lib mmwidgets + * @since S60 v5.0 + * @ingroup group_mmwidgets + */ + +class CListBoxView; + +class TMmFloatingItem + { + +public: + /** + * Constructor. + * + * If a non-null value for the aView parameter is supplied, then item position + * will be relative, so when the view is scrolled the floating item will move + * just like all the non-floating items. + * If aView is NULL, then item position will be absolute, meaning that it will + * not change when the view is scrolled. + * + * @since S60 ?S60_version + * @param aDrawnIndex Index of the item which is going to + * be draw off place. + * @param aStartPosition Position of the item (always expressed in screen + * coordinates, even when creating an item with relative + * position). + * @param aType Type of the floating item. + * @param aAnimationFrames Total number of animation frames to perform. + * @param aView The view on which items are drawn (optional - affects + * scrolling behavior). + */ + TMmFloatingItem( TInt aDrawnIndex, TPoint aStartPosition, + TMmFloatingItemType aType, TInt aAnimationFrames, + CListBoxView* aView = NULL ); + + /** + * Sets the flag of manual delete. If such flag is set + * the floating item will not perfrom self removal. Normally + * floating items remove themselves fram the drawing buffer whenever + * the animation is finished. This is used for example for + * dragged items, since they are not animated, and they will be + * deleted manual when the uses lets go of the drag. + * + * @since S60 5.0 + * @param aManual Flag of manual deletion. + */ + void SetManualDelete( TBool aManual ); + + /** + * Performs a step of the animation, according to + * earlier provided information. + * + * @since S60 5.0 + */ + TBool MakeStep(); + + /** + * Set the difference in the location of the floating item + * from the originating position of the item, to the resulting + * position of the animation + * + * @since S60 5.0 + * @param aDiffetenceVector Vector of displacement. + */ + void SetPositionStep( TPoint aDiffetenceVector ); + + /** + * Set the size of the step that modifies the size of the + * item with every step of the animation. + * + * @since S60 5.0 + * @param aStartSize Initial size of the item. + * @param aFinalSize Final size of the item. + */ + void SetSizeStep( TReal aStartSize, TReal aFinalSize ); + + /** + * Gets the current zoom ratio. The ratio might by + * time specific, since floating items support animations + * changing size of the item. + * + * @since S60 5.0 + * @return Zooming ratio. + */ + TReal GetCurrentZoomRatio() const; + + /** + * Gets the type of the floating item. + * + * @since S60 5.0 + * @return Type of the floating item. + */ + TMmFloatingItemType GetFloatingItemType() const; + + /** + * Gets the item index of the item being drawn. + * + * @since S60 5.0 + * @return Item of the item drawn. + */ + TInt GetDrawnItemIndex() const; + + /** + * Gets the current item position. + * + * The position returned is always expressed in screen coordinates, + * even if this item's position is relative. + * + * @since S60 5.0 + * @return Position of the item. + */ + TPoint GetItemPosition() const; + + /** + * Marks the item as invalid. Item will be deleted + * from the cache when an attempt to draw the item + * occurs. + * + * @since S60 5.0 + */ + void InvalidateFloatingItem(); + + /** + * Tests if the item is still valid. + * + * @since S60 5.0 + */ + TBool IsFloatingItemValid() const; + + /** + * Zooming status is returned, meaning if the item is still + * in the state of zoming in, zooming out, or in normal size + * + * @since S60 5.0 + * @return Negative value is returned if the item is zooming out. + * Positive value is returned if item is zooming in. + * Zero is returned if the item is static in size. + */ + TInt GetZoomingStatus(); + + /** + * Checks if the item has the manual deletion + * flag setup. + * + * @since S60 5.0 + * @return The status of manual deletion flag. + */ + TBool IsManualDelete(); + + /** + * Calculates consequent steps + * + * @since S60 5.0 + * @param aVector Displacement vector. + */ + void CalculateSteps(TPoint aVector); + +private: + + /** + * Index of the item, which is being animated. + */ + TInt iDrawnItemIndex; + + /** + * Current item position. + * + * This can be either an absolute position (expressed in screen coordinates) or + * a relative position depending on whether iView member variable is NULL. + * In the latter case, the position is relative to the top-left corner of the + * first item in the view. + */ + TPoint iItemPosition; + + /** + * Dispalcement of the item, per animation step. + */ + TFixedArray<TPoint, MmEffects::KMaximumAnimationFramesCount> iPositionStep; + + /** + * Size change, per animation step. + */ + TReal iSizeStep; + + /** + * Counter of animation frames. + */ + TInt iFrameCounter; + + /** + * Total number of animation frames to perform. + */ + TInt iFrames; + + /** + * Manual deletion flag. + */ + TBool iManualDelete; + + /** + * Current scaling ratio. + */ + TReal iZoomRatio; + + /** + * Type of the floating item. There is a need for distinction + * between different animations types. + */ + TMmFloatingItemType iType; + + /** + * The view on which items are drawn. + * + * When iView is NULL, then iItemPosition contains absolute item position. + * Otherwise iItemPostion contains item position relative to the top-left + * corner of the first item in the view. + */ + CListBoxView* iView; + + }; + +#endif // T_MMFLOATINGITEM_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmgrid.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmgrid.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,445 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CMmGrid declaration +* Version : %version: MM_32.1.19 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef C_MMGRID_H +#define C_MMGRID_H + +#include <e32std.h> +#include <e32base.h> +#include <AknGrid.h> + +class CMmGridModel; +class CMmListBoxItemDrawer; +class CMmMarqueeAdapter; +class CMmWidgetContainer; +class CMmTemplateLibrary; + +/** + * Multimedia Menu Grid Widget + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v3.0 + * @ingroup group_mmwidgets + */ +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. + */ + virtual ~CMmGrid(); + + /** + * Draws the grid is given rectangle. + * + * @since S60 v3.0 + * @param aRect Rect within which grid should be drawn. + */ + void Draw( const TRect& aRect ) const; + + /** + * Draws the grid view. + * + * @since S60 v5.0 + */ + void DrawView(); + + /** + * Creates the item drawer for grid. + * + * @since S60 v3.0 + */ + void CreateItemDrawerL(); + + /** + * Creates the item drawer for grid. + * + * @param aTemplateLibrary Template library for drawer. + * @since S60 v3.0 + */ + void CreateItemDrawerL( CMmTemplateLibrary* aTemplateLibrary ); + + /** + * Creates the view class instance for grid. + * + * @since S60 v3.0 + * @return Griv view. + */ + CListBoxView* MakeViewClassInstanceL(); + + /** + * Handles scrolling event. + * + * @since S60 v3.0 + * @param aScrollBar Scrollbar being scrolled. + * @param aEventType Type of scrollbar event. + */ + void HandleScrollEventL( CEikScrollBar* aScrollBar, + TEikScrollEvent aEventType ); + + /** + * Handles pointer event. + * + * @since S60 v3.0 + * @param aPointerEvent Type of pointer event. + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + /** + * Sets item drawer and view background context. + * + * @since S60 v3.0 + * @param aBgContext Background context to be set in view and item drawer. + */ + 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. + * + * @since S60 v3.0 + * @return Do items fit in view rectangle. + */ + TBool AllItemsFitInViewRect(); + + /** + * Updates scrollbar changes. + * + * @since S60 v3.0 + */ + void UpdateScrollBarsL(); + + /** + * Sets the marquee adapter. + * + * @since S60 v3.0 + * @param aAdapter Marquee adapter. + */ + void SetMarqueeAdapter( CMmMarqueeAdapter* aAdapter ); + + /** + * Sets up the layout (orientation and items' sizes). + * + * @since S60 v3.0 + */ + void SetupLayout(); + + /** + * Gets the Grid model. + * + * @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 + * 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. + */ + void AdjustTopItemIndex() const; + + /** + * 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. + */ + void SetItemHeight( TInt aItemHeight ); + + /** + * Updates scrollbar thumbs. + */ + void UpdateScrollBarThumbs(); + + /** + * 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 + */ + CMmGrid(); + + /** + * 2nd phase constructor. + * + * @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. + * + * @since S60 v3.0 + * @param aIsLandscape Is orientation in landscape mode. + * @param aCellSize The size of grid cell/item. + * @param aViewLayout The layout of the grid (e.g. 3x4). + */ + void DoHandleResourceChangeL( TBool aIsLandscape, TSize& aCellSize, + TSize& aViewLayout ); + + /** + * Handles changes in resource. + * + * @since S60 v3.0 + * @param aCellSize The size of grid cell/item. + * @param aViewLayout The layout of the grid (e.g. 3x4). + */ + void DoHandleResourceChangeL( TSize& aCellSize, + TSize& aViewLayout ); + + /** + * Sets up the layout (for use in non-leaving SetupLayout()) + * + * @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. + */ + TBool IsPointerInTopScrollingThreshold( + const TPointerEvent& aPointerEvent ) const; + + /** + * 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 ); + + /** + * Updates the dispapearing highlight. + * + * @since S60 v3.0 + * @param aPointerEvent Type of pointer event. + */ + void HandleOverridenHighlightDrawing( const TPointerEvent& aPointerEvent, + TInt aIndexBefore, TInt aIndexAfter ); + + /** + * Ensures that elements are drawn correctly when mirrored layout is + * used and scrollbar is visible by shifting ViewRect to the right. + * Also disabled background drawing for scrollbar as it would not + * 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; + +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. + */ + TBool iHighlightVisibleUntilButton1Up; + + /** + * Blocks scrollbar drawing. When this flag is set scrollbars components + * are blocked in the CountComponentControls() method; + */ + TBool iDisableChildComponentDrawing; + }; + +#endif // C_MMGRID_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmgridcontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmgridcontainer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,302 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CMmGridContainer declaration +* Version : %version: MM_29.1.13 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef C_MMGRIDCONTAINER_H +#define C_MMGRIDCONTAINER_H + +#include <e32std.h> +#include <e32base.h> +#include <AknsLayeredBackgroundControlContext.h> +#include <AknsListBoxBackgroundControlContext.h> +#include <AknGrid.h> +#include "mmwidgetcontainer.h" +#include "hnglobals.h" + +class CMmGrid; +class CMmMarqueeAdapter; +class CEikColumnListBox; +class CNaviScrollTimer; +class CHnSuiteModel; +class CMmTemplateLibrary; +class CMmListBoxItemDrawer; + +/** + * Container for Multimedia Menu grid widget + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v5.0 + * @ingroup group_mmwidgets + */ +NONSHARABLE_CLASS( CMmGridContainer ) : public CMmWidgetContainer + { +public: + /** + * Two-phased constructor. + * + * @since S60 v5.0 + * @param aRect Rectangle of widget control. + * @param aObjectProvider Object provider. + * @param aTemplateLibrary template library for Drawer + */ + static CMmGridContainer* NewL( const TRect& aRect, + MObjectProvider* aObjectProvider, CMmTemplateLibrary* aTemplateLibrary ); + + /** + * Two-phased constructor. + * + * @since S60 v5.0 + * @param aRect Rectangle of widget control. + * @param aObjectProvider Object provider. + * @param aTemplateLibrary template library for Drawer + */ + static CMmGridContainer* NewLC( const TRect& aRect, + MObjectProvider* aObjectProvider, CMmTemplateLibrary* aTemplateLibrary ); + + /** + * Destructor. + * + * @since S60 v5.0 + */ + virtual ~CMmGridContainer(); + + /** + * Gets grid widget. + * + * @since S60 v5.0 + * @return Pointer to grid. + */ + CAknGrid* Grid(); + +public: // from base class CMmWidgetContainer + + /** + * Handle item addition. + * + * @since S60 v3.0 + */ + void HandleItemAdditionL(); + + /** + * Handle item removal. + * + * @since S60 v3.0 + */ + void HandleItemRemovalL(); + + /** + * Sets the default highlight in grid. + * + * @since S60 v5.0 + * @param aRedraw Is highlight to redraw. + */ + IMPORT_C void SetDefaultHighlightL( TBool aRedraw = ETrue ); + + /** + * Checks if widget is in edit mode state. + * + * @since S60 v5.0 + * @param aIsEditMode Is grid in edit mode state. + */ + void SetEditModeL( TBool aIsEditMode ); + + /** + * Derived from CCoeControl, called when container rectangle size is changed. + * + * @since S60 v5.0 + */ + void SizeChanged(); + + /** + * Gets grid model. + * + * @since S60 v5.0 + * @return Grid model. + */ + CMmListBoxModel* GetMmModel(); + + /** + * Sets empty text shown when grid is empty. + * + * @since S60 v5.0 + * @param aText Text to be shown when grid is empty. + */ + IMPORT_C void SetEmptyTextL( const TDesC& aText ); + + /** + * Sets item drawer and view background context. + * + * @since S60 v5.0 + * @param aBgContext Background context. + */ + void SetItemDrawerAndViewBgContext( + CAknsBasicBackgroundControlContext * aBgContext ); + + /** + * Sets up the grid layout. + * + * @since S60 v5.0 + */ + void SetupWidgetLayoutL(); + + /** + * Sets suite model. + * + * @since S60 v5.0 + * @param aModel Suite model. + */ + void SetSuiteModelL( CHnSuiteModel* aModel ); + + /** + * Set highlight visibility. + * + * @since S60 v5.0 + * @param aVisible Visibility status. + */ + void SetHighlightVisibilityL( TBool aVisible ); + + /** + * Retrieve type of widget. + * + * @since S60 v3.0 + * @return Type of widget. + */ + THnSuiteWidgetType WidgetType(); + + /** + * Called when filp state changed. + * + * @since S60 v3.0 + */ + void FlipStateChangedL(); + + /** + * Draws the widget view. + * + * @since S60 v5.0 + */ + virtual void DrawView(); + + /** + * Set the vertical item offset; + * @param aOffset The offset to set to the widget. + * + * @since S60 v5.0 + */ + virtual void SetVerticalItemOffset( TInt aOffset ); + + /** + * Gets the current widget vertical item offset. + * + * @since S60 v5.0 + * @return The current widget vertical item offset. + */ + virtual TInt VerticalItemOffset() const; + + /** + * Tells if item is visible (fully or partially). + * Overridden from the base class CMmWidgetContainer in order to + * provide a reliable implementation for grid. + * + * @param aItemIndex Item index. + * @return ETrue if visible, EFalse otherwise. + */ + TBool ItemIsVisible( TInt aItemIndex ) const; + +private: + /** + * Default constructor. + * + * @since S60 v5.0 + */ + CMmGridContainer(); + + /** + * 2nd phase constructor. + * + * @since S60 v5.0 + * @param aRect Rectangle of widget control. + * @param aObjectProvider Object provider. + * @param aTemplateLibrary template library for Drawer + */ + void ConstructL( const TRect& aRect, MObjectProvider* aObjectProvider, + CMmTemplateLibrary* aTemplateLibrary ); + + /** + * Constructs listbox from resource, creates scrollbar and sets empty list background text. + * + * @since S60 v5.0 + * @param aTemplateLibrary template library for Drawer + * @return Grid model. + */ + CMmGrid* CreateGridL( CMmTemplateLibrary* aTemplateLibrary ); + + /** + * Gets column count in current view. + * @returns Column count in current view. + */ + TInt ColumnsInCurrentView(); + + /** + * Gets row count in current view. + * @returns Row count in current view. + */ + TInt RowsInCurrentView(); + + /** + * Updates current view's scrollbar thumbs. + */ + void UpdateViewScrollBarThumbs(); + + /** + * Gets base default highlight in landscape mode. + * + * @param aLayout current layout of the grid + * @returns default highlight + */ + TInt LandscapeOrientationDefaultHighlight( TSize aLayout ); + + /** + * Gets base default highlight in portrait mode. + * + * @param aLayout current layout of the grid + * @returns default highlight + */ + TInt PortraitOrientationDefaultHighlight( TSize aLayout ); + + /** + * Calculates offset for default highlight position based on + * index of first visible item. + * + * @returns offset for default highlight + */ + TInt DefaultHighlightOffset(); + +private: // Data + + /** + * Pointer to listbox control. + * Own. + */ + CMmGrid* iGrid; + + }; + +#endif // C_MMGRIDCONTAINER_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmgridmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmgridmodel.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,110 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CMmGridModel declaration +* Version : %version: MM_14 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef C_MMGRIDMODEL_H +#define C_MMGRIDMODEL_H + +#include <e32std.h> +#include <e32base.h> +#include <AknGridM.h> + +class CMmListBoxModel; +class CHnSuiteModel; + +/** + * Multimedia Menu grid model. + * + * @code + * @endcode + * @lib + * @since S60 v3.0 + * @ingroup group_mmwidgets + */ +NONSHARABLE_CLASS( CMmGridModel ) : public CAknGridM + { +public: + /** + * Two-phased constructor. + */ + static CMmGridModel* NewL(); + + /** + * Two-phased constructor. + */ + static CMmGridModel* NewLC(); + + /** + * Destructor. + * + * @since S60 v3.0 + */ + ~CMmGridModel(); + + + /** + * Returns the number of grid items in model. + * + * @since S60 v3.0 + * @return Number of items in model. + */ + TInt NumberOfItems() const; + + /** + * Returns the Multimedia Menu listbox model. + * + * @since S60 v3.0 + * @return Listbox model. + */ + CMmListBoxModel* MmListBoxModel(); + +private: + /** + * Default constructor. + * + * @since S60 v3.0 + */ + CMmGridModel(); + + /** + * 2nd phase constructor. + * + * @since S60 v3.0 + */ + void ConstructL(); + + /** + * 2nd phase constructor. + * Do not delete!!! This constructor does not do anything + * and is overloaded to make sure AVKON sets up the grid only by calling + * ConstructL() without any parameters. + * + * @since S60 v5.0 + */ + void ConstructL(MDesCArray* /*aItemTextArray*/, TListBoxModelItemArrayOwnership /*aOwnershipType*/); + +private: // Data + + /** + * The Multimedia Menu Listbox model which is in fact the grid model used. + */ + CMmListBoxModel* iMmListBoxModel; + + }; + +#endif // C_MMGRIDMODEL_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmgridview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmgridview.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,208 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CMmGridView declaration +* Version : %version: MM_24.1.7 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef C_MMGRIDVIEW_H +#define C_MMGRIDVIEW_H + +#include <e32std.h> +#include <e32base.h> +#include <AknGridView.h> + +/** + * Multimedia Menu Grid View. + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v3.0 + * @ingroup group_mmwidgets + */ +NONSHARABLE_CLASS( CMmGridView ) : public CAknGridView + { +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. + * + * @since S60 v3.0 + * @param aClipRect Clipping rectangle. + */ + void Draw( const TRect* aClipRect ) const; + + /** + * Draws item definied by index. + * + * @since S60 v3.0 + * @param aItemIndex Item index which should be draw. + */ + void DrawItem(TInt aItemIndex) const; + + /** + * Gets item position. + * + * This fuction from @c CAknGridView is overridden so that it + * returns 'mirrored' item positions when mirrored layout is + * 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 + * rocker key in mirrored layout. + * Please note that it is necessary because of the hackish + * solution used to draw items in mirrored layout. + */ + void UpdateSelectionL( TSelectionMode aSelectionMode ); + + /** + * @see CAknGridView::MoveCursorL + * + * This method of CAknGridView is overriden to so that + * 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. + */ + void MoveCursorL( TCursorMovement aCursorMovement, + TSelectionMode aSelectionMode ); + + /** + * 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 views items. + */ + void SetItemHeight(TInt aItemHeight); + +private: + + /** + * Default constructor. + * + * @since S60 v3.0 + */ + CMmGridView(); + + /** + * 2nd phase constructor. + * + * @since S60 v3.0 + */ + void ConstructL(); + + /** + * Draws the grid within the given clipping rectangle. + * + * @since S60 v3.0 + * @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. + */ + TPoint CorrectItemPos( TInt aItemIndex ) const; + +private: + + /** + * 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; + }; + +#endif // C_MMGRIDVIEW_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmhighlighttimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmhighlighttimer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,200 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: highlight timer class +* Version : %version: MM_11.1.4 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef C_MMHIGHLIGHTTIMER_H +#define C_MMHIGHLIGHTTIMER_H + +#include <e32base.h> +#include <e32std.h> + +class CMmWidgetContainer; + +/** + * Used by Multimedia Menu to handle highlight behaviour. + * If the timer is set up highlight is due to disappera after set up + * time. + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v3.0 + * @ingroup group_mmwidgets + */ +NONSHARABLE_CLASS( CMmHighlightTimer ) : public CActive + { +public: + /** + * Two-phased constructor. + * + * @since S60 v3.0 + * @param aContainer Widget container that will use timer. + * @return Instance of highlight timer. + */ + IMPORT_C static CMmHighlightTimer* NewL( + CMmWidgetContainer* aContainer ); + + /** + * Two-phased constructor. + * + * @since S60 v3.0 + * @param aContainer Widget container that will use timer. + * @return Instance of highlight timer. + */ + IMPORT_C static CMmHighlightTimer* NewLC( + CMmWidgetContainer* aContainer ); + + /** + * Destructor. + * + * @since S60 v3.0 + */ + virtual ~CMmHighlightTimer(); + + /** + * Starts the timer with the time specified. Also draws the highlight. + * Highlight timer is the only element eligible to draw highlight with single click. + * If aTime parameter is negative or null the highlight is set permanently until it is + * cancelled manually (e.g. by calling StopL). + * + * @since S60 v5.0 + * @param aTime Time after which timer expires. + * @param aPressDownState The highlight state to be drawn. Default is highlight pressed down. + */ + void StartL( TInt aTime, TBool aPressDownState = ETrue ); + + /** + * Continues the highlight visibility for a specific time. + * If highlight wasn't active (visible) then this method does nothing. + * + * @since S60 v5.0 + * @param aTime Time after which timer expires. + */ + void ContinueL( TInt aTime ); + + /** + * Cancels the asynchronous request and draws over the highlighted item (if told to). + * + * @since S60 v5.0 + * @param aDrawOverHighlight Tells if previous highlight should be drawn over with no highlight. + */ + void StopL( TBool aDrawOverHighlight = ETrue ); + + + /** + * Returns the previously drawn highlight index. + * + * @since S60 v5.0 + * @return Previously drawn highlight index. + */ + TInt TimerHighlightIndex() const; + +private: + + /** + * Constructor. + * + * @since S60 v3.0 + * @param aContainer The widget for which highlight is handled by the timer. + */ + CMmHighlightTimer( CMmWidgetContainer* aContainer ); + + /** + * 2nd phase constructor. + * + * @since S60 v3.0 + */ + void ConstructL(); + + /** + * Disables highlight and redraws the view. + * + * @since S60 v3.0 + */ + void RunL(); + + /** + * Cancels timer. + * + * @since S60 v3.0 + */ + void DoCancel(); + + /** + * Run if error occurred. + * + * @since S60 v3.0 + * @param aError Error for which error handling should be run. + * @return Error code. + */ + TInt RunError( TInt aError ); + + /** + * Draws the highlight. + * + * @since S60 v5.0 + * @param aItemIndex The index of the highlight. + */ + void DrawHighlightL( TInt aItemIndex ); + + /** + * Sets press down state on widget drawer to draw highlight as told. + * + * @since S60 v5.0 + * @param aPressDownState ETrue to set press down state. Otherwise press down state is disabled. + */ + void SetPressDownState(TBool aPressDownState); + +private: + + /** + * Defines states of the CMmHighlightTimer. + */ + enum THighlightTimerState + { + EInactivityState, + ETimerExpirationCompletionState, + EExternalCompletionState + }; + + /** + * Actual state of the CMmHighlightTimer. + */ + TInt iState; + + /** + * Timer class. CMmHighlightTimer requests notifications + * from this member every 6 seconds. + */ + RTimer iTimer; + + /** + * Manages highlight. Receives notifications. + * Not own. + */ + CMmWidgetContainer* iContainer; + + /** + * Index of drawn item. + */ + TInt iTimerHighlightIndex; + + }; + +#endif // C_MMHIGHLIGHTTIMER_H + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmitemsdatacache.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmitemsdatacache.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,129 @@ +/* +* 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 : 2 << Don't touch! Updated by Synergy at check-out. +* +*/ + +#ifndef MMITEMSDATACACHE_H +#define MMITEMSDATACACHE_H + +#include <e32base.h> +#include <e32cmn.h> + +class CMmCacheForItem; + +/** + * Provides a cache of data needed to draw every item in grid or list view. + * This class is only used by CMmListBoxItemDrawer. + */ +NONSHARABLE_CLASS( CMmItemsDataCache ): public CBase + { +public: + /** + * Creates new CMmItemsDataCache object. + */ + static CMmItemsDataCache* NewLC(); + + /** + * Creates new CMmItemsDataCache object. + */ + static CMmItemsDataCache* NewL(); + + /** + * Returns item cache object for an item at specified index. + * + * @param aItemIndex Item index + * @return Item cache object. + */ + CMmCacheForItem* GetItemCacheL( TInt aItemIndex ); + + /** + * Gets an integer identifier of a template of given name. + * The identifier is guaranteed to be unique among other + * identifiers obtained from this instance of CMmItemsDataCache + * object. + * Such identifier can be used to perform fast template + * comparisons in the CMmListBoxItemDrawer code. + * @c TMmSubcellsSetupCode code assumes that the template + * identifier will not exceed 255. Assumption will be met unless + * there are more that 256 different templates used in one suite + * which is extremely unlikely. + * + * @param aTemplateName Name of a template. + * @return Template identifier based on template name. + */ + TInt GetTemplateIdentifierL( const TDesC8& aTemplateName ); + + /** + * Translates a template identifier obtained from @c GetTemplateIdentifierL + * into a regular string containing template name. + * + * @param aTemplateIdentifier Template identifier from GetTemplateIdentifierL. + * @return Template name. + */ + const TDesC8& GetTemplateNameByIdentifier( TInt aTemplateIdentifier ) const; + + /** + * Marks the whole data in cache as outdated so that + * it cannot possibly be used until it is updated by + * setting up subcells in normal (non-cached) mode. + */ + void Invalidate(); + + /** + * Reduces the number of cache entries to given number. + * If there are less entries than aItemCount then nothing + * is done. + * + * @param aItemCount number of items to store cached data for + */ + void Trim( TInt aItemCount ); + + /** + * Standard C++ virtual destructor. + */ + ~CMmItemsDataCache(); +protected: + + /** + * Standard C++ constructor. + */ + CMmItemsDataCache(); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + +protected: // data + + /** + * Array of cache objects for individual items. + * Own. + */ + RPointerArray<CMmCacheForItem> iItemCacheArr; + + /** + * Array of template names used by @c GetTemplateIdentifierL and + * @c GetTemplateNameByIdentifier methods. Template identifiers + * that @c GetTemplateIdentifierL returns are in fact indices in + * this array. + * Own. Contents of the array owned too. + */ + RPointerArray<HBufC8> iTemplateNames; + + }; + +#endif // MMITEMSDATACACHE_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmkeyeventobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmkeyeventobserver.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,49 @@ +/* +* 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: receives key pressed notifications +* +*/ + + +#ifndef M_MMKEYEVENTOBSERVER_H +#define M_MMKEYEVENTOBSERVER_H + +#include <coedef.h> + +/** + * Interface for handling key events. + * + * @code + * @endcode + * @lib + * @since S60 v3.0 + */ +class MMmKeyEventObserver + { +public: + + /** + * Called by implementing class to handle incoming key event (e.g. rocker key pressed). + * + * @since S60 v3.0 + * @param aKeyEvent The type of key event triggered. + * @param aType The Code of the event. + * @return Information if the key event has been handled. + */ + virtual TKeyResponse HandleKeyPressedL( const TKeyEvent &aKeyEvent, + TEventCode aType ) = 0; + + }; + +#endif // M_MMKEYEVENTOBSERVER_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmlctutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmlctutils.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,135 @@ +/* +* 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: +* +*/ + + + +#ifndef MMLCTUTILS_H +#define MMLCTUTILS_H + +// INCLUDES +#include <e32std.h> +#include <e32base.h> +#include <aknlayoutscalable_uiaccel.cdl.h> +#include <aknlayoutscalable_avkon.cdl.h> +#include <AknDef.hrh> +#include "mmtemplatelibrary.h" + +// CLASS DECLARATION + +/** + * Utilities for LCT scalable layout support in Multimedia Menu. + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v3.0 + * @ingroup group_mmwidgets + */ +class MmLCTUtils + { + +public: + + /** + * Gets the window component layout for the given layout name and variety. + * + * @since S60 v3.0 + * @param aLayout Name of the layout. + * @param aVariety Variety for the layout. + * @return Window component layout. + */ + static TAknWindowComponentLayout ItemLayout (const TDesC8& aLayout, + TInt aVariety); + + /** + * Gets the text component layout for the given layout name and variety. + * + * @since S60 v3.0 + * @param aLayout Name of the layout. + * @param aVariety Variety for the layout. + * @return Text component layout. + */ + static TAknTextComponentLayout + TextLayout (const TDesC8& aLayout, TInt aVariety); + + /** + * Gets the Window component layout for the given layout name and variety. Used for setting up graphical subcells. + * + * @since S60 v3.0 + * @param aLayout Name of the layout. + * @param aVariety Variety for the layout. + * @return Window component layout. + */ + static TAknWindowComponentLayout GraphicLayout (const TDesC8& aLayout, + TInt aVariety); + + /** + * Sets up template data for text subcell. + * + * @since S60 v3.0 + * @param aItemSize Size of the parent item. + * @param aSubCellTemplate Template data to be set. + */ + static void SetupTextSubCellTemplate (TSize aItemSize, + TTemplateChild& aSubCellTemplate); + + /** + * Sets up template data for graphic subcell. + * + * @since S60 v3.0 + * @param aItemSize Size of the parent item. + * @param aSubCellTemplate Template data to be set. + */ + static void SetupGraphicSubCellTemplate (TSize aItemSize, + TTemplateChild& aSubCellTemplate); + + /** + * Calculates the item size using LCT. + * + * @since S60 v3.0 + * @param aLCTTemplate Name of the layout. + * @param aVariety Variety for the layout. + * @param aParentRect Parent rectangle. + * @param aWindowLayout Window component layout to be set. + * @return Size of the item calculated by LCT. + */ + static TSize GetLCTSize (const TDesC8& aLCTTemplate, TInt aVariety, + const TRect aParentRect, TAknWindowLineLayout& aWindowLayout ); + + /** + * Calculates the layout size using LCT. + * + * @since S60 v3.0 + * @param aLCTTemplate Name of the layout template. + * @param aVariety Variation of the layout. + * @return Size of the layout (e.g 3x4) calculated by LCT. + */ + static TSize GetLayoutSize( const TDesC8& aLCTTemplate, TInt aVariety ); + + /** + * Gets the structure of parameters for a given layout. + * + * @since S60 v3.0 + * @param aLayout Name of the layout template. + * @param aVariety Variation of the layout. + * @return + */ + static TAknLayoutScalableParameterLimits LCTParameterLimits( const TDesC8& aLayout, TInt aVariety ); + }; + +#endif // MMLCTUTILS_H + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmlistbox.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmlistbox.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,389 @@ +/* +* 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: CMmListBox +* Version : %version: MM_22.1.14 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef C_MMLISTBOX_H +#define C_MMLISTBOX_H + +#include <e32std.h> +#include <e32base.h> +#include <aknlists.h> +#include <e32cmn.h> + +class CMmListBoxModel; +class CMmListBoxItemDrawer; +class CMmMarqueeAdapter; +class CMmWidgetContainer; +class CMmTemplateLibrary; + +/** + * CMmListBox + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v3.0 + * @ingroup group_mmwidgets + */ +NONSHARABLE_CLASS( CMmListBox ) : public CEikFormattedCellListBoxTypedef + { +public: + /** + * Two-phased constructor. + * + * @since S60 v3.0 + * @param aParent Parent control. + * @param aFlags Flags. + * @param aTemplateLibrary Template library for drawer. + * @return List box. + */ + static CMmListBox* NewL( const CCoeControl* aParent, TInt aFlags, + CMmTemplateLibrary* aTemplateLibrary ); + + /** + * Two-phased constructor. + * + * @since S60 v3.0 + * @param aParent Parent control. + * @param aFlags Flags. + * @param aTemplateLibrary Template library for drawer. + * @return List box. + */ + static CMmListBox* NewLC( const CCoeControl* aParent, TInt aFlags, + CMmTemplateLibrary* aTemplateLibrary ); + + /** + * Destructor. + * + * @since S60 v3.0 + */ + virtual ~CMmListBox(); + + /** + * Gets the listbox model. + * + * @since S60 v3.0 + * @return Listbox model. + */ + CMmListBoxModel * MmModel(); + + /** + * Sets the listbox model. + * + * @since S60 v3.0 + * @param aMmModel The model to be set. + */ + void SetMmModel( CMmListBoxModel* aMmModel ); + + /** + * Creates the view class instance. + * + * @since S60 v3.0 + * @return Listbox view. + */ + CListBoxView* MakeViewClassInstanceL(); + + /** + * Creates the item drawer for listbox. + * + * @param aTemplateLibrary Template library for drawer. + * @since S60 v3.0 + */ + void CreateItemDrawerL( CMmTemplateLibrary* aTemplateLibrary ); + + /** + * Sets the flag. + * + * @since S60 v3.0 + * @param aFlag Avkon list flag + */ + void SetListFlag( TInt aFlag ); + + /** + * Clears the flag. + * + * @since S60 v3.0 + * @param aFlag Avkon list flag + */ + void ClearListFlag( TInt aFlag ); + + +public: // from base class CCoeControl. + + /** + * From CCoeControl. + * Handles pointer events. + * + * @since S60 v3.0 + * @param aPointerEvent Pointer event. + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + /** + * From base class. + * + * @since S60 v3.0 + * @param aKeyEvent Key event. + * @param aType Event code. + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * Adjusts the given rectangle. + * + * @since S60 v3.0 + * @param aRect Rectangle to be adjusted. + * @return Error code. + */ + TInt AdjustRectHeightToWholeNumberOfItems( TRect& aRect ) const; + + /** + * Sets item drawer and view background context. + * + * @since S60 v3.0 + * @param aBgContext Background context. + */ + void SetItemDrawerAndViewBgContext( + CAknsBasicBackgroundControlContext * aBgContext ); + + /** + * Updates scrollbar. + * + * @since S60 v3.0 + */ + void UpdateScrollBarsL(); + + /** + * Special version of Update scrollbar that never calls DrawNow() + */ + void UpdateScrollBarsNoRedrawL(); + + /** + * Checks if all items fit in view rectangle. + * + * @since S60 v3.0 + * @return Do all items fit in view rectangle. + */ + TBool AllItemsFitInViewRect(); + + /** + * Handles scrollbar visibility change. + * + * @since S60 v3.0 + * @return Is redraw needed. + */ + TBool HandleScrollbarVisibilityChangeL(); + + /** + * Sets marquee adapter. + * + * @since S60 v3.0 + * @param aAdapter Marquee adapter. + */ + void SetMarqueeAdapter( CMmMarqueeAdapter* aAdapter ); + + /** + * Notifies that marquee is being drawn. + * + * @since S60 v3.0 + * @param aIsMarqueeBeingDrawn Is marquee being drawn. + */ + void SetMarqueeDrawing( TBool aIsMarqueeBeingDrawn ); + + /** + * Handles item removal. redraws view, updates scrollbar. + * + * @since S60 v3.0 + */ + void HandleItemRemovalL(); + + /** + * Redraws items in view if it is necessary. + * + * @since S60 v3.0 + * @param aPreviousCurrent Previously current item index. + * @param aCurrent Current item index. + * + * @return true if anything was drawn. + */ + TBool RedrawIfNecessary( TInt aPreviousCurrent, TInt aCurrent ); + + /** + * Overridden from base class to allow for drawing scrollbar + * background in mirrored layout. + * + * @param aRect clipping rect + */ + void Draw(const TRect& aRect) const; + + /** + * Draws the listbox view. + * + * @since S60 v5.0 + */ + void DrawView(); + + /** + * 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. + */ + void SetItemHeight( TInt aItemHeight ); + + /** + * Updates scrollbar thumbs. + */ + void UpdateScrollBarThumbs(); + + /** + * 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 + */ + CMmListBox(); + + /** + * 2nd phase constructor. + * + * @since S60 v3.0 + * @param aParent Parent control. + * @param aFlags Flags. + * @param aTemplateLibrary Template library for drawer. + */ + void ConstructL( const CCoeControl* aParent, TInt aFlags, + CMmTemplateLibrary* aTemplateLibrary ); + + /** + * 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 ); + + /** + * 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. + */ + TBool IsPointerInTopScrollingThreshold( + const TPointerEvent& aPointerEvent ) const; + + /** + * 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 ); + + /** + * Ensures that elements are drawn correctly when mirrored layout is + * used and scrollbar is visible by shifting ViewRect to the right. + */ + void FixViewForMirroredLayout(); + + /** + * 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; + +private: // Data + /** + * Item drawer. + */ + CMmListBoxItemDrawer* iMmDrawer; + + /** + * Multimedia Menu model. + */ + CMmListBoxModel* iMmModel; + + /** + * marquee adapter. + */ + CMmMarqueeAdapter* iMarqueeAdapter; + + /** + * Blocks scrollbar drawing. When this flag is set scrollbars components + * are blocked in the CountComponentControls() method; + */ + TBool iDisableChildComponentDrawing; + }; + +#endif // MMLISTBOX_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmlistboxcontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmlistboxcontainer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,260 @@ +/* +* Copyright (c) 2007-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: CMmListBoxContainer +* Version : %version: MM_21.1.10 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef C_MMLISTBOXCONTAINER_H +#define C_MMLISTBOXCONTAINER_H + +#include <eiklbo.h> +#include <AknsLayeredBackgroundControlContext.h> +#include <AknsListBoxBackgroundControlContext.h> + +#include "mmwidgetcontainer.h" +#include "mmwidgetsconstants.h" +#include "hnglobals.h" + +class CMmListBox; +class CMmMarqueeAdapter; +class CEikColumnListBox; +class CNaviScrollTimer; +class CHnSuiteModel; +class CMmTemplateLibrary; + +/** + * Container for Multimedia Menu listbox widget. + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v5.0 + * @ingroup group_mmwidgets + */ +NONSHARABLE_CLASS( CMmListBoxContainer ) : public CMmWidgetContainer + { +public: + /** + * Two-phased constructor. + * + * @since S60 v5.0 + * @param aRect Rectangle of widget control. + * @param aObjectProvider Object provider. + * @param aTemplateLibrary Template library for drawer. + */ + static CMmListBoxContainer* NewL( const TRect& aRect, + MObjectProvider* aObjectProvider, + CMmTemplateLibrary* aTemplateLibrary ); + + /** + * Two-phased constructor. + * + * @since S60 v5.0 + * @param aRect Rectangle of widget control. + * @param aObjectProvider Object provider. + * @param aTemplateLibrary Template library for drawer. + */ + static CMmListBoxContainer* NewLC( const TRect& aRect, + MObjectProvider* aObjectProvider, + CMmTemplateLibrary* aTemplateLibrary ); + + /** + * Destructor. + * + * @since S60 v5.0 + */ + virtual ~CMmListBoxContainer(); + +public: // from base class CMmWidgetContainer + + /** + * Handle item addition. + * + * @since S60 v3.0 + */ + void HandleItemAdditionL(); + + /** + * Handle item removal. + * + * @since S60 v3.0 + */ + void HandleItemRemovalL(); + + /** + * Set the default highlight in listbox. + * + * @since S60 v5.0 + * @param aRedraw Is highlight to redraw. + */ + IMPORT_C void SetDefaultHighlightL( TBool aRedraw = ETrue ); + + /** + * Called to set widget in edit mode state. + * + * @since S60 v5.0 + * @param aIsEditMode Is edit mode to be set. + */ + void SetEditModeL( TBool aIsEditMode ); + + /** + * Gets the listbox model. + * + * @since S60 v5.0 + * @return listbox model + */ + CMmListBoxModel* GetMmModel(); + + /** + * Sets the empty text for empty list. + * + * @since S60 v5.0 + * @param aText Text to be set when list is empty. + */ + IMPORT_C void SetEmptyTextL(const TDesC& aText); + + /** + * Set background context for item drawer and view. + * + * @since S60 v5.0 + * @param aBgContext Background context. + */ + void SetItemDrawerAndViewBgContext( + CAknsBasicBackgroundControlContext * aBgContext ); + + /** + * Sets up the layout for the widget. + * + * @since S60 v5.0 + */ + void SetupWidgetLayoutL(); + + /** + * Sets suite model. + * + * @since S60 v5.0 + * @param aModel Suite model. + */ + void SetSuiteModelL( CHnSuiteModel* aModel ); + + /** + * Set highlight visibility. + * + * @since S60 v5.0 + * @param aVisible Visibility status. + */ + void SetHighlightVisibilityL( TBool aVisible ); + + /** + * Gets widget type. + * + * @since S60 v5.0 + * @return Widget type. + */ + THnSuiteWidgetType WidgetType(); + +public: + /** + * Draws the widget view. + * + * @since S60 v5.0 + */ + virtual void DrawView(); + + /** + * Set the vertical item offset; + * @param aOffset The offset to set to the widget. + * + * @since S60 v5.0 + */ + virtual void SetVerticalItemOffset( TInt aOffset ); + + /** + * Gets the current widget vertical item offset. + * + * @since S60 v5.0 + * @return The current widget vertical item offset. + */ + virtual TInt VerticalItemOffset() const; + +protected: // from CMmWidgetContainer + + /** + * Checks whether given point collides with specific item's re-order area. + * + * Please see @c CMmWidgetContainer::PointInItemReorderAreaL documentation + * for details. + * + * @since S60 v5.0 + */ + TBool PointInItemReorderAreaL( TInt aItemIndex, TPoint aPoint ); + +private: + /** + * Default constructor. + * + * @since S60 v5.0 + */ + CMmListBoxContainer(); + + /** + * 2nd phase constructor. + * + * @since S60 v5.0 + * @param aRect Rectangle of widget control. + * @param aObjectProvider Object provider. + * @param aTemplateLibrary Template library for drawer. + */ + void ConstructL( const TRect& aRect, MObjectProvider* aObjectProvider, + CMmTemplateLibrary* aTemplateLibrary ); + + /** + * Constructs listbox from resource, creates scrollbar + * and sets empty list background text. + * + * @since S60 v5.0 + * @param aTemplateLibrary Template library for drawer. + * @return List box widget. + */ + CMmListBox* CreateListboxL( CMmTemplateLibrary* aTemplateLibrary ); + + /** + * Gets column count in current view. + * @returns Column count in current view. + */ + TInt ColumnsInCurrentView(); + + /** + * Gets row count in current view. + * @returns Row count in current view. + */ + TInt RowsInCurrentView(); + + /** + * Updates current view's scrollbar thumbs. + */ + void UpdateViewScrollBarThumbs(); + +private: // members + /** + * Pointer to listbox widget. + * Owned. + */ + CMmListBox* iListBox; + + }; + +#endif //__MMLISTBOXCONTAINER_H__ diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmlistboxitemdrawer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmlistboxitemdrawer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,918 @@ +/* +* 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: CMmListBoxItemDrawer +* Version : %version: MM_38.1.14 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef C_MMLISTBOXITEMDRAWER_H +#define C_MMLISTBOXITEMDRAWER_H + +#include <e32std.h> +#include <e32base.h> +#include <AknsBasicBackgroundControlContext.h> +#include <eikfrlbd.h> +#include <AknDef.hrh> +#include "mmwidgetsconstants.h" +#include "mmtemplatelibrary.h" +#include "hniconholder.h" +#include "mmsubcellssetupcode.h" + +class CMmListBoxModel; +class TMmFloatingItem; +class CMmMarqueeAdapter; +class CMmDrawerAnimator; +class CMmPostEvaluationProcessor; +class CMmItemsDataCache; + +/** + * Used to draw items in widgets. The item drawer is used both by grid + * and listbox. Data is used to draw subcells. The subcell templates are fetched + * from the template library and set to data to be drawn. + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v3.0 + * @ingroup group_mmwidgets + */ +NONSHARABLE_CLASS( CMmListBoxItemDrawer ): + public CFormattedCellListBoxItemDrawer + { + + friend class CMmPostEvaluationProcessor; + +public: + + /** + * Two-phased constructor. + * + * @since S60 v3.0 + * @param aMmListBoxModel The listbox model. + * @param aFont Font. + * @param aFormattedCellData Cell data. + * @param aWidgetType Widget type. + */ + static CMmListBoxItemDrawer* NewL( + CMmListBoxModel* aMmListBoxModel, + const CFont* aFont, + CFormattedCellListBoxData* aFormattedCellData, + TMmWidgetType aWidgetType, + CMmTemplateLibrary* aTemplateLibrary ); + + /** + * Two-phased constructor. + * + * @since S60 v3.0 + * @param aMmListBoxModel The listbox model. + * @param aFont Font. + * @param aFormattedCellData Cell data. + * @param aWidgetType Widget type. + */ + static CMmListBoxItemDrawer* NewLC( + CMmListBoxModel* aMmListBoxModel, + const CFont* aFont, + CFormattedCellListBoxData* aFormattedCellData, + TMmWidgetType aWidgetType, + CMmTemplateLibrary* aTemplateLibrary ); + + /** + * Destructor. + * + * @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. + */ + void InvalidateCache(); + + /** + * Get the height of the given item. + * + * @since S60 v3.0 + * @param aItemIndex Item index for which height is calculated. + * @param aItemIsCurrent Is item the current widget item. + * @return Item height. + */ + TInt GetItemHeight( TInt aItemIndex, TBool aItemIsCurrent ) const; + + /** + * Gets size of given item. + * + * @since S60 v3.0 + * @param aItemIndex Item index. + * @param aItemIsCurrent Is item the current widget item. + * @return Size of item. + */ + TSize GetItemSize( TInt aItemIndex, TBool aItemIsCurrent ) const; + + /** + * Gets rect of indicator. + * + * @since S60 v3.0 + * @return Rect of indicator. + */ + TRect GetIndicatorRect() const; + + /** + * Setx draggable state + * + * @since S60 v3.0 + * @param aDraggable Is draggable. + */ + void SetDraggableL( TBool aDraggable ); + + /** + * Sets item which is dragged. + * + * @since S60 v3.0 + * @param aDraggedItemIndex Dragged item index. + * @param aPoint Dragged point. + */ + void SetDraggedIndexL( TInt aDraggedItemIndex, TPoint aPoint ); + + /** + * Sets item which is dragged. + * + * @since S60 v3.0 + * @param aCenterPoint Center point of dragged item. + */ + void SetDraggedPointL( TPoint aCenterPoint ); + + /** + * Reveales if is possible to drag. + * + * @since S60 5.0 + * @return Is draggable. + */ + TBool IsDraggable() const; + + /** + * Sets associated widget. + * + * @since S60 5.0 + * @param aView Widget to associated with this drawer. + */ + void SetView( CEikListBox* aView ); + + /** + * Get associated widget. + * + * @since S60 5.0 + * @return Widget associated with this drawer. + */ + CEikListBox* Widget() const; + + /** + * Gets template library. + * + * @since S60 5.0 + * @return Return iTemplateLibrary. + */ + CMmTemplateLibrary* TemplateLibrary(); + + /** + * Sets the background context. + * + * @since S60 5.0 + * @param aBgContext Background context. + */ + void SetBgContext( + CAknsBasicBackgroundControlContext* aBgContext ); + + /** + * Sets condition if background should be redrawn. + * + * @since S60 v3.0 + * @param aRedraw Should background be redrawn. + */ + void SetRedrawItemBackground( TBool aRedraw ); + + /** + * Checks if item background redrawing is enabled. + * + * @since S60 v3.0 + * @return Is background redrawing enabled. + */ + TBool IsRedrawItemBackgroundEnabled() const; + + /** + * Draws empty item ( no subcells ). + * + * @since S60 v3.0 + * @param aItemIndex Item index. + * @param aItemRectPos Item rectangle position. + * @param aViewIsDimmed Is view dimmed. + */ + void DrawEmptyItem( TInt aItemIndex, + TPoint aItemRectPos, TBool aViewIsDimmed ) const; + + /** + * Sets edit mode condition. + * + * @since S60 v3.0 + * @param aIsEditMode Is edit mode. + */ + void SetEditModeL( TBool aIsEditMode ); + + /** + * Checks if edit mode is running. + * + * @since S60 v3.0 + * @return Is edit mode running. + */ + TBool IsEditMode() const; + + /** + * Animates dragged item transition. + * + * @since S60 v3.0 + */ + void AnimateDragItemTransitionL( ); + + /** + * Animates swapping of items. + * + * @since S60 v3.0 + * @param aItemFrom Start item position (index). + * @param aItemTo End item position (index). + */ + void AnimateItemSwapL( TInt aItemFrom, TInt aItemTo ); + + /** + * Animate item zoom in. + * + * @since S60 v3.0 + * @param aItemIndex Item index of item to be zoomed in. + */ + void AnimateItemZoomInL( TInt aItemIndex ); + + /** + * Animate item zoom out. + * + * @since S60 v3.0 + * @param aItemIndex Item index of zoomed item. + */ + void AnimateItemZoomOutL( TInt aItemIndex ); + + /** + * Checks if item drawer is ready to run new animation. + * + * @since S60 v3.0 + * @return Is drawer ready to run animation. + */ + CMmDrawerAnimator* GetAnimator(); + + /** + * Draws floating items. + * + * @since S60 v3.0 + * @param aCurrentlyDrawnRect Currently drawn item rectangle. + */ + void DrawFloatingItems( TRect aCurrentlyDrawnRect ); + + /** + * Gets floating item index. + * + * @since S60 v3.0 + * @param aType Floating item type. + * @return Floating item index. + */ + TInt GetFloatingItemIndex( TMmFloatingItemType aType ) const; + + /** + * Gets floating item. + * + * @since S60 v3.0 + * @param aType Floating item type. + * @return Floating item. + */ + TMmFloatingItem& GetFloatingItemL( TMmFloatingItemType aType ); + + /** + * Gets number of floating items. + * + * @since S60 5.0 + * @param aType Floating item type. + * @return Number of floating items. + */ + TInt GetValidFloatingItemCount( TMmFloatingItemType aType ); + + /** + * Gets floating items count. + * + * @since S60 5.0 + * @return Number of the floating items in the array. + */ + TInt GetFloatingItemCount(); + + /** + * Adds floating item to the floating item array. + * + * @since S60 5.0 + * @param aFloatingItem Floating item to be added. + * @param aPosition Position to add at. + */ + void AddFloatingItemL( TMmFloatingItem& aFloatingItem, + TInt aPosition = KErrNotFound ); + + /** + * Removes floating item. + * + * @since S60 5.0 + * @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. + * + * @since S60 5.0 + * @param aIndex Index of the floating item in the array. + * @return Floating item. + */ + TMmFloatingItem& GetFloatingItemAtIndex( TInt aIndex ); + + /** + * Used to set scrollbar visibility flag. + * + * @since S60 v3.0 + * @param aIsScrollbarVisible Is scrollbar visible. + */ + void SetScrollbarVisibilityL( TBool aIsScrollbarVisible ); + + /** + * Replaces subcell text. + * + * @since S60 v3.0 + * @param aText Text which will replace previous text. + */ + void ReplaceSubCellText( const TDesC& aText ); + + /** + * Adds subcell marquee element. + * + * @since S60 v3.0 + * @param aSubCellTemplate Subcell template data. + * @param aIndex Subcell index. + * @param aItemIndex Item index. + */ + void AddSubcellMarqueeElementL( TTemplateChild aSubCellTemplate, + TInt aIndex, TInt aItemIndex ); + + /** + * Sets the marquee adapter. + * + * @since S60 v3.0 + * @param aAdapter Marquee adapter. + */ + void SetMarqueeAdapter( CMmMarqueeAdapter* aAdapter ); + + /** + * Sets the flag which tells that marquee is currently being drawn. + * + * @since S60 v3.0 + * @param aIsMarqueeBeingDrawn Is marquee being drawn. + */ + void SetMarqueeDrawing( TBool aIsMarqueeBeingDrawn ); + + /** + * Checks if text is clipped. + * + * @since S60 v3.0 + * @param aTemplateChild Subcell template data. + * @param aText Text to be clipped. + * @return Is text clipped. + */ + TBool IsTextClippedL( TTemplateChild aTemplateChild, + const TDesC& aText ) const; + + /** + * Sets the flag which tells that a scrollbar event is running. + * + * @since S60 v3.0 + * @param aIsRunning Is scrollbar event running. + */ + void SetScrollbarEventRunning( TBool aIsRunning ); + + /** + * Sets number of columns in view. + * + * @since S60 v3.0 + * @param aNumberOfColumns Number of columns in view. + */ + void SetNumberOfColsInView( TInt aNumberOfColumns ); + + /** + * Used in non-touch edit mode to block drawing of move indicators and highlight + * to clean screen for animation. + * + * @since S60 v3.0 + * @param aDrawn Should highlight and move indicators be drawn. + */ + void SetHighlightShown( TBool aDrawn ); + +protected: + /** + * From CListItemDrawer. Draws an item. + * + * @since S60 v3.0 + * @param aItemIndex Item index to be drawn. + * @param aItemRectPos Item rectangle position. + * @param aItemIsSelected Is item selected. + * @param aItemIsCurrent Is item current. + * @param aViewIsEmphasized Is view emphasized. + * @param aViewIsDimmed Is view dimmed. + */ + void DrawItem( TInt aItemIndex, TPoint aItemRectPos, + TBool aItemIsSelected, TBool aItemIsCurrent, + TBool aViewIsEmphasized, TBool aViewIsDimmed ) const; + + /** + * Draws item according to format text. + * + * @since S60 v3.0 + * @param aItemIndex Item index to be drawn. + * @param aItemTextRect Item rectangle. + * @param aItemIsCurrent Is item current. + * @param aViewIsEmphasized Is view emphasized. + * @param aItemIsSelected Is item selected. + */ + void DrawItemText( TInt aItemIndex, const TRect& aItemTextRect, + TBool aItemIsCurrent, TBool aViewIsEmphasized, + TBool aItemIsSelected ) const; + /** + * 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 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. + * Also, fills-in/updates the cache information for the item at index + * aItemIndex. + * + * @since S60 v3.0 + * @param aItemIsCurrent Is item the current item in widget. + * @param aItemIndex Item index. + */ + void SetupSubCellsL( TBool aItemIsCurrent, TInt aItemIndex ) const; + + /** + * Sets up subcell to be drawn by listbox data. + * + * @since S60 v3.0 + * @param aSubCellTemplate Subcell template data. + * @param aIndex Subcell index. + * @param aItemIndex Item index. + */ + void SetupSubCellL( TTemplateChild aSubCellTemplate, TInt aIndex, + TInt aItemIndex ) const; + + /** + * Sets up "null" subcell to be avoided when drawing. + * + * @since S60 v3.0 + * @param aIndex Subcell index. + * @param aItemIndex Item index. + */ + void SetupSubNoCellL( TInt aIndex, TInt aItemIndex ) const; + + /** + * Sets up icon for dragged subcell. + * + * @since S60 v3.0 + * @param aSubCellTemplate Subcell template data. + * @param aIndex Subcell index. + * @param aItemIndex Index of dragged item. + */ + void SetupSubIcondDragHighlightCellL( TTemplateChild aSubCellTemplate, + TInt aIndex, TInt aItemIndex ) const; + + /** + * Adjusts rectangle of item. + * + * @since S60 v3.0 + * @param aItemIndex Item's index which adjust rectangle. + * @return Index of item which rectangle should be adjusted. + */ + TRect AdjustItemRect( TInt aItemIndex ) const; + + /** + * Draws the move indicator over the indicated item. + * + * @since S60 v3.0 + * @param aItemIndex Item index with move indicator. + * @param aActualItemRect The actual rectangle of indicator item. + */ + void DrawActualIndicatorItem( TInt aItemIndex, TRect aActualItemRect ); + + /** + * Sets up colors for subcell data. + * + * @since S60 v3.0 + * @return Colors for subcell drawing. + */ + CFormattedCellListBoxData::TColors SetupColors( TBool aDragged = EFalse ) const; + +private: + + /** + * Default constructor. + * + * @since S60 v3.0 + * @param aMmListBoxModel List box model. + * @param aFont Font needed by base constructor. + * @param aFormattedCellData Used to format subcell data in item drawer. + * @param aWidgetType Type of widgte (list/grid). + * @param aTemplateLibrary TemplateLibrary contains items sizes. + */ + CMmListBoxItemDrawer( CMmListBoxModel* aMmListBoxModel, + const CFont* aFont, + CFormattedCellListBoxData* aFormattedCellData, + TMmWidgetType aWidgetType, CMmTemplateLibrary* aTemplateLibrary ); + + /** + * 2nd phase constructor. + * + * @since S60 v3.0 + */ + void ConstructL(); + + /** + *Draws the item text according to the format defined by a text string. + * + * @since S60 v3.0 + * @param aItemIndex Item index to be drawn. + * @param aItemTextRect Item rectangle. + * @param aItemIsCurrent Is item current. + * @param aViewIsEmphasized Is view emphasized. + * @param aItemIsSelected Is item selected. + */ + void DoDrawItemTextL( TInt aItemIndex, const TRect& aItemTextRect, + TBool aItemIsCurrent, TBool aViewIsEmphasized, + TBool aItemIsSelected ) const; + + /** + * Draws an item. + * + * @since S60 v3.0 + * @param aItemIndex Item index to be drawn. + * @param aItemRectPos Position of item rectangle. + * @param aItemIsSelected Is item selected. + * @param aItemIsCurrent Is item current. + * @param aViewIsEmphasized Is view emphasized. + * @param aViewIsDimmed Is view dimmed. + */ + void DoDrawItem(TInt aItemIndex, TPoint aItemRectPos, + TBool aItemIsSelected, TBool aItemIsCurrent, TBool aViewIsEmphasized, + TBool aViewIsDimmed) const; + + /** + * Sets up backdrop image subcell. + * + * @since S60 v3.0 + * @param aTemplateChildArray Array of subcell children where the backdrop subcell template is appended. + * @param aItemIndex Index of currently drawn item. + * @param aItemText Text used to format item subcell content. + * @param aSubcellIncrement Is incremented if backdrop subcell template is appended. + */ + void SetupBackdropSubcellL( + RArray<TTemplateChild>& aTemplateChildArray, TInt aItemIndex, + RBuf& aItemText, TInt& aSubcellIncrement ) const; + + /** + * Sets up icon image subcell. + * + * @since S60 v3.0 + * @param aTemplateChildArray Array of subcell children where the backdrop subcell template is appended. + * @param aChildIndex Index of a template child. + * @param aItemIndex Index of currently drawn item. + * @param aItemText Text used to format item subcell content. + * @param aSubcellIncrement Is incremented if backdrop subcell template is appended. + */ + void SetupIconSubcellL( + RArray<TTemplateChild>& 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: + * 1. bitmap width is nearly the same* as target area width and bitmap height + * is not greater than target height + * 2. bitmap width is not greater that target width and bitmap height is + * nearly the same* as target height. + * * nearly the same means that it is exactly the same or differs by at most + * 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. + * + * @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 + */ + TBool BitmapFitsIntoTarget( TSize aBmpSize, TSize aTargetSize ) const; + + /** + * Sets up icon text subcell. + * + * @since S60 v3.0 + * @param aTemplateChildArray Array of subcell children where the backdrop subcell template is appended. + * @param aItemIndex Index of currently drawn item. + * @param aItemText Text used to format item subcell content. + * @param aSubcellIncrement Is incremented if backdrop subcell template is appended. + * @param aChildIndex Index of a template child. + */ + void SetupTextSubcellL( + RArray<TTemplateChild>& aTemplateChildArray, TInt aChildIndex, TInt aItemIndex, + RBuf& aItemText, TInt& aSubcellIncrement ) const; + + /** + * Appends text if there is enough free memory. + * + * @since S60 v3.0 + * @param aBuffer Buffer to which the text will be added + * @param aTextToAppend Text to add + */ + void AppendText( RBuf& aBuffer, const TDesC& aTextToAppend ) const; + + /** + * Returns true if an item having an index equal to aItemIndex is a + * floating and dragged item. + * + * @param aItemIndex An index of a currently drawn item. + * @return ETrue if an item is floating and dragged. + */ + TBool IsFloating( TInt aItemIndex ) const; + + /** + * Returns highlight visibility. + * + * @param aItemIndex An index of a currently drawn item. + * @param aItemIsCurrent Is aItemIndex the current item index. + * @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 aItemIsCurrent, TBool aAllowHighlightForNonDraggedItem ) const; + + /** + * Returns backdrop visibility. + * + * @param aItemIndex An index of a currently drawn item. + * @param aItemIsCurrent Is aItemIndex the current item index. + * @return ETrue if backdrop is visible for the currently drawn item. + */ + TBool GetBackdropVisibility( TInt aItemIndex, TBool aItemIsCurrent ) const; + + /** + * Checks if item has specified floating type. + * + * @param aItemIndex Item index. + * @param aFloatingType Floating type to check on the item. + * @return ETrue if the item is of the given floating type. + */ + TBool ItemHasFloatingType( TInt aItemIndex, TMmFloatingItemType aFloatingType) const; + +public: + /** + * Animator used by drawer to animate item transitions. + * Own + */ + CMmDrawerAnimator* iAnimator; + +private: // Data + /** + * Listbox model. + * Not own. + */ + CMmListBoxModel* iMmModel; + + /** + * Font. + */ + const CFont * iFont; + + /** + * Drawer owner widget type (list/grid). + */ + TMmWidgetType iWidgetType; + + /** + * Is draggable flag. + */ + TBool iDraggable; + + /** + * Widget. + */ + CEikListBox* iWidget; + + /** + * Background context. + * Not own. + */ + CAknsBasicBackgroundControlContext * iBgContext; + + /** + * Redraw background flag. + */ + TBool iRedrawBackground; + + /** + * Ratio of zooming animation. + */ + TReal iIconAnimationZoomRatio; + + /** + * Zommed item index. + */ + TInt iZoomIconIndex; + + /** + * Is edit mode flag. + */ + TBool iIsEditMode; + + /** + * Array of floating items. + */ + RArray<TMmFloatingItem> iFloatingItems; + + /** + * Just draw backdrop flag. + */ + TBool iLeftOverAreaUnderAnimatedItem; + + /** + * Is drawn item an indicator item. + */ + TBool iIsIndicatorItem; + + /** + * Marquee adapter. + */ + CMmMarqueeAdapter* iMarqueeAdapter; + + /** + * Subcell item text. + */ + HBufC* iSubcellText; + + /** + * Is marquee being drawn flag; + */ + TBool iIsMarqueeBeingDrawn; + + /** + * Number of columns in widget. + */ + TInt iNumberOfColsInWidget; + + /** + * Original mask of the dragged item. + * Not own. + */ + CFbsBitmap* iOriginalMask; + + /** + * Gul Icon of the item dragged. + * Not own. + */ + CGulIcon* iGulDragged; + + /** + * Temporary mask of the dragged item. + * Not own. + */ + CFbsBitmap* iDragMask; + + /** + * Indicates id original gul had external bitmaps. + */ + TBool iExternalBitamp; + + /** + * Indicates if highlight should be shown. + */ + TBool iHighlightShown; + + /** + * Indicates if move indicators should be drawn. + */ + TBool iDrawMoveIndicators; + + /** + * Template library. Stores template attributes. + * Not own. + */ + CMmTemplateLibrary* iTemplateLibrary; + + /** + * Storage for cached items data. The data is updated during normal operation + * and used when iUseCache is ETrue. + * Own. + */ + CMmItemsDataCache* iItemsDataCache; + + /** + * This flag tells whether to rely on cached data (when possible) or + * to obtain data from the model normally. It should be set to ETrue + * when drawing performance is critical (e.g. during flick). + */ + TBool iUseCache; + + /** + * 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. + */ + mutable TMmSubcellsSetupCode iLastSubcellsSetupCode; + + /** + * Set to ETrue if item has backdrop. + */ + mutable TBool iItemHasBackdrop; + }; + +#endif // MMLISTBOXITEMDRAWER_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmlistboxmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmlistboxmodel.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,166 @@ +/* +* 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: CMmListBoxItemModel +* Version : %version: MM_18.1.3 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef C_MMLISTBOXMODEL_H +#define C_MMLISTBOXMODEL_H + +#include <e32std.h> +#include <e32base.h> +#include <gulicon.h> +#include <AknUtils.h> +#include "hnsuiteobserver.h" + +class CHnSuiteModel; +class CHnAttributeBase; +class CHnAttributeImage; +class CHnIconHolder; + +/** + * Multimedia Menu listbox model + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v3.0 + * @ingroup group_mmwidgets + */ +NONSHARABLE_CLASS( CMmListBoxModel ): + public CAknFilteredTextListBoxModel, + public MHnSuiteObserver + { +public: + // Constructors and destructor + + /** + * Destructor. + */ + ~CMmListBoxModel(); + + /** + * Two-phased constructor. + */ + static CMmListBoxModel* NewL( ); + + /** + * Two-phased constructor. + */ + static CMmListBoxModel* NewLC( ); + + /** + * Gets the text attribute for a specific item by the name of the attribute. + * + * @since S60 v3.0 + * @param aIndex The index of the item for which the text is requested. + * @param aAttributeName The name of the text attribute to be returned. + * @return Size of item. + */ + const TDesC8& GetAttributeAsText( TInt aIndex, const TDesC8 & aAttributeName ); + + /** + * Gets the graphical attribute for a specific item by the name of the attribute. + * The attribute is returned as an icon holder. Please see @c CHnIconHolder for + * infomation on what icon holder is and what + * it is useful for. + * + * @param aIndex The index of the item for which the graphic is requested. + * @param aAttributeName The name of the graphical attribute to be returned. + * @param aDesiredIconSize The desired icon size. + * @return An icon holder object. + */ + CHnIconHolder* GetAttributeAsRefCountedGraphics( TInt aIndex, + const TDesC8& aAttributeName, TSize* aDesiredIconSize = NULL ); + + /** + * Sets the suite model. This method is used by matrix menu application when suite is loaded. + * + * @since S60 v3.0 + * @param aSuiteModel The suite model to be set. + */ + void SetSuiteModelL( CHnSuiteModel * aSuiteModel ); + + /** + * Gets the suite model of the currently visible suite. + * + * @since S60 v3.0 + * @return The current suite model. + */ + CHnSuiteModel* GetSuiteModel(); + + /** + * Reorders the model when item positions are edited in edit mode. + * + * @since S60 v3.0 + * @param aFromIndex The starting index of items to be shifted. + * @param aToIndex The end index of items to be shifted. + */ + void ReorderModelL(TInt aFromIndex, TInt aToIndex); + + /** + * Handle event triggered by suite. + * + * @since S60 v3.0 + * @param aCustomSuiteEvent Type of suite event. + * @param aModel The suite model that the event concerns. + */ + void HandleSuiteEventL( THnCustomSuiteEvent aCustomSuiteEvent, + CHnSuiteModel* aModel ); + +private: + + /** + * Gets the attribute by name. + * + * @since S60 v3.0 + * @param aIndex The index of the item for which the attribute is requested. + * @param aAttributeName The name of the requested attribute. + * @return Size of item. + */ + CHnAttributeBase* GetAttribute( TInt aIndex, const TDesC8 & aAttributeName ); + + /** + * Updates the item text array when model is reordered or new model is loaded. + * It is important that the number of elements in the array is the same + * as number of items in the suite. + * + * @since S60 v3.0 + */ + void UpdateDummyArrayDataL(); + + + /** + * Constructor for performing 1st stage construction + */ + CMmListBoxModel( ); + + /** + * Default symbian 2nd stage constructor. + */ + void ConstructL(); + + +private: + + /** + * Not own. Suite model being the container for the data. + */ + CHnSuiteModel* iSuiteModel; + + }; + +#endif // CMMLISTBOXMODEL_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmlistboxview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmlistboxview.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,268 @@ +/* +* 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_12.1.6 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef MMLISTBOXVIEW_H +#define MMLISTBOXVIEW_H + +// INCLUDES +#include <e32std.h> +#include <e32base.h> +#include <eikfrlb.h> + +// CLASS DECLARATION + +/** + * Multimedia Menu Listbox view. + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v3.0 + * @ingroup group_mmwidgets + */ +NONSHARABLE_CLASS( CMmListBoxView ) : public CFormattedCellListBoxView + { +public: + // Constructors and destructor + + /** + * Destructor. + */ + ~CMmListBoxView(); + + /** + * Two-phased constructor. + */ + static CMmListBoxView* NewL(); + + /** + * Two-phased constructor. + */ + static CMmListBoxView* NewLC(); + + /** + * Calculate the bottom item index. + * + * @since S60 v3.0 + */ + void CalcBottomItemIndex(); + + /** + * Draw the view. + * + * @since S60 v3.0 + * @param clipRect Clipping rectangle. + */ + void Draw(const TRect* clipRect) const; + + /** + * Draws the listbox within the given clipping rect. + * + * @since S60 v3.0 + * @param clipRect Clipping rectangle. + */ + void DoDraw(const TRect* aClipRect) const; + + /** + * Draw item in view. It is possible that it + * calls drawing of more than one item. + * + * @since S60 v3.0 + * @param aItemIndex Item index. + */ + void DrawItem(TInt aItemIndex) const; + + /** + * Draw a single item in view. + * + * @since S60 v3.0 + * @param aItemIndex Item index. + */ + void DrawSingleItem (TInt aItemIndex) const; + + /** + * Get the number of items that fit in rectangle. + * + * @since S60 v3.0 + * @param aRect Clipping rectangle. + * @return Number of items that fit in rectangle. + */ + TInt NumberOfItemsThatFitInRect(const TRect& aRect) const; + + /** + * Get the number of items that fit in rectangle (with option to include + * partial item at bottom of view). + * + * @since S60 v3.0 + * @param aRect Rect for calculations. + * @param aIncludePartialItem Should partial item be included. + * @return Number of items that fit in rectangle. + */ + TInt GetNumberOfItemsThatFitInRect (const TRect& aRect, TBool aIncludePartialItem ) const; + + /** + * Get item size. + * + * @since S60 v3.0 + * @param aItemIndex Item index. + * @return Size of item. + */ + TSize ItemSize(TInt aItemIndex) const; + + /** + * Sets aItemIndex to the index of the item whose bounding box contains aPosition. + * + * @since S60 v3.0 + * @param aPosition Item position. + * @param aItemIndex Item index. + * @return Was item found. + */ + TBool XYPosToItemIndex(TPoint aPosition, TInt& aItemIndex) const; + + /** + * Gets item position. + * + * @since S60 v3.0 + * @param aItemIndex Item index. + * @return Item position. + */ + TPoint ItemPos(TInt aItemIndex) const; + + /** + * Sets item height. + * + * @since S60 v3.0 + * @param aItemHeight Item height. + */ + void SetItemHeight(TInt aItemHeight); + + /** + * Calculates new top item index so item is visible. + * + * @since S60 v3.0 + * @param aItemIndex Item to be visible. + * @return New top item index. + */ + TInt CalcNewTopItemIndexSoItemIsVisible(TInt aItemIndex) const; + + /** + * Draw background between rects. + * + * @since S60 v3.0 + * @param aUsedPortionOfViewRect Inner rect. + * @param aSmallerViewRect Outer rect. + */ + void RedrawBackground( TRect aUsedPortionOfViewRect, TRect aSmallerViewRect) const; + + /** + * Draws background in list which is not covered by vivible items. + * + * @since S60 v3.0 + */ + void RedrawBackground() const; + + /** + * Gets total height of items within range. + * + * @since S60 v3.0 + * @param aStartIndex Start item index. + * @param aEndIndex End item index. + * @return Total height of items starting from aStartIndex, ending with aEndIndex. + */ + TInt GetTotalHeight( TInt aStartIndex, TInt aEndIndex ) const; + + /** + * Gets the current widget vertical item offset. + * + * @since S60 v5.0 + * @return The current widget vertical item offset. + */ + TInt VerticalItemOffset() const; + + /** + * Overridden to allow for disabling this method in certain situations. + * + * @param aItemIndex Item index. + */ + TBool ScrollToMakeItemVisible(TInt aItemIndex); + + /** + * Disables ScrollToMakeItemVisible. + * When disabled, ScrollToMakeItemVisible does nothing. + * + * @param aDisable Self-explanatory. + */ + void DisableScrollToItem( TBool aDisable ); + +private: + + /** + * Constructor for performing 1st stage construction. + */ + CMmListBoxView(); + + /** + * Default symbian 2nd stage constructor. + */ + void ConstructL(); + + /** + * Updates average item height. + * + * @since S60 v3.0 + */ + void UpdateAverageItemHeight(); + + /** + * Gets last item index depending on height. + * + * @since S60 v3.0 + * @param aStartIndex Start item index. + * @param aHeight Height of area. + * @return Last item index. + */ + TInt GetLastIndexInHeight( const TInt aStartIndex, TInt aHeight ) const; + + /** + * Sets the previously drawn current item index. + * + * @since S60 v3.0 + * @param aIndex Current Item index. + */ + void SetPreviouslyDrawnCurrentItemIndex( TBool aIndex ); + +private: + + /** + * Scrollbar visibility flag. + */ + TBool iScrollbarIsVisible; + + /** + * iCurrentItemIndex + */ + TInt iPreviouslyDrawnCurrentItemIndex; + + /** + * When ETrue, disables ScrollToMakeItemVisible method. + */ + TBool iScrollToItemDisabled; + }; + +#endif // MMLISTBOXVIEW_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmlongtapobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmlongtapobserver.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,40 @@ +/* +* 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: receives key pressed notifications +* +*/ + + +#ifndef M_MMLONGTAPOBSERVER_H +#define M_MMLONGTAPOBSERVER_H + +#include <coedef.h> + +/** + * Interface for handling long tap events. + * + * @code + * @endcode + * @lib + * @since S60 v3.0 + */ +class MMmLongTapObserver + { +public: + + virtual void HandleLongTapEventL( const TPoint& aPenEventLocation ) = 0; + + }; + +#endif // M_MMLONGTAPOBSERVER_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmmarqueeadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmmarqueeadapter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,333 @@ +/* +* 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: Constants for the matrixmenu +* Version : %version: 22 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + + +#ifndef MMMARQUEEADAPTER_H +#define MMMARQUEEADAPTER_H + +// INCLUDES +#include <e32std.h> +#include <e32base.h> +#include <AknMarqueeControl.h> +#include <aknlayoutscalable_avkon.cdl.h> +#include <eiklbx.h> + +// CLASS DECLARATION +/** + * Used by Multimedia Menu to display marquee + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v3.0 + * @ingroup group_mmwidgets + */ +NONSHARABLE_CLASS( CMmMarqueeAdapter ) : public CBase + { + + +private: + /** + * Used to keep currently drawn marquee element + * @code + * @endcode + * @lib mmwidgets + * @since S60 v3.0 + * @ingroup group_mmwidgets + */ + NONSHARABLE_CLASS( CMmMarqueeElement ) : public CBase + { + + friend class CMmMarqueeAdapter; + + // No implementation required + public: + + /** + * Constructor + * + * @since S60 v3.0 + * @param aElementRect The rect to draw marquee + * @param aAlign Align of text + * @param aFont Font + * @param aColor Color + * @param aIndex Item subcell index + * @param aBaselineOffset Baseline offset + */ + CMmMarqueeElement ( + TRect aElementRect, + CGraphicsContext::TTextAlign aAlign, + TAknLogicalFontId aFont, + TRgb aColor, + TInt aIndex, + TInt aBaselineOffset ); + + /** + * Destructor + * + * @since S60 v3.0 + */ + ~CMmMarqueeElement (); + + /** + * Two-phased constructor. + * + * @since S60 v3.0 + * @param aElementRect The rect to draw marquee. + * @param aAlign Align of text. + * @param aText Text do be drawn. + * @param aFontId Font's id. + * @param aColor Color. + * @param aIndex Item subcell index. + * @param aBaselineOffset Baseline offset. + */ + static CMmMarqueeElement* NewL ( + TRect aElementRect, + CGraphicsContext::TTextAlign aAlign, + const TDesC& aText, + TAknLogicalFontId aFontId, + TRgb aColor, + TInt aIndex, + TInt aBaselineOffset ); + + + /** + * Setup marquee scroll data + * + * @since S60 v3.0 + * @param aLoops Number of loops to be drawn + * @param aScrollAmount Scroll amount + * @param aScrollDelay Scroll delay + */ + void SetupMarqueeControlL( + TInt aLoops, + TInt aScrollAmount, + TInt aScrollDelay ); + + + private: + + /** + * ConstructL construct marquee element + * + * @since S60 v3.0 + * @param aText Text for element + */ + void ConstructL ( const TDesC& aText ); + + private: + + /** + * Element rectangle ( according to item rect ) + */ + TRect iElementRect; + + /** + * Align of text + */ + CGraphicsContext::TTextAlign iAlign; + + /** + * LCT layouts map + * Own + */ + HBufC* iText; + + /** + * Font + */ + TAknLogicalFontId iFont; + + /** + * Color + */ + TRgb iColor; + + /** + * Loops to be drawn + */ + TInt iLoops; // default 1 + + /** + * Scroll amount + */ + TInt iScrollAmount; // default 6 + + /** + * Scroll delay + */ + TInt iScrollDelay; // default 1000000 + + /** + * Marquee control + * Own + */ + CAknMarqueeControl* iMarqueeControl; + + /** + * Subcell index of marquee element + */ + TInt iSubcellIndex; + + /** + * Baseline offset + */ + TInt iBaselineOffset; + }; +public: + // Constructors and destructor + + /** + * Destructor. + */ + ~CMmMarqueeAdapter (); + + /** + * Two-phased constructor. + */ + static CMmMarqueeAdapter* NewL (); + + /** + * Two-phased constructor. + */ + static CMmMarqueeAdapter* NewLC (); + +private: + + /** + * Constructor for performing 1st stage construction + */ + CMmMarqueeAdapter (); + + /** + * Default symbian 2nd stage constructor. + */ + void ConstructL (); + + +public: + + /** + * Adds marquee element to be drawn + * + * @since S60 v3.0 + * @param aRect Rectangle where marquee is drawn + * @param aText Marquee text + * @param aFont Font + * @param aColor Color + * @param aAlign Align of text + * @param aIndex Subcell index + * @param aBaselineOffset Baseline offset + * @param aCurrentlyDrawnItemIndex Currently drawn item index + */ + void AddMarqueeElementL (const TRect& aRect, const TDesC& aText, + TAknLogicalFontId aFont, TRgb aColor, + CGraphicsContext::TTextAlign aAlign, TInt aIndex, TInt aBaselineOffset, TInt aCurrentlyDrawnItemIndex); + + /** + * Enables marquee + * + * @since S60 v3.0 + * @param aEnable Enable/disable marquee + */ + void EnableMarquee( TBool aEnable ); + + /** + * Draws marquee text. is called every time marque is scrolled + * + * @since S60 v3.0 + * @param aGc Window graphics context. + */ + void DrawMarqueeL(CWindowGc & aGc); + + /** + * Stops marquee drawing + * + * @since S60 v3.0 + */ + void StopMarqueeDrawing(TInt aIndex = -1); + + /** + * Set listbox where marquee is drawn + * + * @since S60 v3.0 + * @param aControl Listbox + */ + void SetControl( CEikListBox * aControl ); + + /** + * Reveales if subcell marquee element already exists + * + * @since S60 v3.0 + * @param aIndex Item subcell index + * @return Does element exist in marquee adapter marquee elements array + */ + TBool SubcellMarqueeElementExists( TInt aIndex ); + + /** + * Removes marquee elements from marquee adapter + * + * @since S60 v3.0 + * @param aSubcellIndex Item subcell index + */ + void RemoveSubcellMarqueeElement(TInt aSubcellIndex); + + /** + * Checks if marquee is enabled. + * + * @return ETrue if marquee enabled, EFalse otherwise. + */ + TBool IsMarqueeEnabled() const; + +private: + + /** + * Called when marquee scroll increments + * + * @since S60 v3.0 + * @param aControl Listbox where marquee is drawn + * @return Was marqueee drawing successful + */ + static TInt RedrawEvent(TAny* aControl); + +private: //members + + /** + * Array of marquee element + */ + RPointerArray< CMmMarqueeElement > iMarqueeElements; + + /** + * Is marquee enabled + */ + TBool iMarqueeEnabled; + + /** + * Listbox where marquee is drawn + * Not own + */ + CEikListBox* iListbox; + + /** + * Currently drawn item index + */ + TInt iCurrentMarqueeItemIndex; + }; + +#endif // MMMARQUEEADAPTER_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmpostevaluationprocessor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmpostevaluationprocessor.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,137 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CMmPostEvaluationProcessor declaration +* Version : %version: 2 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef C_MMPOSTEVALUATIONPROCESSOR_H +#define C_MMPOSTEVALUATIONPROCESSOR_H + +#include <e32base.h> +#include <e32std.h> + +class CMmListBoxItemDrawer; + +/** + * Used to performa additional post evaluation operations connected with + * the ui, and preparation of a suite display from the mmwidgets side. + * All the operation are performed in an active object, since they + * are not time crucial, and are performed to adjust performance: + * such as preloading suite icons that are not visible in the current view. + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v5.0 + * @see CListBoxItemDrawer + * @ingroup group_mmwidgets + */ +NONSHARABLE_CLASS( CMmPostEvaluationProcessor ) : public CActive + { + +public: + /** + * Two-phased constructor. + * + * @since S60 v5.0 + * @param aDrawer Item drawer used to draw item. + */ + static CMmPostEvaluationProcessor* NewL( CMmListBoxItemDrawer& aDrawer ); + + /** + * Two-phased constructor. + * + * @since S60 v5.0 + * @param aDrawer Item drawer used to draw item. + */ + static CMmPostEvaluationProcessor* NewLC( CMmListBoxItemDrawer& aDrawer ); + + /** + * Destructor. + * + * @since S60 v5.0 + */ + virtual ~CMmPostEvaluationProcessor(); + + /** + * Starts at predefiend index. + * + * @param aIndex Starts processing at index. + * @since S60 v3.0 + */ + void StartAt( TInt aIndex = 0 ); + +private: + + /** + * Default constructor. + * + * @since S60 v3.0 + * @param aDrawer Object used to draw items in widgets. + */ + CMmPostEvaluationProcessor( CMmListBoxItemDrawer& aDrawer ); + + /** + * 2nd phase constructor. + * + * @since S60 v3.0 + */ + void ConstructL(); + + + +private: // From CActive + + /** + * Draws next animation phase. + * + * @since S60 v3.0 + */ + void RunL(); + + /** + * Cancels animation timer. Stops animation. + * + * @since S60 v3.0 + */ + void DoCancel(); + + /** + * Handles error if error an error occured. + * + * @since S60 v3.0 + * @param aError Error code which occurred. + * @return Error code for error handling. + */ + TInt RunError( TInt aError ); + +private: // Data + + /** + * Drawer to use for preload. + + */ + CMmListBoxItemDrawer & iDrawer; + + /** + * Index to be processed in next RunL. + + */ + TInt iIndexToProcess; + + }; + +#endif // MMDRAWERANIMATOR_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmsubcellssetupcode.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmsubcellssetupcode.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,114 @@ +/* +* 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: +* Version : 2 << Don't touch! Updated by Synergy at check-out. +* +*/ + +#ifndef MMSUBCELLSSETUPCODE_H +#define MMSUBCELLSSETUPCODE_H + +#include <e32def.h> + +const TInt KNumberOfBitsToStoreSubcellType = 3; +const TInt KNumberOfBitsToStoreTemplateId = 8; +const TInt KNumberOfBitsToStoreIsCurrentInfo = 1; + +/** + * The purpose of this class is to provide a very fast way + * of determining whether two particular ways of setting up + * subcells are compatible (compatible == the same). + * + * It is important that the methods of this class are used + * in a fixed order: + * 1. (Optional) Clear() - only needed if this object was + * used before. + * 2. AddSubcellInfo() - for every subcell being set up + * and in the same order. + * 3. AddTemplateInfo + * 4. AddIsCurrentInfo + * It was assumed that there would never be more than 6 + * MmTemplateContants::KSubCellsCount subcells. If that + * should ever change, consider changing the type of iCode + * member to TUint64. + * Default assignment operator and copy constructor are ok + * for this class. + */ +NONSHARABLE_CLASS( TMmSubcellsSetupCode ) + { +public: + /** + * Values of this enum must be low enough to be stored in + * just KNumberOfBitsToStoreSubcellType bits (currently the + * maximum value allowed is 7). + */ + enum TSubcellType + { + ENoSubcell = 0, + EGraphicsSubcell = 1, + ETextSubcell = 2, + EBackdropSubcell = 3 + }; +public: + /** + * Standard C++ constructor. + */ + inline TMmSubcellsSetupCode(); + /** + * Adds the information about what type of subcell was just + * set up. + * @param aSubcellType Subcell type (any value defined in the + * TSubcellType enum). + */ + inline void AddSubcellInfo( TSubcellType aSubcellType ); + /** + * Adds information about the template used. + * + * @param aTemplateIdentifier Template idetifier obtained from + * CMmItemsDataCache::GetTemplateIdentifierL(). + */ + inline void AddTemplateInfo( TInt aTemplateIdentifier ); + /** + * Adds information whether subcells setup was made for a + * highlighted item. + */ + inline void AddIsCurrentInfo( TBool aIsCurrent ); + /** + * Clears all the information stored in this object so that + * it can be-reused. + */ + inline void Clear(); + /** + * Comparison operator ==. + * @param aOther object to compare with this object. + * @return ETrue if objects equal. + */ + inline TBool operator==( const TMmSubcellsSetupCode aOther ) const; + /** + * Comparison operator !=. + * @param aOther object to compare with this object. + * @return ETrue if objects differ. + */ + inline TBool operator!=( const TMmSubcellsSetupCode aOther ) const; + +protected: // data + /** + * The subcells setup code. + */ + TUint32 iCode; + }; + +#include "mmsubcellssetupcode.inl" + +#endif // MMSUBCELLSSETUPCODE_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmsubcellssetupcode.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmsubcellssetupcode.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,94 @@ +/* +* 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: +* Version : 2 << Don't touch! Updated by Synergy at check-out. +* +*/ + +#include "mmwidgetsconstants.h" + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline TMmSubcellsSetupCode::TMmSubcellsSetupCode() + : iCode( 0 ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void TMmSubcellsSetupCode::AddSubcellInfo( TSubcellType aSubcellType ) + { + // 8 == 2 ^ KNumberOfBitsToStoreSubcellType + __ASSERT_DEBUG( aSubcellType < 8, User::Invariant() ); + + iCode <<= KNumberOfBitsToStoreSubcellType; + iCode |= aSubcellType; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void TMmSubcellsSetupCode::AddTemplateInfo( TInt aTemplateIdentifier ) + { + // 256 == 2 ^ KNumberOfBitsToStoreTemplateId + __ASSERT_DEBUG( aTemplateIdentifier < 256, User::Invariant() ); + + iCode <<= KNumberOfBitsToStoreTemplateId; + iCode |= aTemplateIdentifier; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void TMmSubcellsSetupCode::AddIsCurrentInfo( TBool aIsCurrent ) + { + iCode <<= KNumberOfBitsToStoreIsCurrentInfo; + // remember that TBool is in fact an integer + iCode |= ( aIsCurrent ? 1 : 0 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void TMmSubcellsSetupCode::Clear() + { + iCode = 0; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline TBool TMmSubcellsSetupCode::operator==( + const TMmSubcellsSetupCode aOther ) const + { + return iCode == aOther.iCode; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline TBool TMmSubcellsSetupCode::operator!=( + const TMmSubcellsSetupCode aOther ) const + { + return iCode != aOther.iCode; + } diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmtemplatelibrary.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmtemplatelibrary.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,595 @@ +/* +* 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_24.1.8 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef MMTEMPLATELIBRARY_H +#define MMTEMPLATELIBRARY_H + +// INCLUDES +#include <e32std.h> +#include <e32base.h> +#include <e32hashtab.h> //RHashMap +#include <avkon.hrh> +#include <xmlengdom.h> +#include <gdi.h> +#include <eiksbfrm.h> +#include <AknLayout2Def.h> +#include "mmwidgetsconstants.h" +#include <AknDef.hrh> + +// default templates +// grid +_LIT8( KDefaultGridLogicalTemplate, "logical_template_3" ); +// list +_LIT8( KDefaultListLogicalTemplate, "list_single_hc_apps_pane" ); + + +// STRUCT DECLARATION + +/** + * Struct used to store template child data + * + * @since S60 v5.0 + * @ingroup group_mmwidgets + */ +class TTemplateChild + { + +public: + + /** + * Rectangle of subcell according to position in item. + */ + TRect iRectAccordingToParent; + + /** + * Data type represented by the subcell. + */ + TBufC8<64> iData; + + /** + * The LCT template used to calculate the subcell position. + */ + TBufC8<64> iLct; + + /** + * The variety for the lct template. + */ + TInt iVariety; + + /** + * Depicts if the subcell is an image or text. + */ + TBool iIsImage; + + /** + * The font id used for displaying text. + */ + TAknLogicalFontId iFontId; + + /** + * The type of align for the text. + */ + CGraphicsContext::TTextAlign iTextAlign; + + /** + * The additional Id for a subcell element used to differentiate it + * from others. e.g the backdrop image has a different visual id + * since it is displayed only in edit mode. + */ + TImageVisualId iImageVisualId; + + /** + * The type of horizontal align for the icon. + */ + TManualAlign iHAlign; + + }; + +// CLASS DECLARATION + +/** + * Used by Multimedia Menu to load template data. + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v3.0 + * @ingroup group_mmwidgets + */ +NONSHARABLE_CLASS( CMmTemplateLibrary ) : public CBase + { +public: + // Constructors and destructor + + /** + * Destructor. + */ + ~CMmTemplateLibrary(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CMmTemplateLibrary* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CMmTemplateLibrary* NewLC(); + +private: + + /** + * Constructor for performing 1st stage construction. + */ + CMmTemplateLibrary(); + + /** + * Default symbian 2nd stage constructor. + */ + void ConstructL(); + +public: + + /** + * Gets the size of template item according to highlight and orientation. + * + * @since S60 v3.0 + * @param aWidgetType The widget type. + * @param aTemplate The current template for the item. + * @param aLandscapeOrientation Is view in landscape orientation. + * @param aHighlighted Is item highlighted. + * @param aParentRect The bounding rect in which the item is drawn. + * + * @return size of item + */ + TSize GetSize( TMmWidgetType aWidgetType, const TDesC8& aTemplate, + TBool aLandscapeOrientation = 0, TBool aHighlighted = 0, + TRect aParentRect = TRect() ); + + /** + * Gets the size of template. + * + * @since S60 v3.0 + * @param aItemSize Item size to be set. + * @param aWidgetType The widget type. + * @param aTemplate The current template for the item. + * @param aLandscapeOrientation Is view in landscape orientation. + * @param aHighlighted Is item highlighted. + * @param aParentRect The bounding rect in which the item is drawn. + * + * @return error code + */ + TInt GetSize( TSize& aItemSize, TMmWidgetType aWidgetType, + const TDesC8& aTemplate, TBool aLandscapeOrientation, + TBool aHighlighted , TRect aParentRect = TRect() ); + + /** + * Get array of templates for subcells ( item children ). + * + * @since S60 v3.0 + * @param aWidgetType The widget type. + * @param aArray The array of subcell children to be set. + * @param aTemplate The current template for the item. + * @param aLandscapeOrientation Is view in landscape orientation. + * @param aHighlighted Is item highlighted. + * @param aIsEditMode Is in edit mode. + * + */ + void GetChildrenL( TMmWidgetType aWidgetType, + RArray< TTemplateChild >& aArray, const TDesC8& aTemplate, + TBool aLandscapeOrientation = 0, TBool aHighlighted = 0, TBool aIsEditMode = 0 ); + + /** + * Get the layout size ( Grid ) e.g. 3x4 + * + * @since S60 v3.0 + * @param aWidgetType The widget type. + * @param aTemplate The current template for the item. + * @param aLandscapeOrientation Is view in landscape orientation. + * + * @return the size of the layout. + */ + TSize GetLayoutSizeL( TMmWidgetType aWidgetType, const TDesC8& aTemplate, + TBool aLandscapeOrientation ); + + /** + * Get rect of move indicator according to item (as reference position). + * The rect is relevant to the item in point (0,0). + * e.g for item size 20x360 the rect can be (-5,-5):(365,25). + * + * @since S60 v3.0 + * @param aWidgetType The widget type. + * @param aTemplate The current template for the item. + * @param aLandscapeOrientation Is view in landscape orientation. + * @param aHighlighted Is item highlighted. + * + * @return rect of move indicator area. + */ + TRect GetMoveIndicatorRect( TMmWidgetType aWidgetType, const TDesC8& aTemplate, + TBool aLandscapeOrientation, TBool aHighlighted ); + + /** + * Get children templates for move indicator. + * + * @since S60 v3.0 + * @param aWidgetType The widget type. + * @param aArray Array of children templates. + * @param aTemplate The current template for the item. + * @param aLandscapeOrientation Is view in landscape orientation. + * @param aHighlighted Is item highlighted. + * + */ + void GetMoveIndicatorChildrenL( TMmWidgetType aWidgetType, + RArray< TTemplateChild >& aArray, const TDesC8& aTemplate, TBool aLandscapeOrientation, TBool aHighlighted ); + + /** + * Get size of item for LCT template. + * + * @since S60 v3.0 + * @param aLCTTemplate The LCT template name. + * @param aVariety The variety for aLCTTemplate. + * @param aWindowLayout The window layout to be used to calculet the size. + * @param aLandscapeOrientation ETrue if view in landscape orientation otherwise EFalse. + * + * @return item size + */ + TSize GetLCTSize( const TDesC8& aLCTTemplate, TInt aVariety, TAknWindowLineLayout& aWindowLayout, TBool aLandscapeOrientation ); + + /** + * Clean the cache + * + * @since S60 v3.0 + */ + void CleanAndClearCache( ); + + /** + * The template content is loaded. LCT templates have highest priority. + * If there is no LCT template, a custom template is loaded. + * + * @since S60 v3.0 + * @param aTemplate The current template for the item. + * @param aWidgetType The widget type. + * @param aMmTemplateType Type of template (LCT/custom). + * + * @return Template content. + */ + HBufC8* GetTemplateContentL( const TDesC8& aTemplate, TMmWidgetType aWidgetType, TMmTemplateType& aMmTemplateType ); + + /** + * Sets scrollbar visibility so template library is aware. + * + * @since S60 v3.0 + * @param aIsScrollbarVisible Is scrollbar visible. + */ + void SetScrollbarVisibilityL( TBool aIsScrollbarVisible ); + + /** + * Gets scrollbar visibility. + * + * @since S60 v3.0 + * @return Is scrollbar visible. + */ + TBool GetScrollbarVisibility(); + + /** + * Sets the current zoom so template library can retrieve the appropriate templates. + * + * @since S60 v3.0 + * @param aZoom Is The current zoom to be set. + */ + void SetZoom( TAknUiZoom aZoom = EAknUiZoomAutomatic ); + + /** + * Sets the scrollbar width so template library can calculate the width of the item correctly. + * + * @since S60 v3.0 + * @param aScrollbarWidth The current width of the scrollbar. + */ + void SetScrollbarWidthL( TInt aScrollbarWidth ); + + /** + * Gets scrollbar width. + * + * @since S60 v3.0 + * @return scrollbar width + */ + TInt ScrollbarWidth(); + + /** + * Gets the parent rect for given orientation from which templates were calculated. + * + * @since S60 v3.0 + * @param aLandscapeOrientation The current landscape orientation. + * @return Parent rect for given orientation. + */ + TRect GetParentRect( TBool aLandscapeOrientation ); + +private: + /** + * Get the lookup text. + * + * @since S60 v3.0 + * @param aTemplate The current template for the item. + * @param aWidgetType The widget type. + * @param aLandscapeOrientation Is view in landscape orientation. + * @param aHighlighted Is item highlighted. + * + * @return Lookup text. + */ + HBufC8* LookupText( const TDesC8& aTemplate, TMmWidgetType aWidgetType, + TAknUiZoom aZoom, TBool aLandscapeOrientation = EFalse, + TBool aHighlighted = EFalse ); + + /** + * Get the lookup text for layout size. + * + * @since S60 v3.0 + * @param aWidgetType The widget type. + * @param aTemplate The current template for the item. + * @param aLandscapeOrientation Is view in landscape orientation. + * + * @return lookup layout text. + */ + HBufC8* LookupLayoutText( TMmWidgetType aWidgetType, TAknUiZoom aZoom, + const TDesC8& aTemplate, TBool aLandscapeOrientation ); + + /** + * Get the lookup text for move indicator. + * + * @since S60 v3.0 + * @param aLookupText The lookup text to be used to create the lookup indicator text. + * @return lookup Indicator text. + */ + HBufC8* LookupIndicatorText( const TDesC8& aLookupText ); + + /** + * Load the template to cache. + * + * @since S60 v3.0 + * @param aWidgetType The widget type. + * @param aTemplate The current template for the item. + * @param aLandscapeOrientation The current orientation. + */ + void LoadTemplateL( TMmWidgetType aWidgetType, const TDesC8& aTemplate, + TBool aLandscapeOrientation ); + + /** + * Get template file content. + * + * @since S60 v3.0 + * @param aContent Descriptor to which the file content should be set. + * @param aTemplate The current template for the item. + * @param aWidgetType The widget type. + * @param aMmTemplateType Type of template (LCT/custom). + * @param aLoadCustomTemplate Value to be set depending on template type loaded (LCT/custom). + */ + void GetTemplateFileContentL (HBufC8*& aContent, const TDesC8& aTemplate, + TMmWidgetType aWidgetType, TMmTemplateType& aMmTemplateType, + TBool aLoadCustomTemplate = EFalse); + + /** + * Process xml element. + * + * @since S60 v3.0 + * @param aMmTemplateType Type of template (LCT/custom). + * @param aElement Element ( xml ). + * @param aTemplate The current template for the item. + * @param aLandscapeOrientation Is view in landscape orientation. + * @param aHighlighted Is item highlighted. + * + */ + void ProcessElementL (TMmTemplateType aMmTemplateType, + TXmlEngElement aElement, const TDesC8& aTemplate, + TBool aLandscapeOrientation, TBool aHighlighted); + + /** + * Process the LCT template. + * + * @since S60 v3.0 + * @param aElement Element (xml). + * @param aTemplate The current template for the item. + * @param aLandscapeOrientation Is view in landscape orientation. + * @param aHighlighted Is item highlighted. + */ + void ProcessLCTTemplateElementL( TXmlEngElement aElement, + const TDesC8& aTemplate, + TBool aLandscapeOrientation, + TBool aHighlighted ); + + /** + * Process the custom template. + * + * @since S60 v3.0 + * @param aElement Element (xml) + * @param aTemplate The current template for the item. + * @param aLandscapeOrientation Is view in landscape orientation. + * @param aHighlighted Is item highlighted. + */ + void ProcessCustomTemplateElementL( TXmlEngElement aElement, + const TDesC8& aTemplate, + TBool aLandscapeOrientation, + TBool aHighlighted ); + + /** + * Setup LCT template data. + * + * @since S60 v3.0 + * @param aChildTemplate Template where the data should be set up. + * @param aChildElement Element (xml). + * @param aItemSize Item size. + */ + void SetupLCTTemplateL(TTemplateChild& aChildTemplate, TXmlEngElement& aChildElement, TSize aItemSize ); + + /** + * Setup custom template. + * + * @since S60 v3.0 + * @param aChildTemplate Template where the data should be set up. + * @param aChildElement Element (xml). + */ + void SetupCustomTemplateL(TTemplateChild& aChildTemplate, TXmlEngElement& aChildElement ); + + /** + * Set the template visual id. + * + * @since S60 v3.0 + * @param aChildTemplate Template data. + */ + void SetupTemplateVisualId(TTemplateChild& aChildTemplate ); + + /** + * Setup the item children template data for move indicator and cache the data. + * + * @since S60 v3.0 + * @param aLookupString Lookup string. + * @param aItemSize Item size. + */ + void SetupMoveIndicatorTemplateChildrenL( const TDesC8& aLookupString, TSize aItemSize ); + + /** + * Adjusts the item size loaded to template cache according to layout size and orientation. + * This method adjusts the item width so that items occupy the view correctly. + * + * @since S60 v3.0 + * @param aSize The size of the item to be adjusted. + * @param aLayoutSize The layout of the widget e.g 3x4 + * @param aLandscapeOrientation The orientation of the template being processed. + */ + void AdjustItemWidth( TSize& aSize, TSize aLayoutSize, TBool aLandscapeOrientation ); + + /** + * Updates the parent rect according to orientation. + * + * @since S60 v3.0 + * @param aParentRect The current parent rectangle. + * @param aLandscapeOrientation The current orientation. + */ + void UpdateParentRect( TRect aParentRect, TBool aLandscapeOrientation ); + + /** + * Sets the parent rect for given orientation. + * + * @since S60 v3.0 + * @param aLandscapeOrientation Orientation for which parent rect shoul be set. + * @param aParentRect The parent rect of current orientation. + */ + void SetParentRect( TBool aLandscapeOrientation, TRect aParentRect); + + /** + * Appends the edit mode template (backdrop icon) to the array of template children passed to the item drawer for drawing. + * + * @since S60 v3.0 + * @param aTemplateArray The template array to which the edit mode template is appended. + * @param aSize The size of the item for which the edit mode template should be calculated. + */ + void AppendEditModeTemplateL( RArray< TTemplateChild >& aTemplateArray, TSize aSize ); + + /** + * Adjusts the item size according to layout, LCT item size and orientation. + * + * @since S60 v3.0 + * @param aItemSize The LCT item size. + * @param aLayoutSize The layout size to be used to calculate item size. + * @param aLandscapeOrientation The orientation for which the template is loaded. + */ + void AdjustItemSize(TSize& aItemSize, TSize aLayoutSize, TBool aLandscapeOrientation ); + + /** + * Get the current zoom for displaying templates. + * + * @since S60 v3.0 + * @return The current zoom. + */ + TAknUiZoom Zoom( ); + + /** + * Caches the layout size + * + * @since S60 v3.0 + * @param aLayoutSize The layout size to ba cached. + * @param aTemplate The template for the cached layout size. + * @param aLandscapeOrientation The orientation for which the template is loaded. + * @return The current zoom. + */ + void CacheLayoutSizeL( TSize aLayoutSize, const TDesC8& aTemplate, TBool aLandscapeOrientation ); + + /** + * Adjusts icon's align to layout (left, center, right). + * + * @since S60 v5.0 + * @param aParentSize The LCT parent item size. + * @param aTemplateChild Template data. + */ + void AdjustIconPosition(TSize aParentSize, + TTemplateChild& aTemplateChild); + +private: //Members + + /** + * Widget type of template being loaded. + */ + TMmWidgetType iWidgetType; + + /** + * Template type which is being loaded (LCT/custom). + */ + TMmTemplateType iMmTemplateType; + + /** + * Template sizes map. + */ + RHashMap< HBufC8*, TSize> iTemplateSizesMap; + + /** + * Item children template map. + */ + RHashMap< HBufC8*, RArray<TTemplateChild> > iTemplateChildrenMap; + + /** + * Move indicator rects map. + */ + RHashMap< HBufC8*, TRect> iMoveIndicatorRectsMap; + + /** + * Parent bounding rect. + */ + TRect iParentRectPortrait; + + /** + * Parent bounding rect. + */ + TRect iParentRectLandscape; + + /** + * Scrollbar is visible. + */ + TBool iIsScrollbarVisible; + + /** + * Scrollbar width. + */ + TInt iScrollbarWidth; + + /** + * Zoom type. + */ + TAknUiZoom iZoom; + + }; +#endif // MMTEMPLATELIBRARY_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmvisibilityobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmvisibilityobserver.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,54 @@ +/* +* 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: receives key pressed notifications +* +*/ + +#ifndef M_MMVISIBILITYOBSERVER_H +#define M_MMVISIBILITYOBSERVER_H + +#include <coedef.h> + +/** + * Interface for handling application changing background/foreground states. + * + * @code + * @endcode + * @lib + * @since S60 v3.0 + * @ingroup group_mmwidgets + */ +class MMmVisibilityObserver + { +public: + + /** + * Called when application goes into foreground (e.g options menu + * goes off or application is opened ). + * + * @since S60 v5.0 + */ + virtual void HandleForegroundGainedL() = 0; + + /** + * Called when application goes into background (e.g the options list + * is open and application view is dimmed). + * + * @since S60 v5.0 + */ + virtual void HandleBackgroundGainedL() = 0; + + }; + +#endif // M_MMVISIBILITYOBSERVER_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmwidgetcontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmwidgetcontainer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1052 @@ +/* +* 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_48.1.33 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef MMMWIDGETCONTAINER_H +#define MMMWIDGETCONTAINER_H + +// INCLUDES +#include <AknDef.hrh> +#include <e32std.h> +#include <e32base.h> +#include <eiklbx.h> +#include <coecntrl.h> +#include <AknsDrawUtils.h> +#include <AknsLayeredBackgroundControlContext.h> +#include <AknsListBoxBackgroundControlContext.h> +#include <aknlongtapdetector.h> + +#include "hnsuiteobserver.h" +#include "mmvisibilityobserver.h" +#include "hnglobals.h" + +// CLASS DECLARATION +class CHnSuiteModel; +class CMmListBoxModel; +class MEikListBoxObserver; +class MMmKeyEventObserver; +class MMmDragAndDropObserver; +class MMmWidgetObserver; +class CMatrixMenuAppUi; +class CMmHighlightTimer; +class CMmMarqueeAdapter; +class CMmListBoxItemDrawer; +class CMmTemplateLibrary; +class CMmPostEvaluationProcessor; +class MMmLongTapObserver; +/** + * Square of the distance the cursor has to be dragged from the current + * position to really move the dragged item. + */ +const TInt KDragDelta( 640 ); + +/** + * Structure used to store cache for widget position. + * + * @since S60 v5.0 + * @ingroup group_mmwidgets + */ +class TMmWidgetPosition + { +public: + /** + * Default constructor. + * Initializes member variables with sensible values. + */ + TMmWidgetPosition(); + +public: // data + /** + * The vertical item offset cache. + */ + TInt iVerticalItemOffset; + + /** + * The top item index cache. + */ + TInt iTopItemIndex; + + /** + * Tells if the cached values are valid. + */ + TBool iValid; + + /** + * 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; + }; + +/** + * Interface for widget containers. + * + * @code + * @endcode + * @lib mmwidgets + * @since S60 v3.0 + * @ingroup group_mmwidgets + */ + +NONSHARABLE_CLASS( CMmWidgetContainer ): public CCoeControl, + public MMmVisibilityObserver, + public MEikListBoxObserver, + public MAknLongTapDetectorCallBack + { +public: + + /** + * Creates a new grid container. + * + * @since S60 v3.0 + * @param aRect Parent rectangle. + * @param aObjectProvider Object provider. + * @return GridContainer. + */ + IMPORT_C static CMmWidgetContainer* NewGridContainerL( const TRect& aRect, + MObjectProvider* aObjectProvider, CMmTemplateLibrary* aTemplateLibrary ); + + /** + * Creates a new listbox container. + * + * @since S60 v3.0 + * @param aRect Parent rectangle. + * @param aObjectProvider Object provider. + * @param aTemplateLibrary Template library for drawer. + * @return ListboxContainer. + */ + IMPORT_C static CMmWidgetContainer* NewListBoxContainerL( const TRect& aRect, + MObjectProvider* aObjectProvider, CMmTemplateLibrary* aTemplateLibrary ); + +public: // Highlight related methods + + /** + * Sets the default highlight. + * + * @since S60 v3.0 + * @param aRedraw Is highlight to redraw. + */ + virtual void SetDefaultHighlightL( TBool aRedraw = ETrue ) = 0; + + /** + * Sets the highlight. + * + * @since S60 v3.0 + * @param aItemIndex Index to set the highlight at. + * @param aRedraw Is highlight to redraw. + */ + IMPORT_C virtual void SetManualHighlightL(TInt aItemIndex, TBool aRedraw = ETrue ); + + /** + * Gets the highlight from the widget. + * + * @since S60 v3.0 + * @return Current Highlight in the widget. + */ + IMPORT_C virtual TInt GetHighlight(); + + /** + * Gets the highlight from the widget. + * + * @since S60 v3.0 + * @return Previous Highlight in the widget. + */ + IMPORT_C virtual TInt GetPreviousHighlight(); + + /** + * Set highlight visibility. + * + * @since S60 v3.0 + * @param aVisible Visibility status. + */ + IMPORT_C virtual void SetHighlightVisibilityL( TBool aVisible ); + + /** + * Set highlight visibility. + * + * @since S60 v3.0 + * @return Visibility status. + */ + IMPORT_C virtual TBool IsHighlightVisible(); + + /** + * Handle item addition. + * + * @since S60 v3.0 + */ + IMPORT_C virtual void HandleItemAdditionL(); + + + /** + * Handle item removal. + * + * @since S60 v3.0 + */ + IMPORT_C virtual void HandleItemRemovalL(); + + /** + * Handle item removal. + * + * @since S60 v3.0 + */ + IMPORT_C CHnSuiteModel* GetSuiteModelL(); + + /** + * Retrieve type of widget. + * + * @since S60 v3.0 + * @return Type of widget. + */ + IMPORT_C virtual THnSuiteWidgetType WidgetType(); + + /** + * 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(); + + /** + * Checks if timer is active. + * Calling this method without parameters will cause to return + * timer activity state globally (without reference to a specific item index - which tells + * if timer is active at all). + * + * @param aItemIndex Item index for which to check timer activity. Can be not defined. + * @return ETrue if timer is active which means highlight is visible. + */ + TBool IsTimerActive( TInt aItemIndex = KErrNotFound ); + + /** + * Sets the long tap observer. + * + * @param aObserver Observer to receive long tap events. + */ + IMPORT_C virtual void SetLongTapObserver( MMmLongTapObserver* aObserver ); + + /** + * Handles top focus notification. This is called when we want to explicitly inform + * the container that it is in top focus state (or not). + * @param aIsTopFocus ETrue if container is in top focus. + */ + IMPORT_C virtual void HandleTopFocusL( TBool aIsTopFocus = ETrue ); + + /** + * Is called when options menu visibility changes (hides or pops up) + * @param aOptionsMenuVisible ETrue when option menu pops up. + */ + IMPORT_C virtual void HandleOptionsMenuVisibilityChangeL( + TBool aOptionsMenuVisible ); +public: + + /** + * Sets suite model. + * + * @since S60 v3.0 + * @param aModel Suite model. + */ + virtual void SetSuiteModelL( CHnSuiteModel* aModel ); + + /** + * Gets Multimedia Menu model. + * + * @since S60 v3.0 + * @return Model. + */ + virtual CMmListBoxModel* GetMmModel() = 0; + + /** + * Sets widget observer. + * + * @since S60 v3.0 + * @param aObserver Widget observer. + */ + IMPORT_C virtual void SetObserver( MMmWidgetObserver* aObserver); + + /** + * Gets item rectangle according to item index. + * + * @since S60 v3.0 + * @param aItemIndex Item index. + * @return Item rectangle. + */ + IMPORT_C TRect GetItemRectL( TInt aItemIndex ); + + /** + * Sets empty text visible when model has no items. + * + * @since S60 v3.0 + * @param aText Text to be shown when view is empty. + */ + virtual void SetEmptyTextL(const TDesC& aText) = 0 ; + + /** + * Sets flag. + * + * @since S60 v3.0 + * @param Flag Flag. + */ + virtual void SetFlag(TInt Flag); + + /** + * Gets widget. + * + * @since S60 v3.0 + * @return Widget. + */ + virtual CEikListBox* Widget(); + + /** + * Sets background context for item drawer and view. + * + * @since S60 v3.0 + * @param aBgContext Background context. + */ + virtual void SetItemDrawerAndViewBgContext( + CAknsBasicBackgroundControlContext * aBgContext ) =0; + + /** + * Sets edit mode so UI is aware. + * + * @since S60 v3.0 + * @param aIsEditMode Is edit mode. + */ + virtual void SetEditModeL( TBool aIsEditMode ); + + /** + * Tells if UI is aware of edit mode. + * + * @since S60 v5.0 + * @return Edit mode status. + */ + virtual TBool IsEditMode() const; + + /** + * Sets up widget layout (needed for grid). + * + * @since S60 v3.0 + */ + virtual void SetupWidgetLayoutL() =0; + + /** + * Constructor. + */ + CMmWidgetContainer(); + + /** + * Destructor. + */ + ~CMmWidgetContainer(); + + /** + * from CCoeControl. + * + * @since S60 v3.0 + */ + void SizeChanged(); + + /** + * Draws the widget. + * + * @since S60 v3.0 + * @param aRect Rectangle within the widget shuld be drawn. + */ + void Draw(const TRect& aRect) const; + + /** + * Draws the widget view. + * + * @since S60 v5.0 + */ + virtual void DrawView() = 0; + + /** + * Returns type UID pointer that can be used in MopSupplyObject. + * + * @since S60 v3.0 + * @param aId Type UID, should be the same that was given as aId. + * parameter of MopSupplyObject. + * @return Type UID pointer. + */ + TTypeUid::Ptr MopSupplyObject(TTypeUid aId); + + /** + * From CCoeControl. + * + * @since S60 v3.0 + * @param aPointerEvent Pointer event. + */ + void HandlePointerEventL(const TPointerEvent& aPointerEvent); + + /** + * From CCoeControl. + * + * @since S60 v5.0 + * @param aPointerEvent Pointer event. + */ + void HandlePointerEventsInEditModeL(const TPointerEvent& aPointerEvent, + TBool aAbortAnimations ); + + /** + * Set draggable. + * + * @since S60 v3.0 + * @param aDraggable Is draggable. + */ + void SetDraggableL( TBool aDraggable ); + + /** + * Gets draggable status. + * Draggable status determines if the item has + * the capability to be dragged at the momont. + * So before threshold is crossed the container + * is not draggable in the sense of this method + * because the dragged item is not yet drawn. + * It becomes draggable when it start to be drawn + * + * @since S60 v3.0 + * @return Is draggable. + */ + IMPORT_C TBool IsDraggable(); + + /** + * From CCoeControl. + * + * @since S60 v3.0 + * @return count component controls. + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl. + * + * @since S60 v3.0 + * @param aIndex index of control. + * @return component control. + */ + CCoeControl* ComponentControl(TInt aIndex) const; + + /** + * From CCoeControl. + * + * @since S60 v3.0 + * @param aKeyEvent key event. + * @param aType event type. + * @return response to key event. + */ + TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType); + + /** + * Zooms item icon. + * + * @since S60 v3.0 + * @param aItemIndex Item index. + */ + IMPORT_C void ItemIconZoomL( TInt aItemIndex ); + + /** + * Handle button up event. + * + * @since S60 v3.0 + * @param aPointerEvent Pointer event. + */ + void HandleButtonDownL(const TPointerEvent& aPointerEvent ); + + /** + * Handle button down event. + * + * @since S60 v3.0 + * @param aPointerEvent Pointer event. + */ + void HandleButtonUpL(const TPointerEvent& aPointerEvent ); + + /** + * Overridden to invalidate item drawer cache on skin change and + * dynamic variant switch. + * + * @param aType A message UID value. + */ + void HandleResourceChange( TInt aType ); + + /** + * Handle dragging of item. + * + * @since S60 v3.0 + * @param aPointerEvent Pointer event. + * @param aAbortAnimation Should animation be aborted. + */ + void HandleDragL(const TPointerEvent& aPointerEvent, TBool aAbortAnimation ); + + /** + * Sets marquee adapter. + * + * @since S60 v3.0 + * @param aAdapter A marquee adapter. + */ + void SetMarqueeAdapter( CMmMarqueeAdapter* aAdapter ); + + /** + * Sets up item drawer. + * + * @since S60 v3.0 + */ + void SetupDrawer(); + + /** + * Cancels gragging of item. + * + * @since S60 v3.0 + * @param aAnimate Should dragged item transition be animated. + */ + IMPORT_C void CancelDragL( TBool aAnimate ); + + /** + * Animates item shifting. + * + * @since S60 v3.0 + * @param aHighlight Highlighted item index. + */ + void AnimateShiftL(TInt aHighlight); + + /** + * Gest number of items. + * + * @since S60 v3.0 + * @return Number of items. + */ + IMPORT_C TInt NumberOfItems(); + + /** + * Retrieve information if flip is open. + * + * @since S60 v5.0 + * @return ETrue if flip is open. Other cases returns EFalse. + */ + TBool FlipOpen(); + + /** + * Sets the flip open state. + * + * @since S60 v5.0 + * @param aIsFlipOpen Is the flip open. + */ + IMPORT_C void SetFlipOpenL( TBool aIsFlipOpen ); + + /** + * This should be called when flip state was changed + * + * @since S60 v5.0 + */ + virtual void FlipStateChangedL(); + + /** + * This should be called at the end of edit mode in non-touch + * + * @since S60 v5.0 + */ + IMPORT_C void StopMovingL(); + + /** + * Handle zooming change + * + * @since S60 v5.0 + */ + IMPORT_C void HandleZoomChanged( TAknUiZoom aZoom ); + + /** + * Set the zoom + * + * @since S60 v5.0 + */ + IMPORT_C void SetZoom( TAknUiZoom aZoom ); + + /** + * Set the vertical item offset; + * @param aOffset The offset to set to the widget. + * + * @since S60 v5.0 + */ + virtual void SetVerticalItemOffset( TInt aOffset ) = 0; + + /** + * Gets the current vertical item offset for the widget in the container. + * @since S60 v5.0 + * + * @return The current vertical item offset. + */ + virtual TInt VerticalItemOffset() const = 0; + + /** + * Saves the currents position of the widget. The vertical item offset + * and the top item index are cached. + * @since S60 v5.0 + */ + IMPORT_C void CacheWidgetPosition(); + + /** + * Resets the widget position cache to top of view. + * Both vartical item offset and top index are set to zero + * in cache and widget. + * @since S60 v5.0 + */ + IMPORT_C void ResetWidgetPosition(); + + /** + * Restores the cached widget position values in the widget. + * @since S60 v5.0 + */ + IMPORT_C void RestoreWidgetPosition(); + + /** + * Scrolls to the specified item index so that the item is seen entirely on screen. + * @since S60 v5.0 + * + * @param aIndex The widget item index to scroll to. + * @return True if any scrolling was done. + */ + IMPORT_C TBool ScrollToItemL( TInt aIndex ); + + /** + * Called when the number of items in widget model changed. + * @since S60 v5.0 + * + * @param aChange Type of change + */ + IMPORT_C void NumberOfItemsChangedL( TItemsChangeType aChange ); + + /** + * Aligns the bottom of view to the last model item bottom edge so that no extra + * unused pixels are visible at the bottom of screen. + * @since S60 v5.0 + * + * @return True if the view was scrolled. + */ + TBool AlignBottomOfViewL( ); + + /** + * Calculate numer of pixels required to scroll when aligning bottom of view. + * @since S60 v5.0 + */ + TInt CalcBottomPixelsToScroll(); + + /** + * Sets visibility of a widget. + * + * @param aVisible ETrue if widget should be visible, EFalse - otherwise + */ + void MakeVisible(TBool aVisible); + + /** + * Tells if item is visible (fully or partially). + * @param aItemIndex Item index. + * @return ETrue if visible, EFalse otherwise. + */ + virtual TBool ItemIsVisible( TInt aItemIndex ) const; + + /** + * Tells if item is entirely visible. + * @param aIndex The index of the item. + */ + IMPORT_C TBool ItemIsFullyVisible(TInt aIndex); + + /** + * Prepares the container to be set to the garbage collector. + */ + IMPORT_C void PrepareForGarbage(); + + /** + * Checks, whether the currently dragged item is a draggable item. i.e. parent folder + * is not a draggable item. + * @returns True, if dragged item is parent folder + * or no item is dragged (iDraggedIndex = -1), false otherwise. + */ + TBool IsNoItemDragged(); + + /** + * Sets the iHasFocus member variable, which is used to determine + * if marquee animation can be enabled. + */ + IMPORT_C void SetHasFocusL( TBool aHasFocus ); + + /** + * Sets the iIsFaded member variable, which is used to determine + * if marquee animation can be enabled. + */ + IMPORT_C void SetIsFaded( TBool aIsFaded ); + +public: // from MMmVisibilityObserver + + /** + * + * @since S60 v3.0 + */ + IMPORT_C void HandleBackgroundGainedL(); + + /** + * + * @since S60 v3.0 + */ + IMPORT_C void HandleForegroundGainedL(); +public: // from MEikListBoxObserver + + /** + * Handles list box events. + * + * @since S60 v5.0 + */ + virtual void HandleListBoxEventL(CEikListBox* aListBox, + TListBoxEvent aEventType); + +public: + /** + * From MAknLongTapDetectorCallBack. Handles long tap events. + * + * @since S60 v5.0 + * @param aPenEventLocation Point coordinates relative to container. + * @param aPenEventScreenLocation Point coordinates relative to screen. + */ + virtual void HandleLongTapEventL( const TPoint& aPenEventLocation, + const TPoint& aPenEventScreenLocation ); +protected: + + /** + * Handles additional contruction tasks. + * + * @since S60 v3.0 + */ + void ConstructL(); + + /** + * Sets highlight locally. + * Does not modify the avkon behaviur. + * + * @since S60 v3.0 + * @param aItemIndex Index of the item. + */ + 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 + * help determine whether item re-ordering is needed. + * + * @param aItemIndex index of the item to check + * @param aPoint point coordinates + * @return ETrue if point is located within item re-order area, + * EFalse otherwise + */ + virtual TBool PointInItemReorderAreaL( TInt aItemIndex, TPoint aPoint ); + + /** + * Hides the options menu if it is being displayed. + * This has (probably) the same effect as clicking Cancel (RSK) - + * the menu just disappears. + */ + void HideOptionsMenuIfDisplayed(); + +protected: + + /** + * Validates the widget current item index so that it is consistent with + * the current model. + */ + void ValidateWidgetCurrentItemIndex(); + + /** + * Updates current view's scrollbar thumbs. + */ + virtual void UpdateViewScrollBarThumbs(); + + /** + * Starts or stops marquee animation based on the current state + * of the container. + */ + void StartOrStopMarquee(); + +private: + + /** + * 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. + * + * @since S60 v3.0 + * @param aDraggedItemOverIcons Is dragged over icons flag. + */ + void ManageFolderZoomingL( TBool aDraggedItemOverIcons ); + + /** + * Cancels gragging of item if relevant( Edit Mode is activated ) + * + * @since S60 v3.0 + */ + void CancelDragL(); + + /** + * Sets the widget highlight back to place if e.g. item was dragged over an item + * where it could not be dropped into. + * + * @since S60 v3.0 + */ + void SetHighlightAfterDrag(); + + /** + * Handles key event. + * + * @since S60 v3.0 + * @param aKeyEvent Key event. + * @param aType Event code. + */ + TKeyResponse HandleKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType); + + /** + * Handles rocker (select) press. + */ + void HandleRockerPressL(); + + /** + * Gets distance between current and previous position. + * @param aPos Current position. + * @param aTapPoint Point of the tap. + * @return Distance between two points in pixels. + */ + TInt DeltaSquare( const TPoint aTapPoint, + const TPoint aPos ); + + /** + * Checks, whether given item is a folder or root folder. + * @param aItemIndex Item index to check. + * @returns True, if given item is a folder or root folder, false otherwise. + */ + 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 ); + + /** + * Gets column count in current view. + * @returns Column count in current view. + */ + virtual TInt ColumnsInCurrentView(); + + /** + * Gets row count in current view. + * @returns Row count in current view. + */ + virtual TInt RowsInCurrentView(); + + /** + * 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 ); + + /** + * Sets up the scrolling effect movement type. + * @param aDown True if scrolling is downwards. + */ + void SetupScrollingEffectsL( TBool aDown ); + +protected: + + + /** + * Own. + */ + CEikListBox* iWidget; + + /** + * Key event observer. + */ + MMmKeyEventObserver* iKeyEventObserver; + + /** + * Drag and drop observer. + */ + MMmDragAndDropObserver* iDragAndDropObserver; + /** + * List box observer. + */ + MEikListBoxObserver* iListBoxObserver; + + /** + * Notifies about time expiration. + * + * Owned by descendant. + */ + CMmHighlightTimer* iTimer; + + /** + * Marquee adapter. + * Own. + */ + CMmMarqueeAdapter* iMarqueeAdapter; + + /** + * Item drawer. + * Not own. + */ + CMmListBoxItemDrawer* iDrawer; + +protected: + + /** + * Current Highlight. + */ + TInt iCurrentHighlight; + + /** + * Has drag occurred. + */ + TBool iDragOccured; + + /** + * Processed display elelments for better performance. + */ + CMmPostEvaluationProcessor* iPostProcessor; + + /** + * Set when long tap is in progress (stylus popup displayed over container) + */ + TBool iLongTapInProgress; + +private: + + + /** + * Background context. + * Own. + */ + CAknsBasicBackgroundControlContext* iBgContext; + + /** + * Last drag point. + */ + TPoint iLastDragPoint; + + /** + * First tap point. + */ + TPoint iTapPoint; + + /** + * First tap point. + */ + TPoint iItemRelativeTapPoint; + + /** + * Last drag highlight. + */ + TInt iLastDragHighlight; + + /** + * Dragged item index. + */ + TBool iDraggedIndex; + + /** + * Edit mode status. + */ + TBool iIsEditMode; + + /** + * Destination of item index. + */ + TInt iItemIndexDestination; + + /** + * Previous Highlight. + */ + TInt iPreviousHighlight; + + /** + * Is flip open + */ + TBool iFlipOpen; + + /** + * The current rect of the widget control. + */ + TRect iWidgetRect; + + /** + * Longpress allowed flag. We only accept long press (EEventKey+iRepeats) + * when there was no highlight visible before EEventKeyDown, otherwise + * we react only to EEventKeyDown + */ + TBool iAllowLongPress; + + /** + * Cache for widget position. + */ + TMmWidgetPosition iWidgetPositionCache; + + /** + * ETrue if Matrix menu window is faded. + */ + TBool iIsFaded; + + /** + * ETrue if Matrix menu has focus (i.e. it is not obscured by any popup + * note). + */ + TBool iHasFocus; + + /** + * ETrue if in foreground. + */ + TBool iInForeground; + + /** + * Own. + * Detects long tap events. + */ + CAknLongTapDetector* iLongTapDetector; + + /** + * Observer to notify about long tap events. + */ + MMmLongTapObserver* iLongTapObserver; + + }; + +#endif // MMMWIDGETCONTAINER_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmwidgetobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmwidgetobserver.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,49 @@ +/* +* 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: receives key pressed notifications +* Version : %version: 8 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef M_MMWIDGETOBSERVER_H +#define M_MMWIDGETOBSERVER_H + +#include <coedef.h> +#include <eiklbo.h> +#include "mmkeyeventobserver.h" +#include "mmdraganddropobserver.h" +#include "mmlongtapobserver.h" + +/** + * MKeyEventObserver used to bundle different interfaces. + * A complete set of the bundled interfaces allows to fully + * control widgets behaviour. + * Class implementing this interface will be able to receive all + * notifications from a widget. + * + * @code + * @endcode + * @lib + * @since S60 v5.0 + */ +class MMmWidgetObserver : public MMmKeyEventObserver, + public MMmDragAndDropObserver, + public MEikListBoxObserver, + public MMmLongTapObserver + { + + }; + +#endif // M_MMWIDGETOBSERVER_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/inc/mmwidgetsconstants.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/inc/mmwidgetsconstants.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,448 @@ +/* +* 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: Constants for the matrixmenu +* Version : %version: 33.1.8 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef MMWIDGETSCONSTANTS_H +#define MMWIDGETSCONSTANTS_H + + +#include <e32keys.h> + +/** + * Grid constants' namespace. + */ +namespace MmGrid + { + /** + * X component of the 4x3 layout. + */ + const TInt K4By3LayoutX = 4; + + /** + * Y component of the 4x3 layout. + */ + const TInt K4By3LayoutY = 3; + + /** + * X component of the 3x4 layout. + */ + + const TInt K3By4LayoutX = 3; + + /** + * Y component of the 3x4 layout. + */ + const TInt K3By4LayoutY = 4; + + /** + * X component of the 4x5 layout. + */ + const TInt K4By5LayoutX = 4; + + /** + * Y component of the 5x4 layout. + */ + const TInt K4By5LayoutY = 5; + + /** + * X component of the 5x4 layout. + */ + const TInt K5By4LayoutX = 5; + + /** + * 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 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 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 4x3 grid. + */ + const TInt K4By3DefaultHighlight(5); + + /** + * Default highlight in 5x4 grid. + */ + const TInt K5By4DefaultHighlight(7); + + /** + * Default highlight in 4x5 grid. + */ + const TInt K4By5DefaultHighlight(8); + + /** + * 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 rows in portrait/non-zoom mode; + */ + const TInt KRowsLandscapeZoomNormal(3); + + /** + * Number of columns in landscape/non-zoom mode; + */ + const TInt KColsLandscapeZoomNormal(4); + + } + +/** + * Listbox constants' namespace. + */ +namespace MmListBox + { + /** + * 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); + } + +/** + * Drag and drop related constants. + */ +namespace MmEffects + { + /** + * Threshold for items shift. + */ + const TReal KShiftRatio(0.25); + + /** + * 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 on non-touch devices. + */ + const TInt KUsualAnimationFramesCountNonTouch( 2 ); + + /** + * No animation frames count. + */ + const TInt KNoAnimationFramesCount( 1 ); + + /** + * Delay between redrawing frames. + */ + const TInt KAnimationFrameDelay( 40000 ); + + /** + * Text alpha during drag. + */ + const TInt KDragTextAlpha( 50 ); + + /** + * Focus based scrolling item threshold. + */ + const TReal KFocusScrollingThreshold( 0.55 ); + + /** + * Focus based scrolling item threshold for listbox landscape mode. + */ + const TReal KFocusScrollingThresholdListboxLanscape( 1.0 ); + + /** + * Value of drag ignore. + */ + const TInt KDragIgnoreRectValue(200); + + /** + * Time between two butto repeat events. + */ + const TInt KDragRepeatRespawn(2); + + /** + * 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); + + const TInt KTemplateChildTextLength (64); + + const TInt KSubCellsCount (6); + + const TInt KItemSubCellsText (300); + + 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', +#ifndef __WINS__ + '*', +#else + EStdKeyNkpAsterisk, +#endif + '0', EStdKeyHash }; + + /** + * 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); + } +/** + * Matrix Template Library panic notice. + */ +_LIT( KMtlPanic, "MTL" ); + +_LIT8( KMmTitle8, "mul_title" ); +_LIT8( KMmDetail8, "mul_detail" ); +_LIT8( KMmIcon8, "mul_icon" ); +_LIT8( KMmBackdropIcon8, "mul_icon_backdrop" ); +_LIT8( KMmTemplate8, "mul_template" ); +_LIT8( KGrid8, "grid" ); +_LIT8( KListbox8, "listbox" ); +_LIT8( KZoomLarge8, "large_zoom" ); +_LIT8( KZoomNormal8, "normal_zoom" ); +_LIT8( KZoomSmall8, "small_zoom" ); + +_LIT8( KEmpty8, "empty" ); +_LIT8( KOrientation8, "orientation" ); +_LIT8( KBase8, "base" ); +_LIT8( KText8, "text" ); +_LIT8( KLayout8, "layout" ); +_LIT8( KVariety8, "variety" ); +_LIT8( KHAlign8, "halign" ); +_LIT8( KCenter8, "center" ); +_LIT8( KLeft8, "left" ); +_LIT8( KRight8, "right" ); +_LIT8( KHeight8, "height" ); +_LIT8( KWidth8, "width" ); +_LIT8( KTextVisual8, "textvisual" ); +_LIT8( KImageVisual8, "imagevisual" ); +_LIT8( KImagePath8, "imagepath" ); +_LIT8( KGridLayout8, "gridlayout" ); +_LIT8( KVarietyZoom8, "variety_zoom" ); +_LIT8( KEnabled8, "enabled" ); +_LIT8( KRow8, "row" ); +_LIT8( KCol8, "col" ); +_LIT8( KPositionX8, "positionx" ); +_LIT8( KPositionY8, "positiony" ); +_LIT8( KStyle8, "style" ); +_LIT8( KTargetValue8, "targetvalue" ); +_LIT8( KQfnPrimarySmall8, "qfn_primarysmall" ); +_LIT8( KHorizontalAlign8, "horizontalalign" ); +_LIT8( KLct8, "lct"); +_LIT8( KHighlight8, "highlight" ); +_LIT8( KNoHighlight8, "nohighlight" ); +_LIT8( KLandscape8, "landscape" ); + +_LIT8( KMmMoveIndicatorFrame8, "mul_move_indicator_frame" ); +_LIT8( KMmMoveIndicatorArrowTop8, "mul_move_indicator_arrow_top" ); +_LIT8( KMmMoveIndicatorArrowBottom8, "mul_move_indicator_arrow_bottom" ); +_LIT8( KMmMoveIndicatorArrowLeft8, "mul_move_indicator_arrow_left" ); +_LIT8( KMmMoveIndicatorArrowRight8, "mul_move_indicator_arrow_right" ); +_LIT8( KMI8, "MI" ); + +_LIT( KTab, "\t" ); +_LIT( KAkn, "akn" ); +_LIT( KUnderline, "_" ); +_LIT( KLct, "lct" ); +_LIT( KCustom, "custom" ); + +_LIT( KZResource, "z:\\resource\\" ); + +_LIT( KFormat1, "\t%S\t%S\t" ); +_LIT( KFormat2, "%d\t%S\t%S\t" ); + + +_LIT( KMLID, "MLID" ); +_LIT8( KListSingleLargeGraphicPane8, "list_single_large_graphic_pane" ); +_LIT8( KUiaccelAalistDoubleGraphicPane8, "uiaccel_aalist_double_graphic_pane" ); +_LIT8( KUiaccelAalistDoublePane8, "uiaccel_aalist_double_pane" ); +_LIT8( KUiaccelAalistSinglePane8, "uiaccel_aalist_single_pane" ); +_LIT8( KUiaccelAalistGeneAdPane8, "uiaccel_aalist_gene_ad_pane" ); +_LIT8( KUiaccelAalistSinglePaneT18, "uiaccel_aalist_single_pane_t1" ); +_LIT8( KUiaccelAalistDoubleGraphicPaneT18, "uiaccel_aalist_double_graphic_pane_t1" ); +_LIT8( KUiaccelAalistDoubleGraphicPaneT28, "uiaccel_aalist_double_graphic_pane_t2" ); +_LIT8( KUiaccelAalistDoublePaneT18, "uiaccel_aalist_double_pane_t1" ); +_LIT8( KUiaccelAalistDoublePaneT28, "uiaccel_aalist_double_pane_t2" ); +_LIT8( KlistSingleLargeGraphicPaneT18, "list_single_large_graphic_pane_t1" ); +_LIT8( KUiaccelAalistSinglePaneG18, "uiaccel_aalist_single_pane_g1" ); +_LIT8( KUiaccelAalistSinglePaneG28, "uiaccel_aalist_single_pane_g2" ); +_LIT8( KUiaccelAalistDoubleGraphicPaneG1, "uiaccel_aalist_double_graphic_pane_g1" ); +_LIT8( KUiaccelAalistDoubleGraphicPaneG28, "uiaccel_aalist_double_graphic_pane_g2" ); +_LIT8( KUiaccelAalistDoubleGraphicPaneG38, "uiaccel_aalist_double_graphic_pane_g3" ); +_LIT8( KUiaccelAalistDoubleGraphicPaneG68, "uiaccel_aalist_double_graphic_pane_g6" ); +_LIT8( KUiaccelAalistDoubleGraphicPaneG78, "uiaccel_aalist_double_graphic_pane_g7" ); +_LIT8( KUiaccelAalistDoublePaneG18, "uiaccel_aalist_double_pane_g1" ); +_LIT8( KUiaccelAalistDoublePaneG28, "uiaccel_aalist_double_pane_g2" ); +_LIT8( KlistSingleLargeGraphicPane8, "list_single_large_graphic_pane" ); +_LIT8( KlistSingleLargeGraphicPaneG18, "list_single_large_graphic_pane_g1" ); +_LIT8( KlistSingleLargeGraphicPaneG2Cp28, "list_single_large_graphic_pane_g2_cp2" ); +_LIT8( KlistSingleLargeGraphicPaneG4Cp28, "list_single_large_graphic_pane_g4_cp2" ); +_LIT8( KUiaccelAalistGeneAdPaneG18, "uiaccel_aalist_gene_ad_pane_g1" ); + +_LIT8( KUiaccelAagridCellImagePane8, "uiaccel_aagrid_cell_image_pane" ); +_LIT8( KUiaccelAagridCellImagePaneT18, "uiaccel_aagrid_cell_image_pane_t1" ); +_LIT8( KUiaccelAagridCellImagePaneG18, "uiaccel_aagrid_cell_image_pane_g1" ); +_LIT8( KUiaccelAagridCellImagePaneG28, "uiaccel_aagrid_cell_image_pane_g2" ); +_LIT8( KUiaccelAagridCellImagePaneG38, "uiaccel_aagrid_cell_image_pane_g3" ); +_LIT8( KUiaccelAagridCellImagePaneG48, "uiaccel_aagrid_cell_image_pane_g4" ); + +_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( 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( KListSingleHcAppsPaneT18, "list_single_hc_apps_pane_t1" ); +_LIT8( KListSingleHcAppsPaneG18, "list_single_hc_apps_pane_g1" ); +_LIT8( KListSingleHcAppsPaneG28, "list_single_hc_apps_pane_g2" ); +/** + * Defines the type of a widget. + */ +enum TMmWidgetType + { + EWidgetTypeNone = 0, + EGrid, + EListbox, + ECoverflow + }; + +enum TImageVisualId + { + EImageVisualIdNormalMode = 0x00000000, + EImageVisualIdSwapMode = 0x00000001, + EImageVisualIdEditMode = 0x00000002 + }; + +/** + * Defines the type of a template. + */ +enum TMmTemplateType + { + ETemplateTypeCustom = 0, + ETemplateTypeLCT + }; + +/** + * Defines the type of a floating item. + */ +enum TMmFloatingItemType + { + EDrag, + EPostDragRefreshItem, + EPostHighlightChangeRefreshItem, + ESwapTransition, + EDragTransition, + EZoomTransition + }; + +const TInt KDelayInSeconds1 = 1000000; +const TInt KDelayInSeconds6 = 6000000; +const TInt KDelayInfinite = -1; + +enum TManualAlign + { + EManualAlignUndefined, + EManualAlignLeft, + EManualAlignCenter, + EManualAlignRight + }; + +#endif // MMWIDGETSCONSTANTS_H diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/rom/mmwidgets.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/rom/mmwidgets.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image description file for project matrixmenu +* +*/ + + +#ifndef MATRIXWIDGETS_IBY +#define MATRIXWIDGETS_IBY + +#include <data_caging_paths_for_iby.hrh> + +file=ABI_DIR\BUILD_DIR\mmwidgets.dll SHARED_LIB_DIR\mmwidgets.dll + +data=\epoc32\data\z\resource\list\custom\akn_single_large_graphic_pane.xml resource\list\custom\akn_single_large_graphic_pane.xml +data=\epoc32\data\z\resource\list\custom\akn_logical_template_1.xml resource\list\custom\akn_logical_template_1.xml +data=\epoc32\data\z\resource\list\custom\akn_logical_template_2.xml resource\list\custom\akn_logical_template_2.xml +data=\epoc32\data\z\resource\list\custom\akn_logical_template_3.xml resource\list\custom\akn_logical_template_3.xml +data=\epoc32\data\z\resource\list\custom\akn_logical_template_4.xml resource\list\custom\akn_logical_template_4.xml +data=\epoc32\data\z\resource\list\custom\akn_logical_template_5.xml resource\list\custom\akn_logical_template_5.xml +data=\epoc32\data\z\resource\list\custom\akn_logical_template_6.xml resource\list\custom\akn_logical_template_6.xml +data=\epoc32\data\z\resource\list\custom\akn_logical_template_7.xml resource\list\custom\akn_logical_template_7.xml +data=\epoc32\data\z\resource\list\custom\akn_logical_template_8.xml resource\list\custom\akn_logical_template_8.xml +data=\epoc32\data\z\resource\list\custom\akn_logical_template_10.xml resource\list\custom\akn_logical_template_10.xml +data=\epoc32\data\z\resource\list\custom\akn_logical_template_11.xml resource\list\custom\akn_logical_template_11.xml +data=\epoc32\data\z\resource\list\custom\akn_logical_template_12.xml resource\list\custom\akn_logical_template_12.xml +data=\epoc32\data\z\resource\list\custom\akn_logical_template_13.xml resource\list\custom\akn_logical_template_13.xml + + +data=\epoc32\data\z\resource\grid\custom\akn_single_large_graphic_pane.xml resource\grid\custom\akn_single_large_graphic_pane.xml +data=\epoc32\data\z\resource\grid\custom\akn_logical_template_1.xml resource\grid\custom\akn_logical_template_1.xml +data=\epoc32\data\z\resource\grid\custom\akn_logical_template_2.xml resource\grid\custom\akn_logical_template_2.xml +data=\epoc32\data\z\resource\grid\custom\akn_logical_template_3.xml resource\grid\custom\akn_logical_template_3.xml +data=\epoc32\data\z\resource\grid\custom\akn_logical_template_4.xml resource\grid\custom\akn_logical_template_4.xml + + +//lct exports + +data=\epoc32\data\z\resource\list\lct\akn_list_single_hc_apps_pane.xml resource\list\lct\akn_list_single_hc_apps_pane.xml +data=\epoc32\data\z\resource\list\lct\akn_single_large_graphic_pane.xml resource\list\lct\akn_single_large_graphic_pane.xml +data=\epoc32\data\z\resource\list\lct\akn_logical_template_1.xml resource\list\lct\akn_logical_template_1.xml +data=\epoc32\data\z\resource\list\lct\akn_logical_template_2.xml resource\list\lct\akn_logical_template_2.xml +data=\epoc32\data\z\resource\list\lct\akn_logical_template_3.xml resource\list\lct\akn_logical_template_3.xml +data=\epoc32\data\z\resource\list\lct\akn_logical_template_4.xml resource\list\lct\akn_logical_template_4.xml +data=\epoc32\data\z\resource\list\lct\akn_logical_template_5.xml resource\list\lct\akn_logical_template_5.xml +data=\epoc32\data\z\resource\list\lct\akn_logical_template_6.xml resource\list\lct\akn_logical_template_6.xml +data=\epoc32\data\z\resource\list\lct\akn_logical_template_6a.xml resource\list\lct\akn_logical_template_6a.xml +data=\epoc32\data\z\resource\list\lct\akn_logical_template_7.xml resource\list\lct\akn_logical_template_7.xml +data=\epoc32\data\z\resource\list\lct\akn_logical_template_8.xml resource\list\lct\akn_logical_template_8.xml +data=\epoc32\data\z\resource\list\lct\akn_logical_template_12.xml resource\list\lct\akn_logical_template_12.xml + +data=\epoc32\data\z\resource\grid\lct\akn_logical_template_3.xml resource\grid\lct\akn_logical_template_3.xml + +#endif // MATRIXWIDGETS_IBY diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmcacheforitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmcacheforitem.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,164 @@ +/* +* 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 : 2 << Don't touch! Updated by Synergy at check-out. +* +*/ + +#include "mmcacheforitem.h" +#include "mmitemsdatacache.h" +#include "hniconholder.h" + +const TInt KIconHolderListGranularity = 2; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmCacheForItem* CMmCacheForItem::NewLC( CMmItemsDataCache& aParent ) + { + CMmCacheForItem* self = new (ELeave) CMmCacheForItem( aParent ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmCacheForItem* CMmCacheForItem::NewL( CMmItemsDataCache& aParent ) + { + CMmCacheForItem* self = NewLC( aParent ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmCacheForItem::~CMmCacheForItem() + { + ClearIconArray(); + iIconHolderList.Close(); + iItemText.Close(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TDesC8& CMmCacheForItem::GetTemplate() const + { + __ASSERT_DEBUG( iIsValid, User::Invariant() ); + return iParent.GetTemplateNameByIdentifier( iTemplateIdentifier ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmCacheForItem::SetTemplateL( const TDesC8& aItemTemplate ) + { + iTemplateIdentifier = iParent.GetTemplateIdentifierL( aItemTemplate ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CArrayPtr<CGulIcon>* CMmCacheForItem::GetIconListL() + { + __ASSERT_DEBUG( iIsValid, User::Invariant() ); + + const TInt iconCount = iIconHolderList.Count(); + CArrayPtr<CGulIcon>* iconList = new (ELeave) CArrayPtrFlat<CGulIcon>( + Max( iconCount, 1 ) ); + CleanupStack::PushL( iconList ); + + for ( TInt i = 0; i < iconCount; ++i ) + { + iconList->AppendL( iIconHolderList[i]->GetGulIcon() ); + } + + CleanupStack::Pop( iconList ); + return iconList; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmCacheForItem::AppendIconL( CHnIconHolder* aIconHolder ) + { + ASSERT( aIconHolder ); + iIconHolderList.AppendL( aIconHolder ); + TInt itemIndex = iIconHolderList.Count() - 1; + TInt err = aIconHolder->Open(); + if ( err != KErrNone ) + { + iIconHolderList.Remove( itemIndex ); + User::Leave( err ); + } + return itemIndex; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmCacheForItem::ClearIconArray() + { + const TInt count = iIconHolderList.Count(); + for (TInt i = 0; i < count; ++i ) + { + iIconHolderList[i]->Close(); + } + if ( count ) + { + iIconHolderList.Reset(); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmCacheForItem::InvalidateIfCacheMayNotBeUsed( TBool aIsItemCurrent, + TMmSubcellsSetupCode aSubcellsSetupCode ) + { + if ( iSubcellsSetupCode != aSubcellsSetupCode || + (!!iIsCurrent) != (!!aIsItemCurrent) ) + { + iIsValid = EFalse; + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmCacheForItem::CMmCacheForItem( CMmItemsDataCache& aParent ) + : iIconHolderList( KIconHolderListGranularity ), iParent( aParent ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmCacheForItem::ConstructL() + { + } diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmdraweranimator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmdraweranimator.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,441 @@ +/* +* 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_40 % << Don't touch! Updated by Synergy at check-out. +* +*/ + +#include <AknUtils.h> + +#include "mmdraweranimator.h" +#include "mmlistboxitemdrawer.h" +#include "mmfloatingitem.h" +#include "mmwidgetcontainer.h" + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmDrawerAnimator::CMmDrawerAnimator(CMmListBoxItemDrawer& aDrawer) : + CActive( AknLayoutUtils::PenEnabled() ? + EPriorityRealTime : + EPriorityAbsoluteRealTime8 ), iDrawer(aDrawer), + iLastNotedHighlight( KErrNotFound ), iLastNotedTopItem( KErrNotFound ), + iLastNotedVerticalOffset( 0 ), + iUsualAnimationFramesCount( AknLayoutUtils::PenEnabled() ? + MmEffects::KUsualAnimationFramesCount : + MmEffects::KUsualAnimationFramesCountNonTouch ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmDrawerAnimator* CMmDrawerAnimator::NewLC(CMmListBoxItemDrawer& aDrawer) + { + CMmDrawerAnimator* self = new ( ELeave ) CMmDrawerAnimator(aDrawer); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmDrawerAnimator* CMmDrawerAnimator::NewL(CMmListBoxItemDrawer& aDrawer) + { + CMmDrawerAnimator* self = CMmDrawerAnimator::NewLC(aDrawer); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmDrawerAnimator::ConstructL() + { + User::LeaveIfError( iTimer.CreateLocal() ); // Initialize timer + CActiveScheduler::Add( this); // Add to scheduler + iPreparedForGarbage = EFalse; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmDrawerAnimator::~CMmDrawerAnimator() + { + Cancel(); // Cancel any request, if outstanding + iTimer.Close(); // Destroy the RTimer object + // Delete instance variables if any + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmDrawerAnimator::DoCancel() + { + iTimer.Cancel(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +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); + + 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 ) + { + TRect highlightedItemRect( + iDrawer.Widget()->View()->ItemPos( highlightedItemIndex ), + iDrawer.Widget()->View()->ItemSize( highlightedItemIndex ) ); + refreshRect.BoundingRect( highlightedItemRect ); + iLastNotedHighlight = highlightedItemIndex; + } + + iDrawer.Widget()->View()->SetDisableRedraw(EFalse); + + TInt currentVerticalOffset = static_cast<CMmWidgetContainer*>( + iDrawer.Widget()->Parent() )->VerticalItemOffset(); + + 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()->SetDisableRedraw(ETrue); + + iLastRedrawTime.HomeTime(); + + } + + if (iDrawer.GetFloatingItemCount() > 0) + { + Trigger(); + } + else + { + Cancel(); + iDrawer.Widget()->View()->SetDisableRedraw( EFalse ); + +#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() ); + } + } +#endif + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TRect CMmDrawerAnimator::AdjustRefreshRectToNonTouch( const TRect& aRefreshRect ) + { + TRect rect( aRefreshRect ); + if( !AknLayoutUtils::PenEnabled() ) + { + 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; + } + return rect; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmDrawerAnimator::Trigger() + { + 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() ); + } + } +#endif + + iDrawer.Widget()->View()->SetDisableRedraw(ETrue); + iTimer.After(iStatus, TTimeIntervalMicroSeconds32( + MmEffects::KAnimationFrameDelay ) ); + SetActive(); + } + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmDrawerAnimator::RunError(TInt aError) + { + return aError; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmDrawerAnimator::AnimateDragItemTransitionL( ) + { + if (KErrNotFound != iDrawer.GetFloatingItemIndex(EDrag)) + { + TMmFloatingItem floatingItem( + iDrawer.GetFloatingItemL(EDrag).GetDrawnItemIndex(), + iDrawer.GetFloatingItemL(EDrag).GetItemPosition(), + EDragTransition, iUsualAnimationFramesCount, + 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) ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmDrawerAnimator::IsReadyForNewAnimation() + { + if ( iPreparedForGarbage ) + { + return EFalse; + } + + for(int i=0; i< iDrawer.GetFloatingItemCount(); i++) + { + TMmFloatingItemType type + = iDrawer.GetFloatingItemAtIndex(i).GetFloatingItemType(); + if ( type != EDrag && type != EZoomTransition ) + { + return EFalse; + } + } + return ETrue; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmDrawerAnimator::CancelAnimationsL() + { + for(int i=0; i< iDrawer.GetFloatingItemCount(); i++) + { + 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 ), + ESwapTransition, iUsualAnimationFramesCount, + iDrawer.Widget()->View() ); + + for(int i=0; i< iDrawer.GetFloatingItemCount(); i++) + { + TMmFloatingItem& current = iDrawer.GetFloatingItemAtIndex(i); + + if (current.GetFloatingItemType() == EZoomTransition + && current.GetDrawnItemIndex() == aItemFrom ) + { + current.InvalidateFloatingItem(); + floatingItem.SetSizeStep( current.GetCurrentZoomRatio(), 1.0f ); + break; + } + } + + 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, + iDrawer.Widget()->View()->ItemPos( aItemIndex ), + EZoomTransition, iUsualAnimationFramesCount, + iDrawer.Widget()->View() ); + floatingItem.SetManualDelete( aZoomIn ); + floatingItem.SetSizeStep( + (aZoomIn) ? KNormalStateZoomRatio : KZoomStateZoomRatio, + (aZoomIn) ? KZoomStateZoomRatio : KNormalStateZoomRatio ); + + TInt animationFound = EFalse; + for(int i=0; i< iDrawer.GetFloatingItemCount(); i++) + { + TMmFloatingItem& current = iDrawer.GetFloatingItemAtIndex(i); + if (current.GetFloatingItemType() == EZoomTransition && + current.GetDrawnItemIndex() == aItemIndex ) + { + current.InvalidateFloatingItem(); + floatingItem.SetSizeStep( current.GetCurrentZoomRatio(), + (aZoomIn) ? KZoomStateZoomRatio : KNormalStateZoomRatio); + animationFound = ETrue; + break; + } + } + + 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 + // neglected. + iDrawer.AddFloatingItemL( floatingItem ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmDrawerAnimator::SetNextRedrawToWholeScreen() + { + iPreviousRefreshRect = iDrawer.Widget()->View()->ViewRect(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmDrawerAnimator::PrepareForGarbage() + { +// Cancel any outstanding requests + Cancel(); + iPreparedForGarbage = ETrue; + } +//End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmfloatingitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmfloatingitem.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,197 @@ +/* +* 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: floating item +* +*/ + +#include <e32math.h> +#include <eiklbv.h> +#include "mmfloatingitem.h" + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TMmFloatingItem::TMmFloatingItem( TInt aDrawnIndex, TPoint aStartPosition, + TMmFloatingItemType aType, TInt aAnimationFrames, CListBoxView* aView ) + { + iView = aView; + iSizeStep = 0; + iZoomRatio = 1; + iManualDelete = EFalse; + + if ( iView ) + { + // item position is relative + iItemPosition = aStartPosition - iView->ItemPos( 0 ); + } + else + { + // item position is absolute + iItemPosition = aStartPosition; + } + + iDrawnItemIndex = aDrawnIndex; + iType = aType; + iFrames = aAnimationFrames; + iFrameCounter = 0; + CalculateSteps(TPoint(0,0)); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMmFloatingItem::SetPositionStep( TPoint aDiffetenceVector ) + { + ASSERT( iFrames ); + iFrameCounter = 0; + CalculateSteps( aDiffetenceVector ); + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMmFloatingItem::CalculateSteps(TPoint aVector) + { + iPositionStep.Reset(); + + TReal x = aVector.iX; + TReal y = aVector.iY; + + TReal sx = 0.0; + TReal sy = 0.0; + + for( TInt i = 0; i < iFrames; i++ ) + { + TReal sin; + Math::Sin( sin, (i+1) * KPi/iFrames + KPi * 3./2. ); + TReal xx = x * (0.5*( sin + 1.0 ) ) - sx; + TReal yy = y * (0.5*( sin + 1.0 ) ) - sy; + + sx += xx; + sy += yy; + + iPositionStep.At(i) = TPoint( xx, yy ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMmFloatingItem::SetSizeStep( TReal aStartSize, TReal aFinalSize ) + { + ASSERT( iFrames ); + iFrameCounter = 0; + iZoomRatio = aStartSize; + iSizeStep = (aFinalSize - aStartSize) / iFrames; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool TMmFloatingItem::MakeStep() + { + TBool ret(EFalse); + + if(iFrameCounter >= iFrames && iManualDelete == EFalse) + { + InvalidateFloatingItem(); + } + else if (iFrameCounter < iFrames) + { + iItemPosition += iPositionStep[iFrameCounter]; + iZoomRatio += iSizeStep; + ret = Abs(iPositionStep[iFrameCounter].iX) > 0 + || Abs(iPositionStep[iFrameCounter].iY > 0) + || Abs(iSizeStep) > 0; + iFrameCounter++; + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMmFloatingItem::SetManualDelete(TBool aManual) + { + iManualDelete = aManual; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TReal TMmFloatingItem::GetCurrentZoomRatio() const + { + return iZoomRatio; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TMmFloatingItemType TMmFloatingItem::GetFloatingItemType() const + { + return iType; + } + +TInt TMmFloatingItem::GetDrawnItemIndex() const + { + return iDrawnItemIndex; + } + +TPoint TMmFloatingItem::GetItemPosition() const + { + TPoint ret; + if ( iView ) + { + // item position is relative + ret = iItemPosition + iView->ItemPos( 0 ); + } + else + { + // item position is absolute + ret = iItemPosition; + } + return ret; + } + +void TMmFloatingItem::InvalidateFloatingItem() + { + iDrawnItemIndex = KErrNotFound; + } + +TBool TMmFloatingItem::IsFloatingItemValid() const + { + return GetDrawnItemIndex() != KErrNotFound + && iType != EPostDragRefreshItem + && iType != EPostHighlightChangeRefreshItem; + } + +TBool TMmFloatingItem::IsManualDelete() + { + return iManualDelete; + } + +TInt TMmFloatingItem::GetZoomingStatus() + { + return iSizeStep; + } +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmgrid.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmgrid.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1010 @@ +/* +* 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_92 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#include <AknsDrawUtils.h> +#include <layoutmetadata.cdl.h> +#include "mmgrid.h" +#include "mmgridmodel.h" +#include "mmlistboxitemdrawer.h" +#include "mmgridview.h" +#include "mmtemplatelibrary.h" +#include "mmlistboxmodel.h" +#include "mmmarqueeadapter.h" +#include "mmwidgetsconstants.h" +#include "mmwidgetcontainer.h" +#include "hnsuitemodel.h" +#include "mmdraweranimator.h" + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST +#include <aknlistloadertfx.h> +#include <aknlistboxtfxinternal.h> +#endif + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmGrid::CMmGrid() + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmGrid::~CMmGrid() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmGrid* CMmGrid::NewLC( const CCoeControl* aParent, TInt aFlags, + CMmTemplateLibrary* aTemplateLibrary) + { + CMmGrid* self = new (ELeave)CMmGrid(); + CleanupStack::PushL(self); + self->ConstructL( aParent, aFlags, aTemplateLibrary ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmGrid* CMmGrid::NewL( const CCoeControl* aParent, TInt aFlags, + CMmTemplateLibrary* aTemplateLibrary ) + { + CMmGrid* self = CMmGrid::NewLC( aParent, aFlags, aTemplateLibrary ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// If a parent to the supplied control has its Gc set, this function will find +// it and return it. (Copied from EIKLBX.CPP, needed by CMmGrid::Draw) +// ----------------------------------------------------------------------------- +// +LOCAL_C CWindowGc* ReplaceGcWithCustomGc( const CEikListBox* aListBox ) + { + const CCoeControl* parent = aListBox; + CWindowGc* customGc; + while(parent) + { + customGc = parent->GetGc(); + if ( customGc ) + { + CListItemDrawer* itemDrawer = aListBox->View()->ItemDrawer(); + CWindowGc* originalGc = itemDrawer->Gc(); + if ( customGc == originalGc ) + { + return NULL; + } + else + { + itemDrawer->SetGc( customGc ); + return originalGc; + } + } + parent = parent->Parent(); + } + return NULL; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::Draw(const TRect& aRect) const + { + if ( View()->RedrawDisabled () || !IsVisible () ) + { + return; + } + iMmDrawer->SetNumberOfColsInView( + static_cast<CMmGridView*>(iView)->NumberOfColsInView() ); + + // If a parent has a custom gc, draw listbox using that gc + CWindowGc* replacedGc = ReplaceGcWithCustomGc( this ); + + CWindowGc* gc = iItemDrawer->Gc(); + TGulBorder::TColors borderColors; + iBorder.Draw(*gc, Rect(), borderColors); + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( + static_cast<CMmGridView*>(iView)->Gc() ); + TBool effects = transApi && !transApi->EffectsDisabled(); + if ( effects ) + { + // ViewRect might have been moved to the right to prevent grid items + // from overlapping the scrollbar in mirrored layout. + // However, we still have to draw scrollbar background, thus the + // rectangle object passed to MAknListBoxTfxInternal::BeginRedraw must + // be placed at (0, 0) so that it covers the area where scrollbar is + // drawn. + TRect r( View()->ViewRect().Size() ); + transApi->BeginRedraw( MAknListBoxTfxInternal::EListView, r ); + transApi->StartDrawing( MAknListBoxTfxInternal::EListView ); + } +#endif // RD_UI_TRANSITION_EFFECTS_LIST + + ClearMargins(); + RedrawScrollbarBackground(); + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( effects ) + { + transApi->StopDrawing(); + } +#endif // RD_UI_TRANSITION_EFFECTS_LIST + iView->Draw(&aRect); + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( effects ) + { + transApi->EndViewRedraw( aRect ); + } +#endif // RD_UI_TRANSITION_EFFECTS_LIST + + if ( replacedGc ) + { + // Stop using the custom gc + iItemDrawer->SetGc( replacedGc ); + } + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::DrawView() + { + iDisableChildComponentDrawing = ETrue; + DrawNow(Rect()); + iDisableChildComponentDrawing = EFalse; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::CreateItemDrawerL() + { + iItemDrawer = iMmDrawer; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::CreateItemDrawerL( CMmTemplateLibrary* aTemplateLibrary ) + { + CFormattedCellListBoxData* data=CFormattedCellGridData::NewL(); + CleanupStack::PushL(data); + + iMmDrawer = CMmListBoxItemDrawer::NewL( + MmModel()->MmListBoxModel(), iEikonEnv->NormalFont(), data, EGrid, + aTemplateLibrary ); + iItemDrawer = iMmDrawer; + data->SetControl( this ); + CleanupStack::Pop( data ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::HandleScrollEventL( CEikScrollBar* aScrollBar, + TEikScrollEvent aEventType ) + { + CAknGrid::HandleScrollEventL(aScrollBar, aEventType); + iCurrentTopItemIndex = TopItemIndex(); + + // setting default highligh in order not to overwrite the top item index + // set before in the SetLayout method + CMmWidgetContainer* parent = static_cast< CMmWidgetContainer* > ( Parent() ); + if (!parent->IsHighlightVisible()) + { + parent->SetDefaultHighlightL( EFalse ); + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( + static_cast<CMmGridView*>(iView)->Gc() ); + TBool effects = transApi && !transApi->EffectsDisabled(); + if ( effects && aEventType == EEikScrollPageUp || + aEventType == EEikScrollPageDown ) + { + DrawNow(); + } +#endif + + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::HandlePointerEventInEditModeL( const TPointerEvent& aPointerEvent ) + { + TInt itemUnderPointerIndex = KErrNotFound; + + if ( aPointerEvent.iType == TPointerEvent::EButton1Up || + aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + CAknGrid::HandlePointerEventL( aPointerEvent ); + } + else if ( View()->XYPosToItemIndex( + aPointerEvent.iPosition, itemUnderPointerIndex ) ) + { + if ( CurrentItemIndex() != itemUnderPointerIndex ) + { + CMmWidgetContainer* parent = static_cast<CMmWidgetContainer*>( Parent() ); + if ( parent->IsNoItemDragged() ) + { + if ( ItemDrawer()->Flags() & CListItemDrawer::EPressedDownState ) + { + ItemDrawer()->ClearFlags( CListItemDrawer::EPressedDownState ); + iView->DrawItem( CurrentItemIndex() ); + } + } + else + { + iView->SetCurrentItemIndex( itemUnderPointerIndex ); + iView->DrawItem(itemUnderPointerIndex); + } + } + } + + HandleScrollingInEditMode( aPointerEvent ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::HandlePointerEventInNormalModeL( const TPointerEvent& aPointerEvent ) + { + CMmWidgetContainer* parent = static_cast<CMmWidgetContainer*>( Parent() ); + if ( aPointerEvent.iType == TPointerEvent::EButton1Down && !parent->FlipOpen() ) + { + 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<CMmWidgetContainer*>( 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 ); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::HandleScrollingInEditMode( const TPointerEvent& aPointerEvent ) + { + if ( aPointerEvent.iType == TPointerEvent::EDrag + || aPointerEvent.iType == TPointerEvent::EButtonRepeat ) + { + TInt nextScrollDelay = ScrollIfNeeded( aPointerEvent ); + if ( nextScrollDelay ) + { + TRect ignoreDragRect( + TPoint(aPointerEvent.iParentPosition.iX - MmEffects::KDragIgnoreRectValue, + aPointerEvent.iParentPosition.iY - MmEffects::KDragIgnoreRectValue), + TPoint(aPointerEvent.iParentPosition.iX + MmEffects::KDragIgnoreRectValue, + aPointerEvent.iParentPosition.iY + MmEffects::KDragIgnoreRectValue)); + + Window().CancelPointerRepeatEventRequest(); + Window().RequestPointerRepeatEvent( nextScrollDelay, ignoreDragRect ); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmGrid::IsPointerInTopScrollingThreshold( + const TPointerEvent& aPointerEvent ) const + { + TInt topScrollingTreshold = Rect().iTl.iY + + ( MmEffects::KFocusScrollingThreshold + * TReal( View()->ItemSize().iHeight ) ); + + return ( aPointerEvent.iPosition.iY < topScrollingTreshold ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmGrid::IsPointerInBottomScrollingThreshold( + const TPointerEvent& aPointerEvent ) const + { + TInt bottomScrollingTreshold = Rect().iBr.iY + - ( MmEffects::KFocusScrollingThreshold + * TReal( View()->ItemSize().iHeight ) ); + + return ( aPointerEvent.iPosition.iY > bottomScrollingTreshold ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmGrid::ScrollIfNeeded( const TPointerEvent& aPointerEvent ) + { + CAknGridView* view = static_cast<CAknGridView*>( View() ); + TInt nextScrollDelay = 0; + + TBool readyForScrolling = iMmDrawer->GetAnimator()->IsReadyForNewAnimation() + && iMmDrawer->GetFloatingItemCount() != 0; + + if ( IsPointerInTopScrollingThreshold( aPointerEvent ) ) + { + // scroll up by one row + TInt newCurrentItemIndex = CurrentItemIndex() - view->NumberOfColsInView(); + if ( newCurrentItemIndex < 0 ) + { + newCurrentItemIndex = CurrentItemIndex(); + } + + if ( !View()->ItemIsVisible( 0 ) ) + { + nextScrollDelay = MmEffects::KEditModeScrollingDelayFactor * + Max( 1, aPointerEvent.iPosition.iY - Rect().iTl.iY ); + + if ( readyForScrolling ) + { + TRAP_IGNORE( HandlePhysicsScrollEventL( -iItemHeight ) ); + View()->SetCurrentItemIndex( newCurrentItemIndex ); + } + } + else + { + if ( readyForScrolling ) + { + TBool redrawDisabledBefore = View()->RedrawDisabled(); + View()->SetDisableRedraw( EFalse ); + CMmWidgetContainer* parent = static_cast<CMmWidgetContainer*>( Parent() ); + parent->ResetWidgetPosition(); + DrawNow(); + View()->SetDisableRedraw( redrawDisabledBefore ); + } + } + } + else if ( IsPointerInBottomScrollingThreshold( aPointerEvent) ) + { + // scroll down by one row + TInt lastItemIndex = iModel->NumberOfItems() - 1; + + // maximum top item index that can be set (greater top item index value would + // cause an empty row at the bottom of the menu) + TInt maxTopItemIndex = View()->CalcNewTopItemIndexSoItemIsVisible( lastItemIndex ); + TInt currentItemIndex = CurrentItemIndex(); + TInt newCurrentItemIndex = currentItemIndex + view->NumberOfColsInView(); + TInt distanceToScroll( iItemHeight ); + if ( View()->ItemIsVisible( lastItemIndex ) ) + { + TPoint lastItemPos( View()->ItemPos( lastItemIndex ) ); + distanceToScroll = iItemHeight - ( Rect().iBr.iY - lastItemPos.iY ) + + Rect().Height() - iViewLayout.iHeight * iItemHeight; + } + + if ( newCurrentItemIndex <= lastItemIndex ) + { + nextScrollDelay = MmEffects::KEditModeScrollingDelayFactor * + Max( 1, Rect().iBr.iY - aPointerEvent.iPosition.iY ); + + if ( readyForScrolling ) + { + TRAP_IGNORE( HandlePhysicsScrollEventL( distanceToScroll ) ); + View()->SetCurrentItemIndex( newCurrentItemIndex ); + } + } + else if ( TopItemIndex() < maxTopItemIndex ) + { + if ( readyForScrolling ) + { + TRAP_IGNORE( HandlePhysicsScrollEventL( distanceToScroll ) ); + View()->SetCurrentItemIndex( currentItemIndex ); + } + } + } + + return nextScrollDelay; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::HandlePointerEventL(const TPointerEvent& aPointerEvent) + { +// if ( aPointerEvent.iType == TPointerEvent::EButton1Down && +// iMmDrawer->CachedDataUseIsEnabled() ) +// { +// // Touching the screen stops flick but avkon does not send us +// // MEikListBoxObserver::EEventFlickStopped event in such case. +// // Thus this little hack: +// iMmDrawer->EnableCachedDataUse( EFalse ); +// DrawView(); +// } + + CMmWidgetContainer* parent = static_cast<CMmWidgetContainer*>( Parent() ); + if ( parent->IsEditMode() ) + { + HandlePointerEventInEditModeL( aPointerEvent ); + } + else + { + HandlePointerEventInNormalModeL( aPointerEvent ); + } + + if ( iMmDrawer->GetFloatingItemCount() > 0 && + iMmDrawer->GetAnimator()->IsActive() ) + { + iMmDrawer->GetAnimator()->CancelNextRedrawL(); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::HandleOverridenHighlightDrawing( const TPointerEvent& aPointerEvent, + TInt aIndexBefore, TInt aIndexAfter ) + { + // In grid our behaviour is a little different than defalt avkon. + // It is required to clean the highlight after the finger has been raised, + // and simulate the tap effect, when an item that has an invisible + // highlight is tapped again. + TBool effects (EFalse); +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( + iMmDrawer->Gc() ); + effects = transApi && !transApi->EffectsDisabled(); +#endif + if (effects) + { + CMmWidgetContainer* parent = static_cast< CMmWidgetContainer* > ( Parent() ); + if ( aIndexBefore == aIndexAfter + && !parent->IsEditMode() + && aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + DrawItem( aIndexAfter ); + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( + iMmDrawer->Gc() ); + if ( transApi ) + { + transApi->SetMoveType( MAknListBoxTfxInternal::EListTap); + transApi->Draw( Rect() ); + } +#endif + } + else if ( aIndexBefore == aIndexAfter + && aPointerEvent.iType == TPointerEvent::EButton1Up + && !parent->IsHighlightVisible()) + { +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( + iMmDrawer->Gc() ); + if ( transApi ) + { + transApi->Draw( Rect() ); + } +#endif + } + } + + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::FixViewForMirroredLayout() + { + TInt scrollbarWidth = ScrollBarOffset() + + ScrollBarFrame()->VerticalScrollBar()->Rect().Width(); + TRect r( View()->ViewRect() ); + TInt currentShift = r.iTl.iX; + TBool scrollbarVisible = ScrollBarFrame()->VerticalScrollBar()->IsVisible(); + TBool layoutMirrored = AknLayoutUtils::LayoutMirrored(); + + if ( layoutMirrored ) + { + // Extra width, which results from the fact that it is not always + // possible to divide screen width by the number of columns without + // a non-zero remainder. This makes the distance of grid items from + // scrollbar in mirrored layout exactly the same as in normal layout. + scrollbarWidth += ( r.Width() - scrollbarWidth ) % + ( (CAknGridView*) View() )->NumberOfColsInView(); + } + + if ( layoutMirrored && scrollbarVisible && currentShift != scrollbarWidth ) + { + // shift view rect to the right + r.Move( scrollbarWidth - currentShift, 0 ); + View()->SetViewRect( r ); + } + else if ( ( !layoutMirrored || !scrollbarVisible ) && currentShift != 0 ) + { + // restore view rect to its normal position + r.Move( -currentShift, 0 ); + View()->SetViewRect( r ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::ConstructL( const CCoeControl* aParent, TInt aFlags, + CMmTemplateLibrary* aTemplateLibrary ) + { + iDisableChildComponentDrawing = EFalse; + iModel = iMmModel = CMmGridModel::NewL(); + CreateItemDrawerL(aTemplateLibrary); + CAknGrid::ConstructL( aParent, aFlags ); + iMmDrawer->SetView( this ); + + //set initial value so avkon does not panic + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + iViewLayout = TSize( MmGrid::K4By3LayoutX, MmGrid::K4By3LayoutY ); + } + else + { + iViewLayout = TSize( MmGrid::K3By4LayoutX, MmGrid::K3By4LayoutY ); + } + + DoSetupLayoutL(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CListBoxView* CMmGrid::MakeViewClassInstanceL() + { + return CMmGridView::NewL(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmGridModel* CMmGrid::MmModel() + { + return iMmModel; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TKeyResponse CMmGrid::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) + { + TKeyEvent eventCopy( aKeyEvent ); + if ( AknLayoutUtils::LayoutMirrored() ) + { + if ( eventCopy.iCode == EKeyLeftArrow ) + { + eventCopy.iCode = EKeyRightArrow; + } + else if ( eventCopy.iCode == EKeyRightArrow ) + { + eventCopy.iCode = EKeyLeftArrow; + } + } + return CAknGrid::OfferKeyEventL( eventCopy, aType ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::HandleViewRectSizeChangeL() + { + if ( !AknLayoutUtils::LayoutMirrored() ) + { + CAknGrid::HandleViewRectSizeChangeL(); + } + else + { + // for mirrored layout this function should do + // exactly the same things as CAknGrid::HandleViewRectSizeChangeL + // would do for normal layout + iView->CalcBottomItemIndex(); + if ( CurrentItemIndex() >= 0 ) + { + AdjustTopItemIndex(); + iView->CalcDataWidth(); + UpdateScrollBarsL(); + iView->CalcBottomItemIndex(); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::AdjustTopItemIndex() const + { + CAknGridView* view = static_cast<CAknGridView*>( iView ); + const TInt numOfCols = view->NumberOfColsInView(); + const TInt numOfRows = view->NumberOfRowsInView(); + const TInt itemCount = iModel->NumberOfItems(); + + ASSERT( numOfCols > 0 ); + + TInt lastRow = 0; + if ( itemCount > 0 ) + { + lastRow = ( itemCount - 1 ) / numOfCols; + } + TInt maxPossibleTopRow = Max( 0, lastRow - numOfRows + 1 ); + + TInt topRow = TopItemIndex() / numOfCols; + + if ( !( TopItemIndex() % numOfCols == 0 && + topRow <= maxPossibleTopRow ) ) + { + topRow = Min( topRow, maxPossibleTopRow ); + SetTopItemIndex( topRow * numOfCols ); + } + + // prevent problems with view being scrolled up beyond limits + if ( topRow == maxPossibleTopRow && VerticalItemOffset() < 0 ) + { + TRAP_IGNORE( + ( ( CMmWidgetContainer* ) Parent() )->AlignBottomOfViewL() ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::DoHandleResourceChangeL( TSize& aCellSize, + TSize& aViewLayout ) + { + TBool cond = Layout_Meta_Data::IsLandscapeOrientation(); + TRAPD( err, DoHandleResourceChangeL( cond, aCellSize, aViewLayout ) ); + if ( err == KErrNotFound ) + { + aViewLayout = iViewLayout; + aCellSize = TSize (1,1); + } + else if ( err == KErrNoMemory ) + { + User::Leave( KErrNoMemory ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::DoHandleResourceChangeL( TBool aIsLandscape, TSize& aCellSize, + TSize& aViewLayout ) + { + CHnSuiteModel* model = iMmModel->MmListBoxModel()->GetSuiteModel(); + const TDesC8& templ = (model) ? model->GetTemplate() : KNullDesC8(); + aCellSize = iMmDrawer->TemplateLibrary()->GetSize( + EGrid, templ, aIsLandscape, EFalse, iView->ViewRect() ); + aViewLayout = iMmDrawer->TemplateLibrary()->GetLayoutSizeL( + EGrid, templ, aIsLandscape ); + iViewLayout = aViewLayout; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::SetItemDrawerAndViewBgContext( + CAknsBasicBackgroundControlContext * aBgContext ) + { + iMmDrawer->SetBgContext (aBgContext); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmGrid::HandleScrollbarVisibilityChangeL() + { + TBool ret = EFalse; + if ( AllItemsFitInViewRect() ) + { + if ( ScrollBarFrame()->VerticalScrollBar()->IsVisible() + || iMmDrawer->TemplateLibrary()->GetScrollbarVisibility() ) + { + ScrollBarFrame()->VerticalScrollBar()->MakeVisible( EFalse ); + iMmDrawer->SetScrollbarVisibilityL( EFalse ); + SetTopItemIndex( 0 ); + iCurrentTopItemIndex = 0; + ret = ETrue; + } + } + else if ( !ScrollBarFrame()->VerticalScrollBar()->IsVisible() + || !iMmDrawer->TemplateLibrary()->GetScrollbarVisibility() ) + { + ScrollBarFrame()->VerticalScrollBar()->MakeVisible( ETrue ); + iMmDrawer->SetScrollbarVisibilityL( ETrue ); + ret = ETrue; + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +TBool CMmGrid::AllItemsFitInViewRect() + { + if ( iMmModel->NumberOfItems() <= iViewLayout.iWidth * iViewLayout.iHeight + || iViewLayout == TSize(0,0) ) + { + return ETrue; + } + else + { + return EFalse; + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::UpdateScrollBarsL() + { + TBool redrawNeeded = HandleScrollbarVisibilityChangeL(); + if (ScrollBarFrame()->VerticalScrollBar()->IsVisible()) + { + CAknGrid::UpdateScrollBarsL(); + } + iCurrentTopItemIndex = TopItemIndex(); + iMmDrawer->TemplateLibrary()->SetScrollbarWidthL( + ScrollBarFrame()->VerticalScrollBar()->Rect().Width() + ScrollBarOffset() ); + FixViewForMirroredLayout(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::SetMarqueeAdapter( CMmMarqueeAdapter* aAdapter ) + { + iMarqueeAdapter = aAdapter; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::SetupLayout() + { + TRAP_IGNORE( DoSetupLayoutL() ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::DoSetupLayoutL() + { + TSize cellSize; + TSize viewLayout; + DoHandleResourceChangeL( cellSize, viewLayout ); +// The mirrored layout arabic item lineout ( right to left ) +// is handled by CMmGridView::ItemPos( TInt aItemIndex ) +// and CMmGridView::XYPosToItemIndex( TPoint aPosition, TInt& aItemIndex ) + SetLayoutL( EFalse, ETrue /*!AknLayoutUtils::LayoutMirrored()*/, ETrue, viewLayout.iWidth, + viewLayout.iHeight, cellSize, 0, 0 ); + iMmDrawer->SetNumberOfColsInView( + static_cast<CMmGridView*>(iView)->NumberOfColsInView() ); + // setting the top item index when changing orientation + TInt cols( static_cast<CMmGridView*>(iView)->NumberOfColsInView() ); + SetTopItemIndex( ( (TInt) ( iCurrentTopItemIndex / cols ) ) * cols ); + UpdateScrollBarsL(); + AknsUtils::RegisterControlPosition( iMmDrawer->FormattedCellData()->Control() ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmGrid::ScrollBarOffset() + { + TInt offset = 0; + if ( ScrollBarFrame()->ScrollBarExists( CEikScrollBar::EVertical ) ) + { + if ( AknLayoutUtils::LayoutMirrored() ) + { + offset = ScrollBarFrame()->VerticalScrollBar()->Position().iX; + } + else + { + offset = View()->ViewRect().Width() + - ( ScrollBarFrame()->VerticalScrollBar()->Position().iX + + ScrollBarFrame()->VerticalScrollBar()->Rect().Width() ); + } + } + return offset; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::RedrawScrollbarBackground() const + { + TRect viewRect( View()->ViewRect() ); + if ( viewRect.iTl.iX > 0 ) + { + TRect scrollbarRect( TPoint( 0, 0 ), + TSize( viewRect.iTl.iX, viewRect.Height() ) ); + + CWindowGc* gc = iItemDrawer->Gc(); + CMmListBoxItemDrawer* itemDrawer = + static_cast<CMmListBoxItemDrawer*>( iItemDrawer ); + MAknsSkinInstance *skin = AknsUtils::SkinInstance(); + CCoeControl* control = itemDrawer->FormattedCellData()->Control(); + MAknsControlContext *cc = AknsDrawUtils::ControlContext( control ); + if( gc ) + { + if ( control ) + { + AknsDrawUtils::Background( skin, cc, control, *gc, scrollbarRect ); + } + else + { + gc->SetBrushColor( BackColor() ); + gc->Clear( scrollbarRect ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::SetVerticalItemOffset(TInt aOffset) + { + static_cast<CMmGridView*> (View())->SetItemOffsetInPixels(aOffset); + UpdateScrollBarThumbs(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmGrid::VerticalItemOffset() const + { + return static_cast<CMmGridView*> (View())->VerticalItemOffset(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::SetItemHeight( TInt aItemHeight ) + { + iItemHeight = aItemHeight; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::UpdateScrollBarThumbs() + { + CAknGrid::UpdateScrollBarThumbs(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmGrid::CountComponentControls() const + { + TInt componentControls(0); + if ( !iDisableChildComponentDrawing ) + { + componentControls = CAknGrid::CountComponentControls(); + } + return componentControls; + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::SetDisableChildComponentDrawing( TBool aDisable ) + { + iDisableChildComponentDrawing = aDisable; + } +//End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmgridcontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmgridcontainer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,519 @@ +/* +* 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_72 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_72 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#include "mmgridcontainer.h" +#include "mmgridmodel.h" +#include "mmlistboxmodel.h" +#include "mmmarqueeadapter.h" +#include <AknsLayeredBackgroundControlContext.h> +#include <AknsListBoxBackgroundControlContext.h> +#include <layoutmetadata.cdl.h> +#include "mmhighlighttimer.h" +#include "hnsuitemodel.h" +#include "mmgrid.h" +#include "mmwidgetsconstants.h" +#include "hnglobals.h" +#include "mmpostevaluationprocessor.h" +#include "mmlistboxitemdrawer.h" +#include "mmdraweranimator.h" + +// ----------------------------------------------------------------------------- +// CMmGridContainer::NewLC() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMmGridContainer* CMmGridContainer::NewLC( const TRect& aRect, + MObjectProvider* aObjectProvider, CMmTemplateLibrary* aLibrary ) + { + CMmGridContainer* self = new( ELeave ) CMmGridContainer(); + CleanupStack::PushL( self ); + self->ConstructL( aRect, aObjectProvider, aLibrary ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMmGridContainer::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMmGridContainer* CMmGridContainer::NewL( const TRect& aRect, + MObjectProvider* aObjectProvider, CMmTemplateLibrary* aLibrary ) + { + CMmGridContainer* self = NewLC( aRect, aObjectProvider, aLibrary); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMmGridContainer::CMmGridContainer() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CMmGridContainer::CMmGridContainer() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CAknGrid* CMmGridContainer::Grid() + { + return iGrid; + } +// ----------------------------------------------------------------------------- +// CMmGridContainer::~CMmGridContainer() +// Destructor +// ----------------------------------------------------------------------------- +// +CMmGridContainer::~CMmGridContainer() + { + delete iGrid; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +THnSuiteWidgetType CMmGridContainer::WidgetType() + { + return EGridWidget; + } +// ----------------------------------------------------------------------------- +// CMmGridContainer::ConstructL() +// 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CMmGridContainer::ConstructL( const TRect& aRect, MObjectProvider* aObjectProvider, + CMmTemplateLibrary* aTemplateLibrary ) + { + CMmWidgetContainer::ConstructL(); + + SetMopParent( aObjectProvider ); + CreateWindowL(); // Creates window. + iWidget = CreateGridL(aTemplateLibrary); + iWidget->SetListBoxObserver( this ); + SetRect( aRect ); // Sets rectangle of frame. + ActivateL(); // Activates window. ( Ready to draw ) + SetupDrawer(); + SetHighlightVisibilityL( !AknLayoutUtils::PenEnabled() ); + iPostProcessor = CMmPostEvaluationProcessor::NewL( *iDrawer ); + } + +// ----------------------------------------------------------------------------- +// CMmGridContainer::CreateGridL() +// Constructs listbox from resource, creates scroll bar and sets empty +// list background text. +// ----------------------------------------------------------------------------- +// +CMmGrid* CMmGridContainer::CreateGridL( CMmTemplateLibrary* aTemplateLibrary ) + { + iGrid = CMmGrid::NewL( this, + EAknListBoxSelectionList | EAknListBoxLoopScrolling | EAknListBoxDisableHighlight , aTemplateLibrary ); + iGrid->SetContainerWindowL( *this ); + iGrid->CreateScrollBarFrameL( ETrue ); + iGrid->SetPrimaryScrollingType( + CAknGridView::EScrollFollowsItemsAndLoops ); + iGrid->SetSecondaryScrollingType( + CAknGridView::EScrollFollowsGrid ); + iGrid->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto ); + iGrid->ScrollBarFrame()->DrawBackground( EFalse, EFalse ); + return iGrid; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGridContainer::SizeChanged() + { + CMmWidgetContainer::SizeChanged(); + if ( iGrid ) + { +// iGrid->SetRect( Rect() ); + iGrid->SetupLayout(); + } + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGridContainer::SetEditModeL( TBool aIsEditMode ) + { + if (aIsEditMode && !AknLayoutUtils::PenEnabled() ) + { + iGrid->SetPrimaryScrollingType( + CAknGridView::EScrollStops ); + iGrid->SetSecondaryScrollingType( + CAknGridView::EScrollStops ); + } + else + { + iGrid->SetPrimaryScrollingType( + CAknGridView::EScrollFollowsItemsAndLoops ); + iGrid->SetSecondaryScrollingType( + CAknGridView::EScrollFollowsGrid ); + + } + + // In EditMode we allow Avkon to redraw scrollbar background + // to prevent scrollbar flicking. + // When edit mode is disabled, this redrawing causes performance problems + // (and disabling it does not produce erroneous side-effects). + if( aIsEditMode ) + { + iGrid->ScrollBarFrame()->DrawBackground( EFalse, ETrue ); + } + else + { + iGrid->ScrollBarFrame()->DrawBackground( EFalse, EFalse ); + } + + CMmWidgetContainer::SetEditModeL( aIsEditMode ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMmGridContainer::SetEmptyTextL(const TDesC& aText) + { + iGrid->SetEmptyGridTextL( aText ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMmGridContainer::SetDefaultHighlightL( TBool aRedraw ) + { + CAknGridView* view = (CAknGridView*) iGrid->View(); + + if ( view ) + { + TInt defaultHighlight( 0 ); + TSize layout = TSize( view->NumberOfColsInView(), + view->NumberOfRowsInView() ); + + if ( Layout_Meta_Data::IsLandscapeOrientation() || FlipOpen() ) + { + defaultHighlight = LandscapeOrientationDefaultHighlight( layout ); + } + else + { + defaultHighlight = PortraitOrientationDefaultHighlight( layout ); + } + + SetManualHighlightL( defaultHighlight + DefaultHighlightOffset(), aRedraw ); + } + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +TInt CMmGridContainer::LandscapeOrientationDefaultHighlight( TSize aLayout ) + { + TInt defaultHighlight( 0 ); + + if ( aLayout == TSize(MmGrid::K4By3LayoutX, MmGrid::K4By3LayoutY) + && iGrid->Model()->NumberOfItems() >= MmGrid::K4By3Threshold ) + { + defaultHighlight = MmGrid::K4By3DefaultHighlight; + } + else if ( aLayout == TSize(MmGrid::K5By4LayoutX, MmGrid::K5By4LayoutY) + && iGrid->Model()->NumberOfItems() >= MmGrid::K5By4Threshold ) + { + defaultHighlight = MmGrid::K5By4DefaultHighlight; + } + // When flip is opened, the phone layout is not changed immediately, + // so the phone might still be in portrait mode for a couple of secs. + // However, we have to set the correct default item immediately, and + // the correct item is the one for landscape mode, even if the phone + // is still in portrait mode. On variant switch 3x4 layout will be + // replaced by 4x3 layout, while 4x5 layout will change into 5x4. + else if ( aLayout == TSize( MmGrid::K3By4LayoutX, MmGrid::K3By4LayoutY ) + && iGrid->Model()->NumberOfItems() >= MmGrid::K4By3Threshold ) + { + defaultHighlight = MmGrid::K4By3DefaultHighlight; + } + else if ( aLayout == TSize( MmGrid::K4By5LayoutX, MmGrid::K4By5LayoutY ) + && iGrid->Model()->NumberOfItems() >= MmGrid::K5By4Threshold ) + { + defaultHighlight = MmGrid::K5By4DefaultHighlight; + } + + return defaultHighlight; + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +TInt CMmGridContainer::PortraitOrientationDefaultHighlight( TSize aLayout ) + { + TInt defaultHighlight( 0 ); + + if ( aLayout == TSize(MmGrid::K4By5LayoutX, MmGrid::K4By5LayoutY ) + && iGrid->Model()->NumberOfItems() >= MmGrid::K4By5Threshold ) + { + defaultHighlight = MmGrid::K4By5DefaultHighlight; + } + else if ( aLayout == TSize(MmGrid::K3By4LayoutX, MmGrid::K3By4LayoutY) + && iGrid->Model()->NumberOfItems() >= MmGrid::K3By4Threshold ) + { + defaultHighlight = MmGrid::K3By4DefaultHighlight; + } + + return defaultHighlight; + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +TInt CMmGridContainer::DefaultHighlightOffset() + { + TInt topVisibleItemIndex = iGrid->View()->TopItemIndex(); + TInt hiddenPixels = -iGrid->View()->ItemOffsetInPixels(); + + if ( iGrid->View()->ItemIsPartiallyVisible( topVisibleItemIndex ) + && hiddenPixels > iGrid->View()->ItemSize().iHeight / 2 ) + { + topVisibleItemIndex += ColumnsInCurrentView(); + } + + return topVisibleItemIndex; + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +CMmListBoxModel* CMmGridContainer::GetMmModel() + { + return iGrid->MmModel()->MmListBoxModel(); + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +void CMmGridContainer::SetItemDrawerAndViewBgContext( + CAknsBasicBackgroundControlContext * aBgContext ) + { + iGrid->SetItemDrawerAndViewBgContext (aBgContext); + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +void CMmGridContainer::SetupWidgetLayoutL() + { + User::LeaveIfNull( iGrid ); + iGrid->SetupLayout(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGridContainer::SetSuiteModelL( CHnSuiteModel* aModel ) + { + CMmWidgetContainer::SetSuiteModelL( aModel ); + if ( aModel ) + { + aModel->SetActiveL( !AknLayoutUtils::PenEnabled() ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGridContainer::SetHighlightVisibilityL( TBool aVisible ) + { + CMmWidgetContainer::SetHighlightVisibilityL( aVisible ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmGridContainer::HandleItemAdditionL() + { + iGrid->HandleItemAdditionL(); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmGridContainer::HandleItemRemovalL() + { + + GetMmModel()->HandleSuiteEventL( ESuiteItemsRemoved, GetMmModel()->GetSuiteModel() ); + ValidateWidgetCurrentItemIndex(); + iDrawer->RemoveFloatingItems(); + if( IsEditMode() ) + { + iDrawer->GetAnimator()->SetNextRedrawToWholeScreen(); + } + + CacheWidgetPosition(); + iGrid->HandleItemRemovalL(); + RestoreWidgetPosition(); + CacheWidgetPosition(); + + if ( iCurrentHighlight != iGrid->CurrentItemIndex() ) + { + iCurrentHighlight = iGrid->CurrentItemIndex(); + if( !iCurrentHighlight && !iGrid->Model()->NumberOfItems() ) + { + iCurrentHighlight = KErrNotFound ; + } + CHnSuiteModel* suiteModel = GetSuiteModelL(); + if ( suiteModel ) + { + suiteModel->SetSuiteHighlightL( iCurrentHighlight ); + } + } + static_cast<CMmListBoxItemDrawer*>( iGrid->ItemDrawer() )->TrimCacheSize( + GetMmModel()->NumberOfItems() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmGridContainer::FlipStateChangedL() + { +// if ( !IsEditMode() ) +// { +// if ( FlipOpen() ) +// { +// if ( iTimer ) +// { +// delete iTimer; +// iTimer = NULL; +// } +// SetHighlightVisibilityL( ETrue ); +// if ( iCurrentHighlight == KErrNotFound ) +// { +// SetDefaultHighlightL( ETrue ); +// } +// } +// else +// { +// if ( AknLayoutUtils::PenEnabled() && !iTimer ) +// { +// iTimer = CMmHighlightTimer::NewL( this ); +// } +// SetHighlightVisibilityL( EFalse ); +// DrawNow(); +// } +// } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmGridContainer::ColumnsInCurrentView() + { + CAknGridView* view ( (CAknGridView*) iGrid->View() ); + return view->NumberOfColsInView(); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmGridContainer::RowsInCurrentView() + { + CAknGridView* view ( (CAknGridView*) iGrid->View() ); + return view->NumberOfRowsInView(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmGridContainer::DrawView() + { + iGrid->DrawView(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGridContainer::SetVerticalItemOffset( TInt aOffset ) + { + iGrid->SetVerticalItemOffset( aOffset ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmGridContainer::VerticalItemOffset() const + { + return iGrid->VerticalItemOffset(); + } + +//---------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmGridContainer::UpdateViewScrollBarThumbs() + { + iGrid->UpdateScrollBarThumbs(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmGridContainer::ItemIsVisible( TInt aItemIndex ) const + { + CListBoxView* v = iGrid->View(); + TRect itemRect( v->ItemPos( aItemIndex ), v->ItemSize( aItemIndex ) ); + TRect viewRect = v->ViewRect(); + TBool isVisible = EFalse; + if ( itemRect.Intersects( viewRect ) ) + { + TRect intersection = itemRect; + intersection.Intersection( viewRect ); + isVisible = intersection.Height() > 1 && intersection.Width() > 1; + } + return isVisible; + } + +// End of File + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmgridmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmgridmodel.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,103 @@ +/* +* 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 "mmgridmodel.h" +#include "mmlistboxmodel.h" + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmGridModel::CMmGridModel() + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmGridModel::~CMmGridModel() + { + delete iMmListBoxModel; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmGridModel* CMmGridModel::NewLC() + { + CMmGridModel* self = new (ELeave)CMmGridModel(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmGridModel* CMmGridModel::NewL() + { + CMmGridModel* self = CMmGridModel::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmGridModel::NumberOfItems() const + { + return CAknGridM::NumberOfItems(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGridModel::ConstructL() + { + iMmListBoxModel = CMmListBoxModel::NewL(); + delete iItemTextArray; + iItemTextArray = iMmListBoxModel->ItemTextArray(); + SetOwnershipType(ELbmDoesNotOwnItemArray); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGridModel::ConstructL(MDesCArray* /*aItemTextArray*/, + TListBoxModelItemArrayOwnership /*aOwnershipType*/) + { + //do not delete this is needed to cheat AVKON + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmListBoxModel* CMmGridModel::MmListBoxModel() + { + return iMmListBoxModel; + } + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmgridview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmgridview.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,312 @@ +/* +* 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 <eikfrlbd.h> + +#include "mmgridview.h" +#include "mmgrid.h" +#include "mmlistboxitemdrawer.h" +#ifdef RD_UI_TRANSITION_EFFECTS_LIST +#include <aknlistloadertfx.h> +#include <aknlistboxtfxinternal.h> +#endif + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmGridView::CMmGridView() : + iLastCurMove( ECursorFirstItem ), iOldIndex( KErrNotFound ) + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmGridView::~CMmGridView() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmGridView* CMmGridView::NewLC() + { + CMmGridView* self = new (ELeave)CMmGridView(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmGridView* CMmGridView::NewL() + { + CMmGridView* self = CMmGridView::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGridView::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGridView::DrawItem(TInt aItemIndex) const + { + CMmListBoxItemDrawer* itemDrawer = + STATIC_CAST( CMmListBoxItemDrawer*, ItemDrawer() ); + TSize size = itemDrawer->GetItemSize( 0, ETrue ); + if ( itemDrawer->ItemCellSize() != size ) + { + const_cast<CMmGridView*>( this )->SetItemHeight(size.iHeight); + const_cast<CMmGridView*>( this )->SetColumnWidth(size.iWidth); + } + + CAknGridView::DrawItem( aItemIndex ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TPoint CMmGridView::ItemPos( TInt aItemIndex ) const + { + if ( aItemIndex < 0 ) + { + // let avkon handle the insane cases + return CAknGridView::ItemPos( aItemIndex ); + } + + if ( AknLayoutUtils::LayoutMirrored() ) + { + const TInt colNum = NumberOfColsInView(); + TInt itemCol = aItemIndex % colNum; + TInt mirroredItemCol = colNum - itemCol - 1; + aItemIndex = aItemIndex - itemCol + mirroredItemCol; + } + + // return CAknGridView::ItemPos( aItemIndex ); + return CorrectItemPos( aItemIndex ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TPoint CMmGridView::CorrectItemPos( TInt aItemIndex ) const + { + // 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 ), + iViewRect.iTl.iY + (itemRow - topItemRow) * + ( iItemHeight + sizeBetweenItems.iHeight ) + iVerticalOffset ); + + return itemPos; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmGridView::XYPosToItemIndex( TPoint aPosition, TInt& aItemIndex ) const + { + if ( AknLayoutUtils::LayoutMirrored() ) + { + aPosition.iX = iViewRect.Width() - ( aPosition.iX - iViewRect.iTl.iX ); + } + return CAknGridView::XYPosToItemIndex( aPosition, aItemIndex ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CWindowGc* CMmGridView::Gc() + { + return iGc; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGridView::MoveCursorL( TCursorMovement aCursorMovement, + TSelectionMode aSelectionMode ) + { +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + iLastCurMove = aCursorMovement; + iOldIndex = iCurrentItemIndex; +#endif // RD_UI_TRANSITION_EFFECTS_LIST + + CAknGridView::MoveCursorL( aCursorMovement, aSelectionMode ); + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + iLastCurMove = ECursorFirstItem; + iOldIndex = KErrNotFound; +#endif // RD_UI_TRANSITION_EFFECTS_LIST + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGridView::UpdateSelectionL( TSelectionMode aSelectionMode ) + { +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( AknLayoutUtils::LayoutMirrored() ) + { + MAknListBoxTfxInternal* api = CAknListLoader::TfxApiInternal( Gc() ); + TInt row( 0 ); + TInt col( 0 ); + TInt newRow( 0 ); + TInt newCol( 0 ); + LogicalPosFromListBoxIndex( iOldIndex, row, col ); + LogicalPosFromListBoxIndex( iCurrentItemIndex, newRow, newCol ); + if ( api ) + { + if ( iLastCurMove == CAknGridView::ECursorNextColumn ) + { + if ( newCol < col || newRow != row ) + api->SetMoveType( MAknListBoxTfxInternal::EListNoMovement ); + } + else if ( iLastCurMove == CAknGridView::ECursorPreviousColumn ) + { + if ( newCol > col || newRow != row ) + api->SetMoveType( MAknListBoxTfxInternal::EListNoMovement ); + } + } + } +#endif // RD_UI_TRANSITION_EFFECTS_LIST + + CAknGridView::UpdateSelectionL( aSelectionMode ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGridView::Draw(const TRect* aClipRect) const + { + DoDraw( aClipRect ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGridView::DoDraw(const TRect* aClipRect) const + { + CMmListBoxItemDrawer* itemDrawer = static_cast< CMmListBoxItemDrawer*> ( ItemDrawer() ); + TBool drawingInitiated(EFalse); + if ( CAknEnv::Static()->TransparencyEnabled() && + iWin && iWin->GetDrawRect() == TRect::EUninitialized ) + { + TRect a; + if (!aClipRect || *aClipRect == TRect(0,0,0,0) ) + { + a = ViewRect(); + aClipRect = &a; + } + + drawingInitiated=ETrue; + iWin->Invalidate( *aClipRect ); + iWin->BeginRedraw( *aClipRect ); + } + CAknGridView::Draw( aClipRect ); + + if ( aClipRect ) + { + TRect rect(*aClipRect); + TInt lastItemInView = (iModel->NumberOfItems() <= BottomItemIndex() ) + ? iModel->NumberOfItems()-1 : BottomItemIndex(); + rect.iTl.iY = ItemPos( lastItemInView ).iY + ItemSize( lastItemInView ).iHeight; +// iGc->SetClippingRect( rect ); +// removed to prevent non-redraw drawing. Was present to prevent out of view drawing when effects are on. +// could be removed because effects were disabled at some point in edit mode to enhance performance. + itemDrawer->DrawFloatingItems( rect ); +// iGc->CancelClippingRect(); + } + +// if (aClipRect) +// { +// const_cast< CMmGridView* >(this)->Gc()->DrawRect(*aClipRect); +// } + + if ( CAknEnv::Static()->TransparencyEnabled() && + iWin && drawingInitiated ) + { + drawingInitiated = EFalse; + iWin->EndRedraw( ); + } + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmGridView::VerticalItemOffset() const + { + return iVerticalOffset; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGridView::SetItemHeight(TInt aItemHeight) + { + // we need to update the iItemHeight member in grid also (there are two different item height value holders - in grid and here in grid view) + CMmListBoxItemDrawer* itemDrawer = + STATIC_CAST( CMmListBoxItemDrawer*, ItemDrawer() ); + static_cast<CMmGrid*>(itemDrawer->Widget())->SetItemHeight( aItemHeight ); + + CAknGridView::SetItemHeight(aItemHeight); + } + +//End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmhighlighttimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmhighlighttimer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,236 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: highlight control class +* +*/ +#include <eiklbi.h> + +#include "mmhighlighttimer.h" +#include "mmwidgetcontainer.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmHighlightTimer::CMmHighlightTimer(CMmWidgetContainer* aContainer) : + CActive(EPriorityStandard), iState(EInactivityState), + iContainer( aContainer ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CMmHighlightTimer* CMmHighlightTimer::NewLC( + CMmWidgetContainer* aContainer) + { + ASSERT(aContainer); + CMmHighlightTimer* self = new (ELeave) CMmHighlightTimer( aContainer ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CMmHighlightTimer* CMmHighlightTimer::NewL( + CMmWidgetContainer* aContainer) + { + CMmHighlightTimer* self = CMmHighlightTimer::NewLC( aContainer ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmHighlightTimer::ConstructL() + { + User::LeaveIfError( iTimer.CreateLocal() ); + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmHighlightTimer::~CMmHighlightTimer() + { + Cancel(); + iTimer.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmHighlightTimer::DoCancel() + { + if (iState == ETimerExpirationCompletionState) + { + iTimer.Cancel(); + } + else if (iState == EExternalCompletionState) + { + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrCancel ); + } + iState = EInactivityState; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmHighlightTimer::StartL( TInt aTime, TBool aPressDownState ) + { + CListBoxView* view = iContainer->Widget()->View(); + if ( IsActive() && + iTimerHighlightIndex != iContainer->Widget()->CurrentItemIndex()) + { + // draw over previous highlight + // this occurs when e.g. highlight is set by rocker and later another + // item is pressed. + DrawHighlightL( iTimerHighlightIndex ); + } + Cancel(); + if (aTime > 0) + { + iTimer.After(iStatus, aTime); + iState = ETimerExpirationCompletionState; + } + else + { + iStatus = KRequestPending; + iState = EExternalCompletionState; + } + + SetActive(); + iContainer->SetHighlightVisibilityL( ETrue ); + { + SetPressDownState( aPressDownState ); + TInt currentItemIndex = + iContainer->Widget()->View()->CurrentItemIndex(); + DrawHighlightL( currentItemIndex ); + iTimerHighlightIndex = currentItemIndex; + } + iContainer->SetHighlightVisibilityL( EFalse ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmHighlightTimer::RunL() + { + DrawHighlightL(iContainer->Widget()->View()->CurrentItemIndex()); + iState = EInactivityState; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmHighlightTimer::RunError(TInt /*aError*/) + { + iState = EInactivityState; + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmHighlightTimer::StopL( TBool aDrawOverHighlight ) + { + if (IsActive()) + { + Cancel(); + if ( aDrawOverHighlight ) + { + DrawHighlightL( iContainer->Widget()->View()->CurrentItemIndex() ); + } + } + iState = EInactivityState; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmHighlightTimer::TimerHighlightIndex() const + { + return iTimerHighlightIndex; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmHighlightTimer::DrawHighlightL(TInt aItemIndex) + { + if ( iContainer->IsVisible() ) + { + CListBoxView* view = iContainer->Widget()->View(); + iContainer->Widget()->DrawNow( TRect( + view->ItemPos( aItemIndex ), view->ItemSize( + aItemIndex) ) ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmHighlightTimer::SetPressDownState(TBool aPressDownState) + { + if ( aPressDownState ) + { + iContainer->Widget()->View()->ItemDrawer()->SetFlags( + CListItemDrawer::EPressedDownState ); + } + else + { + iContainer->Widget()->View()->ItemDrawer()->ClearFlags( + CListItemDrawer::EPressedDownState ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmHighlightTimer::ContinueL( TInt aTime ) + { + if ( IsActive() ) + { + Cancel(); + if ( aTime > 0 ) + { + iTimer.After( iStatus, aTime ); + iState = ETimerExpirationCompletionState; + } + else + { + iStatus = KRequestPending; + iState = EExternalCompletionState; + } + SetActive(); + } + } +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmitemsdatacache.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmitemsdatacache.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,159 @@ +/* +* 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 : 2 << Don't touch! Updated by Synergy at check-out. +* +*/ + +#include "mmitemsdatacache.h" +#include "mmcacheforitem.h" + +const TInt KItemCacheArrGranularity = 20; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmItemsDataCache* CMmItemsDataCache::NewLC() + { + CMmItemsDataCache* self = new (ELeave) CMmItemsDataCache(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmItemsDataCache* CMmItemsDataCache::NewL() + { + CMmItemsDataCache* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmCacheForItem* CMmItemsDataCache::GetItemCacheL( TInt aItemIndex ) + { + ASSERT( aItemIndex >= 0 ); + while ( iItemCacheArr.Count() <= aItemIndex ) + { + CMmCacheForItem* cacheForItem = CMmCacheForItem::NewLC( *this ); + iItemCacheArr.AppendL( cacheForItem ); + CleanupStack::Pop( cacheForItem ); + } + return iItemCacheArr[aItemIndex]; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmItemsDataCache::GetTemplateIdentifierL( const TDesC8& aTemplateName ) + { + TInt identifier = KErrNotFound; + + // this looks very primitive, but RPointerArray::FindL just compares pointers + // so I guess there is no other way + TInt templateCount = iTemplateNames.Count(); + for ( TInt i = 0; i < templateCount; ++i ) + { + if ( iTemplateNames[i]->Compare( aTemplateName ) == 0 ) + { + identifier = i; + break; + } + } + + if ( identifier == KErrNotFound ) + { + HBufC8* templateNameCopy = HBufC8::NewLC( aTemplateName.Length() ); + templateNameCopy->Des().Copy( aTemplateName ); + iTemplateNames.AppendL( templateNameCopy ); + CleanupStack::Pop( templateNameCopy ); + identifier = iTemplateNames.Count() - 1; + } + return identifier; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TDesC8& CMmItemsDataCache::GetTemplateNameByIdentifier( + TInt aTemplateIdentifier ) const + { + return *( iTemplateNames[aTemplateIdentifier] ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmItemsDataCache::Invalidate() + { + const TInt count = iItemCacheArr.Count(); + for ( TInt i = 0; i < count; ++i ) + { + iItemCacheArr[i]->SetValid( EFalse ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmItemsDataCache::Trim( TInt aItemCount ) + { + __ASSERT_ALWAYS( aItemCount >= 0, User::Invariant() ); + for ( TInt i = iItemCacheArr.Count() - 1; i >= aItemCount; --i ) + { + CMmCacheForItem* cache = iItemCacheArr[i]; + iItemCacheArr.Remove( i ); + delete cache; + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmItemsDataCache::~CMmItemsDataCache() + { + iItemCacheArr.ResetAndDestroy(); + iItemCacheArr.Close(); + iTemplateNames.ResetAndDestroy(); + iTemplateNames.Close(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmItemsDataCache::CMmItemsDataCache() + : iItemCacheArr( KItemCacheArrGranularity ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmItemsDataCache::ConstructL() + { + } diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmlctutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmlctutils.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,342 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: highlight control class +* +*/ + + +#include "mmlctutils.h" +#include "mmtemplatelibrary.h" +#include "mmwidgetsconstants.h" +#include <aknlayoutscalable_uiaccel.cdl.h> +#include <aknlayoutscalable_avkon.cdl.h> +#include <AknUtils.h> +#include <AknFontId.h> +#include <AknLayoutFont.h> +#include <AknDef.hrh> + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TAknWindowComponentLayout MmLCTUtils::ItemLayout( const TDesC8& aLayout, TInt aVariety ) + { + if ( !aLayout.Compare(KListSingleLargeGraphicPane8)) + { + return AknLayoutScalable_Avkon::list_single_large_graphic_pane(0, 0, 0); + } + else if ( !aLayout.Compare(KUiaccelAalistDoubleGraphicPane8)) + { + return AknLayoutScalable_UiAccel::aalist_double_graphic_pane(aVariety); + } + else if ( !aLayout.Compare(KUiaccelAalistDoublePane8)) + { + return AknLayoutScalable_UiAccel::aalist_double_pane(aVariety); + } + else if ( !aLayout.Compare(KUiaccelAalistSinglePane8)) + { + return AknLayoutScalable_UiAccel::aalist_single_pane(aVariety); + } + else if ( !aLayout.Compare(KUiaccelAalistGeneAdPane8)) + { + return AknLayoutScalable_UiAccel::aalist_gene_ad_pane(aVariety); + } + else if ( !aLayout.Compare(KUiaccelAagridCellImagePane8)) + { + return AknLayoutScalable_UiAccel::aagrid_cell_image_pane(aVariety, 0, 0); + } + else if ( !aLayout.Compare(KCellHcAppsPane8)) + { + return AknLayoutScalable_Avkon::cell_hc_apps_pane( aVariety, 0, 0); + } + else if ( !aLayout.Compare(KCellAppPane8)) + { + return AknLayoutScalable_Avkon::cell_app_pane( aVariety, 0, 0 ); + } + else if ( !aLayout.Compare(KListSingleHcAppsPane8)) + { + return AknLayoutScalable_Avkon::list_single_hc_apps_pane( 0, aVariety ); + } + else + { + User::Panic(KMLID, -1); + } + return TAknWindowComponentLayout(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TAknTextComponentLayout MmLCTUtils::TextLayout( const TDesC8& aLayout, TInt aVariety ) + { + if ( aLayout.Compare(KUiaccelAalistSinglePaneT18) == 0 ) + { + return AknLayoutScalable_UiAccel::aalist_single_pane_t1(aVariety); + } + else if ( aLayout.Compare(KUiaccelAalistDoubleGraphicPaneT18) == 0 ) + { + return AknLayoutScalable_UiAccel::aalist_double_graphic_pane_t1(aVariety); + } + else if ( aLayout.Compare(KUiaccelAalistDoubleGraphicPaneT28) == 0 ) + { + return AknLayoutScalable_UiAccel::aalist_double_graphic_pane_t2(aVariety); + } + else if ( aLayout.Compare(KUiaccelAalistDoublePaneT18) == 0 ) + { + return AknLayoutScalable_UiAccel::aalist_double_pane_t1(aVariety); + } + else if ( aLayout.Compare(KUiaccelAalistDoublePaneT28) == 0 ) + { + return AknLayoutScalable_UiAccel::aalist_double_pane_t2(aVariety); + } + else if ( aLayout.Compare(KlistSingleLargeGraphicPaneT18) == 0 ) + { + return AknLayoutScalable_Avkon::list_single_large_graphic_pane_t1(aVariety); + } + else if ( aLayout.Compare(KUiaccelAagridCellImagePaneT18) == 0 ) + { + return AknLayoutScalable_UiAccel::aagrid_cell_image_pane_t1(aVariety); + } + else if ( !aLayout.Compare(KCellHcAppsPaneT18)) + { + return AknLayoutScalable_Avkon::cell_hc_apps_pane_t1( aVariety, 0, 0); + } + else if ( !aLayout.Compare(KListSingleHcAppsPaneT18)) + { + return AknLayoutScalable_Avkon::list_single_hc_apps_pane_t1( aVariety ); + } + else if ( !aLayout.Compare(KCellAppsPaneT18)) + { + return AknLayoutScalable_Avkon::cell_app_pane_t1( aVariety, 0, 0 ); + } + else + { + User::Panic(KMLID, -1); + } + return TAknTextComponentLayout(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TAknWindowComponentLayout MmLCTUtils::GraphicLayout( const TDesC8& aLayout, TInt aVariety ) + { + if ( aLayout.Compare(KUiaccelAalistSinglePaneG18) == 0 ) + { + return AknLayoutScalable_UiAccel::aalist_single_pane_g1(aVariety); + } + else if ( aLayout.Compare(KUiaccelAalistSinglePaneG28) == 0 ) + { + return AknLayoutScalable_UiAccel::aalist_single_pane_g2(aVariety); + } + else if ( aLayout.Compare(KUiaccelAalistDoubleGraphicPaneG1) == 0 ) + { + return AknLayoutScalable_UiAccel::aalist_double_graphic_pane_g1(aVariety); + } + else if ( aLayout.Compare(KUiaccelAalistDoubleGraphicPaneG28) == 0 ) + { + return AknLayoutScalable_UiAccel::aalist_double_graphic_pane_g2(aVariety); + } + else if ( aLayout.Compare(KUiaccelAalistDoubleGraphicPaneG38) == 0 ) + { + return AknLayoutScalable_UiAccel::aalist_double_graphic_pane_g3(aVariety); + } + else if ( aLayout.Compare(KUiaccelAalistDoublePaneG18) == 0 ) + { + return AknLayoutScalable_UiAccel::aalist_double_pane_g1(aVariety); + } + else if ( aLayout.Compare(KUiaccelAalistDoublePaneG28) == 0 ) + { + return AknLayoutScalable_UiAccel::aalist_double_pane_g2(aVariety); + } + else if ( aLayout.Compare(KlistSingleLargeGraphicPane8) == 0 ) + { + return AknLayoutScalable_Avkon::list_single_large_graphic_pane(aVariety, 0,0); + } + else if ( aLayout.Compare(KlistSingleLargeGraphicPaneG18) == 0 ) + { + return AknLayoutScalable_Avkon::list_single_large_graphic_pane_g1(aVariety); + } + else if ( aLayout.Compare(KlistSingleLargeGraphicPaneG2Cp28) == 0 ) + { + return AknLayoutScalable_Avkon::list_single_large_graphic_pane_g2_cp2(aVariety); + } + else if ( aLayout.Compare(KlistSingleLargeGraphicPaneG4Cp28) == 0 ) + { + return AknLayoutScalable_Avkon::list_single_large_graphic_pane_g4_cp2(aVariety); + } + else if ( aLayout.Compare(KUiaccelAagridCellImagePaneG18) == 0 ) + { + return AknLayoutScalable_UiAccel::aagrid_cell_image_pane_g1(aVariety); + } + else if ( aLayout.Compare(KUiaccelAagridCellImagePaneG28) == 0 ) + { + return AknLayoutScalable_UiAccel::aagrid_cell_image_pane_g2(aVariety); + } + else if ( aLayout.Compare(KUiaccelAagridCellImagePaneG38) == 0 ) + { + return AknLayoutScalable_UiAccel::aagrid_cell_image_pane_g3(aVariety); + } + else if ( aLayout.Compare(KUiaccelAagridCellImagePaneG48) == 0 ) + { + return AknLayoutScalable_UiAccel::aagrid_cell_image_pane_g4(aVariety); + } + else if ( !aLayout.Compare(KUiaccelAagridCellImagePane8)) + { + return AknLayoutScalable_UiAccel::aagrid_cell_image_pane(aVariety, 0, 0); + } + else if ( !aLayout.Compare(KUiaccelAalistDoubleGraphicPane8)) + { + return AknLayoutScalable_UiAccel::aalist_double_graphic_pane(aVariety); + } + else if ( !aLayout.Compare(KUiaccelAalistDoubleGraphicPaneG68)) + { + return AknLayoutScalable_UiAccel::aalist_double_graphic_pane_g6(aVariety); + } + else if ( !aLayout.Compare(KUiaccelAalistDoubleGraphicPaneG78)) + { + return AknLayoutScalable_UiAccel::aalist_double_graphic_pane_g7(aVariety); + } + else if ( !aLayout.Compare(KUiaccelAalistGeneAdPaneG18)) + { + return AknLayoutScalable_UiAccel::aalist_gene_ad_pane_g1(aVariety); + } + else if ( !aLayout.Compare(KUiaccelAalistGeneAdPaneG18)) + { + return AknLayoutScalable_UiAccel::aalist_gene_ad_pane_g1(aVariety); + } + else if ( !aLayout.Compare( KCellHcAppsPaneG18)) + { + return AknLayoutScalable_Avkon::cell_hc_apps_pane_g1( aVariety, 0, 0); + } + else if ( !aLayout.Compare( KCellHcAppsPaneG28)) + { + return AknLayoutScalable_Avkon::cell_hc_apps_pane_g2( aVariety, 0, 0); + } + else if ( !aLayout.Compare( KCellHcAppsPaneG38)) + { + return AknLayoutScalable_Avkon::cell_hc_apps_pane_g3( aVariety, 0, 0); + } + else if ( !aLayout.Compare( KListSingleHcAppsPaneG18)) + { + return AknLayoutScalable_Avkon::list_single_hc_apps_pane_g1( aVariety ); + } + else if ( !aLayout.Compare( KListSingleHcAppsPaneG28)) + { + return AknLayoutScalable_Avkon::list_single_hc_apps_pane_g2( aVariety ); + } + else if ( !aLayout.Compare( KCellAppsPaneG18)) + { + return AknLayoutScalable_Avkon::cell_app_pane_g1( aVariety, 0, 0 ); + } + else if ( !aLayout.Compare( KCellAppsPaneG28)) + { + return AknLayoutScalable_Avkon::cell_app_pane_g2( aVariety, 0, 0 ); + } + else + { + User::Panic(KMLID, -1); + } + return TAknWindowComponentLayout(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TAknLayoutScalableParameterLimits MmLCTUtils::LCTParameterLimits( const TDesC8& aLayout, TInt aVariety ) + { + if ( aLayout.Compare(KCellHcAppsPane8) == 0 ) + { + return AknLayoutScalable_Avkon::cell_hc_apps_pane_ParamLimits( aVariety ); + } + else if ( aLayout.Compare(KCellAppPane8) == 0 ) + { + return AknLayoutScalable_Avkon::cell_app_pane_ParamLimits( aVariety ); + } + else + { + User::Panic(KMLID, -1); + } + return TAknLayoutScalableParameterLimits(); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void MmLCTUtils::SetupTextSubCellTemplate( TSize aItemSize, + TTemplateChild& aSubCellTemplate ) + { + TAknTextComponentLayout textLayout = TextLayout( aSubCellTemplate.iLct, aSubCellTemplate.iVariety); + TAknTextLineLayout textlineLayout = textLayout.LayoutLine(); + TAknLayoutText t; + t.LayoutText( aItemSize, textlineLayout ); + aSubCellTemplate.iTextAlign = AknLayoutUtils::TextAlignFromId( textlineLayout.iJ ); + aSubCellTemplate.iRectAccordingToParent = t.TextRect(); + aSubCellTemplate.iFontId = (TAknLogicalFontId)textlineLayout.FontId(); + aSubCellTemplate.iIsImage = EFalse; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void MmLCTUtils::SetupGraphicSubCellTemplate( TSize aItemSize, + TTemplateChild& aSubCellTemplate ) + { + TAknWindowComponentLayout graphicLayout = GraphicLayout ( + aSubCellTemplate.iLct, aSubCellTemplate.iVariety); + TAknLayoutRect r; + r.LayoutRect( aItemSize, graphicLayout.LayoutLine() ); + aSubCellTemplate.iTextAlign = CGraphicsContext::ECenter ; + aSubCellTemplate.iRectAccordingToParent = r.Rect(); + aSubCellTemplate.iIsImage = ETrue; + aSubCellTemplate.iFontId = EAknLogicalFontSecondaryFont; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TSize MmLCTUtils::GetLCTSize (const TDesC8& aLCTTemplate, TInt aVariety, + const TRect aParentRect, TAknWindowLineLayout& aWindowLayout) + { + aWindowLayout = MmLCTUtils::ItemLayout( aLCTTemplate, aVariety); + TAknLayoutRect layRect; + layRect.LayoutRect(aParentRect, aWindowLayout); + return layRect.Rect().Size(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TSize MmLCTUtils::GetLayoutSize( const TDesC8& aLCTTemplate, TInt aVariety ) + { + TInt cols(0); + TInt rows(0); + cols = MmLCTUtils::LCTParameterLimits( aLCTTemplate, aVariety ).LastColumn() + 1; + rows = MmLCTUtils::LCTParameterLimits( aLCTTemplate, aVariety ).LastRow() + 1; + if ( aLCTTemplate.Compare(KCellAppPane8) == 0 && aVariety == 3 ) + { + cols = 6; + rows = 2; + } + return TSize( cols, rows); + } + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmlistbox.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmlistbox.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,889 @@ +/* +* 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 <aknlists.h> +#include <eikspmod.h> +#include <eikclb.h> +#include <eikfrlb.h> +#include <eikslb.h> +#include <AknUtils.h> +#include <aknlayoutscalable_avkon.cdl.h> +#include <aknlayoutscalable_apps.cdl.h> +#include <layoutmetadata.cdl.h> + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST +#include <aknlistboxtfxinternal.h> +#include <akntransitionutils.h> +#include <aknlistloadertfx.h> +#endif + +#include "mmlistboxmodel.h" +#include "mmlistbox.h" +#include "mmlistboxview.h" +#include "mmlistboxitemdrawer.h" +#include "mmmarqueeadapter.h" +#include "mmwidgetcontainer.h" +#include "mmwidgetsconstants.h" +#include "mmdraweranimator.h" +#include "mmtemplatelibrary.h" + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmListBox::CMmListBox() : AKNDOUBLELISTBOXNAME(R_LIST_PANE_LINES_AB_COLUMN) + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmListBox::~CMmListBox() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +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; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::SetListFlag( TInt aFlag ) + { + iListBoxFlags = iListBoxFlags | aFlag; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::ClearListFlag( TInt aFlag ) + { + iListBoxFlags = iListBoxFlags & !aFlag; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmListBox* CMmListBox::NewL( const CCoeControl* aParent, TInt aFlags, + CMmTemplateLibrary* aTemplateLibrary ) + { + CMmListBox* self = CMmListBox::NewLC( aParent, aFlags, aTemplateLibrary ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::ConstructL( const CCoeControl* aParent, TInt aFlags, + CMmTemplateLibrary* aTemplateLibrary ) + { + iDisableChildComponentDrawing = EFalse; + iModel = iMmModel = CMmListBoxModel::NewL(); + CreateItemDrawerL( aTemplateLibrary ); + + EnableExtendedDrawingL(); + + + iItemDrawer->SetDrawMark(EFalse); + CEikListBox::ConstructL(aParent,aFlags); + iMmDrawer->SetView( this ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::HandlePointerEventInEditModeL( + const TPointerEvent& aPointerEvent ) + { + TInt itemUnderPointerIndex = KErrNotFound; + if ( aPointerEvent.iType == TPointerEvent::EButton1Up || + aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + CEikFormattedCellListBoxTypedef::HandlePointerEventL( aPointerEvent ); + } + else if ( View()->XYPosToItemIndex( + aPointerEvent.iPosition, itemUnderPointerIndex ) ) + { + TInt currentItemIndex = CurrentItemIndex(); + if ( currentItemIndex != itemUnderPointerIndex ) + { + View()->SetCurrentItemIndex( itemUnderPointerIndex ); + // remove hightlight from the previously highlighted item + } + } + HandleScrollingInEditMode( aPointerEvent ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::HandleScrollingInEditMode( const TPointerEvent& aPointerEvent ) + { + if ( aPointerEvent.iType == TPointerEvent::EDrag + || aPointerEvent.iType == TPointerEvent::EButtonRepeat ) + { + TInt nextScrollDelay = ScrollIfNeeded( aPointerEvent ); + if ( nextScrollDelay ) + { + TRect ignoreDragRect( + TPoint(aPointerEvent.iParentPosition.iX - MmEffects::KDragIgnoreRectValue, + aPointerEvent.iParentPosition.iY - MmEffects::KDragIgnoreRectValue), + TPoint(aPointerEvent.iParentPosition.iX + MmEffects::KDragIgnoreRectValue, + aPointerEvent.iParentPosition.iY + MmEffects::KDragIgnoreRectValue)); + + Window().CancelPointerRepeatEventRequest(); + Window().RequestPointerRepeatEvent( nextScrollDelay, ignoreDragRect ); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmListBox::IsPointerInTopScrollingThreshold( + const TPointerEvent& aPointerEvent ) const + { + TInt topScrollingTreshold = Rect().iTl.iY + + ( MmEffects::KFocusScrollingThreshold + * TReal( View()->ItemSize().iHeight ) ); + + return ( aPointerEvent.iPosition.iY < topScrollingTreshold ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmListBox::IsPointerInBottomScrollingThreshold( + const TPointerEvent& aPointerEvent ) const + { + TInt bottomScrollingTreshold = Rect().iBr.iY + - ( MmEffects::KFocusScrollingThreshold + * TReal( View()->ItemSize().iHeight ) ); + + return ( aPointerEvent.iPosition.iY > bottomScrollingTreshold ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +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; + + 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 ); + + if (readyForScrolling) + { + View()->VScrollTo( View()->CalcNewTopItemIndexSoItemIsVisible( + newCurrentItemIndex ) ); + View()->SetCurrentItemIndex( newCurrentItemIndex ); + UpdateScrollBarThumbs(); + } + } + } + + return nextScrollDelay; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) + { +// if ( aPointerEvent.iType == TPointerEvent::EButton1Down && +// iMmDrawer->CachedDataUseIsEnabled() ) +// { +// // Touching the screen stops flick but avkon does not send us +// // MEikListBoxObserver::EEventFlickStopped event in such case. +// // Thus this little hack: +// iMmDrawer->EnableCachedDataUse( EFalse ); +// DrawView(); +// } + + CMmWidgetContainer* parent = static_cast<CMmWidgetContainer*>( Parent() ); + + if ( parent->IsEditMode() ) + { + HandlePointerEventInEditModeL( aPointerEvent ); + } + else + { + CEikFormattedCellListBoxTypedef::HandlePointerEventL( aPointerEvent ); + } + + if ( iMmDrawer->GetAnimator()->IsActive() ) + { + iMmDrawer->GetAnimator()->CancelNextRedrawL(); + } + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::FixViewForMirroredLayout() + { + TInt scrollbarWidth = + ScrollBarFrame()->VerticalScrollBar()->Rect().Width(); + TRect r( View()->ViewRect() ); + TInt currentShift = r.iTl.iX; + TBool scrollbarVisible = ScrollBarFrame()->VerticalScrollBar()->IsVisible(); + TBool layoutMirrored = AknLayoutUtils::LayoutMirrored(); + + if ( layoutMirrored && scrollbarVisible && currentShift != scrollbarWidth ) + { + // shift view rect to the right + r.Move( scrollbarWidth - currentShift, 0 ); + View()->SetViewRect( r ); + } + else if ( ( !layoutMirrored || !scrollbarVisible ) && currentShift != 0 ) + { + // restore view rect to its normal position + r.Move( -currentShift, 0 ); + View()->SetViewRect( r ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::RedrawScrollbarBackground() const + { + TRect viewRect( View()->ViewRect() ); + if ( viewRect.iTl.iX > 0 ) + { + TRect scrollbarRect( TPoint( 0, 0 ), + TSize( viewRect.iTl.iX, viewRect.Height() ) ); + + CWindowGc* gc = iItemDrawer->Gc(); + CMmListBoxItemDrawer* itemDrawer = + static_cast<CMmListBoxItemDrawer*>( iItemDrawer ); + MAknsSkinInstance *skin = AknsUtils::SkinInstance(); + CCoeControl* control = itemDrawer->FormattedCellData()->Control(); + MAknsControlContext *cc = AknsDrawUtils::ControlContext( control ); + if( gc ) + { + if ( control ) + { + AknsDrawUtils::Background( skin, cc, control, *gc, scrollbarRect ); + } + else + { + gc->SetBrushColor( BackColor() ); + gc->Clear( scrollbarRect ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TKeyResponse CMmListBox::OfferKeyEventL( + const TKeyEvent& aKeyEvent,TEventCode aType ) + { + TInt itemIndex = CurrentItemIndex(); + TInt previousItemIndex = CurrentItemIndex(); + TKeyResponse ret = CEikFormattedCellListBoxTypedef::OfferKeyEventL( + aKeyEvent, aType ); + TInt currentItemIndex = CurrentItemIndex(); + + TInt itemY = View()->ItemPos( currentItemIndex ).iY + + View()->ItemSize( currentItemIndex ).iHeight; + + if ( currentItemIndex == BottomItemIndex() + && 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 ); + } +#endif + iView->VScrollTo( + iView->CalcNewTopItemIndexSoItemIsVisible( currentItemIndex ) ); + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( effects ) + { + transApi->Draw( Rect() ); + } +#endif + } + SetCurrentItemIndex( currentItemIndex ); + } + + RedrawIfNecessary( itemIndex, CurrentItemIndex()); + return ret; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmListBox::RedrawIfNecessary( TInt aPreviousCurrent, TInt aCurrent ) + { + TBool redrawConsumed( EFalse ); + if( aCurrent == KErrNotFound ) + { + return redrawConsumed; + } + + CMmListBoxView * view = static_cast<CMmListBoxView *>(iView); + TInt differenceIndex = Abs( aPreviousCurrent - aCurrent ); + if ( aPreviousCurrent == KErrNotFound || differenceIndex == 0 ) + { + //TODO: It should be checked if this is really necessary + view->RedrawBackground(); + return redrawConsumed; + } + + TInt sizePrevBefore = iMmDrawer->GetItemHeight(aPreviousCurrent, ETrue); + TInt sizeCurBefore = iMmDrawer->GetItemHeight(aCurrent, EFalse); + TInt sizePrevAfter = iMmDrawer->GetItemHeight(aPreviousCurrent, EFalse); + TInt sizeCurAfter = iMmDrawer->GetItemHeight(aCurrent, ETrue); + + if ( ( sizePrevBefore == sizePrevAfter ) && (sizeCurBefore == sizeCurAfter) ) + { + return redrawConsumed; + } + else + { + TInt sizeAllBefore = sizePrevBefore + sizePrevAfter; + TInt sizeAllAfter = sizeCurBefore + sizeCurAfter; + + TInt lastPotentialItemIndex = Min( iModel->NumberOfItems(), + iView->TopItemIndex() + iView->NumberOfItemsThatFitInRect( + iView->ViewRect() ) ); + TInt redrawIndex = lastPotentialItemIndex; + + if ( differenceIndex == 1 ) + { + if( sizeAllBefore != sizeAllAfter ) + { + redrawIndex = Min( aPreviousCurrent, aCurrent ); + } + else + { + return redrawConsumed; + } + } + else if ( differenceIndex > 1 && sizeAllBefore == sizeAllAfter ) + { + redrawIndex = Min( aPreviousCurrent, aCurrent ); + lastPotentialItemIndex = Max( aPreviousCurrent, aCurrent ); + } + else if ( differenceIndex > 1 ) + { + redrawIndex = Min( aPreviousCurrent, aCurrent ); + } + + if (redrawIndex < iView->TopItemIndex()) + redrawIndex = iView->TopItemIndex(); + + if (lastPotentialItemIndex > iView->BottomItemIndex()) + lastPotentialItemIndex = iView->BottomItemIndex(); + + if ( aPreviousCurrent < TopItemIndex() ) + { + lastPotentialItemIndex = BottomItemIndex() ; + } + else if ( BottomItemIndex() < aPreviousCurrent ) + { + lastPotentialItemIndex = BottomItemIndex() + 1; + } + + while ( redrawIndex < lastPotentialItemIndex +1 ) + { + view->DrawSingleItem( redrawIndex++ ); + redrawConsumed = ETrue; + } + + view->RedrawBackground(); + } + return redrawConsumed; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::CreateItemDrawerL( CMmTemplateLibrary* aTemplateLibrary ) + { + CFormattedCellListBoxData* cellData=CFormattedCellListBoxData::NewL(); + CleanupStack::PushL( cellData ); + iItemDrawer = iMmDrawer = CMmListBoxItemDrawer::NewL( MmModel(), + iEikonEnv->NormalFont(), cellData, EListbox, aTemplateLibrary ); + CleanupStack::Pop( cellData ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmListBoxModel* CMmListBox::MmModel() + { + return iMmModel; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::SetMmModel( CMmListBoxModel* aMmModel ) + { + if ( iMmModel != aMmModel ) + { + delete iMmModel; + iMmModel = aMmModel; + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CListBoxView* CMmListBox::MakeViewClassInstanceL() + { + return CMmListBoxView::NewL(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBox::AdjustRectHeightToWholeNumberOfItems(TRect& /*aRect*/) const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::SetItemDrawerAndViewBgContext (CAknsBasicBackgroundControlContext * aBgContext) + { + iMmDrawer->SetBgContext (aBgContext); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmListBox::HandleScrollbarVisibilityChangeL() + { + TBool ret = EFalse; + if ( AllItemsFitInViewRect() ) + { + if ( ScrollBarFrame()->VerticalScrollBar()->IsVisible() + || iMmDrawer->TemplateLibrary()->GetScrollbarVisibility() ) + { + 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 ); + } +#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; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +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; + } + } + +/** + * Helper class whose only purpose is to ensure that + * ScrollToItem method will be always re-enabled. + */ +struct TScrollToItemEnabler + { + CMmListBoxView* iV; + void Close() { iV->DisableScrollToItem( EFalse ); } + }; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::UpdateScrollBarsL() + { + TBool redrawNeeded = HandleScrollbarVisibilityChangeL(); + if (ScrollBarFrame()->VerticalScrollBar()->IsVisible()) + { + CMmListBoxView* view = static_cast<CMmListBoxView*>( 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(); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::UpdateScrollBarsNoRedrawL() + { + HandleScrollbarVisibilityChangeL(); + if ( ScrollBarFrame()->VerticalScrollBar()->IsVisible() ) + { + CMmListBoxView* view = static_cast<CMmListBoxView*>( 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) ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::SetMarqueeDrawing( TBool aIsMarqueeBeingDrawn ) + { + iMmDrawer->SetMarqueeDrawing( aIsMarqueeBeingDrawn ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::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 +// it and return it. (Copied from EIKLBX.CPP, needed by CMmListBox::Draw) +// ----------------------------------------------------------------------------- +// +LOCAL_C CWindowGc* ReplaceGcWithCustomGc( const CEikListBox* aListBox ) + { + const CCoeControl* parent = aListBox; + CWindowGc* customGc; + while(parent) + { + customGc = parent->GetGc(); + if ( customGc ) + { + CListItemDrawer* itemDrawer = aListBox->View()->ItemDrawer(); + CWindowGc* originalGc = itemDrawer->Gc(); + if ( customGc == originalGc ) + { + return NULL; + } + else + { + itemDrawer->SetGc( customGc ); + return originalGc; + } + } + parent = parent->Parent(); + } + return NULL; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::Draw(const TRect& aRect) const + { +// if (!iResized) +// { +// return; +// } + + CWindowGc* gc = this->iItemDrawer->Gc(); + + // If a parent has a custom gc, draw listbox using that gc + CWindowGc* replacedGc = ReplaceGcWithCustomGc( + static_cast<const CEikListBox*>( this ) ); + + if (this->iModel->NumberOfItems() == 0) + { + this->iView->DrawEmptyList(this->Rect()); + + if ( replacedGc ) + { + // Stop using the custom gc + this->iItemDrawer->SetGc( replacedGc ); + } + return; + } + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( gc ); + + if ( transApi ) + { + transApi->SetListType( MAknListBoxTfxInternal::EListBoxTypeMainPane ); + // ViewRect might have been moved to the right to prevent grid items + // from overlapping the scrollbar in mirrored layout. + // However, we still have to draw scrollbar background, thus the + // rectangle object passed to MAknListBoxTfxInternal::BeginRedraw must + // be placed at (0, 0) so that it covers the area where scrollbar is + // drawn. + TRect r( View()->ViewRect().Size() ); + transApi->BeginRedraw( MAknListBoxTfxInternal::EListView, r ); + } +#endif //RD_UI_TRANSITION_EFFECTS_LIST + if (!this->iView->RedrawDisabled()) + { + MAknsControlContext *cc = AknsDrawUtils::ControlContext( this ); + if (!cc) cc = ItemDrawer()->FormattedCellData()->SkinBackgroundContext(); + + if (gc) + { + TRect clientRect; + this->RestoreClientRectFromViewRect(clientRect); +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( transApi ) + { + transApi->StartDrawing( MAknListBoxTfxInternal::EListView ); + } +#endif //RD_UI_TRANSITION_EFFECTS_LIST + gc->SetBrushColor(this->BackColor()); + AknsDrawUtils::BackgroundBetweenRects( AknsUtils::SkinInstance(), cc, this, *gc, clientRect, this->iView->ViewRect() ); + RedrawScrollbarBackground(); +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( transApi ) + { + transApi->StopDrawing(); + } +#endif //RD_UI_TRANSITION_EFFECTS_LIST + } + } + if ( this->iModel->NumberOfItems() ) + { + // finally, draw the actual list + this->iView->Draw(&aRect); + } +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( transApi ) + { + CMmListBoxView* view = static_cast<CMmListBoxView*>( View() ); + view->DisableScrollToItem( ETrue ); + transApi->EndViewRedraw( aRect ); + view->DisableScrollToItem( EFalse ); + } +#endif //RD_UI_TRANSITION_EFFECTS_LIST + if ( replacedGc ) + { + // Stop using the custom gc + this->iItemDrawer->SetGc( replacedGc ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::DrawView() + { + iDisableChildComponentDrawing = ETrue; + DrawNow(Rect()); + iDisableChildComponentDrawing = EFalse; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::SetVerticalItemOffset( TInt aOffset ) + { + static_cast<CMmListBoxView*>( View() )->SetItemOffsetInPixels( aOffset ); + UpdateScrollBarThumbs(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBox::VerticalItemOffset() const + { + return static_cast<CMmListBoxView*>( View() )->VerticalItemOffset(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::SetItemHeight( TInt aItemHeight ) + { + if ( aItemHeight != iItemHeight ) + { + iItemHeight = aItemHeight; + TRAP_IGNORE( UpdateScrollBarsNoRedrawL() ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::UpdateScrollBarThumbs() + { + CEikFormattedCellListBox::UpdateScrollBarThumbs(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBox::CountComponentControls() const + { + TInt componentControls(0); + if ( !iDisableChildComponentDrawing ) + { + componentControls = CEikFormattedCellListBoxTypedef::CountComponentControls(); + } + return componentControls; + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::SetDisableChildComponentDrawing( TBool aDisable ) + { + iDisableChildComponentDrawing = aDisable; + } + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmlistboxcontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmlistboxcontainer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,332 @@ +/* +* 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_64 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#include <aknlists.h> +#include <barsread.h> + +#include <eikclb.h> +#include <StringLoader.h> +#include <AknsLayeredBackgroundControlContext.h> +#include <AknsListBoxBackgroundControlContext.h> + +#include "mmlistbox.h" +#include "mmlistboxmodel.h" +#include "mmmarqueeadapter.h" +#include "hnsuitemodel.h" +#include "mmlistboxcontainer.h" +#include "mmlistboxitemdrawer.h" +#include "mmwidgetsconstants.h" +#include "mmtemplatelibrary.h" +#include "mmpostevaluationprocessor.h" +#include "mmdraweranimator.h" +#include "mmhighlighttimer.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CListboxNumberContainer::CListboxNumberContainer() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CMmListBoxContainer* CMmListBoxContainer::NewLC( const TRect& aRect, + MObjectProvider* aObjectProvider, CMmTemplateLibrary* aTemplateLibrary ) + { + CMmListBoxContainer* self = new( ELeave ) CMmListBoxContainer(); + CleanupStack::PushL( self ); + self->ConstructL( aRect, aObjectProvider, aTemplateLibrary ); + return self; + } + +// ----------------------------------------------------------------------------- +// CListboxNumberContainer::CListboxNumberContainer() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CMmListBoxContainer* CMmListBoxContainer::NewL( const TRect& aRect, + MObjectProvider* aObjectProvider, CMmTemplateLibrary* aTemplateLibrary ) + { + CMmListBoxContainer* self = NewLC( aRect, aObjectProvider, aTemplateLibrary ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CListboxNumberContainer::CListboxNumberContainer() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CMmListBoxContainer::CMmListBoxContainer() + { + } + +// ----------------------------------------------------------------------------- +// CListboxNumberContainer::~CListboxNumberContainer() +// Destructor +// ----------------------------------------------------------------------------- +// +CMmListBoxContainer::~CMmListBoxContainer() + { + delete iListBox; + delete iMarqueeAdapter; + } + +// ----------------------------------------------------------------------------- +// CMmListBoxContainer::ConstructL() +// 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CMmListBoxContainer::ConstructL( const TRect& aRect, + MObjectProvider* aObjectProvider, CMmTemplateLibrary* aTemplateLibrary ) + { + CMmWidgetContainer::ConstructL(); + + SetMopParent( aObjectProvider ); + CreateWindowL(); // Creates window. + iWidget = CreateListboxL( aTemplateLibrary ); + iWidget->SetListBoxObserver( this ); + SetRect( aRect ); // Sets rectangle of frame. + ActivateL(); // Activates window. ( Ready to draw ) + SetupDrawer(); +// SetHighlightVisibilityL( ETrue ); + iMarqueeAdapter = CMmMarqueeAdapter::NewL(); + iDrawer->SetMarqueeAdapter( iMarqueeAdapter ); + iListBox->SetMarqueeAdapter( iMarqueeAdapter ); + iPostProcessor = CMmPostEvaluationProcessor::NewL( *iDrawer ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmListBoxContainer::DrawView() + { + iListBox->DrawView(); + } + +// ----------------------------------------------------------------------------- +// CMmListBoxContainer::CreateListboxL() +// Constructs listbox from resource, creates scroll bar and sets empty +// list background text. +// ----------------------------------------------------------------------------- +// +CMmListBox* CMmListBoxContainer::CreateListboxL( + CMmTemplateLibrary* aTemplateLibrary ) + { + iListBox = CMmListBox::NewL( this, EAknListBoxSelectionList + | EAknListBoxLoopScrolling, aTemplateLibrary ); + iListBox->SetContainerWindowL( *this ); + iListBox->CreateScrollBarFrameL( ETrue ); + iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto ); + iListBox->ScrollBarFrame()->DrawBackground( EFalse, EFalse ); + return iListBox; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +THnSuiteWidgetType CMmListBoxContainer::WidgetType() + { + return EListWidget; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMmListBoxContainer::SetDefaultHighlightL( TBool aRedraw ) + { + TInt defaultHighlight = Widget()->TopItemIndex(); + if ( !ItemIsFullyVisible( defaultHighlight ) + && defaultHighlight < NumberOfItems() - 1 ) + { + defaultHighlight++; + } + + if (defaultHighlight >= 0 ) + { + SetManualHighlightL( defaultHighlight, aRedraw ); + } + } +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMmListBoxContainer::SetEmptyTextL(const TDesC& aText) + { + iListBox->View()->SetListEmptyTextL( aText ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxContainer::SetEditModeL( TBool aIsEditMode ) + { + if (aIsEditMode && !AknLayoutUtils::PenEnabled() ) + { + iListBox->ClearListFlag( EAknListBoxLoopScrolling ); + } + else + { + iListBox->SetListFlag( EAknListBoxLoopScrolling ); + } + CMmWidgetContainer::SetEditModeL( aIsEditMode ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmListBoxModel* CMmListBoxContainer::GetMmModel() + { + return iListBox->MmModel(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxContainer::SetupWidgetLayoutL() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxContainer::SetItemDrawerAndViewBgContext( + CAknsBasicBackgroundControlContext * aBgContext ) + { + iListBox->SetItemDrawerAndViewBgContext (aBgContext); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxContainer::SetSuiteModelL( CHnSuiteModel* aModel ) + { + CMmWidgetContainer::SetSuiteModelL( aModel ); + // highlight always active + aModel->SetActiveL( ETrue ); + iMarqueeAdapter->StopMarqueeDrawing(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxContainer::SetHighlightVisibilityL( TBool aVisible ) + { + CMmWidgetContainer::SetHighlightVisibilityL( aVisible ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CMmListBoxContainer::PointInItemReorderAreaL( + TInt aItemIndex, TPoint aPoint ) + { + TRect itemRect = GetItemRectL( aItemIndex ); + itemRect.Shrink( 0, MmEffects::KShiftRatio * itemRect.Height() ); + return itemRect.Contains( aPoint ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmListBoxContainer::HandleItemAdditionL() + { + iListBox->HandleItemAdditionL(); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmListBoxContainer::HandleItemRemovalL() + { + GetMmModel()->HandleSuiteEventL( ESuiteItemsRemoved, GetMmModel()->GetSuiteModel() ); + iCurrentHighlight = GetSuiteModelL()->GetSuiteHighlight(); + ValidateWidgetCurrentItemIndex(); + + iDrawer->RemoveFloatingItems(); + if( IsEditMode() ) + { + iDrawer->GetAnimator()->SetNextRedrawToWholeScreen(); + } + + iListBox->HandleItemRemovalL(); + + CHnSuiteModel* suiteModel = GetSuiteModelL(); + suiteModel->SetSuiteHighlightL( iCurrentHighlight ); + static_cast<CMmListBoxItemDrawer*>( iListBox->ItemDrawer() )->TrimCacheSize( + GetMmModel()->NumberOfItems() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmListBoxContainer::ColumnsInCurrentView() + { + return 1; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmListBoxContainer::RowsInCurrentView() + { + return iListBox->View()->NumberOfItemsThatFitInRect( + iListBox->View()->ViewRect()); + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxContainer::SetVerticalItemOffset( TInt aOffset ) + { + iListBox->SetVerticalItemOffset( aOffset ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBoxContainer::VerticalItemOffset() const + { + return iListBox->VerticalItemOffset(); + } + +//---------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmListBoxContainer::UpdateViewScrollBarThumbs() + { + iListBox->UpdateScrollBarThumbs(); + } +// End of File diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1543 @@ +/* +* 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 <eikfrlb.h> +#include "mmwidgetsconstants.h" +#include "hnconvutils.h" +#include <gdi.h> +#include <AknIconArray.h> +#include <AknsConstants.h> +#include <AknFontAccess.h> +#include <aknlistboxtfx.h> +#include <layoutmetadata.cdl.h> +#include <AknIconUtils.h> +#include <AknBidiTextUtils.h> +#include <AknDef.hrh> +#include <AknLayoutFont.h> + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST +#include <aknlistloadertfx.h> +#include <aknlistboxtfxinternal.h> +#endif + +#include <AknsLayeredBackgroundControlContext.h> +#include <AknsListBoxBackgroundControlContext.h> +#include "bitmaptransforms.h" +#include "mmwidgetsconstants.h" +#include "mmlistbox.h" +#include "mmtemplatelibrary.h" +#include "mmlistboxitemdrawer.h" +#include "mmlistboxmodel.h" +#include "mmdraweranimator.h" +#include "mmmarqueeadapter.h" +#include "mmfloatingitem.h" +#include "mmgridview.h" +#include "mmcacheforitem.h" +#include "mmitemsdatacache.h" +#include "mmwidgetcontainer.h" +#include "hnsuitemodel.h" +#include "menudebug.h" + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmListBoxItemDrawer::CMmListBoxItemDrawer( + CMmListBoxModel* aMmListBoxModel, + const CFont* aFont, + CFormattedCellListBoxData* aFormattedCellData, + TMmWidgetType aWidgetType, + CMmTemplateLibrary* aTemplateLibrary ) + : CFormattedCellListBoxItemDrawer( aMmListBoxModel , aFont, aFormattedCellData), + iFont(aFont), iLeftOverAreaUnderAnimatedItem(EFalse) + { + iWidgetType = aWidgetType; + iTemplateLibrary = aTemplateLibrary; + iMmModel = aMmListBoxModel; + iRedrawBackground = ETrue; + iZoomIconIndex = -1; + iIconAnimationZoomRatio = 1; + SetFlags( CListItemDrawer::EDisableHighlight ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmListBoxItemDrawer::~CMmListBoxItemDrawer() + { + iFloatingItems.Close(); + delete iItemsDataCache; + delete iAnimator; + delete iSubcellText; + delete ColumnData()->IconArray(); + ColumnData()->SetIconArray( NULL ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::EnableCachedDataUse( TBool aEnable ) + { + __ASSERT_DEBUG( !( aEnable && IsEditMode() ), User::Invariant() ); + iUseCache = aEnable; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmListBoxItemDrawer::CachedDataUseIsEnabled() const + { + return iUseCache; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::TrimCacheSize( TInt aItemCount ) + { + iItemsDataCache->Trim( aItemCount ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::InvalidateCache() + { + iItemsDataCache->Invalidate(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +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; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +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; + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetView(CEikListBox * aView) + { + iWidget = aView; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CEikListBox* CMmListBoxItemDrawer::Widget() const + { + return iWidget; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::ConstructL() + { + iAnimator = CMmDrawerAnimator::NewL( *this ); + iItemsDataCache = CMmItemsDataCache::NewL(); + iIsEditMode = EFalse; + iHighlightShown = EFalse; + iDrawMoveIndicators = ETrue; + } + +// ----xm------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::DrawEmptyItem( TInt aItemIndex, + TPoint aItemRectPos, TBool aViewIsDimmed ) const + { + TRect r( aItemRectPos, iItemCellSize ); + + CFormattedCellListBoxItemDrawer::DrawEmptyItem( aItemIndex, aItemRectPos, + aViewIsDimmed ); + + const_cast<CMmListBoxItemDrawer*>(this)->DrawFloatingItems(r); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBoxItemDrawer::GetFloatingItemIndex(TMmFloatingItemType aType) const + { + TInt ret (KErrNotFound); + TInt i(iFloatingItems.Count()-1); + for(; i >= 0; i--) + { + if (iFloatingItems[i].GetFloatingItemType() == aType) + { + ret = i; + break; + } + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TMmFloatingItem& CMmListBoxItemDrawer::GetFloatingItemL(TMmFloatingItemType aType) + { + TInt index = GetFloatingItemIndex(aType); + User::LeaveIfError( index ); + return iFloatingItems[ index ]; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::AnimateDragItemTransitionL() + { + iAnimator->AnimateDragItemTransitionL(); + iAnimator->Trigger(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::AnimateItemSwapL( TInt aItemFrom, TInt aItemTo ) + { + iAnimator->AnimateItemSwapL( aItemFrom, aItemTo ); + iAnimator->Trigger(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::AnimateItemZoomInL( TInt aItemIndex ) + { + iAnimator->AnimateItemZoomL( aItemIndex, ETrue ); + iAnimator->Trigger(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::AnimateItemZoomOutL( TInt aItemIndex ) + { + iAnimator->AnimateItemZoomL( aItemIndex, EFalse ); + iAnimator->Trigger(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::DrawFloatingItems(TRect currentlyDrawnRect) + { + SetRedrawItemBackground( EFalse ); + for(TInt i(iFloatingItems.Count()-1); i >= 0 ; i--) + { + TMmFloatingItemType type = iFloatingItems[i].GetFloatingItemType(); + 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; + + iZoomIconIndex = iFloatingItems[i].GetDrawnItemIndex(); + iIconAnimationZoomRatio = iFloatingItems[i].GetCurrentZoomRatio(); + + if ( ItemHasFloatingType( drawnItemIndex, EDrag) || + ItemHasFloatingType( drawnItemIndex, EDragTransition) ) + { + ClearFlags( CListItemDrawer::EPressedDownState ); + } + + DrawActualItem( drawnItemIndex, rect, ETrue, EFalse, EFalse, EFalse ); + iIconAnimationZoomRatio = tempZoomRatio; + iZoomIconIndex = tempZoomIconIndex; + } + } + else + { + iFloatingItems.Remove(i); + } + } + SetRedrawItemBackground( ETrue ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBoxItemDrawer::GetValidFloatingItemCount(TMmFloatingItemType aType) + { + TInt count (0); + + for(TInt i(iFloatingItems.Count()-1); i >= 0; i--) + { + if (iFloatingItems[i].GetFloatingItemType() == aType + && iFloatingItems[i].IsFloatingItemValid() ) + count++; + } + return count; + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::DrawItem(TInt aItemIndex, TPoint aItemRectPos, + TBool aItemIsSelected, TBool aItemIsCurrent, TBool aViewIsEmphasized, + TBool aViewIsDimmed) const + { + if ( !Widget()->View()->RedrawDisabled() ) + { + DoDrawItem( aItemIndex, aItemRectPos, aItemIsSelected, + aItemIsCurrent, aViewIsEmphasized, aViewIsDimmed); + } + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::DoDrawItem(TInt aItemIndex, TPoint aItemRectPos, + TBool aItemIsSelected, TBool aItemIsCurrent, TBool aViewIsEmphasized, + TBool aViewIsDimmed) const + { + 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 ); + } +#endif + + const_cast<CMmListBoxItemDrawer*>(this)->iLeftOverAreaUnderAnimatedItem = EFalse; + for(TInt i(iFloatingItems.Count()-1); i >= 0; i--) + { + if ( iFloatingItems[i].GetDrawnItemIndex() == aItemIndex + && iFloatingItems[i].IsFloatingItemValid() ) + { + const_cast<CMmListBoxItemDrawer*>(this)->iLeftOverAreaUnderAnimatedItem = ETrue; + break; + } + } + + DrawActualItem(aItemIndex, actualItemRect, aItemIsCurrent, aViewIsEmphasized, + aViewIsDimmed, aItemIsSelected); + const_cast<CMmListBoxItemDrawer*>(this)->iLeftOverAreaUnderAnimatedItem = EFalse; + + const_cast<CMmListBoxItemDrawer*>(this)->DrawFloatingItems(actualItemRect); + + if (!AknLayoutUtils::PenEnabled() && IsEditMode()) + { + const_cast<CMmListBoxItemDrawer*>(this)->DrawActualIndicatorItem( + aItemIndex, actualItemRect ); + } + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( transApi ) + { + transApi->EndRedraw( MAknListBoxTfxInternal::EListItem, aItemIndex ); + } +#endif + + + + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::DrawItemText(TInt aItemIndex, + const TRect &aItemTextRect, TBool aItemIsCurrent, + TBool aViewIsEmphasized, TBool aItemIsSelected ) const + { + TRAP_IGNORE( DoDrawItemTextL( aItemIndex, aItemTextRect, aItemIsCurrent, + aViewIsEmphasized, aItemIsSelected ) ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::DoDrawItemTextL( TInt aItemIndex, const TRect + &aItemTextRect, TBool aItemIsCurrent, TBool aViewIsEmphasized, + TBool /* aItemIsSelected */) const + { + CMmCacheForItem* cache = iItemsDataCache->GetItemCacheL( aItemIndex ); + cache->InvalidateIfCacheMayNotBeUsed( + aItemIsCurrent, iLastSubcellsSetupCode ); + + if ( IsRedrawItemBackgroundEnabled() ) + { + DrawBackgroundAndSeparatorLines( aItemTextRect ); + } + + if ( !iUseCache || !cache->IsValid() ) + { + SetupSubCellsL( aItemIsCurrent, aItemIndex ); + } + __ASSERT_DEBUG( cache->IsValid(), User::Invariant() ); + CArrayPtr<CGulIcon>* oldIconList = FormattedCellData()->IconArray(); + FormattedCellData()->SetIconArray( cache->GetIconListL() ); + delete oldIconList; + oldIconList = NULL; + + + TBool highlightShown = ETrue; + CFormattedCellListBoxData::TColors colors; + + colors = SetupColors( IsFloating( aItemIndex ) ); + + CFormattedCellListBoxData* data = static_cast<CFormattedCellListBoxData*>(iData); + data->EnableMarqueeL( EFalse ); + if (FormattedCellData()->RespectFocus() && !aViewIsEmphasized) + { +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iGc ); + if ( transApi ) + { + transApi->Remove( MAknListBoxTfxInternal::EListHighlight ); + } +#endif + highlightShown = EFalse; + } + + data->Draw( Properties(aItemIndex), *iGc, &( cache->GetItemText() ), aItemTextRect, + GetHighlightVisibility( aItemIndex, aItemIsCurrent, highlightShown ), colors ); + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iGc ); + if ( transApi ) + { + transApi->StartDrawing( MAknListBoxTfxInternal::EListItem ); + } +#endif + + if ( iMarqueeAdapter && aItemIsCurrent ) + { + DEBUG(("CMmListBoxItemDrawer::DoDrawItemTextL - DrawMarquee")); + iMarqueeAdapter->DrawMarqueeL( *iGc ); + } + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( transApi ) + { + transApi->StopDrawing(); + } +#endif + + delete ColumnData()->IconArray(); + ColumnData()->SetIconArray( NULL ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetRedrawItemBackground( TBool aRedraw ) + { + iRedrawBackground = aRedraw; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmListBoxItemDrawer::IsRedrawItemBackgroundEnabled() const + { + return iRedrawBackground; + } + +void CMmListBoxItemDrawer::DrawBackgroundAndSeparatorLines( const TRect& aItemTextRect ) const + { + MAknsSkinInstance *skin = AknsUtils::SkinInstance(); + CCoeControl* control = FormattedCellData()->Control(); + + if ( IsRedrawItemBackgroundEnabled() ) + { +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iGc ); + if ( transApi ) + { + transApi->StartDrawing( MAknListBoxTfxInternal::EListView ); + } +#endif + TBool bgDrawn( EFalse ); + if ( control ) + { + if ( CAknEnv::Static()->TransparencyEnabled() ) + { + bgDrawn = AknsDrawUtils::Background( + skin, iBgContext, control, *iGc, aItemTextRect, + KAknsDrawParamNoClearUnderImage ); + } + else + { + bgDrawn = AknsDrawUtils::Background( + skin, iBgContext, control, *iGc, aItemTextRect, + KAknsDrawParamNoClearUnderImage | + KAknsDrawParamBottomLevelRGBOnly ); + } + } + if ( !bgDrawn ) + { + iGc->Clear( aItemTextRect ); + } +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( transApi ) + { + transApi->StopDrawing(); + } +#endif + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetupSubNoCellL( TInt aIndex, + TInt aItemIndex ) const + { + TTemplateChild child; + child.iFontId = EAknLogicalFontSecondaryFont; + child.iIsImage = EFalse; + const_cast<CMmListBoxItemDrawer*>(this)-> + ReplaceSubCellText( KNullDesC() ); + SetupSubCellL( child, aIndex, aItemIndex ); + iLastSubcellsSetupCode.AddSubcellInfo( TMmSubcellsSetupCode::ENoSubcell ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetupSubIcondDragHighlightCellL( + TTemplateChild aSubCellTemplate, TInt aIndex, TInt aItemIndex ) const + { + aSubCellTemplate.iRectAccordingToParent.iBr + = TPoint(ItemCellSize().iWidth * iIconAnimationZoomRatio, + ItemCellSize().iHeight * iIconAnimationZoomRatio); + + aSubCellTemplate.iRectAccordingToParent.iTl = TPoint(0, 0); + SetupSubCellL( aSubCellTemplate, aIndex , aItemIndex); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetupSubCellL( TTemplateChild aSubCellTemplate, + TInt aIndex, TInt aItemIndex ) const + { + CFormattedCellListBoxData* data = static_cast<CFormattedCellListBoxData*>(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 ); + +// 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())->IsTimerActive() ) + { + data->SetSubCellSizeL( aIndex, TSize(0,0)); + const_cast<CMmListBoxItemDrawer*>(this)->AddSubcellMarqueeElementL( + aSubCellTemplate, aIndex, aItemIndex); + } + else if (iMarqueeAdapter) + { + iMarqueeAdapter->StopMarqueeDrawing(aIndex); + } + } + + if ( iMarqueeAdapter && iIsMarqueeBeingDrawn + && iMarqueeAdapter->SubcellMarqueeElementExists( aIndex ) ) + { + if (aItemIndex != iWidget->View()->CurrentItemIndex() ) + { + iMarqueeAdapter->StopMarqueeDrawing(aIndex); + } + else + { + data->SetSubCellSizeL(aIndex, TSize(0, 0)); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CFormattedCellListBoxData::TColors CMmListBoxItemDrawer::SetupColors( TBool aDragged ) const + { + CFormattedCellListBoxData::TColors colors; + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + if ( !aDragged ) + { + AknsUtils::GetCachedColor( skin, colors.iText, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); + AknsUtils::GetCachedColor( skin, colors.iBack , KAknsIIDQsnTextColors, + EAknsCIQsnOtherColorsCG9 ); + AknsUtils::GetCachedColor( skin, colors.iHighlightedText, + KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 ); + AknsUtils::GetCachedColor( skin, colors.iHighlightedBack, + KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ); + } + else + { + AknsUtils::GetCachedColor( skin, colors.iText, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG10 ); + AknsUtils::GetCachedColor( skin, colors.iBack , KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); + AknsUtils::GetCachedColor( skin, colors.iHighlightedText, + KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 ); + AknsUtils::GetCachedColor( skin, colors.iHighlightedBack, + KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ); + } + + return colors; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBoxItemDrawer::GetItemHeight( TInt aItemIndex, TBool aItemIsCurrent ) const + { + TSize ret(TInt(0),TInt(0)); + ret = GetItemSize(aItemIndex, aItemIsCurrent); + return ret.iHeight; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBoxItemDrawer::GetFloatingItemCount() + { + for( TInt i=0; i< iFloatingItems.Count(); i++) + { + TMmFloatingItem& current = GetFloatingItemAtIndex(i); + if (current.GetDrawnItemIndex() == KErrNotFound) + { + RemoveFloatingItem(i); + } + } + + return iFloatingItems.Count(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TMmFloatingItem& CMmListBoxItemDrawer::GetFloatingItemAtIndex( TInt aIndex ) + { + return iFloatingItems[ aIndex ]; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::RemoveFloatingItem( TInt aPosition ) + { + if (aPosition != KErrNotFound) + { + iFloatingItems.Remove( aPosition ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::RemoveFloatingItems() + { + iFloatingItems.Reset(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::AddFloatingItemL( TMmFloatingItem& aFloatingItem, + TInt aPosition ) + { + if (aPosition != KErrNotFound) + { + iFloatingItems.InsertL( aFloatingItem, aPosition ); + } + else + { + iFloatingItems.AppendL( aFloatingItem ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TSize CMmListBoxItemDrawer::GetItemSize( TInt aItemIndex, TBool aItemIsCurrent ) const + { + if ( aItemIndex < 0 ) + { + return TSize( 1, 1 ); + } + + TSize size; + + CMmCacheForItem* cache = NULL; + TRAPD( cacheError, cache = iItemsDataCache->GetItemCacheL( aItemIndex ) ); + if ( cacheError != KErrNone ) + { + cache = NULL; + } + + if ( cache ) + { + cache->InvalidateIfCacheMayNotBeUsed( + aItemIsCurrent, iLastSubcellsSetupCode ); + } + + if ( !iUseCache || !cache || !cache->IsValid() ) + { + const TDesC8& mm_template = iMmModel->GetAttributeAsText (aItemIndex, + KMmTemplate8); + TRect viewRect = iWidget->View()->ViewRect(); + + 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, + landscapeOrientation, aItemIsCurrent, viewRect ) + != KErrNone ) + { + size = TSize( 1, 1 ); + } + if ( cache ) + { + cache->SetSize( size ); + } + } + else + { + size = cache->GetSize(); + } + return size; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TRect CMmListBoxItemDrawer::GetIndicatorRect() const + { + TBool landscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation(); + const TDesC8& mm_template = iMmModel->GetAttributeAsText( + iWidget->View()->CurrentItemIndex(), KMmTemplate8 ); + TRect indicatorRect( iTemplateLibrary->GetMoveIndicatorRect( + iWidgetType, mm_template, landscapeOrientation, ETrue ) ); + return indicatorRect; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetDraggableL( TBool aDraggable ) + { + + iDraggable = aDraggable; + + if (!iDraggable) + { + for(int i=0; i< iFloatingItems.Count(); i++) + { + if (iFloatingItems[i].GetFloatingItemType() == EZoomTransition + && iFloatingItems[i].GetZoomingStatus() > 0) + { + AnimateItemZoomOutL( iFloatingItems[i].GetDrawnItemIndex() ); + } + else if (iFloatingItems[i].GetFloatingItemType() == EDrag + || iFloatingItems[i].IsManualDelete()) + { + iFloatingItems[i].InvalidateFloatingItem(); + } + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetEditModeL( TBool aEditMode ) + { + if ( aEditMode ) + { + EnableCachedDataUse( EFalse ); + } +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal *trans = CAknListLoader::TfxApiInternal( iGc ); + if( trans ) + { + trans->Remove( MAknListBoxTfxInternal::EListEverything ); + trans->Draw( iViewRect ); + } +#endif + iIsEditMode = aEditMode; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmListBoxItemDrawer::IsEditMode() const + { + return iIsEditMode; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmDrawerAnimator* CMmListBoxItemDrawer::GetAnimator() + { + return iAnimator; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetDraggedPointL( TPoint aPoint ) + { + TInt dragFloatingItem = GetFloatingItemIndex(EDrag); + if (dragFloatingItem != KErrNotFound ) + { + TMmFloatingItem & item = GetFloatingItemAtIndex( dragFloatingItem ); + TMmFloatingItem floatingItem( item.GetDrawnItemIndex(), + aPoint, EDrag, MmEffects::KNoAnimationFramesCount, NULL ); + floatingItem.SetManualDelete( ETrue ); + + TMmFloatingItem postDragRefresh( item.GetDrawnItemIndex(), + item.GetItemPosition(), EPostDragRefreshItem, + MmEffects::KNoAnimationFramesCount, iWidget->View() ); + + iFloatingItems.Remove(dragFloatingItem); + + if (postDragRefresh.GetItemPosition() != floatingItem.GetItemPosition()) + { + iFloatingItems.Append( postDragRefresh ); + } + iFloatingItems.Insert( floatingItem, 0 ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetDraggedIndexL(TInt aDraggedItemIndex, + TPoint aPoint) + { + TInt dragFloatingItem = KErrNotFound; + do + { + dragFloatingItem = GetFloatingItemIndex(EDrag); + if (dragFloatingItem != KErrNotFound) + { + TMmFloatingItem & item = GetFloatingItemAtIndex( dragFloatingItem ); + + TMmFloatingItem postDragRefresh( item.GetDrawnItemIndex(), + item.GetItemPosition(), EPostDragRefreshItem, + MmEffects::KNoAnimationFramesCount, iWidget->View() ); + + if (postDragRefresh.GetItemPosition() != aPoint) + { + iFloatingItems.Append( postDragRefresh ); + } + } + + RemoveFloatingItem( dragFloatingItem ); + + } + while ( dragFloatingItem != KErrNotFound ); + + if ( aDraggedItemIndex != KErrNotFound ) + { + TMmFloatingItem floatingItem( aDraggedItemIndex, aPoint, EDrag, + MmEffects::KNoAnimationFramesCount, iWidget->View() ); + floatingItem.SetManualDelete( ETrue ); + AddFloatingItemL(floatingItem, 0); + + ClearFlags( CListItemDrawer::EPressedDownState ); + } + + iAnimator->Trigger(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmListBoxItemDrawer::IsDraggable() const + { + return iDraggable && iWidget->View(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetBgContext( + CAknsBasicBackgroundControlContext * aBgContext ) + { + iBgContext = aBgContext; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetScrollbarVisibilityL( TBool 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; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::DrawActualIndicatorItem( TInt aItemIndex, TRect /*actualItemRect*/ ) + { + if ( iDrawMoveIndicators ) + { + iIsIndicatorItem = ETrue; + SetRedrawItemBackground( EFalse ); + + DrawActualItem( aItemIndex, AdjustItemRect( aItemIndex ) , EFalse, EFalse, EFalse, EFalse); + + SetRedrawItemBackground( ETrue ); + iIsIndicatorItem = EFalse; + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::ReplaceSubCellText( const TDesC& aText ) + { + 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); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetMarqueeAdapter( CMmMarqueeAdapter* aAdapter ) + { + iMarqueeAdapter = aAdapter; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetMarqueeDrawing( TBool aIsMarqueeBeingDrawn ) + { + iIsMarqueeBeingDrawn = aIsMarqueeBeingDrawn; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmListBoxItemDrawer::IsTextClippedL( TTemplateChild aTemplateChild, + const TDesC& aText ) const + { + TBuf< MmMarqueeConstants::KClippingBufLength > clipbuf + = aText.Left( MmMarqueeConstants::KTextTrimmingThreshold); + TInt maxClipWidth = aTemplateChild.iRectAccordingToParent.Width(); + const CFont* font = AknLayoutUtils::FontFromId(aTemplateChild.iFontId); + return AknBidiTextUtils::ConvertToVisualAndClipL( clipbuf, *font, + aTemplateChild.iRectAccordingToParent.Width(), maxClipWidth ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetNumberOfColsInView(TInt aNumberOfColumns) + { + iNumberOfColsInWidget = aNumberOfColumns; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetupIconSubcellL( + RArray<TTemplateChild>& aTemplateChildArray, TInt aChildIndex, TInt aItemIndex, + RBuf& aItemText, TInt& aSubcellIncrement ) const + { + CGulIcon* icon = NULL; + TTemplateChild child = aTemplateChildArray[aChildIndex]; + if ( !IsEditMode() && + child.iImageVisualId == EImageVisualIdEditMode ) + { + 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(); + + 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 ) + { + AknIconUtils::SetSize( bitmap, child.iRectAccordingToParent.Size(), + 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 ) + { + __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(); + 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 ); + } + aItemText.Append( KTab ); + } + + aSubcellIncrement++; + iLastSubcellsSetupCode.AddSubcellInfo( TMmSubcellsSetupCode::EGraphicsSubcell ); + } + else + { + // Even when there is no graphics in the model, it is + // necessary to set up an empty subcell in place of + // what would normally be an icon (graphics) subcell. + // This ensures that TMmSubcellsSetupCode will work + // properly. + SetupSubNoCellL( aSubcellIncrement, aItemIndex ); + aSubcellIncrement++; + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmListBoxItemDrawer::BitmapFitsIntoTarget( + TSize aBmpSize, TSize aTargetSize ) const + { + TBool widthLessOrEqual = aBmpSize.iWidth <= aTargetSize.iWidth; + TBool heightLessOrEqual = aBmpSize.iHeight <= aTargetSize.iHeight; + TBool widthAlmostEqual = Abs( aBmpSize.iWidth - aTargetSize.iWidth ) < 2; + TBool heightAlmostEqual = Abs( aBmpSize.iHeight - aTargetSize.iHeight ) < 2; + return ( widthLessOrEqual && heightAlmostEqual ) || + ( widthAlmostEqual && heightLessOrEqual ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetupTextSubcellL( + RArray<TTemplateChild>& 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 ); + + const_cast<CMmListBoxItemDrawer*>(this)->ReplaceSubCellText( + itemChildText ); + CleanupStack::PopAndDestroy( &itemChildText ); + + SetupSubCellL( child, aSubcellIncrement, aItemIndex ); + + if ( aChildIndex < aTemplateChildArray.Count() - 1 ) + { + AppendText( aItemText, KTab ); + } + + aSubcellIncrement++; + iLastSubcellsSetupCode.AddSubcellInfo( TMmSubcellsSetupCode::ETextSubcell ); + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::AppendText( RBuf& aBuffer, const TDesC& aTextToAppend ) const + { + TInt newLength = aBuffer.Length() + aTextToAppend.Length(); + TInt error = KErrNone; + + if( aBuffer.MaxLength() < newLength ) + { + error = aBuffer.ReAlloc( newLength ); + } + if ( error == KErrNone ) + { + aBuffer.Append( aTextToAppend ); + } + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetupBackdropSubcellL( + RArray<TTemplateChild>& aTemplateChildArray, TInt aItemIndex, + RBuf& aItemText, TInt& aSubcellIncrement ) const + { + CGulIcon* icon = NULL; + for ( TInt i = 0; i < aTemplateChildArray.Count() /*&& + aItemIndex != iWidget->View()->CurrentItemIndex()*/; ++i ) + { + TTemplateChild child = aTemplateChildArray[i]; + if( child.iImageVisualId == EImageVisualIdEditMode && + child.iIsImage ) + { + TSize itemSize = GetItemSize( aItemIndex, + aItemIndex == iWidget->View()->CurrentItemIndex() ); + CHnIconHolder* iconHolder = iMmModel->GetAttributeAsRefCountedGraphics( aItemIndex, child.iData, &itemSize ); + icon = iconHolder ? iconHolder->GetGulIcon() : NULL; + 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 ); + + HBufC8* number = HnConvUtils::NumToStr8LC( iconIndex ); + TInt newLength = aItemText.Length() + number->Length(); + if( aItemText.MaxLength() < newLength ) + { + aItemText.ReAllocL( newLength ); + } + CleanupStack::PopAndDestroy( number ); + aItemText.AppendNum( iconIndex ); + + newLength = aItemText.Length() + KTab().Length(); + if( aItemText.MaxLength() < newLength ) + { + aItemText.ReAllocL( newLength ); + } + aItemText.Append( KTab ); + SetupSubCellL( child, aSubcellIncrement, aItemIndex ); + aSubcellIncrement++; + iLastSubcellsSetupCode.AddSubcellInfo( TMmSubcellsSetupCode::EBackdropSubcell ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetupSubCellsL( TBool aItemIsCurrent, + TInt aItemIndex ) const + { + CMmCacheForItem* cache = iItemsDataCache->GetItemCacheL( aItemIndex ); + cache->SetValid( EFalse ); + + const TDesC8& mmTemplate = iMmModel->GetAttributeAsText( aItemIndex, KMmTemplate8 ); + if ( !mmTemplate.Compare( KNullDesC8 ) || !mmTemplate.Compare( KEmpty8 ) ) + { + User::Leave( KErrNotFound ); + } + cache->SetTemplateL( mmTemplate ); + + cache->ClearIconArray(); + cache->SetCurrent( aItemIsCurrent ); + + TBool landscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation(); + + RBuf& itemText = cache->GetItemTextForModifications(); + itemText.Close(); + itemText.CreateL( MmTemplateContants::KItemSubCellsText ); + + RArray<TTemplateChild> templateChildArray; + CleanupClosePushL( templateChildArray ); + if ( !iIsIndicatorItem ) + { + iTemplateLibrary->GetChildrenL( iWidgetType, templateChildArray, mmTemplate, + landscapeOrientation, aItemIsCurrent, IsEditMode() ); + } + else if ( !AknLayoutUtils::PenEnabled() ) + { + iTemplateLibrary->GetMoveIndicatorChildrenL( iWidgetType, templateChildArray, + mmTemplate, landscapeOrientation, aItemIsCurrent ); + } + + iLastSubcellsSetupCode.Clear(); + + //Backdrop icon as first element to draw + TInt subcellIncrement( 0 ); + if ( GetBackdropVisibility( aItemIndex, aItemIsCurrent ) ) + { + SetupBackdropSubcellL( templateChildArray, aItemIndex, itemText, subcellIncrement ); + iItemHasBackdrop = ETrue; + } + else + { + iItemHasBackdrop = EFalse; + } + + 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 ); + } + } + + for ( TInt i = subcellIncrement; i < MmTemplateContants::KSubCellsCount; i++ ) + { + SetupSubNoCellL( i, aItemIndex ); + } + + iLastSubcellsSetupCode.AddTemplateInfo( + iItemsDataCache->GetTemplateIdentifierL( mmTemplate ) ); + iLastSubcellsSetupCode.AddIsCurrentInfo( aItemIsCurrent ); + + CleanupStack::PopAndDestroy( &templateChildArray ); + + cache->SetSubcellsSetupCode( iLastSubcellsSetupCode ); + // the line below is here only to make the cached information complete + GetItemSize( aItemIndex, aItemIsCurrent ); + cache->SetValid( ETrue ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmTemplateLibrary* CMmListBoxItemDrawer::TemplateLibrary() + { + return iTemplateLibrary; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxItemDrawer::SetHighlightShown( TBool aDrawn ) + { + iHighlightShown = aDrawn; + iDrawMoveIndicators = aDrawn; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmListBoxItemDrawer::IsFloating( TInt aItemIndex ) const + { + TBool isFloating( EFalse ); + + TInt index = GetFloatingItemIndex( EDrag ); + if (index == KErrNotFound) + { + index = GetFloatingItemIndex( EDragTransition ); + } + + if ( KErrNotFound != index ) + { + TMmFloatingItem& current = const_cast<CMmListBoxItemDrawer*>(this)->GetFloatingItemAtIndex( index ); + TInt drawnIndex = current.GetDrawnItemIndex(); + if ( drawnIndex == aItemIndex ) + { + isFloating = ETrue; + } + } + return isFloating; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +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 ); + + if ( ( STATIC_CAST(CMmWidgetContainer*,Widget()->Parent())->IsTimerActive() + && aItemIsCurrent && aAllowHighlightForNonDraggedItem ) + || currentlyDraggedItem ) + { + highlightVisibility = ETrue; + } + } + return highlightVisibility; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmListBoxItemDrawer::GetBackdropVisibility( TInt aItemIndex, + 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 */ + && !iIsIndicatorItem /* in non-touch backdrop is not drawn, just "move indicators" */ + && !iLeftOverAreaUnderAnimatedItem /* is the currently drawn item the area left over behind dragged item*/ + && !( STATIC_CAST( CMmWidgetContainer*,Widget()->Parent() )->IsTimerActive() + && 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-- ) + { + const TMmFloatingItem& item = iFloatingItems[i]; + if ( item.GetFloatingItemType() == aFloatingType + && item.GetDrawnItemIndex() == aItemIndex ) + { + hasFloatingType = ETrue; + break; + } + } + return hasFloatingType; + } +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmlistboxmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmlistboxmodel.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,198 @@ +/* +* 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 "mmlistboxmodel.h" +#include "mmwidgetsconstants.h" +#include <eiktxlbm.h> +#include "hnconvutils.h" +#include "hnsuiteobserver.h" +#include "hnsuitemodel.h" +#include "hnitemmodel.h" +#include "hnattributebase.h" +#include "hnattributeimage.h" + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmListBoxModel::CMmListBoxModel() + : iSuiteModel( NULL ) + { + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmListBoxModel::~CMmListBoxModel() + { + if (iSuiteModel) + { + iSuiteModel->UnregisterSuiteObserver( this ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmListBoxModel* CMmListBoxModel::NewLC() + { + CMmListBoxModel* self = new (ELeave) CMmListBoxModel(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmListBoxModel* CMmListBoxModel::NewL() + { + CMmListBoxModel* self = CMmListBoxModel::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxModel::SetSuiteModelL( CHnSuiteModel * aSuiteModel ) + { + if (iSuiteModel) + iSuiteModel->UnregisterSuiteObserver( this ); + + iSuiteModel = aSuiteModel; + UpdateDummyArrayDataL(); + + if (iSuiteModel) + iSuiteModel->RegisterSuiteObserverL( this, EPriorityNormal ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CHnAttributeBase* CMmListBoxModel::GetAttribute( TInt aIndex, + const TDesC8 & aAttributeName ) + { + CHnItemModel* item = (iSuiteModel) ? iSuiteModel->GetItemModel( iSuiteModel->IdByIndex( aIndex ) ) : NULL; + return (item) ? item->GetAttribute( aAttributeName ) : NULL; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TDesC8& CMmListBoxModel::GetAttributeAsText( TInt aIndex, + const TDesC8 & aAttributeName ) + { + CHnAttributeBase* attribute = GetAttribute( aIndex, aAttributeName ); + return (attribute) ? attribute->Value() : KNullDesC8; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CHnIconHolder* CMmListBoxModel::GetAttributeAsRefCountedGraphics( TInt aIndex, + const TDesC8 & aAttributeName, TSize* aDesiredIconSize) + { + CHnAttributeBase* attribute = GetAttribute( aIndex, aAttributeName ); + if ( !attribute || attribute->Type() != EImageAttribute ) + { + return NULL; + } + return attribute->GetIconHolder( aDesiredIconSize ); + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxModel::ConstructL() + { + CTextListBoxModel::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxModel::UpdateDummyArrayDataL( ) + { + CDesCArrayFlat* dataArray = static_cast<CDesC16ArrayFlat*>( ItemTextArray() ); + dataArray->Reset(); + for( TInt i(0); iSuiteModel && i < iSuiteModel->GetItemModelsCount(); i++ ) + { + CHnItemModel* itemModel = iSuiteModel->GetItemModel( iSuiteModel->IdByIndex( i ) ); + CHnItemModel* emptyItem = iSuiteModel->GetItemModel( iSuiteModel->IdByIndex( -1 ) ); + if (!itemModel || itemModel == emptyItem ) + { + continue; + } + dataArray->AppendL( KNullDesC16() ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxModel::ReorderModelL(TInt aFromIndex, TInt aToIndex) + { + iSuiteModel->ReorderItemsL( aFromIndex, aToIndex ); + UpdateDummyArrayDataL(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CHnSuiteModel* CMmListBoxModel::GetSuiteModel() + { + return iSuiteModel; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxModel::HandleSuiteEventL( THnCustomSuiteEvent aCustomSuiteEvent, + CHnSuiteModel* aModel) + { + if (iSuiteModel == aModel) + { + switch ( aCustomSuiteEvent ) + { + case ESuiteModelDestroyed: + iSuiteModel = NULL; + break; + case ESuiteItemsAdded: + case ESuiteItemsRemoved: + case ESuiteItemsUpdated: + UpdateDummyArrayDataL( ); + default: + break; + } + } + } + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmlistboxview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmlistboxview.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,660 @@ +/* +* 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_49 % << Don't touch! Updated by Synergy at check-out. + * +*/ + + + +#include "mmlistboxview.h" +#include "mmlistbox.h" +#include "mmlistboxitemdrawer.h" +#include "mmlistboxmodel.h" +#include "hnsuitemodel.h" +#include "hnitemsorder.h" +#include <eikfrlb.h> +#include <AknUtils.h> +#include <eikfrlbd.h> +#include <eikspmod.h> +#include <aknlayoutscalable_avkon.cdl.h> +#include <AknsDrawUtils.h> + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST +#include <aknlistboxtfx.h> +#include <aknlistboxtfxinternal.h> +#include <akntransitionutils.h> +#include <aknlistloadertfx.h> +#endif + +CMmListBoxView::CMmListBoxView () + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmListBoxView::~CMmListBoxView () + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmListBoxView* CMmListBoxView::NewLC () + { + CMmListBoxView* self = new (ELeave)CMmListBoxView(); + CleanupStack::PushL (self); + self->ConstructL (); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmListBoxView* CMmListBoxView::NewL () + { + CMmListBoxView* self=CMmListBoxView::NewLC (); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxView::ConstructL () + { + iScrollbarIsVisible = ETrue; + iPreviouslyDrawnCurrentItemIndex = KErrNotFound; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxView::UpdateAverageItemHeight () + { + TInt count( iModel->NumberOfItems() ); + if ( !count ) + { + SetItemHeight( 2 ); + } + else + { + TInt totalHeight = GetTotalHeight( 0, count - 1 ); + TInt averageItemHeight = totalHeight / count; + if ( totalHeight % count ) + { + ++averageItemHeight; + // this ensures that it is always possible to + // scroll to the very bottom of the view by + // using scrollbar. + } + SetItemHeight( averageItemHeight ); + } + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBoxView::GetTotalHeight (const TInt aStartIndex, TInt aEndIndex) const + { + TInt totalHeight = 0; + + if ( aEndIndex >= 0) + { + TInt itemCount = iModel->NumberOfItems (); + aEndIndex = (aEndIndex >= itemCount ) ? itemCount-1 : aEndIndex; + CMmListBoxItemDrawer* drawer= STATIC_CAST( CMmListBoxItemDrawer*, iItemDrawer); + for (TInt i(aStartIndex); i <= aEndIndex; i++) + { + totalHeight += drawer->GetItemHeight (i, CurrentItemIndex () == i); + } + } + + return totalHeight; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBoxView::GetLastIndexInHeight (const TInt aStartIndex, TInt aHeight) const + { + TInt i = aStartIndex; + TInt totalHeight = 0; + + TInt itemCount(iModel->NumberOfItems () ); + CMmListBoxItemDrawer* drawer= STATIC_CAST( CMmListBoxItemDrawer*, iItemDrawer); + + for (; (i > -1) && (i < itemCount); i++) + { + totalHeight += drawer->GetItemHeight (i, CurrentItemIndex () == i); + if ( totalHeight > aHeight) + break; + } + + TInt ret(i - aStartIndex); + + if ( !AknLayoutUtils::PenEnabled() && totalHeight > aHeight ) + { + ret--; // exclude partial item + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBoxView::NumberOfItemsThatFitInRect(const TRect& aRect) const + { + return GetNumberOfItemsThatFitInRect( aRect, EFalse ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBoxView::GetNumberOfItemsThatFitInRect (const TRect& aRect, + TBool aIncludePartialItem ) const + { + TInt i = iTopItemIndex; + TInt totalHeight = iVerticalOffset; + + TInt itemCount( iModel->NumberOfItems () ); + CMmListBoxItemDrawer* drawer= STATIC_CAST( CMmListBoxItemDrawer*, iItemDrawer); + while (totalHeight < aRect.Height ()) + { + totalHeight += ((i > -1) && (i < itemCount )) ? drawer->GetItemHeight ( + i, CurrentItemIndex () == i) : iItemHeight; + ++i; + } + + TInt ret(i - iTopItemIndex); + + if ( !AknLayoutUtils::PenEnabled() && !aIncludePartialItem && totalHeight > aRect.Height() ) + { + ret--; // exclude partial item + } + + return ret; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxView::CalcBottomItemIndex () + { + + TInt numberOfVisibleItems = NumberOfItemsThatFitInRect( iViewRect ); + iBottomItemIndex = Min( iTopItemIndex + numberOfVisibleItems - 1, + iModel->NumberOfItems() ); + + // The next piece of code removes filtering from find box when + // new list items are added. + if ( Flags () & CListBoxView::EItemCountModified) + { + CAknFilteredTextListBoxModel *model= STATIC_CAST(CAknFilteredTextListBoxModel*,iModel); + CAknListBoxFilterItems *filter = model ? model->Filter () : 0; + if ( filter) + { + TRAP_IGNORE(filter->ResetFilteringL()); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxView::Draw (const TRect* aClipRect) const + { + TBool drawingInitiated(EFalse); + if ( CAknEnv::Static()->TransparencyEnabled() && + iWin && iWin->GetDrawRect() == TRect::EUninitialized ) + { + TRect a(ViewRect()); + if (!aClipRect || *aClipRect == TRect(0,0,0,0) ) + { + aClipRect = &a; + } + drawingInitiated=ETrue; + iWin->Invalidate( *aClipRect ); + iWin->BeginRedraw( *aClipRect ); + } + + DoDraw(aClipRect); + + CMmListBoxItemDrawer* itemDrawer = + static_cast<CMmListBoxItemDrawer*>(iItemDrawer ); + if (aClipRect) + { + TRect rect(*aClipRect); + rect.iTl.iY = ItemPos( BottomItemIndex() ).iY + ItemSize( BottomItemIndex() ).iHeight; + +// iGc->SetClippingRect( rect ); +// removed to prevent non-redraw drawing. Was present to prevent out of view drawing when effects are on. +// could be removed because effects were disabled at some point in edit mode to enhance performance. + itemDrawer->DrawFloatingItems( rect ); +// iGc->CancelClippingRect(); + } + + if ( CAknEnv::Static()->TransparencyEnabled() && + iWin && drawingInitiated ) + { + drawingInitiated = EFalse; + iWin->EndRedraw( ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxView::DoDraw(const TRect* aClipRect) const + { + CMmListBoxView* view= CONST_CAST( CMmListBoxView*, this ); + view->UpdateAverageItemHeight (); + + CMmListBoxModel* model = static_cast< CMmListBoxModel* > ( iModel ); + if ( model && model->GetSuiteModel() + && !model->GetSuiteModel()->GetItemsOrder()->IsSuiteReadyToShow() ) + { + return; + } + + if ( RedrawDisabled () || !IsVisible () ) + { + return; + } + + TInt i = iTopItemIndex; + CMmListBoxItemDrawer* itemDrawer = + static_cast<CMmListBoxItemDrawer*>(iItemDrawer ); + MAknsSkinInstance *skin = AknsUtils::SkinInstance (); + CCoeControl* control = itemDrawer->FormattedCellData()->Control (); + MAknsControlContext *cc = AknsDrawUtils::ControlContext (control); + + if ( !cc) + { + cc = itemDrawer->FormattedCellData()->SkinBackgroundContext (); + } + + itemDrawer->SetTopItemIndex (iTopItemIndex); + + if ( iModel->NumberOfItems () > 0) + { + TBool drawingInitiated = ETrue; + if ( CAknEnv::Static()->TransparencyEnabled () ) + { + if ( iWin && iWin->GetDrawRect () == TRect::EUninitialized) + { +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal* transApi = + CAknListLoader::TfxApiInternal( iGc ); + drawingInitiated = transApi && !transApi->EffectsDisabled(); +#else + drawingInitiated = EFalse; +#endif + } + + if ( !drawingInitiated) + { + iWin->Invalidate ( *aClipRect); + iWin->BeginRedraw ( *aClipRect); + } + } + + TInt lastPotentialItemIndex = Min (iModel->NumberOfItems (), + iTopItemIndex + GetNumberOfItemsThatFitInRect( ViewRect (), ETrue ) ); + while (i < lastPotentialItemIndex) + { + DrawItem(i++); + } + + RedrawBackground(); + + if ( CAknEnv::Static()->TransparencyEnabled () && !drawingInitiated) + { + iWin->EndRedraw (); + } + } + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxView::DrawItem (TInt aItemIndex) const + { + CMmListBoxItemDrawer* itemDrawer= STATIC_CAST( CMmListBoxItemDrawer*, iItemDrawer ); + TBool currentChanged( CurrentItemIndex() != iPreviouslyDrawnCurrentItemIndex ); + TBool redrawConsumed(EFalse); + if ( currentChanged ) + { + CMmListBoxView* view= CONST_CAST( CMmListBoxView*, this ); + redrawConsumed = + static_cast<CMmListBox*> (itemDrawer->Widget())->RedrawIfNecessary( + iPreviouslyDrawnCurrentItemIndex, + CurrentItemIndex()); + view->SetPreviouslyDrawnCurrentItemIndex( CurrentItemIndex() ); + } + + if ( !redrawConsumed ) + { + DrawSingleItem ( aItemIndex ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TSize CMmListBoxView::ItemSize (TInt aItemIndex) const + { + CMmListBoxView* view= CONST_CAST( CMmListBoxView*, this ); + view->UpdateAverageItemHeight (); + + CMmListBoxItemDrawer* itemDrawer= STATIC_CAST( CMmListBoxItemDrawer*, iItemDrawer ); + TSize size(CFormattedCellListBoxView::ItemSize(aItemIndex).iWidth, itemDrawer->GetItemHeight (aItemIndex, + CurrentItemIndex () == aItemIndex) ); + + if ( size.iHeight < 2) + size.iHeight = 2; + + return size; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TPoint CMmListBoxView::ItemPos (TInt aItemIndex) const + { + TInt vRealPos = CFormattedCellListBoxView::ItemPos(TopItemIndex()).iY; + TInt totalHeight = 0; + if ( aItemIndex > iTopItemIndex ) + { + totalHeight = GetTotalHeight( iTopItemIndex, aItemIndex - 1 ); + } + else if ( aItemIndex < iTopItemIndex ) + { + totalHeight = -GetTotalHeight( aItemIndex, iTopItemIndex - 1 ); + } + + return TPoint (-iHScrollOffset + iViewRect.iTl.iX, iViewRect.iTl.iY + + totalHeight + vRealPos); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmListBoxView::XYPosToItemIndex (TPoint aPosition, TInt& aItemIndex) const + { + // returns ETrue and sets aItemIndex to the index of the item whose bounding box contains aPosition + // returns EFalse if no such item exists + TBool itemFound = EFalse; + if ( iViewRect.Contains (aPosition)) + { + TInt vRealPos = CFormattedCellListBoxView::ItemPos(TopItemIndex()).iY; + // aPosition is inside the display area + TInt numberOfVisibleItems = GetLastIndexInHeight (iTopItemIndex, + aPosition.iY - iViewRect.iTl.iY - vRealPos ); + TInt itemAtSpecifiedPos = iTopItemIndex + numberOfVisibleItems; + aItemIndex = itemAtSpecifiedPos; + itemFound = ( GetTotalHeight( iTopItemIndex, iBottomItemIndex ) + >= aPosition.iY ) && ( iModel->NumberOfItems() > itemAtSpecifiedPos ); +// if ( itemFound ) +// { +// // aPosition is inside the display area +// TInt numberOfVisibleItems = GetLastIndexInHeight (iTopItemIndex, +// aPosition.iY - iViewRect.iTl.iY); +// TInt itemAtSpecifiedPos = iTopItemIndex + numberOfVisibleItems; +// aItemIndex = itemAtSpecifiedPos; +// } + } + return itemFound; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxView::SetItemHeight (TInt aItemHeight) + { + // 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<CMmListBox*>(itemDrawer->Widget())->SetItemHeight( aItemHeight ); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBoxView::CalcNewTopItemIndexSoItemIsVisible (TInt aItemIndex) const + { + CMmListBoxItemDrawer* itemDrawer = + static_cast<CMmListBoxItemDrawer*>( iItemDrawer ); + + TInt newTopItemIndex = iTopItemIndex; + + 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 + TPoint itemPosition( ItemPos( aItemIndex ) ); + TBool itemPartiallyVisible = + ( itemPosition.iY < iViewRect.iTl.iY && + 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() ) > + ViewRect().iBr.iY; + + if ( itemIsAboveVisibleArea ) + { + newTopItemIndex = aItemIndex; + const_cast<CMmListBoxView*>( this )->SetItemOffsetInPixels( 0 ); + } + + if ( itemIsBeneathVisibleArea ) + { + const TInt viewHeight = ViewRect().Height(); + newTopItemIndex = aItemIndex; + for ( ;; ) + { + TInt totalHeight = GetTotalHeight( newTopItemIndex, aItemIndex ); + if ( totalHeight >= viewHeight || newTopItemIndex == 0 ) + { + const_cast<CMmListBoxView*>( this )->SetItemOffsetInPixels( + viewHeight - totalHeight ); + break; + } + --newTopItemIndex; + } + } + + return newTopItemIndex; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxView::RedrawBackground (TRect aUsedPortionOfViewRect, + TRect aSmallerViewRect) const + { +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal(iGc); + if (transApi) + { + transApi->StartDrawing(MAknListBoxTfxInternal::EListView); + } +#endif + + CMmListBoxItemDrawer* itemDrawer = STATIC_CAST( CMmListBoxItemDrawer*, iItemDrawer ); + MAknsSkinInstance *skin = AknsUtils::SkinInstance(); + CCoeControl* control = itemDrawer->FormattedCellData()->Control(); + MAknsControlContext *cc = AknsDrawUtils::ControlContext(control); + + if (control) + { + AknsDrawUtils::BackgroundBetweenRects(skin, cc, control, *iGc, + aSmallerViewRect, aUsedPortionOfViewRect); + } + else + { + iGc->SetBrushColor(BackColor()); + DrawUtils::ClearBetweenRects(*iGc, aSmallerViewRect, + aUsedPortionOfViewRect); + } + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if (transApi) + { + transApi->StopDrawing(); + } +#endif + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxView::RedrawBackground () const + { +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + CMmListBoxItemDrawer* drawer = + static_cast<CMmListBoxItemDrawer*>( iItemDrawer ); + CMmTemplateLibrary* templateLib = drawer->TemplateLibrary(); + + TInt usedPortionHeight = GetTotalHeight(iTopItemIndex, iBottomItemIndex ); + TInt usedPortionWidth = iViewRect.Width(); + if (templateLib->GetScrollbarVisibility()) + { + usedPortionWidth -= templateLib->ScrollbarWidth(); + } + + TRect usedPortionOfViewRect(iViewRect.iTl, TSize(usedPortionWidth, + usedPortionHeight)); + usedPortionOfViewRect.Move(0, + CFormattedCellListBoxView::ItemPos(iTopItemIndex).iY); + + RedrawBackground(usedPortionOfViewRect, iViewRect); +#endif + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxView::SetPreviouslyDrawnCurrentItemIndex( TBool aIndex ) + { + iPreviouslyDrawnCurrentItemIndex = aIndex; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxView::DrawSingleItem (TInt aItemIndex) const + { + CMmListBoxItemDrawer* itemDrawer= STATIC_CAST( CMmListBoxItemDrawer*, iItemDrawer ); + TSize size = itemDrawer->GetItemSize( aItemIndex, 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 + // some drawing-related error which used to occur when moving highlight with + // 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). + + CFormattedCellListBoxView::DrawItem (aItemIndex); + + //To eliminate the effect of undrawn fragment of background, when the last + //is drawn, background is refreshed + if ( aItemIndex == ( iModel->NumberOfItems()-1 ) && ItemIsVisible( iModel->NumberOfItems()-1 ) ) + { + CMmListBoxItemDrawer* itemDrawer= STATIC_CAST( CMmListBoxItemDrawer*, iItemDrawer ); + if ( !itemDrawer->IsEditMode() ) + { + RedrawBackground(); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBoxView::VerticalItemOffset() const + { + return iVerticalOffset; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmListBoxView::ScrollToMakeItemVisible(TInt aItemIndex) + { + TBool scrollConsumed(EFalse); + if ( !iScrollToItemDisabled ) + { + scrollConsumed = CFormattedCellListBoxView::ScrollToMakeItemVisible( + aItemIndex); + } + return scrollConsumed; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBoxView::DisableScrollToItem( TBool aDisable ) + { + iScrollToItemDisabled = aDisable; + } + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmmarqueeadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmmarqueeadapter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,395 @@ +/* +* 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 <aknlayoutscalable_avkon.cdl.h> +#include <AknUtils.h> +#include <eikfrlb.h> +#include <AknBidiTextUtils.h> +#include <gdi.h> +#include <AknLayoutFont.h> + +#include "mmlistbox.h" +#include "mmmarqueeadapter.h" +#include "mmwidgetsconstants.h" + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmMarqueeAdapter::CMmMarqueeAdapter () + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmMarqueeAdapter::~CMmMarqueeAdapter () + { + iMarqueeElements.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmMarqueeAdapter* CMmMarqueeAdapter::NewLC () + { + CMmMarqueeAdapter* self = new (ELeave)CMmMarqueeAdapter(); + CleanupStack::PushL (self); + self->ConstructL (); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmMarqueeAdapter* CMmMarqueeAdapter::NewL () + { + CMmMarqueeAdapter* self = CMmMarqueeAdapter::NewLC (); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmMarqueeAdapter::ConstructL () + { + iMarqueeEnabled = ETrue; + iCurrentMarqueeItemIndex = -1; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmMarqueeAdapter::AddMarqueeElementL( + const TRect& aRect, + const TDesC& aText, + TAknLogicalFontId aFont, + TRgb aColor, + CGraphicsContext::TTextAlign aAlign, + TInt aIndex, + TInt aBaselineOffset, + TInt aCurrentlyDrawnItemIndex + ) + { + if( !iMarqueeEnabled ) + { + return; + } + + if ( aCurrentlyDrawnItemIndex != iCurrentMarqueeItemIndex ) + { + StopMarqueeDrawing(); + iCurrentMarqueeItemIndex = aCurrentlyDrawnItemIndex; + } + + CMmMarqueeElement* element = NULL; + TInt elementIndex(0); + for (TInt i = 0; i < iMarqueeElements.Count() ; i++) + { + if (iMarqueeElements[i]->iSubcellIndex == aIndex) + { + element = iMarqueeElements[i]; + elementIndex = i; + break; + } + } + + if ( element ) + { + const TDesC& previousText = *(element->iText); + TBool textChanged = previousText.Compare( aText ); + + if ( textChanged ) + { + CAknMarqueeControl * control = element->iMarqueeControl; + control->Stop(); + control->Reset(); + iMarqueeElements.Remove(elementIndex ); + delete element; + } + } + + if( SubcellMarqueeElementExists( aIndex ) ) + { + return; + } + + CMmMarqueeElement* newElement = + CMmMarqueeElement::NewL( aRect, aAlign, aText, aFont, aColor, aIndex, aBaselineOffset ); + CleanupStack::PushL( newElement ); + newElement->SetupMarqueeControlL( MmMarqueeConstants::KLoops, + MmMarqueeConstants::KScrollAmount, MmMarqueeConstants::KScrollDelay); + TCallBack callBack(CMmMarqueeAdapter::RedrawEvent, iListbox); + if ( newElement->iMarqueeControl ) + { + newElement->iMarqueeControl->SetRedrawCallBack(callBack); + } + iMarqueeElements.AppendL( newElement ); + CleanupStack::Pop( newElement ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmMarqueeAdapter::StopMarqueeDrawing(TInt aIndex) + { + for (TInt elementIndex = iMarqueeElements.Count() - 1; + elementIndex >= 0; elementIndex--) + { + if ((aIndex < 0) || + (iMarqueeElements[elementIndex]->iSubcellIndex == aIndex)) + { + CMmMarqueeElement* element = iMarqueeElements[elementIndex]; + CAknMarqueeControl * control = element->iMarqueeControl; + control->Stop(); + control->Reset(); + iMarqueeElements.Remove(elementIndex); + delete element; + if (iMarqueeElements.Count() == 0 || (aIndex >= 0)) + { + iCurrentMarqueeItemIndex = -1; + break; + } + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmMarqueeAdapter::EnableMarquee( TBool aEnable ) + { + iMarqueeEnabled = aEnable; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmMarqueeAdapter::DrawMarqueeL(CWindowGc & aGc ) + { + if ( iCurrentMarqueeItemIndex != iListbox->View()->CurrentItemIndex() ) + { + StopMarqueeDrawing(); + return; + } + else if ( iMarqueeEnabled ) + { + for (TInt i = 0; i < iMarqueeElements.Count() ; i++) + { + CMmMarqueeElement* element = iMarqueeElements[i]; + CAknMarqueeControl* control = element->iMarqueeControl; + control->EnableMarquee( ETrue ); + +// Setup graphical context ( font, colors ) for marquee + const CFont* font = AknLayoutUtils::FontFromId( element->iFont ); + TInt baseLineOffset = CAknLayoutFont::AsCAknLayoutFontOrNull( font )->TextPaneTopToBaseline(); + aGc.UseFont(font); + aGc.SetPenColor( element->iColor ); + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + +// Let marquee know if it needs to do bidi conversion + control->UseLogicalToVisualConversion( ETrue ); + + TRect subcellRectOnScreen = element->iElementRect; + TPoint currentItemPositionOnScreen + = iListbox->View()->ItemPos( iListbox->View()->CurrentItemIndex() ); + subcellRectOnScreen.Move( currentItemPositionOnScreen.iX , currentItemPositionOnScreen.iY ); + if ( control->DrawText(aGc, subcellRectOnScreen, *(element->iText), + baseLineOffset, element->iAlign, *font) ) + + { +// All the loops have been executed, the text needs to be truncated. + TBuf< MmMarqueeConstants::KClippingBufLength > clipbuf + = (element->iText)->Left( MmMarqueeConstants::KTextTrimmingThreshold ); +// Get the clipping buffer and draw it + TInt maxClipWidth = element->iElementRect.Width(); + AknBidiTextUtils::ConvertToVisualAndClipL( clipbuf, *font, + element->iElementRect.Width(), maxClipWidth ); + aGc.DrawText(clipbuf, subcellRectOnScreen, baseLineOffset , element->iAlign, 0); + } +// Clean the font cache in graphical context after marquee drawing + aGc.DiscardFont(); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmMarqueeAdapter::RedrawEvent(TAny* aControl ) + { + if ( !((CCoeControl*)aControl)->IsVisible() ) + { + return EFalse; + } + + CMmListBox* listBox = + (CMmListBox*)aControl; + if (listBox->CurrentItemIndex() >= 0 + && listBox->CurrentItemIndex() <= listBox->View()->BottomItemIndex() + && listBox->CurrentItemIndex() >= listBox->View()->TopItemIndex() + ) + { + listBox->SetMarqueeDrawing( ETrue ); //redraw the item without using marquee in the last loop + listBox->View()->DrawItem( listBox->CurrentItemIndex() ); + listBox->SetMarqueeDrawing(EFalse); + } + + return ETrue; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmMarqueeAdapter::SetControl( CEikListBox * aControl ) + { + iListbox = aControl; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmMarqueeAdapter::SubcellMarqueeElementExists( TInt aIndex ) + { + TBool ret = EFalse; + for (TInt i = 0; i < iMarqueeElements.Count() ; i++) + { + if (iMarqueeElements[i]->iSubcellIndex == aIndex) + { + ret = ETrue; + } + } + return ret; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmMarqueeAdapter::RemoveSubcellMarqueeElement(TInt aSubcellIndex) + { + for (TInt i = 0; i < iMarqueeElements.Count() ; i++) + { + if (iMarqueeElements[i]->iSubcellIndex == aSubcellIndex) + { + iMarqueeElements.Remove(i); + break; + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmMarqueeAdapter::IsMarqueeEnabled() const + { + return iMarqueeEnabled; + } + +//class CMmMarqueeElement + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmMarqueeAdapter::CMmMarqueeElement::CMmMarqueeElement ( + TRect aElementRect, + CGraphicsContext::TTextAlign aAlign, + TAknLogicalFontId aFont, + TRgb aColor, TInt aIndex, + TInt aBaselineOffset ):iElementRect(aElementRect), + iAlign(aAlign), + iFont(aFont),iColor(aColor), + iSubcellIndex(aIndex), + iBaselineOffset(aBaselineOffset) + { + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmMarqueeAdapter::CMmMarqueeElement::~CMmMarqueeElement () + { + delete iMarqueeControl; + delete iText; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmMarqueeAdapter::CMmMarqueeElement* CMmMarqueeAdapter::CMmMarqueeElement::NewL ( + TRect aElementRect, CGraphicsContext::TTextAlign aAlign, + const TDesC& aText, TAknLogicalFontId aFont, TRgb aColor,TInt aIndex, + TInt aBaselineOffset ) + { + CMmMarqueeAdapter::CMmMarqueeElement* self + = new (ELeave)CMmMarqueeAdapter::CMmMarqueeElement( aElementRect, aAlign, + aFont, aColor, aIndex, aBaselineOffset ); + CleanupStack::PushL( self ); + self->ConstructL( aText ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmMarqueeAdapter::CMmMarqueeElement::ConstructL ( const TDesC& aText ) + { + iText = aText.AllocL(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmMarqueeAdapter::CMmMarqueeElement::SetupMarqueeControlL( + TInt aLoops, + TInt aScrollAmount, + TInt aScrollDelay ) + { + iMarqueeControl = CAknMarqueeControl::NewL( aLoops, aScrollAmount, aScrollDelay ); + iMarqueeControl->SetLoops(aLoops); + iLoops = aLoops; + iScrollAmount = aScrollAmount; + iScrollDelay = aScrollDelay; + } +// End of file + + + + diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmpostevaluationprocessor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmpostevaluationprocessor.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,128 @@ +/* +* 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 "mmpostevaluationprocessor.h" +#include "mmlistboxitemdrawer.h" +#include "mmlistboxmodel.h" +#include <layoutmetadata.cdl.h> + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmPostEvaluationProcessor::CMmPostEvaluationProcessor(CMmListBoxItemDrawer& aDrawer) : + CActive(EPriorityLess), iDrawer(aDrawer), iIndexToProcess(0) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmPostEvaluationProcessor* CMmPostEvaluationProcessor::NewLC(CMmListBoxItemDrawer& aDrawer) + { + CMmPostEvaluationProcessor* self = new ( ELeave ) CMmPostEvaluationProcessor(aDrawer); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmPostEvaluationProcessor* CMmPostEvaluationProcessor::NewL(CMmListBoxItemDrawer& aDrawer) + { + CMmPostEvaluationProcessor* self = CMmPostEvaluationProcessor::NewLC(aDrawer); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmPostEvaluationProcessor::ConstructL() + { + CActiveScheduler::Add( this); // Add to scheduler + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmPostEvaluationProcessor::~CMmPostEvaluationProcessor() + { + Cancel(); // Cancel any request, if outstanding + // Delete instance variables if any + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmPostEvaluationProcessor::DoCancel() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmPostEvaluationProcessor::RunL() + { + const TDesC8& mm_template = iDrawer.iMmModel->GetAttributeAsText( + iIndexToProcess, KMmTemplate8 ); + + if ( mm_template.Compare( KNullDesC8 ) && mm_template.Compare( KEmpty8 ) ) + { + iDrawer.SetupSubCellsL( EFalse, iIndexToProcess ); + delete iDrawer.ColumnData()->IconArray(); + iDrawer.ColumnData()->SetIconArray( NULL ); + } + + if ( ++iIndexToProcess < iDrawer.iMmModel->NumberOfItems() ) + { + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmPostEvaluationProcessor::RunError(TInt aError) + { + return aError; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmPostEvaluationProcessor::StartAt( TInt aIndex ) + { + Cancel(); + iIndexToProcess = aIndex; + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + } + +//End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmtemplatelibrary.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmtemplatelibrary.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1233 @@ +/* +* 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 "mmtemplatelibrary.h" +#include "mmlctutils.h" +#include "mmwidgetsconstants.h" +#include <hnutils.h> +#include <gdi.h> +#include <hnconvutils.h> +#include "menudebug.h" +#include <hnglobals.h> +#include <AknUtils.h> +#include <AknDef.hrh> + + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TUint32 HBuf16Hash( HBufC8* const & aBuf ) + { + return DefaultHash::Des8(*aBuf); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool HBuf16Ident( HBufC8* const & aL, HBufC8* const & aR ) + { + return DefaultIdentity::Des8(*aL, *aR); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +//: +CMmTemplateLibrary::CMmTemplateLibrary() + : iWidgetType(EWidgetTypeNone), + iTemplateSizesMap( &HBuf16Hash, &HBuf16Ident ), + iTemplateChildrenMap( &HBuf16Hash, &HBuf16Ident ), + iMoveIndicatorRectsMap( &HBuf16Hash, &HBuf16Ident ) + { + // No implementation required + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMmTemplateLibrary::~CMmTemplateLibrary() + { + CleanAndClearCache(); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmTemplateLibrary::CleanAndClearCache( ) + { + + THashMapIter<HBufC8*, TSize> iter( iTemplateSizesMap ); + while ( HBufC8* const * ptr = iter.NextKey() ) + { + delete *ptr; + } + iTemplateSizesMap.Close(); + + THashMapIter<HBufC8*, RArray<TTemplateChild> > iter2( iTemplateChildrenMap ); + while ( HBufC8* const * ptr = iter2.NextKey() ) + { + iter2.CurrentValue()->Close(); + delete *ptr; + } + iTemplateChildrenMap.Close(); + + THashMapIter<HBufC8*, TRect> iter4( iMoveIndicatorRectsMap ); + while ( HBufC8* const * ptr = iter4.NextKey() ) + { + delete *ptr; + } + iMoveIndicatorRectsMap.Close(); + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CMmTemplateLibrary* CMmTemplateLibrary::NewL() + { + CMmTemplateLibrary* self = CMmTemplateLibrary::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CMmTemplateLibrary* CMmTemplateLibrary::NewLC() + { + CMmTemplateLibrary* self = new( ELeave ) CMmTemplateLibrary(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmTemplateLibrary::ConstructL() + { + //No implementation needed. + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TSize CMmTemplateLibrary::GetSize( TMmWidgetType aWidgetType, const TDesC8& aTemplate, + TBool aLandscapeOrientation, TBool aHighlighted, TRect aParentRect ) + { + TSize result; + GetSize(result, aWidgetType, aTemplate, aLandscapeOrientation, + aHighlighted, aParentRect ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmTemplateLibrary::GetSize( TSize& aItemSize, + TMmWidgetType aWidgetType, const TDesC8& aTemplate, + TBool aLandscapeOrientation, TBool aHighlighted, TRect aParentRect ) + { + if ( KNullDesC8()== aTemplate || aParentRect == TRect(TPoint(0,0), TPoint(0,0)) + || !aTemplate.Compare( KEmpty8 ) ) + { + return KErrNotFound; + } + UpdateParentRect( aParentRect, aLandscapeOrientation ); + + TInt err( KErrNone ); + HBufC8* lookup_string = LookupText( aTemplate, aWidgetType, iZoom, + aLandscapeOrientation, aHighlighted ); + + TSize* itemSize = iTemplateSizesMap.Find( lookup_string ); + if ( !itemSize ) + { + TRAP( err, LoadTemplateL( aWidgetType, aTemplate, aLandscapeOrientation ) ); + if ( err == KErrNone ) + { + itemSize = iTemplateSizesMap.Find( lookup_string ); + if( !itemSize ) + { + User::Panic( KMtlPanic, KErrNotFound ); + } + aItemSize = *itemSize; + } + } + else + { + iWidgetType = aWidgetType; + TSize layoutSize; + TInt err( KErrNone ); + TRAP( err, layoutSize = GetLayoutSizeL( iWidgetType, aTemplate, + aLandscapeOrientation ) ); + if( err == KErrNone ) + { + AdjustItemSize( *itemSize, layoutSize, aLandscapeOrientation ); + } + aItemSize = *itemSize; + } + delete lookup_string; + + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TSize CMmTemplateLibrary::GetLayoutSizeL( TMmWidgetType aWidgetType, const TDesC8& aTemplate, + TBool aLandscapeOrientation ) + { + if ( KNullDesC8()== aTemplate ) + { + User::Leave( -1 ); + } + TSize* layoutSize = NULL; + switch ( aWidgetType ) + { + case EGrid: + { + HBufC8* lookup_string = LookupLayoutText( aWidgetType, iZoom, + aTemplate, aLandscapeOrientation ); + CleanupStack::PushL( lookup_string ); + layoutSize = iTemplateSizesMap.Find( lookup_string ); + if (!layoutSize) + { + LoadTemplateL( aWidgetType, aTemplate, aLandscapeOrientation ); + layoutSize = iTemplateSizesMap.Find( lookup_string ); + if( !layoutSize ) + User::Panic( KMtlPanic, -1); + } + CleanupStack::PopAndDestroy( lookup_string ); + } + + break; + case EListbox: + return TSize( MmListBox::KCols,0 ); + default: + User::Panic( KMtlPanic, -1); + } + return *layoutSize; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TRect CMmTemplateLibrary::GetMoveIndicatorRect(TMmWidgetType aWidgetType, + const TDesC8& aTemplate, TBool aLandscapeOrientation, + TBool aHighlighted) + { + ASSERT( KNullDesC8() != aTemplate && aTemplate.Compare( KEmpty8 ) ); + + HBufC8* lookup_string = LookupText(aTemplate, aWidgetType, iZoom, + aLandscapeOrientation, aHighlighted ); + HBufC8* lookup_indicator_string = LookupIndicatorText( *lookup_string ); + + TRect* itemRect = iMoveIndicatorRectsMap.Find( lookup_indicator_string ); + if (!itemRect) + { + TSize itemSize; + GetSize( itemSize, aWidgetType, aTemplate, aLandscapeOrientation, EFalse, GetParentRect( aLandscapeOrientation ) ); + TRAPD( err, SetupMoveIndicatorTemplateChildrenL( + *lookup_indicator_string, itemSize ) ); + if ( KErrNone == err ) + { + itemRect = iMoveIndicatorRectsMap.Find( lookup_indicator_string ); + if (!itemRect) + { + User::Panic( KMtlPanic, -1); + } + } + } + + delete lookup_indicator_string; + delete lookup_string; + return *itemRect; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmTemplateLibrary::GetChildrenL(TMmWidgetType aWidgetType, RArray< + TTemplateChild>& aArray, const TDesC8& aTemplate, + TBool aLandscapeOrientation, TBool aHighlighted, TBool aIsEditMode) + { + ASSERT( KNullDesC8() != aTemplate && aTemplate.Compare( KEmpty8 ) ); + + HBufC8* lookup_string = LookupText( aTemplate, aWidgetType, iZoom, + aLandscapeOrientation, aHighlighted ); + CleanupStack::PushL( lookup_string ); + RArray<TTemplateChild>* children = iTemplateChildrenMap.Find( lookup_string ); + if ( !children ) + { + LoadTemplateL( aWidgetType, aTemplate, aLandscapeOrientation ); + children = iTemplateChildrenMap.Find( lookup_string ); + if (!children) + { + User::Panic( KMtlPanic, -1); + } + } + CleanupStack::PopAndDestroy( lookup_string ); + for (TInt i = 0; i < children->Count(); i++) + aArray.AppendL((*children)[i]); + if ( aIsEditMode ) + { + TSize size = GetSize( aWidgetType, aTemplate, aLandscapeOrientation, aHighlighted, GetParentRect(aLandscapeOrientation) ); + AppendEditModeTemplateL( aArray, size ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmTemplateLibrary::GetMoveIndicatorChildrenL(TMmWidgetType aWidgetType, + RArray<TTemplateChild>& aArray, const TDesC8& aTemplate, + TBool aLandscapeOrientation, TBool aHighlighted) + { + ASSERT( KNullDesC8() != aTemplate && aTemplate.Compare( KEmpty8 ) ); + + HBufC8* lookup_string = LookupText(aTemplate, aWidgetType, iZoom, + aLandscapeOrientation, aHighlighted ); + CleanupStack::PushL( lookup_string ); + HBufC8* lookup_indicator_string = LookupIndicatorText( *lookup_string ); + CleanupStack::PushL( lookup_indicator_string ); + + RArray<TTemplateChild>* children = iTemplateChildrenMap.Find( lookup_indicator_string ); + if ( !children ) + { + TSize itemSize; + GetSize( itemSize, aWidgetType, aTemplate, aLandscapeOrientation, EFalse, GetParentRect( aLandscapeOrientation ) ); + SetupMoveIndicatorTemplateChildrenL( *lookup_indicator_string, itemSize ); + children = iTemplateChildrenMap.Find( lookup_indicator_string ); + if (!children) + User::Panic( KMtlPanic, -1); + } + + CleanupStack::PopAndDestroy( lookup_indicator_string ); + CleanupStack::PopAndDestroy( lookup_string ); + + for (TInt i = 0; i < children->Count(); i++) + { + aArray.AppendL((*children)[i]); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HBufC8* CMmTemplateLibrary::LookupText( const TDesC8& aTemplate, + TMmWidgetType aWidgetType, TAknUiZoom aZoom, TBool aLandscapeOrientation, + TBool aHighlighted ) + { + HBufC8* lookup_string = HBufC8::New( MmTemplateContants::KTemplateChildTextLength ); + if (lookup_string) + { + TPtr8 lookup_string_ptr( lookup_string->Des() ); + lookup_string_ptr.Append( aTemplate ); + lookup_string_ptr.Append( KColon8 ); + switch ( aWidgetType ) + { + case EListbox: + lookup_string_ptr.Append( KListbox8 ); + break; + case EGrid: + lookup_string_ptr.Append( KGrid8 ); + break; + } + lookup_string_ptr.Append( KColon8 ); + lookup_string_ptr.AppendNum( aLandscapeOrientation ); + lookup_string_ptr.Append( KColon8 ); + lookup_string_ptr.AppendNum( aHighlighted ); + lookup_string_ptr.Append( KColon8 ); + switch ( aZoom ) + { + case EAknUiZoomLarge : + lookup_string_ptr.Append( KZoomLarge8 ); + break; + case EAknUiZoomSmall : + lookup_string_ptr.Append( KZoomSmall8 ); + break; + default : + lookup_string_ptr.Append( KZoomNormal8 ); + break; + } + } + return lookup_string; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC8* CMmTemplateLibrary::LookupLayoutText( TMmWidgetType aWidgetType, + TAknUiZoom aZoom, const TDesC8& aTemplate, TBool aLandscapeOrientation ) + { + HBufC8* lookup_string = HBufC8::New( MmTemplateContants::KTemplateChildTextLength ); + if (lookup_string) + { + TPtr8 lookup_string_ptr( lookup_string->Des() ); + switch ( aWidgetType ) + { + case EListbox: + lookup_string_ptr.Append( KListbox8 ); + break; + case EGrid: + lookup_string_ptr.Append( KGrid8 ); + break; + } + lookup_string_ptr.Append( KColon8 ); + switch ( aZoom ) + { + case EAknUiZoomLarge: + lookup_string_ptr.Append( KZoomLarge8 ); + break; + case EAknUiZoomSmall : + lookup_string_ptr.Append( KZoomSmall8 ); + break; + default: + lookup_string_ptr.Append( KZoomNormal8 ); + break; + } + lookup_string_ptr.Append( KColon8 ); + lookup_string_ptr.Append( aTemplate ); + lookup_string_ptr.Append( KColon8 ); + lookup_string_ptr.AppendNum( aLandscapeOrientation ); + } + return lookup_string; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC8* CMmTemplateLibrary::LookupIndicatorText( const TDesC8& aLookupText ) + { + HBufC8* lookup_string = HBufC8::New( MmTemplateContants::KTemplateChildTextLength ); + if (lookup_string) + { + TPtr8 lookup_string_ptr( lookup_string->Des() ); + lookup_string_ptr.Append( KMI8 ); + lookup_string_ptr.Append( KColon8 ); + lookup_string_ptr.Append( aLookupText ); + } + + return lookup_string; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::LoadTemplateL( TMmWidgetType aWidgetType, + const TDesC8& aTemplate, TBool aLandscapeOrientation ) + { + iWidgetType = aWidgetType; + DEBUG(("_Mm_:CMmTemplateLibrary::LoadTemplateL IN")); + TMmTemplateType mmTemplateType; + HBufC8* content = GetTemplateContentL( aTemplate, aWidgetType, mmTemplateType ); + CleanupStack::PushL( content ); + RXmlEngDOMImplementation domImpl; + CleanupClosePushL( domImpl ); + RXmlEngDOMParser domParser; + CleanupClosePushL( domParser ); + DEBUG(("_Mm_:CMmTemplateLibrary::LoadTemplateL Opening domImpl")); + domImpl.OpenL(); + User::LeaveIfError( domParser.Open( domImpl ) ); + DEBUG(("_Mm_:CMmTemplateLibrary::LoadTemplateL parsing content...")); + RXmlEngDocument xmlDoc = domParser.ParseL( *content ); + CleanupClosePushL( xmlDoc ); + + // first orientation + RXmlEngNodeList<TXmlEngElement> orientElements; + CleanupClosePushL( orientElements ); + xmlDoc.DocumentElement().GetChildElements( orientElements ); + TXmlEngElement orientationElement; + while ( orientElements.HasNext() ) + { + orientationElement = orientElements.Next(); + DEBUG(("_Mm_:CMmTemplateLibrary::LoadTemplateL Reading orientation")); + TPtrC8 name = orientationElement.Name(); + DEBUG8(("\t_Mm_:orientation: %S", &name)); + if ( !name.Compare( KOrientation8 ) ) + { + TBool landscapeOrientation(EFalse); + if (orientationElement.AttributeValueL(KId8) == KLandscape8) + landscapeOrientation = ETrue; + if ( landscapeOrientation != aLandscapeOrientation ) + { + continue; + } + RXmlEngNodeList<TXmlEngElement> elements; + orientationElement.GetChildElements( elements ); + CleanupClosePushL( elements ); + TXmlEngElement element; + while ( elements.HasNext() ) + { + element = elements.Next(); + DEBUG(("_Mm_:iMmTemplateType != EMmTemplateMoveIndicator")); + if (element.AttributeValueL(KId8) == KHighlight8) + { + DEBUG(("_Mm_:AttributeValueL - id == highlight")); + ProcessElementL( mmTemplateType, element, aTemplate, landscapeOrientation, ETrue ); + DEBUG(("ProcesElementL END")); + } + else if (element.AttributeValueL(KId8) == KNoHighlight8) + { + DEBUG(("_Mm_:AttributeValueL - id == nohighlight")); + ProcessElementL( mmTemplateType, element, aTemplate, landscapeOrientation, EFalse ); + DEBUG(("ProcesElementL END")); + if ( aWidgetType == EGrid ) + { + DEBUG(("_Mm_:aWidgetType == EGrid")); + ProcessElementL( mmTemplateType, element, aTemplate, landscapeOrientation, ETrue ); + DEBUG(("ProcesElementL END")); + } + } + } + CleanupStack::PopAndDestroy( &elements ); + } + } + + CleanupStack::PopAndDestroy( &orientElements ); + CleanupStack::PopAndDestroy( &xmlDoc ); + CleanupStack::PopAndDestroy( &domParser ); + CleanupStack::PopAndDestroy( &domImpl ); + CleanupStack::PopAndDestroy(content); + DEBUG(("_Mm_:CMmTemplateLibrary::LoadTemplateL OUT")); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::ProcessElementL(TMmTemplateType aMmTemplateType, + TXmlEngElement aElement, + const TDesC8& aTemplate, + TBool aLandscapeOrientation, + TBool aHighlighted ) + { + switch ( aMmTemplateType ) + { + case ETemplateTypeLCT: + ProcessLCTTemplateElementL(aElement, aTemplate, aLandscapeOrientation, aHighlighted ); + break; + case ETemplateTypeCustom: + ProcessCustomTemplateElementL(aElement, aTemplate, aLandscapeOrientation, aHighlighted ); + break; + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::ProcessLCTTemplateElementL(TXmlEngElement aElement, + const TDesC8& aTemplate, + TBool aLandscapeOrientation, + TBool aHighlighted ) + { + RXmlEngNodeList<TXmlEngElement> layoutElements; + CleanupClosePushL( layoutElements ); + aElement.GetChildElements( layoutElements ); + TXmlEngElement layoutElement; + TSize itemSize; + while ( layoutElements.HasNext() ) + { + layoutElement = layoutElements.Next(); + + if ( !layoutElement.Name().Compare( KLayout8 ) ) + { + TPtrC8 lctAtt = layoutElement.AttributeValueL(KLct8); + + // set layout for grid + TInt variety; + if ( Zoom() == EAknUiZoomLarge && iWidgetType == EGrid) + { + HnConvUtils::Str8ToInt(layoutElement.AttributeValueL(KVarietyZoom8), variety); + } + else + { + HnConvUtils::Str8ToInt(layoutElement.AttributeValueL(KVariety8), variety); + } + + TSize layoutSize; + if ( iWidgetType == EGrid ) + { + layoutSize = MmLCTUtils::GetLayoutSize( lctAtt, variety ); + CacheLayoutSizeL( layoutSize, aTemplate, aLandscapeOrientation ); + } + else + { + layoutSize = GetLayoutSizeL( iWidgetType, aTemplate, aLandscapeOrientation ); + } + + TAknWindowLineLayout layout; + TSize itemSize = GetLCTSize( lctAtt, variety, layout, aLandscapeOrientation ); + + AdjustItemSize( itemSize, layoutSize, aLandscapeOrientation ); + HBufC8* lookup_string = LookupText( aTemplate, iWidgetType, iZoom, + aLandscapeOrientation, aHighlighted ); + iTemplateSizesMap.InsertL( lookup_string, itemSize ); + + // setup children + RArray< TTemplateChild > childrenDefinition; + CleanupClosePushL( childrenDefinition ); + RXmlEngNodeList<TXmlEngElement> childrenElements; + CleanupClosePushL( childrenElements ); + layoutElement.GetChildElements( childrenElements ); + TXmlEngElement childElement; + while ( childrenElements.HasNext() ) + { + childElement = childrenElements.Next(); + TPtrC8 name = childElement.Name(); + if ( !name.Compare( KTextVisual8 ) || + !name.Compare( KImageVisual8 ) ) + { + TTemplateChild childTemplate; + childTemplate.iLct = childElement.AttributeValueL(KLct8); + TInt variety; + if ( Zoom() != EAknUiZoomNormal && iWidgetType == EGrid ) + { + HnConvUtils::Str8ToInt(childElement.AttributeValueL(KVarietyZoom8), variety); + } + else + { + HnConvUtils::Str8ToInt(childElement.AttributeValueL(KVariety8), variety); + } + childTemplate.iVariety = variety; + + TPtrC8 ptr = childElement.AttributeValueL(KHAlign8); + if (!ptr.Compare(KNullDesC8)) + { + childTemplate.iHAlign = EManualAlignUndefined; + } + else if (!ptr.Compare(KLeft8)) + { + childTemplate.iHAlign = EManualAlignLeft; + } + else if (!ptr.Compare(KCenter8)) + { + childTemplate.iHAlign = EManualAlignCenter; + } + else if (!ptr.Compare(KRight8)) + { + childTemplate.iHAlign = EManualAlignRight; + } + + SetupLCTTemplateL( childTemplate, childElement, itemSize ); + childrenDefinition.AppendL( childTemplate ); + } + } + CleanupStack::PopAndDestroy( &childrenElements ); + // save children defintion in map + lookup_string = LookupText(aTemplate, iWidgetType, iZoom, + aLandscapeOrientation, aHighlighted ); + iTemplateChildrenMap.InsertL(lookup_string, childrenDefinition); + CleanupStack::Pop( &childrenDefinition ); + break; + } + } + CleanupStack::PopAndDestroy( &layoutElements ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::ProcessCustomTemplateElementL(TXmlEngElement aElement, + const TDesC8& aTemplate, + TBool aLandscapeOrientation, + TBool aHighlighted ) + { + RXmlEngNodeList<TXmlEngElement> layoutElements; + CleanupClosePushL( layoutElements ); + aElement.GetChildElements( layoutElements ); + TXmlEngElement layoutElement; + while ( layoutElements.HasNext() ) + { + layoutElement = layoutElements.Next(); + if ( !layoutElement.Name().Compare( KLayout8 ) ) + { + TSize itemSize; + // set sizes + TInt height; + TInt width; + HBufC8* lookup_string; + + HnConvUtils::Str8ToInt(layoutElement.AttributeValueL(KHeight8), height); + HnConvUtils::Str8ToInt(layoutElement.AttributeValueL(KWidth8), width); + lookup_string = LookupText( aTemplate, iWidgetType, iZoom, + aLandscapeOrientation, aHighlighted ); + itemSize = TSize( width, height ); + + + TSize layoutSize = ( aLandscapeOrientation ) ? + TSize( MmGrid::KColsLandscapeZoomNormal, MmGrid::KRowsLandscapeZoomNormal ): + TSize( MmGrid::KColsPortraitZoomNormal, MmGrid::KRowsPortraitZoomNormal ) ; + layoutSize = ( iWidgetType == EGrid ) ? layoutSize: TSize(MmListBox::KCols,0); + CacheLayoutSizeL( layoutSize, aTemplate, aLandscapeOrientation ); + + AdjustItemWidth( itemSize, layoutSize, aLandscapeOrientation ); + iTemplateSizesMap.InsertL(lookup_string, itemSize); + + // set children + RArray< TTemplateChild > childrenDefinition; + CleanupClosePushL( childrenDefinition ); + + RXmlEngNodeList<TXmlEngElement> childrenElements; + CleanupClosePushL( childrenElements ); + layoutElement.GetChildElements( childrenElements ); + TXmlEngElement childElement; + while ( childrenElements.HasNext() ) + { + childElement = childrenElements.Next(); + TPtrC8 name = childElement.Name(); + if ( !name.Compare( KTextVisual8 ) || + !name.Compare( KImageVisual8 ) ) + { + TTemplateChild childTemplate; + SetupCustomTemplateL( childTemplate, childElement ); + childrenDefinition.AppendL( childTemplate ); + } + } + CleanupStack::PopAndDestroy( &childrenElements ); + // save children defintion in map + lookup_string = LookupText(aTemplate, iWidgetType, iZoom, + aLandscapeOrientation, aHighlighted ); + iTemplateChildrenMap.InsertL(lookup_string, childrenDefinition); + CleanupStack::Pop( &childrenDefinition ); + // we found first layout, it is enough + break; + } + } + CleanupStack::PopAndDestroy( &layoutElements ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC8* CMmTemplateLibrary::GetTemplateContentL(const TDesC8& aTemplate, + TMmWidgetType aWidgetType, TMmTemplateType& aMmTemplateType) + { + HBufC8* content; + TRAPD( err , GetTemplateFileContentL( content, aTemplate, aWidgetType, aMmTemplateType ) ); + if ( KErrNone != err || !content ) + { +// if LCT template was not loaded try to load a custom template + TRAPD( err , GetTemplateFileContentL( content, aTemplate, aWidgetType, aMmTemplateType, ETrue ) ); + if ( KErrNoMemory == err ) + { + User::Leave( KErrNoMemory ); + } + if ( KErrNone != err || !content ) + { + User::Panic(KMtlPanic, -1); + } + } + return content; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::GetTemplateFileContentL( HBufC8*& aContent, + const TDesC8& aTemplate, TMmWidgetType aWidgetType, + TMmTemplateType& aMmTemplateType, TBool aLoadCustomTemplate ) + { + DEBUG(("_Mm_:CMmTemplateLibrary::GetTemplateContentL IN")); + TFileName filename; +// create filename egz: akn_logical_template_3.xml + filename.Copy(aTemplate); + filename.Insert(0, KUnderline ); + filename.Insert(0, KAkn ); + filename.Append( KXmlExt ); + +// append path egz: z:\\resource\\grid\\lct\\akn_logical_template_3.xml + + if ( !aLoadCustomTemplate ) + { + filename.Insert(0, KBslash ); + filename.Insert(0, KLct ); + } + else + { + filename.Insert(0, KBslash ); + filename.Insert(0, KCustom ); + } + + switch (aWidgetType) + { + case EGrid: + filename.Insert(0, KBslash ); + filename.Insert(0, KWidgetTypeGrid); + break; + case EListbox: + filename.Insert(0, KBslash ); + filename.Insert(0, KWidgetTypeList ); + break; + } + + filename.Insert(0, KZResource ); + + DEBUG(("\t_Mm_:tail: %S", &filename)); + DEBUG(("_Mm_:CMmTemplateLibrary::GetTemplateContentL OUT")); + +// load LCT Template or if it does not exist then load custom template + aContent = HnUtils::ReadFileLC(filename); + CleanupStack::Pop( aContent ); + + if ( aLoadCustomTemplate ) + { + aMmTemplateType = ETemplateTypeCustom; + } + else + { + aMmTemplateType = ETemplateTypeLCT; + } + return; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TSize CMmTemplateLibrary::GetLCTSize( const TDesC8& aLCTTemplate, TInt aVariety, + TAknWindowLineLayout& aWindowLayout, TBool aLandscapeOrientation ) + { + TSize size = MmLCTUtils::GetLCTSize( aLCTTemplate, aVariety, + GetParentRect( aLandscapeOrientation ), aWindowLayout ); + return size; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::SetupLCTTemplateL(TTemplateChild& aChildTemplate, + TXmlEngElement& aChildElement, TSize aItemSize ) + { + TPtrC8 name = aChildElement.Name(); + aChildTemplate.iData = aChildElement.AttributeValueL(KId8); + SetupTemplateVisualId( aChildTemplate ); + + // read attribute name (mm_title, mm_icon) + RXmlEngNodeList<TXmlEngElement> attributeElements; + CleanupClosePushL( attributeElements ); + aChildElement.GetChildElements( attributeElements ); + TXmlEngElement attElement; + while ( attributeElements.HasNext() ) + { + attElement = attributeElements.Next(); + TPtrC8 nameAtt = attElement.AttributeValueL(KName8); + if ( !name.Compare( KTextVisual8 ) && + !nameAtt.Compare( KText8 ) ) + { + MmLCTUtils::SetupTextSubCellTemplate( aItemSize, aChildTemplate ); + } + else if ( !name.Compare( KImageVisual8 ) && + !nameAtt.Compare( KImagePath8 ) ) + { + MmLCTUtils::SetupGraphicSubCellTemplate(aItemSize, aChildTemplate); + AdjustIconPosition(aItemSize, aChildTemplate); + } + } + CleanupStack::PopAndDestroy( &attributeElements ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::SetupCustomTemplateL(TTemplateChild& aChildTemplate, + TXmlEngElement& aChildElement) + { + TPtrC8 name = aChildElement.Name(); + TInt positionx; TInt positiony; + TInt height; TInt width; + + HnConvUtils::Str8ToInt(aChildElement.AttributeValueL(KPositionX8), positionx); + HnConvUtils::Str8ToInt(aChildElement.AttributeValueL(KPositionY8), positiony); + HnConvUtils::Str8ToInt(aChildElement.AttributeValueL(KHeight8), height); + HnConvUtils::Str8ToInt(aChildElement.AttributeValueL(KWidth8), width); + aChildTemplate.iRectAccordingToParent = TRect( TPoint(positionx,positiony), TSize(width, height) ); + + aChildTemplate.iData = aChildElement.AttributeValueL(KId8); + SetupTemplateVisualId( aChildTemplate ); + + // read attribute name (mm_title, mm_icon) + RXmlEngNodeList<TXmlEngElement> attributeElements; + CleanupClosePushL( attributeElements ); + aChildElement.GetChildElements( attributeElements ); + TXmlEngElement attElement; + while ( attributeElements.HasNext() ) + { + attElement = attributeElements.Next(); + TPtrC8 nameAtt = attElement.AttributeValueL(KName8); + if ( !name.Compare( KTextVisual8 ) && + !nameAtt.Compare( KText8 ) ) + { + aChildTemplate.iIsImage = EFalse; + } + else if ( !name.Compare( KImageVisual8 ) && + !nameAtt.Compare( KImagePath8 ) ) + { + aChildTemplate.iIsImage = ETrue; + aChildTemplate.iFontId = EAknLogicalFontSecondaryFont; + aChildTemplate.iTextAlign = CGraphicsContext::ELeft ; + } + else if ( !name.Compare( KTextVisual8 ) && + !nameAtt.Compare( KStyle8 ) ) + { + TPtrC8 font = attElement.AttributeValueL(KTargetValue8); + if ( !font.Compare( KQfnPrimarySmall8 ) ) + { + aChildTemplate.iFontId = EAknLogicalFontPrimarySmallFont; + } + else + { + aChildTemplate.iFontId = EAknLogicalFontSecondaryFont; + } + } + else if ( !name.Compare( KTextVisual8 ) && + !nameAtt.Compare( KHorizontalAlign8 ) ) + { + TInt textAlign; + HnConvUtils::Str8ToInt(attElement.AttributeValueL(KTargetValue8), textAlign); + aChildTemplate.iTextAlign = static_cast<CGraphicsContext::TTextAlign>(textAlign); + } + } + + CleanupStack::PopAndDestroy( &attributeElements ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::SetupTemplateVisualId(TTemplateChild& aChildTemplate ) + { + if( !aChildTemplate.iData.Compare( KMmBackdropIcon8 )) + { + aChildTemplate.iImageVisualId = EImageVisualIdEditMode; + } + else + { + aChildTemplate.iImageVisualId = EImageVisualIdNormalMode; + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::AppendEditModeTemplateL( + RArray<TTemplateChild>& aTemplateArray, TSize aSize) + { + //setup backdrop icon + TTemplateChild childTemplate; + childTemplate.iIsImage = ETrue; + childTemplate.iFontId = EAknLogicalFontSecondaryFont; + childTemplate.iTextAlign = CGraphicsContext::ELeft; + childTemplate.iRectAccordingToParent = TRect( TPoint( 0,0 ), + TPoint( aSize.iWidth, aSize.iHeight ) ); + childTemplate.iData = TBufC8< MmTemplateContants::KTemplateChildTextLength >( KMmBackdropIcon8 ); + SetupTemplateVisualId( childTemplate ); + aTemplateArray.AppendL( childTemplate ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::SetupMoveIndicatorTemplateChildrenL( + const TDesC8& aLookupString, TSize aItemSize ) + { + RArray< TTemplateChild > childrenDefinition; + TTemplateChild childTemplate; + childTemplate.iIsImage = ETrue; + childTemplate.iImageVisualId = EImageVisualIdNormalMode; + childTemplate.iFontId = EAknLogicalFontSecondaryFont; + childTemplate.iTextAlign = CGraphicsContext::ELeft; + TPoint startingPosition = TPoint( + MmTemplateContants::KMoveIndicatorStartingPos, + MmTemplateContants::KMoveIndicatorStartingPos); + + //setup move_indicator_arrow_left + childTemplate.iRectAccordingToParent = TRect(TPoint(0,aItemSize.iHeight/2 + startingPosition.iY/2), + TPoint(startingPosition.iX, + startingPosition.iY*3/2 + aItemSize.iHeight/2)); + childTemplate.iData = TBufC8< MmTemplateContants::KTemplateChildTextLength>( + KMmMoveIndicatorArrowLeft8 ); + childrenDefinition.AppendL( childTemplate ); + + //setup move_indicator_arrow_right + childTemplate.iRectAccordingToParent = TRect( + TPoint(startingPosition.iX + aItemSize.iWidth , aItemSize.iHeight/2 + startingPosition.iY/2), + TPoint(startingPosition.iX*2 + aItemSize.iWidth, + startingPosition.iY*3/2 + aItemSize.iHeight/2)); + childTemplate.iData = TBufC8< MmTemplateContants::KTemplateChildTextLength>( + KMmMoveIndicatorArrowRight8 ); + childrenDefinition.AppendL( childTemplate ); + + //setup move_indicator_arrow_top + childTemplate.iRectAccordingToParent = TRect(TPoint( aItemSize.iWidth/2 + startingPosition.iX/2, 0 ), + TPoint(aItemSize.iWidth/2 + startingPosition.iX*3/2, startingPosition.iY)); + childTemplate.iData = TBufC8< MmTemplateContants::KTemplateChildTextLength >( + KMmMoveIndicatorArrowTop8 ); + childrenDefinition.AppendL( childTemplate ); + + //setup move_indicator_arrow_bottom + childTemplate.iRectAccordingToParent = TRect( TPoint( aItemSize.iWidth/2 + startingPosition.iX/2, + aItemSize.iHeight + startingPosition.iY + 2 ), + TPoint(aItemSize.iWidth/2 + startingPosition.iX*3/2, + aItemSize.iHeight + 2 *startingPosition.iY)); + childTemplate.iData = TBufC8< MmTemplateContants::KTemplateChildTextLength>( + KMmMoveIndicatorArrowBottom8 ); + childrenDefinition.AppendL( childTemplate ); + + HBufC8* lookup_string = aLookupString.AllocLC(); + iTemplateChildrenMap.InsertL(lookup_string, childrenDefinition); + CleanupStack::Pop( lookup_string ); + lookup_string = NULL; + + lookup_string = aLookupString.AllocLC(); + TRect rectAccordingToParent = TRect( + TPoint( -startingPosition.iX, -startingPosition.iY), + TPoint(2*startingPosition.iX + aItemSize.iWidth , + 2*startingPosition.iY + aItemSize.iHeight) ); + + iMoveIndicatorRectsMap.InsertL( lookup_string, rectAccordingToParent ); + CleanupStack::Pop( lookup_string ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::SetScrollbarVisibilityL( TBool aIsScrollbarVisible ) + { + if ( iIsScrollbarVisible != aIsScrollbarVisible ) + { + iIsScrollbarVisible = aIsScrollbarVisible; + CleanAndClearCache(); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmTemplateLibrary::GetScrollbarVisibility() + { + return iIsScrollbarVisible; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::SetScrollbarWidthL( TInt aScrollbarWidth ) + { + if ( iIsScrollbarVisible ) + { + if ( iScrollbarWidth != aScrollbarWidth ) + { + iScrollbarWidth = aScrollbarWidth; + CleanAndClearCache(); + } + } + else + { + if ( iScrollbarWidth != 0 ) + { + iScrollbarWidth = 0; + CleanAndClearCache(); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmTemplateLibrary::ScrollbarWidth() + { + return iScrollbarWidth; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::AdjustItemWidth(TSize& aItemSize, TSize aLayoutSize, + TBool aLandscapeOrientation) + { + if ( iIsScrollbarVisible ) + { + aItemSize.iWidth = ( GetParentRect(aLandscapeOrientation).Width() - iScrollbarWidth ) / aLayoutSize.iWidth; + } + else + { + aItemSize.iWidth = GetParentRect(aLandscapeOrientation).Width() / aLayoutSize.iWidth; + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::UpdateParentRect( TRect aParentRect, TBool aLandscapeOrientation ) + { + if( GetParentRect( aLandscapeOrientation ) != aParentRect ) + { + SetParentRect( aLandscapeOrientation, aParentRect ); + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TRect CMmTemplateLibrary::GetParentRect( TBool aLandscapeOrientation ) + { + if ( aLandscapeOrientation ) + return iParentRectLandscape; + else + return iParentRectPortrait; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::SetParentRect( TBool aLandscapeOrientation, TRect aParentRect) + { + if ( aLandscapeOrientation ) + iParentRectLandscape = aParentRect; + else + iParentRectPortrait = aParentRect; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::AdjustItemSize(TSize& aItemSize, TSize aLayoutSize, + TBool aLandscapeOrientation) + { + switch ( iWidgetType ) + { + case EGrid: + aItemSize.iHeight = GetParentRect( aLandscapeOrientation ).Height() / aLayoutSize.iHeight; + break; + case EListbox: + break; + } + AdjustItemWidth( aItemSize, aLayoutSize, aLandscapeOrientation ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TAknUiZoom CMmTemplateLibrary::Zoom( ) + { + return iZoom; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::SetZoom( TAknUiZoom aZoom ) + { + if ( (EAknUiZoomLarge == aZoom) + || (EAknUiZoomSmall == aZoom) ) + { + iZoom = aZoom; + } + else + { + iZoom = EAknUiZoomNormal; + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::CacheLayoutSizeL(TSize aLayoutSize, + const TDesC8& aTemplate, TBool aLandscapeOrientation) + { + HBufC8* lookup_layout_text = LookupLayoutText( iWidgetType, iZoom, + aTemplate, aLandscapeOrientation ); + + if ( iTemplateSizesMap.Find( lookup_layout_text ) ) + { + delete lookup_layout_text; + } + else + { + iTemplateSizesMap.InsertL( lookup_layout_text, aLayoutSize ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmTemplateLibrary::AdjustIconPosition(TSize aParentSize, + TTemplateChild& aTemplateChild) + { + switch (aTemplateChild.iHAlign) + { + case EManualAlignLeft: + break; + case EManualAlignCenter: + { + TInt rectWidth = + aTemplateChild.iRectAccordingToParent.Size().iWidth; + TInt lX = (aParentSize.iWidth - rectWidth) / 2; + aTemplateChild.iRectAccordingToParent.Move(lX + - aTemplateChild.iRectAccordingToParent.iTl.iX, 0); + break; + } + case EManualAlignRight: + break; + default: + break; + } + } + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,2095 @@ +/* +* 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_71.1.17.1.42 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#include <e32keys.h> +#include <e32math.h> +#include <AknsDrawUtils.h> +#include <layoutmetadata.cdl.h> +#include <aknlongtapdetector.h> + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST +#include <aknlistloadertfx.h> +#include <aknlistboxtfxinternal.h> +#include <aknlistboxtfx.h> +#endif + +#include "mmwidgetcontainer.h" +#include "mmlistboxmodel.h" +#include "mmmarqueeadapter.h" +#include "mmwidgetobserver.h" +#include "mmhighlighttimer.h" +#include "mmvisibilityobserver.h" +#include "mmlistboxcontainer.h" +#include "mmgridcontainer.h" +#include "mmlistboxitemdrawer.h" +#include "mmmarqueeadapter.h" +#include "mmfloatingitem.h" +#include "hnsuitemodel.h" +#include "hnitemsorder.h" +#include "menudebug.h" +#include "mmdraweranimator.h" +#include "hnglobals.h" +#include "mmpostevaluationprocessor.h" +#include "mmgrid.h" +#include "mmlongtapobserver.h" + +class CMmTemplateLibrary; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TMmWidgetPosition::TMmWidgetPosition() + : iVerticalItemOffset( 0 ) + , iTopItemIndex( KErrNotFound ) + , iValid( EFalse ) + , iLandscape( EFalse ) + , iHighlightedItemId( KErrNotFound ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMmWidgetContainer* CMmWidgetContainer::NewGridContainerL( const TRect& aRect, + MObjectProvider* aObjectProvider, CMmTemplateLibrary* aLibrary ) + { + return CMmGridContainer::NewL( aRect, aObjectProvider, aLibrary ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMmWidgetContainer* CMmWidgetContainer::NewListBoxContainerL( const TRect& aRect, + MObjectProvider* aObjectProvider, CMmTemplateLibrary* aTemplateLibrary ) + { + return CMmListBoxContainer::NewL( aRect, aObjectProvider, aTemplateLibrary ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::ConstructL() + { + if ( AknLayoutUtils::PenEnabled() ) + { + iTimer = CMmHighlightTimer::NewL( this ); + } + iBgContext = CAknsBasicBackgroundControlContext::NewL( + KAknsIIDQsnBgAreaMainAppsGrid, Rect(), EFalse); + iLongTapDetector = CAknLongTapDetector::NewL( this ); + iLongTapDetector->EnableLongTapAnimation(ETrue); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmWidgetContainer::CMmWidgetContainer() + : iIsFaded( EFalse ) + , iHasFocus( ETrue ) + , iInForeground( ETrue ) + { + iMarqueeAdapter = NULL; + iBgContext = NULL; + iWidgetPositionCache.iValid = EFalse; + iLongTapInProgress = EFalse; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMmWidgetContainer::~CMmWidgetContainer() + { + AknsUtils::DeregisterControlPosition( this ); + AknsUtils::DeregisterControlPosition( this->iWidget ); + delete iTimer; + delete iBgContext; + delete iPostProcessor; + delete iLongTapDetector; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::SizeChanged() + { + if ( iWidget && iWidgetRect != Rect() ) + { + CMmTemplateLibrary * templateLibrary = + static_cast<CMmListBoxItemDrawer*> ( + 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 ) + { + TRect rect = iCoeEnv->ScreenDevice()->SizeInPixels(); + iBgContext->SetRect( rect ); + SetItemDrawerAndViewBgContext( iBgContext ); + } + + AknsUtils::RegisterControlPosition( this ); + AknsUtils::RegisterControlPosition( this->iWidget ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::Draw( const TRect& /*aRect*/ ) const + { + // do nothing + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TTypeUid::Ptr CMmWidgetContainer::MopSupplyObject(TTypeUid aId) + { + if (aId.iUid == MAknsControlContext::ETypeId && iBgContext ) + { + return MAknsControlContext::SupplyMopObject(aId, iBgContext ); + } + + return CCoeControl::MopSupplyObject(aId); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::HandleButtonDownL(const TPointerEvent& aPointerEvent ) + { + iTapPoint = aPointerEvent.iPosition; + iLastDragPoint = aPointerEvent.iPosition; + iLastDragHighlight = GetHighlight(); + if( !iWidget->View()->XYPosToItemIndex( + aPointerEvent.iPosition, iDraggedIndex ) ) + { + iDraggedIndex = KErrNotFound; + } + iItemRelativeTapPoint = aPointerEvent.iPosition - iWidget->View()->ItemPos( + iDraggedIndex ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::HandleButtonUpL(const TPointerEvent& /*aPointerEvent*/ ) + { + iTapPoint = TPoint( 0, 0 ); + CancelDragL( EFalse ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::HandleResourceChange( TInt aType ) + { + if ( aType == KEikDynamicLayoutVariantSwitch || + aType == KAknsMessageSkinChange ) + { + static_cast<CMmListBoxItemDrawer*>( iDrawer )->InvalidateCache(); + } + + CCoeControl::HandleResourceChange( aType ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::ItemIconZoomL( TInt /*aItemIndex */) + { + TInt index = GetHighlight(); + if (index != iDraggedIndex) + { + iDrawer->AnimateItemZoomInL( index ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CHnSuiteModel* CMmWidgetContainer::GetSuiteModelL() + { + return GetMmModel()->GetSuiteModel(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::HandleDragL(const TPointerEvent& aPointerEvent, + TBool aAbortAnimation ) + { + DEBUG(("\t_Mm_:CMmWidgetContainer::HandleDragL: iLastDragHighlight = %d ", + iLastDragHighlight )); + + TInt highlight = GetHighlight(); + DEBUG(("\t_Mm_:CMmWidgetContainer::HandleDragL: highlight = %d ", highlight )); + + TPoint dragDelta ( iLastDragPoint - aPointerEvent.iPosition); + TInt dragSpeed = dragDelta.iX * dragDelta.iX + dragDelta.iY * dragDelta.iY; + TBool tooFast = (dragSpeed > MmEffects::KDragSpeedIgnoreThreshold); + + if (iLastDragHighlight != highlight ) + { + iDragAndDropObserver->HandleDragOverL( GetHighlight() ); + } + + 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 ( DeltaSquare( iTapPoint, aPointerEvent.iPosition ) > KDragDelta && + !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 )); + iLastDragPoint = aPointerEvent.iPosition; + iLastDragHighlight = highlight; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::AnimateShiftL(TInt aHighlight) + { + TInt lowerVal = (iDraggedIndex < aHighlight)? iDraggedIndex : aHighlight; + TInt higherVal = (iDraggedIndex < aHighlight)? aHighlight : iDraggedIndex; + 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 ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::CancelDragL( TBool aAnimate ) + { + if (aAnimate) + { + iDrawer->AnimateDragItemTransitionL(); + } + + SetHighlightAfterDrag(); + + iDraggedIndex = -1; + iDrawer->SetDraggedIndexL( iDraggedIndex, TPoint(0,0) ); + SetDraggableL( EFalse ); + + TInt dragFloatingItem; + do + { + dragFloatingItem = iDrawer->GetFloatingItemIndex( EDrag ); + iDrawer->RemoveFloatingItem( dragFloatingItem ); + } + while ( dragFloatingItem != KErrNotFound ); + + iDrawer->GetAnimator()->CancelNextRedrawL(); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +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; + } + } + + return result; + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +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; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::SetHasFocusL( TBool aHasFocus ) + { + if ( !!aHasFocus != !!iHasFocus ) // logical Ex-OR + { + iHasFocus = aHasFocus; + StartOrStopMarquee(); + } + if ( !aHasFocus ) + { + ASSERT(iTimer); + iTimer->StopL(); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::SetIsFaded( TBool aIsFaded ) + { + if ( !!aIsFaded != !!iIsFaded ) // logical Ex-OR + { + iIsFaded = aIsFaded; + StartOrStopMarquee(); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +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; + + 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; + } + } + + 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; + } + } + + if (!isAnimated) + { + if ( ( !aDraggedItemOverIcons && IsFolderL( iLastDragHighlight ) ) || + iLastDragHighlight != Widget()->CurrentItemIndex() ) + { + iDrawer->AnimateItemZoomOutL( iLastDragHighlight ); + } + } + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::HandlePointerEventsInEditModeL( + const TPointerEvent& aPointerEvent, TBool aAbortAnimations ) + { + + TInt pointedItem = KErrNotFound; + TBool draggedItemOverIcons = iWidget->View()->XYPosToItemIndex( + aPointerEvent.iPosition, pointedItem ); + + if (aPointerEvent.iType == TPointerEvent::EButton1Down) + { +//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) + { +//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; + } + + if (GetHighlight() != Widget()->CurrentItemIndex() ) + { + SetHighlightL( Widget()->CurrentItemIndex() ); + } + + ManageFolderZoomingL( draggedItemOverIcons ); + + HandleDragL(pointerEvent, aAbortAnimations); + + } + else if (aPointerEvent.iType == TPointerEvent::EButton1Up && iDrawer->IsDraggable()) + { + if ( !draggedItemOverIcons ) + { + SetManualHighlightL( iDraggedIndex ); + } + + iDragAndDropObserver->HandleDragStopL( GetHighlight() ); + HandleButtonUpL(aPointerEvent); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::HandlePointerEventL(const TPointerEvent& aPointerEvent ) + { + if ( iMarqueeAdapter && aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + iMarqueeAdapter->StopMarqueeDrawing(); + } + + TInt index = KErrNotFound; + TBool itemExists = iWidget->View()->XYPosToItemIndex( aPointerEvent.iPosition, index ); + + 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 ) + { + iTimer->StopL(); + if ( IsEditMode() ) + { + SetHighlightL( index ); + } + } + } + else + { + iTimer->StopL(); + } + } + + TInt lastTopItemIndex = Widget()->TopItemIndex(); + + TBool abortAnimation = lastTopItemIndex != Widget()->TopItemIndex(); + + if (abortAnimation) + { + iDrawer->GetAnimator()->CancelAnimationsL(); + } + + if ( IsEditMode() && iDragAndDropObserver ) + { + HandlePointerEventsInEditModeL(aPointerEvent, abortAnimation); + } + + if ( iLongTapDetector ) + { + TPointerEvent longTapPointerEvent = aPointerEvent; + if ( aPointerEvent.iType == TPointerEvent::EButtonRepeat ) + { + longTapPointerEvent.iType = TPointerEvent::EDrag; + } + iLongTapDetector->PointerEventL( longTapPointerEvent ); + } + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +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 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::SetDraggableL( TBool aDraggable ) + { + + iDrawer = STATIC_CAST(CMmListBoxItemDrawer*, iWidget->View()->ItemDrawer()); + iDrawer->SetDraggableL( aDraggable ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmWidgetContainer::IsEditMode() const + { + return iIsEditMode; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::SetEditModeL( TBool aIsEditMode ) + { + iIsEditMode = aIsEditMode; + StartOrStopMarquee(); + + ASSERT(iDrawer); + iDrawer->SetEditModeL( 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 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::SetHighlightVisibilityL( TBool aEnable ) + { + // activate the model + CHnSuiteModel* suiteModel = GetMmModel()->GetSuiteModel(); + + if ( suiteModel ) + { + suiteModel->SetActiveL( aEnable ); + } +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( + iDrawer->Gc() ); +#endif + if ( !aEnable ) + { + iWidget->View()->ItemDrawer()->SetFlags( + CListItemDrawer::EDisableHighlight ); +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( transApi ) + { + transApi->Remove( MAknListBoxTfxInternal::EListHighlight ); + } +#endif + } + else + { + iWidget->View()->ItemDrawer()->ClearFlags( + CListItemDrawer::EDisableHighlight ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------- ------------------------------ +// +EXPORT_C TBool CMmWidgetContainer::IsHighlightVisible() + { + return IsTimerActive(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMmWidgetContainer::IsDraggable() + { + iDrawer = STATIC_CAST(CMmListBoxItemDrawer*, iWidget->View()->ItemDrawer()); + return iDrawer->IsDraggable(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmWidgetContainer::CountComponentControls() const + { + return 1; + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +CCoeControl* CMmWidgetContainer::ComponentControl(TInt aIndex) const + { + switch( aIndex ) + { + case 0: + return iWidget; + default: + return NULL; + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMmWidgetContainer::NumberOfItems() + { + return GetMmModel()->NumberOfItems(); + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::SetObserver( MMmWidgetObserver* aObserver ) + { + //iWidget->SetListBoxObserver( aObserver ); + iListBoxObserver = aObserver; + iKeyEventObserver = aObserver; + iDragAndDropObserver = aObserver; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMmWidgetContainer::GetPreviousHighlight() + { + return iPreviousHighlight; + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMmWidgetContainer::GetHighlight( ) + { + return iCurrentHighlight; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::SetManualHighlightL( TInt aItemIndex, + TBool aRedraw ) + { + SetHighlightL( aItemIndex ); + + if ( aItemIndex >= 0 && aItemIndex < GetMmModel()->NumberOfItems() ) + { + if ( aItemIndex != iWidget->CurrentItemIndex() ) + { + iWidget->View()->SetCurrentItemIndex( aItemIndex ); + } + + if ( aRedraw ) + { + iWidget->SetCurrentItemIndex( aItemIndex ); + iWidget->DrawNow(); + } + } + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::SetHighlightL( TInt aItemIndex ) + { + ASSERT( aItemIndex >= KErrNotFound ); + + if (aItemIndex == KErrNotFound) + { + iCurrentHighlight = iPreviousHighlight = KErrNotFound; + SetDefaultHighlightL( EFalse ); + } + else if (aItemIndex >= 0 && aItemIndex < GetMmModel()->NumberOfItems()) + { + iPreviousHighlight = iCurrentHighlight; + iCurrentHighlight = aItemIndex; + + if ( iPreviousHighlight != iCurrentHighlight ) + { + HideOptionsMenuIfDisplayed(); + } + + CHnSuiteModel* suiteModel = GetMmModel()->GetSuiteModel(); + + if (suiteModel) + { + suiteModel->SetSuiteHighlightL( iCurrentHighlight ); + } + } + + + if ( IsEditMode() ) + { + TMmFloatingItem postDragCurrent( GetHighlight(), + Widget()->View()->ItemPos( GetHighlight() ), + EPostHighlightChangeRefreshItem, + MmEffects::KNoAnimationFramesCount, Widget()->View() ); + + iDrawer->AddFloatingItemL( postDragCurrent ); + + if ( GetPreviousHighlight() != GetHighlight() ) + { + TMmFloatingItem postDragPrevious( GetPreviousHighlight(), + Widget()->View()->ItemPos( GetPreviousHighlight() ), + EPostHighlightChangeRefreshItem, + MmEffects::KNoAnimationFramesCount, Widget()->View() ); + + iDrawer->AddFloatingItemL( postDragPrevious ); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmWidgetContainer::PointInItemReorderAreaL( + TInt aItemIndex, TPoint aPoint ) + { + TRect itemRect = GetItemRectL( aItemIndex ); + itemRect.Shrink( MmEffects::KShiftRatio * itemRect.Width(), + MmEffects::KShiftRatio * itemRect.Height() ); + return itemRect.Contains( aPoint ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::HideOptionsMenuIfDisplayed() + { + CEikMenuBar* menuBar = CEikonEnv::Static()->AppUiFactory()->MenuBar(); + if ( menuBar && menuBar->IsDisplayed() ) + { + menuBar->StopDisplayingMenuBar(); + } + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::SetFlag(TInt /*Flag*/) + { + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +CEikListBox* CMmWidgetContainer::Widget() + { + return iWidget; + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +TKeyResponse CMmWidgetContainer::OfferKeyEventL(const TKeyEvent &aKeyEvent, + TEventCode aType) + { + TKeyResponse resp = EKeyWasNotConsumed; + + TBool highlightVisibleWhenEventReceived = IsHighlightVisible(); + + if ( IsEditMode() && IsDraggable() ) + return resp; + + resp = HandleKeyEventL( aKeyEvent, aType ); + if ( iMarqueeAdapter && ( aType == EEventKeyDown ) ) + { + iMarqueeAdapter->StopMarqueeDrawing(); + } + + 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 (aType == EEventKey ) + { + TInt prevIndex = GetHighlight(); + static_cast<CMmListBoxItemDrawer*>(iDrawer)->SetHighlightShown( EFalse ); + resp = iWidget->OfferKeyEventL( aKeyEvent, aType ); + static_cast<CMmListBoxItemDrawer*>(iDrawer)->SetHighlightShown( ETrue ); + SetHighlightL( iWidget->CurrentItemIndex() ); + ScrollViewIfNeededL(); //only edit mode non-touch + + if ( prevIndex != GetHighlight() + && KErrNotFound != prevIndex ) + { + iDraggedIndex = prevIndex; + iDragAndDropObserver->HandleDragStartL( iDraggedIndex ); + GetMmModel()->ReorderModelL( iDraggedIndex, GetHighlight() ); + iDrawer->AnimateItemSwapL( iDraggedIndex , GetHighlight() ); + AnimateShiftL( GetHighlight() ); + } + return resp; + } + } + + if ( resp == EKeyWasNotConsumed ) + { +// here is a workaround for avkon to enable cursor movement we need to set highlight visibility +// to ETrue so that single click implementation in avkon will change the current item index. + SetHighlightVisibilityL(ETrue); //workaround + resp = iWidget->OfferKeyEventL( aKeyEvent, aType ); + SetHighlightVisibilityL(EFalse);//workaround + } + + if ( iKeyEventObserver ) + { + resp = iKeyEventObserver->HandleKeyPressedL( aKeyEvent, aType ); + } + + if ( ( aKeyEvent.iScanCode == EStdKeyDevice3 || + aKeyEvent.iScanCode == EStdKeyEnter || + aKeyEvent.iScanCode == EStdKeyNkpEnter ) && aType == EEventKeyDown ) + { + if ( highlightVisibleWhenEventReceived ) + { + iAllowLongPress = EFalse; + } + else + { + iAllowLongPress = ETrue; + + SetHighlightVisibilityL( ETrue ); + SetDefaultHighlightL( ETrue ); + if ( iTimer ) + { + iTimer->StartL( KDelayInSeconds6, EFalse ); + HandleForegroundGainedL(); + } + } + } + return resp; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +//TBool CMmWidgetContainer::HighlightWouldLoop( const TKeyEvent& aKeyEvent, +// const TEventCode& aType ) +// { +// TInt viewColCount ( ColumnsInCurrentView() ); +// +// if ( viewColCount == 0 ) +// return ETrue; +// +// // this allows to finish drag'n'drop operation +// if ( iDraggedIndex != KErrNotFound && aType == EEventKeyUp ) +// return EFalse; +// +// TBool wouldLoop = EFalse; +// TInt highlightIndex = GetHighlight(); +// +// TInt highlightRow = highlightIndex / viewColCount; +// TInt lastRowWithItems = ( NumberOfItems() - 1 ) / viewColCount; +// TInt highlightCol = highlightIndex % viewColCount; +// TInt lastItemCol = ( NumberOfItems() - 1 ) % viewColCount; +// +// TInt keyScanCode = aKeyEvent.iScanCode; +// +// if ( AknLayoutUtils::LayoutMirrored() ) +// { +// if ( keyScanCode == EStdKeyLeftArrow ) +// keyScanCode = EStdKeyRightArrow; +// else if ( keyScanCode == EStdKeyRightArrow ) +// keyScanCode = EStdKeyLeftArrow; +// } +// +// if ( keyScanCode == EStdKeyRightArrow ) +// { +// if ( highlightIndex == NumberOfItems() - 1 ) +// wouldLoop = ETrue; +// else if ( highlightCol == viewColCount - 1 ) +// wouldLoop = ETrue; +// } +// else if ( keyScanCode == EStdKeyLeftArrow ) +// { +// if ( highlightCol == 0 ) +// wouldLoop = ETrue; +// } +// else if ( keyScanCode == EStdKeyUpArrow ) +// { +// if ( highlightRow == 0 ) +// wouldLoop = ETrue; +// } +// else if ( keyScanCode == EStdKeyDownArrow ) +// { +// if ( highlightRow == lastRowWithItems ) +// wouldLoop = ETrue; +// else if ( highlightRow == lastRowWithItems - 1 && highlightCol > lastItemCol) +// wouldLoop = ETrue; +// } +// +// return wouldLoop; +// } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmWidgetContainer::ColumnsInCurrentView() + { + //should be overridden by deriving classes + return NumberOfItems(); + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmWidgetContainer::RowsInCurrentView() + { + //should be overridden by deriving classes + CListBoxView *view = ((CListBoxView*) Widget()->View()); + return view->NumberOfItemsThatFitInRect( Rect());//Widget()->View()->ViewRect()); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::HandleRockerPressL() + { + TKeyEvent ke; + ke.iScanCode = EStdKeyNull; + ke.iCode = EStdKeyNull; + ke.iModifiers = 0; + ke.iRepeats = 0; + if( iKeyEventObserver ) + { + iKeyEventObserver->HandleKeyPressedL( ke, EEventUser ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TKeyResponse CMmWidgetContainer::HandleKeyEventL( const TKeyEvent &aKeyEvent, + TEventCode aType ) + { + TKeyResponse resp = EKeyWasNotConsumed; + 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; + + // handle arrow: draw highlight when arrow used + if ( arrowHasHandling ) + { + if ( !iTimer->IsActive() ) + { + if ( aType == EEventKey || aType == EEventKeyUp ) + { + // if no highlight and key released - show highlight + SetDefaultHighlightL( EFalse ); + } + // ignore all navigation events when highlight not visible + resp = EKeyWasConsumed; + } + else + { + + // this block is used to set the highlight only once for each event + if ( aKeyEvent.iRepeats > 0 ) + { + // if repeated key events we move focus on EEventKey + if ( aType == EEventKey ) + { + SetHighlightL( iWidget->CurrentItemIndex() ); + } + } + else + { + // if single event we move focus on EEventKeyUp + if ( aType == EEventKeyUp ) + { + SetHighlightL( iWidget->CurrentItemIndex() ); + } + } + } + + // run timer in order to hide the highlight + if ( aType == EEventKey && iTimer) + { + iTimer->StartL( KDelayInSeconds6, EFalse ); + HandleForegroundGainedL(); + } + } + else if( arrowKeyPressed ) + { + // ignore left and right arrows in list + resp = EKeyWasConsumed; + } + // rocker select (short press) + else if ( ( aKeyEvent.iScanCode == EStdKeyDevice3 ) && ( aType == EEventKeyDown ) ) + { + 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; + } + + return resp; + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::SetSuiteModelL(CHnSuiteModel* aModel) + { + CHnSuiteModel* prevModel = GetMmModel()->GetSuiteModel(); + + TInt numberOfItemsBefore (0); + numberOfItemsBefore = GetMmModel()->NumberOfItems(); + + GetMmModel()->SetSuiteModelL( aModel ); + + // 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 ) + { + HandleItemAdditionL(); + } + else + { + HandleItemRemovalL(); + } + if ( prevModel && aModel ) + { + SetupWidgetLayoutL(); + } + iWidget->MakeVisible(ETrue); + + Widget()->View()->ItemDrawer()->ClearFlags( + CListItemDrawer::EPressedDownState ); + iPostProcessor->StartAt( iWidget->BottomItemIndex() + 1 ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmWidgetContainer::SetupDrawer() + { + iDrawer = STATIC_CAST(CMmListBoxItemDrawer*, iWidget->View()->ItemDrawer()); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C THnSuiteWidgetType CMmWidgetContainer::WidgetType() + { + return EUnspecified; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmWidgetContainer::RemoveLiwObjects() + { + // there is only one place where LIW objects can be (co)owned in mmwidgets + // and that place is item drawer's cache + iDrawer->TrimCacheSize( 0 ); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::HandleBackgroundGainedL() + { + iInForeground = EFalse; + StartOrStopMarquee(); + + CancelDragL(); + + // Fix for EMWK-7NYKRJ + // Matrix Menu: Scrollbar highligted when App Key is pressed while it is held + if ( AknLayoutUtils::PenEnabled() ) + { + CEikScrollBar* scrollBar = + iWidget->ScrollBarFrame()->VerticalScrollBar(); + if ( scrollBar && scrollBar->IsVisible() ) + { + TPointerEvent fakeButton1UpEvent; + fakeButton1UpEvent.iType = TPointerEvent::EButton1Up; + fakeButton1UpEvent.iModifiers = 0; + scrollBar->HandlePointerEventL( fakeButton1UpEvent ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::HandleForegroundGainedL() + { + iInForeground = ETrue; + StartOrStopMarquee(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMmWidgetContainer::DeltaSquare( const TPoint aTapPoint, + 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; + } + else + { + delta = height * height + width * width; + } + return delta; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmWidgetContainer::CancelDragL() + { + if( iIsEditMode && iDrawer ) + { + if( iDrawer->GetFloatingItemIndex( EDrag ) != KErrNotFound ) + { + CancelDragL( EFalse ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::HandleItemAdditionL() + { + // 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 ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CMmWidgetContainer::FlipOpen() + { + return iFlipOpen; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::SetFlipOpenL( TBool aIsFlipOpen ) + { + if ( aIsFlipOpen != iFlipOpen ) + { + iFlipOpen = aIsFlipOpen; + FlipStateChangedL(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmWidgetContainer::FlipStateChangedL() + { +// default do nothing + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::StopMovingL() + { + if ( !AknLayoutUtils::PenEnabled() && iDragAndDropObserver ) + iDragAndDropObserver->HandleDragStopL( GetHighlight() ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmWidgetContainer::ScrollViewIfNeededL() + { + if ((iWidget->BottomItemIndex() / ColumnsInCurrentView() + - iWidget->TopItemIndex() / ColumnsInCurrentView() ) <= 1 ) + { + return; + } + + TBool needToScrollUp = + GetHighlight() - iWidget->TopItemIndex() < ColumnsInCurrentView() + && iWidget->TopItemIndex() != 0; + + 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 ( needToScrollUp ) + { +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iDrawer->Gc() ); + if ( transApi ) + { + transApi->SetMoveType( MAknListBoxTfxInternal::EListScrollUp ); + } +#endif + iDrawer->RemoveFloatingItems(); + iWidget->View()->VScrollTo( + iWidget->TopItemIndex() - ColumnsInCurrentView() ); +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( transApi ) + { + transApi->Draw( Rect() ); + } +#endif + UpdateViewScrollBarThumbs(); + } + else if ( needToScrollDown ) + { + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iDrawer->Gc() ); + if ( transApi ) + { + transApi->SetMoveType( MAknListBoxTfxInternal::EListScrollDown ); + } +#endif + iDrawer->RemoveFloatingItems(); + iWidget->View()->VScrollTo( + iWidget->TopItemIndex() + ColumnsInCurrentView() ); + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( transApi ) + { + transApi->Draw( Rect() ); + } +#endif + + UpdateViewScrollBarThumbs(); + } + } + +//---------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmWidgetContainer::UpdateViewScrollBarThumbs() + { + + } + +//---------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmWidgetContainer::StartOrStopMarquee() + { + if ( iMarqueeAdapter ) + { + TBool marqueeShouldBeEnabled = iHasFocus && iInForeground + && !iIsFaded && !IsEditMode(); + + // logical Ex-OR + if ( !!marqueeShouldBeEnabled != !!iMarqueeAdapter->IsMarqueeEnabled() ) + { + if ( !marqueeShouldBeEnabled ) + { + iMarqueeAdapter->StopMarqueeDrawing(); + } + + iMarqueeAdapter->EnableMarquee( marqueeShouldBeEnabled ); + } + } + } + +//---------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::HandleZoomChanged( TAknUiZoom aZoom ) + { + SetZoom( aZoom ); + if( WidgetType() == EGridWidget ) + { + CMmGrid* grid = static_cast<CMmGrid*>( iWidget ); + grid->SetupLayout(); + } + Widget()->DrawDeferred(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::SetZoom( TAknUiZoom aZoom ) + { + CMmTemplateLibrary * templateLibrary = + static_cast<CMmListBoxItemDrawer*> ( + Widget()->View()->ItemDrawer() )->TemplateLibrary(); + + if ( WidgetType() == EGridWidget && EAknUiZoomSmall == aZoom ) + { + aZoom = EAknUiZoomNormal; + } + templateLibrary->SetZoom( aZoom ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +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 ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmWidgetContainer::ValidateWidgetCurrentItemIndex() + { + 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; + + 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; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::RestoreWidgetPosition() + { + 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 ) + { + iWidgetPositionCache.iVerticalItemOffset = 0; + // This corrects the position cached during the upper boundary + // effect. AlignBottomOfViewL will take care of lower boundary + // effect. + } + + 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()) ); + } + + iWidgetPositionCache.iValid = EFalse; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmWidgetContainer::MakeVisible(TBool aVisible) + { + if (!aVisible) + { + ASSERT(iTimer); + TRAP_IGNORE( iTimer->StopL( EFalse ) ); + RestoreWidgetPosition(); + CacheWidgetPosition(); + iDrawer->RemoveFloatingItems(); + } + else if (aVisible) + { + RestoreWidgetPosition(); + } + CCoeControl::MakeVisible(aVisible); + iWidget->MakeVisible(aVisible); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::ResetWidgetPosition() + { + 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 ); + + 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 ) + { + ASSERT(iTimer); + iTimer->StopL(); + if ( aChange == EItemsAdded ) + { + HandleItemAdditionL(); + } + else if ( aChange == EItemsRemoved ) + { + HandleItemRemovalL(); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmWidgetContainer::AlignBottomOfViewL() + { + TInt scrollConsumed( EFalse ); + TInt pixelsToScroll( 0 ); + + if ( NumberOfItems() > 0 ) + { + pixelsToScroll = CalcBottomPixelsToScroll(); + } + + if ( pixelsToScroll != 0 ) + { + ScrollInPixelsL( pixelsToScroll ); + scrollConsumed = ETrue; + } + + return scrollConsumed; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmWidgetContainer::CalcBottomPixelsToScroll() + { + const TInt firstItemIndex( 0 ); + TInt lastItemIndex = NumberOfItems() - 1; + TInt viewHeight = Widget()->View()->ViewRect().Height(); + TInt lastItemBottomY = Widget()->View()->ItemPos(lastItemIndex).iY + + Widget()->ItemHeight(); + TInt pixelsToScroll( 0 ); + + if ( Widget()->ScrollBarFrame()->VerticalScrollBar()->IsVisible() ) + { + pixelsToScroll = Min( 0, lastItemBottomY - viewHeight ); + } + else + { + pixelsToScroll = Widget()->View()->ItemPos( firstItemIndex ).iY; + } + + return pixelsToScroll; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmWidgetContainer::ItemIsVisible( TInt aItemIndex ) const + { + return iWidget->View()->ItemIsVisible( aItemIndex ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMmWidgetContainer::ItemIsFullyVisible(TInt aIndex) + { + return ItemIsVisible( aIndex ) + && !Widget()->View()->ItemIsPartiallyVisible(aIndex); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +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(); + + 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; + } + + } + 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) + { +#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); + } +#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(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMmWidgetContainer::IsTimerActive( TInt aItemIndex ) + { + ASSERT(iTimer); + TBool timerActive = iTimer->IsActive(); + if ( aItemIndex >= 0 && timerActive ) + { + timerActive = ( aItemIndex == iTimer->TimerHighlightIndex() ); + } + return timerActive; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmWidgetContainer::HandleLongTapEventL( const TPoint& aPenEventLocation, + const TPoint& aPenEventScreenLocation ) + { + TInt index( KErrNotFound ); + if ( iWidget->View()->XYPosToItemIndex( aPenEventLocation, index ) ) + { + ASSERT( iTimer ); + iTimer->ContinueL( KDelayInfinite ); + iLongTapInProgress = ETrue; + if ( iLongTapObserver ) + { + iLongTapObserver->HandleLongTapEventL( aPenEventScreenLocation ); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::SetLongTapObserver( MMmLongTapObserver* aObserver ) + { + iLongTapObserver = aObserver; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::HandleTopFocusL( TBool aStopTimer ) + { + if ( iLongTapInProgress ) + { + iLongTapInProgress = EFalse; + if( aStopTimer ) + { + ASSERT( iTimer ); + iTimer->StopL(); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMmWidgetContainer::HandleListBoxEventL( CEikListBox* aListBox, + TListBoxEvent aEventType ) + { + ASSERT( iTimer ); +// handle same behaviour in edit mode and normal mode + switch ( aEventType ) + { + case MEikListBoxObserver::EEventPenDownOnItem: + { + iDragOccured = EFalse; + if ( !iLongTapInProgress ) + { + iTimer->StartL( KDelayInfinite ); + } + break; + } + case MEikListBoxObserver::EEventItemSingleClicked: + { + if ( !iDragOccured && !iLongTapInProgress ) + { + SetHighlightL( Widget()->CurrentItemIndex() ); + iTimer->StopL( ETrue ); + } + iDragOccured = EFalse; + break; + } + case MEikListBoxObserver::EEventItemDraggingActioned: + { + iTimer->StopL(); + iDragOccured = ETrue; + break; + } + case MEikListBoxObserver::EEventPanningStarted: + case MEikListBoxObserver::EEventPanningStopped: + case MEikListBoxObserver::EEventFlickStarted: + case MEikListBoxObserver::EEventFlickStopped: + { + iTimer->StopL( EFalse ); + break; + } + } + +// handle different behaviour in edit mode and normal mode + if ( !IsEditMode() ) + { + switch ( aEventType ) + { + case MEikListBoxObserver::EEventFlickStarted: + { + static_cast<CMmListBoxItemDrawer*>( + Widget()->View()->ItemDrawer() )-> + EnableCachedDataUse( ETrue ); + break; + } + case MEikListBoxObserver::EEventFlickStopped: + { + static_cast<CMmListBoxItemDrawer*>( + 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; + } + } + } + + if ( iListBoxObserver && !iLongTapInProgress ) + { + iListBoxObserver->HandleListBoxEventL( aListBox, aEventType ); + } + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CMmWidgetContainer::HandleOptionsMenuVisibilityChangeL( + TBool aOptionsMenuVisible ) + { + if ( IsTimerActive() ) + { + TInt delay = (aOptionsMenuVisible) ? KDelayInfinite : KDelayInSeconds6; + iTimer->StartL( delay, EFalse ); + } + } +//End of file diff -r 000000000000 -r f72a12da539e menufw/menufwui/mmwidgets/src/mymenudebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menufwui/mmwidgets/src/mymenudebug.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: debug constants definitions +* +*/ + + +#ifndef MYMENUDEBUG_H +#define MYMENUDEBUG_H + +// MACROS +#define APPEND_TO_DEBUG_FILE + +// CONSTANTS +_LIT(KDebugDirName, "menu"); +_LIT(KDebugFileName, "mmtimediawidgets.txt"); + +#endif // MYMENUDEBUG_H + +// End of File diff -r 000000000000 -r f72a12da539e menufw/menusuites/data/mmenuschema.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/data/mmenuschema.xsd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,592 @@ +<?xml version="1.0" encoding="utf-8" ?> +<xs:schema xmlns:mmenu="http://nokia.com/mmenu" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://nokia.com/mmenu" xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <xs:element name="content"> + <xs:annotation> + <xs:documentation>This Tag is the root element of configuration and defines namespaces for XML needs</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" name="localization" type="mmenu:localizationType"> + <xs:annotation> + <xs:documentation>Localization tag should be used in order to map resource sources to namespaces. It enables use of resources in context of namespaces. Namespace are not only limited to single xml file – they have global scope, and once defined, are available in all definition files.</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element minOccurs="0" name="suite" type="mmenu:suiteType"> + <xs:annotation> + <xs:documentation>This tag defines single suite</xs:documentation> + </xs:annotation> + <xs:unique name="uniqueEventNameSuite"> + <xs:selector xpath="mmenu:event" /> + <xs:field xpath="@event" /> + </xs:unique> + </xs:element> + <xs:element minOccurs="0" maxOccurs="unbounded" name="item"> + <xs:annotation> + <xs:documentation>This tag defines suite’s single or multiple items. It contains information about graphical representation, menu structure, actions, and queries. </xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:complexContent mixed="false"> + <xs:extension base="mmenu:itemType" /> + </xs:complexContent> + </xs:complexType> + <xs:unique name="uniqueEventNameItem"> + <xs:selector xpath="mmenu:event" /> + <xs:field xpath="@event" /> + </xs:unique> + </xs:element> + </xs:sequence> + <xs:attribute name="genre" type="xs:string" use="optional"> + <xs:annotation> + <xs:documentation>This defines the suite name, for which the contents of the tag should relate to. It should be specified, for xml files containing items for a suite. Xml configuration files for suites do not require this, since they define the suite.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + </xs:element> + <xs:complexType name="menuItemType"> + <xs:sequence> + <xs:annotation> + <xs:documentation>Menu item may contain nested menu items.</xs:documentation> + </xs:annotation> + <xs:element minOccurs="0" maxOccurs="unbounded" name="menuitem" type="mmenu:menuItemType"> + <xs:annotation> + <xs:documentation>A nested menu item.</xs:documentation> + </xs:annotation> + </xs:element> + </xs:sequence> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Localized name of the menu item, which will be displayed in the menu.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="position" type="xs:integer"> + <xs:annotation> + <xs:documentation>Position in the menu (used to control the order in which the items are displayed). Predefined menu items have their position defined at 100, 200 etc, so it is easy to position custom menu items between the predefined ones.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="event" type="mmenu:eventTypeType"> + <xs:annotation> + <xs:documentation>Event related with the item. Mapped to specific action in mmenu:event section. Parameter should start with custom:” string followed with event name to indicate creation of a new event related to menu item and not to a predefined event. For list of predefined event see event Tag description (3.7) +</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="mmenu:conditionGroup" /> + </xs:complexType> + <xs:complexType name="keySeqType"> + <xs:annotation> + <xs:documentation>Defines a key structure. A key, may contain nested keys. Keys are store information.</xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" name="key"> + <xs:complexType> + <xs:complexContent mixed="false"> + <xs:extension base="mmenu:keySeqType" /> + </xs:complexContent> + </xs:complexType> + </xs:element> + </xs:sequence> + <xs:attribute name="name" use="optional"> + <xs:annotation> + <xs:documentation>name of the parameter</xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:minLength value="1" /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="type" use="optional"> + <xs:annotation> + <xs:documentation>type of the parameter Values: +- string +- string16 +- formatted_string +- integer +- uid +- boolean</xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="string" /> + <xs:enumeration value="string8" /> + <xs:enumeration value="string16" /> + <xs:enumeration value="integer64" /> + <xs:enumeration value="integer" /> + <xs:enumeration value="uid" /> + <xs:enumeration value="boolean" /> + <xs:enumeration value="list" /> + <xs:enumeration value="map" /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="value" type="xs:string" use="optional"> + <xs:annotation> + <xs:documentation>value of the parameter</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:simpleType name="logicalTemplateType"> + <xs:annotation> + <xs:documentation>Describes the logicla template to be used for widget's presentation. Logical templates are specific for widgets, so configuration should be consulted with documentation. If suite allows multiple widget types, multiple tempaltes may be specified using the "|" character.</xs:documentation> + </xs:annotation> + <xs:restriction base="xs:string"> + <xs:pattern value="(list_single_hc_apps_pane|single_large_graphic_pane|(logical_template_([0-9])*([0-9a-z]))+[|]{0,1})+|empty" /> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="widgetTypeType"> + <xs:annotation> + <xs:documentation>Desribes the type of a widget. If a suite allows multiple widgets, the values should be separated by "|" character.</xs:documentation> + </xs:annotation> + <xs:restriction base="xs:string"> + <xs:pattern value="((grid|list|coverflow)[|]{0,1})+" /> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="serviceType"> + <xs:annotation> + <xs:documentation>Type defines the structure to access liw services.</xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element xmlns:q1="http://nokia.com/mmenu" minOccurs="0" name="constructor" type="q1:keySeqType"> + <xs:annotation> + <xs:documentation>Element defines the parameters needed to fetch the service interface. In this section service specific parameters may be defined. The section should contain a series of mmenu:key elements</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="command"> + <xs:annotation> + <xs:documentation>Defines command name (to be invoked on the interface) and invocation method (synchronous or asynchronous)</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:element xmlns:q2="http://nokia.com/mmenu" minOccurs="0" maxOccurs="unbounded" name="key" type="q2:keySeqType"> + <xs:annotation> + <xs:documentation>This tak contains xml structured data (mmenu:key) as it will be passed to the service</xs:documentation> + </xs:annotation> + </xs:element> + </xs:sequence> + <xs:attribute name="name"> + <xs:annotation> + <xs:documentation>name of the command to invoke on the interface</xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:minLength value="1" /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="mode" use="optional"> + <xs:annotation> + <xs:documentation>mode definition. Either “sync” for synchronous invocation or “async” +asynchronous invocation +</xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="sync" /> + <xs:enumeration value="async" /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + </xs:complexType> + </xs:element> + </xs:sequence> + <xs:attribute name="service"> + <xs:annotation> + <xs:documentation>name of the service producing output: e.g. “Service.TestMatrixDataService”.</xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:minLength value="1" /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="interface" type="xs:string" use="optional"> + <xs:annotation> + <xs:documentation>interface used for the query: e.g. “ITestMatrixDataSource”.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="eventType"> + <xs:annotation> + <xs:documentation>Type defines the configuration of a specific event handling.</xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" name="action"> + <xs:complexType> + <xs:complexContent mixed="false"> + <xs:extension base="mmenu:serviceType"> + <xs:attributeGroup ref="mmenu:conditionGroup" /> + </xs:extension> + </xs:complexContent> + </xs:complexType> + </xs:element> + </xs:sequence> + <xs:attribute name="event" use="required"> + <xs:simpleType> + <xs:restriction base="mmenu:eventTypeType" /> + </xs:simpleType> + </xs:attribute> + </xs:complexType> + <xs:complexType name="imageType"> + <xs:annotation> + <xs:documentation>Type defines the configuration of an image.</xs:documentation> + </xs:annotation> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="application_uid" type="xs:string" use="optional" /> + <xs:attribute name="file" type="xs:string" use="optional" /> + <xs:attribute name="effect"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="backdrop" /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attributeGroup ref="mmenu:imageBitmapBufferType" /> + <xs:attributeGroup ref="mmenu:imageResourceAttributeGroup" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + <xs:simpleType name="eventTypeType"> + <xs:restriction base="xs:string"> + <xs:pattern value="(custom:[_a-zA-Z0-9]+)|(key:select)|(key:select2)|(key:select3)|(key:call)|(item:focus)|(item:unfocus)|(suite:load)|(suite:unload)|(key:clear)|(key:move_into)|(key:move)" /> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="textType"> + <xs:annotation> + <xs:documentation>Type defines the configuration of text value.</xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" name="param"> + <xs:complexType> + <xs:attribute name="value" type="xs:string" /> + </xs:complexType> + </xs:element> + </xs:sequence> + <xs:attributeGroup ref="mmenu:textResourceAttributeGroup" /> + <xs:attribute name="value" type="xs:string" /> + </xs:complexType> + <xs:complexType name="toolbarType"> + <xs:annotation> + <xs:documentation>This type defines the configuration of a toolbar. +</xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element minOccurs="1" maxOccurs="3" name="button"> + <xs:complexType> + <xs:complexContent mixed="false"> + <xs:extension base="mmenu:buttonType" /> + </xs:complexContent> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + <xs:complexType name="buttonType"> + <xs:annotation> + <xs:documentation>This type defines the configuration of a button in a toolbar. +</xs:documentation> + </xs:annotation> + <xs:all> + <xs:element minOccurs="0" maxOccurs="1" name="text"> + <xs:complexType> + <xs:complexContent mixed="false"> + <xs:extension base="mmenu:textType" /> + </xs:complexContent> + </xs:complexType> + </xs:element> + <xs:element minOccurs="0" maxOccurs="1" name="image" type="mmenu:imageType" /> + </xs:all> + <xs:attribute name="index" type="xs:integer" use="required" /> + <xs:attribute name="condition" type="xs:string" use="optional" /> + <xs:attribute name="dimm" type="xs:string" use="optional" /> + <xs:attribute name="event" type="mmenu:eventTypeType"> + <xs:annotation> + <xs:documentation>Event related with the item. Mapped to specific action in mmenu:event section. Parameter should start with custom:” string followed with event name to indicate creation of a new event related to menu item and not to a predefined event. For list of predefined event see event Tag description (3.7) +</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="itemType"> + <xs:annotation> + <xs:documentation>This type defines the configuration of an item. +</xs:documentation> + </xs:annotation> + <xs:choice minOccurs="1" maxOccurs="unbounded"> + <xs:element xmlns:q1="http://nokia.com/mmenu" minOccurs="0" maxOccurs="unbounded" name="menuitem" type="q1:menuItemType"> + <xs:annotation> + <xs:documentation>The tag is used to describe user menu appearance when item is focused, and which events will occur when menu item is selected. </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element xmlns:q1="http://nokia.com/mmenu" minOccurs="0" maxOccurs="unbounded" name="menuitem_specific" type="q1:menuItemType"> + <xs:annotation> + <xs:documentation>This tag is the same as menuitem but describes menu items displayed only which have specific relation to the item</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element minOccurs="0" maxOccurs="1" name="toolbar" type="mmenu:toolbarType"> + <xs:annotation> + <xs:documentation>This element describes the layout of toolbar, for the highlighted item.</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element minOccurs="0" maxOccurs="unbounded" name="query"> + <xs:annotation> + <xs:documentation>Defines parameters used to construct queries to services and display dynamically modifiable data.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:complexContent mixed="false"> + <xs:extension xmlns:q2="http://nokia.com/mmenu" base="q2:serviceType"> + <xs:attribute name="namespace" type="xs:string" /> + </xs:extension> + </xs:complexContent> + </xs:complexType> + </xs:element> + <xs:element xmlns:q3="http://nokia.com/mmenu" minOccurs="0" maxOccurs="unbounded" name="notify_request" type="q3:serviceType"> + <xs:annotation> + <xs:documentation>Registers for notifications in a liw service. +</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element minOccurs="0" maxOccurs="unbounded" name="output"> + <xs:annotation> + <xs:documentation>Configures layout of graphical items.</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:choice> + <xs:element minOccurs="0" name="image" type="mmenu:imageType" /> + <xs:element minOccurs="0" name="text" type="mmenu:textType" /> + </xs:choice> + <xs:attribute name="alias" use="required"> + <xs:annotation> + <xs:documentation>Defines UI graphical element to which content will be linked to. Some UI elements: +- mul_name is the main item shown in graphical list item, +- mul_detail represents secondary line, +- mul_icon is the icon for the list item. + +The complete definition of all aliases can be obtained from [3]. Aliases are dependant of the presentation type, thus one should be well acquainted with [3] to achieve expected result. +</xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="mul_title" /> + <xs:enumeration value="mul_detail" /> + <xs:enumeration value="mul_icon" /> + <xs:enumeration value="mul_icon_2" /> + <xs:enumeration value="mul_icon_3" /> + <xs:enumeration value="mul_indicator_1" /> + <xs:enumeration value="mul_indicator_2" /> + <xs:enumeration value="mul_move_indicator_arrow_top" /> + <xs:enumeration value="mul_move_indicator_arrow_bottom" /> + <xs:enumeration value="mul_move_indicator_arrow_left" /> + <xs:enumeration value="mul_move_indicator_arrow_right" /> + <xs:enumeration value="mul_move_indicator_frame" /> + <xs:enumeration value="mul_icon_backdrop" /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="type" use="optional"> + <xs:annotation> + <xs:documentation>Content type. Values: +- string +- string16 +- formatted_string +- integer +- uid +- boolean + +Use “string” type for icons and constant texts and “formatted_string” type for texts with parameters + +</xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="string" /> + <xs:enumeration value="string8" /> + <xs:enumeration value="string16" /> + <xs:enumeration value="formatted_string" /> + <xs:enumeration value="integer" /> + <xs:enumeration value="uid" /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="value" type="xs:string" use="optional"> + <xs:annotation> + <xs:documentation>Hard coded value for the parameter or a reference.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="mmenu:conditionGroup" /> + </xs:complexType> + </xs:element> + <xs:element xmlns:q4="http://nokia.com/mmenu" minOccurs="0" maxOccurs="unbounded" name="event" type="q4:eventType"> + <xs:annotation> + <xs:documentation>Used to specify event handling, for predefined and custom events. +</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element minOccurs="0" maxOccurs="1" name="edit_mode" type="mmenu:itemType" /> + <xs:element minOccurs="0" maxOccurs="1" name="msk" type="mmenu:mskType" /> + </xs:choice> + <xs:attribute xmlns:q5="http://nokia.com/mmenu" name="template" type="q5:logicalTemplateType" use="optional"> + <xs:annotation> + <xs:documentation>Logical template which will be used to represent data. The attribute is optional. When not specified a default value from suite definition is used. For more details see 2.3</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="count" use="required" type="xs:string"> + <xs:annotation> + <xs:documentation>Number of items current section refers to. If all the available elements are to be retrieved a “*” sing should be used to indicate quantity</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="type" type="xs:string"> + <xs:annotation> + <xs:documentation>Type of an item (MCS).</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="id" type="xs:string"> + <xs:annotation> + <xs:documentation>Unique id of the item in the scope of the suite.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="remove_locked" type="xs:string"> + <xs:annotation> + <xs:documentation>Information if item can be to move to other position</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="running" type="xs:string"> + <xs:annotation> + <xs:documentation>Information if item is currently running</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="custom_id" type="xs:string"> + <xs:annotation> + <xs:documentation>Item's custom id, can be set using a value from liw variant or simple number.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="uid" type="xs:string"> + <xs:annotation> + <xs:documentation>Item's uid, can be set using a value from liw variant or simple uid.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attributeGroup ref="mmenu:conditionGroup" /> + <xs:attribute name="drm_protection" type="xs:string" /> + </xs:complexType> + <xs:complexType name="suiteType"> + <xs:annotation> + <xs:documentation>This type defines the configuration of a suite +</xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" name="query"> + <xs:annotation> + <xs:documentation>Defines parameters used to construct queries to services and display dynamically modifiable data.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:complexContent mixed="false"> + <xs:extension base="mmenu:serviceType"> + <xs:attribute name="namespace" type="xs:string" /> + </xs:extension> + </xs:complexContent> + </xs:complexType> + </xs:element> + <xs:element minOccurs="0" maxOccurs="unbounded" name="event" type="mmenu:eventType"> + <xs:annotation> + <xs:documentation>Used to specify event handling, for predefined and custom events. +</xs:documentation> + </xs:annotation> + </xs:element> + </xs:sequence> + <xs:attribute name="genre" use="required"> + <xs:annotation> + <xs:documentation>Unique string identification of a suite</xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="xs:string" /> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="type" use="required"> + <xs:annotation> + <xs:documentation>Ttype of presentation. Available types are: +- grid +- list +- coverflow + +If a suite allows multiple types, they should be separated with "|" character. +</xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="mmenu:widgetTypeType" /> + </xs:simpleType> + </xs:attribute> + <xs:attribute xmlns:q2="http://nokia.com/mmenu" name="template" type="q2:logicalTemplateType" use="required"> + <xs:annotation> + <xs:documentation>Logical template to specify the layout of a specific presentation type. +This parameter is strictly dependant on the values defined in [3]. One should be aware that although values of logical template may seem similar for different presentation types, they are different in their specification and count. Usually they are in form logical_template_x, where x is a number. For more details please consult [3]. +</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="title" type="xs:string" use="required"> + <xs:annotation> + <xs:documentation>Suite title, should contain localized value +</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="emptytext" type="xs:string" /> + <xs:attribute name="custom_id" type="xs:string" use="optional"> + <xs:annotation> + <xs:documentation>Suite's custom id, can be set using a value from liw variant or simple number.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="localizationType"> + <xs:attribute name="namespace" type="xs:string" use="required"> + <xs:annotation> + <xs:documentation>identifier used to access the resource</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="source" type="xs:string" use="required"> + <xs:annotation> + <xs:documentation>binary file with resources. File extension should be: +- RSC file for logical names, +- MBM for images and +- MIF for icons. </xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="mskType"> + <xs:all> + <xs:element minOccurs="0" maxOccurs="1" name="text" type="mmenu:textType" /> + </xs:all> + <xs:attribute name="event" use="optional"> + <xs:simpleType> + <xs:restriction xmlns:q1="http://nokia.com/mmenu" base="q1:eventTypeType" /> + </xs:simpleType> + </xs:attribute> + </xs:complexType> + <xs:attributeGroup name="imageBitmapBufferType"> + <xs:annotation> + <xs:documentation>Group of attributes, used to configure image from resource from liw bitmap buffer.</xs:documentation> + </xs:annotation> + <xs:attribute name="mask" type="xs:string" use="optional" /> + <xs:attribute name="bitmap" type="xs:string" use="optional" /> + </xs:attributeGroup> + <xs:attributeGroup name="textResourceAttributeGroup"> + <xs:annotation> + <xs:documentation>Group of attributes, used to configure text from resource.</xs:documentation> + </xs:annotation> + <xs:attribute name="resource" type="xs:string" /> + <xs:attribute name="id" type="xs:string" /> + </xs:attributeGroup> + <xs:attributeGroup name="imageResourceAttributeGroup"> + <xs:annotation> + <xs:documentation>Group of attributes, used to configure image from resource and/or skin.</xs:documentation> + </xs:annotation> + <xs:attribute name="skinid_minor" type="xs:string" use="optional" /> + <xs:attribute name="skinid_major" type="xs:string" use="optional" /> + <xs:attribute name="mif_file" type="xs:string" use="optional" /> + <xs:attribute name="bitmap_id" type="xs:string" use="optional" /> + <xs:attribute name="mask_id" type="xs:string" use="optional" /> + </xs:attributeGroup> + <xs:attributeGroup name="conditionGroup"> + <xs:attribute name="condition" type="xs:string"> + <xs:annotation> + <xs:documentation>If condition is fulfilled the menu is added to the item. May contain query reference which will be checked against specified condition. More about condition definition in mmenu:action section. +</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:attributeGroup> +</xs:schema> \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/bwins/dummyCu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/bwins/dummyCu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?E32Main@@YAHXZ @ 1 NONAME ; int E32Main(void) + diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/data/foldersuite.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/data/foldersuite.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for folder suite. +* +*/ + + +NAME FLDR // 4 letter ID + +#include <eikon.rh> + +#ifdef LANGUAGE_SC + #include <sc/avkon.loc> +#else + #include <avkon.loc> +#endif + +#include <matrix_menu.loc> + +RESOURCE RSS_SIGNATURE { } +RESOURCE TBUF { buf=""; } + +RESOURCE TBUF R_ROOTSUITE_MENU_TITLE { buf = qtn_menu_title; } +RESOURCE TBUF R_MENU_FOLDER_EMPTY_TEXT { buf = qtn_menu_empty_folder; } +RESOURCE TBUF R_MENU_FOLDER_EDIT { buf = qtn_menu_organize; } +RESOURCE TBUF R_MENU_FOLDER_EDIT_NON_TOUCH { buf = qtn_menu_organize; } + +RESOURCE TBUF R_SKINS_LIST_APPSHELL_LIST { buf=qtn_skins_list_appshell_list; } +RESOURCE TBUF R_SKINS_LIST_APPSHELL_GRID { buf=qtn_skins_list_appshell_grid; } +RESOURCE TBUF R_OPTIONS_HELP { buf=qtn_options_help; } +RESOURCE TBUF R_MENU_OPEN { buf=qtn_menu_open; } +RESOURCE TBUF R_OPTIONS_ORG_NEW_FOLDER { buf=qtn_options_org_new_folder; } +RESOURCE TBUF R_OPTIONS_ORG_MOVE { buf=qtn_options_org_move; } +RESOURCE TBUF R_OPTIONS_ORG_MOVE_TO_FOLDER { buf=qtn_options_org_move_to_folder; } +RESOURCE TBUF R_OPTIONS_SUB_RENAME { buf=qtn_options_sub_rename; } +RESOURCE TBUF R_OPTIONS_SUB_DELETE { buf=qtn_options_sub_delete; } +RESOURCE TBUF R_FLDR_DELETE { buf=qtn_fldr_delete; } +RESOURCE TBUF R_FLDR_RENAME { buf=qtn_fldr_rename; } + + + +// end of file diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/data/items_nontouch.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/data/items_nontouch.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,411 @@ +<?xml version="1.0" encoding="UTF-8"?> +<mm:content xmlns:mm="http://nokia.com/mmenu" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nokia.com/mmenu ../mmenuschema.xsd" genre="foldersuite"> + <mm:item count="1" template="empty" id="emptyitem"> + <mm:menuitem name="foldersuite_rsc:R_SKINS_LIST_APPSHELL_LIST" event="custom:change_widget_to_list" position="82" condition="mm:suite/type != list & mm:suite/allowed_types HAS list"/> + <mm:menuitem name="foldersuite_rsc:R_SKINS_LIST_APPSHELL_GRID" event="custom:change_widget_to_grid" position="82" condition="mm:suite/type != grid & mm:suite/allowed_types HAS grid"/> + <mm:menuitem name="foldersuite_rsc:R_MENU_FOLDER_EDIT_NON_TOUCH" position="83" condition="params:remove_locked != true" > + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_ORG_NEW_FOLDER" event="custom:add_folder" position="84" condition="params:remove_locked != true" /> + </mm:menuitem> + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_HELP" event="custom:help" position="91" /> + + <mm:msk/> + + <mm:event event="custom:add_folder"> + <mm:action service="MultimediaMenu" interface="0x2001CB79"> + <mm:command name="MMCreateNewFolderCommand"> + <mm:key name="item_lock" type="string" value="params:remove_locked" /> + <mm:key name="folder" type="integer" value="params:folder_id" /> + </mm:command> + </mm:action> + </mm:event> + + <!-- Change widget type to next list. --> + <mm:event event="custom:change_widget_to_list"> + <mm:action service="MultimediaMenu"> + <mm:command name="SwitchWidget"> + <mm:key name="type" type="string" value="list" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:change_widget_to_grid"> + <mm:action service="MultimediaMenu"> + <mm:command name="SwitchWidget"> + <mm:key name="type" type="string" value="grid" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:help"> + <mm:action service="Service.ActionHandler" interface="IDataAction"> + <mm:command name="Execute"> + <mm:key name="plugin_id" type="uid" value="0x2001B285" /> + <mm:key name="data"> + <mm:key name="help_uid" type="integer" value="270486738" /> + <mm:key name="help_topic" type="string" value="APP_HLP_APP_SHELL" /> + </mm:key> + </mm:command> + </mm:action> + </mm:event> + + </mm:item> + + <mm:item count="folder_items:ReturnValue/[$count]" template="logical_template_3|list_single_hc_apps_pane" id="folder_suite_items" remove_locked="folder_items:ReturnValue/[$index]/delete_locked" type="folder_items:ReturnValue/[$index]/type" running="folder_items:ReturnValue/[$index]/running" custom_id="folder_items:ReturnValue/[$index]/id" drm_protection="folder_items:ReturnValue/[$index]/drm_protection" uid="folder_items:ReturnValue/[$index]/uid" > + + <mm:menuitem name="foldersuite_rsc:R_MENU_OPEN" event="key:select" position="81" /> + <mm:menuitem name="foldersuite_rsc:R_SKINS_LIST_APPSHELL_LIST" event="custom:change_widget_to_list" position="82" condition="mm:suite/type != list & mm:suite/allowed_types HAS list"/> + <mm:menuitem name="foldersuite_rsc:R_SKINS_LIST_APPSHELL_GRID" event="custom:change_widget_to_grid" position="82" condition="mm:suite/type != grid & mm:suite/allowed_types HAS grid"/> + <mm:menuitem name="foldersuite_rsc:R_MENU_FOLDER_EDIT_NON_TOUCH" position="83" condition="params:remove_locked != true" > + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_ORG_MOVE" event="custom:edit_mode" position="84" condition="params:remove_locked != true" /> + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_ORG_MOVE_TO_FOLDER" event="custom:move_to_folder" position="85" condition="params:remove_locked != true" /> + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_ORG_NEW_FOLDER" event="custom:add_folder" position="86" condition="params:remove_locked != true" /> + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_SUB_DELETE" event="custom:delete_folder" position="87" condition="folder_items:ReturnValue/[$index]/type = menu:folder & params:remove_locked != true & folder_items:ReturnValue/[$index]/delete_locked != true & folder_items:ReturnValue/[$index]/children_count = 0" /> + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_SUB_DELETE" event="custom:delete_application" position="87" condition="folder_items:ReturnValue/[$index]/type = menu:application & params:remove_locked != true & folder_items:ReturnValue/[$index]/delete_locked != true" /> + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_SUB_RENAME" event="custom:rename_folder" position="88" condition="folder_items:ReturnValue/[$index]/type = menu:folder & params:remove_locked != true & folder_items:ReturnValue/[$index]/delete_locked != true" /> + </mm:menuitem> + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_HELP" event="custom:help" position="91" /> + + <mm:query namespace="folder_items" service="Service.MenuContent" interface="IDataSource"> + <mm:constructor> + <mm:key name="ContentName" type="string" value="matrixmenudata"/> + </mm:constructor> + <mm:command mode="async" name="GetList"> + <mm:key name="InData"> + <mm:key name="id" type="integer" value="params:folder_id"/> + <mm:key name="recursive_search" type="boolean" value="FALSE"/> + <mm:key name="flat_result" type="boolean" value="TRUE"/> + </mm:key> + <mm:key name="Filter"> + <mm:key name="missing" type="boolean" value="FALSE"/> + <mm:key name="hidden" type="boolean" value="FALSE"/> + <mm:key name="required_attributes" type="string" value="title_name:long_name:short_name:children_count:bitmap_buffer:mask_buffer:drm_protection:suite_name:widget_type:template:running:uid" /> + </mm:key> + </mm:command> + </mm:query> + + <mm:notify_request service="Service.MenuContent" interface="IDataSource"> + <mm:constructor> + <mm:key name="ContentName" type="string" value="matrixmenudata"/> + </mm:constructor> + <mm:command mode="async" name="RequestNotification"> + <mm:key name="InData" type="map"> + <mm:key name="add_remove" type="boolean" value="TRUE" /> + <mm:key name="reorder" type="boolean" value="TRUE" /> + <mm:key name="attribute_change" type="boolean" value="TRUE" /> + <mm:key name="id" type="integer" value="params:folder_id" /> + </mm:key> + </mm:command> + </mm:notify_request> + + <mm:output alias="mul_title" type="string" value="folder_items:ReturnValue/[$index]/long_name" condition="mm:suite/type = list" /> + <mm:output alias="mul_title" type="string" value="folder_items:ReturnValue/[$index]/short_name" condition="mm:suite/type = grid" /> + + <mm:output alias="mul_icon"> + <mm:image bitmap="folder_items:ReturnValue/[$index]/bitmap_buffer" mask="folder_items:ReturnValue/[$index]/mask_buffer" /> + </mm:output> + + <mm:output alias="mul_indicator_1" condition="folder_items:ReturnValue/[$index]/running = true"> + <mm:image mif_file="gridroot.mif" bitmap_id="EMbmGridrootQgn_indi_app_open" mask_id="EMbmGridrootQgn_indi_app_open_mask" /> + </mm:output> + + <mm:output alias="mul_indicator_1" condition="folder_items:ReturnValue/[$index]/drm_protection = expired"> + <mm:image mif_file="gridroot.mif" bitmap_id="EMbmGridrootQgn_prop_drm_rights_exp_super" mask_id="EMbmGridrootQgn_prop_drm_rights_exp_super_mask" /> + </mm:output> + + <mm:msk> + <mm:text value="foldersuite_rsc:R_MENU_OPEN"/> + </mm:msk> + + <mm:event event="key:select"> + + <mm:action service="MultimediaMenu" condition="folder_items:ReturnValue/[$index]/type = menu:suite"> + <mm:command name="OpenSuite" > + <mm:key name="suite_name" type="string" value="folder_items:ReturnValue/[$index]/suite_name" /> + <mm:key name="params" type="map"> + <mm:key name="widget_type" type="string" value="folder_items:ReturnValue/[$index]/widget_type"/> + <mm:key name="template" type="string" value="folder_items:ReturnValue/[$index]/template"/> + </mm:key> + </mm:command> + </mm:action> + + <mm:action service="MultimediaMenu" + condition="folder_items:ReturnValue/[$index]/type = menu:folder"> + <mm:command name="OpenSuite"> + <mm:key name="suite_name" type="string" value="foldersuite" /> + <mm:key name="params" type="map"> + <mm:key name="suite_name" type="string" value="folder_items:ReturnValue/[$index]/title_name"/> + <mm:key name="folder_id" type="integer" value="folder_items:ReturnValue/[$index]/id"/> + <mm:key name="widget_type" type="string" value="folder_items:ReturnValue/[$index]/widget_type"/> + <mm:key name="template" type="string" value="folder_items:ReturnValue/[$index]/template"/> + <mm:key name="remove_locked" type="boolean" value="folder_items:ReturnValue/[$index]/delete_locked"/> + </mm:key> + </mm:command> + </mm:action> + + <mm:action service="Service.MenuContent" interface="IMenuContent" condition="folder_items:ReturnValue/[$index]/type != menu:suite + & folder_items:ReturnValue/[$index]/type != menu:folder"> + <mm:constructor> + <mm:key name="ContentName" type="string" value="matrixmenudata"/> + </mm:constructor> + <mm:command name="ExecuteAction" mode="async"> + <mm:key name="InData"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id"/> + <mm:key name="action" type="string8" value="open"/> + </mm:key> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="key:clear"> + <!-- action for folders --> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="folder_items:ReturnValue/[$index]/type = menu:folder & folder_items:ReturnValue/[$index]/delete_locked != true & folder_items:ReturnValue/[$index]/children_count = 0 & mm:suite/type = grid"> + <mm:command name="MMDeleteFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/short_name" /> + <mm:key name="children_count" type="integer" value="folder_items:ReturnValue/[$index]/children_count" /> + </mm:command> + </mm:action> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="folder_items:ReturnValue/[$index]/type = menu:folder & folder_items:ReturnValue/[$index]/delete_locked != true & folder_items:ReturnValue/[$index]/children_count = 0 & mm:suite/type = list"> + <mm:command name="MMDeleteFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/long_name" /> + <mm:key name="children_count" type="integer" value="folder_items:ReturnValue/[$index]/children_count" /> + </mm:command> + </mm:action> + <!-- action for application, links ... --> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="folder_items:ReturnValue/[$index]/type = menu:application & folder_items:ReturnValue/[$index]/delete_locked != true"> + <mm:command name="MMDeleteAppCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + </mm:command> + </mm:action> + <!-- action for suites --> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="folder_items:ReturnValue/[$index]/type = menu:suite & folder_items:ReturnValue/[$index]/delete_locked != true & mm:suite/type = grid" > + <mm:command name="MMDeleteSuiteCommand"> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/short_name" /> + </mm:command> + </mm:action> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="folder_items:ReturnValue/[$index]/type = menu:suite & folder_items:ReturnValue/[$index]/delete_locked != true & mm:suite/type = list" > + <mm:command name="MMDeleteSuiteCommand"> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/long_name" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:help"> + <mm:action service="Service.ActionHandler" interface="IDataAction"> + <mm:command name="Execute"> + <mm:key name="plugin_id" type="uid" value="0x2001B285" /> + <mm:key name="data"> + <mm:key name="help_uid" type="integer" value="270486738" /> + <mm:key name="help_topic" type="string" value="APP_HLP_APP_SHELL" /> + </mm:key> + </mm:command> + </mm:action> + </mm:event> + + <!-- Change widget type to next list. --> + <mm:event event="custom:change_widget_to_list"> + <mm:action service="MultimediaMenu"> + <mm:command name="SwitchWidget"> + <mm:key name="type" type="string" value="list" /> + </mm:command> + </mm:action> + </mm:event> + <!-- Change widget type to next possible grid. --> + <mm:event event="custom:change_widget_to_grid"> + <mm:action service="MultimediaMenu"> + <mm:command name="SwitchWidget"> + <mm:key name="type" type="string" value="grid" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:edit_mode"> + <mm:action service="MultimediaMenu"> + <mm:command name="StartEditMode" /> + </mm:action> + </mm:event> + + <mm:event event="custom:move_mode"> + <mm:action service="MultimediaMenu" interface="0x2001CB79"> + <mm:command name="MMMoveCommand"> + <mm:key name="folder" type="integer" value="params:folder_id" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:move_to_folder"> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="mm:suite/type = grid" > + <mm:command name="MMMoveToFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/short_name" /> + <mm:key name="folder" type="integer" value="params:folder_id" /> + <mm:key name="widget" type="string" value="mm:suite/type" /> + </mm:command> + </mm:action> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="mm:suite/type = list" > + <mm:command name="MMMoveToFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/long_name" /> + <mm:key name="folder" type="integer" value="params:folder_id" /> + <mm:key name="widget" type="string" value="mm:suite/type" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:add_folder"> + <mm:action service="MultimediaMenu" interface="0x2001CB79"> + <mm:command name="MMCreateNewFolderCommand"> + <mm:key name="item_lock" type="string" value="params:remove_locked" /> + <mm:key name="folder" type="integer" value="params:folder_id" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:delete_folder"> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="mm:suite/type = grid" > + <mm:command name="MMDeleteFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/short_name" /> + <mm:key name="children_count" type="integer" value="folder_items:ReturnValue/[$index]/children_count" /> + </mm:command> + </mm:action> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="mm:suite/type = list" > + <mm:command name="MMDeleteFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/long_name" /> + <mm:key name="children_count" type="integer" value="folder_items:ReturnValue/[$index]/children_count" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:delete_application"> + <mm:action service="MultimediaMenu" interface="0x2001CB79" > + <mm:command name="MMDeleteAppCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:rename_folder"> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="mm:suite/type = list" > + <mm:command name="MMRenameFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/long_name" /> + </mm:command> + </mm:action> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="mm:suite/type = grid" > + <mm:command name="MMRenameFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/short_name" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:edit_mode count="folder_items:ReturnValue/[$count]" template="logical_template_3|list_single_hc_apps_pane" id="folder_suite_items" remove_locked="folder_items:ReturnValue/[$index]/delete_locked" type="folder_items:ReturnValue/[$index]/type" custom_id="folder_items:ReturnValue/[$index]/id" uid="folder_items:ReturnValue/[$index]/uid"> + + <mm:menuitem name="Help" event="custom:help" position="91" /> + + <mm:query namespace="folder_items" service="Service.MenuContent" interface="IDataSource"> + <mm:constructor> + <mm:key name="ContentName" type="string" value="matrixmenudata"/> + </mm:constructor> + <mm:command mode="async" name="GetList"> + <mm:key name="InData"> + <mm:key name="id" type="integer" value="params:folder_id"/> + <mm:key name="recursive_search" type="boolean" value="FALSE"/> + <mm:key name="flat_result" type="boolean" value="TRUE"/> + </mm:key> + <mm:key name="Filter"> + <mm:key name="missing" type="boolean" value="FALSE"/> + <mm:key name="hidden" type="boolean" value="FALSE"/> + <mm:key name="required_attributes" type="string" value="title_name:long_name:short_name:children_count:bitmap_buffer:mask_buffer:drm_protection:suite_name:widget_type:template:running:uid" /> + </mm:key> + </mm:command> + </mm:query> + + <mm:notify_request service="Service.MenuContent" interface="IDataSource"> + <mm:constructor> + <mm:key name="ContentName" type="string" value="matrixmenudata"/> + </mm:constructor> + <mm:command mode="async" name="RequestNotification"> + <mm:key name="InData" type="map"> + <mm:key name="add_remove" type="boolean" value="TRUE" /> + <mm:key name="reorder" type="boolean" value="TRUE" /> + <mm:key name="attribute_change" type="boolean" value="TRUE" /> + <mm:key name="id" type="integer" value="params:folder_id" /> + </mm:key> + </mm:command> + </mm:notify_request> + + <mm:output alias="mul_title" type="string" value="folder_items:ReturnValue/[$index]/long_name" condition="mm:suite/type = list" /> + <mm:output alias="mul_title" type="string" value="folder_items:ReturnValue/[$index]/short_name" condition="mm:suite/type = grid" /> + + + + <mm:output alias="mul_icon"> + <mm:image bitmap="folder_items:ReturnValue/[$index]/bitmap_buffer" mask="folder_items:ReturnValue/[$index]/mask_buffer" /> + </mm:output> + + + <mm:output alias="mul_move_indicator_arrow_top" > + <mm:image mif_file="move_indicator_icons.mif" + bitmap_id="EMbmMove_indicator_iconsQgn_indi_org_arrow_up" + mask_id="EMbmMove_indicator_iconsQgn_indi_org_arrow_up_mask" /> + </mm:output> + + <mm:output alias="mul_move_indicator_arrow_bottom" > + <mm:image mif_file="move_indicator_icons.mif" + bitmap_id="EMbmMove_indicator_iconsQgn_indi_org_arrow_down" + mask_id="EMbmMove_indicator_iconsQgn_indi_org_arrow_down_mask" /> + </mm:output> + + <mm:output alias="mul_move_indicator_arrow_left" > + <mm:image mif_file="move_indicator_icons.mif" + bitmap_id="EMbmMove_indicator_iconsQgn_indi_org_arrow_left" + mask_id="EMbmMove_indicator_iconsQgn_indi_org_arrow_left_mask" /> + </mm:output> + + <mm:output alias="mul_move_indicator_arrow_right" > + <mm:image mif_file="move_indicator_icons.mif" + bitmap_id="EMbmMove_indicator_iconsQgn_indi_org_arrow_right" + mask_id="EMbmMove_indicator_iconsQgn_indi_org_arrow_right_mask" /> + </mm:output> + + <mm:event event="key:select"> + <mm:action service="MultimediaMenu"> + <mm:command name="StopEditMode" /> + </mm:action> + </mm:event> + + <mm:event event="key:move"> + <mm:action service="Service.MenuContent" interface="IMenuContent"> + <mm:constructor> + <mm:key name="ContentName" type="string" value="matrixmenudata" /> + </mm:constructor> + <mm:command name="Organize" mode="async"> + <mm:key name="InData"> + <mm:key name="item_ids" type="list"> + <mm:key name="id" type="boolean" value="event_data:dragged_custom_id" /> + </mm:key> + <mm:key name="before_item_id" type="boolean" value="event_data:dropped_before_custom_id" /> + </mm:key> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:help"> + <mm:action service="Service.ActionHandler" interface="IDataAction"> + <mm:command name="Execute"> + <mm:key name="plugin_id" type="uid" value="0x2001B285" /> + <mm:key name="data"> + <mm:key name="help_uid" type="integer" value="270486738" /> + <mm:key name="help_topic" type="string" value="APP_HLP_APP_SHELL" /> + </mm:key> + </mm:command> + </mm:action> + </mm:event> + + </mm:edit_mode> + </mm:item> +</mm:content> diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/data/items_touch.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/data/items_touch.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,478 @@ +<?xml version="1.0" encoding="UTF-8"?> +<mm:content xmlns:mm="http://nokia.com/mmenu" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nokia.com/mmenu ../mmenuschema.xsd" genre="foldersuite"> + <mm:item count="1" template="empty" id="emptyitem"> + <mm:menuitem name="foldersuite_rsc:R_SKINS_LIST_APPSHELL_LIST" event="custom:change_widget_to_list" position="82" condition="mm:suite/type != list & mm:suite/allowed_types HAS list"/> + <mm:menuitem name="foldersuite_rsc:R_SKINS_LIST_APPSHELL_GRID" event="custom:change_widget_to_grid" position="82" condition="mm:suite/type != grid & mm:suite/allowed_types HAS grid"/> + <mm:menuitem name="foldersuite_rsc:R_MENU_FOLDER_EDIT" event="custom:edit_mode" position="83" condition="params:remove_locked != true" /> + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_HELP" event="custom:help" position="91" /> + + <mm:event event="custom:help"> + <mm:action service="Service.ActionHandler" interface="IDataAction"> + <mm:command name="Execute"> + <mm:key name="plugin_id" type="uid" value="0x2001B285" /> + <mm:key name="data"> + <mm:key name="help_uid" type="integer" value="270486738" /> + <mm:key name="help_topic" type="string" value="APP_HLP_APP_SHELL" /> + </mm:key> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:edit_mode"> + <mm:action service="MultimediaMenu"> + <mm:command name="StartEditMode" /> + </mm:action> + </mm:event> + + <mm:event event="custom:change_widget_to_list"> + <mm:action service="MultimediaMenu"> + <mm:command name="SwitchWidget"> + <mm:key name="type" type="string" value="list" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:change_widget_to_grid"> + <mm:action service="MultimediaMenu"> + <mm:command name="SwitchWidget"> + <mm:key name="type" type="string" value="grid" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:edit_mode count="1" template="empty" id="emptyitem"> + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_ORG_NEW_FOLDER" event="custom:add_folder" position="82" condition="params:remove_locked != true"/> + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_HELP" event="custom:help" position="91" /> + + <mm:event event="custom:add_folder"> + <mm:action service="MultimediaMenu" interface="0x2001CB79"> + <mm:command name="MMCreateNewFolderCommand"> + <mm:key name="item_lock" type="string" value="params:remove_locked" /> + <mm:key name="folder" type="integer" value="params:folder_id" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:help"> + <mm:action service="Service.ActionHandler" interface="IDataAction"> + <mm:command name="Execute"> + <mm:key name="plugin_id" type="uid" value="0x2001B285" /> + <mm:key name="data"> + <mm:key name="help_uid" type="integer" value="270486738" /> + <mm:key name="help_topic" type="string" value="APP_HLP_APP_SHELL" /> + </mm:key> + </mm:command> + </mm:action> + </mm:event> + </mm:edit_mode> + </mm:item> + + <mm:item count="0" template="logical_template_3|list_single_hc_apps_pane" id="parent_item" remove_locked="true" type="custom:parent_folder"> + <mm:menuitem name="foldersuite_rsc:R_SKINS_LIST_APPSHELL_LIST" event="custom:change_widget_to_list" position="82" condition="mm:suite/type != list & mm:suite/allowed_types HAS list"/> + <mm:menuitem name="foldersuite_rsc:R_SKINS_LIST_APPSHELL_GRID" event="custom:change_widget_to_grid" position="82" condition="mm:suite/type != grid & mm:suite/allowed_types HAS grid"/> + + <mm:edit_mode count="1" template="logical_template_3|list_single_hc_apps_pane" id="parent_item" type="custom:parent_folder" condition="params:folder_id != 1"> + + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_ORG_NEW_FOLDER" event="custom:add_folder" position="82" condition="params:remove_locked != true" /> + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_HELP" event="custom:help" position="91" /> + + <mm:output alias="mul_title" type="string" value=""/> + + <mm:output alias="mul_icon"> + <mm:image bitmap_id="EMbmGridrootQgn_prop_folder_parent" mask_id="EMbmGridrootQgn_prop_folder_parent_mask" mif_file="gridroot.mif" /> + </mm:output> + + <mm:event event="key:select"> + <mm:action service="MultimediaMenu"> + <mm:command name="Back" /> + </mm:action> + </mm:event> + + <mm:event event="custom:add_folder"> + <mm:action service="MultimediaMenu" interface="0x2001CB79"> + <mm:command name="MMCreateNewFolderCommand"> + <mm:key name="item_lock" type="string" value="params:remove_locked" /> + <mm:key name="folder" type="integer" value="params:folder_id" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="key:move_into"> + <mm:action service="Service.MenuContent" interface="IMenuContent"> + <mm:constructor> + <mm:key name="ContentName" type="string" value="matrixmenudata" /> + </mm:constructor> + <mm:command name="Organize" mode="async"> + <mm:key name="InData"> + <mm:key name="item_ids" type="list"> + <mm:key name="id" type="boolean" value="event_data:dragged_custom_id" /> + </mm:key> + <mm:key name="folder_id" type="boolean" value="params:parent_folder_id" /> + </mm:key> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:help"> + <mm:action service="Service.ActionHandler" interface="IDataAction"> + <mm:command name="Execute"> + <mm:key name="plugin_id" type="uid" value="0x2001B285" /> + <mm:key name="data"> + <mm:key name="help_uid" type="integer" value="270486738" /> + <mm:key name="help_topic" type="string" value="APP_HLP_APP_SHELL" /> + </mm:key> + </mm:command> + </mm:action> + </mm:event> + + </mm:edit_mode> + </mm:item> + + <mm:item count="folder_items:ReturnValue/[$count]" template="logical_template_3|list_single_hc_apps_pane" id="folder_suite_items" remove_locked="folder_items:ReturnValue/[$index]/delete_locked" type="folder_items:ReturnValue/[$index]/type" running="folder_items:ReturnValue/[$index]/running" custom_id="folder_items:ReturnValue/[$index]/id" drm_protection="folder_items:ReturnValue/[$index]/drm_protection" uid="folder_items:ReturnValue/[$index]/uid" > + <mm:menuitem name="foldersuite_rsc:R_SKINS_LIST_APPSHELL_LIST" event="custom:change_widget_to_list" position="81" condition="mm:suite/type != list & mm:suite/allowed_types HAS list"/> + <mm:menuitem name="foldersuite_rsc:R_SKINS_LIST_APPSHELL_GRID" event="custom:change_widget_to_grid" position="81" condition="mm:suite/type != grid & mm:suite/allowed_types HAS grid"/> + <mm:menuitem name="foldersuite_rsc:R_MENU_FOLDER_EDIT" event="custom:edit_mode" position="82" condition="params:remove_locked != true" /> + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_HELP" event="custom:help" position="91" /> + + <mm:query namespace="folder_items" service="Service.MenuContent" interface="IDataSource"> + <mm:constructor> + <mm:key name="ContentName" type="string" value="matrixmenudata"/> + </mm:constructor> + <mm:command mode="async" name="GetList"> + <mm:key name="InData"> + <mm:key name="id" type="integer" value="params:folder_id"/> + <mm:key name="recursive_search" type="boolean" value="FALSE"/> + <mm:key name="flat_result" type="boolean" value="TRUE"/> + </mm:key> + <mm:key name="Filter"> + <mm:key name="missing" type="boolean" value="FALSE"/> + <mm:key name="hidden" type="boolean" value="FALSE"/> + <mm:key name="required_attributes" type="string" value="title_name:long_name:short_name:children_count:bitmap_buffer:mask_buffer:drm_protection:suite_name:widget_type:template:running:uid" /> + </mm:key> + </mm:command> + </mm:query> + + <mm:notify_request service="Service.MenuContent" interface="IDataSource"> + <mm:constructor> + <mm:key name="ContentName" type="string" value="matrixmenudata"/> + </mm:constructor> + <mm:command mode="async" name="RequestNotification"> + <mm:key name="InData" type="map"> + <mm:key name="add_remove" type="boolean" value="TRUE" /> + <mm:key name="reorder" type="boolean" value="TRUE" /> + <mm:key name="attribute_change" type="boolean" value="TRUE" /> + <mm:key name="id" type="integer" value="params:folder_id" /> + </mm:key> + </mm:command> + </mm:notify_request> + + <mm:output alias="mul_title" type="string" value="folder_items:ReturnValue/[$index]/long_name" condition="mm:suite/type = list" /> + <mm:output alias="mul_title" type="string" value="folder_items:ReturnValue/[$index]/short_name" condition="mm:suite/type = grid" /> + + <mm:output alias="mul_icon"> + <mm:image bitmap="folder_items:ReturnValue/[$index]/bitmap_buffer" mask="folder_items:ReturnValue/[$index]/mask_buffer" /> + </mm:output> + + <mm:output alias="mul_indicator_1" condition="folder_items:ReturnValue/[$index]/running = true"> + <mm:image mif_file="gridroot.mif" bitmap_id="EMbmGridrootQgn_indi_app_open" mask_id="EMbmGridrootQgn_indi_app_open_mask" /> + </mm:output> + + <mm:output alias="mul_indicator_1" condition="folder_items:ReturnValue/[$index]/drm_protection = expired"> + <mm:image mif_file="gridroot.mif" bitmap_id="EMbmGridrootQgn_prop_drm_rights_exp_super" mask_id="EMbmGridrootQgn_prop_drm_rights_exp_super_mask" /> + </mm:output> + + <mm:event event="key:select"> + + <mm:action service="MultimediaMenu" condition="folder_items:ReturnValue/[$index]/type = menu:suite"> + <mm:command name="OpenSuite" > + <mm:key name="suite_name" type="string" value="folder_items:ReturnValue/[$index]/suite_name" /> + <mm:key name="params" type="map"> + <mm:key name="widget_type" type="string" value="folder_items:ReturnValue/[$index]/widget_type"/> + <mm:key name="template" type="string" value="folder_items:ReturnValue/[$index]/template"/> + </mm:key> + </mm:command> + </mm:action> + + <mm:action service="MultimediaMenu" condition="folder_items:ReturnValue/[$index]/type = menu:folder"> + <mm:command name="OpenSuite"> + <mm:key name="suite_name" type="string" value="foldersuite" /> + <mm:key name="params" type="map"> + <mm:key name="suite_name" type="string" value="folder_items:ReturnValue/[$index]/title_name"/> + <mm:key name="folder_id" type="integer" value="folder_items:ReturnValue/[$index]/id"/> + <mm:key name="widget_type" type="string" value="folder_items:ReturnValue/[$index]/widget_type"/> + <mm:key name="template" type="string" value="folder_items:ReturnValue/[$index]/template"/> + <mm:key name="remove_locked" type="boolean" value="folder_items:ReturnValue/[$index]/delete_locked"/> + <mm:key name="parent_folder_id" type="integer" value="params:tmp_parent_folder_id"/> + <mm:key name="tmp_parent_folder_id" type="integer" value="folder_items:ReturnValue/[$index]/id"/> + <mm:key name="children_count" type="integer" value="folder_items:ReturnValue/[$index]/children_count"/> + <mm:key name="applicationgroup_name" type="string" value="folder_items:ReturnValue/[$index]/applicationgroup_name"/> + </mm:key> + </mm:command> + </mm:action> + + <mm:action service="Service.MenuContent" interface="IMenuContent" condition="folder_items:ReturnValue/[$index]/type != menu:suite + & folder_items:ReturnValue/[$index]/type != menu:folder"> + <mm:constructor> + <mm:key name="ContentName" type="string" value="matrixmenudata"/> + </mm:constructor> + <mm:command name="ExecuteAction" mode="async"> + <mm:key name="InData"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id"/> + <mm:key name="action" type="string8" value="open"/> + </mm:key> + </mm:command> + </mm:action> + + </mm:event> + + <mm:event event="custom:help"> + <mm:action service="Service.ActionHandler" interface="IDataAction"> + <mm:command name="Execute"> + <mm:key name="plugin_id" type="uid" value="0x2001B285" /> + <mm:key name="data"> + <mm:key name="help_uid" type="integer" value="270486738" /> + <mm:key name="help_topic" type="string" value="APP_HLP_APP_SHELL" /> + </mm:key> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:change_widget_to_list"> + <mm:action service="MultimediaMenu"> + <mm:command name="SwitchWidget"> + <mm:key name="type" type="string" value="list" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:change_widget_to_grid"> + <mm:action service="MultimediaMenu"> + <mm:command name="SwitchWidget"> + <mm:key name="type" type="string" value="grid" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:edit_mode"> + <mm:action service="MultimediaMenu"> + <mm:command name="StartEditMode" /> + </mm:action> + </mm:event> + + <mm:edit_mode count="folder_items:ReturnValue/[$count]" template="logical_template_3|list_single_hc_apps_pane" id="folder_suite_items" remove_locked="folder_items:ReturnValue/[$index]/delete_locked" type="folder_items:ReturnValue/[$index]/type" custom_id="folder_items:ReturnValue/[$index]/id" uid="folder_items:ReturnValue/[$index]/uid"> + <mm:menuitem_specific name="foldersuite_rsc:R_OPTIONS_ORG_MOVE_TO_FOLDER" event="custom:move_to_folder" position="81" condition="params:remove_locked != true" /> + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_ORG_NEW_FOLDER" event="custom:add_folder" position="82" condition="params:remove_locked != true" /> + <mm:menuitem_specific name="foldersuite_rsc:R_FLDR_DELETE" event="custom:delete_folder" position="83" condition="folder_items:ReturnValue/[$index]/type = menu:folder & params:remove_locked != true & folder_items:ReturnValue/[$index]/delete_locked != true & folder_items:ReturnValue/[$index]/children_count = 0" /> + <mm:menuitem_specific name="foldersuite_rsc:R_FLDR_DELETE" event="custom:delete_application" position="83" condition="folder_items:ReturnValue/[$index]/type = menu:application & params:remove_locked != true & folder_items:ReturnValue/[$index]/delete_locked != true" /> + <mm:menuitem_specific name="foldersuite_rsc:R_FLDR_RENAME" event="custom:rename_folder" position="84" condition="folder_items:ReturnValue/[$index]/type = menu:folder & params:remove_locked != true & folder_items:ReturnValue/[$index]/delete_locked != true" /> + <mm:menuitem name="foldersuite_rsc:R_OPTIONS_HELP" event="custom:help" position="91" /> + + <mm:query namespace="folder_items" service="Service.MenuContent" interface="IDataSource"> + <mm:constructor> + <mm:key name="ContentName" type="string" value="matrixmenudata"/> + </mm:constructor> + <mm:command mode="async" name="GetList"> + <mm:key name="InData"> + <mm:key name="id" type="integer" value="params:folder_id"/> + <mm:key name="recursive_search" type="boolean" value="FALSE"/> + <mm:key name="flat_result" type="boolean" value="TRUE"/> + </mm:key> + <mm:key name="Filter"> + <mm:key name="missing" type="boolean" value="FALSE"/> + <mm:key name="hidden" type="boolean" value="FALSE"/> + <mm:key name="required_attributes" type="string" value="title_name:long_name:short_name:children_count:bitmap_buffer:mask_buffer:drm_protection:suite_name:widget_type:template:running:uid" /> + </mm:key> + </mm:command> + </mm:query> + + <mm:notify_request service="Service.MenuContent" interface="IDataSource"> + <mm:constructor> + <mm:key name="ContentName" type="string" value="matrixmenudata"/> + </mm:constructor> + <mm:command mode="async" name="RequestNotification"> + <mm:key name="InData" type="map"> + <mm:key name="add_remove" type="boolean" value="TRUE" /> + <mm:key name="reorder" type="boolean" value="TRUE" /> + <mm:key name="attribute_change" type="boolean" value="TRUE" /> + <mm:key name="id" type="integer" value="params:folder_id" /> + </mm:key> + </mm:command> + </mm:notify_request> + + <mm:output alias="mul_title" type="string" value="folder_items:ReturnValue/[$index]/long_name" condition="mm:suite/type = list" /> + <mm:output alias="mul_title" type="string" value="folder_items:ReturnValue/[$index]/short_name" condition="mm:suite/type = grid" /> + + <mm:output alias="mul_icon"> + <mm:image bitmap="folder_items:ReturnValue/[$index]/bitmap_buffer" mask="folder_items:ReturnValue/[$index]/mask_buffer" /> + </mm:output> + + <mm:output alias="mul_indicator_1" condition="folder_items:ReturnValue/[$index]/delete_locked = true & folder_items:ReturnValue/[$index]/type = menu:folder"> + <mm:image mif_file="gridroot.mif" bitmap_id="EMbmGridrootQgn_indi_org_icon_locked" mask_id="EMbmGridrootQgn_indi_org_icon_locked_mask" /> + </mm:output> + + <mm:output alias="mul_icon_backdrop"> + <mm:image skinid_major="0x101F86E3" skinid_minor="0x1EBA"/> + </mm:output> + + <mm:event event="key:select"> + <mm:action service="MultimediaMenu" condition="folder_items:ReturnValue/[$index]/type = menu:folder & folder_items:ReturnValue/[$index]/delete_locked != true"> + <mm:command name="OpenSuite"> + <mm:key name="suite_name" type="string" value="foldersuite" /> + <mm:key name="params" type="map"> + <mm:key name="suite_name" type="string" value="folder_items:ReturnValue/[$index]/title_name"/> + <mm:key name="folder_id" type="integer" value="folder_items:ReturnValue/[$index]/id"/> + <mm:key name="widget_type" type="string" value="folder_items:ReturnValue/[$index]/widget_type"/> + <mm:key name="template" type="string" value="folder_items:ReturnValue/[$index]/template"/> + <mm:key name="remove_locked" type="boolean" value="folder_items:ReturnValue/[$index]/delete_locked"/> + <mm:key name="parent_folder_id" type="integer" value="params:tmp_parent_folder_id"/> + <mm:key name="tmp_parent_folder_id" type="integer" value="folder_items:ReturnValue/[$index]/id"/> + <mm:key name="applicationgroup_name" type="string" value="folder_items:ReturnValue/[$index]/applicationgroup_name"/> + </mm:key> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="key:clear"> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="folder_items:ReturnValue/[$index]/type = menu:folder & folder_items:ReturnValue/[$index]/delete_locked != true & folder_items:ReturnValue/[$index]/children_count = 0 & mm:suite/type = grid"> + <mm:command name="MMDeleteFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/short_name" /> + <mm:key name="children_count" type="integer" value="folder_items:ReturnValue/[$index]/children_count" /> + </mm:command> + </mm:action> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="folder_items:ReturnValue/[$index]/type = menu:folder & folder_items:ReturnValue/[$index]/delete_locked != true & folder_items:ReturnValue/[$index]/children_count = 0 & mm:suite/type = list"> + <mm:command name="MMDeleteFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/long_name" /> + <mm:key name="children_count" type="integer" value="folder_items:ReturnValue/[$index]/children_count" /> + </mm:command> + </mm:action> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="folder_items:ReturnValue/[$index]/type = menu:application & folder_items:ReturnValue/[$index]/delete_locked != true"> + <mm:command name="MMDeleteAppCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + </mm:command> + </mm:action> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="folder_items:ReturnValue/[$index]/type = menu:suite & folder_items:ReturnValue/[$index]/delete_locked != true & mm:suite/type = grid" > + <mm:command name="MMDeleteSuiteCommand"> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/short_name" /> + </mm:command> + </mm:action> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="folder_items:ReturnValue/[$index]/type = menu:suite & folder_items:ReturnValue/[$index]/delete_locked != true & mm:suite/type = list" > + <mm:command name="MMDeleteSuiteCommand"> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/long_name" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:help"> + <mm:action service="Service.ActionHandler" interface="IDataAction"> + <mm:command name="Execute"> + <mm:key name="plugin_id" type="uid" value="0x2001B285" /> + <mm:key name="data"> + <mm:key name="help_uid" type="integer" value="270486738" /> + <mm:key name="help_topic" type="string" value="APP_HLP_APP_SHELL" /> + </mm:key> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:move_to_folder"> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="mm:suite/type = grid" > + <mm:command name="MMMoveToFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/short_name" /> + <mm:key name="folder" type="integer" value="params:folder_id" /> + <mm:key name="widget" type="string" value="mm:suite/type" /> + </mm:command> + </mm:action> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="mm:suite/type = list" > + <mm:command name="MMMoveToFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/long_name" /> + <mm:key name="folder" type="integer" value="params:folder_id" /> + <mm:key name="widget" type="string" value="mm:suite/type" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:add_folder"> + <mm:action service="MultimediaMenu" interface="0x2001CB79"> + <mm:command name="MMCreateNewFolderCommand"> + <mm:key name="item_lock" type="string" value="params:remove_locked" /> + <mm:key name="folder" type="integer" value="params:folder_id" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:delete_folder"> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="mm:suite/type = grid" > + <mm:command name="MMDeleteFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/short_name" /> + <mm:key name="children_count" type="integer" value="folder_items:ReturnValue/[$index]/children_count" /> + </mm:command> + </mm:action> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="mm:suite/type = list" > + <mm:command name="MMDeleteFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/long_name" /> + <mm:key name="children_count" type="integer" value="folder_items:ReturnValue/[$index]/children_count" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:delete_application"> + <mm:action service="MultimediaMenu" interface="0x2001CB79" > + <mm:command name="MMDeleteAppCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + </mm:command> + </mm:action> + </mm:event> + + <mm:event event="custom:rename_folder"> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="mm:suite/type = list" > + <mm:command name="MMRenameFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/long_name" /> + </mm:command> + </mm:action> + <mm:action service="MultimediaMenu" interface="0x2001CB79" condition="mm:suite/type = grid" > + <mm:command name="MMRenameFolderCommand"> + <mm:key name="id" type="integer" value="folder_items:ReturnValue/[$index]/id" /> + <mm:key name="name" type="string" value="folder_items:ReturnValue/[$index]/short_name" /> + </mm:command> + </mm:action> + </mm:event> + <mm:event event="key:move"> + <mm:action service="Service.MenuContent" interface="IMenuContent"> + <mm:constructor> + <mm:key name="ContentName" type="string" value="matrixmenudata" /> + </mm:constructor> + <mm:command name="Organize" mode="async"> + <mm:key name="InData"> + <mm:key name="item_ids" type="list"> + <mm:key name="id" type="boolean" value="event_data:dragged_custom_id" /> + </mm:key> + <mm:key name="before_item_id" type="boolean" value="event_data:dropped_before_custom_id" /> + </mm:key> + </mm:command> + </mm:action> + </mm:event> + <mm:event event="key:move_into"> + <mm:action service="Service.MenuContent" interface="IMenuContent"> + <mm:constructor> + <mm:key name="ContentName" type="string" value="matrixmenudata" /> + </mm:constructor> + <mm:command name="Organize" mode="async"> + <mm:key name="InData"> + <mm:key name="item_ids" type="list"> + <mm:key name="id" type="boolean" value="event_data:dragged_custom_id" /> + </mm:key> + <mm:key name="folder_id" type="boolean" value="folder_items:ReturnValue/[$index]/id" /> + </mm:key> + </mm:command> + </mm:action> + </mm:event> + </mm:edit_mode> + </mm:item> +</mm:content> \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/data/matrixmenudata.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/data/matrixmenudata.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,300 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +============================================================================ +<FileName: "matrixmenudata.dtd"> +<PartOf : "menu content service"> + +<FileDescription: "Localization strings for matrix menu content definition"> +<FileVersion : "1.0"> + +<Copyright: +"Copyright © 2005 Nokia Corporation. +This material, including documentation and any related +computer programs, is protected by copyright controlled by +Nokia Corporation. All rights are reserved. Copying, +including reproducing, storing, adapting or translating, any +or all of this material requires the prior written consent of +Nokia Corporation. This material also contains confidential +information which may not be disclosed to others without the +prior written consent of Nokia Corporation."> +============================================================================ +--> + +<!-- +qtn_fldr_root_level.attributes +qtn_fldr_root_level.recycled "Avkon.loc" +qtn_fldr_root_level.layout "list_single_large_graphic_pane_t1" +qtn_fldr_root_level.release "3.1" +qtn_fldr_root_level.description "Application Shell root level folder name shown in "Move to folder" dialogs" +qtn_fldr_root_level.parents "Folder selection list dialog" +qtn_fldr_root_level.islocalisable "FALSE" +--> +<!ENTITY qtn_fldr_root_level "Root level"> + + +<!-- +qtn_apps_internet_grid.attributes +qtn_apps_internet_grid.layout "cell_app_pane_1" +qtn_apps_internet_grid.release "5.0" +qtn_apps_internet_grid.description "Internet folder caption title" +qtn_apps_internet_grid.parents "Title pane" +qtn_apps_internet_grid.grammar "Internet folder contains e.g. bookmarks" +qtn_apps_internet_grid.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_internet_grid "Internet"> + +<!-- +qtn_apps_photos_grid.attributes +qtn_apps_photos_grid.layout "cell_app_pane_1" +qtn_apps_photos_grid.release "5.0" +qtn_apps_photos_grid.description "Photos folder caption title" +qtn_apps_photos_grid.parents "Title pane" +qtn_apps_photos_grid.grammar "Photos folder contains e.g. galleries" +qtn_apps_photos_grid.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_photos_grid "Photos"> + +<!-- +qtn_apps_music_grid.attributes +qtn_apps_music_grid.layout "cell_app_pane_1" +qtn_apps_music_grid.release "5.0" +qtn_apps_music_grid.description "Music folder caption title" +qtn_apps_music_grid.parents "Title pane" +qtn_apps_music_grid.grammar "Music folder contains e.g. tracks list" +qtn_apps_music_grid.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_music_grid "Music"> + +<!-- +qtn_apps_videotv_grid.attributes +qtn_apps_videotv_grid.layout "cell_app_pane_1" +qtn_apps_videotv_grid.release "5.0" +qtn_apps_videotv_grid.description "Video & TV folder caption title" +qtn_apps_videotv_grid.parents "Title pane" +qtn_apps_videotv_grid.grammar "Video & TV folder contains e.g. movies" +qtn_apps_videotv_grid.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_videotv_grid "Video & TV"> + +<!-- +qtn_apps_games_grid.attributes +qtn_apps_games_grid.layout "cell_app_pane_1" +qtn_apps_games_grid.release "5.0" +qtn_apps_games_grid.description "Games folder caption title" +qtn_apps_games_grid.parents "Title pane" +qtn_apps_games_grid.grammar "Games folder contains e.g. games list" +qtn_apps_games_grid.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_games_grid "Games"> + +<!-- +qtn_apps_applications_grid.attributes +qtn_apps_applications_grid.layout "cell_app_pane_1" +qtn_apps_applications_grid.release "5.0" +qtn_apps_applications_grid.description "Applications folder caption title" +qtn_apps_applications_grid.parents "Title pane" +qtn_apps_applications_grid.grammar "Applications folder contains all available apps" +qtn_apps_applications_grid.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_applications_grid "Applications"> + +<!-- +qtn_apps_contacts_grid.attributes +qtn_apps_contacts_grid.layout "cell_app_pane_1" +qtn_apps_contacts_grid.release "5.0" +qtn_apps_contacts_grid.description "Contacts suite title" +qtn_apps_contacts_grid.parents "Title pane" +qtn_apps_contacts_grid.grammar "Contacts suite contains e.g. phonebook" +qtn_apps_contacts_grid.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_contacts_grid "Contacts"> + +<!-- +qtn_apps_office_grid.attributes +qtn_apps_office_grid.layout "cell_app_pane_1" +qtn_apps_office_grid.release "5.0" +qtn_apps_office_grid.description "Office suite title" +qtn_apps_office_grid.parents "Title pane" +qtn_apps_office_grid.grammar "Office suite" +qtn_apps_office_grid.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_office_grid "Office"> + +<!-- +qtn_apps_internet_list.attributes +qtn_apps_internet_list.layout "list_single_large_graphic_pane_1" +qtn_apps_internet_list.release "5.0" +qtn_apps_internet_list.description "Internet folder caption title" +qtn_apps_internet_list.parents "Title pane" +qtn_apps_internet_list.grammar "Internet folder contains e.g. bookmarks" +qtn_apps_internet_list.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_internet_list "Internet"> + +<!-- +qtn_apps_photos_list.attributes +qtn_apps_photos_list.layout "list_single_large_graphic_pane_1" +qtn_apps_photos_list.release "5.0" +qtn_apps_photos_list.description "Photos folder caption title" +qtn_apps_photos_list.parents "Title pane" +qtn_apps_photos_list.grammar "Photos folder contains e.g. galleries" +qtn_apps_photos_list.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_photos_list "Photos"> + +<!-- +qtn_apps_music_list.attributes +qtn_apps_music_list.layout "list_single_large_graphic_pane_1" +qtn_apps_music_list.release "5.0" +qtn_apps_music_list.description "Music folder caption title" +qtn_apps_music_list.parents "Title pane" +qtn_apps_music_list.grammar "Music folder contains e.g. tracks list" +qtn_apps_music_list.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_music_list "Music"> + +<!-- +qtn_apps_videotv_list.attributes +qtn_apps_videotv_list.layout "list_single_large_graphic_pane_1" +qtn_apps_videotv_list.release "5.0" +qtn_apps_videotv_list.description "Video & TV folder caption title" +qtn_apps_videotv_list.parents "Title pane" +qtn_apps_videotv_list.grammar "Video & TV folder contains e.g. movies" +qtn_apps_videotv_list.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_videotv_list "Video & TV"> + +<!-- +qtn_apps_games_list.attributes +qtn_apps_games_list.layout "list_single_large_graphic_pane_1" +qtn_apps_games_list.release "5.0" +qtn_apps_games_list.description "Games folder caption title" +qtn_apps_games_list.parents "Title pane" +qtn_apps_games_list.grammar "Games folder contains e.g. games list" +qtn_apps_games_list.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_games_list "Games"> + +<!-- +qtn_apps_applications_list.attributes +qtn_apps_applications_list.layout "list_single_large_graphic_pane_1" +qtn_apps_applications_list.release "5.0" +qtn_apps_applications_list.description "Applications folder caption title" +qtn_apps_applications_list.parents "Title pane" +qtn_apps_applications_list.grammar "Applications folder contains all available apps" +qtn_apps_applications_list.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_applications_list "Applications"> + +<!-- +qtn_apps_contacts_list.attributes +qtn_apps_contacts_list.layout "list_single_large_graphic_pane_1" +qtn_apps_contacts_list.release "5.0" +qtn_apps_contacts_list.description "Contacts suite title" +qtn_apps_contacts_list.parents "Title pane" +qtn_apps_contacts_list.grammar "Contacts suite contains e.g. phonebook" +qtn_apps_contacts_list.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_contacts_list "Contacts"> + +<!-- +qtn_apps_office_list.attributes +qtn_apps_office_list.layout "list_single_large_graphic_pane_1" +qtn_apps_office_list.release "5.0" +qtn_apps_office_list.description "Office suite title" +qtn_apps_office_list.parents "Title pane" +qtn_apps_office_list.grammar "Office suite" +qtn_apps_office_list.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_office_list "Office"> + +<!-- +qtn_apps_browserng_title.attributes +qtn_apps_browserng_title.layout "title_pane_t1" +qtn_apps_browserng_title.release "5.0" +qtn_apps_browserng_title.description "Internet folder caption title" +qtn_apps_browserng_title.parents "Title pane" +qtn_apps_browserng_title.grammar "Internet folder contains e.g. bookmarks" +qtn_apps_browserng_title.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_browserng_title "Internet"> + +<!-- +qtn_apps_photos_title.attributes +qtn_apps_photos_title.layout "title_pane_t1" +qtn_apps_photos_title.release "5.0" +qtn_apps_photos_title.description "Photos folder caption title" +qtn_apps_photos_title.parents "Title pane" +qtn_apps_photos_title.grammar "Photos folder contains e.g. galleries" +qtn_apps_photos_title.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_photos_title "Photos"> + +<!-- +qtn_apps_music_title.attributes +qtn_apps_music_title.layout "title_pane_t1" +qtn_apps_music_title.release "5.0" +qtn_apps_music_title.description "Music folder caption title" +qtn_apps_music_title.parents "Title pane" +qtn_apps_music_title.grammar "Music folder contains e.g. tracks list" +qtn_apps_music_title.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_music_title "Music"> + +<!-- +qtn_apps_videotv_title.attributes +qtn_apps_videotv_title.layout "title_pane_t1" +qtn_apps_videotv_title.release "5.0" +qtn_apps_videotv_title.description "Video & TV folder caption title" +qtn_apps_videotv_title.parents "Title pane" +qtn_apps_videotv_title.grammar "Video & TV folder contains e.g. movies" +qtn_apps_videotv_title.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_videotv_title "Video & TV"> + +<!-- +qtn_apps_games_title.attributes +qtn_apps_games_title.layout "title_pane_t1" +qtn_apps_games_title.release "5.0" +qtn_apps_games_title.description "Games folder caption title" +qtn_apps_games_title.parents "Title pane" +qtn_apps_games_title.grammar "Games folder contains e.g. games list" +qtn_apps_games_title.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_games_title "Games"> + +<!-- +qtn_apps_appsfolder_title.attributes +qtn_apps_appsfolder_title.layout "title_pane_t1" +qtn_apps_appsfolder_title.release "5.0" +qtn_apps_appsfolder_title.description "Applications folder caption title" +qtn_apps_appsfolder_title.parents "Title pane" +qtn_apps_appsfolder_title.grammar "Applications folder contains all available apps" +qtn_apps_appsfolder_title.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_appsfolder_title "Applications"> + +<!-- +qtn_apps_phonebook_title.attributes +qtn_apps_phonebook_title.layout "title_pane_t1" +qtn_apps_phonebook_title.release "5.0" +qtn_apps_phonebook_title.description "Contacts suite title" +qtn_apps_phonebook_title.parents "Title pane" +qtn_apps_phonebook_title.grammar "Contacts suite contains e.g. phonebook" +qtn_apps_phonebook_title.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_phonebook_title "Contacts"> + +<!-- +qtn_apps_office_title.attributes +qtn_apps_office_title.layout "title_pane_t1" +qtn_apps_office_title.release "5.0" +qtn_apps_office_title.description "Office suite title" +qtn_apps_office_title.parents "Title pane" +qtn_apps_office_title.grammar "Office suite" +qtn_apps_office_title.islocalisable "TRUE" +--> +<!ENTITY qtn_apps_office_title "Office"> + + +<!-- End of File--> diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/data/matrixmenudata.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/data/matrixmenudata.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,233 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE xcfwml SYSTEM "matrixmenudata.dtd"> +<menu:data xmlns:menu="http:://www.s60.com/xml/applicationshell/1" version="5.0"> + <menu:folder title_name="&qtn_fldr_root_level;" long_name="&qtn_fldr_root_level;" short_name="&qtn_fldr_root_level;"> + <!--Office folder--> + <!-- <menu:folder title_name="&qtn_apps_office_title;" + long_name="&qtn_apps_office_list;" + short_name="&qtn_apps_office_grid;" + applicationgroup_name="Office" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16398" + mask_id="16399" + icon_skin_minor_id="0x1ead" + icon_skin_major_id="0x101F86E3"> --> + <!--Calendar--> + <menu:application uid="0x10005901"/> + <!-- </menu:folder> --> + <!--Contacts application--> + <menu:application uid="0x101F4CCE"/> + <!--music suite--> + <menu:suite title_name="&qtn_apps_music_title;" + long_name="&qtn_apps_music_list;" + short_name="&qtn_apps_music_grid;" + suite_name="musicsuite" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16384" + mask_id="16385" + icon_skin_minor_id="0x2176" + icon_skin_major_id="0x101F86E3"/> + <!-- application used in music suite should be hidden from menu --> + <menu:folder flags="hidden"> + <menu:application uid="0x102072C3"/> <!-- Music Player (MusicPlayer)--> + <menu:application uid="0x10207A89"/> <!-- Radio --> + <menu:application uid="0x101FFB51"/> <!-- Music Store --> + </menu:folder> + <!--Internet folder--> + <!-- now using qgnmenugroupweb available in skin --> + <menu:folder title_name="&qtn_apps_browserng_title;" + long_name="&qtn_apps_internet_list;" + short_name="&qtn_apps_internet_grid;" + applicationgroup_name="internet" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16386" + mask_id="16387" + icon_skin_minor_id="0x2005" + icon_skin_major_id="0x101F86E3" > + <!--Browser--> + <menu:application uid="0x10008D39"/> + <!--Online Search--> + <menu:application uid="0x20000907"/> + </menu:folder> + <!--Messaging application--> + <menu:application uid="0x100058C5"/> + <!--Photos suite--> + <menu:suite title_name="&qtn_apps_photos_title;" + long_name="&qtn_apps_photos_list;" + short_name="&qtn_apps_photos_grid;" + suite_name="photossuite" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16398" + mask_id="16399" + icon_skin_minor_id="0x217c" + icon_skin_major_id="0x101F86E3" /> + <!-- application used in photos suite should be hidden from menu --> + <menu:folder flags="hidden"> + <menu:application uid="0x200009EE"/> <!--Photos--> + <menu:application uid="0x2000BB53"/> <!--Share Online--> + </menu:folder> + <!--Download! application--> + <menu:application uid="0x20007803" /> + <!--Maps application--> + <menu:application uid="0x20001F63"/> + <!--Video & TV suite--> + <menu:suite title_name="&qtn_apps_videotv_title;" + long_name="&qtn_apps_videotv_list;" + short_name="&qtn_apps_videotv_grid;" + suite_name="tvvideosuite" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16402" + mask_id="16403" + icon_skin_minor_id="0x217d" + icon_skin_major_id="0x101F86E3"/> + <!-- application used in video suite should be hidden from menu --> + <menu:folder flags="hidden"> + <menu:application uid="0x102750E2"/> <!--VideoCenter--> + </menu:folder> + <!--Settings/Control Panel--> + <menu:application uid="0x100058EC"/> + <!--Games folder--> + <menu:folder title_name="&qtn_apps_games_title;" + long_name="&qtn_apps_games_list;" + short_name="&qtn_apps_games_grid;" + applicationgroup_name="Games" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16396" + mask_id="16397" + icon_skin_minor_id="0x2184" + icon_skin_major_id="0x101F86E3" > + <!--Games/N-Gage application--> + <!-- <menu:application uid="0x20007B39" /> --> + </menu:folder> + <!--Application folder--> + <menu:folder applicationgroup_name="applications" + default="1" + title_name="&qtn_apps_appsfolder_title;" + long_name="&qtn_apps_applications_list;" + short_name="&qtn_apps_applications_grid;" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16392" + mask_id="16393" + icon_skin_minor_id="0x2174" + icon_skin_major_id="0x101F86E3"> + <menu:application uid="0x20001BB9"/> + <!--Adobe PDF--> + <menu:application uid="0x10005902"/> + <!--Calculator--> + <menu:application uid="0x10005903"/> + <!--Clock--> + <menu:application uid="0x101F4668"/> + <!--Converter--> + <menu:application uid="0x10275458"/> + <!-- Service configurator --> + <menu:application uid="0x10208A0A"/> + <!--Home media ?? Home Connect ??--> + <menu:application uid="0x10005907"/> + <!--Notepad--> + <menu:application uid="0x1028190B"/> + <!--Podcasting--> + <menu:application uid="0x100058CA"/> + <!--Voice recorder--> + <menu:application uid="0x10282411"/> + <!--Search application--> + </menu:folder> + <menu:folder flags="hidden" long_name="mcsplugin_folder"> + <menu:application uid="0x100058EC" + view="0x10207250" + long_name="Connectivity" + presenceicon="SKIN ( 270501603 8586 ): mif ( c:\\data\\Installs\\TemplateData\\templateIcons.mif 16386 16387)"/> + + <menu:application uid="0x100058EC" + view="0x10283321" + long_name="Installations"/> + + <menu:shortcut uid="0x99999999" + long_name="New message" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16392" + mask_id="16393" + icon_skin_minor_id="0x1327" + icon_skin_major_id="0x101F86E3" + param="messaging:msg"/> + + <menu:shortcut uid="0x99999998" + long_name="Sel. message type" + icon_file="aimcsplugin.mif" + icon_id="16388" + mask_id="16389" + icon_skin_minor_id="" + icon_skin_major_id="" + param="messaging:seltype"/> + + <menu:shortcut uid="0x99999997" + long_name="New email" + icon_file="aimcsplugin.mif" + icon_id="16388" + mask_id="16389" + icon_skin_minor_id="" + icon_skin_major_id="" + param="messaging:email"/> + + <menu:shortcut uid="0x99999996" + long_name="New SyncML" + icon_file="aimcsplugin.mif" + icon_id="16390" + mask_id="16391" + icon_skin_minor_id="" + icon_skin_major_id="" + param="messaging:syncmlmail"/> + + <menu:shortcut uid="0x99999995" + long_name="New postcard" + icon_file="aimcsplugin.mif" + icon_id="16388" + mask_id="16389" + icon_skin_minor_id="" + icon_skin_major_id="" + param="messaging:postcard"/> + + <menu:shortcut uid="0x99999994" + long_name="New audio message" + icon_file="aimcsplugin.mif" + icon_id="16388" + mask_id="16389" + icon_skin_minor_id="" + icon_skin_major_id="" + param="messaging:audiomsg"/> + + <menu:url uid="0x99999993" + long_name="Google search" + icon_file="aimcsplugin.mif" + icon_id="16386" + mask_id="16387" + icon_skin_minor_id="" + icon_skin_major_id="" + url="www.google.com"/> + + <menu:url uid="0x99999992" + long_name="Nokia OVI" + icon_file="ovi_brand_graphics.mif" + icon_id="16384" + mask_id="16385" + presenceicon="SKIN ( 0x101F86E3 0x1af5 )" + url="www.ovi.com"/> + + <menu:shortcut uid="0x99999991" + long_name="Undefined" + icon_file="aimcsplugin.mif" + icon_id="16388" + mask_id="16389" + icon_skin_minor_id="0x1af5" + icon_skin_major_id="0x101F86E3"/> + + <menu:shortcut uid="0x99999989" + long_name="Dialed calls" + icon_file="aimcsplugin.mif" + icon_id="16398" + mask_id="16399" + icon_skin_minor_id="" + icon_skin_major_id="" + param="logs:dialed"/> + </menu:folder> + </menu:folder> +</menu:data> diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/data/matrixmenudatatestcontent.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/data/matrixmenudatatestcontent.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE xcfwml SYSTEM "matrixmenudata.dtd"> +<menu:data xmlns:menu="http:://www.s60.com/xml/applicationshell/1" version="5.0"> + <menu:folder title_name="&qtn_fldr_root_level;" long_name="&qtn_fldr_root_level;" short_name="&qtn_fldr_root_level;"> + <!--Office folder--> + <!-- <menu:folder title_name="&qtn_apps_office_title;" + long_name="&qtn_apps_office_list;" + short_name="&qtn_apps_office_grid;" + applicationgroup_name="Office" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16398" + mask_id="16399" + icon_skin_minor_id="0x1ead" + icon_skin_major_id="0x101F86E3"> --> + <!--Calendar--> + <menu:application uid="0x10005901"/> + <!-- </menu:folder> --> + <!--Contacts application--> + <menu:application uid="0x101F4CCE"/> + <!--music folder--> + <menu:folder title_name="&qtn_apps_music_title;" + long_name="&qtn_apps_music_list;" + short_name="&qtn_apps_music_grid;" + applicationgroup_name="Music" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16384" + mask_id="16385" + icon_skin_minor_id="0x217e" + icon_skin_major_id="0x101F86E3"> + <!-- Music Player (MusicPlayer)--> + <menu:application uid="0x102072C3"/> + <!-- Radio --> + <menu:application uid="0x10207A89"/> + <!-- Music Store --> + <menu:application uid="0x101FFB51"/> + <!-- Podcasting --> + <menu:application uid="0x1028190B"/> + </menu:folder> + <!--Internet folder--> + <!-- now using qgnmenugroupweb available in skin --> + <menu:folder title_name="&qtn_apps_browserng_title;" + long_name="&qtn_apps_internet_list;" + short_name="&qtn_apps_internet_grid;" + applicationgroup_name="internet" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16386" + mask_id="16387" + icon_skin_minor_id="0x2005" + icon_skin_major_id="0x101F86E3" > + <!--Browser--> + <menu:application uid="0x10008D39"/> + <!--Share Online--> + <menu:application uid="0x2000BB53"/> + <!--Online Search--> + <menu:application uid="0x20000907"/> + </menu:folder> + <!--Messaging application--> + <menu:application uid="0x100058C5"/> + <!--Photos suite--> + <menu:suite title_name="&qtn_apps_photos_title;" + long_name="&qtn_apps_photos_list;" + short_name="&qtn_apps_photos_grid;" + suite_name="photossuite" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16398" + mask_id="16399" + icon_skin_minor_id="0x217c" + icon_skin_major_id="0x101F86E3" /> + <!--Download! application--> + <menu:application uid="0x20007803" /> + <!--Maps application--> + <menu:application uid="0x20001F63"/> + <!--Video & TV suite--> + <menu:suite title_name="&qtn_apps_videotv_title;" + long_name="&qtn_apps_videotv_list;" + short_name="&qtn_apps_videotv_grid;" + suite_name="tvvideosuite" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16402" + mask_id="16403" + icon_skin_minor_id="0x217d" + icon_skin_major_id="0x101F86E3"/> + <!--Settings/Control Panel--> + <menu:application uid="0x100058EC"/> + <!--Games folder--> + <menu:folder title_name="&qtn_apps_games_title;" + long_name="&qtn_apps_games_list;" + short_name="&qtn_apps_games_grid;" + applicationgroup_name="Games" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16396" + mask_id="16397" + icon_skin_minor_id="0x2184" + icon_skin_major_id="0x101F86E3" > + <!--Games/N-Gage application--> + <!-- <menu:application uid="0x20007B39" /> --> + </menu:folder> + <!--Application folder--> + <menu:folder applicationgroup_name="applications" + default="1" + title_name="&qtn_apps_appsfolder_title;" + long_name="&qtn_apps_applications_list;" + short_name="&qtn_apps_applications_grid;" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16392" + mask_id="16393" + icon_skin_minor_id="0x2174" + icon_skin_major_id="0x101F86E3"> + <menu:application uid="0x20001BB9"/> + <!--Adobe PDF--> + <menu:application uid="0x10005902"/> + <!--Calculator--> + <menu:application uid="0x10005903"/> + <!--Clock--> + <menu:application uid="0x101F4668"/> + <!--Converter--> + <menu:application uid="0x10275458"/> + <!-- Service configurator --> + <menu:application uid="0x10208A0A"/> + <!--Home media ?? Home Connect ??--> + <menu:application uid="0x10005907"/> + <!--Notepad--> + <menu:application uid="0x1028190B"/> + <!--Podcasting--> + <menu:application uid="0x100058CA"/> + <!--Voice recorder--> + <menu:application uid="0x10282411"/> + <!--Search application--> + </menu:folder> + + <!-- Test suites --> + <menu:suite title_name="Base" + long_name="Base" + short_name="Base" + suite_name="basicsuite" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16394" + mask_id="16395" + icon_skin_minor_id="0x13fc" + icon_skin_major_id="0x101F86E3"/> + <menu:suite title_name="Demo" + long_name="Demo" + short_name="Demo" + suite_name="demosuite" + icon_file="z:\resource\apps\matrixmenudata.mif" + icon_id="16394" + mask_id="16395" + icon_skin_minor_id="0x13fc" + icon_skin_major_id="0x101F86E3"/> + <menu:suite title_name="&qtn_apps_office_title;" + long_name="&qtn_apps_office_list;" + short_name="&qtn_apps_office_grid;" + suite_name="ziadromsuite" + icon_file="z:\resource\apps\iadromsuite.mif" + icon_id="16384" + mask_id="16385" + icon_skin_minor_id="0x13fc" + icon_skin_major_id="0x101F86E3"/> + </menu:folder> +</menu:data> \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/data/suite.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/data/suite.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<mm:content xmlns:mm="http://nokia.com/mmenu" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nokia.com/mmenu ../mmenuschema.xsd"> + <mm:localization namespace="foldersuite_rsc" source="foldersuite.rsc"/> + <mm:suite template="logical_template_3|list_single_hc_apps_pane" type="grid|list" genre="foldersuite" title="params:suite_name" custom_id="params:folder_id" emptytext="foldersuite_rsc:R_MENU_FOLDER_EMPTY_TEXT"/> +</mm:content> + diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/eabi/dummyCu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/eabi/dummyCu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + _Z7E32Mainv @ 1 NONAME + diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/gfx/qgn_move_arrow_bottom.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/gfx/qgn_move_arrow_bottom.svg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.0" + width="29.999998" + height="17" + id="svg2"> + <defs + id="defs4" /> + <g + transform="matrix(1,0,0,-1,5.5146966e-2,952.38437)" + id="layer1"> + <path + d="M 8.0180856,5.3832459 L 13.390995,14.908102 L 2.4557733,14.79875 L 8.0180856,5.3832459 z" + transform="matrix(1.6313301,-1.0632413e-2,1.2696974e-2,1.0866093,1.8504061,933.62447)" + id="path3203" + style="opacity:0.5;fill:#00ffff;fill-opacity:1;stroke:#00ffff;stroke-width:3.7553103;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + </g> +</svg> diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/gfx/qgn_move_arrow_left.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/gfx/qgn_move_arrow_left.svg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="17" + height="30" + id="svg2" + sodipodi:version="0.32" + inkscape:version="0.46" + version="1.0" + sodipodi:docname="arrow_left.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs4"> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + id="perspective10" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + gridtolerance="10000" + guidetolerance="10" + objecttolerance="10" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="15.839192" + inkscape:cx="7.6537826" + inkscape:cy="14.270458" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1280" + inkscape:window-height="938" + inkscape:window-x="-4" + inkscape:window-y="-4" + showborder="true" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-7.3183197,-933.11487)"> + <path + sodipodi:type="star" + style="opacity:0.5;fill:#00ffff;fill-opacity:1;stroke:#00ffff;stroke-width:3.7553103;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path3203" + sodipodi:sides="3" + sodipodi:cx="7.9549513" + sodipodi:cy="11.696699" + sodipodi:r1="6.3137689" + sodipodi:r2="3.1568844" + sodipodi:arg1="-1.5607967" + sodipodi:arg2="-0.51359911" + inkscape:flatsided="true" + inkscape:rounded="0" + inkscape:randomized="0" + d="M 8.0180856,5.3832459 L 13.390995,14.908102 L 2.4557733,14.79875 L 8.0180856,5.3832459 z" + transform="matrix(-1.0632413e-2,1.6313301,1.0866093,1.2696974e-2,5.4858753,935.10512)" /> + </g> +</svg> diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/gfx/qgn_move_arrow_right.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/gfx/qgn_move_arrow_right.svg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="17" + height="30" + id="svg2" + sodipodi:version="0.32" + inkscape:version="0.46" + version="1.0" + sodipodi:docname="arrow_right.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs4"> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + id="perspective10" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + gridtolerance="10000" + guidetolerance="10" + objecttolerance="10" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="15.839192" + inkscape:cx="7.6537826" + inkscape:cy="14.270458" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1280" + inkscape:window-height="938" + inkscape:window-x="-4" + inkscape:window-y="-4" + showborder="true" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-7.3183197,-933.11487)"> + <path + sodipodi:type="star" + style="opacity:0.5;fill:#00ffff;fill-opacity:1;stroke:#00ffff;stroke-width:3.7553103;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path3203" + sodipodi:sides="3" + sodipodi:cx="7.9549513" + sodipodi:cy="11.696699" + sodipodi:r1="6.3137689" + sodipodi:r2="3.1568844" + sodipodi:arg1="-1.5607967" + sodipodi:arg2="-0.51359911" + inkscape:flatsided="true" + inkscape:rounded="0" + inkscape:randomized="0" + d="M 8.0180856,5.3832459 L 13.390995,14.908102 L 2.4557733,14.79875 L 8.0180856,5.3832459 z" + transform="matrix(1.0632413e-2,1.6313301,-1.0866093,1.2696974e-2,26.107456,935.16825)" /> + </g> +</svg> diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/gfx/qgn_move_arrow_top.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/gfx/qgn_move_arrow_top.svg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.0" + width="29.999998" + height="17" + id="svg2"> + <defs + id="defs4" /> + <g + transform="translate(-8.9406967e-8,-935.36218)" + id="layer1"> + <path + d="M 8.0180856,5.3832459 L 13.390995,14.908102 L 2.4557733,14.79875 L 8.0180856,5.3832459 z" + transform="matrix(1.6313301,-1.0632413e-2,1.2696974e-2,1.0866093,1.8504061,933.62447)" + id="path3203" + style="opacity:0.5;fill:#00ffff;fill-opacity:1;stroke:#00ffff;stroke-width:3.7553103;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + </g> +</svg> diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/gfx/qgn_move_frame.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/gfx/qgn_move_frame.svg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.0" + width="108" + height="106.99999" + id="svg3758"> + <defs + id="defs3760" /> + <g + transform="translate(-152.14287,-506.79071)" + id="layer1"> + <rect + width="98" + height="96.999992" + x="157.14287" + y="511.79071" + id="rect3768" + style="opacity:0.5;fill:none;fill-opacity:1;stroke:#00ffff;stroke-width:8;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + </g> +</svg> diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project foldersuite +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// exports for HW +// touch +../data/suite.xml /epoc32/data/z/private/101F4CD2/import/suites/foldersuite_touch/suite.xml +../data/items_touch.xml /epoc32/data/z/private/101F4CD2/import/suites/foldersuite_touch/items.xml +// non-touch +../data/suite.xml /epoc32/data/z/private/101F4CD2/import/suites/foldersuite_nontouch/suite.xml +../data/items_nontouch.xml /epoc32/data/z/private/101F4CD2/import/suites/foldersuite_nontouch/items.xml + +// exports for emulator +// touch +../data/suite.xml /epoc32/release/winscw/udeb/z/private/101F4CD2/import/suites/foldersuite_touch/suite.xml +../data/suite.xml /epoc32/release/winscw/urel/z/private/101F4CD2/import/suites/foldersuite_touch/suite.xml +../data/items_touch.xml /epoc32/release/winscw/udeb/z/private/101F4CD2/import/suites/foldersuite_touch/items.xml +../data/items_touch.xml /epoc32/release/winscw/urel/z/private/101F4CD2/import/suites/foldersuite_touch/items.xml +// non-touch +../data/suite.xml /epoc32/release/winscw/udeb/z/private/101F4CD2/import/suites/foldersuite_nontouch/suite.xml +../data/suite.xml /epoc32/release/winscw/urel/z/private/101F4CD2/import/suites/foldersuite_nontouch/suite.xml +../data/items_nontouch.xml /epoc32/release/winscw/udeb/z/private/101F4CD2/import/suites/foldersuite_nontouch/items.xml +../data/items_nontouch.xml /epoc32/release/winscw/urel/z/private/101F4CD2/import/suites/foldersuite_nontouch/items.xml +// default +../data/suite.xml /epoc32/release/winscw/udeb/z/private/101F4CD2/import/suites/foldersuite/suite.xml +../data/suite.xml /epoc32/release/winscw/urel/z/private/101F4CD2/import/suites/foldersuite/suite.xml +#ifdef __PEN_SUPPORT +../data/items_touch.xml /epoc32/release/winscw/udeb/z/private/101F4CD2/import/suites/foldersuite/items.xml +../data/items_touch.xml /epoc32/release/winscw/urel/z/private/101F4CD2/import/suites/foldersuite/items.xml +#else +../data/items_nontouch.xml /epoc32/release/winscw/udeb/z/private/101F4CD2/import/suites/foldersuite/items.xml +../data/items_nontouch.xml /epoc32/release/winscw/urel/z/private/101F4CD2/import/suites/foldersuite/items.xml +#endif + +../loc/matrixmenudata.loc APP_LAYER_LOC_EXPORT_PATH(matrixmenudata.loc) +// MCS root folder configuration +#ifdef _MATRIX_MENU_INCLUDE_TEST_CONTENT +../data/matrixmenudatatestcontent.xml /epoc32/RELEASE/winscw/udeb/Z/private/200113DD/content/matrixmenudata.xml +../data/matrixmenudatatestcontent.xml /epoc32/RELEASE/winscw/urel/Z/private/200113DD/content/matrixmenudata.xml +../data/matrixmenudatatestcontent.xml /epoc32/data/Z/private/200113DD/content/matrixmenudata.xml +#else +../data/matrixmenudata.xml /epoc32/RELEASE/winscw/udeb/Z/private/200113DD/content/matrixmenudata.xml +../data/matrixmenudata.xml /epoc32/RELEASE/winscw/urel/Z/private/200113DD/content/matrixmenudata.xml +../data/matrixmenudata.xml /epoc32/data/Z/private/200113DD/content/matrixmenudata.xml +#endif +../data/matrixmenudata.dtd /epoc32/RELEASE/winscw/udeb/Z/private/200113DD/content/01/matrixmenudata.dtd +../data/matrixmenudata.dtd /epoc32/RELEASE/winscw/urel/Z/private/200113DD/content/01/matrixmenudata.dtd +../data/matrixmenudata.dtd /epoc32/data/Z/private/200113DD/content/01/matrixmenudata.dtd + +#ifdef SBSV2 +./copyheaderfile.xml /epoc32/tools/makefile_templates/general/copyheaderfile.xml +./copyheaderfile.flm /epoc32/tools/makefile_templates/general/copyheaderfile.flm +./copyheaderfile.meta /epoc32/tools/makefile_templates/general/copyheaderfile.meta +#endif + +PRJ_MMPFILES +foldersuite.mmp +#ifndef SBSV2 +gnumakefile exportfoldersuite.mk +#ifndef __PEN_SUPPORT +gnumakefile exportmoveindicatoricons.mk +#endif +#endif + +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME matrixmenudata +OPTION DTD_TYPE dtd +END + +START EXTENSION s60/mifconv +OPTION TARGETFILE gridroot.mif +OPTION HEADERFILE gridroot.mbg +OPTION SOURCES -c8,8 qgn_prop_folder_large -c8,8 qgn_prop_folder_empty -c8,8 qgn_prop_drm_rights_valid_super -c8,8 qgn_prop_drm_rights_exp_super -c8,8 qgn_indi_org_icon_locked -c8,8 qgn_indi_app_open -c8,8 qgn_prop_folder_parent -c8,8 qgn_prop_folder_medium +END + +START EXTENSION s60/mifconv +OPTION TARGETFILE matrixmenudata.mif +OPTION HEADERFILE matrixmenudata.mbg +OPTION SOURCES -c8,8 qgn_menu_music -c8,8 qgn_menu_group_web -c8,8 qgn_menu_photos -c8,8 qgn_menu_video -c8,8 qgn_menu_group_apps -c8,8 qgn_menu_group_extras -c8,8 qgn_menu_games -c8,8 qgn_menu_group_organiser +END + +#ifndef __PEN_SUPPORT +START EXTENSION s60/mifconv +OPTION TARGETFILE move_indicator_icons.mif +OPTION HEADERFILE move_indicator_icons.mbg +OPTION SOURCES -c8,8 qgn_indi_org_arrow_down -c8,8 qgn_indi_org_arrow_left -c8,8 qgn_indi_org_arrow_right -c8,8 qgn_indi_org_arrow_up +END +#endif + +#if defined(SBSV2) && defined(WINSCW) +START EXTENSION general/copyheaderfile + SRCFILE foldersuite.rsg +END + +START EXTENSION general/copyheaderfile + SRCFILE gridroot.mbg +END + +START EXTENSION general/copyheaderfile + SRCFILE matrixmenudata.mbg +END +#ifndef __PEN_SUPPORT +START EXTENSION general/copyheaderfile + SRCFILE move_indicator_icons.mbg +END +#endif +#endif \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/group/copyheaderfile.flm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/group/copyheaderfile.flm Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,44 @@ +# copyheaderfile.flm +# +# Copyright (c) 2008-2009 Nokia Ltd. All rights reserved. +# +# Header file exporting Function Like Makefile (FLM) +# The file destinations relative to EPOCROOT + +## Inputs +# SRCFILE + +CLEANTARGETS:= +RELEASEABLES:= +CREATABLEPATHS:= + +# Check if all the inputs are present +$(if $(SRCFILE),,$(error Must define SRCFILE)) + +ifeq ($(PLATFORM),WINSCW) +TRGDIR:=$(EPOCROOT)/epoc32/release/winscw/$(CFG)/z/resource/apps +TARGET:=$(TRGDIR)/$(SRCFILE) +RSGFILE:=$(EPOCROOT)/epoc32/include/$(SRCFILE) +CREATABLEPATHS:=$(TRGDIR) +RELEASEABLES:=$(TARGET) +CLEANTARGETS:=$(RELEASEABLES) + +define copyheaderfile +$(GUARD)_$(CFG):=1 +ALL:: $(TARGET) + +$(TARGET) : $(RSGFILE) + $(call startrule,copyheaderfile,FORCESUCCESS) \ + $(GNUCP) $$< $$@ && \ + $(GNUCHMOD) a+rw "$$@" \ + $(call endrule,copyheaderfile) +endef + +ifeq ($($(GUARD)_$(CFG)),) +$(eval -$(copyheaderfile)) +$(eval $(call makepath,$(CREATABLEPATHS))) +$(eval $(call whatmacro,$(RELEASEABLES),WHATMAKEFILE)) +$(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS))) +endif + +endif diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/group/copyheaderfile.meta --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/group/copyheaderfile.meta Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,22 @@ +# ============================================================================ +# Name : copyheaderfile.meta +# Part of : foldersuite +# Description : +# Version : %version: 1 % +# +# Copyright (c) 2008 Nokia Corporation. +# This material, including documentation and any related +# computer programs, is protected by copyright controlled by +# Nokia Corporation. All rights are reserved. Copying, +# including reproducing, storing, adapting or translating, any +# or all of this material requires the prior written consent of +# Nokia Corporation. This material also contains confidential +# information which may not be disclosed to others without the +# prior written consent of Nokia Corporation. +# ============================================================================ + +platform win32 +makefile gnumake +techstream s60 + + diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/group/copyheaderfile.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/group/copyheaderfile.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- +# ============================================================================ +# Name : copyheaderfile.xml +# Part of : mifconv_templates +# Description : +# Version : %version: 1 % +# +# Copyright (c) 2008 Nokia Corporation. +# This material, including documentation and any related +# computer programs, is protected by copyright controlled by +# Nokia Corporation. All rights are reserved. Copying, +# including reproducing, storing, adapting or translating, any +# or all of this material requires the prior written consent of +# Nokia Corporation. This material also contains confidential +# information which may not be disclosed to others without the +# prior written consent of Nokia Corporation. +# ============================================================================ +--> + +<build xmlns="http://symbian.com/xml/build" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symbian.com/xml/build ../../schema/build/2_0.xsd"> + <interface name="general.copyheaderfile" extends="Symbian.UserFLM" flm="copyheaderfile.flm"> + <param name='SRCFILE' default=''/> + </interface> + +</build> diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/group/exportfoldersuite.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/group/exportfoldersuite.mk Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,30 @@ +# +# Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: resource makefile for folder suite. +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=$(EPOCROOT)epoc32/release/$(PLATFORM)/$(CFG)/Z +else +ZDIR=$(EPOCROOT)epoc32/data/z +endif + +FINAL : + echo Exporting .rsg files... + perl -S $(EPOCROOT)epoc32/tools/ecopyfile.pl "$(EPOCROOT)epoc32/include/foldersuite.rsg" "$(ZDIR)/resource/apps/foldersuite.rsg" + echo Exporting .mbg files... + perl -S $(EPOCROOT)epoc32/tools/ecopyfile.pl "$(EPOCROOT)epoc32/include/gridroot.mbg" "$(ZDIR)/resource/apps/gridroot.mbg" + perl -S $(EPOCROOT)epoc32/tools/ecopyfile.pl "$(EPOCROOT)epoc32/include/matrixmenudata.mbg" "$(ZDIR)/resource/apps/matrixmenudata.mbg" + +MAKMAKE FREEZE LIB CLEANLIB RESOURCE RELEASABLES CLEAN BLD SAVESPACE : diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/group/exportmoveindicatoricons.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/group/exportmoveindicatoricons.mk Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,27 @@ +# +# Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: resource makefile for folder suite. +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=$(EPOCROOT)epoc32/release/$(PLATFORM)/$(CFG)/Z +else +ZDIR=$(EPOCROOT)epoc32/data/z +endif + +FINAL : + echo Exporting mbg file... + perl -S $(EPOCROOT)epoc32/tools/ecopyfile.pl "$(EPOCROOT)epoc32/include/move_indicator_icons.mbg" "$(ZDIR)/resource/apps/move_indicator_icons.mbg" + +MAKMAKE FREEZE LIB CLEANLIB RESOURCE RELEASABLES CLEAN BLD SAVESPACE : diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/group/foldersuite.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/group/foldersuite.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +/* +* 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: Project definition file for project folder suite. +* +*/ + + +#include <platform_paths.hrh> +#include <data_caging_paths.hrh> + +TARGET dummyC.dll +TARGETTYPE dll + +UID 0x0 0x02349823 +CAPABILITY CAP_GENERAL_DLL + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src +SOURCE dummyC.cpp + +SOURCEPATH . +USERINCLUDE ../../../menufwui/matrixmenu/loc + + +START RESOURCE ../data/foldersuite.rss +HEADER +TARGETPATH APP_RESOURCE_DIR +LANGUAGE_IDS +END + +// End of file diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/loc/matrixmenudata.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/loc/matrixmenudata.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,171 @@ +/* +* Copyright (c) 2007-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: Localization strings for project Menu Framework. +* +*/ + + +CHARACTER_SET UTF8 + +//d: Name of the root level. +//d: Displayed in move to folder popup. +//l: list_single_graphic_pane_t1_cp2 +//r: 1.0 +#define qtn_fldr_root_level "Root level" + +//d: Title of the Photos suite. +//d: Displayed as an item title in grid. +//l: cell_app_pane_t1 +//r: 1.0 +#define qtn_apps_photos_grid "Photos" + +//d: Title of the Music suite. +//d: Displayed as an item title in grid. +//l: cell_app_pane_t1 +//r: 1.0 +#define qtn_apps_music_grid "Music" + +//d: Title of the Video & TV suite. +//d: Displayed as an item title in grid. +//l: cell_app_pane_t1 +//r: 1.0 +#define qtn_apps_videotv_grid "Video & TV" + +//d: Title of the Games suite. +//d: Displayed as an item title in grid. +//l: aagrid_cell_image_pane_t1/opt2 +//r: 1.0 +#define qtn_apps_games_grid "Games" + +//d: Title of the Contacts suite. +//d: Displayed as an item title in grid. +//l: cell_app_pane_t1 +//r: 1.0 +#define qtn_apps_contacts_grid "Contacts" + +//d: Title of the Office suite. +//d: Displayed as an item title in grid. +//l: cell_app_pane_t1 +//r: 1.0 +#define qtn_apps_office_grid "Office" + +//d: Title of the Internet folder. +//d: Displayed as an item title in grid. +//l: cell_app_pane_t1 +//r: 1.0 +#define qtn_apps_internet_grid "Internet" + +//d: Title of the Applications folder. +//d: Displayed as an item title in grid. +//l: cell_app_pane_t1 +//r: 1.0 +#define qtn_apps_applications_grid "Applications" + +//d: Title of the Photos suite. +//d: Displayed as an item title in list. +//l: list_single_large_graphic_pane_t1 +//r: 1.0 +#define qtn_apps_photos_list "Photos" + +//d: Title of the Music suite. +//d: Displayed as an item title in list. +//l: list_single_large_graphic_pane_t1 +//r: 1.0 +#define qtn_apps_music_list "Music" + +//d: Title of the Video & TV suite. +//d: Displayed as an item title in list. +//l: list_single_large_graphic_pane_t1 +//r: 1.0 +#define qtn_apps_videotv_list "Video & TV" + +//d: Title of the Games suite. +//d: Displayed as an item title in list. +//l: aalist_single_large_graphic_pane_t1 +//r: 1.0 +#define qtn_apps_games_list "Games" + +//d: Title of the Contacts suite. +//d: Displayed as an item title in list. +//l: list_single_large_graphic_pane_t1 +//r: 1.0 +#define qtn_apps_contacts_list "Contacts" + +//d: Title of the Office suite. +//d: Displayed as an item title in list. +//l: list_single_large_graphic_pane_t1 +//r: 1.0 +#define qtn_apps_office_list "Office" + +//d: Title of the Internet folder. +//d: Displayed as an item title in list. +//l: list_single_large_graphic_pane_t1 +//r: 1.0 +#define qtn_apps_internet_list "Internet" + +//d: Title of the Applications folder. +//d: Displayed as an item title in list. +//l: list_single_large_graphic_pane_t1 +//r: 1.0 +#define qtn_apps_applications_list "Applications" + +//d: Title of the Photos suite. +//d: Displayed as an item title in grid. +//l: title_pane_t2/opt9 +//r: 1.0 +#define qtn_apps_photos_title "Photos" + +//d: Title of the Music suite. +//d: Displayed as an item title in grid. +//l: aagrid_cell_image_pane_t1/opt2 +//r: 1.0 +#define qtn_apps_music_title "Music" + +//d: Title of the Video & TV suite. +//d: Displayed as an item title in grid. +//l: title_pane_t2/opt9 +//r: 1.0 +#define qtn_apps_videotv_title "Video & TV" + +//d: Title of the Games suite. +//d: Displayed as an item title in grid. +//l: title_pane_t2/opt9 +//r: 1.0 +#define qtn_apps_games_title "Games" + +//d: Title of the Contacts suite. +//d: Displayed as an item title in grid. +//l: cell_app_pane_t1 +//r: 1.0 +#define qtn_apps_phonebook_title "Contacts" + +//d: Title of the Office suite. +//d: Displayed as an item title in grid. +//l: title_pane_t2/opt9 +//r: 1.0 +#define qtn_apps_office_title "Office" + +//d: Title of the Internet folder. +//d: Displayed as an item title in grid. +//l: title_pane_t2/opt9 +//r: 1.0 +#define qtn_apps_browserng_title "Internet" + +//d: Title of the Applications folder. +//d: Displayed as an item title in grid. +//l: title_pane_t2/opt9 +//r: 1.0 +#define qtn_apps_appsfolder_title "Applications" + +// end of file diff -r 000000000000 -r f72a12da539e menufw/menusuites/foldersuite/src/dummyC.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/foldersuite/src/dummyC.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include <e32def.h> + +EXPORT_C int E32Main() +{ + return 0; +} diff -r 000000000000 -r f72a12da539e menufw/menusuites/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project menusuites +* +*/ + + +#include <platform_paths.hrh> + +#include "../foldersuite/group/bld.inf" + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/menusuites.iby CORE_APP_LAYER_IBY_EXPORT_PATH(menusuites.iby) +../rom/menusuites_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(menusuites_resources.iby) + +../data/mmenuschema.xsd /epoc32/release/winscw/udeb/z/private/101F4CD2/import/suites/mmenuschema.xsd +../data/mmenuschema.xsd /epoc32/release/winscw/urel/z/private/101F4CD2/import/suites/mmenuschema.xsd +../data/mmenuschema.xsd /epoc32/data/z/private/101F4CD2/import/suites/mmenuschema.xsd + +PRJ_MMPFILES +#ifndef SBSV2 +#ifdef WINSCW +gnumakefile validateNewMenuFw.mk +#endif +#endif + +#ifdef _MATRIX_MENU_INCLUDE_TEST_CONTENT +#include "../internal/test/group/bld.inf" +#endif diff -r 000000000000 -r f72a12da539e menufw/menusuites/group/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/group/build.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,18 @@ +<project name="menufw" default="validate" basedir="."> + <description> + this script validates MenuFw suites definitiona against XML Scheme + </description> + + <echo>VALIDATION SCRIPT: This script validates files in ${xmllocation} againsts XML shema</echo> + + <target name="validate" > + <xmlvalidate failonerror="true"> + <attribute name="http://xml.org/sax/features/validation" value="true"/> + <attribute name="http://apache.org/xml/features/validation/schema" value="true"/> + <attribute name="http://xml.org/sax/features/namespaces" value="true"/> + + <fileset dir="${xmllocation}" includes="**/*.xml" excludes="*.xml"/> + </xmlvalidate > + </target> + +</project> \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menusuites/group/validate.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/group/validate.mk Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,21 @@ +# +# 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: scalable icon makefile for project +# + + +FINAL : + echo VALIDATE + ant -q -Dxmllocation="\epoc32\release\winscw\udeb\Z\private\20012474\import\suites\" +MAKMAKE FREEZE LIB CLEANLIB RESOURCE RELEASABLES CLEAN BLD SAVESPACE : diff -r 000000000000 -r f72a12da539e menufw/menusuites/group/validateNewMenuFw.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/group/validateNewMenuFw.mk Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +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: scalable icon makefile for project +# + +FINAL : + echo VALIDATE + ant -q -Dxmllocation="\epoc32\release\winscw\udeb\Z\private\101F4CD2\import\suites\" +MAKMAKE FREEZE LIB CLEANLIB RESOURCE RELEASABLES CLEAN BLD SAVESPACE : diff -r 000000000000 -r f72a12da539e menufw/menusuites/rom/menusuites.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/rom/menusuites.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,51 @@ +/* +* 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: IBY file for the menusuites subsystem +* +*/ + + +#ifndef MENUSUITES_IBY +#define MENUSUITES_IBY + + +data=\epoc32\data\z\resource\apps\gridroot.mif resource\apps\gridroot.mif +data=\epoc32\include\gridroot.mbg resource\apps\gridroot.mbg + +data=\epoc32\data\z\resource\apps\matrixmenudata.mif resource\apps\matrixmenudata.mif +data=\epoc32\include\matrixmenudata.mbg resource\apps\matrixmenudata.mbg + +data=\epoc32\data\Z\private\200113DD\content\matrixmenudata.xml private\200113DD\content\matrixmenudata.xml + +#ifndef __PEN_SUPPORT +data=\epoc32\data\z\resource\apps\move_indicator_icons.mif resource\apps\move_indicator_icons.mif +data=\epoc32\data\z\resource\apps\move_indicator_icons.mbg resource\apps\move_indicator_icons.mbg +#endif + +// FOLDER SUITE + +#ifdef __PEN_SUPPORT +data=/epoc32/data/z/private/101F4CD2/import/suites/foldersuite_touch\suite.xml private\101F4CD2\import\suites\foldersuite\suite.xml +data=/epoc32/data/z/private/101F4CD2/import/suites/foldersuite_touch\items.xml private\101F4CD2\import\suites\foldersuite\items.xml +#else +data=/epoc32/data/z/private/101F4CD2/import/suites/foldersuite_nontouch\suite.xml private\101F4CD2\import\suites\foldersuite\suite.xml +data=/epoc32/data/z/private/101F4CD2/import/suites/foldersuite_nontouch\items.xml private\101F4CD2\import\suites\foldersuite\items.xml +#endif + +/* File containing localization strings */ +data=\epoc32\include\foldersuite.rsg resource\apps\foldersuite.rsg + +#endif // MENUSUITES_IBY + +// End of File \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/menusuites/rom/menusuites_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/menusuites/rom/menusuites_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,27 @@ +/* +* 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: IBY file for the menusuites subsystem +* +*/ + + +#ifndef MENUSUITES_RESOURCES_IBY +#define MENUSUITES_RESOURCES_IBY + +data=\epoc32\data\z\resource\apps\foldersuite.rsc resource\apps\foldersuite.rsc +data=\epoc32\data\Z\private\200113DD\content\01\matrixmenudata.dtd private\200113DD\content\01\matrixmenudata.dtd + +#endif // MENUSUITES_RESOURCES_IBY + +// End of File \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/rom/menufw_stub.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/rom/menufw_stub.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,26 @@ +/* +* 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: +* +*/ + + +#ifndef MENUFW_STUB_IBY +#define MENUFW_STUB_IBY + +data=\epoc32\data\z\system\install\menufw_stub.sis system\install\menufw_stub.sis + +#endif // MENUFW_STUB_IBY + +// End of File \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/sis/menufw_SA_RU.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/sis/menufw_SA_RU.pkg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,103 @@ +; +; Copyright (c) 2002-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: +; + +;Languages +&EN + +;Header +#{"MenuFW"},(0x101f4cd2),2,0,0, TYPE=SA, RU +; Supports Series 60 v5.0 +(0x1028315F), 0, 0, 0, {"Series60ProductID"} + +;Localised Vendor name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +;Files to install + +;hierarchynavigator +"\epoc32\release\armv5\urel\hnengine.dll" -"!:\sys\bin\hnengine.dll" +"\epoc32\release\armv5\urel\hnpresentationmodel.dll" -"!:\sys\bin\hnpresentationmodel.dll" +"\epoc32\release\armv5\urel\hnmetadatamodel.dll" -"!:\sys\bin\hnmetadatamodel.dll" +"\epoc32\release\armv5\urel\hnutilities.dll" -"!:\sys\bin\hnutilities.dll" + +;menufwui +"\epoc32\release\armv5\urel\mmextensionmanager.dll" -"!:\sys\bin\mmextensionmanager.dll" +"\epoc32\release\armv5\urel\mmfolderuiextensionplugin.dll" -"!:\sys\bin\mmfolderuiextensionplugin.dll" +"\epoc32\data\z\resource\plugins\mmfolderuiextensionplugin.rsc" -"!:\resource\plugins\mmfolderuiextensionplugin.rsc" +"\epoc32\data\z\resource\apps\mmfolderuiextplugin.rsc" -"!:\resource\apps\mmfolderuiextplugin.rsc" + +;matrixmenu +"\epoc32\release\armv5\urel\matrixmenu.exe" -"!:\sys\bin\matrixmenu.exe" +"\epoc32\data\z\private\10003a3f\apps\matrixmenu_reg.rsc" -"c:\private\10003a3f\import\apps\matrixmenu_reg.rsc" +"\epoc32\data\z\resource\apps\matrixmenu.mif" -"!:\resource\apps\matrixmenu.mif" +"\epoc32\data\z\resource\apps\matrixmenu.rsc" -"!:\resource\apps\matrixmenu.rsc" + +"\epoc32\data\z\resource\apps\matrixmenu.r01" -"!:\resource\apps\matrixmenu.r01" +"\epoc32\data\z\resource\apps\gridroot.mbg" -"!:\resource\apps\gridroot.mbg" +"\epoc32\data\z\resource\apps\gridroot.mif" -"!:\resource\apps\gridroot.mif" + +"\epoc32\data\z\resource\apps\move_indicator_icons.mbg" -"!:\resource\apps\move_indicator_icons.mbg" +"\epoc32\data\z\resource\apps\move_indicator_icons.mif" -"!:\resource\apps\move_indicator_icons.mif" + +;mmwidgets +"\epoc32\release\armv5\urel\mmwidgets.dll" -"!:\sys\bin\mmwidgets.dll" + +;tamplates + +"\epoc32\data\z\resource\list\custom\akn_single_large_graphic_pane.xml" -"!:\resource\list\custom\akn_single_large_graphic_pane.xml" +"\epoc32\data\z\resource\list\custom\akn_logical_template_1.xml" -"!:\resource\list\custom\akn_logical_template_1.xml" +"\epoc32\data\z\resource\list\custom\akn_logical_template_2.xml" -"!:\resource\list\custom\akn_logical_template_2.xml" +"\epoc32\data\z\resource\list\custom\akn_logical_template_3.xml" -"!:\resource\list\custom\akn_logical_template_3.xml" +"\epoc32\data\z\resource\list\custom\akn_logical_template_4.xml" -"!:\resource\list\custom\akn_logical_template_4.xml" +"\epoc32\data\z\resource\list\custom\akn_logical_template_5.xml" -"!:\resource\list\custom\akn_logical_template_5.xml" +"\epoc32\data\z\resource\list\custom\akn_logical_template_6.xml" -"!:\resource\list\custom\akn_logical_template_6.xml" +"\epoc32\data\z\resource\list\custom\akn_logical_template_7.xml" -"!:\resource\list\custom\akn_logical_template_7.xml" +"\epoc32\data\z\resource\list\custom\akn_logical_template_8.xml" -"!:\resource\list\custom\akn_logical_template_8.xml" +;"\epoc32\data\z\resource\list\custom\akn_logical_template_10.xml" -"!:\resource\list\custom\akn_logical_template_10.xml" +;"\epoc32\data\z\resource\list\custom\akn_logical_template_11.xml" -"!:\resource\list\custom\akn_logical_template_11.xml" +"\epoc32\data\z\resource\list\custom\akn_logical_template_12.xml" -"!:\resource\list\custom\akn_logical_template_12.xml" +;"\epoc32\data\z\resource\list\custom\akn_logical_template_13.xml" -"!:\resource\list\custom\akn_logical_template_13.xml" + +"\epoc32\data\z\resource\grid\custom\akn_single_large_graphic_pane.xml" -"!:\resource\grid\custom\akn_single_large_graphic_pane.xml" +"\epoc32\data\z\resource\grid\custom\akn_logical_template_1.xml" -"!:\resource\grid\custom\akn_logical_template_1.xml" +"\epoc32\data\z\resource\grid\custom\akn_logical_template_2.xml" -"!:\resource\grid\custom\akn_logical_template_2.xml" +"\epoc32\data\z\resource\grid\custom\akn_logical_template_3.xml" -"!:\resource\grid\custom\akn_logical_template_3.xml" +"\epoc32\data\z\resource\grid\custom\akn_logical_template_4.xml" -"!:\resource\grid\custom\akn_logical_template_4.xml" + + +;lct +"\epoc32\data\z\resource\list\lct\akn_single_large_graphic_pane.xml" -"!:\resource\list\lct\akn_single_large_graphic_pane.xml" +"\epoc32\data\z\resource\list\lct\akn_logical_template_1.xml" -"!:\resource\list\lct\akn_logical_template_1.xml" +"\epoc32\data\z\resource\list\lct\akn_logical_template_2.xml" -"!:\resource\list\lct\akn_logical_template_2.xml" +"\epoc32\data\z\resource\list\lct\akn_logical_template_3.xml" -"!:\resource\list\lct\akn_logical_template_3.xml" +"\epoc32\data\z\resource\list\lct\akn_logical_template_4.xml" -"!:\resource\list\lct\akn_logical_template_4.xml" +"\epoc32\data\z\resource\list\lct\akn_logical_template_5.xml" -"!:\resource\list\lct\akn_logical_template_5.xml" +"\epoc32\data\z\resource\list\lct\akn_logical_template_6.xml" -"!:\resource\list\lct\akn_logical_template_6.xml" +"\epoc32\data\z\resource\list\lct\akn_logical_template_7.xml" -"!:\resource\list\lct\akn_logical_template_7.xml" +"\epoc32\data\z\resource\list\lct\akn_logical_template_8.xml" -"!:\resource\list\lct\akn_logical_template_8.xml" +"\epoc32\data\z\resource\list\lct\akn_logical_template_12.xml" -"!:\resource\list\lct\akn_logical_template_12.xml" +;suites +"\epoc32\data\Z\private\101f4cd2\import\suites\foldersuite\suite.xml" -"!:\private\101f4cd2\import\suites\foldersuite\suite.xml" +"\epoc32\data\Z\private\101f4cd2\import\suites\foldersuite\items.xml" -"!:\private\101f4cd2\import\suites\foldersuite\items.xml" +"\epoc32\data\Z\resource\apps\foldersuite.rsc" -"!:\resource\apps\foldersuite.rsc" +"\epoc32\data\Z\resource\apps\foldersuite.rsg" -"!:\resource\apps\foldersuite.rsg" + + +;TEST CONTENT +;removed \ No newline at end of file diff -r 000000000000 -r f72a12da539e menufw/sis/menufw_stub.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/sis/menufw_stub.pkg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,102 @@ +; +; 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: +; + +;Languages +&EN + +;Header +#{"MenuFW"},(0x101f4cd2),1,0,0, TYPE=SA +; Supports Series 60 v5.0 +(0x1028315F), 0, 0, 0, {"Series60ProductID"} + +;Localised Vendor name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +;Files + +;hierarchynavigator +"" -"z:\sys\bin\hnengine.dll" +"" -"z:\sys\bin\hnpresentationmodel.dll" +"" -"z:\sys\bin\hnmetadatamodel.dll" +"" -"z:\sys\bin\hnutilities.dll" + +;menufwui +"" -"z:\sys\bin\mmextensionmanager.dll" +"" -"z:\sys\bin\mmfolderuiextensionplugin.dll" +"" -"z:\resource\plugins\mmfolderuiextensionplugin.rsc" +"" -"z:\resource\apps\mmfolderuiextplugin.rsc" + +;matrixmenu +"" -"z:\sys\bin\matrixmenu.exe" +"" -"z:\private\10003a3f\import\apps\matrixmenu_reg.rsc" +"" -"z:\resource\apps\matrixmenu.mif" +"" -"z:\resource\apps\matrixmenu.r*" + + +"" -"z:\resource\apps\gridroot.mbg" +"" -"z:\resource\apps\gridroot.mif" + +"" -"z:\resource\apps\move_indicator_icons.mbg" +"" -"z:\resource\apps\move_indicator_icons.mif" + +;mmwidgets +"" -"z:\sys\bin\mmwidgets.dll" + +;tamplates + +"" -"z:\resource\list\custom\akn_single_large_graphic_pane.xml" +"" -"z:\resource\list\custom\akn_logical_template_1.xml" +"" -"z:\resource\list\custom\akn_logical_template_2.xml" +"" -"z:\resource\list\custom\akn_logical_template_3.xml" +"" -"z:\resource\list\custom\akn_logical_template_4.xml" +"" -"z:\resource\list\custom\akn_logical_template_5.xml" +"" -"z:\resource\list\custom\akn_logical_template_6.xml" +"" -"z:\resource\list\custom\akn_logical_template_7.xml" +"" -"z:\resource\list\custom\akn_logical_template_8.xml" +"" -"z:\resource\list\custom\akn_logical_template_10.xml" +"" -"z:\resource\list\custom\akn_logical_template_11.xml" +"" -"z:\resource\list\custom\akn_logical_template_12.xml" +"" -"z:\resource\list\custom\akn_logical_template_13.xml" + +"" -"z:\resource\grid\custom\akn_single_large_graphic_pane.xml" +"" -"z:\resource\grid\custom\akn_logical_template_1.xml" +"" -"z:\resource\grid\custom\akn_logical_template_2.xml" +"" -"z:\resource\grid\custom\akn_logical_template_3.xml" +"" -"z:\resource\grid\custom\akn_logical_template_4.xml" + +;lct +"" -"z:\resource\list\lct\akn_single_large_graphic_pane.xml" +"" -"z:\resource\list\lct\akn_logical_template_1.xml" +"" -"z:\resource\list\lct\akn_logical_template_2.xml" +"" -"z:\resource\list\lct\akn_logical_template_3.xml" +"" -"z:\resource\list\lct\akn_logical_template_4.xml" +"" -"z:\resource\list\lct\akn_logical_template_5.xml" +"" -"z:\resource\list\lct\akn_logical_template_6.xml" +"" -"z:\resource\list\lct\akn_logical_template_7.xml" +"" -"z:\resource\list\lct\akn_logical_template_8.xml" +"" -"z:\resource\list\lct\akn_logical_template_12.xml" +;suites +"" -"z:\private\101f4cd2\import\suites\foldersuite\suite.xml" +"" -"z:\private\101f4cd2\import\suites\foldersuite\items.xml" +"" -"z:\resource\apps\foldersuite.rsc" +"" -"z:\resource\apps\foldersuite.rsg" + + +;TEST CONTENT: +;removed diff -r 000000000000 -r f72a12da539e package_definition.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_definition.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<SystemDefinition schema="3.0.0"> + <package id="homescreen" name="Home Screen Apps" levels="fw apps"> + <collection id="idlehomescreen" name="Idle Home Screen" level="apps"> + <component id="nativeuicontroller" filter="s60" name="Native UI Controller"> + <unit bldFile="idlehomescreen/nativeuicontroller/group"/> + </component> + <component id="exths" filter="s60" name="Active Idle Container" class="plugin"> + <!-- why is the ID so different from the name? Is one wrong? --> + <unit bldFile="idlehomescreen/exths/group"/> + </component> + <component id="activeidle3" filter="s60" name="Active Idle 3"> + <unit bldFile="idlehomescreen/activeidle3/group"/> + <!-- do these need to be built? --> + <!-- <unit bldFile="idlehomescreen/activeidle3/data/group"/> --> + <!-- <unit bldFile="idlehomescreen/activeidle3/xmluirendering/uiengine/group"/> --> + </component> + <component id="hsplugins" filter="s60" name="Home Screen Plugins" class="plugin"> + <unit bldFile="idlehomescreen/hsplugins/group"/> + <!-- do these need to be built? --> + <!-- <unit bldFile="idlehomescreen/hsplugins/organizer/qhd_tch/organizer_2001f481/group"/> --> + <!-- <unit bldFile="idlehomescreen/hsplugins/organizer/vga/organizer_2001f48d/group"/> --> + <!-- <unit bldFile="idlehomescreen/hsplugins/organizer/vga/organizer_2001fdba/group"/> --> + </component> + </collection> + <collection id="menufw" name="Menu Framework" level="fw"> + <component id="hierarchynavigator" filter="s60" name="Hierarchy Navigator"> + <unit bldFile="menufw/hierarchynavigator/group"/> + </component> + <component id="menufwui" filter="s60" name="Menu Framework UI"> + <unit bldFile="menufw/menufwui/group"/> + </component> + <component id="menusuites" filter="s60" name="Menu Suites"> + <unit bldFile="menufw/menusuites/group"/> + </component> + <component id="menufw_build" filter="s60" name="Menu Framework Build"> + <!-- can the exports be exported by the other components? --> + <unit bldFile="menufw/group"/> + </component> + </collection> + <collection id="homescreen_info" name="Home Screen Apps Info" level="apps"> + <component id="homescreen_test" filter="s60" purpose="development" name="Home Screen Apps Test"> + <!-- should this be commented out or not? --> + <!-- <unit bldFile="tsrc/group"/> --> + </component> + <component id="homescreen_plat" filter="s60" name="Home Screen Apps Platform Interfaces" class="api"> + <unit bldFile="homescreen_plat/group"/> + </component> + </collection> + </package> +</SystemDefinition> diff -r 000000000000 -r f72a12da539e sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sysdef_1_4_0.dtd Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,86 @@ + <!ELEMENT SystemDefinition (systemModel?, build?)> + <!ATTLIST SystemDefinition + name CDATA #REQUIRED + schema CDATA #REQUIRED> + <!ELEMENT systemModel (layer+)> + <!ELEMENT layer (logicalset* | module*)*> + <!ATTLIST layer + name CDATA #REQUIRED + levels CDATA #IMPLIED + span CDATA #IMPLIED> + <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*> + <!ATTLIST logicalset name CDATA #REQUIRED> + <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*> + <!ATTLIST logicalsubset name CDATA #REQUIRED> + <!ELEMENT module (component* | unit* | package* | prebuilt*)*> + <!ATTLIST module + name CDATA #REQUIRED + level CDATA #IMPLIED> + <!ELEMENT component (unit* | package* | prebuilt*)*> + <!ATTLIST component name CDATA #REQUIRED> + <!ELEMENT unit EMPTY> + <!ATTLIST unit + unitID ID #REQUIRED + name CDATA #REQUIRED + mrp CDATA #REQUIRED + filter CDATA #IMPLIED + bldFile CDATA #REQUIRED + priority CDATA #IMPLIED + contract CDATA #IMPLIED> + <!ELEMENT package EMPTY> + <!ATTLIST package + name CDATA #REQUIRED + mrp CDATA #REQUIRED + filter CDATA #IMPLIED + contract CDATA #IMPLIED> + <!ELEMENT prebuilt EMPTY> + <!ATTLIST prebuilt + name CDATA #REQUIRED + version CDATA #REQUIRED + late (Y|N) #IMPLIED + filter CDATA #IMPLIED + contract CDATA #IMPLIED> + <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*> + <!ELEMENT unitList (unitRef+)> + <!ATTLIST unitList + name ID #REQUIRED + description CDATA #REQUIRED> + <!ELEMENT unitRef EMPTY> + <!ATTLIST unitRef unit IDREF #REQUIRED> + <!ELEMENT targetList EMPTY> + <!ATTLIST targetList + name ID #REQUIRED + description CDATA #REQUIRED + target IDREFS #REQUIRED> + <!ELEMENT target EMPTY> + <!ATTLIST target + name ID #REQUIRED + abldTarget CDATA #REQUIRED + description CDATA #REQUIRED> + <!ELEMENT option EMPTY> + <!ATTLIST option + name ID #REQUIRED + abldOption CDATA #REQUIRED + description CDATA #REQUIRED + enable (Y | N | y | n) #REQUIRED> + <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*> + <!ATTLIST configuration + name ID #REQUIRED + description CDATA #REQUIRED + filter CDATA #REQUIRED> + <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))> + <!ELEMENT unitListRef EMPTY> + <!ATTLIST unitListRef unitList IDREF #REQUIRED> + <!ELEMENT layerRef EMPTY> + <!ATTLIST layerRef layerName CDATA #REQUIRED> + <!ELEMENT buildLayer EMPTY> + <!ATTLIST buildLayer + command CDATA #REQUIRED + targetList IDREFS #IMPLIED + unitParallel (Y | N | y | n) #REQUIRED + targetParallel (Y | N | y | n) #IMPLIED> + <!ELEMENT specialInstructions EMPTY> + <!ATTLIST specialInstructions + name CDATA #REQUIRED + cwd CDATA #REQUIRED + command CDATA #REQUIRED> diff -r 000000000000 -r f72a12da539e systemDefinition.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemDefinition.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,33 @@ +<?xml version="1.0"?> +<!DOCTYPE SystemDefinition SYSTEM "systemDefinition.dtd"[ + + <!ENTITY layer_real_source_path "\sf\app\homescreen"> + <!ENTITY layer_name "homescreen"> + + <!ENTITY layer_file SYSTEM "systemDefinitionLayer.xml"> + <!ENTITY targetDefinition_file SYSTEM "/epoc32/tools/systemDefinition/targetDefinition.xml"> + <!ENTITY defaultbuild_file SYSTEM "/epoc32/tools/systemDefinition/default_build.xml"> + <!ENTITY defaultclean_file SYSTEM "/epoc32/tools/systemDefinition/default_clean.xml"> +]> + +<SystemDefinition name="SystemDefinition" schema="1.4.0"> + <systemModel> +&layer_file; + </systemModel> + <build> +&targetDefinition_file; + + <configuration name="build" description="build layer" filter=""> + <layerRef layerName="&layer_name;"/> + +&defaultbuild_file; + </configuration> + + <configuration name="clean" description="clean layer" filter=""> + <layerRef layerName="&layer_name;"/> + +&defaultclean_file; + </configuration> + + </build> +</SystemDefinition> diff -r 000000000000 -r f72a12da539e systemDefinitionLayer.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/systemDefinitionLayer.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,7 @@ +<layer name="homescreen"> + <module name="group_homescreen"> + <component name="group_homescreen"> + <unit unitID="homescreen" mrp="" bldFile="&layer_real_source_path;\group" name="homescreen" /> + </component> + </module> +</layer> diff -r 000000000000 -r f72a12da539e tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 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: Includes all the Domain API test modules +* +*/ + + +#include "../../uishellservices_dom/ai_utilities_api/tsrc/group/bld.inf" +#include "../../uishellservices_dom/menu_content_service_api/tsrc/group/bld.inf" +#include "../../uishellservices_dom/action_handler_plugin_api/tsrc/group/bld.inf" +#include "../../uishellservices_dom/content_harvester_plugin_api/tsrc/group/bld.inf" +#include "../../uishellservices_dom/menu_sat_interface_api/tsrc/group/bld.inf" + diff -r 000000000000 -r f72a12da539e widgetmanager/data/20026F53.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/data/20026F53.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,44 @@ +/* +* 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: widget manager plugin registry resource +* +*/ + +#include "registryinfov2.rh" + +// Declares info for two implementations +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = 0x20026F53; + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = 0x20026F51; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x20026F53; + version_no = 1; + display_name = "Widget Manager"; + default_data = "WmContentControlUI"; + opaque_data = "WmContentControlUI"; + } + }; + } + }; + } diff -r 000000000000 -r f72a12da539e widgetmanager/data/widgetmanagerview.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/data/widgetmanagerview.loc Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localisation file of Widget Manager +* +*/ + + + +// TITLES OF EACH VIEW + +// d: Title of Application +// d: +// d: +// l: title_pane_t2/opt12 +// w: +// r: TB9.2 +#define qtn_wm_title_text "Widget Catalog" + + + +// OPTIONS-MENU MENUITEMS + +// d: Add-menuitem in Options-menu +// d: +// d: +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_options_wm_add "Add To Homescreen" + +// d: Launch-menuitem in Options-menu +// d: +// d: +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_options_wm_launch_widget "Launch" + +// d: Search-menuitem in Options-menu +// d: +// d: +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_options_wm_search "Search" + +// d: Uninstall-menuitem in Options-menu +// d: +// d: +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_options_wm_uninstall "Uninstall" + +// d: Open-menuitem in Options-menu +// d: +// d: +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_options_wm_open "Open" + +// d: Sort alphabetically-menuitem in Options-menu +// d: +// d: +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_options_wm_sort_alpha "Sort alphabetically" + +// d: Details-menuitem in Options-menu +// d: +// d: +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_options_wm_show_details "Details" + + + +// MISC + +// d: Text displayed on OVI Store button +// d: +// d: +// l: wgtman_btn_pane_t1 +// w: +// r: TB9.2 +// +#define qtn_wm_ovi_store_title "Ovi Store" + +// d: Info popup to indicate that an item can not be added to home screen +// d: because current view is full +// d: +// l: popup_note_window +// w: +// r: TB9.2 +// +#define qtn_hs_add_widget_no_space_note "Not enough space to add new widget to active page. Remove some content first" + +// d: Info popup to indicate that an item can not be added to home screen +// d: because maximum instance count of current widget would be exceeded +// d: +// l: popup_note_window +// w: +// r: TB9.2 +// +#define qtn_hs_add_widget_max_count_note "Unable to add. Home screen does not allow more instances of this widget" + +// d: widget details dialog left softkey for adding widget to home screen +// d: Note: widgets dialog is not necessarily full screen width, which may affect +// d: string max length! +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +// +#define qtn_wm_details_add_to_hs "Add" + +// d: widget details dialog - no description +// d: +// d: +// l: listrow_wgtman_pane_t2 +// w: +// r: TB9.2 +// +#define qtn_wm_details_no_description "No description available" + +// d: widget uninstall not allowed +// d: +// d: +// l: popup_note_window +// w: +// r: TB9.2 +// +#define qtn_wm_uninst_not_allowed "%U can not be uninstalled " + diff -r 000000000000 -r f72a12da539e widgetmanager/data/widgetmanagerview.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/data/widgetmanagerview.rss Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,235 @@ +/* +* 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: +* +* +*/ + +// INCLUDES +#include <eikon.rh> +#include <avkon.rsg> +#include <avkon.rh> +#include <avkon.loc> +#include <appinfo.rh> +#include <avkon.mbg> + +#include "widgetmanager.hrh" +#include "widgetmanagerview.loc" + +// RESOURCE IDENTIFIER +NAME WIGZ // 4 letter ID + +RESOURCE RSS_SIGNATURE + { + } + +// ---------------------------------------------------- +// MAIN VIEW AND ITS PARTS +// ---------------------------------------------------- + +RESOURCE AVKON_VIEW r_wm_main_container_view + { + cba = R_AVKON_SOFTKEYS_OPTIONS_BACK__SELECT; + menubar = r_wm_main_container_options_menu; + toolbar = 0; + } + +RESOURCE TITLE_PANE r_wm_main_container_title_resource + { + txt = qtn_wm_title_text; + } + +// ---------------------------------------------------- +// MENU +// ---------------------------------------------------- + +RESOURCE MENU_BAR r_wm_main_container_options_menu + { + titles = + { + MENU_TITLE + { + menu_pane = r_wm_main_container_menu_pane; + } + }; + } + +RESOURCE MENU_PANE r_wm_main_container_menu_pane + { + items = + { + MENU_ITEM + { + command = EWmMainContainerViewOpenPortalMenuItemCommand; + txt = qtn_options_wm_open; + flags = EEikMenuItemAction; + }, + MENU_ITEM + { + command = EWmMainContainerViewAddMenuItemCommand; + txt = qtn_options_wm_add; + flags = EEikMenuItemAction; + }, + MENU_ITEM + { + command = EWmMainContainerViewWiddetDetailsMenuItemCommand; + txt = qtn_options_wm_show_details; + flags = EEikMenuItemSpecific; + }, + MENU_ITEM + { + command = EWmMainContainerViewLaunchMenuItemCommand; + txt = qtn_options_wm_launch_widget; + flags = EEikMenuItemSpecific; + }, + MENU_ITEM + { + command = EWmMainContainerViewSearchMenuItemCommand; + txt = qtn_options_wm_search; + }, + MENU_ITEM + { + command = EWmMainContainerViewSortAlphaMenuItemCommand; + txt = qtn_options_wm_sort_alpha; + }, + MENU_ITEM + { + command = EWmMainContainerViewUninstallMenuItemCommand; + txt = qtn_options_wm_uninstall; + flags = EEikMenuItemSpecific; + }, + MENU_ITEM + { + command = EWmMainContainerViewHelpMenuItemCommand; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = EWmMainContainerViewBackMenuItemCommand; + txt = qtn_options_exit; + } + }; + } + +// ---------------------------------------------------- +// OVI STORE BUTTON +// ---------------------------------------------------- + +RESOURCE AVKON_BUTTON r_wm_portal_button + { + flags = 0; + states = + { + AVKON_BUTTON_STATE + { + flags = 0; + txt = qtn_wm_ovi_store_title; + bmpfile = AVKON_BITMAP_FILE; + bmpid = EMbmAvkonQgn_graf_wml_wait_globe_04; + bmpmask = EMbmAvkonQgn_graf_wml_wait_globe_04_mask; + press_bmpid = EMbmAvkonQgn_graf_wml_wait_globe_04; + press_bmpmask = EMbmAvkonQgn_graf_wml_wait_globe_04_mask; + } + }; + } + +RESOURCE TBUF r_qtn_wm_go_to_ovi_store + { + buf = qtn_wm_ovi_store_title; + } + +// ---------------------------------------------------- +// MISCELLANEOUS INFO MESSAGES +// ---------------------------------------------------- + +RESOURCE TBUF r_qtn_hs_add_widget_no_space_note + { + buf = qtn_hs_add_widget_no_space_note; + } + +RESOURCE TBUF r_qtn_hs_add_widget_max_count_note + { + buf = qtn_hs_add_widget_max_count_note; + } + +RESOURCE TBUF r_qtn_wm_details_no_description + { + buf = qtn_wm_details_no_description; + } + +RESOURCE TBUF r_qtn_wm_uninst_not_allowed + { + buf = qtn_wm_uninst_not_allowed; + } + +// ---------------------------------------------------- +// Wm Details dialog +// ---------------------------------------------------- + +STRUCT WMDLGCONTROL + { + STRUCT control; + } + +RESOURCE DIALOG r_wm_details_add_dialog + { + flags = EEikDialogFlagNoDrag | + EEikDialogFlagCbaButtons | + EEikDialogFlagWait | + EEikDialogFlagNoTitleBar; + buttons = r_wm_details_add_close_cba; + } + +RESOURCE CBA r_wm_details_add_close_cba + { + buttons = + { + CBA_BUTTON // add + { + id = ECbaAddToHs; + txt = qtn_wm_details_add_to_hs; + }, + CBA_BUTTON // close + { + id = EAknSoftkeyClose; + txt = text_softkey_close; + } + }; + } + +RESOURCE DIALOG r_wm_details_only_dialog + { + flags = EEikDialogFlagNoDrag | + EEikDialogFlagCbaButtons | + EEikDialogFlagWait | + EEikDialogFlagNoTitleBar; + buttons = r_wm_details_empty_close_cba; + } + +RESOURCE CBA r_wm_details_empty_close_cba + { + buttons = + { + CBA_BUTTON // empty + { + id = 0; + txt = text_softkey_empty; + }, + CBA_BUTTON // close + { + id = EAknSoftkeyClose; + txt = text_softkey_close; + } + }; + } diff -r 000000000000 -r f72a12da539e widgetmanager/gfx/add_widget_button.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/gfx/add_widget_button.svg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948) --> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="50px" + height="36px" viewBox="0 0 50 36" enable-background="new 0 0 50 36" xml:space="preserve"> +<g id="Layer_2"> +</g> +<g id="Layer_1"> + <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="24.9995" y1="0" x2="24.9995" y2="36.0005"> + <stop offset="0" style="stop-color:#79CD19"/> + <stop offset="1" style="stop-color:#4A9826"/> + </linearGradient> + <path fill="url(#SVGID_1_)" d="M50,31c0,2.762-2.239,5-5,5H5c-2.762,0-5-2.238-5-5V5c0-2.761,2.238-5,5-5h40c2.761,0,5,2.239,5,5 + V31z"/> + <polygon fill="#E6E6E6" points="16.515,21.084 22.015,21.084 22.015,26.585 22.015,27.586 23.015,27.586 27.015,27.586 + 28.016,27.586 28.016,26.585 28.016,21.084 33.515,21.084 34.516,21.084 34.516,20.083 34.516,16.083 34.516,15.082 33.515,15.082 + 28.016,15.082 28.016,9.583 28.016,8.582 27.015,8.582 23.015,8.582 22.015,8.582 22.015,9.583 22.015,15.082 16.515,15.082 + 15.515,15.082 15.515,16.083 15.515,20.082 15.515,21.084 "/> + <path opacity="0.5" fill="#FFFFFF" d="M2.033,33.656C1.398,32.947,1.001,32.023,1.001,31V5c0-2.205,1.795-4,4-4h40 + c1.15,0,2.182,0.496,2.912,1.276l0.708-0.708C47.711,0.606,46.43,0,45.001,0h-40c-2.762,0-5,2.238-5,5v26 + c0,1.301,0.509,2.475,1.323,3.365L2.033,33.656z"/> + <path opacity="0.2" d="M50.001,31V5c0-1.333-0.529-2.536-1.379-3.433l-0.709,0.708c0.67,0.716,1.088,1.669,1.088,2.724v26 + c0,2.205-1.795,4-4,4h-40c-1.182,0-2.235-0.525-2.968-1.344l-0.709,0.709C2.238,35.363,3.541,36,5.001,36h40 + C47.763,36,50.001,33.762,50.001,31z"/> + <polygon opacity="0.3" points="22.034,27.578 22.056,27.578 23.058,26.576 23.034,26.576 23.034,20.093 22.034,21.094 + 22.034,26.577 "/> + <polygon fill="#FFFFFF" points="15.507,21.08 15.507,21.084 16.507,21.084 22.005,21.085 22.005,21.103 23.007,20.102 + 23.007,20.085 16.507,20.084 16.507,20.08 "/> + <polygon opacity="0.3" points="16.495,20.08 16.495,16.086 22.995,16.086 22.995,9.586 26.994,9.586 26.994,9.613 27.995,8.612 + 27.995,8.584 26.993,8.584 22.995,8.584 21.993,8.584 21.993,9.585 21.993,15.084 16.495,15.084 15.495,15.084 15.495,16.085 + 15.495,20.084 15.495,21.08 "/> + <polygon fill="#FFFFFF" points="28.016,8.596 27.015,9.597 27.015,16.069 27.028,16.069 28.029,15.068 28.016,15.068 28.016,9.568 + "/> + <polygon fill="#FFFFFF" points="23.034,27.584 27.033,27.584 28.035,27.584 28.035,26.583 28.035,21.082 33.533,21.082 + 34.535,21.082 34.535,20.081 34.535,16.082 34.535,15.088 33.534,16.088 33.534,20.082 27.034,20.082 27.034,26.582 23.058,26.582 + 22.056,27.584 "/> + <polygon opacity="0.3" points="33.524,16.091 34.525,15.09 34.525,15.084 33.523,15.084 28.039,15.084 27.038,16.085 + 33.524,16.085 "/> +</g> +</svg> diff -r 000000000000 -r f72a12da539e widgetmanager/gfx/qgn_menu_hswidget.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/gfx/qgn_menu_hswidget.svg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd"> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="88" height="88" viewBox="0 0 88 88"> +<rect fill="none" height="88" width="88"/> +<linearGradient id="SVGID_1" gradientUnits="userSpaceOnUse" x1="22.43" y1="2.92" x2="66.99" y2="90.66"> +<stop stop-color="#A2C2DD" offset="0.1"/> +<stop stop-color="#6C83BB" offset="0.71"/> +<stop stop-color="#003D6D" offset="0.99"/> +</linearGradient> +<path d="M63.987,81.355c-0.18,0-0.364-0.024-0.543-0.076l-19.092-5.262c-1.259-0.341-2.284-1.793-2.328-3.306 l-0.002-0.068l-3.806,1.339c-0.217,0.066-0.435,0.104-0.656,0.104c-0.18,0-0.362-0.024-0.541-0.072l-19.458-5.141 c-1.282-0.332-2.325-1.772-2.374-3.276L14.623,47.38c-0.034-1.117,0.516-2.05,1.403-2.376L24.09,42l0.016-0.006l0.078-0.027 c0.071-0.023,0.145-0.042,0.221-0.056l0.186-0.027l0.186-0.008c0.056,0,0.11,0.002,0.167,0.008l0.083,0.006l0.023,0.002l0.075,0.012 l0.026,0.004l0.133,0.026l18.117,4.305l7.348-2.809l0.018-0.01l0.08-0.027c0.071-0.021,0.144-0.041,0.22-0.058l0.178-0.027 l0.021-0.002l0.054-0.002l0.114-0.004c0.053,0,0.107,0.002,0.163,0.006l0.095,0.01l0.132,0.019l0.025,0.006l0.088,0.019 l19.093,4.656l0.174,0.049c0.016,0.002,0.064,0.021,0.114,0.041c0.007,0.003,0.051,0.019,0.091,0.037l0.012,0.007l0.069,0.031 l0.01,0.004l0.066,0.033l0.011,0.008l0.109,0.06l0.013,0.009l0.105,0.065l0.143,0.102c0.029,0.021,0.077,0.06,0.121,0.097 c0.016,0.011,0.059,0.05,0.103,0.089l0.067,0.064l0.008,0.008l0.063,0.064c0.035,0.032,0.069,0.069,0.102,0.106 c0.043,0.048,0.087,0.102,0.134,0.157c0.067,0.087,0.128,0.174,0.188,0.264c0.149,0.228,0.276,0.473,0.378,0.733 c0.036,0.093,0.068,0.186,0.098,0.28c0.022,0.064,0.043,0.141,0.062,0.223l0.037,0.157l0.028,0.161l0.023,0.165l0.001,0.019 l0.018,0.188v0.004l0.004,0.109l0.721,24.573v0.01v0.081v0.104l-0.009,0.167l-0.008,0.097l-0.003,0.026l-0.023,0.17l-0.001,0.01 l-0.015,0.072l-0.023,0.104c-0.002,0.021-0.016,0.074-0.032,0.128c-0.003,0.019-0.019,0.068-0.037,0.122l-0.041,0.113l-0.052,0.126 l-0.075,0.15c-0.038,0.072-0.069,0.124-0.101,0.173c-0.049,0.072-0.096,0.135-0.144,0.194c-0.229,0.274-0.504,0.471-0.82,0.586 l-8.078,2.896C64.424,81.318,64.207,81.355,63.987,81.355L63.987,81.355z M58.611,43.634c-0.601,0-1.218-0.075-1.832-0.217 c-5.321-1.234-9.814-7.423-10.013-13.797c-0.141-4.509,1.896-8.199,5.223-9.546l-0.002-0.002l2.504-1.065l3.104-1.345l0.01,0.022 l2.047-0.873c0.127-0.054,0.246-0.097,0.369-0.141c0.265-0.095,0.553-0.175,0.854-0.241c0.219-0.047,0.438-0.083,0.665-0.114 c0.206-0.022,0.403-0.039,0.604-0.047c0.098-0.004,0.201-0.006,0.308-0.006l0.239,0.004c0.174,0.002,0.352,0.012,0.53,0.033 c0.157,0.014,0.32,0.035,0.485,0.064l0.334,0.054l0.012,0.004l0.07,0.017l0.102,0.022c0.118,0.025,0.264,0.06,0.414,0.097 c0.188,0.056,0.323,0.097,0.461,0.14c0.15,0.048,0.3,0.104,0.454,0.163c0.139,0.054,0.286,0.114,0.434,0.18 c0.141,0.062,0.288,0.128,0.435,0.204c0.136,0.066,0.283,0.145,0.431,0.229c0.137,0.075,0.282,0.161,0.424,0.248 c0.156,0.097,0.306,0.194,0.452,0.297c0.155,0.107,0.314,0.219,0.466,0.338c0.149,0.111,0.311,0.242,0.467,0.372 c0.171,0.145,0.339,0.295,0.504,0.45c0.189,0.173,0.369,0.357,0.551,0.545c0.219,0.227,0.429,0.462,0.634,0.706 c0.295,0.357,0.571,0.72,0.822,1.083c0.672,0.966,1.243,2.026,1.701,3.151c0.167,0.409,0.317,0.821,0.446,1.228 c0.097,0.301,0.186,0.606,0.264,0.918c0.068,0.258,0.13,0.52,0.184,0.784c0.05,0.239,0.093,0.47,0.13,0.708 c0.034,0.212,0.065,0.429,0.089,0.642c0.026,0.198,0.048,0.407,0.064,0.617c0.015,0.196,0.026,0.392,0.036,0.588l0.003,0.093 l0.004,0.099c0.004,0.122,0.005,0.25,0.005,0.377c0.003,0.182-0.001,0.363-0.005,0.542c-0.008,0.188-0.017,0.365-0.028,0.539 c-0.013,0.171-0.027,0.349-0.047,0.52c-0.018,0.167-0.039,0.339-0.063,0.506c-0.026,0.173-0.055,0.34-0.086,0.505 c-0.031,0.167-0.066,0.336-0.105,0.503c-0.041,0.18-0.085,0.349-0.134,0.516c-0.047,0.169-0.098,0.336-0.153,0.501 c-0.063,0.186-0.127,0.365-0.195,0.539c-0.074,0.188-0.151,0.372-0.233,0.549c-0.094,0.202-0.19,0.394-0.293,0.58 c-0.12,0.221-0.246,0.429-0.382,0.633c-0.169,0.262-0.359,0.52-0.56,0.757c-0.825,0.995-1.824,1.725-2.967,2.169l-7.654,3.1 C60.378,43.473,59.507,43.634,58.611,43.634L58.611,43.634z M34.343,41.839l-0.335-0.295l-6.913-6.135l-6.556,2.821l-1.133,0.487 l0.135-1.226l1.031-9.319l-5.811-8.063l-0.534-0.743l0.843-0.343l8.076-3.258l0.141-0.06l0.153,0.006l0.738,0.025l1.7-4.282 l0.11-0.281l0.276-0.122l8.075-3.37l0.681-0.285l0.265,0.689l3.722,9.641l7.714,3.151l0.97,0.396l-0.719,0.762l-5.304,5.608 l1.602,10.104l0.091,0.569l-0.539,0.21l-8.031,3.135c-0.025,0.01-0.052,0.022-0.08,0.031L34.343,41.839L34.343,41.839z" fill="url(#SVGID_1)"/> +<linearGradient id="SVGID_2" gradientUnits="userSpaceOnUse" x1="30.21" y1="45.14" x2="40.63" y2="66.61"> +<stop stop-color="#43910A" offset="0"/> +<stop stop-color="#17594C" offset="1"/> +</linearGradient> +<path d="M46.985,68.733l-0.567-18.834c-0.001-0.011-0.001-0.023-0.001-0.035 c-0.002-0.037-0.005-0.072-0.008-0.109c-0.002-0.037-0.007-0.076-0.011-0.114c-0.005-0.039-0.011-0.08-0.017-0.119 c-0.008-0.043-0.016-0.087-0.024-0.132c-0.01-0.048-0.022-0.098-0.035-0.145c-0.013-0.06-0.03-0.116-0.048-0.174 c-0.025-0.078-0.053-0.154-0.083-0.229c-0.086-0.213-0.191-0.415-0.315-0.599c-0.049-0.072-0.1-0.141-0.151-0.204 c-0.039-0.048-0.077-0.093-0.117-0.137c-0.033-0.035-0.066-0.07-0.102-0.104c-0.031-0.029-0.063-0.059-0.093-0.085 c-0.029-0.024-0.059-0.052-0.087-0.074c-0.027-0.022-0.056-0.044-0.085-0.064c-0.025-0.021-0.054-0.039-0.08-0.058 c-0.026-0.017-0.052-0.033-0.08-0.05c-0.025-0.017-0.053-0.03-0.078-0.043c-0.026-0.017-0.053-0.029-0.078-0.041 c-0.026-0.013-0.052-0.025-0.08-0.037c-0.026-0.011-0.052-0.021-0.079-0.031c-0.026-0.011-0.054-0.019-0.081-0.026 c-0.028-0.009-0.055-0.017-0.083-0.025c-0.008-0.002-0.016-0.004-0.024-0.006l-19.464-4.625c-0.021-0.004-0.042-0.008-0.063-0.012 c-0.029-0.006-0.059-0.011-0.087-0.015c-0.031-0.004-0.063-0.006-0.093-0.01c-0.033,0-0.065-0.002-0.098-0.002 c-0.035,0-0.07,0.002-0.103,0.004c-0.041,0.004-0.08,0.008-0.119,0.017c-0.051,0.008-0.101,0.021-0.15,0.037 c-0.021,0.006-0.042,0.012-0.063,0.021l-8.076,2.997c0.021-0.007,21.914,27.567,21.714,27.637l8.076-2.843 c0.2-0.072,0.375-0.196,0.52-0.365c0.035-0.042,0.068-0.085,0.1-0.133c0.024-0.035,0.047-0.072,0.067-0.109 c0.019-0.035,0.036-0.065,0.053-0.103c0.016-0.031,0.029-0.064,0.043-0.098c0.012-0.03,0.024-0.063,0.034-0.097 c0.011-0.031,0.021-0.06,0.029-0.091c0.008-0.029,0.017-0.062,0.023-0.093c0.008-0.029,0.014-0.06,0.02-0.091 c0.007-0.031,0.011-0.062,0.016-0.093c0.006-0.031,0.009-0.063,0.012-0.093c0.004-0.031,0.007-0.064,0.009-0.098 c0.001-0.03,0.004-0.062,0.006-0.097c0-0.033,0.001-0.065,0.001-0.101C46.986,68.78,46.985,68.758,46.985,68.733z" fill="url(#SVGID_2)"/> +<linearGradient id="SVGID_3" gradientUnits="userSpaceOnUse" x1="12.64" y1="42.63" x2="43.4" y2="77.87"> +<stop stop-color="#DCE8E4" offset="0"/> +<stop stop-color="#43910A" offset="1"/> +</linearGradient> +<path d="M36.509,50.295c0.978,0.239,1.801,1.416,1.838,2.625l0.566,18.676 c0.037,1.215-0.726,1.989-1.704,1.725L17.746,68.18c-0.979-0.253-1.801-1.421-1.839-2.605L15.34,47.356 c-0.037-1.18,0.725-1.952,1.704-1.723L36.509,50.295z" fill="url(#SVGID_3)"/> +<linearGradient id="SVGID_4" gradientUnits="userSpaceOnUse" x1="56.73" y1="46.62" x2="69.4" y2="74.83"> +<stop stop-color="#BBE0FF" offset="0"/> +<stop stop-color="#A2C2DD" offset="0.35"/> +<stop stop-color="#6C83BB" offset="0.7"/> +<stop stop-color="#003D6D" offset="1"/> +</linearGradient> +<path d="M73.378,75.945L72.66,51.374c-0.001-0.012-0.002-0.024-0.002-0.034 c-0.003-0.037-0.005-0.075-0.007-0.112c-0.004-0.037-0.006-0.076-0.012-0.115c-0.005-0.039-0.01-0.08-0.016-0.119 c-0.008-0.044-0.016-0.089-0.024-0.133c-0.01-0.049-0.021-0.099-0.032-0.146c-0.015-0.06-0.031-0.117-0.049-0.175 c-0.023-0.076-0.052-0.155-0.081-0.231c-0.083-0.215-0.188-0.415-0.31-0.601c-0.048-0.072-0.098-0.143-0.149-0.208 c-0.037-0.048-0.074-0.091-0.113-0.135c-0.033-0.037-0.065-0.072-0.101-0.107c-0.029-0.028-0.061-0.058-0.09-0.086 c-0.028-0.025-0.057-0.05-0.086-0.072c-0.026-0.022-0.054-0.046-0.081-0.064c-0.027-0.021-0.053-0.041-0.081-0.06 c-0.025-0.017-0.052-0.033-0.077-0.05c-0.026-0.015-0.052-0.03-0.077-0.045c-0.026-0.015-0.051-0.027-0.078-0.042 c-0.024-0.01-0.05-0.024-0.076-0.034c-0.025-0.013-0.052-0.023-0.078-0.033c-0.025-0.011-0.052-0.019-0.078-0.027 c-0.027-0.008-0.055-0.017-0.082-0.024c-0.007,0-0.016-0.004-0.023-0.004l-19.092-4.654c-0.021-0.006-0.042-0.01-0.063-0.014 c-0.028-0.006-0.058-0.01-0.085-0.015c-0.03-0.004-0.062-0.006-0.091-0.008c-0.032-0.002-0.064-0.004-0.097-0.004 c-0.033,0-0.067,0.002-0.102,0.004c-0.038,0.004-0.078,0.01-0.115,0.017c-0.05,0.01-0.099,0.023-0.146,0.037 c-0.022,0.006-0.042,0.015-0.062,0.023l-8.076,3.089c0.02-0.01,21.658,33.316,21.463,33.387l8.075-2.894 c0.196-0.072,0.368-0.196,0.51-0.365c0.034-0.041,0.067-0.087,0.098-0.132c0.023-0.037,0.046-0.074,0.066-0.111 c0.019-0.035,0.035-0.068,0.052-0.104c0.015-0.033,0.027-0.063,0.041-0.099c0.013-0.031,0.023-0.063,0.035-0.095 c0.01-0.031,0.019-0.063,0.027-0.094c0.008-0.03,0.016-0.062,0.024-0.093c0.006-0.03,0.013-0.062,0.019-0.093 c0.005-0.028,0.01-0.06,0.015-0.093c0.005-0.03,0.008-0.062,0.012-0.095c0.005-0.031,0.007-0.062,0.009-0.095 s0.004-0.064,0.004-0.097c0.002-0.035,0.002-0.068,0.002-0.104C73.38,75.99,73.38,75.968,73.378,75.945z" fill="url(#SVGID_4)"/> +<linearGradient id="SVGID_5" gradientUnits="userSpaceOnUse" x1="40.88" y1="44.88" x2="68.29" y2="84.97"> +<stop stop-color="#FFFFFF" offset="0.15"/> +<stop stop-color="#A2C2DD" offset="1"/> +</linearGradient> +<path d="M62.786,51.841c0.959,0.241,1.766,1.426,1.802,2.646l0.721,24.368 c0.036,1.227-0.712,2.002-1.672,1.733l-19.093-5.26c-0.959-0.262-1.766-1.442-1.802-2.639l-0.72-23.798 c-0.036-1.19,0.711-1.973,1.671-1.739L62.786,51.841z" fill="url(#SVGID_5)"/> +<linearGradient id="SVGID_6" gradientUnits="userSpaceOnUse" x1="15.34" y1="18.21" x2="25.43" y2="18.21"> +<stop stop-color="#E6EEF4" offset="0"/> +<stop stop-color="#2F8E9A" offset="0.44"/> +<stop stop-color="#003D6D" offset="0.94"/> +</linearGradient> +<polygon fill="url(#SVGID_6)" points="25.43,16.5 23.414,16.43 15.339,19.69 23.255,19.994 24.069,19.664 "/> +<linearGradient id="SVGID_7" gradientUnits="userSpaceOnUse" x1="29.92" y1="9.81" x2="35.32" y2="20.62"> +<stop stop-color="#E6EEF4" offset="0"/> +<stop stop-color="#2F8E9A" offset="0.44"/> +<stop stop-color="#003D6D" offset="0.94"/> +</linearGradient> +<path d="M38.449,18.279l-3.833-9.932l-8.075,3.368l3.833,9.862C33.074,20.479,35.749,19.387,38.449,18.279z" fill="url(#SVGID_7)"/> +<linearGradient id="SVGID_8" gradientUnits="userSpaceOnUse" x1="42.72" y1="24.82" x2="34.38" y2="18.51"> +<stop stop-color="#E6EEF4" offset="0"/> +<stop stop-color="#2F8E9A" offset="0.44"/> +<stop stop-color="#003D6D" offset="0.94"/> +</linearGradient> +<path d="M46.449,21.543l-8-3.264l-8.075,3.297l8,3.269C38.396,24.823,44.091,22.563,46.449,21.543z" fill="url(#SVGID_8)"/> +<linearGradient id="SVGID_9" gradientUnits="userSpaceOnUse" x1="42.18" y1="23.58" x2="28.57" y2="37.19"> +<stop stop-color="#E6EEF4" offset="0"/> +<stop stop-color="#2F8E9A" offset="0.44"/> +<stop stop-color="#003D6D" offset="0.94"/> +</linearGradient> +<polygon fill="url(#SVGID_9)" points="40.904,27.41 46.449,21.543 38.375,24.845 32.829,30.642 "/> +<linearGradient id="SVGID_10" gradientUnits="userSpaceOnUse" x1="39.13" y1="39.57" x2="35.59" y2="26.33"> +<stop stop-color="#E6EEF4" offset="0"/> +<stop stop-color="#2F8E9A" offset="0.44"/> +<stop stop-color="#003D6D" offset="0.94"/> +</linearGradient> +<path d="M32.829,30.642l1.658,10.369l8.075-3.149L40.904,27.41C40.904,27.41,32.862,30.627,32.829,30.642z" fill="url(#SVGID_10)"/> +<linearGradient id="SVGID_11" gradientUnits="userSpaceOnUse" x1="18.97" y1="15.63" x2="37.23" y2="43.12"> +<stop stop-color="#D6E6EC" offset="0"/> +<stop stop-color="#298595" offset="1"/> +</linearGradient> +<polygon fill="url(#SVGID_11)" points="26.546,11.715 30.379,21.577 38.379,24.845 32.833,30.642 34.491,41.011 27.23,34.569 20.255,37.571 21.316,27.978 15.343,19.69 23.259,19.994 "/> +<linearGradient id="SVGID_12" gradientUnits="userSpaceOnUse" x1="52.27" y1="29.75" x2="73.38" y2="29.75"> +<stop stop-color="#E6EEF4" offset="0"/> +<stop stop-color="#9646AC" offset="0.44"/> +<stop stop-color="#3D013F" offset="0.94"/> +</linearGradient> +<path d="M73.374,30.359c-0.002-0.06-0.004-0.122-0.007-0.182c-0.008-0.188-0.021-0.375-0.034-0.562 c-0.017-0.198-0.036-0.394-0.061-0.59c-0.024-0.205-0.054-0.409-0.085-0.613c-0.036-0.225-0.079-0.45-0.124-0.672 c-0.053-0.254-0.11-0.504-0.176-0.751c-0.075-0.297-0.16-0.592-0.254-0.883c-0.127-0.396-0.269-0.789-0.426-1.172l0,0 c-0.438-1.077-0.986-2.092-1.627-3.015c-0.249-0.357-0.511-0.702-0.783-1.028c-0.194-0.231-0.395-0.456-0.6-0.671 c-0.17-0.177-0.344-0.351-0.523-0.518c-0.156-0.145-0.317-0.289-0.478-0.425c-0.146-0.122-0.296-0.241-0.444-0.353 c-0.141-0.109-0.287-0.214-0.433-0.313c-0.137-0.095-0.275-0.188-0.42-0.274c-0.132-0.083-0.269-0.165-0.404-0.239 c-0.133-0.077-0.269-0.146-0.404-0.215c-0.134-0.068-0.267-0.13-0.402-0.188c-0.134-0.06-0.269-0.116-0.402-0.167 c-0.137-0.054-0.272-0.101-0.408-0.146c-0.139-0.043-0.275-0.084-0.415-0.126c-0.143-0.037-0.283-0.07-0.426-0.101 c-0.04-0.01-0.081-0.016-0.122-0.029c-0.105-0.019-0.215-0.035-0.32-0.054c-0.149-0.022-0.299-0.043-0.449-0.058 c-0.16-0.017-0.317-0.027-0.477-0.029c-0.167-0.006-0.334-0.006-0.501,0.002c-0.18,0.006-0.361,0.021-0.534,0.042 c-0.208,0.027-0.409,0.062-0.606,0.101c-0.261,0.058-0.521,0.13-0.769,0.219l-0.006,0.002c-0.108,0.037-0.216,0.078-0.322,0.122 l-7.664,3.263c0.107-0.045,0.217-0.087,0.326-0.122l5.287-2.292l-5.287,2.292c0.253-0.084,0.508-0.157,0.77-0.214 c0.201-0.042,0.401-0.074,0.605-0.099c0.178-0.019,7.981,21.822,6.952,22.212l7.663-3.104c1.03-0.398,1.936-1.067,2.678-1.958 c0.181-0.217,0.352-0.45,0.513-0.696c0.123-0.186,0.239-0.379,0.349-0.582c0.096-0.171,0.185-0.351,0.271-0.533 c0.076-0.167,0.149-0.338,0.218-0.512c0.065-0.163,0.125-0.33,0.183-0.501c0.052-0.155,0.099-0.312,0.145-0.472 c0.044-0.159,0.086-0.32,0.124-0.481c0.036-0.155,0.069-0.314,0.1-0.475c0.03-0.157,0.056-0.316,0.08-0.479 c0.024-0.157,0.044-0.32,0.062-0.48c0.018-0.163,0.032-0.326,0.043-0.493c0.013-0.165,0.021-0.334,0.025-0.501 c0.006-0.173,0.008-0.349,0.008-0.526C73.379,30.601,73.378,30.481,73.374,30.359z" fill="url(#SVGID_12)"/> +<linearGradient id="SVGID_13" gradientUnits="userSpaceOnUse" x1="47.62" y1="18.01" x2="65.31" y2="44.62"> +<stop stop-color="#DEDEED" offset="0"/> +<stop stop-color="#9646AC" offset="1"/> +</linearGradient> +<path d="M56.257,20.407c5.032,1.021,9.268,6.917,9.457,13.153c0.188,6.243-3.738,10.339-8.771,9.16 c-5.035-1.168-9.27-7.037-9.46-13.122C47.294,23.521,51.222,19.399,56.257,20.407z" fill="url(#SVGID_13)"/> +</svg> \ No newline at end of file diff -r 000000000000 -r f72a12da539e widgetmanager/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +/* +* 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: +* Widget manager build information +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/widgetmanager.iby CORE_APP_LAYER_IBY_EXPORT_PATH(widgetmanager.iby) +../rom/widgetmanager_resources.iby CORE_APP_LAYER_IBY_EXPORT_PATH(widgetmanager_resources.iby) + +../sis/widgetmanager_stub.sis /epoc32/data/z/system/install/widgetmanager_stub.sis + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv +OPTION TARGETFILE widgetmanager.mif +OPTION HEADERFILE widgetmanager.mbg +OPTION SOURCEDIR ../gfx +OPTION SOURCEFILE wmicons.txt +END + +PRJ_MMPFILES + +widgetmanager.mmp + diff -r 000000000000 -r f72a12da539e widgetmanager/group/widgetmanager.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/group/widgetmanager.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,115 @@ +/* +* 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: +* Widget manager project definition file +* +*/ + +#include <data_caging_paths.hrh> +#include <platform_paths.hrh> + +TARGET widgetmanager.dll +TARGETTYPE PLUGIN + +// ECom Dll recognition UID followed by the unique UID for this dll +UID 0x10009D8D 0x20026F53 + +VENDORID VID_DEFAULT +SECUREID 0x20026F53 + +// SIS installation + IAD support +VERSION 1.1 +paged + +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../src +SOURCE wmpluginproxy.cpp +SOURCE wmplugin.cpp +SOURCE wmresourceloader.cpp +SOURCE wmmaincontainer.cpp +SOURCE wmmaincontainerview.cpp +SOURCE wmwidgetdata.cpp +SOURCE wmlistbox.cpp +SOURCE wmimageconverter.cpp +SOURCE wmpersistentwidgetorder.cpp +SOURCE wmeffectmanager.cpp +SOURCE wmiconfileprovider.cpp +SOURCE wmdetailsdlg.cpp +SOURCE wmwidgetloaderao.cpp + +SOURCEPATH ../data +START RESOURCE 20026F53.rss +TARGETPATH ECOM_RESOURCE_DIR +TARGET widgetmanager.rsc +END //RESOURCE + +SOURCEPATH ../data +START RESOURCE widgetmanagerview.rss +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END //RESOURCE + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../data + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + + +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY avkon.lib +LIBRARY eikcore.lib +LIBRARY estor.lib +LIBRARY eikcoctl.lib +LIBRARY eikctl.lib +LIBRARY eikdlg.lib + +LIBRARY efsrv.lib // RFs +LIBRARY bafl.lib // BaflUtils +LIBRARY apgrfx.lib // RApaLsSession +LIBRARY commonengine.lib // StringLoader + +LIBRARY aknicon.lib // AknIconUtility +LIBRARY imageconversion.lib // CImageDecoder +LIBRARY bitmaptransforms.lib // CBitmapScaler +LIBRARY fbscli.lib // CFbsBitmap +LIBRARY bitgdi.lib // CFbsBitmapDevice +LIBRARY gdi.lib // CFont +LIBRARY egul.lib // TextUtils +LIBRARY ecom.lib // ECom fw +LIBRARY aknskins.lib // AknsDrawUtils +LIBRARY aknskinsrv.lib // AknsDrawUtils +LIBRARY aknswallpaperutils.lib // AknsDrawUtils +LIBRARY hscontentcontrol.lib // CHsContentControlUi +LIBRARY apparc.lib // CApaCommandLine +LIBRARY aknlayout.lib // avkon layout +LIBRARY aknlayout2scalable.lib // scalable avkon layout +LIBRARY swinstcli.lib // widget uninstall +LIBRARY hscontentinfo.lib // CHsContentInfo +LIBRARY platformenv.lib // DriveInfo::GetDefaultDrive +LIBRARY svgengine.lib // CSvgEngineInterfaceImpl +LIBRARY gfxtrans.lib // effect manager +LIBRARY ws32.lib //WindowSession +LIBRARY widgetregistryclient.lib // WidgetRegistryClient +LIBRARY hlplch.lib // HlpLauncher +LIBRARY sysutil.lib // diskspace +LIBRARY featmgr.lib // FeatureManager +LIBRARY etext.lib + + +// End of file diff -r 000000000000 -r f72a12da539e widgetmanager/group/wmicons.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/group/wmicons.txt Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,3 @@ +-c32,8 qgn_menu_hswidget +-c32,8 add_widget_button + diff -r 000000000000 -r f72a12da539e widgetmanager/inc/widgetmanager.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/widgetmanager.hrh Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,44 @@ +/* +* 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: +* Declares resource ids for widgetmanager application. +* +*/ + + +/** WidgetManger viev uid */ +enum TWidgetManagerViewUids + { + EWmMainContainerViewId = 0x20026F53 + }; + +/** MainContainer View Commands */ +enum TWmMainContainerViewCommands + { + EWmMainContainerViewAddMenuItemCommand = 0x6000, + EWmMainContainerViewLaunchMenuItemCommand, + EWmMainContainerViewSearchMenuItemCommand, + EWmMainContainerViewSortAlphaMenuItemCommand, + EWmMainContainerViewUninstallMenuItemCommand, + EWmMainContainerViewHelpMenuItemCommand, + EWmMainContainerViewOpenPortalMenuItemCommand, + EWmMainContainerViewBackMenuItemCommand, + EWmMainContainerViewWiddetDetailsMenuItemCommand + }; + +enum TWmMenuCmdIDs + { + ECbaAddToHs = 1 + }; + \ No newline at end of file diff -r 000000000000 -r f72a12da539e widgetmanager/inc/widgetmanager.pan --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/widgetmanager.pan Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Declares panic codes for widgetmanager app. +* +*/ + +#ifndef WIDGETMANAGER_PAN_H +#define WIDGETMANAGER_PAN_H + +/** WidgetManager application panic codes */ +enum TWidgetManagerPanics + { + EWidgetManagerUi = 1 + // add further panics here + }; + +inline void Panic(TWidgetManagerPanics aReason) + { + _LIT(applicationName,"WidgetManager"); + User::Panic(applicationName, aReason); + } + +#endif // WIDGETMANAGER_PAN_H diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmcommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmcommon.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,45 @@ +/* +* 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 WMCOMMON_H +#define WMCOMMON_H + +//includes +#include <e32base.h> + +// widgetmanager UID +const TUid KUidWidgetManager = { 0x200255FF }; + +// HsContentInfo types +_LIT8( KContentWidget, "widget" ); +_LIT8( KContentTemplate, "template" ); + +// UI related const +const TInt KWidgetHeight = 90; + +// UI component ID's +enum TWmUiControlIds + { + EOviPortal = 0x1, + ELastPortal, + EWidgetsList, + EFindBox, + EMaximumWidgets = 0xC8 + }; + +#endif //WMCOMMON_H diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmdetailsdlg.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmdetailsdlg.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,147 @@ +/* +* 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: +* Declares widget details dialog for WidgetManager +* +*/ + +#ifndef ___WMDETAILSDLG_H__ +#define ___WMDETAILSDLG_H__ + +// INCLUDES +#include <e32base.h> +#include <AknDialog.h> + +// FORWARD DECLARATIONS +class CEikRichTextEditor; +class CAknsBasicBackgroundControlContext; + +// CLASS DECLARATIONS +/** + * CWmDetailsDlg + */ +NONSHARABLE_CLASS( CWmDetailsDlg ): public CAknDialog + { +public: + + /** + * Two-phased constructor. + */ + static CWmDetailsDlg* NewL( + const TDesC& aName, + const TDesC& aDescription, + TBool aCanBeAdded, + const CFbsBitmap* aLogoBmp, + const CFbsBitmap* aLogoMask, + CAknsBasicBackgroundControlContext* aBgContext ); + + /** Destructor. */ + ~CWmDetailsDlg(); + +public: // New functions + /** From CAknDialog Initializes the dialog and calls + CAknDialog's ExecuteLD() */ + TInt ExecuteLD(); + +private: // Functions from base classes + + + /** From CEikDialog Initializes dialog before layout*/ + void PreLayoutDynInitL(); + + /** From CEikDialog Handles button events and looks + if the dialog can be closed */ + TBool OkToExitL(TInt aButtonId); + + /** From CCoeControl Handles key events */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType ); + + /** From CEikDialog Called by framework when dialog is activated */ + void ActivateL(); + + /** From CAknDialog called to provide access to the contorols */ + TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); + + /** From CAknDialog */ + void SetSizeAndPosition( const TSize& aSize ); + + /** From CCoeControl */ + void SizeChanged(); + + /** From CCoeControl */ + TInt CountComponentControls() const; + CCoeControl* ComponentControl(TInt aIndex) const; + void Draw( const TRect& aRect ) const; + + /** Desired rect for dialog */ + TRect WmDetailsDialogRect(); + + /** Insert and format content */ + void InsertAndFormatContentL(); + +private: + + /** Constructor for performing 1st stage construction */ + CWmDetailsDlg( TBool aCanBeAdded ); + + /** 2nd phase constructor */ + void ConstructL( + const TDesC& aName, + const TDesC& aDescription, + const CFbsBitmap* aLogoBmp, + const CFbsBitmap* aLogoMask, + CAknsBasicBackgroundControlContext* aBgContext ); + +private: + + /** + * Background context (not owned) + */ + CAknsBasicBackgroundControlContext* iBgContext; + + /** + * Richtext editor + */ + CEikRichTextEditor* iRtEditor; + + /** + * Name of widget + */ + HBufC* iName; + + /** + * Description of widget + */ + HBufC* iDescription; + + /** + * Logo image + */ + CFbsBitmap* iLogoBmp; + + /** + * Logo mask + */ + CFbsBitmap* iLogoMask; + + /** + * ETrue if widget can be added to HS + */ + TBool iCanBeAdded; + + }; + +#endif ___WMDETAILSDLG_H__ + +// End of File diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmeffectmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmeffectmanager.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,111 @@ +/* +* 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: +* CImageConverter declaration +* +*/ + +#ifndef WMEFFECTMANAGER_H +#define WMEFFECTMANAGER_H + +// INCLUDES +#include <e32base.h> + +class CCoeEnv; +// CONSTANTS +// Effects +const TInt KAppStartCommonDefaultStyle = 3; +const TInt KAppExitCommonDefaultStyle = 5; + +/** + * Struct which holds needed info of effect. + */ +NONSHARABLE_STRUCT( TWmEffect ) + { + TInt iState; + TInt iType; + TInt iId; + }; + +/** + * Effect manager. + * Handles starting and ending effects. + * + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CWmEffectManager ) : public CBase + { +public: + /** + * Two-phased constructor. + * @return new instance of CWmEffectManager. + */ + static CWmEffectManager* NewL( CCoeEnv& aCoeEnv ); + + /** + * Destructor. + */ + ~CWmEffectManager(); + +public: + /** + * Begin handling of fullscreen effect. + * @param aId effect id + */ + void BeginFullscreenEffectL( TInt aId ); + + /** + * When UiRendered is called effect is ended and will be drawn + */ + void UiRendered(); + +private: + /** + * C++ default constructor. + */ + CWmEffectManager( CCoeEnv& aCoeEnv ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + +private: + /** + * Starts fullscreen effect. + * @param aEffect effect data + */ + void DoBeginFullscreenEffect( TWmEffect& aEffect ); + + /** + * Removes and destroys effect from effect list. + * @param aEffect effect data + */ + void RemoveEffect( TWmEffect* aEffect ); + +private: // data + /** + * List of started effects. + */ + RPointerArray<TWmEffect> iEffects; + + /** + * COE env + */ + CCoeEnv& iCoeEnv; + }; + +#endif // WMEFFECTMANAGER_H + +// End of file diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmiconfileprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmiconfileprovider.h Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* CWmIconFileProvider declaration +* +*/ + +#ifndef WMICONFILEPROVIDER_H_ +#define WMICONFILEPROVIDER_H_ + +// INCLUDES +#include <f32file.h> +#include <AknIconUtils.h> + +// CLASS DECLARATIONS + +/** +* CWmIconFileProvider +*/ +NONSHARABLE_CLASS( CWmIconFileProvider ) : public CBase, + public MAknIconFileProvider + { +public: + /** + * Two-phased constructor. + * + * @param aFs A handle to a file server session. + * @return New instance of CWmIconFileProvider. + */ + static CWmIconFileProvider* NewL( RFs& aFs ); + + /** + * Destructor. + */ + ~CWmIconFileProvider(); + + /** + * @return icon file name. + */ + inline const TDesC& IconFileName(); + + /** + * Setter for icon file name. + */ + void SetIconFile( const TDesC& aFileName ); + + +private: + //from MAknIconFileProvider + + /** + * Returns an open file handle to the icon file. + * This method should leave if an icon file with specified type does + * not exist. That may be the case e.g. with MBM file, + * if there are no bitmap icons. + * + * Note! RFs::ShareProtected must be called to the RFs instance used + * for opening the file. + * + * @param aFile Icon file should be opened in this file handle, which + * is an empty file handle, when the AknIcon framework calls this method. + * The AknIcon framework takes care of closing the file handle after + * having used it. + * @param aType Icon file type. + */ + void RetrieveIconFileHandleL( RFile& aFile, const TIconFileType aType ); + + /** + * With this method, AknIcon framework informs that it does not use + * this MAknIconFileProvider instance any more. After this call, + * it is ok to delete the object. This can be implemented simply + * e.g. by deleting self in this callback. + * Normally, this callback is invoked when the icon in question + * is deleted. + * Note, however, that if the same MAknIconFileProvider instance is + * supplied in multiple CreateIcon calls, then it must be accessible + * by AknIcon framework until it has signalled a matching amount + * of these callbacks. + */ + void Finished(); + +private: + /** + * Constructor + * + * @param aFs A handle to a file server session. + */ + CWmIconFileProvider( RFs& aFs ); + + /** 2nd phase constructor */ + void ConstructL(); + +private: // data + + /** the file session */ + RFs& iFs; + + /** A buffer that can contain the name of a file. */ + TFileName iFileName; + + /** used for file session */ + RFile iFile; + }; + +#include "wmiconfileprovider.inl" +#endif // WMICONFILEPROVIDER_H_ diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmiconfileprovider.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmiconfileprovider.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CWmIconFileProvider declaration +* +*/ + + + +#ifndef WMICONFILEPROVIDER_INL_ +#define WMICONFILEPROVIDER_INL_ + + + /** + * description + * + * @return description + */ + inline const TDesC& CWmIconFileProvider::IconFileName() + { return iFileName; } + +#endif /* WMICONFILEPROVIDER_INL_ */ diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmimageconverter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmimageconverter.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,239 @@ +/* +* 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: +* CWmImageConverter declaration +* +*/ + +#ifndef WMIMAGECONVERTER_H +#define WMIMAGECONVERTER_H + +//includes +#include <e32std.h> +#include <e32base.h> +#include <f32file.h> + +// Forward declarations +class CFbsBitmap; +class CBitmapScaler; +class CImageDecoder; +class TAknsItemID; +class CWmUnitTest; +class CWmIconFileProvider; + +// 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 + { + /** states for this converter */ + enum TState + { + EIdle = 0, + EDecoding, + EScalingBitmap, + EScalingMask + }; + +public: //contructors/destructors + /** + * Two-phased constructor. + * @param aObserver observer + */ + static CWmImageConverter* NewL( MConverterObserver* aObserver ); + + /** Destructor */ + ~CWmImageConverter(); + +public: // interface methods + + /** + * Parses icon string and prepares logo image. + * + * @param aWidth wanted widht + * @param aHeight wanted height + * @param aIconStr str containing logo icon + * Supported values: + * - skin(<major id> <minor id>):mif(<path> <bitmapid> <maskid>) + * - mif(<path> <bitmapid> <maskid>) + * - uid(<application uid>) + * - <file name>.<png/svg> + */ + void HandleIconStringL( TInt aWidth, TInt aHeight, const TDesC& aIconStr ); + + /** + * Returns converted bitmap. Caller takes ownership + * + * @return CFbsBitmap + */ + CFbsBitmap* Bitmap(); + + /** + * Returns converted mask. Caller takes ownership + * + * @return CFbsBitmap + */ + CFbsBitmap* Mask(); + + /** + * sets the size for decoding + * @param aSize the logo size + */ + inline 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(); + +protected: // implementation of CActive + /** + * Implements cancellation of an outstanding request. + * + * @see CActive::DoCancel + */ + void DoCancel(); + + /** + * Handles an active object's request completion event. + * + * @see CActive::RunL + */ + void RunL(); + + /** + * RunError + * + * @see CActive::RunError + */ + TInt RunError(TInt aError); + +private: + CWmImageConverter(); + void ConstructL( MConverterObserver* aObserver ); + +private: + + inline TState EngineState(); + void ScaleBitmap( TInt aWidth, TInt aHeight ); + void ScaleMask( TInt aWidth, TInt aHeight ); + void CreateIconFromUidL( const TUid& aUid ); + void CreateIconFromSvgL( const TDesC& aFileName ); + void CreateIconFromOtherL( const TDesC& aFileName ); + void CreateSkinOrMifIconL( + const TAknsItemID& aItemId, TInt aBitmapId, + TInt aMaskId, const TDesC& aFileName ); + // resolvers + TBool ResolveUid( const TDesC& aPath, TUid& aUid ); + TBool ResolveSkinId( const TDesC& aPath, TAknsItemID& aItemId ); + TBool ResolveMifId( const TDesC& aPath, TInt& aBitmapId, + TInt& aMaskId, TDes& aFileName ); + TBool ResolveSkinIdAndMifId( const TDesC& aPath, TAknsItemID& aItemId, + TInt& aBitmapId, TInt& aMaskId, TDes& aFileName ); + TBool EndsWith( const TDesC& aString, const TDesC& aPattern ); + +private: + /** + * Converter observer (not owned) + */ + MConverterObserver* iObserver; + + /** + * decoded image + */ + CFbsBitmap* iBitmap; + + /** + * decoded image mask + */ + CFbsBitmap* iMask; + + /** + * Icon file provider + */ + CWmIconFileProvider* iIconFileProvider; + + /** + * decoder from ICL API + */ + CImageDecoder* iImageDecoder; + + /** + * bitmap scaler + */ + CBitmapScaler* iScaler; + + /** + * internal state + */ + TState iState; + + /** + * File name to convert + */ + TFileName iFilename; + + /** + * size to convert + */ + TSize iSize; + + /** + * is scaling needed + */ + TBool iScaleNeeded; + + /** + * File handle + */ + RFs iFs; + + /** + * Conversion method for current image + */ + TConversionMethod iConversionMethod; + + }; + +#include "wmimageconverter.inl" +#endif // #ifndef WMIMAGECONVERTER_H + +// end of file diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmimageconverter.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmimageconverter.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +/* +* 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: +* CWmImageConverter inline function definitions +* +*/ +#ifndef IMAGECONVERTER_INL_ +#define IMAGECONVERTER_INL_ + +// --------------------------------------------------------------------------- +// Sets logo size +// --------------------------------------------------------------------------- +// +inline void CWmImageConverter::SetLogoSize( const TSize& aSize ) + { + iSize = aSize; + }; + +// --------------------------------------------------------------------------- +// Returns engine state +// --------------------------------------------------------------------------- +// +inline CWmImageConverter::TState CWmImageConverter::EngineState() + { + return iState; + }; + +#endif /* IMAGECONVERTER_INL_ */ diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmlistbox.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmlistbox.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,422 @@ +/* +* 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: +* Declares widget listbox for WidgetManager +* +*/ + +#ifndef ___WMLISTBOX_H__ +#define ___WMLISTBOX_H__ + +// INCLUDES +#include <eiklbi.h> +#include <eiktxlbx.h> +#include <eiktxlbm.h> +#include <eikfrlb.h> +#include <eiktxlbm.h> +#include <aknlists.h> + +#include <touchfeedback.h> +#include <touchlogicalfeedback.h> +#include <aknlongtapdetector.h> +#include "wmwidgetdataobserver.h" +#include "wmwidgetdata.h" + +// FORWARD DECLARATIONS +class CWmListBox; +class CWmPlugin; +class CListBoxView; +class CFormattedCellListBoxData; +class CAknLongTapDetector; +class CWmListModel; +class CWmWidgetData; +class CAknStylusPopUpMenu; +class MEikMenuObserver; + +// CLASS DECLARATIONS + +/** + * CWmListItemDrawer + */ +NONSHARABLE_CLASS( CWmListItemDrawer ): public CFormattedCellListBoxItemDrawer + { +public: + /** Two-phased constructor. */ + static CWmListItemDrawer* NewL( + CWmPlugin& aWmPlugin, + MTextListBoxModel* aTextListBoxModel, + const CFont* aFont, + CFormattedCellListBoxData* aFormattedCellData, + CWmListBox* aListBox ); + + /** Destructor. */ + ~CWmListItemDrawer(); + + /** Default logo image. */ + const CFbsBitmap* DefaultLogoImage(); + /** Default logo mask. */ + const CFbsBitmap* DefaultLogoMask(); + +public: + + /** + * from CFormattedCellListBoxItemDrawer: + * draws a single list box item + */ + void DrawItem( + TInt aItemIndex, TPoint aItemRectPos, + TBool aItemIsSelected, TBool aItemIsCurrent, + TBool aViewIsEmphasized, TBool aViewIsDimmed ) const; + +private: + /** Constructor for performing 1st stage construction */ + CWmListItemDrawer( + CWmPlugin& aWmPlugin, + MTextListBoxModel* aTextListBoxModel, + const CFont* aFont, + CFormattedCellListBoxData* aFormattedCellData, + CWmListBox* aListBox ); + + /** 2nd phase constructor */ + void ConstructL(); + + /** + * re-calculates all rects, sizes and resizes bitmaps, that are + * stored as members. Called from DrawItem if it is found that the + * draw area size has changed from previous, resulting all stored + * rectangles and bitmaps to invalidate. + * @param aSize requested size of the item being drawn. + */ + void CalculateRectangles( const TSize& aSize); + + /** + * Draws a frame rectangle for an item. + * @param aOutterRect outter rectangle. + * @param aInnerRect inner rectangle. + * @param aID Skin item id. + */ + void DrawFrame( + const TRect& aOutterRect, + const TRect& aInnerRect, + const TAknsItemID& aID, + const TAknsItemID& aCenterID ) const; + + /** + * Draws a rectangle for an item. + * @param aActualItemRect the rectangular area to be drawn. + */ + void DrawItemRect( const TRect& aActualItemRect ) const; + +private: // data members + + /** + * the plugin root (not owned) + */ + CWmPlugin& iWmPlugin; + + /** + * pointer to the list box data (not owned) + */ + CFormattedCellListBoxData* iCellData; + + /** + * pointer to the listbox (not owned) + */ + CWmListBox* iListBox; + + /** + * current font used in drawing (not owned) + */ + const CFont* iFont; + + /** + * item size used in calculating all the rects and bitmaps + */ + TSize iCurrentSize; + + /** + * logo area (relative to item upper left corner) + */ + TRect iRelativeLogoRect; + + /** + * add button area (relative to item upper left corner) + */ + TRect iRelativeAddButtonRect; + + /** + * title area (relative to item upper left corner) + */ + TRect iRelativeTitleRect; + + /** + * add-button bitmap + */ + CFbsBitmap* iAddWidgetBtnImage; + + /** + * add-button mask + */ + CFbsBitmap* iAddWidgetBtnMask; + + /** + * default logo (when widget does not have one) bitmap + */ + CFbsBitmap* iDefaultLogoImage; + + /** + * default logo (when widget does not have one) mask + */ + CFbsBitmap* iDefaultLogoImageMask; + + }; + + + +// CLASS DECLARATIONS +/** + * CWmListBox + */ +NONSHARABLE_CLASS( CWmListBox ): public CAknDouble2LargeStyleListBox, + public MWmWidgetDataObserver + { +public: + + /** + * Two-phased constructor. + */ + static CWmListBox* NewL( + CWmPlugin& aWmPlugin, + const TRect& aRect, + const CCoeControl* aParent, + TInt aFlags = 0 ); + + /** Destructor. */ + ~CWmListBox(); + +public: // API for manipulating list content + + /** Default Logo. */ + const CFbsBitmap* DefaultLogo(); + /** Default Logo mask. */ + const CFbsBitmap* DefaultMask(); + + /** + * Findbox visibility + * + * @param aVisibility sets find pane visibility + */ + inline void SetFindPaneIsVisible( TBool aVisibility ); + + /** + * Currently selected item index + * + * @return return currently selected item + */ + TInt CurrentListBoxItemIndex(); + + /** + * real index for listbox item if findbox is active + * + * @return return index from original list for currently selected item + */ + TInt RealIndex( TInt aIndex ); + + /** + * number of items in the widget data array (also items on the list) + * + * @return count of widget data array + */ + inline TInt WidgetDataCount(); + + /** + * currently selected item + * @return the selected item, or NULL if nothing selected + */ + CWmWidgetData* WidgetData(); + + /** + * gets an item by index + * + * @param aItemIndex index for item to return + */ + CWmWidgetData& WidgetData( TInt aItemIndex ); + + /** + * gets the constant widget data array + */ + inline const RWidgetDataValues& WidgetDataArray(); + + /** + * inserts widget data to the model. Takes ownership of the object. + * The widget data will appear to correct location in natural order: + * - in previously saved position, if it has been viewed before + * (widget data must have a pointer to persistent widget order) + * - in case this is a new widget, it will appear topmost + * - in case there is no persistent widgets order or it is empty, + * the widget is added in alphabetical order + * + * NOTE: caller must call HandleItemAdditionL() for the listbox after + * adding all widget datas to update the listbox correctly! + * + * @param aWidget Data data to add + */ + void AddWidgetDataL( CWmWidgetData* aWidgetData ); + + /** + * removes widget data from given index in the model + * The method reorganises the list model and size. + * Drawing is still needed to update the appearance. + * + * @param aItemIndex index to remove + * */ + void RemoveWidgetData( TInt aItemIndex/*, TBool aRedraw = ETrue*/ ); + + /** + * requests to redraw item in given index position + * + * @param aItemIndex index to redraw + */ + void RedrawItem( TInt aItemIndex ); + + /** sort order of widgets in the list */ + enum TSortOrder + { + /** sort list as it was on last run */ + EStoredOrder, + /** sort alphabetically */ + EAlphabetical, + /** show latest installed first */ + ELatestFirst + }; + + /** + * sets the list sort order + * + * @param aOrder sort order + */ + void SetSortOrderL( TSortOrder aOrder ); + + /** + * Responds to layout switched. + */ + void HandleLayoutChanged(); + + /** + * 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(); + +private: // from CEikTextListBox + /** + * Creates the item drawer. + * + * @see CEikTextListBox::CreateItemDrawerL + */ + void CreateItemDrawerL(); + +protected: // from base class CCoeControl + + /** + * Sets the control's extent, specifying a rectangle. + * + * @see CCoeControl::SizeChanged + */ + void SizeChanged(); + +private: // from base class CCoeControl + + /* + * Draws the control. + * + * @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 */ + CWmListBox( CWmPlugin& aWmPlugin ); + + /** 2nd phase constructor */ + void ConstructL( + const TRect& aRect, + const CCoeControl* aParent, + TInt aFlags ); + + +protected: // from MWmWidgetDataObserver + + /** + * widget needs redrawing + * + * @param aWidgetData item to redraw + */ + void HandleWidgetDataChanged( CWmWidgetData* aWidgetData ); + +private: // own methods + + /** + * linear order for sorting, depending on the sort type being used + */ + TLinearOrder<CWmWidgetData> SortOrder( TSortOrder aOrder ); + +private: + + /** + * the plugin root (not owned) + */ + CWmPlugin& iWmPlugin; + + /** + * array of widget data objects (the list model) + */ + RWidgetDataValues iWidgetDatas; + + /** + * the currently active item ADD button's rectangle, for push recognition + */ + TRect iButtonRect; + + /** + * state of list box find pane + */ + TBool iFindPaneIsVisible; + + /** + * state of pointer pressed down and hold + */ + TBool iPressedDown; + + }; +#include "wmlistbox.inl" + +#endif ___WMLISTBOX_H__ + +// End of File diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmlistbox.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmlistbox.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,53 @@ +/* +* 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: +* Inline function definitions for CWmListBox +* +*/ + +#ifndef WMLISTBOX_INL_ +#define WMLISTBOX_INL_ + +/** + * Findbox visibility + * + * @param aVisibility sets find pane visibility + */ + inline void CWmListBox::SetFindPaneIsVisible( TBool aVisibility ) + { iFindPaneIsVisible = aVisibility; } + + /** + * number of items in the widget data array (also items on the list) + * + * @return count of widget data array + */ + inline TInt CWmListBox::WidgetDataCount() + { return iWidgetDatas.Count(); } + + /** + * gets the constant widget data array + */ + inline const RWidgetDataValues& CWmListBox::WidgetDataArray() + { return iWidgetDatas; } + +/** + * State of pointer down event + * + * @return ETrue if pointer is down + */ + inline TBool CWmListBox::PressedDown() + { return iPressedDown; } + + +#endif /* WMLISTBOX_INL_ */ diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmmaincontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmmaincontainer.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,398 @@ +/* +* 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: +* Declares main container control for Widget Manager application. +* +*/ + +#ifndef WMMAINCONTAINER_H +#define WMMAINCONTAINER_H + +#include <e32base.h> +#include <e32cmn.h> +#include <f32file.h> +#include <coecobs.h> +#include <coecntrl.h> +#include <AknsUtils.h> +#include <gulicon.h> +#include <eiklbo.h> // MEikListBoxObserver + +// FORWARD DECLARATIONS +class CWmPlugin; +class CWmListBox; +class CAknsBasicBackgroundControlContext; +class CAknViewAppUi; +class CAknSearchField; +class CAknButton; +class CCoeControl; +class CAknSearchField; +class CWmWidgetLoaderAo; + +/** + * Container class for WmMainContainer + * + * @class CWmMainContainer WmMainContainer.h + */ +NONSHARABLE_CLASS( CWmMainContainer ) : public CCoeControl, + public MEikListBoxObserver, + public MCoeControlObserver + { +public: // constructors and destructor + + /* + * Two-phased constructor. + * + * @param aRect container rect + * @param aParent control base class + * @param aCommandObserver observers respond to user commands + * @param aWmPlugin wm plugin + */ + static CWmMainContainer* NewL( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver, + CWmPlugin& aWmPlugin ); + + /* + * Two-phased constructor. + * + * @param aRect container rect + * @param aParent control base class + * @param aCommandObserver observers respond to user commands + * @param aWmPlugin wm plugin + */ + static CWmMainContainer* NewLC( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver, + CWmPlugin& aWmPlugin ); + + /** Destructor */ + virtual ~CWmMainContainer(); + +private: + CWmMainContainer( CWmPlugin& aWmPlugin ); + + void ConstructL( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver ); + +public: // new functions + + /** + * @return true, if portal button is currently selected + */ + TBool PortalSelected(); + + /** + * @return true, if a widget in list is currently selected + */ + TBool WidgetSelected(); + + /** + * @return true, ADD command is possible + */ + TBool CanDoAdd(); + + /** + * @return true, if UNINSTALL command is possible + */ + TBool CanDoUninstall(); + + /** + * @return true, if LAUNCH command is possible + */ + TBool CanDoLaunch(); + + /** + * @return true, if FIND command is possible + */ + TBool CanDoFind(); + + /** + * @return true, if SORT command is possible + */ + TBool CanDoSort(); + + /** + * @return true, if DETAILS command is possible + */ + TBool CanDoDetails(); + + /** + * @return true, if HELP command is possible + */ + TBool CanDoHelp(); + + /** + * executes widget details dialog launch + */ + void LaunchDetailsDialogL(); + + /** + * executes widget addition to home screen + */ + void AddWidgetToHomeScreenL(); + + /** + * executes widget launch + */ + void LaunchWidgetL(); + + /** + * executes findbox activation + */ + void ActivateFindPaneL(); + + /** + * executes findbox deactivation + */ + void DeactivateFindPaneL(); + + /** + * sorts the widget list in alphabetical order + */ + void SortListAlphabeticallyL(); + + /** + * executes widget uninstall + */ + void UninstallWidgetL(); + + /** + * opens OVI portal + */ + void OpenOviPortalL(); + + /** + * Selection key (middle soft key) + */ + void SelectL(); + + /** + * Show widget manager help + */ + void ShowHelpL(); + + /** + * handles situation when widget list has changed. + * in practice reloads the widget list from the widgets API + * and redraws the screen. + */ + void HandleWidgetListChanged(); + +public: + + /** + * Handles key events. + * + * @see CCoeControl::OfferKeyEventL + */ + TKeyResponse OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * Handles a change to the control's resources + * + * @see CCoeControl::HandleResourceChange + */ + void HandleResourceChange( TInt aType ); + + /** + * Handles pointer events. + * + * @see CCoeControl::HandlePointerEventL + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + /** + * returns whether adding of widget was sucessful or not + */ + TInt ExitStatus(); + + /** + * Sets the exit status to denote the failure or sucess of adding + * widget to homescreen + */ + void SetExitStatus( TInt aExitStatus ); + + /** + * Moves focus to the OVI button + */ + void SetFocusToOviButton(); + + /** + * Moves focus to the widgets list, alternatively also setting the currently + * selected item. + * @param aIndex the item in widgets list to highlight during setting focus. + * By default the previously selected item will be highlighted. + */ + void SetFocusToWidgetList( TInt aIndex = KErrUnknown ); + + /* + * Tells if user inputs should be handeled or not. If ret is EFalse wm + * can ignore user inputs. This is becouse closing view is async and user + * might give some inputs before view is closed. + */ + TBool ClosingDown(); + + /* + * To set iClosingDown. See above. + */ + void SetClosingDown( TBool aClosingDown ); + +protected: // from base class CCoeControl + + /** + * Sets the control's extent, specifying a rectangle. + * + * @see CCoeControl::SizeChanged + */ + void SizeChanged(); + +private: // from base class CCoeControl + + /* + * Draws the control. + * + * @see CCoeControl::Draw + */ + void Draw( const TRect& aRect ) const; + + /** + * Suppy Mop object for control context + * @param TTypeUid aId + */ + TTypeUid::Ptr MopSupplyObject(TTypeUid aId); + +private: // from MEikListBoxObserver + + /** + * List box observer interface. + * + * @see MEikListBoxObserver::HandleListBoxEventL + */ + void HandleListBoxEventL( + CEikListBox* aListBox, + TListBoxEvent aEventType); + +private: // from MCoeControlObserver + + /** + * Control observer interface + * + * @see MCoeControlObserver::HandleControlEventL + */ + void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); + +private: // New functions + + void AddControlL( CCoeControl* aControl, TInt aControlId ); + void InitializeControlsL( const TRect& aRect ); + void LayoutControlsL(); + void StartLoadingWidgetsL(); + void RemoveCtrlsFromStack(); + TKeyResponse MoveFocusByKeys( + const TKeyEvent& aKeyEvent, + TEventCode aType ); + void UpdateFocusMode(); + CCoeControl* FindChildControlByPoint( const TPoint& aPoint ); + void HandleFindSizeChanged(); + +private: + + /** + * the plugin root + */ + CWmPlugin& iWmPlugin; + + /** + * parent control + */ + const CCoeControl* iParent; + + /** + * the widgets list + */ + CWmListBox* iWidgetsList; + + /** + * search filed + */ + CAknSearchField* iFindbox; + + /** + * search filed visibility switch + */ + TBool iFindPaneIsVisible; + + /** + * background + */ + CAknsBasicBackgroundControlContext* iBgContext; + + /** + * Ovi portal + */ + CAknButton* iOviPortal; + + /** GUI layout modes */ + enum TWmLayout + { + EPortrait, + ELandscape, + ELandscapeMirrored + }; + + /** + * current widget manager container layout + */ + TWmLayout iLayout; + + /** focus modes */ + enum TWmFocusMode + { + ENowhere, + EOvi, + EList, + EFind + }; + + /** + * current widget manager focus mode + */ + TWmFocusMode iFocusMode; + + /** + * exit variable to denote sucess or failure of adding widget to hs + */ + TInt iExitStatus; + + /** + * AO for loading widgets into the list UI + */ + CWmWidgetLoaderAo* iWidgetLoader; + + /** + * If this is set to ETrue it means wmview is closing and all user inputs + * should be ignored. + */ + TBool iClosingDown; + }; + +#endif // WMMAINCONTAINER_H + +// End of File diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmmaincontainerview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmmaincontainerview.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,141 @@ +/* +* 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: +* Declares main container view for Widget Manager application. +* +*/ + +#ifndef WMMAINCONTAINERVIEW_H +#define WMMAINCONTAINERVIEW_H + +#include <aknview.h> + + +class CWmMainContainer; +class CWmPlugin; + +/** + * Avkon view class for WmMainContainerView. It is register with the view server + * by the AppUi. It owns the container control. + * @class CWmMainContainerView WmMainContainerView.h + */ +NONSHARABLE_CLASS( CWmMainContainerView ) : public CAknView + { + +public: // constructors and destructor + /** + * Two-phased constructor. + * + * @param aWmPlugin wm plugin + */ + static CWmMainContainerView* NewL( CWmPlugin& aWmPlugin ); + + /** + * Two-phased constructor. + * + * @param aWmPlugin wm plugin + */ + static CWmMainContainerView* NewLC( CWmPlugin& aWmPlugin ); + + /** Destructor */ + virtual ~CWmMainContainerView(); + + +public: // from base class CAknView + /** + * Returns views id, intended for overriding by sub classes. + * + * @see CAknView::Id + */ + TUid Id() const; + + /** + * Command handling function intended for overriding by sub classes. + * + * @see CAknView::HandleCommandL + */ + void HandleCommandL( TInt aCommand ); + +public: + /** + * Creates CWmMainContainer + */ + CWmMainContainer* CreateContainerL(); + +private: + CWmMainContainerView( CWmPlugin& aWmPlugin ); + void ConstructL(); + +protected: // from base class CAknView + /** + * Avkon view architecture system. + * + * @see CAknView::DoActivateL + */ + void DoActivateL( + const TVwsViewId& aPrevViewId, + 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. + * + * @see MEikMenuObserver::DynInitMenuPaneL + */ + void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); + +private: + + /** menu commands */ + TBool HandleOpenMenuItemSelectedL(); + TBool HandleAddMenuItemSelectedL(); + TBool HandleLaunchMenuItemSelectedL(); + TBool HandleSearchMenuItemSelectedL(); + TBool HandleSortAlphaMenuItemSelectedL(); + TBool HandleUninstallMenuItemSelectedL(); + TBool HandleHelpMenuItemSelectedL(); + TBool HandleDetailsMenuItemSelectedL(); + TBool HandleDeactivateFindPaneL(); + /** setup status pane */ + void SetupStatusPaneL(); + +private: + /** + * the container + */ + CWmMainContainer* iWmMainContainer; + + /** + * the plugin root (not owned) + */ + CWmPlugin& iWmPlugin; + + }; + +#endif // WMMAINCONTAINERVIEW_H diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmpersistentwidgetorder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmpersistentwidgetorder.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Defines an ordered list of widget id's with persistence capability +* +*/ + +#ifndef WMPERSISTENTWIDGETORDER_H +#define WMPERSISTENTWIDGETORDER_H + +// INCLUDES +#include <e32base.h> +#include "wmwidgetdata.h" + +// FORWARD DECLARATIONS +class RFs; + +// CLASS DECLARATION +/** + * CWmPersistentWidgetOrder + * This class is an ordered list of widget identifiers. The list can be + * serialised and extract from stream and persisted. The list can be used + * in sorting a pointer array of CWmWidgetData. + */ +NONSHARABLE_CLASS( CWmPersistentWidgetOrder ) : public CBase + { + +public: // Constructors and destructor + /** + * static constructor. + */ + static CWmPersistentWidgetOrder* NewL( RFs& aFs ); + + /** Destructor. */ + ~CWmPersistentWidgetOrder(); + +private: // private construction + + /** + * constructor + */ + CWmPersistentWidgetOrder( RFs& aFs ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + + +public: // API + + /** + * Loads the persistent widget list from storage. + * This is typically done once after construction. + */ + void LoadL(); + + /** + * Stores a sorted array of WmWidgetData types as the persistent list. + * The instance can now be used to sort widget data. + * + * @param aArray the array of widget daya types + */ + void StoreL( const RWidgetDataValues& aArray ); + + /** + * Retrieves an index of given widget data object within the list. + * This index can be used to sort and organise. + * + * @param aWidgetData data to seek index of in the sorted order + * @return the index found, or KErrNotFound if widget is new + */ + TInt IndexOf( const CWmWidgetData& aWidgetData ) 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. + */ + TBool IsEmpty() const; + +protected: + + /** + * Cleans up the array + */ + void CleanupArray(); + + /** + * build the storage file path and name. The storage file will be located + * in host process private directory. + * @param aPathBuf a buffer to receive the complete file path + */ + void GetStoreFileNameL( TDes& aPathBuf ); + + /** + * Unique tag of a widget + */ + class Tag + { + public: + /** constructs a tag from parameters */ + Tag( TInt32 aUid, HBufC16* aPublisherId ); + + /** compares a tag agains a widget data */ + TBool Matches( const CWmWidgetData& aWidgetData ) const; + + /** widget uid */ + TInt32 iUid; + + /** widget publisher id */ + HBufC16* iPublisherId; + }; + +private: // data members + + /** the file session */ + RFs& iFs; + + /** array of widget tags for sorting */ + RArray<Tag> iTagArray; + + }; + + +#endif // WMPERSISTENTWIDGETORDER_H diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmplugin.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,162 @@ +/* +* 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: +* widget manager plugin declaration +* +*/ + +#ifndef __WMPLUGIN_ +#define __WMPLUGIN_ + +// INCLUDES +#include <e32base.h> +#include <vwsdef.h> + +#include <hscontentcontrolui.h> +#include <hscontentcontroller.h> +#include <hscontentinfo.h> + +class CAknViewAppUi; +class CWmResourceLoader; +class CWmMainContainerView; +class CWmMainContainer; +class CWmEffectManager; + +/** + * CWmPlugin + */ +NONSHARABLE_CLASS( CWmPlugin ) : public CHsContentControlUi + { +public: + + /** + * Two-phased constructor. + */ + static CWmPlugin* NewL(); + + /** Destructor */ + ~CWmPlugin(); + +public: // From MHsContentControlUi + + /** + * shows the widget manager UI + * + * @see MHsContentControlUi::Activate + */ + void Activate(); + + /** + * Notifies widget list changes + * + * @see MHsContentControlUi::NotifyWidgetListChanged + */ + void NotifyWidgetListChanged(); + +public: // plugin services + + /** + * whether widget manager UI is showing + * + * @return return ETrue if wm UI is showed + */ + TBool IsActive(); + + /** + * hides widget manager UI + */ + void Deactivate(); + + /** + * main view activated. Sets the previous view ID and main container + * + * @param aPreviousViewId + * @param aWmMainContainer + */ + void MainViewActivated( + const TVwsViewId& aPreviousViewId, + CWmMainContainer* aWmMainContainer ); + + /** + * main view was deactivated + */ + void MainViewDeactivated(); + + /** + * the CAknViewAppUi reference + * + * @return returns CAknViewAppUi + */ + inline CAknViewAppUi& ViewAppUi(); + + /** + * the resource loader + * + * @return returns CWmResourceLoader + */ + inline CWmResourceLoader& ResourceLoader(); + + /** + * the content controller ref + * + * @return returns MHsContentController + */ + inline MHsContentController& ContentController(); + + /** + * the shared file server reference + */ + inline RFs& FileServer(); + +private: // Construction + CWmPlugin(); + void ConstructL(); + +private: // data members + + /** + * the host application view app UI (not owned) + */ + CAknViewAppUi* iViewAppUi; + + /** + * main container (not owned) + */ + CWmMainContainer* iWmMainContainer; + + /** + * resource loader + */ + CWmResourceLoader* iResourceLoader; + + /** + * previous view ID (shown when main view closed) + */ + TVwsViewId iPreviousViewUid; + + /** + * Takes care of fancy UI effects + */ + CWmEffectManager* iEffectManager; + + /** + * The file server session + */ + RFs* iFs; + + }; + +#include "wmplugin.inl" +#endif // __WMPLUGIN_ + diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmplugin.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmplugin.inl Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,54 @@ +/* +* 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: +* widget manager plugin inline defintions +* +*/ + +#ifndef WMPLUGIN_INL_ +#define WMPLUGIN_INL_ + + /** + * the CAknViewAppUi reference + * + * @return returns CAknViewAppUi + */ + inline CAknViewAppUi& CWmPlugin::ViewAppUi() + { return *iViewAppUi; } + + /** + * the resource loader + * + * @return returns CWmResourceLoader + */ + inline CWmResourceLoader& CWmPlugin::ResourceLoader() + { return *iResourceLoader; } + + /** + * the content controller ref + * + * @return returns MHsContentController + */ + inline MHsContentController& CWmPlugin::ContentController() + { return *iHsContentController; } + + /** + * the shared file server reference + */ + inline RFs& CWmPlugin::FileServer() + { return *iFs; } + + + +#endif /* WMPLUGIN_INL_ */ diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmresourceloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmresourceloader.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,133 @@ +/* +* 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: +* loads widget manager resources and icons +* +*/ + + +#ifndef WMRESOURCELOADER_H_ +#define WMRESOURCELOADER_H_ + +// INCLUDE FILES +#include <e32base.h> + +// FORWARD DECLARATIONS +class CAknStylusPopUpMenu; +class CEikonEnv; +class CAknButton; +class CAknInformationNote; + +/** + * CWmResourceLoader + */ +NONSHARABLE_CLASS( CWmResourceLoader ) : public CBase + { + +public: // construction/destruction + /** + * static constructor + * + * @param aCoeEnv Control environment. + */ + static CWmResourceLoader* NewL( + CEikonEnv& aEnv ); + + /** destructor */ + ~CWmResourceLoader(); + +public: // services + + /** + * Loads a button from the widgetmanager resource file + * using CAknButton::ConstructFromResourceL + * + * @param aResource handle to the empty button instance + * @param aResourceId ID of the resource to use in loading + */ + void LoadButtonL( + CAknButton& aResource, + TInt aResourceId ); + + /** + * shows a simple info popup with OK button + * @param aResourceId the resource id of string to be shown + * @param aString additional string to be replaced into %U + */ + void InfoPopupL( TInt aResourceId, const TDesC& aString ); + + /** + * shows a standard error popup + * @param aErrorCode a system-wide standard error code + */ + void ErrorPopup( TInt aErrorCode ); + + /** icon file path */ + const TDesC& IconFilePath(); + + /** default no description text */ + const TDesC& NoDescriptionText(); + +private: // internal methods + + /** constructor */ + CWmResourceLoader( + CEikonEnv& aEnv ); + + /** 2nd phase constructor */ + void ConstructL(); + + /** load the resource */ + void LoadResourcesL(); + + /** free resources */ + void UnloadResources(); + + /** find icon file path */ + void DetermineIconFilePath(); + +private: // members + + /** + * the environment + */ + CEikonEnv& iEnv; + + /** + * name of this DLL + */ + TFileName iDllName; + + /** + * resource file offset + */ + TInt iResourceFileOffset; + + /** + * ICON file + */ + TFileName iMifFile; + + /** + * info note dialog + */ + CAknInformationNote *iNote; + + /** + * Default description text + */ + HBufC* iDescription; + }; + +#endif // WMRESOURCELOADER_H_ diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmwidgetdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmwidgetdata.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,252 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CWmWidgetData declaration +* +*/ + + +#ifndef WMWIDGETDATA_H +#define WMWIDGETDATA_H + +// INCLUDES +#include <e32std.h> +#include <e32base.h> +#include <f32file.h> +#include <bamdesca.h> +#include <hscontentinfo.h> + +#include "wmimageconverter.h" + +// FORWARD DECLARATIONS +class CDictionaryFileStore; +class MWmWidgetDataObserver; +class CFbsBitmap; +class CHsContentInfo; +class CWmPersistentWidgetOrder; +class RWidgetRegistryClientSession; + +// CLASS DECLARATION +/** + * CWmWidgetData is a representation of a widget in CWmListBox. it + * stores all data required for drawing the item in a list box, and + * handling the list item. + */ +NONSHARABLE_CLASS( CWmWidgetData ) + : public CBase + , public MConverterObserver + { + +public: // types + + /** widget type */ + enum TWidgetType + { + EUnknown, + ENative, + ECps // wrt widgets included in this category + }; + +public: // construction + /** + * Two-phased constructor. + * @param aHsContentInfo + * @param aRegistryClientSession + */ + static CWmWidgetData* NewL( + CHsContentInfo& aHsContentInfo, + RWidgetRegistryClientSession* aRegistryClientSession ); + + /** + * Two-phased constructor. + * @param aHsContentInfo + * @param aRegistryClientSession + */ + static CWmWidgetData* NewLC( + CHsContentInfo& aHsContentInfo, + RWidgetRegistryClientSession* aRegistryClientSession ); + + /** Destructor. */ + ~CWmWidgetData(); + +private: // private construction + /** Constructor for performing 1st stage construction */ + CWmWidgetData(); + + /** 2nd phase constructor */ + void ConstructL( + CHsContentInfo& aHsContentInfo, + RWidgetRegistryClientSession* aRegistryClientSession ); + +public: // external handles + + /** + * sets an observer for callbacks + * + * @param aObserver notifications when changes occur in widget data + */ + void SetObserver( MWmWidgetDataObserver* aObserver ); + + /** + * persistent widget order handle, which is used in comparing + */ + void SetPersistentWidgetOrder( + const CWmPersistentWidgetOrder* aPersistentWidgetOrder ); + + /** + * set logo rect size + */ + void SetLogoSize( const TSize& aSize ); + + /** + * Init logo re-creation + */ + void ReCreateLogo( const TSize& aSize ); + +public: // comparing / sorting + /** whether this object represents the same widget as aContentInfo */ + TBool EqualsTo( CHsContentInfo& aContentInfo ); + + /** comparator function for sort by name (compare two names)*/ + static TInt CompareByName( + const CWmWidgetData& aDataOne, + const CWmWidgetData& aDataTwo ); + + /** + * comparator function for sorting by stored order + **/ + static TInt CompareByPersistentWidgetOrder( + const CWmWidgetData& aDataOne, + const CWmWidgetData& aDataTwo ); + +public: // methods to read the content + + /** the HsContent info */ + inline CHsContentInfo& HsContentInfo(); + + /** the HsContent info */ + inline const CHsContentInfo& HsContentInfo() const; + + /** widget name */ + inline const TDesC& Name() const; + + /** widget description */ + inline const TDesC& Description() const; + + /** widget uid */ + inline TUid Uid() const; + + /** cps widget publisher id */ + inline const TDesC& PublisherId() const; + + /** cps widget publisher uid */ + TUid PublisherUid(); + + /** widget type */ + inline TWidgetType WidgetType() const; + + /** running install animation index */ + inline TInt InstallAnimationIndex() const; + + /** the logo bitmap */ + inline const CFbsBitmap* LogoImage(); + + /** the logo bitmap */ + inline const CFbsBitmap* LogoImageMask(); + + /** whether the widget data is valid or not */ + inline TBool IsValid(); + + /** sets the widget data validity */ + inline void SetValid( TBool aValid ); + +protected: // from MConverterObserver + + /** image conversin completed */ + void NotifyCompletion( TInt aError ); + +private: // new functions + + /** fetches publisher uid from widget registry*/ + void FetchPublisherUidL( + RWidgetRegistryClientSession* aRegistryClientSession ); + + /** Converts uid to TUid from TDesC8 */ + TUid UidFromString( const TDesC8& aUidString ) const; + + /** Logo icon string handling */ + static TInt HandleAsyncIconString( TAny* aPtr ); + void HandleIconStringL( const TDesC& aIconStr ); + void FireDataChanged(); + +private: // data members + + /* instance of the CIdle class for async iconStr handling*/ + CIdle* iIdle; + + /* the image converter utility */ + CWmImageConverter* iImageConverter; + + /* observes this widget representation (NOT OWNED) */ + MWmWidgetDataObserver* iObserver; + + /* rotating animation index */ + TInt iInstallAnimationIndex; + + /** the widget logo bitmap */ + CFbsBitmap* iLogoImage; + + /** the widget logo mask */ + CFbsBitmap* iLogoImageMask; + + /** The CHsContentInfo that corresponds to this list row */ + CHsContentInfo* iHsContentInfo; + + /** type oif the widget */ + TWidgetType iWidgetType; + + /** persistent order of widgets (used in sorting) */ + const CWmPersistentWidgetOrder* iPersistentWidgetOrder; + + /** wrt widget publisher uid */ + TUid iPublisherUid; + + /** size of logo rect in list item */ + TSize iLogoSize; + + /** validity of the widget - used during list refresh */ + TBool iValid; + + }; + + +/** + * Pointer array of widget data objects. + * Also acts as an adapter to a descriptor array, providing the + * widget names as descriptor array elements. + */ +NONSHARABLE_CLASS( RWidgetDataValues ) : public RPointerArray<CWmWidgetData>, + public MDesCArray + { + protected: // from MDesCArray + /** returns number of items in the pointer array */ + inline TInt MdcaCount() const; + + /** returns the pointed widget name */ + inline TPtrC16 MdcaPoint(TInt aIndex) const; + + }; + +#include "wmwidgetdata.inl" +#endif // WMWIDGETDATA_H diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmwidgetdata.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmwidgetdata.inl Thu Dec 17 08:40:49 2009 +0200 @@ -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: +* CWmWidgetData , RWidgetDataValues inline function definitions +* +*/ + +#ifndef WMWIDGETDATA_INL_ +#define WMWIDGETDATA_INL_ + + /** the HsContent info */ + inline CHsContentInfo& CWmWidgetData::HsContentInfo() + { return *iHsContentInfo; } + + /** the HsContent info */ + inline const CHsContentInfo& CWmWidgetData::HsContentInfo() const + { return *iHsContentInfo; } + + /** widget name */ + inline const TDesC& CWmWidgetData::Name() const + { return iHsContentInfo->Name(); } + + /** widget description */ + inline const TDesC& CWmWidgetData::Description() const + { return iHsContentInfo->Description(); } + + /** widget uid */ + inline TUid CWmWidgetData::Uid() const + { return UidFromString( iHsContentInfo->Uid() ); }; + + /** cps widget publisher id */ + inline const TDesC& CWmWidgetData::PublisherId() const + { return iHsContentInfo->PublisherId(); } + + /** widget type */ + inline CWmWidgetData::TWidgetType CWmWidgetData::WidgetType() const + { return iWidgetType; } + + /** running install animation index */ + inline TInt CWmWidgetData::InstallAnimationIndex() const + { return iInstallAnimationIndex; } + + /** the logo bitmap */ + inline const CFbsBitmap* CWmWidgetData::LogoImage() + { return iLogoImage; } + + /** the logo bitmap */ + inline const CFbsBitmap* CWmWidgetData::LogoImageMask() + { return iLogoImageMask; } + + /** whether the widget data is valid or not */ + inline TBool CWmWidgetData::IsValid() + { return iValid; } + + /** sets the widget data validity */ + inline void CWmWidgetData::SetValid( TBool aValid ) + { iValid = aValid; } + + + //From RWidgetDataValues + + /** returns number of items in the pointer array */ + inline TInt RWidgetDataValues::MdcaCount() const + { + return Count(); + } + /** returns the pointed widget name */ + inline TPtrC16 RWidgetDataValues::MdcaPoint(TInt aIndex) const + { + const TPtrC16 ptr( (*this)[aIndex]->Name() ); + return ptr; + } + +#endif /* WMWIDGETDATA_INL_ */ diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmwidgetdataobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmwidgetdataobserver.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Observer for changes in the widget data +* +*/ + + +#ifndef WMWIDGETDATAOBSERVER_H +#define WMWIDGETDATAOBSERVER_H + +// INCLUDES +#include <e32std.h> + +// Forward declarations +class CWmWidgetData; + +// CLASS DECLARATION + +/** + * Observer class for receiving notifications + * when changes occur in widget data + */ +NONSHARABLE_CLASS( MWmWidgetDataObserver ) + { + public: + /** + * A single widget data has changed. + * @param aWidgetData pointer to the data where change + * has occurred + */ + virtual void HandleWidgetDataChanged( + CWmWidgetData* aWidgetData ) = 0; + + }; + +#endif // WMWIDGETDATAOBSERVER_H diff -r 000000000000 -r f72a12da539e widgetmanager/inc/wmwidgetloaderao.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/inc/wmwidgetloaderao.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,125 @@ +/* +* 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: +* CWmIconFileProvider declaration +* +*/ + +#ifndef WMWIDGETLOADERAO_H_ +#define WMWIDGETLOADERAO_H_ + +// INCLUDES +#include <e32base.h> + +// FORWARD DECLARATIONS +class CWmPlugin; +class CWmListBox; +class CHsContentInfo; +class CWmWidgetData; +class CWmPersistentWidgetOrder; +class RWidgetRegistryClientSession; + +// CLASS DECLARATIONS + +/** + * CWmWidgetLoaderAo + */ +NONSHARABLE_CLASS( CWmWidgetLoaderAo ) : public CAsyncOneShot + { + +public: + /** + * Static constructor + */ + static CWmWidgetLoaderAo* NewL( + CWmPlugin& aWmPlugin, + CWmListBox& aTargetList ); + + /** + * Destructor. + */ + ~CWmWidgetLoaderAo(); + + /** + * Starts the load process by activating the AO + */ + void StartLoading(); + +private: + + /** + * Constructor + */ + CWmWidgetLoaderAo( + CWmPlugin& aWmPlugin, + CWmListBox& aTargetList ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + +protected: // from CActive + + /** + * AO body + */ + void RunL(); + + /** + * AO error handler + */ + TInt RunError( TInt aError ); + +private: + + /** + * loads widgets into the listbox + */ + void DoLoadWidgetsL(); + + /** + * finds a widget data entry from iWidgetsList that matches + * given content info. returns a pointer to the data found, + * or NULL if not found + */ + CWmWidgetData* FindWidgetData( CHsContentInfo& aContentInfo ); + + /** + * adds a widget data entry to iWidgetsList + */ + void AddWidgetDataL( CHsContentInfo& aContentInfo ); + + /** + * cleanup resources allocated runing one single run + */ + void Cleanup(); + +private: // data + + /** reference to the widget manager root */ + CWmPlugin& iWmPlugin; + + /** target where widgets are to be loaded */ + CWmListBox& iWidgetsList; + + /** widget registry */ + RWidgetRegistryClientSession* iWidgetRegistry; + + /** persistent widget order */ + CWmPersistentWidgetOrder* iWidgetOrder; + + }; + +#endif // WMWIDGETLOADERAO_H_ diff -r 000000000000 -r f72a12da539e widgetmanager/rom/widgetmanager.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/rom/widgetmanager.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* widgetmanager binaries +*/ + +#ifndef WIDGETMANAGER_IBY +#define WIDGETMANAGER_IBY + +// widgetmanager plugin +ECOM_PLUGIN( widgetmanager.dll, widgetmanager.rsc ) + +// widgetmanager icons +data=DATAZ_\resource\apps\widgetmanager.mif \resource\apps\widgetmanager.mif + +// widgetmanager stub sis +data=ZSYSTEM\install\widgetmanager_stub.sis system\install\widgetmanager_stub.sis + +#endif // WIDGETMANAGER_IBY + diff -r 000000000000 -r f72a12da539e widgetmanager/rom/widgetmanager_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/rom/widgetmanager_resources.iby Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* widgetmanager resource binaries +*/ + +#ifndef WIDGETMANAGER_RESOURCES_IBY +#define WIDGETMANAGER_RESOURCES_IBY + +// widgetmanager resources +data=DATAZ_\resource\widgetmanagerview.rsc \resource\widgetmanagerview.rsc + +#endif // WIDGETMANAGER_RESOURCES_IBY + diff -r 000000000000 -r f72a12da539e widgetmanager/sis/Create_update_sisx.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/sis/Create_update_sisx.bat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +rem Change dll versions for IAD update +call elftran.exe -version 1.2 \epoc32\release\armv5\urel\widgetmanager.dll +call elftran.exe -version 1.2 \epoc32\release\armv5\udeb\widgetmanager.dll + +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 +makesis widgetmanager_urel.pkg +signsis widgetmanager_urel.SIS widgetmanager_urel.SISX Nokia_RnDCert_02.der Nokia_RnDCert_02.key + +rem Create wm stubsis file +makesis -s widgetmanager_stub.pkg \ No newline at end of file diff -r 000000000000 -r f72a12da539e widgetmanager/sis/Nokia_RnDCert_02.der Binary file widgetmanager/sis/Nokia_RnDCert_02.der has changed diff -r 000000000000 -r f72a12da539e widgetmanager/sis/Nokia_RnDCert_02.key --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/sis/Nokia_RnDCert_02.key Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,15 @@ +-----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 000000000000 -r f72a12da539e widgetmanager/sis/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/sis/backup_registration.xml Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,5 @@ +<?xml version="1.0" standalone="yes"?> +<backup_registration> + <system_backup/> + <restore requires_reboot = "no"/> +</backup_registration> diff -r 000000000000 -r f72a12da539e widgetmanager/sis/widgetmanager_stub.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/sis/widgetmanager_stub.pkg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,28 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: widgetmanager_stub.pkg +; + +;Language - standard language definitions +&EN + +; standard SIS file header +#{"Widget Manager"},(0x20026F53),1,0,0,TYPE=SA + +;Localized Vendor name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + diff -r 000000000000 -r f72a12da539e widgetmanager/sis/widgetmanager_stub.sis Binary file widgetmanager/sis/widgetmanager_stub.sis has changed diff -r 000000000000 -r f72a12da539e widgetmanager/sis/widgetmanager_udeb.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/sis/widgetmanager_udeb.pkg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,45 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: widgetmanager.pkg +; + +;Language - standard language definitions +&EN + +; standard SIS file header +#{"Widget Manager"},(0x20026F53),1,2,2,TYPE=SA,RU + +;Localised Vendor name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +;Supports Series 60 v 5.0 +[0x1028315F], 0, 0, 0, {"S60ProductID"} + +;We need to force update to be installed to c-drive +;becouse we are part of the homescreen. If update was installed to memcard +;homescreen will be closed when memcard is removed. + +; widgetmanager plugin and plugin resource +"\epoc32\release\armv5\udeb\widgetmanager.dll" -"C:\sys\bin\widgetmanager.dll" +"\epoc32\data\z\resource\plugins\widgetmanager.rsc" -"C:\resource\plugins\widgetmanager.rsc" + +; widgetmanager resource file +"\epoc32\data\z\resource\widgetmanagerview.rsc" -"C:\resource\widgetmanagerview.rsc" + +; widgetmanager icons +"\epoc32\data\z\resource\apps\widgetmanager.mif" -"C:\resource\apps\widgetmanager.mif" + diff -r 000000000000 -r f72a12da539e widgetmanager/sis/widgetmanager_urel.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/sis/widgetmanager_urel.pkg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,45 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: widgetmanager.pkg +; + +;Language - standard language definitions +&EN + +; standard SIS file header +#{"Widget Manager"},(0x20026F53),1,2,2,TYPE=SA,RU + +;Localised Vendor name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +;Supports Series 60 v 5.0 +[0x1028315F], 0, 0, 0, {"S60ProductID"} + +;We need to force update to be installed to c-drive +;becouse we are part of the homescreen. If update was installed to memcard +;homescreen will be closed when memcard is removed. + +; widgetmanager plugin and plugin resource +"\epoc32\release\armv5\urel\widgetmanager.dll" -"C:\sys\bin\widgetmanager.dll" +"\epoc32\data\z\resource\plugins\widgetmanager.rsc" -"C:\resource\plugins\widgetmanager.rsc" + +; widgetmanager resource file +"\epoc32\data\z\resource\widgetmanagerview.rsc" -"C:\resource\widgetmanagerview.rsc" + +; widgetmanager icons +"\epoc32\data\z\resource\apps\widgetmanager.mif" -"C:\resource\apps\widgetmanager.mif" + diff -r 000000000000 -r f72a12da539e widgetmanager/src/wmdetailsdlg.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/src/wmdetailsdlg.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,525 @@ +/* +* 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: +* Implementation of the widget details dlg for WidgetManager +* +*/ + +// INCLUDE FILES +#include <gdi.h> +#include <eikrted.h> // for CRichTextEditor +#include <txtrich.h> // for CRichText +#include <AknUtils.h> // for AknUtils +#include <AknsUtils.h> // MAknsSkinInstance +#include <AknsDrawUtils.h> // AknsDrawUtils +#include <applayout.cdl.h> //layout +#include <layoutmetadata.cdl.h> +#include <aknlayoutscalable_avkon.cdl.h> +#include <aknlayoutscalable_apps.cdl.h> +#include <AknsBasicBackgroundControlContext.h> + +#include <widgetmanagerview.rsg> +#include "widgetmanager.hrh" +#include "wmdetailsdlg.h" + + +// CONSTANTS + + +// MEMBER FUNCTIONS + +// --------------------------------------------------------- +// FullScreenRect +// rectangle representing the screen +// --------------------------------------------------------- +// +TRect FullScreenRect() + { + TRect screen; + CCoeEnv* env = CCoeEnv::Static(); + if ( env ) + { + CWsScreenDevice* screenDevice = env->ScreenDevice(); + if ( screenDevice ) + screen.SetRect( TPoint(0,0), screenDevice->SizeInPixels() ); + } + return screen; + } + +// --------------------------------------------------------- +// CWmDetailsDlg::NewL +// --------------------------------------------------------- +// +CWmDetailsDlg* CWmDetailsDlg::NewL( + const TDesC& aName, + const TDesC& aDescription, + TBool aCanBeAdded, + const CFbsBitmap* aLogoBmp, + const CFbsBitmap* aLogoMask, + CAknsBasicBackgroundControlContext* aBgContext ) + { + CWmDetailsDlg* self = new ( ELeave ) CWmDetailsDlg( aCanBeAdded ); + CleanupStack::PushL( self ); + self->ConstructL( aName, aDescription, aLogoBmp, aLogoMask, aBgContext ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// CWmDetailsDlg::CWmDetailsDlg +// --------------------------------------------------------- +// +CWmDetailsDlg::CWmDetailsDlg( TBool aCanBeAdded ) + : CAknDialog(), + iCanBeAdded( aCanBeAdded ) + { + iBorder = TGulBorder::ERaisedControl; + } + +// --------------------------------------------------------- +// CWmDetailsDlg::~CWmDetailsDlg +// --------------------------------------------------------- +// +CWmDetailsDlg::~CWmDetailsDlg() + { + iEikonEnv->RemoveFromStack( iRtEditor ); + iEikonEnv->RemoveFromStack( this ); + delete iRtEditor; + delete iName; + delete iDescription; + delete iLogoBmp; + delete iLogoMask; + } + +// ----------------------------------------------------------------------------- +// CWmDetailsDlg::ExecuteLD +// ----------------------------------------------------------------------------- +// +TInt CWmDetailsDlg::ExecuteLD() + { + if ( iCanBeAdded ) + { + return CAknDialog::ExecuteLD( R_WM_DETAILS_ADD_DIALOG ); + } + else + { + return CAknDialog::ExecuteLD( R_WM_DETAILS_ONLY_DIALOG ); + } + } + +// --------------------------------------------------------- +// CWmDetailsDlg::ConstructL +// --------------------------------------------------------- +// +void CWmDetailsDlg::ConstructL( + const TDesC& aName, + const TDesC& aDescription, + const CFbsBitmap* aLogoBmp, + const CFbsBitmap* aLogoMask, + CAknsBasicBackgroundControlContext* aBgContext ) + { + if ( !aLogoBmp ) + { + User::Leave( KErrArgument ); + } + + CAknDialog::ConstructL( R_AVKON_DIALOG_EMPTY_MENUBAR ); + + iBgContext = aBgContext; + 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() ) ); + + if ( aLogoMask ) + { + 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() ) ); + } + + iEikonEnv->AddWindowShadow( static_cast<CCoeControl*>(this) ); + } + +// ----------------------------------------------------------------------------- +// CWmDetailsDlg::OkToExitL +// ----------------------------------------------------------------------------- +// +TBool CWmDetailsDlg::OkToExitL( TInt aButtonId ) + { + if ( aButtonId == ECbaAddToHs || + aButtonId == EAknSoftkeyClose ) + { + // Close dlg + return ETrue; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CWmDetailsDlg::PreLayoutDynInitL +// ----------------------------------------------------------------------------- +// +void CWmDetailsDlg::PreLayoutDynInitL() + { + iRtEditor = new(ELeave) CEikRichTextEditor(); + iRtEditor->ConstructL( this, + 0, + 0, + CEikEdwin::EReadOnly | + CEikEdwin::ENoAutoSelection | + CEikEdwin::EAvkonDisableCursor | + CEikEdwin::EDisplayOnly ); + iRtEditor->SetContainerWindowL(*this); + iRtEditor->SetAknEditorFlags( + EAknEditorFlagEnableScrollBars | + EEikEdwinAvkonDisableCursor | + EEikEdwinDisplayOnly | + EEikEdwinReadOnly ); + + iRtEditor->SetSkinBackgroundControlContextL( iBgContext ); + + CEikScrollBarFrame* scrollBarFrame = iRtEditor->CreateScrollBarFrameL(); + scrollBarFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, + CEikScrollBarFrame::EOff ); + + InsertAndFormatContentL(); + iRtEditor->UpdateScrollBarsL(); + } + +//------------------------------------------------------------------------------ +// CWmDetailsDlg::InsertAndFormatContentL +//------------------------------------------------------------------------------ +// +void CWmDetailsDlg::InsertAndFormatContentL() + { + CRichText* richText = iRtEditor->RichText(); + const TInt KMinTxtLength = 100; + + richText->Reset(); + if ( iDescription->Des().Length() <= KMinTxtLength ) + { + richText->InsertL( richText->DocumentLength(), + CEditableText::ELineBreak ); + } + richText->InsertL( richText->DocumentLength(), *iDescription ); + + // change the color of the text according to the skin color + TRgb color = KRgbBlack; + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsUtils::GetCachedColor(skin, color, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); + + // Format text + iRtEditor->SetSelectionL( 0, richText->DocumentLength() ); + + // Get a logical font to base my font on: + const CFont* logicalFont = AknLayoutUtils::FontFromId(EAknLogicalFontPrimarySmallFont); + // Extract font information + TFontSpec fontspec = logicalFont->FontSpecInTwips(); + TCharFormat charFormat(fontspec.iTypeface.iName, fontspec.iHeight); + TCharFormatMask charFormatMask; + CParaFormat paraFormat; + TParaFormatMask paraFormatMask; + paraFormat.iHorizontalAlignment = CParaFormat::EJustifiedAlign; + charFormat.iFontPresentation.iTextColor = color; + paraFormatMask.SetAttrib(EAttAlignment); + charFormatMask.SetAttrib(EAttFontTypeface); + charFormatMask.SetAttrib(EAttFontHeight); + charFormatMask.SetAttrib(EAttColor); + iRtEditor->ApplyParaFormatL(¶Format, paraFormatMask); + iRtEditor->ApplyCharFormatL(charFormat, charFormatMask); + iRtEditor->ClearSelectionL(); + } + +//------------------------------------------------------------------------------ +// CWmDetailsDlg::CountComponentControls +//------------------------------------------------------------------------------ +// +TInt CWmDetailsDlg::CountComponentControls() const + { + return iRtEditor ? 1 : 0; + } + +//------------------------------------------------------------------------------ +// CWmDetailsDlg::ComponentControl +//------------------------------------------------------------------------------ +// +CCoeControl* CWmDetailsDlg::ComponentControl(TInt aIndex) const + { + switch (aIndex) + { + case 0: + return iRtEditor; + default: + return NULL; + } + } + +//------------------------------------------------------------------------------ +// CWmDetailsDlg::ActivateL +//------------------------------------------------------------------------------ +// +void CWmDetailsDlg::ActivateL() + { + CAknDialog::ActivateL(); + iEikonEnv->EikAppUi()->AddToStackL( this, ECoeStackPriorityDialog ); + iEikonEnv->EikAppUi()->AddToStackL( iRtEditor ); + iRtEditor->SetFocus( ETrue ); + } + +// ----------------------------------------------------------------------------- +// CWmDetailsDlg::WmDetailsDialogRect +// ----------------------------------------------------------------------------- +// +TRect CWmDetailsDlg::WmDetailsDialogRect() + { + TRect mainPane, dlgRect; + TPoint topLeft; + TInt desiredW, desiredH; + AknLayoutUtils::LayoutMetricsRect( + AknLayoutUtils::EApplicationWindow, mainPane ); + + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + desiredW = ( mainPane.Width() - (mainPane.Width()/4) ); + desiredH = ( mainPane.Height() - (mainPane.Height()/5) ); + topLeft.iX = ( ( mainPane.Width() - desiredW ) /2); + topLeft.iY = ( ( mainPane.Height() - desiredH ) /2); + dlgRect.SetRect( topLeft, TSize( desiredW, desiredH ) ); + } + else + { + desiredH = ( mainPane.Height() - (mainPane.Height()/4) ); + desiredW = ( mainPane.Width() - (mainPane.Width()/5) ); + topLeft.iX = ( ( mainPane.Width() - desiredW ) /2); + topLeft.iY = ( ( mainPane.Height() - desiredH ) /2); + dlgRect.SetRect( topLeft, TSize( desiredW, desiredH ) ); + } + return dlgRect; + } + +// ----------------------------------------------------------------------------- +// CWmDetailsDlg::SetSizeAndPosition +// ----------------------------------------------------------------------------- +// +void CWmDetailsDlg::SetSizeAndPosition( const TSize& /*aSize*/ ) + { + SetRect( WmDetailsDialogRect() ); + } + +// ----------------------------------------------------------------------------- +// CWmDetailsDlg::SizeChanged +// ----------------------------------------------------------------------------- +// +void CWmDetailsDlg::SizeChanged() + { + CAknDialog::SizeChanged(); + TRect rect = Rect(); + if ( iBgContext ) { iBgContext->SetRect( FullScreenRect() ); } + if ( iRtEditor ) + { + const TInt offSet = 5; + TRect cbaRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EControlPane, cbaRect ); + + TInt logoH = iLogoBmp->SizeInPixels().iHeight; + + TInt height, width; + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + height = ( (rect.Height() - logoH) - (cbaRect.Height() * 2) - offSet ); + } + else + { + height = ( (rect.Height() - logoH) - (cbaRect.Height() * 1.5) - offSet ); + } + + width = ( rect.Width() - (CEikScrollBar::DefaultScrollBarBreadth() * 4 ) - offSet ); + TPoint point = TPoint( rect.iTl.iX + offSet, rect.iTl.iY + logoH + offSet ); + TSize size = TSize( width, height ); + iRtEditor->SetRect( TRect( point, size ) ); + TRAP_IGNORE( + iRtEditor->SetSkinBackgroundControlContextL( iBgContext ); + InsertAndFormatContentL(); ); + } + } + +// ---------------------------------------------------------------------------- +// CWmDetailsDlg::SupplyMopObject +// ---------------------------------------------------------------------------- +// +TTypeUid::Ptr CWmDetailsDlg::MopSupplyObject( TTypeUid aId ) + { + if ( aId.iUid == MAknsControlContext::ETypeId ) + { + return MAknsControlContext::SupplyMopObject( aId, iBgContext ); + } + return CAknDialog::MopSupplyObject( aId ); + } + +// ---------------------------------------------------------------------------- +// CWmDetailsDlg::OfferKeyEventL +// ---------------------------------------------------------------------------- +// +TKeyResponse CWmDetailsDlg::OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType ) + { + if (aType == EEventKey) + { + switch (aKeyEvent.iCode) + { + case EKeyEscape: + { + // framework calls this when dialog must shut down + return CAknDialog::OfferKeyEventL( aKeyEvent, aType ); + } + case EKeyDownArrow: + { + if ( iRtEditor ) + { + iRtEditor->MoveCursorL(TCursorPosition::EFPageDown, EFalse); + return EKeyWasConsumed; + } + } + case EKeyUpArrow: + { + if ( iRtEditor ) + { + iRtEditor->MoveCursorL(TCursorPosition::EFPageUp, EFalse); + return EKeyWasConsumed; + } + } + default: + { + if ( iRtEditor ) + { + return iRtEditor->OfferKeyEventL( aKeyEvent, aType ); + } + break; + } + } + } + return CAknDialog::OfferKeyEventL( aKeyEvent, aType); + } + +// ----------------------------------------------------------------------------- +// CWmDetailsDlg::Draw +// ----------------------------------------------------------------------------- +// +void CWmDetailsDlg::Draw( const TRect& /*aRect*/ ) const + { + CWindowGc& gc = SystemGc(); + TRect rect = Rect(); + TRect innerRect( rect ); + TRgb color = KRgbBlack; + const TInt offSet = 5; + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + + // draw background + if ( !AknsDrawUtils::Background( skin, cc, this, gc, innerRect ) ) + { + gc.SetPenStyle( CGraphicsContext::ENullPen ); + gc.SetBrushStyle( CGraphicsContext::ENullBrush ); + gc.SetBrushColor( AKN_LAF_COLOR( 0 ) ); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.DrawRect( innerRect ); + gc.SetBrushStyle( CGraphicsContext::ENullBrush ); + } + + // to fix scrollbar background issue in richtext editor + if ( iRtEditor ) + { + MAknsControlContext* ccRte = AknsDrawUtils::ControlContext( iRtEditor ); + AknsDrawUtils::Background( skin, ccRte, iRtEditor, gc, iRtEditor->Rect() ); + } + + // draw logo + TRect bmpRect( TPoint(0,0), TSize( iLogoBmp->SizeInPixels() ) ); + TPoint point = TPoint( innerRect.iTl.iX + offSet, + innerRect.iTl.iY + offSet ); + + if ( iLogoBmp && iLogoMask ) + { + gc.BitBltMasked( point, iLogoBmp, + bmpRect, iLogoMask, ETrue ); + } + else + { + gc.BitBlt( point, iLogoBmp, bmpRect ); + } + + // draw name + point.iX += (bmpRect.Width() + offSet); + + AknsUtils::GetCachedColor( + skin, color, + KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ); + + // DRAW TEXT + const CFont* font = AknLayoutUtils::FontFromId( EAknLogicalFontPrimaryFont ); + gc.UseFont( font ); + gc.SetPenColor( color ); + gc.SetPenStyle( CGraphicsContext::ESolidPen ); + point.iY += (bmpRect.Height() - (font->HeightInPixels() /2 ) ); + CGraphicsContext::TDrawTextParam param; + + HBufC* buf = iName->Des().Alloc(); + if ( buf ) + { + TPtr bufPtr = buf->Des(); + TextUtils::ClipToFit( bufPtr, *font, (innerRect.Width() - point.iX ) ); + gc.DrawText( bufPtr ,point, param ); + delete buf; + } + else + { + gc.DrawText( *iName ,point, param ); + } + + gc.DiscardFont(); + + // draw the rounded rectangle as border + const TInt KFrameRoundRadius = 3; + 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 ); + } + +// End of File + diff -r 000000000000 -r f72a12da539e widgetmanager/src/wmeffectmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/src/wmeffectmanager.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,157 @@ +/* +* 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: Effect manager. +* +*/ + + +// SYSTEM INCLUDE FILES +#include <eikapp.h> +#include <aknappui.h> +#include <gfxtranseffect/gfxtranseffect.h> // For transition effects +#include <akntranseffect.h> // For transition effects + +// INCLUDE FILES +#include "wmeffectmanager.h" + +// CONSTANTS +const TInt KEffectTypeFullscreen = 1; + +const TInt KWaitForLayout = 1; +const TInt KEffectStarted = 2; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// C++ default constructor. +// ----------------------------------------------------------------------------- +// +CWmEffectManager::CWmEffectManager( CCoeEnv& aCoeEnv ): iCoeEnv (aCoeEnv) + { + } + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CWmEffectManager::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CWmEffectManager* CWmEffectManager::NewL( CCoeEnv& aCoeEnv ) + { + CWmEffectManager* self = new (ELeave) CWmEffectManager( aCoeEnv ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +CWmEffectManager::~CWmEffectManager() + { + GfxTransEffect::AbortFullScreen(); + iEffects.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// CWmEffectManager::BeginFullscreenEffectL +// ----------------------------------------------------------------------------- +// +void CWmEffectManager::BeginFullscreenEffectL( TInt aId ) + { + TWmEffect* effect = new (ELeave) TWmEffect; + CleanupStack::PushL( effect ); + effect->iId = aId; + effect->iType = KEffectTypeFullscreen; + effect->iState = KWaitForLayout; + iEffects.Append( effect ); + + CleanupStack::Pop( effect ); + + DoBeginFullscreenEffect( *effect ); + } + +// ----------------------------------------------------------------------------- +// CWmEffectManager::UiRendered +// ----------------------------------------------------------------------------- +// +void CWmEffectManager::UiRendered() + { + for ( TInt i = 0; i < iEffects.Count(); ) + { + TWmEffect* effect = iEffects[i]; + if ( effect && effect->iState == KEffectStarted ) + { + GfxTransEffect::EndFullScreen(); + RemoveEffect( effect ); + } + else + { + // RemoveEffect() will remove from iEffects array and + // thats why we need to have conter in else + i++; + } + } + } + +// ----------------------------------------------------------------------------- +// CWmEffectManager::DoBeginFullscreenEffect +// ----------------------------------------------------------------------------- +// +void CWmEffectManager::DoBeginFullscreenEffect( TWmEffect& aEffect ) + { + if ( iCoeEnv.WsSession().GetFocusWindowGroup() != + iCoeEnv.RootWin().Identifier() ) + { + // Window group is not focused + RemoveEffect( &aEffect ); + return; + } + + const TInt flags( AknTransEffect::TParameter::EActivateExplicitCancel ); + const TUid targetAppUid( iAvkonAppUi->Application()->AppDllUid() ); + + // Set effect begin point + GfxTransEffect::BeginFullScreen( aEffect.iId , iAvkonAppUi->ClientRect(), + AknTransEffect::EParameterType, AknTransEffect::GfxTransParam( + targetAppUid, flags ) ); + + aEffect.iState = KEffectStarted; + } + +// ----------------------------------------------------------------------------- +// CXnEffectManager::RemoveEffect +// ----------------------------------------------------------------------------- +// +void CWmEffectManager::RemoveEffect( TWmEffect* aEffect ) + { + TInt index = iEffects.Find( aEffect ); + if ( index != KErrNotFound ) + { + TWmEffect* temp = iEffects[index]; + iEffects.Remove( index ); + delete temp; + } + } + +// End fo file + diff -r 000000000000 -r f72a12da539e widgetmanager/src/wmiconfileprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/src/wmiconfileprovider.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,89 @@ +/* +* 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: +* CWmIconFileProvider implementation. +* +*/ + +#include "wmcommon.h" +#include "wmiconfileprovider.h" + +// --------------------------------------------------------------------------- +// CWmIconFileProvider::CWmIconFileProvider +// --------------------------------------------------------------------------- +// +CWmIconFileProvider::CWmIconFileProvider( RFs& aFs ) + :iFs( aFs ) + { + } + +// --------------------------------------------------------------------------- +// CWmIconFileProvider::~CWmIconFileProvider +// --------------------------------------------------------------------------- +// +CWmIconFileProvider::~CWmIconFileProvider() + { + } + +// --------------------------------------------------------------------------- +// CWmIconFileProvider::SetIconFile +// --------------------------------------------------------------------------- +// +void CWmIconFileProvider::SetIconFile( const TDesC& aFileName ) + { + iFileName.Copy( aFileName ); + } + +// --------------------------------------------------------------------------- +// CWmIconFileProvider::NewL +// --------------------------------------------------------------------------- +// +CWmIconFileProvider* CWmIconFileProvider::NewL( RFs& aFs ) + { + CWmIconFileProvider* self = new (ELeave) CWmIconFileProvider( aFs ); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); // self + return self; + } + +// --------------------------------------------------------------------------- +// CWmIconFileProvider::ConstructL +// --------------------------------------------------------------------------- +// +void CWmIconFileProvider::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// CWmIconFileProvider::RetrieveIconFileHandleL +// --------------------------------------------------------------------------- +// +void CWmIconFileProvider::RetrieveIconFileHandleL( + RFile& aFile, + const TIconFileType /*aType*/ ) + { + User::LeaveIfError( aFile.Open( iFs, iFileName, EFileShareAny ) ); + } + +// --------------------------------------------------------------------------- +// CWmIconFileProvider::Finished +// --------------------------------------------------------------------------- +// +void CWmIconFileProvider::Finished() + { + } + +// end of file + diff -r 000000000000 -r f72a12da539e widgetmanager/src/wmimageconverter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/src/wmimageconverter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,874 @@ +/* +* 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: +* CWmImageConverter implementation +* +*/ + +#include <fbs.h> +#include <eikdef.h> +#include <eikenv.h> +#include <bautils.h> +#include <imageconversion.h> +#include <bitmaptransforms.h> +#include <AknIconUtils.h> +#include <AknsSkinInstance.h> +#include <AknsUtils.h> +#include <avkon.mbg> +#include <apgcli.h> +#include <SVGEngineInterfaceImpl.h> +#include <WidgetRegistryConstants.h> // KWidgetUidLowerBound, KWidgetUidUpperBound + +#include "wmiconfileprovider.h" +#include "wmimageconverter.h" + +_LIT( KSkin, "skin" ); +_LIT( KMif, "mif" ); +_LIT( KUid, "uid" ); +_LIT( KColon, ":" ); +_LIT( KSvgExt, ".svg" ); +_LIT( KHexPrefix, "0x" ); +const TUint KLeftParenthesis = '('; + +// --------------------------------------------------------- +// CWmImageConverter::NewL +// --------------------------------------------------------- +// +CWmImageConverter* CWmImageConverter::NewL( MConverterObserver* aObserver ) + { + CWmImageConverter* self = + new(ELeave) CWmImageConverter(); + CleanupStack::PushL( self ); + self->ConstructL( aObserver ); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------- +// CWmImageConverter::CWmImageConverter +// --------------------------------------------------------- +// +CWmImageConverter::CWmImageConverter() + : CActive( EPriorityStandard ) + { + iState = EIdle; + iBitmap = NULL; + iMask = NULL; + iObserver = NULL; + iConversionMethod = EUnrecognized; + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------- +// CWmImageConverter::ConstructL +// --------------------------------------------------------- +// +void CWmImageConverter::ConstructL( MConverterObserver* aObserver ) + { + User::LeaveIfError( iFs.Connect() ); + iFs.ShareProtected(); + iIconFileProvider = CWmIconFileProvider::NewL( iFs ); + iScaler = CBitmapScaler::NewL(); + iObserver = aObserver; + } + +// --------------------------------------------------------- +// CWmImageConverter::~CWmImageConverter +// --------------------------------------------------------- +// +CWmImageConverter::~CWmImageConverter() + { + Cancel(); + delete iImageDecoder; + iFs.Close(); + if (iBitmap) + { + delete iBitmap; + iBitmap = NULL; + } + if (iMask) + { + delete iMask; + iMask = NULL; + } + delete iScaler; + delete iIconFileProvider; + } + +// --------------------------------------------------------- +// CWmImageConverter::HandleIconStringL +// --------------------------------------------------------- +// +void CWmImageConverter::HandleIconStringL( + TInt aWidth, TInt aHeight, + const TDesC& aIconStr ) + { + if ( aIconStr.Length() ) + { + TAknsItemID skinItemId; + skinItemId.iMajor = 0; + skinItemId.iMinor = 0; + TInt bitmapId( KErrNotFound ); + TInt maskId( KErrNotFound ); + TUid appUid; + iFilename = KNullDesC; + iScaleNeeded = EFalse; + iSize.SetSize( aWidth, aHeight ); + + 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 + { + iConversionMethod = EUnrecognized; + User::Leave( KErrArgument ); + } + } + } + +// --------------------------------------------------------- +// CWmImageConverter::CreateIconFromUidL +// --------------------------------------------------------- +// +void CWmImageConverter::CreateIconFromUidL( const TUid& aUid ) + { + 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 ); + + CArrayFixFlat<TSize>* sizeArray = new (ELeave) CArrayFixFlat<TSize>(3); + CleanupStack::PushL( sizeArray ); + User::LeaveIfError( lsSession.GetAppIconSizes( aUid, *sizeArray ) ); + TInt sizeCount = sizeArray->Count(); + TSize size; + if ( sizeCount > 0 ) + { + for( TInt i=0; i < sizeArray->Count(); i++ ) + { + size = (*sizeArray)[i]; + if ( size == iSize ) + { + break; + } + } + } + CApaMaskedBitmap* maskedBmp = CApaMaskedBitmap::NewLC(); + User::LeaveIfError( lsSession.GetAppIcon( aUid, size, *maskedBmp ) ); + iBitmap = static_cast<CFbsBitmap*>( maskedBmp ); // ownership transfered + + 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); + CleanupStack::PopAndDestroy( &lsSession ); + + // scale or notify + if ( size == iSize ) + { + iObserver->NotifyCompletion( KErrNone ); + } + else + { + iScaleNeeded = ETrue; + ScaleBitmap( iSize.iWidth, iSize.iHeight ); + } + } + else if ( aUid.iUid != KNullUid.iUid ) + { + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + TInt err( KErrNone ); + TRAP( err, + { + AknsUtils::CreateAppIconLC( skin, aUid, + EAknsAppIconTypeContext, bitmap, mask ); + CleanupStack::Pop( 2 ); // for trap + } + ); + + if( KErrNone != err ) + { + // If icon is not created, try to create default application icon + AknsUtils::CreateIconLC( skin, + KAknsIIDQgnMenuUnknownLst, bitmap, mask, + AknIconUtils::AvkonIconFileName(), + EMbmAvkonQgn_menu_unknown_lst, + EMbmAvkonQgn_menu_unknown_lst_mask ); + CleanupStack::Pop( 2 ); // for trap + } + + iBitmap = bitmap; + iMask = mask; + + err = AknIconUtils::SetSize( iBitmap , iSize, EAspectRatioNotPreserved ); + if ( KErrNone == err ) + { + err = AknIconUtils::SetSize( iMask , iSize, EAspectRatioNotPreserved ); + } + + // notify observer + iObserver->NotifyCompletion( err ); + } + else + { + User::Leave( KErrArgument ); + } + } + +// --------------------------------------------------------- +// CWmImageConverter::CreateIconFromSvgL +// --------------------------------------------------------- +// +void CWmImageConverter::CreateIconFromSvgL( const TDesC& aFileName ) + { + TInt domHandle; + CFbsBitmap* dummyBitmap = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( dummyBitmap ); + + dummyBitmap->Create( TSize( 0, 0 ), EGray2 ); + TFontSpec fontSpec; + CSvgEngineInterfaceImpl* svgEngine = + CSvgEngineInterfaceImpl::NewL( dummyBitmap, NULL, fontSpec ); + CleanupStack::PushL( svgEngine ); + + svgEngine->SetBackgroundColor( 0 ); + svgEngine->SetDRMMode( EFalse ); + + User::LeaveIfError( svgEngine->PrepareDom( + aFileName, domHandle )->SystemErrorCode() ); + + iBitmap = new ( ELeave ) CFbsBitmap; + + User::LeaveIfError( iBitmap->Create( iSize, EColor16M ) ); + + iMask = new ( ELeave ) CFbsBitmap; + User::LeaveIfError( iMask->Create( iSize, EGray256 ) ); + + svgEngine->UseDom( domHandle, iBitmap, iMask ); + svgEngine->SetPreserveAspectRatio( NULL, ESvgPreserveAspectRatio_XmidYmid, + ESvgMeetOrSlice_Meet, ETrue ); + svgEngine->SetSvgDimensionToFrameBuffer( + iSize.iWidth, iSize.iHeight ); + + svgEngine->Start(); + + if ( iBitmap->SizeInPixels() != iSize || + svgEngine->ContentDimensions() != iSize ) + { + iScaleNeeded = ETrue; + ScaleBitmap( iSize.iWidth, iSize.iHeight ); + } + else + { + // notify observer + iObserver->NotifyCompletion( KErrNone ); + } + + svgEngine->UseDom( domHandle, NULL, NULL ); + svgEngine->DeleteDom( domHandle ); + + CleanupStack::PopAndDestroy( 2, dummyBitmap ); // dummyBitmap, svgEngine + } + +// --------------------------------------------------------- +// CWmImageConverter::CreateIconFromOtherL +// --------------------------------------------------------- +// +void CWmImageConverter::CreateIconFromOtherL( const TDesC& aFileName ) + { + if ( IsActive() || iState != EIdle ) + { + 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 + iState = EDecoding; + iImageDecoder->Convert( &iStatus, *iBitmap, *iMask ); + SetActive(); + } + +// --------------------------------------------------------- +// CWmImageConverter::DoCancel +// --------------------------------------------------------- +// +void CWmImageConverter::DoCancel() + { + if( iState == EDecoding ) + { + iImageDecoder->Cancel(); + if ( iObserver ) + { + iObserver->NotifyCompletion( KErrCancel ); + } + } + else if( iState == EScalingBitmap || + iState == EScalingMask ) + { + iScaler->Cancel(); + if ( iObserver ) + { + iObserver->NotifyCompletion( KErrCancel ); + } + } + else + { + // State is EIdle, do nothing + } + iState = EIdle; + 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 ) ) + { + // the maintain aspect ratio is by default set to true + iScaler->Scale( &iStatus, *iBitmap, TSize( aWidth,aHeight ), EFalse ); + iState = EScalingBitmap; + SetActive(); + } + } + +// --------------------------------------------------------- +// CWmImageConverter::ScaleMask +// --------------------------------------------------------- +// +void CWmImageConverter::ScaleMask( TInt aWidth, TInt aHeight ) + { + if ( !IsActive() && + iState == EScalingBitmap && + iMask ) + { + // the maintain aspect ratio is by default set to true + iScaler->Scale( &iStatus, *iMask, TSize(aWidth,aHeight), EFalse ); + iState = EScalingMask; + 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 +// --------------------------------------------------------- +// +TBool CWmImageConverter::EndsWith( const TDesC& aString, + const TDesC& aPattern ) + { + return ( aString.Right( aPattern.Length() ) == aPattern ); + } + +// --------------------------------------------------------------------------- +// CWmImageConverter::ResolveUid +// --------------------------------------------------------------------------- +// +TBool CWmImageConverter::ResolveUid( + const TDesC& aPath, TUid& aUid ) + { + // Syntax: uid(0x12345678) + TInt error = KErrNotFound; + TInt pos = aPath.FindF( KUid ); + if( pos == 0 ) + { + // Skip skin token + pos += KUid().Length(); + + // Initialize lexer + TLex lex( aPath.Mid( pos ) ); + + // Check left parenthesis + if ( lex.Get() == KLeftParenthesis ) + { + lex.SkipSpaceAndMark(); + lex.SkipCharacters(); + + TPtrC mtoken = lex.MarkedToken(); + pos = mtoken.FindF( KHexPrefix ); + if ( pos == 0 ) + { + TLex lex( mtoken.Mid( KHexPrefix().Length() ) ); + TUint id = 0; + error = lex.Val( id, EHex ); + aUid = TUid::Uid( (TInt)id ); + } + else + { + TInt id( 0 ); + error = lex.Val( id ); + aUid.iUid = id; + } + } + } + + return (error == KErrNone ); + } + +// --------------------------------------------------------------------------- +// CWmImageConverter::ResolveSkinId +// --------------------------------------------------------------------------- +// +TBool CWmImageConverter::ResolveSkinId( + const TDesC& aPath, TAknsItemID& aItemId ) + { + // Syntax: skin(major minor) + TInt error = KErrNotFound; + TInt pos = aPath.FindF( KSkin ); + if( pos == 0 ) + { + // Skip skin token + pos += KSkin().Length(); + + // Initialize lexer + TLex lex( aPath.Mid( pos ) ); + + lex.SkipSpaceAndMark(); + // Check left parenthesis + if ( lex.Get() == KLeftParenthesis ) + { + pos++; + TLex lex( aPath.Mid( pos ) ); + lex.SkipSpaceAndMark(); + + TPtrC mtoken = lex.MarkedToken(); + pos = mtoken.FindF( KHexPrefix ); + if ( pos == 0 ) + { + TUint majorId( 0 ); + TUint minorId( 0 ); + lex.Assign( mtoken.Mid( KHexPrefix().Length() ) ); + error = lex.Val( majorId, EHex ); + lex.SkipSpace(); + lex.SkipAndMark( KHexPrefix().Length() ); + error |= lex.Val( minorId, EHex ); + aItemId.Set( majorId, minorId ); + } + else + { + TInt majorId(0); + TInt minorId(0); + error = lex.Val( majorId ); + lex.SkipSpace(); + error |= lex.Val( minorId ); + aItemId.Set( majorId, minorId ); + } + } + } + + return (error == KErrNone ); + } + +// --------------------------------------------------------------------------- +// CWmImageConverter::ResolveMifId +// --------------------------------------------------------------------------- +// +TBool CWmImageConverter::ResolveMifId( + const TDesC& aPath, TInt& aBitmapId, + TInt& aMaskId, TDes& aFileName ) + { + // Syntax: mif(filename bimapId maskId) + TInt error = KErrNotFound; + TInt pos = aPath.FindF( KMif ); + if( pos == 0 ) + { + // Skip mif token + pos += KMif().Length(); + // Initialize lexer + TLex lex( aPath.Mid( pos ) ); + + // Check left parenthesis + if ( lex.Get() == KLeftParenthesis ) + { + lex.SkipSpaceAndMark(); + lex.SkipCharacters(); + // Resolve MifFile name + aFileName.Copy(lex.MarkedToken()); + if( aFileName.Length()!= 0) + { + // Resolve bitmap id + lex.SkipSpace(); + error = lex.Val( aBitmapId ); + + // Resolve mask id + // dont return error if it is not found, that is ok + lex.SkipSpace(); + lex.Val( aMaskId ); + } + else + { + error = KErrNotFound; + } + } + } + return (error == KErrNone ); + } + +// --------------------------------------------------------------------------- +// CWmImageConverter::ResolveSkinIdAndMifId +// --------------------------------------------------------------------------- +// +TBool CWmImageConverter::ResolveSkinIdAndMifId( + const TDesC& aPath, TAknsItemID& aItemId, + TInt& aBitmapId, TInt& aMaskId, TDes& aFileName ) + { + // Syntax: skin(major minor):mif(filename bimapId maskId) + TBool result = ResolveSkinId( aPath, aItemId ); + if ( result ) + { + TInt pos = aPath.FindF( KColon ); + if ( pos != KErrNotFound ) + { + TPtrC ptr = aPath.Mid( pos+1 ); + result = ResolveMifId( ptr, aBitmapId, aMaskId, aFileName ); + } + } + else + { + result = ResolveMifId( aPath, aBitmapId, aMaskId, aFileName ); + } + return result; + } + +// --------------------------------------------------------------------------- +// CWmImageConverter::CreateSkinOrMifIconL +// --------------------------------------------------------------------------- +// +void CWmImageConverter::CreateSkinOrMifIconL( + const TAknsItemID& aItemId, TInt aBitmapId, + TInt aMaskId, const TDesC& aFileName ) + { + iIconFileProvider->SetIconFile( 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<CAknsMaskedBitmapItemData*>( + 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<CAknsImageTableItemData*>( + 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; + // 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, *iIconFileProvider, aBitmapId, aMaskId ); + } + else + { + bitmap = AknIconUtils::CreateIconL( *iIconFileProvider, aBitmapId ); + } + } + else + { + User::Leave( KErrArgument ); + } + + iBitmap = bitmap; + iMask = mask; + + TInt err = AknIconUtils::SetSize( iBitmap , iSize, EAspectRatioNotPreserved ); + if ( KErrNone == err ) + { + err = AknIconUtils::SetSize( iMask , iSize, EAspectRatioNotPreserved ); + } + + // notify observer + iObserver->NotifyCompletion( err ); + } + +// --------------------------------------------------------------------------- +// CWmImageConverter::ConversionMethod() +// --------------------------------------------------------------------------- +// +CWmImageConverter::TConversionMethod CWmImageConverter::ConversionMethod() + { + return iConversionMethod; + } + +// End of file + diff -r 000000000000 -r f72a12da539e widgetmanager/src/wmlistbox.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/src/wmlistbox.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,678 @@ +/* +* 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: +* Implementation of the widget listbox for WidgetManager +* +*/ + +// INCLUDE FILES +#include <coemain.h> +#include <StringLoader.h> +#include <aknstyluspopupmenu.h> +#include <AknsDrawUtils.h> +#include <AknsFrameBackgroundControlContext.h> +#include <AknsListBoxBackgroundControlContext.h> + +#include <widgetmanagerview.rsg> +#include <widgetmanager.mbg> +#include "wmcommon.h" +#include "wmplugin.h" +#include "wmresourceloader.h" +#include "wmlistbox.h" +#include "wmwidgetdata.h" + +// CONSTANTS +const TInt KFrameRoundRadius = 4; +const TInt KFocusFrameWidth = 2; +const TInt KLeftMarginBig = 5; +const TInt KRightMargin = 1; +const TInt KTopTextMargin = 2; +const TInt KRightTextMargin = 3; +const TInt KRightMarginBig = 5; +const TInt KTopMargin = 1; +const TInt KTopMarginBig = 5; +const TInt KBottomMargin = 1; +const TInt KBottomMarginBig = 5; +const TInt KLogoWidth = 55; +const TInt KLogoHeight = 55; + +// MEMBER FUNCTIONS + +// --------------------------------------------------------- +// CWmListItemDrawer::NewL +// --------------------------------------------------------- +// +CWmListItemDrawer* CWmListItemDrawer::NewL( + CWmPlugin& aWmPlugin, + MTextListBoxModel* aTextListBoxModel, + const CFont* aFont, + CFormattedCellListBoxData* aFormattedCellData, + CWmListBox* aListBox ) + { + CWmListItemDrawer* self = new ( ELeave ) CWmListItemDrawer( + aWmPlugin, + aTextListBoxModel, + aFont, + aFormattedCellData, + aListBox ); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------- +// CWmListItemDrawer::CWmListItemDrawer +// --------------------------------------------------------- +// +CWmListItemDrawer::CWmListItemDrawer( + CWmPlugin& aWmPlugin, + MTextListBoxModel* aTextListBoxModel, + const CFont* aFont, + CFormattedCellListBoxData* aFormattedCellData, + CWmListBox* aListBox ) + : CFormattedCellListBoxItemDrawer( aTextListBoxModel,aFont,aFormattedCellData ), + iWmPlugin( aWmPlugin ) + { + iCellData = aFormattedCellData; + iListBox = aListBox; + iFont = aFont; + } + +// --------------------------------------------------------- +// CWmListItemDrawer::ConstructL +// --------------------------------------------------------- +// +void CWmListItemDrawer::ConstructL() + { + SetSkinEnabledL( ETrue ); + + AknsUtils::CreateIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnMenuHswidget, + iDefaultLogoImage, + iDefaultLogoImageMask, + iWmPlugin.ResourceLoader().IconFilePath(), + EMbmWidgetmanagerQgn_menu_hswidget, + EMbmWidgetmanagerQgn_menu_hswidget_mask + ); + + AknsUtils::CreateIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnIndiWmAdd, + iAddWidgetBtnImage, + iAddWidgetBtnMask, + iWmPlugin.ResourceLoader().IconFilePath(), + EMbmWidgetmanagerAdd_widget_button, + EMbmWidgetmanagerAdd_widget_button_mask + ); + } + +// --------------------------------------------------------- +// CWmListItemDrawer::~CWmListItemDrawer +// --------------------------------------------------------- +// +CWmListItemDrawer::~CWmListItemDrawer() + { + iCellData = NULL; + iListBox = NULL; + + // dispose icons + delete iDefaultLogoImage; + delete iDefaultLogoImageMask; + delete iAddWidgetBtnImage; + delete iAddWidgetBtnMask; + } + +// --------------------------------------------------------- +// CWmListItemDrawer::CalculateRectangles +// --------------------------------------------------------- +// +void CWmListItemDrawer::CalculateRectangles( const TSize& aSize ) + { + iCurrentSize = aSize; + + // LOGO RECT + TSize logoSize = iListBox->LogoSize(); + TInt val = ( aSize.iHeight - KBottomMarginBig * 4 ); + TSize newSize( val, val ); + if ( logoSize != newSize || + logoSize.iHeight >= aSize.iHeight ) + { + logoSize = newSize; + } + iRelativeLogoRect.SetRect( + TPoint( KLeftMarginBig, KTopMarginBig ), + TSize( logoSize ) ); + + // ADD BUTTON RECT + TInt btnWidth = ( aSize.iWidth / 7 ); + TInt btnHeight = ( aSize.iHeight / 3 ); + TPoint btnLocation( + ( aSize.iWidth - KRightMarginBig - btnWidth ), + ( aSize.iHeight / 2 - btnHeight / 2 ) ); + iRelativeAddButtonRect.SetRect( btnLocation, TSize( btnWidth, btnHeight ) ); + + // TEXT RECT + iRelativeTitleRect.SetRect( + KLeftMarginBig + logoSize.iWidth + KRightMarginBig, + KTopMargin, + aSize.iWidth - KRightMargin - btnWidth - KRightMargin, + aSize.iHeight - KBottomMargin - KBottomMargin ); + + // RESIZE BITMAPS + AknIconUtils::SetSize( + iDefaultLogoImage, iRelativeLogoRect.Size(), EAspectRatioNotPreserved ); + AknIconUtils::SetSize( + iDefaultLogoImageMask, iRelativeLogoRect.Size(), EAspectRatioNotPreserved ); + AknIconUtils::SetSize( + iAddWidgetBtnImage, iRelativeAddButtonRect.Size(), EAspectRatioNotPreserved ); + AknIconUtils::SetSize( + iAddWidgetBtnMask, iRelativeAddButtonRect.Size(), EAspectRatioNotPreserved ); + } + +// --------------------------------------------------------- +// CWmListItemDrawer::DrawFrame +// --------------------------------------------------------- +// +void CWmListItemDrawer::DrawFrame( + const TRect& aOutterRect, + const TRect& aInnerRect, + const TAknsItemID& aID, + const TAknsItemID& aCenterID ) const + { + CWindowGc& gc = *Gc(); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsDrawUtils::DrawFrame( skin, gc, aOutterRect, aInnerRect, + aID, aCenterID ); + } + +// --------------------------------------------------------- +// CWmListItemDrawer::DrawItemRect +// --------------------------------------------------------- +// +void CWmListItemDrawer::DrawItemRect( + const TRect& aActualItemRect ) const + { + CWindowGc& gc = *Gc(); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext *cc = AknsDrawUtils::ControlContext( iListBox ); + AknsDrawUtils::Background( skin, cc, iListBox, gc, aActualItemRect ); + } + +// --------------------------------------------------------- +// CWmListItemDrawer::DrawItem +// --------------------------------------------------------- +// +void CWmListItemDrawer::DrawItem( TInt aItemIndex, TPoint aItemRectPos, + TBool /*aItemIsSelected*/, TBool /*aItemIsCurrent*/, + TBool /*aViewIsEmphasized*/, TBool /*aViewIsDimmed*/ ) const + { + TInt w = ItemWidthInPixels( aItemIndex ); + TInt h = iListBox->ItemHeight(); + CWmWidgetData& wData = iListBox->WidgetData( aItemIndex ); + if ( iCurrentSize != TSize(w,h) ) + { + // re-calculate all rects + // note: members are manipulated here, although this method is const! + const_cast<CWmListItemDrawer&>(*this).CalculateRectangles( TSize(w,h) ); + wData.SetLogoSize( iRelativeLogoRect.Size() ); + } + + TInt selectedIndex = iListBox->CurrentItemIndex(); + TBool isInFocus = ( selectedIndex == aItemIndex ); + TBool listFocused = iListBox->IsFocused(); + TRect itemRect = TRect( aItemRectPos, TSize( w, h ) ); + TRect fullRect = TRect( aItemRectPos, + TSize( iListBox->Rect().Width(), h ) ); + + DrawItemRect( fullRect ); + + TRect logoRect( iRelativeLogoRect ); + logoRect.Move( aItemRectPos ); + TRect addBtnRect( iRelativeAddButtonRect ); + addBtnRect.Move( aItemRectPos ); + TRect textRect( iRelativeTitleRect ); + textRect.Move( aItemRectPos ); + + if ( isInFocus && listFocused ) + { + TRect innerRect( itemRect ); + const TInt highlightOffset = 5; + innerRect.Shrink( highlightOffset, highlightOffset ); + DrawFrame( itemRect, innerRect, + iListBox->PressedDown() ? + KAknsIIDQsnFrListPressed : KAknsIIDQsnFrList, + KAknsIIDQsnFrListCenter ); + } + + // Get graphics context which is used for drawing. + CWindowGc& gc = *Gc(); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + // DRAW LOGO + CFbsBitmap* bitmap = const_cast<CFbsBitmap*>(wData.LogoImage()); + CFbsBitmap* mask = const_cast<CFbsBitmap*>(wData.LogoImageMask()); + if ( !bitmap ) + { + TRect bmpRect( TPoint(0,0), TSize( iDefaultLogoImage->SizeInPixels() ) ); + gc.BitBltMasked( logoRect.iTl, iDefaultLogoImage, + bmpRect, iDefaultLogoImageMask, ETrue ); + } + else + { + TRect bmpRect( TPoint(0,0), TSize( bitmap->SizeInPixels() ) ); + if ( bitmap && mask ) + { + gc.BitBltMasked( logoRect.iTl, bitmap, + bmpRect, mask, ETrue ); + } + else + { + gc.BitBlt( logoRect.iTl, bitmap, bmpRect ); + } + } + + TRgb textColor; + TAknsQsnTextColorsIndex index = ( isInFocus && listFocused )? + EAknsCIQsnTextColorsCG10 : EAknsCIQsnTextColorsCG6; + + AknsUtils::GetCachedColor( + skin, textColor, KAknsIIDQsnTextColors, index ); + + // DRAW TEXT + gc.UseFont( iFont ); + gc.SetPenColor( textColor ); + gc.SetPenSize( TSize(2,2) ); + + gc.DrawText( wData.Name(), textRect, + ( KTopTextMargin + iFont->FontMaxHeight() ), + CGraphicsContext::ELeft, KRightTextMargin ); + + if ( wData.HsContentInfo().CanBeAdded() ) + { + // DRAW ADD BUTTON + gc.BitBltMasked( addBtnRect.iTl, iAddWidgetBtnImage, + TRect( TPoint(0,0), iAddWidgetBtnImage->SizeInPixels() ), + iAddWidgetBtnMask, ETrue ); + + // DRAW BUTTON FOCUS + if ( isInFocus && listFocused ) + { + // draw focused frame around button if item is selected + gc.SetPenStyle( CGraphicsContext::ESolidPen ); + gc.SetPenSize( TSize( KFocusFrameWidth, KFocusFrameWidth ) ); + //Draw the rounded rectangle + gc.DrawRoundRect( addBtnRect, TSize( KFrameRoundRadius, KFrameRoundRadius ) ); + gc.SetBrushStyle( CGraphicsContext::ENullBrush ); + gc.SetPenStyle( CGraphicsContext::ENullPen ); + } + } + + gc.SetPenSize(TSize(1,1)); + + // DRAW DESCRIPTION TEXT + HBufC* buf = wData.Description().Alloc(); + if ( buf ) + { + TPtr bufPtr = buf->Des(); + bufPtr.Copy( wData.Description() ); + TextUtils::ClipToFit( bufPtr, *iFont, textRect.Width() ); + gc.DrawText( bufPtr, textRect, + ( iFont->HeightInPixels() + textRect.Height()/2 ), + CGraphicsContext::ELeft, KRightTextMargin ); + delete buf; + } + + gc.DiscardFont(); + } + +// --------------------------------------------------------- +// CWmListItemDrawer::DefaultLogoImage() +// --------------------------------------------------------- +// +const CFbsBitmap* CWmListItemDrawer::DefaultLogoImage() + { + return iDefaultLogoImage; + } + +// --------------------------------------------------------- +// CWmListItemDrawer::DefaultLogoMask() +// --------------------------------------------------------- +// +const CFbsBitmap* CWmListItemDrawer::DefaultLogoMask() + { + return iDefaultLogoImageMask; + } + +// --------------------------------------------------------- +// CWmListBox::NewL +// --------------------------------------------------------- +// +CWmListBox* CWmListBox::NewL( + CWmPlugin& aWmPlugin, + const TRect& aRect, + const CCoeControl* aParent, + TInt aFlags ) + { + CWmListBox* self = new ( ELeave ) CWmListBox( aWmPlugin); + CleanupStack::PushL( self ); + self->ConstructL( aRect, aParent, aFlags ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// CWmListBox::CWmListBox +// --------------------------------------------------------- +// +CWmListBox::CWmListBox( CWmPlugin& aWmPlugin ): + CAknDouble2LargeStyleListBox(), + iWmPlugin( aWmPlugin ) + { + iFindPaneIsVisible = EFalse; + iPressedDown = EFalse; + } + +// --------------------------------------------------------- +// CWmListBox::~CWmListBox +// --------------------------------------------------------- +// +CWmListBox::~CWmListBox() + { + iWidgetDatas.ResetAndDestroy(); + } + +// --------------------------------------------------------- +// CWmListBox::ConstructL +// --------------------------------------------------------- +// +void CWmListBox::ConstructL( + const TRect& aRect, + const CCoeControl* aParent, + TInt aFlags ) + { + CEikFormattedCellListBox::ConstructL( aParent, aFlags ); + SetContainerWindowL( *aParent ); + + // set model point to the widgets array + Model()->SetItemTextArray( &iWidgetDatas ); + Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + SetRect( aRect ); + } + +// --------------------------------------------------------- +// CWmListBox::WidgetData +// --------------------------------------------------------- +// +CWmWidgetData* CWmListBox::WidgetData() + { + TInt index = CurrentListBoxItemIndex(); + return (index>=0 ? iWidgetDatas[index] : NULL); + } + +// --------------------------------------------------------- +// CWmListBox::WidgetData +// --------------------------------------------------------- +// +CWmWidgetData& CWmListBox::WidgetData( TInt aItemIndex ) + { + return *iWidgetDatas[ RealIndex( aItemIndex ) ]; + } + +// --------------------------------------------------------- +// CWmListBox::AddWidgetDataL +// --------------------------------------------------------- +// +void CWmListBox::AddWidgetDataL( CWmWidgetData* aWidgetData ) + { + aWidgetData->SetObserver( this ); + aWidgetData->SetLogoSize( LogoSize() ); + iWidgetDatas.InsertInOrderAllowRepeatsL( aWidgetData, + SortOrder(EStoredOrder) ); + } + +// --------------------------------------------------------- +// CWmListBox::RemoveWidgetData +// --------------------------------------------------------- +// +void CWmListBox::RemoveWidgetData( TInt aItemIndex ) + { + TInt realIndex = RealIndex( aItemIndex ); + TBool current = ( aItemIndex == CurrentItemIndex() ); + // remove widget data + CWmWidgetData* data = iWidgetDatas[realIndex]; + iWidgetDatas.Remove( realIndex ); + delete data; + + // reorganise + TRAP_IGNORE( + AknListBoxUtils::HandleItemRemovalAndPositionHighlightL( + this, realIndex, current ) ); + } + +// --------------------------------------------------------- +// CWmListBox::RedrawItem +// --------------------------------------------------------- +// +void CWmListBox::RedrawItem( TInt aItemIndex ) + { + View()->DrawItem( aItemIndex ); + } + +// --------------------------------------------------------- +// CWmListBox::SetSortOrderL +// --------------------------------------------------------- +// +void CWmListBox::SetSortOrderL( TSortOrder aOrder ) + { + // now sort the existing data + iWidgetDatas.Sort( SortOrder( aOrder ) ); + DrawNow(); + } + +// --------------------------------------------------------- +// CWmListBox::CreateItemDrawerL +// --------------------------------------------------------- +// +void CWmListBox::CreateItemDrawerL() + { + CFormattedCellListBoxData* cellData = CFormattedCellListBoxData::NewL(); + CleanupStack::PushL( cellData ); + iItemDrawer = CWmListItemDrawer::NewL( + iWmPlugin, + Model(), + iEikonEnv->DenseFont(), + cellData, + this ); + CleanupStack::Pop(); // cellData + } + +// --------------------------------------------------------- +// CWmListBox::HandleLayoutChanged +// --------------------------------------------------------- +// +void CWmListBox::HandleLayoutChanged() + { + TSize ls = LogoSize(); + for ( TInt i=0; i<iWidgetDatas.Count(); i++) + { + iWidgetDatas[i]->ReCreateLogo( ls ); + } + } + +// --------------------------------------------------------- +// CWmListBox::HandleWidgetDataChanged +// --------------------------------------------------------- +// +void CWmListBox::HandleWidgetDataChanged( CWmWidgetData* aWidgetData ) + { + if ( !iFindPaneIsVisible ) + { + // spontaneous change in the model. Cause table to redraw + TInt index = iWidgetDatas.Find( aWidgetData ); + if ( index >= 0 ) + { + // redraw item. + RedrawItem( RealIndex( index ) ); + } + } + } + +// --------------------------------------------------------- +// CWmListBox::SortOrder +// --------------------------------------------------------- +// +TLinearOrder<CWmWidgetData> CWmListBox::SortOrder( TSortOrder aOrder ) + { + if ( aOrder == EStoredOrder ) + { + return TLinearOrder<CWmWidgetData>( + CWmWidgetData::CompareByPersistentWidgetOrder ); + } + else + { + return TLinearOrder<CWmWidgetData>( + CWmWidgetData::CompareByName ); + } + } + +// --------------------------------------------------------- +// CWmListBox::CurrentListBoxItemIndex +// --------------------------------------------------------- +// +TInt CWmListBox::CurrentListBoxItemIndex() + { + TInt index( KErrNotFound ); + if ( Model()->NumberOfItems() > 0 ) + { + index = CurrentItemIndex(); + } + return RealIndex( index ); + } + +// --------------------------------------------------------- +// CWmListBox::RealIndex +// --------------------------------------------------------- +// +TInt CWmListBox::RealIndex( TInt aIndex ) + { + TInt realIndex = aIndex; + if ( iFindPaneIsVisible && aIndex >= 0 ) + { + realIndex = static_cast<CAknFilteredTextListBoxModel*>(Model())->Filter() + ->FilteredItemIndex( aIndex ); + } + return realIndex; + } + +// --------------------------------------------------------- +// CWmListBox::SizeChanged +// --------------------------------------------------------- +// +void CWmListBox::SizeChanged() + { + CAknsListBoxBackgroundControlContext* context = + static_cast<CAknsListBoxBackgroundControlContext*>( + ItemDrawer()->FormattedCellData()-> + SkinBackgroundContext() ); + if ( context ) context->SetRect( Rect() ); + CAknDouble2LargeStyleListBox::SizeChanged(); + } + +// --------------------------------------------------------- +// CWmListBox::Draw +// --------------------------------------------------------- +// +void CWmListBox::Draw( const TRect& aRect ) const + { + CWindowGc& gc = SystemGc(); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + AknsDrawUtils::Background( skin, cc, this, gc, Rect() ); + CAknDouble2LargeStyleListBox::Draw( aRect ); + } + +// --------------------------------------------------------- +// CWmListBox::HandlePointerEventL +// --------------------------------------------------------- +// +void CWmListBox::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + // Check if pointer is down ( needed for drawing correct hightlight frame ) + if ( Rect().Contains( aPointerEvent.iPosition ) ) + { + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + iPressedDown = ETrue; + RedrawItem( CurrentListBoxItemIndex() ); + } + else if( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + iPressedDown = EFalse; + RedrawItem( CurrentListBoxItemIndex() ); + } + } + + CAknDouble2LargeStyleListBox::HandlePointerEventL( aPointerEvent ); + } + +// --------------------------------------------------------- +// CWmListBox::LogoSize +// --------------------------------------------------------- +// +TSize CWmListBox::LogoSize() + { + TSize size( KLogoWidth,KLogoHeight ); + TInt val = ( ItemHeight() - KBottomMarginBig * 4 ); + if ( val > 0 ) + { + size.SetSize( val, val ); + } + return size; + } + +// --------------------------------------------------------- +// CWmListBox::DefaultLogo +// --------------------------------------------------------- +// +const CFbsBitmap* CWmListBox::DefaultLogo() + { + CWmListItemDrawer* itemDrawer = + static_cast <CWmListItemDrawer*>( iItemDrawer ); + if ( itemDrawer ) + { + return itemDrawer->DefaultLogoImage(); + } + return NULL; + } + +// --------------------------------------------------------- +// CWmListBox::DefaultMask +// --------------------------------------------------------- +// +const CFbsBitmap* CWmListBox::DefaultMask() + { + CWmListItemDrawer* itemDrawer = + static_cast <CWmListItemDrawer*>( iItemDrawer ); + if ( itemDrawer ) + { + return itemDrawer->DefaultLogoMask(); + } + return NULL; + } + +// End of File + diff -r 000000000000 -r f72a12da539e widgetmanager/src/wmmaincontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/src/wmmaincontainer.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,1323 @@ +/* +* 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: +* Implementation of the container control for WidgetManager application. +* +*/ + +// INCLUDE FILES +#include <aknViewAppUi.h> +#include <eikappui.h> +#include <widgetmanagerview.rsg> +#include <coemain.h> +#include <eikenv.h> +#include <barsread.h> +#include <AknUtils.h> +#include <barsread.h> +#include <StringLoader.h> +#include <eikenv.h> +#include <AknIconArray.h> +#include <aknstyluspopupmenu.h> +#include <avkon.loc> +#include <aknlayout.cdl.h> +#include <layoutmetadata.cdl.h> +#include <aknlayoutscalable_avkon.cdl.h> +#include <AknsSkinInstance.h> +#include <apgicnfl.h> +#include <AknIconUtils.h> +#include <AknsDrawUtils.h> +#include <aknenv.h> +#include <aknlists.h> +#include <eikclbd.h> +#include <aknsfld.h> +#include <AknLayout.lag> +#include <aknlayoutscalable_avkon.cdl.h> +#include <AknsBasicBackgroundControlContext.h> +#include <apgcli.h> +#include <widgetmanager.mbg> +#include <avkon.rsg> +#include <coecobs.h> +#include <coecntrl.h> +#include <SWInstApi.h> //installer +#include <WidgetRegistryClient.h> // widgetreqistry +#include <aknbutton.h> // CAknButton +#include <SchemeHandler.h> // for starting the OVI client +#include <featmgr.h> // FeatureManager +#include <hlplch.h> // HlpLauncher +#include <csxhelp/hmsc.hlp.hrh> +#include <aisystemuids.hrh> + +#include "wmcommon.h" +#include "wmplugin.h" +#include "wmmaincontainer.h" +#include "wmmaincontainerview.h" +#include "wmresourceloader.h" +#include "widgetmanager.hrh" +#include "wmlistbox.h" +#include "wmpersistentwidgetorder.h" +#include "wmdetailsdlg.h" +#include "wmwidgetloaderao.h" + +// CONSTANTS +const TInt KTextLimit = 40; // Text-limit for find-field +const TInt KMinWidgets = 1; // minimum number of widgets to show findpane +_LIT8( KWrtMime, "application/x-nokia-widget"); + +// --------------------------------------------------------- +// CWmMainContainer::CWmMainContainer() +// --------------------------------------------------------- +// +CWmMainContainer::CWmMainContainer( CWmPlugin& aWmPlugin ) + :iWmPlugin( aWmPlugin ) + { + iWidgetsList = NULL; + iFindbox = NULL; + iFindPaneIsVisible = EFalse; + iBgContext = NULL; + iFocusMode = ENowhere; + iClosingDown = EFalse; + } + +// --------------------------------------------------------- +// CWmMainContainer::~CWmMainContainer() +// --------------------------------------------------------- +// +CWmMainContainer::~CWmMainContainer() + { + RemoveCtrlsFromStack(); + Components().ResetAndDestroy(); + delete iWidgetLoader; + iWidgetsList = NULL; + iOviPortal = NULL; + iFindbox = NULL; + delete iBgContext; + } + +// --------------------------------------------------------- +// CWmMainContainer::NewL +// --------------------------------------------------------- +// +CWmMainContainer* CWmMainContainer::NewL( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver, + CWmPlugin& aWmPlugin ) + { + CWmMainContainer* self = CWmMainContainer::NewLC( + aRect, + aParent, + aCommandObserver, + aWmPlugin ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// CWmMainContainer::NewLC +// --------------------------------------------------------- +// +CWmMainContainer* CWmMainContainer::NewLC( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver, + CWmPlugin& aWmPlugin ) + { + CWmMainContainer* self = new ( ELeave ) CWmMainContainer( aWmPlugin ); + CleanupStack::PushL( self ); + self->ConstructL( aRect, aParent, aCommandObserver ); + return self; + } + +// --------------------------------------------------------- +// ScreenRect +// rectangle representing the screen +// --------------------------------------------------------- +// +TRect ScreenRect() + { + TRect screen; + CCoeEnv* env = CCoeEnv::Static(); + if ( env ) + { + CWsScreenDevice* screenDevice = env->ScreenDevice(); + if ( screenDevice ) + screen.SetRect( TPoint(0,0), screenDevice->SizeInPixels() ); + } + return screen; + } + +// --------------------------------------------------------- +// CWmMainContainer::ConstructL +// --------------------------------------------------------- +// +void CWmMainContainer::ConstructL( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* /*aCommandObserver*/ ) + { + // Initialize control array + InitComponentArrayL(); + Components().SetControlsOwnedExternally( ETrue ); + + // create the UI + if ( aParent == NULL ) + { + CreateWindowL(); + iParent = this; + } + else + { + SetContainerWindowL( *aParent ); + iParent = aParent; + } + + // background context + iBgContext = CAknsBasicBackgroundControlContext::NewL( + KAknsIIDQsnBgScreen, ScreenRect() , ETrue); + + // set up controls + InitializeControlsL( aRect ); + + // set size and activate + SetRect( aRect ); + if ( !aParent ) + { + ActivateL(); + } + + } + +// --------------------------------------------------------- +// CWmMainContainer::SizeChanged +// --------------------------------------------------------- +// +void CWmMainContainer::SizeChanged() + { + CCoeControl::SizeChanged(); + iBgContext->SetRect( ScreenRect() ); + TRAP_IGNORE( LayoutControlsL() ); + } + +// --------------------------------------------------------- +// CWmMainContainer::LayoutControlsL +// --------------------------------------------------------- +// +void CWmMainContainer::LayoutControlsL() + { + TRect rect = Rect(); + TBool landscape = ( rect.Width() > rect.Height() ); + + // calculate layout (different in landscape and portrait) + TRect oviButtonRect; + TRect widgetsListRect; + if ( landscape ) + { + iLayout = ELandscape; + const TInt KOffset = 2; + TInt oviButtonWidth = rect.Width() / 6; + widgetsListRect.SetRect( + TPoint( 0, 0 ), + TPoint( rect.Width() - oviButtonWidth - KOffset, rect.Height() ) ); + oviButtonRect.SetRect( + TPoint( rect.Width() - oviButtonWidth, KOffset ), + TPoint( rect.Width() - KOffset, rect.Height() - KOffset ) ); + } + else + { + iLayout = EPortrait; + const TInt KOffset = 2; + TInt oviButtonHeight = rect.Height() / 8; + oviButtonRect.SetRect( + TPoint( KOffset, KOffset ), + TPoint( rect.Width() - KOffset, oviButtonHeight ) ); + widgetsListRect.SetRect( + TPoint( 0, oviButtonHeight + KOffset ), + TPoint( rect.Width(), rect.Height() ) ); + } + + // Apply layout to child controls + iOviPortal->SetRect( oviButtonRect ); + iOviPortal->SetHighlightRect( oviButtonRect ); + iWidgetsList->SetRect( widgetsListRect ); + if( iFindbox && iFindPaneIsVisible ) + { + // resizes listbox/searchfield + HandleFindSizeChanged(); + } + + // change OVI portal button style + if ( landscape ) + { + // vertical style button + iOviPortal->State()->SetTextL( KNullDesC() ); + TInt iconDimension = oviButtonRect.Width() * 2 / 3; + iOviPortal->SetIconSize( TSize( iconDimension, iconDimension ) ); + iOviPortal->SetTextVerticalAlignment( + CAknButton::ECenter ); + iOviPortal->SetTextAndIconAlignment( + CAknButton::EIconOverText ); + } + else + { + // horizontal style button + HBufC* oviText = StringLoader::LoadLC( R_QTN_WM_GO_TO_OVI_STORE ); + iOviPortal->State()->SetTextL( *oviText ); + CleanupStack::PopAndDestroy( oviText ); + TInt iconDimension = oviButtonRect.Height() * 2 / 3; + iOviPortal->SetIconSize( TSize( iconDimension, iconDimension ) ); + iOviPortal->SetTextHorizontalAlignment( + CGraphicsContext::ECenter ); + iOviPortal->SetTextAndIconAlignment( + CAknButton::EIconBeforeText ); + } + + DrawDeferred(); + } + +// --------------------------------------------------------- +// CWmMainContainer::OfferKeyEventL +// --------------------------------------------------------- +// +TKeyResponse CWmMainContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + TKeyResponse keyResponse( EKeyWasNotConsumed ); + + if ( iFindbox ) + { + // open search field with alpha digit numbers + if ( aType == EEventKeyDown && !iFindPaneIsVisible && + aKeyEvent.iScanCode < EStdKeyF1 && + TChar(aKeyEvent.iScanCode).IsAlphaDigit() ) + { + ActivateFindPaneL(); + + if ( iFindPaneIsVisible ) + { + return EKeyWasConsumed; + } + } + + if ( iFindPaneIsVisible ) + { + // deactive the FindPane when Back has been pressed + if ( aType == EEventKeyDown && + aKeyEvent.iScanCode == EStdKeyBackspace ) + { + TBuf<KTextLimit> searchText; + iFindbox->GetSearchText( searchText ); + if ( searchText == KNullDesC ) + { + DeactivateFindPaneL(); + return EKeyWasConsumed; + } + } + + // Cancel-selected need to unfocus findbox + // to receive event in ProcessCommand + if ( aType == EEventKeyDown + && aKeyEvent.iScanCode == EStdKeyDevice1 ) + { + iFindbox->SetFocus( EFalse ); + UpdateFocusMode(); + return EKeyWasConsumed; + } + + if ( aKeyEvent.iScanCode == EStdKeyNo || + aKeyEvent.iCode == EKeyNo ) + { + DeactivateFindPaneL(); + return EKeyWasConsumed; + } + + // find items with all event codes (that's the reason why there is EEventKey instead of aType) + TBool needsRefresh( EFalse ); + keyResponse = AknFind::HandleFindOfferKeyEventL( + aKeyEvent, EEventKey, this, + iWidgetsList, iFindbox, ETrue, needsRefresh ); + if ( needsRefresh ) + { + DrawNow(); + } + } + } + + // check special cases for movement between controls + if ( keyResponse == EKeyWasNotConsumed && !iFindPaneIsVisible ) + { + keyResponse = MoveFocusByKeys( aKeyEvent, aType ); + } + + // pass key event except backpace or delete key event to widgets list if focused + if ( keyResponse == EKeyWasNotConsumed && iWidgetsList->IsFocused() ) + { + if ( (aType == EEventKey) && (aKeyEvent.iCode == EKeyBackspace || aKeyEvent.iCode == EKeyDelete)) + { + if( CanDoUninstall() ) + { + UninstallWidgetL(); + } + else + { + CWmWidgetData* data = iWidgetsList->WidgetData(); + if( data != NULL ) + iWmPlugin.ResourceLoader().InfoPopupL( + R_QTN_WM_UNINST_NOT_ALLOWED, data->Name() ); + } + } + else + { + //passing to listbox handler + keyResponse = iWidgetsList->OfferKeyEventL( + aKeyEvent, aType ); + } + } + + // pass key event to OVI portal if focused + if ( keyResponse == EKeyWasNotConsumed && iOviPortal->IsFocused() ) + { + keyResponse = iOviPortal->OfferKeyEventL( + aKeyEvent, aType ); + } + + if ( keyResponse == EKeyWasConsumed ) + DrawDeferred(); + + // Do not let UI framework forward the keys to child controls as + // we have already done that. + return EKeyWasConsumed; + } + + +// --------------------------------------------------------- +// CWmMainContainer::MoveFocusByKeys +// --------------------------------------------------------- +// +TKeyResponse CWmMainContainer::MoveFocusByKeys( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + TKeyResponse keyResponse( EKeyWasNotConsumed ); + + if ( iWidgetsList->IsFocused() ) + { + // ------------------------------------ + // focus is in the WIDGETS LIST + // ------------------------------------ + if ( iLayout == EPortrait && + aKeyEvent.iScanCode == EStdKeyUpArrow && + iWidgetsList->CurrentItemIndex() == 0 ) + { + // widget list top -> up -> ovi button (portrait) + if ( aType == EEventKey ) + SetFocusToOviButton(); + keyResponse = EKeyWasConsumed; + } + else if ( iLayout == EPortrait && + aKeyEvent.iScanCode == EStdKeyDownArrow && + iWidgetsList->CurrentItemIndex() == + iWidgetsList->Model()->NumberOfItems() - 1 ) + { + // widget list bottom -> down -> ovi button (portrait) + if ( aType == EEventKey ) + SetFocusToOviButton(); + keyResponse = EKeyWasConsumed; + } + else if ( iLayout == ELandscape && + aKeyEvent.iScanCode == EStdKeyRightArrow ) + { + // widget list -> right -> ovi button (landscape) + if ( aType == EEventKey ) + SetFocusToOviButton(); + keyResponse = EKeyWasConsumed; + } + else if ( iLayout == ELandscapeMirrored && + aKeyEvent.iScanCode == EStdKeyLeftArrow ) + { + // widget list -> left -> ovi button (landscape mirrored) + if ( aType == EEventKey ) + SetFocusToOviButton(); + keyResponse = EKeyWasConsumed; + } + } + else if ( iOviPortal->IsFocused() ) + { + // ------------------------------------ + // focus is in the OVI PORTAL BUTTON + // ------------------------------------ + if ( iLayout == EPortrait && + aKeyEvent.iScanCode == EStdKeyDownArrow ) + { + // ovi button -> down -> widget list top (portrait) + if ( aType == EEventKey ) + SetFocusToWidgetList( 0 ); + keyResponse = EKeyWasConsumed; + } + else if ( iLayout == EPortrait && + aKeyEvent.iScanCode == EStdKeyUpArrow ) + { + // obi button -> up -> widget list bottom (portrait) + if ( aType == EEventKey ) + SetFocusToWidgetList( iWidgetsList->Model()->NumberOfItems()-1 ); + keyResponse = EKeyWasConsumed; + } + else if ( iLayout == ELandscape && + aKeyEvent.iScanCode == EStdKeyLeftArrow ) + { + // ovi button -> left -> widget list (landscape) + if ( aType == EEventKey ) + SetFocusToWidgetList(); + keyResponse = EKeyWasConsumed; + } + else if ( iLayout == ELandscapeMirrored && + aKeyEvent.iScanCode == EStdKeyRightArrow ) + { + // ovi button -> right -> widget list (landscape mirrored) + if ( aType == EEventKey ) + SetFocusToWidgetList(); + keyResponse = EKeyWasConsumed; + } + } + else + { + // ------------------------------------ + // focus is NOWHERE + // ------------------------------------ + if ( aKeyEvent.iScanCode == EStdKeyUpArrow || + aKeyEvent.iScanCode == EStdKeyDownArrow || + aKeyEvent.iScanCode == EStdKeyLeftArrow || + aKeyEvent.iScanCode == EStdKeyRightArrow ) + { + // no focus -> key hit -> focus list + if ( aType == EEventKey ) + SetFocusToWidgetList(); + keyResponse = EKeyWasConsumed; + } + } + + return keyResponse; + } + +// --------------------------------------------------------- +// CWmMainContainer::SetFocusToOviButton +// --------------------------------------------------------- +// +void CWmMainContainer::SetFocusToOviButton() + { + iWidgetsList->SetFocus(EFalse); + iOviPortal->SetFocus(ETrue); + DrawDeferred(); + UpdateFocusMode(); + } + +// --------------------------------------------------------- +// CWmMainContainer::SetFocusToWidgetList +// --------------------------------------------------------- +// +void CWmMainContainer::SetFocusToWidgetList( TInt aIndex ) + { + iOviPortal->SetFocus(EFalse); + iWidgetsList->SetFocus(ETrue); + if ( aIndex >= 0 && aIndex < iWidgetsList->Model()->NumberOfItems() ) + { + iWidgetsList->SetCurrentItemIndex( aIndex ); + } + DrawDeferred(); + UpdateFocusMode(); + } + +// --------------------------------------------------------- +// CWmMainContainer::UpdateFocusMode +// --------------------------------------------------------- +// +void CWmMainContainer::UpdateFocusMode() + { + if ( iOviPortal->IsFocused() ) + { + // OVI BUTTON is focused + iFocusMode = EOvi; + } + else if( ( iFindPaneIsVisible ) && + ( iFindbox->IsFocused() || iWidgetsList->IsFocused() ) ) + { + // FIND MODE + iFocusMode = EFind; + } + else if ( iWidgetsList->IsFocused() ) + { + // WIDGETS LIST is focused + iFocusMode = EList; + } + else + { + // NO focus + iFocusMode = ENowhere; + } + } + +// --------------------------------------------------------- +// CWmMainContainer::FindChildControlByPoint +// --------------------------------------------------------- +// +CCoeControl* CWmMainContainer::FindChildControlByPoint( + const TPoint& aPoint ) + { + CCoeControl* theControl = NULL; + CCoeControlArray::TCursor cursor = Components().Begin(); + CCoeControl* c; + while((c=cursor.Control<CCoeControl>()) != NULL ) + { + if(c->IsVisible()) + { + if ( c->Rect().Contains( aPoint ) ) theControl = c; + } + cursor.Next(); + } + return theControl; + } + +// --------------------------------------------------------- +// CWmMainContainer::HandlePointerEventL +// --------------------------------------------------------- +// +void CWmMainContainer::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + if ( !iClosingDown ) + { + + if (aPointerEvent.iType == TPointerEvent::EButton1Down) + { + // Check if user clicked a child control + CCoeControl* control = FindChildControlByPoint( aPointerEvent.iPosition ); + if ( control && !control->IsFocused() ) + { + // Set focus to the control that was clicked + control->SetFocus( ETrue ); + // remove focus from ALL other child controls. + CCoeControlArray::TCursor cursor = Components().Begin(); + CCoeControl* c; + while ((c=cursor.Control<CCoeControl>()) != NULL ) + { + if ( c != control && c->IsFocused() ) c->SetFocus( EFalse ); + cursor.Next(); + } + // update focus mode accordingly + UpdateFocusMode(); + // repaint + DrawDeferred(); + } + } + + CCoeControl::HandlePointerEventL( aPointerEvent ); + } + } + +// --------------------------------------------------------- +// CWmMainContainer::InitializeControlsL +// --------------------------------------------------------- +// +void CWmMainContainer::InitializeControlsL( const TRect& /*aRect*/ ) + { + // Create OVI STORE button + iOviPortal = CAknButton::NewL(); + iWmPlugin.ResourceLoader().LoadButtonL( *iOviPortal, + R_WM_PORTAL_BUTTON ); + iOviPortal->SetMopParent( this ); + iOviPortal->SetFocusing( ETrue ); + AddControlL( iOviPortal, EOviPortal ); + iOviPortal->SetContainerWindowL( *this ); + // ToDo : replace 3-10 IID with real one when available (wk46) + iOviPortal->SetFrameAndCenterIds( + KAknsIIDQgnHomeWmButton, + KAknsIIDQgnHomeWmButtonCenter, + KAknsIIDDefault, + KAknsIIDDefault, + KAknsIIDDefault, + KAknsIIDDefault, + KAknsIIDDefault, + KAknsIIDDefault, + KAknsIIDDefault, + KAknsIIDDefault ); + iOviPortal->ActivateL(); + iOviPortal->SetObserver( this ); + + // Create widget list box + iWidgetsList = CWmListBox::NewL( + iWmPlugin, + TRect(), + iParent ); + iWidgetsList->SetMopParent( this ); + AddControlL( iWidgetsList, EWidgetsList ); + iWidgetsList->ActivateL(); + iWidgetsList->SetListBoxObserver( this ); + + // Create scroll bar. + iWidgetsList->CreateScrollBarFrameL( ETrue ); + iWidgetsList->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); + iWidgetsList->UpdateScrollBarsL(); + + // search field + iFindbox = CAknSearchField::NewL( *this, + CAknSearchField::EAdaptiveSearch, + 0, KTextLimit ); + AddControlL( iFindbox, EFindBox ); + + UpdateFocusMode(); + StartLoadingWidgetsL(); + } + +// --------------------------------------------------------- +// CWmMainContainer::HandleWidgetListChanged +// --------------------------------------------------------- +// +void CWmMainContainer::HandleWidgetListChanged() + { + TRAP_IGNORE( StartLoadingWidgetsL(); ); + } + +// --------------------------------------------------------- +// CWmMainContainer::StartLoadingWidgetsL +// --------------------------------------------------------- +// +void CWmMainContainer::StartLoadingWidgetsL() + { + if ( !iWidgetLoader ) + { + // create the widget loader AO + iWidgetLoader = CWmWidgetLoaderAo::NewL( iWmPlugin, *iWidgetsList ); + } + iWidgetLoader->StartLoading(); + } + +// --------------------------------------------------------- +// CWmMainContainer::HandleResourceChange +// --------------------------------------------------------- +// +void CWmMainContainer::HandleResourceChange( TInt aType ) + { + CCoeControl::HandleResourceChange( aType ); + + if ( KEikDynamicLayoutVariantSwitch == aType ) + { + TRect rect; + AknLayoutUtils::LayoutMetricsRect( + AknLayoutUtils::EMainPane, rect ); + SetRect( rect ); + + // notify widgetlist + iWidgetsList->HandleLayoutChanged(); + } + } + + +// --------------------------------------------------------- +// CWmMainContainer::MopSupplyObject +// --------------------------------------------------------- +// +TTypeUid::Ptr CWmMainContainer::MopSupplyObject( TTypeUid aId ) + { + if ( aId.iUid == MAknsControlContext::ETypeId ) + { + return MAknsControlContext::SupplyMopObject( + aId, iBgContext ); + } + return CCoeControl::MopSupplyObject( aId ); + } + +// --------------------------------------------------------- +// CWmMainContainer::Draw +// --------------------------------------------------------- +// +void CWmMainContainer::Draw( const TRect& /*aRect*/ ) const + { + CWindowGc& gc = SystemGc(); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + AknsDrawUtils::Background( skin, cc, this, gc, Rect() ); + } + +// --------------------------------------------------------- +// CWmMainContainer::AddControlL +// --------------------------------------------------------- +// +void CWmMainContainer::AddControlL( + CCoeControl* aControl, + TInt aControlId ) + { + Components().AppendLC( aControl, aControlId ); // Ownership transfered + CleanupStack::Pop(aControl); + iWmPlugin.ViewAppUi().AddToStackL( aControl ); + aControl->MakeVisible( ETrue ); + } + +// --------------------------------------------------------- +// CWmMainContainer::PortalSelected +// --------------------------------------------------------- +// +TBool CWmMainContainer::PortalSelected() + { + return ( iFocusMode == EOvi ); + } + +// --------------------------------------------------------- +// CWmMainContainer::WidgetSelected +// --------------------------------------------------------- +// +TBool CWmMainContainer::WidgetSelected() + { + return ( iFocusMode == EList ) || ( iFocusMode == EFind ); + } + +// --------------------------------------------------------- +// CWmMainContainer::CanDoAdd +// --------------------------------------------------------- +// +TBool CWmMainContainer::CanDoAdd() + { + TBool retVal = EFalse; + CWmWidgetData* data = iWidgetsList->WidgetData(); + if ( WidgetSelected() && data ) + { + if ( data->HsContentInfo().CanBeAdded() ) + retVal = ETrue; + } + return retVal; + } + +// --------------------------------------------------------- +// CWmMainContainer::CanDoUninstall +// --------------------------------------------------------- +// +TBool CWmMainContainer::CanDoUninstall() + { + TBool retVal( EFalse ); + CWmWidgetData* data = iWidgetsList->WidgetData(); + if ( WidgetSelected() && data ) + { + if ( data->WidgetType() == CWmWidgetData::ECps && + data->PublisherUid() != KNullUid ) + { + retVal = ETrue; + } + } + return retVal; + } + +// --------------------------------------------------------- +// CWmMainContainer::CanDoLaunch +// --------------------------------------------------------- +// +TBool CWmMainContainer::CanDoLaunch() + { + TBool retVal(EFalse); + if ( WidgetSelected() ) + { + CWmWidgetData* data = iWidgetsList->WidgetData(); + if ( data->WidgetType() == CWmWidgetData::ECps && + data->PublisherUid() != KNullUid ) + { + retVal = ETrue; + } + } + return retVal; + } + +// --------------------------------------------------------- +// CWmMainContainer::CanDoFind +// --------------------------------------------------------- +// +TBool CWmMainContainer::CanDoFind() + { + TBool canDo( !iFindPaneIsVisible ); + if ( canDo ) + { + canDo = ( iFocusMode == EList || iFocusMode == ENowhere ); + } + return canDo; + } + +// --------------------------------------------------------- +// CWmMainContainer::CanDoSort +// --------------------------------------------------------- +// +TBool CWmMainContainer::CanDoSort() + { + return !iFindPaneIsVisible; + } + +// --------------------------------------------------------- +// CWmMainContainer::CanDoDetails +// --------------------------------------------------------- +// +TBool CWmMainContainer::CanDoDetails() + { + return WidgetSelected(); + } + +// --------------------------------------------------------- +// CWmMainContainer::CanDoHelp +// --------------------------------------------------------- +// +TBool CWmMainContainer::CanDoHelp() + { + return FeatureManager::FeatureSupported( KFeatureIdHelp ); + } + +// --------------------------------------------------------------------------- +// CWmMainContainer::AddWidgetToHomeScreenL +// --------------------------------------------------------------------------- +// +void CWmMainContainer::AddWidgetToHomeScreenL() + { + CWmWidgetData* data = iWidgetsList->WidgetData(); + if ( data ) + { + if ( iFindbox && iFindPaneIsVisible ) + { + DeactivateFindPaneL(); + } + + SetExitStatus( iWmPlugin.ContentController().AddWidgetL( + data->HsContentInfo() ) ); + + iWmPlugin.Deactivate(); + } + + } + +// --------------------------------------------------------------------------- +// CWmMainContainer::SetExitStatus +// --------------------------------------------------------------------------- +// +void CWmMainContainer::SetExitStatus( TInt aExitStatus ) + { + iExitStatus = aExitStatus; + } + +// --------------------------------------------------------------------------- +// CWmMainContainer::ExitStatus +// --------------------------------------------------------------------------- +// +TInt CWmMainContainer::ExitStatus( ) + { + return iExitStatus; + } + +// --------------------------------------------------------------------------- +// CWmMainContainer::LaunchWidgetL +// --------------------------------------------------------------------------- +// +void CWmMainContainer::LaunchWidgetL() + { + if ( CanDoLaunch() ) + { + CWmWidgetData* data = iWidgetsList->WidgetData(); + + HBufC* param = KNullDesC().AllocLC(); // launch params + + RApaLsSession appArc; + User::LeaveIfError( appArc.Connect() ); // connect to AppArc server + CleanupClosePushL( appArc ); + TThreadId id; + User::LeaveIfError( appArc.StartDocument( + *param, data->PublisherUid(), id ) ); + + CleanupStack::PopAndDestroy( &appArc ); + CleanupStack::PopAndDestroy( param ); + } + } + +// --------------------------------------------------------------------------- +// CWmMainContainer::ActivateFindPaneL +// --------------------------------------------------------------------------- +// +void CWmMainContainer::ActivateFindPaneL() + { + if ( iFindbox && !iFindPaneIsVisible && + iWidgetsList->Model()->NumberOfItems() > KMinWidgets ) + { + // enable filtering + CAknFilteredTextListBoxModel* m = + static_cast <CAknFilteredTextListBoxModel*> ( iWidgetsList->Model() ); + if ( m ) + { + m->CreateFilterL( iWidgetsList, iFindbox ); + if ( m->Filter() ) + { + m->Filter()->SetParentControl( this ); + } + } + + iFindbox->ActivateL(); + iFindbox->ResetL(); + iFindbox->SetSearchTextL( KNullDesC ); + iFindbox->SetSkinEnabledL( ETrue ); + + iFindPaneIsVisible = ETrue; + iFindbox->MakeVisible( ETrue ); + + // layout listbox and findbox + LayoutControlsL(); + + iFindbox->SetFocus( ETrue ); + iWidgetsList->SetFindPaneIsVisible( ETrue ); + + // set soft key set + CEikButtonGroupContainer* cbaGroup = + CEikButtonGroupContainer::Current(); + cbaGroup->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_CANCEL__SELECT ); + cbaGroup->DrawNow(); + + UpdateFocusMode(); + } + } + +// --------------------------------------------------------------------------- +// CWmMainContainer::DeactivateFindPaneL +// --------------------------------------------------------------------------- +// +void CWmMainContainer::DeactivateFindPaneL() + { + if( iFindbox && iFindPaneIsVisible ) + { + // notify search field we're shutting down + TKeyEvent keyEvent = { EKeyNo, EStdKeyNo, 0, 0 }; + iFindbox->OfferKeyEventL( keyEvent, EEventKey ); + + // reset findbox + iFindbox->ResetL(); + + // reset filter + CAknFilteredTextListBoxModel* m = + static_cast <CAknFilteredTextListBoxModel*> ( iWidgetsList->Model() ); + if ( m && m->Filter() ) + { + m->Filter()->ResetFilteringL(); + m->RemoveFilter(); + } + + iFindbox->MakeVisible( EFalse ); + iFindbox->SetFocus( EFalse ); + iFindPaneIsVisible = EFalse; + iWidgetsList->SetFindPaneIsVisible( EFalse ); + + LayoutControlsL(); + iWidgetsList->SetFocus( ETrue ); + + // set soft key set + CEikButtonGroupContainer* cbaGroup = + CEikButtonGroupContainer::Current(); + cbaGroup->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK__SELECT ); + cbaGroup->DrawNow(); + + UpdateFocusMode(); + DrawNow(); + } + } + +// --------------------------------------------------------------------------- +// CWmMainContainer::SortListAlphabeticallyL +// --------------------------------------------------------------------------- +// +void CWmMainContainer::SortListAlphabeticallyL() + { + if ( iWidgetsList ) + { + iWidgetsList->SetSortOrderL( CWmListBox::EAlphabetical ); + + //store changed list order + CWmPersistentWidgetOrder* widgetOrder = + CWmPersistentWidgetOrder::NewL( iWmPlugin.FileServer() ); + CleanupStack::PushL( widgetOrder ); + widgetOrder->StoreL( iWidgetsList->WidgetDataArray() ); + CleanupStack::PopAndDestroy( widgetOrder ); + + } + } + +// --------------------------------------------------------------------------- +// CWmMainContainer::UninstallWidgetL +// --------------------------------------------------------------------------- +// +void CWmMainContainer::UninstallWidgetL() + { + if ( CanDoUninstall() ) + { + CWmWidgetData* data = iWidgetsList->WidgetData(); + + SwiUI::RSWInstLauncher installer; + User::LeaveIfError( installer.Connect() ); + + installer.Uninstall( data->PublisherUid(), KWrtMime ); + installer.Close(); + } + } + +// --------------------------------------------------------------------------- +// CWmMainContainer::OpenOviPortalL +// --------------------------------------------------------------------------- +// +void CWmMainContainer::OpenOviPortalL() + { + _LIT( KParam, "{\"Parameters\": {\"cmd\": \"channel\", \"id\": \"tag:mosh.nokia.com,2009-04:atom/2.0/channels/10\" }}" ); + _LIT( KHtmlFile, "C:\\private\\102829a0\\com.nokia.ovi.juniper.WRTClient\\Juniper\\Main.html" ); + _LIT( KFileName, "securewidgetui.exe" ); + _LIT( KUrl, "4 https://store.ovi.com/applications/"); + + RApaLsSession appArcSession; + User::LeaveIfError( appArcSession.Connect() ); + CleanupClosePushL( appArcSession ); + + HBufC* param = HBufC::NewLC( KParam().Length() ); + param->Des().Copy(KParam); + + TThreadId id; + CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); + cmdLine->SetCommandL( EApaCommandOpen ); + cmdLine->SetExecutableNameL( KFileName ); + cmdLine->SetDocumentNameL( KHtmlFile ); + HBufC8* buf8 = HBufC8::NewLC( param->Des().Length() ); + buf8->Des().Copy( *param ); + cmdLine->SetOpaqueDataL( *buf8 ); + cmdLine->SetTailEndL( *buf8 ); + + TInt err = appArcSession.StartApp( *cmdLine, id ); + if ( err == KErrNone ) + { + _LIT( KSchemeTemplate, "ecwrtservices:command=launch&app=com.nokia.ovi.juniper.WRTClient&commandLine="); + const TInt KSecureWidgetWebAppSchemeHandlerUid = 0x102829B2; + + // Create scheme url to launch the widget + HBufC* schemeUrl = HBufC::NewLC( KSchemeTemplate().Length() + + param->Des().Length() ); + + schemeUrl->Des().Copy( KSchemeTemplate ); + schemeUrl->Des().Append( *param ); + + // Initialize scheme handler plugin + TUid dtorId; + CSchemeHandler* schemeHandler = reinterpret_cast<CSchemeHandler*>( + REComSession::CreateImplementationL( + TUid::Uid( KSecureWidgetWebAppSchemeHandlerUid ), + dtorId, schemeUrl ) ); + CleanupStack::PushL( schemeHandler ); + + // Handle the scheme url + schemeHandler->HandleUrlEmbeddedL(); + + CleanupStack::PopAndDestroy( schemeHandler ); + REComSession::FinalClose(); + CleanupStack::PopAndDestroy( schemeUrl ); + } + else + { + // Ovi store not found start browser + const TUid KOSSBrowserUidValue = { 0x10008D39 }; + HBufC* param = HBufC::NewLC( KUrl().Length() ); + param->Des().Copy( KUrl ); + 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( !appArcSession.Handle() ) + { + User::LeaveIfError( appArcSession.Connect() ); + } + TThreadId thread; + User::LeaveIfError(appArcSession.StartDocument(*param, KOSSBrowserUidValue, thread)); + appArcSession.Close(); + } + CleanupStack::PopAndDestroy( param ); + } + + CleanupStack::PopAndDestroy( buf8 ); + CleanupStack::PopAndDestroy( cmdLine ); + CleanupStack::PopAndDestroy( param ); + CleanupStack::PopAndDestroy( &appArcSession ); + + // unfocus OVI button + iOviPortal->SetFocus( EFalse ); + iOviPortal->DrawDeferred(); + UpdateFocusMode(); + } + +// --------------------------------------------------------------------------- +// CWmMainContainer::SelectL +// --------------------------------------------------------------------------- +// +void CWmMainContainer::SelectL() + { + if ( WidgetSelected() ) + AddWidgetToHomeScreenL(); + else if ( PortalSelected() ) + OpenOviPortalL(); + else + SetFocusToWidgetList(); + } + +// --------------------------------------------------------------------------- +// CWmMainContainer::ShowHelpL +// --------------------------------------------------------------------------- +// +void CWmMainContainer::ShowHelpL() + { + TUid fwUid = TUid::Uid( AI_UID3_AIFW_COMMON ); + // retrieve resolve host application help context + CArrayFix<TCoeHelpContext>* helpContext = + iEikonEnv->EikAppUi()->AppHelpContextL(); + + // add the widget manager entry into the help context + CleanupStack::PushL( helpContext ); + helpContext->InsertL( 0, TCoeHelpContext( + fwUid, KWM_HLP_WIDGET_COLLECTION ) ); + CleanupStack::Pop( helpContext ); + + // launch help + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), + helpContext ); + helpContext = 0; // HlpLauncher takes ownership of helpContext + } + +// --------------------------------------------------------------------------- +// CWmMainContainer::RemoveCtrlsFromStack +// --------------------------------------------------------------------------- +// +void CWmMainContainer::RemoveCtrlsFromStack() + { + for ( TInt i=0; i < CountComponentControls(); i++ ) + { + CCoeControl* ctl = ComponentControl( i ) ; + if ( ctl ) + { + iWmPlugin.ViewAppUi().RemoveFromStack( ctl ); + } + } + } + +// --------------------------------------------------------------------------- +// CWmMainContainer::HandleListBoxEventL +// --------------------------------------------------------------------------- +// +void CWmMainContainer::HandleListBoxEventL( + CEikListBox* /*aListBox*/, TListBoxEvent aEventType ) + { + if ( !iClosingDown && ( aEventType == EEventEnterKeyPressed || + aEventType == EEventItemSingleClicked ) ) + { + AddWidgetToHomeScreenL(); + } + } + +// --------------------------------------------------------------------------- +// CWmMainContainer::HandleControlEventL +// --------------------------------------------------------------------------- +// +void CWmMainContainer::HandleControlEventL( + CCoeControl* aControl, TCoeEvent aEventType ) + { + if ( !iClosingDown && aControl == iOviPortal && aEventType == EEventStateChanged ) + { + OpenOviPortalL(); + } + } + +// ---------------------------------------------------- +// CWmMainContainer::LaunchDetailsDialogL +// ---------------------------------------------------- +// +void CWmMainContainer::LaunchDetailsDialogL() + { + CWmWidgetData* data = iWidgetsList->WidgetData(); + if ( data ) + { + const CFbsBitmap* logo = ( data->LogoImage() ) ? + data->LogoImage() : iWidgetsList->DefaultLogo(); + const CFbsBitmap* mask = ( data->LogoImageMask() ) ? + data->LogoImageMask() : iWidgetsList->DefaultMask(); + + TPtrC description = ( data->Description().Length() > 0 ) ? + data->Description() : iWmPlugin.ResourceLoader().NoDescriptionText(); + CWmDetailsDlg* dlg = CWmDetailsDlg::NewL( + data->Name(), description, + data->HsContentInfo().CanBeAdded(), + logo, mask, iBgContext ); + + if ( dlg && dlg->ExecuteLD() == ECbaAddToHs ) + { + AddWidgetToHomeScreenL(); + } + } + } + +// ---------------------------------------------------- +// CWmMainContainer::SetClosingDown +// ---------------------------------------------------- +// +void CWmMainContainer::SetClosingDown( TBool aClosingDown ) + { + iClosingDown = aClosingDown; + } + +// ---------------------------------------------------- +// CWmMainContainer::ClosingDown +// ---------------------------------------------------- +// +TBool CWmMainContainer::ClosingDown() + { + return iClosingDown; + } + +// ---------------------------------------------------- +// CWmMainContainer::HandleFindSizeChanged +// ---------------------------------------------------- +// +void CWmMainContainer::HandleFindSizeChanged() + { + TAknWindowLineLayout findPane = + AknLayoutScalable_Avkon::find_pane().LayoutLine(); + + TAknWindowLineLayout listPane; + + TRect listRect = iWidgetsList->Rect(); + listPane.il = listRect.iTl.iX; + listPane.it = listRect.iTl.iY; + listPane.ib = 0; + listPane.iH = TUint16( listRect.Height() - ( findPane.iH - 1 ) ); + listPane.iW = listRect.Width(); + listPane.ir = ELayoutEmpty; + findPane.iW = listPane.iW; + + TRect rect = Rect(); + AknLayoutUtils::LayoutControl( iFindbox, rect, findPane ); + AknLayoutUtils::LayoutControl( iWidgetsList, rect, listPane ); + + iWidgetsList->DrawNow(); + } + + +// End of File + diff -r 000000000000 -r f72a12da539e widgetmanager/src/wmmaincontainerview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/src/wmmaincontainerview.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,436 @@ +/* +* 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: +* Implementation of the main container view for WidgetManager application. +* +*/ + +// INCLUDES +#include <aknViewAppUi.h> +#include <eikmenub.h> +#include <avkon.hrh> +#include <akncontext.h> +#include <akntitle.h> +#include <StringLoader.h> +#include <barsread.h> +#include <eikbtgpc.h> +#include <widgetmanagerview.rsg> +#include <hscontentcontroller.h> + +#include "wmplugin.h" +#include "widgetmanager.hrh" +#include "wmmaincontainerview.h" +#include "wmresourceloader.h" +#include "wmmaincontainer.h" +#include <avkon.rsg> + + +// --------------------------------------------------------- +// CWmMainContainerView::CWmMainContainerView() +// --------------------------------------------------------- +// +CWmMainContainerView::CWmMainContainerView( + CWmPlugin& aWmPlugin ): + iWmPlugin( aWmPlugin ) + { + iWmMainContainer = NULL; + } + +// --------------------------------------------------------- +// CWmMainContainerView::~CWmMainContainerView() +// --------------------------------------------------------- +// +CWmMainContainerView::~CWmMainContainerView() + { + if ( iWmMainContainer != NULL ) + { + AppUi()->RemoveFromViewStack( *this, iWmMainContainer ); + delete iWmMainContainer; + iWmMainContainer = NULL; + } + } + +// --------------------------------------------------------- +// CWmMainContainerView::NewL +// --------------------------------------------------------- +// +CWmMainContainerView* CWmMainContainerView::NewL( + CWmPlugin& aWmPlugin ) + { + CWmMainContainerView* self = CWmMainContainerView::NewLC( + aWmPlugin ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// CWmMainContainerView::NewLC +// --------------------------------------------------------- +// +CWmMainContainerView* CWmMainContainerView::NewLC( + CWmPlugin& aWmPlugin ) + { + CWmMainContainerView* self = + new ( ELeave ) CWmMainContainerView( aWmPlugin ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------- +// CWmMainContainerView::ConstructL +// --------------------------------------------------------- +// +void CWmMainContainerView::ConstructL() + { + BaseConstructL( R_WM_MAIN_CONTAINER_VIEW ); + } + +// --------------------------------------------------------- +// CWmMainContainerView::Id +// --------------------------------------------------------- +// +TUid CWmMainContainerView::Id() const + { + return TUid::Uid( EWmMainContainerViewId ); + } + +// --------------------------------------------------------- +// CWmMainContainerView::HandleCommandL +// --------------------------------------------------------- +// +void CWmMainContainerView::HandleCommandL( TInt aCommand ) + { + if ( !iWmMainContainer->ClosingDown() ) + { + switch ( aCommand ) + { + case EWmMainContainerViewOpenPortalMenuItemCommand: + HandleOpenMenuItemSelectedL(); + break; + case EWmMainContainerViewAddMenuItemCommand: + HandleAddMenuItemSelectedL(); + break; + case EWmMainContainerViewLaunchMenuItemCommand: + HandleLaunchMenuItemSelectedL(); + break; + case EWmMainContainerViewSearchMenuItemCommand: // flow through + case EAknSoftkeySearch: + HandleSearchMenuItemSelectedL(); + break; + case EWmMainContainerViewSortAlphaMenuItemCommand: + HandleSortAlphaMenuItemSelectedL(); + break; + case EWmMainContainerViewUninstallMenuItemCommand: + HandleUninstallMenuItemSelectedL(); + break; + case EWmMainContainerViewHelpMenuItemCommand: + HandleHelpMenuItemSelectedL(); + break; + case EWmMainContainerViewBackMenuItemCommand: // flow through + case EAknSoftkeyBack: + iWmPlugin.Deactivate(); + break; + case EWmMainContainerViewWiddetDetailsMenuItemCommand: + HandleDetailsMenuItemSelectedL(); + break; + case EAknSoftkeySelect: + if ( iWmMainContainer ) + iWmMainContainer->SelectL(); + break; + case EAknSoftkeyCancel: // flow through + case EEikCmdCanceled: + { + HandleDeactivateFindPaneL(); + break; + } + default: + break; + } + } + } + +// --------------------------------------------------------- +// CWmMainContainerView::DoActivateL +// --------------------------------------------------------- +// +void CWmMainContainerView::DoActivateL( + const TVwsViewId& aPrevViewId, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + if ( iWmMainContainer == NULL ) + { + iWmMainContainer = CreateContainerL(); + iWmMainContainer->SetClosingDown( EFalse ); + iWmMainContainer->SetMopParent( this ); + AppUi()->AddToStackL( *this, iWmMainContainer ); + } + + SetupStatusPaneL(); + + iWmMainContainer->SetExitStatus( KErrNone ); + iWmPlugin.MainViewActivated( aPrevViewId, iWmMainContainer ); + StatusPane()->SwitchLayoutL( + R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ); + StatusPane()->ApplyCurrentSettingsL(); + StatusPane()->DrawNow(); + CEikButtonGroupContainer* bgc( Cba() ); + + CEikCba* cba = static_cast< CEikCba* >( bgc->ButtonGroup() ); + if ( cba ) + { + + bgc->SetBoundingRect( TRect() ); + cba->DrawNow(); + } + } + +// --------------------------------------------------------- +// CWmMainContainerView::DoDeactivate +// --------------------------------------------------------- +// +void CWmMainContainerView::DoDeactivate() + { + TInt exitStatus = KErrNone; + if ( iWmMainContainer != NULL ) + { + exitStatus = iWmMainContainer->ExitStatus(); + AppUi()->RemoveFromViewStack( *this, iWmMainContainer ); + delete iWmMainContainer; + iWmMainContainer = NULL; + } + + // display error, if such exists + if ( exitStatus == KHsErrorViewFull || + exitStatus == KHsErrorDoesNotFit ) + { + TRAP_IGNORE( iWmPlugin.ResourceLoader().InfoPopupL( + R_QTN_HS_ADD_WIDGET_NO_SPACE_NOTE, KNullDesC ) ); + } + else if ( exitStatus == KHsErrorMaxInstanceCountExceeded ) + { + TRAP_IGNORE( iWmPlugin.ResourceLoader().InfoPopupL( + R_QTN_HS_ADD_WIDGET_MAX_COUNT_NOTE, KNullDesC ) ); + } + else if ( exitStatus != KErrNone ) + { + iWmPlugin.ResourceLoader().ErrorPopup( exitStatus ); + } + + iWmPlugin.MainViewDeactivated(); + } + +// --------------------------------------------------------- +// CWmMainContainerView::HandleStatusPaneSizeChange +// --------------------------------------------------------- +// +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() + { + // setup the title pane + TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle ); + CEikStatusPaneBase::TPaneCapabilities subPaneTitle = + StatusPane()->PaneCapabilities( titlePaneUid ); + if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() ) + { + CAknTitlePane* title = static_cast< CAknTitlePane* >( + StatusPane()->ControlL( titlePaneUid ) ); + if ( title ) + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( + reader, R_WM_MAIN_CONTAINER_TITLE_RESOURCE ); + title->SetFromResourceL( reader ); + title->DrawDeferred(); + CleanupStack::PopAndDestroy(); // reader internal state + } + } + } + +// --------------------------------------------------------- +// CWmMainContainerView::CreateContainerL +// --------------------------------------------------------- +// +CWmMainContainer* CWmMainContainerView::CreateContainerL() + { + return CWmMainContainer::NewL( ClientRect(), NULL, this, iWmPlugin ); + } + +// --------------------------------------------------------- +// CWmMainContainerView::DynInitMenuPaneL +// --------------------------------------------------------- +// +void CWmMainContainerView::DynInitMenuPaneL( + TInt aResourceId, CEikMenuPane* aMenuPane ) + { + if ( aResourceId == R_WM_MAIN_CONTAINER_MENU_PANE && + iWmMainContainer ) + { + aMenuPane->SetItemDimmed( EWmMainContainerViewAddMenuItemCommand, + !iWmMainContainer->CanDoAdd() ); + aMenuPane->SetItemDimmed( EWmMainContainerViewWiddetDetailsMenuItemCommand, + !iWmMainContainer->CanDoDetails() ); + aMenuPane->SetItemDimmed( EWmMainContainerViewLaunchMenuItemCommand, + !iWmMainContainer->CanDoLaunch() ); + aMenuPane->SetItemDimmed( EWmMainContainerViewSearchMenuItemCommand, + !iWmMainContainer->CanDoFind() ); + aMenuPane->SetItemDimmed( EWmMainContainerViewSortAlphaMenuItemCommand, + !iWmMainContainer->CanDoSort() ); + aMenuPane->SetItemDimmed( EWmMainContainerViewHelpMenuItemCommand, + !iWmMainContainer->CanDoHelp() ); + aMenuPane->SetItemDimmed( EWmMainContainerViewUninstallMenuItemCommand, + !iWmMainContainer->CanDoUninstall() ); + if ( !iWmMainContainer->PortalSelected() ) + aMenuPane->DeleteMenuItem( EWmMainContainerViewOpenPortalMenuItemCommand ); + if ( !iWmMainContainer->WidgetSelected() ) + aMenuPane->DeleteMenuItem( EWmMainContainerViewAddMenuItemCommand ); + } + } + +// --------------------------------------------------------- +// CWmMainContainerView::HandleOpenMenuItemSelectedL +// --------------------------------------------------------- +// +TBool CWmMainContainerView::HandleOpenMenuItemSelectedL() + { + if ( iWmMainContainer && iWmMainContainer->PortalSelected() ) + { + iWmMainContainer->OpenOviPortalL(); + } + return ETrue; + } + +// --------------------------------------------------------- +// CWmMainContainerView::HandleDetailsMenuItemSelectedL +// --------------------------------------------------------- +// +TBool CWmMainContainerView::HandleDetailsMenuItemSelectedL() + { + if ( iWmMainContainer && iWmMainContainer->WidgetSelected() ) + { + iWmMainContainer->LaunchDetailsDialogL(); + } + return ETrue; + } + +// --------------------------------------------------------- +// CWmMainContainerView::HandleAddMenuItemSelectedL +// --------------------------------------------------------- +// +TBool CWmMainContainerView::HandleAddMenuItemSelectedL() + { + if ( iWmMainContainer && iWmMainContainer->WidgetSelected() ) + { + iWmMainContainer->AddWidgetToHomeScreenL(); + } + return ETrue; + } + +// --------------------------------------------------------- +// CWmMainContainerView::HandleLaunchMenuItemSelectedL +// --------------------------------------------------------- +// +TBool CWmMainContainerView::HandleLaunchMenuItemSelectedL() + { + if ( iWmMainContainer && iWmMainContainer->WidgetSelected() ) + { + iWmMainContainer->LaunchWidgetL(); + } + return ETrue; + } + +// --------------------------------------------------------- +// CWmMainContainerView::HandleSearchMenuItemSelectedL +// --------------------------------------------------------- +// +TBool CWmMainContainerView::HandleSearchMenuItemSelectedL() + { + if ( iWmMainContainer ) + { + iWmMainContainer->ActivateFindPaneL(); + } + return ETrue; + } + +// --------------------------------------------------------- +// CWmMainContainerView::HandleSortAlphaMenuItemSelectedL +// --------------------------------------------------------- +// +TBool CWmMainContainerView::HandleSortAlphaMenuItemSelectedL() + { + if ( iWmMainContainer ) + { + iWmMainContainer->SortListAlphabeticallyL(); + } + return ETrue; + } + +// --------------------------------------------------------- +// CWmMainContainerView::HandleUninstallMenuItemSelectedL +// --------------------------------------------------------- +// +TBool CWmMainContainerView::HandleUninstallMenuItemSelectedL() + { + if ( iWmMainContainer ) + { + iWmMainContainer->UninstallWidgetL(); + } + return ETrue; + } + +// --------------------------------------------------------- +// CWmMainContainerView::HandleHelpMenuItemSelectedL +// --------------------------------------------------------- +// +TBool CWmMainContainerView::HandleHelpMenuItemSelectedL() + { + iWmMainContainer->ShowHelpL(); + return ETrue; + } + +// --------------------------------------------------------- +// CWmMainContainerView::HandleDeactivateFindPaneL +// --------------------------------------------------------- +// +TBool CWmMainContainerView::HandleDeactivateFindPaneL() + { + if ( iWmMainContainer ) + { + iWmMainContainer->DeactivateFindPaneL(); + } + return ETrue; + } + +// End of file diff -r 000000000000 -r f72a12da539e widgetmanager/src/wmpersistentwidgetorder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/src/wmpersistentwidgetorder.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,244 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Defines an ordered list of widget id's with persistence capability +* +*/ + +// INCLUDES +#include <s32file.h> // RFile +#include <s32std.h> // streams +#include <driveinfo.h> +#include <sysutil.h> + +#include "wmwidgetdata.h" +#include "wmpersistentwidgetorder.h" + +// CONSTANTS +_LIT( KStoreFileName, "wmlistorder.dat" ); + + +// --------------------------------------------------------- +// CWmPersistentWidgetOrder::NewL +// --------------------------------------------------------- +// +CWmPersistentWidgetOrder* CWmPersistentWidgetOrder::NewL( RFs& aFs ) + { + CWmPersistentWidgetOrder* self = + new (ELeave) CWmPersistentWidgetOrder( aFs ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// CWmPersistentWidgetOrder::CWmPersistentWidgetOrder +// --------------------------------------------------------- +// +CWmPersistentWidgetOrder::CWmPersistentWidgetOrder( RFs& aFs ) + : iFs( aFs ) + { + } + +// --------------------------------------------------------- +// CWmPersistentWidgetOrder::ConstructL +// --------------------------------------------------------- +// +void CWmPersistentWidgetOrder::ConstructL() + { + } + +// --------------------------------------------------------- +// CWmPersistentWidgetOrder::~CWmPersistentWidgetOrder +// --------------------------------------------------------- +// +CWmPersistentWidgetOrder::~CWmPersistentWidgetOrder() + { + CleanupArray(); + } + +// --------------------------------------------------------- +// CWmPersistentWidgetOrder::LoadL +// --------------------------------------------------------- +// +void CWmPersistentWidgetOrder::LoadL() + { + // 1. empty the in-mempory storage + CleanupArray(); + // 2. create stream for reading data from a file + TFileName storeFileName; + GetStoreFileNameL( storeFileName ); + CPermanentFileStore* fileStore = NULL; + fileStore = CPermanentFileStore::OpenL( + iFs, storeFileName, EFileRead ); + CleanupStack::PushL( fileStore ); + RStoreReadStream reader; + reader.OpenLC( *fileStore, fileStore->Root() ); + // 3. read all contents from the stream + TInt arrayCount = reader.ReadInt32L(); + while( iTagArray.Count() < arrayCount ) + { + TInt32 uid = reader.ReadInt32L(); + TInt32 publisherIdLen = reader.ReadInt32L(); + HBufC16* publisherId = HBufC16::NewLC(publisherIdLen); + TPtr16 publisherIdPtr = publisherId->Des(); + reader.ReadL( publisherIdPtr, publisherIdLen ); + iTagArray.AppendL( Tag( uid, publisherId ) ); + CleanupStack::Pop( publisherId ); + } + // 4. cleanup + CleanupStack::PopAndDestroy( &reader ); + CleanupStack::PopAndDestroy( fileStore ); + } + +// --------------------------------------------------------- +// CWmPersistentWidgetOrder::StoreL +// --------------------------------------------------------- +// +void CWmPersistentWidgetOrder::StoreL( const RWidgetDataValues& aArray ) + { + // 1. empty the in-mempory storage + CleanupArray(); + // 2. serialize the widget array tags to a local array + for( TInt i=0; i<aArray.Count(); ++i ) + { + TInt32 uid = aArray[i]->Uid().iUid; + HBufC16* publisherId = aArray[i]->HsContentInfo().PublisherId().AllocLC(); + iTagArray.AppendL( Tag( uid, publisherId ) ); + CleanupStack::Pop( publisherId ); + } + // 3. create stream for storing the data to a file + TFileName storeFileName; + GetStoreFileNameL( storeFileName ); + CPermanentFileStore* fileStore = CPermanentFileStore::ReplaceLC( + iFs, storeFileName, EFileWrite ); + fileStore->SetTypeL(KPermanentFileStoreLayoutUid); + RStoreWriteStream writer; + TStreamId id = writer.CreateLC( *fileStore ); + // 4. write all content to the stream + writer.WriteInt32L( iTagArray.Count() ); + for( TInt i=0; i<iTagArray.Count(); ++i ) + { + writer.WriteInt32L( iTagArray[i].iUid ); + writer.WriteInt32L( iTagArray[i].iPublisherId->Length() ); + writer.WriteL( *iTagArray[i].iPublisherId, + iTagArray[i].iPublisherId->Length() ); + } + // 5. check available space and commit the stream + TInt streamsize = writer.Sink()->SizeL(); + TBool noSpace = SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, streamsize, + EDriveC ); + if( noSpace ) + { + //do nothing + } + else // there is enough free space + { + writer.CommitL(); + fileStore->SetRootL(id); + fileStore->CommitL(); + } + + // 6. cleanup + CleanupStack::PopAndDestroy( &writer ); + CleanupStack::PopAndDestroy( fileStore ); + } + +// --------------------------------------------------------- +// CWmPersistentWidgetOrder::CleanupArray +// --------------------------------------------------------- +// +void CWmPersistentWidgetOrder::CleanupArray() + { + for( TInt i=0; i<iTagArray.Count(); ++i ) + { + delete iTagArray[i].iPublisherId; + iTagArray[i].iPublisherId = 0; + } + iTagArray.Close(); + } + +// --------------------------------------------------------- +// CWmPersistentWidgetOrder::GetStoreFileNameL +// --------------------------------------------------------- +// +void CWmPersistentWidgetOrder::GetStoreFileNameL( + TDes& aPathBuf ) + { + // get default drive for phone memory + TInt driveNum = EDriveC; + User::LeaveIfError( DriveInfo::GetDefaultDrive( + DriveInfo::EDefaultPhoneMemory, driveNum ) ); + // make sure the directory exists + iFs.CreatePrivatePath( driveNum ); // ignore errors + // build the store path + TChar driveLetter; + User::LeaveIfError( iFs.DriveToChar( driveNum, driveLetter ) ); + aPathBuf.Append( driveLetter ); + aPathBuf.Append( _L(":") ); + TFileName privatePath; + User::LeaveIfError( iFs.PrivatePath( privatePath ) ); + aPathBuf.Append( privatePath ); + aPathBuf.Append( KStoreFileName ); + } + +// --------------------------------------------------------- +// CWmPersistentWidgetOrder::IndexOf +// --------------------------------------------------------- +// +TInt CWmPersistentWidgetOrder::IndexOf( const CWmWidgetData& aWidgetData ) const + { + TInt found = KErrNotFound; + for( TInt i=0; i<iTagArray.Count() && found<0; ++i ) + { + if ( iTagArray[i].Matches( aWidgetData ) ) + found = i; + } + return found; + } + +// --------------------------------------------------------- +// CWmPersistentWidgetOrder::IsEmpty +// --------------------------------------------------------- +// +TBool CWmPersistentWidgetOrder::IsEmpty() const + { + return iTagArray.Count() == 0; + } + +// --------------------------------------------------------- +// CWmPersistentWidgetOrder::Tag::Tag +// --------------------------------------------------------- +// +CWmPersistentWidgetOrder::Tag::Tag( + TInt32 aUid, HBufC16* aPublisherId ) + { + iUid = aUid; + iPublisherId = aPublisherId; + } + +// --------------------------------------------------------- +// CWmPersistentWidgetOrder::Tag::Matches +// --------------------------------------------------------- +// +TBool CWmPersistentWidgetOrder::Tag::Matches( + const CWmWidgetData& aWidgetData ) const + { + return ( aWidgetData.Uid().iUid == iUid && + aWidgetData.HsContentInfo().PublisherId() == *iPublisherId ); + } + + +// end of file diff -r 000000000000 -r f72a12da539e widgetmanager/src/wmplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/src/wmplugin.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,177 @@ +/* +* 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: +* widget manager plugin implementation +* +*/ + +// INCLUDE FILES +#include <bautils.h> +#include <coemain.h> +#include <aknViewAppUi.h> + +#include "wmcommon.h" +#include "widgetmanager.hrh" +#include "wmmaincontainer.h" +#include "wmmaincontainerview.h" +#include "wmresourceloader.h" +#include "wmplugin.h" +#include "wmeffectmanager.h" + +// --------------------------------------------------------- +// CWmPlugin::NewL +// --------------------------------------------------------- +// +CWmPlugin* CWmPlugin::NewL() + { + CWmPlugin* self=new(ELeave) CWmPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------- +// CWmPlugin::~CWmPlugin +// --------------------------------------------------------- +// +CWmPlugin::~CWmPlugin() + { + if ( iViewAppUi ) + { + Deactivate(); + iViewAppUi->RemoveView( TUid::Uid( EWmMainContainerViewId ) ); + } + iWmMainContainer = NULL; + delete iResourceLoader; + delete iEffectManager; + } + +// --------------------------------------------------------- +// CWmPlugin::CWmPlugin +// --------------------------------------------------------- +// +CWmPlugin::CWmPlugin() + { + iPreviousViewUid.iViewUid = KNullUid; + } + +// --------------------------------------------------------- +// CWmPlugin::ConstructL +// --------------------------------------------------------- +// +void CWmPlugin::ConstructL() + { + iWmMainContainer = NULL; + + // store static view app ui + CEikonEnv* eikonEnv = CEikonEnv::Static(); + if ( !eikonEnv ) User::Leave( KErrUnknown ); + iViewAppUi = (CAknViewAppUi*)eikonEnv->EikAppUi(); + if ( !iViewAppUi ) User::Leave( KErrUnknown ); + + // create resource loader + iFs = &eikonEnv->FsSession(); + iResourceLoader = CWmResourceLoader::NewL( *eikonEnv ); + iEffectManager = CWmEffectManager::NewL( *eikonEnv ); + + // main view + CWmMainContainerView* mainView = + CWmMainContainerView::NewL( *this ); + CleanupStack::PushL( mainView ); + iViewAppUi->AddViewL( mainView ); + CleanupStack::Pop( mainView ); + } + +// --------------------------------------------------------- +// CWmPlugin::Activate +// --------------------------------------------------------- +// +void CWmPlugin::Activate() + { + if ( !IsActive() && iHsContentController ) + { + TRAP_IGNORE( + iEffectManager->BeginFullscreenEffectL( + KAppStartCommonDefaultStyle ); + iViewAppUi->ActivateLocalViewL( + TUid::Uid( EWmMainContainerViewId ) ); + ); + } + } + +// --------------------------------------------------------- +// CWmPlugin::IsActive +// --------------------------------------------------------- +// +TBool CWmPlugin::IsActive() + { + return ( iPreviousViewUid.iViewUid != KNullUid ); + } + +// --------------------------------------------------------- +// CWmPlugin::Deactivate +// --------------------------------------------------------- +// +void CWmPlugin::Deactivate() + { + if ( IsActive() ) + { + iWmMainContainer->SetClosingDown( ETrue ); + TRAP_IGNORE( + iEffectManager->BeginFullscreenEffectL( + KAppExitCommonDefaultStyle ); + iViewAppUi->ActivateLocalViewL( + iPreviousViewUid.iViewUid ); + ); + } + } + +// --------------------------------------------------------- +// CWmPlugin::MainViewActivated +// --------------------------------------------------------- +// +void CWmPlugin::MainViewActivated( + const TVwsViewId& aViewId, + CWmMainContainer* aWmMainContainer ) + { + iPreviousViewUid = aViewId; + iWmMainContainer = aWmMainContainer; + iEffectManager->UiRendered(); + } + +// --------------------------------------------------------- +// CWmPlugin::MainViewDeactivated +// --------------------------------------------------------- +// +void CWmPlugin::MainViewDeactivated() + { + iPreviousViewUid.iViewUid = KNullUid; + iWmMainContainer = NULL; + iEffectManager->UiRendered(); + } + +// --------------------------------------------------------- +// CWmPlugin::NotifyWidgetListChanged +// --------------------------------------------------------- +// +void CWmPlugin::NotifyWidgetListChanged() + { + if ( iWmMainContainer ) + { + iWmMainContainer->HandleWidgetListChanged(); + } + } + +// End of file diff -r 000000000000 -r f72a12da539e widgetmanager/src/wmpluginproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/src/wmpluginproxy.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,37 @@ +/* +* 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: +* widget manager plugin proxy +* +*/ + +#include <e32std.h> +#include <implementationproxy.h> + +#include "wmplugin.h" + +// Map the interface implementation UIDs to implementation factory functions +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x20026F53, CWmPlugin::NewL ) + }; + + +// Exported proxy for instantiation method resolution. +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } diff -r 000000000000 -r f72a12da539e widgetmanager/src/wmresourceloader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/src/wmresourceloader.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,199 @@ +/* +* 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: +* loads widget manager resources and icons +* +*/ + +// INCLUDE FILES +#include <eikenv.h> +#include <eikappui.h> +#include <aknapp.h> +#include <bautils.h> +#include <gdi.h> +#include <aknbutton.h> +#include <AknIconUtils.h> +#include <StringLoader.h> +#include <aknnotewrappers.h> +#include <widgetmanagerview.rsg> + +#include "wmresourceloader.h" + +// CONSTANTS +_LIT( KRelativeMifPath, "\\resource\\apps\\widgetmanager.mif" ); +_LIT( KRelativeResourcePathWithWildcard, "\\resource\\widgetmanagerview.r*" ); +_LIT( KRelativeResourcePath, "\\resource\\widgetmanagerview.rsc" ); + + +// --------------------------------------------------------- +// CWmResourceLoader::NewL +// --------------------------------------------------------- +// +CWmResourceLoader* CWmResourceLoader::NewL( + CEikonEnv& aEnv ) + { + CWmResourceLoader* self = new (ELeave) CWmResourceLoader( aEnv ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// CWmResourceLoader::CWmResourceLoader +// --------------------------------------------------------- +// +CWmResourceLoader::CWmResourceLoader( CEikonEnv& aEnv ) + : iEnv( aEnv ) + { + } + +// --------------------------------------------------------- +// CWmResourceLoader::~CWmResourceLoader +// --------------------------------------------------------- +// +CWmResourceLoader::~CWmResourceLoader() + { + UnloadResources(); + delete iNote; + delete iDescription; + } + +// --------------------------------------------------------- +// CWmResourceLoader::ConstructL +// --------------------------------------------------------- +// +void CWmResourceLoader::ConstructL() + { + Dll::FileName( iDllName ); + + LoadResourcesL(); + DetermineIconFilePath(); + + iDescription = StringLoader::LoadL( + R_QTN_WM_DETAILS_NO_DESCRIPTION, &iEnv ); + } + +// --------------------------------------------------------- +// CWmResourceLoader::LoadResourcesL +// --------------------------------------------------------- +// +void CWmResourceLoader::LoadResourcesL() + { + TFileName resourceFile; + RFs& fs = iEnv.FsSession(); + resourceFile.Copy( iDllName.Left(2) ); + resourceFile.Append( KRelativeResourcePathWithWildcard ); + BaflUtils::NearestLanguageFile( fs, resourceFile ); + if ( !BaflUtils::FileExists( fs, resourceFile ) ) + { + resourceFile.Copy( iDllName.Left(2) ); + resourceFile.Append( KRelativeResourcePath ); + BaflUtils::NearestLanguageFile( fs, resourceFile ); + } + iResourceFileOffset = iEnv.AddResourceFileL( resourceFile ); + } + +// --------------------------------------------------------- +// CWmResourceLoader::UnloadResources +// --------------------------------------------------------- +// +void CWmResourceLoader::UnloadResources() + { + if ( iResourceFileOffset ) + { + iEnv.DeleteResourceFile( iResourceFileOffset ); + } + } + +// --------------------------------------------------------- +// CWmResourceLoader::DetermineIconFilePath +// --------------------------------------------------------- +// +void CWmResourceLoader::DetermineIconFilePath() + { + iMifFile.Copy( iDllName.Left(2) ); + iMifFile.Append( KRelativeMifPath ); + } + +// --------------------------------------------------------- +// CWmResourceLoader::IconFilePath +// --------------------------------------------------------- +// +const TDesC& CWmResourceLoader::IconFilePath() + { + return iMifFile; + } + +// --------------------------------------------------------- +// CWmResourceLoader::LoadButtonL +// --------------------------------------------------------- +void CWmResourceLoader::LoadButtonL( + CAknButton& aResource, + TInt aResourceId ) + { + TResourceReader reader; + iEnv.CreateResourceReaderLC( reader, aResourceId ); + aResource.ConstructFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader + } + +// --------------------------------------------------------- +// LoadStringLC +// loads a string from resource. If an additional string is +// given (the length is greater than zero) uses a different +// StringLoader method to load. +// --------------------------------------------------------- +// +HBufC* LoadStringLC( TInt aResourceId, const TDesC& aString, CEikonEnv* aEnv ) + { + if ( aString.Length() > 0 ) + return StringLoader::LoadLC( aResourceId, aString, aEnv ); + else + return StringLoader::LoadLC( aResourceId, aEnv ); + } + +// --------------------------------------------------------- +// CWmResourceLoader::InfoPopupL +// --------------------------------------------------------- +// +void CWmResourceLoader::InfoPopupL( TInt aResourceId, const TDesC& aString ) + { + HBufC* infoMsg = LoadStringLC( aResourceId, aString, &iEnv ); + iNote = new (ELeave) CAknInformationNote( &iNote ); + iNote->SetTimeout( CAknNoteDialog::ELongTimeout ); + iNote->ExecuteLD( *infoMsg ); + CleanupStack::PopAndDestroy( infoMsg ); + } + +// --------------------------------------------------------- +// CWmResourceLoader::ErrorPopup +// --------------------------------------------------------- +// +void CWmResourceLoader::ErrorPopup( TInt aErrorCode ) + { + iEnv.HandleError( aErrorCode ); + } + +// --------------------------------------------------------- +// CWmResourceLoader::NoDescriptionText +// --------------------------------------------------------- +// +const TDesC& CWmResourceLoader::NoDescriptionText() + { + return *iDescription; + } + +// end of file + diff -r 000000000000 -r f72a12da539e widgetmanager/src/wmwidgetdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/src/wmwidgetdata.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,357 @@ +/* +* 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: +* CWmWidgetData implementation. +* +*/ + + +// INCLUDE FILES +#include <fbs.h> +#include <bautils.h> +#include <s32file.h> +#include <hscontentinfo.h> +#include <WidgetRegistryClient.h> // widgetreqistry +#include "wmwidgetdata.h" +#include "wmwidgetdataobserver.h" +#include "wmpersistentwidgetorder.h" +#include "wmcommon.h" + +// --------------------------------------------------------- +// CWmWidgetData::NewL +// --------------------------------------------------------- +// +CWmWidgetData* CWmWidgetData::NewL( + CHsContentInfo& aHsContentInfo, + RWidgetRegistryClientSession* aRegistryClientSession ) + { + CWmWidgetData* self = CWmWidgetData::NewLC( + aHsContentInfo, aRegistryClientSession ); + CleanupStack::Pop(); // self; + return self; + } + +// --------------------------------------------------------- +// CWmWidgetData::NewLC +// --------------------------------------------------------- +// +CWmWidgetData* CWmWidgetData::NewLC( + CHsContentInfo& aHsContentInfo, + RWidgetRegistryClientSession* aRegistryClientSession ) + { + CWmWidgetData* self = new ( ELeave ) CWmWidgetData(); + CleanupStack::PushL(self); + self->ConstructL( aHsContentInfo, aRegistryClientSession ); + return self; + } + +// --------------------------------------------------------- +// CWmWidgetData::CWmWidgetData +// --------------------------------------------------------- +// +CWmWidgetData::CWmWidgetData() + { + iIdle = NULL; + iLogoImage = NULL; + iLogoImageMask = NULL; + iHsContentInfo = NULL; + iWidgetType = CWmWidgetData::EUnknown; + iInstallAnimationIndex = KErrNotFound; + iPublisherUid = KNullUid; + iLogoSize = TSize( 0, 0 ); + } + +// --------------------------------------------------------- +// CWmWidgetData::ConstructL +// --------------------------------------------------------- +// +void CWmWidgetData::ConstructL( + CHsContentInfo& aHsContentInfo, + RWidgetRegistryClientSession* aRegistryClientSession ) + { + // analyse the widget type + if ( aHsContentInfo.Type() == KContentTemplate ) + { + iWidgetType = CWmWidgetData::ECps; // wrt widgets included in this gategory + } + else if ( aHsContentInfo.Type() == KContentWidget ) + { + iWidgetType = CWmWidgetData::ENative; + } + + // duplicate the content info locally + iHsContentInfo = aHsContentInfo.CloneL(); + + iImageConverter = CWmImageConverter::NewL( this ); + + FetchPublisherUidL( aRegistryClientSession ); + + // start decoding the icon + iIdle = CIdle::NewL( CActive::EPriorityLow ); + iIdle->Start( TCallBack( HandleAsyncIconString, this ) ); + } + + +// --------------------------------------------------------- +// CWmWidgetData::~CWmWidgetData +// --------------------------------------------------------- +// +CWmWidgetData::~CWmWidgetData() + { + if ( iIdle && iIdle->IsActive() ) + { + iIdle->Cancel(); + } + delete iIdle; + SetObserver( NULL ); + delete iLogoImage; + delete iLogoImageMask; + delete iImageConverter; + delete iHsContentInfo; + } + +// --------------------------------------------------------- +// CWmWidgetData::SetObserver +// --------------------------------------------------------- +// +void CWmWidgetData::SetObserver( MWmWidgetDataObserver* aObserver ) + { + iObserver = aObserver; + } + +// --------------------------------------------------------- +// CWmWidgetData::SetObserver +// --------------------------------------------------------- +// +void CWmWidgetData::SetPersistentWidgetOrder( + const CWmPersistentWidgetOrder* aPersistentWidgetOrder ) + { + iPersistentWidgetOrder = aPersistentWidgetOrder; + } + +// --------------------------------------------------------- +// CWmWidgetData::EqualsTo +// --------------------------------------------------------- +// +TBool CWmWidgetData::EqualsTo( CHsContentInfo& aContentInfo ) + { + return ( + HsContentInfo().Uid() == aContentInfo.Uid() && + HsContentInfo().PublisherId() == aContentInfo.PublisherId() ); + } + +// --------------------------------------------------------- +// CWmWidgetData::CompareByName +// --------------------------------------------------------- +// +TInt CWmWidgetData::CompareByName( + const CWmWidgetData& aDataOne, const CWmWidgetData& aDataTwo ) + { + // negate the result for ascending alphabetical order + TInt result = aDataOne.Name().CompareC( aDataTwo.Name() ); + return result; + } + +// --------------------------------------------------------- +// CWmWidgetData::CompareByPersistentWidgetOrder +// --------------------------------------------------------- +// +TInt CWmWidgetData::CompareByPersistentWidgetOrder( + const CWmWidgetData& aDataOne, const CWmWidgetData& 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; + } + +// --------------------------------------------------------- +// 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(); + FireDataChanged(); + } + } + +// --------------------------------------------------------- +// CWmWidgetData::HandleIconStringL +// --------------------------------------------------------- +// +void CWmWidgetData::HandleIconStringL( const TDesC& aIconStr ) + { + HBufC* iconStr = NULL; + if ( aIconStr.Length() == 0 && + iPublisherUid != KNullUid ) + { + // workaround for wrt widgets icon + _LIT( KUidTag, "uid(0x%x)" ); + const TInt KLength = 32; + iconStr = HBufC::NewLC( KLength ); + iconStr->Des().Format( KUidTag, iPublisherUid.iUid ); + } + else + { + iconStr = aIconStr.AllocLC(); + } + + TSize size( iLogoSize ); + if ( iLogoImage ) { size = iLogoImage->SizeInPixels(); } + if ( size != iLogoSize && + iLogoSize.iWidth > 0 && iLogoSize.iHeight > 0 ) + { + size = iLogoSize; + } + iImageConverter->HandleIconStringL( + size.iWidth, size.iHeight, *iconStr ); + + CleanupStack::PopAndDestroy( iconStr ); + } + +// --------------------------------------------------------- +// CWmWidgetData::FireDataChanged +// --------------------------------------------------------- +// +void CWmWidgetData::FireDataChanged() + { + if ( iObserver ) + { + iObserver->HandleWidgetDataChanged( this ); + } + } + +// ---------------------------------------------------- +// CWmWidgetData::UidFromString +// ---------------------------------------------------- +// +TUid CWmWidgetData::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; + } + +// ---------------------------------------------------- +// CWmWidgetData::PublisherUid +// ---------------------------------------------------- +// +TUid CWmWidgetData::PublisherUid() + { + return iPublisherUid; + } + +// ---------------------------------------------------- +// CWmWidgetData::FetchPublisherUidL +// ---------------------------------------------------- +// +void CWmWidgetData::FetchPublisherUidL( + RWidgetRegistryClientSession* aRegistryClientSession ) + { + if ( iPublisherUid == KNullUid && + PublisherId() != KNullDesC && + iWidgetType != CWmWidgetData::ENative && + aRegistryClientSession ) + { + TInt widgetUid = aRegistryClientSession->GetWidgetUidL( PublisherId() ); + iPublisherUid = ( widgetUid != 0 ? TUid::Uid(widgetUid) : KNullUid ); + } + } +// ---------------------------------------------------- +// CWmWidgetData::SetLogoSize +// ---------------------------------------------------- +// +void CWmWidgetData::SetLogoSize( const TSize& aSize ) + { + iLogoSize = aSize; + if ( iImageConverter ) + { + iImageConverter->SetLogoSize( aSize ); + } + } + +// --------------------------------------------------------- +// CWmWidgetData::HandleAsyncIconString +// --------------------------------------------------------- +// +TInt CWmWidgetData::HandleAsyncIconString( TAny* aPtr ) + { + CWmWidgetData* self = static_cast< CWmWidgetData* >( aPtr ); + if ( self->iIdle->IsActive() ) + { + self->iIdle->Cancel(); + } + TRAP_IGNORE( self->HandleIconStringL( + self->HsContentInfo().IconPath() ); ); + return KErrNone; + } + +// --------------------------------------------------------- +// CWmWidgetData::ReCreateLogo +// --------------------------------------------------------- +// +void CWmWidgetData::ReCreateLogo( const TSize& aSize ) + { + TSize imageSize( iLogoSize ); + if ( iLogoImage ) { imageSize = iLogoImage->SizeInPixels(); } + if ( (aSize != iLogoSize) || (imageSize != iLogoSize) ) + { + iLogoSize = aSize; + + delete iLogoImage; + iLogoImage = NULL; + delete iLogoImageMask; + iLogoImageMask = NULL; + + if ( iIdle && !iIdle->IsActive() ) + { + // start decoding the icon + iIdle->Start( TCallBack( HandleAsyncIconString, this ) ); + } + } + } + +// End of file + diff -r 000000000000 -r f72a12da539e widgetmanager/src/wmwidgetloaderao.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/src/wmwidgetloaderao.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,256 @@ +/* +* 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: +* Active object to load widgets into list +* +*/ + +// INCLUDE FILES +#include "wmcommon.h" +#include "wmplugin.h" +#include "wmresourceloader.h" +#include "wmpersistentwidgetorder.h" +#include "wmlistbox.h" +#include "wmwidgetloaderao.h" + +#include <hscontentcontroller.h> // content control api +#include <hscontentinfoarray.h> // content control api +#include <WidgetRegistryClient.h> // widget reqistry + + +// --------------------------------------------------------------------------- +// CWmWidgetLoaderAo::NewL +// --------------------------------------------------------------------------- +// +CWmWidgetLoaderAo* CWmWidgetLoaderAo::NewL( + CWmPlugin& aWmPlugin, + CWmListBox& aTargetList ) + { + CWmWidgetLoaderAo* self = new (ELeave) CWmWidgetLoaderAo( + aWmPlugin, aTargetList ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CWmWidgetLoaderAo::NewL +// --------------------------------------------------------------------------- +// +CWmWidgetLoaderAo::CWmWidgetLoaderAo( + CWmPlugin& aWmPlugin, + CWmListBox& aTargetList ) + : CAsyncOneShot( EPriorityLow ) + , iWmPlugin( aWmPlugin ) + , iWidgetsList( aTargetList ) + { + iWidgetRegistry = NULL; + iWidgetOrder = NULL; + } + +// --------------------------------------------------------------------------- +// CWmWidgetLoaderAo::ConstructL +// --------------------------------------------------------------------------- +// +void CWmWidgetLoaderAo::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// CWmWidgetLoaderAo::~CWmWidgetLoaderAo +// --------------------------------------------------------------------------- +// +CWmWidgetLoaderAo::~CWmWidgetLoaderAo() + { + // cancel ongoing operation + Cancel(); + + // cleanup run data + Cleanup(); + + } + +// --------------------------------------------------------------------------- +// CWmWidgetLoaderAo::StartLoading +// --------------------------------------------------------------------------- +// +void CWmWidgetLoaderAo::StartLoading() + { + if ( IsActive() ) + { + // cancel ongoing process + Cancel(); + } + Call(); + } + +// --------------------------------------------------------------------------- +// CWmWidgetLoaderAo::RunL +// --------------------------------------------------------------------------- +// +void CWmWidgetLoaderAo::RunL() + { + DoLoadWidgetsL(); + Cleanup(); + } + +// --------------------------------------------------------------------------- +// CWmWidgetLoaderAo::RunError +// --------------------------------------------------------------------------- +// +TInt CWmWidgetLoaderAo::RunError( TInt /*aError*/ ) + { + Cleanup(); + return KErrNone; + } + +// --------------------------------------------------------- +// CWmWidgetLoaderAo::DoLoadWidgetsL +// --------------------------------------------------------- +// +void CWmWidgetLoaderAo::DoLoadWidgetsL() + { + // 1. mark all the existing widgets initially non-valid + for( TInt i=0; i<iWidgetsList.WidgetDataCount(); ++i ) + iWidgetsList.WidgetData(i).SetValid( EFalse ); + + // 2. load the widgets array + MHsContentController& controller = iWmPlugin.ContentController(); + CHsContentInfoArray* contentInfoArray = CHsContentInfoArray::NewL(); + CleanupStack::PushL( contentInfoArray ); + controller.WidgetListL( *contentInfoArray ); + + // 3. load the widget order + iWidgetOrder = CWmPersistentWidgetOrder::NewL( iWmPlugin.FileServer() ); + TRAPD( loadError, iWidgetOrder->LoadL() ); + + // 4. loop through the content array and compare it against the existing + // widget data. + TInt widgetsAdded = 0; + for ( TInt i=0; i < contentInfoArray->Array().Count(); i++ ) + { + CHsContentInfo* contentInfo = contentInfoArray->Array()[i]; + + // check if this widget exists. + // if it does, keep the existing one + // if it does not, add it + CWmWidgetData* existingData = FindWidgetData( *contentInfo ); + if ( existingData ) + { + // keep the existing one + existingData->SetValid( ETrue ); + } + else + { + // add a new one + AddWidgetDataL( *contentInfo ); + ++widgetsAdded; + } + } + + // if widgets were added, extend the listbox + if ( widgetsAdded ) + iWidgetsList.HandleItemAdditionL(); + + // 5: finally, remove all UI widgets that during the loading process were + // NOT marked as VALID. those widgets do not exist anymore. + TInt widgetsRemoved = 0; + for( TInt i=0; i<iWidgetsList.WidgetDataCount(); i++ ) + { + if( !iWidgetsList.WidgetData(i).IsValid() ) + { + iWidgetsList.RemoveWidgetData( i ); + ++widgetsRemoved; + } + } + + // 6: cleanup + CleanupStack::PopAndDestroy( contentInfoArray ); + + // 7. redraw list + if ( widgetsAdded > 0 || widgetsRemoved > 0 ) + { + iWidgetsList.DrawDeferred(); + } + + // 8. store list order if necessary + if ( loadError != KErrNone || widgetsAdded > 0 || widgetsRemoved > 0 ) + { + iWidgetOrder->StoreL( iWidgetsList.WidgetDataArray() ); + } + + } + +// --------------------------------------------------------- +// CWmWidgetLoaderAo::FindWidgetDataL +// --------------------------------------------------------- +// +CWmWidgetData* CWmWidgetLoaderAo::FindWidgetData( + CHsContentInfo& aContentInfo ) + { + CWmWidgetData* data = NULL; + for( TInt i=0; i<iWidgetsList.WidgetDataCount() && !data; ++i ) + { + if ( iWidgetsList.WidgetData(i).EqualsTo( aContentInfo ) ) + { + data = &iWidgetsList.WidgetData(i); + } + } + return data; + } + +// --------------------------------------------------------- +// CWmWidgetLoaderAo::AddWidgetDataL +// --------------------------------------------------------- +// +void CWmWidgetLoaderAo::AddWidgetDataL( + CHsContentInfo& aContentInfo ) + { + if ( !iWidgetRegistry ) + { + iWidgetRegistry = new (ELeave) RWidgetRegistryClientSession(); + User::LeaveIfError( iWidgetRegistry->Connect() ); + } + + CWmWidgetData* widgetData = CWmWidgetData::NewLC( + aContentInfo, iWidgetRegistry ); + widgetData->SetPersistentWidgetOrder( iWidgetOrder ); + widgetData->SetValid( ETrue ); + iWidgetsList.AddWidgetDataL( widgetData ); + CleanupStack::Pop( widgetData ); + } + +// --------------------------------------------------------------------------- +// CWmWidgetLoaderAo::Cleanup +// --------------------------------------------------------------------------- +// +void CWmWidgetLoaderAo::Cleanup() + { + // disconnect widget registry + if ( iWidgetRegistry ) + { + iWidgetRegistry->Disconnect(); + iWidgetRegistry->Close(); + delete iWidgetRegistry; + iWidgetRegistry = NULL; + } + + // delete widget order + delete iWidgetOrder; + iWidgetOrder = NULL; + } + +// end of file + diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/bwins/wmunittestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/bwins/wmunittestu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &) + diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/conf/ui_wmunittest.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/conf/ui_wmunittest.cfg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,776 @@ +//------------------------------------------------------------------------------- +// constants +//------------------------------------------------------------------------------- +// +[Define] + +TRUE 1 +FALSE 0 + +OK 0 +FAIL -1 + +MAX_WIDGET_AMOUNT 1000 // non-functional requirement + +EUnrecognized 0 +EUidIcon 1 +ESvgIcon 2 +ESkinIcon 3 +EMifIcon 4 +ESkinAndMifIcon 5 +EImageIcon 6 + +[Enddefine] + +//------------------------------------------------------------------------------- +// Test cases for the plugin +//------------------------------------------------------------------------------- +// + + +// Tests WmPlugin construction +[Test] +title WmPlugin create/delete +create wmunittest test +test HeapSet +test PluginCreate +pause 500 +test PluginDelete +test HeapCheck +delete test +[Endtest] + +// Heap usage logging +[Test] +title WmPlugin memcon test +create wmunittest test +test HeapSet +test LogHeap "before wm" +test PluginCreate +test LogHeap "wm Active" +// +test SetMass 10 +test PluginActivate +pause 500 +test LogHeap "10 widgets" +// +test SetMass 20 +test PluginWidgetsChanged +pause 250 +test LogHeap "20 widgets" +// +test SetMass 30 +test PluginWidgetsChanged +pause 250 +test LogHeap "30 widgets" +// +test SetMass 40 +test PluginWidgetsChanged +pause 250 +test LogHeap "40 widgets" +// +test SetMass 50 +test PluginWidgetsChanged +pause 250 +test LogHeap "50 widgets" +// +test SetMass 60 +test PluginWidgetsChanged +pause 250 +test LogHeap "60 widgets" +// +test SetMass 70 +test PluginWidgetsChanged +pause 250 +test LogHeap "70 widgets" +// +test SetMass 80 +test PluginWidgetsChanged +pause 250 +test LogHeap "80 widgets" +// +test SetMass 90 +test PluginWidgetsChanged +pause 250 +test LogHeap "90 widgets" +// +test SetMass 100 +test PluginWidgetsChanged +pause 250 +test LogHeap "100 widgets" +// +test SetMass 200 +test PluginWidgetsChanged +pause 250 +test LogHeap "200 widgets" +// +test SetMass 300 +test PluginWidgetsChanged +pause 250 +test LogHeap "300 widgets" +// +test SetMass 400 +test PluginWidgetsChanged +pause 250 +test LogHeap "400 widgets" +// +test SetMass 500 +test PluginWidgetsChanged +pause 250 +test LogHeap "500 widgets" +// +test PluginDeactivate +pause 250 +test LogHeap "wm deactive" +// +test PluginDeactivate +pause 500 +test PluginDelete +test HeapCheck +test LogHeap "after wm" +delete test +[Endtest] + +// Tests WmPlugin Activate method +[Test] +title WmPlugin activate/deactivate +create wmunittest test +test HeapSet +test PluginCreate +test SetMass 10 +test PluginActivate +pause 500 +test PluginDeactivate +pause 500 +test PluginDelete +test HeapCheck +delete test +[Endtest] + +// Tests WmPlugin NotifyWidgetListChanged with no change at all +[Test] +title WmPlugin notify nochange +create wmunittest test +test HeapSet +test PluginCreate +test SetMass 10 +test PluginActivate +pause 500 +test SetMass 10 +test PluginWidgetsChanged +pause 500 +test PluginDeactivate +pause 500 +test PluginDelete +test HeapCheck +delete test +[Endtest] + +// Tests WmPlugin NotifyWidgetListChanged 10->11 widgets +[Test] +title WmPlugin notify 10->11 +create wmunittest test +test HeapSet +test PluginCreate +test SetMass 10 +test PluginActivate +pause 500 +test SetMass 11 +test PluginWidgetsChanged +pause 500 +test PluginDeactivate +pause 500 +test PluginDelete +test HeapCheck +delete test +[Endtest] + +// Tests WmPlugin NotifyWidgetListChanged 10->9 widgets +[Test] +title WmPlugin notify 10->9 +create wmunittest test +test HeapSet +test PluginCreate +test SetMass 10 +test PluginActivate +pause 500 +test SetMass 9 +test PluginWidgetsChanged +pause 500 +test PluginDeactivate +pause 500 +test PluginDelete +test HeapCheck +delete test +[Endtest] + +// Tests WmPlugin NotifyWidgetListChanged 0->10 widgets +[Test] +title WmPlugin notify 0->10 +create wmunittest test +test HeapSet +test PluginCreate +test SetMass 0 +test PluginActivate +pause 500 +test SetMass 10 +test PluginWidgetsChanged +pause 500 +test PluginDeactivate +pause 500 +test PluginDelete +test HeapCheck +delete test +[Endtest] + +// Tests WmPlugin NotifyWidgetListChanged 10->0 widgets +[Test] +title WmPlugin notify 10->0 +create wmunittest test +test HeapSet +test PluginCreate +test SetMass 10 +test PluginActivate +pause 500 +test SetMass 0 +test PluginWidgetsChanged +pause 500 +test PluginDeactivate +pause 500 +test PluginDelete +test HeapCheck +delete test +[Endtest] + +// Tests WmPlugin NotifyWidgetListChanged with ridiculous amount of widgets +// testing the OOM error handling +[Test] +title WmPlugin notify OOM +create wmunittest test +test HeapSet +test PluginCreate +test SetMass 10 +test PluginActivate +pause 500 +test SetMass 10000 +test PluginWidgetsChanged +pause 500 +test PluginDeactivate +pause 500 +test PluginDelete +test HeapCheck +delete test +[Endtest] + +// Tests WmPlugin with large data amount +[Test] +title WmPlugin capacity +create wmunittest test +test HeapSet +test PluginCreate +test SetMass MAX_WIDGET_AMOUNT +test PluginActivate +pause 3000 +test PluginDelete +test HeapCheck +delete test +[Endtest] + +// Tests WmPlugin by notifying widget list changed hundreds of times +// with different widget amounts and different timeouts. Target is to +// interrupt the previous update process test that it is cancelled ok +[Test] +title WmPlugin robustness +create wmunittest test +test HeapSet +test PluginCreate +test SetMass 5 +test PluginActivate +pause 500 +loop 100 +test SetMass 10 +test PluginWidgetsChanged +pause 10 +test SetMass 15 +test PluginWidgetsChanged +pause 90 +test SetMass 11 +test PluginWidgetsChanged +pause 50 +test SetMass 16 +test PluginWidgetsChanged +pause 120 +endloop +test PluginDeactivate +pause 500 +test PluginDelete +test HeapCheck +delete test +[Endtest] + +//------------------------------------------------------------------------------- +// Test cases for the persistent widget order +//------------------------------------------------------------------------------- +// + +// Tests persistent widget order NewL method +[Test] +title Widget order create +create wmunittest test +test HeapSet +test WidgetOrderCreate +test WidgetOrderCheckIsEmpty TRUE +test WidgetOrderDelete +test HeapCheck +delete test +[Endtest] + +// Test persistent widget order STORE method +[Test] +title Widget order store +create wmunittest test +test HeapSet +test WidgetOrderCreate +test WidgetOrderCheckIsEmpty TRUE +test SetMass 5 +test WidgetOrderSave +test WidgetOrderCheckIsEmpty FALSE +test WidgetOrderDelete +test HeapCheck +delete test +[Endtest] + +// Test persistent widget order STORE method when storing an empty array +[Test] +title Widget order store empty +create wmunittest test +test HeapSet +test WidgetOrderCreate +test WidgetOrderCheckIsEmpty TRUE +test SetMass 0 +test WidgetOrderSave +test WidgetOrderCheckIsEmpty TRUE +test WidgetOrderDelete +test HeapCheck +delete test +[Endtest] + + +// Tests persistent widget order LOAD method +[Test] +title Widget order load +create wmunittest test +test HeapSet +test WidgetOrderCreate +test SetMass 5 +test WidgetOrderSave +test WidgetOrderCheckIsEmpty 0 +test WidgetOrderDelete +test WidgetOrderCreate +test WidgetOrderLoad +test WidgetOrderCheckIsEmpty 0 +test WidgetOrderDelete +test HeapCheck +delete test +[Endtest] + +// Tests persistent widget order LOAD method when count is ZERO +[Test] +title Widget order load empty +create wmunittest test +test HeapSet +test WidgetOrderCreate +test SetMass 0 +test WidgetOrderSave +test WidgetOrderCheckIsEmpty TRUE +test WidgetOrderDelete +test WidgetOrderCreate +test WidgetOrderLoad +test WidgetOrderCheckIsEmpty TRUE +test WidgetOrderDelete +test HeapCheck +delete test +[Endtest] + +// Tests persistent widget order INDEXOF method +[Test] +title Widget order use +create wmunittest test +test HeapSet +test WidgetOrderCreate +test SetMass 8 +test WidgetOrderSave +test WidgetOrderCheckIsEmpty FALSE +test WidgetOrderUse +test WidgetOrderDelete +test HeapCheck +delete test +[Endtest] + +// Tests persistent widget order INDEXOF method when class is empty +[Test] +title Widget order use empty +create wmunittest test +test HeapSet +test WidgetOrderCreate +test WidgetOrderCheckIsEmpty TRUE +test SetMass 0 +test WidgetOrderUse +test WidgetOrderDelete +test HeapCheck +delete test +[Endtest] + +// Tests persistent widget order with large data amount +[Test] +title Widget order capacity +create wmunittest test +test HeapSet +test WidgetOrderCreate +test SetMass MAX_WIDGET_AMOUNT +test WidgetOrderSave +test WidgetOrderDelete +test WidgetOrderCreate +test WidgetOrderLoad +test SetMass MAX_WIDGET_AMOUNT +test WidgetOrderUse +test WidgetOrderDelete +test HeapCheck +delete test +[Endtest] + +// Tests persistent widget order save & load 100 times in sequence +[Test] +title Widget order robustness +create wmunittest test +test HeapSet +test WidgetOrderCreate +test SetMass 100 +loop 100 +test WidgetOrderSave +endloop +test WidgetOrderDelete +test WidgetOrderCreate +test SetMass 100 +loop 100 +test WidgetOrderLoad +endloop +test WidgetOrderUse +test WidgetOrderDelete +test HeapCheck +delete test +[Endtest] + + +//------------------------------------------------------------------------------- +// Test cases for the image converter +//------------------------------------------------------------------------------- +// + +// Tests image converter NewL method +[Test] +title Image converter create delete +create wmunittest test +test HeapSet +test ImageConverterCreate +test ImageConverterConversionMethod EUnrecognized +test ImageConverterDelete +test HeapCheck +delete test +[Endtest] + +// Tests malformed icon string +[Test] +title malformed image formats +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 "mif ( c:\testframework\wmunittest\wmlogo\logo.mif 16384 16385)" +test ImageConverterWaitResult FAIL +test ImageConverterConvert "skin( 0x100056c6 0x86 ):mif ( c:\testframework\wmunittest\wmlogo\logo.mif 16384 16385 )" +test ImageConverterWaitResult FAIL +test ImageConverterConvert "skin ( 0x101f84b7 0x1000594D ) : mif ( c:\testframework\wmunittest\wmlogo\logo.mif 16384 16385 )" +test ImageConverterWaitResult FAIL +test ImageConverterConvert " uid(0x10005901 )" +test ImageConverterWaitResult FAIL +test ImageConverterConvert "uid (268458241 )" +test ImageConverterWaitResult FAIL +test ImageConverterConvert "uid (0x10005901)" +test ImageConverterWaitResult FAIL +test ImageConverterDelete +test HeapCheck +delete test +[Endtest] + + +// Tests image converter with skin syntax +[Test] +title Image converter skin +create wmunittest test +test HeapSet +test ImageConverterCreate +test ImageConverterConvert "skin(0x101F86E3 0x100d)" +test ImageConverterWaitResult OK +test ImageConverterConversionMethod ESkinIcon +test ImageConverterDelete +test HeapCheck +delete test +[Endtest] + +// Tests image converter skin method with null skin item ids +[Test] +title Image converter skin (null) +create wmunittest test +test HeapSet +test ImageConverterCreate +test ImageConverterConvert "skin(0 0)" +test ImageConverterWaitResult FAIL +test ImageConverterDelete +test HeapCheck +delete test +[Endtest] + +// Tests image converter with skin/mif syntax +[Test] +title Image converter skin/mif +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 ImageConverterDelete +test HeapCheck +delete test +[Endtest] + +// Tests image converter mif method +[Test] +title Image converter mif +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 ImageConverterDelete +test HeapCheck +delete test +[Endtest] + +// Tests image converter mif method with invalid path +[Test] +title Image converter mif (invalid path) +create wmunittest test +test HeapSet +test ImageConverterCreate +test ImageConverterConvert "mif(c:\blabla.mif 16384 16385)" +test ImageConverterWaitResult FAIL +test ImageConverterDelete +test HeapCheck +delete test +[Endtest] + +// Tests image converter mif method with invalid bitmap & mask ids +[Test] +title Image converter mif (invalid ids) +create wmunittest test +test HeapSet +test ImageConverterCreate +test ImageConverterConvert "mif(c:\testframework\wmunittest\wmlogo\logo.mif 1 2)" +test ImageConverterWaitResult FAIL +test ImageConverterDelete +test HeapCheck +delete test +[Endtest] + +// Tests image converter uid method +[Test] +title Image converter uid +create wmunittest test +test HeapSet +test ImageConverterCreate +test ImageConverterConvert "uid(0x10005901)" +test ImageConverterWaitResult OK +test ImageConverterConversionMethod EUidIcon +test ImageConverterDelete +test HeapCheck +delete test +[Endtest] + +// Tests image converter uid method with null uid +[Test] +title Image converter uid (null) +create wmunittest test +test HeapSet +test ImageConverterCreate +test ImageConverterConvert "uid(0x0)" +test ImageConverterWaitResult FAIL +test ImageConverterDelete +test HeapCheck +delete test +[Endtest] + +// Tests image converter uid method with wrt widget uid. +[Test] +title Image converter wrt widget +create wmunittest test +test HeapSet +test InstallWrtWidget "c:\testframework\wmunittest\wmlogo\test.wgz" +test ImageConverterCreate +test ImageConverterConvert "uid(0x2000DAD2)" +test ImageConverterWaitResult OK +test ImageConverterConversionMethod EUidIcon +test ImageConverterDelete +test UninstallWrtWidget "0x2000DAD2" +test HeapCheck +delete test +[Endtest] + +// Tests image converter svg method +[Test] +title Image converter svg +create wmunittest test +test HeapSet +test ImageConverterCreate +test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logo.svg" +test ImageConverterWaitResult OK +test ImageConverterConversionMethod ESvgIcon +test ImageConverterDelete +test HeapCheck +delete test +[Endtest] + +// Tests image converter svg method corrupt file. +[Test] +title Image converter svg (corrupted) +create wmunittest test +test HeapSet +test ImageConverterCreate +test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logocorrupt.svg" +test ImageConverterWaitResult FAIL +test ImageConverterConversionMethod ESvgIcon +test ImageConverterDelete +test HeapCheck +delete test +[Endtest] + +// Tests image converter png method +[Test] +title Image converter png +create wmunittest test +test HeapSet +test ImageConverterCreate +test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logo.png" +test ImageConverterWaitResult OK +test ImageConverterConversionMethod EImageIcon +test ImageConverterDelete +test HeapCheck +delete test +[Endtest] + +// Tests image converter png method corrupt file. +[Test] +title Image converter png (corrupted) +create wmunittest test +test HeapSet +test ImageConverterCreate +test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logocorrupt.png" +test ImageConverterWaitResult FAIL +test ImageConverterDelete +test HeapCheck +delete test +[Endtest] + +// Tests image converter jpeg method +[Test] +title Image converter jpeg +create wmunittest test +test HeapSet +test ImageConverterCreate +test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logo.jpg" +test ImageConverterWaitResult OK +test ImageConverterConversionMethod EImageIcon +test ImageConverterDelete +test HeapCheck +delete test +[Endtest] + +// Tests image converter jpeg method +[Test] +title Image converter jpeg (corrupted) +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 +[Test] +title Image converter cancel +create wmunittest test +test HeapSet +test ImageConverterCreate +test ImageConverterConvert "c:\testframework\wmunittest\wmlogo\logo.svg" +test CancelConvert +test ImageConverterWaitResult FAIL +test ImageConverterDelete +test HeapCheck +delete test +[Endtest] + + +//------------------------------------------------------------------------------- +// Misc Test cases +//------------------------------------------------------------------------------- +// + +// Tests error note +[Test] +title Other error note +create wmunittest test +test HeapSet +test PluginCreate +test PluginActivate +test ErrorPopup +pause 3000 +test PluginDelete +test HeapCheck +delete test +[Endtest] + +/* +// Test for heikki to play :) +[Test] +title WmPlugin 1h test +create wmunittest test +test HeapSet +test PluginCreate +test SetMass 500 +test PluginActivate +pause 3600000 +test PluginDelete +test HeapCheck +delete test +[Endtest] +*/ + + diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/conf/wmunittest.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/conf/wmunittest.bat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,19 @@ +rem /* +rem * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem * All rights reserved. +rem * This component and the accompanying materials are made available +rem * under the terms of "Eclipse Public License v1.0" +rem * which accompanies this distribution, and is available +rem * at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem * +rem * Initial Contributors: +rem * Nokia Corporation - initial contribution. +rem * +rem * Contributors: +rem * +rem * Description: +rem * +rem */ + +ATSInterface.exe -testmodule TestScripter -config c:\testframework\ui_wmunittest.cfg + diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/conf/wmunittest.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/conf/wmunittest.ini Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,188 @@ +# +# This is STIF initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# + XML, Test report will be xml type, for example 'TestReport.xml'. +# Note, that xml format is available only when output is set to FILE. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. +# - Sets a device reset module's dll name(Reboot). +# + If Nokia specific reset module is not available or it is not correct one +# StifHWResetStub module may use as a template for user specific reset +# module. +# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation +# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02 +# + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', + # 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= C:\LOGS\TestFramework\ +TestReportFileName= WidgetManager + +TestReportFormat= TXT # Possible values: TXT, HTML or XML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +DisableMeasurement= stifmeasurementdisablenone # Possible values are: + # 'stifmeasurementdisablenone', 'stifmeasurementdisableall' + # 'stifmeasurementplugin01', 'stifmeasurementplugin02', + # 'stifmeasurementplugin03', 'stifmeasurementplugin04', + # 'stifmeasurementplugin05' or 'stifbappeaprofiler' + +Timeout= 0 # Default timeout value for each test case. In milliseconds +UITestingSupport= YES # Possible values: YES or NO +#SeparateProcesses= YES # Possible values: YES or NO (default: NO) +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# Widget manager unit tests +[New_Module] +ModuleName= testscripter +TestCaseFile= c:\testframework\ui_wmunittest.cfg +[End_Module] + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIF logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\\LOGS\\Module\\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# +# - Will write log file in unicode format. +# + YES, Log file will be written in unicode format +# + NO, Log will be written as normal, not unicode, file. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' +#NOTE: TestEngine and TestServer logging settings cannot change here + +#CreateLogDirectories= YES # Possible values: YES or NO + +#EmulatorBasePath= C:\LOGS\TestFramework\ +#EmulatorFormat= HTML # Possible values: TXT or HTML +#EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +#HardwareBasePath= D:\LOGS\TestFramework\ +#HardwareFormat= HTML # Possible values: TXT or HTML +#HardwareOutput= FILE # Possible values: FILE or RDEBUG + +#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +#ThreadIdToLogFile= YES # Possible values: YES or NO +#WithTimeStamp= YES # Possible values: YES or NO +#WithLineBreak= YES # Possible values: YES or NO +#WithEventRanking= YES # Possible values: YES or NO + +#FileUnicode= YES # Possible values: YES or NO +#AddTestCaseTitle= YES # Possible values: YES or NO +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set filters to be used by ConsoleUI. +# If you want to use filter with ConsoleUI, simply remove comments +# from section below and provide valid filter entries. +# Each filter line has to start with "filter= " keyword. +# Filter can contain special wildcard characters: +# * which stands for none or any literal; +# ? which stands for single character. +# Filters are not case-sensitive. + +#[Filters] +#filter= *math* +#filter= *radio* +#[End_Filters] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/data/wmlogo/logo.jpg Binary file widgetmanager/tsrc/wmunittest/data/wmlogo/logo.jpg has changed diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/data/wmlogo/logo.mif Binary file widgetmanager/tsrc/wmunittest/data/wmlogo/logo.mif has changed diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/data/wmlogo/logo.png Binary file widgetmanager/tsrc/wmunittest/data/wmlogo/logo.png has changed diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/data/wmlogo/logo.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/data/wmlogo/logo.svg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="32px" + height="32px" + id="svg2466" + sodipodi:version="0.32" + inkscape:version="0.46" + sodipodi:docname="drawing.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs2468"> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 16 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="32 : 16 : 1" + inkscape:persp3d-origin="16 : 10.666667 : 1" + id="perspective2474" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="15.938205" + inkscape:cx="9.927765" + inkscape:cy="10.627086" + inkscape:current-layer="layer1" + showgrid="true" + inkscape:grid-bbox="true" + inkscape:document-units="px" + inkscape:window-width="1680" + inkscape:window-height="1031" + inkscape:window-x="0" + inkscape:window-y="0" /> + <metadata + id="metadata2471"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1" + inkscape:label="Layer 1" + inkscape:groupmode="layer"> + <image + y="5.765738" + x="-0.030936712" + id="image2462" + height="18.19879" + width="31.139833" + sodipodi:absref="Y:\HS_Domain\homescreen\idlehomescreen\data\qhd_tch\shortcut2_2001f484\gfx\shortcut2logo.png" + xlink:href="Y:\HS_Domain\homescreen\idlehomescreen\data\qhd_tch\shortcut2_2001f484\gfx\shortcut2logo.png" + transform="matrix(1,0,2.5955691e-2,0.9996631,0,0)" /> + </g> +</svg> diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/data/wmlogo/logocorrupt.jpg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/data/wmlogo/logocorrupt.jpg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,13 @@ + JFIF  ` ` 6Exif II*     & JZP `N:ym C%0A +~5;ܬz9բs7(dU =]_.%P 93̧_dPh +l8,2> W9>Mɮ\te ?~jATۍz;桹 YoI, fI]Q,X +)\{S幭*5*| i l #^ʮYC،׍8o@$_ױ>RzY|Tr>)-k$ v~o@GGlnU^O^`l1qsֱ5MrO +S@eViCn󥋩 +ſu9RA b0n{Jʲ Z(W:t(N<wF o Fj˶?o %8 V1OҪZ |+VIOғ(qޞ$:_jJ8s)q |}|&)V}ҍ[h@$luYN>LW7Q0/͏*ϛZ<zN]KHd[(hN'PjW[6ȿyARem/o}7}m82 +\ϙrlr Q]k2%l;<rE?5&ȟ2q? ko4Ց!=܄dG̬ RP rngy ǚg|#-ԗֱuQʜ I; 9 +Nןsɝ)Sm=k+@**FV3ee=5wZO"85Znu%^ѷ߱R+CHnNe2 $;5 +V7X)gǭq6LDg`*I vU +qIǥ|mX:i(.nf:xx*z43[!^ysuqg7X2O?G^\׊t.o3>e{}IBi- r ?L~5 Rrwf$(0QE s߄b9#Q{-%[HKv 8?νB<Vˎ3 \,v m"%|?O)(+Ή(ld[77X}ɮpU (=h +ZJ(# ^g_ ^peuhًla$PVtfxmNPeb $~#vO([wU +Z'e⺺(mʫ^gy巃4fYi.d^33` +$ Q +u-Bi G Ѝ]5JI  R MyJ7x _?UP x K ߣ QE /_?UP x /(/{ ~ G_*( K ߣ Rf{E ~ E f{E ~ G_*( _ T ߣ QE /_*?UP = G /{ ~ E  x *( K ߣ Rf{E ~ E f{E ~ K = G ? _ T ߣ QE /? _ TQ@_*h ⨢/{ ~ G_*( K ߣ Rf{E ~ E /Lh ⨢ "9>j|_RI'<E  \ No newline at end of file diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/data/wmlogo/logocorrupt.png --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/data/wmlogo/logocorrupt.png Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,23 @@ +PNG + + IHDR < W #n| sRGB  gAMA a cHRM z& u0 ` : pQ< IDATx^Xٺ5{=3 !4@=3ą@1 ݝ Wu@&YOujZw__~]Wՠ>/=VCw{c@S{yȺ cosH8o z eˮԔVVrlF-D#׃^TMzO0Bס3WڇNi=_n@m~׿oq3טCiZu4t-)HLKLL R2Pa@LtqTLYYBi5z!#9 }>rs>9=/dd~n^'>ǁﷺI e 06Ecg@[ndqu 9<1w>'l7AO;P ځj>/oߤ1E?ꗁ>fG. [[RS YT]Vá7d⠶"Z-&'hH(|jh~@@EٟM;|o֤O"I,j  "A*7-b$-D+>9.|?~N/i ^_(56}&x %菴l1_~+\}vj4TVVŕ]=7xJhАRVTFĵۛ::;;[:n[OЌA`  śE +@I[I5</ +~5,&ч-6B=@Oz|gS&OfYؘ;>9]<{k7aGddҸ/[6L,3&g3PM{lڭG7ylԼ+,vw oE?-tk!K,q.x_.3܂;LSsj2O`]'݊}VZ ]07o`R7V2b☳W]Q]x7R .r-wgϞ㗽x$]\ZX.955qix0<rk=sk2k}R|9~B0nKG-kbϑKF-u]vH0Z$%WьHOH bsԨG[PD`8H+lD +Ʈ&zs]Tmw!h mtmC;k I!xn^L#t,bD?D9G-?|;..[Tͯ-/E*H4YZ mrTlbD4 iUɟFHfyCȴzF,xO|W{kon5wM5)(MTJjܘQGӐM-x^n=cu Q׭Y`|0vy(-Xp9L>d윙K|=ß=rx1C'#ɓ켜?!G{{Gʥw;0u} +8> [Qb n0Ti_ WsMPhp>Rr+ZdL-ĕkdVZq2j%]8zEeÖX;lЕ.CW: _:b瘥N\쬰NS縬Ԃ>?%-FIZ+N} ́-; {c<x̘|ۉ_5jP+K/s#SU+CM;UvJ3IuGVvNNNҮ$Uf|礛OBW%BXI˯Jhq1_y7n=u0ԝ+/~s[d<y_zۏS~r<?5CƏn_x7~s}C!nsk?̼iqsG=qg:a,D:~8#fymBb\!c i8EiXXIʚJЀHGR<e"fqzqQJaa2(O.$ E%)y)9)IiH7TH%)IeiIY__j 9U[:ɽ[;jh>   #cr4KZMۿik ~ -/!86?)89ieHleEyꚚ⒲¼‚<uyٚ(O&1QEa܄a  _Wm9}ų,8vsC:wCݲ}x_V_xb*iN5}ޮz'^ o_amvЇAn=pᛧ>}<}"+I+T[y>vޱ[go`wXSP|=[cƮawjjڡ5vE=M+ +5]+ZsgƎpMZ?]+XsG3§kh=mtm\oƎKu_x>(3$*<:&/0"(_"&z^3<$k֭eU&mmrs S4L{+=9~,p z?=iQ -}?j+?~0xs$<29Oy0l3 d7ϴ#1N5t/ϸ +IPyZIo'lZ{AIZ*Ko^pymO_|sovg8sƹ7޾uSn҅WN\vҵ3_8K\xx܃o!&pڹ7.]uԅӧ.]tmKg/a&laz9D!Y1H" lq}O=5E7$$T&'9 16x%{[{p2EĘ/, _0D +1 p/ro쀈WObc0a8 @ ~ءݫw K +꧿~y + |.(b0t$#3%NvP{Nc#]sc]K]Vv@I?}86s28h Hc8yK&sRəga@7FFnL$HgT3HvcbGiRC{jon!>-kua7*q*WQET-YߥW!JRiwf8A +'5:5 C瀀R?׉*@8KZrA#^2Z<ZxfVYn9 L>8X/*Ē12(B@]~[k"ƋFl2SB {L)d.^JNա"^I3 PM!əG1++O RC09 +> (o-Jf )Ɣ/<,~%@5j269(O@S0*|[҂9@LTnPNjU=M*̀ )viOi}`O9?'h[{ fn}`\2;J'Gg| &4r\49M%94׈|+"ȿ5#gDIK:Q!+מ93}LvgHɸ4'S-_4@^AS\&$8\)se @#~Wd,EZ t~Yz_S\f=Y"΀LԢgr $7)oј5`҂i?6?N]? &XCWo{H SV蟴p 70Š(~] 2٠1 %Z" U?zq*#i?檤zHscbVVLڏ3"KСC9tA/a#L a3fLOtAopG͊CgTQԂC%m}@?D=&4kbR=Ƈ=@TdYt +bU 6+֓H8u%cK@*/ +9 ,Q%8x_IB/+ i`lH| ߒz(T%߼IZhbda1HfKi{G1?ЕGF2Äli +b@o~cI1WMqV1< t9SOG`7$T}i(w)JjPsʲ1}>5"^Ғ% `#ET +5KZ꽂LcL .QtESsV$o!ׂQovϼ\K@ +X<*uXdbwi O=ƤߤSS1x:ȈZ$0@8t"E2Ċ3qR([Xjl'I]$ u*{v~h/UH\> AV0VPapdi&mZ,B  +sĀAD~uWPO[@ηjϯuU;|~ͻ7vhYT. +kLc!Zȇ *8 AEwSS\:?[]_o/_}~ͻ; +m,( xmZu*TH 0Cu$fH@~Su 0@]G +@uOW}vh|:6@@d@ *cx +- Q񙊼k1>~U}a{_-9}~A#@߷/ԧHZrS+%ЂpDiЍ)K3Їh#3|=]z'oח'4@ۿTwQ!A i{pHK Xhl6@s][@k;;`:_>&84*ta ^g<b IENDB` \ No newline at end of file diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/data/wmlogo/logocorrupt.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/data/wmlogo/logocorrupt.svg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + id="svg2466" + inkscape:version="0.46" + sodipodi:docname="drawing.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1" + inkscape:label="Layer 1" + inkscape:groupmode="layer"> + id="image2462" + height="18.19879" + width="31.139833" + sodipodi:absref="Y:\HS_Domain\homescreen\idlehomescreen\data\qhd_tch\shortcut2_2001f484\gfx\shortcut2logo.png" + xlink:href="Y:\HS_Domain\homescreen\idlehomescreen\data\qhd_tch\shortcut2_2001f484\gfx\shortcut2logo.png" + transform="matrix(1,0,2.5955691e-2,0.9996631,0,0)" /> + </g> +</svg> diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/data/wmlogo/test.wgz Binary file widgetmanager/tsrc/wmunittest/data/wmlogo/test.wgz has changed diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/eabi/wmunittestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/eabi/wmunittestu.def Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/group/Create_sisx.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/group/Create_sisx.bat Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,19 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +rem Create wm sis&sisx files +makesis wmunittest.pkg +signsis wmunittest.SIS wmunittest.SISX Nokia_RnDCert_02.der Nokia_RnDCert_02.key diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/group/Nokia_RnDCert_02.der Binary file widgetmanager/tsrc/wmunittest/group/Nokia_RnDCert_02.der has changed diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/group/Nokia_RnDCert_02.key --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/group/Nokia_RnDCert_02.key Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,15 @@ +-----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 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/group/bld.inf Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,39 @@ +/* +* 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: +* Widget manager unit tests +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTEXPORTS +// test case configuration +../conf/wmunittest.bat /epoc32/winscw/c/wmunittest.bat +../conf/wmunittest.ini /epoc32/winscw/c/testframework/testframework.ini +../conf/ui_wmunittest.cfg /epoc32/winscw/c/testframework/ui_wmunittest.cfg +// test data +../data/wmlogo/logo.jpg /epoc32/winscw/c/testframework/wmunittest/wmlogo/logo.jpg +../data/wmlogo/logo.mif /epoc32/winscw/c/testframework/wmunittest/wmlogo/logo.mif +../data/wmlogo/logo.png /epoc32/winscw/c/testframework/wmunittest/wmlogo/logo.png +../data/wmlogo/logo.svg /epoc32/winscw/c/testframework/wmunittest/wmlogo/logo.svg +../data/wmlogo/logocorrupt.jpg /epoc32/winscw/c/testframework/wmunittest/wmlogo/logocorrupt.jpg +../data/wmlogo/logocorrupt.png /epoc32/winscw/c/testframework/wmunittest/wmlogo/logocorrupt.png +../data/wmlogo/logocorrupt.svg /epoc32/winscw/c/testframework/wmunittest/wmlogo/logocorrupt.svg +../data/wmlogo/test.wgz /epoc32/winscw/c/testframework/wmunittest/wmlogo/test.wgz + +PRJ_TESTMMPFILES +wmunittest.mmp + +// End of File diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/group/wmunittest.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/group/wmunittest.mmp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MMP file for STIF Test Framework's TestScripter +* testclass test module. +* +*/ + +#include <data_caging_paths.hrh> +#include <platform_paths.hrh> +#include <bldvariant.hrh> + +TARGET wmunittest.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E3 + +CAPABILITY ALL -TCB +VENDORID VID_DEFAULT +SECUREID 0x101FB3E3 + +DEFFILE wmunittest.def + +USERINCLUDE ../inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/libc +SYSTEMINCLUDE /epoc32/include/ecom + +SOURCEPATH ../../../src +SOURCE wmplugin.cpp +SOURCE wmresourceloader.cpp +SOURCE wmmaincontainer.cpp +SOURCE wmmaincontainerview.cpp +SOURCE wmwidgetdata.cpp +SOURCE wmlistbox.cpp +SOURCE wmimageconverter.cpp +SOURCE wmiconfileprovider.cpp +SOURCE wmpersistentwidgetorder.cpp +SOURCE wmeffectmanager.cpp +SOURCE wmdetailsdlg.cpp +SOURCE wmwidgetloaderao.cpp + +SOURCEPATH ../src +SOURCE wmunittest.cpp +SOURCE wmunittest_all.cpp +SOURCE wmunittest_plugin.cpp +SOURCE wmunittest_sortorder.cpp +SOURCE wmunittest_converter.cpp + +// same as in widgetmanager.mmp +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY avkon.lib +LIBRARY eikcore.lib +LIBRARY estor.lib +LIBRARY eikcoctl.lib +LIBRARY eikctl.lib +LIBRARY eikdlg.lib +LIBRARY efsrv.lib // RFs +LIBRARY bafl.lib // BaflUtils +LIBRARY apgrfx.lib // RApaLsSession +LIBRARY commonengine.lib // StringLoader +LIBRARY aknicon.lib // AknIconUtility +LIBRARY imageconversion.lib // CImageDecoder +LIBRARY bitmaptransforms.lib // CBitmapScaler +LIBRARY fbscli.lib // CFbsBitmap +LIBRARY gdi.lib // CFont +LIBRARY egul.lib // TextUtils +LIBRARY ecom.lib // ECom fw +LIBRARY aknskins.lib // AknsDrawUtils +LIBRARY aknskinsrv.lib // AknsDrawUtils +LIBRARY aknswallpaperutils.lib // AknsDrawUtils +LIBRARY hscontentcontrol.lib // CHsContentControlUi +LIBRARY apparc.lib // CApaCommandLine +LIBRARY aknlayout.lib // avkon layout +LIBRARY aknlayout2scalable.lib // scalable avkon layout +LIBRARY swinstcli.lib // widget uninstall +LIBRARY hscontentinfo.lib // CHsContentInfo +LIBRARY platformenv.lib // DriveInfo::GetDefaultDrive +LIBRARY svgengine.lib // CSvgEngineInterfaceImpl +LIBRARY gfxtrans.lib // effect manager +LIBRARY ws32.lib //WindowSession +LIBRARY widgetregistryclient.lib // WidgetRegistryClient +LIBRARY hlplch.lib // HlpLauncher +LIBRARY sysutil.lib // diskspace +LIBRARY featmgr.lib // FeatureManager +LIBRARY etext.lib + + +// libraries needed by the test framework +LIBRARY stiftestinterface.lib + +// End of File diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/group/wmunittest.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/group/wmunittest.pkg Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,51 @@ +; +; 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: +; +; Installation file for STIF +; + +; Languages +&EN + +; Provide value for uid +#{"STIF"},(0x101FB3E3),1,1,0,TYPE=SA + +; Series60 product id for S60 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + + +; Install files + +"\epoc32\release\armv5\udeb\wmunittest.dll" - "!:\sys\bin\wmunittest.dll" + +"..\conf\wmunittest.bat" - "!:\wmunittest.bat" +"..\conf\wmunittest.ini" - "!:\testframework\testframework2.ini" +"..\conf\ui_wmunittest.cfg" - "!:\testframework\ui_wmunittest.cfg" + +"..\data\wmlogo\logo.jpg" - "!:\testframework\wmunittest\wmlogo\logo.jpg" +"..\data\wmlogo\logo.mif" - "!:\testframework\wmunittest\wmlogo\logo.mif" +"..\data\wmlogo\logo.png" - "!:\testframework\wmunittest\wmlogo\logo.png" +"..\data\wmlogo\logo.svg" - "!:\testframework\wmunittest\wmlogo\logo.svg" +"..\data\wmlogo\logocorrupt.jpg" - "!:\testframework\wmunittest\wmlogo\logocorrupt.jpg" +"..\data\wmlogo\logocorrupt.png" - "!:\testframework\wmunittest\wmlogo\logocorrupt.png" +"..\data\wmlogo\logocorrupt.svg" - "!:\testframework\wmunittest\wmlogo\logocorrupt.svg" +"..\data\wmlogo\test.wgz" - "!:\testframework\wmunittest\wmlogo\test.wgz" + diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/inc/wmunittest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/inc/wmunittest.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,205 @@ +/* +* 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: STIF testclass declaration +* +*/ + +#ifndef WMUNITTEST_H +#define WMUNITTEST_H + +// INCLUDES +#include <stiflogger.h> +#include <testscripterinternal.h> +#include <stiftestmodule.h> +#include <testclassassert.h> +#include <s32file.h> // RFs + +#include "wmimageconverter.h" // MConverterObserver +#include <hscontentcontroller.h> + +// MACROS +#define TEST_CLASS_VERSION_MAJOR 0 +#define TEST_CLASS_VERSION_MINOR 0 +#define TEST_CLASS_VERSION_BUILD 0 + +// MACROS FOR THE TEST CASES +#define _LOG(a) iLog->Log(_L(a)) +#define _RETURN(a, b) iLog->Log(_L("\treturn: %d"),b); \ + iLog->Log(_L(a)); \ + return b; \ + +#define _CLEANUPCHECK_BEGIN \ + CBase* __check = new (ELeave) CBase(); \ + CleanupStack::PushL( __check ); + +#define _CLEANUPCHECK_END \ + CleanupStack::PopAndDestroy( __check ); + + +// Logging path & file +_LIT( KWmUnitTestLogPath, "\\logs\\testframework\\wmunittest\\" ); +_LIT( KWmUnitTestLogFile, "wmunittest.txt" ); + +// FORWARD DECLARATIONS +class CWmPlugin; +class CWmPersistentWidgetOrder; +class CWmImageConverter; +class CHsContentInfo; +class CHsContentInfoArray; +class RWidgetDataValues; + + +// CLASS DECLARATION +/** +* test class for STIF Test Framework TestScripter. +*/ +NONSHARABLE_CLASS(CWmUnitTest) : public CScriptBase, + public MConverterObserver, + public MHsContentController + { + public: // Constructors and destructor + /** static constructor */ + static CWmUnitTest* NewL( CTestModuleIf& aTestModuleIf ); + /** desctructor */ + ~CWmUnitTest(); + + private: // private stuff + /** default constructor */ + CWmUnitTest( CTestModuleIf& aTestModuleIf ); + /** 2nd phase constructor */ + void ConstructL(); + /** version check */ + void SendTestClassVersion(); + + public: // Test run API + + /** 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 ViewListL( CHsContentInfoArray& aArray ); + TInt AppListL( CHsContentInfoArray& aArray ); + TInt AddWidgetL( CHsContentInfo& aInfo ); + TInt RemoveWidgetL( CHsContentInfo& aInfo ); + TInt AddViewL( CHsContentInfo& aInfo ); + TInt RemoveViewL( CHsContentInfo& aInfo ); + TInt ActivateViewL( CHsContentInfo& aInfo ); + TInt ActivateAppL( CHsContentInfo& aInfo ); + + private: // Test methods + + // GENERAL + + // sets heap reference value + TInt HeapSetL( CStifItemParser& aItem ); + // Log heap usage to file + TInt LogHeapL( CStifItemParser& aItem ); + // compares heap against reference, logs warning if no match + TInt HeapCheckL( CStifItemParser& aItem ); + // sets the mass of data for next test case + TInt SetMassL( CStifItemParser& aItem ); + // install and uninstall wrt widget for tests + TInt InstallWrtWidgetL( CStifItemParser& aItem ); + TInt UninstallWrtWidgetL( CStifItemParser& aItem ); + // test error note + TInt ErrorPopupL( CStifItemParser& aItem ); + + // TESTING THE PLUGIN + + // creates the WM plugin + TInt PluginCreateL( CStifItemParser& aItem ); + // deletes WM plugin + TInt PluginDeleteL( CStifItemParser& aItem ); + // calls Activate method for WM plugin + TInt PluginActivateL( CStifItemParser& aItem ); + // calls Deactivate method for WM plugin + TInt PluginDeactivateL( CStifItemParser& aItem ); + // calls NotifyWidgetListChanged method for WM plugin + TInt PluginWidgetsChangedL( CStifItemParser& aItem ); + + // TESTING THE WIDGET SORTING AND ORDER + + // creates WM persistent widget order object + TInt WidgetOrderCreateL( CStifItemParser& aItem ); + // deletes WM persistent widget order object + TInt WidgetOrderDeleteL( CStifItemParser& aItem ); + // tests WM persistent widget order's LOAD method + TInt WidgetOrderLoadL( CStifItemParser& aItem ); + // tests WM persistent widget order's SAVE method + TInt WidgetOrderSaveL( CStifItemParser& aItem ); + // tests WM persistent widget order's SAVE method + TInt WidgetOrderCheckIsEmptyL( CStifItemParser& aItem ); + // calls WM persistent widget order's API methods + TInt WidgetOrderUseL( CStifItemParser& aItem ); + + // TESTING IMAGE CONVERSION ROUTINES + + // creates image converter object + TInt ImageConverterCreateL( CStifItemParser& aItem ); + // deletes image converter object + 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 + + void CreateContentInfoArrayL( CHsContentInfoArray& aArray, TInt aCount ); + void CreateWidgetDataArrayL( RWidgetDataValues& aArray, TInt aCount ); + + // file server + RFs iFs; + + // the WM plugin instance + CWmPlugin* iWmPlugin; + + // the WM persistent widget order instance + CWmPersistentWidgetOrder* iWmWidgetOrder; + + // the Image converter instance + CWmImageConverter* iImageConverter; + + // amount of heap allocated in HeapSet + TInt iHeapSize; + + // image converter response ready + TBool iConversionReady; + + // image converter result + TInt iConversionError; + + // switch for active schedular wait + TBool iWaiting; + + // multipurpose test data count + TInt iMass; + + }; + + +#endif // WMUNITTEST_H + +// End of File diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/src/wmunittest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/src/wmunittest.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,111 @@ +/* +* 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: This file contains testclass implementation. +* +*/ + +// INCLUDE FILES +#include <stiftestinterface.h> +#include <settingserverclient.h> + +#include "wmunittest.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CWmUnitTest::CWmUnitTest +// ----------------------------------------------------------------------------- +// +CWmUnitTest::CWmUnitTest( + CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::ConstructL +// ----------------------------------------------------------------------------- +// +void CWmUnitTest::ConstructL() + { + iLog = CStifLogger::NewL( KWmUnitTestLogPath, + KWmUnitTestLogFile, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + + SendTestClassVersion(); + + User::LeaveIfError( iFs.Connect() ); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::NewL +// ----------------------------------------------------------------------------- +// +CWmUnitTest* CWmUnitTest::NewL( + CTestModuleIf& aTestModuleIf ) + { + CWmUnitTest* self = new (ELeave) CWmUnitTest( aTestModuleIf ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::~CWmUnitTest +// ----------------------------------------------------------------------------- +// +CWmUnitTest::~CWmUnitTest() + { + // Delete logger + delete iLog; + // close file server + iFs.Close(); + } + +//----------------------------------------------------------------------------- +// CWmDeploymentClientTest::SendTestClassVersion +//----------------------------------------------------------------------------- +// +void CWmUnitTest::SendTestClassVersion() + { + TVersion moduleVersion; + moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; + moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; + moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; + + TFileName moduleName; + moduleName = _L("wmunittest.dll"); + + TBool newVersionOfMethod = ETrue; + TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL() - polymorphic Dll entry point. +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + return ( CScriptBase* ) CWmUnitTest::NewL( aTestModuleIf ); + } + + +// End of File diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/src/wmunittest_all.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/src/wmunittest_all.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,249 @@ +/* +* 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: list of all test blocks +* +*/ + +//INCLUDE FILES +#include <e32svr.h> +#include <stdlib.h> +#include <stifparser.h> +#include <stiftestinterface.h> +#include <bautils.h> +#include <aknsskininstance.h> +#include <swinstapi.h> +#include <swinstdefs.h> +#include <coemain.h> +#include <EIKENV.H> +#include "wmunittest.h" +#include "wmresourceloader.h" + +// CONSTANTS +_LIT( KHexPrefix, "0x" ); +_LIT8( KWrtMime, "application/x-nokia-widget"); + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CWmUnitTest::RunMethodL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::RunMethodL( + CStifItemParser& aItem ) + { + static TStifFunctionInfo const KFunctions[] = + { + // general test blocks + ENTRY( "HeapSet", CWmUnitTest::HeapSetL ), + ENTRY( "LogHeap", CWmUnitTest::LogHeapL ), + ENTRY( "HeapCheck", CWmUnitTest::HeapCheckL ), + ENTRY( "SetMass", CWmUnitTest::SetMassL ), + ENTRY( "ErrorPopup", CWmUnitTest::ErrorPopupL ), + + // install/uninstall wrt widget for test + ENTRY( "InstallWrtWidget", CWmUnitTest::InstallWrtWidgetL ), + ENTRY( "UninstallWrtWidget", CWmUnitTest::UninstallWrtWidgetL ), + + // test blocks for the plugin + ENTRY( "PluginCreate", CWmUnitTest::PluginCreateL ), + ENTRY( "PluginDelete", CWmUnitTest::PluginDeleteL ), + ENTRY( "PluginActivate", CWmUnitTest::PluginActivateL ), + ENTRY( "PluginDeactivate", CWmUnitTest::PluginDeactivateL ), + ENTRY( "PluginWidgetsChanged", CWmUnitTest::PluginWidgetsChangedL ), + + // test blocks for the persistent widget order class + ENTRY( "WidgetOrderCreate", CWmUnitTest::WidgetOrderCreateL ), + ENTRY( "WidgetOrderDelete", CWmUnitTest::WidgetOrderDeleteL ), + ENTRY( "WidgetOrderLoad", CWmUnitTest::WidgetOrderLoadL ), + ENTRY( "WidgetOrderSave", CWmUnitTest::WidgetOrderSaveL ), + ENTRY( "WidgetOrderCheckIsEmpty", CWmUnitTest::WidgetOrderCheckIsEmptyL ), + ENTRY( "WidgetOrderUse", CWmUnitTest::WidgetOrderUseL ), + + // test blocks for the image converter + ENTRY( "ImageConverterCreate", CWmUnitTest::ImageConverterCreateL ), + ENTRY( "ImageConverterDelete", CWmUnitTest::ImageConverterDeleteL ), + ENTRY( "ImageConverterConvert", CWmUnitTest::ImageConverterConvertL ), + ENTRY( "ImageConverterWaitResult", CWmUnitTest::ImageConverterWaitResultL ), + ENTRY( "ImageConverterConversionMethod", CWmUnitTest::ImageConverterConversionMethodL ), + ENTRY( "CancelConvert", CWmUnitTest::CancelConvertL ), + + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::HeapSetL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::HeapSetL( CStifItemParser& /*aItem*/ ) + { + User::Heap().AllocSize( iHeapSize ); + _RETURN("HeapSetL End", KErrNone); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::LogHeapL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::LogHeapL( CStifItemParser& aItem ) + { + TPtrC inputStr; + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + User::LeaveIfError( aItem.GetNextString( inputStr ) ); + + TInt size = 0; + User::Heap().AllocSize( size ); + iLog->Log( _L("Heap usage, %S: %d"), &inputStr, size ); + _RETURN("LogHeapL End", KErrNone); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::HeapCheckL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::HeapCheckL( CStifItemParser& /*aItem*/ ) + { + TInt ret = KErrNone; + TInt heapSizeAtCheckpoint; + User::Heap().AllocSize( heapSizeAtCheckpoint ); + if ( iHeapSize != heapSizeAtCheckpoint ) + { + //ret = KErrTooBig; <-- not reliable + _LOG("Warning: potential memory leak detected!!!"); + } + _RETURN("HeapCheckL End", ret); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::SetMassL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::SetMassL( CStifItemParser& aItem ) + { + aItem.GetNextInt( iMass ); + _RETURN("SetMassL End", KErrNone); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::InstallWrtWidgetL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::InstallWrtWidgetL( CStifItemParser& aItem ) + { + TInt ret = KErrNone; + TPtrC inputStr; + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + User::LeaveIfError( aItem.GetNextString( inputStr ) ); + if ( inputStr.Length() == 0 ) User::Leave( KErrArgument ); + + // install widget + SwiUI::RSWInstSilentLauncher installer; + User::LeaveIfError( installer.Connect() ); + CleanupClosePushL( installer ); + + SwiUI::TInstallReqPckg installReqPckg; + SwiUI::TInstallOptions options; + TRequestStatus status = KRequestPending; + + options.iUpgrade = SwiUI::EPolicyAllowed; + options.iOptionalItems = SwiUI::EPolicyAllowed; + options.iOCSP = SwiUI::EPolicyAllowed; + options.iIgnoreOCSPWarnings = SwiUI::EPolicyAllowed; + options.iUntrusted = SwiUI::EPolicyAllowed; + options.iPackageInfo = SwiUI::EPolicyAllowed; + options.iCapabilities = SwiUI::EPolicyAllowed; + options.iKillApp = SwiUI::EPolicyAllowed; + options.iOverwrite = SwiUI::EPolicyAllowed; + options.iDownload = SwiUI::EPolicyAllowed; + options.iDrive = 'C'; + options.iLang = User::Language(); + options.iUsePhoneLang = ETrue; + options.iUpgradeData = SwiUI::EPolicyAllowed; + + SwiUI::TInstallOptionsPckg optionsPkg( options ); + installer.SilentInstall( status , inputStr, optionsPkg ); + User::WaitForRequest( status ); + ret = status.Int(); + CleanupStack::PopAndDestroy( &installer ); + _RETURN("InstallWrtWidgetL End", ret); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::UninstallWrtWidgetL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::UninstallWrtWidgetL( CStifItemParser& aItem ) + { + TInt ret = KErrNone; + TPtrC inputStr; + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + User::LeaveIfError( aItem.GetNextString( inputStr ) ); + if ( inputStr.Length() == 0 ) User::Leave( KErrArgument ); + + TUid uid; + TLex lex( inputStr ); + lex.SkipSpaceAndMark(); + TPtrC mtoken = lex.MarkedToken(); + TInt pos = mtoken.FindF( KHexPrefix ); + if ( pos == 0 ) + { + TLex lex( mtoken.Mid( KHexPrefix().Length() ) ); + TUint id = 0; + ret = lex.Val( id, EHex ); + uid = TUid::Uid( (TInt)id ); + } + else + { + TInt id( 0 ); + ret = lex.Val( id ); + uid.iUid = id; + } + + if ( ret == KErrNone ) + { + // Uninstall widget + SwiUI::RSWInstSilentLauncher installer; + User::LeaveIfError( installer.Connect() ); + CleanupClosePushL( installer ); + + TRequestStatus status = KRequestPending; + SwiUI::TUninstallOptions optionsUninstall; + optionsUninstall.iBreakDependency = SwiUI::EPolicyAllowed; + optionsUninstall.iKillApp = SwiUI::EPolicyAllowed; + SwiUI::TUninstallOptionsPckg uninstallOptionsPkg( optionsUninstall ); + + installer.SilentUninstall( status, uid, uninstallOptionsPkg, KWrtMime ); + User::WaitForRequest( status ); + CleanupStack::PopAndDestroy( &installer ); + } + + _RETURN("UninstallWrtWidgetL End", ret); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::ErrorPopup +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::ErrorPopupL( CStifItemParser& /*aItem*/ ) + { + CWmResourceLoader* res = CWmResourceLoader::NewL( *CEikonEnv::Static() ); + res->ErrorPopup(KErrNone); + delete res; + _RETURN("ErrorPopupL End", KErrNone); + } +// End of File diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/src/wmunittest_converter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/src/wmunittest_converter.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,164 @@ +/* +* 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: test blocks for CWmImageConverter +* +*/ + +//INCLUDE FILES +#include <e32svr.h> +#include <stdlib.h> +#include <stifparser.h> +#include <stiftestinterface.h> +#include <bautils.h> +#include <aknsskininstance.h> +#include "wmunittest.h" +// components to test +#include "wmimageconverter.h" + + +// ----------------------------------------------------------------------------- +// CWmUnitTest::ImageConverterCreateL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::ImageConverterCreateL( CStifItemParser& /*aItem*/ ) + { + if ( iImageConverter != 0 ) User::Leave( KErrArgument ); + TInt ret = KErrNone; + _CLEANUPCHECK_BEGIN + iImageConverter = CWmImageConverter::NewL( this ); + _CLEANUPCHECK_END + _RETURN("ImageConverterCreateL End", ret); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::ImageConverterDeleteL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::ImageConverterDeleteL( CStifItemParser& /*aItem*/ ) + { + if ( iImageConverter == 0 ) User::Leave( KErrArgument ); + TInt ret = KErrNone; + delete iImageConverter; + iImageConverter = 0; + _RETURN("ImageConverterDeleteL End", ret); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::ImageConverterConvertL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::ImageConverterConvertL( CStifItemParser& aItem ) + { + if ( iImageConverter == 0 ) User::Leave( KErrArgument ); + TInt ret = KErrNone; + iConversionReady = EFalse; + TPtrC inputStr; + + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + User::LeaveIfError( aItem.GetNextString( inputStr ) ); + if ( inputStr.Length() == 0 ) User::Leave( KErrArgument ); + + TRAPD( err, iImageConverter->HandleIconStringL( 40, 40, inputStr ) ); + if ( err != KErrNone ) + { + _LOG("ImageConverterConvertL:HandleIconStringL returns with leave"); + iConversionReady = ETrue; + iConversionError = err; + } + + _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 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/src/wmunittest_plugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/src/wmunittest_plugin.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,186 @@ +/* +* 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: test blocks for CWmPlugin +* +*/ + +//INCLUDE FILES +#include <e32svr.h> +#include <stdlib.h> +#include <stifparser.h> +#include <stiftestinterface.h> +#include <bautils.h> +#include <aknsskininstance.h> +#include "wmunittest.h" +// components to test +#include "wmplugin.h" +#include <hscontentinfo.h> +#include <hscontentinfoarray.h> + +// MACROS +#define _LOG(a) iLog->Log(_L(a)) +#define _RETURN(a, b) iLog->Log(_L("\treturn: %d"),b); \ + iLog->Log(_L(a)); \ + return b; \ + +#define _CLEANUPCHECK_BEGIN \ + CBase* __check = new (ELeave) CBase(); \ + CleanupStack::PushL( __check ); + +#define _CLEANUPCHECK_END \ + CleanupStack::PopAndDestroy( __check ); + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CWmUnitTest::PluginCreateL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::PluginCreateL( CStifItemParser& /*aItem*/ ) + { + if ( iWmPlugin != 0 ) User::Leave( KErrArgument ); + TInt ret = KErrNone; + _CLEANUPCHECK_BEGIN + iWmPlugin = CWmPlugin::NewL(); + iWmPlugin->SetContentController( this ); + _CLEANUPCHECK_END + _RETURN("PluginCreateL End", ret); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::PluginDeleteL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::PluginDeleteL( CStifItemParser& /*aItem*/ ) + { + if ( iWmPlugin == 0 ) User::Leave( KErrArgument ); + TInt ret = KErrNone; + delete iWmPlugin; + iWmPlugin = 0; + _RETURN("PluginDeleteL End", ret); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::PluginActivateL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::PluginActivateL( CStifItemParser& /*aItem*/ ) + { + if ( iWmPlugin == 0 ) User::Leave( KErrArgument ); + iWmPlugin->Activate(); + _RETURN("PluginActivateL End", KErrNone); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::PluginDeactivateL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::PluginDeactivateL( CStifItemParser& /*aItem*/ ) + { + if ( iWmPlugin == 0 ) User::Leave( KErrArgument ); + iWmPlugin->Deactivate(); + _RETURN("PluginActivateL End", KErrNone); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::PluginWidgetsChangedL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::PluginWidgetsChangedL( CStifItemParser& /*aItem*/ ) + { + if ( iWmPlugin == 0 ) User::Leave( KErrArgument ); + iWmPlugin->NotifyWidgetListChanged(); + _RETURN("PluginWidgetsChangedL End", KErrNone); + } + +// ============================================================================= +// Methods from MHsContentController +// ============================================================================= + +TInt CWmUnitTest::WidgetListL( CHsContentInfoArray& aArray ) + { + CreateContentInfoArrayL( aArray, iMass ); + return KErrNone; + } + +TInt CWmUnitTest::ViewListL( CHsContentInfoArray& /*aArray*/ ) + { + return KErrNone; + } + +TInt CWmUnitTest::AppListL( CHsContentInfoArray& /*aArray*/ ) + { + return KErrNone; + } + +TInt CWmUnitTest::AddWidgetL( CHsContentInfo& /*aInfo*/ ) + { + return KErrNone; + } + +TInt CWmUnitTest::RemoveWidgetL( CHsContentInfo& /*aInfo*/ ) + { + return KErrNone; + } + +TInt CWmUnitTest::AddViewL( CHsContentInfo& /*aInfo*/ ) + { + return KErrNone; + } + +TInt CWmUnitTest::RemoveViewL( CHsContentInfo& /*aInfo*/ ) + { + return KErrNone; + } + +TInt CWmUnitTest::ActivateViewL( CHsContentInfo& /*aInfo*/ ) + { + return KErrNone; + } + +TInt CWmUnitTest::ActivateAppL( CHsContentInfo& /*aInfo*/ ) + { + return KErrNone; + } + + + + +// ----------------------------------------------------------------------------- +// CWmUnitTest::CreateContentInfoArrayL +// ----------------------------------------------------------------------------- +// +void CWmUnitTest::CreateContentInfoArrayL( CHsContentInfoArray& aArray, TInt aCount ) + { + for( TInt i=0; i<aCount; ++i ) + { + CHsContentInfo* info = CHsContentInfo::NewLC(); + TBuf<64> name; + name.Format( _L("Widget_%d"), i ); + info->SetNameL( name ); + TBuf8<20> id; + id.Num( i ); + info->SetUidL( id ); + info->SetTypeL( _L8("template") ); + info->SetIconPathL( _L("uid(0x2000DAD2)") ); + info->SetCanBeAdded( ETrue ); + info->SetDescriptionL(_L("Default plaa plaa plaa plaa plaa plaa plaa")); + + aArray.Array().AppendL( info ); + CleanupStack::Pop( info ); + } + } + +// End of File diff -r 000000000000 -r f72a12da539e widgetmanager/tsrc/wmunittest/src/wmunittest_sortorder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetmanager/tsrc/wmunittest/src/wmunittest_sortorder.cpp Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,176 @@ +/* +* 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: test blocks for CWmPersistentWidgetorder +* +*/ + +//INCLUDE FILES +#include <e32svr.h> +#include <stdlib.h> +#include <stifparser.h> +#include <stiftestinterface.h> +#include <bautils.h> +#include <aknsskininstance.h> +#include "wmunittest.h" +// components to test +#include "wmpersistentwidgetorder.h" +#include "wmwidgetdata.h" +#include <hscontentinfo.h> +#include <hscontentinfoarray.h> +#include <widgetregistryclient.h> // widgetreqistry + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CWmUnitTest::WidgetOrderCreateL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::WidgetOrderCreateL( CStifItemParser& /*aItem*/ ) + { + if ( iWmWidgetOrder != 0 ) User::Leave( KErrArgument ); + TInt ret = KErrNone; + _CLEANUPCHECK_BEGIN + iWmWidgetOrder = CWmPersistentWidgetOrder::NewL( iFs ); + _CLEANUPCHECK_END + _RETURN("WidgetOrderCreateL End", ret); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::WidgetOrderDeleteL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::WidgetOrderDeleteL( CStifItemParser& /*aItem*/ ) + { + if ( iWmWidgetOrder == 0 ) User::Leave( KErrArgument ); + TInt ret = KErrNone; + delete iWmWidgetOrder; + iWmWidgetOrder = 0; + _RETURN("WidgetOrderDeleteL End", ret); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::WidgetOrderLoadL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::WidgetOrderLoadL( CStifItemParser& /*aItem*/ ) + { + if ( iWmWidgetOrder == 0 ) User::Leave( KErrArgument ); + TInt ret = KErrNone; + _CLEANUPCHECK_BEGIN + iWmWidgetOrder->LoadL(); + _CLEANUPCHECK_END + _RETURN("WidgetOrderLoadL End", ret); + } + + +// ----------------------------------------------------------------------------- +// CWmUnitTest::WidgetOrderSaveL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::WidgetOrderSaveL( CStifItemParser& /*aItem*/ ) + { + if ( iWmWidgetOrder == 0 ) User::Leave( KErrArgument ); + TInt ret = KErrNone; + + _CLEANUPCHECK_BEGIN + RWidgetDataValues array; + CleanupClosePushL( array ); + CreateWidgetDataArrayL( array, iMass ); + iWmWidgetOrder->StoreL( array ); + array.ResetAndDestroy(); + CleanupStack::Pop( &array ); + _CLEANUPCHECK_END + + _RETURN("WidgetOrderSaveL End", ret); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::WidgetOrderCheckIsEmptyL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::WidgetOrderCheckIsEmptyL( CStifItemParser& aItem ) + { + if ( iWmWidgetOrder == 0 ) User::Leave( KErrArgument ); + TInt ret = KErrNone; + TInt expectedResult; + aItem.GetNextInt( expectedResult ); + + if ( iWmWidgetOrder->IsEmpty() && !expectedResult ) + ret = KErrGeneral; + if ( !iWmWidgetOrder->IsEmpty() && expectedResult ) + ret = KErrGeneral; + + _RETURN("WidgetOrderCheckIsEmptyL End", ret); + } + +// ----------------------------------------------------------------------------- +// CWmUnitTest::WidgetOrderUseL +// ----------------------------------------------------------------------------- +// +TInt CWmUnitTest::WidgetOrderUseL( CStifItemParser& /*aItem*/ ) + { + if ( iWmWidgetOrder == 0 ) User::Leave( KErrArgument ); + TInt ret = KErrNone; + + _CLEANUPCHECK_BEGIN + // test IndexOf + RWidgetDataValues array; + CreateWidgetDataArrayL( array, iMass ); + for( TInt i=0; i<array.Count() && ret==KErrNone; ++i ) + { + TInt index = iWmWidgetOrder->IndexOf( *array[i] ); + if ( index < KErrNotFound || index >= array.Count() ) + ret = KErrUnknown; // illegal index + } + array.ResetAndDestroy(); + _CLEANUPCHECK_END + + _RETURN("WidgetOrderUseL End", ret); + } + + +// ----------------------------------------------------------------------------- +// CWmUnitTest::CreateWidgetDataArrayL +// ----------------------------------------------------------------------------- +// +void CWmUnitTest::CreateWidgetDataArrayL( RWidgetDataValues& aArray, TInt aCount ) + { + // first create an array of content info classes + CHsContentInfoArray* contentArray = CHsContentInfoArray::NewL(); + CleanupStack::PushL( contentArray ); + CreateContentInfoArrayL( *contentArray, aCount ); + // connect to widget registry + RWidgetRegistryClientSession registryClient; + User::LeaveIfError( registryClient.Connect() ); + CleanupClosePushL( registryClient ); + + for( TInt i=0; i<contentArray->Array().Count(); ++i ) + { + CWmWidgetData* data = CWmWidgetData::NewL( + *contentArray->Array()[i], ®istryClient); + CleanupStack::PushL( data ); + aArray.AppendL( data ); + CleanupStack::Pop( data ); + delete contentArray->Array()[i]; + contentArray->Array()[i] = 0; + } + + registryClient.Disconnect(); + CleanupStack::PopAndDestroy( ®istryClient ); + CleanupStack::PopAndDestroy( contentArray ); + } + + +// End of File