# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1282113607 -10800 # Node ID 4b195f3bea29f665089a6850b6c1b8961c51bb70 # Parent 2b1b11a301d283b44469786c16018ec7e9610acb Revision: 201031 Kit: 201033 diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreen.pro --- a/homescreen.pro Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreen.pro Wed Aug 18 09:40:07 2010 +0300 @@ -16,7 +16,9 @@ TEMPLATE = subdirs -SUBDIRS = homescreenapp +SUBDIRS += homescreenapp \ + homescreen_plat + symbian:SUBDIRS += screensaver CONFIG += ordered diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreen_plat/homescreen_plat.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/homescreen_plat.pro Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,24 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " + +include(homescreenclient_api/homescreenclient_api.pri) + +for(filename,PLATFORM_HEADERS){ + BLD_INF_RULES.prj_exports *= "$$filename APP_LAYER_PLATFORM_EXPORT_PATH($$basename(filename))" + } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreen_plat/homescreenclient_api/homescreenclient_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/homescreenclient_api/homescreenclient_api.metaxml Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,13 @@ + + + homescreenclient_api + Home screen API to create widgets, change wallpaper + c++ + homescreenapp + + + + no + no + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreen_plat/homescreenclient_api/homescreenclient_api.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/homescreenclient_api/homescreenclient_api.pri Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,18 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +PLATFORM_HEADERS += \ + homescreenclient_api/hsmenuclient.h \ No newline at end of file diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreen_plat/homescreenclient_api/hsmenuclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/homescreenclient_api/hsmenuclient.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: hsmenuclient.h + * + */ + +#ifndef HSMENUCLIENT_H +#define HSMENUCLIENT_H + +#include +#include +#include + +QTM_USE_NAMESPACE + +//mandatory keys +const QString hsItemName("item:name"); +// or for localized name +const QString hsItemLocName("item:locname"); + +const QString hsitemLaunchUri("item:launchuri"); +const QString hsitemPublisherId("item:publisherId"); + +//not mandatory +const QString hsItemWidgetUri("widget:uri"); +const QString hsItemDescription("item:description"); +// or for localized name +const QString hsItemLocDescription("item:locdescription"); + +//for icon - not mandatory +const QString hsIconFileName("icon:filename");//to display specific icon from file +const QString hsIconName("icon:name");// HbIcon +const QString hsIconApplicationId("icon:applicationid"); // icon from associated application + + +class HsMenuClientPrivate; + +class HsMenuClient : public QObject +{ + Q_OBJECT + +public: + HsMenuClient(QObject *parent = 0); + ~HsMenuClient(); +public slots: + bool add(const QVariantMap &entryPreference = QVariantMap()); + bool remove(const QVariantMap &queryPreference = QVariantMap()) const; + + QList getList(const QVariantMap &queryPreference = QVariantMap()); + +private: + Q_DISABLE_COPY(HsMenuClient) + /** + * Pointer to a private implementation. + */ + HsMenuClientPrivate * const m_d; +}; + + + +#endif // HSMENUCLIENT_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/common.pri --- a/homescreenapp/common.pri Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/common.pri Wed Aug 18 09:40:07 2010 +0300 @@ -1,4 +1,4 @@ -# + # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # This component and the accompanying materials are made available @@ -33,7 +33,7 @@ SUBDIRPART = release } -win32: OUTPUT_DIR = $$PWD/../../bin/$$SUBDIRPART +!symbian: OUTPUT_DIR = $$PWD/../../bin/$$SUBDIRPART symbian: OUTPUT_DIR = $$PWD/bin SOURCE_DIR = $$PWD/inc @@ -45,6 +45,7 @@ MOC_DIR = $$OUTPUT_DIR/tmp/$$TARGET/moc RCC_DIR = $$OUTPUT_DIR/tmp/$$TARGET/rcc UI_DIR = $$OUTPUT_DIR/tmp/$$TARGET/ui + CONFIG -= app_bundle } else { # test part is NOT DONE QT *= testlib CONFIG += console @@ -68,19 +69,16 @@ INCLUDEPATH += $$MOC_DIR TARGET.CAPABILITY = ALL -TCB TARGET.EPOCALLOWDLLDATA=1 -} - -win32 { +} else { # add platfrom API for windows INCLUDEPATH += \ - $$PWD/../../homescreensrv/homescreensrv_plat/contentstorage_api \ - $$PWD/../../homescreensrv/homescreensrv_plat/hswidgetmodel_api \ + $$PWD/../../homescreensrv/homescreensrv_plat/contentstorage_api \ $$PWD/../../homescreensrv/homescreensrv_plat/homescreen_information_api/inc } plugin: !isEmpty(PLUGIN_SUBDIR): DESTDIR = $$OUTPUT_DIR/$$PLUGIN_SUBDIR -win32: plugin { # copy manifiers +!symbian: plugin { # copy manifiers manifest.path = $$DESTDIR manifest.files = ./resource/*.manifest ./resource/*.xml manifest.CONFIG += no_build @@ -99,10 +97,6 @@ qtplugins.path = $$PLUGIN_SUBDIR qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin - - message(Remove "contains(MOBILITY, serviceframework)" after the QtSF refactorig is done!) - - !contains(MOBILITY, serviceframework):qtplugins.sources += resource/$${TARGET}.manifest hs_public_plugin { contains(MOBILITY, serviceframework):BLD_INF_RULES.prj_exports += "resource/$${TARGET}.xml z:/private/20022F35/$${TARGET}.xml" @@ -120,8 +114,7 @@ for(entry, entries) : BLD_INF_RULES.prj_exports += "./$$entry z:/$$replace(2, ^/,)/$$basename(entry)" } export ( BLD_INF_RULES.prj_exports) -} -win32 { +} else { name = $$replace(1, [/\\\\\.\*], _) eval ($${name}.path = $${OUTPUT_DIR}/$${2}) eval ($${name}.files = $$1) @@ -138,10 +131,11 @@ } } -!exists($${EPOCROOT}epoc32/include/platform/mw/XQSettingsManager) { - DEFINES += NO_QT_EXTENSIONS +symbian { + DEFINES += QT_EXTENSIONS } + # support for NFT nft:DEFINES += NFT diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/examples/batterywidgetplugin/resource/batterywidgetplugin.xml --- a/homescreenapp/examples/batterywidgetplugin/resource/batterywidgetplugin.xml Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/examples/batterywidgetplugin/resource/batterywidgetplugin.xml Wed Aug 18 09:40:07 2010 +0300 @@ -8,7 +8,5 @@ 1.0 Example of home screen widget - batterywidgetplugin.png - Battery diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/examples/batterywidgetplugin/sis/batterywidgetplugin.bat --- a/homescreenapp/examples/batterywidgetplugin/sis/batterywidgetplugin.bat Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/examples/batterywidgetplugin/sis/batterywidgetplugin.bat Wed Aug 18 09:40:07 2010 +0300 @@ -19,7 +19,7 @@ if exist batterywidgetplugin.sisx del batterywidgetplugin.sisx makesis batterywidgetplugin.pkg -signsis batterywidgetplugin.sis batterywidgetplugin.sisx ../../../../sis/rd.cer ../../../../sis/rd-key.pem +signsis batterywidgetplugin.sis batterywidgetplugin.sisx ../../../sis/rd.cer ../../../sis/rd-key.pem if exist batterywidgetplugin.sisx ( echo batterywidgetplugin.sisx creation SUCCEEDED diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/examples/minibrowserwidgetplugin/inc/minibrowserwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/examples/minibrowserwidgetplugin/inc/minibrowserwidget.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Example of home screen widget +* +*/ + +#ifndef MINIBROWSERWIDGET_H +#define MINIBROWSERWIDGET_H + +#include +class HbLineEdit; +class QGraphicsWebView; +class HbIconItem; +class HbPushButton; + +class MiniBrowserWidget : public HbWidget +{ + Q_OBJECT +// Start of snippet 1 + Q_PROPERTY(bool isOnline READ isOnline WRITE setOnline) +// End of snippet 1 +// Start of snippet 2 + Q_PROPERTY(QString url READ url WRITE setUrl) +// End of snippet 2 + +public: + MiniBrowserWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0); + ~MiniBrowserWidget(); + +public: + bool isOnline(); + void setOnline(bool online); + QString url() const; + void setUrl(const QString& url); + +public slots: + void onInitialize(); + void onShow(); + void onHide(); + +public slots: + void pressGoButton(); + void pressStopButton(); + void loadFinished(bool ok); + void loadProgress(int progress); + void loadStarted(); + +// Start of snippet 3 +signals: + void setPreferences(const QStringList &names); +// End of snippet 3 + +private: + Q_DISABLE_COPY(MiniBrowserWidget) + + HbPushButton *mGoButton; + HbPushButton *mStopButton; + HbLineEdit *mEditor; + QGraphicsWebView *mWeb; + HbIconItem *mSpinnerAnimationWidget; + bool mOnline; + QString mUrl; + +}; + +#endif // MINIBROWSERWIDGET_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/examples/minibrowserwidgetplugin/inc/minibrowserwidgetplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/examples/minibrowserwidgetplugin/inc/minibrowserwidgetplugin.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Example of home screen widget +* +*/ + +#ifndef MINIBROWSERWIDGETPLUGIN_H +#define MINIBROWSERWIDGETPLUGIN_H + +#include +#include + +QTM_USE_NAMESPACE +// Start of snippet 1 +class MiniBrowserWidgetPlugin : public QObject, public QServicePluginInterface +{ + Q_OBJECT + Q_INTERFACES(QtMobility::QServicePluginInterface) + +public: + QObject *createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session); +}; +// End of snippet 1 + +#endif // HELLOWORLDWIDGETPLUGIN_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/examples/minibrowserwidgetplugin/minibrowserwidgetplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/examples/minibrowserwidgetplugin/minibrowserwidgetplugin.pro Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,67 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Example of home screen widget +# + +TEMPLATE = lib +CONFIG += plugin mobility hb +MOBILITY = serviceframework + +QT += webkit + +HEADERS += ./inc/*.h +SOURCES += ./src/*.cpp + +INCLUDEPATH += ./inc + +symbian: { + + DESTDIR = /private/20022F35/import/widgetregistry/20022F6F + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + + TARGET.UID3 = 0x20022F6F + TARGET.EPOCALLOWDLLDATA=1 + TARGET.CAPABILITY = ALL -TCB + + plugins.path = $${DESTDIR} + plugins.sources = $${TARGET}.dll + + widgetResources.path = $${DESTDIR} + widgetResources.sources += resource/$${TARGET}.xml + widgetResources.sources += resource/$${TARGET}.manifest + widgetResources.sources += resource/$${TARGET}preview.png + widgetResources.sources += resource/$${TARGET}.svg + + DEPLOYMENT += plugins \ + widgetResources +} + +win32: { + + CONFIG(debug, debug|release) { + SUBDIRPART = debug + } else { + SUBDIRPART = release + } + + PLUGIN_SUBDIR = /private/20022F35/import/widgetregistry/20022F6F + + DESTDIR = $$PWD/../../../../bin/$${SUBDIRPART}/$${PLUGIN_SUBDIR} + + manifest.path = $${DESTDIR} + manifest.files = ./resource/*.manifest ./resource/*.xml ./resource/*.png ./resource/*.svg + + INSTALLS += manifest + +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/examples/minibrowserwidgetplugin/resource/minibrowserwidgetplugin.manifest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/examples/minibrowserwidgetplugin/resource/minibrowserwidgetplugin.manifest Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,10 @@ + + + minibrowserwidgetplugin + Mini browser + Home screen example widget + minibrowserwidgetplugin.svg + minibrowserwidgetpluginpreview.png + false + minibrowserwidgetplugin.xml + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/examples/minibrowserwidgetplugin/resource/minibrowserwidgetplugin.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/examples/minibrowserwidgetplugin/resource/minibrowserwidgetplugin.svg Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,1566 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Hello! + + + + + + eJzsvWmTHMeVIPgdZvgPtR/aTPrARISHxyVrG7M8ezVLiTKJmlFvzxitBBRJTAMFDI7WcH/9vtuf +e3hkZaFK3ZS6ygmi4Bnp4cfzdx//8H/97g9fbV+9+/PNV92muXr+7B/+Yf/h5vrTuw+/uqLuq1+/ +efP546cP2PWL3//yqoXH8Kntr6fv5Mn/dvPh4+t3t7+iz/jTE37/F9/efHh3e3N79f9cv/54vWmv +/scvjn/69qtvX998evfim89vPv+PX/7y6he/xOe/ff3pzQ1844+3n/C3V1+FX9pUYOjD9Sf4dHgx +vQhN21y1za+aeLX9DT6ye/f59tXr2x927/7Pr66+6gb604aIf/Dz//v1728+3vXQ4d3Lz29vbj/9 +7sO7lzcfP+7fvXn34eOvrvY/Xd9e/eb6B/jk+uqfb968efeXq92b65f/6r9zenf7CZ797bt/fX39 +h+vbj1/9/uaHz2+uP/hnfntz8+rm1Zknt7/uvzu9fnMD+/b2+tPVTLu4/XUbvtt9fv3m1W8/v/3z +DexobAbq776jKf7xI8wNpom/U//43a/fQtcfbj59gtXCu+gwfv9PO78w6KX2i3+B97+mo4Ut/p+/ +1JE/vHv/9vrDv37k56YJ/pOPvr15+/4NHAVtY4z2n34MC9Ad7jdNuPoqxHYTp6a/ij2ARjv3V12Y +oUe+kLb95t9e3/wFt+b2RnZj++HTH17/f7C6Nsam4f/LR7///Obmwx9vX+Nm8n7MvB+/effq5g18 +Iw1xenP9w0ddcJv+L098e/3hh5tPACDv3nz+RCA82Vtgz7++/ukG4aCVl3zz/ub223f/jab6VduO +m9BftX3Ev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uOBlGSDwt5+iFPtwGcH6Jng3yINYwP4Qf9 +En74fcrpX3Lmh7Sv+MO1s+zv/yf28apNGsyiNmUrK6ftt97lqP3xhedqvI3b/+nF2v0+Js72hvAq +9jbqjYGYe7Hx++B/sAQ/Mj5YWame1Bb++X8B1IaZMw== + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/examples/minibrowserwidgetplugin/resource/minibrowserwidgetplugin.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/examples/minibrowserwidgetplugin/resource/minibrowserwidgetplugin.xml Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,11 @@ + + + minibrowserwidgetplugin + minibrowserwidgetplugin + Example widget + + com.nokia.symbian.IHomeScreenWidget + 1.0 + Example of home screen widget + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/examples/minibrowserwidgetplugin/resource/minibrowserwidgetpluginpreview.png Binary file homescreenapp/examples/minibrowserwidgetplugin/resource/minibrowserwidgetpluginpreview.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/examples/minibrowserwidgetplugin/sis/minibrowserwidgetplugin.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/examples/minibrowserwidgetplugin/sis/minibrowserwidgetplugin.bat Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,30 @@ +@rem +@rem Copyright (c) 2010 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 +@echo off + +if exist minibrowserwidgetplugin.sisx del minibrowserwidgetplugin.sisx + +makesis minibrowserwidgetplugin.pkg +signsis minibrowserwidgetplugin.sis minibrowserwidgetplugin.sisx ../../../sis/rd.cer ../../../sis/rd-key.pem + +if exist minibrowserwidgetplugin.sisx ( +echo minibrowserwidgetplugin.sisx creation SUCCEEDED +del minibrowserwidgetplugin.sis +) + +if not exist minibrowserwidgetplugin.sisx ( +echo minibrowserwidgetplugin.sisx creation FAILED +) \ No newline at end of file diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/examples/minibrowserwidgetplugin/sis/minibrowserwidgetplugin.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/examples/minibrowserwidgetplugin/sis/minibrowserwidgetplugin.pkg Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,45 @@ +; +; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; + +; Language +&EN + +; SIS header: name, uid, version +#{"minibrowserwidgetplugin"},(0x20022F6F),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + +; Manual PKG pre-rules from PRO files +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + + +"../resource/minibrowserwidgetplugin.manifest" - "!:/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetplugin.manifest",FM,"application/hs-widget-uninstall+xml",RR,RW + +"/epoc32/release/armv5/urel/minibrowserwidgetplugin.dll" - "!:/sys/bin/minibrowserwidgetplugin.dll" +"/epoc32/data/z/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetplugin.qtplugin" - "!:/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetplugin.qtplugin" +"../resource/minibrowserwidgetplugin.manifest" - "!:/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetplugin.manifest" +"../resource/minibrowserwidgetplugin.xml" - "!:/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetplugin.xml" +"/epoc32/data/z/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetplugin.svg" - "!:/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetplugin.svg" +"/epoc32/data/z/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetpluginpreview.png" - "!:/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetpluginpreview.png" + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/examples/minibrowserwidgetplugin/sis/minibrowserwidgetplugin_winscw.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/examples/minibrowserwidgetplugin/sis/minibrowserwidgetplugin_winscw.pkg Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,44 @@ +; +; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; + +; Language +&EN + +; SIS header: name, uid, version +#{"minibrowserwidgetplugin"},(0x20022F6F),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + +; Manual PKG pre-rules from PRO files +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + + +"../resource/minibrowserwidgetplugin.manifest" - "!:/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetplugin.manifest",FM,"application/hs-widget-uninstall+xml",RR,RW + +"/epoc32/release/winscw/udeb/minibrowserwidgetplugin.dll" - "!:/sys/bin/minibrowserwidgetplugin.dll" +"/epoc32/data/z/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetplugin.qtplugin" - "!:/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetplugin.qtplugin" +"../resource/minibrowserwidgetplugin.manifest" - "!:/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetplugin.manifest" +"../resource/minibrowserwidgetplugin.xml" - "!:/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetplugin.xml" +"/epoc32/data/z/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetplugin.svg" - "!:/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetplugin.svg" +"/epoc32/data/z/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetpluginpreview.png" - "!:/private/20022F35/import/widgetregistry/20022F6F/minibrowserwidgetpluginpreview.png" diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/examples/minibrowserwidgetplugin/src/minibrowserwidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/examples/minibrowserwidgetplugin/src/minibrowserwidget.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,221 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Example of home screen widget +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "minibrowserwidget.h" + +/*! + \ingroup group_minibrowser_widget + \class MiniBrowserWidget + \brief Example implementation for home screen widget. + + MiniBrowserWidget derived from the HbWidget and implements + needed functions for the home screen widget. + As name suggests MiniBrowserWidget is a small web browser widget in + the home screen. + + Mini browser widget demonstrates the following home screen widget features: +
    +
  1. home screen online/offline state, see \ref sssection_isonline
  2. +
  3. preferences, see \ref sssection_setpreferences
  4. +
+ It also shows use of HbPushButton and HbLineEdit widgets. + @image html hs_minibrowser.png + + +*/ + +/*! + Constructs a widget which is a child of \a parent, with widget flags set to \a flags. + Widget creates two buttons ('go' and 'stop'), text field to write url and browser view. + Note that this is just an simple example so this creates child widgets directly to the layout. + For more complicated widget layouting, see Orbit documentation and especially WidgetML section of it. +*/ +MiniBrowserWidget::MiniBrowserWidget(QGraphicsItem* parent, Qt::WindowFlags flags) + : HbWidget(parent, flags) +{ + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); + setLayout(layout); + + QGraphicsLinearLayout *buttonLayout = new QGraphicsLinearLayout(Qt::Horizontal); + mGoButton = new HbPushButton("Go"); + connect(mGoButton, SIGNAL(pressed()), SLOT(pressGoButton())); + buttonLayout->addItem(mGoButton); + mStopButton = new HbPushButton("Stop"); + connect(mStopButton, SIGNAL(pressed()), SLOT(pressStopButton())); + buttonLayout->addItem(mStopButton); + mStopButton->setEnabled(false); + mEditor = new HbLineEdit(); + buttonLayout->addItem(mEditor); + + layout->addItem(buttonLayout); + + mWeb = new QGraphicsWebView(); + layout->addItem(mWeb); + + connect(mWeb, SIGNAL(loadStarted()), SLOT(loadStarted())); + connect(mWeb, SIGNAL(loadProgress(int)), SLOT(loadProgress(int))); + connect(mWeb, SIGNAL(loadFinished(bool)), SLOT(loadFinished(bool))); + + // maximum size of the home screen widget is (48,39) units. Convert units to pixels and + // resize minibrowser as maximum size + HbFrameDrawer *drawer = new HbFrameDrawer( + QLatin1String("qtg_fr_hsshortcut_normal"), HbFrameDrawer::NinePieces); + setBackgroundItem(new HbFrameItem(drawer)); + + HbDeviceProfile profile; + qreal factor = profile.unitValue(); + setPreferredSize(48*factor, 39*factor); + resize(preferredSize()); + + mUrl = QString("http://www.nokia.com"); +} + +/*! + Destructor +*/ +MiniBrowserWidget::~MiniBrowserWidget() +{ +} + +/*! + Returns widget's online state +*/ +// Start of snippet 1 +bool MiniBrowserWidget::isOnline() +{ + return mOnline; +} + +/*! + Sets online state of the widget as \a online +*/ +void MiniBrowserWidget::setOnline(bool online) +{ + mOnline = online; +} +// End of snippet 1 + +/*! + Returns url of the widget currently showing. +*/ +// Start of snippet 2 +QString MiniBrowserWidget::url() const +{ + return mUrl; +} + +/*! + Sets url of the widget as \a url +*/ +void MiniBrowserWidget::setUrl(const QString& url) +{ + mUrl = url; +} +// End of snippet 2 + +/*! + Called when widget is initialized and all to properties are set +*/ +void MiniBrowserWidget::onInitialize() +{ + mGoButton->setEnabled(mOnline); + mEditor->setText(mUrl); +} + +/*! + Called when widget is shown in the home screen +*/ +// Start of snippet 3 +void MiniBrowserWidget::onShow() +{ + if (mOnline) { + mWeb->load(QUrl(mUrl)); + mStopButton->setEnabled(true); + } +} +// End of snippet 3 + +/*! + Called when widget is hidden from the home screen. + Widget can decide what is appropriate action when + widget is not visible on the screen. At least it + should not update itself as often as when on the + screen to save battery etc. +*/ +// Start of snippet 4 +void MiniBrowserWidget::onHide() +{ + mWeb->stop(); +} +// End of snippet 4 + +/*! + Slot connected to 'go' button +*/ +// Start of snippet 5 +void MiniBrowserWidget::pressGoButton() +{ + setUrl(mEditor->text()); + if (mOnline) { + mWeb->load(QUrl(mUrl)); + mStopButton->setEnabled(true); + } + QStringList list; + list.append("url"); + emit setPreferences(list); +} +// End of snippet 5 + +/*! + Slot connected to 'stop' button +*/ +void MiniBrowserWidget::pressStopButton() +{ + mWeb->stop(); + //mStopButton->setEnabled(false); +} + +/*! + Slot connected to webview's loadProgress signal + TODO: check if this is needed. +*/ +void MiniBrowserWidget::loadProgress(int progress) +{ + Q_UNUSED(progress) + qDebug() << progress; +} + +/*! + Slot connected to webview's loadFinished signal +*/ +void MiniBrowserWidget::loadFinished(bool ok) +{ + Q_UNUSED(ok) + mStopButton->setEnabled(false); +} +void MiniBrowserWidget::loadStarted() +{ +} + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/examples/minibrowserwidgetplugin/src/minibrowserwidgetplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/examples/minibrowserwidgetplugin/src/minibrowserwidgetplugin.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Example of home screen widget +* +*/ + +#include +#include +#include + +#include "minibrowserwidgetplugin.h" +#include "minibrowserwidget.h" + +/*! + \ingroup group_minibrowser_widget + \class MiniBrowserWidgetPlugin + \brief Example implementation for home screen widget plugin. +*/ + +/*! + Initialize plugin for minibrowser widget. Contains necessary information about + the minibrowser widget that it can be loaded through QT Service Framework. +*/ +QObject *MiniBrowserWidgetPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session) +{ + Q_UNUSED(context); + Q_UNUSED(session); + + if (descriptor.interfaceName() == QLatin1String("com.nokia.symbian.IHomeScreenWidget")) { + return new MiniBrowserWidget(); + } else { + return 0; + } +} + +Q_EXPORT_PLUGIN2(minibrowserwidgetplugin, MiniBrowserWidgetPlugin) diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/homescreenapp.pro --- a/homescreenapp/homescreenapp.pro Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/homescreenapp.pro Wed Aug 18 09:40:07 2010 +0300 @@ -18,7 +18,6 @@ SUBDIRS += hsutils \ hsdomainmodel \ - runtimeplugins \ serviceproviders \ stateplugins \ widgetplugins \ @@ -27,10 +26,11 @@ symbian: { SUBDIRS += hshomescreenclientplugin \ - hswidgetuninstaller + hswidgetuninstaller \ + hsapplicationlauncher } -SUBDIRS += ./../tsrc +exists(./../tsrc/tsrc.pro): SUBDIRS += ./../tsrc CONFIG += ordered diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/conf/base/confml/CI_homescreendb.confml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/conf/base/confml/CI_homescreendb.confml Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1hsclockwidgetplugin + 2dialerwidgetplugin + 3ftuhswidget + 4hsshortcutwidgetplugin + 5hsshortcutwidgetplugin + 6hsshortcutwidgetplugin + 7hsshortcutwidgetplugin + 8hsshortcutwidgetplugin + 9hsshortcutwidgetplugin + 10hsshortcutwidgetplugin + 11hsshortcutwidgetplugin + 12hsshortcutwidgetplugin + 13hsshortcutwidgetplugin + portrait15800.0 + landscape15800.0 + portrait1362760.0 + landscape1361760.0 + portrait154000.0 + landscape3001500.0 + portrait15800.0 + portrait100800.0 + portrait185800.0 + portrait270800.0 + portrait151850.0 + portrait1001850.0 + portrait1851850.0 + portrait15800.0 + portrait100800.0 + portrait185800.0 + clockTypeAnalog + uid0x20022EF9 + uid0x10005901 + uid0x20029F80 + uid0x2001FE79 + uid0x10207C62 + uid0x10005951 + uid0x20025FD9 + uid0x102828D6 + uid0x101FB751 + uid0x100059EE + 10 + 21 + 32 + bounceEffect20 + widgetTapAndHoldTimeout500 + sceneTapAndHoldTimeout500 + pageChangeAnimationDuration200 + pageChangeZoneAnimationDuration800 + pageChangeZoneReverseAnimationDuration200 + pageRemovedAnimationDuration200 + newPageAddedAnimationDuration200 + widgetDragEffectDuration200 + widgetDropEffectDuration200 + defaultPageId1 + maximumPageCount8 + isShortcutLabelVisibletrue + bounceFeedbackEffectDistance3 + pageChangePanDistanceInPixels120 + tapAndHoldDistance16 + pageChangeZoneWidth60 + pageIndicatorSpacing8 + maximumWidgetHeight39 + maximumWidgetWidth48 + minimumWidgetHeight8.75 + minimumWidgetWidth8.75 + pageChangePanDistance17.91 + pageChangeFeedbackEffectSensitive + widgetPickFeedbackEffectItemPick + widgetDropFeedbackEffectItemDrop + widgetRepositionFeedbackEffectBounceEffect + widgetOverTrashbinFeedbackEffectItemMoveOver + widgetDropToTrashbinFeedbackEffectItemDrop + shortcutWidgetTapFeedbackEffectBasicItem + widgetMoveBlockedFeedbackEffectBasic + clockWidgetTapFeedbackEffectBasicItem + widgetSnappingFeedbackEffectItemMoveOver + isSnapEnabledtrue + snapTimeout100 + snapForce30 + snapGap6 + pageMargin0 + snapLineFadeInDuration200 + snapLineFadeOutDuration100 + isSnapEffectsEnabledtrue + sceneTypePageWallpapers + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/conf/base/confml/homescreendb.confml --- a/homescreenapp/hsapplication/conf/base/confml/homescreendb.confml Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsapplication/conf/base/confml/homescreendb.confml Wed Aug 18 09:40:07 2010 +0300 @@ -1,125 +1,127 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1hsclockwidgetplugin - 2hsdialerwidgetplugin - 3ftuhswidget - 4hsshortcutwidgetplugin - 5hsshortcutwidgetplugin - 6hsshortcutwidgetplugin - 7hsshortcutwidgetplugin - 8hsshortcutwidgetplugin - 9hsshortcutwidgetplugin - 10hsshortcutwidgetplugin - 11hsshortcutwidgetplugin - 12hsshortcutwidgetplugin - 13hsshortcutwidgetplugin - portrait15800.0 - landscape15800.0 - portrait1362760.0 - landscape1361760.0 - portrait154000.0 - landscape3001500.0 - portrait15800.0 - portrait100800.0 - portrait185800.0 - portrait270800.0 - portrait151850.0 - portrait1001850.0 - portrait1851850.0 - portrait15800.0 - portrait100800.0 - portrait185800.0 - clockTypeAnalog - uid0x20022EF9 - uid0x10005901 - uid0x20029F80 - uid0x2001FE79 - uid0x10207C62 - uid0x10005951 - uid0x20025FD9 - uid0x102828D6 - uid0x101FB751 - uid0x100059EE - 10 - 21 - 32 - bounceEffect20 - widgetTapAndHoldTimeout500 - sceneTapAndHoldTimeout500 - pageChangeAnimationDuration200 - pageChangeZoneAnimationDuration800 - pageChangeZoneReverseAnimationDuration200 - pageRemovedAnimationDuration200 - newPageAddedAnimationDuration200 - widgetDragEffectDuration200 - widgetDropEffectDuration200 - defaultPageId1 - maximumPageCount8 - isShortcutLabelVisibletrue - bounceFeedbackEffectDistance3 - pageChangePanDistanceInPixels120 - tapAndHoldDistance16 - pageChangeZoneWidth60 - pageIndicatorSpacing8 - maximumWidgetHeight39 - maximumWidgetWidth48 - minimumWidgetHeight8.75 - minimumWidgetWidth8.75 - pageChangePanDistance17.91 - pageChangeFeedbackEffectSensitive - widgetPickFeedbackEffectItemPick - widgetDropFeedbackEffectItemDrop - widgetRepositionFeedbackEffectBounceEffect - widgetOverTrashbinFeedbackEffectItemMoveOver - widgetDropToTrashbinFeedbackEffectItemDrop - shortcutWidgetTapFeedbackEffectBasicItem - widgetMoveBlockedFeedbackEffectBasic - clockWidgetTapFeedbackEffectBasicItem - widgetSnappingFeedbackEffectItemMoveOver - isSnapEnabledtrue - snapTimeout100 - snapForce30 - snapGap6 - snapBorderGap0 - snapLineFadeInDuration200 - snapLineFadeOutDuration100 - isSnapEffectsEnabledtrue - sceneTypePageWallpapers - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1hsclockwidgetplugin + 2dialerwidgetplugin + 3ftuhswidget + 4hsshortcutwidgetplugin + 5hsshortcutwidgetplugin + 6hsshortcutwidgetplugin + 7hsshortcutwidgetplugin + 8hsshortcutwidgetplugin + 9hsshortcutwidgetplugin + 10hsshortcutwidgetplugin + 11hsshortcutwidgetplugin + 12hsshortcutwidgetplugin + 13hsshortcutwidgetplugin + portrait15800.0 + landscape15800.0 + portrait1362760.0 + landscape1361760.0 + portrait154000.0 + landscape3001500.0 + portrait15800.0 + portrait100800.0 + portrait185800.0 + portrait270800.0 + portrait151850.0 + portrait1001850.0 + portrait1851850.0 + portrait15800.0 + portrait100800.0 + portrait185800.0 + clockTypeAnalog + uid0x20022EF9 + uid0x10005901 + uid0x20029F80 + uid0x2001FE79 + uid0x10207C62 + uid0x10005951 + uid0x20025FD9 + uid0x102828D6 + uid0x101FB751 + uid0x100059EE + 10 + 21 + 32 + bounceEffect20 + widgetTapAndHoldTimeout500 + sceneTapAndHoldTimeout500 + pageChangeAnimationDuration200 + pageChangeZoneAnimationDuration800 + pageChangeZoneReverseAnimationDuration200 + pageRemovedAnimationDuration200 + newPageAddedAnimationDuration200 + widgetDragEffectDuration200 + widgetDropEffectDuration200 + defaultPageId1 + maximumPageCount8 + isShortcutLabelVisibletrue + bounceFeedbackEffectDistance3 + pageChangePanDistanceInPixels120 + tapAndHoldDistance16 + pageChangeZoneWidth60 + pageIndicatorSpacing8 + maximumWidgetHeight39 + maximumWidgetWidth48 + minimumWidgetHeight8.75 + minimumWidgetWidth8.75 + pageChangePanDistance17.91 + pageChangeFeedbackEffectSensitive + widgetPickFeedbackEffectItemPick + widgetDropFeedbackEffectItemDrop + widgetRepositionFeedbackEffectBounceEffect + widgetOverTrashbinFeedbackEffectItemMoveOver + widgetDropToTrashbinFeedbackEffectItemDrop + shortcutWidgetTapFeedbackEffectBasicItem + widgetMoveBlockedFeedbackEffectBasic + clockWidgetTapFeedbackEffectBasicItem + widgetSnappingFeedbackEffectItemMoveOver + isSnapEnabledtrue + snapTimeout100 + snapForce30 + snapGap6 + pageMargin0 + snapLineFadeInDuration200 + snapLineFadeOutDuration100 + isSnapEffectsEnabledtrue + sceneTypePageWallpapers + bounceAnimationEasingCurveLinear + pageChangeAnimationEasingCurveLinear + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/conf/base/implml/homescreendb.implml --- a/homescreenapp/hsapplication/conf/base/implml/homescreendb.implml Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsapplication/conf/base/implml/homescreendb.implml Wed Aug 18 09:40:07 2010 +0300 @@ -1,7 +1,8 @@  - - + + + + + + + @@ -26,13 +31,13 @@ - + - + - + \ No newline at end of file diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/hsapplication.pri --- a/homescreenapp/hsapplication/hsapplication.pri Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsapplication/hsapplication.pri Wed Aug 18 09:40:07 2010 +0300 @@ -14,10 +14,14 @@ # Description: # -HEADERS += ./inc/hshomescreen.h +HEADERS += ./inc/hshomescreen.h \ + ./inc/hsstatemachine.h SOURCES += ./src/hshomescreen.cpp \ + ./src/hsstatemachine.cpp \ ./src/main.cpp symbian:{ - HEADERS += ./inc/hshomescreenclientserviceprovider.h - SOURCES += ./src/hshomescreenclientserviceprovider.cpp + HEADERS += ./inc/hshomescreenclientserviceprovider.h \ + ./inc/hsrecoverymanager.h + SOURCES += ./src/hshomescreenclientserviceprovider.cpp \ + ./src/hsrecoverymanager.cpp } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/hsapplication.pro --- a/homescreenapp/hsapplication/hsapplication.pro Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsapplication/hsapplication.pro Wed Aug 18 09:40:07 2010 +0300 @@ -18,16 +18,17 @@ include(../common.pri) -LIBS += -lhsutils -lhsdomainmodel CONFIG += console -QT += xml +#QT += xml CONFIG += hb mobility -MOBILITY = serviceframework +MOBILITY = serviceframework publishsubscribe fute:DEFINES += FUTE +new_short:DEFINES += HSWIDGETORGANIZER_ALGORITHM + DEPENDPATH += . \ ./inc \ ./src @@ -40,7 +41,8 @@ TRANSLATIONS = homescreen.ts LIBS += -lhsutils \ - -lhsdomainmodel + -lhsdomainmodel \ + -lcaclient symbian: { @@ -56,12 +58,12 @@ include(hsapplication_exports_to_rom.pri) CONFIG += service - LIBS += -lxqservice -lxqserviceutil + LIBS += -lxqservice -lxqserviceutil -lXQKeyCapture SERVICE.FILE = ipc_service_conf.xml } -win32: { +!symbian: { include(installs_win.pri) } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/hsapplication_exports_to_rom.pri --- a/homescreenapp/hsapplication/hsapplication_exports_to_rom.pri Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsapplication/hsapplication_exports_to_rom.pri Wed Aug 18 09:40:07 2010 +0300 @@ -16,6 +16,7 @@ # configuration file exports BLD_INF_RULES.prj_exports += \ + "conf/base/confml/CI_homescreendb.confml APP_LAYER_CONFML(CI_homescreendb.confml)" \ "conf/base/confml/homescreendb.confml APP_LAYER_CONFML(homescreendb.confml)" \ "conf/base/implml/homescreendb.implml APP_LAYER_CRML(homescreendb.implml)" \ "conf/base/implml/homescreendb_templates/create.sql APP_LAYER_CRML(homescreendb_templates/create.sql)" \ diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/inc/hshomescreen.h --- a/homescreenapp/hsapplication/inc/hshomescreen.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsapplication/inc/hshomescreen.h Wed Aug 18 09:40:07 2010 +0300 @@ -53,7 +53,7 @@ bool eventFilter(QObject *watched, QEvent *event); private: - void registerServicePlugins(QServiceManager &serviceManager); + void registerServicePlugins(); void registerServicePlugins(const QString &root, QServiceManager &serviceManager); private slots: diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/inc/hsrecoverymanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/inc/hsrecoverymanager.h Wed Aug 18 09:40:07 2010 +0300 @@ -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: +* +*/ + +#ifndef HSRECOVERYMANAGER_H +#define HSRECOVERYMANAGER_H + +#include +#include + +#include "hstest_global.h" +HOMESCREEN_TEST_CLASS(t_hsapplication) + +class HsRecoveryManager : public QObject +{ + Q_OBJECT + +public: + HsRecoveryManager(QObject *parent = 0); + ~HsRecoveryManager(); + + void execute(); + +private slots: + void restoreRomDatabase(); + void resetCrashCount(); + +private: + Q_DISABLE_COPY(HsRecoveryManager) + int crashCount(); + +private: + QTimer mTimer; + + HOMESCREEN_TEST_FRIEND_CLASS(t_hsapplication) +}; + +#endif // HSRECOVERYMANAGER_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/inc/hsstatemachine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/inc/hsstatemachine.h Wed Aug 18 09:40:07 2010 +0300 @@ -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: Default implementation of the home screen runtime. +* +*/ + +#ifndef HSSTATEMACHINE_H +#define HSSTATEMACHINE_H + +#include +#include + +#ifdef Q_OS_SYMBIAN +#include +#endif + +#include "hstest_global.h" + +class HsContentService; +QTM_BEGIN_NAMESPACE +class QValueSpacePublisher; +QTM_END_NAMESPACE + +QTM_USE_NAMESPACE + +HOMESCREEN_TEST_CLASS(t_hsapplication) + +class HsStateMachine : public QStateMachine +{ + Q_OBJECT + +public: + HsStateMachine(QObject *parent = 0); + ~HsStateMachine(); + +signals: + void event_exit(); + void event_toIdle(); + void event_toAppLib(); +protected: + bool eventFilter(QObject *watched, QEvent *event); + +private: + Q_DISABLE_COPY(HsStateMachine) + + + void registerAnimations(); + void createStatePublisher(); + void createContentServiceParts(); + void createStates(); + void updatePSKeys(); + void captureEndKey(bool enable); + +private slots: + void onIdleStateEntered(); + void onIdleStateExited(); + void activityRequested(const QString &name); + + +private: + HsContentService *mContentService; + + bool mHomeScreenActive; + bool mIdleStateActive; + bool mEndKeyCaptured; + + QValueSpacePublisher *mPublisher; + +#ifdef Q_OS_SYMBIAN + XQKeyCapture keyCapture; +#endif + + HOMESCREEN_TEST_FRIEND_CLASS(t_hsapplication) +}; + +#endif diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/installs_symbian.pri --- a/homescreenapp/hsapplication/installs_symbian.pri Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsapplication/installs_symbian.pri Wed Aug 18 09:40:07 2010 +0300 @@ -17,21 +17,29 @@ deploy.path = z: exports1.path = /private/20022F35 +# this database is only for winscw emulator, for HW it is generated during image creation from confml +exports1.sources += resource/resource_emulator/homescreen.db exports1.sources += data/backup_registration.xml for(export1, exports1.sources):BLD_INF_RULES.prj_exports += "./$$export1 $$deploy.path$$exports1.path/$$basename(export1)" exports2.path = /private/20022f35/wallpapers/scene -exports2.sources += resource/scene/default_landscape.png -exports2.sources += resource/scene/default_portrait.png +exports2.sources += resource/wallpapers/scene/default_landscape.png +exports2.sources += resource/wallpapers/scene/default_portrait.png for(export2, exports2.sources):BLD_INF_RULES.prj_exports += "./$$export2 $$deploy.path$$exports2.path/$$basename(export2)" exports3.path = /private/20022f35/wallpapers/page -exports3.sources += resource/page/default_landscape.png -exports3.sources += resource/page/default_portrait.png -exports3.sources += resource/page/1_landscape.png -exports3.sources += resource/page/1_portrait.png -exports3.sources += resource/page/2_landscape.png -exports3.sources += resource/page/2_portrait.png -exports3.sources += resource/page/3_landscape.png -exports3.sources += resource/page/3_portrait.png +exports3.sources += resource/wallpapers/page/default_landscape.png +exports3.sources += resource/wallpapers/page/default_portrait.png +exports3.sources += resource/wallpapers/page/1_landscape.png +exports3.sources += resource/wallpapers/page/1_portrait.png +exports3.sources += resource/wallpapers/page/2_landscape.png +exports3.sources += resource/wallpapers/page/2_portrait.png +exports3.sources += resource/wallpapers/page/3_landscape.png +exports3.sources += resource/wallpapers/page/3_portrait.png for(export3, exports3.sources):BLD_INF_RULES.prj_exports += "./$$export3 $$deploy.path$$exports3.path/$$basename(export3)" + +exports4.path = /private/20022f35/wallpapers/originals +exports4.sources += resource/wallpapers/page/originals/car.png +exports4.sources += resource/wallpapers/page/originals/shapes.png +exports4.sources += resource/wallpapers/page/originals/shoes.png +for(export4, exports4.sources):BLD_INF_RULES.prj_exports += "./$$export4 $$deploy.path$$exports4.path/$$basename(export4)" diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/installs_win.pri --- a/homescreenapp/hsapplication/installs_win.pri Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsapplication/installs_win.pri Wed Aug 18 09:40:07 2010 +0300 @@ -16,9 +16,9 @@ kqtihswallpapers.CONFIG += no_build kqtihswallpapers.path = $$DESTDIR/resource/kqtihswallpapers -kqtihswallpapers.files = ./resource/bg_1.png \ - ./resource/bg_2.png \ - ./resource/bg_3.png +kqtihswallpapers.files = ./resource/wallpapers/page/originals/car.png \ + ./resource/wallpapers/page/originals/shapes.png \ + ./resource/wallpapers/page/originals/shoes.png homescreendb.CONFIG += no_build homescreendb.path = $$DESTDIR/private/20022f35 @@ -26,19 +26,19 @@ scenewallpapers.CONFIG += no_build scenewallpapers.path = $$DESTDIR/private/20022f35/wallpapers/scene -scenewallpapers.files = ./resource/scene/default_landscape.png \ - ./resource/scene/default_portrait.png +scenewallpapers.files = ./resource/wallpapers/scene/default_landscape.png \ + ./resource/wallpapers/scene/default_portrait.png pagewallpapers.CONFIG += no_build pagewallpapers.path = $$DESTDIR/private/20022f35/wallpapers/page -pagewallpapers.files = ./resource/page/default_landscape.png \ - ./resource/page/default_portrait.png \ - ./resource/page/1_portrait.png \ - ./resource/page/1_landscape.png \ - ./resource/page/2_portrait.png \ - ./resource/page/2_landscape.png \ - ./resource/page/3_portrait.png \ - ./resource/page/3_landscape.png +pagewallpapers.files = ./resource/wallpapers/page/default_landscape.png \ + ./resource/wallpapers/page/default_portrait.png \ + ./resource/wallpapers/page/1_portrait.png \ + ./resource/wallpapers/page/1_landscape.png \ + ./resource/wallpapers/page/2_portrait.png \ + ./resource/wallpapers/page/2_landscape.png \ + ./resource/wallpapers/page/3_portrait.png \ + ./resource/wallpapers/page/3_landscape.png INSTALLS += kqtihswallpapers homescreendb scenewallpapers pagewallpapers PRE_TARGETDEPS += install_kqtihswallpapers install_homescreendb install_scenewallpapers install_pagewallpapers diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/bg_1.png Binary file homescreenapp/hsapplication/resource/bg_1.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/bg_2.png Binary file homescreenapp/hsapplication/resource/bg_2.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/bg_3.png Binary file homescreenapp/hsapplication/resource/bg_3.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/page/1_landscape.png Binary file homescreenapp/hsapplication/resource/page/1_landscape.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/page/1_portrait.png Binary file homescreenapp/hsapplication/resource/page/1_portrait.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/page/2_landscape.png Binary file homescreenapp/hsapplication/resource/page/2_landscape.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/page/2_portrait.png Binary file homescreenapp/hsapplication/resource/page/2_portrait.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/page/3_landscape.png Binary file homescreenapp/hsapplication/resource/page/3_landscape.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/page/3_portrait.png Binary file homescreenapp/hsapplication/resource/page/3_portrait.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/page/default_landscape.png Binary file homescreenapp/hsapplication/resource/page/default_landscape.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/page/default_portrait.png Binary file homescreenapp/hsapplication/resource/page/default_portrait.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/resource_emulator/homescreen.db Binary file homescreenapp/hsapplication/resource/resource_emulator/homescreen.db has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/resource_win/homescreen.db Binary file homescreenapp/hsapplication/resource/resource_win/homescreen.db has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/scene/default_landscape.png Binary file homescreenapp/hsapplication/resource/scene/default_landscape.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/scene/default_portrait.png Binary file homescreenapp/hsapplication/resource/scene/default_portrait.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/wallpapers/page/1_landscape.png Binary file homescreenapp/hsapplication/resource/wallpapers/page/1_landscape.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/wallpapers/page/1_portrait.png Binary file homescreenapp/hsapplication/resource/wallpapers/page/1_portrait.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/wallpapers/page/2_landscape.png Binary file homescreenapp/hsapplication/resource/wallpapers/page/2_landscape.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/wallpapers/page/2_portrait.png Binary file homescreenapp/hsapplication/resource/wallpapers/page/2_portrait.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/wallpapers/page/3_landscape.png Binary file homescreenapp/hsapplication/resource/wallpapers/page/3_landscape.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/wallpapers/page/3_portrait.png Binary file homescreenapp/hsapplication/resource/wallpapers/page/3_portrait.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/wallpapers/page/default_landscape.png Binary file homescreenapp/hsapplication/resource/wallpapers/page/default_landscape.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/wallpapers/page/default_portrait.png Binary file homescreenapp/hsapplication/resource/wallpapers/page/default_portrait.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/wallpapers/page/originals/car.png Binary file homescreenapp/hsapplication/resource/wallpapers/page/originals/car.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/wallpapers/page/originals/shapes.png Binary file homescreenapp/hsapplication/resource/wallpapers/page/originals/shapes.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/wallpapers/page/originals/shoes.png Binary file homescreenapp/hsapplication/resource/wallpapers/page/originals/shoes.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/wallpapers/scene/default_landscape.png Binary file homescreenapp/hsapplication/resource/wallpapers/scene/default_landscape.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/wallpapers/scene/default_portrait.png Binary file homescreenapp/hsapplication/resource/wallpapers/scene/default_portrait.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/resource/wallpapers/scene/originals/kites.png Binary file homescreenapp/hsapplication/resource/wallpapers/scene/originals/kites.png has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/src/hshomescreen.cpp --- a/homescreenapp/hsapplication/src/hshomescreen.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsapplication/src/hshomescreen.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -26,6 +26,7 @@ #include "hshomescreen.h" #include "hstest_global.h" +#include "hsstatemachine.h" #ifdef Q_OS_SYMBIAN #include "hshomescreenclientserviceprovider.h" #endif @@ -35,8 +36,7 @@ \class HsHomeScreen \ingroup group_hsapplication \brief Homescreen application main class. - Loads a runtime from a runtime provider plugin. Manages - the state machine execution. + Manages the state machine execution. */ /*! @@ -52,34 +52,17 @@ { HSTEST_FUNC_ENTRY("HS::HsHomeScreen::HsHomeScreen"); - QServiceManager serviceManager; - - registerServicePlugins(serviceManager); + registerServicePlugins(); - QServiceFilter filter("com.nokia.symbian.IHomeScreenRuntime"); - QList interfaces = serviceManager.findInterfaces(filter); - - if (interfaces.isEmpty()) { - emit exit(); - return; - } + mRuntime = new HsStateMachine(this); - QObject *object = serviceManager.loadInterface(interfaces.first().interfaceName()); - mRuntime = qobject_cast(object); - - if (mRuntime) { - mRuntime->setParent(this); - connect(mRuntime, SIGNAL(started()), SLOT(onRuntimeStarted())); - connect(mRuntime, SIGNAL(stopped()), SLOT(onRuntimeStopped())); - hbInstance->allMainWindows().first()->installEventFilter(this); + connect(mRuntime, SIGNAL(started()), SLOT(onRuntimeStarted())); + connect(mRuntime, SIGNAL(stopped()), SLOT(onRuntimeStopped())); + hbInstance->allMainWindows().first()->installEventFilter(this); #ifdef Q_OS_SYMBIAN - mHomeScreenClientServiceProvider = new HsHomeScreenClientServiceProvider; - mHomeScreenClientServiceProvider->setParent(this); + mHomeScreenClientServiceProvider = new HsHomeScreenClientServiceProvider; + mHomeScreenClientServiceProvider->setParent(this); #endif - } else { - delete object; - emit exit(); - } HSTEST_FUNC_EXIT("HS::HsHomeScreen::HsHomeScreen"); } @@ -97,26 +80,21 @@ */ /*! - Starts the runtime. + Starts the state machine. */ void HsHomeScreen::start() { HSTEST_FUNC_ENTRY("HS::HsHomeScreen::start"); - if (mRuntime) { - mRuntime->start(); - } else { - HSTEST_FUNC_EXIT("HS::HsHomeScreen::start, mRuntime not created, exit application"); - emit exit(); - } + mRuntime->start(); HSTEST_FUNC_EXIT("HS::HsHomeScreen::start"); } /*! - Stops the runtime. + Stops the state machine. */ void HsHomeScreen::stop() { - if (mRuntime && mRuntime->isRunning()) { + if (mRuntime->isRunning()) { QEventLoop eventLoop; connect(mRuntime, SIGNAL(finished()), &eventLoop, SLOT(quit())); QMetaObject::invokeMethod(mRuntime, "event_exit", Qt::QueuedConnection); @@ -137,14 +115,14 @@ } /*! - Called after the runtime has started. + Called after the state machine has started. */ void HsHomeScreen::onRuntimeStarted() { } /*! - Called after the runtime has stopped. + Called after the state machine has stopped. */ void HsHomeScreen::onRuntimeStopped() { @@ -154,13 +132,15 @@ /*! Registers service plugins pre-installed on the device. */ -void HsHomeScreen::registerServicePlugins(QServiceManager &serviceManager) -{ +void HsHomeScreen::registerServicePlugins() +{ HSTEST_FUNC_ENTRY("HS::HsHomeScreen::registerServicePlugins()"); + + QServiceManager serviceManager; + QStringList pluginPaths; - pluginPaths << "private/20022F35"; - pluginPaths << "hsresources/plugins"; + pluginPaths << "private/20022F35"; QFileInfoList drives = QDir::drives(); foreach(const QString pluginPath, pluginPaths) { @@ -182,6 +162,12 @@ HSTEST_FUNC_EXIT("HS::HsHomeScreen::registerServicePlugins()"); } +#ifdef COVERAGE_MEASUREMENT +#ifndef Q_OS_SYMBIAN +#pragma CTC SKIP +#endif // Q_OS_SYMBIAN +#endif //COVERAGE_MEASUREMENT + /*! Recursively registers service plugins starting from given /a root directory. All directories containing plugins are added to @@ -214,3 +200,9 @@ } HSTEST_FUNC_EXIT("HS::HsHomeScreen::registerServicePlugins(const QString &)"); } + +#ifdef COVERAGE_MEASUREMENT +#ifndef Q_OS_SYMBIAN +#pragma CTC ENDSKIP +#endif // Q_OS_SYMBIAN +#endif //COVERAGE_MEASUREMENT \ No newline at end of file diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/src/hsrecoverymanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/src/hsrecoverymanager.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -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: +* +*/ + +#include + +#include + +#include "hsrecoverymanager.h" + +const TInt KPSCategoryUid(0x20022F36); +const TInt KPSCrashCountKey(1); +const int KCrashCountThreshold(3); +const int KResetCrashCountInterval(60000); + +/*! + \class HsRecoveryManager + \ingroup group_hsapplication + \brief Used during homescreen startup for recovering from possible crash situations. +*/ + +/*! + Constructs a new recovery manager with the given \a parent item. +*/ +HsRecoveryManager::HsRecoveryManager(QObject *parent) + : QObject(parent) +{ + mTimer.setInterval(KResetCrashCountInterval); + mTimer.setSingleShot(true); + connect(&mTimer, SIGNAL(timeout()), SLOT(resetCrashCount())); +} + +/*! + Destructor. +*/ +HsRecoveryManager::~HsRecoveryManager() +{ +} + +/*! + Executes this recovery manager. If crash count exceeds the + threshold, the ROM configuration is selected. Otherwise, + the existing one is used. +*/ +void HsRecoveryManager::execute() +{ + int count = crashCount(); + if (KCrashCountThreshold <= count) { + restoreRomDatabase(); + resetCrashCount(); + return; + } + if (0 < count) { + mTimer.start(); + } +} + +/*! + Restores the ROM database to c: drive. +*/ +void HsRecoveryManager::restoreRomDatabase() +{ + // If exists, remove the database from c: + QFile file("c:/private/20022f35/homescreen.db"); + if (file.exists()) { + file.remove(); + } + // Copy the rom database to c: and set permissions. + file.setFileName("z:/private/20022f35/homescreen.db"); + file.copy("c:/private/20022f35/homescreen.db"); + file.setFileName("c:/private/20022f35/homescreen.db"); + file.setPermissions(QFile::ReadOwner | QFile::WriteOwner); +} + +/*! + Resets the crash count to zero. +*/ +void HsRecoveryManager::resetCrashCount() +{ + RProperty::Set(TUid::Uid(KPSCategoryUid), KPSCrashCountKey, 0); +} + +/*! + Returns the current crash count. +*/ +int HsRecoveryManager::crashCount() +{ + TInt count = 0; + RProperty::Get(TUid::Uid(KPSCategoryUid), KPSCrashCountKey, count); + return count; +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/src/hsstatemachine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/src/hsstatemachine.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,426 @@ +/* +* 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: Default implementation of the home state machine. +* +*/ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "hsmenueventfactory.h" +#include "homescreendomainpskeys.h" +#include "hsstatemachine.h" +#include "hsdatabase.h" +#include "hscontentservice.h" +#include "hsshortcutservice.h" +#include "hsmenueventtransition.h" +#include "hswidgetpositioningonorientationchange.h" +#include "hswidgetpositioningonwidgetadd.h" +#include "hsconfiguration.h" +#include "hstest_global.h" +#include "hswidgetpositioningonwidgetmove.h" + +QTM_USE_NAMESPACE +#define hbApp qobject_cast(qApp) + +namespace +{ + const char KHsRootStateInterface[] = "com.nokia.homescreen.state.HsRootState"; + const char KHsLoadSceneStateInterface[] = "com.nokia.homescreen.state.HsLoadSceneState"; + const char KHsIdleStateInterface[] = "com.nokia.homescreen.state.HsIdleState"; + const char KHsAppLibraryStateInterface[] = "com.nokia.homescreen.state.HsAppLibraryState"; + const char KHsMenuWorkerStateInterface[] = "com.nokia.homescreen.state.HsMenuWorkerState"; + const char KHsBacupRestoreStateInterface[] = "com.nokia.homescreen.state.HsBackupRestoreState"; +} + + +/*! + \class HsStateMachine + \ingroup group_hsstatemachine + \brief Default implementation of the home screen state machine. + Creates an execution context (EC) and populates it with + runtime services. States are loaded from state plugins. + Each state is given an access to the EC. States + are added to a state machine. Finally, the state machine + is started. +*/ + +/*! + Constructs state machine with \a parent as the parent object. +*/ +HsStateMachine::HsStateMachine(QObject *parent) + : QStateMachine(parent), + mContentService(0), + mHomeScreenActive(false), + mIdleStateActive(false), + mEndKeyCaptured(false), + mPublisher(NULL) +#ifdef Q_OS_SYMBIAN + ,keyCapture() +#endif +{ + HSTEST_FUNC_ENTRY("HS::HsStateMachine::HsStateMachine"); + + HsDatabase *db = new HsDatabase(QCoreApplication::instance()); + db->setConnectionName("homescreen.dbc"); +#ifdef Q_OS_SYMBIAN + db->setDatabaseName("c:/private/20022f35/homescreen.db"); +#else + db->setDatabaseName("private/20022f35/homescreen.db"); +#endif + db->open(); + HsDatabase::setInstance(db); + + HsConfiguration::setInstance(new HsConfiguration(QCoreApplication::instance())); + HsConfiguration::instance()->load(); + + HsWidgetPositioningOnOrientationChange::setInstance( + new HsAdvancedWidgetPositioningOnOrientationChange); +#ifdef HSWIDGETORGANIZER_ALGORITHM + HsWidgetPositioningOnWidgetAdd::setInstance( + new HsWidgetOrganizer); +#else + HsWidgetPositioningOnWidgetAdd::setInstance( + new HsAnchorPointInBottomRight); +#endif + + HsWidgetPositioningOnWidgetMove::setInstance( + new HsSnapToLines); + + registerAnimations(); + + createStatePublisher(); + createContentServiceParts(); + createStates(); + + // create the instance so that singleton is accessible from elsewhere + HsShortcutService::instance(this); + + QCoreApplication::instance()->installEventFilter(this); + + if (hbApp) { // Qt test framework uses QApplication. + connect(hbApp->activityManager(), SIGNAL(activityRequested(QString)), + this, SLOT(activityRequested(QString))); + } + HSTEST_FUNC_EXIT("HS::HsStateMachine::HsStateMachine"); +} + +/*! + Destructor. +*/ +HsStateMachine::~HsStateMachine() +{ + HsWidgetPositioningOnOrientationChange::setInstance(0); + HsWidgetPositioningOnWidgetAdd::setInstance(0); + HsWidgetPositioningOnWidgetMove::setInstance(0); + delete mPublisher; +} + +/*! + \fn void HsStateMachine::stopStateMachine() + Emission of this signal initiates a transition to the final state. +*/ + +/*! + \copydoc QObject::eventFilter(QObject *watched, QEvent *event) +*/ +bool HsStateMachine::eventFilter(QObject *watched, QEvent *event) +{ + Q_UNUSED(watched); + + switch (event->type()) { + case QEvent::ApplicationActivate: + qDebug() << "HsStateMachine::eventFilter: QEvent::ApplicationActivate"; + mHomeScreenActive = true; + updatePSKeys(); + break; + case QEvent::ApplicationDeactivate: + qDebug() << "HsStateMachine::eventFilter: QEvent::ApplicationDeactivate"; + mHomeScreenActive = false; + updatePSKeys(); + break; + default: + break; + } + + bool result = QStateMachine::eventFilter(watched, event); + if (event->type() == QEvent::KeyPress ) { + QKeyEvent* ke = static_cast(event); + result = (ke->key() == Qt::Key_Home); + } + return result; +} + + +/*! + Registers framework animations. +*/ +void HsStateMachine::registerAnimations() +{ + HbIconAnimationManager *manager = HbIconAnimationManager::global(); + manager->addDefinitionFile(QLatin1String("qtg_anim_loading.axml")); +} + +/*! + Creates Home screen state publisher. +*/ +void HsStateMachine::createStatePublisher() +{ + mPublisher = new QValueSpacePublisher(QValueSpace::PermanentLayer, HsStatePSKeyPath); + + if (!mPublisher->isConnected()){ + // No permanent layer available + mPublisher = new QValueSpacePublisher(HsStatePSKeyPath); + } + + mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenInactive); +} + +/*! + Creates content service parts. +*/ +void HsStateMachine::createContentServiceParts() +{ + HSTEST_FUNC_ENTRY("HS::HsStateMachine::createContentServiceParts"); + + mContentService = new HsContentService(this); + + HSTEST_FUNC_EXIT("HS::HsStateMachine::createContentServiceParts"); +} + +/*! + Creates states. +*/ +void HsStateMachine::createStates() +{ + HSTEST_FUNC_ENTRY("HS::HsStateMachine::createStates"); + + QFinalState *finalState = new QFinalState(); + addState(finalState); + + QState *guiRootState = new QState(); + addState(guiRootState); + + guiRootState->addTransition(this, SIGNAL(event_exit()), finalState); + + QServiceManager manager; + + + QObject *loadSceneStateObj = manager.loadInterface(KHsLoadSceneStateInterface); + QState *loadSceneState = qobject_cast(loadSceneStateObj); + loadSceneState->setParent(guiRootState); + loadSceneState->setObjectName(KHsLoadSceneStateInterface); + + QObject *rootStateObj = manager.loadInterface(KHsRootStateInterface); + QState *rootState = qobject_cast(rootStateObj); + rootState->setParent(guiRootState); + rootState->setObjectName(KHsRootStateInterface); + + QObject *idleStateObj = manager.loadInterface(KHsIdleStateInterface); + QState *idleState = qobject_cast(idleStateObj); + idleState->setParent(rootState); + idleState->setObjectName(KHsIdleStateInterface); + connect(idleState, SIGNAL(entered()), SLOT(onIdleStateEntered())); + connect(idleState, SIGNAL(exited()), SLOT(onIdleStateExited())); + + + //menu state + QState *menuParallelState = new QState( + QState::ParallelStates, rootState); + QState *menuRootState = new QState(menuParallelState); + + QObject *appLibraryStateObj = manager.loadInterface(KHsAppLibraryStateInterface); + QState *appLibraryState = qobject_cast(appLibraryStateObj); + appLibraryState->setParent(menuRootState); + appLibraryState->setObjectName(KHsAppLibraryStateInterface); + menuRootState->setInitialState(appLibraryState); + + QHistoryState *historyState = new QHistoryState(rootState); + historyState->setDefaultState(idleState); + + loadSceneState->addTransition( + loadSceneState, SIGNAL(event_history()), historyState); + + QObject *menuWorkerStateObj = manager.loadInterface(KHsMenuWorkerStateInterface); + QState *menuWorkerState = qobject_cast(menuWorkerStateObj); + menuWorkerState->setParent(menuParallelState); + menuWorkerState->setObjectName(KHsMenuWorkerStateInterface); + + connect(appLibraryState, SIGNAL(collectionEntered()), + menuWorkerState, SIGNAL(reset())); + + //Backup/Restore state + QObject *backupRestoreStateObj = manager.loadInterface(KHsBacupRestoreStateInterface); + QState *backupRestoreState = qobject_cast(backupRestoreStateObj); + backupRestoreState->setParent(guiRootState); + backupRestoreState->setObjectName(KHsBacupRestoreStateInterface); + backupRestoreState->addTransition( + backupRestoreState, SIGNAL(event_loadScene()), loadSceneState); + + // root state transitions + idleState->addTransition(idleState, SIGNAL(event_applicationLibrary()), menuRootState); + appLibraryState->addTransition( + appLibraryState, SIGNAL(toHomescreenState()), idleState); + rootState->addTransition(rootState, SIGNAL(event_backupRestore()), backupRestoreState); + // opening shortcut to Application Library + HsMenuEventTransition *idleToAppLibTransition = + new HsMenuEventTransition(HsMenuEvent::OpenApplicationLibrary, + idleState, appLibraryState); + idleState->addTransition(idleToAppLibTransition); + + HsMenuEventTransition *appLibToIdleTransition = + new HsMenuEventTransition( + HsMenuEvent::OpenHomeScreen, appLibraryState, idleState); + appLibraryState->addTransition(appLibToIdleTransition); + + HbMainWindow *window = hbInstance->allMainWindows().first(); + +#ifndef Q_OS_SYMBIAN + // key driven transition from idle to menu + QKeyEventTransition *idleToMenuRootTransition = + new QKeyEventTransition( + window, QEvent::KeyPress, Qt::Key_Home); + idleToMenuRootTransition->setTargetState(menuRootState); + idleState->addTransition(idleToMenuRootTransition); + // key driven transition from menu to idle + QKeyEventTransition *menuToIdleTransition = + new QKeyEventTransition( + window, QEvent::KeyPress, Qt::Key_Home); + menuToIdleTransition->setTargetState(idleState); + menuRootState->addTransition(menuToIdleTransition); +#endif + // key driven transition from menu to idle + QKeyEventTransition *menuToIdleTransitionNoKey = + new QKeyEventTransition( + window, QEvent::KeyPress, Qt::Key_No); + menuToIdleTransitionNoKey->setTargetState(idleState); + menuRootState->addTransition(menuToIdleTransitionNoKey); + + // add transition to switch to idle + menuRootState->addTransition( this, SIGNAL(event_toIdle()), idleState); + // add transition to switch to applib + idleState->addTransition( this, SIGNAL(event_toAppLib()), menuRootState); + + // transitions to child states + // opening shortcut to a colleciton + QList collectionStates = + appLibraryState-> + findChildren + ("homescreen.nokia.com/state/applibrarystate/collectionstate"); + qDebug( + "Found %d \"collectionstate\" children for Application Library State", + collectionStates.count()); + if (collectionStates.count()) { + HsMenuEventTransition *idleToCollectionTransition = + new HsMenuEventTransition(HsMenuEvent::OpenCollection, + idleState, collectionStates[0]); + idleState->addTransition(idleToCollectionTransition); + } + + guiRootState->setInitialState(loadSceneState); + setInitialState(guiRootState); + + HSTEST_FUNC_EXIT("HS::HsStateMachine::createStates"); +} + + +/*! + Publishes Home screen states via Publish & Subscribe. +*/ +void HsStateMachine::updatePSKeys() +{ + if (!mPublisher){ + createStatePublisher(); + } + + if (mHomeScreenActive && mIdleStateActive){ + qDebug() << "HsStateMachine::updatePSKeys: EHomeScreenIdleState"; + mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenIdleState); + } + else{ + qDebug() << "HsStateMachine::updatePSKeys: EHomeScreenInactive"; + mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenInactive); + } + + if (mHomeScreenActive && !mIdleStateActive) { + captureEndKey(true); + } else { + captureEndKey(false); + } +} + +/*! + capture End key +*/ +void HsStateMachine::captureEndKey(bool enable) +{ +#ifdef Q_OS_SYMBIAN + if (enable && !mEndKeyCaptured) { + mEndKeyCaptured = true; + keyCapture.captureKey(Qt::Key_No); + } else if (mEndKeyCaptured) { + mEndKeyCaptured = false; + keyCapture.cancelCaptureKey(Qt::Key_No); + } +#endif +} + +/*! + Called when state machine is in Idle state. +*/ +void HsStateMachine::onIdleStateEntered() +{ + mIdleStateActive = true; + updatePSKeys(); +} + +/*! + Called when state machine leaves the Idle state. +*/ +void HsStateMachine::onIdleStateExited() +{ + mIdleStateActive = false; + updatePSKeys(); +} + +/*! + Activity requested by another client +*/ +void HsStateMachine::activityRequested(const QString &name) +{ + if (name == groupAppLibRecentView()) { + this->postEvent( + HsMenuEventFactory::createOpenCollectionEvent(0, + collectionDownloadedTypeName())); + } else if (name == activityHsIdleView()) { + emit event_toIdle(); + } else if (name == activityAppLibMainView()) { + emit event_toAppLib(); + } +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplication/src/main.cpp --- a/homescreenapp/hsapplication/src/main.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsapplication/src/main.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -36,6 +36,7 @@ #include #include +#include "hsrecoverymanager.h" void loadTranslationFilesOnSymbian(QTranslator &commonTranslator, QTranslator &hsTranslator, @@ -43,6 +44,7 @@ void copyWallpapersFromRom(); void copyHsDatabaseFileFromRom(); void createPrivateFolder(); +void copyWallpaperOriginalsFromRomToPhotos(); /*! \fn setHomescreenAsSystemAppL(CEikonEnv* eikonEnv) @@ -133,6 +135,8 @@ #ifdef Q_OS_SYMBIAN copyHsDatabaseFileFromRom(); + HsRecoveryManager recoveryManager; + recoveryManager.execute(); copyWallpapersFromRom(); #endif @@ -203,7 +207,7 @@ HSTEST("HS::main() - homescreen.db not in c:"); file.setFileName("z:/private/20022f35/homescreen.db"); if(!file.exists()) { - HSTEST("HS::main() - homescreen.db not in ROM!"); + qWarning() << "HS::main() - homescreen.db not in ROM!"; } else { HSTEST("HS::main() - homescreen.db found from z:"); createPrivateFolder(); @@ -214,10 +218,12 @@ HSTEST("HS::main() - homescreen.db copied from ROM to c:!"); file.setFileName("c:/private/20022f35/homescreen.db"); if(!file.setPermissions(QFile::ReadOwner | QFile::WriteOwner)) { - HSTEST("HS::main() - homescreen.db ReadWrite permission settings on c: failed!"); + qWarning() << "HS::main() - homescreen.db ReadWrite permission settings on c: failed!"; } HSTEST("HS::main() - homescreen.db permission set to ReadWrite!"); } + // Copy wallpaper originals to C drive user data to be visible in Photos + copyWallpaperOriginalsFromRomToPhotos(); } #ifdef __WINS__ else if(!file.setPermissions(QFile::ReadOwner | QFile::WriteOwner)) { @@ -280,6 +286,36 @@ } /*! + \fn copyWallpaperOriginalFromRomToPhotos() + \ingroup group_hsapplication + \internal + \brief Wallpaper original copier + Copies homescreen wallpaper originals from rom to C for Photos + does not exist on c: drive +*/ +void copyWallpaperOriginalsFromRomToPhotos() +{ + QString targetPath("e:/data/images/wallpapers"); + QDir dir(targetPath); + if(!dir.exists()) { + dir.mkpath(targetPath); + QDir dir2("z:/private/20022f35/wallpapers/originals"); + dir2.setFilter(QDir::Files); + QStringList files = dir2.entryList(); + foreach(QString file, files) { + QString targetFile(targetPath + "/" + file); + if ( QFile::copy(dir2.absoluteFilePath(file), targetFile) ) { + qDebug() << "Wallpaper original copied from " << dir2.absoluteFilePath(file) << "to " << targetFile; + } + QFile createdFile(targetFile); + if(!createdFile.setPermissions(QFile::ReadOwner | QFile::WriteOwner)) { + qDebug() << "Read write permission set failed for wallpaper original" << targetFile; + } + } + } +} + +/*! \fn loadTranslationFilesOnSymbian(QTranslator &commonTranslator, QTranslator &hsTranslator, QTranslator &alTranslator) diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplicationlauncher/group/hsapplicationlauncher.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/group/hsapplicationlauncher.mmp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Makefile of hsapplicationlauncher +* +*/ + +#include + +TARGET hsapplicationlauncher.exe + +targettype exe + +UID 0x1000008d 0x20022F36 +CAPABILITY ReadDeviceData WriteDeviceData +VENDORID VID_DEFAULT +SECUREID 0x20022F36 + +EPOCHEAPSIZE 0x1000 0x100000 // 4KB - 1 MB +EPOCSTACKSIZE 0x5000 + +SOURCEPATH ../src +SOURCE hsapplicationlauncher.cpp +SOURCE hsprocessmonitor.cpp +SOURCE hsshutdownmonitor.cpp + +USERINCLUDE . +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib // CBase etc +LIBRARY bafl.lib // descriptors +LIBRARY ssmcmn.lib // state manager +LIBRARY centralrepository.lib +LIBRARY cenrepnotifhandler.lib + +LANG SC + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplicationlauncher/hsapplicationlauncher.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/hsapplicationlauncher.pro Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,21 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Main project file for homescreen application +# + +TEMPLATE = subdirs + +symbian: { + BLD_INF_RULES.prj_mmpfiles += "./group/hsapplicationlauncher.mmp" +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplicationlauncher/inc/hsapplicationlauncher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/inc/hsapplicationlauncher.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,186 @@ +/* +* Copyright (c) 1020 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 __HS_LAUNCH_ +#define __HS_LAUNCH_ + +#include +#include +#include +#include "hsprocessmonitor.h" +#include "hsshutdownmonitor.h" + +class t_hsapplicationlauncher; + +/** + * CHsLaunch + * + * application class. + * + * @since S60 5.2 + */ +class CHsLaunch : public CActive, + MCenRepNotifyHandlerCallback, + MHsProcessMonitorObserver, + MHsShutdownMonitorObserver + { + public: + /** + * Create new launcher + * + * @since S60 5.2 + */ + static CHsLaunch* NewL(); + + /** + * Destructor. + * + * @since S60 5.2 + */ + virtual ~CHsLaunch(); + + /** + * Set active object to be ran + * + * @since S60 5.2 + */ + void Activate(); + + /** + * Get application return value + * + * @return TInt Application return value + * @since S60 5.2 + */ + TInt ApplicationReturnValue(); + + protected: + /** + * C++ constructor. + * + * @since S60 5.2 + */ + CHsLaunch(); + + /** + * Symbian 2nd phase constructor + * + * @since S60 5.2 + */ + void ConstructL(); + + private: // From CActive. + /** + * From CActive + */ + void RunL(); + + /** + * From CActive + * + * @since S60 5.2 + */ + void DoCancel(); + + /** + * From CActive + * + * @since S60 5.2 + */ + TInt RunError( TInt aError ); + + private: // From MCenRepNotifyHandlerCallback + /** + * From MCenRepNotifyHandlerCallback + */ + void HandleNotifyInt(TUint32 aId, TInt aNewValue); + + private: // From MHsProcessMonitorObserver + /** + * From MHsProcessMonitorObserver + */ + void ProcessEnded( const TExitType& aExitType, + const TInt aExitReason, + const TExitCategoryName& aExitCategory ); + + /** + * From MHsProcessMonitorObserver + */ + void ProcessMonitoringError( TInt aError ); + + private: // From MHsShutdownMonitorObserver + /** + * From MHsShutdownMonitorObserver + */ + void SystemShutdownEvent(); + + private: + /** + * Initialize process monitor + * + * @param aProcessId Id of process to monitor + */ + void InitProcessMonitorL( const TInt aProcessId ); + + /** + * Shut down application + * + * @param aApplicationReturnValue Application return value. + */ + void ShutdownApp( const TInt aApplicationReturnValue ); + + /** + * Starts the home screen application. + */ + void StartHomeScreen(); + + /** + * Checks if the language is selected. + */ + TBool IsLanguageSelectedL(); + + /** + * Starts listening the repository notifications for + * language selection. + */ + void StartListeningLanguageSelectionL(); + + /** + * Stops listening the repository notifications for + * language selection. + */ + void StopListeningLanguageSelection(); + + private: // data. + // Process monitor. Owned. + CHsProcessMonitor* iProcessMonitor; + + // Shutdown monitor. Owned. + CHsShutdownMonitor* iShutdownMonitor; + + // Repository. + CRepository *iRepository; + + // Repository notify handler. + CCenRepNotifyHandler* iCenRepNotifyHandler; + + // Application return value + TInt iApplicationReturnValue; + + friend class t_hsapplicationlauncher; + }; + +#endif // __HS_LAUNCH_ diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplicationlauncher/inc/hsprocessmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/inc/hsprocessmonitor.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,159 @@ +/* +* Copyright (c) 1020 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: process monitor. +*/ + + +#ifndef __HS_PROCESS_MONITOR__ +#define __HS_PROCESS_MONITOR__ + +#include + +class t_hsapplicationlauncher; + +/** + * MHsProcessMonitorObserver + * + * Monitor component observer. + * + * @since S60 5.2 + */ +class MHsProcessMonitorObserver + { + public: + /** + * Called when monitored process is ended. + * + * @param aExitType Exit type + * @param aExitReason Exit reason + * @param aExitCategory Exit category + */ + virtual void ProcessEnded( const TExitType& aExitType, + const TInt aExitReason, + const TExitCategoryName& aExitCategory ) = 0; + + /** + * Called when error occured during monitoring. + * + * @param aError System wide error code. + */ + virtual void ProcessMonitoringError( TInt aError ) = 0; + }; + +/** + * HsProcessMonitor + * + * Component for monitoring process states. + * + * @since S60 5.2 + */ +class CHsProcessMonitor : public CActive + { + public: + /** + * Create new monitor + * + * @param aProcessName process id + * @param aObserver monitor observer + * @since S60 5.2 + */ + static CHsProcessMonitor* NewL( const TInt aProcessId, + MHsProcessMonitorObserver& aObserver ); + + /** + * Destructor + * + * @since S60 5.2 + */ + ~CHsProcessMonitor(); + + /** + * Attach monitor + * + * @return TInt System wide error code. + * @since S60 5.2 + */ + TInt AttachMonitor(); + + /** + * Start monitor + * + * @return TInt System wide error code. + * @since S60 5.2 + */ + TInt StartMonitor(); + + protected: + /** + * C++ constructor + * + * @param aProcessName process id + * @param aObserver watchdog observer. + * @since S60 5.2 + */ + CHsProcessMonitor( const TInt aProcessId, + MHsProcessMonitorObserver& aObserver ); + + /** + * Symbian 2nd phase constructor + * + * @since S60 5.2 + */ + void ConstructL(); + + private: // From CActive + /** + * From CActive + */ + void RunL(); + + /** + * From CActive + * + * @since S60 5.2 + */ + void DoCancel(); + + /** + * From CActive + * + * @since S60 5.2 + */ + TInt RunError( TInt aError ); + + private: // New methods + /** + * Close process handle if open + * + * @since S60 5.2 + */ + void SecureProcessHandleAsClosed(); + + private: + // process id + TInt iProcessId; + + // watchdog observer + MHsProcessMonitorObserver& iObserver; + + // Process handle + RProcess iProcess; + + // boolean to represent whether process handle is open + TBool iProcessHandleOpen; + + friend class t_hsapplicationlauncher; + }; + +#endif // __HS_PROCESS_MONITOR__ diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplicationlauncher/inc/hsshutdownmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/inc/hsshutdownmonitor.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,121 @@ +/* +* Copyright (c) 1020 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: shutdown monitor. +*/ + + +#ifndef __HS_SHUTDOWN_MONITOR__ +#define __HS_SHUTDOWN_MONITOR__ + +#include +#include + +class t_hsapplicationlauncher; + +/** + * MHsShutdownMonitorObserver + * + * Monitor component observer. + * + * @since S60 5.2 + */ +class MHsShutdownMonitorObserver + { + public: + /** + * Called when shutdown occurs + */ + virtual void SystemShutdownEvent() = 0; + }; + +/** + * HsShutdownMonitor + * + * Component for monitoring shutdown + * + * @since S60 5.2 + */ +class CHsShutdownMonitor : public CActive + { + public: + /** + * Create new monitor + * + * @param aObserver monitor observer + * @since S60 5.2 + */ + static CHsShutdownMonitor* NewL( + MHsShutdownMonitorObserver& aObserver ); + + /** + * Destructor + * + * @since S60 5.2 + */ + ~CHsShutdownMonitor(); + + /** + * Start monitor + * + * @since S60 5.2 + */ + void StartMonitor(); + + protected: + /** + * C++ constructor + * + * @param aObserver monitor observer. + * @since S60 5.2 + */ + CHsShutdownMonitor( MHsShutdownMonitorObserver& aObserver ); + + /** + * Symbian 2nd phase constructor + * + * @since S60 5.2 + */ + void ConstructL(); + + private: // From CActive + /** + * From CActive + */ + void RunL(); + + /** + * From CActive + * + * @since S60 5.2 + */ + void DoCancel(); + + /** + * From CActive + * + * @since S60 5.2 + */ + TInt RunError( TInt aError ); + + private: + // watchdog observer + MHsShutdownMonitorObserver& iObserver; + + // State aware session. + RSsmStateAwareSession iSAS; + + friend class t_hsapplicationlauncher; + }; + +#endif // __HS_PROCESS_MONITOR__ diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplicationlauncher/src/hsapplicationlauncher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/src/hsapplicationlauncher.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,452 @@ +/* + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: application class. + * + */ + +#include +#include +#include "hsapplicationlauncher.h" + +// ========================= DECLARATIONS ================================== +_LIT( KHsExeName, "hsapplication.exe" ); +_LIT( KHsProcessName, "hsapplication.exe" ); +const TInt KSleepOnRetry = 250000; // 250ms +const TUid KPSCategoryUid = TUid::Uid( 0x20022F36 ); +const TInt KPSCrashCountKey = 1; +_LIT_SECURITY_POLICY_C1( KPSReadPolicy, ECapabilityReadDeviceData ); +_LIT_SECURITY_POLICY_C1( KPSWritePolicy, ECapabilityWriteDeviceData ); + +// ========================= LOCAL FUNCTIONS ================================== +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT +void RunAppL() + { + // Construct active scheduler. + CActiveScheduler* activeScheduler = new ( ELeave )CActiveScheduler(); + CleanupStack::PushL( activeScheduler ); + CActiveScheduler::Install( activeScheduler ); + + // Construct app. + CHsLaunch* app = CHsLaunch::NewL(); + CleanupStack::PushL( app ); + + app->Activate(); + + // Signal startup. + RProcess::Rendezvous(KErrNone); + + // Start active scheduler. + CActiveScheduler::Start(); + + User::LeaveIfError( app->ApplicationReturnValue() ); + + // Cleanup. + CleanupStack::PopAndDestroy( app ); + CleanupStack::PopAndDestroy( activeScheduler ); + } + +#ifndef HOMESCREEN_TEST +// ----------------------------------------------------------------------------- +// E32Main +// entry-point +// ----------------------------------------------------------------------------- +// +TInt E32Main() + { + TInt error = KErrNone; + + __UHEAP_MARK; + + // Construct cleanup stack. + CTrapCleanup* cleanupstack = CTrapCleanup::New(); + if( !cleanupstack ) + { + error = KErrNoMemory; + } + + // Call next phase of startup. + if( !error ) + { + TRAP( error, RunAppL() ); + } + + // Cleanup. + delete cleanupstack; + cleanupstack = NULL; + + __UHEAP_MARKEND; + + return error; + } +#endif //HOMESCREEN_TEST +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT +// ========================= MEMBER FUNCTIONS ================================== + +// ----------------------------------------------------------------------------- +// CHsLaunch::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +CHsLaunch* CHsLaunch::NewL() + { + CHsLaunch* self = new ( ELeave ) CHsLaunch(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CHsLaunch::ConstructL() + { + iRepository = CRepository::NewL(TUid::Uid(0x2002b3aa)); + + iShutdownMonitor = CHsShutdownMonitor::NewL( *this ); + iShutdownMonitor->StartMonitor(); + + // Create property to pub/sub. + TInt error = RProperty::Define( KPSCrashCountKey, + RProperty::EInt, + KPSReadPolicy, + KPSWritePolicy ); + if( error == KErrNone ) + { + // Init it to zero. + error = RProperty::Set( KPSCategoryUid, KPSCrashCountKey, 0 ); + } + else if( error == KErrAlreadyExists ) + { + error = KErrNone; + } + + User::LeaveIfError( error ); + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::CHsLaunch() +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +CHsLaunch::CHsLaunch() : + CActive( EPriorityStandard ), + iApplicationReturnValue( KErrNone ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::~CHsLaunch() +// Destructor. +// ----------------------------------------------------------------------------- +// +CHsLaunch::~CHsLaunch() + { + Cancel(); + + delete iRepository; + iRepository = NULL; + + delete iProcessMonitor; + iProcessMonitor = NULL; + + delete iShutdownMonitor; + iShutdownMonitor = NULL; + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::Activate() +// Set active object to be ran +// ----------------------------------------------------------------------------- +// +void CHsLaunch::Activate() + { + SetActive(); + TRequestStatus* tmp = &iStatus; + User::RequestComplete( tmp, KErrNone ); + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::ApplicationReturnValue() +// Get application return value +// ----------------------------------------------------------------------------- +// +TInt CHsLaunch::ApplicationReturnValue() + { + return iApplicationReturnValue; + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::RunL +// ----------------------------------------------------------------------------- +// +void CHsLaunch::RunL() + { +#if defined( __WINS__ ) + StartHomeScreen(); +#else + if (IsLanguageSelectedL()) + { + StartHomeScreen(); + } + else + { + StartListeningLanguageSelectionL(); + } +#endif //__WINS__ + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::DoCancel() +// From CActive. +// ----------------------------------------------------------------------------- +// +void CHsLaunch::DoCancel() + { + if( iProcessMonitor ) + { + iProcessMonitor->Cancel(); + } + + if( iShutdownMonitor ) + { + iShutdownMonitor->Cancel(); + } + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::RunError() +// From CActive. +// ----------------------------------------------------------------------------- +// +TInt CHsLaunch::RunError( TInt aError ) + { + /* Shutdown. This application + * will be restarted by startup sw. */ + ShutdownApp( KErrGeneral ); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::HandleNotifyInt() +// From MCenRepNotifyHandlerCallback +// ----------------------------------------------------------------------------- +// +void CHsLaunch::HandleNotifyInt(TUint32 aId, TInt aNewValue) +{ + if (aId == 0x00000007 && aNewValue) + { + StopListeningLanguageSelection(); + StartHomeScreen(); + } +} + +// ----------------------------------------------------------------------------- +// CHsLaunch::ProcessEndedL() +// From MHsProcessMonitorObserver +// ----------------------------------------------------------------------------- +// +void CHsLaunch::ProcessEnded( const TExitType& aExitType, + const TInt aExitReason, + const TExitCategoryName& /*aExitCategory*/ ) + { + TInt crashCount = 0; + TInt error = RProperty::Get( KPSCategoryUid, + KPSCrashCountKey, + crashCount ); + + // increment crash count in cenrep if the process has panic'd or killed with + // an error code + if( aExitType == EExitPanic || + ( aExitType == EExitKill && aExitReason != KErrNone ) ) + { + if( error == KErrNone ) + { + crashCount++; + error = RProperty::Set( KPSCategoryUid, + KPSCrashCountKey, + crashCount ); + } + + if( error == KErrNone ) + { + User::After( KSleepOnRetry ); + Activate(); + } + else + { + ShutdownApp( error ); + } + } + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::ProcessMonitoringErrorL() +// From MHsProcessMonitorObserver +// ----------------------------------------------------------------------------- +// +void CHsLaunch::ProcessMonitoringError( TInt aError ) + { + /* Error in this method is critical and it might cause + * endless active scheduler loop if no active objects are + * not triggered. Therefore shutdown. This application + * will be restarted by startup sw. */ + ShutdownApp( aError ); + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::SystemShutdownEvent() +// From MHsShutdownMonitorObserver +// ----------------------------------------------------------------------------- +// +void CHsLaunch::SystemShutdownEvent() + { + // Do not shut down app. Startup app would try to restart this app. + // Just deactivate all active objects and wait for power off. + if( IsActive() ) + { + Cancel(); + } + else + { + DoCancel(); + } + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::InitProcessMonitorL() +// Initialize process monitor +// ----------------------------------------------------------------------------- +// +void CHsLaunch::InitProcessMonitorL( const TInt aProcessId ) + { + if( iProcessMonitor ) + { + delete iProcessMonitor; + iProcessMonitor = NULL; + } + iProcessMonitor = CHsProcessMonitor::NewL( aProcessId, *this ); + User::LeaveIfError( iProcessMonitor->StartMonitor() ); + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::ShutdownApp() +// Shut down application +// ----------------------------------------------------------------------------- +// +void CHsLaunch::ShutdownApp( const TInt aApplicationReturnValue ) + { + if( IsActive() ) + { + Cancel(); + } + else + { + DoCancel(); + } + + iApplicationReturnValue = aApplicationReturnValue; +#ifndef HOMESCREEN_TEST + CActiveScheduler::Stop(); +#endif //HOMESCREEN_TEST + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::StartHomeScreen() +// Starts the homescreen application. +// ----------------------------------------------------------------------------- +// +void CHsLaunch::StartHomeScreen() + { + // Create app or connect to existing. + TInt processExisted = EFalse; + + RProcess process; + TInt processError = process.Create( KHsExeName, KNullDesC ); + if( processError == KErrAlreadyExists ) + { + processError = process.Open( KHsProcessName, EOwnerProcess ); + processExisted = ETrue; + } + TInt monitorError = KErrNone; + if( processError == KErrNone ) + { + TRAP( monitorError, InitProcessMonitorL( process.Id() ) ); + } + + if( processError == KErrNone && + !processExisted ) + { + // Make sure process is started even if monitor startup + // fails. This will assure that process is not left in + // suspended state. Resume can not be called for + // already running process (will cause KERN-EXEC 46). + process.Resume(); + } + + process.Close(); + + if( processError != KErrNone || + monitorError != KErrNone ) + { + /* Error in this method is critical and it might cause + * endless active scheduler loop if no active objects are + * not triggered. Therefore shutdown. This application + * will be restarted by startup sw. */ + ShutdownApp( KErrGeneral ); + } + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::IsLanguageSelected() +// Checks if the language is selected. +// ----------------------------------------------------------------------------- +// +TBool CHsLaunch::IsLanguageSelectedL() + { + TInt value; + User::LeaveIfError(iRepository->Get(0x00000007, value)); + return value; + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::StartListeningLanguageSelection() +// Starts to listen repository notifications. +// ----------------------------------------------------------------------------- +// +void CHsLaunch::StartListeningLanguageSelectionL() + { + iCenRepNotifyHandler = CCenRepNotifyHandler::NewL( + *this, *iRepository, CCenRepNotifyHandler::EIntKey, 0x00000007); + iCenRepNotifyHandler->StartListeningL(); + } + +// ----------------------------------------------------------------------------- +// CHsLaunch::StopListeningLanguageSelection() +// Stops to listen repository notifications. +// ----------------------------------------------------------------------------- +// +void CHsLaunch::StopListeningLanguageSelection() + { + iCenRepNotifyHandler->StopListening(); + delete iCenRepNotifyHandler; + iCenRepNotifyHandler = NULL; + } + +// End of File diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplicationlauncher/src/hsprocessmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/src/hsprocessmonitor.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -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: process monitor. + * + */ + +#include "hsprocessmonitor.h" + +// ========================= MEMBER FUNCTIONS ================================== + +// ----------------------------------------------------------------------------- +// CHsProcessMonitor::NewL() +// Two-phased constructor +// ----------------------------------------------------------------------------- +CHsProcessMonitor* CHsProcessMonitor::NewL( const TInt iProcessId, + MHsProcessMonitorObserver& aObserver ) + { + CHsProcessMonitor* self = new ( ELeave ) CHsProcessMonitor( iProcessId, + aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHsProcessMonitor::~CHsProcessMonitor() +// Destructor. +// ----------------------------------------------------------------------------- +// +CHsProcessMonitor::~CHsProcessMonitor() + { + Cancel(); + SecureProcessHandleAsClosed(); + iProcessId = KErrNotFound; + } + +// ----------------------------------------------------------------------------- +// CHsProcessMonitor::AttachMonitor() +// Attach monitor +// ----------------------------------------------------------------------------- +// +TInt CHsProcessMonitor::AttachMonitor() + { + SecureProcessHandleAsClosed(); + + TInt error = iProcess.Open( iProcessId, EOwnerProcess ); + + if( error == KErrNone ) + { + iProcessHandleOpen = ETrue; + } + + return error; + } + +// ----------------------------------------------------------------------------- +// CHsProcessMonitor::StartMonitor() +// Start monitor +// ----------------------------------------------------------------------------- +// +TInt CHsProcessMonitor::StartMonitor() + { + TInt error = KErrNone; + + if( !iProcessHandleOpen ) + { + error = AttachMonitor(); + } + + if( error == KErrNone ) + { + iProcess.Logon( iStatus ); + SetActive(); + } + + return error; + } + +// ----------------------------------------------------------------------------- +// CHsProcessMonitor::CHsProcessMonitor() +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +CHsProcessMonitor::CHsProcessMonitor( const TInt aProcessId, + MHsProcessMonitorObserver& aObserver ) : + CActive( EPriorityStandard ), + iProcessId( aProcessId ), + iObserver( aObserver ), + iProcessHandleOpen( EFalse ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CHsProcessMonitor::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CHsProcessMonitor::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CHsProcessMonitor::RunL +// ----------------------------------------------------------------------------- +// +void CHsProcessMonitor::RunL() + { + iProcess.LogonCancel( iStatus ); + + const TInt error = iStatus.Int(); + + if( error == KErrCancel ) + { + } + else if( error == KErrNoMemory ) + { + User::Leave( KErrNoMemory ); + } + else + { + const TExitType exitType = iProcess.ExitType(); + if( exitType == EExitPending ) + { + User::LeaveIfError( StartMonitor() ); + } + else + { + iObserver.ProcessEnded( exitType, + iProcess.ExitReason(), + iProcess.ExitCategory() ); + } + } + } + +// ----------------------------------------------------------------------------- +// CHsProcessMonitor::DoCancel() +// From CActive. +// ----------------------------------------------------------------------------- +// +void CHsProcessMonitor::DoCancel() + { + iProcess.LogonCancel( iStatus ); + } + +// ----------------------------------------------------------------------------- +// CHsProcessMonitor::RunError() +// From CActive. +// ----------------------------------------------------------------------------- +// +TInt CHsProcessMonitor::RunError( TInt aError ) + { + iObserver.ProcessMonitoringError( aError ); + + // Observer will handle error. Return green light. + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CHsProcessMonitor::SecureProcessHandleAsClosed() +// Close process handle if open +// ----------------------------------------------------------------------------- +// +void CHsProcessMonitor::SecureProcessHandleAsClosed() + { + if( iProcessHandleOpen ) + { + iProcess.Close(); + iProcessHandleOpen = EFalse; + } + } + +// End of File diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsapplicationlauncher/src/hsshutdownmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/src/hsshutdownmonitor.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,130 @@ +/* + * 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: shutdown monitor. + * + */ + +#include +#include + +#include "hsshutdownmonitor.h" + +// ========================= MEMBER FUNCTIONS ================================== + +// ----------------------------------------------------------------------------- +// CHsShutdownMonitor::NewL() +// Two-phased constructor +// ----------------------------------------------------------------------------- +CHsShutdownMonitor* CHsShutdownMonitor::NewL( + MHsShutdownMonitorObserver& aObserver ) + { + CHsShutdownMonitor* self = new ( ELeave ) CHsShutdownMonitor( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHsShutdownMonitor::~CHsShutdownMonitor() +// Destructor. +// ----------------------------------------------------------------------------- +// +CHsShutdownMonitor::~CHsShutdownMonitor() + { + Cancel(); + iSAS.Close(); + } + +// ----------------------------------------------------------------------------- +// CHsShutdownMonitor::StartMonitor() +// Start monitor +// ----------------------------------------------------------------------------- +// +void CHsShutdownMonitor::StartMonitor() + { + iSAS.RequestStateNotification( iStatus ); + SetActive(); + } + +// ----------------------------------------------------------------------------- +// CHsShutdownMonitor::CHsShutdownMonitor() +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +CHsShutdownMonitor::CHsShutdownMonitor( MHsShutdownMonitorObserver& aObserver ) : + CActive( EPriorityStandard ), + iObserver( aObserver ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CHsShutdownMonitor::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CHsShutdownMonitor::ConstructL() + { + User::LeaveIfError( iSAS.Connect( KSM2GenMiddlewareDomain3 ) ); + } + +// ----------------------------------------------------------------------------- +// CHsShutdownMonitor::RunL +// ----------------------------------------------------------------------------- +// +void CHsShutdownMonitor::RunL() + { + User::LeaveIfError( iStatus.Int() ); + + TBool registerForMoreEvents = ETrue; + + TSsmState state = iSAS.State(); + if( state.MainState() == ESsmShutdown ) + { + iObserver.SystemShutdownEvent(); + registerForMoreEvents = EFalse; + } + + if( registerForMoreEvents ) + { + iSAS.AcknowledgeAndRequestStateNotification( KErrNone, iStatus ); + SetActive(); + } + else + { + iSAS.AcknowledgeStateNotification( KErrNone ); + } + } + +// ----------------------------------------------------------------------------- +// CHsShutdownMonitor::DoCancel() +// From CActive. +// ----------------------------------------------------------------------------- +// +void CHsShutdownMonitor::DoCancel() + { + iSAS.RequestStateNotificationCancel(); + } + +// ----------------------------------------------------------------------------- +// CHsShutdownMonitor::RunError() +// From CActive. +// ----------------------------------------------------------------------------- +// +TInt CHsShutdownMonitor::RunError( TInt aError ) + { + return aError; + } + +// End of File diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/hsdomainmodel.pri --- a/homescreenapp/hsdomainmodel/hsdomainmodel.pri Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/hsdomainmodel.pri Wed Aug 18 09:40:07 2010 +0300 @@ -19,6 +19,7 @@ ./inc/hsdatabase.h \ ./inc/hsdomainmodel_global.h \ ./inc/hspage.h \ + ./inc/hspagevisual.h \ ./inc/hspagenewwidgetlayout.h \ ./inc/hsgui.h \ ./inc/hsscene.h \ @@ -27,18 +28,24 @@ ./inc/hswallpaper.h \ ./inc/hswallpaperloader.h \ ./inc/hswallpaperloaderthread.h \ + ./inc/hshostedwidgetfactory.h \ ./inc/hswidgethost.h \ + ./inc/hswidgethostvisual.h \ ./inc/hswidgetcomponentregistry.h \ ./inc/hswidgetcomponent.h \ ./inc/hswidgetcomponentdescriptor.h \ ./inc/hsbackuprestoreobserver.h \ ./inc/hsconfiguration.h \ ./inc/hswidgettoucharea.h \ - ./inc/hspagetoucharea.h + ./inc/hspagetoucharea.h \ + ./inc/hsidlewidget.h \ + ./inc/hsdocumentloader.h + SOURCES += ./src/hscontentservice.cpp \ ./src/hsdatabase.cpp \ ./src/hspage.cpp \ + ./src/hspagevisual.cpp \ ./src/hspagenewwidgetlayout.cpp \ ./src/hsgui.cpp \ ./src/hsscene.cpp \ @@ -46,14 +53,18 @@ ./src/hswallpaper.cpp \ ./src/hswallpaperloader.cpp \ ./src/hswallpaperloaderthread.cpp \ + ./src/hshostedwidgetfactory.cpp \ ./src/hswidgethost.cpp \ + ./src/hswidgethostvisual.cpp \ ./src/hswidgetcomponentregistry.cpp \ ./src/hswidgetcomponent.cpp \ ./src/hswidgetcomponentdescriptor.cpp \ ./src/hsbackuprestoreobserver.cpp \ ./src/hsconfiguration.cpp \ ./src/hswidgettoucharea.cpp \ - ./src/hspagetoucharea.cpp + ./src/hspagetoucharea.cpp \ + ./src/hsidlewidget.cpp \ + ./src/hsdocumentloader.cpp symbian: { HEADERS += ./inc/hsbackuprestoreobserver_p.h \ diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/hsdomainmodel.pro --- a/homescreenapp/hsdomainmodel/hsdomainmodel.pro Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/hsdomainmodel.pro Wed Aug 18 09:40:07 2010 +0300 @@ -40,11 +40,16 @@ ../hsutils/inc \ ../hsapplication/inc +RESOURCES += hsdomainmodel.qrc + symbian: { TARGET.UID3 = 0x20022F38 LIBS += -lxqsettingsmanager -labclient } -win32:{ +!symbian:{ QT += network } + +new_short:DEFINES += HSWIDGETORGANIZER_ALGORITHM + include(hsdomainmodel.pri) diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/hsdomainmodel.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/hsdomainmodel.qrc Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,5 @@ + + + resource/controllayer.docml + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/inc/hsconfiguration.h --- a/homescreenapp/hsdomainmodel/inc/hsconfiguration.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/inc/hsconfiguration.h Wed Aug 18 09:40:07 2010 +0300 @@ -20,6 +20,7 @@ #include #include +#include #include @@ -47,7 +48,7 @@ Q_PROPERTY(int widgetDragEffectDuration READ widgetDragEffectDuration WRITE setWidgetDragEffectDuration) Q_PROPERTY(int widgetDropEffectDuration READ widgetDropEffectDuration WRITE setWidgetDropEffectDuration) Q_PROPERTY(int defaultPageId READ defaultPageId WRITE setDefaultPageId) - Q_PROPERTY(int maximumPageCount READ maximumPageCount WRITE setMaximumPageCount) + Q_PROPERTY(int maximumPageCount READ maximumPageCount WRITE setMaximumPageCount) Q_PROPERTY(bool isShortcutLabelVisible READ isShortcutLabelVisible WRITE setShortcutLabelVisible) Q_PROPERTY(qreal bounceFeedbackEffectDistance READ bounceFeedbackEffectDistance WRITE setBounceFeedbackEffectDistance) Q_PROPERTY(qreal pageChangePanDistanceInPixels READ pageChangePanDistanceInPixels WRITE setPageChangePanDistanceInPixels) @@ -73,11 +74,13 @@ Q_PROPERTY(int snapTimeout READ snapTimeout WRITE setSnapTimeout) Q_PROPERTY(qreal snapForce READ snapForce WRITE setSnapForce) Q_PROPERTY(qreal snapGap READ snapGap WRITE setSnapGap) - Q_PROPERTY(qreal snapBorderGap READ snapBorderGap WRITE setSnapBorderGap) + Q_PROPERTY(qreal pageMargin READ pageMargin WRITE setPageMargin) Q_PROPERTY(int snapLineFadeInDuration READ snapLineFadeInDuration WRITE setSnapLineFadeInDuration) Q_PROPERTY(int snapLineFadeOutDuration READ snapLineFadeOutDuration WRITE setSnapLineFadeOutDuration) Q_PROPERTY(bool isSnapEffectsEnabled READ isSnapEffectsEnabled WRITE setSnapEffectsEnabled) Q_PROPERTY(SceneType sceneType READ sceneType WRITE setSceneType) + Q_PROPERTY(QEasingCurve::Type bounceAnimationEasingCurve READ bounceAnimationEasingCurve WRITE setBounceAnimationEasingCurve) + Q_PROPERTY(QEasingCurve::Type pageChangeAnimationEasingCurve READ pageChangeAnimationEasingCurve WRITE setPageChangeAnimationEasingCurve) Q_ENUMS(SceneType) @@ -91,107 +94,122 @@ SceneWallpaper }; +#define SETVALUE(member, name) \ + if (member != value) { \ + member = value; \ + emit propertyChanged(name); \ + } + int bounceEffect() const { return mBounceEffect; } - void setBounceEffect(int effect) { mBounceEffect = effect; } + void setBounceEffect(int value) { SETVALUE(mBounceEffect, "bounceEffect") } int widgetTapAndHoldTimeout() const { return mWidgetTapAndHoldTimeout; } - void setWidgetTapAndHoldTimeout(int timeout) { mWidgetTapAndHoldTimeout = timeout; } + void setWidgetTapAndHoldTimeout(int value) { SETVALUE(mWidgetTapAndHoldTimeout, "widgetTapAndHoldTimeout") } int sceneTapAndHoldTimeout() const { return mSceneTapAndHoldTimeout; } - void setSceneTapAndHoldTimeout(int timeout) { mSceneTapAndHoldTimeout = timeout; } + void setSceneTapAndHoldTimeout(int value) { SETVALUE(mSceneTapAndHoldTimeout, "sceneTapAndHoldTimeout") } int pageChangeAnimationDuration() const { return mPageChangeAnimationDuration; } - void setPageChangeAnimationDuration(int duration) { mPageChangeAnimationDuration = duration; } + void setPageChangeAnimationDuration(int value) { SETVALUE(mPageChangeAnimationDuration, "pageChangeAnimationDuration") } int pageChangeZoneAnimationDuration() const { return mPageChangeZoneAnimationDuration; } - void setPageChangeZoneAnimationDuration(int duration) { mPageChangeZoneAnimationDuration = duration; } + void setPageChangeZoneAnimationDuration(int value) { SETVALUE(mPageChangeZoneAnimationDuration, "pageChangeZoneAnimationDuration") } int pageChangeZoneReverseAnimationDuration() const { return mPageChangeZoneReverseAnimationDuration; } - void setPageChangeZoneReverseAnimationDuration(int duration) { mPageChangeZoneReverseAnimationDuration = duration; } + void setPageChangeZoneReverseAnimationDuration(int value) { SETVALUE(mPageChangeZoneReverseAnimationDuration, "pageChangeZoneReverseAnimationDuration") } int pageRemovedAnimationDuration() const { return mPageRemovedAnimationDuration; } - void setPageRemovedAnimationDuration(int duration) { mPageRemovedAnimationDuration = duration; } + void setPageRemovedAnimationDuration(int value) { SETVALUE(mPageRemovedAnimationDuration, "pageRemovedAnimationDuration") } int newPageAddedAnimationDuration() const { return mNewPageAddedAnimationDuration; } - void setNewPageAddedAnimationDuration(int duration) { mNewPageAddedAnimationDuration = duration; } + void setNewPageAddedAnimationDuration(int value) { SETVALUE(mNewPageAddedAnimationDuration, "newPageAddedAnimationDuration") } int widgetDragEffectDuration() const { return mWidgetDragEffectDuration; } - void setWidgetDragEffectDuration(int duration) { mWidgetDragEffectDuration = duration; } + void setWidgetDragEffectDuration(int value) { SETVALUE(mWidgetDragEffectDuration, "widgetDragEffectDuration") } int widgetDropEffectDuration() const { return mWidgetDropEffectDuration; } - void setWidgetDropEffectDuration(int duration) { mWidgetDropEffectDuration = duration; } + void setWidgetDropEffectDuration(int value) { SETVALUE(mWidgetDropEffectDuration, "widgetDropEffectDuration") } int defaultPageId() const { return mDefaultPageId; } - void setDefaultPageId(int id) { mDefaultPageId = id; } + void setDefaultPageId(int value) { SETVALUE(mDefaultPageId, "defaultPageId") } int maximumPageCount() const { return mMaximumPageCount; } - void setMaximumPageCount(int count) { mMaximumPageCount = count; } + void setMaximumPageCount(int value) { SETVALUE(mMaximumPageCount, "maximumPageCount") } bool isShortcutLabelVisible() const { return mIsShortcutLabelVisible; } - void setShortcutLabelVisible(bool visible) { mIsShortcutLabelVisible = visible; } + void setShortcutLabelVisible(bool value) { SETVALUE(mIsShortcutLabelVisible, "isShortcutLabelVisible") } qreal bounceFeedbackEffectDistance() const { return mBounceFeedbackEffectDistance; } - void setBounceFeedbackEffectDistance(qreal distance) { mBounceFeedbackEffectDistance = distance; } + void setBounceFeedbackEffectDistance(qreal value) { SETVALUE(mBounceFeedbackEffectDistance, "bounceFeedbackEffectDistance") } qreal pageChangePanDistanceInPixels() const { return mPageChangePanDistanceInPixels; } - void setPageChangePanDistanceInPixels(qreal distance) { mPageChangePanDistanceInPixels = distance; } + void setPageChangePanDistanceInPixels(qreal value) { SETVALUE(mPageChangePanDistanceInPixels, "pageChangePanDistanceInPixels") } qreal tapAndHoldDistance() const { return mTapAndHoldDistance; } - void setTapAndHoldDistance(qreal distance) { mTapAndHoldDistance = distance; } + void setTapAndHoldDistance(qreal value) { SETVALUE(mTapAndHoldDistance, "tapAndHoldDistance") } qreal pageChangeZoneWidth() const { return mPageChangeZoneWidth; } - void setPageChangeZoneWidth(qreal width) { mPageChangeZoneWidth = width; } + void setPageChangeZoneWidth(qreal value) { SETVALUE(mPageChangeZoneWidth, "pageChangeZoneWidth") } qreal pageIndicatorSpacing() const { return mPageIndicatorSpacing; } - void setPageIndicatorSpacing(qreal spacing) { mPageIndicatorSpacing = spacing; } + void setPageIndicatorSpacing(qreal value) { SETVALUE(mPageIndicatorSpacing, "pageIndicatorSpacing") } qreal maximumWidgetHeight() const { return mMaximumWidgetHeight; } - void setMaximumWidgetHeight(qreal height) { mMaximumWidgetHeight = height; } + void setMaximumWidgetHeight(qreal value) { SETVALUE(mMaximumWidgetHeight, "maximumWidgetHeight") } qreal maximumWidgetWidth() const { return mMaximumWidgetWidth; } - void setMaximumWidgetWidth(qreal width) { mMaximumWidgetWidth = width; } + void setMaximumWidgetWidth(qreal value) { SETVALUE(mMaximumWidgetWidth, "maximumWidgetWidth") } qreal minimumWidgetHeight() const { return mMinimumWidgetHeight; } - void setMinimumWidgetHeight(qreal height) { mMinimumWidgetHeight = height; } + void setMinimumWidgetHeight(qreal value) { SETVALUE(mMinimumWidgetHeight, "minimumWidgetHeight") } qreal minimumWidgetWidth() const { return mMinimumWidgetWidth; } - void setMinimumWidgetWidth(qreal width) { mMinimumWidgetWidth = width; } + void setMinimumWidgetWidth(qreal value) { SETVALUE(mMinimumWidgetWidth, "minimumWidgetWidth") } qreal pageChangePanDistance() const { return mPageChangePanDistance; } - void setPageChangePanDistance(qreal distance) { mPageChangePanDistance = distance; } + void setPageChangePanDistance(qreal value) { SETVALUE(mPageChangePanDistance, "pageChangePanDistance") } HbFeedback::InstantEffect pageChangeFeedbackEffect() const { return mPageChangeFeedbackEffect; } - void setPageChangeFeedbackEffect(HbFeedback::InstantEffect effect) { mPageChangeFeedbackEffect = effect; } + void setPageChangeFeedbackEffect(HbFeedback::InstantEffect value) { SETVALUE(mPageChangeFeedbackEffect, "pageChangeFeedbackEffect") } HbFeedback::InstantEffect widgetPickFeedbackEffect() const { return mWidgetPickFeedbackEffect; } - void setWidgetPickFeedbackEffect(HbFeedback::InstantEffect effect) { mWidgetPickFeedbackEffect = effect; } + void setWidgetPickFeedbackEffect(HbFeedback::InstantEffect value) { SETVALUE(mWidgetPickFeedbackEffect, "widgetPickFeedbackEffect") } HbFeedback::InstantEffect widgetDropFeedbackEffect() const { return mWidgetDropFeedbackEffect; } - void setWidgetDropFeedbackEffect(HbFeedback::InstantEffect effect) { mWidgetDropFeedbackEffect = effect; } + void setWidgetDropFeedbackEffect(HbFeedback::InstantEffect value) { SETVALUE(mWidgetDropFeedbackEffect, "widgetDropFeedbackEffect") } HbFeedback::InstantEffect widgetRepositionFeedbackEffect() const { return mWidgetRepositionFeedbackEffect; } - void setWidgetRepositionFeedbackEffect(HbFeedback::InstantEffect effect) { mWidgetRepositionFeedbackEffect = effect; } + void setWidgetRepositionFeedbackEffect(HbFeedback::InstantEffect value) { SETVALUE(mWidgetRepositionFeedbackEffect, "widgetRepositionFeedbackEffect") } HbFeedback::InstantEffect widgetOverTrashbinFeedbackEffect() const { return mWidgetOverTrashbinFeedbackEffect; } - void setWidgetOverTrashbinFeedbackEffect(HbFeedback::InstantEffect effect) { mWidgetOverTrashbinFeedbackEffect = effect; } + void setWidgetOverTrashbinFeedbackEffect(HbFeedback::InstantEffect value) { SETVALUE(mWidgetOverTrashbinFeedbackEffect, "widgetOverTrashbinFeedbackEffect") } HbFeedback::InstantEffect widgetDropToTrashbinFeedbackEffect() const { return mWidgetDropToTrashbinFeedbackEffect; } - void setWidgetDropToTrashbinFeedbackEffect(HbFeedback::InstantEffect effect) { mWidgetDropToTrashbinFeedbackEffect = effect; } + void setWidgetDropToTrashbinFeedbackEffect(HbFeedback::InstantEffect value) { SETVALUE(mWidgetDropToTrashbinFeedbackEffect, "widgetDropToTrashbinFeedbackEffect") } HbFeedback::InstantEffect shortcutWidgetTapFeedbackEffect() const { return mShortcutWidgetTapFeedbackEffect; } - void setShortcutWidgetTapFeedbackEffect(HbFeedback::InstantEffect effect) { mShortcutWidgetTapFeedbackEffect = effect; } + void setShortcutWidgetTapFeedbackEffect(HbFeedback::InstantEffect value) { SETVALUE(mShortcutWidgetTapFeedbackEffect, "shortcutWidgetTapFeedbackEffect") } HbFeedback::InstantEffect widgetMoveBlockedFeedbackEffect() const { return mWidgetMoveBlockedFeedbackEffect; } - void setWidgetMoveBlockedFeedbackEffect(HbFeedback::InstantEffect effect) { mWidgetMoveBlockedFeedbackEffect = effect; } + void setWidgetMoveBlockedFeedbackEffect(HbFeedback::InstantEffect value) { SETVALUE(mWidgetMoveBlockedFeedbackEffect, "widgetMoveBlockedFeedbackEffect") } HbFeedback::InstantEffect clockWidgetTapFeedbackEffect() const { return mClockWidgetTapFeedbackEffect; } - void setClockWidgetTapFeedbackEffect(HbFeedback::InstantEffect effect) { mClockWidgetTapFeedbackEffect = effect; } + void setClockWidgetTapFeedbackEffect(HbFeedback::InstantEffect value) { SETVALUE(mClockWidgetTapFeedbackEffect, "clockWidgetTapFeedbackEffect") } HbFeedback::InstantEffect widgetSnappingFeedbackEffect() const { return mWidgetSnappingFeedbackEffect; } - void setWidgetSnappingFeedbackEffect(HbFeedback::InstantEffect effect) { mWidgetSnappingFeedbackEffect = effect; } + void setWidgetSnappingFeedbackEffect(HbFeedback::InstantEffect value) { SETVALUE(mWidgetSnappingFeedbackEffect, "widgetSnappingFeedbackEffect") } bool isSnapEnabled() const { return mIsSnapEnabled; } - void setSnapEnabled(bool enabled) { mIsSnapEnabled = enabled; } + void setSnapEnabled(bool value) { SETVALUE(mIsSnapEnabled, "isSnapEnabled") } int snapTimeout() const { return mSnapTimeout; } - void setSnapTimeout(int timeout) { mSnapTimeout = timeout; } + void setSnapTimeout(int value) { SETVALUE(mSnapTimeout, "snapTimeout") } qreal snapForce() const { return mSnapForce; } - void setSnapForce(qreal force) { mSnapForce = force; } + void setSnapForce(qreal value) { SETVALUE(mSnapForce, "snapForce") } qreal snapGap() const { return mSnapGap; } - void setSnapGap(qreal gap) { mSnapGap = gap; } - qreal snapBorderGap() const { return mSnapBorderGap; } - void setSnapBorderGap(qreal gap) { mSnapBorderGap = gap; } + void setSnapGap(qreal value) { SETVALUE(mSnapGap, "snapGap") } + qreal pageMargin() const { return mPageMargin; } + void setPageMargin(qreal value) { SETVALUE(mPageMargin, "pageMargin") } int snapLineFadeInDuration() const { return mSnapLineFadeInDuration; } - void setSnapLineFadeInDuration(int duration) { mSnapLineFadeInDuration = duration; } + void setSnapLineFadeInDuration(int value) { SETVALUE(mSnapLineFadeInDuration, "snapLineFadeInDuration") } int snapLineFadeOutDuration() const { return mSnapLineFadeOutDuration; } - void setSnapLineFadeOutDuration(int duration) { mSnapLineFadeOutDuration = duration; } + void setSnapLineFadeOutDuration(int value) { SETVALUE(mSnapLineFadeOutDuration, "snapLineFadeOutDuration") } bool isSnapEffectsEnabled() const { return mIsSnapEffectsEnabled; } - void setSnapEffectsEnabled(bool enabled) { mIsSnapEffectsEnabled = enabled; } + void setSnapEffectsEnabled(bool value) { SETVALUE(mIsSnapEffectsEnabled, "isSnapEffectsEnabled") } SceneType sceneType() const { return mSceneType; } - void setSceneType(SceneType type) { mSceneType = type; } - + void setSceneType(SceneType value) { SETVALUE(mSceneType, "sceneType") } + QEasingCurve::Type bounceAnimationEasingCurve() const { return mBounceAnimationEasingCurve; } + void setBounceAnimationEasingCurve(QEasingCurve::Type value) { SETVALUE(mBounceAnimationEasingCurve, "bounceAnimationEasingCurve") } + QEasingCurve::Type pageChangeAnimationEasingCurve() const { return mPageChangeAnimationEasingCurve; } + void setPageChangeAnimationEasingCurve(QEasingCurve::Type value) { SETVALUE(mPageChangeAnimationEasingCurve, "pageChangeAnimationEasingCurve") } + +#undef SETVALUE + QSizeF minimumWidgetSizeInUnits() const; QSizeF maximumWidgetSizeInUnits() const; QSizeF minimumWidgetSizeInPixels() const; QSizeF maximumWidgetSizeInPixels() const; - + bool load(); bool importFromFile(const QString &path); bool exportToFile(const QString &path); - + static HsConfiguration *instance(); static HsConfiguration *takeInstance(); static void setInstance(HsConfiguration *instance); +signals: + void propertyChanged(const QString &name); + private: Q_DISABLE_COPY(HsConfiguration) - + private: int mBounceEffect; int mWidgetTapAndHoldTimeout; @@ -230,12 +248,14 @@ int mSnapTimeout; qreal mSnapForce; qreal mSnapGap; - qreal mSnapBorderGap; + qreal mPageMargin; int mSnapLineFadeInDuration; int mSnapLineFadeOutDuration; bool mIsSnapEffectsEnabled; SceneType mSceneType; - + QEasingCurve::Type mBounceAnimationEasingCurve; + QEasingCurve::Type mPageChangeAnimationEasingCurve; + static HsConfiguration *mInstance; HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/inc/hsdocumentloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/inc/hsdocumentloader.h Wed Aug 18 09:40:07 2010 +0300 @@ -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: Homescreen document loader class. +* +*/ + +#ifndef HSDOCUMENTLOADER_H +#define HSDOCUMENTLOADER_H + +#include +#include "hstest_global.h" + +HOMESCREEN_TEST_CLASS(TestHsDomainModel) + +class HsDocumentLoader : public HbDocumentLoader +{ +public: + HsDocumentLoader(); + virtual ~HsDocumentLoader(); + +public: + QObject *createObject(const QString &type, const QString &name); + +private: + + Q_DISABLE_COPY(HsDocumentLoader) + + HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) +}; + +#endif diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/inc/hsdomainmodel_global.h --- a/homescreenapp/hsdomainmodel/inc/hsdomainmodel_global.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/inc/hsdomainmodel_global.h Wed Aug 18 09:40:07 2010 +0300 @@ -19,7 +19,7 @@ #ifndef HSDOMAINMODEL_GLOBAL_H #define HSDOMAINMODEL_GLOBAL_H -#include +#include // services uri; services key names used when the service is passed as property in state const char CONTENT_SERVICE_KEY[] = "http://homescreen.nokia.com/runtimeservices/contentservice"; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/inc/hsdomainmodeldatastructures.h --- a/homescreenapp/hsdomainmodel/inc/hsdomainmodeldatastructures.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/inc/hsdomainmodeldatastructures.h Wed Aug 18 09:40:07 2010 +0300 @@ -19,7 +19,7 @@ #define HSDOMAINMODELDATASTRUCTURES_H #include - +#include #include "hsdomainmodel_global.h" class HSDOMAINMODEL_EXPORT HsSceneData diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/inc/hsgui.h --- a/homescreenapp/hsdomainmodel/inc/hsgui.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/inc/hsgui.h Wed Aug 18 09:40:07 2010 +0300 @@ -18,34 +18,61 @@ #ifndef HSGUI_H #define HSGUI_H + +#include #include - +#include #include "hsdomainmodel_global.h" #include "hstest_global.h" +HOMESCREEN_TEST_CLASS(TestHsDomainModel) HOMESCREEN_TEST_CLASS(HomeScreenStatePluginTest) class HbView; -class HbMainWindow; +class HsIdleWidget; +class HsPropertyAnimationWrapper; -class HSDOMAINMODEL_EXPORT HsGui +struct HsGuiImpl; + +class HSDOMAINMODEL_EXPORT HsGui: public QObject { + Q_OBJECT public: - static HbView *idleView(); - static HbView *takeIdleView(); - static void setIdleView(HbView *idleView); - - static HbMainWindow *mainWindow(); + ~HsGui(); + + static HsGui *setInstance(HsGui *); + static HsGui *instance(); + static HsGui *takeInstance(); + + void setupIdleUi(); + void cleanupIdleUi(); + + void setOrientation(Qt::Orientation); + Qt::Orientation orientation(); + + HbView *idleView() const; + HsIdleWidget *idleWidget() const; + + QRectF layoutRect() const; + + void show(); + + HsPropertyAnimationWrapper *pageChangeAnimation(); + HsPropertyAnimationWrapper *pageCrawlingAnimation(); +signals: + void orientationChanged(Qt::Orientation); + void navigateToApplibrary(); + +private: + HsGui(QObject *parent=0); private: - HsGui() {} - -private: - static QPointer mIdleView; - + static HsGui *mInstance; + HsGuiImpl *mImpl; + HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest) }; -Q_DECLARE_METATYPE(HsGui*) + #endif // HSGUI_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/inc/hshostedwidgetfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/inc/hshostedwidgetfactory.h Wed Aug 18 09:40:07 2010 +0300 @@ -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: +* +*/ + +#ifndef HSHOSTEDWIDGETFACTORY_H +#define HSHOSTEDWIDGETFACTORY_H + +#include + + +#include "hsdomainmodel_global.h" +#include "hsdomainmodeldatastructures.h" + +#include "hstest_global.h" +HOMESCREEN_TEST_CLASS(TestHsDomainModel) + +struct HsHostedWidgetFactoryImpl; + +class HSDOMAINMODEL_EXPORT HsHostedWidgetFactory : public QObject +{ + Q_OBJECT + +public: + static HsHostedWidgetFactory *instance(); + static HsHostedWidgetFactory *takeInstance(); + static HsHostedWidgetFactory *setInstance(HsHostedWidgetFactory *); + ~HsHostedWidgetFactory(); + + QObject *createWidget(const QString &uri); +private: + Q_DISABLE_COPY(HsHostedWidgetFactory) + HsHostedWidgetFactory(QObject *parent = 0); +private: + static HsHostedWidgetFactory *mInstance; + HsHostedWidgetFactoryImpl *mImpl; + + HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) +}; + +#endif // HSWIDGETHOST_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/inc/hsidlewidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/inc/hsidlewidget.h Wed Aug 18 09:40:07 2010 +0300 @@ -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: +* +*/ + + +#ifndef HSIDLEWIDGET_H +#define HSIDLEWIDGET_H + +#include + +#include "hstest_global.h" +#include "hsdomainmodel_global.h" + +HOMESCREEN_TEST_CLASS(TestHsDomainModel) + +class HsPage; +class HsTrashBinWidget; +class HsPageIndicator; +class HsSnapLine; + +class HSDOMAINMODEL_EXPORT HsIdleWidget : public HbWidget +{ + Q_OBJECT + Q_PROPERTY(qreal sceneX READ sceneX WRITE setSceneX) + +public: + HsIdleWidget(QGraphicsItem *parent = 0); + ~HsIdleWidget(); + + qreal sceneX() const; + void setSceneX(qreal x); + + void setGeometry(const QRectF &rect); + + void setActivePage(int index); + void insertPage(int index, HsPage *page); + void removePage(int index); + + HbWidget *controlLayer() const { return mControlLayer; } + HbWidget *pageLayer() const { return mPageLayer; } + HbWidget *pageWallpaperLayer() const { return mPageWallpaperLayer; } + HbWidget *sceneLayer() const { return mSceneLayer; } + + HsTrashBinWidget *trashBin() const { return mTrashBin; } + HsPageIndicator *pageIndicator() const { return mPageIndicator; } + + qreal parallaxFactor() const; + + +public slots: + void showTrashBin(); + void showPageIndicator(); + + void showVerticalSnapLine(const QLineF &snapLine); + void hideVerticalSnapLine(); + void showHorizontalSnapLine(const QLineF &snapLine); + void hideHorizontalSnapLine(); + +protected: + void polishEvent(); + +private: + Q_DISABLE_COPY(HsIdleWidget) + void loadControlLayer(); + +private: + HbWidget *mControlLayer; + HbWidget *mPageLayer; + HbWidget *mPageWallpaperLayer; + HbWidget *mSceneLayer; + + HsTrashBinWidget *mTrashBin; + HsPageIndicator *mPageIndicator; + + HsSnapLine *mHorizontalSnapLine; + HsSnapLine *mVerticalSnapLine; + + HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) +}; + +#endif // HSIDLEWIDGET_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/inc/hspage.h --- a/homescreenapp/hsdomainmodel/inc/hspage.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/inc/hspage.h Wed Aug 18 09:40:07 2010 +0300 @@ -18,6 +18,7 @@ #ifndef HSPAGE_H #define HSPAGE_H +#include #include #include #include "hsdomainmodel_global.h" @@ -27,62 +28,60 @@ class HsPageData; class HsWallpaper; class HsPageTouchArea; +class HsPageVisual; HOMESCREEN_TEST_CLASS(TestHsDomainModel) -class HSDOMAINMODEL_EXPORT HsPage : public HbWidget +class HSDOMAINMODEL_EXPORT HsPage : public QObject { Q_OBJECT Q_PROPERTY(int pageIndex READ pageIndex) public: - HsPage(QGraphicsItem *parent = 0); + HsPage(QObject *parent = 0); ~HsPage(); - int databaseId() const; void setDatabaseId(int id); - - void setGeometry(const QRectF &rect); - + // void setGeometry(const QRectF &rect); bool load(); - HsWallpaper *wallpaper() const; - bool addExistingWidget(HsWidgetHost *widgetHost); bool removeWidget(HsWidgetHost *widgeHost); - QList newWidgets(); bool addNewWidget(HsWidgetHost *widgetHost, const QPointF &position = QPointF()); void layoutNewWidgets(); void resetNewWidgets(); bool deleteFromDatabase(); - QList widgets() const; - bool isRemovable() const; void setRemovable(bool removable); - bool isDefaultPage() const; bool isActivePage() const; - static HsPage *createInstance(const HsPageData &pageData); - - QPointF mTouchPoint; - + QPointF adjustedWidgetPosition(const QRectF &origWidgetRect); + QRectF contentGeometry(); + QRectF contentGeometry(Qt::Orientation orientation); + QRectF contentRect(); + QRectF contentRect(Qt::Orientation orientation); + HsPageVisual *visual() const; +#ifdef HSWIDGETORGANIZER_ALGORITHM + enum sortOrder { height, width}; +#endif //HSWIDGETORGANIZER_ALGORITHM public slots: void showWidgets(); void hideWidgets(); void setOnline(bool online = true); - void updateZValues(); - int pageIndex(); private: Q_DISABLE_COPY(HsPage) - void setupTouchArea(); + // void setupTouchArea(); void connectWidget(HsWidgetHost *widget); void disconnectWidget(HsWidgetHost *widget); +#ifdef HSWIDGETORGANIZER_ALGORITHM + void sortWidgets(sortOrder order, QList &widgets); +#endif //HSWIDGETORGANIZER_ALGORITHM private slots: void onWidgetFinished(); @@ -90,18 +89,20 @@ void onWidgetResized(); void onWidgetAvailable(); void onWidgetUnavailable(); - void onOrientationChanged(Qt::Orientation orientation); + void onPageMarginChanged(const QString &value); private: int mDatabaseId; + HsPageVisual *mPageVisual; HsWallpaper *mWallpaper; bool mRemovable; QList mWidgets; QList mNewWidgets; QList mUnavailableWidgets; - HsPageTouchArea *mTouchArea; - + //HsPageTouchArea *mTouchArea; + QPointF mTouchPoint; + qreal mPageMargin; HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) }; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/inc/hspagenewwidgetlayout.h --- a/homescreenapp/hsdomainmodel/inc/hspagenewwidgetlayout.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/inc/hspagenewwidgetlayout.h Wed Aug 18 09:40:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -35,9 +35,13 @@ void removeAt(int index); QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; void setGeometry(const QRectF &rect); - void addItem(HsWidgetHost *item); - + enum sortOrder { height, width}; + +private: +#ifdef HSWIDGETORGANIZER_ALGORITHM + QList sortWidgets(sortOrder order); +#endif private: QSizeF mSize; QList mNewWidgets; @@ -46,5 +50,4 @@ HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) }; - #endif diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/inc/hspagevisual.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/inc/hspagevisual.h Wed Aug 18 09:40:07 2010 +0300 @@ -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: +* +*/ + +#ifndef HSPAGEVISUAL_H +#define HSPAGEVISUAL_H + + +#include +#include "hsdomainmodel_global.h" +#include "hstest_global.h" + + +class HsPageTouchArea; + +HOMESCREEN_TEST_CLASS(TestHsDomainModel) + +class HSDOMAINMODEL_EXPORT HsPageVisual : public HbWidget +{ + Q_OBJECT + + +public: + HsPageVisual(QGraphicsItem *parent = 0); + ~HsPageVisual(); + + void setGeometry(const QRectF &rect); + +private: + Q_DISABLE_COPY(HsPageVisual) + void setupTouchArea(); + +private: + HsPageTouchArea *mTouchArea; + HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) +}; + +#endif diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/inc/hsscene.h --- a/homescreenapp/hsdomainmodel/inc/hsscene.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/inc/hsscene.h Wed Aug 18 09:40:07 2010 +0300 @@ -71,8 +71,8 @@ static HsScene *instance(); static HsScene *takeInstance(); static void setInstance(HsScene *instance); - static HbMainWindow *mainWindow(); - static Qt::Orientation orientation(); + //static HbMainWindow *mainWindow(); + //static Qt::Orientation orientation(); signals: void pageTapAndHoldFinished(QGestureEvent *event); @@ -105,7 +105,7 @@ friend class HsPage; friend class HsPageTouchArea; - friend class HsWidgetHost; + friend class HsWidgetHostVisual; friend class HsWidgetTouchArea; friend class HsWidgetMoveTouchArea; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/inc/hswidgethost.h --- a/homescreenapp/hsdomainmodel/inc/hswidgethost.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/inc/hswidgethost.h Wed Aug 18 09:40:07 2010 +0300 @@ -18,7 +18,7 @@ #ifndef HSWIDGETHOST_H #define HSWIDGETHOST_H -#include +#include #include #include @@ -33,13 +33,14 @@ class HsWidgetTouchArea; class HsWidgetComponent; class HsPage; +class HsWidgetHostVisual; -class HSDOMAINMODEL_EXPORT HsWidgetHost : public HbWidget +class HSDOMAINMODEL_EXPORT HsWidgetHost : public QObject { Q_OBJECT public: - HsWidgetHost(int databaseId, QGraphicsItem *parent = 0); + HsWidgetHost(int databaseId, QObject *parent = 0); ~HsWidgetHost(); static HsWidgetHost *createInstance( @@ -58,8 +59,8 @@ bool savePresentation(HsWidgetPresentationData &presentation); bool getPresentation(HsWidgetPresentationData &presentation); bool removePresentation(Qt::Orientation orientation); - QPainterPath shape() const; - + + HsWidgetHostVisual *visual() const; signals: void event_startAndShow(); void event_startAndHide(); @@ -73,7 +74,6 @@ void finished(); void faulted(); - void resized(); void available(); void unavailable(); @@ -90,22 +90,20 @@ void startDropEffect(); protected: - bool eventFilter(QObject *watched, QEvent *event); +/* bool eventFilter(QObject *watched, QEvent *event); void gestureEvent(QGestureEvent *event); void mousePressEvent(QGraphicsSceneMouseEvent *) {} - +*/ private: Q_DISABLE_COPY(HsWidgetHost) - void setupTouchArea(); - void setupEffects(); + void setupStates(); bool setProperty(const char *name, QMetaProperty &property); bool setMethod(const char *signature, QMetaMethod &method); bool hasSignal(const char *signature); - void setNewSize(const QSizeF &size); - + bool setPreferencesToWidget(); private slots: @@ -127,12 +125,13 @@ void onSetPreferences(const QStringList &names); private: - int mDatabaseId; + int mDatabaseId; + HsWidgetHostVisual *mVisual; QStateMachine *mStateMachine; - QGraphicsWidget *mWidget; + QObject *mWidget; HsPage *mPage; HsWidgetComponent *mComponent; - HsWidgetTouchArea *mTouchArea; + QMetaMethod mOnInitializeMethod; QMetaMethod mOnShowMethod; QMetaMethod mOnHideMethod; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/inc/hswidgethostvisual.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/inc/hswidgethostvisual.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,76 @@ +/* +* 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 HSWIDGETHOSTVISUAL_H +#define HSWIDGETHOSTVISUAL_H + +#include +#include +#include + +#include "hsdomainmodel_global.h" +#include "hsdomainmodeldatastructures.h" + +#include "hstest_global.h" +HOMESCREEN_TEST_CLASS(TestHsDomainModel) + +class QStateMachine; + +class HsWidgetTouchArea; +class HsWidgetComponent; +class HsPage; +class HsWidgetHost; + +class HSDOMAINMODEL_EXPORT HsWidgetHostVisual : public HbWidget +{ + Q_OBJECT + +public: + HsWidgetHostVisual(QGraphicsItem *parent = 0); + ~HsWidgetHostVisual(); + + QPainterPath shape() const; + void setWidget(QObject *widget); + void setVisualModel(HsWidgetHost *model); + HsWidgetHost *visualModel() const; +signals: + void resized(); + +public slots: + void startDragEffect(); + void startDropEffect(); + +protected: + bool eventFilter(QObject *watched, QEvent *event); + void gestureEvent(QGestureEvent *event); + void mousePressEvent(QGraphicsSceneMouseEvent *) {} + +private: + Q_DISABLE_COPY(HsWidgetHostVisual) + void setupTouchArea(); + void setupEffects(); + + void setNewSize(const QSizeF &size); + +private: + HsWidgetTouchArea *mTouchArea; + HsWidgetHost *mVisualModel; + QGraphicsWidget *mWidget; + HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) +}; + +#endif // HSWIDGETHOST_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/inc/hswidgettoucharea.h --- a/homescreenapp/hsdomainmodel/inc/hswidgettoucharea.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/inc/hswidgettoucharea.h Wed Aug 18 09:40:07 2010 +0300 @@ -24,14 +24,14 @@ HOMESCREEN_TEST_CLASS(TestHsDomainModel) -class HsWidgetHost; +class HsWidgetHostVisual; class HsWidgetTouchArea : public HbTouchArea { Q_OBJECT public: - HsWidgetTouchArea(HsWidgetHost *widgetHost); + HsWidgetTouchArea(HsWidgetHostVisual *widgetHost); ~HsWidgetTouchArea(); bool sceneEvent(QEvent *event); @@ -44,7 +44,7 @@ Q_DISABLE_COPY(HsWidgetTouchArea) private: - HsWidgetHost *mWidgetHost; + HsWidgetHostVisual *mWidgetHostVisual; HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) }; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/resource/controllayer.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/resource/controllayer.docml Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/src/hsconfiguration.cpp --- a/homescreenapp/hsdomainmodel/src/hsconfiguration.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hsconfiguration.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -73,11 +73,13 @@ mSnapTimeout(100), mSnapForce(30), mSnapGap(6), - mSnapBorderGap(0), + mPageMargin(0), mSnapLineFadeInDuration(200), mSnapLineFadeOutDuration(100), mIsSnapEffectsEnabled(true), - mSceneType(PageWallpapers) + mSceneType(PageWallpapers), + mBounceAnimationEasingCurve(QEasingCurve::Linear), + mPageChangeAnimationEasingCurve(QEasingCurve::Linear) { } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/src/hsdocumentloader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/src/hsdocumentloader.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,65 @@ +/* +* 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: Homescreen document loader class. +* +*/ + +#include "hsdocumentloader.h" +#include "hspageindicator.h" +#include "hstrashbinwidget.h" +#include "hsconfiguration.h" + +/*! + \class HsDocumentLoader + \ingroup group_hshomescreenstateplugin + \brief Homescreen document loader class. + + Loads own widgets from docml. +*/ + +/*! + Constructor. +*/ +HsDocumentLoader::HsDocumentLoader() + : HbDocumentLoader() +{ +} + +/*! + Destructor. +*/ +HsDocumentLoader::~HsDocumentLoader() +{ +} + +/*! + Looks up an object which inherits class type and of which object name equals to name. + \a type type of the desired object. + \a name object name of the desired object. + */ +QObject *HsDocumentLoader::createObject(const QString &type, const QString &name) +{ + if (type == HsPageIndicator::staticMetaObject.className()) { + QObject *object = new HsPageIndicator(HSCONFIGURATION_GET(pageIndicatorSpacing)); + object->setObjectName(name); + return object; + } + else if (type == HsTrashBinWidget::staticMetaObject.className()) { + QObject *object = new HsTrashBinWidget; + object->setObjectName(name); + return object; + } + + return HbDocumentLoader::createObject(type, name); +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/src/hsgui.cpp --- a/homescreenapp/hsdomainmodel/src/hsgui.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hsgui.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -16,9 +16,19 @@ */ #include +#include #include +#include +#include #include "hsgui.h" +#include "hsidlewidget.h" +#include "hsscene.h" +#include "hsconfiguration.h" +#include "hspropertyanimationwrapper.h" +namespace { + const char gApplicationLibraryIconName[] = "qtg_mono_applications_all"; +} /*! \class HsGui @@ -27,47 +37,160 @@ HsGui includes common UI components for Home screen. */ -/*! - Returns the idle view. -*/ -HbView *HsGui::idleView() +HsGui *HsGui::mInstance(0); + +struct HsGuiImpl { - return mIdleView; + HsIdleWidget *mIdleWidget; + HbView *mIdleView; + HbMainWindow *mWindow; + HbAction *mNavigationAction; + HsPropertyAnimationWrapper *mPageChangeAnimation; + HsPropertyAnimationWrapper *mPageCrawlingAnimation; +}; + + + +HsGui::~HsGui() +{ + if (mImpl->mNavigationAction) { + delete mImpl->mNavigationAction; + } + + if (mImpl->mPageChangeAnimation) { + mImpl->mPageChangeAnimation->stop(); + delete mImpl->mPageChangeAnimation; + } + if (mImpl->mPageCrawlingAnimation) { + mImpl->mPageCrawlingAnimation->stop(); + delete mImpl->mPageCrawlingAnimation; + } + delete mImpl; } -/*! - Returns the current idle view instance. Callers of this - function take ownership of the instance. The current - view instance will be reset to null. -*/ -HbView *HsGui::takeIdleView() -{ - HbView *idleView = mIdleView; - mIdleView = 0; - return idleView; +HsGui *HsGui::setInstance(HsGui *instance) +{ + HsGui *old = mInstance; + if (mInstance != instance) { + mInstance = instance; + } + return old; +} + +HsGui *HsGui::instance() +{ + if (!mInstance) { + mInstance = new HsGui(QCoreApplication::instance()); + } + return mInstance; +} + +HsGui *HsGui::takeInstance() +{ + HsGui *instance = mInstance; + mInstance = 0; + return instance; +} + +void HsGui::setupIdleUi() +{ + if (!mImpl->mIdleWidget) { + mImpl->mIdleWidget = new HsIdleWidget; + mImpl->mIdleView = mImpl->mWindow->addView(mImpl->mIdleWidget); + mImpl->mIdleView->setContentFullScreen(); + + delete mImpl->mNavigationAction; + mImpl->mNavigationAction = 0; + mImpl->mNavigationAction = new HbAction; + mImpl->mNavigationAction->setIcon(HbIcon(gApplicationLibraryIconName)); + mImpl->mNavigationAction->setObjectName("applib_navigation_action"); + connect(mImpl->mNavigationAction, SIGNAL(triggered()), SIGNAL(navigateToApplibrary())); + mImpl->mIdleView->setNavigationAction(mImpl->mNavigationAction); + } + bool animate = !mImpl->mWindow->isObscured(); + mImpl->mWindow->setCurrentView(mImpl->mIdleView, animate); } -/*! - Sets the idle view instance. The existing instance - will be deleted. -*/ -void HsGui::setIdleView(HbView *idleView) +void HsGui::cleanupIdleUi() { - if (mIdleView != idleView) { - delete mIdleView; - mIdleView = idleView; + if (mImpl->mIdleView) { + mImpl->mIdleView->setNavigationAction(0); + delete mImpl->mNavigationAction; + mImpl->mNavigationAction = 0; + + mImpl->mWindow->removeView(mImpl->mIdleView); + delete mImpl->mIdleView; + mImpl->mIdleView = 0; + + delete mImpl->mPageChangeAnimation; + mImpl->mPageChangeAnimation = 0; + + delete mImpl->mPageCrawlingAnimation; + mImpl->mPageCrawlingAnimation = 0; } + +} + +void HsGui::setOrientation(Qt::Orientation orientation) +{ + mImpl->mWindow->setOrientation(orientation); +} + +Qt::Orientation HsGui::orientation() +{ + return mImpl->mWindow->orientation(); +} + +HbView *HsGui::idleView() const +{ + return mImpl->mIdleView; +} + +HsIdleWidget *HsGui::idleWidget() const +{ + return mImpl->mIdleWidget; } -/*! - Returns the main window. -*/ -HbMainWindow *HsGui::mainWindow() +QRectF HsGui::layoutRect() const { - return hbInstance->allMainWindows().first(); + return mImpl->mWindow->layoutRect(); +} + +void HsGui::show() +{ + mImpl->mWindow->raise(); + mImpl->mWindow->show(); } -/*! - Points to the idle view instance. -*/ -QPointer HsGui::mIdleView(0); +HsPropertyAnimationWrapper *HsGui::pageChangeAnimation() +{ + if (!mImpl->mPageChangeAnimation) { + mImpl->mPageChangeAnimation = new HsPropertyAnimationWrapper; + mImpl->mPageChangeAnimation->setTargetObject(mImpl->mIdleWidget); + mImpl->mPageChangeAnimation->setPropertyName("sceneX"); + } + return mImpl->mPageChangeAnimation; +} +HsPropertyAnimationWrapper *HsGui::pageCrawlingAnimation() +{ + if (!mImpl->mPageCrawlingAnimation) { + mImpl->mPageCrawlingAnimation = new HsPropertyAnimationWrapper; + mImpl->mPageCrawlingAnimation->setTargetObject(mImpl->mIdleWidget); + mImpl->mPageCrawlingAnimation->setPropertyName("sceneX"); + } + return mImpl->mPageCrawlingAnimation; +} + +HsGui::HsGui(QObject *parent): + QObject(parent),mImpl(new HsGuiImpl) +{ + mImpl->mIdleView = 0; + mImpl->mIdleWidget = 0; + mImpl->mNavigationAction = 0; + mImpl->mPageChangeAnimation = 0; + mImpl->mPageCrawlingAnimation = 0; + + mImpl->mWindow = hbInstance->allMainWindows().first(); + connect(mImpl->mWindow, SIGNAL(orientationChanged(Qt::Orientation)), + SIGNAL(orientationChanged(Qt::Orientation))); +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/src/hshostedwidgetfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/src/hshostedwidgetfactory.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#include +#include +#include +#include +#include "hshostedwidgetfactory.h" + +QTM_USE_NAMESPACE + +/*! + \class HsWidgetFactory + \ingroup group_hsdomainmodel + \brief Each widget is controlled by the home screen framework through a widget host. +*/ + + +struct HsHostedWidgetFactoryImpl{ + QServiceManager mServiceManager; + QServiceFilter mFilter; +}; + + + +HsHostedWidgetFactory *HsHostedWidgetFactory::mInstance = 0; + +HsHostedWidgetFactory *HsHostedWidgetFactory::instance() +{ + if (!mInstance) { + mInstance = new HsHostedWidgetFactory; + } + return mInstance; +} + +HsHostedWidgetFactory *HsHostedWidgetFactory::takeInstance() +{ + HsHostedWidgetFactory *instance = mInstance; + mInstance = 0; + return instance; +} + +HsHostedWidgetFactory *HsHostedWidgetFactory::setInstance + (HsHostedWidgetFactory *instance) +{ + HsHostedWidgetFactory *old = mInstance; + if (mInstance != instance) { + mInstance = instance; + } + return old; +} + +QObject *HsHostedWidgetFactory::createWidget(const QString &uri) +{ + mImpl->mFilter.setServiceName(uri); + QList interfaces = + mImpl->mServiceManager.findInterfaces(mImpl->mFilter); + + if (interfaces.isEmpty()) { + return 0; + } + // In theory we support QGraphicsWidget derived widgets + QObject *widgetObject = mImpl->mServiceManager.loadInterface(interfaces.first()); + + if (!qobject_cast(widgetObject)) { + delete widgetObject; + widgetObject = 0; + } + return widgetObject; +} + +/*! + Constructs a new widget host with given \a databaseId and + \a parent item. +*/ +HsHostedWidgetFactory::HsHostedWidgetFactory(QObject *parent) + : QObject(parent), + mImpl(new HsHostedWidgetFactoryImpl) +{ + mImpl->mFilter.setInterface("com.nokia.symbian.IHomeScreenWidget"); +} + +/*! + Destructor. +*/ +HsHostedWidgetFactory::~HsHostedWidgetFactory() +{ + delete mImpl; +} + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/src/hsidlewidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/src/hsidlewidget.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,409 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include + +#include +#include + +#include "hsidlewidget.h" +#include "hsscene.h" +#include "hspage.h" +#include "hspagevisual.h" +#include "hswidgethost.h" +#include "hswallpaper.h" +#include "hstrashbinwidget.h" +#include "hspageindicator.h" +#include "hsdocumentloader.h" +#include "hsconfiguration.h" +#include "hsapp_defs.h" +#include "hssnapline.h" +#include "hsgui.h" + + +namespace +{ + const char gControlLayerDocmlName[] = "controllayer.docml"; + const char gControlLayerName[] = "controlLayer"; + const char gTrashBinName[] = "trashBin"; + const char gPageIndicatorName[] = "pageIndicator"; +} + +/*! + \class HsIdleWidget + \ingroup group_hshomescreenstateplugin + \brief View part of the home screen idle state. + + Maintains the idle view ui layers and takes care of + receiving user input and communicating it to the idle + state for further processing. +*/ + +/*! + Constructs a new idle widget with the given \a parent. +*/ +HsIdleWidget::HsIdleWidget(QGraphicsItem *parent) + : HbWidget(parent), + mControlLayer(0), mPageLayer(0), mPageWallpaperLayer(0), + mSceneLayer(0), + mTrashBin(0), mPageIndicator(0), + mHorizontalSnapLine(0), mVerticalSnapLine(0) +{ + setFlag(ItemHasNoContents); + + loadControlLayer(); + + QGraphicsLinearLayout *linearLayout = 0; + + linearLayout = new QGraphicsLinearLayout(Qt::Horizontal); + linearLayout->setContentsMargins(0, 0, 0, 0); + linearLayout->setSpacing(0); + mPageLayer = new HbWidget(this); + mPageLayer->setLayout(linearLayout); + mPageLayer->setZValue(2); + + linearLayout = new QGraphicsLinearLayout(Qt::Horizontal); + linearLayout->setContentsMargins(0, 0, 0, 0); + linearLayout->setSpacing(0); + mPageWallpaperLayer = new HbWidget(this); + mPageWallpaperLayer->setLayout(linearLayout); + mPageWallpaperLayer->setZValue(1); + + linearLayout = new QGraphicsLinearLayout(Qt::Horizontal); + linearLayout->setContentsMargins(0, 0, 0, 0); + linearLayout->setSpacing(0); + mSceneLayer = new HbWidget(this); + mSceneLayer->setLayout(linearLayout); + mSceneLayer->setZValue(0); +} + +/*! + Destroys this idle widget. +*/ +HsIdleWidget::~HsIdleWidget() +{ + QList pages = HsScene::instance()->pages(); + foreach (HsPage *page, pages) { + page->visual()->setParentItem(0); + if (page->visual()->scene()) { + page->visual()->scene()->removeItem(page->visual()); + } + HsWallpaper *pageWallpaper = page->wallpaper(); + if (pageWallpaper) { + pageWallpaper->setParentItem(0); + if (pageWallpaper->scene()) { + pageWallpaper->scene()->removeItem(pageWallpaper); + } + } + } + + HsWallpaper *sceneWallpaper = HsScene::instance()->wallpaper(); + if (sceneWallpaper) { + sceneWallpaper->setParentItem(0); + if (sceneWallpaper->scene()) { + sceneWallpaper->scene()->removeItem(sceneWallpaper); + } + } +} + +qreal HsIdleWidget::sceneX() const +{ + return mPageLayer->x(); +} + +void HsIdleWidget::setSceneX(qreal x) +{ + if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::SceneWallpaper) { + mPageLayer->setX(x); + mSceneLayer->setX((parallaxFactor() * x) - HSCONFIGURATION_GET(bounceEffect) / 2); + } else { + mPageLayer->setX(x); + mPageWallpaperLayer->setX(x); + } +} + +/*! + Layouts the ui layers according to the given \a rect. + If given \a rect has different size than a fullscreen view, rect + is lifted up by statuspane height. Normally HsIdleWidget position is 0,0 + relative to it's parent container (HbView). This functionality tackles + problem caused by HbStackedLayout which sets top most rect for all items + (views) in a stack (not considering fullscreen mode). +*/ +void HsIdleWidget::setGeometry(const QRectF &rect) +{ + + int n = HsScene::instance()->pages().count(); + QRectF layoutRect(HsGui::instance()->layoutRect()); + if (layoutRect == rect || (layoutRect.height() == rect.width() && layoutRect.width() == rect.height())) { + mControlLayer->resize(rect.size()); + mPageLayer->resize(n * rect.width(), rect.height()); + if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) { + mPageWallpaperLayer->resize(n * rect.width(), rect.height()); + } + mSceneLayer->resize(2 * rect.width() + HSCONFIGURATION_GET(bounceEffect), rect.height()); + HbWidget::setGeometry(rect); + } else { + QRectF sceneRect = mapToScene(rect).boundingRect(); + // HbView is a container item for widget, thus 0,0 is relative to view's position. + // Lift rect by offset. Fullscreen view is in 0,0 position in scene coordinates otherwise + // it's e.g 0,68 (statuspane being at 0,0 and view at 0,68) + sceneRect.setTop(-sceneRect.top()); + HbWidget::setGeometry(sceneRect); + } +} + +/*! + Sets the active page \a index to the page + indicator. +*/ +void HsIdleWidget::setActivePage(int index) +{ + mPageIndicator->setActiveItemIndex(index); +} + +/*! + Inserts the given \a page at index position + \a index in the page layer. +*/ +void HsIdleWidget::insertPage(int index, HsPage *page) +{ + QGraphicsLinearLayout *layout = + static_cast(mPageLayer->layout()); + layout->insertItem(index, page->visual()); + mPageLayer->resize( + layout->count() * size().width(), size().height()); + + if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) { + QGraphicsLinearLayout *layout = + static_cast(mPageWallpaperLayer->layout()); + layout->insertItem(index, page->wallpaper()); + mPageWallpaperLayer->resize( + layout->count() * size().width(), size().height()); + } +} + +/*! + Removes the page at index position + \a index in the page layer. +*/ +void HsIdleWidget::removePage(int index) +{ + QGraphicsLinearLayout *layout = + static_cast(mPageLayer->layout()); + layout->removeAt(index); + mPageLayer->resize( + layout->count() * size().width(), size().height()); + + if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) { + QGraphicsLinearLayout *layout = + static_cast(mPageWallpaperLayer->layout()); + layout->removeAt(index); + mPageWallpaperLayer->resize( + layout->count() * size().width(), size().height()); + } + mPageIndicator->removeItem(index); +} + +/*! + \fn HsIdleWidget::controlLayer() const + + Returns the control layer. +*/ + +/*! + \fn HsIdleWidget::pageLayer() const + + Returns the page layer. +*/ + +/*! + \fn HsIdleWidget::sceneLayer() const + + Returns the scene layer. +*/ + +/*! + \fn HsIdleWidget::trashBin() const + + Returns the trashbin widget. +*/ + +/*! + \fn HsIdleWidget::pageIndicator() const + + Returns the page indicator widget. +*/ + +/*! + Sets the trashbin visible and hides the page indicator. +*/ +void HsIdleWidget::showTrashBin() +{ + mPageIndicator->hide(); + mTrashBin->show(); +} + +/*! + Sets the page indicator visible and hides the trashbin. +*/ +void HsIdleWidget::showPageIndicator() +{ + mTrashBin->hide(); + mTrashBin->deactivate(); + mPageIndicator->setSpacing(HSCONFIGURATION_GET(pageIndicatorSpacing)); // for usability optimization widget, can be removed later on + mPageIndicator->setVisible(1 < mPageIndicator->itemCount()); +} + +/*! + Shows the Vertical snapping lines showing the guidance +*/ +void HsIdleWidget::showVerticalSnapLine(const QLineF &snapLine) +{ + QVariantHash snapConfiguration; + snapConfiguration[SNAPLINEFADEINDURATION] = QString::number(HSCONFIGURATION_GET(snapLineFadeInDuration)); + snapConfiguration[SNAPLINEFADEOUTDURATION] = QString::number(HSCONFIGURATION_GET(snapLineFadeOutDuration)); + + mVerticalSnapLine->setConfiguration(snapConfiguration); + mVerticalSnapLine->showLine(snapLine); +} + +/*! + Shows the Horizontal snapping lines showing the guidance +*/ +void HsIdleWidget::showHorizontalSnapLine(const QLineF &snapLine) +{ + QVariantHash snapConfiguration; + snapConfiguration[SNAPLINEFADEINDURATION] = QString::number(HSCONFIGURATION_GET(snapLineFadeInDuration)); + snapConfiguration[SNAPLINEFADEOUTDURATION] = QString::number(HSCONFIGURATION_GET(snapLineFadeOutDuration)); + + mHorizontalSnapLine->setConfiguration(snapConfiguration); + mHorizontalSnapLine->showLine(snapLine); +} + +/*! + Hides the Vertical snapping line showing the guidance +*/ +void HsIdleWidget::hideVerticalSnapLine() +{ + mVerticalSnapLine->hideLine(); +} + +/*! + Hides the Horizontal snapping line showing the guidance +*/ +void HsIdleWidget::hideHorizontalSnapLine() +{ + mHorizontalSnapLine->hideLine(); +} + +/*! + Reimplements QGraphicsWidget::polishEvent(). +*/ +void HsIdleWidget::polishEvent() +{ + HsScene *scene = HsScene::instance(); + Q_ASSERT(scene); + + QGraphicsLinearLayout *pageLayout = + static_cast(mPageLayer->layout()); + + QList pages = scene->pages(); + + foreach (HsPage *page, pages) { + pageLayout->addItem(page->visual()); + if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) { + QGraphicsLinearLayout *pageWallpaperLayout = + static_cast(mPageWallpaperLayer->layout()); + pageWallpaperLayout->addItem(page->wallpaper()); + } + } + if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::SceneWallpaper) { + QGraphicsLinearLayout *sceneLayout = + static_cast(mSceneLayer->layout()); + HsWallpaper *wallpaper = HsScene::instance()->wallpaper(); + sceneLayout->addItem(wallpaper); + } + + mPageIndicator->initialize(pages.count(), scene->activePageIndex()); + showPageIndicator(); + + // HsGui::instance()->scene()->installEventFilter(this); +} + +/*! + Loads the control layer declared in a docml file. +*/ +void HsIdleWidget::loadControlLayer() +{ + HsDocumentLoader loader; + bool loaded = false; + +#ifndef Q_OS_SYMBIAN + QString path = QDir::currentPath(); +#else + QString path = "c:"; +#endif + + QString file = path + "/hsresources/" + gControlLayerDocmlName; + QString fallbackPath = QString(":/") + gControlLayerDocmlName; + + if (QFile::exists(file)) { + loader.load(file, &loaded); + if (!loaded) { + loader.load(fallbackPath, &loaded); + } + } else { + loader.load(fallbackPath, &loaded); + } + + if (loaded) { + mControlLayer = qobject_cast(loader.findWidget(gControlLayerName)); + mControlLayer->setZValue(3); + mControlLayer->setParentItem(this); + + mTrashBin = qobject_cast(loader.findWidget(gTrashBinName)); + mTrashBin->setZValue(1e6); + + mPageIndicator = qobject_cast(loader.findWidget(gPageIndicatorName)); + mPageIndicator->setZValue(1e6); + + + mHorizontalSnapLine = new HsSnapLine(mControlLayer); + mHorizontalSnapLine->setZValue(10); + + mVerticalSnapLine = new HsSnapLine(mControlLayer); + mVerticalSnapLine->setZValue(10); + } else { + // TODO: Handle error. + } +} + +qreal HsIdleWidget::parallaxFactor() const +{ + qreal clw = mControlLayer->size().width(); + qreal slw = mSceneLayer->size().width() - HSCONFIGURATION_GET(bounceEffect); + int n = HsScene::instance()->pages().count(); + if (n < 2) { + return 1; + } else { + return (slw - clw) / ((n - 1) * clw); + } +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/src/hspage.cpp --- a/homescreenapp/hsdomainmodel/src/hspage.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hspage.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -19,15 +19,18 @@ #include "hsdomainmodeldatastructures.h" #include "hspage.h" +#include "hspagevisual.h" #include "hspagetoucharea.h" #include "hspagenewwidgetlayout.h" #include "hsscene.h" #include "hsdatabase.h" #include "hswidgethost.h" +#include "hswidgethostvisual.h" #include "hswallpaper.h" #include "hswidgetpositioningonwidgetadd.h" #include "hswidgetpositioningonorientationchange.h" #include "hsconfiguration.h" +#include "hsgui.h" /*! @@ -43,18 +46,18 @@ \a parent Owner. \a aFlags Window flags. */ -HsPage::HsPage(QGraphicsItem* parent) - : HbWidget(parent), +HsPage::HsPage(QObject* parent) + : QObject(parent), mDatabaseId(-1), + mPageVisual(new HsPageVisual), mWallpaper(0), mRemovable(true), - mTouchArea(0) + mPageMargin(0.0) { - setFlag(QGraphicsItem::ItemHasNoContents); - setSizePolicy(QSizePolicy(QSizePolicy::Ignored, - QSizePolicy::Ignored)); - - setupTouchArea(); + + //Page margin + mPageMargin = HSCONFIGURATION_GET(pageMargin); + connect(HsConfiguration::instance(), SIGNAL(propertyChanged(QString)), SLOT(onPageMarginChanged(QString))); } /*! @@ -62,6 +65,36 @@ */ HsPage::~HsPage() { + // visuals are owned by widget host, detach those from page visual + HsWidgetHostVisual *visual(0); + foreach (HsWidgetHost *widget, mWidgets) { + visual = widget->visual(); + visual->setParent(0); + if (visual->scene()) { + visual->scene()->removeItem(visual); + } + } + + foreach (HsWidgetHost *widget, mNewWidgets) { + visual = widget->visual(); + visual->setParent(0); + if (visual->scene()) { + visual->scene()->removeItem(visual); + } + } + + foreach (HsWidgetHost *widget, mUnavailableWidgets) { + visual = widget->visual(); + visual->setParent(0); + if (visual->scene()) { + visual->scene()->removeItem(visual); + } + } + qDeleteAll(mWidgets); + qDeleteAll(mNewWidgets); + qDeleteAll(mUnavailableWidgets); + + delete mPageVisual; delete mWallpaper; } @@ -80,7 +113,7 @@ { mDatabaseId = id; } - +/* void HsPage::setGeometry(const QRectF &rect) { if (mTouchArea) { @@ -89,7 +122,7 @@ HbWidget::setGeometry(rect); } - +*/ /*! Loads widgets. */ @@ -112,14 +145,23 @@ foreach (HsWidgetData data, datas) { HsWidgetHost *widget = new HsWidgetHost(data.id); - mWidgets.append(widget); - connectWidget(widget); - widget->setPage(this); - widget->setParentItem(this); - widget->startWidget(isDefaultPage()); + if (!widget->loadPresentation(Qt::Horizontal) && + !widget->loadPresentation(Qt::Vertical)) { + widget->setPage(this); + widget->visual()->hide(); + connectWidget(widget); + mNewWidgets << widget; + } + else { + mWidgets.append(widget); + connectWidget(widget); + widget->setPage(this); + widget->visual()->setParentItem(this->visual()); + widget->startWidget(isDefaultPage()); + } } - connect(HsScene::mainWindow(), + connect(HsGui::instance(), SIGNAL(orientationChanged(Qt::Orientation)), SLOT(onOrientationChanged(Qt::Orientation))); @@ -127,7 +169,7 @@ } /*! - Return wallpaper. + Return wallpaper. */ HsWallpaper *HsPage::wallpaper() const { @@ -152,10 +194,11 @@ connectWidget(widgetHost); mWidgets << widgetHost; - widgetHost->setParentItem(this); + widgetHost->visual()->setParentItem(visual()); return true; } + /*! Remove given \a widgetHost from a page. Widget is not deleted. Returns true if successful @@ -168,10 +211,11 @@ disconnectWidget(widgetHost); mWidgets.removeOne(widgetHost); - widgetHost->setParentItem(0); + widgetHost->visual()->setParentItem(0); return true; } + /*! Returns list of new widgets belonging to a page. Widgets which are not yet layouted are considered as new widgets. @@ -195,19 +239,10 @@ if (mNewWidgets.contains(widgetHost)) { return true; } + + widgetHost->setPage(this); - HsWidgetPresentationData presentation; - presentation.orientation = HsScene::orientation(); - if (!widgetHost->getPresentation(presentation)) { - presentation.orientation = HsScene::orientation(); - presentation.setPos(mTouchPoint); - presentation.zValue = 0; - widgetHost->savePresentation(presentation); - } - - widgetHost->hide(); - widgetHost->setPos(presentation.x, presentation.y); - widgetHost->setZValue(presentation.zValue); + widgetHost->visual()->hide(); connectWidget(widgetHost); mNewWidgets << widgetHost; @@ -224,10 +259,10 @@ return; } - HsPageNewWidgetLayout *newWidgetLayout = static_cast(layout()); + HsPageNewWidgetLayout *newWidgetLayout = static_cast(visual()->layout()); if (!newWidgetLayout) { newWidgetLayout = new HsPageNewWidgetLayout(mTouchPoint); - setLayout(newWidgetLayout); + visual()->setLayout(newWidgetLayout); } updateZValues(); HsWidgetHost *widget = 0; @@ -235,36 +270,67 @@ widget = mNewWidgets.at(i); newWidgetLayout->addItem(widget); widget->setPage(this); - widget->setParentItem(this); + widget->visual()->setParentItem(visual()); widget->showWidget(); - widget->show(); + widget->visual()->show(); } mWidgets << mNewWidgets; mNewWidgets.clear(); } /*! + Clears new widgets list and resets layout. +*/ +void HsPage::resetNewWidgets() +{ + mNewWidgets.clear(); + visual()->setLayout(0); +} + +/*! Remove page and all it's contained widgets from database */ bool HsPage::deleteFromDatabase() { + + HsWidgetHostVisual *visual(0); foreach (HsWidgetHost *widget, mWidgets) { + visual = widget->visual(); + visual->setParent(0); + if (visual->scene()) { + visual->scene()->removeItem(visual); + } widget->remove(); } mWidgets.clear(); + foreach (HsWidgetHost *widget, mNewWidgets) { + visual = widget->visual(); + visual->setParent(0); + if (visual->scene()) { + visual->scene()->removeItem(visual); + } widget->remove(); } mNewWidgets.clear(); foreach (HsWidgetHost *widget, mUnavailableWidgets) { + visual = widget->visual(); + visual->setParent(0); + if (visual->scene()) { + visual->scene()->removeItem(visual); + } widget->remove(); } mUnavailableWidgets.clear(); - + + if (mWallpaper) { + mWallpaper->remove(); + } return HsDatabase::instance()->deletePage(mDatabaseId); } + /*! Return list of widgets belonging to a page */ @@ -289,6 +355,7 @@ { mRemovable = removable; } + /*! Return true if page is default page. */ @@ -296,6 +363,7 @@ { return mDatabaseId == HSCONFIGURATION_GET(defaultPageId); } + /*! Return true if page is active page. */ @@ -303,6 +371,7 @@ { return this == HsScene::instance()->activePage(); } + /*! Create page into database and return instance of a new page. */ @@ -322,12 +391,75 @@ } /*! + The widget is bounded in the rectangle which is smaller by pageMargin on all sides of page. +*/ +QPointF HsPage::adjustedWidgetPosition(const QRectF &origWidgetRect) +{ + QRectF widgetAreaRect = contentGeometry(); + qreal widgetX = qBound(widgetAreaRect.left(), origWidgetRect.x(), widgetAreaRect.right() - origWidgetRect.width()); + qreal widgetY = qBound(widgetAreaRect.top(), origWidgetRect.y(), widgetAreaRect.bottom() - origWidgetRect.height()); + + return QPointF(widgetX, widgetY); +} + +/*! + Returns rect of rectangular where widgets are allowed to be placed in the page. +*/ +QRectF HsPage::contentGeometry() +{ + return contentGeometry(HsGui::instance()->orientation()); +} + +/*! + Returns rect of rectangular where widgets are allowed to be placed in the page. +*/ +QRectF HsPage::contentGeometry(Qt::Orientation orientation) +{ + QRectF pageRect = HsGui::instance()->layoutRect(); + + if (orientation != HsGui::instance()->orientation()) { + qreal width = pageRect.width(); + qreal height = pageRect.height(); + pageRect.setWidth(height); + pageRect.setHeight(width); + } + + //Take care of chrome in both orientation + pageRect.setTop(64); + + //Shrink by page margins at each side + return pageRect.adjusted(mPageMargin, mPageMargin, -mPageMargin, -mPageMargin); +} + +/*! + Returns rect of rectangular where widgets are allowed to be placed in the page. +*/ +QRectF HsPage::contentRect() +{ + return contentRect(HsGui::instance()->orientation()); +} + +/*! + Returns rect of rectangular where widgets are allowed to be placed in the page. +*/ +QRectF HsPage::contentRect(Qt::Orientation orientation) +{ + QRectF rect = contentGeometry(orientation); + rect.moveTopLeft(QPointF(0,0)); + return rect; +} + +HsPageVisual *HsPage::visual() const +{ + return mPageVisual; +} +/*! Calls onShow() for contained widgets. */ void HsPage::showWidgets() { foreach (HsWidgetHost *widget, mWidgets) { - if (widget->parentItem() == this) { + if (widget->visual()->parentItem() == visual()) { widget->showWidget(); } } @@ -339,14 +471,14 @@ void HsPage::hideWidgets() { foreach (HsWidgetHost *widget, mWidgets) { - if (widget->parentItem() == this) { + if (widget->visual()->parentItem() == visual()) { widget->hideWidget(); } } } /*! - Propogate online state to widgets. + Propagate online state to widgets. */ void HsPage::setOnline(bool online) { @@ -357,6 +489,7 @@ widget->setOnline(online); } } + /*! Update widgets z-values and persist those. Active widget has top most z-value. @@ -368,7 +501,7 @@ if (!mWidgets.isEmpty()) { QMultiMap map; foreach (HsWidgetHost *widget, mWidgets) { - map.insert(widget->zValue(), widget); + map.insert(widget->visual()->zValue(), widget); } QList sortedWidgets = map.values(); @@ -380,14 +513,14 @@ } foreach (HsWidgetHost *widget, sortedWidgets) { - widget->setZValue(z++); + widget->visual()->setZValue(z++); widget->savePresentation(); } } if (!mNewWidgets.isEmpty()) { foreach (HsWidgetHost *widget, mNewWidgets) { - widget->setZValue(z++); + widget->visual()->setZValue(z++); widget->savePresentation(); } } @@ -402,11 +535,11 @@ /*! Create touch area for page. */ -void HsPage::setupTouchArea() +/*void HsPage::setupTouchArea() { mTouchArea = new HsPageTouchArea(this); mTouchArea->setZValue(-1); -} +}*/ /*! Utility to connect widget signals to page. */ @@ -414,7 +547,7 @@ { connect(widget, SIGNAL(finished()), SLOT(onWidgetFinished())); connect(widget, SIGNAL(faulted()), SLOT(onWidgetFaulted())); - connect(widget, SIGNAL(resized()), SLOT(onWidgetResized())); + connect(widget->visual(), SIGNAL(resized()), SLOT(onWidgetResized())); connect(widget, SIGNAL(available()), SLOT(onWidgetAvailable())); connect(widget, SIGNAL(unavailable()), SLOT(onWidgetUnavailable())); } @@ -423,6 +556,7 @@ */ void HsPage::disconnectWidget(HsWidgetHost *widget) { + widget->visual()->disconnect(this); widget->disconnect(this); } /*! @@ -437,6 +571,14 @@ if (!mNewWidgets.removeOne(widget)) { mWidgets.removeOne(widget); } + if (widget){ + HsWidgetHostVisual *visual = widget->visual(); + visual->setParentItem(0); + if (visual->scene()) { + visual->scene()->removeItem(visual); + } + } + disconnectWidget(widget); widget->remove(); @@ -455,15 +597,11 @@ */ void HsPage::onWidgetResized() { - if ( !layout() ) { - HsWidgetHost *widget = qobject_cast(sender()); - QRectF widgetRect = widget->geometry(); - QRectF pageRect = HsScene::mainWindow()->layoutRect(); - qreal widgetX = qBound(qreal(0), widgetRect.x(), pageRect.width() - widgetRect.width()); - qreal widgetY = qBound(qreal(64), widgetRect.y(), pageRect.height() - widgetRect.height()); - widget->setPos(widgetX, widgetY); + if (!visual()->layout()) { + HsWidgetHostVisual *widgetVisual = qobject_cast(sender()); + widgetVisual->setPos(adjustedWidgetPosition(widgetVisual->geometry())); } else { - layout()->invalidate(); + visual()->layout()->invalidate(); } } /*! @@ -472,13 +610,14 @@ void HsPage::onWidgetAvailable() { HsWidgetHost *widget = qobject_cast(sender()); + HsWidgetHostVisual *widgetVisual(widget->visual()); mUnavailableWidgets.removeOne(widget); mWidgets.append(widget); - widget->setParentItem(this); + widgetVisual->setParentItem(visual()); widget->startWidget(isActivePage()); - widget->show(); + widgetVisual->show(); } /*! Update internal bookkeeping and hide widget @@ -486,6 +625,7 @@ void HsPage::onWidgetUnavailable() { HsWidgetHost *widget = qobject_cast(sender()); + HsWidgetHostVisual *widgetVisual(widget->visual()); if (mWidgets.contains(widget)) { mWidgets.removeOne(widget); @@ -497,46 +637,154 @@ mUnavailableWidgets.append(widget); - widget->hide(); - widget->setParentItem(0); + widgetVisual->hide(); + widgetVisual->setParentItem(0); } + /*! Run positioning algorithm for widgets which don't have position on target orientation. Otherwise set orientation positions for widgets. */ void HsPage::onOrientationChanged(Qt::Orientation orientation) { - QRectF rect = HsScene::mainWindow()->layoutRect(); - HsWidgetPositioningOnOrientationChange *converter = HsWidgetPositioningOnOrientationChange::instance(); - qreal chrome = 64; - QRectF from(0, chrome, rect.height(), rect.width() - chrome); - QRectF to(0, chrome, rect.width(), rect.height() - chrome); + Qt::Orientation orientationFrom = orientation == Qt::Vertical ? Qt::Horizontal : Qt::Vertical; + QRectF from = contentGeometry(orientationFrom); + QRectF to = contentGeometry(orientation); HsWidgetPresentationData presentation; presentation.orientation = orientation; - + + HsWidgetHostVisual *visual(0); +#ifdef HSWIDGETORGANIZER_ALGORITHM + QList newWidgets; +#endif //HSWIDGETORGANIZER_ALGORITHM foreach (HsWidgetHost *widget, mWidgets) { + visual = widget->visual(); if (!widget->getPresentation(presentation)) { +#ifndef HSWIDGETORGANIZER_ALGORITHM QList geometries = converter->convert( - from, QList() << widget->geometry(), to); - widget->setGeometry(geometries.first()); + from, QList() << visual->geometry(), to); + visual->setGeometry(geometries.first()); widget->savePresentation(); +#else //HSWIDGETORGANIZER_ALGORITHM + newWidgets << widget; +#endif //HSWIDGETORGANIZER_ALGORITHM } else { - widget->setPos(presentation.pos()); - widget->setZValue(presentation.zValue); + QRectF adjustWidgetPosition; + adjustWidgetPosition = visual->geometry(); + adjustWidgetPosition.moveTopLeft(presentation.pos()); + visual->setPos(adjustedWidgetPosition(adjustWidgetPosition)); + visual->setZValue(presentation.zValue); + widget->savePresentation(); //Needed to follow pageMargin dynamic change + } + } + +#ifdef HSWIDGETORGANIZER_ALGORITHM + // sort new widgets in order + if (newWidgets.count()) { + // TODO: read from configuration? or just use height for portrait and width for landscape (currently only height is used) + sortOrder order(height); + if(orientation == Qt::Horizontal) { + order = width; + } + sortWidgets(order, newWidgets); + // get rects for new widgets + QList newRects; + foreach (HsWidgetHost *newWidget, newWidgets) { + newRects << QRectF(QPointF(), newWidget->visual()->preferredSize()); + } + + // get page rect + QRectF pageRect = contentGeometry(); + + // scan existing widgets rects + QList existingRects; + foreach (HsWidgetHost *widget, mWidgets) { + if (!newWidgets.contains(widget)) { + existingRects << QRectF(widget->visual()->pos(), widget->visual()->preferredSize()); + } + } + + // calculate new widget positions with "stuck 'em all"-algorithm + HsWidgetPositioningOnWidgetAdd *algorithm = + HsWidgetPositioningOnWidgetAdd::instance(); + QList calculatedRects = + algorithm->convert(pageRect, existingRects, newRects, QPointF()); + + for ( int i=0; ivisual()->setGeometry(calculatedRects.at(i)); + mWidgets.at(j)->savePresentation(); + } + } +#endif //HSWIDGETORGANIZER_ALGORITHM + +} + +void HsPage::onPageMarginChanged(const QString &value) +{ + if (value == "pageMargin") { + mPageMargin = HSCONFIGURATION_GET(pageMargin); + HsWidgetHostVisual *visual(0); + if (!mWidgets.isEmpty()) { + foreach (HsWidgetHost *widget, mWidgets) { + visual = widget->visual(); + visual->setPos(adjustedWidgetPosition(visual->geometry())); + widget->savePresentation(); + } + } + + if (!mNewWidgets.isEmpty()) { + foreach (HsWidgetHost *widget, mNewWidgets) { + visual = widget->visual(); + visual->setPos(adjustedWidgetPosition(visual->geometry())); + widget->savePresentation(); + } } } } - +#ifdef HSWIDGETORGANIZER_ALGORITHM +// TODO: sorting should be done in algorithm class, make widget<->rect mapping here and move sortWidgets function to algorithm side /*! - Clears new widgets list and resets layout. + Sorts widgets in height/width order */ -void HsPage::resetNewWidgets() +void HsPage::sortWidgets(sortOrder order, QList &widgets) { - mNewWidgets.clear(); - setLayout(0); + QList tmpWidgets; + + for ( int i = 0; i < widgets.count(); i++) { + int index = 0; + // add first widget to sorted list + if (i == 0) { + tmpWidgets << widgets.at(i); + } else { + // go through existing widgets in the sorted list + for ( int j = 0; j < tmpWidgets.count(); j++) { + // sort widgets in height order + if (order == height) { + /* if widgets heigth is smaller on already + existing ones in the list -> increment index + */ + if (widgets.at(i)->visual()->preferredHeight() <= tmpWidgets.at(j)->visual()->preferredHeight()) { + index++; + } + // sort widgets in width order + } else { + /* if widgets width is smaller on already + existing ones in the sorted list -> increment index + */ + if (widgets.at(i)->visual()->preferredWidth() <= tmpWidgets.at(j)->visual()->preferredWidth()) { + index++; + } + } + } + // add widget to its correct index in sorted list + tmpWidgets.insert(index, widgets.at(i)); + } + } + widgets = tmpWidgets; } - +#endif //HSWIDGETORGANIZER_ALGORITHM diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/src/hspagenewwidgetlayout.cpp --- a/homescreenapp/hsdomainmodel/src/hspagenewwidgetlayout.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hspagenewwidgetlayout.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,17 +15,18 @@ * */ -#include - #include "hsdomainmodeldatastructures.h" #include "hspagenewwidgetlayout.h" #include "hsscene.h" +#include "hspage.h" #include "hsdatabase.h" #include "hswidgethost.h" +#include "hswidgethostvisual.h" #include "hswallpaper.h" #include "hswidgetpositioningonwidgetadd.h" #include "hswidgetpositioningonorientationchange.h" #include "hsconfiguration.h" +#include "hsgui.h" /*! @@ -45,7 +46,7 @@ : QGraphicsLayout(parent), mTouchPoint(touchPoint) { - mSize = HsScene::mainWindow()->layoutRect().size(); + mSize = HsGui::instance()->layoutRect().size(); } /*! @@ -68,7 +69,7 @@ */ QGraphicsLayoutItem *HsPageNewWidgetLayout::itemAt(int i) const { - return mNewWidgets.at(i); + return mNewWidgets.at(i)->visual(); } /*! @@ -102,10 +103,20 @@ void HsPageNewWidgetLayout::setGeometry(const QRectF &rect) { QGraphicsLayout::setGeometry(rect); - - QList rects; + +#ifdef HSWIDGETORGANIZER_ALGORITHM + // sort new widgets in order + if (mNewWidgets.count() > 1) { + // TODO: read from configuration? or just use height for portrait and width for landscape (currently only height is used) + sortOrder order(height); + mNewWidgets = sortWidgets(order); + } +#endif + + // get rects for new widgets + QList newRects; foreach (HsWidgetHost *newWidget, mNewWidgets) { - rects << QRectF(QPointF(), newWidget->preferredSize()); + newRects << QRectF(QPointF(), newWidget->visual()->preferredSize()); } /* if there is touch point defined (widget added from context menu) @@ -113,29 +124,38 @@ -> set widget center point to this touch point */ if (mTouchPoint != QPointF() && mNewWidgets.count() == 1) { - QRectF pageRect = HsScene::mainWindow()->layoutRect(); - qreal widgetX = qBound(qreal(0), mTouchPoint.x() - rects.at(0).width() / 2, pageRect.width() - rects.at(0).width()); - qreal widgetY = qBound(qreal(64), mTouchPoint.y() - rects.at(0).height() / 2, pageRect.height() - rects.at(0).height()); - mNewWidgets.at(0)->setGeometry(widgetX, - widgetY, - rects.at(0).width(), - rects.at(0).height()); + QRectF widgetRect = newRects.at(0); + widgetRect.moveCenter(mTouchPoint); + widgetRect.moveTopLeft(HsScene::instance()->activePage()->adjustedWidgetPosition(widgetRect)); + mNewWidgets.at(0)->visual()->setGeometry(widgetRect); /* we have to save widget presentation data here after drawing to get correct position for later use */ mNewWidgets.at(0)->savePresentation(); } - // otherwise calculate position with algorithm + // otherwise calculate widget positions with algorithm else { + // get page rect + QRectF pageRect = HsScene::instance()->activePage()->contentGeometry(); + + // scan existing widgets rects + QList existingWidgets; + existingWidgets = HsScene::instance()->activePage()->widgets(); + QList existingRects; + foreach (HsWidgetHost *widget, existingWidgets) { + if (!mNewWidgets.contains(widget)) { + existingRects << QRectF(widget->visual()->pos(), widget->visual()->preferredSize()); + } + } + + // calculate new widget positions with "stuck 'em all"-algorithm HsWidgetPositioningOnWidgetAdd *algorithm = HsWidgetPositioningOnWidgetAdd::instance(); - QRectF pageRect = HsScene::mainWindow()->layoutRect(); - pageRect.adjust( (qreal)0,(qreal)64,(qreal)0,(qreal)0); QList calculatedRects = - algorithm->convert(pageRect, rects, QPointF()); + algorithm->convert(pageRect, existingRects, newRects, QPointF()); for ( int i=0; isetGeometry(calculatedRects.at(i)); + mNewWidgets.at(i)->visual()->setGeometry(calculatedRects.at(i)); mNewWidgets.at(i)->savePresentation(); } } @@ -148,3 +168,46 @@ { mNewWidgets.append(item); } + +#ifdef HSWIDGETORGANIZER_ALGORITHM +// TODO: sorting should be done in algorithm class, make widget<->rect mapping here and move sortWidgets function to algorithm side +/*! + Sorts widgets in height/width order +*/ +QList HsPageNewWidgetLayout::sortWidgets(sortOrder order) +{ + QList tmpWidgets; + + for ( int i = 0; i < mNewWidgets.count(); i++) { + int index = 0; + // add first widget to sorted list + if (i == 0) { + tmpWidgets << mNewWidgets.at(i); + } else { + // go through existing widgets in the sorted list + for ( int j = 0; j < tmpWidgets.count(); j++) { + // sort widgets in height order + if (order == height) { + /* if widgets heigth is smaller on already + existing ones in the list -> increment index + */ + if (mNewWidgets.at(i)->visual()->preferredHeight() <= tmpWidgets.at(j)->visual()->preferredHeight()) { + index++; + } + // sort widgets in width order + } else { + /* if widgets width is smaller on already + existing ones in the sorted list -> increment index + */ + if (mNewWidgets.at(i)->visual()->preferredWidth() <= tmpWidgets.at(j)->visual()->preferredWidth()) { + index++; + } + } + } + // add widget to its correct index in sorted list + tmpWidgets.insert(index, mNewWidgets.at(i)); + } + } + return tmpWidgets; +} +#endif // HSWIDGETORGANIZER_ALGORITHM \ No newline at end of file diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/src/hspagevisual.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/src/hspagevisual.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,73 @@ +/* +* 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 "hspagevisual.h" +#include "hspagetoucharea.h" + + + +/*! + \class HsPageVisual + \ingroup group_hsdomainmodel + \brief Represents a page in the framework. + HsPageVisual contains group of widgets. HsPageVisual can have a wallpaper. +*/ + +/*! + Constructor. + + \a parent Owner. + \a aFlags Window flags. +*/ +HsPageVisual::HsPageVisual(QGraphicsItem* parent) + : HbWidget(parent), + mTouchArea(0) +{ + setFlag(QGraphicsItem::ItemHasNoContents); + setSizePolicy(QSizePolicy(QSizePolicy::Ignored, + QSizePolicy::Ignored)); + + setupTouchArea(); +} + +/*! + Destructor. +*/ +HsPageVisual::~HsPageVisual() +{ +} + +void HsPageVisual::setGeometry(const QRectF &rect) +{ + if (mTouchArea) { + mTouchArea->resize(rect.size()); + } + + HbWidget::setGeometry(rect); +} + +/*! + Create touch area for page. +*/ +void HsPageVisual::setupTouchArea() +{ + mTouchArea = new HsPageTouchArea(this); + mTouchArea->setZValue(-1); +} + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/src/hsscene.cpp --- a/homescreenapp/hsdomainmodel/src/hsscene.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hsscene.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -164,29 +164,41 @@ return true; } - int index = mPages.indexOf(page) + 1; + int nextIndex = mPages.indexOf(page) + 1; HsDatabase *db = HsDatabase::instance(); db->transaction(); - + // update page indexes HsPageData data; - for (int i = index; i < mPages.count(); ++i) { - data.id = mPages.at(i)->databaseId(); - data.indexPosition = i - 1; + int pageCount(mPages.count()); + for (;nextIndex < pageCount; ++nextIndex) { + data.id = mPages.at(nextIndex)->databaseId(); + data.indexPosition = nextIndex - 1; if (!db->updatePage(data)) { db->rollback(); return false; } } - + // page will remove itself from database if (!page->deleteFromDatabase()) { db->rollback(); return false; } db->commit(); - + // update internal list + int index = mPages.indexOf(page); + bool lastPage(mPages.last() == page); mPages.removeOne(page); + if (mPages.isEmpty()) { + mActivePage = NULL; + }else if (mActivePage == page) { + if (lastPage) { + index--; + } + setActivePageIndex(index); + } + return true; } @@ -309,18 +321,18 @@ /*! Return main window. */ -HbMainWindow *HsScene::mainWindow() +/*HbMainWindow *HsGui::instance() { return hbInstance->allMainWindows().first(); } - +*/ /*! Return current orientation. */ -Qt::Orientation HsScene::orientation() +/*Qt::Orientation HsGui::instance()->orientation() { return mainWindow()->orientation(); -} +}*/ /*! Listens for application background/foreground changes. diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/src/hswallpaper.cpp --- a/homescreenapp/hsdomainmodel/src/hswallpaper.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hswallpaper.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -28,6 +28,8 @@ #include "hspage.h" #include "hswallpaperloader.h" #include "hsconfiguration.h" +#include "hsgui.h" + /*! \class HsWallpaper @@ -58,7 +60,7 @@ layout->addItem(mIconItem); setLayout(layout); - connect(HsScene::mainWindow(), + connect(HsGui::instance(), SIGNAL(orientationChanged(Qt::Orientation)), SLOT(updateIconItem(Qt::Orientation))); } @@ -110,7 +112,7 @@ mLandscapeImagePath = infos.first().absoluteFilePath(); mPortraitImagePath = infos.last().absoluteFilePath(); - updateIconItem(HsScene::orientation()); + updateIconItem(HsGui::instance()->orientation()); } /*! @@ -150,7 +152,7 @@ mLandscapeImagePath = infos.first().absoluteFilePath(); mPortraitImagePath = infos.last().absoluteFilePath(); - updateIconItem(HsScene::orientation()); + updateIconItem(HsGui::instance()->orientation()); return true; } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/src/hswidgetcomponentregistry.cpp --- a/homescreenapp/hsdomainmodel/src/hswidgetcomponentregistry.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hswidgetcomponentregistry.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -25,13 +25,12 @@ #include "caentry.h" #include "cadefs.h" #include "canotifier.h" -#include "hsscene.h" #include #include #include -#include +//#include /*! \class HsWidgetComponentRegistry @@ -58,7 +57,7 @@ { if (!mInstance) { mInstance = new HsWidgetComponentRegistry; - mInstance->setParent(HsScene::mainWindow()); + mInstance->setParent(QCoreApplication::instance()); } return mInstance; } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/src/hswidgethost.cpp --- a/homescreenapp/hsdomainmodel/src/hswidgethost.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hswidgethost.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -19,31 +19,20 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include #include "hsdatabase.h" #include "hsdomainmodeldatastructures.h" #include "hsscene.h" #include "hspage.h" #include "hswidgethost.h" -#include "hswidgettoucharea.h" +#include "hswidgethostvisual.h" +#include "hshostedwidgetfactory.h" + #include "hswidgetcomponentregistry.h" #include "hswidgetcomponent.h" #include "hsconfiguration.h" #include "hscontentservice.h" +#include "hsgui.h" // Helper macros for connecting state entry and exit actions. #define ENTRY_ACTION(state, action) \ @@ -51,7 +40,7 @@ #define EXIT_ACTION(state, action) \ connect(state, SIGNAL(exited()), SLOT(action())); -QTM_USE_NAMESPACE + /*! @@ -64,8 +53,9 @@ Constructs a new widget host with given \a databaseId and \a parent item. */ -HsWidgetHost::HsWidgetHost(int databaseId, QGraphicsItem *parent) - : HbWidget(parent), +HsWidgetHost::HsWidgetHost(int databaseId, QObject *parent) + : QObject(parent), + mVisual(new HsWidgetHostVisual), mDatabaseId(databaseId), mStateMachine(0), mWidget(0), @@ -73,19 +63,8 @@ mComponent(0), mIsFinishing(false) { - setFlag(QGraphicsItem::ItemClipsChildrenToShape); - setFlag(QGraphicsItem::ItemHasNoContents); - - grabGesture(Qt::TapGesture); - grabGesture(Qt::TapAndHoldGesture); - grabGesture(Qt::PanGesture); - grabGesture(Qt::PinchGesture); - grabGesture(Qt::SwipeGesture); - grabGesture(Qt::CustomGesture); - - setupTouchArea(); - setupEffects(); setupStates(); + mVisual->setVisualModel(this); } /*! @@ -93,6 +72,7 @@ */ HsWidgetHost::~HsWidgetHost() { + delete mVisual; } /*! @@ -145,6 +125,7 @@ } mPage = page; + return true; } @@ -163,7 +144,7 @@ */ bool HsWidgetHost::loadPresentation() { - return loadPresentation(HsScene::orientation()); + return loadPresentation(HsGui::instance()->orientation()); } /*! @@ -180,8 +161,8 @@ if (!db->widgetPresentation(data)) { return false; } - setPos(data.x, data.y); - setZValue(data.zValue); + mVisual->setPos(data.x, data.y); + mVisual->setZValue(data.zValue); return true; } @@ -191,7 +172,7 @@ */ bool HsWidgetHost::savePresentation() { - return savePresentation(HsScene::orientation()); + return savePresentation(HsGui::instance()->orientation()); } /*! @@ -204,8 +185,8 @@ HsWidgetPresentationData data; data.orientation = orientation; - data.setPos(pos()); - data.zValue = zValue(); + data.setPos(mVisual->pos()); + data.zValue = mVisual->zValue(); data.widgetId = mDatabaseId; return db->setWidgetPresentation(data); } @@ -245,29 +226,9 @@ return db->deleteWidgetPresentation(mDatabaseId, orientation); } -/*! - Reimplemented from QGraphicsItem. Returns the shape of the - this widget host. The shape is computed based on the contained - widget. -*/ -QPainterPath HsWidgetHost::shape() const +HsWidgetHostVisual *HsWidgetHost::visual() const { - QPainterPath path; - - if (mWidget) { - QRectF currRect = rect(); - path = mWidget->shape(); - - QRectF pathRect(path.boundingRect()); - - if (pathRect.width() > currRect.width() - || pathRect.height() > currRect.height()) { - QPainterPath newPath(currRect.topLeft()); - newPath.addRect(currRect); - path = path.intersected(newPath); - } - } - return path; + return mVisual; } /*! @@ -327,11 +288,7 @@ host has moved to faulted state. */ -/*! - \fn HsWidgetHost::resized() - Notifies the home screen framework that this widget - host has resized itself. -*/ + /*! \fn HsWidgetHost::available() @@ -424,29 +381,7 @@ */ void HsWidgetHost::startDragEffect() { - /* TODO: Uncomment after the Qt bug has been fixed. - QGraphicsDropShadowEffect *effect = - static_cast(graphicsEffect()); - */ - HbInstantFeedback::play(HbFeedback::ItemPick); - - setTransformOriginPoint(rect().center()); - - QParallelAnimationGroup *animationGroup = new QParallelAnimationGroup(); - - QPropertyAnimation *animation = new QPropertyAnimation(this, "scale"); - animation->setDuration(HSCONFIGURATION_GET(widgetDragEffectDuration)); - animation->setEndValue(1.1); - animationGroup->addAnimation(animation); - - /* TODO: Uncomment after the Qt bug has been fixed. - animation = new QPropertyAnimation(effect, "offset"); - animation->setDuration(200); - animation->setEndValue(QPointF(8 ,8)); - animationGroup->addAnimation(animation); - */ - - animationGroup->start(QAbstractAnimation::DeleteWhenStopped); + mVisual->startDragEffect(); } /*! @@ -454,98 +389,7 @@ */ void HsWidgetHost::startDropEffect() { - /* TODO: Uncomment after the Qt bug has been fixed. - QGraphicsDropShadowEffect *effect = - static_cast(graphicsEffect()); - */ - HbInstantFeedback::play(HbFeedback::ItemDrop); - - QParallelAnimationGroup *animationGroup = new QParallelAnimationGroup; - - QPropertyAnimation *animation = new QPropertyAnimation(this, "scale"); - animation->setDuration(HSCONFIGURATION_GET(widgetDropEffectDuration)); - animation->setEndValue(1); - animationGroup->addAnimation(animation); - - /* TODO: Uncomment after the Qt bug has been fixed. - animation = new QPropertyAnimation(effect, "offset"); - animation->setDuration(200); - animation->setEndValue(QPointF(3, 3)); - animationGroup->addAnimation(animation); - */ - - animationGroup->start(QAbstractAnimation::DeleteWhenStopped); -} - -/*! - Reimplemented from QObject for monitoring changes in - contained widget's size. -*/ -bool HsWidgetHost::eventFilter(QObject *watched, QEvent *event) -{ - if (event->type() == QEvent::GraphicsSceneResize ) { - QGraphicsSceneResizeEvent *resizeEvent = - static_cast(event); - setNewSize(resizeEvent->newSize()); - emit resized(); - } - return HbWidget::eventFilter(watched, event); -} - -/*! - Reimplemented from HbWidget for pan gesture handling. -*/ -void HsWidgetHost::gestureEvent(QGestureEvent *event) -{ - HsScene *scene = HsScene::instance(); - QGesture *gesture = event->gesture(Qt::PanGesture); - if (gesture) { - switch (gesture->state()) { - case Qt::GestureStarted: - grabMouse(); - emit scene->pagePanStarted(event); - break; - case Qt::GestureUpdated: - emit scene->pagePanUpdated(event); - break; - case Qt::GestureFinished: - case Qt::GestureCanceled: - ungrabMouse(); - emit scene->pagePanFinished(event); - break; - default: - break; - } - } -} - -/*! - \fn HsWidgetHost::mousePressEvent(QGraphicsSceneMouseEvent *) - Reimplemented from QGraphicsItem for eating all mouse presses. -*/ - -/*! - Configures the touch are for this widget host. -*/ -void HsWidgetHost::setupTouchArea() -{ - mTouchArea = new HsWidgetTouchArea(this); - mTouchArea->setZValue(1); -} - -/*! - Configures the effects for this widget host. -*/ -void HsWidgetHost::setupEffects() -{ - /* TODO: Uncomment after the Qt bug has been fixed. - QGraphicsDropShadowEffect *effect = - new QGraphicsDropShadowEffect(this); - effect->setColor(QColor(0, 0, 0, 150)); - effect->setBlurRadius(5); - effect->setOffset(3); - setGraphicsEffect(effect); - */ + mVisual->startDropEffect(); } /*! @@ -681,15 +525,6 @@ return index >= 0; } -/*! - Resizes this widget host to the given \a size. -*/ -void HsWidgetHost::setNewSize(const QSizeF &size) -{ - mTouchArea->resize(size); - resize(size); - setPreferredSize(size); -} /*! Assigns preferences for the contained widget. @@ -752,26 +587,21 @@ */ void HsWidgetHost::action_load() { - QServiceManager manager; - QServiceFilter filter("com.nokia.symbian.IHomeScreenWidget"); - filter.setServiceName(mComponent->uri()); - QList interfaces = manager.findInterfaces(filter); - if (interfaces.isEmpty()) { + mWidget = HsHostedWidgetFactory::instance()->createWidget(mComponent->uri()); + if (!mWidget) { emit event_faulted(); return; } - - QObject *widgetObject = manager.loadInterface(interfaces.first()); - mWidget = qobject_cast(widgetObject); - - if (!mWidget || - !setMethod("onShow()", mOnShowMethod) || + // must have fuctions + if (!setMethod("onShow()", mOnShowMethod) || !setMethod("onHide()", mOnHideMethod)) { + delete mWidget; mWidget = 0; - delete widgetObject; emit event_faulted(); return; } + + mVisual->setWidget(mWidget); setMethod("onInitialize()", mOnInitializeMethod); setMethod("onUninitialize()", mOnUninitializeMethod); @@ -792,21 +622,12 @@ SLOT(onError()), Qt::QueuedConnection); } - mWidget->installEventFilter(this); - - setMinimumSize(HSCONFIGURATION_GET(minimumWidgetSizeInPixels)); - setMaximumSize(HSCONFIGURATION_GET(maximumWidgetSizeInPixels)); - loadPresentation(); - - mWidget->setParentItem(this); - - setNewSize(mWidget->size()); - + QString objName(mComponent->uri()); objName.append(":"); objName.append(QString::number(mDatabaseId)); - setObjectName(objName); + mVisual->setObjectName(objName); } /*! @@ -814,6 +635,7 @@ */ void HsWidgetHost::action_unload() { + mVisual->setWidget(0); delete mWidget; mWidget = 0; // This is needed because QServicePluginCleanup is diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/src/hswidgethostvisual.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/src/hswidgethostvisual.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,263 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include +#include +#include +#include + + +#include +#include + +#include "hswidgethostvisual.h" +#include "hswidgethost.h" +#include "hsscene.h" +#include "hsconfiguration.h" +#include "hswidgettoucharea.h" + + +/*! + \class HsWidgetHostVisual + \ingroup group_hsdomainmodel + \brief Each widget is controlled by the home screen framework through a widget host. +*/ + +/*! + Constructs a new widget host with given \a databaseId and + \a parent item. +*/ +HsWidgetHostVisual::HsWidgetHostVisual(QGraphicsItem *parent) + : HbWidget(parent),mWidget(0) + +{ + setFlag(QGraphicsItem::ItemClipsChildrenToShape); + setFlag(QGraphicsItem::ItemHasNoContents); + + grabGesture(Qt::TapGesture); + grabGesture(Qt::TapAndHoldGesture); + grabGesture(Qt::PanGesture); + grabGesture(Qt::PinchGesture); + grabGesture(Qt::SwipeGesture); + grabGesture(Qt::CustomGesture); + + setupTouchArea(); + setupEffects(); + + setMinimumSize(HSCONFIGURATION_GET(minimumWidgetSizeInPixels)); + setMaximumSize(HSCONFIGURATION_GET(maximumWidgetSizeInPixels)); + +} + +/*! + Destructor. +*/ +HsWidgetHostVisual::~HsWidgetHostVisual() +{ +} + + +/*! + Reimplemented from QGraphicsItem. Returns the shape of the + this widget host. The shape is computed based on the contained + widget. +*/ +QPainterPath HsWidgetHostVisual::shape() const +{ + QPainterPath path; + + if (mWidget) { + QRectF currRect = rect(); + path = mWidget->shape(); + + QRectF pathRect(path.boundingRect()); + + if (pathRect.width() > currRect.width() + || pathRect.height() > currRect.height()) { + QPainterPath newPath(currRect.topLeft()); + newPath.addRect(currRect); + path = path.intersected(newPath); + } + } + return path; +} +void HsWidgetHostVisual::setWidget(QObject *widget) +{ + mWidget = qobject_cast(widget); + if (mWidget) { + mWidget->installEventFilter(this); + mWidget->setParentItem(this); + setNewSize(mWidget->size()); + } +} + +void HsWidgetHostVisual::setVisualModel(HsWidgetHost *model) +{ + mVisualModel = model; +} +HsWidgetHost *HsWidgetHostVisual::visualModel() const +{ + return mVisualModel; +} +/*! + Starts the drag effect. +*/ +void HsWidgetHostVisual::startDragEffect() +{ + /* TODO: Uncomment after the Qt bug has been fixed. + QGraphicsDropShadowEffect *effect = + static_cast(graphicsEffect()); + */ + HbInstantFeedback::play(HbFeedback::ItemPick); + + setTransformOriginPoint(rect().center()); + + QParallelAnimationGroup *animationGroup = new QParallelAnimationGroup(); + + QPropertyAnimation *animation = new QPropertyAnimation(this, "scale"); + animation->setDuration(HSCONFIGURATION_GET(widgetDragEffectDuration)); + animation->setEndValue(1.1); + animationGroup->addAnimation(animation); + + /* TODO: Uncomment after the Qt bug has been fixed. + animation = new QPropertyAnimation(effect, "offset"); + animation->setDuration(200); + animation->setEndValue(QPointF(8 ,8)); + animationGroup->addAnimation(animation); + */ + + animationGroup->start(QAbstractAnimation::DeleteWhenStopped); +} + +/*! + Starts the drop effect. +*/ +void HsWidgetHostVisual::startDropEffect() +{ + /* TODO: Uncomment after the Qt bug has been fixed. + QGraphicsDropShadowEffect *effect = + static_cast(graphicsEffect()); + */ + HbInstantFeedback::play(HbFeedback::ItemDrop); + + QParallelAnimationGroup *animationGroup = new QParallelAnimationGroup; + + QPropertyAnimation *animation = new QPropertyAnimation(this, "scale"); + animation->setDuration(HSCONFIGURATION_GET(widgetDropEffectDuration)); + animation->setEndValue(1); + animationGroup->addAnimation(animation); + + /* TODO: Uncomment after the Qt bug has been fixed. + animation = new QPropertyAnimation(effect, "offset"); + animation->setDuration(200); + animation->setEndValue(QPointF(3, 3)); + animationGroup->addAnimation(animation); + */ + + animationGroup->start(QAbstractAnimation::DeleteWhenStopped); +} +/*! + \fn HsWidgetHost::resized() + Notifies the home screen framework that this widget + host has resized itself. +*/ + +/*! + Reimplemented from QObject for monitoring changes in + contained widget's size. +*/ +bool HsWidgetHostVisual::eventFilter(QObject *watched, QEvent *event) +{ + if (event->type() == QEvent::GraphicsSceneResize ) { + QGraphicsSceneResizeEvent *resizeEvent = + static_cast(event); + setNewSize(resizeEvent->newSize()); + emit resized(); + } + return HbWidget::eventFilter(watched, event); +} + +/*! + Reimplemented from HbWidget for pan gesture handling. +*/ +void HsWidgetHostVisual::gestureEvent(QGestureEvent *event) +{ + HsScene *scene = HsScene::instance(); + QGesture *gesture = event->gesture(Qt::PanGesture); + if (gesture) { + switch (gesture->state()) { + case Qt::GestureStarted: + grabMouse(); + emit scene->pagePanStarted(event); + break; + case Qt::GestureUpdated: + emit scene->pagePanUpdated(event); + break; + case Qt::GestureFinished: + case Qt::GestureCanceled: + ungrabMouse(); + emit scene->pagePanFinished(event); + break; + default: + break; + } + } +} + +/*! + \fn HsWidgetHostVisual::mousePressEvent(QGraphicsSceneMouseEvent *) + Reimplemented from QGraphicsItem for eating all mouse presses. +*/ + +/*! + Configures the touch are for this widget host. +*/ +void HsWidgetHostVisual::setupTouchArea() +{ + mTouchArea = new HsWidgetTouchArea(this); + mTouchArea->setZValue(1); +} + +/*! + Configures the effects for this widget host. +*/ +void HsWidgetHostVisual::setupEffects() +{ + /* TODO: Uncomment after the Qt bug has been fixed. + QGraphicsDropShadowEffect *effect = + new QGraphicsDropShadowEffect(this); + effect->setColor(QColor(0, 0, 0, 150)); + effect->setBlurRadius(5); + effect->setOffset(3); + setGraphicsEffect(effect); + */ +} + + +/*! + Resizes this widget host to the given \a size. +*/ +void HsWidgetHostVisual::setNewSize(const QSizeF &size) +{ + mTouchArea->resize(size); + resize(size); + setPreferredSize(size); +} + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsdomainmodel/src/hswidgettoucharea.cpp --- a/homescreenapp/hsdomainmodel/src/hswidgettoucharea.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hswidgettoucharea.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -24,12 +24,12 @@ #include #include "hswidgettoucharea.h" -#include "hswidgethost.h" +#include "hswidgethostvisual.h" #include "hsscene.h" -HsWidgetTouchArea::HsWidgetTouchArea(HsWidgetHost *widgetHost) - : HbTouchArea(widgetHost), - mWidgetHost(widgetHost) +HsWidgetTouchArea::HsWidgetTouchArea(HsWidgetHostVisual *visual) + : HbTouchArea(visual), + mWidgetHostVisual(visual) { grabGesture(Qt::TapAndHoldGesture); } @@ -44,14 +44,14 @@ switch (event->type()) { case QEvent::TouchBegin: case QEvent::GraphicsSceneMousePress: - emit scene->widgetTapStarted(mWidgetHost); + emit scene->widgetTapStarted(mWidgetHostVisual->visualModel()); break; case QEvent::TouchEnd: { ungrabGesture(Qt::PanGesture); ungrabMouse(); QPointF scenePos = static_cast(event)->touchPoints().first().scenePos(); - emit scene->widgetMoveFinished(scenePos, mWidgetHost); + emit scene->widgetMoveFinished(scenePos, mWidgetHostVisual->visualModel()); } break; case QEvent::GraphicsSceneMouseRelease: @@ -59,7 +59,7 @@ ungrabGesture(Qt::PanGesture); ungrabMouse(); QPointF scenePos = static_cast(event)->scenePos(); - emit scene->widgetMoveFinished(scenePos, mWidgetHost); + emit scene->widgetMoveFinished(scenePos, mWidgetHostVisual->visualModel()); } break; default: @@ -71,7 +71,7 @@ QPainterPath HsWidgetTouchArea::shape() const { - return mWidgetHost->shape(); + return mWidgetHostVisual->shape(); } void HsWidgetTouchArea::gestureEvent(QGestureEvent *event) @@ -84,7 +84,7 @@ if (gesture->state() == Qt::GestureFinished) { grabGesture(Qt::PanGesture); grabMouse(); - emit scene->widgetTapAndHoldFinished(event, mWidgetHost); + emit scene->widgetTapAndHoldFinished(event, mWidgetHostVisual->visualModel()); } return; } @@ -96,12 +96,12 @@ switch (gesture->state()) { case Qt::GestureStarted: case Qt::GestureUpdated: - emit scene->widgetMoveUpdated(scenePos, mWidgetHost); + emit scene->widgetMoveUpdated(scenePos, mWidgetHostVisual->visualModel()); break; case Qt::GestureCanceled: case Qt::GestureFinished: ungrabGesture(Qt::PanGesture); - emit scene->widgetMoveFinished(scenePos, mWidgetHost); + emit scene->widgetMoveFinished(scenePos, mWidgetHostVisual->visualModel()); break; default: break; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsmenuclientplugin/hsmenuclientplugin.pro --- a/homescreenapp/hsmenuclientplugin/hsmenuclientplugin.pro Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsmenuclientplugin/hsmenuclientplugin.pro Wed Aug 18 09:40:07 2010 +0300 @@ -23,20 +23,17 @@ LIBS += -lcaclient -INCLUDEPATH += inc +INCLUDEPATH += inc \ + ../../homescreen_plat/homescreenclient_api -HEADERS += inc/hsmenuclient.h \ - inc/hsmenuclientplugin.h \ +HEADERS += ../../homescreen_plat/homescreenclient_api/hsmenuclient.h \ + inc/hsmenuclientplugin.h SOURCES += src/hsmenuclient.cpp \ - src/hsmenuclientplugin.cpp \ + src/hsmenuclientplugin.cpp symbian: { TARGET.UID3 = 0x20028715 -#export interface header to platform -BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " -BLD_INF_RULES.prj_exports += "inc/hsmenuclient.h \ - APP_LAYER_PLATFORM_EXPORT_PATH(hsmenuclient.h)" } include(../common.pri) diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsmenuclientplugin/inc/hsmenuclient.h --- a/homescreenapp/hsmenuclientplugin/inc/hsmenuclient.h Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: hsmenuclient.h - * - */ - -#ifndef HSMENUCLIENT_H -#define HSMENUCLIENT_H - -#include -#include -#include - -QTM_USE_NAMESPACE - -//mandatory keys -const QString hsItemName("item:name"); -// or for localized name -const QString hsItemLocName("item:locname"); - -const QString hsitemLaunchUri("item:launchuri"); -const QString hsitemPublisherId("item:publisherId"); - -//not mandatory -const QString hsItemWidgetUri("widget:uri"); -const QString hsItemDescription("item:description"); -// or for localized name -const QString hsItemLocDescription("item:locdescription"); - -//for icon - not mandatory -const QString hsIconFileName("icon:filename");//to display specific icon from file -const QString hsIconName("icon:name");// HbIcon -const QString hsIconApplicationId("icon:applicationid"); // icon from associated application - - -class HsMenuClientPrivate; - -class HsMenuClient : public QObject -{ - Q_OBJECT - -public: - HsMenuClient(QObject *parent = 0); - ~HsMenuClient(); -public slots: - bool add(const QVariantMap &entryPreference = QVariantMap()); - bool remove(const QVariantMap &queryPreference = QVariantMap()) const; - - QList getList(const QVariantMap &queryPreference = QVariantMap()); - -private: - Q_DISABLE_COPY(HsMenuClient) - /** - * Pointer to a private implementation. - */ - HsMenuClientPrivate * const m_d; -}; - - - -#endif // HSMENUCLIENT_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/inc/hsmenudialogfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/inc/hsmenudialogfactory.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Menu Dialog +* +*/ + + +#ifndef HSMENUDIALOG_H +#define HSMENUDIALOG_H + +#include + +class QStringList; +class HbAction; +class HbMessageBox; + +#include "hsutils_global.h" + +class HSUTILS_EXPORT HsMenuDialogFactory +{ +public: + enum Options { OkCancel, Close }; + + virtual HbMessageBox *create(const QString &text, + Options options = OkCancel) const; + virtual ~HsMenuDialogFactory(); +private: + void setUpActions(HbMessageBox *box, + const QStringList &translationIdentifiers) const; +}; + +#endif + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/inc/hsmenuevent.h --- a/homescreenapp/hsutils/inc/hsmenuevent.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsutils/inc/hsmenuevent.h Wed Aug 18 09:40:07 2010 +0300 @@ -46,10 +46,12 @@ OpenInstalledView, OpenHomeScreen, ArrangeCollection, + ArrangeAllCollections, CreateCollection, PreviewHSWidget, ShowAppSettings, ShowAppDetails, + ShowInstallationLog, Unknown }; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/inc/hsmenueventfactory.h --- a/homescreenapp/hsutils/inc/hsmenueventfactory.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsutils/inc/hsmenueventfactory.h Wed Aug 18 09:40:07 2010 +0300 @@ -63,19 +63,20 @@ static QEvent *createAddAppsFromApplicationsViewEvent( HsSortAttribute aApplicationsSortOder, - HsSortAttribute aCollectionsSortOder, int aItemId = 0); - static QEvent *createAddAppsFromCallectionViewEvent( + static QEvent *createAddAppsFromCollectionViewEvent( int aCollectionId, - int aApplicationId = 0, - HsSortAttribute aCollectionsSortOder = NoHsSortAttribute); + int aApplicationId = 0); static QEvent *createRemoveAppFromCollectionEvent(int aItemId, int aCollectionId); static QEvent *createUninstallApplicationEvent(int aItemId); - static QEvent *createArrangeCollectionEvent(int aTopItemId); + static QEvent *createArrangeCollectionEvent(int aTopItemId, + int aCollectionId); + + static QEvent *createArrangeAllCollectionsEvent(int aTopItemId); static QEvent *createPreviewHSWidgetEvent( int entryId, @@ -87,6 +88,8 @@ static QEvent *createAppSettingsViewEvent(int entryId); static QEvent *createAppDetailsViewEvent(int entryId); + + static QEvent *createInstallationLogEvent(); static QEvent *createUnknownEvent(); diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/inc/hsmessageboxwrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/inc/hsmessageboxwrapper.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,63 @@ +/* +* 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 HSMESSAGEBOXWRAPPER_H +#define HSMESSAGEBOXWRAPPER_H + +#include + +#include "hsutils_global.h" + +#include "hstest_global.h" +HOMESCREEN_TEST_CLASS(t_hsUtils) + +class HbAction; +class HbMessageBox; +struct HsMessageBoxWrapperImpl; + +class HSUTILS_EXPORT HsMessageBoxWrapper : public QObject +{ + Q_OBJECT + +public: + HsMessageBoxWrapper(QObject *parent=0); + ~HsMessageBoxWrapper(); + + void setHeader(const QString &header); + void setQueryText(const QString &queryText); + void close(); + +signals: + void accepted(); + void rejected(); +public slots: + void show(); + +private: + Q_DISABLE_COPY(HsMessageBoxWrapper) + +private slots: + void onDialogClosed(int action); + +private: + HsMessageBoxWrapperImpl *mImpl; + HbMessageBox *mBox; + + HOMESCREEN_TEST_FRIEND_CLASS(t_hsUtils) +}; + +#endif // HSPAGEINDICATOR_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/inc/hspropertyanimationwrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/inc/hspropertyanimationwrapper.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,65 @@ +/* +* 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 HSPROPERTYANIMATIONWRAPPER_H +#define HSPROPERTYANIMATIONWRAPPER_H + +#include + +#include "hsutils_global.h" +#include "hstest_global.h" + +HOMESCREEN_TEST_CLASS(t_hsUtils) + +class QEasingCurve; + +struct HsPropertyAnimationWrapperImpl; +class HSUTILS_EXPORT HsPropertyAnimationWrapper : public QObject +{ + Q_OBJECT + +public: + HsPropertyAnimationWrapper(QObject *parent=0); + ~HsPropertyAnimationWrapper(); + + void setTargetObject(QObject *target); + void setPropertyName(const QByteArray &propertyName); + bool isRunning(); + void setEndValue(const QVariant &value); + void setDuration(int msecs); + void setForward(); + void setBackward(); + bool isForward() const; + void setEasingCurve(const QEasingCurve &curve); + +signals: + void finished(); + +public slots: + void start(); + void stop(); + +private: + Q_DISABLE_COPY(HsPropertyAnimationWrapper) + + +private: + QScopedPointer mImpl; + HOMESCREEN_TEST_FRIEND_CLASS(t_hsUtils) +}; + +#endif // HSPAGEINDICATOR_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/inc/hsutils_global.h --- a/homescreenapp/hsutils/inc/hsutils_global.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsutils/inc/hsutils_global.h Wed Aug 18 09:40:07 2010 +0300 @@ -19,7 +19,7 @@ #ifndef HSUTILS_GLOBAL_H #define HSUTILS_GLOBAL_H -#include +#include #ifdef HSUTILS_LIB diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/inc/hswidgetpositioningonwidgetadd.h --- a/homescreenapp/hsutils/inc/hswidgetpositioningonwidgetadd.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsutils/inc/hswidgetpositioningonwidgetadd.h Wed Aug 18 09:40:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,15 +20,19 @@ #include #include +#include #include "hsutils_global.h" +class HsWidgetHost; + class HSUTILS_EXPORT HsWidgetPositioningOnWidgetAdd { public: virtual ~HsWidgetPositioningOnWidgetAdd() {} virtual QList convert(const QRectF &contentArea, - const QList &rects, + const QList &existingRects, + const QList &newRects, const QPointF &startPoint) = 0; static void setInstance(HsWidgetPositioningOnWidgetAdd *instance); @@ -42,7 +46,8 @@ { public: QList convert(const QRectF &contentArea, - const QList &rects, + const QList &existingRects, + const QList &newRects, const QPointF &startPoint); }; @@ -51,9 +56,40 @@ { public: QList convert(const QRectF &contentArea, - const QList &rects, + const QList &existingRects, + const QList &newRects, const QPointF &startPoint); }; +class HSUTILS_EXPORT HsWidgetOrganizer : public HsWidgetPositioningOnWidgetAdd +{ +public: + QList convert(const QRectF &contentArea, + const QList &existingRects, + const QList &newRects, + const QPointF &startPoint); + +private: + bool initAnchors(const QSizeF &areaSize); + bool getAnchorPoint(const QSizeF &contentSize); + bool searchWidthSpace(const QSizeF &contentSize); + bool searchHeightSpace(int contentHeight); + bool markReservedAnchors(); + QPointF getAnchorCoordinates(int index); + int getIndexForCoordinate(QPointF position); + int lenghtInAnchorPoints(QVariant length); + +private: + int mAnchorColumns; + int mAnchorRows; + int mAnchorDistance; + QPointF mStartWidthAnchorPoint; + QPointF mEndWidthAnchorPoint; + QPointF mEndHeightAnchorPoint; + // TODO: is there better way to store anchor points, perhaps with pointers? + QList mAnchors; + +}; + #endif // HSWIDGETPOSITIONINGONWIDGETADD_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/inc/hswidgetpositioningonwidgetmove.h --- a/homescreenapp/hsutils/inc/hswidgetpositioningonwidgetmove.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsutils/inc/hswidgetpositioningonwidgetmove.h Wed Aug 18 09:40:07 2010 +0300 @@ -103,13 +103,20 @@ private: void createSnappableRectangles(const QList &inactiveRects); - void checkForCenterSnapping(); void checkInactiveRectLieAboveOrBelowOfMovingRect(); + void checkInactiveRectVerticalEdgesInRange(qreal movingRectVerticalEdgePosition); + void checkInactiveRectBetterFitForHorizontalSnapping(qreal containerVerticalEdgeToInactiveRectVerticalEdge, + qreal containerOtherVerticalEdgeToInactiveRectOtherVerticalEdge); void compareLeftSideOfMovingRectForSnapping(); void compareRightSideOfMovingRectForSnapping(); void checkInactiveRectLieLeftOrRightOfMovingRect(); + void checkInactiveRectHorizontalEdgesInRange(qreal movingRectHorizontalEdgePosition); + void checkInactiveRectBetterFitForVerticalSnapping(qreal containerHorizontalEdgeToInactiveRectHorizontalEdge, + qreal containerOtherHorizontalEdgeToInactiveRectOtherHorizontalEdge); void compareTopOfMovingRectForSnapping(); void compareBottomOfMovingRectForSnapping(); + void createVerticalLine(); + void createHorizontalLine(); void extendVerticalLine(); void extendHorizontalLine(); void checkInactiveRectPositionToVerticalLine(); @@ -128,6 +135,8 @@ QRectF mInactiveRectToCompare; HsSnapRectangle mInactiveSnapRectToCompare; QRectF mMovingRect; + + qreal mMinDistancePosition; qreal mHorizontalSnapPosition; qreal mVerticalSnapPosition; @@ -140,6 +149,10 @@ bool mRectLieAbove; bool mLeftInRange; bool mRightInRange; + bool mIsBetterFitHorizontalSnap; + qreal mDistanceVerticalEdges; + qreal mVerticalEdgeToLeftOfInactiveRect; + qreal mVerticalEdgeToRightOfInactiveRect; qreal mMinVerticalEdgesDistance; qreal mVerticalDistance; qreal mVerticalDistanceFromSelectedRect; @@ -148,6 +161,10 @@ bool mRectLieLeft; bool mTopInRange; bool mBottomInRange; + bool mIsBetterFitVerticalSnap; + qreal mDistanceHorizontalEdges; + qreal mHorizontalEdgeToTopOfInactiveRect; + qreal mHorizontalEdgeToBottomOfInactiveRect; qreal mMinHorizontalEdgesDistance; qreal mHorizontalDistance; qreal mHorizontalDistanceFromSelectedRect; @@ -156,7 +173,6 @@ bool mSnapEnabled; qreal mSnapForce; qreal mSnapGap; - qreal mSnapBorderGap; bool mRectVerticalEdgeLiesInLineWithVerticalLine; bool mRectLieAboveVerticalLine; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/src/hsmenudialogfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/src/hsmenudialogfactory.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Menu Dialog +* +*/ + +#include +#include +#include +#include + +#include +#include +#include "hsmenudialogfactory.h" + +/*! + \class HsMenuDialogFactory + \ingroup group_hsutils + + \brief Creates dialog instances for Application Library. + + \sa HsMenuEvent +*/ + +/*! \enum HsMenuDialogFactory::Options + Describes what actions the dialog will have. + */ + +/*! \var HsMenuDialogFactory::Options HsMenuDialogFactory::OkCancel + Requested dialog should have two actions in the following order: Ok (confirm) and Cancel (reject). + */ +/*! \var HsMenuDialogFactory::Options HsMenuDialogFactory::Close + Requested dialog should have one action: Close. + */ +/*! + Creates dialog. + \param text to be displayed in the dialog. + \param options specify dialog actions. + \return requested dialog. +*/ +HbMessageBox *HsMenuDialogFactory::create(const QString &text, + Options options) const +{ + + QStringList actionIdentifiers; // head of the list will be first action in dialog + HbMessageBox::MessageBoxType type(HbMessageBox::MessageTypeNone); + + switch (options) { + + case OkCancel: + + actionIdentifiers << hbTrId("txt_common_button_ok"); + actionIdentifiers << hbTrId("txt_common_button_cancel"); + type = HbMessageBox::MessageTypeQuestion; + break; + + case Close: + + actionIdentifiers << hbTrId("txt_common_button_close"); + type = HbMessageBox::MessageTypeInformation; + break; + + default: + break; + } + + QScopedPointer box(new HbMessageBox(type)); + + setUpActions(box.data(), actionIdentifiers); + + box->setText(text); + box->setAttribute(Qt::WA_DeleteOnClose); + + return box.take(); +} + + +/*! + Destructor. +*/ +HsMenuDialogFactory::~HsMenuDialogFactory() {} + +/*! + Sets up dialog actions + \param box dialog to operate on. + \param actionIdentifiers list of translation identifiers for actions. Order of + actions in the dialog will reflect the identifiers order in the list. +*/ +void HsMenuDialogFactory::setUpActions(HbMessageBox *box, + const QStringList &translationIdentifiers) const +{ + box->clearActions(); + + foreach (QString identifier, translationIdentifiers) { + QScopedPointer action(new HbAction(identifier)); + action->setParent(box); + box->addAction(action.take()); + } +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/src/hsmenuevent.cpp --- a/homescreenapp/hsutils/src/hsmenuevent.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsutils/src/hsmenuevent.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -57,7 +57,7 @@ Opening application library from shortcut. */ /*! \var HsMenuEvent::OperationType HsMenuEvent::ArrangeCollection - Swith to arrange mode. + Switch to arrange mode. */ /*! \var HsMenuEvent::OperationType HsMenuEvent::Unknown Unknown menu event. diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/src/hsmenueventfactory.cpp --- a/homescreenapp/hsutils/src/hsmenueventfactory.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsutils/src/hsmenueventfactory.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -177,18 +177,15 @@ Creates an HsMenuEvent::AddAppsToCollection event. \param aApplicationsSortOder applications sort order. - \param aCollectionsSortOder collections sort order. \param aItemId item id. \return Add applications to collection event. */ QEvent *HsMenuEventFactory::createAddAppsFromApplicationsViewEvent( HsSortAttribute aApplicationsSortOder, - HsSortAttribute aCollectionsSortOder, int aItemId) { QVariantMap params; params.insert(appSortOrderKey(), aApplicationsSortOder); - params.insert(collectionSortOrderKey(), aCollectionsSortOder); params.insert(itemIdKey(), aItemId); return new HsMenuEvent(HsMenuEvent::AddAppsToCollection, params); } @@ -198,18 +195,15 @@ \param aCollectionId collection id. \param aApplicationId application id. - \param aCollectionsSortOder collections sort order. \return Add applications to collection event. */ -QEvent *HsMenuEventFactory::createAddAppsFromCallectionViewEvent( +QEvent *HsMenuEventFactory::createAddAppsFromCollectionViewEvent( int aCollectionId, - int aApplicationId, - HsSortAttribute aCollectionsSortOder) + int aApplicationId) { QVariantMap params; params.insert(itemIdKey(), aApplicationId); params.insert(collectionIdKey(), aCollectionId); - params.insert(collectionSortOrderKey(), aCollectionsSortOder); return new HsMenuEvent(HsMenuEvent::AddAppsToCollection, params); } @@ -247,16 +241,33 @@ Creates an HsMenuEvent::ArrangeCollection event. \param aTopItemId Item id to be scrolled. - \return ArrangeCollection event. + \param aCollectionId Collection id. + \retval ArrangeCollection event. */ -QEvent *HsMenuEventFactory::createArrangeCollectionEvent(int aTopItemId) +QEvent *HsMenuEventFactory::createArrangeCollectionEvent( + int aTopItemId, + int aCollectionId) { QVariantMap params; params.insert(itemIdKey(), aTopItemId); + params.insert(collectionIdKey(), aCollectionId); return new HsMenuEvent(HsMenuEvent::ArrangeCollection, params); } /*! + Creates an HsMenuEvent::ArrangeAllCollections event. + + \param aTopItemId Item id to be scrolled. + \retval ArrangeAllCollections event. + */ +QEvent *HsMenuEventFactory::createArrangeAllCollectionsEvent(int aTopItemId) +{ + QVariantMap params; + params.insert(itemIdKey(), aTopItemId); + return new HsMenuEvent(HsMenuEvent::ArrangeAllCollections, params); +} + +/*! Prepares event triggered on tap on Widget. \param entryId Id of an item. \param entryTypeName Name of the entry type (e.g. application, widget). @@ -315,6 +326,16 @@ } /*! + Creates an HsMenuEvent::ShowInstallationLog event. + + \return Event for installation log. +*/ +QEvent *HsMenuEventFactory::createInstallationLogEvent() +{ + return new HsMenuEvent(HsMenuEvent::ShowInstallationLog); +} + +/*! Creates an HsMenuEvent::Unknown event. \return Unknown event. diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/src/hsmessageboxwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/src/hsmessageboxwrapper.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include "hsmessageboxwrapper.h" + +/*! + \class HsMessageBoxWrapper + \ingroup group_hsutils + \brief +*/ + + +struct HsMessageBoxWrapperImpl{ + QString mHeader; + QString mQueryText; + +}; +/*! + +*/ +HsMessageBoxWrapper::HsMessageBoxWrapper(QObject *parent) + : QObject(parent), + mImpl(new HsMessageBoxWrapperImpl), + mBox(0) +{ +} + +/*! + +*/ +HsMessageBoxWrapper::~HsMessageBoxWrapper() +{ + delete mImpl; +} + +/*! + +*/ +void HsMessageBoxWrapper::setHeader(const QString &header) +{ + mImpl->mHeader = header; +} +/*! + +*/ +void HsMessageBoxWrapper::setQueryText(const QString &queryText) +{ + mImpl->mQueryText = queryText; +} +/*! + +*/ +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif + +void HsMessageBoxWrapper::show() +{ + mBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion); + mBox->setAttribute(Qt::WA_DeleteOnClose); + mBox->setHeadingWidget(new HbLabel(mImpl->mHeader)); + mBox->setText(mImpl->mQueryText); + mBox->setStandardButtons(HbMessageBox::Yes | HbMessageBox::No); + + mBox->open(this,SLOT(onDialogClosed(int))); +} + +void HsMessageBoxWrapper::close() +{ + if (mBox) { + mBox->close(); + mBox = NULL; + } +} + +/*! + +*/ +void HsMessageBoxWrapper::onDialogClosed(int action) +{ + if (action == HbMessageBox::Yes){ + emit accepted(); + } else { + emit rejected(); + } +} +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/src/hspageindicator.cpp --- a/homescreenapp/hsutils/src/hspageindicator.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsutils/src/hspageindicator.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -79,7 +79,7 @@ */ void HsPageIndicator::setActiveItemIndex(int activeItemIndex) { - if (activeItemIndex < 0 || itemCount() <= activeItemIndex) { + if (activeItemIndex < 0 || itemCount()-1 < activeItemIndex) { return; } @@ -116,13 +116,18 @@ */ void HsPageIndicator::removeItem(int activeItemIndex) { - if (activeItemIndex < 0 || itemCount() - 1 <= activeItemIndex) { + if (activeItemIndex < 0 || itemCount() <= activeItemIndex) { return; } + if (activeItemIndex == itemCount()-1) { + activeItemIndex--; + } + delete mItems.last(); mItems.removeLast(); layoutItems(); + setActiveItemIndex(activeItemIndex); } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/src/hspageindicatoritem.cpp --- a/homescreenapp/hsutils/src/hspageindicatoritem.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsutils/src/hspageindicatoritem.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -111,9 +111,12 @@ setTransformOriginPoint(rect().center()); QPropertyAnimation *animation = new QPropertyAnimation(graphicsEffect(), "strength"); + animation->setDuration(800); animation->setKeyValueAt(0.2, 1); animation->setEndValue(0); + + connect(this,SIGNAL(destroyed()),animation,SLOT(stop())); connect(animation, SIGNAL(finished()), SLOT(animationFinished())); animation->start(QAbstractAnimation::DeleteWhenStopped); } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/src/hspropertyanimationwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/src/hspropertyanimationwrapper.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include "hspropertyanimationwrapper.h" + +/*! + \class HsMessageBoxWrapper + \ingroup group_hsutils + \brief +*/ + +struct HsPropertyAnimationWrapperImpl +{ +public: + QPropertyAnimation *mPropertyAnimation; +}; + +/*! + +*/ +HsPropertyAnimationWrapper::HsPropertyAnimationWrapper(QObject *parent) + : QObject(parent),mImpl(new HsPropertyAnimationWrapperImpl) +{ + mImpl->mPropertyAnimation = new QPropertyAnimation(parent); + connect(mImpl->mPropertyAnimation,SIGNAL(finished()),SIGNAL(finished())); +} + +/*! + +*/ +HsPropertyAnimationWrapper::~HsPropertyAnimationWrapper() +{ + +} + +/*! + +*/ +void HsPropertyAnimationWrapper::setTargetObject(QObject *target) +{ + mImpl->mPropertyAnimation->setTargetObject(target); +} +/*! + +*/ +void HsPropertyAnimationWrapper::setPropertyName(const QByteArray &propertyName) +{ + mImpl->mPropertyAnimation->setPropertyName(propertyName); +} + +bool HsPropertyAnimationWrapper::isRunning() +{ + return (mImpl->mPropertyAnimation->state() == QAbstractAnimation::Running); +} + +void HsPropertyAnimationWrapper::setEndValue(const QVariant &value) +{ + mImpl->mPropertyAnimation->setEndValue(value); +} + +void HsPropertyAnimationWrapper::setDuration(int msecs) +{ + mImpl->mPropertyAnimation->setDuration(msecs); +} + +void HsPropertyAnimationWrapper::setForward() +{ + mImpl->mPropertyAnimation->setDirection(QAbstractAnimation::Forward); +} + +void HsPropertyAnimationWrapper::setBackward() +{ + mImpl->mPropertyAnimation->setDirection(QAbstractAnimation::Backward); +} + +bool HsPropertyAnimationWrapper::isForward() const +{ + return (mImpl->mPropertyAnimation->direction() == QAbstractAnimation::Forward); +} +/*! + +*/ +void HsPropertyAnimationWrapper::start() +{ + mImpl->mPropertyAnimation->start(); +} +/*! + +*/ +void HsPropertyAnimationWrapper::stop() +{ + mImpl->mPropertyAnimation->stop(); +} + +/*! + +*/ +void HsPropertyAnimationWrapper::setEasingCurve(const QEasingCurve &curve) +{ + mImpl->mPropertyAnimation->setEasingCurve(curve); +} + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/src/hssnapline.cpp --- a/homescreenapp/hsutils/src/hssnapline.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsutils/src/hssnapline.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -17,9 +17,10 @@ #include #include +#include #include "hsapp_defs.h" -#include "HsSnapLine.h" +#include "hssnapline.h" /*! Constructor. @@ -44,11 +45,6 @@ mFadeOutAnimation = new QPropertyAnimation(graphicsEffect(), "opacity", this); connect(mFadeOutAnimation, SIGNAL(finished()), SLOT(fadeOutAnimationFinished())); - - QPen pen; - pen.setWidth(3); - pen.setColor(Qt::darkCyan); //TODO: Change the color to the Theme element - setPen(pen); } /*! @@ -111,6 +107,23 @@ displayLine.translate(-1.0, 0.0); } + QLinearGradient gradient(displayLine.p1(), displayLine.p2()); + gradient.setColorAt(0.0, Qt::white); + QColor snapLineColor = HbColorScheme::color("qtc_hs_snapguide"); + if (!snapLineColor.isValid()) { + //if valid color is not loaded from the theme, the darkCyan color is used as a backup.color + snapLineColor = Qt::darkCyan; + } + gradient.setColorAt(0.4, snapLineColor); + gradient.setColorAt(0.6, snapLineColor); + gradient.setColorAt(1.0, Qt::white); + QBrush brush(gradient); + QPen pen; + pen.setWidth(3); + pen.setCapStyle(Qt::RoundCap); + pen.setBrush(brush); + setPen(pen); + setLine(displayLine); show(); } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/src/hswidgetpositioningonwidgetadd.cpp --- a/homescreenapp/hsutils/src/hswidgetpositioningonwidgetadd.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsutils/src/hswidgetpositioningonwidgetadd.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,10 +15,15 @@ * */ +#include #include +#include +#include + +#include + + #include "hswidgetpositioningonwidgetadd.h" -#include -#include const qreal offset = 40; //TODO: Implement this as configurable parameter @@ -71,9 +76,12 @@ */ QList HsAnchorPointInBottomRight::convert( const QRectF &contentArea, - const QList &rects, + const QList &existingRects, + const QList &newRects, const QPointF &startPoint) { + Q_UNUSED(existingRects); + QList toGeometries; //Offset for widgets' bottom right position to each other @@ -87,16 +95,16 @@ if(startPoint.isNull()){ QLineF diagonal(contentArea.topLeft(), contentArea.bottomRight()); - QLineF widgetRightSide(contentArea.center().x()+ rects.at(0).width()/2, + QLineF widgetRightSide(contentArea.center().x()+ newRects.at(0).width()/2, contentArea.top(), - contentArea.center().x()+ rects.at(0).width()/2, + contentArea.center().x()+ newRects.at(0).width()/2, contentArea.bottom()); // right side line intersection with diagonal will be bottom right position // for the first rect if(QLineF::BoundedIntersection != diagonal.intersect(widgetRightSide, &anchorPoint)) { - return rects; //Return original since undefined error. + return newRects; //Return original since undefined error. //In this case widget's must be wider than the content area. } }else{ @@ -104,8 +112,8 @@ } QRectF widgetRect; - for(int i=0;i HsAnchorPointInCenter::convert( const QRectF &contentArea, - const QList &rects, + const QList &existingRects, + const QList &newRects, const QPointF &startPoint ) { + Q_UNUSED(existingRects); Q_UNUSED(startPoint) QList toGeometries; @@ -152,7 +162,7 @@ //First widget to the center of the content area QPointF anchorPoint = contentArea.center(); - foreach (QRectF g, rects) { + foreach (QRectF g, newRects) { g.moveCenter(anchorPoint); toGeometries << g; anchorPoint -= offsetPoint; @@ -163,6 +173,279 @@ return toGeometries; } +/*! + \class HsWidgetOrganizer + \brief Advanced widget positioning algorithm. + + Organizes widget's starting from upper left corner towards right, + and then continues the on the next line. +*/ +QList HsWidgetOrganizer::convert( + const QRectF &contentArea, + const QList &existingRects, + const QList &newRects, + const QPointF &startPoint) +{ + Q_UNUSED(startPoint) + + // TODO: maybe we can utilize start point in some use cases / optimizations? + + QList toGeometries; + + // TODO: anchor distance to configuration? + // TODO: optimize anchor distance based on new content amount + // TODO: snap value to same as anchor distance? + mAnchorDistance = 5; + QList temp; + mAnchors = temp; + + // test flag + int test = 0; + + // initialize anchor network for widget positions + if (test == 0) { + initAnchors(contentArea.size()); + } else { + mAnchorDistance = 2; + initAnchors(QSizeF(6,6)); + } + + // mark existing rects (widgets) reserved + foreach (QRectF rect, existingRects) { + // TODO: could mStartWidthAnchorPoint, mEndWidthAnchorPoint, mEndHeightAnchorPoint be somehow refactored better way? + mStartWidthAnchorPoint.setX(lenghtInAnchorPoints(rect.x() - contentArea.x())); + mEndWidthAnchorPoint.setX(lenghtInAnchorPoints(rect.x() + rect.width() - contentArea.x())); + mStartWidthAnchorPoint.setY(lenghtInAnchorPoints(rect.y() - contentArea.y())); + mEndHeightAnchorPoint.setY(lenghtInAnchorPoints(rect.y() + rect.height() - contentArea.y())); + // mark reserved anchor points + markReservedAnchors(); + mStartWidthAnchorPoint = QPointF(0,0); + mEndWidthAnchorPoint = QPointF(0,0); + mEndHeightAnchorPoint = QPointF(0,0); + } + + QList notOrganizedRects; + + // get positions for all new rects (widgets) + for ( int i = 0; i < newRects.count(); i++) { + bool found = false; + if (test == 0) { + // find first free anchor point for rect + found = getAnchorPoint(newRects.at(i).size()); + } else { + found = getAnchorPoint(QSizeF(2,2)); + } + + if (found) { + // save to geometry list + toGeometries << QRectF(mStartWidthAnchorPoint.x() * mAnchorDistance + contentArea.x(), + mStartWidthAnchorPoint.y() * mAnchorDistance + contentArea.y(), + newRects.at(i).width(), newRects.at(i).height()); + // mark new widgets rect reserved + markReservedAnchors(); + // TODO: these optimizations could be used for empty page + //mStartWidthAnchorPoint.setX(mEndWidthAnchorPoint.x() + 1); + //mStartWidthAnchorPoint.setY(mEndWidthAnchorPoint.y()); + } else { + // collect widgets that do not fit + notOrganizedRects << newRects.at(i); + } + // TODO: remove these to optimize for empty page + mStartWidthAnchorPoint = QPointF(0,0); + mEndWidthAnchorPoint = QPointF(0,0); + } + + // use center algorithm with offset for the rest widget that did not fit to screen + if (notOrganizedRects.count() > 0) { + QList tmpExistingRects; + tmpExistingRects += newRects; + tmpExistingRects += existingRects; + HsAnchorPointInCenter *centerAlgorithm = new HsAnchorPointInCenter(); + QList calculatedRects = + centerAlgorithm->convert(contentArea, tmpExistingRects, notOrganizedRects, QPointF()); + toGeometries += calculatedRects; + } + + return toGeometries; +} + + +/*! + Initializes anchor points for context area +*/ +bool HsWidgetOrganizer::initAnchors(const QSizeF &areaSize) +{ + // mandatory check ups + // TODO: these mAnchorDistance checks to earlier phase + if (areaSize == QSizeF(0,0) || areaSize.width() < mAnchorDistance || + areaSize.height() < mAnchorDistance || mAnchorDistance == 0 || mAnchorDistance == 1) { + return false; + } + mAnchorColumns = 0; + mAnchorRows = 0; + + // TODO: can we optimize anchor amount utilizing minimum widget size + mAnchorColumns = lenghtInAnchorPoints(areaSize.width()); + mAnchorRows = lenghtInAnchorPoints(areaSize.height()); + + // create anchor network + for (int i = 0; i < (mAnchorRows * mAnchorColumns); i = i++) { + mAnchors << false; + } + // zero start points + mStartWidthAnchorPoint = QPointF(0,0); + mEndWidthAnchorPoint = QPointF(0,0); + + return true; +} + +/*! + Finds anchor points for content size +*/ +bool HsWidgetOrganizer::getAnchorPoint(const QSizeF &contentSize) +{ + bool anchorFound = false; + + while (anchorFound == false) { + // if no width found for content + if (!searchWidthSpace(contentSize)) { + // when content organized in height order remove this line for optimization + mStartWidthAnchorPoint = QPointF(0,0); + mEndWidthAnchorPoint = QPointF(0,0); + return false; + } + // search height for content + int height = lenghtInAnchorPoints(contentSize.height()); + anchorFound = searchHeightSpace(height); + } + return true; +} + +/*! + Searches anchor point width for content size +*/ +bool HsWidgetOrganizer::searchWidthSpace(const QSizeF &contentSize) +{ + int availableWidth = 0; + int contentWidth = lenghtInAnchorPoints(contentSize.width()); + // TODO: use this optimizations for empty page + //int contentHeight = lenghtInAnchorPoints(contentSize.height()); + bool newRow = true; + + for (int i = getIndexForCoordinate(mStartWidthAnchorPoint); i <= mAnchors.count(); i++) { + // no width left on the page + if ((newRow == false) && ((i % (mAnchorColumns)) == 0)) { + availableWidth = 0; + // jump to new row + mStartWidthAnchorPoint.setX(0); + // TODO: use this optimizations for empty page + //mStartWidthAnchorPoint.setY(mStartWidthAnchorPoint.y() + contentHeight + 1); + mStartWidthAnchorPoint.setY(mStartWidthAnchorPoint.y() + 1); + i = getIndexForCoordinate(mStartWidthAnchorPoint) - 1; + // if no height found + if (i < 0) { + return false; + } + newRow = true; + } else { + // if enough width found + if (availableWidth == contentWidth) { + mEndWidthAnchorPoint = getAnchorCoordinates(i); + if (mEndWidthAnchorPoint == QPointF()) { + return false; + } + return true; + } + // if anchor reserved + if (mAnchors[i] == true) { + availableWidth = 0; + } else { + // update available width + availableWidth = availableWidth + 1; + } + newRow = false; + } + } + return false; +} + +/*! + Searches anchor point area for content size +*/ +bool HsWidgetOrganizer::searchHeightSpace(int contentHeight) +{ + mEndHeightAnchorPoint = QPointF(0,0); + + for (int i = mStartWidthAnchorPoint.x(); i <= mEndWidthAnchorPoint.x(); i = i++) { + for (int j = mStartWidthAnchorPoint.y(); j <= (mStartWidthAnchorPoint.y() + contentHeight); j = j++) { + int index = getIndexForCoordinate(QPointF(i,j)); + // check that index is not out of bounds + if (index == -1) { + // update start width point one step + mStartWidthAnchorPoint.setX(mStartWidthAnchorPoint.x() + 1); + return false; + } + // if anchor reserved + if (mAnchors[index] == true) { + // update start width point one step + mStartWidthAnchorPoint.setX(mStartWidthAnchorPoint.x() + 1); + return false; + } + } + } + mEndHeightAnchorPoint = QPointF(mEndWidthAnchorPoint.x(), mEndWidthAnchorPoint.y() + contentHeight); + return true; +} + +/*! + Marks reserved anchor points based on pre-defined starting and ending points +*/ +bool HsWidgetOrganizer::markReservedAnchors() +{ + for (int i = mStartWidthAnchorPoint.x(); i <= mEndWidthAnchorPoint.x(); i++) { + for (int j = mStartWidthAnchorPoint.y(); j <= mEndHeightAnchorPoint.y(); j++) { + mAnchors[getIndexForCoordinate(QPointF(i,j))] = true; + } + } + return true; +} + +/*! + Returns pixel coordinate based on anchor coordinate +*/ +QPointF HsWidgetOrganizer::getAnchorCoordinates(int index) +{ + if (index < mAnchors.count()) { + int x = index % mAnchorColumns; + int y = (index - x) / mAnchorColumns; + return QPointF(x,y); + } else { + return QPointF(); + } +} + +/*! + Returns anchor coordinate based on pixel coordinate +*/ +int HsWidgetOrganizer::getIndexForCoordinate(QPointF position) +{ + int index = (position.y() * mAnchorColumns) + position.x(); + if (index < mAnchors.count()) { + return index; + } else { + return -1; + } +} + +/*! + Calculates pixel length as anchor points +*/ +int HsWidgetOrganizer::lenghtInAnchorPoints(QVariant length) +{ + // check remainder + int remainder = length.toInt() % mAnchorDistance; + return ((length.toInt() - remainder) / mAnchorDistance); +} #ifdef COVERAGE_MEASUREMENT #pragma CTC ENDSKIP diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/hsutils/src/hswidgetpositioningonwidgetmove.cpp --- a/homescreenapp/hsutils/src/hswidgetpositioningonwidgetmove.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/hsutils/src/hswidgetpositioningonwidgetmove.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -53,17 +53,18 @@ Constructor. */ HsSnapToLines::HsSnapToLines() : - mActiveRectWidth(0.0), mActiveRectHeight(0.0), + mActiveRectWidth(0.0), mActiveRectHeight(0.0), mMinDistancePosition(0.0), mHorizontalSnapPosition(0.0), mVerticalSnapPosition(0.0), - mHorizontalSnapFound(false), - mVerticalSnapFound(false), - mRectLieAbove(false), mLeftInRange(false), mRightInRange(false), + mHorizontalSnapFound(false), mVerticalSnapFound(false), + mRectLieAbove(false), mLeftInRange(false), mRightInRange(false), mIsBetterFitHorizontalSnap(false), + mDistanceVerticalEdges(0.0), mVerticalEdgeToLeftOfInactiveRect(0.0), mVerticalEdgeToRightOfInactiveRect(0.0), mMinVerticalEdgesDistance(0.0), mVerticalDistance(0.0), mVerticalDistanceFromSelectedRect(0.0), mContainerVerticalEdgeDistance(0.0), - mRectLieLeft(false), mTopInRange(false), mBottomInRange(false), + mRectLieLeft(false), mTopInRange(false), mBottomInRange(false), mIsBetterFitVerticalSnap(false), + mDistanceHorizontalEdges(0.0), mHorizontalEdgeToTopOfInactiveRect(0.0), mHorizontalEdgeToBottomOfInactiveRect(0.0), mMinHorizontalEdgesDistance(0.0), mHorizontalDistance(0.0), mHorizontalDistanceFromSelectedRect(0.0), mContainerHorizontalEdgeDistance(0.0), - mSnapEnabled(false), mSnapForce(0.0), mSnapGap(0.0), mSnapBorderGap(0.0), + mSnapEnabled(false), mSnapForce(0.0), mSnapGap(0.0), mRectVerticalEdgeLiesInLineWithVerticalLine(false), mRectLieAboveVerticalLine(false), mRectLieBelowVerticalLine(false), mRectHorizontalEdgeLiesInLineWithHorizontalLine(false), mRectLieLeftOfHorizontalLine(false), mRectLiesRightOfHorizontalLine(false) { @@ -80,7 +81,6 @@ //The following values should be in qreal, so the status received in canConvert is ignored mSnapForce = configuration[SNAPFORCE].toDouble(&canConvert); mSnapGap = configuration[SNAPGAP].toDouble(&canConvert); - mSnapBorderGap = configuration[SNAPBORDERGAP].toDouble(&canConvert); } /*! @@ -91,11 +91,7 @@ const QList &inactiveRects, const QRectF &activeRect) { - mContainerRect.setLeft(containerRect.left() + mSnapBorderGap); - mContainerRect.setTop(containerRect.top() + mSnapBorderGap); - mContainerRect.setRight(containerRect.right() - mSnapBorderGap); - mContainerRect.setBottom(containerRect.bottom() - mSnapBorderGap); - + mContainerRect = containerRect; mActiveRectWidth = activeRect.width(); mActiveRectHeight = activeRect.height(); @@ -178,16 +174,14 @@ mContainerHorizontalEdgeDistance = 0.0; mVerticalSnapFound = false; - checkForCenterSnapping(); for (int i = 0; i < mInactiveSnapRects.count(); ++i) { mInactiveSnapRectToCompare = mInactiveSnapRects[i]; mInactiveRectToCompare = mInactiveSnapRectToCompare.rectangle; if (!movingRect.intersects(mInactiveRectToCompare)) { //Only compare if Inactive Rect and moving rect do not overlap. - //TODO: Move the above check to another function... - // X - Direction Snapping + // Horizontal - Direction Snapping compareLeftSideOfMovingRectForSnapping(); compareRightSideOfMovingRectForSnapping(); - // Y - Direction Snapping + // Vertical - Direction Snapping compareTopOfMovingRectForSnapping(); compareBottomOfMovingRectForSnapping(); } @@ -212,29 +206,6 @@ } /*! - Check if the center of moving rect is in the snap force in the middle of continer rect. -*/ -void HsSnapToLines::checkForCenterSnapping() -{ - QPointF centerOfContainerRect = mContainerRect.center(); - - QRectF verticalSnapField = QRectF(QPointF(centerOfContainerRect.x() - (mSnapForce/2), mContainerRect.top()), - QPointF(centerOfContainerRect.x() + (mSnapForce/2), mContainerRect.bottom())); - - //Check that the widget lies in the container rect, if the snapping position is proposed... is not required, - //unless some widget is bigger than the page width - QPointF centerOfMovingRect = mMovingRect.center(); - if (verticalSnapField.contains(centerOfMovingRect)) { - mHorizontalSnapFound = true; - mHorizontalSnapPosition = centerOfContainerRect.x() - mActiveRectWidth/2; - mMinVerticalEdgesDistance = qAbs(centerOfContainerRect.x() - centerOfMovingRect.x()); - //save the points for the Vertical line - mVerticalLine.setP1(QPointF(centerOfContainerRect.x(), mMovingRect.top())); - mVerticalLine.setP2(QPointF(centerOfContainerRect.x(), mMovingRect.bottom())); - } -} - -/*! Check if the inactive rect being compared with moving rect lies above or below of moving rect. */ void HsSnapToLines::checkInactiveRectLieAboveOrBelowOfMovingRect() @@ -264,6 +235,81 @@ } } +/*! + Check if the Vertical edges (Left and Right Edges) of the inactive rect being compared + is in range of the snapping distance of the vertical edge of moving rect + \param movingRectVerticalEdgePosition Position of the Vertical edge(either left or right) of moving rect. +*/ +void HsSnapToLines::checkInactiveRectVerticalEdgesInRange(qreal movingRectVerticalEdgePosition) +{ + mLeftInRange = false; + mRightInRange = false; + + //calculate the distance of the moving rect's vertical edge to the inactive rect's left and right edges + mVerticalEdgeToLeftOfInactiveRect = qAbs(mInactiveRectToCompare.left() - movingRectVerticalEdgePosition); + mVerticalEdgeToRightOfInactiveRect = qAbs(mInactiveRectToCompare.right() - movingRectVerticalEdgePosition); + + if (mVerticalEdgeToLeftOfInactiveRect <= mMinVerticalEdgesDistance + && (mRectLieAbove && mInactiveSnapRectToCompare.isLeftSnapableForBelow + || !mRectLieAbove && mInactiveSnapRectToCompare.isLeftSnapableForAbove)) { + mLeftInRange = true; + } + if (mVerticalEdgeToRightOfInactiveRect <= mMinVerticalEdgesDistance + && (mRectLieAbove && mInactiveSnapRectToCompare.isRightSnapableForBelow + || !mRectLieAbove && mInactiveSnapRectToCompare.isRightSnapableForAbove)) { + mRightInRange = true; + } +} + +/*! + Check if this inactive rect is better fit for Horizontal snapping + \param containerVerticalEdgeToInactiveRectVerticalEdge + difference between the vertical edge of the container and same vertical edge of inactive rect + \param containerOtherVerticalEdgeToInactiveRectOtherVerticalEdge + difference between the opposite vertical edges of continer and the inactive rect +*/ +void HsSnapToLines::checkInactiveRectBetterFitForHorizontalSnapping(qreal containerVerticalEdgeToInactiveRectVerticalEdge, + qreal containerOtherVerticalEdgeToInactiveRectOtherVerticalEdge) +{ + //Check if the inactive rect is better fit or if it is inline with already selected position and hence is also a better fit + mIsBetterFitHorizontalSnap = false; + if (mLeftInRange || mRightInRange) { + if (mDistanceVerticalEdges < mMinVerticalEdgesDistance) { + mIsBetterFitHorizontalSnap = true; + } + else if (mDistanceVerticalEdges == mMinVerticalEdgesDistance) { //the distance in the vertical edges is same as from the previously selected rect + //check the position of rect with respect to Vertical line + checkInactiveRectPositionToVerticalLine(); + //if horizontal snap position was previously found and the rect's edge is in line with Vertical line + if (mHorizontalSnapFound && mRectVerticalEdgeLiesInLineWithVerticalLine) { + if (mRectLieAboveVerticalLine || mRectLieBelowVerticalLine) { + extendVerticalLineToIncludeInactiveRect(); + } + } + //here the case is that moving rect lies exactly in middle of two same sides of two different inactive widgets. + else { + //Prioritize first on the fact if the inactive rect is closer to the moving rect in Y - direction. + if (mVerticalDistance < mVerticalDistanceFromSelectedRect) { + mIsBetterFitHorizontalSnap = true; + } + else if (mVerticalDistance == mVerticalDistanceFromSelectedRect) { + //Prioritize next if this Inactive rect's vertical edge is closer to the same vertical edge of the container rect, then the previously selected rect + if (containerVerticalEdgeToInactiveRectVerticalEdge < mContainerVerticalEdgeDistance) { + mIsBetterFitHorizontalSnap = true; + } + //Prioritize next if the Inactive rect's vertical edge lies near to same vertical edge of the container rect than the other pair + else if (containerVerticalEdgeToInactiveRectVerticalEdge < containerOtherVerticalEdgeToInactiveRectOtherVerticalEdge) { + mIsBetterFitHorizontalSnap = true; + } + else { + //This else will happen if this rectangle being compared is exactly the same as the selected rectangle for snapping, but in opposite Y direction. + //In that case it does not matter which is the selected rectangle. Hece we leave the already selected rectangle as the better fit. + } + } + } + } + } +} /*! Check if the left edge of moving rect is snappable to the incative rect's left or right edge. @@ -273,141 +319,80 @@ { checkInactiveRectLieAboveOrBelowOfMovingRect(); - //calculate the distance of the moving rect's left edge to the inactive rect's left and right edges - qreal leftToLeftOfInactiveRect = qAbs(mInactiveRectToCompare.left() - mMovingRect.left()); - qreal leftToRightOfInactiveRect = qAbs(mInactiveRectToCompare.right() - mMovingRect.left()); - mLeftInRange = false; - mRightInRange = false; - - if (leftToLeftOfInactiveRect <= mMinVerticalEdgesDistance) { - if (mRectLieAbove && mInactiveSnapRectToCompare.isLeftSnapableForBelow - || !mRectLieAbove && mInactiveSnapRectToCompare.isLeftSnapableForAbove) { - mLeftInRange = true; - } - } - if (leftToRightOfInactiveRect <= mMinVerticalEdgesDistance) { - if (mRectLieAbove && mInactiveSnapRectToCompare.isRightSnapableForBelow - || !mRectLieAbove && mInactiveSnapRectToCompare.isRightSnapableForAbove) { - mRightInRange = true; - } - } + checkInactiveRectVerticalEdgesInRange(mMovingRect.left()); //calculate the distance of inactive rect's left edge and container rect's left edge qreal differenceContainerLeftEdgeToInactiveRectLeftEdge = mInactiveRectToCompare.left() - mContainerRect.left(); //calculate the distance of inactive rect's right edge and container rect's right edge qreal differenceContainerRightEdgeToInactiveRectRightEdge = mContainerRect.right() - mInactiveRectToCompare.right(); - - qreal minDistancePosition = 0.0; - qreal distanceVerticalEdges = 0.0; qreal xSnapGapAdjustment = 0.0; + mDistanceVerticalEdges = 0.0; + mMinDistancePosition = 0.0; //If only one edge of inactive rect is in snappable range, save that position if ((mLeftInRange && !mRightInRange) || !mLeftInRange && mRightInRange) { if (mLeftInRange) { - minDistancePosition = mInactiveRectToCompare.left(); - distanceVerticalEdges = leftToLeftOfInactiveRect; + mMinDistancePosition = mInactiveRectToCompare.left(); + mDistanceVerticalEdges = mVerticalEdgeToLeftOfInactiveRect; xSnapGapAdjustment = 0.0; } else { - minDistancePosition = mInactiveRectToCompare.right(); - distanceVerticalEdges = leftToRightOfInactiveRect; + mMinDistancePosition = mInactiveRectToCompare.right(); + mDistanceVerticalEdges = mVerticalEdgeToRightOfInactiveRect; xSnapGapAdjustment = mSnapGap; } } //else both edges of inactive rect are in range, check which is a better fit else if (mLeftInRange && mRightInRange) { //if left edge of moving rect to the left of the inactive rect is closer than the left edge of moving rect to the right of the inactive rect - if (leftToLeftOfInactiveRect < leftToRightOfInactiveRect) { - minDistancePosition = mInactiveRectToCompare.left(); - distanceVerticalEdges = leftToLeftOfInactiveRect; + if (mVerticalEdgeToLeftOfInactiveRect < mVerticalEdgeToRightOfInactiveRect) { + mMinDistancePosition = mInactiveRectToCompare.left(); + mDistanceVerticalEdges = mVerticalEdgeToLeftOfInactiveRect; xSnapGapAdjustment = 0.0; mRightInRange = false; } //if the left edge of inactive rect to left of moving rect is at the same distance as the right edge of inactive rect to the right of moving rect - else if (leftToLeftOfInactiveRect == leftToRightOfInactiveRect) { + else if (mVerticalEdgeToLeftOfInactiveRect == mVerticalEdgeToRightOfInactiveRect) { //if inactive rect lies towards the left or middle of container rect, then the left edge is priortized as the selected edge for outside snapping if (differenceContainerLeftEdgeToInactiveRectLeftEdge <= differenceContainerRightEdgeToInactiveRectRightEdge) { - minDistancePosition = mInactiveRectToCompare.left(); - distanceVerticalEdges = leftToLeftOfInactiveRect; + mMinDistancePosition = mInactiveRectToCompare.left(); + mDistanceVerticalEdges = mVerticalEdgeToLeftOfInactiveRect; xSnapGapAdjustment = 0.0; mRightInRange = false; } //else right of the inactive rect lies more close to the right of the container rect, and hence prioritize it for snapping. else { - minDistancePosition = mInactiveRectToCompare.right(); - distanceVerticalEdges = leftToRightOfInactiveRect; + mMinDistancePosition = mInactiveRectToCompare.right(); + mDistanceVerticalEdges = mVerticalEdgeToRightOfInactiveRect; xSnapGapAdjustment = mSnapGap; mLeftInRange = false; } } //else right edge of inactive rect to the left of the moving rect is closer than the left edge of inactive rect to the left of the moving rect else{ - minDistancePosition = mInactiveRectToCompare.right(); - distanceVerticalEdges = leftToRightOfInactiveRect; + mMinDistancePosition = mInactiveRectToCompare.right(); + mDistanceVerticalEdges = mVerticalEdgeToRightOfInactiveRect; xSnapGapAdjustment = mSnapGap; mLeftInRange = false; } } - //Check if this inactive rect is better fit than the previous selected rect for X - snapping - bool horizontalSnappingBetterFit = false; - if (mLeftInRange || mRightInRange) { - if (distanceVerticalEdges < mMinVerticalEdgesDistance) { - horizontalSnappingBetterFit = true; - } - else if (distanceVerticalEdges == mMinVerticalEdgesDistance) { //the distance in the vertical edges is same as from the selected rectangle - //check the position of rect with respect to Vertical line - checkInactiveRectPositionToVerticalLine(); - //if horizontal snap position was previously found the rect's edges are in line with Vertical line - if (mHorizontalSnapFound && mRectVerticalEdgeLiesInLineWithVerticalLine) { - if (mRectLieAboveVerticalLine || mRectLieBelowVerticalLine) { - extendVerticalLineToIncludeInactiveRect(); - } - } - //here the case is that moving rect lies exactly in middle of two same sides of two inactive widgets. - else { - //Prioritize first on the fact if the inactive rect is closer to the moving rect in Y - direction. - if (mVerticalDistance < mVerticalDistanceFromSelectedRect) { - horizontalSnappingBetterFit = true; - } - else if (mVerticalDistance == mVerticalDistanceFromSelectedRect) { - //Prioritize next if this Inactive rect is closer to the left edge of the container rect, then the previously selected rect - if (differenceContainerLeftEdgeToInactiveRectLeftEdge < mContainerVerticalEdgeDistance) { - horizontalSnappingBetterFit = true; - } - //Prioritize next if the Inactive widget's left edge lies near to left edge of the container rect - else if (differenceContainerLeftEdgeToInactiveRectLeftEdge < differenceContainerRightEdgeToInactiveRectRightEdge) { - horizontalSnappingBetterFit = true; - } - else { - //This else will happen if this rectangle being compared is exactly the same as the selected rectangle for snapping. - //In that case it does not matter which is the selected rectangle. Hence we leave the already selected rectangle as the better fit. - } - } - } - } - } + //Check if this inactive rect is better fit than the previous selected rect for Horizontal - snapping + checkInactiveRectBetterFitForHorizontalSnapping(differenceContainerLeftEdgeToInactiveRectLeftEdge, + differenceContainerRightEdgeToInactiveRectRightEdge); - if (horizontalSnappingBetterFit) { - qreal proposedRightOfActiveRect = minDistancePosition + xSnapGapAdjustment + mActiveRectWidth; + if (mIsBetterFitHorizontalSnap) { + qreal proposedRightOfActiveRect = mMinDistancePosition + xSnapGapAdjustment + mActiveRectWidth; if (qBound(mContainerRect.left(), proposedRightOfActiveRect, mContainerRect.right()) == proposedRightOfActiveRect) { mHorizontalSnapFound = true; - mHorizontalSnapPosition = minDistancePosition + xSnapGapAdjustment; - mMinVerticalEdgesDistance = distanceVerticalEdges; + mHorizontalSnapPosition = mMinDistancePosition + xSnapGapAdjustment; + mMinVerticalEdgesDistance = mDistanceVerticalEdges; mVerticalDistanceFromSelectedRect = mVerticalDistance; //Save the new distance of the Chosen Rectangle's left edge from Container's left edge mContainerVerticalEdgeDistance = differenceContainerLeftEdgeToInactiveRectLeftEdge; - - if (mRectLieAbove) { - mVerticalLine.setP1(QPointF(minDistancePosition, mInactiveRectToCompare.top())); - mVerticalLine.setP2(QPointF(minDistancePosition, mMovingRect.bottom())); - } - else { - mVerticalLine.setP1(QPointF(minDistancePosition, mInactiveRectToCompare.bottom())); - mVerticalLine.setP2(QPointF(minDistancePosition, mMovingRect.top())); - } + createVerticalLine(); } } } @@ -420,143 +405,96 @@ { checkInactiveRectLieAboveOrBelowOfMovingRect(); - //calculate the distance of the moving rect's right edge to the inactive rect's left and right edges - qreal rightToLeftOfInactiveRect = qAbs(mInactiveRectToCompare.left() - mMovingRect.right()); - qreal rightToRightOfInactiveRect = qAbs(mInactiveRectToCompare.right() - mMovingRect.right()); - mLeftInRange = false; - mRightInRange = false; - - if (rightToLeftOfInactiveRect <= mMinVerticalEdgesDistance) { - if (mRectLieAbove && mInactiveSnapRectToCompare.isLeftSnapableForBelow - || !mRectLieAbove && mInactiveSnapRectToCompare.isLeftSnapableForAbove) { - mLeftInRange = true; - } - } - if (rightToRightOfInactiveRect <= mMinVerticalEdgesDistance) { - if (mRectLieAbove && mInactiveSnapRectToCompare.isRightSnapableForBelow - || !mRectLieAbove && mInactiveSnapRectToCompare.isRightSnapableForAbove) { - mRightInRange = true; - } - } + checkInactiveRectVerticalEdgesInRange(mMovingRect.right()); //calculate the distance of inactive rect's left edge and container rect's left edge qreal differenceContainerLeftEdgeToInactiveRectLeftEdge = mInactiveRectToCompare.left() - mContainerRect.left(); //calculate the distance of inactive rect's right edge and container rect's right edge qreal differenceContainerRightEdgeToInactiveRectRightEdge = mContainerRect.right() - mInactiveRectToCompare.right(); - qreal minDistancePosition = 0.0; - qreal distanceVerticalEdges = 0.0; qreal xSnapGapAdjustment = 0.0; + mDistanceVerticalEdges = 0.0; + mMinDistancePosition = 0.0; //If only one edge of inactive rect is in snappable range, save that position if ((mLeftInRange && !mRightInRange) || !mLeftInRange && mRightInRange) { if (mLeftInRange) { - minDistancePosition = mInactiveRectToCompare.left(); - distanceVerticalEdges = rightToLeftOfInactiveRect; + mMinDistancePosition = mInactiveRectToCompare.left(); + mDistanceVerticalEdges = mVerticalEdgeToLeftOfInactiveRect; xSnapGapAdjustment = mSnapGap; } else { - minDistancePosition = mInactiveRectToCompare.right(); - distanceVerticalEdges = rightToRightOfInactiveRect; + mMinDistancePosition = mInactiveRectToCompare.right(); + mDistanceVerticalEdges = mVerticalEdgeToRightOfInactiveRect; xSnapGapAdjustment = 0.0; } } //else both edges of inactive rect are in range, check which is a better fit else if (mLeftInRange && mRightInRange) { //if right edge of moving rect to the right of the inactive rect is closer than the right edge of moving rect to the left of inactive rect - if (rightToRightOfInactiveRect < rightToLeftOfInactiveRect) { - minDistancePosition = mInactiveRectToCompare.right(); - distanceVerticalEdges = rightToRightOfInactiveRect; + if (mVerticalEdgeToRightOfInactiveRect < mVerticalEdgeToLeftOfInactiveRect) { + mMinDistancePosition = mInactiveRectToCompare.right(); + mDistanceVerticalEdges = mVerticalEdgeToRightOfInactiveRect; xSnapGapAdjustment = 0.0; mLeftInRange = false; } //if the right edge of moving rect to right of inactive rect is at the same distance as the right edge of moving rect to the left of inactive rect - else if (rightToRightOfInactiveRect == rightToLeftOfInactiveRect) { + else if (mVerticalEdgeToRightOfInactiveRect == mVerticalEdgeToLeftOfInactiveRect) { //if inactive rect lies towards the right of container rect, then the right edge is priortized as the selected edge for outside snapping if (differenceContainerRightEdgeToInactiveRectRightEdge < differenceContainerLeftEdgeToInactiveRectLeftEdge ) { - minDistancePosition = mInactiveRectToCompare.right(); - distanceVerticalEdges = rightToRightOfInactiveRect; + mMinDistancePosition = mInactiveRectToCompare.right(); + mDistanceVerticalEdges = mVerticalEdgeToRightOfInactiveRect; xSnapGapAdjustment = 0.0; mLeftInRange = false; } //else left of the inactive rect lies more close to the left or middle of the container rect, and hence prioritize it else { - minDistancePosition = mInactiveRectToCompare.left(); - distanceVerticalEdges = rightToLeftOfInactiveRect; + mMinDistancePosition = mInactiveRectToCompare.left(); + mDistanceVerticalEdges = mVerticalEdgeToLeftOfInactiveRect; xSnapGapAdjustment = mSnapGap; mRightInRange = false; } } //else right edge of moving rect to the left of the inactive rect is closer than the right edge of moving rect to the right of the incoming rect else{ - minDistancePosition = mInactiveRectToCompare.left(); - distanceVerticalEdges = rightToLeftOfInactiveRect; + mMinDistancePosition = mInactiveRectToCompare.left(); + mDistanceVerticalEdges = mVerticalEdgeToLeftOfInactiveRect; xSnapGapAdjustment = mSnapGap; mRightInRange = false; } } //Check if this inactive rect is better fit than the previous selected rect - bool horizontalSnappingBetterFit = false; - if (mLeftInRange || mRightInRange) { - if (distanceVerticalEdges < mMinVerticalEdgesDistance) { - horizontalSnappingBetterFit = true; - } - else if (distanceVerticalEdges == mMinVerticalEdgesDistance) { //the distance in the vertical edge is same as from the selected rectangle - //check the position of rect with respect to Vertical line - checkInactiveRectPositionToVerticalLine(); - //if horizontal snap position was previously found and the rect's edge is in line with Vertical line - if (mHorizontalSnapFound && mRectVerticalEdgeLiesInLineWithVerticalLine) { - if (mRectLieAboveVerticalLine || mRectLieBelowVerticalLine) { - extendVerticalLineToIncludeInactiveRect(); - } - } - //here the case is that moving rect lies exactly in middle of two same sides of two inactive widgets. - else { - //Prioritize first on the fact if the inactive rect is closer to the moving rect in Y - direction. - if (mVerticalDistance < mVerticalDistanceFromSelectedRect) { - horizontalSnappingBetterFit = true; - } - else if (mVerticalDistance == mVerticalDistanceFromSelectedRect) { - //Prioritize next if this Inactive rect is closer to the right edge of the container rect, then the previously selected rect - if (differenceContainerRightEdgeToInactiveRectRightEdge < mContainerVerticalEdgeDistance) { - horizontalSnappingBetterFit = true; - } - //Prioritize next if the Inactive rect's right edge lies near to right edge of the container rect - else if (differenceContainerRightEdgeToInactiveRectRightEdge < differenceContainerLeftEdgeToInactiveRectLeftEdge) { - horizontalSnappingBetterFit = true; - } - else { - //This else will happen if this rectangle being compared is exactly the same as the selected rectangle for snapping, but in opposite Y direction. - //In that case it does not matter which is the selected rectangle. Hece we leave the already selected rectangle as the better fit. - } - } - } - } - } + checkInactiveRectBetterFitForHorizontalSnapping(differenceContainerRightEdgeToInactiveRectRightEdge, + differenceContainerLeftEdgeToInactiveRectLeftEdge); - if (horizontalSnappingBetterFit) { - qreal proposedLeftOfActiveRect = minDistancePosition - mActiveRectWidth - xSnapGapAdjustment; + if (mIsBetterFitHorizontalSnap) { + qreal proposedLeftOfActiveRect = mMinDistancePosition - mActiveRectWidth - xSnapGapAdjustment; if (qBound(mContainerRect.left(), proposedLeftOfActiveRect, mContainerRect.right()) == proposedLeftOfActiveRect) { mHorizontalSnapFound = true; mHorizontalSnapPosition = proposedLeftOfActiveRect; - mMinVerticalEdgesDistance = distanceVerticalEdges; + mMinVerticalEdgesDistance = mDistanceVerticalEdges; mVerticalDistanceFromSelectedRect = mVerticalDistance; //Save the new distance of the Chosen Rectangle's right edge from Container's right edge mContainerVerticalEdgeDistance = differenceContainerRightEdgeToInactiveRectRightEdge; + createVerticalLine(); + } + } +} - if (mRectLieAbove) { - //save the points for the Vertical line - mVerticalLine.setP1(QPointF(minDistancePosition, mInactiveRectToCompare.top())); - mVerticalLine.setP2(QPointF(minDistancePosition, mMovingRect.bottom())); - } - else { - //save the points for the Vertical line - mVerticalLine.setP1(QPointF(minDistancePosition, mInactiveRectToCompare.bottom())); - mVerticalLine.setP2(QPointF(minDistancePosition, mMovingRect.top())); - } - } +/*! + Create the vertical line for horizontal snap guidance +*/ +void HsSnapToLines::createVerticalLine() +{ + if (mRectLieAbove) { + mVerticalLine.setP1(QPointF(mMinDistancePosition, mInactiveRectToCompare.top())); + mVerticalLine.setP2(QPointF(mMinDistancePosition, mMovingRect.bottom())); + } + else { + mVerticalLine.setP1(QPointF(mMinDistancePosition, mInactiveRectToCompare.bottom())); + mVerticalLine.setP2(QPointF(mMinDistancePosition, mMovingRect.top())); } } @@ -590,97 +528,49 @@ } /*! - Check if the top edge of moving rect is snappable to the incative rect's top or bottom edge. - The inactive rect's edge is only chosen if it is a better fit for vertical snapping. + Check if the Horizontal edges (Top and Bottom Edges) of the inactive rect being compared + is in range of the snapping distance of the horizontal edge of moving rect + \param movingRectHorizontalEdgePosition Position of the Horizontal edge(either top or bottom) of moving rect. */ -void HsSnapToLines::compareTopOfMovingRectForSnapping() +void HsSnapToLines::checkInactiveRectHorizontalEdgesInRange(qreal movingRectHorizontalEdgePosition) { - //Check if the inactive rect lies to the left or right of the moving rect - checkInactiveRectLieLeftOrRightOfMovingRect(); - - //calculate the distance of the moving rect's top edge to the inactive rect's top and bottom edges - qreal topToTopOfInactiveRect = qAbs(mInactiveRectToCompare.top() - mMovingRect.top()); - qreal topToBottomOfInactiveRect = qAbs(mInactiveRectToCompare.bottom() - mMovingRect.top()); mTopInRange = false; mBottomInRange = false; - if (topToTopOfInactiveRect <= mMinHorizontalEdgesDistance) { + //calculate the distance of the moving rect's horizontal edge to the inactive rect's top and bottom edges + mHorizontalEdgeToTopOfInactiveRect = qAbs(mInactiveRectToCompare.top() - movingRectHorizontalEdgePosition); + mHorizontalEdgeToBottomOfInactiveRect = qAbs(mInactiveRectToCompare.bottom() - movingRectHorizontalEdgePosition); + + if (mHorizontalEdgeToTopOfInactiveRect <= mMinHorizontalEdgesDistance) { if (mRectLieLeft && mInactiveSnapRectToCompare.isTopSnapableForRight || !mRectLieLeft && mInactiveSnapRectToCompare.isTopSnapableForLeft) { mTopInRange = true; } } - if (topToBottomOfInactiveRect <= mMinHorizontalEdgesDistance) { + if (mHorizontalEdgeToBottomOfInactiveRect <= mMinHorizontalEdgesDistance) { if (mRectLieLeft && mInactiveSnapRectToCompare.isBottomSnapableForRight || !mRectLieLeft && mInactiveSnapRectToCompare.isBottomSnapableForLeft) { mBottomInRange = true; } } - - //calculate the distance of inactive rect's top edge and container rect's top edge - qreal differenceContainerTopEdgeToInactiveRectTopEdge = mInactiveRectToCompare.top() - mContainerRect.top(); - //calculate the distance of inactive rect's bottom edge and container rect's bottom edge - qreal differenceContainerBottomEdgeToInactiveRectBottomEdge = mContainerRect.bottom() - mInactiveRectToCompare.bottom(); - qreal minDistancePosition = 0.0; - qreal distanceHorizontalEdges = 0.0; - qreal ySnapGapAdjustment = 0.0; +} - //If only one edge of inactive rect is in snappable range, save that position - if ((mTopInRange && !mBottomInRange) - || !mTopInRange && mBottomInRange) { - if (mTopInRange) { - minDistancePosition = mInactiveRectToCompare.top(); - distanceHorizontalEdges = topToTopOfInactiveRect; - ySnapGapAdjustment = 0.0; - } - else { - minDistancePosition = mInactiveRectToCompare.bottom(); - distanceHorizontalEdges = topToBottomOfInactiveRect; - ySnapGapAdjustment = mSnapGap; - } - } - //else both edges of inactive rect are in range, check which is a better fit - else if (mTopInRange && mBottomInRange) { - //if top edge of moving rect to the top of the inactive rect is closer than the bottom edge of moving rect to the bottom of the inactive rect - if (topToTopOfInactiveRect < topToBottomOfInactiveRect) { - minDistancePosition = mInactiveRectToCompare.top(); - distanceHorizontalEdges = topToTopOfInactiveRect; - ySnapGapAdjustment = 0.0; - mBottomInRange = false; +/*! + Check if this inactive rect is better fit for Vertical snapping + \param containerHorizontalEdgeToInactiveRectHorizontalEdge + difference between the horizontal edge of the container and same horizontal edge of inactive rect + \param containerOtherHorizontalEdgeToInactiveRectOtherHorizontalEdge + difference between the opposite horizontal edges of continer and the inactive rect +*/ +void HsSnapToLines::checkInactiveRectBetterFitForVerticalSnapping(qreal containerHorizontalEdgeToInactiveRectHorizontalEdge, + qreal containerOtherHorizontalEdgeToInactiveRectOtherHorizontalEdge) +{ + mIsBetterFitVerticalSnap = false; + if (mTopInRange || mBottomInRange) { + if (mDistanceHorizontalEdges < mMinHorizontalEdgesDistance) { + mIsBetterFitVerticalSnap = true; } - //if the top edge of moving rect to top of inactive rect is at the same distance as the top edge of moving rect to the bottom of inactive rect - else if (topToTopOfInactiveRect == topToBottomOfInactiveRect) { - //if inactive rect lies towards the top or middle of container rect, then the top edge is priortized as the selected edge for outside snapping - if (differenceContainerTopEdgeToInactiveRectTopEdge <= differenceContainerBottomEdgeToInactiveRectBottomEdge) { - minDistancePosition = mInactiveRectToCompare.top(); - distanceHorizontalEdges = topToTopOfInactiveRect; - ySnapGapAdjustment = 0.0; - mBottomInRange = false; - } - //else bottom of the inactive rect lies more close to the bottom of the container rect, and hence prioritize it for snapping. - else { - minDistancePosition = mInactiveRectToCompare.bottom(); - distanceHorizontalEdges = topToBottomOfInactiveRect; - ySnapGapAdjustment = mSnapGap; - mTopInRange = false; - } - } - //else top edge of moving rect to the bottom of the inactive rect is closer than the top edge of moving rect to the top of the inactive rect - else{ - minDistancePosition = mInactiveRectToCompare.bottom(); - distanceHorizontalEdges = topToBottomOfInactiveRect; - ySnapGapAdjustment = mSnapGap; - mTopInRange = false; - } - } - - //Check if this inactive rect is better fit than the previous selected rect - bool verticalSnappingBetterFit = false; - if (mTopInRange || mBottomInRange) { - if (distanceHorizontalEdges < mMinHorizontalEdgesDistance) { - verticalSnappingBetterFit = true; - } - else if (distanceHorizontalEdges == mMinHorizontalEdgesDistance) { //the distance in the horizontal edge is same as from the selected rectangle + else if (mDistanceHorizontalEdges == mMinHorizontalEdgesDistance) { //the distance in the horizontal edge is same as from the selected rectangle //check the position of rect with respect to horizontal line checkInactiveRectPositionToHorizontalLine(); //if vertical snap position was already found and this rect's horizontal edges lies in line with Horizontal snap line @@ -692,16 +582,16 @@ else { //Prioritize first on the fact if the inactive rect is closer to the moving rect in X - direction. if (mHorizontalDistance < mHorizontalDistanceFromSelectedRect) { - verticalSnappingBetterFit = true; + mIsBetterFitVerticalSnap = true; } else if (mHorizontalDistance == mHorizontalDistanceFromSelectedRect) { //Prioritize next if this Inactive rect is closer to the top edge of the container rect, then the previously selected rect - if (differenceContainerTopEdgeToInactiveRectTopEdge < mContainerHorizontalEdgeDistance) { - verticalSnappingBetterFit = true; + if (containerHorizontalEdgeToInactiveRectHorizontalEdge < mContainerHorizontalEdgeDistance) { + mIsBetterFitVerticalSnap = true; } //Prioritize next if the Inactive widget's top edge lies near to top edge of the container rect - else if (differenceContainerTopEdgeToInactiveRectTopEdge < differenceContainerBottomEdgeToInactiveRectBottomEdge) { - verticalSnappingBetterFit = true; + else if (containerHorizontalEdgeToInactiveRectHorizontalEdge < containerOtherHorizontalEdgeToInactiveRectOtherHorizontalEdge) { + mIsBetterFitVerticalSnap = true; } else { //This else will happen if this rectangle being compared is exactly the same as the selected rectangle for snapping, or in opposite X direction. @@ -712,27 +602,91 @@ } } - if (verticalSnappingBetterFit) { - qreal proposedBottomOfActiveRect = minDistancePosition + mActiveRectHeight + ySnapGapAdjustment; +} + +/*! + Check if the top edge of moving rect is snappable to the incative rect's top or bottom edge. + The inactive rect's edge is only chosen if it is a better fit for vertical snapping. +*/ +void HsSnapToLines::compareTopOfMovingRectForSnapping() +{ + //Check if the inactive rect lies to the left or right of the moving rect + checkInactiveRectLieLeftOrRightOfMovingRect(); + + checkInactiveRectHorizontalEdgesInRange(mMovingRect.top()); + + //calculate the distance of inactive rect's top edge and container rect's top edge + qreal differenceContainerTopEdgeToInactiveRectTopEdge = mInactiveRectToCompare.top() - mContainerRect.top(); + //calculate the distance of inactive rect's bottom edge and container rect's bottom edge + qreal differenceContainerBottomEdgeToInactiveRectBottomEdge = mContainerRect.bottom() - mInactiveRectToCompare.bottom(); + qreal ySnapGapAdjustment = 0.0; + mDistanceHorizontalEdges = 0.0; + mMinDistancePosition = 0.0; + + //If only one edge of inactive rect is in snappable range, save that position + if ((mTopInRange && !mBottomInRange) + || !mTopInRange && mBottomInRange) { + if (mTopInRange) { + mMinDistancePosition = mInactiveRectToCompare.top(); + mDistanceHorizontalEdges = mHorizontalEdgeToTopOfInactiveRect; + ySnapGapAdjustment = 0.0; + } + else { + mMinDistancePosition = mInactiveRectToCompare.bottom(); + mDistanceHorizontalEdges = mHorizontalEdgeToBottomOfInactiveRect; + ySnapGapAdjustment = mSnapGap; + } + } + //else both edges of inactive rect are in range, check which is a better fit + else if (mTopInRange && mBottomInRange) { + //if top edge of moving rect to the top of the inactive rect is closer than the bottom edge of moving rect to the bottom of the inactive rect + if (mHorizontalEdgeToTopOfInactiveRect < mHorizontalEdgeToBottomOfInactiveRect) { + mMinDistancePosition = mInactiveRectToCompare.top(); + mDistanceHorizontalEdges = mHorizontalEdgeToTopOfInactiveRect; + ySnapGapAdjustment = 0.0; + mBottomInRange = false; + } + //if the top edge of moving rect to top of inactive rect is at the same distance as the top edge of moving rect to the bottom of inactive rect + else if (mHorizontalEdgeToTopOfInactiveRect == mHorizontalEdgeToBottomOfInactiveRect) { + //if inactive rect lies towards the top or middle of container rect, then the top edge is priortized as the selected edge for outside snapping + if (differenceContainerTopEdgeToInactiveRectTopEdge <= differenceContainerBottomEdgeToInactiveRectBottomEdge) { + mMinDistancePosition = mInactiveRectToCompare.top(); + mDistanceHorizontalEdges = mHorizontalEdgeToTopOfInactiveRect; + ySnapGapAdjustment = 0.0; + mBottomInRange = false; + } + //else bottom of the inactive rect lies more close to the bottom of the container rect, and hence prioritize it for snapping. + else { + mMinDistancePosition = mInactiveRectToCompare.bottom(); + mDistanceHorizontalEdges = mHorizontalEdgeToBottomOfInactiveRect; + ySnapGapAdjustment = mSnapGap; + mTopInRange = false; + } + } + //else top edge of moving rect to the bottom of the inactive rect is closer than the top edge of moving rect to the top of the inactive rect + else{ + mMinDistancePosition = mInactiveRectToCompare.bottom(); + mDistanceHorizontalEdges = mHorizontalEdgeToBottomOfInactiveRect; + ySnapGapAdjustment = mSnapGap; + mTopInRange = false; + } + } + + //Check if this inactive rect is better fit than the previous selected rect + checkInactiveRectBetterFitForVerticalSnapping(differenceContainerTopEdgeToInactiveRectTopEdge, + differenceContainerBottomEdgeToInactiveRectBottomEdge); + + if (mIsBetterFitVerticalSnap) { + qreal proposedBottomOfActiveRect = mMinDistancePosition + mActiveRectHeight + ySnapGapAdjustment; if (qBound(mContainerRect.top(), proposedBottomOfActiveRect, mContainerRect.bottom()) == proposedBottomOfActiveRect) { mVerticalSnapFound = true; - mVerticalSnapPosition = minDistancePosition + ySnapGapAdjustment; - mMinHorizontalEdgesDistance = distanceHorizontalEdges; + mVerticalSnapPosition = mMinDistancePosition + ySnapGapAdjustment; + mMinHorizontalEdgesDistance = mDistanceHorizontalEdges; mHorizontalDistanceFromSelectedRect = mHorizontalDistance; //Save the new distance of the Chosen Rectangle's top edge from Container's top edge mContainerHorizontalEdgeDistance = differenceContainerTopEdgeToInactiveRectTopEdge; - - if (mRectLieLeft) { - //save the points for the Horizontal line - mHorizontalLine.setP1(QPointF(mInactiveRectToCompare.left(), minDistancePosition)); - mHorizontalLine.setP2(QPointF(mMovingRect.right(), minDistancePosition)); - } - else { - //save the points for the Horizontal line - mHorizontalLine.setP1(QPointF(mInactiveRectToCompare.right(), minDistancePosition)); - mHorizontalLine.setP2(QPointF(mMovingRect.left(), minDistancePosition)); - } + createHorizontalLine(); } } } @@ -747,142 +701,99 @@ checkInactiveRectLieLeftOrRightOfMovingRect(); //calculate the distance of the moving rect's bottom edge to the inactive rect's top and bottom edges - qreal bottomToTopOfInactiveRect = qAbs(mInactiveRectToCompare.top() - mMovingRect.bottom()); - qreal bottomToBottomOfInactiveRect = qAbs(mInactiveRectToCompare.bottom() - mMovingRect.bottom()); - mTopInRange = false; - mBottomInRange = false; - - if (bottomToTopOfInactiveRect <= mMinHorizontalEdgesDistance) { - if (mRectLieLeft && mInactiveSnapRectToCompare.isTopSnapableForRight - || !mRectLieLeft && mInactiveSnapRectToCompare.isTopSnapableForLeft) { - mTopInRange = true; - } - } - if (bottomToBottomOfInactiveRect <= mMinHorizontalEdgesDistance) { - if (mRectLieLeft && mInactiveSnapRectToCompare.isBottomSnapableForRight - || !mRectLieLeft && mInactiveSnapRectToCompare.isBottomSnapableForLeft) { - mBottomInRange = true; - } - } + checkInactiveRectHorizontalEdgesInRange(mMovingRect.bottom()); //calculate the distance of inactive rect's top edge and container rect's top edge qreal differenceContainerTopEdgeToInactiveRectTopEdge = mInactiveRectToCompare.top() - mContainerRect.top(); //calculate the distance of inactive rect's bottom edge and container rect's bottom edge qreal differenceContainerBottomEdgeToInactiveRectBottomEdge = mContainerRect.bottom() - mInactiveRectToCompare.bottom(); - qreal minDistancePosition = 0.0; - qreal distanceHorizontalEdges = 0.0; qreal ySnapGapAdjustment = 0.0; + mDistanceHorizontalEdges = 0.0; + mMinDistancePosition = 0.0; //If only one edge of inactive rect is in snappable range, save that position if ((mTopInRange && !mBottomInRange) || !mTopInRange && mBottomInRange) { if (mTopInRange) { - minDistancePosition = mInactiveRectToCompare.top(); - distanceHorizontalEdges = bottomToTopOfInactiveRect; + mMinDistancePosition = mInactiveRectToCompare.top(); + mDistanceHorizontalEdges = mHorizontalEdgeToTopOfInactiveRect; ySnapGapAdjustment = mSnapGap; } else { - minDistancePosition = mInactiveRectToCompare.bottom(); - distanceHorizontalEdges = bottomToBottomOfInactiveRect; + mMinDistancePosition = mInactiveRectToCompare.bottom(); + mDistanceHorizontalEdges = mHorizontalEdgeToBottomOfInactiveRect; ySnapGapAdjustment = 0.0; } } //else both edges of inactive rect are in range, check which is a better fit else if (mTopInRange && mBottomInRange) { //if bottom edge of moving rect to the bottom of inactive rect is closer than the bottom edge of moving rect to the top of the inactive rect - if (bottomToBottomOfInactiveRect < bottomToTopOfInactiveRect ) { - minDistancePosition = mInactiveRectToCompare.bottom(); - distanceHorizontalEdges = bottomToBottomOfInactiveRect; + if (mHorizontalEdgeToBottomOfInactiveRect < mHorizontalEdgeToTopOfInactiveRect ) { + mMinDistancePosition = mInactiveRectToCompare.bottom(); + mDistanceHorizontalEdges = mHorizontalEdgeToBottomOfInactiveRect; ySnapGapAdjustment = 0.0; mTopInRange = false; } //if bottom edge of moving rect to the bottom of inactive rect is at the same distance as the bottom edge of moving rect to the top of inactive rect - else if (bottomToBottomOfInactiveRect == bottomToTopOfInactiveRect) { + else if (mHorizontalEdgeToBottomOfInactiveRect == mHorizontalEdgeToTopOfInactiveRect) { //if inactive rect lies towards the bottom of container rect, then the bottom edge is priortized as the selected edge for snapping //This is done for outside snapping if (differenceContainerBottomEdgeToInactiveRectBottomEdge < differenceContainerTopEdgeToInactiveRectTopEdge) { - minDistancePosition = mInactiveRectToCompare.bottom(); - distanceHorizontalEdges = bottomToBottomOfInactiveRect; + mMinDistancePosition = mInactiveRectToCompare.bottom(); + mDistanceHorizontalEdges = mHorizontalEdgeToBottomOfInactiveRect; ySnapGapAdjustment = 0.0; mTopInRange = false; } //else top of the inactive rect lies more close to the top of the container rect or at the same distance, and hence prioritize it else { - minDistancePosition = mInactiveRectToCompare.top(); - distanceHorizontalEdges = bottomToTopOfInactiveRect; + mMinDistancePosition = mInactiveRectToCompare.top(); + mDistanceHorizontalEdges = mHorizontalEdgeToTopOfInactiveRect; ySnapGapAdjustment = mSnapGap; mBottomInRange = false; } } //else bottom edge of moving rect to the top of inactive rect is closer than the bottom edge of moving rect to the bottom of the inactive rect else{ - minDistancePosition = mInactiveRectToCompare.top(); - distanceHorizontalEdges = bottomToTopOfInactiveRect; + mMinDistancePosition = mInactiveRectToCompare.top(); + mDistanceHorizontalEdges = mHorizontalEdgeToTopOfInactiveRect; ySnapGapAdjustment = mSnapGap; mBottomInRange = false; } } //Check if this inactive rect is better fit than the previous selected rect - bool verticalSnappingBetterFit = false; - if (mTopInRange || mBottomInRange) { - if (distanceHorizontalEdges < mMinHorizontalEdgesDistance) { - verticalSnappingBetterFit = true; - } - else if (distanceHorizontalEdges == mMinHorizontalEdgesDistance) { //the distance in the horizontal edge is same as from the selected rectangle - //check the position of rect with respect to horizontal line - checkInactiveRectPositionToHorizontalLine(); - //if vertical snap was already found and the horizontal line of rect is in line with horizontal snap line - if (mVerticalSnapFound && mRectHorizontalEdgeLiesInLineWithHorizontalLine) { - if (mRectLieLeftOfHorizontalLine || mRectLiesRightOfHorizontalLine) { - extendHorizontalLineToIncludeInactiveRect(); - } - } - else { - //Prioritize first on the fact if the inactive rect is closer to the moving rect in X - direction. - if (mHorizontalDistance < mHorizontalDistanceFromSelectedRect) { - verticalSnappingBetterFit = true; - } - else if (mHorizontalDistance == mHorizontalDistanceFromSelectedRect) { - //Prioritize next if this Inactive rect is closer to the bottom edge of the container rect, then the previously selected rect - if (differenceContainerBottomEdgeToInactiveRectBottomEdge < mContainerHorizontalEdgeDistance) { - verticalSnappingBetterFit = true; - } - //Prioritize next if the Inactive widget's bottom edge lies near to bottom edge of the container rect - else if (differenceContainerBottomEdgeToInactiveRectBottomEdge < differenceContainerTopEdgeToInactiveRectTopEdge) { - verticalSnappingBetterFit = true; - } - else { - //This else will happen if this rectangle being compared is exactly the same as the selected rectangle for snapping, or in opposite X direction. - //In that case it does not matter which is the selected rectangle. Hence we leave the already selected rectangle as the better fit. - } - } - } - } - } + checkInactiveRectBetterFitForVerticalSnapping(differenceContainerBottomEdgeToInactiveRectBottomEdge, + differenceContainerTopEdgeToInactiveRectTopEdge); - if (verticalSnappingBetterFit) { - qreal proposedTopOfActiveRect = minDistancePosition - mActiveRectHeight - ySnapGapAdjustment; + if (mIsBetterFitVerticalSnap) { + qreal proposedTopOfActiveRect = mMinDistancePosition - mActiveRectHeight - ySnapGapAdjustment; if (qBound(mContainerRect.top(), proposedTopOfActiveRect, mContainerRect.bottom()) == proposedTopOfActiveRect) { mVerticalSnapFound = true; mVerticalSnapPosition = proposedTopOfActiveRect; - mMinHorizontalEdgesDistance = distanceHorizontalEdges; + mMinHorizontalEdgesDistance = mDistanceHorizontalEdges; mHorizontalDistanceFromSelectedRect = mHorizontalDistance; //Save the new distance of the Selected Rectangle's bottom edge from Container's bottom edge mContainerHorizontalEdgeDistance = differenceContainerBottomEdgeToInactiveRectBottomEdge; + createHorizontalLine(); + } + } +} - if (mRectLieLeft) { - //save the points for the Horizontal line - mHorizontalLine.setP1(QPointF(mInactiveRectToCompare.left(), minDistancePosition)); - mHorizontalLine.setP2(QPointF(mMovingRect.right(), minDistancePosition)); - } - else { - //save the points for the Horizontal line - mHorizontalLine.setP1(QPointF(mInactiveRectToCompare.right(), minDistancePosition)); - mHorizontalLine.setP2(QPointF(mMovingRect.left(), minDistancePosition)); - } - } +/*! + Create the horizontal line for vertical snap guidance +*/ +void HsSnapToLines::createHorizontalLine() +{ + if (mRectLieLeft) { + //save the points for the Horizontal line + mHorizontalLine.setP1(QPointF(mInactiveRectToCompare.left(), mMinDistancePosition)); + mHorizontalLine.setP2(QPointF(mMovingRect.right(), mMinDistancePosition)); + } + else { + //save the points for the Horizontal line + mHorizontalLine.setP1(QPointF(mInactiveRectToCompare.right(), mMinDistancePosition)); + mHorizontalLine.setP2(QPointF(mMovingRect.left(), mMinDistancePosition)); } } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/inc/hsapp_defs.h --- a/homescreenapp/inc/hsapp_defs.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/inc/hsapp_defs.h Wed Aug 18 09:40:07 2010 +0300 @@ -42,12 +42,14 @@ inline const QString menuModeType(); inline const QString swTypeKey(); inline const QString javaSwType(); +static const char *const HS_CWRT_APP_TYPE="cwrt"; +static const char *const HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE="wrtwidgetuiplugin"; inline const QString packageTypeName(); inline const QString appSettingsPlugin(); inline const QString groupNameAttributeName(); inline const QString componentIdAttributeName(); inline const QString entryShortName(); -inline const QString appLibActivity(); + // Sort attribute enum HsSortAttribute { NoHsSortAttribute, @@ -71,7 +73,8 @@ RenameContextAction, DeleteContextAction, RemoveFromCollectionContextAction, - AppDetailsContextAction + AppDetailsContextAction, + OpenContextAction }; @@ -86,7 +89,7 @@ const char SNAPENABLED[] = "snapenabled"; const char SNAPFORCE[] = "snapforce"; const char SNAPGAP[] = "snapgap"; -const char SNAPBORDERGAP[] = "snapbordergap"; +const char PAGEMARGIN[] = "pagemargin"; const char SNAPLINEFADEINDURATION[] = "snaplinefadeinduration"; const char SNAPLINEFADEOUTDURATION[] = "snaplinefadeoutduration"; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/inc/hsapp_defs.inl --- a/homescreenapp/inc/hsapp_defs.inl Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/inc/hsapp_defs.inl Wed Aug 18 09:40:07 2010 +0300 @@ -308,15 +308,6 @@ } /*! - \return app lib activity name -*/ -inline const QString appLibActivity() -{ - static const QString key("AppLibMainView"); - return key; -} - -/*! \return homescreen activitity name to open idle iew */ inline const QString activityHsIdleView() @@ -325,5 +316,13 @@ return key; } +/*! + \return homescreen activitity name to open applib iew +*/ +inline const QString activityAppLibMainView() +{ + static const QString key("AppLibMainView"); + return key; +} #endif diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/rom/homescreenapp_core.iby --- a/homescreenapp/rom/homescreenapp_core.iby Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/rom/homescreenapp_core.iby Wed Aug 18 09:40:07 2010 +0300 @@ -20,6 +20,7 @@ // ---- hsapplication -------------------------------------------- +file=ABI_DIR\BUILD_DIR\hsapplicationlauncher.exe PROGRAMS_DIR\hsapplicationlauncher.exe file=ABI_DIR\BUILD_DIR\hsapplication.exe PROGRAMS_DIR\hsapplication.exe data=ZPRIVATE\10003a3f\import\apps\hsapplication_reg.rsc private\10003a3f\import\apps\hsapplication_reg.rsc data=\epoc32\data\z\resource\apps\hsapplication.mif resource\apps\hsapplication.mif @@ -34,6 +35,9 @@ data=ZPRIVATE\20022f35\wallpapers\page\2_landscape.png private\20022f35\wallpapers\page\2_landscape.png data=ZPRIVATE\20022f35\wallpapers\page\3_portrait.png private\20022f35\wallpapers\page\3_portrait.png data=ZPRIVATE\20022f35\wallpapers\page\3_landscape.png private\20022f35\wallpapers\page\3_landscape.png +data=ZPRIVATE\20022f35\wallpapers\originals\car.png private\20022f35\wallpapers\originals\car.png +data=ZPRIVATE\20022f35\wallpapers\originals\shapes.png private\20022f35\wallpapers\originals\shapes.png +data=ZPRIVATE\20022f35\wallpapers\originals\shoes.png private\20022f35\wallpapers\originals\shoes.png // ---- hswidgetuninstaller -------------------------------------------- file=ABI_DIR\BUILD_DIR\hswidgetuninstaller.exe PROGRAMS_DIR\hswidgetuninstaller.exe @@ -53,12 +57,10 @@ data=\epoc32\data\z\resource\qt\plugins\hshomescreenclientplugin.qtplugin resource\qt\plugins\hshomescreenclientplugin.qtplugin data=ZPRIVATE\20022f35\hshomescreenclientplugin.xml private\20022f35\hshomescreenclientplugin.xml -// ---- runtimeplugins -------------------------------------------- + -// -------- hsdefaultruntimeplugin -file=ABI_DIR\BUILD_DIR\hsdefaultruntimeplugin.dll SHARED_LIB_DIR\hsdefaultruntimeplugin.dll -data=ZPRIVATE\20022f35\plugins\runtimeplugins\hsdefaultruntimeplugin.qtplugin private\20022f35\plugins\runtimeplugins\hsdefaultruntimeplugin.qtplugin -data=ZPRIVATE\20022f35\plugins\runtimeplugins\hsdefaultruntimeplugin.xml private\20022f35\plugins\runtimeplugins\hsdefaultruntimeplugin.xml + + // ---- serviceproviders -------------------------------------------- diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/runtimeplugins/hsdefaultruntimeplugin/hsdefaultruntimeplugin.pri --- a/homescreenapp/runtimeplugins/hsdefaultruntimeplugin/hsdefaultruntimeplugin.pri Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -HEADERS += ./inc/hsdefaultruntime.h \ - ./inc/hsdefaultruntimeplugin.h -SOURCES += ./src/hsdefaultruntime.cpp \ - ./src/hsdefaultruntimeplugin.cpp diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/runtimeplugins/hsdefaultruntimeplugin/hsdefaultruntimeplugin.pro --- a/homescreenapp/runtimeplugins/hsdefaultruntimeplugin/hsdefaultruntimeplugin.pro Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = lib -CONFIG += plugin hb mobility -MOBILITY = serviceframework publishsubscribe - -PLUGIN_SUBDIR = /private/20022F35/plugins/runtimeplugins - -include (../../common.pri) - -LIBS += -lhsdomainmodel \ - -lhsutils - -QT += xml sql - -DEPENDPATH += ./inc \ - ./src -INCLUDEPATH += ./inc \ - ../../hsutils/inc \ - ../../hsdomainmodel/inc \ - -symbian: { - TARGET.UID3 = 0x20022F3E - LIBS += -lxqkeycapture -} - - -include(hsdefaultruntimeplugin.pri) diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/runtimeplugins/hsdefaultruntimeplugin/inc/hsdefaultruntime.h --- a/homescreenapp/runtimeplugins/hsdefaultruntimeplugin/inc/hsdefaultruntime.h Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Default implementation of the home screen runtime. -* -*/ - -#ifndef HSDEFAULTRUNTIME_H -#define HSDEFAULTRUNTIME_H - -#include -#include - -#ifdef Q_OS_SYMBIAN -#include -#endif - -#ifndef HSDEFAULTRUNTIMEPLUGIN_UNITTEST - #define TEST_CLASS_FWD - #define TEST_FRIEND -#else - #define TEST_CLASS_FWD class DefaultRuntimePluginTest; - #define TEST_FRIEND friend class DefaultRuntimePluginTest; -#endif - -class HsContentService; -QTM_BEGIN_NAMESPACE -class QValueSpacePublisher; -QTM_END_NAMESPACE - -QTM_USE_NAMESPACE - -TEST_CLASS_FWD - -class HsDefaultRuntime : public QStateMachine -{ - Q_OBJECT - -public: - HsDefaultRuntime(QObject *parent = 0); - ~HsDefaultRuntime(); - -signals: - void event_exit(); - void event_toIdle(); -protected: - bool eventFilter(QObject *watched, QEvent *event); - -private: - Q_DISABLE_COPY(HsDefaultRuntime) - - void registerAnimations(); - void createStatePublisher(); - void createContentServiceParts(); - void createStates(); - void assignServices(); - void updatePSKeys(); - -private slots: - void onIdleStateEntered(); - void onIdleStateExited(); - void activityRequested(const QString &name); - - -private: - HsContentService *mContentService; - - bool mHomeScreenActive; - bool mIdleStateActive; - - QValueSpacePublisher *mPublisher; - -#ifdef Q_OS_SYMBIAN - XqKeyCapture keyCapture; -#endif - - TEST_FRIEND -}; - -#endif diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/runtimeplugins/hsdefaultruntimeplugin/inc/hsdefaultruntimeplugin.h --- a/homescreenapp/runtimeplugins/hsdefaultruntimeplugin/inc/hsdefaultruntimeplugin.h Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Default runtime provider. -* -*/ - -#ifndef HSDEFAULTRUNTIMEPLUGIN_H -#define HSDEFAULTRUNTIMEPLUGIN_H - -#include -#include - -QTM_USE_NAMESPACE - -class HsDefaultRuntimePlugin : public QObject, public QServicePluginInterface -{ - Q_OBJECT - Q_INTERFACES(QtMobility::QServicePluginInterface) - -public: - QObject *createInstance(const QServiceInterfaceDescriptor &descriptor, - QServiceContext *context, - QAbstractSecuritySession *session); -}; - -#endif //HSDEFAULTRUNTIMEPLUGIN_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/runtimeplugins/hsdefaultruntimeplugin/resource/hsdefaultruntimeplugin.xml --- a/homescreenapp/runtimeplugins/hsdefaultruntimeplugin/resource/hsdefaultruntimeplugin.xml Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - hsdefaultruntimeplugin - hsdefaultruntimeplugin - Homescreen Runtime Plugin - - com.nokia.symbian.IHomeScreenRuntime - 1.0 - Default implementation for homescreen runtime - - - diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/runtimeplugins/hsdefaultruntimeplugin/src/hsdefaultruntime.cpp --- a/homescreenapp/runtimeplugins/hsdefaultruntimeplugin/src/hsdefaultruntime.cpp Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,447 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Default implementation of the home screen runtime. -* -*/ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "hsmenueventfactory.h" -#include "homescreendomainpskeys.h" -#include "hsdefaultruntime.h" -#include "hsdatabase.h" -#include "hscontentservice.h" -#include "hsshortcutservice.h" -#include "hsmenueventtransition.h" -#include "hswidgetpositioningonorientationchange.h" -#include "hswidgetpositioningonwidgetadd.h" -#include "hsconfiguration.h" -#include "hstest_global.h" -#include "hswidgetpositioningonwidgetmove.h" - -QTM_USE_NAMESPACE -#define hbApp qobject_cast(qApp) - -#ifdef Q_OS_SYMBIAN -const static Qt::Key applicationKey = Qt::Key_Menu; -#else -const static Qt::Key applicationKey = Qt::Key_Home; -#endif - -namespace -{ - const char KHsRootStateInterface[] = "com.nokia.homescreen.state.HsRootState"; - const char KHsLoadSceneStateInterface[] = "com.nokia.homescreen.state.HsLoadSceneState"; - const char KHsIdleStateInterface[] = "com.nokia.homescreen.state.HsIdleState"; - const char KHsAppLibraryStateInterface[] = "com.nokia.homescreen.state.HsAppLibraryState"; - const char KHsMenuWorkerStateInterface[] = "com.nokia.homescreen.state.HsMenuWorkerState"; - const char KHsBacupRestoreStateInterface[] = "com.nokia.homescreen.state.HsBackupRestoreState"; -} - - -/*! - \class HsDefaultRuntime - \ingroup group_hsdefaultruntimeplugin - \brief Default implementation of the home screen runtime. - Creates an execution context (EC) and populates it with - runtime services. States are loaded from state plugins. - Each state is given an access to the EC. States - are added to a state machine. Finally, the state machine - is started. -*/ - -/*! - Constructs runtime with \a parent as the parent object. -*/ -HsDefaultRuntime::HsDefaultRuntime(QObject *parent) - : QStateMachine(parent), - mContentService(0), - mHomeScreenActive(false), - mIdleStateActive(false), - mPublisher(NULL) -#ifdef Q_OS_SYMBIAN - ,keyCapture() -#endif -{ - HSTEST_FUNC_ENTRY("HS::HsDefaultRuntime::HsDefaultRuntime"); - - HsDatabase *db = new HsDatabase; - db->setConnectionName("homescreen.dbc"); -#ifdef Q_OS_SYMBIAN - db->setDatabaseName("c:/private/20022f35/homescreen.db"); -#else - db->setDatabaseName("private/20022f35/homescreen.db"); -#endif - db->open(); - HsDatabase::setInstance(db); - - HsConfiguration::setInstance(new HsConfiguration); - HsConfiguration::instance()->load(); - - HsWidgetPositioningOnOrientationChange::setInstance( - new HsAdvancedWidgetPositioningOnOrientationChange); - - HsWidgetPositioningOnWidgetAdd::setInstance( - new HsAnchorPointInBottomRight); - - HsWidgetPositioningOnWidgetMove::setInstance( - new HsSnapToLines); - - registerAnimations(); - - createStatePublisher(); - createContentServiceParts(); - createStates(); - assignServices(); - - // create the instance so that singleton is accessible from elsewhere - HsShortcutService::instance(this); - - QCoreApplication::instance()->installEventFilter(this); - - if (hbApp) { // Qt test framework uses QApplication. - connect(hbApp->activityManager(), SIGNAL(activityRequested(QString)), - this, SLOT(activityRequested(QString))); - } - HSTEST_FUNC_EXIT("HS::HsDefaultRuntime::HsDefaultRuntime"); -} - -/*! - Destructor. -*/ -HsDefaultRuntime::~HsDefaultRuntime() -{ - HsWidgetPositioningOnOrientationChange::setInstance(0); - delete mPublisher; -} - -/*! - \fn void HsDefaultRuntime::stopStateMachine() - Emission of this signal initiates a transition to the final state. -*/ - -/*! - \copydoc QObject::eventFilter(QObject *watched, QEvent *event) -*/ -bool HsDefaultRuntime::eventFilter(QObject *watched, QEvent *event) -{ - Q_UNUSED(watched); - - switch (event->type()) { - case QEvent::ApplicationActivate: - qDebug() << "HsDefaultRuntime::eventFilter: QEvent::ApplicationActivate"; -#ifdef Q_OS_SYMBIAN - keyCapture.captureKey(applicationKey); -#endif - mHomeScreenActive = true; - updatePSKeys(); - break; - case QEvent::ApplicationDeactivate: - qDebug() << "HsDefaultRuntime::eventFilter: QEvent::ApplicationDeactivate"; -#ifdef Q_OS_SYMBIAN - keyCapture.cancelCaptureKey(applicationKey); -#endif - mHomeScreenActive = false; - updatePSKeys(); - break; - default: - break; - } - - bool result = QStateMachine::eventFilter(watched, event); - // temporary hack as we should not register twice for events - if (event->type() == QEvent::KeyPress ) { - QKeyEvent* ke = static_cast(event); - // Key_Launch0 should be removed when QT starts to send Key_Menu - result = (ke->key() == applicationKey) || ke->key() == Qt::Key_Launch0; - } - return result; -} - - -/*! - Registers framework animations. -*/ -void HsDefaultRuntime::registerAnimations() -{ - HbIconAnimationManager *manager = HbIconAnimationManager::global(); - manager->addDefinitionFile(QLatin1String("qtg_anim_loading.axml")); -} - -/*! - Creates Home screen state publisher. -*/ -void HsDefaultRuntime::createStatePublisher() -{ - mPublisher = new QValueSpacePublisher(QValueSpace::PermanentLayer, HsStatePSKeyPath); - - if (!mPublisher->isConnected()){ - // No permanent layer available - mPublisher = new QValueSpacePublisher(HsStatePSKeyPath); - } - - mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenInactive); -} - -/*! - Creates content service parts. -*/ -void HsDefaultRuntime::createContentServiceParts() -{ - HSTEST_FUNC_ENTRY("HS::HsDefaultRuntime::createContentServiceParts"); - - mContentService = new HsContentService(this); - - HSTEST_FUNC_EXIT("HS::HsDefaultRuntime::createContentServiceParts"); -} - -/*! - Creates states. -*/ -void HsDefaultRuntime::createStates() -{ - HSTEST_FUNC_ENTRY("HS::HsDefaultRuntime::createStates"); - - QFinalState *finalState = new QFinalState(); - addState(finalState); - - QState *guiRootState = new QState(); - addState(guiRootState); - - guiRootState->addTransition(this, SIGNAL(event_exit()), finalState); - - QServiceManager manager; - - - QObject *loadSceneStateObj = manager.loadInterface(KHsLoadSceneStateInterface); - QState *loadSceneState = qobject_cast(loadSceneStateObj); - loadSceneState->setParent(guiRootState); - loadSceneState->setObjectName(KHsLoadSceneStateInterface); - - QObject *rootStateObj = manager.loadInterface(KHsRootStateInterface); - QState *rootState = qobject_cast(rootStateObj); - rootState->setParent(guiRootState); - rootState->setObjectName(KHsRootStateInterface); - - QObject *idleStateObj = manager.loadInterface(KHsIdleStateInterface); - QState *idleState = qobject_cast(idleStateObj); - idleState->setParent(rootState); - idleState->setObjectName(KHsIdleStateInterface); - connect(idleState, SIGNAL(entered()), SLOT(onIdleStateEntered())); - connect(idleState, SIGNAL(exited()), SLOT(onIdleStateExited())); - - - //menu state - QState *menuParallelState = new QState( - QState::ParallelStates, rootState); - QState *menuRootState = new QState(menuParallelState); - - QObject *appLibraryStateObj = manager.loadInterface(KHsAppLibraryStateInterface); - QState *appLibraryState = qobject_cast(appLibraryStateObj); - appLibraryState->setParent(menuRootState); - appLibraryState->setObjectName(KHsAppLibraryStateInterface); - menuRootState->setInitialState(appLibraryState); - - QHistoryState *historyState = new QHistoryState(rootState); - historyState->setDefaultState(idleState); - - loadSceneState->addTransition( - loadSceneState, SIGNAL(event_history()), historyState); - - QObject *menuWorkerStateObj = manager.loadInterface(KHsMenuWorkerStateInterface); - QState *menuWorkerState = qobject_cast(menuWorkerStateObj); - menuWorkerState->setParent(menuParallelState); - menuWorkerState->setObjectName(KHsMenuWorkerStateInterface); - - connect(appLibraryState, SIGNAL(collectionEntered()), - menuWorkerState, SIGNAL(reset())); - connect(appLibraryState, SIGNAL(allAppsStateEntered ()), - menuWorkerState, SIGNAL(reset())); - connect(appLibraryState, SIGNAL(allCollectionsStateEntered ()), - menuWorkerState, SIGNAL(reset())); - - //Backup/Restore state - QObject *backupRestoreStateObj = manager.loadInterface(KHsBacupRestoreStateInterface); - QState *backupRestoreState = qobject_cast(backupRestoreStateObj); - backupRestoreState->setParent(guiRootState); - backupRestoreState->setObjectName(KHsBacupRestoreStateInterface); - backupRestoreState->addTransition( - backupRestoreState, SIGNAL(event_loadScene()), loadSceneState); - - // root state transitions - idleState->addTransition(idleState, SIGNAL(event_applicationLibrary()), menuRootState); - appLibraryState->addTransition( - appLibraryState, SIGNAL(toHomescreenState()), idleState); - rootState->addTransition(rootState, SIGNAL(event_backupRestore()), backupRestoreState); - // opening shortcut to Application Library - HsMenuEventTransition *idleToAppLibTransition = - new HsMenuEventTransition(HsMenuEvent::OpenApplicationLibrary, - idleState, appLibraryState); - idleState->addTransition(idleToAppLibTransition); - - HsMenuEventTransition *appLibToIdleTransition = - new HsMenuEventTransition( - HsMenuEvent::OpenHomeScreen, appLibraryState, idleState); - appLibraryState->addTransition(appLibToIdleTransition); - - HbMainWindow *window = hbInstance->allMainWindows().first(); - - // key driven transition from idle to menu - QKeyEventTransition *idleToMenuRootTransition = - new QKeyEventTransition( - window, QEvent::KeyPress, applicationKey); - idleToMenuRootTransition->setTargetState(menuRootState); - idleState->addTransition(idleToMenuRootTransition); - // key driven transition from menu to idle - QKeyEventTransition *menuToIdleTransition = - new QKeyEventTransition( - window, QEvent::KeyPress, applicationKey); - menuToIdleTransition->setTargetState(idleState); - menuRootState->addTransition(menuToIdleTransition); - - // transition for Key_Launch0 should be removed - // when OT starts to send Key_Menu (maybe wk14) - QKeyEventTransition *idleToMenuRootTransition2 = - new QKeyEventTransition( - window, QEvent::KeyPress, Qt::Key_Launch0); - idleToMenuRootTransition2->setTargetState(menuRootState); - idleState->addTransition(idleToMenuRootTransition2); - // key driven transition from menu to idle - QKeyEventTransition *menuToIdleTransition2 = - new QKeyEventTransition( - window, QEvent::KeyPress, Qt::Key_Launch0); - menuToIdleTransition2->setTargetState(idleState); - menuRootState->addTransition(menuToIdleTransition2); - // add transition to switch to idle - menuRootState->addTransition( this, SIGNAL(event_toIdle()), idleState); - - // transitions to child states - // opening shortcut to a colleciton - QList collectionStates = - appLibraryState-> - findChildren - ("homescreen.nokia.com/state/applibrarystate/collectionstate"); - qDebug( - "Found %d \"collectionstate\" children for Application Library State", - collectionStates.count()); - if (collectionStates.count()) { - HsMenuEventTransition *idleToCollectionTransition = - new HsMenuEventTransition(HsMenuEvent::OpenCollection, - idleState, collectionStates[0]); - idleState->addTransition(idleToCollectionTransition); - } - - guiRootState->setInitialState(loadSceneState); - setInitialState(guiRootState); - - HSTEST_FUNC_EXIT("HS::HsDefaultRuntime::createStates"); -} - -/*! - Assigns services to states based on value of property HS_SERVICES_REGISTRATION_KEY. -*/ -void HsDefaultRuntime::assignServices() -{ - HSTEST_FUNC_ENTRY("HS::HsDefaultRuntime::assignServices"); - - QList children = findChildren(); - foreach (QState *state, children) { - QList services = state->property(HS_SERVICES_REGISTRATION_KEY).toList(); - foreach (const QVariant &service, services) { - QString name = service.toString(); - qDebug() << "Assign service:" << name << "\n to " << state->objectName(); - if (name == CONTENT_SERVICE_KEY) { - state->setProperty(name.toAscii().data(), qVariantFromValue(mContentService)); - } else if (name == SHORTCUT_SERVICE_KEY) { - state->setProperty(name.toAscii().data(), - qVariantFromValue(HsShortcutService::instance(this))); - } else { - qWarning() << "WARNING: Service " << name << " is unknown"; - } - } - } - - HSTEST_FUNC_EXIT("HS::HsDefaultRuntime::assignServices"); -} - -/*! - Publishes Home screen states via Publish & Subscribe. -*/ -void HsDefaultRuntime::updatePSKeys() -{ - if (!mPublisher){ - createStatePublisher(); - } - - if (mHomeScreenActive && mIdleStateActive){ - qDebug() << "HsDefaultRuntime::updatePSKeys: EHomeScreenIdleState"; - mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenIdleState); - } - else{ - qDebug() << "HsDefaultRuntime::updatePSKeys: EHomeScreenInactive"; - mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenInactive); - } -} - -/*! - Called when state machine is in Idle state. -*/ -void HsDefaultRuntime::onIdleStateEntered() -{ - mIdleStateActive = true; - updatePSKeys(); -} - -/*! - Called when state machine leaves the Idle state. -*/ -void HsDefaultRuntime::onIdleStateExited() -{ - mIdleStateActive = false; - updatePSKeys(); -} - -/*! - Activity requested by another client -*/ -void HsDefaultRuntime::activityRequested(const QString &name) -{ - if (name == appLibActivity()) { - this->postEvent( - HsMenuEventFactory::createOpenAppLibraryEvent(NormalHsMenuMode)); - } - else if (name == groupAppLibRecentView()) { - this->postEvent( - HsMenuEventFactory::createOpenCollectionEvent(0, - collectionDownloadedTypeName())); - } else if (name == activityHsIdleView()) { - emit event_toIdle(); - } -} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/runtimeplugins/hsdefaultruntimeplugin/src/hsdefaultruntimeplugin.cpp --- a/homescreenapp/runtimeplugins/hsdefaultruntimeplugin/src/hsdefaultruntimeplugin.cpp Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Default runtime plugin. -* -*/ - -#include -#include -#include - -#include "hsdefaultruntimeplugin.h" -#include "hsdefaultruntime.h" - -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT - -QObject *HsDefaultRuntimePlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, - QServiceContext *context, - QAbstractSecuritySession *session) -{ - Q_UNUSED(context); - Q_UNUSED(session); - - if (descriptor.interfaceName() == QLatin1String("com.nokia.symbian.IHomeScreenRuntime")) { - return new HsDefaultRuntime(this); - } else { - return 0; - } -} - -Q_EXPORT_PLUGIN2(hsdefaultruntimeplugin, HsDefaultRuntimePlugin) - -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/runtimeplugins/runtimeplugins.pro --- a/homescreenapp/runtimeplugins/runtimeplugins.pro Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = subdirs -SUBDIRS = hsdefaultruntimeplugin diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/serviceproviders/hsmenuserviceprovider/hsmenuserviceprovider.pro --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/hsmenuserviceprovider.pro Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/hsmenuserviceprovider.pro Wed Aug 18 09:40:07 2010 +0300 @@ -23,7 +23,8 @@ DEFINES += MENUSERVICE_LIB -LIBS += -lcaclient +LIBS += -lcaclient \ + -lcasoftwareregistry symbian::TARGET.UID3 = 0x20026FA9 -win32:exportResources(./resource/*.png, resource) +!symbian:exportResources(./resource/*.png, resource) diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsiconsidleloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsiconsidleloader.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,46 @@ +/* + * 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: Menu All Applications state. + * + */ + +#ifndef HSICONSIDLELOADER_H_ +#define HSICONSIDLELOADER_H_ + +#include +#include "hsmenuservice_global.h" + +class QTimer; +class HsMenuItemModel; + + +class HsIconsIdleLoader: public QObject +{ + HS_SERVICE_TEST_FRIEND_CLASS(MenuServiceTest) + + Q_OBJECT +public: + + HsIconsIdleLoader(HsMenuItemModel *model, QObject *parent = 0); + ~HsIconsIdleLoader(); + +private slots: + void processWhenIdle(); + +private: + HsMenuItemModel *mModel; + QTimer *mTimer; +}; + +#endif /* HSICONSIDLELOADER_H_ */ diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuentryremovedhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuentryremovedhandler.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Entry removal handler. +* +*/ + + +#ifndef HS_MENU_ENTRY_REMOVED_HANDLER_H +#define HS_MENU_ENTRY_REMOVED_HANDLER_H + +#include + +#include +#include + +#include "hsmenuservice_global.h" + +class MENUSERVICE_EXPORT HsMenuEntryRemovedHandler: public QObject +{ + Q_OBJECT +public: + HsMenuEntryRemovedHandler( + int entryId, QObject *receiver, const char *callback); + virtual ~HsMenuEntryRemovedHandler(); + +signals: + void notify(); +private slots: + virtual void entryChanged(int entryId, ChangeType changeType); + +private: + void subscribe(int entryId); + +private: + QScopedPointer mNotifier; +}; +#endif diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuitemmodel.h --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuitemmodel.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuitemmodel.h Wed Aug 18 09:40:07 2010 +0300 @@ -27,10 +27,13 @@ #include "hsmenuservice_global.h" #include "hsmenuservice.h" +class CaUninstallNotifier; +class HsIconsIdleLoader; // Class declaration class MENUSERVICE_EXPORT HsMenuItemModel: public CaItemModel { - +HS_SERVICE_TEST_FRIEND_CLASS(MenuServiceTest) +Q_OBJECT public: // Data types @@ -47,6 +50,15 @@ virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; bool newIconNeeded(const QModelIndex &index) const; + void preloadIcons(); +private slots: + void uninstallChange(int componentId, int valueOfProgress); + +private: + HsIconsIdleLoader* mIconsIdleLoader; + CaUninstallNotifier* mUninstallNotifier;//not own + int mComponentId; + QList mIds; }; #endif // HSMENUITEMMODEL_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuservice.h --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuservice.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuservice.h Wed Aug 18 09:40:07 2010 +0300 @@ -40,8 +40,7 @@ // Function declarations static HsMenuItemModel *getAllApplicationsModel( HsSortAttribute sortAttribute = DescendingNameHsSortAttribute); - static HsMenuItemModel *getAllCollectionsModel( - HsSortAttribute sortAttribute = LatestOnTopHsSortAttribute); + static HsMenuItemModel *getAllCollectionsModel(); static HsMenuItemModel *getInstalledModel( HsSortAttribute sortAttribute = DescendingNameHsSortAttribute); static HsMenuItemModel *getCollectionModel(int collectionId, diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuservice_global.h --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuservice_global.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuservice_global.h Wed Aug 18 09:40:07 2010 +0300 @@ -19,7 +19,7 @@ #define HSMENUSERVICE_GLOBAL_H // System includes -#include +#include #ifdef MENUSERVICE_LIB #define MENUSERVICE_EXPORT Q_DECL_EXPORT diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsiconsidleloader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsiconsidleloader.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,59 @@ +/* + * 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: Menu All Applications state. + * + */ + +#include +#include +#include "hsmenuitemmodel.h" +#include "hsiconsidleloader.h" + +/*! + Constructor + \param model with defined icons + \param pointer to parent object + */ +HsIconsIdleLoader::HsIconsIdleLoader(HsMenuItemModel *model, QObject *parent): + QObject(parent), + mModel(model), + mTimer(NULL) +{ + mTimer = new QTimer(this); + connect(mTimer, SIGNAL(timeout()), this, SLOT(processWhenIdle())); + mTimer->start(0); // NOTE: zero for idle +} + +/*! + Destructor + */ +HsIconsIdleLoader::~HsIconsIdleLoader() +{ + mTimer->stop(); +} + +/*! + Preloading icons if idle + \retval void + */ +void HsIconsIdleLoader::processWhenIdle() +{ + const QSize iconSize(mModel->getIconSize()); + for (int i=0; irowCount(); i++) { + QModelIndex idx = mModel->index(i); + mModel->entry(idx)->makeIcon(iconSize); + } + mTimer->stop(); // No more timing +} + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuentryremovedhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuentryremovedhandler.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Photos image fetcher client. +* +*/ + +#include + +#include +#include +#include + +#include "hsmenuentryremovedhandler.h" +/*! + \class HsMenuEntryRemovedHandler + Listens for entry removal notifications and calls a callback. + \ingroup group_hsutils + \brief +*/ + +/*! + Constructor. + \param entryId identifies entry which removal is to be observed. + \param receiver object which \a callback is to be called on requested entry + removal. If \receiver is passed 0 no action will be taken on the entry removal. + \param callback signal or slot that will be called on entry removal. The \a callback + signature should correspond to void (*)(int, ChangeType) signal otherwise + runtime warning will be provided. If \a callback is 0 no action will be + taken on the entry removal. +*/ +HsMenuEntryRemovedHandler::HsMenuEntryRemovedHandler( + int entryId, + QObject *receiver, + const char *callback): + mNotifier(0) +{ + if (receiver != 0 && callback != 0) { + connect(this, SIGNAL(notify()), receiver, callback); + subscribe(entryId); + } +}; + +/*! + Destructor. +*/ +HsMenuEntryRemovedHandler::~HsMenuEntryRemovedHandler() {}; + +/*! + Subscribes the observer for notifications for a given entryId and + makes sure the \a HsMenuEntryRemovedObserver::entryChagned will be called + on any notification for the entry. + \param entryId identifier of the entry to be observed. + +*/ +void HsMenuEntryRemovedHandler::subscribe(int entryId) +{ + // create notifier for a given entryId + CaNotifierFilter filter; + QList entryIds; + entryIds.append(entryId); + filter.setIds(entryIds); + mNotifier.reset(CaService::instance()->createNotifier(filter)); + + connect(mNotifier.data(), + SIGNAL(entryChanged(int, ChangeType)), + this, + SLOT(entryChanged(int, ChangeType)), + Qt::UniqueConnection); +} + + +/*! + Handles notification about entry change + \param entryId ignored as the observer is subscribed for exactly one entry. + \param changeType notified change type. + */ +void HsMenuEntryRemovedHandler::entryChanged(int entryId, + ChangeType changeType) +{ + Q_UNUSED(entryId); // CaNotifier should care about matching id, skip it here + + if (changeType == RemoveChangeType) { + mNotifier.reset(0); + emit notify(); + } +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuitemmodel.cpp --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuitemmodel.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuitemmodel.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -16,9 +16,12 @@ */ #include +#include +#include #include "hsmenuitemmodel.h" #include "hsmenuserviceutils.h" +#include "hsiconsidleloader.h" // Constants const QSize smallIconSize(55, 55); @@ -29,9 +32,15 @@ \param pointer to parent object */ HsMenuItemModel::HsMenuItemModel(const CaQuery &query, QObject *parent) : - CaItemModel(query, parent) + CaItemModel(query, parent), + mIconsIdleLoader(NULL) { setIconSize(smallIconSize); + mComponentId = 0; + mUninstallNotifier = + CaSoftwareRegistry::create()->createUninstallNotifier(); + connect(mUninstallNotifier, SIGNAL(progressChange(int, int)), + this, SLOT(uninstallChange(int, int))); } /*! @@ -39,7 +48,9 @@ */ HsMenuItemModel::~HsMenuItemModel() { - + if (!mIds.isEmpty()) { + mIds.clear(); + } } /*! @@ -77,9 +88,9 @@ } else if (role == Hb::IndexFeedbackRole){ QVariant display = CaItemModel::data(index, Qt::DisplayRole); if (display.type() == QVariant::String){ - variant = display; + variant = QVariant(display.toString().at(0).toUpper());; } else { - variant = QVariant(display.toList().at(0)); + variant = QVariant(display.toList().at(0).toString().at(0).toUpper()); } } else { variant = CaItemModel::data(index, role); @@ -106,3 +117,35 @@ HSMENUTEST_FUNC_EXIT("HsMenuItemModel::newIconNeeded"); return result; } + +/*! + Updating uninstall progress with value for each item + \param componentId Component Id of installed item + \param valueOfProgress % value of current progress + */ +void HsMenuItemModel::uninstallChange(int componentId, int valueOfProgress) +{ + if (componentId!=mComponentId) { + if (!mIds.isEmpty()) { + mIds.clear(); + } + // get items list with same componentID + mIds = CaItemModel::getUninstallingEntriesIds(componentId); + mComponentId = componentId; + } + // update each item with progress value + foreach (int id, mIds) { + CaItemModel::updateProgress(id, valueOfProgress); + } +} + + +/*! + Start preloading icons if idle + \param entry entry representing an item + \retval void + */ +void HsMenuItemModel::preloadIcons() +{ + mIconsIdleLoader = new HsIconsIdleLoader(this, this); +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuservice.cpp --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuservice.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuservice.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -34,7 +34,8 @@ // Initialization of a static member variable. int HsMenuService::mAllCollectionsId = 0; - +const char COLLECTION_TITLE_NAME[] = "title_name"; +const char COLLECTION_SHORT_NAME[] = "short_name"; /*! Returns all applications model \param sortAttribute :: SortAttribute @@ -63,22 +64,16 @@ /*! Returns all collections model - \param sortAttribute :: SortAttribute - \param details : switch to return details or not \retval HsMenuItemModel: all collections model */ -HsMenuItemModel *HsMenuService::getAllCollectionsModel( - HsSortAttribute sortAttribute) +HsMenuItemModel *HsMenuService::getAllCollectionsModel() { - qDebug() << "HsMenuService::getAllCollectionsModel" << "sortAttribute:" - << sortAttribute; + qDebug() << "HsMenuService::getAllCollectionsModel"; HSMENUTEST_FUNC_ENTRY("HsMenuService::getAllCollectionsModel"); CaQuery query; query.setParentId(allCollectionsId()); query.setFlagsOn(VisibleEntryFlag); query.setFlagsOff(MissingEntryFlag); - query.setSort(HsMenuServiceUtils::sortBy(sortAttribute), - HsMenuServiceUtils::sortOrder(sortAttribute)); HsMenuItemModel *model = new HsMenuCollectionsItemModel(query); HSMENUTEST_FUNC_EXIT("HsMenuService::getAllCollectionsModel"); return model; @@ -276,6 +271,8 @@ << collection; collection->setText(newCollectionName); + collection->setAttribute(COLLECTION_TITLE_NAME, newCollectionName); + collection->setAttribute(COLLECTION_SHORT_NAME, newCollectionName); result = CaService::instance()->updateEntry(*collection); } HSMENUTEST_FUNC_EXIT("HsMenuService::renameCollection"); diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/sis/homescreenapp.pkg --- a/homescreenapp/sis/homescreenapp.pkg Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/sis/homescreenapp.pkg Wed Aug 18 09:40:07 2010 +0300 @@ -59,13 +59,6 @@ "/epoc32/release/armv5/urel/hsdomainmodel.dll" - "c:/sys/bin/hsdomainmodel.dll" -; ---- runtimeplugins -------------------------------------------- - -; -------- hsdefaultruntimeplugin -"/epoc32/release/armv5/urel/hsdefaultruntimeplugin.dll" - "c:/sys/bin/hsdefaultruntimeplugin.dll" -"/epoc32/data/z/hsresources/plugins/runtimeplugins/hsdefaultruntimeplugin.qtplugin" - "c:/hsresources/plugins/runtimeplugins/hsdefaultruntimeplugin.qtplugin" -"/epoc32/data/z/hsresources/plugins/runtimeplugins/hsdefaultruntimeplugin.manifest" - "c:/hsresources/plugins/runtimeplugins/hsdefaultruntimeplugin.manifest" - ; ---- serviceproviders -------------------------------------------- ; -------- hsmenuserviceprovider diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/sis/homescreenapp_ut_hs.pkg --- a/homescreenapp/sis/homescreenapp_ut_hs.pkg Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/sis/homescreenapp_ut_hs.pkg Wed Aug 18 09:40:07 2010 +0300 @@ -33,16 +33,14 @@ "/epoc32/release/armv5/urel/t_hsapplicationexe.exe" - "c:/sys/bin/t_hsapplicationexe.exe" "/epoc32/data/z/private/10003a3f/import/apps/t_hsapplicationexe_reg.rsc" - "c:/private/10003a3f/import/apps/t_hsapplicationexe_reg.rsc" "/epoc32/data/z/resource/apps/t_hsapplicationexe.rsc" - "c:/resource/apps/t_hsapplicationexe.rsc" -"/epoc32/release/armv5/urel/mockruntimeplugin.dll" - "c:/sys/bin/mockruntimeplugin.dll" -"/epoc32/data/z/private/20022f5f/hsresources/plugins/runtimeplugins/mockruntimeplugin.qtplugin" - "c:/private/20022f5f/hsresources/plugins/runtimeplugins/mockruntimeplugin.qtplugin" -"/epoc32/data/z/private/20022f5f/hsresources/plugins/runtimeplugins/mockruntimeplugin.xml" - "c:/private/20022f5f/hsresources/plugins/runtimeplugins/mockruntimeplugin.xml" +"/epoc32/release/armv5/urel/mockstateplugins.dll" - "c:/sys/bin/mockstateplugins.dll" +"/epoc32/data/z/private/20022f5f/hsresources/plugins/stateplugins/mockstateplugins.qtplugin" - "c:/private/20022f5f/hsresources/plugins/stateplugins/mockstateplugins.qtplugin" +"/epoc32/data/z/private/20022f5f/hsresources/plugins/stateplugins/mockstateplugins.xml" - "c:/private/20022f5f/hsresources/plugins/stateplugins/mockstateplugins.xml" ;--------------- hsutils --------------- "/epoc32/release/armv5/urel/t_hsutils.exe" - "c:/sys/bin/t_hsutils.exe" "/epoc32/data/z/private/10003a3f/import/apps/t_hsutils_reg.rsc" - "c:/private/10003a3f/import/apps/t_hsutils_reg.rsc" "/epoc32/data/z/resource/apps/t_hsutils.rsc" - "c:/resource/apps/t_hsutils.rsc" -"../hsutils/tsrc/t_hsutils/nokia.png" - "c:/hsresources/testresources/nokia.png" -"../hsutils/tsrc/t_hsutils/large.jpg" - "c:/hsresources/testresources/large.jpg" ;--------------- hsdomainmodel --------------- "/epoc32/release/armv5/urel/t_hsdomainmodel.exe" - "c:/sys/bin/t_hsdomainmodel.exe" @@ -69,15 +67,10 @@ "/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoobig.qtplugin" - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoobig.qtplugin" "/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoobig.xml" - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoobig.xml" +"/epoc32/release/armv5/urel/mockwidgetplugincheater.dll" - "c:/sys/bin/mockwidgetplugincheater.dll" +"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugincheater.qtplugin" - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugincheater.qtplugin" +"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugincheater.xml" - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugincheater.xml" -;--------------- runtimeplugins --------------- -;hsdefaultruntimeplugin -"/epoc32/release/armv5/urel/t_hsdefaultruntimeplugin.exe" - "c:/sys/bin/t_hsdefaultruntimeplugin.exe" -"/epoc32/data/z/private/10003a3f/import/apps/t_hsdefaultruntimeplugin_reg.rsc" - "c:/private/10003a3f/import/apps/t_hsdefaultruntimeplugin_reg.rsc" -"/epoc32/data/z/resource/apps/t_hsdefaultruntimeplugin.rsc" - "c:/resource/apps/t_hsdefaultruntimeplugin.rsc" -"/epoc32/release/armv5/urel/mockstateplugins.dll" - "c:/sys/bin/mockstateplugins.dll" -"/epoc32/data/z/private/20022f63/hsresources/plugins/stateplugins/mockstateplugins.qtplugin" - "c:/private/20022f63/hsresources/plugins/stateplugins/mockstateplugins.qtplugin" -"/epoc32/data/z/private/20022f63/hsresources/plugins/stateplugins/mockstateplugins.xml" - "c:/private/20022f63/hsresources/plugins/stateplugins/mockstateplugins.xml" ;--------------- serviceproviders --------------- @@ -102,9 +95,9 @@ ;--------------- hshomescreenclientplugin ----------------------- ;hshomescreenclientplugin -;"/epoc32/release/armv5/urel/t_hshomescreenclientplugin.exe" - "c:/sys/bin/t_hshomescreenclientplugin.exe" -;"/epoc32/data/z/private/10003a3f/import/apps/t_hshomescreenclientplugin_reg.rsc" - "c:/private/10003a3f/import/apps/t_hshomescreenclientplugin_reg.rsc" -;"/epoc32/data/z/resource/apps/t_hshomescreenclientplugin.rsc" - "c:/resource/apps/t_hshomescreenclientplugin.rsc" +"/epoc32/release/armv5/urel/t_hshomescreenclientplugin.exe" - "c:/sys/bin/t_hshomescreenclientplugin.exe" +"/epoc32/data/z/private/10003a3f/import/apps/t_hshomescreenclientplugin_reg.rsc" - "c:/private/10003a3f/import/apps/t_hshomescreenclientplugin_reg.rsc" +"/epoc32/data/z/resource/apps/t_hshomescreenclientplugin.rsc" - "c:/resource/apps/t_hshomescreenclientplugin.rsc" ;--------------- hswidgetuninstaller ----------------------- ;hswidgetuninstaller diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/conf/CI_hsapplibrary.confml Binary file homescreenapp/stateplugins/hsapplibrarystateplugin/conf/CI_hsapplibrary.confml has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary.confml Binary file homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary.confml has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary.implml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary.implml Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary_20022F97.crml Binary file homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary_20022F97.crml has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrary.qm Binary file homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrary.qm has changed diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrary.ts --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrary.ts Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrary.ts Wed Aug 18 09:40:07 2010 +0300 @@ -9,17 +9,7 @@ qtl_dialog_softkey_2 common button - co - False - - - Heading for the mark mode dialog when selecting one or more apps to be added into a collection. - Select applications - Select applications - qtl_dialog_pri_heading - applib_01, applib_05, applib_09 - title - ap + common False @@ -29,7 +19,7 @@ qtl_menu_sec common opt - co + common False @@ -37,19 +27,9 @@ View installed applications View installed applications qtl_menu_pri - applib_03 + applib_01 opt - ap - False - - - Item specific menu item for an item showing the dowload progress. Resumes the download progress (toggles between the Pause command in the item menu) - Resume - Resume - qtl_menu_sec - applib_05 - menu - ap + applib False @@ -59,17 +39,7 @@ qtl_menu_pri applib_03, applib_09 opt - ap - False - - - Sub-menu item. Sorts by default order or user's own order when user has organised the list - Custom - Custom - qtl_menu_sec_add - applib_03, applib_09 - opt_3_sub - ap + applib False @@ -79,7 +49,17 @@ qtl_menu_sec_add applib_01, applib_03, applib_05, applib_07, applib_09 opt_3_sub - ap + applib + False + + + Sorting submenu item in Downloaded collection + Oldest on top + Oldest on top + qtl_menu_sec_add + applib_05 + opt_3_sub + applib False @@ -89,27 +69,17 @@ qtl_dialog_softkey_2 common button - co + common False - - Sub-menu item. Sorts by installation time, latest first (default sort). - Latest on top - Latest on top - qtl_menu_sec_add - applib_05 - opt_3_sub - ap - False - - - Confirmation note for deleting a collection that has no shortcuts on Home Screen. - Delete %1? - Delete %1? - qtl_dialog_pri3 - applib_03, applib_09 - dialog - ap + + Second part of the confirmation note displayed if the user tries to delete an application that actually includes more than one application. + Following applications will be removed: + Following applications will be removed: + qtl_dialog_pri5 + applib_29 + info + applib False @@ -122,7 +92,7 @@ qtl_list_sec_large_graphic applib_03 dblist_1_val - ap + applib False @@ -132,27 +102,27 @@ qtl_menu_pri common opt - co + common False - - First option in a dialogue where user selects the target collection for an item. Opens an input field to name the new collection. - New collection - New collection - qtl_list_popup_pri_graphic - applib_01, applib_05, applib_09 - list - ap + + Sorting submenu item in Downloaded view + Latest on top + Latest on top + qtl_menu_sec_add + applib_05 + opt_3_sub + applib False - - Confirmation note for deleting a collection, operation also deletes possible shortcuts on Home Screen. - Deletes %1 also from Home Screen. Continue? - Deletes %1 also from Home Screen. Continue? - qtl_dialog_pri5 - applib_03, applib_09 + + Shown in text entry of installed app in installation log dialog + Installed + Installed + qtl_dialog_sec + applib_20 dialog - ap + applib False @@ -162,7 +132,7 @@ qtl_menu_sec common menu - co + common False @@ -172,17 +142,27 @@ qtl_menu_sec_add applib_01, applib_03, applib_05, applib_07, applib_09 opt_3_sub - ap + applib + False + + + Confirmation note displayed if the user tries to delete an application. %1 is the application name. + Delete %1 and associated data? + Delete %1 and associated data? + qtl_dialog_pri5 + applib_29 + info + applib False Confirmation note for uninstalling an application or a widget that does not have shortcuts on HS or in collections. %1 will be removed from phone. Continue? %1 will be removed from phone. Continue? - qtl_dialog_pri5 - applib_01, applib_05, applib_07, applib_09 - dialog - ap + qtl_dialog_pri5_large_graphic + applib_27 + info + applib False @@ -192,7 +172,357 @@ qtl_menu_pri applib_09 opt - ap + applib + False + + + Name label shown in application details dialog + Name: + Name: + qtl_dialog_sec + applib_17 + dialog + applib + False + + + Size field in app details dialog. App size shown in megabytes, shown after Size-label. + %L1 MB + %L1 MB + qtl_dialog_sec + applib_17 + dialog + applib + False + + + Button in widget preview dialog + Add to Homescreen + Add to Homescreen + qtl_dialog_softkey_2 + applib_13 + button + applib + False + + + Shown after "Memory in use" header in Application details dialog + %1: Mass storage + %1: Mass storage + qtl_dialog_sec + applib_17 + dialog + applib + False + + + Sub-menu item. Sorts by installation time in the Downloaded collection (latest first, default sort) + Installation time + Installation time + qtl_menu_sec_add + applib_05 + opt_3_sub + applib + False + + + Confirmation note displayed if the user tries to delete an application that actually includes more than one application, which has shortcuts. %1 is the application name. + Delete %1, all it's shortcuts and associated data? + Delete %1, all it's shortcuts and associated data? + qtl_dialog_pri5 + applib_29 + info + applib + False + + + List text shown on application item when the app is being uninstalled. %1 is the app name + Uninstalling %1 + Uninstalling %1 + qtl_list_pri_large_graphic + applib_21 + dblist_1 + applib + False + + + Title for all Application library views + Applications + Applications + qtl_titlebar + applib + title + applib + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Erases something completely from the phone, list, or memory card, for example. Delete should only be used when something in removed permanently. + Delete + Delete + qtl_menu_sec + common + menu + common + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Allows user to rename the selected item (file, folder, music track, image etc.). + Rename + Rename + qtl_menu_sec + common + menu + common + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Cancels the ongoing download. + Cancel download + Cancel download + qtl_menu_sec + common + menu + common + False + + + Heading for the Arrange dialog + Arrange + Arrange + qtl_dialog_pri_heading + applib_16 + title + applib + False + + + Options menu item for viewing installation log + Installation log + Installation log + qtl_menu_pri + applib_07 + opt + applib + False + + + Options list item. Opens sublist for sorting criteria + Sort by + Sort by + qtl_menu_pri_add + applib_01, applib_03, applib_05, applib_07, applib_09 + opt_3 + applib + False + + + Sub-menu item. Sorts by installation time, oldest first. + Oldest on top + Oldest on top + qtl_menu_sec_add + applib_05 + opt_3_sub + applib + False + + + Options menu item. Opens the Task Switcher application. (Same command in Home Screen Options menu.) + Task Switcher + Task Switcher + qtl_menu_pri + applib_01, applib_03, applib_05, applib_07, applib_09, applib_11 + opt + applib + False + + + Text shown in widget preview dialog if no preview is available + (No preview available) + (No preview available) + qtl_dialog_pri5 + applib_30 + info + applib + False + + + Item specific menu item for an item showing the dowload progress. Cancels the ongoing installing progress + Cancel installing + Cancel installing + qtl_menu_sec + applib_05 + menu + applib + False + + + Options list item. Allows the user to add one or more applications into a virtual collection. Involves several steps, indicated by the ... at the end of the command. + Add to collection... + Add to collection... + qtl_menu_pri + applib_01 + opt + applib + False + + + Notification dialog shown after content (Widget or App shortcut) has been added from AppLib to Homescreen + Added to Homescreen + Added to Homescreen + qtl_notifdialog_pri + applib_18 + dpophead + applib + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a view where information about the item is given. + Details + Details + qtl_menu_sec + common + menu + common + False + + + Options list item. Launches SW Update application where user can view and select softwares to be updated. + Check software updates + Check software updates + qtl_menu_pri + applib_01 + opt + applib + False + + + Confirmation note displayed if the user tries to delete a java application that is active at the time. + %1 must be closed before deleting. Close now? + %1 must be closed before deleting. Close now? + qtl_dialog_pri5_large_graphic + applib_28 + info + applib + False + + + Default entry text when naming a new collection, where %L1 is the next available number differentiating between otherwise similar collection names. + Collection(%L1) + Collection(%L1) + qtl_list_pri_large_graphic + applib_15 + dialog_1_entry + applib + False + + + Button. Note! Use this text ID only if there are max. two buttons in the dialog. When this button is pressed, the focused item or operation will be selected or accepted. + OK + OK + qtl_dialog_softkey_2 + common + button + common + False + + + Item specific menu item for an item showing the dowload progress. Resumes the download progress (toggles between the Pause command in the item menu) + Resume + Resume + qtl_menu_sec + applib_05 + menu + applib + False + + + Sub-menu item. Sorts by default order or user's own order when user has organised the list + Custom + Custom + qtl_menu_sec_add + applib_03, applib_09 + opt_3_sub + applib + False + + + Sub-menu item. Sorts by installation time, latest first (default sort). + Latest on top + Latest on top + qtl_menu_sec_add + applib_05 + opt_3_sub + applib + False + + + Confirmation note for deleting a collection that has no shortcuts on Home Screen. + Delete %1? + Delete %1? + qtl_dialog_pri5_large_graphic + applib_24 + info + applib + False + + + If lauching an application fails, thie note is shown. %1 is error code. + Launching the application failed (error code %1) + Launching the application failed (error code %1) + qtl_dialog_pri5_large_graphic + applib_31 + info + applib + False + + + Format label of application details dialog. Format can be for example Symbian, Java or Widget + Format: + Format: + qtl_dialog_sec + applib_17 + dialog + applib + False + + + Confirmation note for deleting a collection, operation also deletes possible shortcuts on Home Screen. + Deletes %1 also from Home Screen. Continue? + Deletes %1 also from Home Screen. Continue? + qtl_dialog_pri5_large_graphic + applib_25 + info + applib + False + + + Delete button + Delete + Delete + qtl_dialog_softkey_2 + common + button + common + False + + + Size field in app details dialog. App size shown in kilobytes, shown after Size-label. + %L1 KB + %L1 KB + qtl_dialog_sec + applib_17 + dialog + applib + False + + + Description label of application details dialog. Free-form description of the purpose of the application. + Description: + Description: + qtl_dialog_sec + applib_17 + dialog + applib False @@ -200,9 +530,9 @@ Collection name: Collection name: qtl_dialog_sec - applib_01, applib_05, applib_09 + applib_15 dialog_1 - ap + applib False @@ -212,17 +542,17 @@ qtl_menu_sec common menu - co + common False - - Button in widget preview dialog - Add to Homescreen - Add to Homescreen - qtl_dialog_softkey_2 - applib_12 - button - ap + + Confirmation for a successful operation, app/widget added to a collection. (Use only when user is not inside the target collection.). %1 is the collection name. + Added to collection %1 + Added to collection %1 + qtl_notifdialog_pri2 + applib_32 + dpophead + applib False @@ -232,47 +562,27 @@ qtl_list_sec_large_graphic applib_03 dblist_1_val - ap - False - - - Sub-menu item. Sorts by installation time in the Downloaded collection (latest first, default sort) - Installation time - Installation time - qtl_menu_sec_add - applib_05 - opt_3_sub - ap + applib False - - Title for all Application library views - Applications - Applications - qtl_titlebar - applib - title - ap + + Dialog shown when uninstallation of an application fails + Uninstallation failed + Uninstallation failed + qtl_dialog_pri5_large_graphic + applib_08 + info + applib False - - Item specific menu item. Note! Only use this text ID if there are no icons. Erases something completely from the phone, list, or memory card, for example. Delete should only be used when something in removed permanently. - Delete - Delete - qtl_menu_sec - common - menu - co - False - - - Item specific menu item. Note! Only use this text ID if there are no icons. Allows user to rename the selected item (file, folder, music track, image etc.). - Rename - Rename - qtl_menu_sec - common - menu - co + + Shown in text entry of removed app in installation log dialog + Removed + Removed + qtl_dialog_sec + applib_20 + dialog + applib False @@ -280,39 +590,9 @@ File corrupted, unable to use widget. Delete widget? File corrupted, unable to use widget. Delete widget? qtl_dialog_pri5 - applib_01, applib_05, applib_09 - dialog - ap - False - - - Item specific menu item. Note! Only use this text ID if there are no icons. Cancels the ongoing download. - Cancel download - Cancel download - qtl_menu_sec - common - menu - co - False - - - Heading for the Arrange dialog - Arrange - Arrange - qtl_dialog_pri_heading - applib_03 - title - ap - False - - - Options list item. Opens sublist for sorting criteria - Sort by - Sort by - qtl_menu_pri_add - applib_01, applib_03, applib_05, applib_07, applib_09 - opt_3 - ap + applib_33 + info + applib False @@ -322,7 +602,7 @@ qtl_menu_sec common menu - co + common False @@ -332,37 +612,27 @@ qtl_menu_pri applib_03 opt - ap - False - - - Sub-menu item. Sorts by installation time, oldest first. - Oldest on top - Oldest on top - qtl_menu_sec_add - applib_05 - opt_3_sub - ap + applib False - - Options menu item. Opens the Task Switcher application. (Same command in Home Screen Options menu.) - Task Switcher - Task Switcher - qtl_menu_pri - applib_01, applib_03, applib_05, applib_07, applib_09, applib_11 - opt - ap + + Shown after "Memory in use" header in Application details dialog if the app is installed in memory card without name + %1: Memory card + %1: Memory card + qtl_dialog_sec + applib_17 + dialog + applib False - - Item specific menu item for an item showing the dowload progress. Cancels the ongoing installing progress - Cancel installing - Cancel installing - qtl_menu_sec - applib_05 - menu - ap + + Supplier label of application details dialog + Supplier: + Supplier: + qtl_dialog_sec + applib_17 + dialog + applib False @@ -372,17 +642,47 @@ qtl_menu_pri applib_01, applib_05, applib_09 menu - ap + applib + False + + + Text for empty view when searching and no results are found + No search results + No search results + qtl_dataform_pri + applib_19 + formlabel_1 + applib False - - Options list item. Allows the user to add one or more applications into a virtual collection. Involves several steps, indicated by the ... at the end of the command. - Add to collection... - Add to collection... - qtl_menu_pri - applib_01 - opt - ap + + Size label on application details dialog. Size of the app is shown after this label. + Size: + Size: + qtl_dialog_sec + applib_17 + dialog + applib + False + + + Shown after "Memory in use" header in Application details dialog. %1 is the drive letter and %2 is the user-given + %1: %2 + %1: %2 + qtl_dialog_sec + applib_17 + dialog + applib + False + + + Shown after "Memory in use" header in Application details dialog + %1: Device memory + %1: Device memory + qtl_dialog_sec + applib_17 + dialog + applib False @@ -390,9 +690,19 @@ Add to: Add to: qtl_dialog_pri_heading - applib_01, applib_09 + applib_34 title - ap + applib + False + + + Heading for fullscreen Installation logs dialog + Installation logs + Installation logs + qtl_dialog_pri_heading + applib_20 + title + applib False @@ -402,37 +712,37 @@ qtl_menu_sec applib_01, applib_05, applib_09 menu - ap + applib False - - Item specific menu item. Note! Only use this text ID if there are no icons. Opens a view where information about the item is given. - Details - Details - qtl_menu_sec - common - menu - co + + Text for empty Collection + No content + No content + qtl_dataform_pri + applib_22 + formlabel_1 + applib False - - Options list item. Launches SW Update application where user can view and select softwares to be updated. - Check software updates - Check software updates - qtl_menu_pri - applib_01 - opt - ap + + Button for creating new collection + Create new + Create new + qtl_dialog_softkey_2 + applib_34 + button + applib False Confirmation note for uninstalling an application or a widget that has shortcuts on HS or in collections. %1 and all its shortcuts will be removed from phone. Continue? %1 and all its shortcuts will be removed from phone. Continue? - qtl_dialog_pri5 - applib_01, applib_05, applib_07, applib_09 - dialog - ap + qtl_dialog_pri5_large_graphic + applib_23 + info + applib False @@ -442,7 +752,7 @@ qtl_menu_sec applib_09 menu - ap + applib False @@ -452,37 +762,27 @@ qtl_menu_sec common opt - co - False - - - Confirmation note displayed if the user tries to delete a java application that is active at the time. - %1 must be closed before deleting. Close %1? - %1 must be closed before deleting. Close %1? - qtl_dialog_pri5 - applib_01, applib_05, applib_07, applib_09 - dialog - ap + common False - - Default entry text when naming a new collection, where %L1 is the next available number differentiating between otherwise similar collection names. - Collection(%L1) - Collection(%L1) - qtl_list_pri_large_graphic - applib_01, applib_05, applib_09 - dialog_1_entry - ap + + Memory in use label in application details dialog + Memory in use: + Memory in use: + qtl_dialog_sec + applib_17 + dialog + applib False - - Item specific menu item for an app/widget. adds application/widget to Homescreen - Add to Home Screen - Add to Home Screen - qtl_menu_sec - applib_01, applib_03, applib_05, applib_09 - menu - ap + + Shown in text entry of partially installed app in installation log dialog + Partially installed + Partially installed + qtl_dialog_sec + applib_20 + dialog + applib False @@ -492,7 +792,27 @@ qtl_menu_pri applib_03 opt - ap + applib + False + + + Item specific menu item for an app/widget. adds application/widget to Homescreen + Add to Home Screen + Add to Home Screen + qtl_menu_sec + applib_01, applib_03, applib_05, applib_09 + menu + applib + False + + + Confirmation for removing an app/widget from a collection. Does not delete the item from the device. + Remove %1 from collection? + Remove %1 from collection? + qtl_dialog_pri5 + applib_26 + info + applib False @@ -502,17 +822,27 @@ qtl_groupbox_simple_sec applib_07 subtitle - ap + applib False - - Confirmation for removing an app/widget from a collection. Does not delete the item from the device. - Remove %1 from collection? - Remove %1 from collection? - qtl_dialog_pri5 - applib_09 + + Protection domain label shown in application details dialog. The value of this field is retrieved from the value, not from platform. The value can be one of the following: Operator, Manufacturer, Trusted 3rd party, Untrusted 3rd party. + Protection domain: + Protection domain: + qtl_dialog_sec + applib_17 dialog - ap + applib + False + + + Heading for the mark mode dialog when selecting one or more apps to be added into a collection. + Select items: + Select items: + qtl_dialog_pri_heading + applib_35 + title + applib False @@ -520,29 +850,29 @@ Collection Collection qtl_list_pri_large_graphic - applib_01, applib_05, applib_09 + applib_15 dialog_1_entry - ap + applib False - - Confirmation for a successful operation, app/widget added to a collection. (Use only when user is not inside the target collection.) - Added to collection %1 - Added to collection %1 - qtl_dialog_pri3 - applib_01, applib_03, applib_05, applib_09 - info - ap + + Version label shown in application details dialog + Version: + Version: + qtl_dialog_sec + applib_17 + dialog + applib False - - Button. Note! Use this text ID only if there are max. two buttons in the dialog. When this button is pressed, the focused item or operation will be selected or accepted. - OK - OK - qtl_dialog_softkey_2 - common - button - co + + Header of application details dialog + Details + Details + qtl_dialog_pri_heading + applib_17 + title + applib False diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin.pro --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin.pro Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin.pro Wed Aug 18 09:40:07 2010 +0300 @@ -32,7 +32,7 @@ TARGET.UID3 = 0x20022F97 nft::LIBS += -lhal include(hsapplibrarystateplugin_exports_to_rom.pri) - exists($${EPOCROOT}epoc32/include/platform/mw/XQSettingsManager):LIBS += -lxqsettingsmanager + LIBS += -lxqsettingsmanager } exportResources(./*.qm, resource/qt/translations) RESOURCES = hsapplibrarystateplugin.qrc diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin.qrc --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin.qrc Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin.qrc Wed Aug 18 09:40:07 2010 +0300 @@ -1,6 +1,11 @@ - resource/applibrary.docml + resource/addcontentlabeledview.docml + resource/common_objects.docml + resource/emptylabeledview.docml + resource/labeledlistview.docml + resource/listview.docml + resource/searchview.docml resource/hsapplibrarystateplugin.css diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin_exports_to_rom.pri --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin_exports_to_rom.pri Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin_exports_to_rom.pri Wed Aug 18 09:40:07 2010 +0300 @@ -17,5 +17,7 @@ BLD_INF_RULES.prj_exports += \ "$${LITERAL_HASH}include " \ "conf/hsapplibrary.confml APP_LAYER_CONFML(hsapplibrary.confml)" \ + "conf/CI_hsapplibrary.confml APP_LAYER_CONFML(CI_hsapplibrary.confml)" \ + "conf/hsapplibrary.implml APP_LAYER_CRML(hsapplibrary.implml)" \ "conf/hsapplibrary_20022F97.crml APP_LAYER_CRML(hsapplibrary_20022F97.crml)" diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsaddmodeproxymodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsaddmodeproxymodel.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,58 @@ +/* + * 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: Proxy model for view in add to homescreen mode. + * + */ + +#ifndef HSADDMODEPROXYMODEL_H +#define HSADDMODEPROXYMODEL_H + +#include +#include +#include + +#include "hsmenustates_global.h" + +class CaNotifier; + +class HsAddModeProxyModel : public QSortFilterProxyModel +{ + Q_OBJECT + + HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) + +public: + + HsAddModeProxyModel(QObject *parent = 0); + ~HsAddModeProxyModel(); + void initilizeCwrtWidgetCache(); + +private slots: + + void updateCacheOnAddWidget(const QString &uri, const QVariantHash &preferences); + void updateCacheOnRemoveWidget(const QString &uri, const QVariantHash &preferences); + void updateEntryStatus(const CaEntry &entry, ChangeType changeType); + +private: + + virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; + static int findCwrtWidgetEntryId(const QVariantHash &preferences); + + QHash mCwrtWidgetCache; + CaQuery mQuery; + QScopedPointer mNotifier; +}; + +#endif //HSADDMODEPROXYMODEL_H + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsallappsstate.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsallappsstate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsallappsstate.h Wed Aug 18 09:40:07 2010 +0300 @@ -18,19 +18,15 @@ #ifndef HSALLAPPSSTATE_H #define HSALLAPPSSTATE_H -#include -#include -#include - +#include #include "hsbaseviewstate.h" #include "hsmenumodewrapper.h" + HS_STATES_TEST_CLASS(MenuStatesTest) class HbView; -class HbAction; -class HbMenu; class HbAbstractViewItem; class QPointF; class HsMenuViewBuilder; @@ -52,40 +48,26 @@ signals: void toAppLibraryState(); -public slots: - void scrollToBeginning(); - void collectionsSortOrder(HsSortAttribute sortAttribute); private slots: - bool openTaskSwitcher(); - int checkSoftwareUpdates(); - void listItemActivated(const QModelIndex &index); void addActivated(const QModelIndex &index); - void listItemLongPressed(HbAbstractViewItem *item, const QPointF &coords); void addLongPressed(HbAbstractViewItem *item, const QPointF &coords); void addToCollection(); void openInstalledView(); void ascendingMenuAction(); void descendingMenuAction(); - void stateEntered(); + void normalModeEntered(); void addModeEntered(); - void normalModeEntered(); void stateExited(); void contextMenuAction(HbAction *action); private: void construct(); void setMenuOptions(); void addToHomeScreen(const QModelIndex &index); + void setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags); + private: - HbAction *mSecondarySoftkeyAction; + HsAddModeProxyModel *mAddModeProxyModel; HsSortAttribute mSortAttribute; - HsSortAttribute mCollectionsSortAttribute; - HsMenuView mMenuView; - HsMenuModeWrapper &mMenuMode; - HsMenuItemModel *mAllAppsModel; - HsMainWindow &mMainWindow; - QModelIndex mContextModelIndex; - QPointer mContextMenu; - }; #endif // HSALLAPPSSTATE_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsallcollectionsstate.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsallcollectionsstate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsallcollectionsstate.h Wed Aug 18 09:40:07 2010 +0300 @@ -18,17 +18,11 @@ #ifndef HSALLCOLLECTIONSSTATE_H #define HSALLCOLLECTIONSSTATE_H -#include -#include -#include -#include - #include "hsbaseviewstate.h" -#include "hsmenumodewrapper.h" HS_STATES_TEST_CLASS(MenuStatesTest) -class HbMenu; +class QPointF; class HsMenuViewBuilder; class HbAbstractViewItem; class HbAction; @@ -36,6 +30,7 @@ class HsMenuItemModel; class HsMenuView; class HsMainWindow; +class HsMenuModeWrapper; class HsAllCollectionsState: public HsBaseViewState { @@ -49,24 +44,13 @@ ~HsAllCollectionsState(); protected: signals: - void sortOrderChanged(HsSortAttribute sortAttribute); void toAppLibraryState(); -public slots: - void scrollToBeginning(); private slots: - bool openTaskSwitcher(); - void listItemActivated(const QModelIndex &index); void addActivated(const QModelIndex &index); - void listItemLongPressed(HbAbstractViewItem *item, const QPointF &coords); void addLongPressed(HbAbstractViewItem *item, const QPointF &coords); void createNewCollection(); void createArrangeCollection(); - void customMenuAction(); - void ascendingMenuAction(); - void descendingMenuAction(); - void stateEntered(); - void addModeEntered(); void normalModeEntered(); void normalModeExited(); void stateExited(); @@ -74,15 +58,7 @@ private: void construct(); void setMenuOptions(); -private: - HbAction *mSecondarySoftkeyAction; - HsSortAttribute mSortAttribute; - HsMenuView mMenuView; - HsMenuModeWrapper &mMenuMode; - HsMenuItemModel *mAllCollectionsModel; - HsMainWindow &mMainWindow; - QModelIndex mContextModelIndex; - QPointer mContextMenu; + void setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags); }; #endif // HSALLCOLLECTIONSSTATE_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsapplibrarystate.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsapplibrarystate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsapplibrarystate.h Wed Aug 18 09:40:07 2010 +0300 @@ -84,28 +84,13 @@ private: HsMenuViewBuilder mMenuViewBuilder; - /** - * All Applications state. - * Own. - */ + HsAllAppsState *mAllAppsState; - /** - * Transition to remember last visited child state in Application Library. - * Own. - */ HsMenuModeTransition *mHistoryTransaction; - /** - * All Collections state. - * Own. - */ HsAllCollectionsState *mAllCollectionsState; - /** - * Collection state. - * Own. - */ HsCollectionState *mCollectionState; HsInstalledAppsState *mInstalledAppsState; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsapplibstateutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsapplibstateutils.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,38 @@ +/* + * 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: Utils for application library state plugin. + * + */ + +#ifndef HSAPPLIBSTATEUTILS_H +#define HSAPPLIBSTATEUTILS_H + +#include + +#include "hsmenustates_global.h" + +class CaEntry; + +class HsAppLibStateUtils +{ + HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) + +public: + + static bool isCWRTWidgetOnHomeScreen(const CaEntry *entry); + +}; + +#endif //HSAPPLIBSTATEUTILS_H + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsbaseviewstate.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsbaseviewstate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsbaseviewstate.h Wed Aug 18 09:40:07 2010 +0300 @@ -18,14 +18,23 @@ #ifndef HSBASEVIEWSTATE_H #define HSBASEVIEWSTATE_H -#include +#include +#include +#include #include "hsmenustates_global.h" #include "hsmenuservice.h" #include "hsmenuview.h" + +class HbMenu; +class HbAction; class HbMessageBox; +class HbAbstractViewItem; class CaNotifier; +class HsMenuModeWrapper; +class HsMainWindow; +class HsAddModeProxyModel; HS_STATES_TEST_CLASS(MenuStatesTest) @@ -37,35 +46,56 @@ public: - HsBaseViewState(QState *parent); + HsBaseViewState(HsMainWindow &mainWindow, QState *parent); + HsBaseViewState(HsMainWindow &mainWindow, + HsMenuModeWrapper& menuMode, QState *parent); ~HsBaseViewState(); - + void scrollToBeginning(); + private slots: - void applicationLaunchFailMessageFinished(HbAction*); - + virtual void openAppLibrary(); + protected slots: - void stateExited(); + virtual void stateEntered(); + virtual void stateExited(); + virtual void addModeEntered(); + virtual void addModeExited(); + virtual void normalModeEntered(); + virtual void normalModeExited(); + virtual void launchItem(const QModelIndex &index); + virtual void openCollection(const QModelIndex &index); + virtual void showContextMenu(HbAbstractViewItem *item, const QPointF &coords); + virtual int checkSoftwareUpdates(); + virtual bool openTaskSwitcher(); + virtual void closeContextMenu(); protected: + void initialize(HsMenuViewBuilder &menuViewBuilder, HsStateContext stateContext); void createApplicationLaunchFailMessage(int errorCode,int itemId); - void subscribeForMemoryCardRemove(); - + void defineTransitions(); + +private: + + virtual void setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags) = 0; + virtual void setMenuOptions() = 0; + private: - void construct(); - void cleanUpApplicationLaunchFailMessage(); - -private: + QPointer mApplicationLaunchFailMessage; + +protected: - CaNotifier *mNotifier; - - int mMessageRelatedItemId; - - HbMessageBox *mApplicationLaunchFailMessage; - + HsMenuItemModel *mModel; + QPointer mContextMenu; + QModelIndex mContextModelIndex; + HbAction *mBackKeyAction; + QScopedPointer mMenuView; + HsMenuModeWrapper *mMenuMode; + HsMainWindow &mMainWindow; + HbMenu *mViewOptions; }; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hscollectionstate.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hscollectionstate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hscollectionstate.h Wed Aug 18 09:40:07 2010 +0300 @@ -18,9 +18,8 @@ #ifndef HSCOLLECTIONSTATE_H #define HSCOLLECTIONSTATE_H -#include -#include -#include +#include +#include #include "hsbaseviewstate.h" @@ -30,7 +29,6 @@ class HbAction; class HbMenu; class HbAbstractViewItem; -class QModelIndex; class HsMenuItemModel; class HsMenuModeWrapper; class HsMenuViewBuilder; @@ -46,29 +44,25 @@ HsMainWindow &mainWindow, QState *parent = 0); ~HsCollectionState(); -public slots: - void collectionsSortOrder(HsSortAttribute sortAttribute); protected: void onEntry(QEvent *event); signals: void sortOrderChanged(HsSortAttribute sortAttribute); private slots: - bool openTaskSwitcher(); - void listItemActivated(const QModelIndex &index); - void listItemLongPressed(HbAbstractViewItem *item, const QPointF &coords); void addAppsAction(bool addApps = true); void addCollectionShortcutToHomeScreenAction(); void renameAction(); void deleteAction(); - void backSteppingAction(); void updateLabel(); void stateEntered(); + void stateExited(); void latestOnTopMenuAction(); void oldestOnTopMenuAction(); void contextMenuAction(HbAction *action); void handleEmptyChange(bool empty); void lockSearchButton(bool lock); + void createArrangeCollection(); private: void construct(); @@ -76,20 +70,13 @@ void makeConnect(); void makeDisconnect(); void addElementToHomeScreen(const QModelIndex &index); + void setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags); + void setMenuOptions(); private: HsSortAttribute mSortAttribute; - HsSortAttribute mCollectionsSortAttribute; int mCollectionId; QString mCollectionType; - HsMenuView mMenuView; - HsMenuModeWrapper &mMenuMode; - HbAction *const mSecondarySoftkeyAction; - HsMenuItemModel *mCollectionModel; - HbMenu *mOptions; - QModelIndex mContextModelIndex; - QPointer mContextMenu; - HsMainWindow &mMainWindow; }; #endif // HSCOLLECTIONSTATE_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsinstalledappsstate.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsinstalledappsstate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsinstalledappsstate.h Wed Aug 18 09:40:07 2010 +0300 @@ -18,9 +18,7 @@ #ifndef HSINSTALLEDAPPSSTATE_H #define HSINSTALLEDAPPSSTATE_H -#include -#include -#include +#include #include "hsbaseviewstate.h" @@ -51,15 +49,7 @@ private slots: - bool openTaskSwitcher(); - - void listItemActivated(const QModelIndex &index); - - void listItemLongPressed(HbAbstractViewItem *item, - const QPointF &coords); - - void backAction(); - + void openInstallationLog(); void stateEntered(); void stateExited(); @@ -71,33 +61,8 @@ private: void construct(); - void setMenuOptions(); - -private: - /** - * The View widget. - * Own. - */ - HsMenuView mMenuView; - - /** - * Item Model for the List. - * Own. - */ - HsMenuItemModel *mInstalledAppsModel; - - /** - * Secondary Softkey action. - * Backstepping functionality. - * Own. - */ - HbAction *const mSecondarySoftkeyAction; - - HsMainWindow &mMainWindow; - - QModelIndex mContextModelIndex; - QPointer mContextMenu; + void setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags); }; #endif // HSINSTALLEDAPPSSTATE_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hslistviewitem.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hslistviewitem.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hslistviewitem.h Wed Aug 18 09:40:07 2010 +0300 @@ -19,10 +19,21 @@ #define CUSTOMLISTVIEWITEM_H #include +#include #include "hsmenustates_global.h" -class HbProgressBar; +// TODO: this is only temporary class for show progress bar. +// It should be remove when fix from orbit will be in official platfrom. +class HsProgressBar: public HbProgressBar { +public: + HsProgressBar(QGraphicsItem *parent=0):HbProgressBar(parent) {} + +protected: + void paint ( QPainter * painter, + const QStyleOptionGraphicsItem * option, + QWidget * widget = 0 ); +}; HS_STATES_TEST_CLASS(MenuStatesTest) @@ -33,17 +44,18 @@ explicit HsListViewItem(QGraphicsItem* parent=0); virtual ~HsListViewItem(); - + virtual HbAbstractViewItem* createItem(); virtual void updateChildItems(); + protected: virtual void polish(HbStyleParameters& params); private: - - HbProgressBar *progress; + HsProgressBar *progress; bool isProgress; HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) }; + #endif // CUSTOMLISTVIEWITEM_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmainwindow.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmainwindow.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmainwindow.h Wed Aug 18 09:40:07 2010 +0300 @@ -20,31 +20,20 @@ #include #include +#include "hsmenustates_global.h" -class HsMenuView; -class HsMainWindow: public QObject +HS_STATES_TEST_CLASS(MenuStatesTest) + +class HbView; + +class HsMainWindow { - Q_OBJECT - public: HsMainWindow(); virtual ~HsMainWindow(); - virtual void setCurrentView(const HsMenuView &menuView); - virtual QPixmap grabScreenshot(); - - public slots: - virtual void saveActivity(); - - signals: - void viewIsReady(); - - private: - /* - * not owned - * - */ - QObject* mActivityClient; + virtual void setCurrentView(HbView *view); + }; #endif // HS_MAIN_WINDOW_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuview.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuview.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuview.h Wed Aug 18 09:40:07 2010 +0300 @@ -21,10 +21,12 @@ #include #include #include +#include #include #include #include "hsmenustates_global.h" #include "hsmenuviewbuilder.h" +#include "hssearchview.h" #include "hsapp_defs.h" class QPointF; @@ -32,100 +34,74 @@ class HbView; class HbMainWindow; class HbAction; -class HbAbstractItemView; class HbListView; class HbGroupBox; class HbWidget; -class HbStaticVkbHost; +class HbShrinkingVkbHost; +class HsMainWindow; class HsMenuItemModel; +HS_STATES_TEST_CLASS(MenuStatesTest) -HS_STATES_TEST_CLASS(MenuStatesTest) class HsMenuView: public QObject { Q_OBJECT public: - HsMenuView(HsMenuViewBuilder &builder, HsViewContext viewContext); + HsMenuView(HsMenuViewBuilder &builder, HsStateContext stateContext, + HsMainWindow& mainWindow); ~HsMenuView(); - void setSearchPanelVisible(bool visible); - void setContext(HsViewContext viewContext, - HsOperationalContext context); - HbView *view() const; HbListView *listView() const; - HbPushButton *collectionButton() const; + HbPushButton *contentButton() const; void activate(); void inactivate(); HbGroupBox *viewLabel() const; - void setModel(HsMenuItemModel *model); + void setModel(QAbstractItemModel *model); + QAbstractItemModel *model() const; - + void reset(HsOperationalContext operationalContext); signals: void activated(const QModelIndex &index); void longPressed(HbAbstractViewItem *item, const QPointF &coords); - + void listViewChange(); public slots: - void activatedProxySlot(const QModelIndex &index); - void longPressedProxySlot(HbAbstractViewItem *item, - const QPointF &coords); - void showSearchPanel(); void hideSearchPanel(); void disableSearch(bool disable); - private slots: void scrollToRow(int row, QAbstractItemView::ScrollHint hint = QAbstractItemView::PositionAtTop); - void findItem(QString criteriaStr); - - void vkbOpened(); - void vkbClosed(); private: - QModelIndex firstVisibleItemIndex(const HbListView *view) const; - - void connectSearchPanelSignals(); - void disconnectSearchPanelSignals(); - void connectSearchItemViewsSignals(); - void disconnectSearchItemViewsSignals(); - - void searchFinished(); - void searchBegins(); HbAbstractItemView::ScrollHint convertScrollHint( QAbstractItemView::ScrollHint hint); + void switchBuilderContext(); + void synchronizeCache(); private: - - const HsViewContext mViewContext; HsMenuViewBuilder &mBuilder; - - QModelIndex mSearchViewInitialIndex; - QModelIndex mIndexToScrollAfterSearchDone; - QModelIndex mSearchViewLongPressedIndex; + const HsStateContext mStateContext; + HsOperationalContext mOperationalContext; + HsMainWindow &mMainWindow; - QSortFilterProxyModel *mProxyModel; // owned - - HbView *mView; - HbListView *mListView; - HbGroupBox *mViewLabel; + HbView *mView; // once this is constructed it is not NULL + HbListView *mListView; // may be NULL in some contexts + HbGroupBox *mViewLabel; // may be NULL in some contexts + HbPushButton *mAddContentButton; // may be NULL in some contexts - HbListView *mSearchListView; - HbSearchPanel *mSearchPanel; - HbStaticVkbHost* mVkbHost; - - HbPushButton *mCollectionButton; + QScopedPointer mHsSearchView; HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) }; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuviewbuilder.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuviewbuilder.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuviewbuilder.h Wed Aug 18 09:40:07 2010 +0300 @@ -20,7 +20,9 @@ #include #include +#include #include +#include #include #include #include @@ -31,25 +33,25 @@ class HbGroupBox; class HbLineEdit; class HbListView; -class HbSearchPanel; class HbToolBar; class HbView; class HbWidget; class HbToolBarExtension; class HbPushButton; -enum HsViewContext { - HsAllAppsContext, +enum HsStateContext { + HsAllAppsContext = 0, HsAllCollectionsContext, HsInstalledAppsContext, HsCollectionContext, + InvalidStateContext }; enum HsOperationalContext { - HsItemViewContext, - HsSearchContext, + HsItemViewContext = 0, HsButtonContext, - HsEmptyLabelContext + HsEmptyLabelContext, + InvalidOperationalContext }; HS_STATES_TEST_CLASS(MenuStatesTest) @@ -71,58 +73,53 @@ HbToolBarExtension *toolBarExtension() const; // mandatory context dependent widgets accessors - HbView *currentView() const; - HbListView *currentListView() const; + HbView *currentView(); + HbListView *currentListView(); // optional widgets accessors - HbGroupBox *currentViewLabel() const; - HbSearchPanel *currentSearchPanel() const; - HbPushButton *collectionButton() const; - - - void setViewContext(HsViewContext viewContext); - void setOperationalContext(HsOperationalContext operationalContext); - bool build(); - -private: - void init(); - - bool parseSection(const QString §ionName = QString()); + HbGroupBox *currentViewLabel(); + HbPushButton *currentAddContentButton(); - bool readContextConfiguration(HsViewContext, HsOperationalContext); + void setStateContext(HsStateContext stateContext); + void setOperationalContext(HsOperationalContext operationalContext); + +private: + typedef QPair Context; + typedef QMap > LoaderMap; + + QSharedPointer + parseDocument(const QString &documentBaseName); + + QSharedPointer readContextConfiguration(); + + Context context() const; + + QSharedPointer currentLoader(); - void searchPanelVisibilityChange(bool visible); - - HbLineEdit *searchPanelLineEdit() const; - - QMap mViewContextToStringMap; - QMap mOperationalContextToStringMap; - - HbDocumentLoader mDocumentLoader; QSet mLoadedObjects; - const QString DOCUMENT_FILE_NAME; + const QString ALL_APPS_ACTION_NAME; const QString ALL_COLLECTIONS_ACTION_NAME; const QString SEARCH_ACTION_NAME; const QString OVI_STORE_ACTION_NAME; const QString OPERATOR_ACTION_NAME; - const QString SEARCH_PANEL_NAME; - const QString BUTTON_NAME; - const QString TOOL_BAR_NAME; QActionGroup *mToolBarActionGroup; HbToolBar *mToolBar; HbToolBarExtension *mToolBarExtension; HbAction *mToolBarExtensionAction; - HsViewContext mViewContext; + HsStateContext mStateContext; HsOperationalContext mOperationalContext; HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) + + LoaderMap mLoaderMap; + QSharedPointer mCommonObjectsLoader; }; #endif // HSMENUVIEWBUILDER_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsoperatorhandler.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsoperatorhandler.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsoperatorhandler.h Wed Aug 18 09:40:07 2010 +0300 @@ -23,6 +23,7 @@ #include "hsmenustates_global.h" class HsOperatorHandlerPrivate; +class HbAction; class HsOperatorHandler: public QObject { @@ -33,10 +34,17 @@ public: HsOperatorHandler(QObject *parent = 0); virtual ~HsOperatorHandler(); - HbIcon icon(); + bool operatorStorePresent(); + bool oviStorePresent(); + bool operatorStoreFirst(); + HbAction *prepareOperatorStoreAction( + HbAction *const operatorAction); QString text(); -public slots: +private: + HbIcon icon(); + +private slots: void action(); private: diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsoperatorhandler_p.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsoperatorhandler_p.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsoperatorhandler_p.h Wed Aug 18 09:40:07 2010 +0300 @@ -14,18 +14,17 @@ * Description: Hs Operator Handler Private. * */ - #ifndef HSOPERATORHANDLER_P_H_ #define HSOPERATORHANDLER_P_H_ -#ifndef NO_QT_EXTENSIONS +#ifdef QT_EXTENSIONS #include +#include #include #include "hsmenustates_global.h" class CaEntry; -class XQSettingsManager; class HsOperatorHandlerPrivate: public QObject { @@ -34,23 +33,46 @@ HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) public: + + enum HsStoreType { + NoneType, + UrlType, + ApplicationType + }; + HsOperatorHandlerPrivate(QObject *parent = 0); virtual ~HsOperatorHandlerPrivate(); HbIcon icon(); QString text(); void action(); + bool oviStorePresent(); + bool operatorStorePresent(); + bool operatorStoreFirst(); private: + bool storeValue(XQSettingsManager *crManager, int storePresenceKey); + QVariant getVariantFromKey( + XQSettingsManager *crManager, + int crKey, + XQSettingsManager::Type type); + HsStoreType operatorStoreType(XQSettingsManager *crManager); + void readCentralRepository(); HbIcon createIcon(XQSettingsManager *crManager); - QString readText(XQSettingsManager *crManager); + QString operatorStoreTitle(XQSettingsManager *crManager); CaEntry *createAppEntry(XQSettingsManager *crManager); CaEntry *createUrlEntry(XQSettingsManager *crManager); + bool operatorStoreFirst(XQSettingsManager *crManager); private: + bool mOviStorePresent; + bool mOperatorStorePresent; + HsStoreType mStoreType; CaEntry *mOperatorEntry; HbIcon mIcon; - QString mText; + QString mOperatorStoreTitle; + bool mOperatorStoreFirst; + }; #endif diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hssearchview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hssearchview.h Wed Aug 18 09:40:07 2010 +0300 @@ -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: Search view. + * + */ + +#ifndef HSSEARCHVIEW_H +#define HSSEARCHVIEW_H + +#include +#include + +#include + +#include "hsmenustates_global.h" +#include "hsmenuviewbuilder.h" +#include "hssearchviewbuilder.h" + +class QSortFilterProxyModel; +class HsMainWindow; +class HbAbstractViewItem; +class HbLineEdit; +class HbSearchPanel; + +HS_STATES_TEST_CLASS(MenuStatesTest) + +class HsSearchView : public QObject +{ + Q_OBJECT + + HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) + +public: + + HsSearchView( + HsMenuViewBuilder &builder, + HsStateContext stateContext, + HsMainWindow &mainWindow); + ~HsSearchView(); + + void setSearchPanelVisible(bool visible); +private: + + bool isActive() const; + + QModelIndex firstVisibleItemIndex(const HbListView *view) const; + void searchBegins(); + + void connectSearchItemViewsSignals(); + void disconnectSearchItemViewsSignals(); + + void connectSearchPanelSignals(); + + void disconnectSearchPanelSignals(); + + void searchFinished(); + +signals: + void activated(const QModelIndex &index); + void longPressed(HbAbstractViewItem *item, const QPointF &coords); + +public slots: + void hideSearchPanel(); + +private slots: + void activatedProxySlot(const QModelIndex &index); + void longPressedProxySlot( + HbAbstractViewItem *item, const QPointF &coords); + +private slots: + void findItem(QString criteriaStr); + void setNoResultsVisibility(); + +private: + void setOriginatingContext(); + void initSearchPanel(HbSearchPanel &searchPanel); + HbLineEdit *searchPanelLineEdit(HbSearchPanel &searchPanel) const; + +private: + + QModelIndex mSearchViewInitialIndex; + QModelIndex mIndexToScrollAfterSearchDone; + QModelIndex mSearchViewLongPressedIndex; + QSortFilterProxyModel *mProxyModel; // owned + HbView *mSearchView; + HbListView *mSearchListView; + HbSearchPanel *mSearchPanel; + const HsStateContext mStateContext; + HsOperationalContext mAfterSearchContext; + HsMenuViewBuilder &mBuilder; + HsMainWindow &mMainWindow; + HbListView *mListView; + QScopedPointer mVkbHost; + HsSearchViewBuilder mSearchViewBuilder; + bool mEmptyResultText; + +}; + +#endif /* HSSEARCHVIEW_H_ */ diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hssearchviewbuilder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hssearchviewbuilder.h Wed Aug 18 09:40:07 2010 +0300 @@ -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: Menu View Builder + * + */ + +#ifndef HSSEARCHVIEWBUILDER_H_ +#define HSSEARCHVIEWBUILDER_H_ + +#include +#include "hsmenustates_global.h" + +class HbSearchPanel; +class HbView; +class HbListView; +class HbGroupBox; + +HS_STATES_TEST_CLASS(MenuStatesTest) + +class HsSearchViewBuilder +{ + + HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) + +public: + HsSearchViewBuilder(); + virtual ~HsSearchViewBuilder(); + + HbView *searchView(); + HbListView *searchListView(); + HbSearchPanel *searchPanel(); + HbGroupBox *searchViewLabel(); + void setSearchLabledContext(); + bool loadViewEmptySection(); + bool loadViewListSection(); + +private: + QSet mLoadedObjects; + QSharedPointer mLoader; + bool mLabledContext; +}; + +#endif /* HSSEARCHVIEWBUILDER_H_ */ diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/resource/addcontentlabeledview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/addcontentlabeledview.docml Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/resource/applibrary.docml --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/applibrary.docml Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,509 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/resource/common_objects.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/common_objects.docml Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/resource/emptylabeledview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/emptylabeledview.docml Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/resource/hslistviewitem.widgetml --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/hslistviewitem.widgetml Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/hslistviewitem.widgetml Wed Aug 18 09:40:07 2010 +0300 @@ -1,50 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -74,5 +28,4 @@ - diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/resource/labeledlistview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/labeledlistview.docml Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/resource/listview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/listview.docml Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/resource/searchview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/searchview.docml Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsaddmodeproxymodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsaddmodeproxymodel.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,188 @@ +/* + * 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: Proxy model for view in add to homescreen mode. + * + */ + +#include +#include + +#include "hscontentservice.h" +#include "hsaddmodeproxymodel.h" +#include "hsmenuitemmodel.h" +#include "hsapplibstateutils.h" + +/*! + \class HsAddModeProxyModel + \ingroup group_hsmenustateplugin + \brief Proxy Model for add to homescreen mode. + Filtering cwrt widgets to not displaing them in add mode when they are alredy present on HS. + \lib ?library + \see QSortFilterProxyModel + */ + +/*! + Constructor. + \param parent parent for object. + */ +HsAddModeProxyModel::HsAddModeProxyModel(QObject *parent) : + QSortFilterProxyModel(parent), + mCwrtWidgetCache(), + mQuery() +{ + initilizeCwrtWidgetCache(); + invalidateFilter(); + connect(HsContentService::instance(), + SIGNAL(widgetAdded(const QString &, const QVariantHash &)), + this, SLOT(updateCacheOnAddWidget(const QString&, const QVariantHash&))); + connect(HsContentService::instance(), + SIGNAL(widgetRemoved(const QString &, const QVariantHash &)), + this, SLOT(updateCacheOnRemoveWidget(const QString&, const QVariantHash&))); + // create notifier for a cwrt widgets with query created in initilizeCwrtWidgetCache + CaNotifierFilter filter(mQuery); + mNotifier.reset(CaService::instance()->createNotifier(filter)); + connect(mNotifier.data(), + SIGNAL(entryChanged(const CaEntry&, ChangeType)), + this, + SLOT(updateEntryStatus(const CaEntry&, ChangeType))); +} + +/* + Destructor. + */ +HsAddModeProxyModel::~HsAddModeProxyModel() +{ +} + +void HsAddModeProxyModel::initilizeCwrtWidgetCache() +{ + QStringList entryTypeNames; + entryTypeNames.append(applicationTypeName()); + mQuery.setEntryTypeNames(entryTypeNames); + mQuery.setAttribute(swTypeKey(), HS_CWRT_APP_TYPE); + mQuery.setAttribute(widgetUriAttributeName(), + HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE); + QList< QSharedPointer > entries = + CaService::instance()->getEntries(mQuery); + foreach (QSharedPointer entry, entries) { + QVariantHash preferences; + QMap attributes = entry->attributes(); + QMapIterator i(attributes); + while (i.hasNext()) { + i.next(); + QString key(i.key()); + QString value(i.value()); + if (key.contains(widgetParam())) { + preferences.insert(key.remove(widgetParam()),value); + } + } + int count(0); + HsContentService::instance()->widgets( + HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE,preferences,count); + mCwrtWidgetCache.insert(entry->id(), count > 0); + } + +} + +/*! + Return entryid for given Cwrt with mini view widget. + \param uri of a widget. + \param preferences widget preferences. + \retval int entry id or 0 for not cwrt with mini view widgets. + */ +int HsAddModeProxyModel::findCwrtWidgetEntryId(const QVariantHash &preferences) +{ + int result = 0; + CaQuery query; + QStringList entryTypeNames; + query.setEntryTypeNames(entryTypeNames); + query.setAttribute(swTypeKey(), HS_CWRT_APP_TYPE); + query.setAttribute(widgetUriAttributeName(), + HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE); + foreach (QString key, preferences.keys()) { + query.setAttribute(widgetParam()+key, + preferences.value(key).toString()); + } + QList< QSharedPointer > entries = + CaService::instance()->getEntries(query); + if( entries.count() > 0 ) + { + result = entries[0]->id(); + } + return result; +} + +/* + Slot called when widget is added to homescreen. + If widget is removed we checkhow many instance of this widget is left on HS. + \param uri of a widget. + \param preferences widget preferences. + */ +void HsAddModeProxyModel::updateCacheOnAddWidget(const QString &uri, + const QVariantHash &preferences){ + if (uri == HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE) { + int entryId = findCwrtWidgetEntryId(preferences); + if (!mCwrtWidgetCache.value(entryId) ) { + mCwrtWidgetCache.insert(entryId,true); + invalidateFilter(); + } + } +} + +/* + Slot called when widget is removed from homescreen. + If widget is removed we checkhow many instance of this widget is left on HS. + \param uri of a widget. + \param preferences widget preferences. +*/ +void HsAddModeProxyModel::updateCacheOnRemoveWidget(const QString &uri, + const QVariantHash &preferences) +{ + if (uri == HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE) { + int entryId = findCwrtWidgetEntryId(preferences); + if (mCwrtWidgetCache.value(entryId)) { + mCwrtWidgetCache.insert(entryId,false); + invalidateFilter(); + } + } +} + +/* + Reimplementated from QSortFilterProxyModel. + \param source_row row in source model. + \param source_parent source parent index. + */ +bool HsAddModeProxyModel::filterAcceptsRow(int source_row, + const QModelIndex &source_parent) const +{ + QVariant entryId = sourceModel()->data( + sourceModel()->index(source_row,0,source_parent), + CaItemModel::IdRole); + return !mCwrtWidgetCache.value(entryId.toInt()); +} + +/* + Update cache if some cwrt widgets were install/uninstal/update or on mmc card. + \param entry changed entry. + \param changeType the type of the change. + */ +void HsAddModeProxyModel::updateEntryStatus(const CaEntry &entry, ChangeType changeType) +{ + if (changeType == RemoveChangeType) { + mCwrtWidgetCache.remove(entry.id()); + } else { + mCwrtWidgetCache.insert(entry.id(), + HsAppLibStateUtils::isCWRTWidgetOnHomeScreen(&entry)); + } +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallappsstate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallappsstate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallappsstate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -15,30 +15,29 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include -#include -#include -#include +#include +#include +#include "hsapp_defs.h" +#include "hsmenueventfactory.h" #include "hsmenuitemmodel.h" -#include "cadefs.h" #include "hsallappsstate.h" -#include "hsaddappstocollectionstate.h" -#include "hsapp_defs.h" #include "hsmenumodewrapper.h" #include "hsmenuviewbuilder.h" -#include "hsmenumodetransition.h" -#include "caentry.h" -#include "caservice.h" #include "hsmainwindow.h" +#include "hsaddmodeproxymodel.h" +#include "hsapplibstateutils.h" /*! \class HsAllAppsState @@ -55,40 +54,24 @@ */ /*! - \var HsAllAppsState::mCollectionsSortAttribute - Collections sort order - */ - -/*! - \var HsAllAppsState::mMenuView - Wrapper for All Applications View. - */ - -/*! - \var HsAllAppsState::mMenuMode - Menu view mode wrapper. - Not Own. - */ - -/*! Constructor. \param menuViewBuilder Menu view builder. - \param menuMode reference to object representing menu mode (add mode on/add mode off). + \param menuMode Menu mode object(add mode on/add mode off). + \param mainWindow Main window wrapper. \param parent Owner. */ HsAllAppsState::HsAllAppsState(HsMenuViewBuilder &menuViewBuilder, HsMenuModeWrapper &menuMode, HsMainWindow &mainWindow, QState *parent) : - HsBaseViewState(parent), mSortAttribute(AscendingNameHsSortAttribute), - mCollectionsSortAttribute(LatestOnTopHsSortAttribute), - mMenuView(menuViewBuilder, HsAllAppsContext), - mMenuMode(menuMode), - mAllAppsModel(0), - mMainWindow(mainWindow), - mContextModelIndex(), mContextMenu(0) + HsBaseViewState(mainWindow, menuMode, parent), + mAddModeProxyModel(0), + mSortAttribute(AscendingNameHsSortAttribute) { + initialize(menuViewBuilder, HsAllAppsContext); construct(); + mAddModeProxyModel = new HsAddModeProxyModel(this); + mAddModeProxyModel->setSourceModel(mModel); } /*! @@ -98,64 +81,46 @@ { HSMENUTEST_FUNC_ENTRY("HsAllAppsState::construct"); - QState *initialState = new QState(this); - setInitialState(initialState); - - QState *addModeState = new QState(this); - connect(addModeState, SIGNAL(entered()),SLOT(addModeEntered())); - - QState *normalModeState = new QState(this); - connect(normalModeState, SIGNAL(entered()),SLOT(normalModeEntered())); - - initialState->addTransition(new HsMenuModeTransition( - mMenuMode, NormalHsMenuMode, normalModeState)); - initialState->addTransition(new HsMenuModeTransition( - mMenuMode, AddHsMenuMode, addModeState)); + defineTransitions(); const QString parentName = parent() != 0 ? parent()->objectName() : QString(""); setObjectName(parentName + "/allappsstate"); - connect(this, SIGNAL(entered()),SLOT(stateEntered())); - connect(this, SIGNAL(exited()),SLOT(stateExited())); + connect(mBackKeyAction, SIGNAL(triggered()), SIGNAL(toAppLibraryState())); - mSecondarySoftkeyAction = new HbAction(Hb::BackNaviAction, this); - - mMenuView.view()->setNavigationAction( - mSecondarySoftkeyAction); + mModel = HsMenuService::getAllApplicationsModel(mSortAttribute); + mMenuView->setModel(mModel); - connect(mSecondarySoftkeyAction, SIGNAL(triggered()), - SIGNAL(toAppLibraryState())); + mModel->preloadIcons(); - mAllAppsModel = HsMenuService::getAllApplicationsModel(mSortAttribute); - mMenuView.setModel(mAllAppsModel); - - mMenuView.listView()->verticalScrollBar()->setInteractive(true); - HbIndexFeedback *indexFeedback = new HbIndexFeedback(mMenuView.view()); + mMenuView->listView()->verticalScrollBar()->setInteractive(true); + HbIndexFeedback *indexFeedback = new HbIndexFeedback(mMenuView->view()); indexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter); - indexFeedback->setItemView(mMenuView.listView()); + indexFeedback->setItemView(mMenuView->listView()); HSMENUTEST_FUNC_EXIT("HsAllAppsState::construct"); } + /*! Creates and installs menu options for the view */ void HsAllAppsState::setMenuOptions() { HSMENUTEST_FUNC_ENTRY("HsAllAppsState::setMenuOptions"); - QScopedPointer viewOptions(new HbMenu); - viewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), - this, SLOT(openTaskSwitcher())); - viewOptions->addAction(hbTrId("txt_applib_opt_add_to_collection"), + mViewOptions->clearActions(); + mViewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), + static_cast(this), SLOT(openTaskSwitcher())); + mViewOptions->addAction(hbTrId("txt_applib_opt_add_to_collection"), this, SLOT(addToCollection())); - viewOptions->addAction(hbTrId("txt_applib_opt_check_software_updates"), - this, SLOT(checkSoftwareUpdates())); + mViewOptions->addAction(hbTrId("txt_applib_opt_check_software_updates"), + static_cast(this), SLOT(checkSoftwareUpdates())); - HbMenu *const sortMenu = viewOptions->addMenu(hbTrId( + HbMenu *const sortMenu = mViewOptions->addMenu(hbTrId( "txt_applib_opt_sort_by")); //Grouped options are exclusive by default. - QActionGroup *sortGroup = new QActionGroup(viewOptions.data()); + QActionGroup *sortGroup = new QActionGroup(this); sortGroup->addAction( sortMenu->addAction(hbTrId("txt_applib_opt_sub_ascending"), @@ -164,7 +129,7 @@ sortMenu->addAction(hbTrId("txt_applib_opt_sub_descending"), this, SLOT(descendingMenuAction()))); - viewOptions->addAction(hbTrId("txt_applib_subtitle_installed"), + mViewOptions->addAction(hbTrId("txt_applib_opt_view_installed_applications"), this, SLOT(openInstalledView())); foreach(QAction *action, sortMenu->actions()) { @@ -184,7 +149,6 @@ if (currentSortingPosition >= 0) { sortGroup->actions().at(currentSortingPosition)->setChecked(true); } - mMenuView.view()->setMenu(viewOptions.take()); HSMENUTEST_FUNC_EXIT("HsAllAppsState::setMenuOptions"); } @@ -195,63 +159,32 @@ HsAllAppsState::~HsAllAppsState() { - mMenuView.setModel(NULL); - delete mAllAppsModel; } -/*! - Scrolls view to first item at top - */ -void HsAllAppsState::scrollToBeginning() -{ - mMenuView.listView()->scrollTo( - mAllAppsModel->index(0), HbAbstractItemView::PositionAtTop); -} /*! - Slot invoked when a state is entered. + Slot invoked when normal mode entered. */ - - -void HsAllAppsState::stateEntered() +void HsAllAppsState::normalModeEntered() { - qDebug("AllAppsState::stateEntered()"); - HSMENUTEST_FUNC_ENTRY("HsAllAppsState::stateEntered"); - - mMainWindow.setCurrentView(mMenuView); - mMenuView.activate(); - - HSMENUTEST_FUNC_EXIT("HsAllAppsState::stateEntered"); + HsBaseViewState::normalModeEntered(); + if (mMenuView->model() != mModel) { + mMenuView->setModel(mModel); + } + connect(mMenuView.data(), + SIGNAL(activated(QModelIndex)), + static_cast(this), SLOT(launchItem(QModelIndex))); } /*! Slot invoked when add mode entered. */ -void HsAllAppsState::normalModeEntered() -{ - setMenuOptions(); - connect(&mMainWindow, SIGNAL(viewIsReady()), - &mMainWindow, SLOT(saveActivity()), - Qt::UniqueConnection); - connect(&mMenuView, - SIGNAL(activated(QModelIndex)), - SLOT(listItemActivated(QModelIndex))); - connect(&mMenuView, - SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), - SLOT(listItemLongPressed(HbAbstractViewItem *, QPointF))); -} - -/*! - Add mode entered. - */ void HsAllAppsState::addModeEntered() { - connect(&mMenuView, - SIGNAL(activated(QModelIndex)), - SLOT(addActivated(QModelIndex))); - connect(&mMenuView, - SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), - SLOT(addLongPressed(HbAbstractViewItem *, QPointF))); + HsBaseViewState::addModeEntered(); + if (mMenuView->model() != mAddModeProxyModel) { + mMenuView->setModel(mAddModeProxyModel); + } } /*! @@ -261,161 +194,31 @@ { HSMENUTEST_FUNC_ENTRY("HsAllAppsState::stateExited"); - disconnect(&mMainWindow, SIGNAL(viewIsReady()), - &mMainWindow, SLOT(saveActivity())); - - mMenuView.setSearchPanelVisible(false); - - mMenuView.disconnect(this); + HsBaseViewState::stateExited(); - mMenuView.view()->setMenu(NULL); - - mMenuView.inactivate(); - - if (mContextMenu) - mContextMenu->close(); - - HsBaseViewState::stateExited(); - HSMENUTEST_FUNC_EXIT("HsAllAppsState::stateExited"); qDebug("AllAppsState::stateExited()"); } /*! - Open task switcher. - \retval true if operation is successful. - */ -bool HsAllAppsState::openTaskSwitcher() -{ - return HsMenuService::launchTaskSwitcher(); -} - -/*! - Check software updates. - \retval 0 if operation is successful. - */ -int HsAllAppsState::checkSoftwareUpdates() -{ - int errCode = HsMenuService::launchSoftwareUpdate(); - if (errCode != 0){ - createApplicationLaunchFailMessage(errCode,0); - } - return errCode; -} - -/*! - Slot connected to List widget in normal mode. - \param index Model index of the activated item. - */ -void HsAllAppsState::listItemActivated(const QModelIndex &index) -{ - HSMENUTEST_FUNC_ENTRY("HsAllAppsState::listItemActivated"); - - QSharedPointer entry = mAllAppsModel->entry(index); - - if (entry->entryTypeName() == widgetTypeName()) { - EntryFlags flags = index.data(CaItemModel::FlagsRole).value< - EntryFlags> (); - if (!(flags & UninstallEntryFlag)) { - machine()->postEvent( - HsMenuEventFactory::createPreviewHSWidgetEvent( - entry->id(), entry->entryTypeName(), entry->attribute( - widgetUriAttributeName()), entry->attribute( - widgetLibraryAttributeName()))); - - const int itemId = index.data(CaItemModel::IdRole).toInt(); - HsMenuService::touch(itemId); - } - } else { - QVariant data = mAllAppsModel->data(index, CaItemModel::IdRole); - int errCode = HsMenuService::executeAction(data.toInt()); - if (errCode != 0) { - createApplicationLaunchFailMessage(errCode,index.data(CaItemModel::IdRole).toInt()); - } - } - - mMenuView.setSearchPanelVisible(false); - - HSMENUTEST_FUNC_EXIT("HsAllAppsState::listItemActivated"); -} - -/*! Slot connected to List widget in add mode. \param index Model index of the activated item. */ void HsAllAppsState::addActivated(const QModelIndex &index) { + mMenuView->disconnect(this); HSMENUTEST_FUNC_ENTRY("HsAllAppsState::addActivated"); addToHomeScreen(index); HSMENUTEST_FUNC_EXIT("HsAllAppsState::addActivated"); } -/*! - Handles long-item-pressed event in all apps view by showing context menu - \param item View item - \param coords Press point coordinates - */ -void HsAllAppsState::listItemLongPressed(HbAbstractViewItem *item, - const QPointF &coords) -{ - HSMENUTEST_FUNC_ENTRY("HsAllAppsState::listItemLongPressed"); - - EntryFlags flags = item->modelIndex().data( - CaItemModel::FlagsRole).value (); - - if (!(flags & UninstallEntryFlag)) { - // create context menu - mContextMenu = new HbMenu; - - HbAction *addToHomeScreenAction = mContextMenu->addAction( - hbTrId("txt_applib_menu_add_to_home_screen")); - addToHomeScreenAction->setData(AddToHomeScreenContextAction); - - HbAction *addToCollectionAction = mContextMenu->addAction( - hbTrId("txt_applib_menu_add_to_collection")); - addToCollectionAction->setData(AddToCollectionContextAction); - - HbAction *uninstallAction = mContextMenu->addAction( - hbTrId("txt_common_menu_delete")); - uninstallAction->setData(UninstallContextAction); - HbAction *appSettingsAction(NULL); - HbAction *appDetailsAction(NULL); - - // check conditions and hide irrelevant menu items - QSharedPointer entry = mAllAppsModel->entry(item->modelIndex()); - - if (!(entry->attribute(appSettingsPlugin()).isEmpty())) { - appSettingsAction = mContextMenu->addAction( - hbTrId("txt_common_menu_settings")); - appSettingsAction->setData(AppSettingContextAction); - } - if (!(entry->attribute(componentIdAttributeName()).isEmpty()) && - (flags & RemovableEntryFlag) ) { - appDetailsAction = mContextMenu->addAction( - hbTrId("txt_common_menu_details")); - appDetailsAction->setData(AppDetailsContextAction); - } - - if (!(flags & RemovableEntryFlag)) { - uninstallAction->setVisible(false); - } - - mContextModelIndex = item->modelIndex(); - mContextMenu->setPreferredPos(coords); - mContextMenu->setAttribute(Qt::WA_DeleteOnClose); - mContextMenu->open(this, SLOT(contextMenuAction(HbAction*))); - } - - - HSMENUTEST_FUNC_EXIT("HsAllAppsState::listItemLongPressed"); -} /*! Handles context menu actions */ void HsAllAppsState::contextMenuAction(HbAction *action) { - HsContextAction command = + HsContextAction command = static_cast(action->data().toInt()); const int itemId = mContextModelIndex.data(CaItemModel::IdRole).toInt(); @@ -429,25 +232,27 @@ // an existing collection via item specific menu. machine()->postEvent( HsMenuEventFactory::createAddAppsFromApplicationsViewEvent( - mSortAttribute, mCollectionsSortAttribute, itemId)); + mSortAttribute, itemId)); break; case UninstallContextAction: machine()->postEvent( HsMenuEventFactory::createUninstallApplicationEvent(itemId)); break; - case AppSettingContextAction: + case AppSettingContextAction: machine()->postEvent( HsMenuEventFactory::createAppSettingsViewEvent(itemId)); break; - case AppDetailsContextAction: + case AppDetailsContextAction: machine()->postEvent( HsMenuEventFactory::createAppDetailsViewEvent(itemId)); - break; + break; + case OpenContextAction: + launchItem(mContextModelIndex); + break; default: break; } - - mMenuView.setSearchPanelVisible(false); + mMenuView->hideSearchPanel(); } /*! @@ -460,6 +265,7 @@ const QPointF &coords) { Q_UNUSED(coords); + mMenuView->disconnect(this); HSMENUTEST_FUNC_ENTRY("HsAllAppsState::addLongPressed"); addToHomeScreen(item->modelIndex()); HSMENUTEST_FUNC_EXIT("HsAllAppsState::addLongPressed"); @@ -475,7 +281,7 @@ // a new/an existing collection via the All view machine()->postEvent( HsMenuEventFactory::createAddAppsFromApplicationsViewEvent( - mSortAttribute, mCollectionsSortAttribute)); + mSortAttribute)); } /*! @@ -495,50 +301,86 @@ /*! Triggers event so that a state adding to Home Screen is reached - \param index of an item to be added to homescreen + \param index of an item to be added to homescreen. \retval void */ void HsAllAppsState::addToHomeScreen(const QModelIndex &index) { HSMENUTEST_FUNC_ENTRY("HsAllAppsState::addToHomeScreen"); - QSharedPointer entry = mAllAppsModel->entry(index); + QSharedPointer entry = mModel->entry(index); machine()-> postEvent(HsMenuEventFactory::createAddToHomeScreenEvent( - entry->id(), mMenuMode.getHsMenuMode(), - mMenuMode.getHsToken())); + entry->id(), mMenuMode->getHsMenuMode(), + mMenuMode->getHsToken())); HSMENUTEST_FUNC_EXIT("HsAllAppsState::addToHomeScreen"); } /*! + Method seting context menu options. + */ +void HsAllAppsState::setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags) +{ + HbAction *openAction = mContextMenu->addAction(hbTrId( + "txt_common_menu_open")); + openAction->setData(OpenContextAction); + + HbAction *addToHomeScreenAction = mContextMenu->addAction( + hbTrId("txt_applib_menu_add_to_home_screen")); + addToHomeScreenAction->setData(AddToHomeScreenContextAction); + + HbAction *addToCollectionAction = mContextMenu->addAction( + hbTrId("txt_applib_menu_add_to_collection")); + addToCollectionAction->setData(AddToCollectionContextAction); + + HbAction *uninstallAction = mContextMenu->addAction( + hbTrId("txt_common_menu_delete")); + uninstallAction->setData(UninstallContextAction); + HbAction *appSettingsAction(NULL); + HbAction *appDetailsAction(NULL); + + // check conditions and hide irrelevant menu items + QSharedPointer entry = mModel->entry(item->modelIndex()); + + if (!(entry->attribute(appSettingsPlugin()).isEmpty())) { + appSettingsAction = mContextMenu->addAction( + hbTrId("txt_common_menu_settings")); + appSettingsAction->setData(AppSettingContextAction); + } + if (!(entry->attribute(componentIdAttributeName()).isEmpty()) && + (flags & RemovableEntryFlag) ) { + appDetailsAction = mContextMenu->addAction( + hbTrId("txt_common_menu_details")); + appDetailsAction->setData(AppDetailsContextAction); + } + + if (!(flags & RemovableEntryFlag)) { + uninstallAction->setVisible(false); + } + + addToHomeScreenAction->setVisible( + !HsAppLibStateUtils::isCWRTWidgetOnHomeScreen(entry.data())); +} + +/*! Menu ascending sort action slot. */ void HsAllAppsState::ascendingMenuAction() { HSMENUTEST_FUNC_ENTRY("HsAllAppsState::ascendingMenuAction"); mSortAttribute = AscendingNameHsSortAttribute; - mAllAppsModel->setSort(mSortAttribute); + mModel->setSort(mSortAttribute); HSMENUTEST_FUNC_EXIT("HsAllAppsState::ascendingMenuAction"); } /*! - Sets collections sort order - /param sortOrder sort order. - */ -void HsAllAppsState::collectionsSortOrder( - HsSortAttribute sortOrder) -{ - mCollectionsSortAttribute = sortOrder; -} - -/*! Menu descending sort action slot. */ void HsAllAppsState::descendingMenuAction() { HSMENUTEST_FUNC_ENTRY("HsAllAppsState::descendingMenuAction"); mSortAttribute = DescendingNameHsSortAttribute; - mAllAppsModel->setSort(mSortAttribute); + mModel->setSort(mSortAttribute); HSMENUTEST_FUNC_EXIT("HsAllAppsState::descendingMenuAction"); } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallcollectionsstate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallcollectionsstate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallcollectionsstate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -14,25 +14,23 @@ * Description: Menu All Collections state. * */ +#include #include #include #include #include -#include #include #include #include -#include -#include + +#include -#include #include "hsmenumodewrapper.h" -#include "hsmenuviewbuilder.h" +#include "hsmenueventfactory.h" +#include "hsmenumodewrapper.h" #include "hsmenuitemmodel.h" -#include "cadefs.h" #include "hsallcollectionsstate.h" #include "hsaddappstocollectionstate.h" -#include "hsmenumodetransition.h" #include "hsmainwindow.h" /*! @@ -45,28 +43,6 @@ */ /*! - \var HsAllCollectionsState::mSortAttribute - Sort order - */ - -/*! - \var HsAllCollectionsState::mMenuView - Wrapper for All Collections View. - */ - -/*! - \var HsAllCollectionsState::mAllCollectionsModel - Item Model for the List. - Own. - */ - -/*! - \fn void HsAllCollectionsState::sortOrderChanged(HsSortAttribute sortAttribute); - Signal emitted when sort order is changed. - \param sortOrder new sort order. - */ - -/*! Constructor. \param menuViewBuilder Menu view builder. \param menuMode reference to object representing menu mode (add mode on/add mode off). @@ -77,14 +53,9 @@ HsMenuModeWrapper &menuMode, HsMainWindow &mainWindow, QState *parent): - HsBaseViewState(parent), - mSortAttribute(CustomHsSortAttribute), - mMenuView(menuViewBuilder, HsAllCollectionsContext), - mMenuMode(menuMode), - mAllCollectionsModel(0), - mMainWindow(mainWindow), - mContextModelIndex(), mContextMenu(0) + HsBaseViewState(mainWindow, menuMode, parent) { + initialize(menuViewBuilder, HsAllCollectionsContext); construct(); } @@ -94,134 +65,73 @@ void HsAllCollectionsState::construct() { HSMENUTEST_FUNC_ENTRY("HsAllCollectionsState::construct"); - - QState *initialState = new QState(this); - setInitialState(initialState); - - QState *addModeState = new QState(this); - connect(addModeState, SIGNAL(entered()),SLOT(addModeEntered())); - - QState *normalModeState = new QState(this); - connect(normalModeState, SIGNAL(entered()),SLOT(normalModeEntered())); - connect(normalModeState, SIGNAL(exited()),SLOT(normalModeExited())); - - initialState->addTransition(new HsMenuModeTransition( - mMenuMode, NormalHsMenuMode, normalModeState)); - initialState->addTransition(new HsMenuModeTransition( - mMenuMode, AddHsMenuMode, addModeState)); - + defineTransitions(); const QString parentName = parent() != 0 ? parent()->objectName() : QString(""); setObjectName(parentName + "/allcollectionsstate"); - connect(this, SIGNAL(entered()),SLOT(stateEntered())); - connect(this, SIGNAL(exited()),SLOT(stateExited())); - mSecondarySoftkeyAction = new HbAction(Hb::BackNaviAction, this); - - mMenuView.view()->setNavigationAction( - mSecondarySoftkeyAction); + connect(mBackKeyAction, SIGNAL(triggered()), SIGNAL(toAppLibraryState())); - connect(mSecondarySoftkeyAction, SIGNAL(triggered()), - SIGNAL(toAppLibraryState())); - - mAllCollectionsModel = HsMenuService::getAllCollectionsModel( - mSortAttribute); - - mMenuView.setModel(mAllCollectionsModel); + mModel = HsMenuService::getAllCollectionsModel(); + mMenuView->setModel(mModel); HSMENUTEST_FUNC_EXIT("HsAllCollectionsState::construct"); } /*! - Creates and installs menu options for the view + Creates and installs menu options for the view. */ void HsAllCollectionsState::setMenuOptions() { HSMENUTEST_FUNC_ENTRY("HsAllCollectionsState::setMenuOptions"); - QScopedPointer viewOptions(new HbMenu); - - viewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), - this, + mViewOptions->clearActions(); + mViewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), + static_cast(this), SLOT(openTaskSwitcher())); - viewOptions->addAction(hbTrId("txt_applib_opt_new_collection"), + mViewOptions->addAction(hbTrId("txt_applib_opt_new_collection"), this, SLOT(createNewCollection())); - HbMenu *const sortMenu = viewOptions->addMenu( - hbTrId("txt_applib_opt_sort_by")); - - //Grouped options are exclusive by default. - QActionGroup *sortGroup = new QActionGroup(viewOptions.data()); - sortGroup->addAction(sortMenu->addAction( - hbTrId("txt_applib_opt_sub_custom"), - this, SLOT(customMenuAction()))); - sortGroup->addAction(sortMenu->addAction( - hbTrId("txt_applib_opt_sub_ascending"), - this, SLOT(ascendingMenuAction()))); - sortGroup->addAction(sortMenu->addAction( - hbTrId("txt_applib_opt_sub_descending"), - this, SLOT(descendingMenuAction()))); - - if (mSortAttribute == CustomHsSortAttribute) { - viewOptions->addAction(hbTrId("txt_applib_opt_arrange"), - this, SLOT(createArrangeCollection())); - } - - foreach(QAction *action, sortMenu->actions()) { - action->setCheckable(true); - } - - switch (mSortAttribute) { - case AscendingNameHsSortAttribute: - sortGroup->actions().at(1)->setChecked(true); - break; - case DescendingNameHsSortAttribute: - sortGroup->actions().at(2)->setChecked(true); - break; - case CustomHsSortAttribute: - default: - sortGroup->actions().at(0)->setChecked(true); - break; - } - - mMenuView.view()->setMenu(viewOptions.take()); + mViewOptions->addAction(hbTrId("txt_applib_opt_arrange"), + this, SLOT(createArrangeCollection())); HSMENUTEST_FUNC_EXIT("HsAllCollectionsState::setMenuOptions"); } /*! + Method seting context menu options. + \param item the context menu is requested for. + \param flags related to \a item. + */ +void HsAllCollectionsState::setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags) +{ + Q_UNUSED(item) + + HbAction *openAction = mContextMenu->addAction(hbTrId( + "txt_common_menu_open")); + openAction->setData(OpenContextAction); + + // create context menu + HbAction *addShortcutAction = mContextMenu->addAction(hbTrId( + "txt_applib_menu_add_to_home_screen")); + addShortcutAction->setData(AddToHomeScreenContextAction); + HbAction *renameAction = NULL; + HbAction *deleteAction = NULL; + + if ((flags & RemovableEntryFlag)) { + renameAction = mContextMenu->addAction( + hbTrId("txt_common_menu_rename_item")); + renameAction->setData(RenameContextAction); + deleteAction = mContextMenu->addAction(hbTrId("txt_common_menu_delete")); + deleteAction->setData(DeleteContextAction); + } +} + +/*! Destructor. */ HsAllCollectionsState::~HsAllCollectionsState() { - mMenuView.setModel(NULL); - delete mAllCollectionsModel; -} - -/*! - Populates all folders - */ -void HsAllCollectionsState::scrollToBeginning() -{ - - mMenuView.listView()->scrollTo( - mAllCollectionsModel->index(0), HbAbstractItemView::PositionAtTop); -} - -/*! - Slot invoked when a state is entered. - */ - - -void HsAllCollectionsState::stateEntered() -{ - qDebug("AllCollectionsState::stateEntered()"); - HSMENUTEST_FUNC_ENTRY("HsAllCollectionsState::stateEntered"); - - mMainWindow.setCurrentView(mMenuView); - mMenuView.activate(); - - HSMENUTEST_FUNC_EXIT("HsAllCollectionsState::stateExited"); } /*! @@ -229,16 +139,11 @@ */ void HsAllCollectionsState::normalModeEntered() { - setMenuOptions(); - connect(&mMainWindow, SIGNAL(viewIsReady()), - &mMainWindow, SLOT(saveActivity()), - Qt::UniqueConnection); - connect(&mMenuView, + HsBaseViewState::normalModeEntered(); + connect(mMenuView.data(), SIGNAL(activated(QModelIndex)), - SLOT(listItemActivated(QModelIndex))); - connect(&mMenuView, - SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), - SLOT(listItemLongPressed(HbAbstractViewItem *, QPointF))); + static_cast(this), + SLOT(openCollection(QModelIndex))); } /*! @@ -246,21 +151,9 @@ */ void HsAllCollectionsState::normalModeExited() { - mMenuView.view()->setMenu(NULL); + } -/*! - Slot invoked when add mode is entered. - */ -void HsAllCollectionsState::addModeEntered() -{ - connect(&mMenuView, - SIGNAL(activated(QModelIndex)), - SLOT(addActivated(QModelIndex))); - connect(&mMenuView, - SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), - SLOT(addLongPressed(HbAbstractViewItem *, QPointF))); -} /*! Slot invoked when a state is exited. @@ -268,19 +161,7 @@ void HsAllCollectionsState::stateExited() { HSMENUTEST_FUNC_ENTRY("HsAllCollectionsState::stateExited"); - - disconnect(&mMainWindow, SIGNAL(viewIsReady()), - &mMainWindow, SLOT(saveActivity())); - - mMenuView.setSearchPanelVisible(false); - mMenuView.disconnect(this); - - mMenuView.inactivate(); - - if (mContextMenu) - mContextMenu->close(); - HsBaseViewState::stateExited(); HSMENUTEST_FUNC_EXIT("HsAllCollectionsState::stateExited"); @@ -288,45 +169,16 @@ } /*! - Open task switcher. - \retval true if operation is successful. - */ -bool HsAllCollectionsState::openTaskSwitcher() -{ - return HsMenuService::launchTaskSwitcher(); -} - -/*! - Slot connected to List widget in normal mode. - \param index Model index of the activated item. - */ -void HsAllCollectionsState::listItemActivated(const QModelIndex &index) -{ - HSMENUTEST_FUNC_ENTRY("HsAllCollectionsState::listItemActivated"); - QVariant data = mAllCollectionsModel->data(index, CaItemModel::IdRole); - int id = data.toInt(); - QString collectionType = - mAllCollectionsModel->data(index, CaItemModel::TypeRole).toString(); - qDebug("AllCollectionsState::listItemActivated - MCS ID: %d", - data.toInt()); - - mMenuView.setSearchPanelVisible(false); - - machine()->postEvent(HsMenuEventFactory::createOpenCollectionFromAppLibraryEvent(id, - collectionType)); - HSMENUTEST_FUNC_EXIT("HsAllCollectionsState::listItemActivated"); -} - -/*! Slot connected to List widget in add mode. \param index Model index of the activated item. */ void HsAllCollectionsState::addActivated(const QModelIndex &index) { + mMenuView->disconnect(this); const int itemId = index.data(CaItemModel::IdRole).toInt(); machine()->postEvent( HsMenuEventFactory::createAddToHomeScreenEvent( - itemId, mMenuMode.getHsMenuMode(), mMenuMode.getHsToken())); + itemId, mMenuMode->getHsMenuMode(), mMenuMode->getHsToken())); } /*! @@ -339,57 +191,20 @@ const QPointF &coords) { Q_UNUSED(coords); + mMenuView->disconnect(this); const int itemId = item->modelIndex().data(CaItemModel::IdRole).toInt(); machine()->postEvent( HsMenuEventFactory::createAddToHomeScreenEvent(itemId, - mMenuMode.getHsMenuMode(), mMenuMode.getHsToken())); + mMenuMode->getHsMenuMode(), mMenuMode->getHsToken())); } /*! - Slot connected to List widget in normal mode. - Called when item long pressed. - \param item View item. - \param coords Press point coordinates. - */ -void HsAllCollectionsState::listItemLongPressed(HbAbstractViewItem *item, - const QPointF &coords) -{ - HSMENUTEST_FUNC_ENTRY("HsAllCollectionsState::listItemLongPressed"); - - mContextMenu = new HbMenu; - - // create context menu - HbAction *addShortcutAction = mContextMenu->addAction(hbTrId( - "txt_applib_menu_add_to_home_screen")); - addShortcutAction->setData(AddToHomeScreenContextAction); - HbAction *renameAction = NULL; - HbAction *deleteAction = NULL; - - EntryFlags flags = item->modelIndex().data(CaItemModel::FlagsRole).value< - EntryFlags> (); - - if ((flags & RemovableEntryFlag)) { - renameAction = mContextMenu->addAction( - hbTrId("txt_common_menu_rename_item")); - renameAction->setData(RenameContextAction); - deleteAction = mContextMenu->addAction(hbTrId("txt_common_menu_delete")); - deleteAction->setData(DeleteContextAction); - } - - mContextModelIndex = item->modelIndex(); - mContextMenu->setPreferredPos(coords); - mContextMenu->setAttribute(Qt::WA_DeleteOnClose); - mContextMenu->open(this, SLOT(contextMenuAction(HbAction*))); - - HSMENUTEST_FUNC_EXIT("HsAllCollectionsState::listItemLongPressed"); -} - -/*! - Handles context menu actions + Handles context menu actions. + \param action to be handled. */ void HsAllCollectionsState::contextMenuAction(HbAction *action) { - HsContextAction command = + HsContextAction command = static_cast(action->data().toInt()); const int itemId = mContextModelIndex.data(CaItemModel::IdRole).toInt(); @@ -398,7 +213,9 @@ case AddToHomeScreenContextAction: machine()->postEvent( HsMenuEventFactory::createAddToHomeScreenEvent( - itemId, mMenuMode.getHsMenuMode(), mMenuMode.getHsToken())); + itemId, + mMenuMode->getHsMenuMode(), + mMenuMode->getHsToken())); break; case RenameContextAction: machine()->postEvent( @@ -407,12 +224,15 @@ case DeleteContextAction: machine()->postEvent( HsMenuEventFactory::createDeleteCollectionEvent(itemId)); - break; + break; + case OpenContextAction: + openCollection(mContextModelIndex); + break; default: break; } - - mMenuView.setSearchPanelVisible(false); + + mMenuView->hideSearchPanel(); } /*! @@ -433,7 +253,7 @@ int topItemId(0); const QList array = - mMenuView.listView()->visibleItems(); + mMenuView->listView()->visibleItems(); if (array.count() >= 1) { QModelIndex idx = array[0]->modelIndex(); @@ -441,45 +261,5 @@ } machine()->postEvent( - HsMenuEventFactory::createArrangeCollectionEvent(topItemId)); -} - -/*! - Menu custom sort action slot. - */ -void HsAllCollectionsState::customMenuAction() -{ - HSMENUTEST_FUNC_ENTRY("HsAllCollectionsState::customMenuAction"); - mSortAttribute = CustomHsSortAttribute; - setMenuOptions(); - mAllCollectionsModel->setSort(mSortAttribute); - emit sortOrderChanged(mSortAttribute); - HSMENUTEST_FUNC_EXIT("HsAllCollectionsState::customMenuAction"); + HsMenuEventFactory::createArrangeAllCollectionsEvent(topItemId)); } - -/*! - Menu ascending sort action slot. - */ -void HsAllCollectionsState::ascendingMenuAction() -{ - HSMENUTEST_FUNC_ENTRY("HsAllCollectionsState::ascendingMenuAction"); - mSortAttribute = AscendingNameHsSortAttribute; - setMenuOptions(); - mAllCollectionsModel->setSort(mSortAttribute); - emit sortOrderChanged(mSortAttribute); - HSMENUTEST_FUNC_EXIT("HsAllCollectionsState::ascendingMenuAction"); -} - -/*! - Menu descending sort action slot. - */ -void HsAllCollectionsState::descendingMenuAction() -{ - HSMENUTEST_FUNC_ENTRY("HsAllCollectionsState::descendingMenuAction"); - mSortAttribute = DescendingNameHsSortAttribute; - setMenuOptions(); - mAllCollectionsModel->setSort(mSortAttribute); - emit sortOrderChanged(mSortAttribute); - HSMENUTEST_FUNC_EXIT("HsAllCollectionsState::descendingMenuAction"); -} - diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsapplibrarystate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsapplibrarystate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsapplibrarystate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -14,18 +14,11 @@ * Description: Menu Application Library state. * */ -#include -#include -#include + +#include #include -#include -#include -#include -#include #include #include -#include - #include "hstest_global.h" #include "hsapplibrarystate.h" @@ -34,7 +27,7 @@ #include "hscollectionstate.h" #include "hsinstalledappsstate.h" #include "hsoperatorhandler.h" -#include "hsmenuview.h" +#include "hsmenueventtransition.h" #include "hsmenumodetransition.h" @@ -125,7 +118,7 @@ mAllCollectionsState = new HsAllCollectionsState(mMenuViewBuilder, mMenuMode, mMainWindow, this); - + QState *initialState = new QState(this); setInitialState(initialState); @@ -142,12 +135,12 @@ this); connect(mCollectionState, SIGNAL(entered()),SLOT(clearToolbarLatch())); - + HsMenuEventTransition *openCollectionFromAppLibTransition = new HsMenuEventTransition(HsMenuEvent::OpenCollectionFromAppLibrary, this, mCollectionState); this->addTransition(openCollectionFromAppLibTransition); - + //It is called from: HsDefaultRuntime::activityRequested(const QString &name) HsMenuEventTransition *openCollectionAfterActivityRequest = new HsMenuEventTransition(HsMenuEvent::OpenCollection, @@ -180,11 +173,6 @@ constructToolbar(); - connect(mAllCollectionsState, SIGNAL(sortOrderChanged(HsSortAttribute)), - mAllAppsState, SLOT(collectionsSortOrder(HsSortAttribute))); - connect(mAllCollectionsState, SIGNAL(sortOrderChanged(HsSortAttribute)), - mCollectionState, SLOT(collectionsSortOrder(HsSortAttribute))); - connect(mAllAppsState, SIGNAL(entered()), this, SLOT(allAppsStateEntered())); @@ -195,7 +183,7 @@ connect(mAllCollectionsState, SIGNAL(entered()), this, SLOT(allCollectionsStateEntered())); - + HSMENUTEST_FUNC_EXIT("HsAppLibraryState::construct"); } @@ -209,19 +197,19 @@ HSMENUTEST_FUNC_ENTRY("HsAppLibraryState::onEntry"); QState::onEntry(event); - if (static_cast(event)->operation() != + if (static_cast(event)->operation() != HsMenuEvent::OpenCollectionFromAppLibrary) { // we are back from HS, scroll those views to top mAllAppsState->scrollToBeginning(); - mAllCollectionsState->scrollToBeginning(); + mAllCollectionsState->scrollToBeginning(); } - + if (event->type() == HsMenuEvent::eventType()) { HsMenuEvent *menuEvent = static_cast(event); QVariantMap data = menuEvent->data(); mMenuMode.setHsMenuMode( - static_cast(data.value(menuModeType()).toInt()), + static_cast(data.value(menuModeType()).toInt()), data.value(HOMESCREENDATA)); } else { mMenuMode.setHsMenuMode(NormalHsMenuMode); @@ -242,16 +230,14 @@ HsOperatorHandler *const operatorHandler = new HsOperatorHandler(this); - const bool operatorActionAvailable = !operatorHandler->icon().isNull(); - - if (operatorActionAvailable) { + if (operatorHandler->oviStorePresent() + && operatorHandler->operatorStorePresent()) { //TODO HbToolBarExtension is not supported in docml currently //should be changed in future bool loaded = HbStyleLoader::registerFilePath( ":/css/hsapplibrarystateplugin.css"); Q_ASSERT(loaded); - HbAction *const operatorAction(mMenuViewBuilder.operatorAction()); HbToolBarExtension *const extension( mMenuViewBuilder.toolBarExtension()); @@ -260,25 +246,31 @@ extensionAction->setIcon(HbIcon("qtg_mono_store")); - operatorAction->setIcon(operatorHandler->icon()); + HbAction *const operatorAction( + operatorHandler->prepareOperatorStoreAction( + mMenuViewBuilder.operatorAction())); operatorAction->setText(hbTrId(operatorHandler->text().toLatin1())); //TODO: no locstring for ovi store currently mMenuViewBuilder.oviStoreAction()->setText("Ovi Store"); - - connect(mMenuViewBuilder.operatorAction(), SIGNAL(triggered()), - operatorHandler, SLOT(action())); - - extension->addAction(mMenuViewBuilder.oviStoreAction()); - extension->addAction(operatorAction); - - } else { + if (operatorHandler->operatorStoreFirst()) { + extension->addAction(operatorAction); + extension->addAction(mMenuViewBuilder.oviStoreAction()); + } else { + extension->addAction(mMenuViewBuilder.oviStoreAction()); + extension->addAction(operatorAction); + } + } else if (operatorHandler->oviStorePresent()) { mMenuViewBuilder.toolBar()->addAction( mMenuViewBuilder.oviStoreAction()); + } else if (operatorHandler->operatorStorePresent()) { + mMenuViewBuilder.toolBar()->addAction( + operatorHandler->prepareOperatorStoreAction( + mMenuViewBuilder.operatorAction())); } - - HbAction *const allCollectionsAction(mMenuViewBuilder.allCollectionsAction()); + HbAction *const allCollectionsAction( + mMenuViewBuilder.allCollectionsAction()); mAllAppsState->addTransition( allCollectionsAction, SIGNAL(triggered()), mAllCollectionsState); @@ -320,12 +312,12 @@ int HsAppLibraryState::oviStoreAction() { HSMENUTEST_FUNC_ENTRY("HsAppLibraryState::oviStoreAction"); - + CaEntry oviEntry; oviEntry.setEntryTypeName(applicationTypeName()); - oviEntry.setAttribute( applicationUidEntryKey(), + oviEntry.setAttribute( applicationUidEntryKey(), QString::number(oviLauncherApplicationUid)); - + int result = CaService::instance()->executeCommand(oviEntry); if (result) { oviEntry.setEntryTypeName(urlTypeName()); @@ -333,7 +325,7 @@ QString("https://store.ovi.com/applications/")); result = CaService::instance()->executeCommand(oviEntry); } - + HSMENUTEST_FUNC_EXIT("HsAppLibraryState::oviStoreAction"); return result; } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsapplibstateutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsapplibstateutils.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,57 @@ +/* + * 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: Utils for application library state plugin. + * + */ + +#include + +#include "hsapplibstateutils.h" +#include "hscontentservice.h" +#include "hsapp_defs.h" + +/*! + \class HsAppLibStateUtils + \ingroup group_hsmenustateplugin + \brief Utils. + Utils for application library state plugin. + */ + +/*! + Return true if given entry is cwrt widget and already on homescreen + */ +bool HsAppLibStateUtils::isCWRTWidgetOnHomeScreen(const CaEntry *entry) +{ + bool result = false; + if (entry->entryTypeName() == applicationTypeName() && + entry->attribute(swTypeKey()) == HS_CWRT_APP_TYPE && + entry->attribute(widgetUriAttributeName()) == + HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE) { + QVariantHash preferences; + QMap attributes = entry->attributes(); + QMapIterator i(attributes); + while (i.hasNext()) { + i.next(); + QString key(i.key()); + QString value(i.value()); + if (key.contains(widgetParam())) { + preferences.insert(key.remove(widgetParam()),value); + } + } + int count(0); + HsContentService::instance()->widgets(HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE,preferences,count); + result = count > 0; + } + return result; +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsbaseviewstate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsbaseviewstate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsbaseviewstate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -15,104 +15,122 @@ * */ -#include +#include +#include +#include #include -#include +#include +#include +#include +#include +#include + #include #include "hsbaseviewstate.h" +#include "hsmenueventfactory.h" +#include "hsmenudialogfactory.h" +#include "hsmenuitemmodel.h" +#include "hsmenumodetransition.h" +#include "hsmenuentryremovedhandler.h" +#include "hsmainwindow.h" + /*! Constructor. + \param mainWindow main window wrapper object. + \param parent Owner. */ -HsBaseViewState::HsBaseViewState( - QState *parent): +HsBaseViewState::HsBaseViewState(HsMainWindow &mainWindow, QState *parent): QState(parent), - mNotifier(0), - mMessageRelatedItemId(0), - mApplicationLaunchFailMessage(0) + mApplicationLaunchFailMessage(0), + mModel(0), + mContextMenu(0), + mContextModelIndex(), + mBackKeyAction(0), + mMenuView(0), + mMenuMode(0), + mMainWindow(mainWindow) { - construct(); + mBackKeyAction = new HbAction(Hb::BackNaviAction, this); + mViewOptions = new HbMenu; } /*! - Constructs contained objects. + Constructor. + \param mainWindow main window wrapper object. + \param menuMode menu mode object. + \param parent Owner. */ -void HsBaseViewState::construct() +HsBaseViewState::HsBaseViewState(HsMainWindow &mainWindow, + HsMenuModeWrapper& menuMode, + QState *parent): + QState(parent), + mApplicationLaunchFailMessage(0), + mModel(0), + mContextMenu(0), + mContextModelIndex(), + mBackKeyAction(0), + mMenuView(0), + mMenuMode(&menuMode), + mMainWindow(mainWindow) { + mBackKeyAction = new HbAction(Hb::BackNaviAction, this); + mViewOptions = new HbMenu; +} +/*! + Initialize contained objects. + \param menuViewBuilder object providing widgets for menu view. + \param stateContext state context of the view the builder + is to provide widgets for. + */ +void HsBaseViewState::initialize(HsMenuViewBuilder &menuViewBuilder, + HsStateContext stateContext) +{ + mMenuView.reset(new HsMenuView(menuViewBuilder, stateContext, mMainWindow)); + mMenuView->view()->setNavigationAction(mBackKeyAction); + mMenuView->view()->setMenu(mViewOptions); + + connect(this, SIGNAL(entered()),SLOT(stateEntered())); + connect(this, SIGNAL(exited()),SLOT(stateExited())); } /*! Creates and open application launch fail message. \param errorCode eroor code to display. + \param itemId id of the launched item. */ -void HsBaseViewState::createApplicationLaunchFailMessage(int errorCode,int itemId) +void HsBaseViewState::createApplicationLaunchFailMessage(int errorCode, + int itemId) { QString message; message.append( HbParameterLengthLimiter("txt_applib_info_launching_the_application_failed").arg( errorCode)); - - mMessageRelatedItemId = itemId; // create and show message box - mApplicationLaunchFailMessage = new HbMessageBox(HbMessageBox::MessageTypeInformation); - mApplicationLaunchFailMessage->setAttribute(Qt::WA_DeleteOnClose); - - mApplicationLaunchFailMessage->setText(message); + mApplicationLaunchFailMessage = HsMenuDialogFactory().create( + message, HsMenuDialogFactory::Close); - mApplicationLaunchFailMessage->clearActions(); - HbAction *mClosemAction = new HbAction(hbTrId("txt_common_button_close"), - mApplicationLaunchFailMessage); - mApplicationLaunchFailMessage->addAction(mClosemAction); + QScopedPointer entryObserver( + new HsMenuEntryRemovedHandler(itemId, mApplicationLaunchFailMessage.data(), SLOT(close()))); - mApplicationLaunchFailMessage->open(this, SLOT(applicationLaunchFailMessageFinished(HbAction*))); - - subscribeForMemoryCardRemove(); + entryObserver.take()->setParent(mApplicationLaunchFailMessage.data()); + + mApplicationLaunchFailMessage->open(); } /*! - Subscribe for memory card remove. + Slot invoked when a state is entered. */ -void HsBaseViewState::subscribeForMemoryCardRemove() -{ - if (mMessageRelatedItemId !=0 ) { - CaNotifierFilter filter; - filter.setIds(QList() << mMessageRelatedItemId); - mNotifier = CaService::instance()->createNotifier(filter); - mNotifier->setParent(this); - connect(mNotifier, - SIGNAL(entryChanged(CaEntry,ChangeType)), - SLOT(cleanUpApplicationLaunchFailMessage())); - } -} - -/*! - Clean up application launch fail message box. - \retval void - */ -void HsBaseViewState::cleanUpApplicationLaunchFailMessage() +void HsBaseViewState::stateEntered() { - if (mApplicationLaunchFailMessage) { - mApplicationLaunchFailMessage->close(); - mApplicationLaunchFailMessage = NULL; - } - if (mNotifier) { - delete mNotifier; - mNotifier = NULL; - } - mMessageRelatedItemId = 0; -} - -/*! - Action after closed application launch fail dialog. - \param finishedAction chosen action. - \retval void - */ -void HsBaseViewState::applicationLaunchFailMessageFinished(HbAction*) -{ - mApplicationLaunchFailMessage = NULL; - cleanUpApplicationLaunchFailMessage(); + qDebug("HsBaseViewState::stateEntered()"); + HSMENUTEST_FUNC_ENTRY("HsBaseViewState::stateEntered"); + mMenuView->activate(); + connect(mMenuView.data(), SIGNAL(listViewChange()), + this, SLOT(closeContextMenu())); + HSMENUTEST_FUNC_EXIT("HsBaseViewState::stateEntered"); } /*! @@ -121,13 +139,206 @@ void HsBaseViewState::stateExited() { HSMENUTEST_FUNC_ENTRY("HsBaseViewState::stateExited"); - cleanUpApplicationLaunchFailMessage(); + + mMenuView->hideSearchPanel(); + mMenuView->disconnect(this); + + mMenuView->inactivate(); + if (!mApplicationLaunchFailMessage.isNull()) { + mApplicationLaunchFailMessage->close(); + } + closeContextMenu(); HSMENUTEST_FUNC_EXIT("HsBaseViewState::stateExited"); } /*! + Add mode entered. + */ +void HsBaseViewState::addModeEntered() +{ + mViewOptions = mMenuView->view()->takeMenu(); + connect(mMenuView.data(), + SIGNAL(activated(QModelIndex)), + SLOT(addActivated(QModelIndex))); + connect(mMenuView.data(), + SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), + SLOT(addLongPressed(HbAbstractViewItem *, QPointF))); +} + +/*! + Add mode exited. + */ +void HsBaseViewState::addModeExited() +{ + mMenuView->view()->setMenu(mViewOptions); +} + +/*! + Slot invoked when normal mode entered. + */ +void HsBaseViewState::normalModeEntered() +{ + setMenuOptions(); + connect(mMenuView.data(), + SIGNAL(activated(QModelIndex)), + mMenuView.data(), + SLOT(hideSearchPanel())); + connect(mMenuView.data(), + SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), + SLOT(showContextMenu(HbAbstractViewItem *, QPointF))); +} + +/*! Destructor. */ HsBaseViewState::~HsBaseViewState() { + delete mModel; + mViewOptions = mMenuView->view()->takeMenu(); + delete mViewOptions; } + +/*! + Slot connected to List widget in normal mode. + \param index Model index of the activated item. + */ +void HsBaseViewState::launchItem(const QModelIndex &index) +{ + HSMENUTEST_FUNC_ENTRY("HsBaseViewState::launchItem"); + + QSharedPointer entry = mModel->entry(index); + if (!entry.isNull() && !(entry->flags() & UninstallEntryFlag)) { + if (entry->entryTypeName() == widgetTypeName()) { + machine()->postEvent(HsMenuEventFactory::createPreviewHSWidgetEvent(entry->id(), + entry->entryTypeName(), entry->attribute(widgetUriAttributeName()), + entry->attribute(widgetLibraryAttributeName()))); + HsMenuService::touch(entry->id()); + } + else { + int errCode = HsMenuService::executeAction(entry->id()); + if (errCode != 0) { + createApplicationLaunchFailMessage(errCode, entry->id()); + } + } + } + HSMENUTEST_FUNC_EXIT("HsBaseViewState::launchItem"); +} + +/*! + Slot connected to List widget in normal mode. + \param index Model index of the activated item. + */ +void HsBaseViewState::openCollection(const QModelIndex &index) +{ + HSMENUTEST_FUNC_ENTRY("HsBaseViewState::openCollection"); + QVariant data = mModel->data(index, CaItemModel::IdRole); + int id = data.toInt(); + QString collectionType = mModel->data( + index, CaItemModel::TypeRole).toString(); + qDebug("HsBaseViewState::openCollection - MCS ID: %d", data.toInt()); + + machine()->postEvent( + HsMenuEventFactory::createOpenCollectionFromAppLibraryEvent( + id, collectionType)); + HSMENUTEST_FUNC_EXIT("HsBaseViewState::openCollection"); +} + +/*! + Slot connected to List widget in normal mode. + \param index Model index of the activated item. + */ +void HsBaseViewState::showContextMenu(HbAbstractViewItem *item, const QPointF &coords) +{ + HSMENUTEST_FUNC_ENTRY("HsBaseViewState::showContextMenu"); + + EntryFlags flags = item->modelIndex().data( + CaItemModel::FlagsRole).value (); + + if (!(flags & UninstallEntryFlag)) { + mContextMenu = new HbMenu; + setContextMenuOptions(item,flags); + mContextModelIndex = item->modelIndex(); + mContextMenu->setPreferredPos(coords); + mContextMenu->setAttribute(Qt::WA_DeleteOnClose); + mContextMenu->open(this, SLOT(contextMenuAction(HbAction*))); + } + HSMENUTEST_FUNC_EXIT("HsBaseViewState::showContextMenu"); + +} + +/*! + Open task switcher. + \retval true if operation is successful. + */ +bool HsBaseViewState::openTaskSwitcher() +{ + return HsMenuService::launchTaskSwitcher(); +} + +/*! + Menu softkey back action slot + */ +void HsBaseViewState::openAppLibrary() +{ + machine()->postEvent(HsMenuEventFactory::createOpenAppLibraryEvent()); +} + +/*! + Check software updates. + \retval 0 if operation is successful. + */ +int HsBaseViewState::checkSoftwareUpdates() +{ + int errCode = HsMenuService::launchSoftwareUpdate(); + if (errCode != 0){ + createApplicationLaunchFailMessage(errCode,0); + } + return errCode; +} + +/*! + close context menu + */ +void HsBaseViewState::closeContextMenu() +{ + if (mContextMenu) { + mContextMenu->close(); + } +} +/*! + Scrolls view to first item at top + */ +void HsBaseViewState::scrollToBeginning() +{ + mMenuView->listView()->scrollTo( + mModel->index(0), HbAbstractItemView::PositionAtTop); +} + +/*! + Normal mode exited dummy implementation. + */ +void HsBaseViewState::normalModeExited() +{ +} + +/*! + Defines transitions + */ +void HsBaseViewState::defineTransitions() +{ + QState *initialState = new QState(this); + setInitialState(initialState); + + QState *addModeState = new QState(this); + connect(addModeState, SIGNAL(entered()),SLOT(addModeEntered())); + connect(addModeState, SIGNAL(exited()),SLOT(addModeExited())); + + QState *normalModeState = new QState(this); + connect(normalModeState, SIGNAL(entered()),SLOT(normalModeEntered())); + connect(normalModeState, SIGNAL(exited()),SLOT(normalModeExited())); + + initialState->addTransition(new HsMenuModeTransition( + *mMenuMode, NormalHsMenuMode, normalModeState)); + initialState->addTransition(new HsMenuModeTransition( + *mMenuMode, AddHsMenuMode, addModeState)); +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -15,30 +15,28 @@ * */ -#include - +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include + +#include "hsapp_defs.h" #include "hsmenuevent.h" +#include "hsmenueventfactory.h" #include "hsmenuservice.h" #include "hsmenumodewrapper.h" #include "hsmenuitemmodel.h" -#include "hsmenuviewbuilder.h" -#include "cadefs.h" -#include "caentry.h" #include "hscollectionstate.h" #include "hsaddappstocollectionstate.h" -#include "hsapp_defs.h" -#include "hsmainwindow.h" +#include "hsapplibstateutils.h" /*! \class HsCollectionState @@ -55,11 +53,6 @@ */ /*! - \var HsCollectionState::mCollectionsSortAttribute - All collections sort order. - */ - -/*! \var HsCollectionState::mCollectionId The id of the current collection. */ @@ -69,35 +62,6 @@ The type of the current collection. */ -/*! - \var HsCollectionState::mMenuView - The List View widget. - */ - -/*! - \var HsCollectionState::mSecondarySoftkeyAction - Secondary Softkey action. - Backstepping functionality. - Own. - */ - -/*! - \var HsCollectionState::mOldNavigationAction - Old navigation icon. - Not own. - */ - -/*! - \var HsCollectionState::mCollectionModel - Item Model for the List. - Own. - */ - -/*! - \var HsCollectionState::mOptions - Options menu. - Own. - */ /*! \fn void HsCollectionState::sortOrderChanged(SHsSortAttribute sortOrder); @@ -114,24 +78,19 @@ /*! Constructor. \param menuViewBuilder Menu view builder. - \param menuMode reference to object representing menu mode (add mode on/add mode off). + \param menuMode menu mode object (add mode on/add mode off). + \param mainWindow main window wrapper. \param parent Owner. */ HsCollectionState::HsCollectionState(HsMenuViewBuilder &menuViewBuilder, HsMenuModeWrapper &menuMode, HsMainWindow &mainWindow, QState *parent) : - HsBaseViewState(parent), + HsBaseViewState(mainWindow, menuMode, parent), mSortAttribute(LatestOnTopHsSortAttribute), - mCollectionsSortAttribute(CustomHsSortAttribute), - mCollectionId(-1), - mMenuView(menuViewBuilder, HsCollectionContext), - mMenuMode(menuMode), - mSecondarySoftkeyAction(new HbAction(Hb::BackNaviAction, this)), - mCollectionModel(0), - mOptions(0), mContextModelIndex(), mContextMenu(0), - mMainWindow(mainWindow) + mCollectionId(-1) { + initialize(menuViewBuilder, HsCollectionContext); construct(); } @@ -146,13 +105,6 @@ parent() != 0 ? parent()->objectName() : QString(""); setObjectName(parentName + "/collectionstate"); - connect(this, SIGNAL(entered()),SLOT(stateEntered())); - connect(this, SIGNAL(exited()),SLOT(stateExited())); - - mMenuView.collectionButton()->setCheckable(true); - makeConnect(); - mMenuView.view()->setNavigationAction(mSecondarySoftkeyAction); - HSMENUTEST_FUNC_EXIT("HsCollectionState::construct"); } @@ -161,11 +113,8 @@ */ HsCollectionState::~HsCollectionState() { - makeDisconnect(); - mMenuView.inactivate(); - mMenuView.setModel(NULL); - mMenuView.view()->setNavigationAction(NULL); - delete mCollectionModel; + mMenuView->inactivate(); + mMenuView->view()->setNavigationAction(NULL); } @@ -192,101 +141,89 @@ /*! Slot invoked when a state is entered. */ - - void HsCollectionState::stateEntered() { HSMENUTEST_FUNC_ENTRY("HsCollectionState::stateEntered"); - - mMainWindow.setCurrentView(mMenuView); - mMenuView.activate(); - - if (!mCollectionModel) { - mCollectionModel = + if (!mModel) { + mModel = HsMenuService::getCollectionModel( mCollectionId, mSortAttribute, mCollectionType); } - - EntryFlags flags = - mCollectionModel->root().data(CaItemModel::FlagsRole).value< - EntryFlags> (); + + handleEmptyChange(mModel->rowCount() == 0); - if (mCollectionModel->rowCount() == 0){ - if (flags & RemovableEntryFlag){ - mMenuView.setContext(HsCollectionContext,HsButtonContext); - } else { - mMenuView.setContext(HsCollectionContext,HsEmptyLabelContext); - } - mMenuView.disableSearch(true); - } else { - mMenuView.setContext(HsCollectionContext,HsItemViewContext); - mMenuView.disableSearch(false); - } + makeConnect(); + + mMenuView->viewLabel()->setHeading( + mModel->root().data(CaItemModel::CollectionTitleRole).toString()); + + HsBaseViewState::stateEntered(); + HSMENUTEST_FUNC_EXIT("HsCollectionState::stateEntered"); +} - connect(mCollectionModel, SIGNAL(modelReset()), SLOT(updateLabel())); - connect(mCollectionModel, SIGNAL(empty(bool)),this, - SLOT(handleEmptyChange(bool))); - connect(mCollectionModel, SIGNAL(empty(bool)),this, - SLOT(lockSearchButton(bool))); - - mMenuView.setModel(mCollectionModel); +/*! + Creates and installs menu options for the view + */ +void HsCollectionState::setMenuOptions() +{ + HSMENUTEST_FUNC_ENTRY("HsAllCollectionsState::setMenuOptions"); - mMenuView.listView()->scrollTo( - mCollectionModel->index(0), HbAbstractItemView::PositionAtTop); + EntryFlags flags = + mModel->root().data(CaItemModel::FlagsRole).value (); - mMenuView.viewLabel()->setHeading( - mCollectionModel->root().data(Qt::DisplayRole).toString()); + mViewOptions->clearActions(); - if (!mOptions) { - mOptions = new HbMenu(); - mOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), - this, + mViewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), + static_cast(this), SLOT(openTaskSwitcher())); - if (flags & RemovableEntryFlag) { - mOptions->addAction(hbTrId("txt_applib_opt_add_content"), this, - SLOT(addAppsAction())); - } - - mOptions->addAction(hbTrId("txt_applib_opt_add_to_home_screen"), - this, SLOT(addCollectionShortcutToHomeScreenAction())); + if (flags & RemovableEntryFlag) { + mViewOptions->addAction(hbTrId("txt_applib_opt_add_content"), this, + SLOT(addAppsAction())); + } - if (flags & RemovableEntryFlag) { - mOptions->addAction( - hbTrId("txt_common_opt_rename_item"), + mViewOptions->addAction(hbTrId("txt_applib_opt_add_to_home_screen"), + this, SLOT(addCollectionShortcutToHomeScreenAction())); + + if (flags & RemovableEntryFlag) { + if (mModel->rowCount() > 0) { + mViewOptions->addAction( + hbTrId("txt_applib_opt_arrange"), this, - SLOT(renameAction())); - mOptions->addAction( - hbTrId("txt_common_opt_delete"), - this, - SLOT(deleteAction())); + SLOT(createArrangeCollection())); } - if (mCollectionType == collectionDownloadedTypeName()) { - HbMenu *sortMenu = mOptions->addMenu( - hbTrId("txt_applib_opt_sort_by")); - //Grouped options are exclusive by default. - QActionGroup *sortGroup = new QActionGroup(mOptions); - sortGroup->addAction( - sortMenu->addAction( - hbTrId("txt_applib_opt_sort_by_sub_latest_on_top"), - this, - SLOT(latestOnTopMenuAction()))); - sortGroup->addAction( - sortMenu->addAction( - hbTrId("txt_applib_opt_sort_by_sub_oldest_on_top"), - this, - SLOT(oldestOnTopMenuAction()))); - foreach(QAction *action, sortMenu->actions()) { - action->setCheckable(true); - } - static const int defaultSortingPosition = 0; - sortGroup->actions().at(defaultSortingPosition)->setChecked(true); + mViewOptions->addAction( + hbTrId("txt_common_opt_rename_item"), + this, + SLOT(renameAction())); + mViewOptions->addAction( + hbTrId("txt_common_opt_delete"), + this, + SLOT(deleteAction())); + } + if (mCollectionType == collectionDownloadedTypeName()) { + HbMenu *sortMenu = mViewOptions->addMenu( + hbTrId("txt_applib_opt_sort_by")); + //Grouped options are exclusive by default. + QActionGroup *sortGroup = new QActionGroup(this); + sortGroup->addAction( + sortMenu->addAction( + hbTrId("txt_applib_opt_sort_by_sub_latest_on_top"), + this, + SLOT(latestOnTopMenuAction()))); + sortGroup->addAction( + sortMenu->addAction( + hbTrId("txt_applib_opt_sort_by_sub_oldest_on_top"), + this, + SLOT(oldestOnTopMenuAction()))); + foreach(QAction *action, sortMenu->actions()) { + action->setCheckable(true); } - - mOptions->setParent(this); - mMenuView.view()->setMenu(mOptions); + static const int defaultSortingPosition = 0; + sortGroup->actions().at(defaultSortingPosition)->setChecked(true); } - HSMENUTEST_FUNC_EXIT("HsCollectionState::stateEntered"); + mMenuView->view()->setMenu(mViewOptions); + HSMENUTEST_FUNC_EXIT("HsAllCollectionsState::setMenuOptions"); } /*! @@ -295,29 +232,15 @@ void HsCollectionState::stateExited() { HSMENUTEST_FUNC_ENTRY("HsCollectionState::stateExited"); - - mMenuView.inactivate(); - mMenuView.setSearchPanelVisible(false); - mMenuView.disableSearch(false); - disconnect(mCollectionModel, SIGNAL(empty(bool)),this, - SLOT(handleEmptyChange(bool))); - - disconnect(mCollectionModel, SIGNAL(empty(bool)),this, - SLOT(lockSearchButton(bool))); + mMenuView->disableSearch(false); + makeDisconnect(); - disconnect(mCollectionModel, SIGNAL(modelReset()), - this, SLOT(updateLabel())); - delete mCollectionModel; - mCollectionModel = NULL; - mOptions->close(); - delete mOptions; - mOptions = NULL; - if (mContextMenu) - mContextMenu->close(); + delete mModel; + mModel = NULL; this->mSortAttribute = NoHsSortAttribute; - + HsBaseViewState::stateExited(); - + HSMENUTEST_FUNC_EXIT("HsCollectionState::stateExited"); qDebug("CollectionState::stateExited()"); } @@ -327,16 +250,25 @@ */ void HsCollectionState::makeConnect() { - connect(mSecondarySoftkeyAction, SIGNAL(triggered()), - SLOT(backSteppingAction())); - connect(&mMenuView, + connect(mBackKeyAction, SIGNAL(triggered()), + static_cast(this), SLOT(openAppLibrary())); + connect(mMenuView.data(), + SIGNAL(activated(QModelIndex)), + static_cast(this), + SLOT(launchItem(QModelIndex))); + connect(mMenuView.data(), SIGNAL(activated(QModelIndex)), - SLOT(listItemActivated(QModelIndex))); - connect(&mMenuView, + mMenuView.data(), + SLOT(hideSearchPanel())); + connect(mMenuView.data(), SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), - SLOT(listItemLongPressed(HbAbstractViewItem *, QPointF))); - connect(mMenuView.collectionButton(), - SIGNAL(toggled(bool)), this, SLOT(addAppsAction(bool))); + static_cast(this), + SLOT(showContextMenu(HbAbstractViewItem *, QPointF))); + connect(mModel, SIGNAL(modelReset()), SLOT(updateLabel())); + connect(mModel, SIGNAL(empty(bool)),this, + SLOT(handleEmptyChange(bool))); + connect(mModel, SIGNAL(empty(bool)),this, + SLOT(lockSearchButton(bool))); } /*! @@ -344,130 +276,29 @@ */ void HsCollectionState::makeDisconnect() { - disconnect(mMenuView.collectionButton(), - SIGNAL(toggled(bool)), this, SLOT(addAppsAction(bool))); - - disconnect(mSecondarySoftkeyAction, SIGNAL(triggered()), - this, SLOT(backSteppingAction())); - - disconnect(&mMenuView, - SIGNAL(activated(QModelIndex)), - this, SLOT(listItemActivated(QModelIndex))); - - disconnect(&mMenuView, - SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), - this, SLOT(listItemLongPressed(HbAbstractViewItem *, QPointF))); -} - -/*! - Open task switcher. - \retval true if operation is successful. - */ -bool HsCollectionState::openTaskSwitcher() -{ - return HsMenuService::launchTaskSwitcher(); -} - -/*! - Slot connected to List widget. - \param index Model index of the activated item. - */ -void HsCollectionState::listItemActivated(const QModelIndex &index) -{ - HSMENUTEST_FUNC_ENTRY("HsCollectionState::listItemActivated"); - - QSharedPointer entry = mCollectionModel->entry(index); - - if (entry->entryTypeName() == widgetTypeName()) { - EntryFlags flags = index.data(CaItemModel::FlagsRole).value< - EntryFlags> (); - if (!(flags & UninstallEntryFlag)) { - machine()->postEvent( - HsMenuEventFactory::createPreviewHSWidgetEvent( - entry->id(), entry->entryTypeName(), entry->attribute( - widgetUriAttributeName()), entry->attribute( - widgetLibraryAttributeName()))); - - const int itemId = index.data(CaItemModel::IdRole).toInt(); - HsMenuService::touch(itemId); - } - } else { - QVariant data = mCollectionModel->data(index, CaItemModel::IdRole); - int errCode = HsMenuService::executeAction(data.toInt()); - if (errCode != 0) { - createApplicationLaunchFailMessage(errCode,index.data(CaItemModel::IdRole).toInt()); - } - } - - mMenuView.setSearchPanelVisible(false); - HSMENUTEST_FUNC_EXIT("HsCollectionState::listItemActivated"); -} + disconnect(mBackKeyAction, SIGNAL(triggered()), + static_cast(this), SLOT(openAppLibrary())); -/*! - Handles long-item-pressed event in all apps view by showing context menu - \param item the event pertains to - \param coords press point coordinates. - \retval void - */ -void HsCollectionState::listItemLongPressed(HbAbstractViewItem *item, - const QPointF &coords) -{ - HSMENUTEST_FUNC_ENTRY("HsCollectionState::listItemLongPressed"); - - EntryFlags flags = item->modelIndex().data(CaItemModel::FlagsRole).value< - EntryFlags> (); - - if (!(flags & UninstallEntryFlag)) { - // create context menu - mContextMenu = new HbMenu(); + disconnect(mMenuView.data(), + SIGNAL(activated(QModelIndex)), + static_cast(this), + SLOT(launchItem(QModelIndex))); + disconnect(mMenuView.data(), + SIGNAL(activated(QModelIndex)), + mMenuView.data(), + SLOT(hideSearchPanel())); + disconnect(mMenuView.data(), + SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), + static_cast(this), + SLOT(showContextMenu(HbAbstractViewItem *, QPointF))); + disconnect(mModel, SIGNAL(empty(bool)),this, + SLOT(handleEmptyChange(bool))); - HbAction *addShortcutAction = mContextMenu->addAction(hbTrId( - "txt_applib_menu_add_to_home_screen")); - addShortcutAction->setData(AddToHomeScreenContextAction); - HbAction *addToCollection = mContextMenu->addAction(hbTrId( - "txt_applib_menu_add_to_collection")); - addToCollection->setData(AddToCollectionContextAction); - HbAction *removeAction(NULL); - HbAction *uninstallAction(NULL); - HbAction *appSettingsAction(NULL); - HbAction *appDetailsAction(NULL); - // we do not add remove option in locked collection - // check conditions and hide irrelevant menu items - EntryFlags rootFlags = - mCollectionModel->root().data(CaItemModel::FlagsRole).value< - EntryFlags> (); - - if (rootFlags & RemovableEntryFlag) { - removeAction = mContextMenu->addAction( - hbTrId("txt_applib_menu_remove_from_collection")); - removeAction->setData(RemoveFromCollectionContextAction); - } + disconnect(mModel, SIGNAL(empty(bool)),this, + SLOT(lockSearchButton(bool))); - if ((flags & RemovableEntryFlag)) { - uninstallAction = mContextMenu->addAction(hbTrId("txt_common_menu_delete")); - uninstallAction->setData(UninstallContextAction); - } - QSharedPointer entry = mCollectionModel->entry(item->modelIndex()); - - if (!(entry->attribute(appSettingsPlugin()).isEmpty())) { - appSettingsAction = mContextMenu->addAction(hbTrId( - "txt_common_menu_settings")); - appSettingsAction->setData(AppSettingContextAction); - } - - if (!(entry->attribute(componentIdAttributeName()).isEmpty()) && - (flags & RemovableEntryFlag) ) { - appDetailsAction = mContextMenu->addAction(hbTrId( - "txt_common_menu_details")); - appDetailsAction->setData(AppDetailsContextAction); - } - mContextModelIndex = item->modelIndex(); - mContextMenu->setPreferredPos(coords); - mContextMenu->setAttribute(Qt::WA_DeleteOnClose); - mContextMenu->open(this, SLOT(contextMenuAction(HbAction*))); - } - - HSMENUTEST_FUNC_EXIT("HsCollectionState::listItemLongPressed"); + disconnect(mModel, SIGNAL(modelReset()), + this, SLOT(updateLabel())); } /*! @@ -475,7 +306,7 @@ */ void HsCollectionState::contextMenuAction(HbAction *action) { - HsContextAction command = + HsContextAction command = static_cast(action->data().toInt()); const int itemId = mContextModelIndex.data(CaItemModel::IdRole).toInt(); @@ -486,8 +317,8 @@ break; case AddToCollectionContextAction: machine()->postEvent( - HsMenuEventFactory::createAddAppsFromCallectionViewEvent( - mCollectionId, itemId, mCollectionsSortAttribute)); + HsMenuEventFactory::createAddAppsFromCollectionViewEvent( + mCollectionId, itemId)); break; case UninstallContextAction: machine()->postEvent( @@ -499,66 +330,88 @@ HsMenuEventFactory::createRemoveAppFromCollectionEvent( itemId, mCollectionId)); break; - case AppSettingContextAction: + case AppSettingContextAction: machine()->postEvent( HsMenuEventFactory::createAppSettingsViewEvent(itemId)); break; - case AppDetailsContextAction: + case AppDetailsContextAction: machine()->postEvent( HsMenuEventFactory::createAppDetailsViewEvent(itemId)); - break; + break; + case OpenContextAction: + launchItem(mContextModelIndex); + break; default: break; } - - mMenuView.setSearchPanelVisible(false); + + mMenuView->hideSearchPanel(); } /*! - Handles button visibility - \param empty if true set empty text label or button to add entries to collection + Handler to be called when model becomes not empty or model becomes empty. + \param empty \a true when model becomes empty \a false otherwise. */ void HsCollectionState::handleEmptyChange(bool empty) { + EntryFlags flags = - mCollectionModel->root().data(CaItemModel::FlagsRole).value< + mModel->root().data(CaItemModel::FlagsRole).value< EntryFlags> (); if (empty){ if (flags & RemovableEntryFlag){ - mMenuView.setContext(HsCollectionContext,HsButtonContext); + mMenuView->reset(HsButtonContext); + connect(mMenuView->contentButton(), + SIGNAL(toggled(bool)), this, SLOT(addAppsAction(bool)), + Qt::UniqueConnection); } else { - mMenuView.setContext(HsCollectionContext,HsEmptyLabelContext); + mMenuView->reset(HsEmptyLabelContext); } + } else { - mMenuView.setContext(HsCollectionContext,HsItemViewContext); + mMenuView->reset(HsItemViewContext); + mMenuView->setModel(mModel); + mMenuView->listView()->scrollTo( + mModel->index(0), HbAbstractItemView::PositionAtTop); } + + mMenuView->disableSearch(empty); + + mMenuView->activate(); + + setMenuOptions(); } /*! - Handles lock serch button - \param lock if true lock search button + Handles lock search button + \param lock if true lock search button. */ void HsCollectionState::lockSearchButton(bool lock) { - mMenuView.disableSearch(lock); + mMenuView->disableSearch(lock); } /*! Menu add applications action slot - \param addApps if true create event for add enties to collection. Parametr use by toggled from HbPushButton + \param addApps if true create event for add enties to collection. + Parametr use by toggled from HbPushButton */ void HsCollectionState::addAppsAction(bool addApps) { // Add applications if (addApps) { - mMenuView.collectionButton()->setChecked(false); + + if (mMenuView->contentButton()) { + mMenuView->contentButton()->setChecked(false); + } + machine()->postEvent( - HsMenuEventFactory::createAddAppsFromCallectionViewEvent( + HsMenuEventFactory::createAddAppsFromCollectionViewEvent( mCollectionId)); - } + } } /*! @@ -567,8 +420,8 @@ void HsCollectionState::addCollectionShortcutToHomeScreenAction() { machine()->postEvent(HsMenuEventFactory::createAddToHomeScreenEvent( - mCollectionId, mMenuMode.getHsMenuMode(), - mMenuMode.getHsToken())); + mCollectionId, mMenuMode->getHsMenuMode(), + mMenuMode->getHsToken())); } /*! @@ -590,40 +443,85 @@ } /*! - Menu softkey back action slot - */ -void HsCollectionState::backSteppingAction() -{ - machine()->postEvent(HsMenuEventFactory::createOpenAppLibraryEvent()); -} - -/*! Updates label */ void HsCollectionState::updateLabel() { HSMENUTEST_FUNC_ENTRY("HsCollectionState::updateLabel"); - if (mCollectionModel) { - mMenuView.viewLabel()->setHeading( - mCollectionModel->root().data(Qt::DisplayRole).toString()); + if (mModel) { + mMenuView->viewLabel()->setHeading( + mModel->root().data(Qt::DisplayRole).toString()); } HSMENUTEST_FUNC_EXIT("HsCollectionState::updateLabel"); } /*! Triggers event so that a state adding to Home Screen is reached - \param index of an item to be added to homescreen + \param index of an item to be added to homescreen. \retval void */ void HsCollectionState::addElementToHomeScreen(const QModelIndex &index) { - QSharedPointer entry = mCollectionModel->entry(index); + QSharedPointer entry = mModel->entry(index); QMap attributes = entry->attributes(); machine()->postEvent( HsMenuEventFactory::createAddToHomeScreenEvent( - entry->id(), mMenuMode.getHsMenuMode(), mMenuMode.getHsToken())); + entry->id(), mMenuMode->getHsMenuMode(), mMenuMode->getHsToken())); +} + +/*! + Method setting context menu options. + */ +void HsCollectionState::setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags) +{ + HbAction *openAction = mContextMenu->addAction(hbTrId( + "txt_common_menu_open")); + openAction->setData(OpenContextAction); + HbAction *addToHomeScreenAction = mContextMenu->addAction(hbTrId( + "txt_applib_menu_add_to_home_screen")); + addToHomeScreenAction->setData(AddToHomeScreenContextAction); + HbAction *addToCollection = mContextMenu->addAction(hbTrId( + "txt_applib_menu_add_to_collection")); + addToCollection->setData(AddToCollectionContextAction); + HbAction *removeAction(NULL); + HbAction *uninstallAction(NULL); + HbAction *appSettingsAction(NULL); + HbAction *appDetailsAction(NULL); + // we do not add remove option in locked collection + // check conditions and hide irrelevant menu items + EntryFlags rootFlags = + mModel->root().data(CaItemModel::FlagsRole).value< + EntryFlags> (); + + if (rootFlags & RemovableEntryFlag) { + removeAction = mContextMenu->addAction( + hbTrId("txt_applib_menu_remove_from_collection")); + removeAction->setData(RemoveFromCollectionContextAction); + } + + if ((flags & RemovableEntryFlag)) { + uninstallAction = mContextMenu->addAction(hbTrId("txt_common_menu_delete")); + uninstallAction->setData(UninstallContextAction); + } + QSharedPointer entry = mModel->entry(item->modelIndex()); + + if (!(entry->attribute(appSettingsPlugin()).isEmpty())) { + appSettingsAction = mContextMenu->addAction(hbTrId( + "txt_common_menu_settings")); + appSettingsAction->setData(AppSettingContextAction); + } + + if (!(entry->attribute(componentIdAttributeName()).isEmpty()) && + (flags & RemovableEntryFlag) ) { + appDetailsAction = mContextMenu->addAction(hbTrId( + "txt_common_menu_details")); + appDetailsAction->setData(AppDetailsContextAction); + } + + addToHomeScreenAction->setVisible( + !HsAppLibStateUtils::isCWRTWidgetOnHomeScreen(entry.data())); } /*! @@ -633,7 +531,7 @@ void HsCollectionState::latestOnTopMenuAction() { mSortAttribute = LatestOnTopHsSortAttribute; - mCollectionModel->setSort(mSortAttribute); + mModel->setSort(mSortAttribute); emit sortOrderChanged(mSortAttribute); } @@ -644,16 +542,31 @@ void HsCollectionState::oldestOnTopMenuAction() { mSortAttribute = OldestOnTopHsSortAttribute; - mCollectionModel->setSort(mSortAttribute); + mModel->setSort(mSortAttribute); emit sortOrderChanged(mSortAttribute); } /*! - Slot for setting all collections sort order - \param sortOrder all collections sort order + A Slot called when an arrange operation + is invoked for a static collection. */ -void HsCollectionState::collectionsSortOrder( - HsSortAttribute sortOrder) +void HsCollectionState::createArrangeCollection() { - mCollectionsSortAttribute = sortOrder; + // Arrange collection via the Arrange view + int topItemId(0); + + if (mMenuView->listView() != NULL) { + const QList array = + mMenuView->listView()->visibleItems(); + + if (array.count() >= 1) { + QModelIndex idx = array[0]->modelIndex(); + topItemId = idx.data(CaItemModel::IdRole).toInt(); + } + } + + machine()->postEvent( + HsMenuEventFactory::createArrangeCollectionEvent( + topItemId, + mCollectionId)); } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -15,26 +15,23 @@ * */ -#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include + +#include #include -#include +#include "hsapp_defs.h" +#include "hsmenueventfactory.h" #include "hsmenuitemmodel.h" -#include "hsmenuviewbuilder.h" -#include "cadefs.h" #include "hsinstalledappsstate.h" #include "hsaddappstocollectionstate.h" -#include "hsapp_defs.h" #include "hsmenumodetransition.h" -#include "hsmainwindow.h" /*! \class HsInstalledAppsState @@ -46,45 +43,17 @@ */ /*! - \var HsInstalledAppsState::mMenuView - The View widget. - Own. - */ - -/*! - \var HsInstalledAppsState::mInstalledAppsModel - Item Model for the List. - Own. - */ - -/*! - \var HsInstalledAppsState::mSecondarySoftkeyAction - Secondary Softkey action. - Backstepping functionality. - Own. - */ - -/*! - \var HsInstalledAppsState::mOldNavigationAction - Old navigation icon. - Not own. - */ - -/*! Constructor. \param menuViewBuilder Menu view builder. + \param mainWindow main window wrapper. \param parent Owner. */ HsInstalledAppsState::HsInstalledAppsState(HsMenuViewBuilder &menuViewBuilder, HsMainWindow &mainWindow, QState *parent): - HsBaseViewState(parent), - mMenuView(menuViewBuilder, HsInstalledAppsContext), - mInstalledAppsModel(0), - mSecondarySoftkeyAction(new HbAction(Hb::BackNaviAction, this)), - mMainWindow(mainWindow), - mContextModelIndex(),mContextMenu(0) + HsBaseViewState(mainWindow, parent) { + initialize(menuViewBuilder, HsInstalledAppsContext); construct(); } @@ -98,16 +67,8 @@ const QString parentName = parent() != 0 ? parent()->objectName() : QString(""); setObjectName(parentName + "/installedappsstate"); - connect(this, SIGNAL(entered()),SLOT(stateEntered())); - connect(this, SIGNAL(exited()),SLOT(stateExited())); - connect(mSecondarySoftkeyAction, SIGNAL(triggered()), - SLOT(backAction())); - mMenuView.view()-> - setNavigationAction(mSecondarySoftkeyAction); - - - setMenuOptions(); + connect(mBackKeyAction, SIGNAL(triggered()), SLOT(openAppLibrary())); HSMENUTEST_FUNC_EXIT("HsInstalledAppsState::construct"); } @@ -118,26 +79,48 @@ void HsInstalledAppsState::setMenuOptions() { HSMENUTEST_FUNC_ENTRY("HsInstalledAppsState::setMenuOptions"); - HbMenu *const mOptions = new HbMenu(); - mOptions->setParent(this); + + mViewOptions->clearActions(); - mOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), + mViewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), this, SLOT(openTaskSwitcher())); + mViewOptions->addAction(hbTrId("txt_applib_opt_installation_log"), + this, SLOT(openInstallationLog())); - mMenuView.view()->setMenu(mOptions); + mMenuView->view()->setMenu(mViewOptions); HSMENUTEST_FUNC_EXIT("HsInstalledAppsState::setMenuOptions"); } /*! + Method seting context menu options. + \param item the context menu is built for. + \param flags of the \item. + */ +void HsInstalledAppsState::setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags) +{ + HbAction *uninstallAction = mContextMenu->addAction( + hbTrId("txt_common_menu_delete")); + HbAction *appDetailsAction(NULL); + uninstallAction->setData(UninstallContextAction); + + QSharedPointer entry = mModel->entry(item->modelIndex()); + + if (!(entry->attribute(componentIdAttributeName()).isEmpty()) && + (flags & RemovableEntryFlag) ) { + appDetailsAction = mContextMenu->addAction(hbTrId( + "txt_common_menu_details")); + appDetailsAction->setData(AppDetailsContextAction); + } +} + + +/*! Destructor. */ HsInstalledAppsState::~HsInstalledAppsState() { - mMenuView.inactivate(); - mMenuView.setModel(NULL); - mMenuView.view()->setNavigationAction(NULL); - - delete mInstalledAppsModel; + mMenuView->inactivate(); + mMenuView->view()->setNavigationAction(NULL); } /*! @@ -149,32 +132,35 @@ qDebug("AllAppsState::stateEntered()"); HSMENUTEST_FUNC_ENTRY("HsInstalledAppsState::stateEntered"); - mMainWindow.setCurrentView(mMenuView); - mMenuView.activate(); + mMenuView->viewLabel()->setHeading( + hbTrId("txt_applib_subtitle_installed")); - if (!mInstalledAppsModel) { - mInstalledAppsModel - = HsMenuService::getInstalledModel(AscendingNameHsSortAttribute); - mMenuView.setModel(mInstalledAppsModel); + if (!mModel) { + mModel + = HsMenuService::getInstalledModel(AscendingNameHsSortAttribute); } - if (mInstalledAppsModel->rowCount() == 0){ - mMenuView.setContext(HsInstalledAppsContext,HsEmptyLabelContext); - } - - mMenuView.listView()->scrollTo( - mInstalledAppsModel->index(0)); + if (mModel->rowCount() == 0) { + mMenuView->reset(HsEmptyLabelContext); + } + else { + mMenuView->reset(HsItemViewContext); + mMenuView->setModel(mModel); + mMenuView->listView()->scrollTo( + mModel->index(0)); + } + + setMenuOptions(); - connect(&mMenuView, - SIGNAL(activated(QModelIndex)), - SLOT(listItemActivated(QModelIndex))); - connect(&mMenuView, + connect(mMenuView.data(), SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), - SLOT(listItemLongPressed(HbAbstractViewItem *, QPointF))); + SLOT(showContextMenu(HbAbstractViewItem *, QPointF))); - connect(mInstalledAppsModel, SIGNAL(empty(bool)),this, + connect(mModel, SIGNAL(empty(bool)),this, SLOT(setEmptyLabelVisibility(bool))); + HsBaseViewState::stateEntered(); + HSMENUTEST_FUNC_EXIT("HsInstalledAppsState::stateEntered"); } @@ -185,147 +171,66 @@ { HSMENUTEST_FUNC_ENTRY("HsInstalledAppsState::stateExited"); - disconnect(mInstalledAppsModel, SIGNAL(empty(bool)),this, + disconnect(mModel, SIGNAL(empty(bool)),this, SLOT(setEmptyLabelVisibility(bool))); - mMenuView.setSearchPanelVisible(false); - - disconnect(&mMenuView, - SIGNAL(activated(QModelIndex)), this, - SLOT(listItemActivated(QModelIndex))); - disconnect(&mMenuView, + disconnect(mMenuView.data(), SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), this, - SLOT(listItemLongPressed(HbAbstractViewItem *, QPointF))); - - mMenuView.inactivate(); + SLOT(showContextMenu(HbAbstractViewItem *, QPointF))); - if (mContextMenu) - mContextMenu->close(); - HsBaseViewState::stateExited(); - + HSMENUTEST_FUNC_EXIT("HsInstalledAppsState::stateExited"); qDebug("AllAppsState::stateExited()"); } /*! - Handles button visibility + Handles button visibility. + \param visibility indicates whether show or not to show 'empty' label. */ void HsInstalledAppsState::setEmptyLabelVisibility(bool visibility) { if(visibility){ - mMenuView.setContext(HsInstalledAppsContext,HsEmptyLabelContext); + mMenuView->reset(HsEmptyLabelContext); } else { - mMenuView.setContext(HsInstalledAppsContext,HsItemViewContext); + mMenuView->reset(HsItemViewContext); + mMenuView->setModel(mModel); } -} - -/*! - Open task switcher. - \retval true if operation is successful. - */ -bool HsInstalledAppsState::openTaskSwitcher() -{ - return HsMenuService::launchTaskSwitcher(); + mMenuView->activate(); } /*! - Method invoked when a list item is activated. - \param index indec of activated item. + Open installation log. */ -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT -void HsInstalledAppsState::listItemActivated(const QModelIndex &/*index*/) +void HsInstalledAppsState::openInstallationLog() { - //no implementation yet + machine()->postEvent( + HsMenuEventFactory::createInstallationLogEvent()); } -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT /*! - Handles long-item-pressed event in all apps view by showing context menu - \param item the event pertains to - \param coords press point coordinates. - */ -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT -void HsInstalledAppsState::listItemLongPressed(HbAbstractViewItem *item, - const QPointF &coords) -{ - HSMENUTEST_FUNC_ENTRY("HsInstalledAppsState::listItemLongPressed"); - - EntryFlags flags = item->modelIndex().data( - CaItemModel::FlagsRole).value (); - if (!(flags & UninstallEntryFlag)) { - // create context menu - mContextMenu = new HbMenu(); - - HbAction *uninstallAction = mContextMenu->addAction( - hbTrId("txt_common_menu_delete")); - HbAction *appDetailsAction(NULL); - uninstallAction->setData(UninstallContextAction); - - QSharedPointer entry = mInstalledAppsModel->entry(item->modelIndex()); - - if (!(entry->attribute(componentIdAttributeName()).isEmpty()) && - (flags & RemovableEntryFlag) ) { - appDetailsAction = mContextMenu->addAction(hbTrId( - "txt_common_menu_details")); - appDetailsAction->setData(AppDetailsContextAction); - } - - mContextModelIndex = item->modelIndex(); - mContextMenu->setPreferredPos(coords); - mContextMenu->setAttribute(Qt::WA_DeleteOnClose); - mContextMenu->open(this, SLOT(contextMenuAction(HbAction*))); - } - - - HSMENUTEST_FUNC_EXIT("HsInstalledAppsState::listItemLongPressed"); -} -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT - -/*! - Handles context menu actions + Handles context menu actions. + \param action to handle. */ void HsInstalledAppsState::contextMenuAction(HbAction *action) -{ - HsContextAction command = +{ + HsContextAction command = static_cast(action->data().toInt()); - + const int itemId = mContextModelIndex.data(CaItemModel::IdRole).toInt(); - + switch (command) { case UninstallContextAction: machine()->postEvent( HsMenuEventFactory::createUninstallApplicationEvent( itemId)); break; - case AppDetailsContextAction: + case AppDetailsContextAction: machine()->postEvent( HsMenuEventFactory::createAppDetailsViewEvent(itemId)); - break; + break; default: - break; + break; } - mMenuView.setSearchPanelVisible(false); + mMenuView->hideSearchPanel(); } - -/*! - Slot invoked when a back action is triggered. - */ -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT -void HsInstalledAppsState::backAction() -{ - machine()->postEvent(HsMenuEventFactory::createOpenAppLibraryEvent()); -} -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hslistviewitem.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hslistviewitem.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hslistviewitem.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -16,20 +16,58 @@ */ #include -#include - +#include #include +#include #include #include "hsmenuitemmodel.h" #include "hslistviewitem.h" + +// TODO: this is only temporary class for show progress bar. +// It should be remove when fix from orbit will be in official platfrom. +// Remove it from header too. + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT +void HsProgressBar::paint(QPainter * painter, + const QStyleOptionGraphicsItem * option, + QWidget * widget) +{ + Q_UNUSED(widget) + QStyleOptionGraphicsItem pixmapOption(*option); + foreach (QGraphicsItem *child, childItems()) { + painter->save(); + painter->translate(child->pos()); + pixmapOption.exposedRect = child->boundingRect(); + child->paint(painter, &pixmapOption, 0); + + foreach (QGraphicsItem *child2, child->childItems()) { + if (child2->isVisible()) { + painter->save(); + painter->translate(child2->pos()); + pixmapOption.exposedRect = child2->boundingRect(); + child2->paint(painter, &pixmapOption, 0); + painter->restore(); + } + } + painter->restore(); + } +} +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT + + HsListViewItem::HsListViewItem(QGraphicsItem* parent) : HbListViewItem(parent), progress(0), isProgress(false) { setGraphicsSize(LargeIcon); - HbStyleLoader::registerFilePath(":/layout/hslistviewitem.css"); - HbStyleLoader::registerFilePath(":/layout/hslistviewitem.widgetml"); + if (this == prototype()) { + HbStyleLoader::registerFilePath(":/layout/hslistviewitem.css"); + } } HsListViewItem::~HsListViewItem() @@ -44,32 +82,22 @@ { HbListViewItem::updateChildItems(); - // DisplayRoles - QVariant displayRole = modelIndex().data(Qt::DisplayRole); - QStringList stringList; - if (displayRole.isValid()) { - if (displayRole.canConvert()) { - stringList.append(displayRole.toString()); - } else if (displayRole.canConvert()) { - stringList = displayRole.toStringList(); - } - } EntryFlags flags = modelIndex().data( CaItemModel::FlagsRole).value (); isProgress = false; if (flags & UninstallEntryFlag) { isProgress = true; if (!progress) { - progress = new HbProgressBar(this); + progress = new HsProgressBar(this); + HbStyle::setItemName(progress, "progress"); progress->setRange(0, 100); + HbEffect::disable(progress); repolish(); } int progresVal = modelIndex().data( CaItemModel::UninstalRole).toInt(); progress->setProgressValue(progresVal); - HbStyle::setItemName(progress, "progress"); } else if (progress) { - HbStyle::setItemName(progress, ""); delete progress; progress = 0; repolish(); @@ -91,6 +119,13 @@ void HsListViewItem::polish(HbStyleParameters& params) { + if (isProgress) { + HbStyleLoader::registerFilePath(":/layout/hslistviewitem.widgetml"); + } HbListViewItem::setProperty("progress", isProgress); HbListViewItem::polish(params); + if (isProgress) { + HbStyleLoader::unregisterFilePath(":/layout/hslistviewitem.widgetml"); + } } + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmainwindow.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmainwindow.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmainwindow.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -21,11 +21,11 @@ #include "hsmainwindow.h" #include "hsmenuview.h" -#include + /*! Constructor */ -QTM_USE_NAMESPACE + /* @@ -36,7 +36,7 @@ */ -HsMainWindow::HsMainWindow() : mActivityClient(NULL) +HsMainWindow::HsMainWindow() { } @@ -51,68 +51,14 @@ Add the \menuView to first instance of HbMainWindow registered in HbInstance. \param view View to be added to HbMainWindow. */ -void HsMainWindow::setCurrentView(const HsMenuView &menuView) +void HsMainWindow::setCurrentView(HbView *view) { HbMainWindow *const hbW( HbInstance::instance()->allMainWindows().value(0)); - connect( hbW, SIGNAL(viewReady()), SIGNAL(viewIsReady()), - Qt::UniqueConnection ); - - HbView *const view = menuView.view(); - if (!hbW->views().contains(view)) { hbW->addView(view); } - hbW->setCurrentView(view); + bool animate = !hbW->isObscured(); + hbW->setCurrentView(view, animate); } - - -/*! - Grabs screenshot from actual main window - \retval QPixmap& containing screenshot -*/ -QPixmap HsMainWindow::grabScreenshot() - { - HbMainWindow *const hbW( - HbInstance::instance()->allMainWindows().value(0)); - return QPixmap::grabWidget(hbW, hbW->rect()); - } - -/*! - Saves applib activity with current view screenshot -*/ -void HsMainWindow::saveActivity() -{ -#ifdef Q_OS_SYMBIAN - - if (!mActivityClient) { - QServiceManager serviceManager; - mActivityClient = serviceManager.loadInterface("com.nokia.qt.activities.ActivityClient"); - if (!mActivityClient) { - qWarning("Cannot initialize critical com.nokia.qt.activities.ActivityClient service."); - } - } - - if (mActivityClient) { - bool retok; - bool ok = QMetaObject::invokeMethod(mActivityClient, "removeActivity", - Q_RETURN_ARG(bool, retok), Q_ARG(QString, appLibActivity())); - if (!ok) { - qWarning("remove appLibActivity failed"); - } - - QVariant variant; - QVariantHash metadata; - metadata.insert("screenshot", grabScreenshot()); - - ok = QMetaObject::invokeMethod(mActivityClient, "addActivity", Q_RETURN_ARG(bool, retok), - Q_ARG(QString, appLibActivity() ), Q_ARG(QVariant, QVariant(variant)), - Q_ARG(QVariantHash, metadata)); - if (!ok) { - qWarning("add appLibActivity failed"); - } - } -#endif//Q_OS_SYMBIAN -} - diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuview.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuview.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuview.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -28,14 +28,16 @@ #include #include #include -#include +#include #include "hsallappsstate.h" #include "hsallcollectionsstate.h" #include "hscollectionstate.h" +#include "hsmainwindow.h" #include "hsmenuitemmodel.h" #include "hsmenuview.h" #include "hslistviewitem.h" +#include "hssearchview.h" /*! \class HsMenuView @@ -49,43 +51,24 @@ */ /*! - Constructor - Builds UI objects - Sets up signals connections. + Retrieves UI objects for a requested context and sets up signals' connections. \param builder Menu View builder. - \param viewContext variable representing view context the view is to be prepared for. + \param stateContext Variable representing view context the view is to be prepared for. + \param mainWindow Object responsible for making a given view + a currently displayed view. */ -HsMenuView::HsMenuView(HsMenuViewBuilder &builder, HsViewContext viewContext): - mViewContext(viewContext), +HsMenuView::HsMenuView(HsMenuViewBuilder &builder, + HsStateContext stateContext, + HsMainWindow &mainWindow): mBuilder(builder), - mProxyModel(new QSortFilterProxyModel(this)), - mView(NULL), - mListView(NULL), - mViewLabel(NULL), - mSearchListView(NULL), - mSearchPanel(NULL), - mVkbHost(NULL) + mStateContext(stateContext), + mOperationalContext(HsItemViewContext), + mMainWindow(mainWindow), + mHsSearchView(new HsSearchView(mBuilder, mStateContext, mMainWindow)) { - mBuilder.setOperationalContext(HsItemViewContext); - mBuilder.setViewContext(mViewContext); - mBuilder.build(); - - mView = mBuilder.currentView(); - mListView = mBuilder.currentListView(); - - mViewLabel= mBuilder.currentViewLabel(); - - mCollectionButton = mBuilder.collectionButton(); - - mProxyModel->setFilterRole(CaItemModel::TextRole); - mProxyModel->setFilterKeyColumn(1); - mProxyModel->setSortRole(CaItemModel::TextRole); - - mVkbHost = new HbStaticVkbHost(mView); - connect(mVkbHost, SIGNAL(keypadOpened()), this, SLOT(vkbOpened())); - connect(mVkbHost, SIGNAL(keypadClosed()), this, SLOT(vkbClosed())); + synchronizeCache(); connect(mListView, SIGNAL(activated(QModelIndex)), @@ -93,12 +76,16 @@ connect(mListView, SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), this, SIGNAL(longPressed(HbAbstractViewItem *, QPointF))); + + connect(mHsSearchView.data(), SIGNAL(activated(QModelIndex)), + this, SIGNAL(activated(QModelIndex))); + connect(mHsSearchView.data(), + SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), + this, SIGNAL(longPressed(HbAbstractViewItem *, QPointF))); } /*! - Destructor - - Disconnects signals. + Empty. */ HsMenuView::~HsMenuView() { @@ -106,105 +93,52 @@ /*! - Sets model for item view. + Sets model for list item view if available in current context otherwise + ingores the request. \param model Model the view is to represent in HsItemViewMode. */ -void HsMenuView::setModel(HsMenuItemModel *model) +void HsMenuView::setModel(QAbstractItemModel *model) { HSMENUTEST_FUNC_ENTRY("HsMenuView::setModel"); - if (mListView->model()) { - disconnect(mListView->model(), - SIGNAL(scrollTo(int, QAbstractItemView::ScrollHint)), - this, - SLOT(scrollToRow(int, QAbstractItemView::ScrollHint))); + if (mListView != NULL) { + if (mListView->model()) { + disconnect(mListView->model(), + SIGNAL(scrollTo(int, QAbstractItemView::ScrollHint)), + this, + SLOT(scrollToRow(int, QAbstractItemView::ScrollHint))); + disconnect(mListView->model(), SIGNAL(countChange()), + this, + SIGNAL(listViewChange())); + } + + mListView->setItemPixmapCacheEnabled(true); // TODO: remove when enabled from default + mListView->setModel(model, new HsListViewItem()); + + if (mListView->model()) { + connect(mListView->model(), + SIGNAL(scrollTo(int, QAbstractItemView::ScrollHint)), + this, + SLOT(scrollToRow(int, QAbstractItemView::ScrollHint))); + connect(mListView->model(), SIGNAL(countChange()), + this, + SIGNAL(listViewChange())); + } } - mListView->setModel(model); - mListView->setItemPrototype(new HsListViewItem()); - if (mListView->model()) { - connect(mListView->model(), - SIGNAL(scrollTo(int, QAbstractItemView::ScrollHint)), - this, - SLOT(scrollToRow(int, QAbstractItemView::ScrollHint))); - } + HSMENUTEST_FUNC_EXIT("HsMenuView::setModel"); } - -/*! - Returns label appropriate for the view. - \return pointer to the label or NULL if the view has no label. - */ -HbGroupBox *HsMenuView::viewLabel() const -{ - return mViewLabel; -} - /*! - \return first visible item index if any or default QModelIndex otherwise. + Returns model for list item view. */ -QModelIndex HsMenuView::firstVisibleItemIndex(const HbListView *view) const -{ - QModelIndex result; - - const QList array = - view->visibleItems(); - - if (array.count() >= 1) { - result = array[0]->modelIndex(); - } - return result; -} - -/*! - Makes the UI to show or hide view search panel. - When search panel is shown the view toolbar and status pane - are hidden until search panel is hidden. - \param visible When true search panel will be shown, - otherwise it will be hidden. - */ -void HsMenuView::setSearchPanelVisible(bool visible) +QAbstractItemModel *HsMenuView::model() const { - HSMENUTEST_FUNC_ENTRY("HsMenuView::setSearchPanelVisible"); - - if (visible) { - - mSearchViewInitialIndex = firstVisibleItemIndex(mListView); - - searchBegins(); - - connectSearchItemViewsSignals(); - connectSearchPanelSignals(); - - } else if (mSearchListView != NULL) { - - mIndexToScrollAfterSearchDone = - firstVisibleItemIndex(mSearchListView); - - disconnectSearchPanelSignals(); - disconnectSearchItemViewsSignals(); - - searchFinished(); - } - HSMENUTEST_FUNC_EXIT("HsMenuView::setSearchPanelVisible"); + return mListView->model(); } /*! - Makes the UI to show or hide view add collection button - \param visibility When true button will be shown, - otherwise it will be hidden. - */ -void HsMenuView::setContext(HsViewContext viewContext, - HsOperationalContext context) -{ - mBuilder.setViewContext(viewContext); - mBuilder.setOperationalContext(context); - mBuilder.build(); -} - - -/*! \return View widget of the menu view. */ HbView *HsMenuView::view() const @@ -213,7 +147,8 @@ } /*! -\return List view widget of the menu view. +\return List view widget of the menu view + if available in the context or NULL otherwise. */ HbListView *HsMenuView::listView() const { @@ -221,11 +156,22 @@ } /*! -\return Collection button + Returns label appropriate for the view. + \return Pointer to the label + if available in the context or NULL otherwise. */ -HbPushButton *HsMenuView::collectionButton() const +HbGroupBox *HsMenuView::viewLabel() const { - return mCollectionButton; + return mViewLabel; +} + +/*! +\return Collection button + if available in the context or NULL otherwise. + */ +HbPushButton *HsMenuView::contentButton() const +{ + return mAddContentButton; } /*! @@ -236,13 +182,10 @@ { HSMENUTEST_FUNC_ENTRY("HsMenuView::showSearchPanel"); - setSearchPanelVisible(true); + mHsSearchView->setSearchPanelVisible(true); HSMENUTEST_FUNC_EXIT("HsMenuView::showSearchPanel"); } -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT skipped: it doubles other method /*! Makes search panel invisible. @@ -251,16 +194,15 @@ void HsMenuView::hideSearchPanel() { HSMENUTEST_FUNC_ENTRY("HsMenuView::hideSearchPanel"); - setSearchPanelVisible(false); + + mHsSearchView->setSearchPanelVisible(false); + HSMENUTEST_FUNC_EXIT("HsMenuView::hideSearchPanel"); } -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT /*! Disable or enable search action button. - \param disable If true action is disabled. + \param disable If true action gets disabled. */ void HsMenuView::disableSearch(bool disable) { @@ -268,7 +210,7 @@ } /*! - Scrolls item view to requested row. + Scrolls list item view to requested row. \param row The row which is to get at the position pointed by \a hint. \param hint Position in the view the row should be scrolled to. */ @@ -276,8 +218,10 @@ { HSMENUTEST_FUNC_ENTRY("HsMenuView::scrollToRow"); - mListView->scrollTo(mListView->model()->index(row, 0), - convertScrollHint(hint)); + if (mListView != NULL) { + mListView->scrollTo( + mListView->model()->index(row, 0), convertScrollHint(hint)); + } HSMENUTEST_FUNC_EXIT("HsMenuView::scrollToRow"); } @@ -303,187 +247,19 @@ } } -/* - Connects \a activated and \a longPressed signals coming from search list - view to emit corresponding signal of this object with translated model index -*/ -void HsMenuView::connectSearchItemViewsSignals() -{ - connect(mSearchListView, SIGNAL(activated(QModelIndex)), - this, SLOT(activatedProxySlot(QModelIndex))); - connect(mSearchListView, SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), - this, SLOT(longPressedProxySlot(HbAbstractViewItem *, QPointF))); - -} - /*! - Disconnects \a activated and \a longPressed signals coming from list - view from to emit corresponding signal - of this object with translated model index. -*/ -void HsMenuView::disconnectSearchItemViewsSignals() -{ - disconnect(mSearchListView, SIGNAL(activated(QModelIndex)), - this, SLOT(activatedProxySlot(QModelIndex))); - disconnect(mSearchListView, SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), - this, - SLOT(longPressedProxySlot(HbAbstractViewItem *, QPointF))); -} - - -/*! - Connects signals \a exitClicked and \a criteriaChanged emitted - by search panel with handling slots of the object or its members. -*/ -void HsMenuView::connectSearchPanelSignals() -{ - connect(mSearchPanel, SIGNAL(exitClicked()), - this, SLOT(hideSearchPanel())); - connect(mSearchPanel, SIGNAL(criteriaChanged(QString)), - this, SLOT(findItem(QString))); - - -} - -/*! - Disconnects signals \a exitClicked and \a criteriaChanged emitted - by search panel from handling slots of the object or its members - Scrolls view to state before connections. -*/ -void HsMenuView::disconnectSearchPanelSignals() -{ - disconnect(mSearchPanel, SIGNAL(exitClicked()), - this, SLOT(hideSearchPanel())); - - disconnect(mSearchPanel, SIGNAL(criteriaChanged(QString)), - this, SLOT(findItem(QString))); - -} - - -/*! - Looks up for item and if found scrolls to it. - \param criteriaStr The item name to find. - */ -void HsMenuView::findItem(QString criteriaStr) -{ - qDebug - () << QString("hsmenuview::findItem: %1").arg(criteriaStr); - HSMENUTEST_FUNC_ENTRY("hsmenuview::findItem"); - - if ("" != criteriaStr) { - mProxyModel->invalidate(); - mProxyModel->setSourceModel(mListView->model()); - mProxyModel->setFilterRegExp(QRegExp( - QString("(^|\\b)%1").arg(criteriaStr), Qt::CaseInsensitive)); - mSearchListView->scrollTo(mProxyModel->index(0,0), - HbAbstractItemView::PositionAtTop); - } else { - mProxyModel->setFilterRegExp(QRegExp(QString(".*"), - Qt::CaseInsensitive, QRegExp::RegExp)); - - // scroll to first item in model - mSearchListView->scrollTo( - mProxyModel->index(0, 0), - - HbAbstractItemView::PositionAtTop); - } - HSMENUTEST_FUNC_EXIT("hsmenuview::findItem"); -} - -/*! - Makes the view display search panel with view representing search results. - */ -void HsMenuView::searchBegins() -{ - HSMENUTEST_FUNC_ENTRY("hsmenuview::searchBegins"); - - - mBuilder.setViewContext(mViewContext); - mBuilder.setOperationalContext(HsSearchContext); - mBuilder.build(); - mSearchListView = mBuilder.currentListView(); - mSearchPanel = mBuilder.currentSearchPanel(); - - mView->hideItems(Hb::AllItems); - - mProxyModel->invalidate(); - mProxyModel->setSourceModel(mListView->model()); - mProxyModel->setFilterRegExp(QRegExp(QString(".*"), Qt::CaseInsensitive, - QRegExp::RegExp)); - mSearchListView->setModel(mProxyModel); - mSearchListView->setItemPrototype(new HsListViewItem()); - - mSearchListView->scrollTo( - mProxyModel->mapFromSource(mSearchViewInitialIndex), - HbAbstractItemView::PositionAtTop); - HSMENUTEST_FUNC_EXIT("hsmenuview::searchBegins"); -} - -/*! - Ensures view does not contain search related elements and is scrolled - to item chosen in search mode. - */ -void HsMenuView::searchFinished() -{ - HSMENUTEST_FUNC_ENTRY("hsmenuview::searchFinished"); - - mBuilder.setViewContext(mViewContext); - mBuilder.setOperationalContext(HsItemViewContext); - mBuilder.build(); - mView->showItems(Hb::AllItems); - - const QModelIndex indexToScroll = - mProxyModel->mapToSource(mIndexToScrollAfterSearchDone); - - mListView->scrollTo(indexToScroll, HbAbstractItemView::PositionAtTop); - - mSearchListView = NULL; - mSearchPanel = NULL; - vkbClosed(); - HSMENUTEST_FUNC_EXIT("hsmenuview::searchFinished"); -} - -/*! - Slot used to translate activated signal from proxy model to normal model. - \param index representing an item activated in search list view. - */ -void HsMenuView::activatedProxySlot(const QModelIndex &index) -{ - emit activated(mProxyModel->mapToSource(index)); -} - -/*! - Slot used to forward 'long pressed' signal with item description transladed - from search view context to context of the view search was requested from. - */ -void HsMenuView::longPressedProxySlot(HbAbstractViewItem *item, - const QPointF &coords) -{ - /* - this is a kind of hack, introduced for reasons: - item object should be reusable later, but orbit (or qt) prevents setting - its index model to previous state - */ - mSearchViewLongPressedIndex = - mProxyModel->mapToSource(item->modelIndex()); - QScopedPointer itemNew(item->createItem()); - itemNew->setModelIndex(mSearchViewLongPressedIndex); - emit longPressed(itemNew.data(), coords); -} - -/*! - Add the view to main window and search action with \a showSearchPanel + Add the view to main window and connect search action with \a showSearchPanel slot of the window. */ void HsMenuView::activate() { + mMainWindow.setCurrentView(mView); connect(mBuilder.searchAction(), SIGNAL(triggered()), - this, SLOT(showSearchPanel())); + this, SLOT(showSearchPanel()), Qt::UniqueConnection); } /*! - Disconnecs search action and \a showSearchPanel slot of the window. + Disconnects search action and disconnects \a showSearchPanel slot from the window. */ void HsMenuView::inactivate() { @@ -494,20 +270,55 @@ this, SLOT(showSearchPanel())); } - /*! - change size of view when VKB is opened + Makes a new view to be activated. Ensure navigation action and view label + heading are preserved after reset. + \param operationalContext Context indicating which view to activate. */ -void HsMenuView::vkbOpened() +void HsMenuView::reset(HsOperationalContext operationalContext) { - mView->setMaximumHeight(mVkbHost->applicationArea().height()); + QString viewLabelHeading; + + // before changing context read current view label heading ... + synchronizeCache(); + + if (mBuilder.currentViewLabel() != 0) { + viewLabelHeading = mBuilder.currentViewLabel()->heading(); + } + // ... and back-key action + HbAction *const backKeyAction(mView->navigationAction()); + + // now we can switch the context + mOperationalContext = operationalContext; + synchronizeCache(); + + if (mBuilder.currentViewLabel() != 0) { + mBuilder.currentViewLabel()->setHeading(viewLabelHeading); + } + mView->setNavigationAction(backKeyAction); } /*! - change size of view when VKB is closed + Builder can be shared between many instances of HsMenuView + being in different contexts. Before using builder make sure + it is in context matching the current HsMenuView. */ -void HsMenuView::vkbClosed() + +void HsMenuView::switchBuilderContext() { - mView->setMaximumHeight(-1); + mBuilder.setStateContext(mStateContext); + mBuilder.setOperationalContext(mOperationalContext); } +/*! + Updates internal data references to widgets. + */ +void HsMenuView::synchronizeCache() +{ + switchBuilderContext(); + + mView = mBuilder.currentView(); + mListView = mBuilder.currentListView(); + mViewLabel = mBuilder.currentViewLabel(); + mAddContentButton = mBuilder.currentAddContentButton(); +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -21,8 +21,6 @@ #include #include #include -#include -#include #include #include #include @@ -35,6 +33,26 @@ #include "hsmenuviewbuilder.h" #include "hsmenustates_global.h" +static const char* DOCUMENT_BASE_NAME_MAP + [InvalidStateContext][InvalidOperationalContext] = + /*HsItemViewContext, HsButtonContext, HsEmptyLabelContext*/ +{ +/*HsAllAppsContext*/ {"listview", "listview", "listview"}, +/*HsAllCollectionsContext*/ {"listview", "listview", "listview"}, +/*HsInstalledAppsContext*/ {"labeledlistview", "labeledlistview", + "emptylabeledview"}, +/*HsCollectionContext*/ {"labeledlistview", "addcontentlabeledview", + "emptylabeledview"} +}; + +static const QString DOCUMENT_NAME_PREFIX(QLatin1String(":/xml/")); +static const QString DOCUMENT_NAME_EXT(QLatin1String(".docml")); +static const QString COMMON_OBJECTS_DOCUMENT_BASE_NAME( + QLatin1String("common_objects")); +static const QString VIEW_NAME(QLatin1String("view")); +static const QString LIST_VIEW_NAME(QLatin1String("listView")); +static const QString VIEW_LABEL_NAME(QLatin1String("label")); +static const QString ADD_CONTENT_BUTTON_NAME(QLatin1String("addContentButton")); /*! \class HsMenuViewBuilder @@ -48,158 +66,128 @@ */ -/*! - Cleanup search text on showing search panel. Ensures vkb host instance - is appears on show and disappears on hide search panel. - - \param visible When true search panel is to show up, - hide otherwise. - */ -void HsMenuViewBuilder::searchPanelVisibilityChange(bool visible) -{ - if (visible) { - HbLineEdit *const lineEdit(searchPanelLineEdit()); - - lineEdit->setText(""); - lineEdit->setFocus(); - } - -} /*! - \return pointer to the view resulting from last \a build call or NULL if + \return Pointer to the view resulting from last \a build call or NULL if the \a build has not yet been called. Memory ownership is not changed. */ -HbView *HsMenuViewBuilder::currentView() const +HbView *HsMenuViewBuilder::currentView() { - const QString VIEW_NAME = - mViewContextToStringMap[mViewContext] - + "View"; + HbView *const view = + qobject_cast(currentLoader()->findWidget(VIEW_NAME)); - HbView *const view = - qobject_cast(mDocumentLoader.findWidget(VIEW_NAME)); - - if (view != NULL && mViewContext != HsInstalledAppsContext) { + if (view != NULL && mStateContext != HsInstalledAppsContext) { view->setToolBar(mToolBar); } return view; } /*! - \return pointer to list view resulting from last \a build call or NULL if + \return Pointer to list view resulting from last \a build call or NULL if the \a build has not yet been called. The pointer is valid until the HsMenuViewBuilder instance is destroyed. Memory ownership is not changed. */ -HbListView *HsMenuViewBuilder::currentListView() const +HbListView *HsMenuViewBuilder::currentListView() { - QString LIST_VIEW_NAME = mViewContextToStringMap[mViewContext]; - if (mOperationalContext == HsSearchContext) { - LIST_VIEW_NAME.append(mOperationalContextToStringMap[mOperationalContext]); - } - LIST_VIEW_NAME.append("ListView"); + HbListView *const listView = + qobject_cast( + currentLoader()->findWidget(LIST_VIEW_NAME)); - return qobject_cast( - mDocumentLoader.findWidget(LIST_VIEW_NAME)); + return listView; } /*! - \return pointer to the view label resulting from last \a build call. It is + \return Pointer to the view label resulting from last \a build call. It is + guaranteed to be not NULL if the \a build was called for the context + related to view including label. + The pointer is valid until the HsMenuViewBuilder instance is destroyed. + Memory ownership is not changed. + */ +HbGroupBox *HsMenuViewBuilder::currentViewLabel() +{ + HbGroupBox *viewLabel = + qobject_cast( + currentLoader()->findWidget(VIEW_LABEL_NAME)); + + return viewLabel; +} + +/*! + \return Pointer to the 'Add content' button resulting from last + \a build call. It is guaranteed to be not NULL if the \a build was called for the context related to view including label. The pointer is valid until the HsMenuViewBuilder instance is destroyed. Memory ownership is not changed. */ -HbGroupBox *HsMenuViewBuilder::currentViewLabel() const +HbPushButton *HsMenuViewBuilder::currentAddContentButton() { - const QString LABEL_NAME = mViewContextToStringMap[mViewContext] - + "Label"; - - return qobject_cast( - mDocumentLoader.findWidget(LABEL_NAME)); + HbPushButton *pushButton = + qobject_cast(currentLoader()->findWidget( + ADD_CONTENT_BUTTON_NAME)); + return pushButton; } /*! - \return pointer to search panel. - The pointer is valid until the HsMenuViewBuilder instance is destroyed. - Memory ownership is not changed. - */ -HbSearchPanel *HsMenuViewBuilder::currentSearchPanel() const -{ - return qobject_cast(mDocumentLoader.findWidget( - SEARCH_PANEL_NAME)); -} - -/*! - \return pointer to a button - The pointer is valid until the HsMenuViewBuilder instance is destroyed. - Memory ownership is not changed. - */ -HbPushButton *HsMenuViewBuilder::collectionButton() const -{ - return qobject_cast(mDocumentLoader.findWidget( - BUTTON_NAME)); -} - -/*! - \return pointer to All Applications Action. Guaranteed to be not NULL. + \return Pointer to All Applications Action. Guaranteed to be not NULL. The pointer is valid until the HsMenuViewBuilder instance is destroyed. Memory ownership is not changed. */ HbAction *HsMenuViewBuilder::allAppsAction() const { - return qobject_cast(mDocumentLoader.findObject( + return qobject_cast(mCommonObjectsLoader->findObject( ALL_APPS_ACTION_NAME)); } /*! - \return pointer to All Collections Action. Guaranteed to be not NULL. + \return Pointer to All Collections Action. Guaranteed to be not NULL. The pointer is valid until the HsMenuViewBuilder instance is destroyed. Memory ownership is not changed. */ HbAction *HsMenuViewBuilder::allCollectionsAction() const { - return qobject_cast(mDocumentLoader.findObject( + return qobject_cast(mCommonObjectsLoader->findObject( ALL_COLLECTIONS_ACTION_NAME)); } /*! - \return pointer to Search Action. Guaranteed to be not NULL. + \return Pointer to Search Action. Guaranteed to be not NULL. The pointer is valid until the HsMenuViewBuilder instance is destroyed. Memory ownership is not changed. */ HbAction *HsMenuViewBuilder::searchAction() const { - return qobject_cast(mDocumentLoader.findObject( + return qobject_cast(mCommonObjectsLoader->findObject( SEARCH_ACTION_NAME)); } /*! - \return pointer to Ovi Store Action. Guaranteed to be not NULL. + \return Pointer to Ovi Store Action. Guaranteed to be not NULL. The pointer is valid until the HsMenuViewBuilder instance is destroyed. Memory ownership is not changed. */ HbAction *HsMenuViewBuilder::oviStoreAction() const { - return qobject_cast(mDocumentLoader.findObject( + return qobject_cast(mCommonObjectsLoader->findObject( OVI_STORE_ACTION_NAME)); } /*! - \return pointer to Operator Action. Guaranteed to be not NULL. + \return Pointer to Operator Action. Guaranteed to be not NULL. The pointer is valid until the HsMenuViewBuilder instance is destroyed. Memory ownership is not changed. */ HbAction *HsMenuViewBuilder::operatorAction() const { - return qobject_cast(mDocumentLoader.findObject( + return qobject_cast(mCommonObjectsLoader->findObject( OPERATOR_ACTION_NAME)); } /*! - \return pointer to the main view toolbar. + \return Pointer to the main view toolbar. The pointer is valid until the HsMenuViewBuilder instance is destroyed. Memory ownership is not changed. */ @@ -209,7 +197,7 @@ } /*! - \return pointer to the toolbar extension. + \return Pointer to the toolbar extension. The pointer is valid until the HsMenuViewBuilder instance is destroyed. Memory ownership is not changed. */ @@ -219,7 +207,7 @@ } /*! - \return action group for \a allAppsState and \a allCollectionsState action. + \return Action group for \a allAppsState and \a allCollectionsState action. */ QActionGroup *HsMenuViewBuilder::toolBarActionGroup() const { @@ -228,42 +216,35 @@ /*! Reads docml configuration corresponding to current context. + \return Shared pointer to loader serving current context. */ -bool HsMenuViewBuilder::build() +QSharedPointer HsMenuViewBuilder::currentLoader() { - return readContextConfiguration(mViewContext, mOperationalContext); + if (!mLoaderMap.contains(context())) { + QSharedPointer loader = + readContextConfiguration(); + mLoaderMap.insert(context(), loader); + } + + return mLoaderMap[context()]; } - /*! - Constructor. - Makes object be initialized with with hidden but existing - search panel and view label. + Loads non-context sensitive objects. */ HsMenuViewBuilder::HsMenuViewBuilder(): - DOCUMENT_FILE_NAME(":/xml/applibrary.docml"), ALL_APPS_ACTION_NAME("allAppsAction"), ALL_COLLECTIONS_ACTION_NAME("allCollectionsAction"), SEARCH_ACTION_NAME("searchAction"), OVI_STORE_ACTION_NAME("oviStoreAction"), OPERATOR_ACTION_NAME("operatorAction"), - SEARCH_PANEL_NAME("searchPanel"), - BUTTON_NAME("collectionButton"), - TOOL_BAR_NAME("toolBar"), mToolBar(new HbToolBar), mToolBarExtension(new HbToolBarExtension), - mViewContext(HsAllAppsContext), + mStateContext(HsAllAppsContext), mOperationalContext(HsItemViewContext) { - init(); - - // parse common section and the one specified by view options - const bool result = parseSection(); - - Q_ASSERT_X(result, - "HsMenuViewBuilder::HsMenuViewBuilder()", - "construction failed"); + mCommonObjectsLoader = parseDocument(COMMON_OBJECTS_DOCUMENT_BASE_NAME); mToolBar->addAction(allAppsAction()); mToolBar->addAction(allCollectionsAction()); @@ -276,8 +257,7 @@ } /*! - Destructor. - Deletes widgets owned by the Menu View Builder. + Deletes loaded objects. */ HsMenuViewBuilder::~HsMenuViewBuilder() { @@ -289,81 +269,43 @@ /*! Parses requested docml file section and reflects its contents in the object state. - \param sectionName Name of the section to parse. - \retval \a true on success, \a false otherwise. + \param documentName Identifies document to parse. + \return Document loader instance containing parsed + objects for requested \documentName. */ -bool HsMenuViewBuilder::parseSection(const QString §ionName) +QSharedPointer HsMenuViewBuilder::parseDocument( + const QString &documentBaseName) { - HSMENUTEST_FUNC_ENTRY("HsMenuViewBuilder::parseSection"); + HSMENUTEST_FUNC_ENTRY("HsMenuViewBuilder::parseDocument"); bool loadStatusOk = false; + + QSharedPointer loader(new HbDocumentLoader()); + + const QString documentFullName = DOCUMENT_NAME_PREFIX + + documentBaseName + + DOCUMENT_NAME_EXT; const QObjectList loadedObjects = - mDocumentLoader.load(DOCUMENT_FILE_NAME, - sectionName, - &loadStatusOk); + loader->load(documentFullName, &loadStatusOk); + mLoadedObjects |= loadedObjects.toSet(); Q_ASSERT_X(loadStatusOk, - DOCUMENT_FILE_NAME.toLatin1().data(), + documentFullName.toLatin1().data(), "Error while loading docml file."); - HSMENUTEST_FUNC_EXIT("HsMenuViewBuilder::parseSection"); - - return loadStatusOk; -} - - -/*! - \return Line edit of the searchPanel on success, NULL otherwise. - */ -HbLineEdit *HsMenuViewBuilder::searchPanelLineEdit() const -{ - HSMENUTEST_FUNC_ENTRY("HsMenuViewBuilder::searchPanelLineEdit"); - - HbLineEdit *result(0); - - foreach(QGraphicsItem *obj, currentSearchPanel()->childItems()) { - - QGraphicsWidget *const widget = static_cast(obj); - - if (widget != NULL) { - - HbLineEdit *const lineEdit = qobject_cast(widget); + HSMENUTEST_FUNC_EXIT("HsMenuViewBuilder::parseDocument"); - if (lineEdit != NULL) { - result = lineEdit; - break; - } - } - } - HSMENUTEST_FUNC_EXIT("HsMenuViewBuilder::searchPanelLineEdit"); - - return result; -} - -/*! - Builds mapping between context and docml name buidling blocks. - */ -void HsMenuViewBuilder::init() -{ - mViewContextToStringMap[HsAllAppsContext] = "allApps"; - mViewContextToStringMap[HsAllCollectionsContext] = "allCollections"; - mViewContextToStringMap[HsInstalledAppsContext] = "installedApps"; - mViewContextToStringMap[HsCollectionContext] = "collection"; - mOperationalContextToStringMap[HsItemViewContext] = ""; - mOperationalContextToStringMap[HsSearchContext] = "Search"; - mOperationalContextToStringMap[HsButtonContext] = "Button"; - mOperationalContextToStringMap[HsEmptyLabelContext] = "EmptyLabel"; - + return loader; } /*! Sets view context. Not reflected in widgets returned by the builder until \a build is not run. */ -void HsMenuViewBuilder::setViewContext(HsViewContext viewContext) +void HsMenuViewBuilder::setStateContext(HsStateContext stateContext) { - mViewContext = viewContext; + mStateContext = stateContext; } /*! @@ -379,20 +321,23 @@ /*! Reads configuration for requested context and ensures search panel and corresponding vkb host are managed properly. + \return Document loader with objects for current context. */ -bool HsMenuViewBuilder::readContextConfiguration(HsViewContext viewContext, - HsOperationalContext operationalContext) +QSharedPointer HsMenuViewBuilder::readContextConfiguration() { - const QString sectionName = mViewContextToStringMap[viewContext] - + mOperationalContextToStringMap[operationalContext] - + "ViewDefinition"; + const QLatin1String documentName( + DOCUMENT_BASE_NAME_MAP[mStateContext][mOperationalContext]); - const bool result = parseSection(sectionName); + QSharedPointer loader = + parseDocument(QString(documentName)); - if (currentSearchPanel()) { - searchPanelVisibilityChange(mOperationalContext == HsSearchContext); - } - - return result; + return loader; } +/*! + \return Current context. + */ +HsMenuViewBuilder::Context HsMenuViewBuilder::context() const +{ + return Context(mStateContext, mOperationalContext); +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -16,12 +16,18 @@ */ #include "hsoperatorhandler.h" -#ifndef NO_QT_EXTENSIONS -#include "hsoperatorhandler_p.h" + +#include + +#ifdef QT_EXTENSIONS + #include "hsoperatorhandler_p.h" #else -#include + #include #endif + + + /*! \class HsOperatorHandler \ingroup group_hsmenustateplugin @@ -37,7 +43,7 @@ */ HsOperatorHandler::HsOperatorHandler(QObject *parent): QObject(parent), -#ifndef NO_QT_EXTENSIONS +#ifdef QT_EXTENSIONS m_q(new HsOperatorHandlerPrivate(this)) #else m_q(0) @@ -58,7 +64,7 @@ */ HbIcon HsOperatorHandler::icon() { -#ifndef NO_QT_EXTENSIONS +#ifdef QT_EXTENSIONS return m_q->icon(); #else return HbIcon(); @@ -71,7 +77,7 @@ */ QString HsOperatorHandler::text() { -#ifndef NO_QT_EXTENSIONS +#ifdef QT_EXTENSIONS return m_q->text(); #else return QString(); @@ -80,13 +86,64 @@ /*! - Open Operator application or related url + Open Operator application or related url action */ void HsOperatorHandler::action() { -#ifndef NO_QT_EXTENSIONS +#ifdef QT_EXTENSIONS m_q->action(); #endif } +/*! + Returns Operator Store presence value predefined in Central Repositoryicon + \retval true if Operator Store should be present in toolbar + */ +bool HsOperatorHandler::operatorStorePresent() +{ +#ifdef QT_EXTENSIONS + return m_q->operatorStorePresent(); +#else + return false; +#endif +} +/*! + Returns Ovi Store presence value predefined in Central Repositoryicon + \retval true if Ovi Store should be present in toolbar + */ +bool HsOperatorHandler::oviStorePresent() +{ +#ifdef QT_EXTENSIONS + return m_q->oviStorePresent(); +#else + return false; +#endif +} + +/*! + Returns if Operator Store should first in toolbar + \retval true if Operator Store should first in toolbar + */ +bool HsOperatorHandler::operatorStoreFirst() +{ +#ifdef QT_EXTENSIONS + return m_q->operatorStoreFirst(); +#else + return false; +#endif +} + +/*! + Prepares HbAction for Operator Store + \param HbAction to prepare + \retval HbAction prepared action + */ +HbAction *HsOperatorHandler::prepareOperatorStoreAction( + HbAction *const operatorAction) +{ + operatorAction->setIcon(icon()); + connect(operatorAction, SIGNAL(triggered()), this, SLOT(action())); + return operatorAction; +} + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler_p.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler_p.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler_p.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -14,21 +14,27 @@ * Description: hsoperatorhandler_p.cpp * */ -#ifndef NO_QT_EXTENSIONS +#ifdef QT_EXTENSIONS #include -#include #include #include "hsoperatorhandler_p.h" #include "hsmenuservice.h" #include "caentry.h" #include "caservice.h" -const int AppLibUid = 0x20022F97; -const int IconId = 0x00000001; -const int OperatorAppUid = 0x00000002; -const int OperatorUrl = 0x00000003; -const int OperatorText = 0x00000004; +const int AppLibUid = 0x20022F97; +const int IncludeOperatorStore = 0x00000001; +const int OperatorStoreType = 0x00000002; +const int OperatorStoreTitle = 0x00000003; +const int OperatorStoreURL = 0x00000004; +const int OperatorStoreIconSkinID = 0x00000005; +const int OperatorStoreApplication = 0x00000006; +const int OperatorStore1stPopUp = 0x00000007; +const int RemoveOviStore = 0x00000008; +const char *operatorStoreIconPath + = "z:/private/20022F35/customsvg/operatorstore.svg"; + // ======== MEMBER FUNCTIONS ======== @@ -38,9 +44,13 @@ */ HsOperatorHandlerPrivate::HsOperatorHandlerPrivate(QObject *parent): QObject(parent), + mOviStorePresent(false), + mOperatorStorePresent(false), + mStoreType(NoneType), mOperatorEntry(0), mIcon(), - mText() + mOperatorStoreTitle(), + mOperatorStoreFirst(false) { readCentralRepository(); } @@ -72,12 +82,39 @@ } /*! - Returns Operator icon predefined in Central Repositoryicon - \retval icon + Returns Operator title text predefined in Central Repositoryicon + \retval text */ QString HsOperatorHandlerPrivate::text() { - return mText; + return mOperatorStoreTitle; +} + +/*! + Returns Ovi Store presence value predefined in Central Repositoryicon + \retval true if Ovi Store should be present in toolbar + */ +bool HsOperatorHandlerPrivate::oviStorePresent() +{ + return mOviStorePresent; +} + +/*! + Returns Operator Store presence value predefined in Central Repositoryicon + \retval true if Operator Store should be present in toolbar + */ +bool HsOperatorHandlerPrivate::operatorStorePresent() +{ + return mOperatorStorePresent; +} + +/*! + Returns if Operator Store should first in toolbar + \retval true if Operator Store should first in toolbar + */ +bool HsOperatorHandlerPrivate::operatorStoreFirst() +{ + return mOperatorStoreFirst; } /*! @@ -87,41 +124,15 @@ */ HbIcon HsOperatorHandlerPrivate::createIcon(XQSettingsManager *crManager) { - qDebug("HsOperatorHandlerPrivate::createIcon"); - HbIcon icon; - - XQCentralRepositorySettingsKey iconKey(AppLibUid, IconId); - QVariant iconVarian = crManager->readItemValue( - iconKey, XQSettingsManager::TypeString); - - if (!iconVarian.isNull() && !iconVarian.toString().isEmpty()) { - qDebug() << "HsOperatorHandlerPrivate::createIcon" - << iconVarian.toString(); - icon = HbIcon(iconVarian.toString()); + QVariant variant = getVariantFromKey( + crManager, + OperatorStoreIconSkinID, + XQSettingsManager::TypeString); + if (!variant.isNull() && !variant.toString().isEmpty()) { + return HbIcon(variant.toString()); + } else { + return HbIcon(operatorStoreIconPath); } - return icon; -} - -/*! - Creates text based on Central Repository - \param crManager settings manager - \retval icon - */ -QString HsOperatorHandlerPrivate::readText(XQSettingsManager *crManager) -{ - qDebug("HsOperatorHandlerPrivate::readText"); - QString text; - - XQCentralRepositorySettingsKey textKey(AppLibUid, OperatorText); - QVariant textVariant = crManager->readItemValue( - textKey, XQSettingsManager::TypeString); - - if (!textVariant.isNull() && textVariant.isValid()) { - qDebug() << "HsOperatorHandlerPrivate::createIcon" - << textVariant.toString(); - text = textVariant.toString(); - } - return text; } /*! @@ -132,19 +143,14 @@ CaEntry *HsOperatorHandlerPrivate::createAppEntry( XQSettingsManager *crManager) { - qDebug("HsOperatorHandlerPrivate::createAppEntry"); - XQCentralRepositorySettingsKey appUidKey(AppLibUid, OperatorAppUid); - QVariant appUidVariant = crManager->readItemValue( - appUidKey, XQSettingsManager::TypeString); - - if (!appUidVariant.isNull() && !appUidVariant.toString().isEmpty()) { - qDebug() << "HsOperatorHandlerPrivate::createAppEntry" - << appUidVariant.toString(); - + QVariant variant = getVariantFromKey( + crManager, OperatorStoreApplication, XQSettingsManager::TypeString); + if (!variant.isNull()) { CaEntry *operatorEntry = new CaEntry; operatorEntry->setEntryTypeName(applicationTypeName()); operatorEntry->setAttribute( - applicationUidEntryKey(), appUidVariant.toString()); + applicationUidEntryKey(), variant.toString()); + return operatorEntry; } return NULL; @@ -158,20 +164,104 @@ CaEntry *HsOperatorHandlerPrivate::createUrlEntry( XQSettingsManager *crManager) { - qDebug("HsOperatorHandlerPrivate::createUrlEntry"); - CaEntry *operatorEntry = new CaEntry; + QVariant variant = getVariantFromKey( + crManager, OperatorStoreURL, XQSettingsManager::TypeString); + if (!variant.isNull()) { + CaEntry *operatorEntry = new CaEntry; + operatorEntry->setEntryTypeName(urlTypeName()); + operatorEntry->setAttribute(urlEntryKey(), variant.toString()); + + return operatorEntry; + } + return NULL; +} + - XQCentralRepositorySettingsKey urlKey(AppLibUid, OperatorUrl); - QVariant urlVariant = crManager->readItemValue( - urlKey, XQSettingsManager::TypeString); +/*! + Generic function to get stores presence values + \param crManager settings manager + \param storePresenceKey store key(Ovi or Operator) + \retval entry + */ +bool HsOperatorHandlerPrivate::storeValue( + XQSettingsManager *crManager, int storePresenceKey) +{ + QVariant variant = getVariantFromKey( + crManager, storePresenceKey, XQSettingsManager::TypeInt); + if (!variant.isNull()) { + return bool(variant.toInt()); + } + return false; +} + +/*! + Generic function to get QVariant for CR key + \param crManager settings manager + \param crKey CR key + \param type type of QVariant to be returned + \retval QVariant + */ +QVariant HsOperatorHandlerPrivate::getVariantFromKey( + XQSettingsManager *crManager, int crKey, XQSettingsManager::Type type) +{ + XQCentralRepositorySettingsKey presenceKey(AppLibUid, crKey); + QVariant presenceVariant = crManager->readItemValue( + presenceKey, type); - if (!urlVariant.isNull() && !urlVariant.toString().isEmpty()) { - operatorEntry->setEntryTypeName(urlTypeName()); - operatorEntry->setAttribute(urlEntryKey(), urlVariant.toString()); - qDebug() << "HsOperatorHandlerPrivate::createUrlEntry" - << urlVariant.toString(); + if (presenceVariant.isValid()) { + qDebug() << "HsOperatorHandlerPrivate::storePresent" + << presenceVariant.toInt(); + return presenceVariant; + } + return QVariant(); +} + +/*! + Generic function to get store type(Url/App) + \param crManager settings manager + \retval HsStoreType store type + */ +HsOperatorHandlerPrivate::HsStoreType + HsOperatorHandlerPrivate::operatorStoreType( + XQSettingsManager *crManager) +{ + QVariant variant = getVariantFromKey( + crManager, OperatorStoreType, XQSettingsManager::TypeInt); + if (!variant.isNull()) { + return HsOperatorHandlerPrivate::HsStoreType(variant.toInt()); } - return operatorEntry; + return NoneType; +} + +/*! + Creates text based on Central Repository + \param crManager settings manager + \retval icon + */ +QString HsOperatorHandlerPrivate::operatorStoreTitle(XQSettingsManager *crManager) +{ + QVariant variant = getVariantFromKey( + crManager, OperatorStoreTitle, XQSettingsManager::TypeString); + if (!variant.isNull()) { + return variant.toString(); + } + return QString(); +} + +/*! + Retrives information if Operator Store should first in toolbarbased + (from Central Repository) + \param crManager settings manager + \retval true if Operator Store should be first + */ +bool HsOperatorHandlerPrivate::operatorStoreFirst(XQSettingsManager *crManager) +{ + QVariant variant = getVariantFromKey( + crManager, OperatorStore1stPopUp, XQSettingsManager::TypeInt); + if (!variant.isNull()) { + return bool(variant.toInt()); + } + return false; } /*! @@ -180,12 +270,21 @@ void HsOperatorHandlerPrivate::readCentralRepository() { XQSettingsManager *crManager = new XQSettingsManager; + //this key indicates that ovi store should be removed + mOviStorePresent = !storeValue(crManager, RemoveOviStore); + //this key indicates that operator store should be added + mOperatorStorePresent = storeValue(crManager, IncludeOperatorStore); - mIcon = createIcon(crManager); - mText = readText(crManager); - mOperatorEntry = createAppEntry(crManager); - if (!mOperatorEntry) { - mOperatorEntry = createUrlEntry(crManager); + if (mOperatorStorePresent) { + mStoreType = operatorStoreType(crManager); + if (mStoreType == ApplicationType) { + mOperatorEntry = createAppEntry(crManager); + } else { + mOperatorEntry = createUrlEntry(crManager); + } + mOperatorStoreTitle = operatorStoreTitle(crManager); + mOperatorStoreFirst = operatorStoreFirst(crManager); + mIcon = createIcon(crManager); } delete crManager; } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hssearchview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hssearchview.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,349 @@ +/* + * 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: hssearchview.cpp + * + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "hslistviewitem.h" +#include "hsmainwindow.h" +#include "hssearchview.h" + +/*! + Set up proxy model for search. + \param builder Retrieves UI widgets. + \param stateContext Identifies the state where search starts from. + \param mainWindow Enables switching between originating and search view. + */ +HsSearchView::HsSearchView(HsMenuViewBuilder &builder, + HsStateContext stateContext, HsMainWindow &mainWindow) : + mProxyModel(new QSortFilterProxyModel(this)), mSearchView(NULL), + mSearchListView(NULL), mSearchPanel(NULL), mStateContext(stateContext), + mBuilder(builder), mMainWindow(mainWindow), mListView(NULL), + mVkbHost(NULL), mSearchViewBuilder(), mEmptyResultText(true) +{ + mProxyModel->setFilterRole(CaItemModel::TextRole); + mProxyModel->setFilterKeyColumn(1); + mProxyModel->setSortRole(CaItemModel::TextRole); +} + +/*! + Empty. + */ +HsSearchView::~HsSearchView() +{ +} + +/*! + Makes the UI to show or hide view search panel. + When search panel is shown the view toolbar and status pane + are hidden until search panel is hidden. + \param visible When true search panel will be shown, + otherwise it will be hidden. + */ +void HsSearchView::setSearchPanelVisible(bool visible) +{ + HSMENUTEST_FUNC_ENTRY("HsMenuView::setSearchPanelVisible"); + + if (visible && !isActive()) { + searchBegins(); + connectSearchItemViewsSignals(); + connectSearchPanelSignals(); + } else if (isActive()) { + disconnectSearchPanelSignals(); + disconnectSearchItemViewsSignals(); + searchFinished(); + } + HSMENUTEST_FUNC_EXIT("HsMenuView::setSearchPanelVisible"); +} + +/*! + \param view List view to operate on. + \return Index of F=first visible item of \a view if any + or default QModelIndex otherwise. + */ +QModelIndex HsSearchView::firstVisibleItemIndex(const HbListView *view) const +{ + const QList array = view->visibleItems(); + if (array.count()) { + return array[0]->modelIndex(); + } + return QModelIndex(); +} + +/*! + Displays search panel with view representing search results. + */ +void HsSearchView::searchBegins() +{ + HSMENUTEST_FUNC_ENTRY("HsSearchView::searchBegins"); + + setOriginatingContext(); + + mListView = mBuilder.currentListView(); + mSearchViewInitialIndex = firstVisibleItemIndex(mListView); + + mProxyModel->invalidate(); + mProxyModel->setSourceModel(mListView->model()); + mProxyModel->setFilterRegExp( + QRegExp(QString(".*"), Qt::CaseInsensitive, QRegExp::RegExp)); + + mSearchView = mSearchViewBuilder.searchView(); + mSearchListView = mSearchViewBuilder.searchListView(); + mSearchPanel = mSearchViewBuilder.searchPanel(); + initSearchPanel(*mSearchPanel); + mVkbHost.reset(new HbShrinkingVkbHost(mSearchView)); + + if (mBuilder.currentViewLabel()) { + mSearchViewBuilder.searchViewLabel()->setHeading( + mBuilder.currentViewLabel()->heading()); + mSearchViewBuilder.setSearchLabledContext(); + } + + mSearchView->hideItems(Hb::AllItems); + mSearchListView->setModel(mProxyModel, new HsListViewItem()); + + mMainWindow.setCurrentView(mSearchView); + + mSearchListView->scrollTo( + mProxyModel->mapFromSource(mSearchViewInitialIndex), + HbAbstractItemView::PositionAtTop); + + setNoResultsVisibility(); + HSMENUTEST_FUNC_EXIT("HsSearchView::searchBegins"); +} + +/*! + Handles button visibility. + \param visibility indicates whether show or not to show 'empty' label. + */ +void HsSearchView::setNoResultsVisibility() +{ + if (mProxyModel->rowCount() && mEmptyResultText) { + mSearchViewBuilder.loadViewListSection(); + mEmptyResultText = false; + } else if (!mProxyModel->rowCount() && !mEmptyResultText) { + mSearchViewBuilder.loadViewEmptySection(); + mEmptyResultText = true; + } +} + +/* + Connects \a activated and \a longPressed signals coming from search list + view to emit corresponding signal of this object with translated model index. +*/ +void HsSearchView::connectSearchItemViewsSignals() +{ + connect(mSearchListView, SIGNAL(activated(QModelIndex)), + this, SLOT(activatedProxySlot(QModelIndex))); + connect(mSearchListView, SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), + this, SLOT(longPressedProxySlot(HbAbstractViewItem *, QPointF))); +} + +/*! + Disconnects \a activated and \a longPressed signals coming from list + view from to emit corresponding signal + of this object with translated model index. +*/ +void HsSearchView::disconnectSearchItemViewsSignals() +{ + disconnect(mSearchListView, SIGNAL(activated(QModelIndex)), + this, SLOT(activatedProxySlot(QModelIndex))); + disconnect(mSearchListView, + SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), + this, SLOT(longPressedProxySlot(HbAbstractViewItem *, QPointF))); +} + + +/*! + Makes search panel invisible. + Equivalent to \a setSearchPanelVisible(false). + */ +void HsSearchView::hideSearchPanel() +{ + HSMENUTEST_FUNC_ENTRY("HsMenuView::hideSearchPanel"); + setSearchPanelVisible(false); + HSMENUTEST_FUNC_EXIT("HsMenuView::hideSearchPanel"); +} + +/*! + Connects signals \a exitClicked and \a criteriaChanged emitted + by search panel with handling slots of the object or its members. +*/ +void HsSearchView::connectSearchPanelSignals() +{ + connect(mProxyModel, SIGNAL(rowsInserted(QModelIndex, int, int)), + this, SLOT(setNoResultsVisibility())); + connect(mProxyModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), + this, SLOT(setNoResultsVisibility())); + connect(mSearchPanel, SIGNAL(exitClicked()), + this, SLOT(hideSearchPanel())); + connect(mSearchPanel, SIGNAL(criteriaChanged(QString)), + this, SLOT(findItem(QString))); +} + +/*! + Disconnects signals \a exitClicked and \a criteriaChanged emitted + by search panel from handling slots of the object or its members + Scrolls view to state before connections. +*/ +void HsSearchView::disconnectSearchPanelSignals() +{ + mProxyModel->disconnect(this); + mSearchPanel->disconnect(this); +} + +/*! + Scrolls originating view to first item matching search criteria. + */ +void HsSearchView::searchFinished() +{ + HSMENUTEST_FUNC_ENTRY("HsSearchView::searchFinished"); + + mIndexToScrollAfterSearchDone = firstVisibleItemIndex(mSearchListView); + + setOriginatingContext(); + + mMainWindow.setCurrentView(mBuilder.currentView()); + + mListView->scrollTo(mProxyModel->mapToSource( + mIndexToScrollAfterSearchDone), + HbAbstractItemView::PositionAtTop); + + HbVkbHost::detachHost(mSearchView); + mVkbHost.reset(NULL); + mSearchListView = NULL; + mSearchPanel = NULL; + mProxyModel->setSourceModel(NULL); + HSMENUTEST_FUNC_EXIT("HsSearchView::searchFinished"); +} + +/*! + Looks up for item and if found scrolls to it. + \param criteriaStr The item name to find. + */ +void HsSearchView::findItem(QString criteriaStr) +{ + qDebug() << "HsSearchView::findItem: " + criteriaStr; + HSMENUTEST_FUNC_ENTRY("HsSearchView::findItem"); + + mProxyModel->setFilterRegExp( + QRegExp("(^|\\b)" + criteriaStr, Qt::CaseInsensitive)); + + mSearchListView->scrollTo( + mProxyModel->index(0,0), HbAbstractItemView::PositionAtTop); + + HSMENUTEST_FUNC_EXIT("HsSearchView::findItem"); +} + +/*! + Slot used to translate activated signal from proxy model to normal model. + \param index Represents an item activated in search list view. + */ +void HsSearchView::activatedProxySlot(const QModelIndex &index) +{ + emit activated(mProxyModel->mapToSource(index)); +} + +/*! + Slot used to forward 'long pressed' signal with item description transladed + from search view context to context of the view search was requested from. + \param item Long pressed item. + \param coords Coordinates of the long press action. + */ +void HsSearchView::longPressedProxySlot( + HbAbstractViewItem *item, const QPointF &coords) +{ + /* + this is a kind of hack, introduced for reasons: + item object should be reusable later, but orbit (or qt) prevents setting + its index model to previous state + */ + mSearchViewLongPressedIndex = mProxyModel->mapToSource( + item->modelIndex()); + QScopedPointer itemNew(item->createItem()); + itemNew->setModelIndex(mSearchViewLongPressedIndex); + emit longPressed(itemNew.data(), coords); +} + +/*! + Sets up search panel. + + \param searchPanel Search panel to initialize. + */ +void HsSearchView::initSearchPanel(HbSearchPanel &searchPanel) +{ + HbLineEdit *const lineEdit(searchPanelLineEdit(searchPanel)); + + lineEdit->setText(""); + lineEdit->setFocus(); + lineEdit->setInputMethodHints( + Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase); +} + +/*! + \param searchPanel Search panel to operate on. + \return Line edit of the searchPanel on success, NULL otherwise. + */ +HbLineEdit *HsSearchView::searchPanelLineEdit( + HbSearchPanel &searchPanel) const +{ + HSMENUTEST_FUNC_ENTRY("HsSearchView::searchPanelLineEdit"); + + HbLineEdit *result(0); + foreach(QGraphicsItem *obj, searchPanel.childItems()) { + QGraphicsWidget *const widget = static_cast(obj); + if (widget != NULL) { + HbLineEdit *const lineEdit = qobject_cast(widget); + if (lineEdit != NULL) { + result = lineEdit; + break; + } + } + } + HSMENUTEST_FUNC_EXIT("HsSearchView::searchPanelLineEdit"); + + return result; +} + +/*! + Sets the builder context to the one determined by \a mStateContext and + \a HsItemViewContext. + */ +void HsSearchView::setOriginatingContext() +{ + mBuilder.setStateContext(mStateContext); + mBuilder.setOperationalContext(HsItemViewContext); +} + +/*! + \retval true when search view is already invoked, \a false otherwise. + */ +bool HsSearchView::isActive() const +{ + return mSearchListView != NULL; +} + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hssearchviewbuilder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hssearchviewbuilder.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,151 @@ +/* + * 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: Search View Builder + * + */ + +#include +#include +#include +#include +#include "hssearchviewbuilder.h" + +const char *searchDocmlFile = ":/xml/searchview.docml"; +const char *searchViewLabeledList = "searchViewLabeledList"; +const char *searchViewList = "searchViewList"; +const char *searchViewLabeledEmpty = "searchViewLabeledEmpty"; +const char *searchViewEmpty = "searchViewEmpty"; + + +/*! + \class HsSearchViewBuilder + \ingroup group_hsmenustateplugin + + \brief Search View Builder + + Reads UI object from Application Library Search docml + + \sa HsMenuView +*/ + +/*! + Constructor. Loads UI objects from docml. + */ +HsSearchViewBuilder::HsSearchViewBuilder() : mLoader(new HbDocumentLoader()), + mLabledContext(false) +{ + bool loadStatusOk(false); + mLoadedObjects = + mLoader->load(searchDocmlFile, &loadStatusOk).toSet(); + Q_ASSERT(loadStatusOk); +} + +/*! + Destructor. Deletes seto of loaded objects. + */ +HsSearchViewBuilder::~HsSearchViewBuilder() +{ + qDeleteAll(mLoadedObjects); +} + +/*! + \return Pointer to the view. + Memory ownership is not changed. + */ +HbView *HsSearchViewBuilder::searchView() +{ + return qobject_cast(mLoader->findWidget("view")); +} + +/*! + \return Pointer to list view. + The pointer is valid until the HsSearchViewBuilder instance is destroyed. + Memory ownership is not changed. + */ +HbListView *HsSearchViewBuilder::searchListView() +{ + return qobject_cast(mLoader->findWidget("listView")); +} + +/*! + \return Pointer to search panel. + The pointer is valid until the HsSearchViewBuilder instance is destroyed. + Memory ownership is not changed. + */ +HbSearchPanel *HsSearchViewBuilder::searchPanel() +{ + return qobject_cast(mLoader->findWidget("searchPanel")); +} + +/*! + \return Pointer to the view label. + The pointer is valid until the HsSearchViewBuilder instance is destroyed. + Memory ownership is not changed. + */ +HbGroupBox *HsSearchViewBuilder::searchViewLabel() +{ + return qobject_cast(mLoader->findWidget("label")); +} + +/*! + Switches HsSearchViewBuilder to labeled view layout. + */ +void HsSearchViewBuilder::setSearchLabledContext() +{ + mLabledContext = true; +} + +/*! + \return true if section was succesfull loaded. + Loads proper empty docml section. + */ +bool HsSearchViewBuilder::loadViewEmptySection() +{ + bool loadStatusOk(false); + if(mLabledContext) { + mLoadedObjects |= mLoader->load( + searchDocmlFile, + searchViewLabeledEmpty, + &loadStatusOk).toSet(); + } else { + mLoadedObjects |= mLoader->load( + searchDocmlFile, + searchViewEmpty, + &loadStatusOk).toSet(); + } + Q_ASSERT(loadStatusOk); + return loadStatusOk; +} + +/*! + \return true if section was succesfull loaded. + Loads proper list docml section. + */ +bool HsSearchViewBuilder::loadViewListSection() +{ + bool loadStatusOk(false); + if(mLabledContext) { + mLoadedObjects |= mLoader->load( + searchDocmlFile, + searchViewLabeledList, + &loadStatusOk).toSet(); + } else { + mLoadedObjects |= mLoader->load( + searchDocmlFile, + searchViewList, + &loadStatusOk).toSet(); + } + Q_ASSERT(loadStatusOk); + return loadStatusOk; +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hshomescreenstateplugin/hshomescreenstateplugin.pro --- a/homescreenapp/stateplugins/hshomescreenstateplugin/hshomescreenstateplugin.pro Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/hshomescreenstateplugin.pro Wed Aug 18 09:40:07 2010 +0300 @@ -29,7 +29,7 @@ HB += hbfeedback CONFIG += plugin hb mobility -MOBILITY = serviceframework +MOBILITY = serviceframework systeminfo PLUGIN_SUBDIR = /private/20022F35/plugins/stateplugins @@ -39,7 +39,6 @@ -lhsdomainmodel \ -lhsmenuserviceprovider -RESOURCES += hshomescreenstateplugin.qrc symbian: { TARGET.UID3 = 0x20022F41 diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hshomescreenstateplugin/hshomescreenstateplugin.qrc --- a/homescreenapp/stateplugins/hshomescreenstateplugin/hshomescreenstateplugin.qrc Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ - - - resource/controllayer.docml - - diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsdocumentloader.h --- a/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsdocumentloader.h Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Homescreen document loader class. -* -*/ - -#ifndef HSDOCUMENTLOADER_H -#define HSDOCUMENTLOADER_H - -#include -#include "hstest_global.h" - -HOMESCREEN_TEST_CLASS(HomeScreenStatePluginTest) - -class HsDocumentLoader : public HbDocumentLoader -{ -public: - HsDocumentLoader(); - virtual ~HsDocumentLoader(); - -public: - QObject *createObject(const QString &type, const QString &name); - -private: - - Q_DISABLE_COPY(HsDocumentLoader) - - HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest) -}; - -#endif diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlestate.h --- a/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlestate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlestate.h Wed Aug 18 09:40:07 2010 +0300 @@ -31,11 +31,11 @@ class QGraphicsItem; class QGraphicsSceneMouseEvent; -class QPropertyAnimation; + class QGestureEvent; class HbAction; class HbContinuousFeedback; -class HsIdleWidget; + class HsTitleResolver; class QParallelAnimationGroup; class HbMenu; @@ -44,6 +44,9 @@ #endif class HsWidgetHost; +class HsPage; +class HsMessageBoxWrapper; + class HsIdleState : public QState { @@ -60,6 +63,7 @@ void event_moveScene(); void event_selectWallpaper(); void event_addPage(); + void event_preRemovePage(); void event_removePage(); void event_toggleConnection(); @@ -78,8 +82,6 @@ void addPageToScene(int pageIndex); void updateZoneAnimation(); void showTrashBin(); - void removeActivePage(); - void deleteZoneAnimation(); QList createInactiveWidgetRects(); void updatePagePresentationToWidgetSnap(); void resetSnapPosition(); @@ -117,6 +119,9 @@ void action_moveScene_moveToNearestPage(); void action_moveScene_disconnectGestureHandlers(); void action_addPage_addPage(); + void action_preRemovePage_showQuery(); + void action_preRemovePage_exit(); + void action_removePage_startRemovePageAnimation(); void action_removePage_removePage(); void action_toggleConnection_toggleConnection(); void action_idle_setupTitle(); @@ -136,18 +141,17 @@ bool openTaskSwitcher(); void zoneAnimationFinished(); void pageChangeAnimationFinished(); - void onRemovePageConfirmationOk(); void onVerticalSnapLineTimerTimeout(); void onHorizontalSnapLineTimerTimeout(); void onActivePageChanged(); - + private: HbAction *mNavigationAction; - HsIdleWidget *mUiWidget; + HsTitleResolver *mTitleResolver; - QPropertyAnimation *mZoneAnimation; + bool mAllowZoneAnimation; - QPropertyAnimation *mPageChangeAnimation; + HbContinuousFeedback *mContinuousFeedback; bool mTrashBinFeedbackAlreadyPlayed; QPointF mPageHotSpot; @@ -157,12 +161,13 @@ QPointer mSceneMenu; HsWidgetPositioningOnWidgetMove::Result mSnapResult; HsWidgetPositioningOnWidgetMove::Result mPreviousSnapResult; - qreal mSnapBorderGap; QTimer mVerticalSnapLineTimer; - QTimer mHorizontalSnapLineTimer; + QTimer mHorizontalSnapLineTimer; #ifdef Q_OS_SYMBIAN XQSettingsManager *mSettingsMgr; #endif + HsMessageBoxWrapper *mMessageBoxWrapper; + HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest) }; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlewidget.h --- a/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlewidget.h Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef HSIDLEWIDGET_H -#define HSIDLEWIDGET_H - -#include - -#include "hstest_global.h" -HOMESCREEN_TEST_CLASS(HomeScreenStatePluginTest) - -class HsPage; -class HsTrashBinWidget; -class HsPageIndicator; -class HsSnapLine; - -class HsIdleWidget : public HbWidget -{ - Q_OBJECT - Q_PROPERTY(qreal sceneX READ sceneX WRITE setSceneX) - -public: - HsIdleWidget(QGraphicsItem *parent = 0); - ~HsIdleWidget(); - - qreal sceneX() const; - void setSceneX(qreal x); - - void setGeometry(const QRectF &rect); - - void setActivePage(int index); - void insertPage(int index, HsPage *page); - void removePage(int index); - - HbWidget *controlLayer() const { return mControlLayer; } - HbWidget *pageLayer() const { return mPageLayer; } - HbWidget *pageWallpaperLayer() const { return mPageWallpaperLayer; } - HbWidget *sceneLayer() const { return mSceneLayer; } - - HsTrashBinWidget *trashBin() const { return mTrashBin; } - HsPageIndicator *pageIndicator() const { return mPageIndicator; } - - qreal parallaxFactor() const; - - -public slots: - void showTrashBin(); - void showPageIndicator(); - - void showVerticalSnapLine(const QLineF &snapLine); - void hideVerticalSnapLine(); - void showHorizontalSnapLine(const QLineF &snapLine); - void hideHorizontalSnapLine(); - -protected: - void polishEvent(); - -private: - Q_DISABLE_COPY(HsIdleWidget) - void loadControlLayer(); - -private: - HbWidget *mControlLayer; - HbWidget *mPageLayer; - HbWidget *mPageWallpaperLayer; - HbWidget *mSceneLayer; - - HsTrashBinWidget *mTrashBin; - HsPageIndicator *mPageIndicator; - - HsSnapLine *mHorizontalSnapLine; - HsSnapLine *mVerticalSnapLine; - - HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest) -}; - -#endif // HSIDLEWIDGET_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hshomescreenstateplugin/resource/controllayer.docml --- a/homescreenapp/stateplugins/hshomescreenstateplugin/resource/controllayer.docml Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hshomescreenstateplugin/src/hsbackuprestorestate.cpp --- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsbackuprestorestate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsbackuprestorestate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -27,6 +27,7 @@ #include "hsscene.h" #include "hsgui.h" + /*! \class HsBackupRestoreState \ingroup group_hshomescreenstateplugin @@ -95,12 +96,5 @@ void HsBackupRestoreState::deleteIdleView() { // Delete idle view - QScopedPointer idleView(HsGui::takeIdleView()); - - if (idleView){ - HbAction *navigationAction(idleView->navigationAction()); - idleView->setNavigationAction(0); - delete navigationAction; - HsScene::mainWindow()->removeView(idleView.data()); - } + HsGui::instance()->cleanupIdleUi(); } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hshomescreenstateplugin/src/hsdocumentloader.cpp --- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsdocumentloader.cpp Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Homescreen document loader class. -* -*/ - -#include "hsdocumentloader.h" -#include "hspageindicator.h" -#include "hstrashbinwidget.h" -#include "hsconfiguration.h" - -/*! - \class HsDocumentLoader - \ingroup group_hshomescreenstateplugin - \brief Homescreen document loader class. - - Loads own widgets from docml. -*/ - -/*! - Constructor. -*/ -HsDocumentLoader::HsDocumentLoader() - : HbDocumentLoader() -{ -} - -/*! - Destructor. -*/ -HsDocumentLoader::~HsDocumentLoader() -{ -} - -/*! - Looks up an object which inherits class type and of which object name equals to name. - \a type type of the desired object. - \a name object name of the desired object. - */ -QObject *HsDocumentLoader::createObject(const QString &type, const QString &name) -{ - if (type == HsPageIndicator::staticMetaObject.className()) { - QObject *object = new HsPageIndicator(HSCONFIGURATION_GET(pageIndicatorSpacing)); - object->setObjectName(name); - return object; - } - else if (type == HsTrashBinWidget::staticMetaObject.className()) { - QObject *object = new HsTrashBinWidget; - object->setObjectName(name); - return object; - } - - return HbDocumentLoader::createObject(type, name); -} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp --- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -42,7 +42,9 @@ #include "hsdomainmodeldatastructures.h" #include "hsscene.h" #include "hspage.h" +#include "hspagevisual.h" #include "hswidgethost.h" +#include "hswidgethostvisual.h" #include "hswallpaper.h" #include "hswallpaperselectionstate.h" #include "hstrashbinwidget.h" @@ -51,19 +53,15 @@ #include "hshomescreenstatecommon.h" #include "hstitleresolver.h" #include "hsmenuservice.h" +#include "hsconfiguration.h" +#include "hsmessageboxwrapper.h" +#include "hspropertyanimationwrapper.h" #include "hsgui.h" -#include "hsconfiguration.h" -// Helper macros for connecting state entry and exit actions. -#define ENTRY_ACTION(state, action) \ - connect(state, SIGNAL(entered()), SLOT(action())); -#define EXIT_ACTION(state, action) \ - connect(state, SIGNAL(exited()), SLOT(action())); namespace { - const char gApplicationLibraryIconName[] = "qtg_mono_applications_all"; - + //User adds a new page to home screen const char hsLocTextId_OptionsMenu_AddPage[] = "txt_homescreen_opt_add_page"; @@ -90,13 +88,15 @@ //Text in confirmation dialog while removing page with content const char hsLocTextId_Confirmation_RemovePage[] = "txt_homescreen_info_page_and_content_will_be_remov"; - - //Button in confirmation dialog while removing page with content - const char hsLocTextId_ConfirmationButton_Ok[] = "txt_homescreen_button_ok"; +} - //Button in confirmation dialog while removing page with content - const char hsLocTextId_ConfirmationButton_Cancel[] = "txt_homescreen_button_cancel"; -} +// Helper macros for connecting state entry and exit actions. +#define ENTRY_ACTION(state, action) \ + connect(state, SIGNAL(entered()), SLOT(action())); +#define EXIT_ACTION(state, action) \ + connect(state, SIGNAL(exited()), SLOT(action())); + + /*! \class HsIdleState @@ -114,23 +114,22 @@ */ HsIdleState::HsIdleState(QState *parent) : QState(parent), - mNavigationAction(0), mUiWidget(0), + mNavigationAction(0), mTitleResolver(0), - mZoneAnimation(0), mAllowZoneAnimation(false), - mPageChangeAnimation(0), mContinuousFeedback(0), mTrashBinFeedbackAlreadyPlayed(false), mDeltaX(0), - mSceneMenu(0), - mSnapBorderGap(0.0) + mSceneMenu(0) #ifdef Q_OS_SYMBIAN ,mSettingsMgr(0) #endif + ,mMessageBoxWrapper(0) + { setupStates(); mTitleResolver = new HsTitleResolver(this); - + // TODO: Uncomment when updated API available //mContinuousFeedback = new HbContinuousFeedback; //mContinuousFeedback->setContinuousEffect(HbFeedback::ContinuousSmooth); @@ -145,7 +144,6 @@ */ HsIdleState::~HsIdleState() { - delete mZoneAnimation; // TODO: Uncomment when updated API available //delete mContinuousFeedback; } @@ -231,6 +229,7 @@ HsWallpaperSelectionState *state_wallpaperSelectionState = new HsWallpaperSelectionState(this); QState *state_addPage = new QState(this); + QState *state_preRemovePage = new QState(this); QState *state_removePage = new QState(this); QState *state_toggleConnection = new QState(this); @@ -239,7 +238,7 @@ state_waitInput->addTransition( this, SIGNAL(event_addPage()), state_addPage); state_waitInput->addTransition( - this, SIGNAL(event_removePage()), state_removePage); + this, SIGNAL(event_preRemovePage()), state_preRemovePage); state_waitInput->addTransition( this, SIGNAL(event_toggleConnection()), state_toggleConnection); state_waitInput->addTransition( @@ -259,8 +258,15 @@ state_wallpaperSelectionState, SIGNAL(event_waitInput()), state_waitInput); state_addPage->addTransition(state_waitInput); + + state_preRemovePage->addTransition( + this,SIGNAL(event_removePage()),state_removePage); + + state_preRemovePage->addTransition( + this,SIGNAL(event_waitInput()),state_waitInput); - state_removePage->addTransition(state_waitInput); + state_removePage->addTransition( + this,SIGNAL(event_waitInput()),state_waitInput); state_toggleConnection->addTransition(state_waitInput); @@ -299,8 +305,12 @@ EXIT_ACTION(state_moveScene, action_moveScene_disconnectGestureHandlers) ENTRY_ACTION(state_addPage, action_addPage_addPage) + + ENTRY_ACTION(state_preRemovePage, action_preRemovePage_showQuery) + EXIT_ACTION(state_preRemovePage, action_preRemovePage_exit); - ENTRY_ACTION(state_removePage, action_removePage_removePage) + ENTRY_ACTION(state_removePage, action_removePage_startRemovePageAnimation) + EXIT_ACTION(state_removePage, action_removePage_removePage) ENTRY_ACTION(state_toggleConnection, action_toggleConnection_toggleConnection) } @@ -310,7 +320,7 @@ */ qreal HsIdleState::pageLayerXPos(int pageIndex) const { - return -pageIndex * HsScene::mainWindow()->layoutRect().width(); + return -pageIndex * HsGui::instance()->layoutRect().width(); } /*! @@ -319,25 +329,31 @@ */ void HsIdleState::startPageChangeAnimation(int targetPageIndex, int duration) { - if (!mPageChangeAnimation) { - mPageChangeAnimation = new QPropertyAnimation(mUiWidget, "sceneX"); + HsPropertyAnimationWrapper *animation = HsGui::instance()->pageChangeAnimation(); + if (animation->isRunning()) { + animation->stop(); + } + animation->disconnect(this); + animation->setEndValue(pageLayerXPos(targetPageIndex)); + animation->setDuration(duration); + + if (abs(mDeltaX) < HSCONFIGURATION_GET(pageChangePanDistanceInPixels)) { + animation->setEasingCurve(HSCONFIGURATION_GET(bounceAnimationEasingCurve)); } - else if (mPageChangeAnimation->state() != QAbstractAnimation::Stopped) { - mPageChangeAnimation->stop(); - } - - mPageChangeAnimation->setEndValue(pageLayerXPos(targetPageIndex)); - mPageChangeAnimation->setDuration(duration); - connect(mPageChangeAnimation, + else { + animation->setEasingCurve(HSCONFIGURATION_GET(pageChangeAnimationEasingCurve)); + } + + connect(animation, SIGNAL(finished()), SLOT(pageChangeAnimationFinished()), Qt::UniqueConnection); - mPageChangeAnimation->start(); + animation->start(); HbInstantFeedback::play(HSCONFIGURATION_GET(pageChangeFeedbackEffect)); - mUiWidget->showPageIndicator(); - mUiWidget->setActivePage(targetPageIndex); + HsGui::instance()->idleWidget()->showPageIndicator(); + HsGui::instance()->idleWidget()->setActivePage(targetPageIndex); } /*! @@ -358,25 +374,25 @@ return; } - if (!mZoneAnimation) { - mZoneAnimation = new QPropertyAnimation(mUiWidget, "sceneX"); - } - int bounceEffect = HSCONFIGURATION_GET(bounceEffect); + + HsPropertyAnimationWrapper *pageCrawlingAnimation = + HsGui::instance()->pageCrawlingAnimation(); if (isInLeftPageChangeZone()) { - mZoneAnimation->setEndValue(pageLayerXPos(scene->activePageIndex()) + bounceEffect); + pageCrawlingAnimation->setEndValue(pageLayerXPos(scene->activePageIndex()) + bounceEffect); } else { - mZoneAnimation->setEndValue(pageLayerXPos(scene->activePageIndex()) - bounceEffect); + pageCrawlingAnimation->setEndValue(pageLayerXPos(scene->activePageIndex()) - bounceEffect); } - mZoneAnimation->setDuration(duration); - mZoneAnimation->setDirection(QAbstractAnimation::Forward); + pageCrawlingAnimation->setDuration(duration); + pageCrawlingAnimation->setForward(); - connect(mZoneAnimation, + connect(pageCrawlingAnimation, SIGNAL(finished()), - SLOT(zoneAnimationFinished())); + SLOT(zoneAnimationFinished()), + Qt::UniqueConnection); - mZoneAnimation->start(); + pageCrawlingAnimation->start(); } /*! @@ -404,7 +420,7 @@ */ bool HsIdleState::isInRightPageChangeZone() { - qreal pageWidth = HsScene::mainWindow()->layoutRect().width(); + qreal pageWidth = HsGui::instance()->layoutRect().width(); return mWidgetHotSpot.x() > pageWidth - HSCONFIGURATION_GET(pageChangeZoneWidth); } @@ -418,7 +434,7 @@ HsPage *page = HsPage::createInstance(data); page->load(); HsScene::instance()->addPage(page); - mUiWidget->insertPage(pageIndex, page); + HsGui::instance()->idleWidget()->insertPage(pageIndex, page); } /*! @@ -426,26 +442,25 @@ */ void HsIdleState::updateZoneAnimation() { - if (isInPageChangeZone() && mAllowZoneAnimation) { - if (!mZoneAnimation && (!mPageChangeAnimation - || mPageChangeAnimation->state() == QAbstractAnimation::Stopped )) { + HsPropertyAnimationWrapper *pageCrawlingAnimation = + HsGui::instance()->pageCrawlingAnimation(); + + if (!mAllowZoneAnimation) { + pageCrawlingAnimation->stop(); + } else if (isInPageChangeZone()) { + // should we start it + if (!pageCrawlingAnimation->isRunning() && + !HsGui::instance()->pageChangeAnimation()->isRunning()) { startPageChangeZoneAnimation(HSCONFIGURATION_GET(pageChangeZoneAnimationDuration)); - } - } else if (mZoneAnimation && !isInPageChangeZone()) { - if (mZoneAnimation->state() == QAbstractAnimation::Running) { - if (mZoneAnimation->direction() == QAbstractAnimation::Forward) { - mZoneAnimation->setDuration(HSCONFIGURATION_GET(pageChangeZoneReverseAnimationDuration)); - mZoneAnimation->setDirection(QAbstractAnimation::Backward); - } - } else { - // Out of the page change zone. Delete animation. - deleteZoneAnimation(); - } - } else if (!isInPageChangeZone()) { - if (mZoneAnimation) { - mZoneAnimation->stop(); - } - } + } + } else if (pageCrawlingAnimation->isRunning()) { + // Not in zone, but still running + if (pageCrawlingAnimation->isForward()){ + // reverse + pageCrawlingAnimation->setDuration(HSCONFIGURATION_GET(pageChangeZoneReverseAnimationDuration)); + pageCrawlingAnimation->setBackward(); + } + } } /*! @@ -453,87 +468,32 @@ */ void HsIdleState::showTrashBin() { - if (mUiWidget->trashBin()->isUnderMouse()) { + if (HsGui::instance()->idleWidget()->trashBin()->isUnderMouse()) { if (!mTrashBinFeedbackAlreadyPlayed) { HbInstantFeedback::play(HSCONFIGURATION_GET(widgetOverTrashbinFeedbackEffect)); mTrashBinFeedbackAlreadyPlayed = true; } - mUiWidget->trashBin()->activate(); + HsGui::instance()->idleWidget()->trashBin()->activate(); } else { - mUiWidget->trashBin()->deactivate(); + HsGui::instance()->idleWidget()->trashBin()->deactivate(); mTrashBinFeedbackAlreadyPlayed = false; } - if (!mUiWidget->pageIndicator()->isAnimationRunning()) { - mUiWidget->showTrashBin(); + if (!HsGui::instance()->idleWidget()->pageIndicator()->isAnimationRunning()) { + HsGui::instance()->idleWidget()->showTrashBin(); } } /*! - Removes currently active page. -*/ -void HsIdleState::removeActivePage() -{ - HsScene *scene = HsScene::instance(); - HsPage *page = scene->activePage(); - - int pageIndex = scene->activePageIndex(); - - mUiWidget->removePage(pageIndex); - scene->removePage(page); - - if (page->wallpaper()) { - page->wallpaper()->remove(); - } - delete page; - - pageIndex = pageIndex == 0 ? 0 : pageIndex - 1; - scene->setActivePageIndex(pageIndex); - - startPageChangeAnimation(pageIndex, HSCONFIGURATION_GET(pageRemovedAnimationDuration)); - - mUiWidget->pageIndicator()->removeItem(pageIndex); - mUiWidget->setActivePage(pageIndex); - mUiWidget->showPageIndicator(); -} - -/*! - Deletes page change zone animation. -*/ -void HsIdleState::deleteZoneAnimation() -{ - delete mZoneAnimation; - mZoneAnimation = NULL; -} - -/*! If called for the first time, setups the idle view. Updates the soft key action and sets the idle view as the current view to the main window. */ void HsIdleState::action_idle_setupView() { - HbView *idleView = HsGui::idleView(); - if (!idleView) { - mUiWidget = new HsIdleWidget; - idleView = HsScene::mainWindow()->addView(mUiWidget); - idleView->setContentFullScreen(); + HsGui::instance()->setupIdleUi(); + connect(HsGui::instance(),SIGNAL(navigateToApplibrary()),SIGNAL(event_applicationLibrary()),Qt::UniqueConnection); - mNavigationAction = new HbAction(this); - mNavigationAction->setIcon(HbIcon(gApplicationLibraryIconName)); - mNavigationAction->setObjectName("applib_navigation_action"); - connect(mNavigationAction, SIGNAL(triggered()), SIGNAL(event_applicationLibrary())); - idleView->setNavigationAction(mNavigationAction); - - HsGui::setIdleView(idleView); - - if (mPageChangeAnimation) { - delete mPageChangeAnimation; - mPageChangeAnimation = NULL; - } - } - - HsScene::mainWindow()->setCurrentView(idleView); } /*! @@ -553,7 +513,7 @@ void HsIdleState::onTitleChanged(QString title) { qDebug() << "HsIdleState::onTitleChanged() to title: " << title; - HsGui::idleView()->setTitle(title); + HsGui::instance()->idleView()->setTitle(title); } /*! @@ -587,9 +547,6 @@ mTitleResolver->disconnect(this); } -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT /*! */ @@ -617,9 +574,6 @@ mSceneMenu->setPreferredPos(mPageHotSpot); mSceneMenu->open(); } -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT void HsIdleState::onPagePanStarted(QGestureEvent *event) { @@ -636,11 +590,11 @@ HsScene *scene = HsScene::instance(); int bounceEffect = HSCONFIGURATION_GET(bounceEffect); - qreal x = qBound(pageLayerXPos(scene->pages().count() - 1) - bounceEffect / 2 / mUiWidget->parallaxFactor(), + qreal x = qBound(pageLayerXPos(scene->pages().count() - 1) - bounceEffect / 2 / HsGui::instance()->idleWidget()->parallaxFactor(), pageLayerXPos(scene->activePageIndex()) + mDeltaX, - pageLayerXPos(0) + (bounceEffect / 2 / mUiWidget->parallaxFactor())); + pageLayerXPos(0) + (bounceEffect / 2 / HsGui::instance()->idleWidget()->parallaxFactor())); - mUiWidget->setSceneX(x); + HsGui::instance()->idleWidget()->setSceneX(x); } void HsIdleState::onPagePanFinished(QGestureEvent *event) @@ -666,41 +620,42 @@ mWidgetHotSpot = qobject_cast( event->gesture(Qt::TapAndHoldGesture))->scenePosition(); - mWidgetHotSpotOffset = mWidgetHotSpot - widget->pos(); + mWidgetHotSpotOffset = mWidgetHotSpot - widget->visual()->pos(); emit event_moveWidget(); } void HsIdleState::onWidgetMoveUpdated(const QPointF &scenePos, HsWidgetHost *widget) { - HsScene *scene = HsScene::instance(); - QRectF widgetRect = widget->geometry(); + QRectF widgetRect = widget->visual()->geometry(); - // Move widget to new position. + // Move widget to updated position. mWidgetHotSpot = scenePos; - widgetRect.moveTopLeft(mWidgetHotSpot - mWidgetHotSpotOffset); - // Widget can be moved over the pages left border. + // When moving widget can go over the pages left border. qreal lowerBoundX = -widgetRect.width(); - HsPage *page = scene->activePage(); - QRectF pageRect = HsGui::idleView()->rect(); - // Widget can be moved over the pages right border. + + // When moving widget can go over the pages right border. + QRectF pageRect = HsGui::instance()->idleView()->rect(); qreal upperBoundX = pageRect.width(); + // When moving widget can go under the chrome at the pages upper border. // Notice that chrome height is 64 pixels. qreal lowerBoundY = qreal(64) - widgetRect.height(); - // Widget can be moved over the pages down border. + + // When moving widget can go over the pages down border. qreal upperBoundY = pageRect.height(); qreal widgetX = qBound(lowerBoundX, widgetRect.x(), upperBoundX); qreal widgetY = qBound(lowerBoundY, widgetRect.y(), upperBoundY); + // If using ItemClipsChildrenToShape-flag in widgethost then // setPos does not update position here, however setGeometry does it, QT bug? - widget->setGeometry(widgetX, widgetY, widgetRect.width(), widgetRect.height()); + widget->visual()->setGeometry(widgetX, widgetY, widgetRect.width(), widgetRect.height()); if (HSCONFIGURATION_GET(isSnapEnabled)) { - mSnapResult = HsWidgetPositioningOnWidgetMove::instance()->run(widget->sceneBoundingRect()); + mSnapResult = HsWidgetPositioningOnWidgetMove::instance()->run(widget->visual()->sceneBoundingRect()); if (HSCONFIGURATION_GET(isSnapEffectsEnabled)) { if (mSnapResult.hasHorizontalSnap) { @@ -720,11 +675,12 @@ mPreviousSnapResult = mSnapResult; } - - int bounceFeedbackEffectDistance = HSCONFIGURATION_GET(bounceFeedbackEffectDistance); // Handle effects: // User is indicated by a tactile feedback if he/she is trying to move // widget over the first or the last page. + HsScene *scene = HsScene::instance(); + HsPage *page = scene->activePage(); + int bounceFeedbackEffectDistance = HSCONFIGURATION_GET(bounceFeedbackEffectDistance); if( (page == scene->pages().first() && mWidgetHotSpot.x() < bounceFeedbackEffectDistance ) || (page == scene->pages().last() && scene->pages().count() == HSCONFIGURATION_GET(maximumPageCount) && mWidgetHotSpot.x() > pageRect.width() - bounceFeedbackEffectDistance)) { @@ -733,8 +689,7 @@ //if (!mContinuousFeedback->isPlaying()) { // mContinuousFeedback->play(); //} - } - else /*if (mContinuousFeedback->isPlaying())*/ { + } else /*if (mContinuousFeedback->isPlaying())*/ { //mContinuousFeedback->stop(); } @@ -783,7 +738,7 @@ QApplication::instance()->installEventFilter(scene); scene->activePage()->showWidgets(); qreal x = pageLayerXPos(scene->activePageIndex()); - mUiWidget->setSceneX(x); + HsGui::instance()->idleWidget()->setSceneX(x); } /*! @@ -791,7 +746,7 @@ */ void HsIdleState::action_idle_connectOrientationChangeEventHandler() { - connect(HsScene::mainWindow(), + connect(HsGui::instance(), SIGNAL(orientationChanged(Qt::Orientation)), SLOT(action_idle_orientationChanged())); } @@ -838,9 +793,10 @@ HsScene *scene = HsScene::instance(); QApplication::instance()->removeEventFilter(scene); scene->activePage()->hideWidgets(); - + + HsGui::instance()->disconnect(this,SIGNAL(event_applicationLibrary())); //Close options menu on view change - HsGui::idleView()->setMenu(NULL); + HsGui::instance()->idleView()->setMenu(NULL); //Close context menu on view change if (mSceneMenu) { @@ -853,7 +809,7 @@ */ void HsIdleState::action_idle_disconnectOrientationChangeEventHandler() { - disconnect(HsScene::mainWindow(), + disconnect(HsGui::instance(), SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(action_idle_orientationChanged())); } @@ -876,44 +832,39 @@ HbMenu *menu = new HbMenu(); menu->setObjectName("hs_menu"); // Task switcher - HbAction *action = menu->addAction(hbTrId(hsLocTextId_OptionsMenu_TaskSwitcher), + menu->addAction(hbTrId(hsLocTextId_OptionsMenu_TaskSwitcher), this, SLOT(openTaskSwitcher())); - action->setObjectName("action_open_task_switcher"); + // Add content - action = menu->addAction(hbTrId(hsLocTextId_ContextMenu_AddContent), + menu->addAction(hbTrId(hsLocTextId_ContextMenu_AddContent), this, SLOT(onAddContentFromOptionsMenuActionTriggered())); - action->setObjectName("action_add_content"); // Add page if (scene->pages().count() < HSCONFIGURATION_GET(maximumPageCount)) { - action = menu->addAction(hbTrId(hsLocTextId_OptionsMenu_AddPage), + menu->addAction(hbTrId(hsLocTextId_OptionsMenu_AddPage), this, SIGNAL(event_addPage())); - action->setObjectName("action_add_page"); - + } // Change wallpaper - action = menu->addAction(hbTrId(hsLocTextId_ContextMenu_ChangeWallpaper), + menu->addAction(hbTrId(hsLocTextId_ContextMenu_ChangeWallpaper), this, SIGNAL(event_selectWallpaper())); - action->setObjectName("action_change_wallpaper"); + // Remove page if (scene->activePage()->isRemovable()) { - action = menu->addAction(hbTrId(hsLocTextId_OptionsMenu_RemovePage), - this, SIGNAL(event_removePage())); - action->setObjectName("action_remove_page"); + menu->addAction(hbTrId(hsLocTextId_OptionsMenu_RemovePage), + this, SIGNAL(event_preRemovePage())); } // Online / Offline if (scene->isOnline()) { - action = menu->addAction(hbTrId(hsLocTextId_OptionsMenu_HsToOffline), + menu->addAction(hbTrId(hsLocTextId_OptionsMenu_HsToOffline), this, SIGNAL(event_toggleConnection())); - action->setObjectName("action_to_offline"); } else { - action = menu->addAction(hbTrId(hsLocTextId_OptionsMenu_HsToOnline), + menu->addAction(hbTrId(hsLocTextId_OptionsMenu_HsToOnline), this, SIGNAL(event_toggleConnection())); - action->setObjectName("action_to_online"); } - HsGui::idleView()->setMenu(menu); + HsGui::instance()->idleView()->setMenu(menu); } void HsIdleState::action_waitInput_connectGestureHandlers() @@ -962,9 +913,9 @@ { HsWidgetHost *widget = HsScene::instance()->activeWidget(); Q_ASSERT(widget); - widget->setParentItem(mUiWidget->controlLayer()); + widget->visual()->setParentItem(HsGui::instance()->idleWidget()->controlLayer()); - mUiWidget->showTrashBin(); + HsGui::instance()->idleWidget()->showTrashBin(); } /*! @@ -1001,16 +952,13 @@ void HsIdleState::action_moveWidget_setWidgetSnap() { if (HSCONFIGURATION_GET(isSnapEnabled)) { - mSnapBorderGap = HSCONFIGURATION_GET(snapBorderGap); QVariantHash snapConfiguration; snapConfiguration[SNAPENABLED] = QString::number(HSCONFIGURATION_GET(isSnapEnabled)); snapConfiguration[SNAPFORCE] = QString::number(HSCONFIGURATION_GET(snapForce)); snapConfiguration[SNAPGAP] = QString::number(HSCONFIGURATION_GET(snapGap)); - snapConfiguration[SNAPBORDERGAP] = mSnapBorderGap; HsWidgetPositioningOnWidgetMove::instance()->setConfiguration(snapConfiguration); - updatePagePresentationToWidgetSnap(); connect(HsScene::instance(), SIGNAL(activePageChanged()), @@ -1045,7 +993,7 @@ if (widget == activeWidget) { continue; } - QRectF widgetRect = widget->geometry(); + QRectF widgetRect = widget->visual()->geometry(); incativeWidgetRects.append(widgetRect); } return incativeWidgetRects; @@ -1056,18 +1004,20 @@ */ void HsIdleState::action_moveWidget_reparentToPage() { - if (mZoneAnimation - && mZoneAnimation->state() == QAbstractAnimation::Running - && mZoneAnimation->direction() == QAbstractAnimation::Forward) { - mZoneAnimation->setDuration(HSCONFIGURATION_GET(pageChangeZoneReverseAnimationDuration)); - mZoneAnimation->setDirection(QAbstractAnimation::Backward); + HsPropertyAnimationWrapper *pageCrawlingAnimation = + HsGui::instance()->pageCrawlingAnimation(); + if (pageCrawlingAnimation->isRunning()&& + pageCrawlingAnimation->isForward()) { + + pageCrawlingAnimation->setDuration(HSCONFIGURATION_GET(pageChangeZoneReverseAnimationDuration)); + pageCrawlingAnimation->setBackward(); } HsScene *scene = HsScene::instance(); HsPage *page = scene->activePage(); HsWidgetHost *widget = scene->activeWidget(); - if (mUiWidget->trashBin()->isUnderMouse()) { + if (HsGui::instance()->idleWidget()->trashBin()->isUnderMouse()) { HbInstantFeedback::play(HSCONFIGURATION_GET(widgetDropToTrashbinFeedbackEffect)); widget->page()->removeWidget(widget); widget->remove(); @@ -1076,17 +1026,15 @@ if (widget->page() != page) { widget->page()->removeWidget(widget); page->addExistingWidget(widget); - if (HsScene::orientation() == Qt::Horizontal) { + if (HsGui::instance()->orientation() == Qt::Horizontal) { widget->removePresentation(Qt::Vertical); } else { widget->removePresentation(Qt::Horizontal); } } - QRectF widgetRect = widget->geometry(); - QRectF pageRect = page->rect(); - //Set the snap position of the widget and save the position + QRectF widgetRect = widget->visual()->geometry(); if (mSnapResult.hasHorizontalSnap) { widgetRect.moveLeft(mSnapResult.horizontalSnapPosition); } @@ -1094,23 +1042,16 @@ widgetRect.moveTop(mSnapResult.verticalSnapPosition); } - //if snapBorderGap is defined, the widget is bounded in the rectangle which is smaller by snapBorderGap on all sides - qreal widgetX = qBound(qreal(0) + mSnapBorderGap, widgetRect.x(), (pageRect.width() - mSnapBorderGap) - widgetRect.width()); - qreal widgetY = qBound(qreal(64) + mSnapBorderGap, widgetRect.y(), (pageRect.height() - mSnapBorderGap) - widgetRect.height()); - - // play feedback effect if user drops widget between pages and it needs to be repositioned back to original page - if( widgetX != widgetRect.x() || widgetY != widgetRect.y()) { - HbInstantFeedback::play(HSCONFIGURATION_GET(widgetRepositionFeedbackEffect)); - } - widget->setPos(widgetX, widgetY); + QPointF adjustedWidgetPosition = page->adjustedWidgetPosition(widgetRect); + widget->visual()->setPos(adjustedWidgetPosition); widget->savePresentation(); page->updateZValues(); } - widget->setParentItem(HsScene::instance()->activePage()); + widget->visual()->setParentItem(HsScene::instance()->activePage()->visual()); - mUiWidget->showPageIndicator(); + HsGui::instance()->idleWidget()->showPageIndicator(); } /*! @@ -1181,7 +1122,7 @@ void HsIdleState::action_moveScene_moveToNearestPage() { QList pages = HsScene::instance()->pages(); - QSizeF pageSize = pages.first()->size(); + QSizeF pageSize = pages.first()->visual()->size(); int pageIndex = HsScene::instance()->activePageIndex(); @@ -1193,6 +1134,17 @@ HsScene::instance()->setActivePageIndex(pageIndex); + HsPage *page = HsScene::instance()->activePage(); + if (page) { + QList widgets = page->newWidgets(); + if (!widgets.isEmpty()) { + foreach (HsWidgetHost *widget, widgets) { + widget->startWidget(); + } + } + page->layoutNewWidgets(); + } + startPageChangeAnimation(pageIndex, HSCONFIGURATION_GET(pageChangeAnimationDuration)); } @@ -1212,8 +1164,74 @@ addPageToScene(pageIndex); scene->setActivePageIndex(pageIndex); startPageChangeAnimation(pageIndex, HSCONFIGURATION_GET(newPageAddedAnimationDuration)); - mUiWidget->pageIndicator()->addItem(pageIndex); - mUiWidget->showPageIndicator(); + HsGui::instance()->idleWidget()->pageIndicator()->addItem(pageIndex); + HsGui::instance()->idleWidget()->showPageIndicator(); +} + +/*! + Displays a confirmation query before page is removed if there are widgets on page +*/ +void HsIdleState::action_preRemovePage_showQuery() +{ + HsScene *scene = HsScene::instance(); + HsPage *page = scene->activePage(); + + if (!page->widgets().isEmpty()) { + if (!mMessageBoxWrapper) { + mMessageBoxWrapper = new HsMessageBoxWrapper(this); + mMessageBoxWrapper->setHeader(hbTrId(hsLocTextId_Title_RemovePage)); + mMessageBoxWrapper->setQueryText(hbTrId(hsLocTextId_Confirmation_RemovePage)); + connect(mMessageBoxWrapper,SIGNAL(accepted()),SIGNAL(event_removePage())); + connect(mMessageBoxWrapper,SIGNAL(rejected()),SIGNAL(event_waitInput())); + } + mMessageBoxWrapper->show(); + } else { + // Empty page can be removed without confirmation + emit event_removePage(); + } +} + +/*! + Make sure confirmation query gets closed if user exits preRemovePage state e.g. by pressing application key +*/ +void HsIdleState::action_preRemovePage_exit() +{ + if (mMessageBoxWrapper) { + mMessageBoxWrapper->close(); + } +} + +/*! + Start remove page animation. +*/ +void HsIdleState::action_removePage_startRemovePageAnimation() +{ + HsScene *scene = HsScene::instance(); + + int pageToRemoveIndex = scene->activePageIndex(); + bool isLastPage(scene->activePage() == scene->pages().last()); + + int nextPageIndex(pageToRemoveIndex); + nextPageIndex++; + if (isLastPage) { + nextPageIndex--; + } + HsPropertyAnimationWrapper *animation = HsGui::instance()->pageChangeAnimation(); + if (animation->isRunning()) { + animation->stop(); + } + animation->disconnect(this); + connect(animation, + SIGNAL(finished()), + SIGNAL(event_waitInput()), + Qt::UniqueConnection); + animation->setEndValue(pageLayerXPos(nextPageIndex)); + animation->setDuration(HSCONFIGURATION_GET(pageRemovedAnimationDuration)); + + animation->start(); + + HbInstantFeedback::play(HSCONFIGURATION_GET(pageChangeFeedbackEffect)); + } /*! @@ -1221,30 +1239,26 @@ */ void HsIdleState::action_removePage_removePage() { + HsIdleWidget *idleWidget = HsGui::instance()->idleWidget(); + HsPropertyAnimationWrapper *animation = HsGui::instance()->pageChangeAnimation(); HsScene *scene = HsScene::instance(); - HsPage *page = scene->activePage(); - - if (!page->widgets().isEmpty()) { -#ifndef HOMESCREEN_TEST //We don't want to test message box. - //Confirm removal of page having content - HbMessageBox *box = new HbMessageBox(HbMessageBox::MessageTypeQuestion); - box->setAttribute(Qt::WA_DeleteOnClose); - box->setHeadingWidget(new HbLabel - (hbTrId(hsLocTextId_Title_RemovePage))); - box->setText(hbTrId(hsLocTextId_Confirmation_RemovePage)); + HsPage *pageToRemove = scene->activePage(); - QAction *buttonOk = box->actions().at(0); - //We are keen only from OK button. Cancel is not connected to any slot. - connect(buttonOk, SIGNAL(triggered()), SLOT(onRemovePageConfirmationOk())); - - box->open(); -#endif // HOMESCREEN_TEST - } else { - // Empty page can be removed without confirmation - removeActivePage(); + if (animation->isRunning()) { + animation->stop(); } + // remove from ui + idleWidget->removePage(pageToRemove->pageIndex()); + idleWidget->showPageIndicator(); + // update data model + scene->removePage(pageToRemove); + // Take new active page (previous was removed) and move scene to right position + qreal x = pageLayerXPos(scene->activePageIndex()); + idleWidget->setSceneX(x); + // delete it + pageToRemove->deleteLater(); + } - /*! Toggles the homescreen online/offline state. */ @@ -1277,8 +1291,8 @@ { HsScene *scene = HsScene::instance(); int pageIndex = scene->activePageIndex(); - - if (mZoneAnimation->direction() == QAbstractAnimation::Forward) { + HsGui *gui(HsGui::instance()); + if (gui->pageCrawlingAnimation()->isForward()) { if (isInLeftPageChangeZone() && 0 < pageIndex) { --pageIndex; @@ -1289,18 +1303,16 @@ if (pageIndex == scene->pages().count()) { if (pageIndex < HSCONFIGURATION_GET(maximumPageCount)) { addPageToScene(pageIndex); - mUiWidget->showPageIndicator(); - mUiWidget->pageIndicator()->addItem(pageIndex); + gui->idleWidget()->showPageIndicator(); + gui->idleWidget()->pageIndicator()->addItem(pageIndex); } } scene->setActivePageIndex(pageIndex); startPageChangeAnimation(pageIndex, HSCONFIGURATION_GET(pageChangeAnimationDuration)); } else { scene->setActivePageIndex(pageIndex); - mUiWidget->setActivePage(pageIndex); + gui->idleWidget()->setActivePage(pageIndex); } - - deleteZoneAnimation(); } /*! @@ -1311,23 +1323,16 @@ updateZoneAnimation(); } -/*! - Handles the close of remove page confirmation dialog for page having content. -*/ -void HsIdleState::onRemovePageConfirmationOk() -{ - removeActivePage(); -} /*! Provides the page presentation to the Widget Snap algorithm */ void HsIdleState::updatePagePresentationToWidgetSnap() { - QRectF containerRect = HsScene::instance()->activePage()->rect(); - containerRect.setTop(qreal(64)); + QRectF containerRect = HsScene::instance()->activePage()->contentGeometry(); HsWidgetHost *activeWidget = HsScene::instance()->activeWidget(); - HsWidgetPositioningOnWidgetMove::instance()->setPagePresentation(containerRect, createInactiveWidgetRects(), activeWidget->geometry()); + HsWidgetPositioningOnWidgetMove::instance()->setPagePresentation( + containerRect, createInactiveWidgetRects(), activeWidget->visual()->geometry()); } /*! @@ -1356,7 +1361,7 @@ //the line will be shown when the timer expires. //If timer has already expired, just show the line, which is redrawn to new geometry. if (!mVerticalSnapLineTimer.isActive()) { - mUiWidget->showVerticalSnapLine(mSnapResult.verticalSnapLine); + HsGui::instance()->idleWidget()->showVerticalSnapLine(mSnapResult.verticalSnapLine); } } } @@ -1366,7 +1371,7 @@ */ void HsIdleState::onVerticalSnapLineTimerTimeout() { - mUiWidget->showVerticalSnapLine(mSnapResult.verticalSnapLine); + HsGui::instance()->idleWidget()->showVerticalSnapLine(mSnapResult.verticalSnapLine); } /*! @@ -1374,7 +1379,7 @@ */ void HsIdleState::hideVerticalLine() { - mUiWidget->hideVerticalSnapLine(); + HsGui::instance()->idleWidget()->hideVerticalSnapLine(); mVerticalSnapLineTimer.stop(); } @@ -1389,7 +1394,7 @@ } else { if (!mHorizontalSnapLineTimer.isActive()) { - mUiWidget->showHorizontalSnapLine(mSnapResult.horizontalSnapLine); + HsGui::instance()->idleWidget()->showHorizontalSnapLine(mSnapResult.horizontalSnapLine); } } } @@ -1399,7 +1404,7 @@ */ void HsIdleState::onHorizontalSnapLineTimerTimeout() { - mUiWidget->showHorizontalSnapLine(mSnapResult.horizontalSnapLine); + HsGui::instance()->idleWidget()->showHorizontalSnapLine(mSnapResult.horizontalSnapLine); } /*! @@ -1407,7 +1412,7 @@ */ void HsIdleState::hideHorizontalLine() { - mUiWidget->hideHorizontalSnapLine(); + HsGui::instance()->idleWidget()->hideHorizontalSnapLine(); mHorizontalSnapLineTimer.stop(); } @@ -1419,3 +1424,5 @@ updatePagePresentationToWidgetSnap(); resetSnapPosition(); } + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlewidget.cpp --- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlewidget.cpp Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,405 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include -#include -#include -#include - -#include -#include - -#include "hsidlewidget.h" -#include "hsscene.h" -#include "hspage.h" -#include "hswidgethost.h" -#include "hswallpaper.h" -#include "hstrashbinwidget.h" -#include "hspageindicator.h" -#include "hsdocumentloader.h" -#include "hsconfiguration.h" -#include "hsapp_defs.h" -#include "hssnapline.h" - -namespace -{ - const char gControlLayerDocmlName[] = "controllayer.docml"; - const char gControlLayerName[] = "controlLayer"; - const char gTrashBinName[] = "trashBin"; - const char gPageIndicatorName[] = "pageIndicator"; -} - -/*! - \class HsIdleWidget - \ingroup group_hshomescreenstateplugin - \brief View part of the home screen idle state. - - Maintains the idle view ui layers and takes care of - receiving user input and communicating it to the idle - state for further processing. -*/ - -/*! - Constructs a new idle widget with the given \a parent. -*/ -HsIdleWidget::HsIdleWidget(QGraphicsItem *parent) - : HbWidget(parent), - mControlLayer(0), mPageLayer(0), mPageWallpaperLayer(0), - mSceneLayer(0), - mTrashBin(0), mPageIndicator(0), - mHorizontalSnapLine(0), mVerticalSnapLine(0) -{ - setFlag(ItemHasNoContents); - - loadControlLayer(); - - QGraphicsLinearLayout *linearLayout = 0; - - linearLayout = new QGraphicsLinearLayout(Qt::Horizontal); - linearLayout->setContentsMargins(0, 0, 0, 0); - linearLayout->setSpacing(0); - mPageLayer = new HbWidget(this); - mPageLayer->setLayout(linearLayout); - mPageLayer->setZValue(2); - - linearLayout = new QGraphicsLinearLayout(Qt::Horizontal); - linearLayout->setContentsMargins(0, 0, 0, 0); - linearLayout->setSpacing(0); - mPageWallpaperLayer = new HbWidget(this); - mPageWallpaperLayer->setLayout(linearLayout); - mPageWallpaperLayer->setZValue(1); - - linearLayout = new QGraphicsLinearLayout(Qt::Horizontal); - linearLayout->setContentsMargins(0, 0, 0, 0); - linearLayout->setSpacing(0); - mSceneLayer = new HbWidget(this); - mSceneLayer->setLayout(linearLayout); - mSceneLayer->setZValue(0); -} - -/*! - Destroys this idle widget. -*/ -HsIdleWidget::~HsIdleWidget() -{ - QList pages = HsScene::instance()->pages(); - foreach (HsPage *page, pages) { - page->setParentItem(0); - if (page->scene()) { - page->scene()->removeItem(page); - } - HsWallpaper *pageWallpaper = page->wallpaper(); - if (pageWallpaper) { - pageWallpaper->setParentItem(0); - if (pageWallpaper->scene()) { - pageWallpaper->scene()->removeItem(pageWallpaper); - } - } - } - - HsWallpaper *sceneWallpaper = HsScene::instance()->wallpaper(); - if (sceneWallpaper) { - sceneWallpaper->setParentItem(0); - if (sceneWallpaper->scene()) { - sceneWallpaper->scene()->removeItem(sceneWallpaper); - } - } -} - -qreal HsIdleWidget::sceneX() const -{ - return mPageLayer->x(); -} - -void HsIdleWidget::setSceneX(qreal x) -{ - if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::SceneWallpaper) { - mPageLayer->setX(x); - mSceneLayer->setX((parallaxFactor() * x) - HSCONFIGURATION_GET(bounceEffect) / 2); - } else { - mPageLayer->setX(x); - mPageWallpaperLayer->setX(x); - } -} - -/*! - Layouts the ui layers according to the given \a rect. - If given \a rect has different size than a fullscreen view, rect - is lifted up by statuspane height. Normally HsIdleWidget position is 0,0 - relative to it's parent container (HbView). This functionality tackles - problem caused by HbStackedLayout which sets top most rect for all items - (views) in a stack (not considering fullscreen mode). -*/ -void HsIdleWidget::setGeometry(const QRectF &rect) -{ - - int n = HsScene::instance()->pages().count(); - QRectF layoutRect(HsScene::instance()->mainWindow()->layoutRect()); - if (layoutRect == rect || (layoutRect.height() == rect.width() && layoutRect.width() == rect.height())) { - mControlLayer->resize(rect.size()); - mPageLayer->resize(n * rect.width(), rect.height()); - if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) { - mPageWallpaperLayer->resize(n * rect.width(), rect.height()); - } - mSceneLayer->resize(2 * rect.width() + HSCONFIGURATION_GET(bounceEffect), rect.height()); - HbWidget::setGeometry(rect); - } else { - QRectF sceneRect = mapToScene(rect).boundingRect(); - // HbView is a container item for widget, thus 0,0 is relative to view's position. - // Lift rect by offset. Fullscreen view is in 0,0 position in scene coordinates otherwise - // it's e.g 0,68 (statuspane being at 0,0 and view at 0,68) - sceneRect.setTop(-sceneRect.top()); - HbWidget::setGeometry(sceneRect); - } -} - -/*! - Sets the active page \a index to the page - indicator. -*/ -void HsIdleWidget::setActivePage(int index) -{ - mPageIndicator->setActiveItemIndex(index); -} - -/*! - Inserts the given \a page at index position - \a index in the page layer. -*/ -void HsIdleWidget::insertPage(int index, HsPage *page) -{ - QGraphicsLinearLayout *layout = - static_cast(mPageLayer->layout()); - layout->insertItem(index, page); - mPageLayer->resize( - layout->count() * size().width(), size().height()); - - if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) { - QGraphicsLinearLayout *layout = - static_cast(mPageWallpaperLayer->layout()); - layout->insertItem(index, page->wallpaper()); - mPageWallpaperLayer->resize( - layout->count() * size().width(), size().height()); - } -} - -/*! - Removes the page at index position - \a index in the page layer. -*/ -void HsIdleWidget::removePage(int index) -{ - QGraphicsLinearLayout *layout = - static_cast(mPageLayer->layout()); - layout->removeAt(index); - mPageLayer->resize( - layout->count() * size().width(), size().height()); - - if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) { - QGraphicsLinearLayout *layout = - static_cast(mPageWallpaperLayer->layout()); - layout->removeAt(index); - mPageWallpaperLayer->resize( - layout->count() * size().width(), size().height()); - } -} - -/*! - \fn HsIdleWidget::controlLayer() const - - Returns the control layer. -*/ - -/*! - \fn HsIdleWidget::pageLayer() const - - Returns the page layer. -*/ - -/*! - \fn HsIdleWidget::sceneLayer() const - - Returns the scene layer. -*/ - -/*! - \fn HsIdleWidget::trashBin() const - - Returns the trashbin widget. -*/ - -/*! - \fn HsIdleWidget::pageIndicator() const - - Returns the page indicator widget. -*/ - -/*! - Sets the trashbin visible and hides the page indicator. -*/ -void HsIdleWidget::showTrashBin() -{ - mPageIndicator->hide(); - mTrashBin->show(); -} - -/*! - Sets the page indicator visible and hides the trashbin. -*/ -void HsIdleWidget::showPageIndicator() -{ - mTrashBin->hide(); - mTrashBin->deactivate(); - mPageIndicator->setSpacing(HSCONFIGURATION_GET(pageIndicatorSpacing)); // for usability optimization widget, can be removed later on - mPageIndicator->setVisible(1 < mPageIndicator->itemCount()); -} - -/*! - Shows the Vertical snapping lines showing the guidance -*/ -void HsIdleWidget::showVerticalSnapLine(const QLineF &snapLine) -{ - QVariantHash snapConfiguration; - snapConfiguration[SNAPLINEFADEINDURATION] = QString::number(HSCONFIGURATION_GET(snapLineFadeInDuration)); - snapConfiguration[SNAPLINEFADEOUTDURATION] = QString::number(HSCONFIGURATION_GET(snapLineFadeOutDuration)); - - mVerticalSnapLine->setConfiguration(snapConfiguration); - mVerticalSnapLine->showLine(snapLine); -} - -/*! - Shows the Horizontal snapping lines showing the guidance -*/ -void HsIdleWidget::showHorizontalSnapLine(const QLineF &snapLine) -{ - QVariantHash snapConfiguration; - snapConfiguration[SNAPLINEFADEINDURATION] = QString::number(HSCONFIGURATION_GET(snapLineFadeInDuration)); - snapConfiguration[SNAPLINEFADEOUTDURATION] = QString::number(HSCONFIGURATION_GET(snapLineFadeOutDuration)); - - mHorizontalSnapLine->setConfiguration(snapConfiguration); - mHorizontalSnapLine->showLine(snapLine); -} - -/*! - Hides the Vertical snapping line showing the guidance -*/ -void HsIdleWidget::hideVerticalSnapLine() -{ - mVerticalSnapLine->hideLine(); -} - -/*! - Hides the Horizontal snapping line showing the guidance -*/ -void HsIdleWidget::hideHorizontalSnapLine() -{ - mHorizontalSnapLine->hideLine(); -} - -/*! - Reimplements QGraphicsWidget::polishEvent(). -*/ -void HsIdleWidget::polishEvent() -{ - HsScene *scene = HsScene::instance(); - Q_ASSERT(scene); - - QGraphicsLinearLayout *pageLayout = - static_cast(mPageLayer->layout()); - - QList pages = scene->pages(); - - foreach (HsPage *page, pages) { - pageLayout->addItem(page); - if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) { - QGraphicsLinearLayout *pageWallpaperLayout = - static_cast(mPageWallpaperLayer->layout()); - pageWallpaperLayout->addItem(page->wallpaper()); - } - } - if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::SceneWallpaper) { - QGraphicsLinearLayout *sceneLayout = - static_cast(mSceneLayer->layout()); - HsWallpaper *wallpaper = HsScene::instance()->wallpaper(); - sceneLayout->addItem(wallpaper); - } - - mPageIndicator->initialize(pages.count(), scene->activePageIndex()); - showPageIndicator(); - - HsScene::mainWindow()->scene()->installEventFilter(this); -} - -/*! - Loads the control layer declared in a docml file. -*/ -void HsIdleWidget::loadControlLayer() -{ - HsDocumentLoader loader; - bool loaded = false; - -#ifndef Q_OS_SYMBIAN - QString path = QDir::currentPath(); -#else - QString path = "c:"; -#endif - - QString file = path + "/hsresources/" + gControlLayerDocmlName; - QString fallbackPath = QString(":/") + gControlLayerDocmlName; - - if (QFile::exists(file)) { - loader.load(file, &loaded); - if (!loaded) { - loader.load(fallbackPath, &loaded); - } - } else { - loader.load(fallbackPath, &loaded); - } - - if (loaded) { - mControlLayer = qobject_cast(loader.findWidget(gControlLayerName)); - mControlLayer->setZValue(3); - mControlLayer->setParentItem(this); - - mTrashBin = qobject_cast(loader.findWidget(gTrashBinName)); - mTrashBin->setZValue(1e6); - - mPageIndicator = qobject_cast(loader.findWidget(gPageIndicatorName)); - mPageIndicator->setZValue(1e6); - - - mHorizontalSnapLine = new HsSnapLine(mControlLayer); - mHorizontalSnapLine->setZValue(10); - - mVerticalSnapLine = new HsSnapLine(mControlLayer); - mVerticalSnapLine->setZValue(10); - } else { - // TODO: Handle error. - } -} - -qreal HsIdleWidget::parallaxFactor() const -{ - qreal clw = mControlLayer->size().width(); - qreal slw = mSceneLayer->size().width() - HSCONFIGURATION_GET(bounceEffect); - int n = HsScene::instance()->pages().count(); - if (n < 2) { - return 1; - } else { - return (slw - clw) / ((n - 1) * clw); - } -} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hshomescreenstateplugin/src/hsloadscenestate.cpp --- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsloadscenestate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsloadscenestate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -15,13 +15,15 @@ * */ -#include +#include "hsloadscenestate.h" +#include "hsscene.h" +#include "hsgui.h" + #ifdef Q_OS_SYMBIAN #include #include #endif -#include "hsloadscenestate.h" -#include "hsscene.h" + /*! \class HsLoadSceneState @@ -121,7 +123,7 @@ void HsLoadSceneState::showUi() { qDebug() << "HsLoadSceneState::showUi"; - HsScene::mainWindow()->raise(); - HsScene::mainWindow()->show(); + + HsGui::instance()->show(); emit event_history(); } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/hsmenuworkerstateplugin.pro --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/hsmenuworkerstateplugin.pro Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/hsmenuworkerstateplugin.pro Wed Aug 18 09:40:07 2010 +0300 @@ -31,7 +31,7 @@ DEPENDPATH += ./inc \ ./src INCLUDEPATH += ./inc \ - ../../serviceproviders\hsmenuserviceprovider\inc \ + ../../serviceproviders/hsmenuserviceprovider/inc \ ../../hsutils/inc \ ../../hsdomainmodel/inc diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/hsmenuworkerstateplugin.qrc --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/hsmenuworkerstateplugin.qrc Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/hsmenuworkerstateplugin.qrc Wed Aug 18 09:40:07 2010 +0300 @@ -5,5 +5,7 @@ resource/hsarrangedialog.docml resource/hsdetailsdialog.docml resource/hsuninstalldialog.docml + resource/hsinstallationlogdialog.docml + resource/hscollectionslistdialog.docml diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddappstocollectionstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddappstocollectionstate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddappstocollectionstate.h Wed Aug 18 09:40:07 2010 +0300 @@ -25,10 +25,11 @@ HS_STATES_TEST_CLASS(MenuStatesTest) class QStandardItemModel; +class QModelIndex; class HbAction; class HsAppsCheckList; class HsCollectionNameDialog; -class HsCollectionsListDialog; +class HbDialog; class HsAddAppsToCollectionState: public QState { @@ -54,11 +55,9 @@ void transitToSaveState(const QString &collectionName); - void transitToAppsCheckListState(const QString &collectionName); - void transitToSaveState(int collectionId); - void transitToAppsCheckListState(int collectionId); + void transitToSelectCollectionState(); void transitToNewCollectionState(); @@ -85,6 +84,8 @@ void cleanData(); void selectApplicationsDone(const QList &appList); + + void collectionSelected(const QModelIndex &modelIndex); private slots: @@ -105,6 +106,8 @@ void construct(); void createStates(); + + QStandardItemModel *standardItemModel(int collectionId); private: @@ -128,14 +131,13 @@ HsSortAttribute mApplicationsSortAttribute; - HsSortAttribute mCollectionsSortAttribute; - HsAppsCheckList *mAppsCheckList; HsCollectionNameDialog *mEditorDialog; - HsCollectionsListDialog *mListDialog; + HbDialog *mListDialog; // not owned + QStandardItemModel *mModel; // delete with dialog }; #endif /* ADDAPPSTOCOLLECTIONSTATE_H */ diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddtohomescreenstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddtohomescreenstate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddtohomescreenstate.h Wed Aug 18 09:40:07 2010 +0300 @@ -27,12 +27,14 @@ HS_STATES_TEST_CLASS(MenuStatesTest) +class QAction; class HbAction; class HbMessageBox; class CaEntry; class CaNotifier; class HsContentService; + class HsAddToHomeScreenState: public QState { Q_OBJECT @@ -52,8 +54,6 @@ void cleanUp(); void messageWidgetCorruptedFinished(HbAction* finishedAction); - - void memoryCardRemoved(); signals: @@ -71,7 +71,6 @@ void logActionResult(QString operationName, int entryId, bool operationSucceded); - void subscribeForMemoryCardRemove(); private: @@ -82,12 +81,10 @@ HbMessageBox *mCorruptedMessage; - HbAction *mConfirmAction; + QAction *mConfirmAction; HsMenuMode mMenuMode; - CaNotifier *mNotifier; - QVariant mToken; }; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsappschecklist.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsappschecklist.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsappschecklist.h Wed Aug 18 09:40:07 2010 +0300 @@ -20,13 +20,12 @@ #include #include -#include "hbmainwindow.h" #include "hsmenustates_global.h" HS_STATES_TEST_CLASS(MenuStatesTest) //forward declarations -class HbView; +class HbDialog; class HbAction; class HbListView; class QStandardItemModel; @@ -56,32 +55,28 @@ protected slots: - void selectApplicationsDone(); + void appsSelectionDialogFinished(HbAction* finishedAction); + + void selectedItemsChanged(); private: void constructControls(); - HbMainWindow *mainWindow() const; - QList getSortedItemsList(const QModelIndexList &modelIndexList); private: - HbView *mView; + HbDialog *mAppsSelectDialog; - HbView *mPreviousView; + HbAction *mActionConfirm; // delete with dialog - HbAction *mActionConfirm; + HbListView *mListView; // delete with dialog - HbListView *mListView; - - HsMenuItemModel *mModel; + HsMenuItemModel *mModel; // delete with dialog HsSortAttribute mSortAttribute; - QObjectList mLoadedObjects; - }; #endif /* APPSCHECKLIST_H */ diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsarrangestate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsarrangestate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsarrangestate.h Wed Aug 18 09:40:07 2010 +0300 @@ -15,8 +15,8 @@ * */ -#ifndef ARRANGE_H -#define ARRANGE_H +#ifndef HSARRANGESTATE_H +#define HSARRANGESTATE_H #include #include @@ -76,15 +76,17 @@ HsMenuItemModel *mItemModel; int mTopItemId; + + int mCollectionId; QModelIndex mTopModelIndex; - QList mCollIdList; + QList mCollItemIdList; - QList mArrangedCollIdList; + QList mArrangedCollItemIdList; QObjectList mObjectList; }; -#endif /* ARRANGE_H_ */ +#endif /* HSARRANGESTATE_H */ diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hscollectionnamedialog.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hscollectionnamedialog.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hscollectionnamedialog.h Wed Aug 18 09:40:07 2010 +0300 @@ -35,9 +35,9 @@ virtual ~HsCollectionNameDialog(); - void open(QObject* receiver, const char* member ); - - QString newName(const QString &name, bool addLastName = false); + void open(QObject* receiver, const char* member); + + QString uniqueCollectionName() const; protected: void closeEvent( QCloseEvent * event ); @@ -47,6 +47,10 @@ void makeDisconnect(); + QString suggestedCollectionName(const QString &name); + + QString generateUniqueCollectionName(const QString &name) const; + private slots: void onTextChanged(const QString &text); @@ -58,13 +62,12 @@ /* * Collections names list from data model. */ - QStringList mCollectionsNames; + QStringList mOtherCollectionsNames; /* - * Last found collection name. + * Already suggested names. */ - QString mLastCollectionName; - + QStringList mSuggestedNames; }; #endif /* HS_INPUT_DIALOG_H */ diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hscollectionslistdialog.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hscollectionslistdialog.h Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ - -#ifndef HS_LIST_DIALOG_H -#define HS_LIST_DIALOG_H - -#include -#include - -#include "hsmenustates_global.h" -HS_STATES_TEST_CLASS(MenuStatesTest) -class QStandardItemModel; - -class HsCollectionsListDialog: public HbSelectionDialog -{ - Q_OBJECT - - HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) - -public: - - HsCollectionsListDialog(HsSortAttribute sortOrder, - int collectionId = 0); - - virtual ~HsCollectionsListDialog(); - - void open(QObject* receiver, const char* member ); - - int getItemId(); - -protected: - void closeEvent( QCloseEvent * event ); - -private: - - void makeConnect(); - - void makeDisconnect(); - - QStandardItemModel *standartItemModel(HsSortAttribute sortOrder, - int collectionId); - - void insertNewCollectionItem(QStandardItemModel *model); - -private: - - QStandardItemModel *mModel; - - int mItemId; -}; - -#endif /* HS_LIST_DIALOG_H */ diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdeletecollectionitemstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdeletecollectionitemstate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdeletecollectionitemstate.h Wed Aug 18 09:40:07 2010 +0300 @@ -23,6 +23,7 @@ #include "hsmenustates_global.h" HS_STATES_TEST_CLASS(MenuStatesTest) +class QAction; class HbAction; class HbMessageBox; class HsShortcutService; @@ -66,7 +67,7 @@ HbMessageBox *mDeleteMessage; // deletes itself automatically on close - HbAction *mConfirmAction; // child for mDeleteMessage + QAction *mConfirmAction; // child for mDeleteMessage }; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdeletecollectionstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdeletecollectionstate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdeletecollectionstate.h Wed Aug 18 09:40:07 2010 +0300 @@ -23,6 +23,7 @@ #include "hsmenustates_global.h" HS_STATES_TEST_CLASS(MenuStatesTest) +class QAction; class HbAction; class HbMessageBox; class HsMenuService; @@ -60,7 +61,7 @@ private: int mItemId; HbMessageBox *mDeleteMessage; // deletes itself automatically on close - HbAction *mConfirmAction; // child for mDeleteMessage + QAction *mConfirmAction; // child for mDeleteMessage }; #endif //HSDELETECOLLECTIONSTATE_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsinstallationlogstate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsinstallationlogstate.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,65 @@ +/* + * 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 HSINSTALLATIONLOGSTATE_H +#define HSINSTALLATIONLOGSTATE_H + +#include + +#include "hsmenustates_global.h" +HS_STATES_TEST_CLASS(MenuStatesTest) + +class HbDialog; + +class HsInstallationLogState: public QState +{ + Q_OBJECT + + HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) + +public: + + HsInstallationLogState(QState *parent = 0); + + virtual ~HsInstallationLogState(); + +protected: + + void onEntry(QEvent *event); + void onExit(QEvent *event); + +private slots: + + void stateExited(); + void cleanUp(); + +signals: + + void exit(); + +private: + + void construct(); + void createInstallationLogDialog(); + +private: + + HbDialog* mInstalationLogDialog; + +}; + +#endif //HSINSTALLATIONLOGSTATE_H diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsmenustates_global.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsmenustates_global.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsmenustates_global.h Wed Aug 18 09:40:07 2010 +0300 @@ -60,6 +60,16 @@ static const char *const HS_UNINSTALL_DIALOG_CONFIRMATION_ACTION ="qtl_dialog_softkey_2_left"; static const char *const HS_UNINSTALL_DIALOG_CONFIRMATION_DIALOG_ICON ="icon"; +static const char *const HS_INSTALLATION_LOG_DIALOG_LAYOUT =":/xml/hsinstallationlogdialog.docml"; +static const char *const HS_INSTALLATION_LOG_DIALOG_NAME="installation_log_dialog"; +static const char *const HS_INSTALLATION_LOG_DIALOG_LOG_LABEL="log_label"; + +static const char *const HS_COLLECTION_DIALOG_LAYOUT =":/xml/hscollectionslistdialog.docml"; +static const char *const HS_COLLECTION_DIALOG_NAME="collection_list_dialog"; +static const char *const HS_COLLECTION_DIALOG_LIST_VIEW="listView"; +static const char *const HS_COLLECTION_DIALOG_CREATE_NEW_ACTION="qtl_dialog_softkey_2_left"; +static const char *const HS_COLLECTION_DIALOG_CANCEL_ACTION="qtl_dialog_softkey_2_right"; + /*! To enable logging of function entry and exit use the following flag for qmake: diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hspreviewhswidgetstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hspreviewhswidgetstate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hspreviewhswidgetstate.h Wed Aug 18 09:40:07 2010 +0300 @@ -20,15 +20,19 @@ #define HSPREVIEWHSWIDGETSTATE_H #include +#include #include "hsmenustates_global.h" +#include "hsmenuentryremovedhandler.h" + HS_STATES_TEST_CLASS(MenuStatesTest) +class QAction; +class HbAction; class CaEntry; class HbDialog; class HsWidgetHost; class CaNotifier; -class HbAction; class HbScrollArea; class HbMessageBox; @@ -49,7 +53,7 @@ void previewDialogFinished(HbAction* finishedAction); void messageWidgetCorruptedFinished(HbAction* finishedAction); - + void onEntry(QEvent *event); void cleanUp(); @@ -60,22 +64,23 @@ private: void showMessageWidgetCorrupted(); - - void subscribeForMemoryCardRemove(); HbDialog* buildPreviewDialog(const CaEntry& entry) const; private: HbDialog *mPreviewDialog; - - CaNotifier *mNotifier; - - QScopedPointer mWidget; - + QScopedPointer mEntryObserver; int mEntryId; HbMessageBox *mCorruptedMessage; + + QAction *mConfirmRemovalAction; + QAction *mAddToHomescreenAction; + + QVariant mToken; + + QString mUri; }; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsuninstallitemstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsuninstallitemstate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsuninstallitemstate.h Wed Aug 18 09:40:07 2010 +0300 @@ -23,6 +23,7 @@ #include "hsmenustates_global.h" HS_STATES_TEST_CLASS(MenuStatesTest) +class QAction; class HbAction; class HbMessageBox; class HsShortcutService; @@ -72,20 +73,17 @@ void createUninstallMessage(); void createUninstallJavaMessage(); - void subscribeForMemoryCardRemove(); + void createSimpleUninstallJavaMessage(); private: int mItemId; - CaNotifier *mNotifier; - HbMessageBox *mUninstallMessage; // deletes itself automatically on close HbDialog *mUninstallJavaMessage; - QObjectList mObjectList; UninstallDialogType mDialogType; - HbAction *mConfirmAction; // child for mConfirmMessage + QAction *mConfirmAction; // child for mConfirmMessage }; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsviewappdetailsstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsviewappdetailsstate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsviewappdetailsstate.h Wed Aug 18 09:40:07 2010 +0300 @@ -18,16 +18,20 @@ #ifndef HSVIEWAPPDETAILSSTATE_H_ #define HSVIEWAPPDETAILSSTATE_H_ + #include #include #include "hsmenustates_global.h" +#include "casoftwareregistry.h" HS_STATES_TEST_CLASS(MenuStatesTest) class HbListWidget; class HsMenuItemModel; class HbDialog; class CaNotifier; +class HbDocumentLoader; + class HsViewAppDetailsState: public QState { @@ -56,15 +60,13 @@ private: void construct(); - void subscribeForMemoryCardRemove(int entryId); + void setFieldPresentation(QString key, + CaSoftwareRegistry::DetailMap &detailMap, + HbDocumentLoader &loader); private: HbDialog *mDialog; - - QObjectList mObjectList; - - CaNotifier *mNotifier; }; #endif /* HSVIEWAPPDETAILSSTATE_H_ */ diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsviewappsettingsstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsviewappsettingsstate.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsviewappsettingsstate.h Wed Aug 18 09:40:07 2010 +0300 @@ -43,12 +43,8 @@ virtual ~HsViewAppSettingsState(); -private slots: - - void settingsDone(); - signals: - void initialize(const QString &aUid); + void initialize(const QString &aUid); void exit(); protected: @@ -61,8 +57,6 @@ void construct(); HbMainWindow *mainWindow() const; - - void subscribeForMemoryCardRemove(int entryId); private: @@ -71,9 +65,6 @@ HbView *mPreviousView; HbAction *mActionConfirm; - - CaNotifier *mNotifier; - }; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsappchecklist.docml --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsappchecklist.docml Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsappchecklist.docml Wed Aug 18 09:40:07 2010 +0300 @@ -1,17 +1,35 @@ - - - + + + + + + + + + + + + + + + + + + + - - + + - + + - + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsarrangedialog.docml --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsarrangedialog.docml Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsarrangedialog.docml Wed Aug 18 09:40:07 2010 +0300 @@ -3,9 +3,9 @@ - - - + + +
diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hscollectionslistdialog.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hscollectionslistdialog.docml Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsdetailsdialog.docml --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsdetailsdialog.docml Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsdetailsdialog.docml Wed Aug 18 09:40:07 2010 +0300 @@ -5,9 +5,8 @@
- - + @@ -17,63 +16,62 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + @@ -91,7 +89,123 @@ - +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsinstallationlogdialog.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsinstallationlogdialog.docml Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hswidgetpreviewdialog.docml --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hswidgetpreviewdialog.docml Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hswidgetpreviewdialog.docml Wed Aug 18 09:40:07 2010 +0300 @@ -11,21 +11,20 @@ - + - - - - - + + + - - - - + + + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddappstocollectionstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddappstocollectionstate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddappstocollectionstate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -15,6 +15,10 @@ * */ +#include +#include +#include +#include #include #include #include @@ -25,8 +29,8 @@ #include "hsaddappstocollectionstate.h" #include "hsmenuevent.h" #include "hscollectionnamedialog.h" -#include "hscollectionslistdialog.h" #include "hsappschecklist.h" +#include "hsmenuitemmodel.h" /*! \class HsAddAppsToCollectionState @@ -133,24 +137,16 @@ */ /*! - \fn void HsAddAppsToCollectionState::transitToAppsCheckListState(const QString &collectionName); - Signal emitted when collection name is selected - version to trigger - transition to mAppCheckListState. - \param collectionName name of collection. - */ - -/*! \fn void void HsAddAppsToCollectionState::transitToSaveState(int collectionId); Signal emitted when collection id is selected. \param collectionId id of collection. */ /*! - \fn void HsAddAppsToCollectionState::transitToAppsCheckListState(int collectionId); - Signal emitted when collection name is selected - version to trigger - transition to mAppCheckListState. - \param collectionId id of collection. - */ + \fn void HsAddAppsToCollectionState::transitToSelectCollectionState(); + Signal emitted after close multiselection list when CollectionActionType is ViaAllViewOptionMenuType + transition to mSelectCollectionState. + */ /*! \fn void HsAddAppsToCollectionState::transitToNewCollectionState(); @@ -179,15 +175,13 @@ mShowConfirmation(0), mInitialState(0), mSelectCollectionState(0), mNewCollectionState(0), mAppsCheckListState(0), mActionType( NoActionType), mApplicationsSortAttribute(NoHsSortAttribute), - mCollectionsSortAttribute(NoHsSortAttribute), mAppsCheckList(0), - mEditorDialog(0), mListDialog(0) + mAppsCheckList(0), mEditorDialog(0), mListDialog(0), mModel(0) { construct(); } /*! Destructor. - */ HsAddAppsToCollectionState::~HsAddAppsToCollectionState() { @@ -238,10 +232,6 @@ SLOT(setCollectionId(int))); connect(this, SIGNAL(transitToSaveState(QString)), SLOT(setCollectionName(QString))); - connect(this, SIGNAL(transitToAppsCheckListState(int)), - SLOT(setCollectionId(int))); - connect(this, SIGNAL(transitToAppsCheckListState(QString)), - SLOT(setCollectionName(QString))); connect(this, SIGNAL(transitToSaveState(QList)), SLOT(setAppList(QList))); @@ -250,28 +240,29 @@ // Add a specific item to a collection via collection specific menu. // Adding a new collection via the Collections view. mSelectCollectionState->addTransition(this, - SIGNAL(transitToNewCollectionState()), mNewCollectionState); + SIGNAL(transitToNewCollectionState()), mNewCollectionState); mSelectCollectionState->addTransition(this, - SIGNAL(transitToSaveState(int)), saveState); + SIGNAL(transitToSaveState(int)), saveState); mNewCollectionState->addTransition(this, - SIGNAL(transitToSaveState(QString)), saveState); + SIGNAL(transitToSaveState(QString)), saveState); // Add one/many applications to an existing/a new collection // via the All view options menu. - // Add items to a collection via the collection's view options menu. + // Add items to a collection via the collection's view options menu. mSelectCollectionState->addTransition(this, - SIGNAL(transitToAppsCheckListState(int)), mAppsCheckListState); + SIGNAL(transitToSaveState(int)), saveState); mNewCollectionState->addTransition(this, - SIGNAL(transitToAppsCheckListState(QString)), mAppsCheckListState); + SIGNAL(transitToSaveState(QString)), saveState); mAppsCheckListState->addTransition(this, - SIGNAL(transitToSaveState(QList)), saveState); - + SIGNAL(transitToSaveState(QList)), saveState); mSelectCollectionState->addTransition(this, - SIGNAL(transitToFinalState()),finalState); + SIGNAL(transitToFinalState()),finalState); mNewCollectionState->addTransition(this, - SIGNAL(transitToFinalState()), finalState); + SIGNAL(transitToFinalState()), finalState); mAppsCheckListState->addTransition(this, - SIGNAL(transitToFinalState()), finalState); + SIGNAL(transitToSelectCollectionState()), mSelectCollectionState); + mAppsCheckListState->addTransition(this, + SIGNAL(transitToFinalState()), finalState); //transition to final state after save saveState->addTransition(finalState); @@ -330,27 +321,19 @@ mApplicationsSortAttribute = static_cast(data.value( appSortOrderKey()).toInt()); - mCollectionsSortAttribute = static_cast(data.value( - collectionSortOrderKey()).toInt()); const int itemId = data.value(itemIdKey()).toInt(); mCollectionId = data.value(collectionIdKey()).toInt(); - if (itemId && (mCollectionsSortAttribute != NoHsSortAttribute - || mCollectionId)) { - //add selected app item form allAppView or collectionView + if (itemId) { + //add selected app item from allAppView or collectionView mAppList.append(itemId); - mInitialState->addTransition(mSelectCollectionState); - mShowConfirmation = true; - } else if (mApplicationsSortAttribute != NoHsSortAttribute - && mCollectionsSortAttribute != NoHsSortAttribute) { + } else if (mApplicationsSortAttribute != NoHsSortAttribute) { //add apps from allAppView options menu mActionType = ViaAllViewOptionMenuType; - - mInitialState->addTransition(mSelectCollectionState); - + mInitialState->addTransition(mAppsCheckListState); mShowConfirmation = true; } else if (mCollectionId) { //add apps from collectionView options menu @@ -406,22 +389,18 @@ } -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- -// -void HsAddAppsToCollectionState::editorDialogFinished(HbAction* finishedAction) +/*! + Slot invoked when editor dialog with name of created collection is finished. + */ +void HsAddAppsToCollectionState::editorDialogFinished( + HbAction* finishedAction) { if (finishedAction == mEditorDialog->actions().value(0)) { - QString newName(mEditorDialog->newName(mEditorDialog->value().toString(), true)); - if (mActionType == ViaAllViewOptionMenuType) { - qDebug("HsAddAppsToCollectionState::newCollection() " - "- emit collectionNameSelectedCl(newName)"); - emit transitToAppsCheckListState(newName); - } else { - qDebug("HsAddAppsToCollectionState::newCollection() " - "- emit collectionNameSelected(newName)"); - emit transitToSaveState(newName); - } + QString newName( + mEditorDialog->uniqueCollectionName()); + qDebug("HsAddAppsToCollectionState::newCollection() " + "- emit collectionNameSelectedCl(newName)"); + emit transitToSaveState(newName); } else { qDebug( "HsAddAppsToCollectionState::newCollection() - emit cancel()"); @@ -437,36 +416,76 @@ { qDebug("HsAddAppsToCollectionState::selectCollection()"); HSMENUTEST_FUNC_ENTRY("HsAddAppsToCollectionState::selectCollection"); - mListDialog = new HsCollectionsListDialog(mCollectionsSortAttribute, - mCollectionId); - mListDialog->open(this, SLOT(listDialogFinished(HbAction*))); + + HbDocumentLoader loader; + bool loadStatusOk = false; + loader.load(HS_COLLECTION_DIALOG_LAYOUT, &loadStatusOk); + Q_ASSERT_X(loadStatusOk, HS_COLLECTION_DIALOG_LAYOUT, + "Error while loading docml file."); + + mListDialog = qobject_cast( + loader.findWidget(HS_COLLECTION_DIALOG_NAME)); + + HbListView *listView = qobject_cast( + loader.findWidget(HS_COLLECTION_DIALOG_LIST_VIEW)); + + HbAction* createNewCollection = + qobject_cast(loader.findObject( + HS_COLLECTION_DIALOG_CREATE_NEW_ACTION)); + + HbAction* cancel = qobject_cast(loader.findObject( + HS_COLLECTION_DIALOG_CANCEL_ACTION)); + + if (mListDialog != NULL) { + mListDialog->setTimeout(HbPopup::NoTimeout); + mListDialog->setAttribute(Qt::WA_DeleteOnClose, true); + + createNewCollection->setParent(mListDialog); + cancel->setParent(mListDialog); + + mModel = standardItemModel(mCollectionId); + mModel->setParent(mListDialog); + listView->setModel(mModel); + + connect(listView, SIGNAL(activated(const QModelIndex &)), + this, SLOT(collectionSelected(const QModelIndex &))); + + mListDialog->open(this, SLOT(listDialogFinished(HbAction*))); + } + HSMENUTEST_FUNC_EXIT("HsAddAppsToCollectionState::selectCollection"); } -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- -// +/*! + Slot invoked when collection list dialog is finished + */ void HsAddAppsToCollectionState::listDialogFinished(HbAction* finishedAction) { - if (finishedAction != mListDialog->actions().value(0)) { - int itemId = mListDialog->getItemId(); - if (itemId) { - if (mActionType == ViaAllViewOptionMenuType) { - qDebug("emit collectionSelectedCl(%d)", itemId); - emit transitToAppsCheckListState(itemId); - } else { - qDebug("emit collectionSelected(%d)", itemId); - emit transitToSaveState(itemId); - } - } else { - qDebug("emit createNewCollection()"); - emit transitToNewCollectionState(); - } - } else { + if (finishedAction == mListDialog->actions().value(0)) { + qDebug("emit createNewCollection()"); + emit transitToNewCollectionState(); + } else if (finishedAction == mListDialog->actions().value(1)) { qDebug("emit cancel()"); emit transitToFinalState(); - } + } + mListDialog = NULL; // set to null since this will be deleted after close + mModel = NULL;// set to null since this will be deleted with dialog +} + +/*! + Slot invoked when collection is selected + \param modelIndex Index of selected item. + */ +void HsAddAppsToCollectionState::collectionSelected( + const QModelIndex &modelIndex) +{ + int selectedCollection = mModel->data( + modelIndex, CaItemModel::IdRole).toInt(); + mListDialog->close(); + + qDebug("emit collectionSelected(%d)", selectedCollection); + emit transitToSaveState(selectedCollection); } /*! @@ -479,9 +498,9 @@ HSMENUTEST_FUNC_ENTRY("HsAddAppsToCollectionState::showMessageAppsAdded"); HbNotificationDialog *notificationDialog = new HbNotificationDialog(); notificationDialog->setAttribute(Qt::WA_DeleteOnClose); - notificationDialog->setTitle(hbTrId( - "txt_applib_dpopinfo_added_to_collection_1") .arg( - HsMenuService::getName(id))); + notificationDialog->setTitle( + hbTrId("txt_applib_dpophead_added_to_collection_1") .arg( + HsMenuService::getName(id))); notificationDialog->show(); mShowConfirmation = false; HSMENUTEST_FUNC_EXIT("HsAddAppsToCollectionState::showMessageAppsAdded"); @@ -527,9 +546,6 @@ /*! Slot invoked when apps checklist state is entered. */ -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT void HsAddAppsToCollectionState::appsCheckListState() { qDebug("HsAddAppsToCollectionState::appsCheckListState()"); @@ -544,29 +560,60 @@ mAppsCheckList->showAppsCheckboxList(mApplicationsSortAttribute); HSMENUTEST_FUNC_EXIT("HsAddAppsToCollectionState::appsCheckListState"); } -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT /*! Slot connected trrigger action of secondary soft key of check list box. It is called when done button is selected. */ -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT void HsAddAppsToCollectionState::selectApplicationsDone( const QList &appList) { if (appList.count()) { qDebug("AppsCheckListState::selectApplicationsDone() " "- emit appsSelected(mAppList)"); - emit transitToSaveState(appList); + if (mActionType == ViaAllViewOptionMenuType) { + setAppList(appList); + emit transitToSelectCollectionState(); + } else { + emit transitToSaveState(appList); + } } else { qDebug( "AppsCheckListState::selectApplicationsDone() - emit cancel()"); emit transitToFinalState(); } } -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT +/*! + Creates standard item model. + \param collectionId id of collection to remove from model. + \return QStandardItemModel - caller takes ownership. + */ +QStandardItemModel *HsAddAppsToCollectionState::standardItemModel( + int collectionId) +{ + HSMENUTEST_FUNC_ENTRY("HsListDialog::standartItemModel"); + QScopedPointer caModel( + HsMenuService::getAllCollectionsModel()); + caModel->setSecondLineVisibility(true); + QStandardItemModel *model = new QStandardItemModel(this); + QList items; + for (int row = 0; row < caModel->rowCount(); row++) { + uint flags = caModel->data(caModel->index(row, 0), + CaItemModel::FlagsRole).value (); + int itemId = caModel->data(caModel->index(row, 0), + CaItemModel::IdRole).toInt(); + if ((flags & RemovableEntryFlag) && (itemId != collectionId)) { + QStandardItem *standardItem = new QStandardItem(); + standardItem->setData(caModel->data(caModel->index(row, 0), + CaItemModel::IdRole), CaItemModel::IdRole); + standardItem->setData(caModel->data(caModel->index(row, 0), + Qt::DisplayRole), Qt::DisplayRole); + standardItem->setData(caModel->data(caModel->index(row, 0), + Qt::DecorationRole), Qt::DecorationRole); + items << standardItem; + } + } + model->insertColumn(0, items); + + HSMENUTEST_FUNC_EXIT("HsListDialog::standartItemModel"); + return model; +} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddtohomescreenstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddtohomescreenstate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddtohomescreenstate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -17,13 +17,14 @@ #include #include -#include #include #include #include #include #include #include +#include "hsmenudialogfactory.h" +#include "hsmenuentryremovedhandler.h" #include "hsaddtohomescreenstate.h" #include "hsmenuevent.h" @@ -56,8 +57,7 @@ HsAddToHomeScreenState::HsAddToHomeScreenState(QState *parent) : QState(parent), mCorruptedMessage(NULL), mConfirmAction(NULL), - mMenuMode(NormalHsMenuMode), - mNotifier(0) + mMenuMode(NormalHsMenuMode) { setObjectName("/AddToHomeScreenState"); @@ -140,7 +140,6 @@ params[HOMESCREENDATA] = mToken; bool success = contentService.createWidget(params); if (!success) { - subscribeForMemoryCardRemove(); showMessageWidgetCorrupted(); } else { emit exit(); @@ -163,21 +162,16 @@ { HSMENUTEST_FUNC_ENTRY("HsCollectionState::showMessageWidgetCorrupted"); - mCorruptedMessage = new HbMessageBox(HbMessageBox::MessageTypeQuestion); - mCorruptedMessage->setAttribute(Qt::WA_DeleteOnClose); - - QString message(hbTrId("txt_applib_dialog_file_corrupted_unable_to_use_wi")); - mCorruptedMessage->setText(message); - - mCorruptedMessage->clearActions(); - mConfirmAction = new HbAction(hbTrId("txt_common_button_ok"), - mCorruptedMessage); - mCorruptedMessage->addAction(mConfirmAction); - - HbAction *secondaryAction = new HbAction( - hbTrId("txt_common_button_cancel"), mCorruptedMessage); - mCorruptedMessage->addAction(secondaryAction); - + mCorruptedMessage = HsMenuDialogFactory().create( + hbTrId("txt_applib_dialog_file_corrupted_unable_to_use_wi")); + mConfirmAction = mCorruptedMessage->actions().value(0); + + QScopedPointer entryObserver( + new HsMenuEntryRemovedHandler(mEntryId, + mCorruptedMessage, SLOT(close()))); + + entryObserver.take()->setParent(mCorruptedMessage); + mCorruptedMessage->open(this, SLOT(messageWidgetCorruptedFinished(HbAction*))); HSMENUTEST_FUNC_EXIT("HsCollectionState::showMessageWidgetCorrupted"); @@ -190,7 +184,7 @@ void HsAddToHomeScreenState::messageWidgetCorruptedFinished (HbAction* finishedAction) { - if (finishedAction == mConfirmAction) { + if (static_cast(finishedAction) == mConfirmAction) { HsMenuService::executeAction(mEntryId, removeActionIdentifier()); } emit exit(); @@ -198,6 +192,7 @@ machine()->postEvent( HsMenuEventFactory::createOpenHomeScreenEvent()); } + mConfirmAction = NULL; } @@ -208,19 +203,11 @@ void HsAddToHomeScreenState::cleanUp() { // Close popups if App key was pressed - if (mCorruptedMessage) { - disconnect(mCorruptedMessage, SIGNAL(finished(HbAction*)), - this, SLOT(messageWidgetCorruptedFinished(HbAction*))); + if (mCorruptedMessage != NULL) { mCorruptedMessage->close(); mCorruptedMessage = NULL; } - disconnect(mNotifier, - SIGNAL(entryChanged(CaEntry,ChangeType)), - this, SLOT(memoryCardRemoved())); - - delete mNotifier; - mNotifier = NULL; mToken = NULL; } @@ -317,32 +304,6 @@ } } -/*! - Subscribe for memory card remove. - \retval void - */ -void HsAddToHomeScreenState::subscribeForMemoryCardRemove() -{ - CaNotifierFilter filter; - QList entryIds; - entryIds.append(mEntryId); - filter.setIds(entryIds); - mNotifier = CaService::instance()->createNotifier(filter); - mNotifier->setParent(this); - connect(mNotifier, - SIGNAL(entryChanged(CaEntry,ChangeType)), - SLOT(memoryCardRemoved())); -} + -/*! - Memory card with instaled widget was removed. - \retval void - */ -void HsAddToHomeScreenState::memoryCardRemoved() -{ - if (mCorruptedMessage) { - mCorruptedMessage->close(); - mCorruptedMessage = NULL; - } - // exit not needed, it is called after dialog closed -} + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsappschecklist.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsappschecklist.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsappschecklist.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include @@ -81,7 +81,7 @@ \retval void */ HsAppsCheckList::HsAppsCheckList() : - mView(0), mPreviousView(0), mActionConfirm(0), mListView(0), mModel(0), + mAppsSelectDialog(0), mActionConfirm(0), mListView(0), mModel(0), mSortAttribute(AscendingNameHsSortAttribute) { } @@ -101,16 +101,10 @@ void HsAppsCheckList::cleanUp() { //clean up + if (mAppsSelectDialog) { + mAppsSelectDialog->close(); + } - qDeleteAll(mLoadedObjects); - mLoadedObjects.clear(); - mListView = NULL; - mView = NULL; - - delete mActionConfirm; - mActionConfirm = NULL; - delete mModel; - mModel = NULL; mSortAttribute = AscendingNameHsSortAttribute; } @@ -127,9 +121,6 @@ Shows check box list with all application. \param sortAttribute order to sort applications. */ -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT void HsAppsCheckList::showAppsCheckboxList(HsSortAttribute sortOrder) { HSMENUTEST_FUNC_ENTRY("HsAppsCheckList::showAppsCheckboxList"); @@ -139,84 +130,81 @@ // fills model with data // constucts controls such as checklist constructControls(); - - // Add mListView to main window - HbMainWindow *hbMainWindow = mainWindow(); + + if (mAppsSelectDialog) { + mAppsSelectDialog->setTimeout(HbPopup::NoTimeout); + mAppsSelectDialog->setAttribute(Qt::WA_DeleteOnClose); + mAppsSelectDialog->open(this, + SLOT(appsSelectionDialogFinished(HbAction*))); + } - // add confirm action - mView->setNavigationAction(mActionConfirm); - - hbMainWindow->addView(mView); - // record the current view in order to activate it once done - mPreviousView = hbMainWindow->currentView(); - hbMainWindow->setCurrentView(mView); - hbMainWindow->show(); HSMENUTEST_FUNC_EXIT("HsAppsCheckList::showAppsCheckboxList"); } -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT + /*! Construct contrlos. */ void HsAppsCheckList::constructControls() { HSMENUTEST_FUNC_ENTRY("HsAppsCheckList::constructControls"); - if (!mActionConfirm) { - mActionConfirm = new HbAction(Hb::ConfirmNaviAction, mView); - connect(mActionConfirm, SIGNAL(triggered()),SLOT(selectApplicationsDone())); - } + + bool loadStatusOk = false; + HbDocumentLoader loader; + loader.load(HS_APP_CHECK_LIST_LAYOUT, &loadStatusOk); - if (!mView) { // it implies that mListView is NULL as well - bool loadStatusOk = false; + Q_ASSERT_X(loadStatusOk, + HS_APP_CHECK_LIST_LAYOUT, + "Error while loading docml file."); - HbDocumentLoader loader; - mLoadedObjects = loader.load(HS_APP_CHECK_LIST_LAYOUT, &loadStatusOk); + static const QString APPS_SELECTION_DIALOG("applications_selection_dialog"); + mAppsSelectDialog = + qobject_cast(loader.findWidget(APPS_SELECTION_DIALOG)); - Q_ASSERT_X(loadStatusOk, - HS_APP_CHECK_LIST_LAYOUT, - "Error while loading docml file."); + if (mAppsSelectDialog) { + static const QString LIST_VIEW_WIDGET("listView"); + mListView = qobject_cast (loader.findWidget( + LIST_VIEW_WIDGET)); + mModel->setParent(mAppsSelectDialog); + mListView->setModel(mModel); - static const QString VIEW_WIDGET_NAME("view"); - mView = qobject_cast (loader.findWidget(VIEW_WIDGET_NAME)); - mView->setParent(this); + connect(mListView,SIGNAL(activated(const QModelIndex&) ),this + ,SLOT(selectedItemsChanged())); + connect(mModel,SIGNAL(rowsRemoved(const QModelIndex&, int,int)), + this, SLOT(selectedItemsChanged())); - static const QString LIST_VIEW_WIDGET_NAME("listView"); - mListView = qobject_cast (loader.findWidget( - LIST_VIEW_WIDGET_NAME)); - mListView->setModel(mModel); + // add confirm action + static const QString HS_APPS_SELECTION_DIALOG_CONFIRMATION_ACTION + ("aps_dialog_softkey_2_left"); + mActionConfirm = qobject_cast(loader.findObject( + HS_APPS_SELECTION_DIALOG_CONFIRMATION_ACTION)); + mActionConfirm->setEnabled(false); + mAppsSelectDialog->actions()[0]->setParent(mAppsSelectDialog); + mAppsSelectDialog->actions()[1]->setParent(mAppsSelectDialog); } HSMENUTEST_FUNC_EXIT("HsAppsCheckList::constructControls"); } /*! - Slot connected trrigger action of secondary soft key of check list box. - It is called when done button is selected. + Action after closed application selection dialog. + \param finishedAction chosen action. + \retval void */ -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT -void HsAppsCheckList::selectApplicationsDone() +void HsAppsCheckList::appsSelectionDialogFinished(HbAction* finishedAction) { - HSMENUTEST_FUNC_ENTRY("HsAppsCheckList::selectApplicationsDone"); - // Remove mListView from main window and restore previous view. - HbMainWindow *hbMainWindow = mainWindow(); - hbMainWindow->setCurrentView(mPreviousView); - hbMainWindow->removeView(mView); - - QItemSelectionModel *itemSelectionModel = mListView->selectionModel(); + HSMENUTEST_FUNC_ENTRY("HsAppsCheckList::appsSelectionDialogFinished"); QList itemsList; - if (itemSelectionModel) { - QModelIndexList modelIndexList = - itemSelectionModel->selectedIndexes(); - itemsList = getSortedItemsList(modelIndexList); + if (finishedAction == mActionConfirm) { + QItemSelectionModel *itemSelectionModel = mListView->selectionModel(); + if (itemSelectionModel) { + QModelIndexList modelIndexList = + itemSelectionModel->selectedIndexes(); + itemsList = getSortedItemsList(modelIndexList); + } } + mAppsSelectDialog = NULL; emit commit(itemsList); - HSMENUTEST_FUNC_EXIT("HsAppsCheckList::selectApplicationsDone"); + HSMENUTEST_FUNC_EXIT("HsAppsCheckList::appsSelectionDialogFinished"); } -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT /*! Returns list with selected items ids. @@ -251,16 +239,13 @@ } /*! - Returns pointer to tha main window. - \return Pointer to the main window. + Slot activated then user select or unselect item */ -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT -HbMainWindow *HsAppsCheckList::mainWindow() const +void HsAppsCheckList::selectedItemsChanged() { - return HbInstance::instance()->allMainWindows().value(0); + if (mListView->selectionModel()->hasSelection()) { + mActionConfirm->setEnabled(true); + } else { + mActionConfirm->setEnabled(false); + } } -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsarrangestate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsarrangestate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsarrangestate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -78,7 +78,7 @@ */ HsArrangeState::HsArrangeState(QState *parent) : QState(parent), mDialog(0), mEntriesList(0), - mItemModel(0) + mItemModel(0),mCollectionId(0) { construct(); } @@ -119,9 +119,10 @@ HSMENUTEST_FUNC_ENTRY("HsArrangeState::save"); getArrangedEntriesIds(listWidget); - if (mArrangedCollIdList != mCollIdList) { + if (mArrangedCollItemIdList != mCollItemIdList) { HsMenuService::organizeCollection( - HsMenuService::allCollectionsId(), mArrangedCollIdList); + mCollectionId, + mArrangedCollItemIdList); } HSMENUTEST_FUNC_EXIT("HsArrangeState::save"); @@ -156,9 +157,22 @@ mDialog = qobject_cast( loader.findWidget(HS_ARRANGE_DIALOG_NAME)); - if (mEntriesList != NULL && mDialog != NULL) { + if (mEntriesList && mDialog) { + switch (menuEvent->operation()) { + case HsMenuEvent::ArrangeCollection: + mCollectionId = data.value(collectionIdKey()).toInt(); + mItemModel = HsMenuService::getCollectionModel( + mCollectionId, + NoHsSortAttribute); + break; + case HsMenuEvent::ArrangeAllCollections: + mCollectionId = HsMenuService::allCollectionsId(); + mItemModel = HsMenuService::getAllCollectionsModel(); + break; + default: + break; + } - mItemModel = HsMenuService::getAllCollectionsModel(); // as we copy the model contents to the list widget // we do not need the model to auto update mItemModel->setAutoUpdate(false); @@ -171,7 +185,7 @@ mEntriesList->setArrangeMode(true); mDialog->setTimeout(HbPopup::NoTimeout); - mDialog->setAttribute(Qt::WA_DeleteOnClose, true); + mDialog->setAttribute(Qt::WA_DeleteOnClose); mDialog->setPreferredSize( HbInstance::instance()->allMainWindows().at(0)->size()); @@ -201,7 +215,8 @@ { HSMENUTEST_FUNC_ENTRY("HsArrangeState::stateExited"); if (mDialog) { - disconnect(mDialog, SIGNAL(finished(HbAction*)), this, SLOT(arrangeDialogFinished(HbAction*))); + disconnect(mDialog, SIGNAL(finished(HbAction*)), + this, SLOT(arrangeDialogFinished(HbAction*))); mDialog->close(); mDialog = NULL; } @@ -212,8 +227,8 @@ delete mItemModel; mItemModel = NULL; - mArrangedCollIdList.clear(); - mCollIdList.clear(); + mArrangedCollItemIdList.clear(); + mCollItemIdList.clear(); HSMENUTEST_FUNC_EXIT("HsArrangeState::stateExited"); qDebug("HsArrangeState::stateExited()"); @@ -235,7 +250,7 @@ int itemId = mItemModel->data(idx, CaItemModel::IdRole).toInt(); widgetItem->setData(mItemModel->data(idx, CaItemModel::IdRole), CaItemModel::IdRole); - mCollIdList.append(itemId); + mCollItemIdList.append(itemId); widgetItem->setData(mItemModel->data(idx, Qt::DisplayRole), Qt::DisplayRole); widgetItem->setData(mItemModel->data(idx, Qt::DecorationRole), @@ -259,6 +274,6 @@ for (int i(0); i < listWidget.count(); ++i) { HbListWidgetItem *widgetItem = listWidget.item(i); QVariant entryId = widgetItem->data(CaItemModel::IdRole); - mArrangedCollIdList.append(entryId.toInt()); + mArrangedCollItemIdList.append(entryId.toInt()); } } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamedialog.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamedialog.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamedialog.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -54,16 +54,22 @@ HsCollectionNameDialog::HsCollectionNameDialog(const int &itemId) { HSMENUTEST_FUNC_ENTRY("HsInputDialog::HsInputDialog"); - mCollectionsNames = HsMenuService::getCollectionNames(); + mOtherCollectionsNames = HsMenuService::getCollectionNames(); + + setInputMode(HbInputDialog::TextInput); setPromptText(hbTrId("txt_applib_title_collection_name")); lineEdit()->setMaxLength(qMaxStrLength); if (itemId) { - setValue(HsMenuService::getName(itemId)); - mCollectionsNames.removeOne(value().toString()); + const QString currentCollectionName( + HsMenuService::getName(itemId)); + setValue(currentCollectionName); + mOtherCollectionsNames.removeOne(currentCollectionName); + mSuggestedNames << currentCollectionName; } else { setValue(hbTrId("txt_applib_dialog_entry_collection")); } + HSMENUTEST_FUNC_EXIT("HsInputDialog::HsInputDialog"); } @@ -72,8 +78,8 @@ */ HsCollectionNameDialog::~HsCollectionNameDialog() { - mCollectionsNames.clear(); - mLastCollectionName.clear(); + mOtherCollectionsNames.clear(); + mSuggestedNames.clear(); } /*! @@ -95,6 +101,16 @@ } /*! + \return User input if it is unique collection name or an unique collection name being + a combination of user name and a suffix matching following regular expression: + "\([0-9][1-9]\)|\([1-9][0-9]+\)" + */ +QString HsCollectionNameDialog::uniqueCollectionName() const +{ + return generateUniqueCollectionName(value().toString()); +} + +/*! \reimp Disconnects signals and calls base class impl. which emits finished(HbAction*) */ @@ -106,41 +122,50 @@ } /*! - * Gets new collection's name. - \param name name of collection. - \param addLastName true - if last found name is need to add to validation - \retval new collection name. + \param name Input string which is to be basename + of resulting unique collection name. + \return Unique collection name. */ -QString HsCollectionNameDialog::newName(const QString &name, - bool addLastName) +QString HsCollectionNameDialog::generateUniqueCollectionName( + const QString &name) const { HSMENUTEST_FUNC_ENTRY("HsInputDialog::newName"); + QString newName(name); - int numToAppend(1); - if (addLastName && mLastCollectionName.length() > 0 - && !mCollectionsNames.contains(mLastCollectionName)) { - mCollectionsNames << mLastCollectionName; + + unsigned int numToAppend(1); + + while (mOtherCollectionsNames.contains(newName)) { + newName = + name + + QString("(%1)").arg(numToAppend, 2, 10, QLatin1Char('0')); + numToAppend++; } - while (mCollectionsNames.contains(newName)) { + + HSMENUTEST_FUNC_EXIT("HsInputDialog::newName"); + return newName; +} +/*! + \param name Input string which is to be basename + for suggested collection name. + \return Unique collection name if it was not yet proposed during lifetime of the dialog + or \a name otherwise. + */ +QString HsCollectionNameDialog::suggestedCollectionName(const QString &name) +{ + HSMENUTEST_FUNC_ENTRY("HsInputDialog::processInput"); + + QString newName = generateUniqueCollectionName(name); + + if (mSuggestedNames.contains(newName)) { newName = name; - newName.append("("); - if (numToAppend < 10) { - newName.append("0"); - } - newName.append(QString::number(numToAppend)); - newName.append(")"); - numToAppend++; - if (!addLastName) { - if (mLastCollectionName.length() > 0 - && !mCollectionsNames.contains(mLastCollectionName)) { - mCollectionsNames << mLastCollectionName; - } - mCollectionsNames.removeOne(name); - mLastCollectionName = name; - } } - HSMENUTEST_FUNC_EXIT("HsInputDialog::newName"); + + if (newName != name) { + mSuggestedNames << newName; + } + + HSMENUTEST_FUNC_EXIT("HsInputDialog::validate"); return newName; } @@ -184,7 +209,7 @@ actions()[0]->setEnabled(true); } - QString newText = newName(text); + QString newText = suggestedCollectionName(text); if (newText != text) { makeDisconnect(); lineEdit()->setText(newText); diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamestate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamestate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamestate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -111,7 +111,7 @@ void HsCollectionNameState::dialogFinished(HbAction* finishedAction) { if (finishedAction == mCollectionNameDialog->actions().value(0)) { - QString newName(mCollectionNameDialog->newName(mCollectionNameDialog->value().toString(), true)); + QString newName(mCollectionNameDialog->uniqueCollectionName()); if (mItemId) { if (newName != HsMenuService::getName(mItemId)) { HsMenuService::renameCollection(mItemId, newName); diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionslistdialog.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionslistdialog.cpp Tue Jul 06 14:06:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Hs list dialog - * - */ - -#include -#include -#include -#include - -#include -#include -#include "hscollectionslistdialog.h" - -/*! - \class HsCollectionsListDialog - \ingroup group_hsworkerstateplugin - \brief Hs List Dialog - Hs List Dialog - */ - -/*! - \var HsCollectionsListDialog::mModel - Model. - */ - -/*! - \var HsCollectionsListDialog::mItemId - Selected item id. - */ - -/*! - \fn void HsCollectionsListDialog::makeConnect(); - Connects edit line signals to slots. -*/ - -/*! - \fn void HsCollectionsListDialog::makeDisconnect(); - Disconnects edit line signals from slots. - */ - -/*! - Constructor - \param sortOrder sort order. - \param collectionId collectionId id of collection - to remove from list. - \retval void - */ -HsCollectionsListDialog::HsCollectionsListDialog(HsSortAttribute sortOrder, - int collectionId) : - HbSelectionDialog(), mItemId(0) -{ - clearActions(); - HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel"), this); - addAction(cancelAction); - - setHeadingWidget(new HbLabel(hbTrId("txt_applib_title_add_to"))); - // it must be single selection, although it shows checkboxes - - // it is Orbit defect and will be fixed in next release - setSelectionMode(HbAbstractItemView::SingleSelection); - mModel = standartItemModel(sortOrder, collectionId); - setModel(mModel); -} - -/*! - Destructor - */ -HsCollectionsListDialog::~HsCollectionsListDialog() -{ - delete mModel; -} - -/*! - Executes dialog. - \retval Selected action. - */ -void HsCollectionsListDialog::open(QObject* receiver, const char* member) -{ - this->setAttribute(Qt::WA_DeleteOnClose); - HbSelectionDialog::open(receiver, member); -} - -/*! - \reimp - Disconnects signals and calls base class impl. which emits finished(HbAction*) - */ -void HsCollectionsListDialog::closeEvent ( QCloseEvent * event ) -{ - qDebug("HsCollectionsListDialog::closeEvent"); - HbAction *closingAction = qobject_cast(sender()); - - if (closingAction != actions().value(0)) { - QModelIndexList modlist = selectedModelIndexes(); - if (modlist.count()) { - mItemId - = mModel-> data(modlist[0], CaItemModel::IdRole).toInt(); - } - } - - HbDialog::closeEvent(event); // emits finished(HbAction*) -} - -/*! - Creates standard item model. - \param sortOrder sort order. - \param collectionId id of collection to remove from model. - \return QStandardItemModel - caller takes ownership. - */ -QStandardItemModel *HsCollectionsListDialog::standartItemModel( - HsSortAttribute sortOrder, int collectionId) -{ - HSMENUTEST_FUNC_ENTRY("HsListDialog::standartItemModel"); - QScopedPointer caModel( - HsMenuService::getAllCollectionsModel(sortOrder)); - caModel->setSecondLineVisibility(false); - QStandardItemModel *model = new QStandardItemModel(this); - QList items; - for (int row = 0; row < caModel->rowCount(); row++) { - uint flags = caModel->data(caModel->index(row, 0), - CaItemModel::FlagsRole).value (); - int itemId = caModel->data(caModel->index(row, 0), - CaItemModel::IdRole).toInt(); - if ((flags & RemovableEntryFlag) && (itemId != collectionId)) { - QStandardItem *standardItem = new QStandardItem(); - standardItem->setData(caModel->data(caModel->index(row, 0), - CaItemModel::IdRole), CaItemModel::IdRole); - standardItem->setData(caModel->data(caModel->index(row, 0), - Qt::DisplayRole), Qt::DisplayRole); - standardItem->setData(caModel->data(caModel->index(row, 0), - Qt::DecorationRole), Qt::DecorationRole); - items << standardItem; - } - } - model->insertColumn(0, items); - - insertNewCollectionItem(model); - HSMENUTEST_FUNC_EXIT("HsListDialog::standartItemModel"); - return model; -} - -/*! - Inserts "new collection" item into model. - \param model a model. - */ -void HsCollectionsListDialog::insertNewCollectionItem( - QStandardItemModel *model) -{ - HSMENUTEST_FUNC_ENTRY("HsListDialog::insertNewCollectionItem"); - QStandardItem *standardItem = new QStandardItem(); - standardItem->setData(0, CaItemModel::IdRole); - standardItem->setData(hbTrId("txt_applib_list_new_collection"), - Qt::DisplayRole); - - standardItem->setData(HbIcon(defaultCollectionIconId()), - Qt::DecorationRole); - - QList items; - items << standardItem; - model->insertRow(0, items); - HSMENUTEST_FUNC_EXIT("HsListDialog::insertNewCollectionItem"); -} - -/*! - Gets selected item id. - \retval Selected item id. - */ -int HsCollectionsListDialog::getItemId() -{ - return mItemId; -} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionitemstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionitemstate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionitemstate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -15,12 +15,13 @@ * */ -#include +#include #include #include #include #include +#include "hsmenudialogfactory.h" #include "hsdeletecollectionitemstate.h" #include "hsmenuevent.h" @@ -86,18 +87,8 @@ HsMenuService::getName(mItemId))); // create and show message box - mDeleteMessage = new HbMessageBox(HbMessageBox::MessageTypeQuestion); - mDeleteMessage->setAttribute(Qt::WA_DeleteOnClose); - - mDeleteMessage->setText(message); - - mDeleteMessage->clearActions(); - mConfirmAction = new HbAction(hbTrId("txt_common_button_ok"), mDeleteMessage); - mDeleteMessage->addAction(mConfirmAction); - - HbAction *secondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), mDeleteMessage); - mDeleteMessage->addAction(secondaryAction); - + mDeleteMessage = HsMenuDialogFactory().create(message); + mConfirmAction = mDeleteMessage->actions().value(0); mDeleteMessage->open(this, SLOT(deleteMessageFinished(HbAction*))); HSMENUTEST_FUNC_EXIT("HsDeleteCollectionItemState::onEntry"); @@ -110,10 +101,11 @@ */ void HsDeleteCollectionItemState::deleteMessageFinished(HbAction* finishedAction) { - if (finishedAction == mConfirmAction) { + if (static_cast(finishedAction) == mConfirmAction) { HsMenuService::removeApplicationFromCollection(mItemId, mCollectionId); } emit exit(); + mConfirmAction = NULL; } /*! diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionstate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionstate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -16,7 +16,7 @@ */ #include -#include +#include #include #include #include @@ -24,6 +24,7 @@ #include #include "hsdeletecollectionstate.h" +#include "hsmenudialogfactory.h" #include "hsmenuevent.h" /*! @@ -91,19 +92,10 @@ } // create and show message box - mDeleteMessage = new HbMessageBox(HbMessageBox::MessageTypeQuestion); - mDeleteMessage->setAttribute(Qt::WA_DeleteOnClose); - - mDeleteMessage->setText(message); + mDeleteMessage = HsMenuDialogFactory().create(message); + mConfirmAction = mDeleteMessage->actions().value(0); + mDeleteMessage->open(this, SLOT(deleteMessageFinished(HbAction*))); - mDeleteMessage->clearActions(); - mConfirmAction = new HbAction(hbTrId("txt_common_button_ok"), mDeleteMessage); - mDeleteMessage->addAction(mConfirmAction); - - HbAction *secondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), mDeleteMessage); - mDeleteMessage->addAction(secondaryAction); - - mDeleteMessage->open(this, SLOT(deleteMessageFinished(HbAction*))); HSMENUTEST_FUNC_EXIT("HsDeleteCollectionState::onEntry"); } @@ -113,12 +105,13 @@ // void HsDeleteCollectionState::deleteMessageFinished(HbAction* finishedAction) { - if (finishedAction == mConfirmAction) { + if (static_cast(finishedAction) == mConfirmAction) { HsMenuService::removeCollection(mItemId); machine()->postEvent( HsMenuEventFactory::createCollectionDeletedEvent()); } emit exit(); + mConfirmAction = NULL; } /*! @@ -129,7 +122,6 @@ { // Close messagebox if App key was pressed if (mDeleteMessage) { - disconnect(mDeleteMessage, SIGNAL(finished(HbAction*)), this, SLOT(deleteMessageFinished(HbAction*))); mDeleteMessage->close(); mDeleteMessage = NULL; } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsinstallationlogstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsinstallationlogstate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,169 @@ +/* + * 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: Menu delete collection item state + * + */ + +#include +#include +#include +#include +#include +#include + +#include "hsinstallationlogstate.h" + +/*! + \class HsInstallationLogState + \ingroup group_hsworkerstateplugin + \brief Uninstall Item State. + Deletes app from collection. + */ + +/*! + Constructor. + \param parent Parent state. + */ +HsInstallationLogState::HsInstallationLogState(QState *parent) : + QState(parent), + mInstalationLogDialog(NULL) +{ + construct(); +} + +/*! + Destructor. + */ +HsInstallationLogState::~HsInstallationLogState() +{ + cleanUp(); // in case of throw +} + +/*! + Constructs contained objects. + */ +void HsInstallationLogState::construct() +{ + setObjectName("/InstallationLogState"); + if (this->parent()) { + setObjectName(this->parent()->objectName() + objectName()); + } + connect(this, SIGNAL(exited()), SLOT(cleanUp())); +} + +/*! + Sets entry event. + \param event entry event. + */ +void HsInstallationLogState::onEntry(QEvent *event) +{ + HSMENUTEST_FUNC_ENTRY("HsInstallationLogState::onEntry"); + QState::onEntry(event); + qDebug("HsInstallationLogState::onEntry()"); + + createInstallationLogDialog(); + + HSMENUTEST_FUNC_EXIT("HsInstallationLogState::onEntry"); +} + +/*! + Invoked on exiting state + */ +void HsInstallationLogState::onExit(QEvent *event) +{ + QState::onExit(event); +} + +/*! + Create installation log dialog. + \retval void + */ +void HsInstallationLogState::createInstallationLogDialog() +{ + QList detailsList = + CaSoftwareRegistry::create()->retrieveLogEntries(); + + HbDocumentLoader loader; + bool loadStatusOk = false; + loader.load(HS_INSTALLATION_LOG_DIALOG_LAYOUT, &loadStatusOk); + Q_ASSERT_X(loadStatusOk, HS_INSTALLATION_LOG_DIALOG_LAYOUT, + "Error while loading docml file."); + + mInstalationLogDialog = qobject_cast( + loader.findWidget(HS_INSTALLATION_LOG_DIALOG_NAME)); + + if (mInstalationLogDialog != NULL) { + mInstalationLogDialog->actions()[0]->setParent(mInstalationLogDialog); + mInstalationLogDialog->setTimeout(HbPopup::NoTimeout); + mInstalationLogDialog->setAttribute(Qt::WA_DeleteOnClose, true); + + HbLabel* logList; + QString applicationsList; + QString listElement("%1 (%2)\n%3 - "); + QString applicationName; + QString version; + QString date; + QString type; + QString installed(hbTrId("txt_applib_dialog_installed")); + QString removed(hbTrId("txt_applib_dialog_removed")); + QString newLine("\n"); + + logList = qobject_cast( + loader.findWidget(HS_INSTALLATION_LOG_DIALOG_LOG_LABEL)); + + for (int i=0; isetPlainText(applicationsList); + + mInstalationLogDialog->open(this, SLOT(stateExited())); + } +} + +void HsInstallationLogState::stateExited() +{ + mInstalationLogDialog = NULL; + emit exit(); +} + +/*! + Slot launched after state has exited and in destructor. + \retval void + */ +void HsInstallationLogState::cleanUp() +{ + // Close popups if App key was pressed + if (mInstalationLogDialog) { + mInstalationLogDialog->close(); + mInstalationLogDialog = NULL; + } +} + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsmenuworkerstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsmenuworkerstate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsmenuworkerstate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -28,6 +28,7 @@ #include "hspreviewhswidgetstate.h" #include "hsviewappsettingsstate.h" #include "hsviewappdetailsstate.h" +#include "hsinstallationlogstate.h" /*! \class HsMenuWorkerState @@ -79,7 +80,9 @@ createChildState ( HsMenuEvent::UninstallApplication); createChildState (HsMenuEvent::ArrangeCollection); + createChildState (HsMenuEvent::ArrangeAllCollections); + // create a new child state based on the template HsCollectionNameState *newChildState = new HsCollectionNameState(this); // create a transition to the new child state which will be triggered by @@ -95,7 +98,8 @@ mInitialState->addTransition(createCollectionTransition); // set a transition to the initial state after child processing finished newChildState->addTransition(newChildState, SIGNAL(exit()), mInitialState); - + connect(this, SIGNAL(reset()), newChildState, SIGNAL(exit())); + HsAddAppsToCollectionState *addAppsToCollectionState = new HsAddAppsToCollectionState(this); // create a transition to the new child state which will be triggered by @@ -108,9 +112,12 @@ addAppsToCollectionState->addTransition(addAppsToCollectionState, SIGNAL(finished()), mInitialState); connect(this, SIGNAL(reset()), addAppsToCollectionState, SIGNAL(finished())); + + createChildState (HsMenuEvent::PreviewHSWidget); createChildState (HsMenuEvent::ShowAppSettings); createChildState (HsMenuEvent::ShowAppDetails); + createChildState (HsMenuEvent::ShowInstallationLog); HSMENUTEST_FUNC_EXIT("HsMenuWorkerState::construct"); } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hspreviewhswidgetstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hspreviewhswidgetstate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hspreviewhswidgetstate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -15,7 +15,6 @@ * */ - #include #include #include @@ -35,10 +34,12 @@ #include "hswidgethost.h" #include "hspreviewhswidgetstate.h" #include "hsmenuevent.h" +#include "hsmenudialogfactory.h" #include "hsapp_defs.h" #include "hsscene.h" #include "hspage.h" + #include "canotifier.h" #include "canotifierfilter.h" #include "caservice.h" @@ -63,10 +64,12 @@ HsPreviewHSWidgetState::HsPreviewHSWidgetState(QState *parent) : QState(parent), mPreviewDialog(0), - mNotifier(0), - mWidget(0), mEntryId(0), - mCorruptedMessage(0) + mCorruptedMessage(0), + mConfirmRemovalAction(0), + mAddToHomescreenAction(0), + mToken(), + mUri() { setObjectName("/HsPreviewHSWidgetState"); if (this->parent()) { @@ -100,34 +103,27 @@ HSMENUTEST_FUNC_ENTRY("HsPreviewHSWidgetState::onEntry"); QState::onEntry(event); HsMenuEvent *menuEvent = static_cast(event); + QVariantMap data = menuEvent->data(); - mEntryId = data.value(itemIdKey()).toInt(); - - QVariantHash widgetData; - widgetData.insert(LIBRARY, data.value(widgetLibraryAttributeName()).toString()); - widgetData.insert(URI, data.value(widgetUriAttributeName()).toString()); - - mWidget.reset( - HsContentService::instance()->createWidgetForPreview(widgetData)); - - if (!mWidget.isNull()) { + mToken = data.value(HOMESCREENDATA); + - QSharedPointer entry = - CaService::instance()->getEntry(mEntryId); - - mPreviewDialog = buildPreviewDialog(*entry); + QSharedPointer entry = + CaService::instance()->getEntry(mEntryId); + mUri = entry->attribute(widgetUriAttributeName()); + mPreviewDialog = buildPreviewDialog(*entry); + mAddToHomescreenAction = mPreviewDialog->actions().value(0); + + if (mPreviewDialog != NULL) { + // Launch popup asyncronously - if (mPreviewDialog != NULL) { - subscribeForMemoryCardRemove(); - // Launch popup asyncronously - mPreviewDialog->open(this, SLOT(previewDialogFinished(HbAction*))); - } - } else { - subscribeForMemoryCardRemove(); - showMessageWidgetCorrupted(); + mEntryObserver.reset( + new HsMenuEntryRemovedHandler(mEntryId, this, SIGNAL(exit()))); + + mPreviewDialog->open(this, SLOT(previewDialogFinished(HbAction*))); } - + HSMENUTEST_FUNC_EXIT("HsPreviewHSWidgetState::onEntry"); } @@ -137,29 +133,19 @@ */ void HsPreviewHSWidgetState::cleanUp() { - // Close popups if App key was pressed or memory card removed - if (mPreviewDialog) { - disconnect(mPreviewDialog, SIGNAL(finished(HbAction*)), - this, SLOT(previewDialogFinished(HbAction*))); - mPreviewDialog->close(); + if (mPreviewDialog != NULL) { + mPreviewDialog->disconnect(); + mPreviewDialog ->close(); mPreviewDialog = NULL; } - - if (mCorruptedMessage) { - disconnect(mCorruptedMessage, SIGNAL(finished(HbAction*)), - this, SLOT(messageWidgetCorruptedFinished(HbAction*))); + + if (mCorruptedMessage != NULL) { + mCorruptedMessage->disconnect(); mCorruptedMessage->close(); mCorruptedMessage = NULL; } - - mWidget.reset(); - - disconnect(mNotifier, - SIGNAL(entryChanged(CaEntry,ChangeType)), - this, SIGNAL(exit())); - - delete mNotifier; - mNotifier = NULL; + + mToken = NULL; } /*! @@ -168,38 +154,30 @@ */ void HsPreviewHSWidgetState::previewDialogFinished(HbAction* finishedAction) { - if (finishedAction == mPreviewDialog->actions().value(0)) { + mPreviewDialog = NULL; + + if (finishedAction == mAddToHomescreenAction) { - HsScene::instance()->activePage()->addNewWidget( - mWidget.take()); // ownership transferred - HbNotificationDialog *notificationDialog = new HbNotificationDialog(); - notificationDialog->setAttribute(Qt::WA_DeleteOnClose); - notificationDialog->setTitle(hbTrId( - "txt_applib_dpophead_added_to_homescreen") ); - notificationDialog->show(); + QVariantHash widgetData; + widgetData[URI] = mUri; + widgetData[HOMESCREENDATA] = mToken; + + bool success = HsContentService::instance()->createWidget(widgetData); + + if (success) { + HbNotificationDialog *notificationDialog = new HbNotificationDialog(); + notificationDialog->setAttribute(Qt::WA_DeleteOnClose); + notificationDialog->setTitle(hbTrId("txt_applib_dpophead_added_to_homescreen")); + notificationDialog->show(); + emit exit(); + } + else { + showMessageWidgetCorrupted(); + } } else { - mWidget->remove(); - mWidget.take(); - mWidget.reset(); + emit exit(); } - emit exit(); -} - -/*! - Subscribe for memory card remove. - \retval void - */ -void HsPreviewHSWidgetState::subscribeForMemoryCardRemove() -{ - CaNotifierFilter filter; - QList entryIds; - entryIds.append(mEntryId); - filter.setIds(entryIds); - mNotifier = CaService::instance()->createNotifier(filter); - mNotifier->setParent(this); - connect(mNotifier, - SIGNAL(entryChanged(CaEntry,ChangeType)), - SIGNAL(exit())); + mAddToHomescreenAction = 0; } /*! @@ -210,20 +188,13 @@ { HSMENUTEST_FUNC_ENTRY("HsCollectionState::showMessageWidgetCorrupted"); - mCorruptedMessage = new HbMessageBox(HbMessageBox::MessageTypeQuestion); - mCorruptedMessage->setAttribute(Qt::WA_DeleteOnClose); - - QString message(hbTrId("txt_applib_dialog_file_corrupted_unable_to_use_wi")); - mCorruptedMessage->setText(message); + mCorruptedMessage = HsMenuDialogFactory().create( + hbTrId("txt_applib_dialog_file_corrupted_unable_to_use_wi")); - mCorruptedMessage->clearActions(); - HbAction *primaryAction = new HbAction(hbTrId("txt_common_button_ok"), mCorruptedMessage); - mCorruptedMessage->addAction(primaryAction); + mConfirmRemovalAction = mCorruptedMessage->actions().value(0); + mCorruptedMessage + ->open(this, SLOT(messageWidgetCorruptedFinished(HbAction*))); - HbAction *secondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), mCorruptedMessage); - mCorruptedMessage->addAction(secondaryAction); - - mCorruptedMessage->open(this, SLOT(messageWidgetCorruptedFinished(HbAction*))); HSMENUTEST_FUNC_EXIT("HsCollectionState::showMessageWidgetCorrupted"); } @@ -233,10 +204,14 @@ */ void HsPreviewHSWidgetState::messageWidgetCorruptedFinished(HbAction* finishedAction) { - if (finishedAction == mCorruptedMessage->actions().value(0)) { + mCorruptedMessage = NULL; + + if (static_cast(finishedAction) == mConfirmRemovalAction) { HsMenuService::executeAction(mEntryId, removeActionIdentifier()); } emit exit(); + + mConfirmRemovalAction = NULL; } /*! @@ -260,7 +235,7 @@ HbLabel *const iconBox = qobject_cast( loader.findWidget(HS_WIDGET_PREVIEW_ICON_BOX_NAME)); - + loadStatusOk = loadStatusOk && (previewDialog != NULL) && (headingLabel != NULL) && (iconBox != NULL); @@ -269,8 +244,8 @@ "Cannot initialize widgets based on docml file."); if (loadStatusOk) { - previewDialog->actions()[0]->setParent(previewDialog); - previewDialog->actions()[1]->setParent(previewDialog); + previewDialog->actions().value(0)->setParent(previewDialog); + previewDialog->actions().value(1)->setParent(previewDialog); previewDialog->setTimeout(HbPopup::NoTimeout); previewDialog->setAttribute(Qt::WA_DeleteOnClose, true); @@ -283,6 +258,8 @@ if (!previewImageName.isEmpty()) { const HbIcon previewImage(previewImageName); if (previewImage.size().isValid()) { + iconBox->setMinimumHeight(previewImage.height()); + iconBox->setMaximumHeight(previewImage.height()); iconBox->setIcon(previewImage); } } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuninstallitemstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuninstallitemstate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuninstallitemstate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -24,7 +24,7 @@ #include #include - +#include #include #include #include @@ -33,7 +33,8 @@ #include "hsuninstallitemstate.h" #include "hsmenuevent.h" - +#include "hsmenudialogfactory.h" +#include "hsmenuentryremovedhandler.h" /*! \class HsUninstallItemState \ingroup group_hsworkerstateplugin @@ -48,7 +49,6 @@ HsUninstallItemState::HsUninstallItemState(QState *parent) : QState(parent), mItemId(0), - mNotifier(NULL), mUninstallMessage(NULL), mUninstallJavaMessage(NULL), mConfirmAction(NULL) @@ -74,6 +74,7 @@ setObjectName(this->parent()->objectName() + objectName()); } connect(this, SIGNAL(exited()), SLOT(cleanUp())); + } /*! @@ -98,9 +99,7 @@ // other createUninstallMessage(); } - - subscribeForMemoryCardRemove(); - + HSMENUTEST_FUNC_EXIT("HsUninstallItemState::onEntry"); } @@ -111,9 +110,12 @@ */ void HsUninstallItemState::uninstallMessageFinished(HbAction* finishedAction) { - if (finishedAction == mConfirmAction) { + if (static_cast(finishedAction) == mConfirmAction) { HsMenuService::executeAction(mItemId, removeActionIdentifier()); } + mConfirmAction = NULL; + mUninstallMessage = NULL; + mUninstallJavaMessage = NULL; emit exit(); } @@ -163,19 +165,6 @@ return retval; } -/*! - Subscribe for memory card remove. - */ -void HsUninstallItemState::subscribeForMemoryCardRemove() -{ - CaNotifierFilter filter; - filter.setIds(QList() << mItemId); - mNotifier = CaService::instance()->createNotifier(filter); - mNotifier->setParent(this); - connect(mNotifier, - SIGNAL(entryChanged(CaEntry,ChangeType)), - SIGNAL(exit())); -} /*! Slot launched after state has exited and in destructor. @@ -184,21 +173,16 @@ void HsUninstallItemState::cleanUp() { // Close messagebox if App key was pressed - if (mUninstallMessage) { - disconnect(mUninstallMessage, SIGNAL(finished(HbAction*)), - this, SLOT(uninstallMessageFinished(HbAction*))); + if (mUninstallMessage != NULL) { mUninstallMessage->close(); mUninstallMessage = NULL; } - if (mUninstallJavaMessage) { - disconnect(mUninstallJavaMessage, SIGNAL(finished(HbAction*)), this, SLOT(uninstallMessageFinished(HbAction*))); + if (mUninstallJavaMessage != NULL) { mUninstallJavaMessage->close(); mUninstallJavaMessage = NULL; } - delete mNotifier; - mNotifier = NULL; mConfirmAction = NULL; mItemId = 0; } @@ -226,19 +210,40 @@ } // create and show message box - mUninstallMessage = new HbMessageBox(HbMessageBox::MessageTypeQuestion); - mUninstallMessage->setAttribute(Qt::WA_DeleteOnClose); - - mUninstallMessage->setText(message); + mUninstallMessage = HsMenuDialogFactory().create(message); + mConfirmAction = mUninstallMessage->actions().value(0); + + QScopedPointer entryObserver( + new HsMenuEntryRemovedHandler(mItemId, this, SIGNAL(exit()))); + entryObserver.take()->setParent(mUninstallMessage); + + mUninstallMessage->open(this, SLOT(uninstallMessageFinished(HbAction*))); +} - mUninstallMessage->clearActions(); - mConfirmAction = new HbAction(hbTrId("txt_common_button_ok"), - mUninstallMessage); - mUninstallMessage->addAction(mConfirmAction); +/*! + Method create uninstall confirmation message. + Used for java applications without deletion confirmation + and with midlet name equal to app name + \retval void + */ +void HsUninstallItemState::createSimpleUninstallJavaMessage() +{ + QString message; + message.append( + HbParameterLengthLimiter("txt_applib_dialog_1_will_be_removed_from_phone_c").arg( + HsMenuService::getName(mItemId))); - HbAction *secondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), - mUninstallMessage); - mUninstallMessage->addAction(secondaryAction); + // create and show message box + mUninstallMessage = HsMenuDialogFactory().create(message); + + QSharedPointer entry = CaService::instance()->getEntry(mItemId); + HbIcon icon = entry->makeIcon(); + mUninstallMessage->setIcon(icon); + mConfirmAction = mUninstallMessage->actions().value(0); + + QScopedPointer entryObserver( + new HsMenuEntryRemovedHandler(mItemId, this, SIGNAL(exit()))); + entryObserver.take()->setParent(mUninstallMessage); mUninstallMessage->open(this, SLOT(uninstallMessageFinished(HbAction*))); } @@ -251,7 +256,7 @@ { HbDocumentLoader loader; bool loadStatusOk = false; - mObjectList = loader.load(HS_UNINSTALL_DIALOG_LAYOUT, &loadStatusOk); + loader.load(HS_UNINSTALL_DIALOG_LAYOUT, &loadStatusOk); Q_ASSERT_X(loadStatusOk, HS_UNINSTALL_DIALOG_LAYOUT, @@ -263,70 +268,80 @@ getApplicationsNames(componentName, applicationsNames, detailsMessage); QString section; - if (applicationsNames.isEmpty() && detailsMessage.isEmpty()) { - mDialogType = UninstallDialogDefinition01; - section = QString("uninstallDialogDefinition01"); - mObjectList = loader.load( - HS_UNINSTALL_DIALOG_LAYOUT, section, &loadStatusOk); - } else if ( (!applicationsNames.isEmpty()) && (!detailsMessage.isEmpty())) { - mDialogType = UninstallDialogDefinition02; - section = QString("uninstallDialogDefinition02"); - mObjectList = loader.load( + if (applicationsNames.isEmpty() && detailsMessage.isEmpty()) { + createSimpleUninstallJavaMessage(); + } + else { + if ( (!applicationsNames.isEmpty()) && (!detailsMessage.isEmpty())) { + mDialogType = UninstallDialogDefinition02; + section = QString("uninstallDialogDefinition02"); + loader.load( HS_UNINSTALL_DIALOG_LAYOUT, section, &loadStatusOk); - } else if ( (!applicationsNames.isEmpty() && detailsMessage.isEmpty())) { - mDialogType = UninstallDialogDefinition03; - section = QString("uninstallDialogDefinition03"); - mObjectList = loader.load( + } + else if ( (!applicationsNames.isEmpty() && detailsMessage.isEmpty())) { + mDialogType = UninstallDialogDefinition03; + section = QString("uninstallDialogDefinition03"); + loader.load( HS_UNINSTALL_DIALOG_LAYOUT, section, &loadStatusOk); - } else if (applicationsNames.isEmpty() && (!detailsMessage.isEmpty())) { - mDialogType = UninstallDialogDefinition04; - section = QString("uninstallDialogDefinition04"); - mObjectList = loader.load( + } + else if (applicationsNames.isEmpty() && (!detailsMessage.isEmpty())) { + mDialogType = UninstallDialogDefinition04; + section = QString("uninstallDialogDefinition04"); + loader.load( HS_UNINSTALL_DIALOG_LAYOUT, section, &loadStatusOk); - } - - mUninstallJavaMessage = - qobject_cast( + } + + mUninstallJavaMessage = qobject_cast( loader.findWidget(HS_UNINSTALL_DIALOG_NAME)); - - HbLabel* iconLabel = - qobject_cast( - loader.findWidget(HS_UNINSTALL_DIALOG_CONFIRMATION_DIALOG_ICON)); - QSharedPointer entry2 = CaService::instance()->getEntry(mItemId); - HbIcon icon = entry2->makeIcon(); - iconLabel->setIcon(icon); - - HbLabel* textLabel = - qobject_cast( - loader.findWidget(HS_UNINSTALL_DIALOG_CONFIRMATION_DIALOG_LABEL)); - textLabel->setPlainText(textLabel->plainText().arg(componentName)); - - HbLabel* detailsUninstalLabel; - if ((mDialogType == UninstallDialogDefinition02) || - (mDialogType == UninstallDialogDefinition04)) { - detailsUninstalLabel= qobject_cast( - loader.findWidget(HS_UNINSTALL_DIALOG_DELETE_LABEL)); - detailsUninstalLabel->setPlainText(detailsMessage); - } + + if (mUninstallJavaMessage) { + mUninstallJavaMessage->setAttribute(Qt::WA_DeleteOnClose); + mUninstallJavaMessage->setTimeout(HbPopup::NoTimeout); + mUninstallJavaMessage->actions()[0]->setParent(mUninstallJavaMessage); + mUninstallJavaMessage->actions()[1]->setParent(mUninstallJavaMessage); + + HbLabel* iconLabel = + qobject_cast( + loader.findWidget(HS_UNINSTALL_DIALOG_CONFIRMATION_DIALOG_ICON)); + QSharedPointer entry2 = CaService::instance()->getEntry(mItemId); + HbIcon icon = entry2->makeIcon(); + iconLabel->setIcon(icon); + + HbLabel* textLabel = + qobject_cast( + loader.findWidget(HS_UNINSTALL_DIALOG_CONFIRMATION_DIALOG_LABEL)); + textLabel->setPlainText(textLabel->plainText().arg(componentName)); - HbLabel* listView; - QString applicationsList; - QString newLine("\n"); - if ((mDialogType == UninstallDialogDefinition02) || - (mDialogType == UninstallDialogDefinition03)) { - listView = qobject_cast( - loader.findWidget(HS_UNINSTALL_DIALOG_LIST_VIEW_LABEL)); + HbLabel* detailsUninstalLabel; + if ((mDialogType == UninstallDialogDefinition02) || + (mDialogType == UninstallDialogDefinition04)) { + detailsUninstalLabel= qobject_cast( + loader.findWidget(HS_UNINSTALL_DIALOG_DELETE_LABEL)); + detailsUninstalLabel->setPlainText(detailsMessage); + } - for (int i=0; i( + loader.findWidget(HS_UNINSTALL_DIALOG_LIST_VIEW_LABEL)); + + for (int i=0; isetPlainText(applicationsList); + } + + mConfirmAction = qobject_cast(loader.findObject( + HS_UNINSTALL_DIALOG_CONFIRMATION_ACTION)); + + QScopedPointer entryObserver( + new HsMenuEntryRemovedHandler(mItemId, this, SIGNAL(exit()))); + entryObserver.take()->setParent(mUninstallJavaMessage); + + mUninstallJavaMessage->open(this, SLOT(uninstallMessageFinished(HbAction*))); } - listView->setPlainText(applicationsList); } - - mUninstallJavaMessage->setAttribute(Qt::WA_DeleteOnClose); - mUninstallJavaMessage->setTimeout(HbPopup::NoTimeout); - mConfirmAction = qobject_cast(loader.findObject( - HS_UNINSTALL_DIALOG_CONFIRMATION_ACTION)); - - mUninstallJavaMessage->open(this, SLOT(uninstallMessageFinished(HbAction*))); } diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappdetailsstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappdetailsstate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappdetailsstate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -16,6 +16,7 @@ */ #include +#include #include #include #include @@ -30,14 +31,17 @@ #include "hsviewappdetailsstate.h" #include "hsmenuevent.h" #include "hsmenuitemmodel.h" +#include "hsmenuentryremovedhandler.h" +static const char *const HS_VIEWAPPDETAILS_JAVA_DIALOG_SECTION_NAME= + "detailsDialogForJavaApplication"; /*! Constructor. - @param parent Parent state. + /param parent Parent state. */ HsViewAppDetailsState::HsViewAppDetailsState(QState *parent) : - QState(parent), mDialog(0), mNotifier(0) + QState(parent), mDialog(0) { construct(); } @@ -47,9 +51,7 @@ */ HsViewAppDetailsState::~HsViewAppDetailsState() { - if (mDialog) { - delete mDialog; - } + delete mDialog; } /*! @@ -58,7 +60,7 @@ void HsViewAppDetailsState::construct() { HSMENUTEST_FUNC_ENTRY("HsViewAppDetailsState::construct"); - + setObjectName("/ViewAppDetailsState"); if (this->parent()) { setObjectName(this->parent()->objectName() + objectName()); @@ -75,61 +77,102 @@ QState::onEntry(event); HsMenuEvent *menuEvent = static_cast(event); QVariantMap data = menuEvent->data(); - + const int entryId = data.value(itemIdKey()).toInt(); - QSharedPointer entry + QSharedPointer entry = CaService::instance()->getEntry(entryId); const int componentId = entry->attribute( componentIdAttributeName()).toInt(); QSharedPointer scr = CaSoftwareRegistry::create(); CaSoftwareRegistry::DetailMap detailMap = scr->entryDetails(componentId); + + QString appType = entry->attribute(swTypeKey()); + + + //TODO: Should we display something In that case? + if (detailMap.size() < 1){ + stateExited(); + return; + } HbDocumentLoader loader; bool loadStatusOk = false; - mObjectList = loader.load(HS_DETAILS_DIALOG_LAYOUT, &loadStatusOk); + loader.load(HS_DETAILS_DIALOG_LAYOUT, &loadStatusOk); Q_ASSERT_X(loadStatusOk, HS_DETAILS_DIALOG_LAYOUT, "Error while loading docml file."); + if (!appType.compare(javaSwType())) { + QString section = QString(HS_VIEWAPPDETAILS_JAVA_DIALOG_SECTION_NAME); + loader.load(HS_DETAILS_DIALOG_LAYOUT, + section, &loadStatusOk); + } + mDialog = qobject_cast( loader.findWidget(HS_DETAILS_DIALOG_NAME)); - mDialog->actions()[0]->setParent(mDialog); - - subscribeForMemoryCardRemove(entryId); - - HbLabel* nameLabel = qobject_cast( - loader.findWidget(CaSoftwareRegistry::componentNameKey())); - HbLabel* versionLabel = qobject_cast( - loader.findWidget(CaSoftwareRegistry::componentVersionKey())); - HbLabel* supplierLabel = qobject_cast( - loader.findWidget(CaSoftwareRegistry::componentVendorKey())); - HbLabel* memoryLabel = qobject_cast( - loader.findWidget(CaSoftwareRegistry::componentDriveInfoKey())); - HbLabel* sizeLabel = qobject_cast( - loader.findWidget(CaSoftwareRegistry::componentSizeKey())); - HbLabel* typeLabel = qobject_cast( - loader.findWidget(CaSoftwareRegistry::componentTypeKey())); - - nameLabel->setPlainText( - detailMap[CaSoftwareRegistry::componentNameKey()]); - versionLabel->setPlainText( - detailMap[CaSoftwareRegistry::componentVersionKey()]); - supplierLabel->setPlainText( - detailMap[CaSoftwareRegistry::componentVendorKey()]); - memoryLabel->setPlainText( - detailMap[CaSoftwareRegistry::componentDriveInfoKey()]); - sizeLabel->setPlainText( - detailMap[CaSoftwareRegistry::componentSizeKey()]); - typeLabel->setPlainText( - detailMap[CaSoftwareRegistry::componentTypeKey()]); - if (mDialog != NULL) { mDialog->setTimeout(HbPopup::NoTimeout); mDialog->setAttribute(Qt::WA_DeleteOnClose, true); - mDialog->open(this, SLOT(stateExited())); + mDialog->actions()[0]->setParent(mDialog); + + setFieldPresentation(CaSoftwareRegistry::componentNameKey(), + detailMap, loader); + setFieldPresentation(CaSoftwareRegistry::componentVersionKey(), + detailMap, loader); + setFieldPresentation(CaSoftwareRegistry::componentVendorKey(), + detailMap, loader); + setFieldPresentation(CaSoftwareRegistry::componentDriveInfoKey(), + detailMap, loader); + setFieldPresentation(CaSoftwareRegistry::componentSizeKey(), + detailMap, loader); + setFieldPresentation(CaSoftwareRegistry::componentTypeKey(), + detailMap, loader); + + if (!appType.compare(javaSwType())) { + setFieldPresentation(CaSoftwareRegistry::componentDescriptionKey(), + detailMap, loader); + setFieldPresentation(CaSoftwareRegistry::componentProtectionDomainKey(), + detailMap, loader); + } + + QScopedPointer entryObserver( + new HsMenuEntryRemovedHandler(entryId, this, SIGNAL(exit()))); + + entryObserver.take()->setParent(mDialog); + + mDialog->open(this, SLOT(stateExited())); + } else { + stateExited(); } - HSMENUTEST_FUNC_EXIT("HsViewAppDetailsState::onEntry"); + HSMENUTEST_FUNC_EXIT("HsViewAppDetailsState::onEntry"); +} + +/*! + Extracting label from loader and set content of data field. + Hide label if the is no data to display. + \param key detail key. + \param detailMap detail map. + \param loader session to document loader + \retval void + */ +void HsViewAppDetailsState::setFieldPresentation(QString key, + CaSoftwareRegistry::DetailMap &detailMap, + HbDocumentLoader &loader) +{ + HbLabel* dataLabel = qobject_cast( + loader.findWidget(key)); + QString data = detailMap[key]; + if (data.isEmpty()) { + dataLabel->setVisible(false); + dataLabel->setMaximumHeight(0); + HbLabel* titleLabel = qobject_cast( + loader.findWidget(QString("_") + key)); + titleLabel->setVisible(false); + titleLabel->setMaximumHeight(0); + } else { + dataLabel->setPlainText(data); + } } /*! @@ -138,7 +181,6 @@ void HsViewAppDetailsState::stateExited() { HSMENUTEST_FUNC_ENTRY("HsViewAppDetailsState::stateExited"); - mDialog = NULL; emit exit(); HSMENUTEST_FUNC_EXIT("HsViewAppDetailsState::stateExited"); qDebug("HsViewAppDetailsState::stateExited()"); @@ -152,26 +194,9 @@ QState::onExit(event); // Close popups if App key was pressed or // memory card removed - if (mDialog) { + if (mDialog != NULL) { mDialog->close(); + mDialog = NULL; } - mDialog = NULL; } -/*! - Subscribe for memory card remove. - \param entryId: entry id. - \retval void - */ -void HsViewAppDetailsState::subscribeForMemoryCardRemove(int entryId) -{ - CaNotifierFilter filter; - QList entryIds; - entryIds.append(entryId); - filter.setIds(entryIds); - mNotifier = CaService::instance()->createNotifier(filter); - mNotifier->setParent(this); - connect(mNotifier, - SIGNAL(entryChanged(CaEntry,ChangeType)), - SIGNAL(exit())); -} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappsettingsstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappsettingsstate.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappsettingsstate.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -14,7 +14,7 @@ * Description: Menu Application Library state. * */ - +#include #include #include #include @@ -26,6 +26,7 @@ #include "hsapp_defs.h" #include "hsmenuevent.h" #include "hsviewappsettingsstate.h" +#include "hsmenuentryremovedhandler.h" #include "caentry.h" #include "canotifier.h" #include "canotifierfilter.h" @@ -64,9 +65,7 @@ QState(parent), mView(0), mPreviousView(0), - mActionConfirm(0), - mNotifier(0) - + mActionConfirm(0) { construct(); } @@ -87,9 +86,6 @@ */ HsViewAppSettingsState::~HsViewAppSettingsState() { - if (mNotifier) { - delete mNotifier; - } } /*! @@ -109,16 +105,20 @@ QSharedPointer entry = CaService::instance()->getEntry(entryId); QString pluginPath; - pluginPath = pluginPath.append("/resource/qt/plugins/appsettings/").append(entry->attribute(appSettingsPlugin())).append(".qtplugin"); + pluginPath = pluginPath.append("/resource/qt/plugins/appsettings/") + .append(entry->attribute(appSettingsPlugin())).append(".qtplugin"); QPluginLoader loader(pluginPath); mView = qobject_cast(loader.instance()); mActionConfirm = new HbAction(Hb::ConfirmNaviAction, mView); - connect(mActionConfirm, SIGNAL(triggered()),SLOT(settingsDone())); + connect(mActionConfirm, SIGNAL(triggered()), SIGNAL(exit())); - if(mView) - { - subscribeForMemoryCardRemove(entryId); + if (mView) { + QScopedPointer entryObserver( + new HsMenuEntryRemovedHandler(entryId, this, SIGNAL(exit()))); + + entryObserver.take()->setParent(mView); + QObject::connect(this, SIGNAL(initialize(QString)), mView, SLOT(initialize(QString))); mView->setParent(this); emit initialize(entry->attribute(applicationUidEntryKey())); @@ -132,7 +132,7 @@ mPreviousView = hbMainWindow->currentView(); hbMainWindow->setCurrentView(mView); hbMainWindow->show(); - } + } HSMENUTEST_FUNC_EXIT("HsViewAppSettingsState::onEntry"); @@ -155,32 +155,6 @@ #endif //COVERAGE_MEASUREMENT -/*! - Invoked when plugin view exits - */ -void HsViewAppSettingsState::settingsDone() -{ - emit exit(); -} - -/*! - Subscribe for memory card remove. - \param entryId: entry id. - \retval void - */ -void HsViewAppSettingsState::subscribeForMemoryCardRemove(int entryId) -{ - CaNotifierFilter filter; - QList entryIds; - entryIds.append(entryId); - filter.setIds(entryIds); - mNotifier = CaService::instance()->createNotifier(filter); - mNotifier->setParent(this); - connect(mNotifier, - SIGNAL(entryChanged(CaEntry,ChangeType)), - SLOT(settingsDone())); -} - void HsViewAppSettingsState::onExit(QEvent *event) { @@ -189,12 +163,7 @@ HbMainWindow *hbMainWindow = mainWindow(); hbMainWindow->setCurrentView(mPreviousView); hbMainWindow->removeView(mView); - disconnect(mNotifier, - SIGNAL(entryChanged(CaEntry,ChangeType)), - this, - SLOT(settingsDone())); - delete mNotifier; - mNotifier = NULL; + delete mActionConfirm; mActionConfirm = NULL; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/widgetplugins/hsclockwidgetplugin/hsclockwidgetplugin.pro --- a/homescreenapp/widgetplugins/hsclockwidgetplugin/hsclockwidgetplugin.pro Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/hsclockwidgetplugin.pro Wed Aug 18 09:40:07 2010 +0300 @@ -38,7 +38,7 @@ } -win32:include(hsclockwidgetplugin_win.pri) +!symbian:include(hsclockwidgetplugin_win.pri) symbian:include(hsclockwidgetplugin_symbian.pri) RESOURCES = hsclockwidgetplugin.qrc diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/widgetplugins/hsclockwidgetplugin/inc/hsanalogclockwidget.h --- a/homescreenapp/widgetplugins/hsclockwidgetplugin/inc/hsanalogclockwidget.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/inc/hsanalogclockwidget.h Wed Aug 18 09:40:07 2010 +0300 @@ -25,7 +25,7 @@ HOMESCREEN_TEST_CLASS(TestClockWidget) class HbIconItem; -class HbTouchArea; +class QGestureEvent; class HsAnalogClockWidget : public HbWidget { @@ -35,7 +35,6 @@ explicit HsAnalogClockWidget(QGraphicsItem *parent = 0); ~HsAnalogClockWidget(); - bool eventFilter(QObject *watched, QEvent *event); QRectF boundingRect() const; QPainterPath shape() const; @@ -47,19 +46,18 @@ protected: void resizeEvent(QGraphicsSceneResizeEvent *event); + void gestureEvent(QGestureEvent *event); private: Q_DISABLE_COPY(HsAnalogClockWidget) void createPrimitives(); void updatePrimitives(); - void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event); private: HbIconItem *mBackground; HbIconItem *mHourHand; HbIconItem *mMinuteHand; HbIconItem *mSecondHand; - HbTouchArea *mTouchArea; HOMESCREEN_TEST_FRIEND_CLASS(TestClockWidget) }; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/widgetplugins/hsclockwidgetplugin/inc/hsdigitalclockwidget.h --- a/homescreenapp/widgetplugins/hsclockwidgetplugin/inc/hsdigitalclockwidget.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/inc/hsdigitalclockwidget.h Wed Aug 18 09:40:07 2010 +0300 @@ -26,7 +26,7 @@ class HbFrameItem; class HbIconItem; -class HbTouchArea; +class QGestureEvent; class HsDigitalClockWidget : public HbWidget { @@ -36,7 +36,6 @@ explicit HsDigitalClockWidget(bool useAmPm = true, QGraphicsItem *parent = 0); ~HsDigitalClockWidget(); - bool eventFilter(QObject *watched, QEvent *event); QPainterPath shape() const; signals: void clockTapped(); @@ -47,12 +46,12 @@ protected: void resizeEvent(QGraphicsSceneResizeEvent *event); + void gestureEvent(QGestureEvent *event); private: Q_DISABLE_COPY(HsDigitalClockWidget) void createPrimitives(); void updatePrimitives(); - void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event); private: HbFrameItem *mBackground; @@ -63,7 +62,6 @@ HbIconItem *mDigit5; HbIconItem *mDigit6; HbIconItem *mAmPm; - HbTouchArea *mTouchArea; bool mUseAmPm; QMap mDigitMap; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/widgetplugins/hsclockwidgetplugin/resource/hsanalogclockwidget.css --- a/homescreenapp/widgetplugins/hsclockwidgetplugin/resource/hsanalogclockwidget.css Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/resource/hsanalogclockwidget.css Wed Aug 18 09:40:07 2010 +0300 @@ -25,7 +25,3 @@ fixed-height: 25.0un; zvalue: 1; } - -HsAnalogClockWidget::toucharea { - zvalue: 4; -} \ No newline at end of file diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/widgetplugins/hsclockwidgetplugin/resource/hsanalogclockwidget.widgetml --- a/homescreenapp/widgetplugins/hsclockwidgetplugin/resource/hsanalogclockwidget.widgetml Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/resource/hsanalogclockwidget.widgetml Wed Aug 18 09:40:07 2010 +0300 @@ -21,10 +21,6 @@ - - - -
diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/widgetplugins/hsclockwidgetplugin/resource/hsdigitalclockwidget.css --- a/homescreenapp/widgetplugins/hsclockwidgetplugin/resource/hsdigitalclockwidget.css Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/resource/hsdigitalclockwidget.css Wed Aug 18 09:40:07 2010 +0300 @@ -65,6 +65,3 @@ zvalue: 2; } -HsDigitalClockWidget::toucharea { - zvalue: 4; -} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/widgetplugins/hsclockwidgetplugin/resource/hsdigitalclockwidget.widgetml --- a/homescreenapp/widgetplugins/hsclockwidgetplugin/resource/hsdigitalclockwidget.widgetml Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/resource/hsdigitalclockwidget.widgetml Wed Aug 18 09:40:07 2010 +0300 @@ -27,10 +27,6 @@ - - - -
diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/widgetplugins/hsclockwidgetplugin/resource/qtg_graf_hswidget_preview_clock.svg --- a/homescreenapp/widgetplugins/hsclockwidgetplugin/resource/qtg_graf_hswidget_preview_clock.svg Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/resource/qtg_graf_hswidget_preview_clock.svg Wed Aug 18 09:40:07 2010 +0300 @@ -1,49 +1,161 @@ - - - - - - - - - - - + + + + + + - - - - + + + + + + + + + + + + + + + + + - - - - - - - - + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/widgetplugins/hsclockwidgetplugin/src/hsanalogclockwidget.cpp --- a/homescreenapp/widgetplugins/hsclockwidgetplugin/src/hsanalogclockwidget.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/src/hsanalogclockwidget.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include "hsconfiguration.h" @@ -38,12 +38,13 @@ HsAnalogClockWidget::HsAnalogClockWidget(QGraphicsItem *parent) : HbWidget(parent), mBackground(0), mHourHand(0), mMinuteHand(0), - mSecondHand(0), mTouchArea(0) + mSecondHand(0) { HbStyleLoader::registerFilePath(":/hsanalogclockwidget.widgetml"); HbStyleLoader::registerFilePath(":/hsanalogclockwidget.css"); createPrimitives(); + grabGesture(Qt::TapGesture); } /*! @@ -53,28 +54,27 @@ { HbStyleLoader::unregisterFilePath(":/hsanalogclockwidget.widgetml"); HbStyleLoader::unregisterFilePath(":/hsanalogclockwidget.css"); - mTouchArea->removeEventFilter(this); } -/*! - Filters touch area events. -*/ -bool HsAnalogClockWidget::eventFilter(QObject *watched, QEvent *event) +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT +void HsAnalogClockWidget::gestureEvent(QGestureEvent *event) { - Q_UNUSED(watched) + HbTapGesture *gesture = qobject_cast(event->gesture(Qt::TapGesture)); + if (gesture) { + if (gesture->state() == Qt::GestureFinished) { + if (gesture->tapStyleHint() == HbTapGesture::Tap) { + HbInstantFeedback::play(HSCONFIGURATION_GET(clockWidgetTapFeedbackEffect)); + emit clockTapped(); + } + } + } +} +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT - switch (event->type()) { - case QEvent::GraphicsSceneMousePress: - return true; - case QEvent::GraphicsSceneMouseRelease: - handleMouseReleaseEvent(static_cast(event)); - return true; - default: - break; - } - - return false; -} /*! Return bounding rect @@ -130,10 +130,6 @@ mSecondHand = new HbIconItem(QLatin1String("qtg_graf_clock_day_sec"), this); HbStyle::setItemName(mSecondHand, QLatin1String("second_hand")); - - mTouchArea = new HbTouchArea(this); - mTouchArea->installEventFilter(this); - HbStyle::setItemName(mTouchArea, QLatin1String("toucharea")); } /*! @@ -160,17 +156,3 @@ mSecondHand->setTransformOriginPoint(originPoint); mSecondHand->setRotation(s); } - -/*! - \internal -*/ -void HsAnalogClockWidget::handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event) -{ - if (!contains(event->pos())) { - return; - } - - HbInstantFeedback::play(HSCONFIGURATION_GET(clockWidgetTapFeedbackEffect)); - - emit clockTapped(); -} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/widgetplugins/hsclockwidgetplugin/src/hsdigitalclockwidget.cpp --- a/homescreenapp/widgetplugins/hsclockwidgetplugin/src/hsdigitalclockwidget.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/src/hsdigitalclockwidget.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -22,10 +22,11 @@ #include #include #include -#include +#include #include #include "hsdigitalclockwidget.h" +#include "hsconfiguration.h" /*! \class HsDigitalClockWidget @@ -41,7 +42,7 @@ mBackground(0), mDigit1(0), mDigit2(0), mDigit3(0), mDigit4(0), mDigit5(0), mDigit6(0), - mAmPm(0), mTouchArea(0), mUseAmPm(useAmPm) + mAmPm(0), mUseAmPm(useAmPm) { HbStyleLoader::registerFilePath(":/hsdigitalclockwidget.widgetml"); HbStyleLoader::registerFilePath(":/hsdigitalclockwidget.css"); @@ -69,6 +70,7 @@ mDigitMap.insert(QChar('9'), QString(":/clock_widget_nine.svg")); createPrimitives(); + grabGesture(Qt::TapGesture); } /*! @@ -78,28 +80,26 @@ { HbStyleLoader::unregisterFilePath(":/hsdigitalclockwidget.widgetml"); HbStyleLoader::unregisterFilePath(":/hsdigitalclockwidget.css"); - mTouchArea->removeEventFilter(this); } -/*! - Filters touch area events. -*/ -bool HsDigitalClockWidget::eventFilter(QObject *watched, QEvent *event) +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT +void HsDigitalClockWidget::gestureEvent(QGestureEvent *event) { - Q_UNUSED(watched) - - switch (event->type()) { - case QEvent::GraphicsSceneMousePress: - return true; - case QEvent::GraphicsSceneMouseRelease: - handleMouseReleaseEvent(static_cast(event)); - return true; - default: - break; + HbTapGesture *gesture = qobject_cast(event->gesture(Qt::TapGesture)); + if (gesture) { + if (gesture->state() == Qt::GestureFinished) { + if (gesture->tapStyleHint() == HbTapGesture::Tap) { + HbInstantFeedback::play(HSCONFIGURATION_GET(clockWidgetTapFeedbackEffect)); + emit clockTapped(); + } + } } - - return false; } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT /*! Return shape @@ -202,10 +202,6 @@ mAmPm = new HbIconItem(QLatin1String(":/clock_widget_am.svg"), this); HbStyle::setItemName(mAmPm, QLatin1String("ampm")); } - - mTouchArea = new HbTouchArea(this); - mTouchArea->installEventFilter(this); - HbStyle::setItemName(mTouchArea, QLatin1String("toucharea")); } /*! @@ -248,17 +244,3 @@ } } } - -/*! - \internal -*/ -void HsDigitalClockWidget::handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event) -{ - if (!contains(event->pos())) { - return; - } - - HbInstantFeedback::play(HbFeedback::BasicItem); - - emit clockTapped(); -} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/widgetplugins/hsshortcutwidgetplugin/inc/hsshortcutwidget.h --- a/homescreenapp/widgetplugins/hsshortcutwidgetplugin/inc/hsshortcutwidget.h Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/inc/hsshortcutwidget.h Wed Aug 18 09:40:07 2010 +0300 @@ -28,7 +28,7 @@ class HbFrameItem; class HbIconItem; class HbTextItem; -class HbTouchArea; +class QGestureEvent; class CaEntry; class HsShortcutWidget : public HbWidget @@ -51,8 +51,6 @@ QString text() const; void setText(const QString& textItem); - bool eventFilter(QObject *watched, QEvent *event); - signals: void finished(); void setPreferences(const QStringList &names); @@ -62,12 +60,13 @@ void onShow(); void onHide(); +protected: + void gestureEvent(QGestureEvent *event); + private: Q_DISABLE_COPY(HsShortcutWidget) - - void handleMousePressEvent(QGraphicsSceneMouseEvent *event); - void handleMouseMoveEvent(QGraphicsSceneMouseEvent *event); - void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event); + + void launch(); void createPrimitives(); void updateContent(const CaEntry &caEntry); @@ -85,8 +84,7 @@ HbFrameItem *mBackground; HbIconItem *mIcon; HbTextItem *mText; - HbTouchArea *mTouchArea; - + int mCaEntryId; QString mUid; EntryRole mCaEntryRole; diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/widgetplugins/hsshortcutwidgetplugin/resource/hsshortcutwidget.css --- a/homescreenapp/widgetplugins/hsshortcutwidgetplugin/resource/hsshortcutwidget.css Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/resource/hsshortcutwidget.css Wed Aug 18 09:40:07 2010 +0300 @@ -54,7 +54,3 @@ color: var(qtc_hs_list_item_title_normal); zvalue: 2; } - -HsShortcutWidget::toucharea { - zvalue: 3; -} diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/widgetplugins/hsshortcutwidgetplugin/resource/hsshortcutwidget.widgetml --- a/homescreenapp/widgetplugins/hsshortcutwidgetplugin/resource/hsshortcutwidget.widgetml Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/resource/hsshortcutwidget.widgetml Wed Aug 18 09:40:07 2010 +0300 @@ -10,12 +10,7 @@ - - - - - - + @@ -25,12 +20,7 @@ - - - - - - +
diff -r 2b1b11a301d2 -r 4b195f3bea29 homescreenapp/widgetplugins/hsshortcutwidgetplugin/src/hsshortcutwidget.cpp --- a/homescreenapp/widgetplugins/hsshortcutwidgetplugin/src/hsshortcutwidget.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/src/hsshortcutwidget.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -22,8 +22,8 @@ #include #include #include -#include #include +#include #include "hsshortcutwidget.h" #include "hsshortcutservice.h" @@ -47,9 +47,11 @@ */ HsShortcutWidget::HsShortcutWidget(QGraphicsItem *parent, Qt::WindowFlags flags) : HbWidget(parent, flags), - mBackground(0), mIcon(0), mText(0), mTouchArea(0), + mBackground(0), mIcon(0), mText(0), mCaEntryId(-1), mCaEntryRole(ItemEntryRole) { + grabGesture(Qt::TapGesture); + HbStyleLoader::registerFilePath(":/hsshortcutwidget.widgetml"); HbStyleLoader::registerFilePath(":/hsshortcutwidget.css"); @@ -120,33 +122,6 @@ } /*! - Filters touch area events. -*/ -bool HsShortcutWidget::eventFilter(QObject *watched, QEvent *event) -{ - Q_UNUSED(watched) - - switch (event->type()) { - case QEvent::GraphicsSceneMousePress: - handleMousePressEvent(static_cast(event)); - return true; - case QEvent::GraphicsSceneMouseMove: - handleMouseMoveEvent(static_cast(event)); - return true; - case QEvent::GraphicsSceneMouseRelease: - handleMouseReleaseEvent(static_cast(event)); - return true; - case QEvent::UngrabMouse: - setBackgroundToNormal(); - return true; - default: - break; - } - - return false; -} - -/*! Initializes this widget. */ void HsShortcutWidget::onInitialize() @@ -204,37 +179,42 @@ } /*! - \internal + \internal */ -void HsShortcutWidget::handleMousePressEvent(QGraphicsSceneMouseEvent *event) +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT +void HsShortcutWidget::gestureEvent(QGestureEvent *event) { - Q_UNUSED(event) - setBackgroundToPressed(); + HbTapGesture *gesture = qobject_cast(event->gesture(Qt::TapGesture)); + if (gesture) { + switch (gesture->state()) { + case Qt::GestureStarted: + setBackgroundToPressed(); + break; + case Qt::GestureCanceled: + setBackgroundToNormal(); + break; + case Qt::GestureFinished: + setBackgroundToNormal(); + if (gesture->tapStyleHint() == HbTapGesture::Tap) { + launch(); + } + break; + default: + break; + } + } } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT /*! \internal */ -void HsShortcutWidget::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event) +void HsShortcutWidget::launch() { - if (contains(event->pos())) { - setBackgroundToPressed(); - } else { - setBackgroundToNormal(); - } -} - -/*! - \internal -*/ -void HsShortcutWidget::handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event) -{ - setBackgroundToNormal(); - - if (!contains(event->pos())) { - return; - } - HbInstantFeedback::play(HSCONFIGURATION_GET(shortcutWidgetTapFeedbackEffect)); if (mCaEntryRole == ItemEntryRole) { @@ -267,12 +247,6 @@ if (HSCONFIGURATION_GET(isShortcutLabelVisible) && !mText ) { mText = new HbTextItem(this); HbStyle::setItemName(mText, QLatin1String("text")); - } - // Touch Area - if (!mTouchArea) { - mTouchArea = new HbTouchArea(this); - mTouchArea->installEventFilter(this); - HbStyle::setItemName(mTouchArea, QLatin1String("toucharea")); } } @@ -350,6 +324,3 @@ emit finished(); } } - - - diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/bwins/screensavermodelu.def --- a/screensaver/bwins/screensavermodelu.def Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/bwins/screensavermodelu.def Wed Aug 18 09:40:07 2010 +0300 @@ -54,4 +54,5 @@ ?handleDeactivatedIndicator@Screensaver@@QAEXPAVHbIndicatorInterface@@@Z @ 53 NONAME ; void Screensaver::handleDeactivatedIndicator(class HbIndicatorInterface *) ?onHandleActiveIndicators@Screensaver@@MAEXABV?$QList@PAVHbIndicatorInterface@@@@@Z @ 54 NONAME ; void Screensaver::onHandleActiveIndicators(class QList const &) ?handleActiveIndicators@Screensaver@@QAEXABV?$QList@PAVHbIndicatorInterface@@@@@Z @ 55 NONAME ; void Screensaver::handleActiveIndicators(class QList const &) + ?screenPowerModeRequested@Screensaver@@IAEXW4ScreenPowerMode@1@@Z @ 56 NONAME ; void Screensaver::screenPowerModeRequested(enum Screensaver::ScreenPowerMode) diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/common.pri --- a/screensaver/common.pri Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/common.pri Wed Aug 18 09:40:07 2010 +0300 @@ -129,7 +129,7 @@ } } -!exists($${EPOCROOT}epoc32/include/mw/XQSettingsManager) { +!symbian { DEFINES += NO_QT_EXTENSIONS } diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/devicedialogplugins/snsrdevicedialogplugin/inc/snsrdevicedialog.h --- a/screensaver/devicedialogplugins/snsrdevicedialogplugin/inc/snsrdevicedialog.h Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/devicedialogplugins/snsrdevicedialogplugin/inc/snsrdevicedialog.h Wed Aug 18 09:40:07 2010 +0300 @@ -23,18 +23,17 @@ - +#include "screensaver.h" #include "snsrtest_global.h" class Screensaver; class SnsrUserActivityServiceInterface; class QGraphicsLinearLayout; class XQSettingsManager; +class HbIndicatorInterface; SCREENSAVER_TEST_CLASS(T_SnsrDeviceDialogPlugin) -class HbIndicatorInterface; - class SnsrDeviceDialog: public HbPopup, public HbDeviceDialogInterface { @@ -55,6 +54,8 @@ }; static const char *dataKeyUnlock; + static const char *dataKeySwitchLights; + static const char *dataKeySwitchLowPower; public: // methods @@ -77,6 +78,7 @@ void screensaverFaulted(); void changeLayout(Qt::Orientation); void requestUnlock(); + void requestScreenMode(Screensaver::ScreenPowerMode mode); // slots for signals emitted by HbIndicatorPluginManager void indicatorsActivated(const QList &activatedIndicators); void indicatorActivated(HbIndicatorInterface *activatedIndicator); diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/devicedialogplugins/snsrdevicedialogplugin/snsrdevicedialogplugin.pro --- a/screensaver/devicedialogplugins/snsrdevicedialogplugin/snsrdevicedialogplugin.pro Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/devicedialogplugins/snsrdevicedialogplugin/snsrdevicedialogplugin.pro Wed Aug 18 09:40:07 2010 +0300 @@ -29,7 +29,7 @@ TARGET.CAPABILITY = CAP_ECOM_PLUGIN include(snsrdevicedialogplugin_exports_to_rom.pri) - exists($${EPOCROOT}epoc32/include/mw/XQSettingsManager):LIBS += -lxqsettingsmanager + LIBS += -lxqsettingsmanager pluginstub.sources = snsrdevicedialogplugin.dll pluginstub.path = /resource/plugins/devicedialogs diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/devicedialogplugins/snsrdevicedialogplugin/src/snsrdevicedialog.cpp --- a/screensaver/devicedialogplugins/snsrdevicedialogplugin/src/snsrdevicedialog.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/devicedialogplugins/snsrdevicedialogplugin/src/snsrdevicedialog.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,22 +15,20 @@ * */ -#include #include +#include #include #include +#include +#include +#include +#include +#include #include -#include -#include -#include - #include - +#include #include "snsrdevicedialog.h" -#include -#include - const char *gBigClockInterfaceName = "com.nokia.screensaver.ISnsrBigClockScreensaver"; @@ -43,6 +41,8 @@ extern const char *lViewType; const char *SnsrDeviceDialog::dataKeyUnlock = "unlock"; +const char *SnsrDeviceDialog::dataKeySwitchLights = "switch_lights"; +const char *SnsrDeviceDialog::dataKeySwitchLowPower = "switch_low_power"; QTM_USE_NAMESPACE @@ -52,7 +52,10 @@ \param parent Parent. */ SnsrDeviceDialog::SnsrDeviceDialog(const QVariantMap ¶meters, QGraphicsItem *parent) : - HbPopup(parent) , mScreensaver(0), mLayout(0), m_setManager (0) + HbPopup(parent), + mScreensaver(0), + mLayout(0), + m_setManager(0) { qDebug("SnsrDeviceDialog::SnsrDeviceDialog()"); @@ -76,6 +79,10 @@ SLOT(changeView(QGraphicsWidget*))); connect(mScreensaver, SIGNAL(faulted()), SLOT(screensaverFaulted())); + connect( mScreensaver, SIGNAL(unlockRequested()), + SLOT(requestUnlock()) ); + connect( mScreensaver, SIGNAL(screenPowerModeRequested(Screensaver::ScreenPowerMode)), + SLOT(requestScreenMode(Screensaver::ScreenPowerMode)) ); mScreensaver->initialize(); @@ -83,10 +90,10 @@ setDismissPolicy(HbPopup::NoDismiss); setTimeout(HbPopup::NoTimeout); + + mainWindow()->setAutomaticOrientationEffectEnabled(false); setDeviceDialogParameters( parameters ); - - connect( mScreensaver, SIGNAL(unlockRequested()), SLOT(requestUnlock()) ); } /*! @@ -123,18 +130,19 @@ // Check initial view from repository if (viewType == ViewTypeInitial ) { - XQSettingsManager::Error error; + XQSettingsManager::Error error; int startupView = 0; - XQSettingsKey settingsKey( XQSettingsKey::TargetCentralRepository, + XQCentralRepositorySettingsKey settingsKey( KCRUidScreensaverSettings.iUid, KScreensaverStartupView ); // TUid as same repository used in control panel via Symbian APIs m_setManager = new XQSettingsManager(this); - if (m_setManager) { - startupView = m_setManager->readItemValue(settingsKey, XQSettingsManager::TypeInt).toUInt(); + if (m_setManager) { + startupView = m_setManager->readItemValue(settingsKey, XQSettingsManager::TypeInt).toInt(); error = m_setManager->error(); - if (error == XQSettingsManager::NoError) + if (error == XQSettingsManager::NoError) { viewType = startupView; + } delete m_setManager; - } + } } switch (viewType) { @@ -253,11 +261,17 @@ if (mLayout->count()) { mLayout->removeAt(0); - } + } if (widget) { widget->show(); mLayout->addItem(widget); + + if ( isVisible() ) { + changeLayout( mainWindow()->orientation() ); + } } + + } /*! @@ -280,6 +294,10 @@ QRectF rect = mainWindow()->layoutRect(); setMinimumSize( rect.size() ); setPreferredPos( QPointF(0,0) ); + QGraphicsSceneResizeEvent sceneResize; + sceneResize.setNewSize( rect.size() ); + event( &sceneResize ); + mScreensaver->updateLayout(); } /*! @@ -291,6 +309,37 @@ data.insert(dataKeyUnlock, 1); emit deviceDialogData(data); } + +/*! + Send low power mode on/off request to autolock. + */ +void SnsrDeviceDialog::requestScreenMode(Screensaver::ScreenPowerMode mode) +{ + /* TEMPORARY FIX for the "black screen jam" bug. To be re-enabled when proper fix is found. + QVariantMap data; + QVariantList rowLimits; + if ( mode == Screensaver::ScreenModeOff ) { + data.insert(dataKeySwitchLights, 0); + data.insert(dataKeySwitchLowPower, rowLimits); // empty list means "low power off" + } + else if ( mode == Screensaver::ScreenModeLowPower ) { + //data.insert(dataKeySwitchLights, 0); + int firstRow; + int lastRow; + mScreensaver->getActiveScreenRows(&firstRow, &lastRow); + rowLimits.append( firstRow ); + rowLimits.append( lastRow ); + data.insert(dataKeySwitchLowPower, rowLimits); + } + else if ( mode == Screensaver::ScreenModeFullPower ) { + data.insert(dataKeySwitchLights, 30); + data.insert(dataKeySwitchLowPower, rowLimits); // empty list means "low power off" + } + + emit deviceDialogData(data); + */ +} + /*! Called when the dialog is created if they are any currently activate universal indicators present. diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/devicedialogplugins/snsrdevicedialogplugin/src/snsrdevicedialogplugin.cpp --- a/screensaver/devicedialogplugins/snsrdevicedialogplugin/src/snsrdevicedialogplugin.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/devicedialogplugins/snsrdevicedialogplugin/src/snsrdevicedialogplugin.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -122,7 +122,7 @@ Q_UNUSED(deviceDialogType) info->group = SecurityGroup; - info->flags = NoDeviceDialogFlags; + info->flags = ReceiveIndicatorStatus; info->priority = DefaultPriority; return true; diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/eabi/screensavermodelu.def --- a/screensaver/eabi/screensavermodelu.def Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/eabi/screensavermodelu.def Wed Aug 18 09:40:07 2010 +0300 @@ -53,4 +53,5 @@ _ZN11Screensaver26handleDeactivatedIndicatorEP20HbIndicatorInterface @ 52 NONAME _ZN11Screensaver26onHandleActivatedIndicatorEP20HbIndicatorInterface @ 53 NONAME _ZN11Screensaver28onHandleDeactivatedIndicatorEP20HbIndicatorInterface @ 54 NONAME + _ZN11Screensaver24screenPowerModeRequestedENS_15ScreenPowerModeE @ 55 NONAME diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensavermodel/inc/screensaver.h --- a/screensaver/screensavermodel/inc/screensaver.h Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensavermodel/inc/screensaver.h Wed Aug 18 09:40:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -42,10 +42,20 @@ public: + Q_ENUMS(ScreenPowerMode) + + enum ScreenPowerMode { + ScreenModeOff = 0, + ScreenModeLowPower, + ScreenModeFullPower + }; + Screensaver(QObject *parent = 0); virtual ~Screensaver(); ScreensaverState currentState(); + virtual void getActiveScreenRows(int *firstActiveRow, int *lastActiveRow) = 0; + virtual void updateLayout() = 0; public slots: @@ -80,6 +90,7 @@ void faulted(); void viewChanged(QGraphicsWidget *widget); void unlockRequested(); + void screenPowerModeRequested(Screensaver::ScreenPowerMode mode); private: diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensavermodel/src/screensaver.cpp --- a/screensaver/screensavermodel/src/screensaver.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensavermodel/src/screensaver.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -108,6 +108,19 @@ */ /*! + \fn void Screensaver::unlockRequested() + + This signal is emitted if screensaver wants the device to be unlocked. + */ + +/*! + \fn void Screensaver::screenPowerModeRequested(ScreenPowerMode mode) + + This signal is emitted when screensaver wants to switch the power + mode of the screen, or update the visible area in power save mode. + */ + +/*! Returns the state that the Screensaver is currently in. \return The current state. */ @@ -117,6 +130,26 @@ } /*! + \fn virtual void getActiveScreenRows(int *firstActiveRow, int *lastActiveRow) = 0 + + Inherited screensavers must implement this function to return the rows where + the screensaver wants to draw graphics. This is called when screen is set to the + power save mode. The values returned do not matter in case the screensaver doesn't + ask for power save mode. + Note that the returned rows should reflect the rows in the natural orientation + of the screen device. That is, if default orientation of the screen is portrait, + then the return value in landscape mode must reflect the columns between which + the graphics are drawn. + */ + +/*! + \fn virtual void updateLayout() = 0 + + Inherited screensavers must implement this function to reload the screen layout + for the current screen orientation. + */ + +/*! Initializes the Screensaver */ void Screensaver::initialize() diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsranalogclockcontainer.h --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsranalogclockcontainer.h Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsranalogclockcontainer.h Wed Aug 18 09:40:07 2010 +0300 @@ -22,7 +22,7 @@ SCREENSAVER_TEST_CLASS(T_SnsrBigClockScreensaverPlugin) -class HbLabel; +class SnsrLabel; class SnsrAnalogClockWidget; class SnsrSwipeWidget; @@ -38,15 +38,18 @@ public slots: virtual void update(); - virtual void changeLayout(Qt::Orientation orientation); public: // from base classes virtual int updateIntervalInMilliseconds(); +protected: // from base classes + + virtual void loadWidgets(); + private: // data - HbLabel *mDateLabel; + SnsrLabel *mDateLabel; SnsrAnalogClockWidget *mAnalogClockWidget; SnsrSwipeWidget *mSwipeWidget; diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsrbigclockcontainer.h --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsrbigclockcontainer.h Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsrbigclockcontainer.h Wed Aug 18 09:40:07 2010 +0300 @@ -42,22 +42,26 @@ public slots: virtual void update() = 0; - virtual void changeLayout(Qt::Orientation orientation) = 0; + virtual void changeLayout(Qt::Orientation orientation); public: + void setIndicatorModel(SnsrIndicatorModel &model); + virtual void getActiveScreenRows(int *firstActiveRow, int *lastActiveRow); + virtual bool isOrientationLocked(); virtual int updateIntervalInMilliseconds() = 0; - void initIndicators(SnsrIndicatorModel &model); protected: + virtual void loadWidgets() = 0; virtual void changeEvent(QEvent * event); QPointF randomPosition(const QRectF &rect); QPointF nextRandomPosition(const QPointF &curPos, QPointF &destPos, const QRectF &containerRect); - + void initIndicatorWidget(); + void resetIndicatorConnections(); + private: - void resetIndicatorConnections(); void setBackgroundColor(); void paint( QPainter *painter, @@ -68,6 +72,7 @@ signals: void unlockRequested(); + void activeAreaMoved(); protected: diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsrbigclockscreensaver.h --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsrbigclockscreensaver.h Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsrbigclockscreensaver.h Wed Aug 18 09:40:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -28,6 +28,7 @@ class HbMainWindow; class SnsrBigClockContainer; class SnsrIndicatorModel; +class XQSettingsManager; class SnsrBigClockScreensaver : public Screensaver { @@ -60,7 +61,12 @@ virtual void onHandleActiveIndicators(const QList &activeIndicators); virtual void onHandleActivatedIndicator(HbIndicatorInterface *activatedIndicator); virtual void onHandleDeactivatedIndicator(HbIndicatorInterface *deactivatedIndicator); + virtual void getActiveScreenRows(int *firstActiveRow, int *lastActiveRow); + virtual void updateLayout(); +private slots: + + void updateActiveAreaForLowPower(); private: @@ -68,7 +74,8 @@ HbMainWindow *mMainWindow; SnsrBigClockContainer *mCurrentContainer; SnsrIndicatorModel *mIndicatorModel; - + XQSettingsManager *m_setManager; + SCREENSAVER_TEST_FRIEND_CLASS(T_SnsrBigClockScreensaverPlugin) }; diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsrblankcontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsrblankcontainer.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for blank screen. +* +*/ + +#ifndef SNSRBLANKCONTAINER_H +#define SNSRBLANKCONTAINER_H + +#include "snsrbigclockcontainer.h" + +//SCREENSAVER_TEST_CLASS(T_SnsrBigClockScreensaverPlugin) + +class SnsrBlankContainer : public SnsrBigClockContainer +{ + Q_OBJECT + +public: + + SnsrBlankContainer(); + ~SnsrBlankContainer(); + +public slots: + + virtual void update(); + +public: // from base classes + + virtual int updateIntervalInMilliseconds(); + +protected: // from base classes + + virtual void loadWidgets(); + +private: + +// SCREENSAVER_TEST_FRIEND_CLASS(T_SnsrBigClockScreensaverPlugin) +}; + +#endif // SNSRBLANKCONTAINER_H diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsrdigitalclockcontainer.h --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsrdigitalclockcontainer.h Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsrdigitalclockcontainer.h Wed Aug 18 09:40:07 2010 +0300 @@ -22,7 +22,7 @@ SCREENSAVER_TEST_CLASS(T_SnsrBigClockScreensaverPlugin) -class HbLabel; +class SnsrLabel; class SnsrSwipeWidget; class SnsrDigitalClockContainer : public SnsrBigClockContainer @@ -37,17 +37,20 @@ public slots: virtual void update(); - virtual void changeLayout(Qt::Orientation orientation); public: // from base classes virtual int updateIntervalInMilliseconds(); +protected: // from base classes + + virtual void loadWidgets(); + private: // data - HbLabel *mTimeLabel; - HbLabel *mAmPmLabel; - HbLabel *mDateLabel; + SnsrLabel *mTimeLabel; + SnsrLabel *mAmPmLabel; + SnsrLabel *mDateLabel; SnsrSwipeWidget *mSwipeWidget; SCREENSAVER_TEST_FRIEND_CLASS(T_SnsrBigClockScreensaverPlugin) diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsroledanalogclockcontainer.h --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsroledanalogclockcontainer.h Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsroledanalogclockcontainer.h Wed Aug 18 09:40:07 2010 +0300 @@ -23,7 +23,7 @@ SCREENSAVER_TEST_CLASS(T_SnsrBigClockScreensaverPlugin) class SnsrOledClockWidget; -class HbLabel; +class SnsrLabel; class SnsrOledAnalogClockContainer : public SnsrBigClockContainer { @@ -37,19 +37,24 @@ public slots: virtual void update(); - virtual void changeLayout(Qt::Orientation orientation); void updatePosition(); public: // from base classes virtual int updateIntervalInMilliseconds(); + virtual void getActiveScreenRows(int *firstActiveRow, int *lastActiveRow); + virtual bool isOrientationLocked(); + +protected: // from base classes + + virtual void loadWidgets(); private: QGraphicsWidget *mClockContainer; SnsrOledClockWidget *mOledClockWidget; - HbLabel *mDateLabel; + SnsrLabel *mDateLabel; QPointF mDestPosition; bool mInitialize; diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsroleddigitalclockcontainer.h --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsroleddigitalclockcontainer.h Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/inc/snsroleddigitalclockcontainer.h Wed Aug 18 09:40:07 2010 +0300 @@ -20,9 +20,11 @@ #include "snsrbigclockcontainer.h" + SCREENSAVER_TEST_CLASS(T_SnsrBigClockScreensaverPlugin) -class HbLabel; +class SnsrLabel; +class SnsrOledTimeLabel; class SnsrOledDigitalClockContainer : public SnsrBigClockContainer { @@ -36,21 +38,26 @@ public slots: virtual void update(); - virtual void changeLayout(Qt::Orientation orientation); void updatePosition(); public: // from base classes virtual int updateIntervalInMilliseconds(); + virtual void getActiveScreenRows(int *firstActiveRow, int *lastActiveRow); + virtual bool isOrientationLocked(); + +protected: // from base classes + + virtual void loadWidgets(); private: QGraphicsWidget *mClockContainer; - HbLabel *mTimeLabel; - HbLabel *mDateLabel; - HbLabel *mAmPmLabel; - + SnsrLabel *mAmPmLabel; + SnsrOledTimeLabel *mTimeLabel; + SnsrLabel *mDateLabel; + QPointF mDestPosition; bool mInitialize; diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/resource/snsrbigclockscreensaveranalog.docml --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/resource/snsrbigclockscreensaveranalog.docml Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/resource/snsrbigclockscreensaveranalog.docml Wed Aug 18 09:40:07 2010 +0300 @@ -10,16 +10,16 @@ - + - - - + + + diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/resource/snsrbigclockscreensaverdigital.docml --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/resource/snsrbigclockscreensaverdigital.docml Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/resource/snsrbigclockscreensaverdigital.docml Wed Aug 18 09:40:07 2010 +0300 @@ -3,9 +3,9 @@ - + - + @@ -13,7 +13,7 @@ - + @@ -21,13 +21,13 @@ - + - + @@ -35,7 +35,7 @@ - + @@ -45,12 +45,14 @@ - +
- + + + - + diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/resource/snsrbigclockscreensaveroledanalog.docml --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/resource/snsrbigclockscreensaveroledanalog.docml Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/resource/snsrbigclockscreensaveroledanalog.docml Wed Aug 18 09:40:07 2010 +0300 @@ -2,15 +2,17 @@ + + - + - + @@ -18,7 +20,7 @@ - + @@ -33,14 +35,22 @@ - +
+ + + + + + + +
- + diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/resource/snsrbigclockscreensaveroleddigital.docml --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/resource/snsrbigclockscreensaveroleddigital.docml Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/resource/snsrbigclockscreensaveroleddigital.docml Wed Aug 18 09:40:07 2010 +0300 @@ -2,18 +2,21 @@ - + + + + - + - - + + @@ -21,40 +24,47 @@ - + - + - - - - - - - + + + + + - + - + - + -
+
+ + + + + + + + +
diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/inc/snsranalogclockwidget.h --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/inc/snsranalogclockwidget.h Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/inc/snsranalogclockwidget.h Wed Aug 18 09:40:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/inc/snsroledclockwidget.h --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/inc/snsroledclockwidget.h Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/inc/snsroledclockwidget.h Wed Aug 18 09:40:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -53,6 +53,9 @@ HbIconItem *mClockHourHand; HbIconItem *mClockMinuteHand; // TODO: not known yet what label (or any) is shown in clock face (day or am/pm or none) + // If some label will be put onto the clock face, then it's color must come + // from theme and is most propably different than SnsrLabel uses (=text/icon color + // used in screensaver in general //HbIconItem *mClockDateFrame; //SnsrLabel *mClockDateLabel; diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/inc/snsroledtimelabel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/inc/snsroledtimelabel.h Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Time label for oled digital clock. +* +*/ + +#ifndef SNSROLEDTIMELABEL_H +#define SNSROLEDTIMELABEL_H + +#include +#include "snsrtest_global.h" + +SCREENSAVER_TEST_CLASS(T_SnsrClockWidgets) + +class SnsrOledTimeLabel : public HbTextItem +{ + Q_OBJECT + + Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment) + +public: + + SnsrOledTimeLabel(QGraphicsItem *parent = 0); + ~SnsrOledTimeLabel(); + + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + +protected: + + virtual void changeEvent(QEvent *event); + +private: + + void setThemedTextColor(); + +private: + + Q_DISABLE_COPY(SnsrOledTimeLabel) + SCREENSAVER_TEST_FRIEND_CLASS(T_SnsrClockWidgets) +}; + +#endif // SNSROLEDTIMELABEL_H diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/src/snsranalogclockwidget.cpp --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/src/snsranalogclockwidget.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/src/snsranalogclockwidget.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/src/snsroledclockwidget.cpp --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/src/snsroledclockwidget.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/src/snsroledclockwidget.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -131,9 +131,12 @@ Q_ASSERT( mClockHourHand && mClockMinuteHand /*&& mClockDateLabel */); // Calculate angles for clock hands. + // Use granularity of one minute so that minute hand is always exactly + // on some minute and not between minutes. OLED clock is not updated more + // frequently than once per minute and using finer granularity would cause + // the minute hand to be always between even minutes. QTime time = QTime::currentTime(); - qreal s = 6 * time.second(); - qreal m = 6 * (time.minute() + s/360); + qreal m = 6 * time.minute(); qreal h = 30 * ((time.hour() % 12) + m/360); int x = mClockHourHand->preferredSize().width()/2; diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/src/snsroledtimelabel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrclockwidgets/src/snsroledtimelabel.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Time label for oled digital clock. +* +*/ + +#include "snsroledtimelabel.h" + +#include +#include +#include + + +const QString snsrForegroundColorRole("snsrforeground"); + +/*! + \class SnsrOledTimeLabel + \ingroup group_snsrbigclockscreensaverprovider + \brief Screensaver oled digital clock's time label + */ + +/*! + Constructs a new SnsrOledTimeLabel. + \param parent Parent object. + */ + +SnsrOledTimeLabel::SnsrOledTimeLabel(QGraphicsItem *parent) + : HbTextItem(parent) +{ + setThemedTextColor(); + + setMinimumLines( 1 ); + setMaximumLines( 1 ); + setAlignment(Qt::AlignCenter); + + // as we do own painting, must disable the flag that is enabled + // by default due to performance optimatizations. + setFlag(QGraphicsItem::ItemHasNoContents,false); +} + +SnsrOledTimeLabel::~SnsrOledTimeLabel() +{ +} + +/*! + \reimp + We want to draw only the outlines of the time label text and thus + text is drawn here with QPainterPath and pen (no brush) which seems to be the + only way to accomplish this. + Base class's Paint method must not be called! + We use base class only to get the bounding rect inside which to draw the text + (boundingRect has been adjusted to current text, font, alignment etc.) + */ +void SnsrOledTimeLabel::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + Q_UNUSED(option); + Q_UNUSED(widget); + + // TODO: changes needed for mirrored layout and/or other than latin digits?? + + painter->save(); //saves the painter state. + + QPainterPath path; + + QRectF boundingRect = this->boundingRect(); + QString timeText = this->text(); + QFont font = this->font(); + + // As painterPath takes the left end of the text's baseline as + // a parameter we must calculate that point from boundingRect's bottom left + // so that font's descent (and baseline (=1)) are taken into account. + // We want to center the text horizontally too. The logic + // is basically the same as used inside the base class for drawing the text + // within boundingRect. + QPointF leftEndOfBaseline(0,0); // for painterPath + QFontMetrics fontMetrics(font); + int descent = fontMetrics.descent(); + int width = fontMetrics.width(timeText); + leftEndOfBaseline.setY(boundingRect.bottomLeft().y() - descent -1); + leftEndOfBaseline.setX((boundingRect.width() - width) / 2 ); // centerH + + path.addText(leftEndOfBaseline, font, timeText); + + painter->setFont(font); + + QPen newPen = painter->pen(); + newPen.setWidth( 1 ); // TODO: is this width ok? + newPen.setColor(this->textColor()); + painter->setPen(newPen); + + painter->setBrush(QBrush(Qt::NoBrush)); + + // painter->setLayoutDirection ( layoutDirection() ); // TODO: needed or not? + + painter->setRenderHint(QPainter::Antialiasing, true); // TODO: use or not? + + painter->drawPath(path); + + // Must restore the painter or the whole UI will be messed up! + painter->restore(); + +} + +/*! + \reimp + */ +void SnsrOledTimeLabel::changeEvent(QEvent * event) +{ + if (event->type() == HbEvent::ThemeChanged) { + setThemedTextColor(); + } + return HbTextItem::changeEvent(event); +} + + +/*! + Sets the time label's color to follow the theme. + */ +void SnsrOledTimeLabel::setThemedTextColor() +{ + QColor textColor(HbColorScheme::color(snsrForegroundColorRole)); + if (textColor.isValid()) { + setTextColor(textColor); + } else { + // fallback mechanism when color definition is missing in default theme + setTextColor(Qt::white); + } +} + + diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrindicatorwidget/inc/snsrindicatormodel.h --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrindicatorwidget/inc/snsrindicatormodel.h Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrindicatorwidget/inc/snsrindicatormodel.h Wed Aug 18 09:40:07 2010 +0300 @@ -42,6 +42,8 @@ void handleActivatedIndicator(HbIndicatorInterface *activatedIndicator); void handleDeactivatedIndicator(HbIndicatorInterface *deactivatedIndicator); + void handleUpdatedIndicator(); + void initializeIndicatorWidget(); /* @@ -53,15 +55,18 @@ void indicatorsUpdated(const QList &activeIndicators); void allIndicatorsDeactivated(); - + private: - void addIndicator(const SnsrIndicatorInfo &indicatorInfo); - + bool addIndicator(const SnsrIndicatorInfo &indicatorInfo); + bool isIndicatorAlreadyAdded(const SnsrIndicatorInfo &indicatorInfo) const; + bool findAndRemoveIndicator(const SnsrIndicatorInfo &indicatorInfo); - + bool showIndicatorInScreensaver(const HbIndicatorInterface &indicatorInterface, SnsrIndicatorInfo &indicatorInfo); + + void connectToIndicatorsUpdateSignal(const HbIndicatorInterface &indicatorInterface); bool anyActiveIndicators() const; diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrindicatorwidget/resource/snsrindicatorwidget.widgetml --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrindicatorwidget/resource/snsrindicatorwidget.widgetml Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrindicatorwidget/resource/snsrindicatorwidget.widgetml Wed Aug 18 09:40:07 2010 +0300 @@ -1,16 +1,16 @@ - + - + - + - + - + - + \ No newline at end of file diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrindicatorwidget/src/snsrindicatormodel.cpp --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrindicatorwidget/src/snsrindicatormodel.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrindicatorwidget/src/snsrindicatormodel.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -29,10 +29,10 @@ \brief Model for handling indicator data. */ -// TODO: what is the type string of silent indicator? couldn't +// TODO: what is the final type string of silent indicator? couldn't // find it in wk22 -> workaround solution: assume that it contains -// substring "silent" -const char *gSilentIndicatorTypeString = "silent"; +// substring "silence" like in their demo app. +const char *gSilentIndicatorTypeString = "silence"; const char *gOfflineIndicatorTypeString = "offline"; @@ -80,6 +80,7 @@ if (activatedIndicator && showIndicatorInScreensaver(*activatedIndicator,indicatorInfo)) { addIndicator(indicatorInfo); + connectToIndicatorsUpdateSignal(*activatedIndicator); addedAny = true; } } @@ -89,12 +90,6 @@ if (addedAny) { emitChangeSignal(); } - - // TODO: no we need to listen to update signals? - // used for changing icon? - /* //connect indicator's update signal - QObject::connect(activatedIndicator, SIGNAL(dataChanged()), - this, SLOT(indicatorUpdated()));*/ } /*! @@ -107,8 +102,10 @@ SnsrIndicatorInfo indicatorInfo; if (activatedIndicator && showIndicatorInScreensaver(*activatedIndicator,indicatorInfo)) { - addIndicator(indicatorInfo); - emitChangeSignal(); + if (addIndicator(indicatorInfo)) { + connectToIndicatorsUpdateSignal(*activatedIndicator); + emitChangeSignal(); + } } } @@ -132,6 +129,35 @@ } /*! + Called when some universal indicator updates its data by + emitting dataChanged signal. + We listen to this signal because at least the silent indicator plugin demo + uses this method to inform the clients when it gets deactivated/activated + once it has been activated once by setting its icon path to empty/valid string. + Don't know if this is going to be the final solution as it's unconventional (?) + but let's be prepared also to this kind of approach. + */ +void SnsrIndicatorModel::handleUpdatedIndicator() +{ + HbIndicatorInterface* indicator = + qobject_cast(sender()); + if (!indicator) { + return; + } + + // If indicator's icon path was set to empty string, then treat it + // like it were deactivated. And if not empty, then it's active again. + if (indicator->indicatorData( + HbIndicatorInterface::MonoDecorationNameRole).toString().isEmpty()) { + handleDeactivatedIndicator(indicator); + } + else { + handleActivatedIndicator(indicator); + } + +} + +/*! Sends a signal with a list of all currently active indicators. No signal is sent if there are no active indicators currently. */ @@ -175,24 +201,50 @@ Add the indicator into this model. Handle here the order in which indicators are shown in screensaver: notification indicators should be shown in the same order as shown in statusbar, that is in reversed - chronological order. Silent indicator should always be the right-most. + chronological order. Silent indicator should always be the right-most one. + /retval true if indicator was added (not found already in the listings) */ -void SnsrIndicatorModel::addIndicator(const SnsrIndicatorInfo &indicatorInfo) +bool SnsrIndicatorModel::addIndicator(const SnsrIndicatorInfo &indicatorInfo) { - // info from pattern library - todo: remove - //Indicators are displayed inside of each group in reversed chronological order - // according to the arrival time; the indicator that appeared most recently is placed on top of the group. + // To be on the safe side, check that the indicator doesn't already + // exists in the active indicator listings. + bool added(false); + + // Use prepend to keep the list in reversed chronological order + if (indicatorInfo.category == HbIndicatorInterface::NotificationCategory + && !isIndicatorAlreadyAdded(indicatorInfo)) { + mNotificationIndicators.prepend(indicatorInfo); + added = true; + } + else if (indicatorInfo.category == HbIndicatorInterface::SettingCategory + && !isIndicatorAlreadyAdded(indicatorInfo)) { + mSettingIndicators.append(indicatorInfo); + added = true; + } + + return added; +} - //Status bar indicators follow the same order; the most recent notification indicator (4) is on the left - // and similarly the most recent settings indicator (5) is on the right. - - // use prepend to keep the list in reversed chronological order - if (indicatorInfo.category == HbIndicatorInterface::NotificationCategory) { - mNotificationIndicators.prepend(indicatorInfo); +/*! + Check whether the indicator is already added in the active + indicator listing. + /retval true if indicator is already added; false if not. + */ +bool SnsrIndicatorModel::isIndicatorAlreadyAdded(const SnsrIndicatorInfo &indicatorInfo) const +{ + bool alreadyExits(false); + + const QList &indicatorList = + indicatorInfo.category == HbIndicatorInterface::NotificationCategory + ? mNotificationIndicators : mSettingIndicators; + + for (int i = 0; i < indicatorList.size(); ++i) { + if (indicatorList.at(i).type == indicatorInfo.type) { + alreadyExits = true; + break; + } } - else { - mSettingIndicators.append(indicatorInfo); - } + return alreadyExits; } /*! @@ -254,7 +306,7 @@ && !iconPath.isEmpty() // TODO: what is the type string of silent indicator? couldn't // find it in wk22 -> workaround solution: assume that it contains - // substring "silent" + // substring "silence" like in their demo app. // && type == gSilentIndicatorTypeString ) { && typeString.contains(gSilentIndicatorTypeString, Qt::CaseInsensitive)) { show = true; @@ -272,6 +324,27 @@ } /*! + Start listening to indicator's dataChanged signals. + /parameter indicator whose dataChanged signal we want to listen + */ +void SnsrIndicatorModel::connectToIndicatorsUpdateSignal(const HbIndicatorInterface &indicatorInterface) +{ + // Connect to silent indicator's dataChanged signal as it seems to + // use unconventional method (demo at least) to inform when + // it's get deactivated/activated: dataChanged signal is emitted and + // icon path is set to empty string/valid string. + // It's assumed that we don't need to listen to other indicators + // as we are not interested e.g. when primary/secondary texts change etc. + + // NOTE: do NOT disconnect the indicator signal anywhere explicitly here + // or we won't get activation/deactivation messages. + if (indicatorInterface.indicatorType().contains(gSilentIndicatorTypeString, Qt::CaseInsensitive)) { + QObject::connect( &indicatorInterface, SIGNAL(dataChanged()), + this, SLOT(handleUpdatedIndicator())); + } +} + +/*! Check whether there is any active indicator currently. /retval true if there is at least one indicator to show */ diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsranalogclockcontainer.cpp --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsranalogclockcontainer.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsranalogclockcontainer.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -21,12 +21,13 @@ #include #include -#include -#include +#include +#include #include "snsranalogclockwidget.h" #include "snsrindicatorwidget.h" #include "snsrswipewidget.h" +#include "snsrlabel.h" /*! \class SnsrAnalogClockContainer @@ -61,41 +62,8 @@ mDateLabel(0), mAnalogClockWidget(0)/*, mSwipeWidget(0)*/ - { +{ SCREENSAVER_TEST_FUNC_ENTRY("SnsrAnalogClockContainer::SnsrAnalogClockContainer") - - bool ok(true); - - // load analog clock - qDebug() << gAnalogLayoutDocml; - mDocumentObjects = mDocumentLoader.load(gAnalogLayoutDocml, &ok); - Q_ASSERT_X(ok, gAnalogLayoutDocml, "Invalid DocML file."); - if (ok) { - mMainView = mDocumentLoader.findWidget(gMainViewName); - mDateLabel = qobject_cast( - mDocumentLoader.findWidget(gDateLabelName)); - mAnalogClockWidget = qobject_cast( - mDocumentLoader.findWidget(gAnalogClockWidgetName)); - mIndicatorWidget = qobject_cast( - mDocumentLoader.findWidget(gIndicatorWidgetName)); - //We don't implement swipe widget at this poin - /*mSwipeWidget = qobject_cast( - mDocumentLoader.findWidget(gSwipeWidgetName));*/ - - Q_ASSERT_X( - mMainView && mDateLabel && mAnalogClockWidget && - mIndicatorWidget /*&& mSwipeWidget*/, - gAnalogLayoutDocml, "Objects not found in DocML file." - ); - - //connect( mSwipeWidget, SIGNAL(swipeDownDetected()), SIGNAL(unlockRequested()) ); - - mIndicatorWidget->setLayoutType(SnsrIndicatorWidget::IndicatorsCentered); - - mBackgroundContainerLayout->addItem(mMainView); - // mSwipeWidget->start(); - } - SCREENSAVER_TEST_FUNC_EXIT("SnsrAnalogClockContainer::SnsrAnalogClockContainer") } @@ -104,6 +72,7 @@ */ SnsrAnalogClockContainer::~SnsrAnalogClockContainer() { + resetIndicatorConnections(); //mDateLabel, mAnalogClockWidget - deleted by the parent } @@ -131,43 +100,57 @@ SCREENSAVER_TEST_FUNC_EXIT("SnsrAnalogClockContainer::update") } -/*! - Changes screensaver layout basing on orientation changes. - \param orientation Current orientation. - */ -void SnsrAnalogClockContainer::changeLayout(Qt::Orientation orientation) -{ - SCREENSAVER_TEST_FUNC_ENTRY("SnsrAnalogClockContainer::changeLayout") - - bool ok(false); - if (mCurrentOrientation != orientation) { - mCurrentOrientation = orientation; - - // hide controls to avoid screen flickering - mMainView->hide(); - - QString sectionToLoad(""); - if (mCurrentOrientation == Qt::Horizontal) { - sectionToLoad = gLandscapeSectionName; - } - qDebug() << "loading: " << gAnalogLayoutDocml << ", section: " << sectionToLoad; - mDocumentLoader.load(gAnalogLayoutDocml, sectionToLoad, &ok); - // view is rebuilt and ready to show - update(); - mMainView->show(); - Q_ASSERT_X(ok, gAnalogLayoutDocml, "Invalid section in DocML file."); - } - // update anyway - this is needed in situations when screensaver goes to - // foreground but layout change did not occur - if (!ok) { - update(); - } - - SCREENSAVER_TEST_FUNC_EXIT("SnsrAnalogClockContainer::changeLayout") -} - int SnsrAnalogClockContainer::updateIntervalInMilliseconds() { return 1000; } +void SnsrAnalogClockContainer::loadWidgets() +{ + bool ok(true); + + // reset widget pointers, any previous widgets are already deleted by now + mMainView = 0; + mDateLabel = 0; + mAnalogClockWidget = 0; + mIndicatorWidget = 0; + + // load widgets from docml + qDebug() << gAnalogLayoutDocml; + mDocumentObjects = mDocumentLoader.load(gAnalogLayoutDocml, &ok); + Q_ASSERT_X(ok, gAnalogLayoutDocml, "Invalid DocML file."); + if (ok) { + mMainView = mDocumentLoader.findWidget(gMainViewName); + mDateLabel = qobject_cast( + mDocumentLoader.findWidget(gDateLabelName)); + mAnalogClockWidget = qobject_cast( + mDocumentLoader.findWidget(gAnalogClockWidgetName)); + mIndicatorWidget = qobject_cast( + mDocumentLoader.findWidget(gIndicatorWidgetName)); + //We don't implement swipe widget at this poin + /*mSwipeWidget = qobject_cast( + mDocumentLoader.findWidget(gSwipeWidgetName));*/ + + Q_ASSERT_X( + mMainView && mDateLabel && mAnalogClockWidget && + mIndicatorWidget /*&& mSwipeWidget*/, + gAnalogLayoutDocml, "Objects not found in DocML file." + ); + + // In case of landscape layout, read also the landscape delta section + if ( mCurrentOrientation == Qt::Horizontal ) { + qDebug() << "loading: " << gAnalogLayoutDocml << ", section: " << gLandscapeSectionName; + mDocumentLoader.load(gAnalogLayoutDocml, gLandscapeSectionName, &ok); + Q_ASSERT_X(ok, gAnalogLayoutDocml, "Invalid section in DocML file."); + } + + initIndicatorWidget(); + mIndicatorWidget->setLayoutType(SnsrIndicatorWidget::IndicatorsCentered); + + mBackgroundContainerLayout->addItem(mMainView); + + //connect( mSwipeWidget, SIGNAL(swipeDownDetected()), SIGNAL(unlockRequested()) ); + //mSwipeWidget->start(); + } +} + diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsrbigclockcontainer.cpp --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsrbigclockcontainer.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsrbigclockcontainer.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -22,11 +22,9 @@ #include #include -#include -#include -#include - -#include +#include +#include +#include #include "snsrbigclockcontainer.h" #include "snsrindicatorwidget.h" @@ -41,7 +39,6 @@ const QString snsrBackgroundColorRole("snsrbackground"); const int gStep(5); -QTM_USE_NAMESPACE /*! Constructs a new SnsrBigClockContainer. @@ -55,7 +52,7 @@ mCurrentOrientation(-1) { setBackgroundColor(); - mBackgroundContainerLayout = new QGraphicsLinearLayout(Qt::Vertical); + mBackgroundContainerLayout = new QGraphicsLinearLayout(Qt::Vertical, this); setLayout(mBackgroundContainerLayout); qsrand(QTime::currentTime().msec()); } @@ -64,9 +61,7 @@ Destructs the class. */ SnsrBigClockContainer::~SnsrBigClockContainer() -{ - resetIndicatorConnections(); - +{ // e.g. mIndicatorWidget gets deleted during these calls mDocumentLoader.reset(); qDeleteAll(mDocumentObjects); @@ -83,10 +78,74 @@ */ /*! - \fn virtual void changeLayout(Qt::Orientation orientation) = 0; + Changes screensaver layout based on orientation changes. + \param orientation Current orientation. + */ +void SnsrBigClockContainer::changeLayout(Qt::Orientation orientation) +{ + SCREENSAVER_TEST_FUNC_ENTRY("SnsrBigClockContainer::changeLayout") + + if (mCurrentOrientation != orientation) { + mCurrentOrientation = orientation; + + // delete any old widgets + if ( mBackgroundContainerLayout->count() ) { + mBackgroundContainerLayout->removeAt(0); + } + mDocumentLoader.reset(); + qDeleteAll(mDocumentObjects); + mDocumentObjects.clear(); + + // reload widgets from docml + loadWidgets(); + } + mBackgroundContainerLayout->setGeometry( mainWindow()->layoutRect() ); + update(); + + SCREENSAVER_TEST_FUNC_EXIT("SnsrBigClockContainer::changeLayout") +} - Slot for members update in container when orientation changed. +/*! + Set used indicator model that is owned by the screensaver class. + Model's life cycle must be the same as screensaver's so that indicators' + status data can be kept in memory and one can receive updates. + This method should be called when the current container is set. + */ +void SnsrBigClockContainer::setIndicatorModel(SnsrIndicatorModel &model) +{ + mIndicatorModel = &model; +} + +/*! + @copydoc Screensaver::getActiveScreenRows() */ +void SnsrBigClockContainer::getActiveScreenRows(int *firstActiveRow, int *lastActiveRow) +{ + // This default implementation return the whole area of the + // container. Inherited low power mode containers can and should + // return smaller area which just barely encloses all the content. + if ( mMainContainer ) { + QRect mainRect = mMainContainer->rect().toRect(); + if ( mCurrentOrientation == Qt::Vertical ) { + *firstActiveRow = mainRect.top(); + *lastActiveRow = mainRect.bottom(); + } + else { + *firstActiveRow = mainRect.left(); + *lastActiveRow = mainRect.right(); + } + } +} + +/*! + Tell if this container wants to lock the screen orientation. + Default implementation in not locked but inherited classes may + override this. + */ +bool SnsrBigClockContainer::isOrientationLocked() +{ + return false; +} /*! \fn virtual int updateIntervalInMilliseconds() = 0; @@ -96,22 +155,16 @@ */ /*! - Set used indicator model and do necessary initializations to show currently - active indicators. + \fn virtual int loadWidgets() = 0; + + Concrete inherited container classes must implement this to instantiate + all the widgets shown in the container. The base class calls this + method when screen layuot is changed. The old widgets are already + deleted by the base class before this is called. Also changing the visible + container is treated as a layout change, and results in call to this method. + Thus, inherited containers don't have to load their widgets yet in their + constructors. */ -void SnsrBigClockContainer::initIndicators(SnsrIndicatorModel &model) -{ - mIndicatorModel = &model; - if (mIndicatorWidget) { - connect(mIndicatorModel, SIGNAL(indicatorsUpdated(QList)), - mIndicatorWidget, SLOT(showIndicators(QList))); - - connect(mIndicatorModel, SIGNAL(allIndicatorsDeactivated()), - mIndicatorWidget, SLOT(removeAllIndicators())); - - mIndicatorModel->initializeIndicatorWidget(); - } -} /*! \reimp @@ -229,15 +282,35 @@ } /*! + Do necessary initializations to show currently active indicators. + Should be called after the indicator widget is created. + */ +void SnsrBigClockContainer::initIndicatorWidget() +{ + Q_ASSERT(mIndicatorModel && mIndicatorWidget); + + connect(mIndicatorModel, SIGNAL(indicatorsUpdated(QList)), + mIndicatorWidget, SLOT(showIndicators(QList))); + + connect(mIndicatorModel, SIGNAL(allIndicatorsDeactivated()), + mIndicatorWidget, SLOT(removeAllIndicators())); + + mIndicatorModel->initializeIndicatorWidget(); +} + +/*! Disconnect connections between indicator model and widget. + Should be called before deleting the indicator widget. */ void SnsrBigClockContainer::resetIndicatorConnections() -{ - disconnect(mIndicatorModel, SIGNAL(indicatorsUpdated(QList)), - mIndicatorWidget, SLOT(showIndicators(QList))); - - disconnect(mIndicatorModel, SIGNAL(allIndicatorsDeactivated()), - mIndicatorWidget, SLOT(removeAllIndicators())); +{ + if (mIndicatorWidget && mIndicatorModel) { + disconnect(mIndicatorModel, SIGNAL(indicatorsUpdated(QList)), + mIndicatorWidget, SLOT(showIndicators(QList))); + + disconnect(mIndicatorModel, SIGNAL(allIndicatorsDeactivated()), + mIndicatorWidget, SLOT(removeAllIndicators())); + } } /*! diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsrbigclockscreensaver.cpp --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsrbigclockscreensaver.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsrbigclockscreensaver.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -24,14 +24,16 @@ #include #include #include +#include +#include +#include -#include -#include - +#include #include "snsranalogclockcontainer.h" #include "snsrdigitalclockcontainer.h" #include "snsroledanalogclockcontainer.h" #include "snsroleddigitalclockcontainer.h" +#include "snsrblankcontainer.h" #include "snsrindicatormodel.h" /*! @@ -40,15 +42,14 @@ \brief Screensaver with big digital clock. */ -const int gTimeInterval(100); - /*! Constructs a new SnsrBigClockScreensaver. */ SnsrBigClockScreensaver::SnsrBigClockScreensaver() : mMainWindow(0), mCurrentContainer(0), - mIndicatorModel(0) + mIndicatorModel(0), + m_setManager(0) { mMainWindow = HbInstance::instance()->allMainWindows().at(0); // for nice looking clock hand transformations @@ -64,6 +65,7 @@ */ SnsrBigClockScreensaver::~SnsrBigClockScreensaver() { + mMainWindow->unsetOrientation( /*animate*/false ); // mCurrentContainer, mIndicatorModel - deleted by the parent } @@ -86,6 +88,8 @@ removeCurrentContainer(); + emit screenPowerModeRequested( Screensaver::ScreenModeFullPower ); + SnsrBigClockContainer* newContainer( 0 ); if (clockFormat() == ClockFormatAnalog) { newContainer = new SnsrAnalogClockContainer(); @@ -95,7 +99,7 @@ } setCurrentContainer( newContainer ); - + SCREENSAVER_TEST_FUNC_EXIT("SnsrBigClockScreensaver::onForeground") return true; } @@ -111,13 +115,34 @@ removeCurrentContainer(); SnsrBigClockContainer* newContainer( 0 ); - if (clockFormat() == ClockFormatAnalog) { - newContainer = new SnsrOledAnalogClockContainer(); + + // Check ScreensaverStatus from repository + XQSettingsManager::Error error; + int screensaverOn = 1; + XQCentralRepositorySettingsKey settingsKey( + KCRUidScreensaverSettings.iUid, KScreensaverStatus ); // TUid as same repository used in control panel via Symbian APIs + m_setManager = new XQSettingsManager(this); + if (m_setManager) { + screensaverOn = m_setManager->readItemValue(settingsKey, XQSettingsManager::TypeInt).toInt(); + error = m_setManager->error(); + if (error != XQSettingsManager::NoError) { + qDebug("Error reading value from XQSettingsManager.. error = %d", error); + } + delete m_setManager; + } + + if (screensaverOn) { + if (clockFormat() == ClockFormatAnalog) { + newContainer = new SnsrOledAnalogClockContainer(); + } + else { + newContainer = new SnsrOledDigitalClockContainer(); + } } else { - newContainer = new SnsrOledDigitalClockContainer(); + newContainer = new SnsrBlankContainer(); } - + setCurrentContainer( newContainer ); SCREENSAVER_TEST_FUNC_EXIT("SnsrBigClockScreensaver::onPartialForeground") @@ -196,6 +221,46 @@ mIndicatorModel->handleDeactivatedIndicator(deactivatedIndicator); } +/*! + @copydoc Screensaver::getActiveScreenRows + */ +void SnsrBigClockScreensaver::getActiveScreenRows(int *firstActiveRow, int *lastActiveRow) +{ + if ( mCurrentContainer ) { + mCurrentContainer->getActiveScreenRows( firstActiveRow, lastActiveRow ); + } + else { + qWarning() << "No current container when active rows queried."; + } +} + +/*! + @copydoc Screensaver::updateLayout + */ +void SnsrBigClockScreensaver::updateLayout() +{ + if ( mCurrentContainer ) { + if ( mCurrentContainer->isOrientationLocked() ) { + mMainWindow->setOrientation( mMainWindow->orientation(), /*animate*/false ); + } + else { + mMainWindow->unsetOrientation( /*animate*/false ); + } + mCurrentContainer->changeLayout( mMainWindow->orientation() ); + } + else { + qWarning() << "No current container when updateLayout called."; + } +} + +/*! + Update the area visible in the power save screen mode. Power save mode gets + also activated on call if not already active. + */ +void SnsrBigClockScreensaver::updateActiveAreaForLowPower() +{ + emit screenPowerModeRequested( Screensaver::ScreenModeLowPower ); +} /*! Determines the curent clock format settings. @@ -223,38 +288,41 @@ { if ( mCurrentContainer ) { disconnect( - mMainWindow, SIGNAL(orientationChanged(Qt::Orientation)), - mCurrentContainer, SLOT(changeLayout(Qt::Orientation)) - ); - disconnect( &mTimer, SIGNAL(timeout()), mCurrentContainer, SLOT(update()) ); disconnect( mCurrentContainer, SIGNAL(unlockRequested()), this, SIGNAL(unlockRequested()) ); - mTimer.stop(); + if (mTimer.timerId()!= -1) { + mTimer.stop(); + } emit viewChanged(0); delete mCurrentContainer; mCurrentContainer = 0; } + + mMainWindow->unsetOrientation( /*animate*/false ); } void SnsrBigClockScreensaver::setCurrentContainer( SnsrBigClockContainer* newContainer ) { mCurrentContainer = newContainer; - connect( - mMainWindow, SIGNAL(orientationChanged(Qt::Orientation)), - mCurrentContainer, SLOT(changeLayout(Qt::Orientation)) - ); + mCurrentContainer->setParent(this); connect( &mTimer, SIGNAL(timeout()), mCurrentContainer, SLOT(update()) ); connect( mCurrentContainer, SIGNAL(unlockRequested()), SIGNAL(unlockRequested()) ); + connect( mCurrentContainer, SIGNAL(activeAreaMoved()), SLOT(updateActiveAreaForLowPower()) ); - mCurrentContainer->initIndicators(*mIndicatorModel); + mCurrentContainer->setIndicatorModel(*mIndicatorModel); + + int updateInterval = mCurrentContainer->updateIntervalInMilliseconds(); + // blankcontainer is empty one, don't start timer with -1 return value + if ( updateInterval != -1) { + mTimer.start(updateInterval); + } - mCurrentContainer->changeLayout(mMainWindow->orientation()); - mTimer.start( mCurrentContainer->updateIntervalInMilliseconds() ); + emit viewChanged(mCurrentContainer); } diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsrblankcontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsrblankcontainer.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for blank screen. +* +*/ + +#include "snsrblankcontainer.h" + +/*! + \class SnsrBlankContainer + \ingroup group_snsrbigclockscreensaverplugin + \brief Container used for preparing layout for blank screen. + */ + +/*! + Constructs a new SnsrBlankContainer. + */ +SnsrBlankContainer::SnsrBlankContainer() : + SnsrBigClockContainer() +{ +} + +/*! + Destructs the class. + */ +SnsrBlankContainer::~SnsrBlankContainer() +{ +} + +void SnsrBlankContainer::update() +{ + // nothing to do +} + +int SnsrBlankContainer::updateIntervalInMilliseconds() +{ + // don't start timer + return -1; +} + +void SnsrBlankContainer::loadWidgets() +{ + // nothing to do as we have no visual components +} + +// end of file diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsrdigitalclockcontainer.cpp --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsrdigitalclockcontainer.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsrdigitalclockcontainer.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -21,11 +21,12 @@ #include #include -#include -#include +#include +#include #include "snsrswipewidget.h" #include "snsrindicatorwidget.h" +#include "snsrlabel.h" /*! \class SnsrDigitalClockContainer @@ -66,41 +67,6 @@ mSwipeWidget(0)*/ { SCREENSAVER_TEST_FUNC_ENTRY("SnsrDigitalClockContainer::SnsrDigitalClockContainer") - - bool ok(false); - // load digital clock - qDebug() << gDigitalLayoutDocml; - mDocumentObjects = mDocumentLoader.load(gDigitalLayoutDocml, &ok); - Q_ASSERT_X(ok, gDigitalLayoutDocml, "Invalid DocML file."); - - if (ok) { - mMainView = mDocumentLoader.findWidget(gMainViewName); - mDateLabel = qobject_cast( - mDocumentLoader.findWidget(gDateLabelName)); - mTimeLabel = qobject_cast( - mDocumentLoader.findWidget(gTimeLabelName)); - mAmPmLabel = qobject_cast( - mDocumentLoader.findWidget(gAmPmLabelName)); - mIndicatorWidget = qobject_cast( - mDocumentLoader.findWidget(gIndicatorWidgetName)); - // implement swipewidget later on - /*mSwipeWidget = qobject_cast( - mDocumentLoader.findWidget(gSwipeWidgetName));*/ - - Q_ASSERT_X( - mMainView && mDateLabel && mTimeLabel && mAmPmLabel && - mIndicatorWidget /*&& mSwipeWidget*/, - gDigitalLayoutDocml, "Objects not found in DocML file." - ); - - //connect( mSwipeWidget, SIGNAL(swipeDownDetected()), SIGNAL(unlockRequested()) ); - - mIndicatorWidget->setLayoutType(SnsrIndicatorWidget::IndicatorsCentered); - - mBackgroundContainerLayout->addItem(mMainView); - // mSwipeWidget->start(); - } - SCREENSAVER_TEST_FUNC_EXIT("SnsrDigitalClockContainer::SnsrDigitalClockContainer") } @@ -109,6 +75,7 @@ */ SnsrDigitalClockContainer::~SnsrDigitalClockContainer() { + resetIndicatorConnections(); //mTimeLabel, mAmPmLabel, mDateLabel - deleted by the parent } @@ -130,7 +97,8 @@ mTimeLabel->setPlainText( HbExtendedLocale().format(QTime::currentTime(), gTimeFormatStr) ); - // if clock type is 24, this will return an empty string. + + // if clock type is 24h, this will return an empty string. mAmPmLabel->setPlainText( HbExtendedLocale().format(QTime::currentTime(), gAmPmFormatStr) ); @@ -151,44 +119,60 @@ SCREENSAVER_TEST_FUNC_EXIT("SnsrDigitalClockContainer::update") } -/*! - Changes screensaver layout basing on orientation changes. - \param orientation Current orientation. - */ -void SnsrDigitalClockContainer::changeLayout(Qt::Orientation orientation) -{ - SCREENSAVER_TEST_FUNC_ENTRY("SnsrDigitalClockContainer::changeLayout") - - bool ok(false); - if (mCurrentOrientation != orientation) { - mCurrentOrientation = orientation; - - // hide controls to avoid screen flickering - mMainView->hide(); - - QString sectionToLoad(""); - if (mCurrentOrientation == Qt::Horizontal) { - sectionToLoad = gLandscapeSectionName; - } - qDebug() << "loading: " << gDigitalLayoutDocml << ", section: " - << sectionToLoad; - mDocumentLoader.load(gDigitalLayoutDocml, sectionToLoad, &ok); - // view is rebuilt and ready to show - update(); - mMainView->show(); - Q_ASSERT_X(ok, gDigitalLayoutDocml, "Invalid section in DocML file."); - } - // update anyway - this is needed in situations when screensaver goes to - // foreground but layout change did not occur - if (!ok) { - update(); - } - - SCREENSAVER_TEST_FUNC_EXIT("SnsrDigitalClockContainer::changeLayout") -} - int SnsrDigitalClockContainer::updateIntervalInMilliseconds() { return 1000; } +void SnsrDigitalClockContainer::loadWidgets() +{ + // reset widget pointers, any previous widgets are already deleted by now + mMainView = 0; + mDateLabel = 0; + mTimeLabel = 0; + mAmPmLabel = 0; + mIndicatorWidget = 0; + + // load widgets from docml + bool ok(false); + qDebug() << gDigitalLayoutDocml; + mDocumentObjects = mDocumentLoader.load(gDigitalLayoutDocml, &ok); + Q_ASSERT_X(ok, gDigitalLayoutDocml, "Invalid DocML file."); + + if (ok) { + mMainView = mDocumentLoader.findWidget(gMainViewName); + mDateLabel = qobject_cast( + mDocumentLoader.findWidget(gDateLabelName)); + mTimeLabel = qobject_cast( + mDocumentLoader.findWidget(gTimeLabelName)); + mAmPmLabel = qobject_cast( + mDocumentLoader.findWidget(gAmPmLabelName)); + mIndicatorWidget = qobject_cast( + mDocumentLoader.findWidget(gIndicatorWidgetName)); + // implement swipewidget later on + /*mSwipeWidget = qobject_cast( + mDocumentLoader.findWidget(gSwipeWidgetName));*/ + + Q_ASSERT_X( + mMainView && mDateLabel && mTimeLabel && mAmPmLabel && + mIndicatorWidget /*&& mSwipeWidget*/, + gDigitalLayoutDocml, "Objects not found in DocML file." + ); + + // In case of landscape layout, read also the landscape delta section + if ( mCurrentOrientation == Qt::Horizontal ) { + qDebug() << "loading: " << gDigitalLayoutDocml << ", section: " << gLandscapeSectionName; + mDocumentLoader.load(gDigitalLayoutDocml, gLandscapeSectionName, &ok); + Q_ASSERT_X(ok, gDigitalLayoutDocml, "Invalid section in DocML file."); + } + + mIndicatorWidget->setLayoutType(SnsrIndicatorWidget::IndicatorsCentered); + initIndicatorWidget(); + + mBackgroundContainerLayout->addItem(mMainView); + + //connect( mSwipeWidget, SIGNAL(swipeDownDetected()), SIGNAL(unlockRequested()) ); + //mSwipeWidget->start(); + } +} + diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsrdocumentloader.cpp --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsrdocumentloader.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsrdocumentloader.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -21,6 +21,7 @@ #include "snsroledclockwidget.h" #include "snsrlabel.h" #include "snsrindicatorwidget.h" +#include "snsroledtimelabel.h" #include "snsrswipewidget.h" /*! @@ -28,11 +29,11 @@ \ingroup group_snsrbigclockscreensaverplugin \brief Custom screensaver docml layout loader. - Used mainly to create the analog clock widget from docml. + Used to create the widgets from docml. */ /*! - Creates the analog clock. + Creates the requested widget. \param type Static type name. \param name Object name. \retval Created object. @@ -63,6 +64,12 @@ return object; } + if (type == SnsrOledTimeLabel::staticMetaObject.className()) { + QObject *object = new SnsrOledTimeLabel(); + object->setObjectName(name); + return object; + } + /* Add swipeWidget implementation later on if (type == SnsrSwipeWidget::staticMetaObject.className()) { diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsroledanalogclockcontainer.cpp --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsroledanalogclockcontainer.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsroledanalogclockcontainer.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -21,11 +21,12 @@ #include #include #include -#include -#include +#include +#include #include "snsroledclockwidget.h" #include "snsrindicatorwidget.h" +#include "snsrlabel.h" /*! \class SnsrOledAnalogClockContainer @@ -57,34 +58,6 @@ mDateLabel(0), mDestPosition(QPointF()), mInitialize(false) { SCREENSAVER_TEST_FUNC_ENTRY("SnsrOledAnalogClockContainer::SnsrOledAnalogClockContainer") - - bool ok(false); - qDebug() << gOledAnalogLayoutDocml; - - // load oled analog clock - mDocumentObjects = mDocumentLoader.load(gOledAnalogLayoutDocml, &ok); - Q_ASSERT_X(ok, gOledAnalogLayoutDocml, "Invalid DocML file."); - if (ok) { - mMainView = mDocumentLoader.findWidget(gMainViewName); - mMainContainer = mDocumentLoader.findWidget(gMainContainerName); - mClockContainer = mDocumentLoader.findWidget(gClockContainerName); - mOledClockWidget = qobject_cast( - mDocumentLoader.findWidget(gOledAnalogClockWidgetName)); - mDateLabel = qobject_cast( - mDocumentLoader.findWidget(gDateLabelName)); - mIndicatorWidget = qobject_cast( - mDocumentLoader.findWidget(gIndicatorWidgetName)); - Q_ASSERT_X( - mMainView && mMainContainer && mClockContainer - && mOledClockWidget && mDateLabel && mIndicatorWidget, - gOledAnalogLayoutDocml, "Objects not found in DocML file." - ); - - mIndicatorWidget->setLayoutType(SnsrIndicatorWidget::IndicatorsCentered); - - mBackgroundContainerLayout->addItem(mMainView); - } - SCREENSAVER_TEST_FUNC_EXIT("SnsrOledAnalogClockContainer::SnsrOledAnalogClockContainer") } @@ -93,6 +66,7 @@ */ SnsrOledAnalogClockContainer::~SnsrOledAnalogClockContainer() { + resetIndicatorConnections(); //mOledClockWidget etc - deleted by the parent } @@ -106,9 +80,14 @@ // Container must have a valid size to enable calculating the // destination position for the clock. if ( containerSize.width() > 0 && containerSize.height() > 0 ) { - containerSize -= mClockContainer->boundingRect().size(); + containerSize -= mClockContainer->size(); QRectF containerRect( mMainContainer->pos(), containerSize ); if ( mInitialize ) { + // disconnect container from parent layout, + // connected container resets its position to the one defined in docml + // after label text updates + mClockContainer->setParentLayoutItem(0); + QPointF clockPos = nextRandomPosition( mClockContainer->pos(), mDestPosition, containerRect ); mClockContainer->setPos( clockPos ); } @@ -116,6 +95,8 @@ mDestPosition = randomPosition( containerRect ); mInitialize = true; } + // the active area of power save mode needs to be updated when clock container is moved + emit activeAreaMoved(); } } @@ -143,57 +124,86 @@ // position updatePosition(); - // TODO: Currently, both time and position are updated 10 times per second. - // These should happen only once per minute in the power save mode. - SCREENSAVER_TEST_FUNC_EXIT("SnsrOledAnalogClockContainer::update") } -/*! - Changes screensaver layout basing on orientation changes. - \param orientation Current orientation. - */ -void SnsrOledAnalogClockContainer::changeLayout(Qt::Orientation orientation) -{ - SCREENSAVER_TEST_FUNC_ENTRY("SnsrOledAnalogClockContainer::changeLayout") - - bool ok(false); - if (mCurrentOrientation != orientation) { - mCurrentOrientation = orientation; - // hide controls to avoid screen flickering - mMainView->hide(); - - QString sectionToLoad(""); - if (mCurrentOrientation == Qt::Horizontal) { - sectionToLoad = gLandscapeSectionName; - } - qDebug() << "loading: " << gOledAnalogLayoutDocml << ", section: " << sectionToLoad; - mDocumentLoader.load(gOledAnalogLayoutDocml, sectionToLoad, &ok); - Q_ASSERT_X(ok, gOledAnalogLayoutDocml, "Invalid section in DocML file."); - - // disconnect container from parent layout, - // connected container resets its position to the one defined in docml - // after label text updates - mClockContainer->setParentLayoutItem(0); - - update(); - - // view is rebuilt and ready to show - mMainView->show(); - } - - // update anyway - this is needed in situations when screensaver goes to - // foreground but layout change did not occur - if (!ok) { - update(); - } - - SCREENSAVER_TEST_FUNC_EXIT("SnsrOledAnalogClockContainer::changeLayout") -} - int SnsrOledAnalogClockContainer::updateIntervalInMilliseconds() { return 60*1000; } +/*! + @copydoc SnsrBigClockContainer::getActiveScreenRows() + */ +void SnsrOledAnalogClockContainer::getActiveScreenRows(int *firstActiveRow, int *lastActiveRow) +{ + if ( mClockContainer ) { + QRect clockRect( mClockContainer->pos().toPoint(), + mClockContainer->size().toSize() ); + if ( mCurrentOrientation == Qt::Vertical ) { + *firstActiveRow = clockRect.top(); + *lastActiveRow = clockRect.bottom() + 1; + } + else { + *firstActiveRow = clockRect.left(); + *lastActiveRow = clockRect.right() + 1; + } + } +} + +/*! + Orientation is locked in power save mode as sensors are off anyway, + at least after some timeout. + */ +bool SnsrOledAnalogClockContainer::isOrientationLocked() +{ + return true; +} + +void SnsrOledAnalogClockContainer::loadWidgets() +{ + bool ok(true); + + // reset widget pointers, any previous widgets are already deleted by now + mMainView = 0; + mMainContainer = 0; + mClockContainer = 0; + mOledClockWidget = 0; + mDateLabel = 0; + mIndicatorWidget = 0; + + // load widgets from docml + qDebug() << gOledAnalogLayoutDocml; + mDocumentObjects = mDocumentLoader.load(gOledAnalogLayoutDocml, &ok); + Q_ASSERT_X(ok, gOledAnalogLayoutDocml, "Invalid DocML file."); + if (ok) { + mMainView = mDocumentLoader.findWidget(gMainViewName); + mMainContainer = mDocumentLoader.findWidget(gMainContainerName); + mClockContainer = mDocumentLoader.findWidget(gClockContainerName); + mOledClockWidget = qobject_cast( + mDocumentLoader.findWidget(gOledAnalogClockWidgetName)); + mDateLabel = qobject_cast( + mDocumentLoader.findWidget(gDateLabelName)); + mIndicatorWidget = qobject_cast( + mDocumentLoader.findWidget(gIndicatorWidgetName)); + Q_ASSERT_X( + mMainView && mMainContainer && mClockContainer + && mOledClockWidget && mDateLabel && mIndicatorWidget, + gOledAnalogLayoutDocml, "Objects not found in DocML file." + ); + + // In case of landscape layout, read also the landscape delta section + if ( mCurrentOrientation == Qt::Horizontal ) { + qDebug() << "loading: " << gOledAnalogLayoutDocml << ", section: " << gLandscapeSectionName; + mDocumentLoader.load(gOledAnalogLayoutDocml, gLandscapeSectionName, &ok); + Q_ASSERT_X(ok, gOledAnalogLayoutDocml, "Invalid section in DocML file."); + } + + mIndicatorWidget->setLayoutType(SnsrIndicatorWidget::IndicatorsCentered); + initIndicatorWidget(); + + mBackgroundContainerLayout->addItem(mMainView); + } +} + // end of file diff -r 2b1b11a301d2 -r 4b195f3bea29 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsroleddigitalclockcontainer.cpp --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsroleddigitalclockcontainer.cpp Tue Jul 06 14:06:53 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsroleddigitalclockcontainer.cpp Wed Aug 18 09:40:07 2010 +0300 @@ -22,10 +22,14 @@ #include #include -#include -#include + +#include +#include +#include "snsrlabel.h" #include "snsrindicatorwidget.h" +#include "snsroledtimelabel.h" + /*! \class SnsrOledDigitalClockContainer @@ -41,7 +45,7 @@ extern const char *gMainContainerName; extern const char *gClockContainerName; -extern const char *gTimeLabelName; +extern const char *gOledTimeLabelName = "oledTimeLabel"; extern const char *gAmPmLabelName; extern const char *gDateLabelName; @@ -54,46 +58,16 @@ extern const char *gIndicatorWidgetName; + /*! Constructs a new SnsrOledDigitalClockContainer. */ SnsrOledDigitalClockContainer::SnsrOledDigitalClockContainer() : - SnsrBigClockContainer(), mClockContainer(0), mTimeLabel(0), - mDateLabel(0), mAmPmLabel(0), mDestPosition(QPointF()), mInitialize(false) + SnsrBigClockContainer(), mClockContainer(0), mAmPmLabel(0), + mTimeLabel(0), mDateLabel(0), mDestPosition(QPointF()), + mInitialize(false) { SCREENSAVER_TEST_FUNC_ENTRY("SnsrOledDigitalClockContainer::SnsrOledDigitalClockContainer") - - bool ok(false); - qDebug() << gOledDigitalLayoutDocml; - - // load digital clock - mDocumentObjects = mDocumentLoader.load(gOledDigitalLayoutDocml, &ok); - Q_ASSERT_X(ok, gOledDigitalLayoutDocml, "Invalid DocML file."); - - if (ok) { - mMainView = mDocumentLoader.findWidget(gMainViewName); - mMainContainer = mDocumentLoader.findWidget(gMainContainerName); - mClockContainer = mDocumentLoader.findWidget(gClockContainerName); - mDateLabel = qobject_cast( - mDocumentLoader.findWidget(gDateLabelName)); - mTimeLabel = qobject_cast( - mDocumentLoader.findWidget(gTimeLabelName)); - mAmPmLabel = qobject_cast( - mDocumentLoader.findWidget(gAmPmLabelName)); - mIndicatorWidget = qobject_cast( - mDocumentLoader.findWidget(gIndicatorWidgetName)); - Q_ASSERT_X( - mMainView && mMainContainer && mClockContainer - && mDateLabel && mTimeLabel && mAmPmLabel - && mIndicatorWidget, - gOledDigitalLayoutDocml, "Objects not found in DocML file." - ); - - mIndicatorWidget->setLayoutType(SnsrIndicatorWidget::IndicatorsCentered); - - mBackgroundContainerLayout->addItem(mMainView); - } - SCREENSAVER_TEST_FUNC_EXIT("SnsrOledDigitalClockContainer::SnsrOledDigitalClockContainer") } @@ -102,6 +76,7 @@ */ SnsrOledDigitalClockContainer::~SnsrOledDigitalClockContainer() { + resetIndicatorConnections(); //mTimeLabel, mAmPmLabel, mDateLabel, mMoveTimer - deleted by the parent } @@ -118,6 +93,11 @@ containerSize -= mClockContainer->boundingRect().size(); QRectF containerRect( mMainContainer->pos(), containerSize ); if ( mInitialize ) { + // disconnect container from parent layout, + // connected container resets its position to the one defined in docml + // after label text updates + mClockContainer->setParentLayoutItem(0); + QPointF clockPos = nextRandomPosition( mClockContainer->pos(), mDestPosition, containerRect ); mClockContainer->setPos( clockPos ); } @@ -125,6 +105,8 @@ mDestPosition = randomPosition( containerRect ); mInitialize = true; } + // the active area of power save mode needs to be updated when clock container is moved + emit activeAreaMoved(); } } @@ -136,9 +118,11 @@ SCREENSAVER_TEST_FUNC_ENTRY("SnsrOledDigitalClockContainer::update") // time - mTimeLabel->setPlainText( + mTimeLabel->setText( HbExtendedLocale().format(QTime::currentTime(), gTimeFormatStr) ); + + // if clock type is 24h, this will return an empty string. mAmPmLabel->setPlainText( HbExtendedLocale().format(QTime::currentTime(), gAmPmFormatStr) ); @@ -161,48 +145,87 @@ SCREENSAVER_TEST_FUNC_EXIT("SnsrOledDigitalClockContainer::update") } -/*! - Changes screensaver layout basing on orientation changes. - \param orientation Current orientation. - */ -void SnsrOledDigitalClockContainer::changeLayout(Qt::Orientation orientation) -{ - SCREENSAVER_TEST_FUNC_ENTRY("SnsrOledDigitalClockContainer::changeLayout") - - if (mCurrentOrientation != orientation) { - mCurrentOrientation = orientation; - - // hide controls to avoid screen flickering - mMainView->hide(); - - QString sectionToLoad(""); - if (mCurrentOrientation == Qt::Horizontal) { - sectionToLoad = gLandscapeSectionName; - } - qDebug() << "loading: " << gOledDigitalLayoutDocml << ", section: " - << sectionToLoad; - bool ok(false); - mDocumentLoader.load(gOledDigitalLayoutDocml, sectionToLoad, &ok); - Q_ASSERT_X(ok, gOledDigitalLayoutDocml, "Invalid section in DocML file."); - - // disconnect container from parent layout, - // connected container resets its position to the one defined in docml - // after label text updates - mClockContainer->setParentLayoutItem(0); - - // update labels before showing the view - update(); - - // view is rebuilt and ready to show - mMainView->show(); - } - - SCREENSAVER_TEST_FUNC_EXIT("SnsrOledDigitalClockContainer::changeLayout") -} - int SnsrOledDigitalClockContainer::updateIntervalInMilliseconds() { return 60*1000; } +/*! + @copydoc SnsrBigClockContainer::getActiveScreenRows() + */ +void SnsrOledDigitalClockContainer::getActiveScreenRows(int *firstActiveRow, int *lastActiveRow) +{ + if ( mClockContainer ) { + QRect clockRect( mClockContainer->pos().toPoint(), + mClockContainer->size().toSize() ); + if ( mCurrentOrientation == Qt::Vertical ) { + *firstActiveRow = clockRect.top(); + *lastActiveRow = clockRect.bottom() + 1; + } + else { + *firstActiveRow = clockRect.left(); + *lastActiveRow = clockRect.right() + 1; + } + } +} + +/*! + Orientation is locked in power save mode as sensors are off anyway, + at least after some timeout. + */ +bool SnsrOledDigitalClockContainer::isOrientationLocked() +{ + return true; +} + +void SnsrOledDigitalClockContainer::loadWidgets() +{ + // reset widget pointers, any previous widgets are already deleted by now + mMainView = 0; + mMainContainer = 0; + mClockContainer = 0; + mDateLabel = 0; + mTimeLabel = 0; + mAmPmLabel = 0; + mIndicatorWidget = 0; + + // load widgets from docml + bool ok(false); + qDebug() << gOledDigitalLayoutDocml; + mDocumentObjects = mDocumentLoader.load(gOledDigitalLayoutDocml, &ok); + Q_ASSERT_X(ok, gOledDigitalLayoutDocml, "Invalid DocML file."); + + if (ok) { + mMainView = mDocumentLoader.findWidget(gMainViewName); + mMainContainer = mDocumentLoader.findWidget(gMainContainerName); + mClockContainer = mDocumentLoader.findWidget(gClockContainerName); + mDateLabel = qobject_cast( + mDocumentLoader.findWidget(gDateLabelName)); + mTimeLabel = qobject_cast( + mDocumentLoader.findWidget(gOledTimeLabelName)); + mAmPmLabel = qobject_cast( + mDocumentLoader.findWidget(gAmPmLabelName)); + mIndicatorWidget = qobject_cast( + mDocumentLoader.findWidget(gIndicatorWidgetName)); + Q_ASSERT_X( + mMainView && mMainContainer && mClockContainer + && mDateLabel && mTimeLabel && mAmPmLabel + && mIndicatorWidget, + gOledDigitalLayoutDocml, "Objects not found in DocML file." + ); + + // In case of landscape layout, read also the landscape delta section + if ( mCurrentOrientation == Qt::Horizontal ) { + qDebug() << "loading: " << gOledDigitalLayoutDocml << ", section: " << gLandscapeSectionName; + mDocumentLoader.load(gOledDigitalLayoutDocml, gLandscapeSectionName, &ok); + Q_ASSERT_X(ok, gOledDigitalLayoutDocml, "Invalid section in DocML file."); + } + + mIndicatorWidget->setLayoutType(SnsrIndicatorWidget::IndicatorsCentered); + initIndicatorWidget(); + + mBackgroundContainerLayout->addItem(mMainView); + } +} + // end of file